testapi.c revision 1572425c2774b3fef6af062b87351a0e42c3e172
1/*
2 * testapi.c: libxml2 API tester program.
3 *
4 * Automatically generated by gentest.py from libxml2-api.xml
5 *
6 * See Copyright for the status of this software.
7 *
8 * daniel@veillard.com
9 */
10
11#ifdef HAVE_CONFIG_H
12#include "libxml.h"
13#else
14#include <stdio.h>
15#endif
16
17#include <stdlib.h> /* for putenv() */
18#include <string.h>
19#include <libxml/xmlerror.h>
20#include <libxml/relaxng.h>
21
22#if defined(_WIN32) && !defined(__CYGWIN__)
23#define snprintf _snprintf
24#endif
25
26static int testlibxml2(void);
27static int test_module(const char *module);
28
29static int generic_errors = 0;
30static int call_tests = 0;
31static int function_tests = 0;
32
33static xmlChar chartab[1024];
34static int inttab[1024];
35static unsigned long longtab[1024];
36
37static xmlDocPtr api_doc = NULL;
38static xmlDtdPtr api_dtd = NULL;
39static xmlNodePtr api_root = NULL;
40static xmlAttrPtr api_attr = NULL;
41static xmlNsPtr api_ns = NULL;
42
43static void
44structured_errors(void *userData ATTRIBUTE_UNUSED,
45                  xmlErrorPtr error ATTRIBUTE_UNUSED) {
46    generic_errors++;
47}
48
49static void
50free_api_doc(void) {
51    xmlFreeDoc(api_doc);
52    api_doc = NULL;
53    api_dtd = NULL;
54    api_root = NULL;
55    api_attr = NULL;
56    api_ns = NULL;
57}
58
59static xmlDocPtr
60get_api_doc(void) {
61    if (api_doc == NULL) {
62        api_doc = xmlReadMemory("<!DOCTYPE root [<!ELEMENT root EMPTY>]><root xmlns:h='http://example.com/' h:foo='bar'/>", 88, "root_test", NULL, 0);
63	api_root = NULL;
64	api_attr = NULL;
65    }
66    return(api_doc);
67}
68
69static xmlDtdPtr
70get_api_dtd(void) {
71    if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) {
72        get_api_doc();
73	if ((api_doc != NULL) && (api_doc->children != NULL) &&
74	    (api_doc->children->type == XML_DTD_NODE))
75	    api_dtd = (xmlDtdPtr) api_doc->children;
76    }
77    return(api_dtd);
78}
79
80static xmlNodePtr
81get_api_root(void) {
82    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
83        get_api_doc();
84	if ((api_doc != NULL) && (api_doc->children != NULL) &&
85	    (api_doc->children->next != NULL) &&
86	    (api_doc->children->next->type == XML_ELEMENT_NODE))
87	    api_root = api_doc->children->next;
88    }
89    return(api_root);
90}
91
92static xmlNsPtr
93get_api_ns(void) {
94    get_api_root();
95    if (api_root != NULL)
96        api_ns = api_root->nsDef;
97    return(api_ns);
98}
99
100static xmlAttrPtr
101get_api_attr(void) {
102#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
103    static int nr = 0;
104    xmlChar name[20];
105#endif
106
107    if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) {
108        get_api_root();
109    }
110    if (api_root == NULL)
111        return(NULL);
112    if (api_root->properties != NULL) {
113        api_attr = api_root->properties;
114        return(api_root->properties);
115    }
116    api_attr = NULL;
117#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
118    snprintf((char *) name, 20, "foo%d", nr++);
119    api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar");
120#endif
121    return(api_attr);
122}
123
124static int quiet = 0;
125
126int main(int argc, char **argv) {
127    int ret;
128    int blocks, mem;
129
130    /* access to the proxy can slow up regression tests a lot */
131    putenv((char *) "http_proxy=");
132
133    memset(chartab, 0, sizeof(chartab));
134    strncpy((char *) chartab, "  chartab\n", 20);
135    memset(inttab, 0, sizeof(inttab));
136    memset(longtab, 0, sizeof(longtab));
137
138    xmlInitParser();
139#ifdef LIBXML_SCHEMAS_ENABLED
140    xmlRelaxNGInitTypes();
141#endif
142
143    LIBXML_TEST_VERSION
144
145    xmlSetStructuredErrorFunc(NULL, structured_errors);
146
147    if (argc >= 2) {
148        if (!strcmp(argv[1], "-q")) {
149	    quiet = 1;
150	    if (argc >= 3)
151	        ret = test_module(argv[2]);
152	    else
153		ret = testlibxml2();
154        } else {
155	   ret = test_module(argv[1]);
156	}
157    } else
158	ret = testlibxml2();
159
160    xmlCleanupParser();
161    blocks = xmlMemBlocks();
162    mem = xmlMemUsed();
163    if ((blocks != 0) || (mem != 0)) {
164        printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
165    }
166    xmlMemoryDump();
167
168    return (ret != 0);
169}
170
171#include <libxml/HTMLparser.h>
172#include <libxml/HTMLtree.h>
173#include <libxml/catalog.h>
174#include <libxml/chvalid.h>
175#include <libxml/dict.h>
176#include <libxml/encoding.h>
177#include <libxml/entities.h>
178#include <libxml/hash.h>
179#include <libxml/list.h>
180#include <libxml/nanoftp.h>
181#include <libxml/nanohttp.h>
182#include <libxml/parser.h>
183#include <libxml/parserInternals.h>
184#include <libxml/pattern.h>
185#include <libxml/relaxng.h>
186#include <libxml/schemasInternals.h>
187#include <libxml/schematron.h>
188#include <libxml/tree.h>
189#include <libxml/uri.h>
190#include <libxml/valid.h>
191#include <libxml/xinclude.h>
192#include <libxml/xmlIO.h>
193#include <libxml/xmlerror.h>
194#include <libxml/xmlreader.h>
195#include <libxml/xmlsave.h>
196#include <libxml/xmlschemas.h>
197#include <libxml/xmlschemastypes.h>
198#include <libxml/xmlstring.h>
199#include <libxml/xmlwriter.h>
200#include <libxml/xpath.h>
201#include <libxml/xpointer.h>
202#include <libxml/debugXML.h>
203
204/*
205  We manually define xmlErrMemory because it's normal declaration
206  is "hidden" by #ifdef IN_LIBXML
207*/
208void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
209
210/*
211 We need some "remote" addresses, but want to avoid getting into
212 name resolution delays, so we use these
213*/
214#define	REMOTE1GOOD	"http://localhost/"
215#define	REMOTE1BAD	"http:http://http"
216#define	REMOTE2GOOD	"ftp://localhost/foo"
217
218#define gen_nb_void_ptr 2
219
220static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
221    return(NULL);
222}
223static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
224}
225
226#if 0
227#define gen_nb_const_void_ptr 2
228
229static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) {
230    if (no == 0) return((const void *) "immutable string");
231    return(NULL);
232}
233static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
234}
235#endif
236
237#define gen_nb_userdata 3
238
239static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) {
240    if (no == 0) return((void *) &call_tests);
241    if (no == 1) return((void *) -1);
242    return(NULL);
243}
244static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
245}
246
247
248#define gen_nb_int 4
249
250static int gen_int(int no, int nr ATTRIBUTE_UNUSED) {
251    if (no == 0) return(0);
252    if (no == 1) return(1);
253    if (no == 2) return(-1);
254    if (no == 3) return(122);
255    return(-1);
256}
257
258static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
259}
260
261#define gen_nb_parseroptions 5
262
263static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) {
264    if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER);
265    if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA);
266    if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN);
267    if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT);
268    return(XML_PARSE_SAX1);
269}
270
271static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
272}
273
274#if 0
275#define gen_nb_long 5
276
277static long gen_long(int no, int nr ATTRIBUTE_UNUSED) {
278    if (no == 0) return(0);
279    if (no == 1) return(1);
280    if (no == 2) return(-1);
281    if (no == 3) return(122);
282    return(-1);
283}
284
285static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
286}
287#endif
288
289#define gen_nb_xmlChar 4
290
291static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
292    if (no == 0) return('a');
293    if (no == 1) return(' ');
294    if (no == 2) return((xmlChar) '�');
295    return(0);
296}
297
298static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
299}
300
301#define gen_nb_unsigned_int 3
302
303static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) {
304    if (no == 0) return(0);
305    if (no == 1) return(1);
306    if (no == 2) return(122);
307    return((unsigned int) -1);
308}
309
310static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
311}
312
313#define gen_nb_unsigned_long 4
314
315static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) {
316    if (no == 0) return(0);
317    if (no == 1) return(1);
318    if (no == 2) return(122);
319    return((unsigned long) -1);
320}
321
322static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
323}
324
325#define gen_nb_double 4
326
327static double gen_double(int no, int nr ATTRIBUTE_UNUSED) {
328    if (no == 0) return(0);
329    if (no == 1) return(-1.1);
330#if defined(LIBXML_XPATH_ENABLED)
331    if (no == 2) return(xmlXPathNAN);
332#endif
333    return(-1);
334}
335
336static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
337}
338
339#define gen_nb_unsigned_long_ptr 2
340
341static unsigned long *gen_unsigned_long_ptr(int no, int nr) {
342    if (no == 0) return(&longtab[nr]);
343    return(NULL);
344}
345
346static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
347}
348
349#define gen_nb_int_ptr 2
350
351static int *gen_int_ptr(int no, int nr) {
352    if (no == 0) return(&inttab[nr]);
353    return(NULL);
354}
355
356static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
357}
358
359#define gen_nb_const_char_ptr 4
360
361static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) {
362    if (no == 0) return((char *) "foo");
363    if (no == 1) return((char *) "<foo/>");
364    if (no == 2) return((char *) "test/ent2");
365    return(NULL);
366}
367static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
368}
369
370#define gen_nb_xmlChar_ptr 2
371
372static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
373    if (no == 0) return(&chartab[0]);
374    return(NULL);
375}
376static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
377}
378
379#define gen_nb_FILE_ptr 2
380
381static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) {
382    if (no == 0) return(fopen("test.out", "a+"));
383    return(NULL);
384}
385static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
386    if (val != NULL) fclose(val);
387}
388
389#define gen_nb_debug_FILE_ptr 2
390static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
391    return(fopen("test.out", "a+"));
392}
393static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) {
394    if (val != NULL) fclose(val);
395}
396
397#define gen_nb_const_xmlChar_ptr 5
398
399static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) {
400    if (no == 0) return((xmlChar *) "foo");
401    if (no == 1) return((xmlChar *) "<foo/>");
402    if (no == 2) return((xmlChar *) "n�ne");
403    if (no == 3) return((xmlChar *) " 2ab ");
404    return(NULL);
405}
406static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
407}
408
409#define gen_nb_filepath 8
410
411static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) {
412    if (no == 0) return("missing.xml");
413    if (no == 1) return("<foo/>");
414    if (no == 2) return("test/ent2");
415    if (no == 3) return("test/valid/REC-xml-19980210.xml");
416    if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd");
417    if (no == 5) return(REMOTE1GOOD);
418    if (no == 6) return(REMOTE1BAD);
419    return(NULL);
420}
421static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
422}
423
424#define gen_nb_eaten_name 2
425
426static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) {
427    if (no == 0) return(xmlStrdup(BAD_CAST "eaten"));
428    return(NULL);
429}
430static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
431}
432
433#define gen_nb_fileoutput 6
434
435static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) {
436    if (no == 0) return("/missing.xml");
437    if (no == 1) return("<foo/>");
438    if (no == 2) return(REMOTE2GOOD);
439    if (no == 3) return(REMOTE1GOOD);
440    if (no == 4) return(REMOTE1BAD);
441    return(NULL);
442}
443static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
444}
445
446#define gen_nb_xmlParserCtxtPtr 3
447static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
448    if (no == 0) return(xmlNewParserCtxt());
449    if (no == 1) return(xmlCreateMemoryParserCtxt("<doc/>", 6));
450    return(NULL);
451}
452static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
453    if (val != NULL)
454        xmlFreeParserCtxt(val);
455}
456
457#define gen_nb_xmlSAXHandlerPtr 2
458static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) {
459#ifdef LIBXML_SAX1_ENABLED
460    if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler);
461#endif
462    return(NULL);
463}
464static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
465}
466
467#define gen_nb_xmlValidCtxtPtr 2
468static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
469#ifdef LIBXML_VALID_ENABLED
470    if (no == 0) return(xmlNewValidCtxt());
471#endif
472    return(NULL);
473}
474static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) {
475#ifdef LIBXML_VALID_ENABLED
476    if (val != NULL)
477        xmlFreeValidCtxt(val);
478#endif
479}
480
481#define gen_nb_xmlParserInputBufferPtr 8
482
483static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
484    if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE));
485    if (no == 1) return(xmlParserInputBufferCreateFilename("<foo/>", XML_CHAR_ENCODING_NONE));
486    if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE));
487    if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE));
488    if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE));
489    if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE));
490    if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE));
491    return(NULL);
492}
493static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
494    xmlFreeParserInputBuffer(val);
495}
496
497#define gen_nb_xmlDocPtr 4
498static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
499    if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
500    if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
501    if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
502    return(NULL);
503}
504static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
505    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
506        xmlFreeDoc(val);
507}
508
509#define gen_nb_xmlAttrPtr 2
510static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) {
511    if (no == 0) return(get_api_attr());
512    return(NULL);
513}
514static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
515    if (no == 0) free_api_doc();
516}
517
518#define gen_nb_xmlDictPtr 2
519static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) {
520    if (no == 0) return(xmlDictCreate());
521    return(NULL);
522}
523static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) {
524    if (val != NULL)
525        xmlDictFree(val);
526}
527
528#define gen_nb_xmlNodePtr 3
529static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
530    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
531    if (no == 1) return(get_api_root());
532    return(NULL);
533/*     if (no == 2) return((xmlNodePtr) get_api_doc()); */
534}
535static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
536    if (no == 1) {
537        free_api_doc();
538    } else if (val != NULL) {
539        xmlUnlinkNode(val);
540        xmlFreeNode(val);
541    }
542}
543
544#define gen_nb_xmlDtdPtr 3
545static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) {
546    if (no == 0)
547        return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar"));
548    if (no == 1) return(get_api_dtd());
549    return(NULL);
550}
551static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) {
552    if (no == 1) free_api_doc();
553    else if (val != NULL) {
554        xmlUnlinkNode((xmlNodePtr) val);
555        xmlFreeNode((xmlNodePtr) val);
556    }
557}
558
559#define gen_nb_xmlNsPtr 2
560static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) {
561    if (no == 0) return(get_api_ns());
562    return(NULL);
563}
564static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
565    if (no == 0) free_api_doc();
566}
567
568#define gen_nb_xmlNodePtr_in 3
569static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) {
570    if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL));
571    if (no == 0) return(xmlNewText(BAD_CAST "text"));
572    return(NULL);
573}
574static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
575}
576
577#ifdef LIBXML_WRITER_ENABLED
578#define gen_nb_xmlTextWriterPtr 2
579static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) {
580    if (no == 0) return(xmlNewTextWriterFilename("test.out", 0));
581    return(NULL);
582}
583static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) {
584    if (val != NULL) xmlFreeTextWriter(val);
585}
586#endif
587
588#ifdef LIBXML_READER_ENABLED
589#define gen_nb_xmlTextReaderPtr 4
590static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) {
591    if (no == 0) return(xmlNewTextReaderFilename("test/ent2"));
592    if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml"));
593    if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd"));
594    return(NULL);
595}
596static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) {
597    if (val != NULL) xmlFreeTextReader(val);
598}
599#endif
600
601#define gen_nb_xmlBufferPtr 3
602static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
603    if (no == 0) return(xmlBufferCreate());
604    if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13));
605    return(NULL);
606}
607static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
608    if (val != NULL) {
609        xmlBufferFree(val);
610    }
611}
612
613#define gen_nb_xmlListPtr 2
614static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
615    if (no == 0) return(xmlListCreate(NULL, NULL));
616    return(NULL);
617}
618static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
619    if (val != NULL) {
620        xmlListDelete(val);
621    }
622}
623
624#define gen_nb_xmlHashTablePtr 2
625static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
626    if (no == 0) return(xmlHashCreate(10));
627    return(NULL);
628}
629static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
630    if (val != NULL) {
631        xmlHashFree(val, NULL);
632    }
633}
634
635#include <libxml/xpathInternals.h>
636
637#ifdef LIBXML_XPATH_ENABLED
638#define gen_nb_xmlXPathObjectPtr 5
639static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
640    if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
641    if (no == 1) return(xmlXPathNewFloat(1.1));
642    if (no == 2) return(xmlXPathNewBoolean(1));
643    if (no == 3) return(xmlXPathNewNodeSet(NULL));
644    return(NULL);
645}
646static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
647    if (val != NULL) {
648        xmlXPathFreeObject(val);
649    }
650}
651#endif
652
653#ifdef LIBXML_OUTPUT_ENABLED
654#define gen_nb_xmlOutputBufferPtr 2
655static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
656    if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
657    return(NULL);
658}
659static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
660    if (val != NULL) {
661        xmlOutputBufferClose(val);
662    }
663}
664#endif
665
666#ifdef LIBXML_FTP_ENABLED
667#define gen_nb_xmlNanoFTPCtxtPtr 4
668static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
669    if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
670    if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
671    if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
672    return(NULL);
673}
674static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
675    if (val != NULL) {
676        xmlNanoFTPFreeCtxt(val);
677    }
678}
679#endif
680
681#ifdef LIBXML_HTTP_ENABLED
682#define gen_nb_xmlNanoHTTPCtxtPtr 1
683static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
684    if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
685    if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
686    if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
687    return(NULL);
688}
689static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
690    if (val != NULL) {
691	xmlNanoHTTPClose(val);
692    }
693}
694#endif
695
696#define gen_nb_xmlCharEncoding 4
697static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
698    if (no == 0) return(XML_CHAR_ENCODING_UTF8);
699    if (no == 1) return(XML_CHAR_ENCODING_NONE);
700    if (no == 2) return(XML_CHAR_ENCODING_8859_1);
701    return(XML_CHAR_ENCODING_ERROR);
702}
703static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
704}
705
706#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
707
708#define gen_nb_xmlExpCtxtPtr 1
709static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
710    return(NULL);
711}
712static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
713}
714
715#define gen_nb_xmlExpNodePtr 1
716static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
717    return(NULL);
718}
719static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
720}
721
722#endif
723
724#if defined(LIBXML_SCHEMAS_ENABLED)
725#define gen_nb_xmlSchemaPtr 1
726static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
727    return(NULL);
728}
729static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
730}
731
732#define gen_nb_xmlSchemaValidCtxtPtr 1
733static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
734    return(NULL);
735}
736static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
737}
738
739#endif /* LIBXML_SCHEMAS_ENABLED */
740
741#define gen_nb_xmlHashDeallocator 2
742static void
743test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
744}
745
746static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
747    if (no == 0) return(test_xmlHashDeallocator);
748    return(NULL);
749}
750static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
751}
752
753
754static void desret_int(int val ATTRIBUTE_UNUSED) {
755}
756static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
757}
758static void desret_long(long val ATTRIBUTE_UNUSED) {
759}
760static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
761}
762static void desret_double(double val ATTRIBUTE_UNUSED) {
763}
764static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
765}
766#if 0
767static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
768}
769#endif
770static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
771}
772static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
773}
774static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
775}
776static void desret_xmlChar_ptr(xmlChar *val) {
777    if (val != NULL)
778	xmlFree(val);
779}
780static void desret_xmlDocPtr(xmlDocPtr val) {
781    if (val != api_doc)
782	xmlFreeDoc(val);
783}
784static void desret_xmlDictPtr(xmlDictPtr val) {
785    xmlDictFree(val);
786}
787#ifdef LIBXML_OUTPUT_ENABLED
788static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
789    xmlOutputBufferClose(val);
790}
791#endif
792#ifdef LIBXML_READER_ENABLED
793static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
794    xmlFreeTextReader(val);
795}
796#endif
797static void desret_xmlNodePtr(xmlNodePtr val) {
798    if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
799	xmlUnlinkNode(val);
800	xmlFreeNode(val);
801    }
802}
803static void desret_xmlAttrPtr(xmlAttrPtr val) {
804    if (val != NULL) {
805	xmlUnlinkNode((xmlNodePtr) val);
806	xmlFreeNode((xmlNodePtr) val);
807    }
808}
809static void desret_xmlEntityPtr(xmlEntityPtr val) {
810    if (val != NULL) {
811	xmlUnlinkNode((xmlNodePtr) val);
812	xmlFreeNode((xmlNodePtr) val);
813    }
814}
815static void desret_xmlElementPtr(xmlElementPtr val) {
816    if (val != NULL) {
817	xmlUnlinkNode((xmlNodePtr) val);
818    }
819}
820static void desret_xmlAttributePtr(xmlAttributePtr val) {
821    if (val != NULL) {
822	xmlUnlinkNode((xmlNodePtr) val);
823    }
824}
825static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
826}
827static void desret_xmlDtdPtr(xmlDtdPtr val) {
828    desret_xmlNodePtr((xmlNodePtr)val);
829}
830#ifdef LIBXML_XPATH_ENABLED
831static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
832    xmlXPathFreeObject(val);
833}
834static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
835    xmlXPathFreeNodeSet(val);
836}
837#endif
838static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
839    xmlFreeParserCtxt(val);
840}
841static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
842    xmlFreeParserInputBuffer(val);
843}
844static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
845    xmlFreeInputStream(val);
846}
847#ifdef LIBXML_WRITER_ENABLED
848static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
849    xmlFreeTextWriter(val);
850}
851#endif
852static void desret_xmlBufferPtr(xmlBufferPtr val) {
853    xmlBufferFree(val);
854}
855#ifdef LIBXML_SCHEMAS_ENABLED
856static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
857    xmlSchemaFreeParserCtxt(val);
858}
859static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
860}
861static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
862    xmlRelaxNGFreeParserCtxt(val);
863}
864#endif
865#ifdef LIBXML_HTML_ENABLED
866static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
867}
868#endif
869#ifdef LIBXML_HTTP_ENABLED
870static void desret_xmlNanoHTTPCtxtPtr(void *val) {
871    xmlNanoHTTPClose(val);
872}
873#endif
874#ifdef LIBXML_FTP_ENABLED
875static void desret_xmlNanoFTPCtxtPtr(void *val) {
876    xmlNanoFTPClose(val);
877}
878#endif
879/* cut and pasted from autogenerated to avoid troubles */
880#define gen_nb_const_xmlChar_ptr_ptr 1
881static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
882    return(NULL);
883}
884static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
885}
886
887#define gen_nb_unsigned_char_ptr 1
888static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
889    return(NULL);
890}
891static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
892}
893
894#define gen_nb_const_unsigned_char_ptr 1
895static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
896    return(NULL);
897}
898static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
899}
900
901#ifdef LIBXML_HTML_ENABLED
902#define gen_nb_const_htmlNodePtr 1
903static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
904    return(NULL);
905}
906static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
907}
908#endif
909
910#ifdef LIBXML_HTML_ENABLED
911#define gen_nb_htmlDocPtr 3
912static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
913    if (no == 0) return(htmlNewDoc(NULL, NULL));
914    if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
915    return(NULL);
916}
917static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
918    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
919        xmlFreeDoc(val);
920}
921static void desret_htmlDocPtr(htmlDocPtr val) {
922    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
923        xmlFreeDoc(val);
924}
925#define gen_nb_htmlParserCtxtPtr 3
926static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
927    if (no == 0) return(xmlNewParserCtxt());
928    if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
929    return(NULL);
930}
931static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
932    if (val != NULL)
933        htmlFreeParserCtxt(val);
934}
935static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
936    if (val != NULL)
937        htmlFreeParserCtxt(val);
938}
939#endif
940
941#ifdef LIBXML_XPATH_ENABLED
942#define gen_nb_xmlNodeSetPtr 1
943static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
944    return(NULL);
945}
946static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
947}
948#endif
949
950#ifdef LIBXML_DEBUG_ENABLED
951#ifdef LIBXML_XPATH_ENABLED
952#define gen_nb_xmlShellCtxtPtr 1
953static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
954    return(NULL);
955}
956static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
957}
958#endif
959#endif
960
961#ifdef LIBXML_PATTERN_ENABLED
962#define gen_nb_xmlPatternPtr 1
963static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
964    return(NULL);
965}
966static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
967}
968#endif
969
970#define gen_nb_xmlElementContentPtr 1
971static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
972    return(NULL);
973}
974static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
975    if (val != NULL)
976        xmlFreeElementContent(val);
977}
978static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
979    if (val != NULL)
980        xmlFreeElementContent(val);
981}
982
983#define gen_nb_xmlParserNodeInfoSeqPtr 1
984static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
985    return(NULL);
986}
987static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
988}
989
990static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
991}
992
993/************************************************************************
994 *									*
995 *   WARNING: end of the manually maintained part of the test code	*
996 *            do not remove or alter the CUT HERE line			*
997 *									*
998 ************************************************************************/
999
1000/* CUT HERE: everything below that line is generated */
1001#ifdef LIBXML_HTML_ENABLED
1002static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1003}
1004
1005#endif
1006
1007#define gen_nb_xmlAttributeDefault 4
1008static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1009    if (no == 1) return(XML_ATTRIBUTE_FIXED);
1010    if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1011    if (no == 3) return(XML_ATTRIBUTE_NONE);
1012    if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1013    return(0);
1014}
1015
1016static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1017}
1018
1019#define gen_nb_xmlAttributeType 4
1020static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1021    if (no == 1) return(XML_ATTRIBUTE_CDATA);
1022    if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1023    if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1024    if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1025    return(0);
1026}
1027
1028static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1029}
1030
1031#define gen_nb_xmlBufferAllocationScheme 4
1032static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1033    if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1034    if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1035    if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
1036    if (no == 4) return(XML_BUFFER_ALLOC_IO);
1037    return(0);
1038}
1039
1040static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1041}
1042
1043static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1044}
1045
1046#ifdef LIBXML_CATALOG_ENABLED
1047#define gen_nb_xmlCatalogAllow 4
1048static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1049    if (no == 1) return(XML_CATA_ALLOW_ALL);
1050    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1051    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1052    if (no == 4) return(XML_CATA_ALLOW_NONE);
1053    return(0);
1054}
1055
1056static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1057}
1058
1059static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1060}
1061
1062#endif
1063
1064#ifdef LIBXML_CATALOG_ENABLED
1065#define gen_nb_xmlCatalogPrefer 3
1066static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1067    if (no == 1) return(XML_CATA_PREFER_NONE);
1068    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1069    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1070    return(0);
1071}
1072
1073static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1074}
1075
1076static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1077}
1078
1079#endif
1080
1081#define gen_nb_xmlElementContentType 4
1082static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1083    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1084    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1085    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1086    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1087    return(0);
1088}
1089
1090static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1091}
1092
1093#define gen_nb_xmlElementTypeVal 4
1094static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1095    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1096    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1097    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1098    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1099    return(0);
1100}
1101
1102static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1103}
1104
1105#define gen_nb_xmlFeature 4
1106static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1107    if (no == 1) return(XML_WITH_AUTOMATA);
1108    if (no == 2) return(XML_WITH_C14N);
1109    if (no == 3) return(XML_WITH_CATALOG);
1110    if (no == 4) return(XML_WITH_DEBUG);
1111    return(0);
1112}
1113
1114static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1115}
1116
1117static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1118}
1119
1120#ifdef LIBXML_SCHEMAS_ENABLED
1121#define gen_nb_xmlSchemaValType 4
1122static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1123    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1124    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1125    if (no == 3) return(XML_SCHEMAS_ANYURI);
1126    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1127    return(0);
1128}
1129
1130static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1131}
1132
1133static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1134}
1135
1136#endif
1137
1138#ifdef LIBXML_SCHEMAS_ENABLED
1139#define gen_nb_xmlSchemaWhitespaceValueType 4
1140static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1141    if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1142    if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1143    if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1144    if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1145    return(0);
1146}
1147
1148static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1149}
1150
1151#endif
1152
1153#include <libxml/HTMLparser.h>
1154#include <libxml/HTMLtree.h>
1155#include <libxml/SAX2.h>
1156#include <libxml/c14n.h>
1157#include <libxml/catalog.h>
1158#include <libxml/chvalid.h>
1159#include <libxml/debugXML.h>
1160#include <libxml/dict.h>
1161#include <libxml/encoding.h>
1162#include <libxml/entities.h>
1163#include <libxml/hash.h>
1164#include <libxml/list.h>
1165#include <libxml/nanoftp.h>
1166#include <libxml/nanohttp.h>
1167#include <libxml/parser.h>
1168#include <libxml/parserInternals.h>
1169#include <libxml/pattern.h>
1170#include <libxml/relaxng.h>
1171#include <libxml/schemasInternals.h>
1172#include <libxml/schematron.h>
1173#include <libxml/tree.h>
1174#include <libxml/uri.h>
1175#include <libxml/valid.h>
1176#include <libxml/xinclude.h>
1177#include <libxml/xmlIO.h>
1178#include <libxml/xmlautomata.h>
1179#include <libxml/xmlerror.h>
1180#include <libxml/xmlmodule.h>
1181#include <libxml/xmlreader.h>
1182#include <libxml/xmlregexp.h>
1183#include <libxml/xmlsave.h>
1184#include <libxml/xmlschemas.h>
1185#include <libxml/xmlschemastypes.h>
1186#include <libxml/xmlstring.h>
1187#include <libxml/xmlunicode.h>
1188#include <libxml/xmlwriter.h>
1189#include <libxml/xpath.h>
1190#include <libxml/xpathInternals.h>
1191#include <libxml/xpointer.h>
1192static int test_HTMLparser(void);
1193static int test_HTMLtree(void);
1194static int test_SAX2(void);
1195static int test_c14n(void);
1196static int test_catalog(void);
1197static int test_chvalid(void);
1198static int test_debugXML(void);
1199static int test_dict(void);
1200static int test_encoding(void);
1201static int test_entities(void);
1202static int test_hash(void);
1203static int test_list(void);
1204static int test_nanoftp(void);
1205static int test_nanohttp(void);
1206static int test_parser(void);
1207static int test_parserInternals(void);
1208static int test_pattern(void);
1209static int test_relaxng(void);
1210static int test_schemasInternals(void);
1211static int test_schematron(void);
1212static int test_tree(void);
1213static int test_uri(void);
1214static int test_valid(void);
1215static int test_xinclude(void);
1216static int test_xmlIO(void);
1217static int test_xmlautomata(void);
1218static int test_xmlerror(void);
1219static int test_xmlmodule(void);
1220static int test_xmlreader(void);
1221static int test_xmlregexp(void);
1222static int test_xmlsave(void);
1223static int test_xmlschemas(void);
1224static int test_xmlschemastypes(void);
1225static int test_xmlstring(void);
1226static int test_xmlunicode(void);
1227static int test_xmlwriter(void);
1228static int test_xpath(void);
1229static int test_xpathInternals(void);
1230static int test_xpointer(void);
1231
1232/**
1233 * testlibxml2:
1234 *
1235 * Main entry point of the tester for the full libxml2 module,
1236 * it calls all the tester entry point for each module.
1237 *
1238 * Returns the number of error found
1239 */
1240static int
1241testlibxml2(void)
1242{
1243    int test_ret = 0;
1244
1245    test_ret += test_HTMLparser();
1246    test_ret += test_HTMLtree();
1247    test_ret += test_SAX2();
1248    test_ret += test_c14n();
1249    test_ret += test_catalog();
1250    test_ret += test_chvalid();
1251    test_ret += test_debugXML();
1252    test_ret += test_dict();
1253    test_ret += test_encoding();
1254    test_ret += test_entities();
1255    test_ret += test_hash();
1256    test_ret += test_list();
1257    test_ret += test_nanoftp();
1258    test_ret += test_nanohttp();
1259    test_ret += test_parser();
1260    test_ret += test_parserInternals();
1261    test_ret += test_pattern();
1262    test_ret += test_relaxng();
1263    test_ret += test_schemasInternals();
1264    test_ret += test_schematron();
1265    test_ret += test_tree();
1266    test_ret += test_uri();
1267    test_ret += test_valid();
1268    test_ret += test_xinclude();
1269    test_ret += test_xmlIO();
1270    test_ret += test_xmlautomata();
1271    test_ret += test_xmlerror();
1272    test_ret += test_xmlmodule();
1273    test_ret += test_xmlreader();
1274    test_ret += test_xmlregexp();
1275    test_ret += test_xmlsave();
1276    test_ret += test_xmlschemas();
1277    test_ret += test_xmlschemastypes();
1278    test_ret += test_xmlstring();
1279    test_ret += test_xmlunicode();
1280    test_ret += test_xmlwriter();
1281    test_ret += test_xpath();
1282    test_ret += test_xpathInternals();
1283    test_ret += test_xpointer();
1284
1285    printf("Total: %d functions, %d tests, %d errors\n",
1286           function_tests, call_tests, test_ret);
1287    return(test_ret);
1288}
1289
1290
1291static int
1292test_UTF8ToHtml(void) {
1293    int test_ret = 0;
1294
1295#if defined(LIBXML_HTML_ENABLED)
1296    int mem_base;
1297    int ret_val;
1298    unsigned char * out; /* a pointer to an array of bytes to store the result */
1299    int n_out;
1300    int * outlen; /* the length of @out */
1301    int n_outlen;
1302    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1303    int n_in;
1304    int * inlen; /* the length of @in */
1305    int n_inlen;
1306
1307    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1308    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1309    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1310    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1311        mem_base = xmlMemBlocks();
1312        out = gen_unsigned_char_ptr(n_out, 0);
1313        outlen = gen_int_ptr(n_outlen, 1);
1314        in = gen_const_unsigned_char_ptr(n_in, 2);
1315        inlen = gen_int_ptr(n_inlen, 3);
1316
1317        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1318        desret_int(ret_val);
1319        call_tests++;
1320        des_unsigned_char_ptr(n_out, out, 0);
1321        des_int_ptr(n_outlen, outlen, 1);
1322        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1323        des_int_ptr(n_inlen, inlen, 3);
1324        xmlResetLastError();
1325        if (mem_base != xmlMemBlocks()) {
1326            printf("Leak of %d blocks found in UTF8ToHtml",
1327	           xmlMemBlocks() - mem_base);
1328	    test_ret++;
1329            printf(" %d", n_out);
1330            printf(" %d", n_outlen);
1331            printf(" %d", n_in);
1332            printf(" %d", n_inlen);
1333            printf("\n");
1334        }
1335    }
1336    }
1337    }
1338    }
1339    function_tests++;
1340#endif
1341
1342    return(test_ret);
1343}
1344
1345#ifdef LIBXML_HTML_ENABLED
1346
1347#define gen_nb_const_htmlElemDesc_ptr 1
1348static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1349    return(NULL);
1350}
1351static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1352}
1353#endif
1354
1355
1356static int
1357test_htmlAttrAllowed(void) {
1358    int test_ret = 0;
1359
1360#if defined(LIBXML_HTML_ENABLED)
1361    int mem_base;
1362    htmlStatus ret_val;
1363    htmlElemDesc * elt; /* HTML element */
1364    int n_elt;
1365    xmlChar * attr; /* HTML attribute */
1366    int n_attr;
1367    int legacy; /* whether to allow deprecated attributes */
1368    int n_legacy;
1369
1370    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1371    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1372    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1373        mem_base = xmlMemBlocks();
1374        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1375        attr = gen_const_xmlChar_ptr(n_attr, 1);
1376        legacy = gen_int(n_legacy, 2);
1377
1378        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1379        desret_htmlStatus(ret_val);
1380        call_tests++;
1381        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1382        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1383        des_int(n_legacy, legacy, 2);
1384        xmlResetLastError();
1385        if (mem_base != xmlMemBlocks()) {
1386            printf("Leak of %d blocks found in htmlAttrAllowed",
1387	           xmlMemBlocks() - mem_base);
1388	    test_ret++;
1389            printf(" %d", n_elt);
1390            printf(" %d", n_attr);
1391            printf(" %d", n_legacy);
1392            printf("\n");
1393        }
1394    }
1395    }
1396    }
1397    function_tests++;
1398#endif
1399
1400    return(test_ret);
1401}
1402
1403#ifdef LIBXML_HTML_ENABLED
1404
1405#define gen_nb_htmlNodePtr 1
1406static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1407    return(NULL);
1408}
1409static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1410}
1411#endif
1412
1413
1414static int
1415test_htmlAutoCloseTag(void) {
1416    int test_ret = 0;
1417
1418#if defined(LIBXML_HTML_ENABLED)
1419    int mem_base;
1420    int ret_val;
1421    htmlDocPtr doc; /* the HTML document */
1422    int n_doc;
1423    xmlChar * name; /* The tag name */
1424    int n_name;
1425    htmlNodePtr elem; /* the HTML element */
1426    int n_elem;
1427
1428    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1429    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1430    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1431        mem_base = xmlMemBlocks();
1432        doc = gen_htmlDocPtr(n_doc, 0);
1433        name = gen_const_xmlChar_ptr(n_name, 1);
1434        elem = gen_htmlNodePtr(n_elem, 2);
1435
1436        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1437        desret_int(ret_val);
1438        call_tests++;
1439        des_htmlDocPtr(n_doc, doc, 0);
1440        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1441        des_htmlNodePtr(n_elem, elem, 2);
1442        xmlResetLastError();
1443        if (mem_base != xmlMemBlocks()) {
1444            printf("Leak of %d blocks found in htmlAutoCloseTag",
1445	           xmlMemBlocks() - mem_base);
1446	    test_ret++;
1447            printf(" %d", n_doc);
1448            printf(" %d", n_name);
1449            printf(" %d", n_elem);
1450            printf("\n");
1451        }
1452    }
1453    }
1454    }
1455    function_tests++;
1456#endif
1457
1458    return(test_ret);
1459}
1460
1461
1462static int
1463test_htmlCreateMemoryParserCtxt(void) {
1464    int test_ret = 0;
1465
1466#if defined(LIBXML_HTML_ENABLED)
1467    int mem_base;
1468    htmlParserCtxtPtr ret_val;
1469    char * buffer; /* a pointer to a char array */
1470    int n_buffer;
1471    int size; /* the size of the array */
1472    int n_size;
1473
1474    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1475    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1476        mem_base = xmlMemBlocks();
1477        buffer = gen_const_char_ptr(n_buffer, 0);
1478        size = gen_int(n_size, 1);
1479
1480        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1481        desret_htmlParserCtxtPtr(ret_val);
1482        call_tests++;
1483        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1484        des_int(n_size, size, 1);
1485        xmlResetLastError();
1486        if (mem_base != xmlMemBlocks()) {
1487            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1488	           xmlMemBlocks() - mem_base);
1489	    test_ret++;
1490            printf(" %d", n_buffer);
1491            printf(" %d", n_size);
1492            printf("\n");
1493        }
1494    }
1495    }
1496    function_tests++;
1497#endif
1498
1499    return(test_ret);
1500}
1501
1502#ifdef LIBXML_HTML_ENABLED
1503
1504#define gen_nb_htmlSAXHandlerPtr 1
1505static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1506    return(NULL);
1507}
1508static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1509}
1510#endif
1511
1512
1513static int
1514test_htmlCreatePushParserCtxt(void) {
1515    int test_ret = 0;
1516
1517#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1518    int mem_base;
1519    htmlParserCtxtPtr ret_val;
1520    htmlSAXHandlerPtr sax; /* a SAX handler */
1521    int n_sax;
1522    void * user_data; /* The user data returned on SAX callbacks */
1523    int n_user_data;
1524    char * chunk; /* a pointer to an array of chars */
1525    int n_chunk;
1526    int size; /* number of chars in the array */
1527    int n_size;
1528    const char * filename; /* an optional file name or URI */
1529    int n_filename;
1530    xmlCharEncoding enc; /* an optional encoding */
1531    int n_enc;
1532
1533    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1534    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1535    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1536    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1537    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1538    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1539        mem_base = xmlMemBlocks();
1540        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1541        user_data = gen_userdata(n_user_data, 1);
1542        chunk = gen_const_char_ptr(n_chunk, 2);
1543        size = gen_int(n_size, 3);
1544        filename = gen_fileoutput(n_filename, 4);
1545        enc = gen_xmlCharEncoding(n_enc, 5);
1546
1547        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1548        desret_htmlParserCtxtPtr(ret_val);
1549        call_tests++;
1550        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1551        des_userdata(n_user_data, user_data, 1);
1552        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1553        des_int(n_size, size, 3);
1554        des_fileoutput(n_filename, filename, 4);
1555        des_xmlCharEncoding(n_enc, enc, 5);
1556        xmlResetLastError();
1557        if (mem_base != xmlMemBlocks()) {
1558            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1559	           xmlMemBlocks() - mem_base);
1560	    test_ret++;
1561            printf(" %d", n_sax);
1562            printf(" %d", n_user_data);
1563            printf(" %d", n_chunk);
1564            printf(" %d", n_size);
1565            printf(" %d", n_filename);
1566            printf(" %d", n_enc);
1567            printf("\n");
1568        }
1569    }
1570    }
1571    }
1572    }
1573    }
1574    }
1575    function_tests++;
1576#endif
1577
1578    return(test_ret);
1579}
1580
1581
1582static int
1583test_htmlCtxtReadDoc(void) {
1584    int test_ret = 0;
1585
1586#if defined(LIBXML_HTML_ENABLED)
1587    int mem_base;
1588    htmlDocPtr ret_val;
1589    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1590    int n_ctxt;
1591    xmlChar * cur; /* a pointer to a zero terminated string */
1592    int n_cur;
1593    const char * URL; /* the base URL to use for the document */
1594    int n_URL;
1595    char * encoding; /* the document encoding, or NULL */
1596    int n_encoding;
1597    int options; /* a combination of htmlParserOption(s) */
1598    int n_options;
1599
1600    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1601    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1602    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1603    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1604    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1605        mem_base = xmlMemBlocks();
1606        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1607        cur = gen_const_xmlChar_ptr(n_cur, 1);
1608        URL = gen_filepath(n_URL, 2);
1609        encoding = gen_const_char_ptr(n_encoding, 3);
1610        options = gen_int(n_options, 4);
1611
1612        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1613        desret_htmlDocPtr(ret_val);
1614        call_tests++;
1615        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1616        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1617        des_filepath(n_URL, URL, 2);
1618        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1619        des_int(n_options, options, 4);
1620        xmlResetLastError();
1621        if (mem_base != xmlMemBlocks()) {
1622            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1623	           xmlMemBlocks() - mem_base);
1624	    test_ret++;
1625            printf(" %d", n_ctxt);
1626            printf(" %d", n_cur);
1627            printf(" %d", n_URL);
1628            printf(" %d", n_encoding);
1629            printf(" %d", n_options);
1630            printf("\n");
1631        }
1632    }
1633    }
1634    }
1635    }
1636    }
1637    function_tests++;
1638#endif
1639
1640    return(test_ret);
1641}
1642
1643
1644static int
1645test_htmlCtxtReadFile(void) {
1646    int test_ret = 0;
1647
1648#if defined(LIBXML_HTML_ENABLED)
1649    htmlDocPtr ret_val;
1650    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1651    int n_ctxt;
1652    const char * filename; /* a file or URL */
1653    int n_filename;
1654    char * encoding; /* the document encoding, or NULL */
1655    int n_encoding;
1656    int options; /* a combination of htmlParserOption(s) */
1657    int n_options;
1658
1659    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1660    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1661    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1662    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1663        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1664        filename = gen_filepath(n_filename, 1);
1665        encoding = gen_const_char_ptr(n_encoding, 2);
1666        options = gen_int(n_options, 3);
1667
1668        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1669        desret_htmlDocPtr(ret_val);
1670        call_tests++;
1671        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1672        des_filepath(n_filename, filename, 1);
1673        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1674        des_int(n_options, options, 3);
1675        xmlResetLastError();
1676    }
1677    }
1678    }
1679    }
1680    function_tests++;
1681#endif
1682
1683    return(test_ret);
1684}
1685
1686
1687static int
1688test_htmlCtxtReadMemory(void) {
1689    int test_ret = 0;
1690
1691#if defined(LIBXML_HTML_ENABLED)
1692    int mem_base;
1693    htmlDocPtr ret_val;
1694    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1695    int n_ctxt;
1696    char * buffer; /* a pointer to a char array */
1697    int n_buffer;
1698    int size; /* the size of the array */
1699    int n_size;
1700    const char * URL; /* the base URL to use for the document */
1701    int n_URL;
1702    char * encoding; /* the document encoding, or NULL */
1703    int n_encoding;
1704    int options; /* a combination of htmlParserOption(s) */
1705    int n_options;
1706
1707    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1708    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1709    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1710    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1711    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1712    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1713        mem_base = xmlMemBlocks();
1714        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1715        buffer = gen_const_char_ptr(n_buffer, 1);
1716        size = gen_int(n_size, 2);
1717        URL = gen_filepath(n_URL, 3);
1718        encoding = gen_const_char_ptr(n_encoding, 4);
1719        options = gen_int(n_options, 5);
1720
1721        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1722        desret_htmlDocPtr(ret_val);
1723        call_tests++;
1724        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1725        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1726        des_int(n_size, size, 2);
1727        des_filepath(n_URL, URL, 3);
1728        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1729        des_int(n_options, options, 5);
1730        xmlResetLastError();
1731        if (mem_base != xmlMemBlocks()) {
1732            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1733	           xmlMemBlocks() - mem_base);
1734	    test_ret++;
1735            printf(" %d", n_ctxt);
1736            printf(" %d", n_buffer);
1737            printf(" %d", n_size);
1738            printf(" %d", n_URL);
1739            printf(" %d", n_encoding);
1740            printf(" %d", n_options);
1741            printf("\n");
1742        }
1743    }
1744    }
1745    }
1746    }
1747    }
1748    }
1749    function_tests++;
1750#endif
1751
1752    return(test_ret);
1753}
1754
1755
1756static int
1757test_htmlCtxtReset(void) {
1758    int test_ret = 0;
1759
1760#if defined(LIBXML_HTML_ENABLED)
1761    int mem_base;
1762    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1763    int n_ctxt;
1764
1765    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1766        mem_base = xmlMemBlocks();
1767        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1768
1769        htmlCtxtReset(ctxt);
1770        call_tests++;
1771        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1772        xmlResetLastError();
1773        if (mem_base != xmlMemBlocks()) {
1774            printf("Leak of %d blocks found in htmlCtxtReset",
1775	           xmlMemBlocks() - mem_base);
1776	    test_ret++;
1777            printf(" %d", n_ctxt);
1778            printf("\n");
1779        }
1780    }
1781    function_tests++;
1782#endif
1783
1784    return(test_ret);
1785}
1786
1787
1788static int
1789test_htmlCtxtUseOptions(void) {
1790    int test_ret = 0;
1791
1792#if defined(LIBXML_HTML_ENABLED)
1793    int mem_base;
1794    int ret_val;
1795    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1796    int n_ctxt;
1797    int options; /* a combination of htmlParserOption(s) */
1798    int n_options;
1799
1800    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1801    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1802        mem_base = xmlMemBlocks();
1803        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1804        options = gen_int(n_options, 1);
1805
1806        ret_val = htmlCtxtUseOptions(ctxt, options);
1807        desret_int(ret_val);
1808        call_tests++;
1809        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1810        des_int(n_options, options, 1);
1811        xmlResetLastError();
1812        if (mem_base != xmlMemBlocks()) {
1813            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1814	           xmlMemBlocks() - mem_base);
1815	    test_ret++;
1816            printf(" %d", n_ctxt);
1817            printf(" %d", n_options);
1818            printf("\n");
1819        }
1820    }
1821    }
1822    function_tests++;
1823#endif
1824
1825    return(test_ret);
1826}
1827
1828
1829static int
1830test_htmlElementAllowedHere(void) {
1831    int test_ret = 0;
1832
1833#if defined(LIBXML_HTML_ENABLED)
1834    int mem_base;
1835    int ret_val;
1836    htmlElemDesc * parent; /* HTML parent element */
1837    int n_parent;
1838    xmlChar * elt; /* HTML element */
1839    int n_elt;
1840
1841    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1842    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1843        mem_base = xmlMemBlocks();
1844        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1845        elt = gen_const_xmlChar_ptr(n_elt, 1);
1846
1847        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1848        desret_int(ret_val);
1849        call_tests++;
1850        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1851        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1852        xmlResetLastError();
1853        if (mem_base != xmlMemBlocks()) {
1854            printf("Leak of %d blocks found in htmlElementAllowedHere",
1855	           xmlMemBlocks() - mem_base);
1856	    test_ret++;
1857            printf(" %d", n_parent);
1858            printf(" %d", n_elt);
1859            printf("\n");
1860        }
1861    }
1862    }
1863    function_tests++;
1864#endif
1865
1866    return(test_ret);
1867}
1868
1869
1870static int
1871test_htmlElementStatusHere(void) {
1872    int test_ret = 0;
1873
1874#if defined(LIBXML_HTML_ENABLED)
1875    int mem_base;
1876    htmlStatus ret_val;
1877    htmlElemDesc * parent; /* HTML parent element */
1878    int n_parent;
1879    htmlElemDesc * elt; /* HTML element */
1880    int n_elt;
1881
1882    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1883    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1884        mem_base = xmlMemBlocks();
1885        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1886        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1887
1888        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1889        desret_htmlStatus(ret_val);
1890        call_tests++;
1891        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1892        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1893        xmlResetLastError();
1894        if (mem_base != xmlMemBlocks()) {
1895            printf("Leak of %d blocks found in htmlElementStatusHere",
1896	           xmlMemBlocks() - mem_base);
1897	    test_ret++;
1898            printf(" %d", n_parent);
1899            printf(" %d", n_elt);
1900            printf("\n");
1901        }
1902    }
1903    }
1904    function_tests++;
1905#endif
1906
1907    return(test_ret);
1908}
1909
1910
1911static int
1912test_htmlEncodeEntities(void) {
1913    int test_ret = 0;
1914
1915#if defined(LIBXML_HTML_ENABLED)
1916    int mem_base;
1917    int ret_val;
1918    unsigned char * out; /* a pointer to an array of bytes to store the result */
1919    int n_out;
1920    int * outlen; /* the length of @out */
1921    int n_outlen;
1922    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1923    int n_in;
1924    int * inlen; /* the length of @in */
1925    int n_inlen;
1926    int quoteChar; /* the quote character to escape (' or ") or zero. */
1927    int n_quoteChar;
1928
1929    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1930    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1931    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1932    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1933    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1934        mem_base = xmlMemBlocks();
1935        out = gen_unsigned_char_ptr(n_out, 0);
1936        outlen = gen_int_ptr(n_outlen, 1);
1937        in = gen_const_unsigned_char_ptr(n_in, 2);
1938        inlen = gen_int_ptr(n_inlen, 3);
1939        quoteChar = gen_int(n_quoteChar, 4);
1940
1941        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1942        desret_int(ret_val);
1943        call_tests++;
1944        des_unsigned_char_ptr(n_out, out, 0);
1945        des_int_ptr(n_outlen, outlen, 1);
1946        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1947        des_int_ptr(n_inlen, inlen, 3);
1948        des_int(n_quoteChar, quoteChar, 4);
1949        xmlResetLastError();
1950        if (mem_base != xmlMemBlocks()) {
1951            printf("Leak of %d blocks found in htmlEncodeEntities",
1952	           xmlMemBlocks() - mem_base);
1953	    test_ret++;
1954            printf(" %d", n_out);
1955            printf(" %d", n_outlen);
1956            printf(" %d", n_in);
1957            printf(" %d", n_inlen);
1958            printf(" %d", n_quoteChar);
1959            printf("\n");
1960        }
1961    }
1962    }
1963    }
1964    }
1965    }
1966    function_tests++;
1967#endif
1968
1969    return(test_ret);
1970}
1971
1972
1973static int
1974test_htmlEntityLookup(void) {
1975    int test_ret = 0;
1976
1977#if defined(LIBXML_HTML_ENABLED)
1978    int mem_base;
1979    const htmlEntityDesc * ret_val;
1980    xmlChar * name; /* the entity name */
1981    int n_name;
1982
1983    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1984        mem_base = xmlMemBlocks();
1985        name = gen_const_xmlChar_ptr(n_name, 0);
1986
1987        ret_val = htmlEntityLookup((const xmlChar *)name);
1988        desret_const_htmlEntityDesc_ptr(ret_val);
1989        call_tests++;
1990        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1991        xmlResetLastError();
1992        if (mem_base != xmlMemBlocks()) {
1993            printf("Leak of %d blocks found in htmlEntityLookup",
1994	           xmlMemBlocks() - mem_base);
1995	    test_ret++;
1996            printf(" %d", n_name);
1997            printf("\n");
1998        }
1999    }
2000    function_tests++;
2001#endif
2002
2003    return(test_ret);
2004}
2005
2006
2007static int
2008test_htmlEntityValueLookup(void) {
2009    int test_ret = 0;
2010
2011#if defined(LIBXML_HTML_ENABLED)
2012    int mem_base;
2013    const htmlEntityDesc * ret_val;
2014    unsigned int value; /* the entity's unicode value */
2015    int n_value;
2016
2017    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2018        mem_base = xmlMemBlocks();
2019        value = gen_unsigned_int(n_value, 0);
2020
2021        ret_val = htmlEntityValueLookup(value);
2022        desret_const_htmlEntityDesc_ptr(ret_val);
2023        call_tests++;
2024        des_unsigned_int(n_value, value, 0);
2025        xmlResetLastError();
2026        if (mem_base != xmlMemBlocks()) {
2027            printf("Leak of %d blocks found in htmlEntityValueLookup",
2028	           xmlMemBlocks() - mem_base);
2029	    test_ret++;
2030            printf(" %d", n_value);
2031            printf("\n");
2032        }
2033    }
2034    function_tests++;
2035#endif
2036
2037    return(test_ret);
2038}
2039
2040
2041static int
2042test_htmlHandleOmittedElem(void) {
2043    int test_ret = 0;
2044
2045#if defined(LIBXML_HTML_ENABLED)
2046    int mem_base;
2047    int ret_val;
2048    int val; /* int 0 or 1 */
2049    int n_val;
2050
2051    for (n_val = 0;n_val < gen_nb_int;n_val++) {
2052        mem_base = xmlMemBlocks();
2053        val = gen_int(n_val, 0);
2054
2055        ret_val = htmlHandleOmittedElem(val);
2056        desret_int(ret_val);
2057        call_tests++;
2058        des_int(n_val, val, 0);
2059        xmlResetLastError();
2060        if (mem_base != xmlMemBlocks()) {
2061            printf("Leak of %d blocks found in htmlHandleOmittedElem",
2062	           xmlMemBlocks() - mem_base);
2063	    test_ret++;
2064            printf(" %d", n_val);
2065            printf("\n");
2066        }
2067    }
2068    function_tests++;
2069#endif
2070
2071    return(test_ret);
2072}
2073
2074
2075static int
2076test_htmlIsAutoClosed(void) {
2077    int test_ret = 0;
2078
2079#if defined(LIBXML_HTML_ENABLED)
2080    int mem_base;
2081    int ret_val;
2082    htmlDocPtr doc; /* the HTML document */
2083    int n_doc;
2084    htmlNodePtr elem; /* the HTML element */
2085    int n_elem;
2086
2087    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2088    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2089        mem_base = xmlMemBlocks();
2090        doc = gen_htmlDocPtr(n_doc, 0);
2091        elem = gen_htmlNodePtr(n_elem, 1);
2092
2093        ret_val = htmlIsAutoClosed(doc, elem);
2094        desret_int(ret_val);
2095        call_tests++;
2096        des_htmlDocPtr(n_doc, doc, 0);
2097        des_htmlNodePtr(n_elem, elem, 1);
2098        xmlResetLastError();
2099        if (mem_base != xmlMemBlocks()) {
2100            printf("Leak of %d blocks found in htmlIsAutoClosed",
2101	           xmlMemBlocks() - mem_base);
2102	    test_ret++;
2103            printf(" %d", n_doc);
2104            printf(" %d", n_elem);
2105            printf("\n");
2106        }
2107    }
2108    }
2109    function_tests++;
2110#endif
2111
2112    return(test_ret);
2113}
2114
2115
2116static int
2117test_htmlIsScriptAttribute(void) {
2118    int test_ret = 0;
2119
2120#if defined(LIBXML_HTML_ENABLED)
2121    int mem_base;
2122    int ret_val;
2123    xmlChar * name; /* an attribute name */
2124    int n_name;
2125
2126    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2127        mem_base = xmlMemBlocks();
2128        name = gen_const_xmlChar_ptr(n_name, 0);
2129
2130        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2131        desret_int(ret_val);
2132        call_tests++;
2133        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2134        xmlResetLastError();
2135        if (mem_base != xmlMemBlocks()) {
2136            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2137	           xmlMemBlocks() - mem_base);
2138	    test_ret++;
2139            printf(" %d", n_name);
2140            printf("\n");
2141        }
2142    }
2143    function_tests++;
2144#endif
2145
2146    return(test_ret);
2147}
2148
2149
2150static int
2151test_htmlNewParserCtxt(void) {
2152    int test_ret = 0;
2153
2154#if defined(LIBXML_HTML_ENABLED)
2155    int mem_base;
2156    htmlParserCtxtPtr ret_val;
2157
2158        mem_base = xmlMemBlocks();
2159
2160        ret_val = htmlNewParserCtxt();
2161        desret_htmlParserCtxtPtr(ret_val);
2162        call_tests++;
2163        xmlResetLastError();
2164        if (mem_base != xmlMemBlocks()) {
2165            printf("Leak of %d blocks found in htmlNewParserCtxt",
2166	           xmlMemBlocks() - mem_base);
2167	    test_ret++;
2168            printf("\n");
2169        }
2170    function_tests++;
2171#endif
2172
2173    return(test_ret);
2174}
2175
2176
2177static int
2178test_htmlNodeStatus(void) {
2179    int test_ret = 0;
2180
2181#if defined(LIBXML_HTML_ENABLED)
2182    int mem_base;
2183    htmlStatus ret_val;
2184    htmlNodePtr node; /* an htmlNodePtr in a tree */
2185    int n_node;
2186    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2187    int n_legacy;
2188
2189    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2190    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2191        mem_base = xmlMemBlocks();
2192        node = gen_const_htmlNodePtr(n_node, 0);
2193        legacy = gen_int(n_legacy, 1);
2194
2195        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2196        desret_htmlStatus(ret_val);
2197        call_tests++;
2198        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2199        des_int(n_legacy, legacy, 1);
2200        xmlResetLastError();
2201        if (mem_base != xmlMemBlocks()) {
2202            printf("Leak of %d blocks found in htmlNodeStatus",
2203	           xmlMemBlocks() - mem_base);
2204	    test_ret++;
2205            printf(" %d", n_node);
2206            printf(" %d", n_legacy);
2207            printf("\n");
2208        }
2209    }
2210    }
2211    function_tests++;
2212#endif
2213
2214    return(test_ret);
2215}
2216
2217
2218static int
2219test_htmlParseCharRef(void) {
2220    int test_ret = 0;
2221
2222#if defined(LIBXML_HTML_ENABLED)
2223    int mem_base;
2224    int ret_val;
2225    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2226    int n_ctxt;
2227
2228    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2229        mem_base = xmlMemBlocks();
2230        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2231
2232        ret_val = htmlParseCharRef(ctxt);
2233        desret_int(ret_val);
2234        call_tests++;
2235        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2236        xmlResetLastError();
2237        if (mem_base != xmlMemBlocks()) {
2238            printf("Leak of %d blocks found in htmlParseCharRef",
2239	           xmlMemBlocks() - mem_base);
2240	    test_ret++;
2241            printf(" %d", n_ctxt);
2242            printf("\n");
2243        }
2244    }
2245    function_tests++;
2246#endif
2247
2248    return(test_ret);
2249}
2250
2251
2252static int
2253test_htmlParseChunk(void) {
2254    int test_ret = 0;
2255
2256#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2257    int mem_base;
2258    int ret_val;
2259    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2260    int n_ctxt;
2261    char * chunk; /* an char array */
2262    int n_chunk;
2263    int size; /* the size in byte of the chunk */
2264    int n_size;
2265    int terminate; /* last chunk indicator */
2266    int n_terminate;
2267
2268    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2269    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2270    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2271    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2272        mem_base = xmlMemBlocks();
2273        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2274        chunk = gen_const_char_ptr(n_chunk, 1);
2275        size = gen_int(n_size, 2);
2276        terminate = gen_int(n_terminate, 3);
2277
2278        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2279        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2280        desret_int(ret_val);
2281        call_tests++;
2282        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2283        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2284        des_int(n_size, size, 2);
2285        des_int(n_terminate, terminate, 3);
2286        xmlResetLastError();
2287        if (mem_base != xmlMemBlocks()) {
2288            printf("Leak of %d blocks found in htmlParseChunk",
2289	           xmlMemBlocks() - mem_base);
2290	    test_ret++;
2291            printf(" %d", n_ctxt);
2292            printf(" %d", n_chunk);
2293            printf(" %d", n_size);
2294            printf(" %d", n_terminate);
2295            printf("\n");
2296        }
2297    }
2298    }
2299    }
2300    }
2301    function_tests++;
2302#endif
2303
2304    return(test_ret);
2305}
2306
2307
2308static int
2309test_htmlParseDoc(void) {
2310    int test_ret = 0;
2311
2312#if defined(LIBXML_HTML_ENABLED)
2313    int mem_base;
2314    htmlDocPtr ret_val;
2315    xmlChar * cur; /* a pointer to an array of xmlChar */
2316    int n_cur;
2317    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2318    int n_encoding;
2319
2320    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2321    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2322        mem_base = xmlMemBlocks();
2323        cur = gen_xmlChar_ptr(n_cur, 0);
2324        encoding = gen_const_char_ptr(n_encoding, 1);
2325
2326        ret_val = htmlParseDoc(cur, (const char *)encoding);
2327        desret_htmlDocPtr(ret_val);
2328        call_tests++;
2329        des_xmlChar_ptr(n_cur, cur, 0);
2330        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2331        xmlResetLastError();
2332        if (mem_base != xmlMemBlocks()) {
2333            printf("Leak of %d blocks found in htmlParseDoc",
2334	           xmlMemBlocks() - mem_base);
2335	    test_ret++;
2336            printf(" %d", n_cur);
2337            printf(" %d", n_encoding);
2338            printf("\n");
2339        }
2340    }
2341    }
2342    function_tests++;
2343#endif
2344
2345    return(test_ret);
2346}
2347
2348
2349static int
2350test_htmlParseDocument(void) {
2351    int test_ret = 0;
2352
2353#if defined(LIBXML_HTML_ENABLED)
2354    int mem_base;
2355    int ret_val;
2356    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2357    int n_ctxt;
2358
2359    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2360        mem_base = xmlMemBlocks();
2361        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2362
2363        ret_val = htmlParseDocument(ctxt);
2364        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2365        desret_int(ret_val);
2366        call_tests++;
2367        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2368        xmlResetLastError();
2369        if (mem_base != xmlMemBlocks()) {
2370            printf("Leak of %d blocks found in htmlParseDocument",
2371	           xmlMemBlocks() - mem_base);
2372	    test_ret++;
2373            printf(" %d", n_ctxt);
2374            printf("\n");
2375        }
2376    }
2377    function_tests++;
2378#endif
2379
2380    return(test_ret);
2381}
2382
2383
2384static int
2385test_htmlParseElement(void) {
2386    int test_ret = 0;
2387
2388#if defined(LIBXML_HTML_ENABLED)
2389    int mem_base;
2390    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2391    int n_ctxt;
2392
2393    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2394        mem_base = xmlMemBlocks();
2395        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2396
2397        htmlParseElement(ctxt);
2398        call_tests++;
2399        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2400        xmlResetLastError();
2401        if (mem_base != xmlMemBlocks()) {
2402            printf("Leak of %d blocks found in htmlParseElement",
2403	           xmlMemBlocks() - mem_base);
2404	    test_ret++;
2405            printf(" %d", n_ctxt);
2406            printf("\n");
2407        }
2408    }
2409    function_tests++;
2410#endif
2411
2412    return(test_ret);
2413}
2414
2415
2416static int
2417test_htmlParseEntityRef(void) {
2418    int test_ret = 0;
2419
2420#if defined(LIBXML_HTML_ENABLED)
2421    int mem_base;
2422    const htmlEntityDesc * ret_val;
2423    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2424    int n_ctxt;
2425    xmlChar ** str; /* location to store the entity name */
2426    int n_str;
2427
2428    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2429    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2430        mem_base = xmlMemBlocks();
2431        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2432        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2433
2434        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2435        desret_const_htmlEntityDesc_ptr(ret_val);
2436        call_tests++;
2437        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2438        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2439        xmlResetLastError();
2440        if (mem_base != xmlMemBlocks()) {
2441            printf("Leak of %d blocks found in htmlParseEntityRef",
2442	           xmlMemBlocks() - mem_base);
2443	    test_ret++;
2444            printf(" %d", n_ctxt);
2445            printf(" %d", n_str);
2446            printf("\n");
2447        }
2448    }
2449    }
2450    function_tests++;
2451#endif
2452
2453    return(test_ret);
2454}
2455
2456
2457static int
2458test_htmlParseFile(void) {
2459    int test_ret = 0;
2460
2461#if defined(LIBXML_HTML_ENABLED)
2462    htmlDocPtr ret_val;
2463    const char * filename; /* the filename */
2464    int n_filename;
2465    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2466    int n_encoding;
2467
2468    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2469    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2470        filename = gen_filepath(n_filename, 0);
2471        encoding = gen_const_char_ptr(n_encoding, 1);
2472
2473        ret_val = htmlParseFile(filename, (const char *)encoding);
2474        desret_htmlDocPtr(ret_val);
2475        call_tests++;
2476        des_filepath(n_filename, filename, 0);
2477        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2478        xmlResetLastError();
2479    }
2480    }
2481    function_tests++;
2482#endif
2483
2484    return(test_ret);
2485}
2486
2487
2488static int
2489test_htmlReadDoc(void) {
2490    int test_ret = 0;
2491
2492#if defined(LIBXML_HTML_ENABLED)
2493    int mem_base;
2494    htmlDocPtr ret_val;
2495    xmlChar * cur; /* a pointer to a zero terminated string */
2496    int n_cur;
2497    const char * URL; /* the base URL to use for the document */
2498    int n_URL;
2499    char * encoding; /* the document encoding, or NULL */
2500    int n_encoding;
2501    int options; /* a combination of htmlParserOption(s) */
2502    int n_options;
2503
2504    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2505    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2506    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2507    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2508        mem_base = xmlMemBlocks();
2509        cur = gen_const_xmlChar_ptr(n_cur, 0);
2510        URL = gen_filepath(n_URL, 1);
2511        encoding = gen_const_char_ptr(n_encoding, 2);
2512        options = gen_int(n_options, 3);
2513
2514        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2515        desret_htmlDocPtr(ret_val);
2516        call_tests++;
2517        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2518        des_filepath(n_URL, URL, 1);
2519        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2520        des_int(n_options, options, 3);
2521        xmlResetLastError();
2522        if (mem_base != xmlMemBlocks()) {
2523            printf("Leak of %d blocks found in htmlReadDoc",
2524	           xmlMemBlocks() - mem_base);
2525	    test_ret++;
2526            printf(" %d", n_cur);
2527            printf(" %d", n_URL);
2528            printf(" %d", n_encoding);
2529            printf(" %d", n_options);
2530            printf("\n");
2531        }
2532    }
2533    }
2534    }
2535    }
2536    function_tests++;
2537#endif
2538
2539    return(test_ret);
2540}
2541
2542
2543static int
2544test_htmlReadFile(void) {
2545    int test_ret = 0;
2546
2547#if defined(LIBXML_HTML_ENABLED)
2548    int mem_base;
2549    htmlDocPtr ret_val;
2550    const char * filename; /* a file or URL */
2551    int n_filename;
2552    char * encoding; /* the document encoding, or NULL */
2553    int n_encoding;
2554    int options; /* a combination of htmlParserOption(s) */
2555    int n_options;
2556
2557    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2558    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2559    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2560        mem_base = xmlMemBlocks();
2561        filename = gen_filepath(n_filename, 0);
2562        encoding = gen_const_char_ptr(n_encoding, 1);
2563        options = gen_int(n_options, 2);
2564
2565        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2566        desret_htmlDocPtr(ret_val);
2567        call_tests++;
2568        des_filepath(n_filename, filename, 0);
2569        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2570        des_int(n_options, options, 2);
2571        xmlResetLastError();
2572        if (mem_base != xmlMemBlocks()) {
2573            printf("Leak of %d blocks found in htmlReadFile",
2574	           xmlMemBlocks() - mem_base);
2575	    test_ret++;
2576            printf(" %d", n_filename);
2577            printf(" %d", n_encoding);
2578            printf(" %d", n_options);
2579            printf("\n");
2580        }
2581    }
2582    }
2583    }
2584    function_tests++;
2585#endif
2586
2587    return(test_ret);
2588}
2589
2590
2591static int
2592test_htmlReadMemory(void) {
2593    int test_ret = 0;
2594
2595#if defined(LIBXML_HTML_ENABLED)
2596    int mem_base;
2597    htmlDocPtr ret_val;
2598    char * buffer; /* a pointer to a char array */
2599    int n_buffer;
2600    int size; /* the size of the array */
2601    int n_size;
2602    const char * URL; /* the base URL to use for the document */
2603    int n_URL;
2604    char * encoding; /* the document encoding, or NULL */
2605    int n_encoding;
2606    int options; /* a combination of htmlParserOption(s) */
2607    int n_options;
2608
2609    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2610    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2611    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2612    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2613    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2614        mem_base = xmlMemBlocks();
2615        buffer = gen_const_char_ptr(n_buffer, 0);
2616        size = gen_int(n_size, 1);
2617        URL = gen_filepath(n_URL, 2);
2618        encoding = gen_const_char_ptr(n_encoding, 3);
2619        options = gen_int(n_options, 4);
2620
2621        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2622        desret_htmlDocPtr(ret_val);
2623        call_tests++;
2624        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2625        des_int(n_size, size, 1);
2626        des_filepath(n_URL, URL, 2);
2627        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2628        des_int(n_options, options, 4);
2629        xmlResetLastError();
2630        if (mem_base != xmlMemBlocks()) {
2631            printf("Leak of %d blocks found in htmlReadMemory",
2632	           xmlMemBlocks() - mem_base);
2633	    test_ret++;
2634            printf(" %d", n_buffer);
2635            printf(" %d", n_size);
2636            printf(" %d", n_URL);
2637            printf(" %d", n_encoding);
2638            printf(" %d", n_options);
2639            printf("\n");
2640        }
2641    }
2642    }
2643    }
2644    }
2645    }
2646    function_tests++;
2647#endif
2648
2649    return(test_ret);
2650}
2651
2652
2653static int
2654test_htmlSAXParseDoc(void) {
2655    int test_ret = 0;
2656
2657#if defined(LIBXML_HTML_ENABLED)
2658    int mem_base;
2659    htmlDocPtr ret_val;
2660    xmlChar * cur; /* a pointer to an array of xmlChar */
2661    int n_cur;
2662    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2663    int n_encoding;
2664    htmlSAXHandlerPtr sax; /* the SAX handler block */
2665    int n_sax;
2666    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2667    int n_userData;
2668
2669    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2670    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2671    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2672    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2673        mem_base = xmlMemBlocks();
2674        cur = gen_xmlChar_ptr(n_cur, 0);
2675        encoding = gen_const_char_ptr(n_encoding, 1);
2676        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2677        userData = gen_userdata(n_userData, 3);
2678
2679        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2680        desret_htmlDocPtr(ret_val);
2681        call_tests++;
2682        des_xmlChar_ptr(n_cur, cur, 0);
2683        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2684        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2685        des_userdata(n_userData, userData, 3);
2686        xmlResetLastError();
2687        if (mem_base != xmlMemBlocks()) {
2688            printf("Leak of %d blocks found in htmlSAXParseDoc",
2689	           xmlMemBlocks() - mem_base);
2690	    test_ret++;
2691            printf(" %d", n_cur);
2692            printf(" %d", n_encoding);
2693            printf(" %d", n_sax);
2694            printf(" %d", n_userData);
2695            printf("\n");
2696        }
2697    }
2698    }
2699    }
2700    }
2701    function_tests++;
2702#endif
2703
2704    return(test_ret);
2705}
2706
2707
2708static int
2709test_htmlSAXParseFile(void) {
2710    int test_ret = 0;
2711
2712#if defined(LIBXML_HTML_ENABLED)
2713    int mem_base;
2714    htmlDocPtr ret_val;
2715    const char * filename; /* the filename */
2716    int n_filename;
2717    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2718    int n_encoding;
2719    htmlSAXHandlerPtr sax; /* the SAX handler block */
2720    int n_sax;
2721    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2722    int n_userData;
2723
2724    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2725    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2726    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2727    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2728        mem_base = xmlMemBlocks();
2729        filename = gen_filepath(n_filename, 0);
2730        encoding = gen_const_char_ptr(n_encoding, 1);
2731        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2732        userData = gen_userdata(n_userData, 3);
2733
2734        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2735        desret_htmlDocPtr(ret_val);
2736        call_tests++;
2737        des_filepath(n_filename, filename, 0);
2738        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2739        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2740        des_userdata(n_userData, userData, 3);
2741        xmlResetLastError();
2742        if (mem_base != xmlMemBlocks()) {
2743            printf("Leak of %d blocks found in htmlSAXParseFile",
2744	           xmlMemBlocks() - mem_base);
2745	    test_ret++;
2746            printf(" %d", n_filename);
2747            printf(" %d", n_encoding);
2748            printf(" %d", n_sax);
2749            printf(" %d", n_userData);
2750            printf("\n");
2751        }
2752    }
2753    }
2754    }
2755    }
2756    function_tests++;
2757#endif
2758
2759    return(test_ret);
2760}
2761
2762
2763static int
2764test_htmlTagLookup(void) {
2765    int test_ret = 0;
2766
2767
2768    /* missing type support */
2769    return(test_ret);
2770}
2771
2772static int
2773test_HTMLparser(void) {
2774    int test_ret = 0;
2775
2776    if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2777    test_ret += test_UTF8ToHtml();
2778    test_ret += test_htmlAttrAllowed();
2779    test_ret += test_htmlAutoCloseTag();
2780    test_ret += test_htmlCreateMemoryParserCtxt();
2781    test_ret += test_htmlCreatePushParserCtxt();
2782    test_ret += test_htmlCtxtReadDoc();
2783    test_ret += test_htmlCtxtReadFile();
2784    test_ret += test_htmlCtxtReadMemory();
2785    test_ret += test_htmlCtxtReset();
2786    test_ret += test_htmlCtxtUseOptions();
2787    test_ret += test_htmlElementAllowedHere();
2788    test_ret += test_htmlElementStatusHere();
2789    test_ret += test_htmlEncodeEntities();
2790    test_ret += test_htmlEntityLookup();
2791    test_ret += test_htmlEntityValueLookup();
2792    test_ret += test_htmlHandleOmittedElem();
2793    test_ret += test_htmlIsAutoClosed();
2794    test_ret += test_htmlIsScriptAttribute();
2795    test_ret += test_htmlNewParserCtxt();
2796    test_ret += test_htmlNodeStatus();
2797    test_ret += test_htmlParseCharRef();
2798    test_ret += test_htmlParseChunk();
2799    test_ret += test_htmlParseDoc();
2800    test_ret += test_htmlParseDocument();
2801    test_ret += test_htmlParseElement();
2802    test_ret += test_htmlParseEntityRef();
2803    test_ret += test_htmlParseFile();
2804    test_ret += test_htmlReadDoc();
2805    test_ret += test_htmlReadFile();
2806    test_ret += test_htmlReadMemory();
2807    test_ret += test_htmlSAXParseDoc();
2808    test_ret += test_htmlSAXParseFile();
2809    test_ret += test_htmlTagLookup();
2810
2811    if (test_ret != 0)
2812	printf("Module HTMLparser: %d errors\n", test_ret);
2813    return(test_ret);
2814}
2815
2816static int
2817test_htmlDocContentDumpFormatOutput(void) {
2818    int test_ret = 0;
2819
2820#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2821    int mem_base;
2822    xmlOutputBufferPtr buf; /* the HTML buffer output */
2823    int n_buf;
2824    xmlDocPtr cur; /* the document */
2825    int n_cur;
2826    char * encoding; /* the encoding string */
2827    int n_encoding;
2828    int format; /* should formatting spaces been added */
2829    int n_format;
2830
2831    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2832    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2833    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2834    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2835        mem_base = xmlMemBlocks();
2836        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2837        cur = gen_xmlDocPtr(n_cur, 1);
2838        encoding = gen_const_char_ptr(n_encoding, 2);
2839        format = gen_int(n_format, 3);
2840
2841        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2842        call_tests++;
2843        des_xmlOutputBufferPtr(n_buf, buf, 0);
2844        des_xmlDocPtr(n_cur, cur, 1);
2845        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2846        des_int(n_format, format, 3);
2847        xmlResetLastError();
2848        if (mem_base != xmlMemBlocks()) {
2849            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2850	           xmlMemBlocks() - mem_base);
2851	    test_ret++;
2852            printf(" %d", n_buf);
2853            printf(" %d", n_cur);
2854            printf(" %d", n_encoding);
2855            printf(" %d", n_format);
2856            printf("\n");
2857        }
2858    }
2859    }
2860    }
2861    }
2862    function_tests++;
2863#endif
2864
2865    return(test_ret);
2866}
2867
2868
2869static int
2870test_htmlDocContentDumpOutput(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
2882    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2883    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2884    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2885        mem_base = xmlMemBlocks();
2886        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2887        cur = gen_xmlDocPtr(n_cur, 1);
2888        encoding = gen_const_char_ptr(n_encoding, 2);
2889
2890        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2891        call_tests++;
2892        des_xmlOutputBufferPtr(n_buf, buf, 0);
2893        des_xmlDocPtr(n_cur, cur, 1);
2894        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2895        xmlResetLastError();
2896        if (mem_base != xmlMemBlocks()) {
2897            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2898	           xmlMemBlocks() - mem_base);
2899	    test_ret++;
2900            printf(" %d", n_buf);
2901            printf(" %d", n_cur);
2902            printf(" %d", n_encoding);
2903            printf("\n");
2904        }
2905    }
2906    }
2907    }
2908    function_tests++;
2909#endif
2910
2911    return(test_ret);
2912}
2913
2914
2915static int
2916test_htmlDocDump(void) {
2917    int test_ret = 0;
2918
2919#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2920    int mem_base;
2921    int ret_val;
2922    FILE * f; /* the FILE* */
2923    int n_f;
2924    xmlDocPtr cur; /* the document */
2925    int n_cur;
2926
2927    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2928    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2929        mem_base = xmlMemBlocks();
2930        f = gen_FILE_ptr(n_f, 0);
2931        cur = gen_xmlDocPtr(n_cur, 1);
2932
2933        ret_val = htmlDocDump(f, cur);
2934        desret_int(ret_val);
2935        call_tests++;
2936        des_FILE_ptr(n_f, f, 0);
2937        des_xmlDocPtr(n_cur, cur, 1);
2938        xmlResetLastError();
2939        if (mem_base != xmlMemBlocks()) {
2940            printf("Leak of %d blocks found in htmlDocDump",
2941	           xmlMemBlocks() - mem_base);
2942	    test_ret++;
2943            printf(" %d", n_f);
2944            printf(" %d", n_cur);
2945            printf("\n");
2946        }
2947    }
2948    }
2949    function_tests++;
2950#endif
2951
2952    return(test_ret);
2953}
2954
2955
2956#define gen_nb_xmlChar_ptr_ptr 1
2957static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2958    return(NULL);
2959}
2960static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2961}
2962
2963static int
2964test_htmlDocDumpMemory(void) {
2965    int test_ret = 0;
2966
2967#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2968    int mem_base;
2969    xmlDocPtr cur; /* the document */
2970    int n_cur;
2971    xmlChar ** mem; /* OUT: the memory pointer */
2972    int n_mem;
2973    int * size; /* OUT: the memory length */
2974    int n_size;
2975
2976    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2977    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2978    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2979        mem_base = xmlMemBlocks();
2980        cur = gen_xmlDocPtr(n_cur, 0);
2981        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2982        size = gen_int_ptr(n_size, 2);
2983
2984        htmlDocDumpMemory(cur, mem, size);
2985        call_tests++;
2986        des_xmlDocPtr(n_cur, cur, 0);
2987        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2988        des_int_ptr(n_size, size, 2);
2989        xmlResetLastError();
2990        if (mem_base != xmlMemBlocks()) {
2991            printf("Leak of %d blocks found in htmlDocDumpMemory",
2992	           xmlMemBlocks() - mem_base);
2993	    test_ret++;
2994            printf(" %d", n_cur);
2995            printf(" %d", n_mem);
2996            printf(" %d", n_size);
2997            printf("\n");
2998        }
2999    }
3000    }
3001    }
3002    function_tests++;
3003#endif
3004
3005    return(test_ret);
3006}
3007
3008
3009static int
3010test_htmlDocDumpMemoryFormat(void) {
3011    int test_ret = 0;
3012
3013#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3014    int mem_base;
3015    xmlDocPtr cur; /* the document */
3016    int n_cur;
3017    xmlChar ** mem; /* OUT: the memory pointer */
3018    int n_mem;
3019    int * size; /* OUT: the memory length */
3020    int n_size;
3021    int format; /* should formatting spaces been added */
3022    int n_format;
3023
3024    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3025    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3026    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3027    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3028        mem_base = xmlMemBlocks();
3029        cur = gen_xmlDocPtr(n_cur, 0);
3030        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3031        size = gen_int_ptr(n_size, 2);
3032        format = gen_int(n_format, 3);
3033
3034        htmlDocDumpMemoryFormat(cur, mem, size, format);
3035        call_tests++;
3036        des_xmlDocPtr(n_cur, cur, 0);
3037        des_xmlChar_ptr_ptr(n_mem, mem, 1);
3038        des_int_ptr(n_size, size, 2);
3039        des_int(n_format, format, 3);
3040        xmlResetLastError();
3041        if (mem_base != xmlMemBlocks()) {
3042            printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3043	           xmlMemBlocks() - mem_base);
3044	    test_ret++;
3045            printf(" %d", n_cur);
3046            printf(" %d", n_mem);
3047            printf(" %d", n_size);
3048            printf(" %d", n_format);
3049            printf("\n");
3050        }
3051    }
3052    }
3053    }
3054    }
3055    function_tests++;
3056#endif
3057
3058    return(test_ret);
3059}
3060
3061
3062static int
3063test_htmlGetMetaEncoding(void) {
3064    int test_ret = 0;
3065
3066#if defined(LIBXML_HTML_ENABLED)
3067    int mem_base;
3068    const xmlChar * ret_val;
3069    htmlDocPtr doc; /* the document */
3070    int n_doc;
3071
3072    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3073        mem_base = xmlMemBlocks();
3074        doc = gen_htmlDocPtr(n_doc, 0);
3075
3076        ret_val = htmlGetMetaEncoding(doc);
3077        desret_const_xmlChar_ptr(ret_val);
3078        call_tests++;
3079        des_htmlDocPtr(n_doc, doc, 0);
3080        xmlResetLastError();
3081        if (mem_base != xmlMemBlocks()) {
3082            printf("Leak of %d blocks found in htmlGetMetaEncoding",
3083	           xmlMemBlocks() - mem_base);
3084	    test_ret++;
3085            printf(" %d", n_doc);
3086            printf("\n");
3087        }
3088    }
3089    function_tests++;
3090#endif
3091
3092    return(test_ret);
3093}
3094
3095
3096static int
3097test_htmlIsBooleanAttr(void) {
3098    int test_ret = 0;
3099
3100#if defined(LIBXML_HTML_ENABLED)
3101    int mem_base;
3102    int ret_val;
3103    xmlChar * name; /* the name of the attribute to check */
3104    int n_name;
3105
3106    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3107        mem_base = xmlMemBlocks();
3108        name = gen_const_xmlChar_ptr(n_name, 0);
3109
3110        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3111        desret_int(ret_val);
3112        call_tests++;
3113        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3114        xmlResetLastError();
3115        if (mem_base != xmlMemBlocks()) {
3116            printf("Leak of %d blocks found in htmlIsBooleanAttr",
3117	           xmlMemBlocks() - mem_base);
3118	    test_ret++;
3119            printf(" %d", n_name);
3120            printf("\n");
3121        }
3122    }
3123    function_tests++;
3124#endif
3125
3126    return(test_ret);
3127}
3128
3129
3130static int
3131test_htmlNewDoc(void) {
3132    int test_ret = 0;
3133
3134#if defined(LIBXML_HTML_ENABLED)
3135    int mem_base;
3136    htmlDocPtr ret_val;
3137    xmlChar * URI; /* URI for the dtd, or NULL */
3138    int n_URI;
3139    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3140    int n_ExternalID;
3141
3142    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3143    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3144        mem_base = xmlMemBlocks();
3145        URI = gen_const_xmlChar_ptr(n_URI, 0);
3146        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3147
3148        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3149        desret_htmlDocPtr(ret_val);
3150        call_tests++;
3151        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3152        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3153        xmlResetLastError();
3154        if (mem_base != xmlMemBlocks()) {
3155            printf("Leak of %d blocks found in htmlNewDoc",
3156	           xmlMemBlocks() - mem_base);
3157	    test_ret++;
3158            printf(" %d", n_URI);
3159            printf(" %d", n_ExternalID);
3160            printf("\n");
3161        }
3162    }
3163    }
3164    function_tests++;
3165#endif
3166
3167    return(test_ret);
3168}
3169
3170
3171static int
3172test_htmlNewDocNoDtD(void) {
3173    int test_ret = 0;
3174
3175#if defined(LIBXML_HTML_ENABLED)
3176    int mem_base;
3177    htmlDocPtr ret_val;
3178    xmlChar * URI; /* URI for the dtd, or NULL */
3179    int n_URI;
3180    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3181    int n_ExternalID;
3182
3183    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3184    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3185        mem_base = xmlMemBlocks();
3186        URI = gen_const_xmlChar_ptr(n_URI, 0);
3187        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3188
3189        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3190        desret_htmlDocPtr(ret_val);
3191        call_tests++;
3192        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3193        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3194        xmlResetLastError();
3195        if (mem_base != xmlMemBlocks()) {
3196            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3197	           xmlMemBlocks() - mem_base);
3198	    test_ret++;
3199            printf(" %d", n_URI);
3200            printf(" %d", n_ExternalID);
3201            printf("\n");
3202        }
3203    }
3204    }
3205    function_tests++;
3206#endif
3207
3208    return(test_ret);
3209}
3210
3211
3212static int
3213test_htmlNodeDump(void) {
3214    int test_ret = 0;
3215
3216#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3217    int mem_base;
3218    int ret_val;
3219    xmlBufferPtr buf; /* the HTML buffer output */
3220    int n_buf;
3221    xmlDocPtr doc; /* the document */
3222    int n_doc;
3223    xmlNodePtr cur; /* the current node */
3224    int n_cur;
3225
3226    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3227    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3228    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3229        mem_base = xmlMemBlocks();
3230        buf = gen_xmlBufferPtr(n_buf, 0);
3231        doc = gen_xmlDocPtr(n_doc, 1);
3232        cur = gen_xmlNodePtr(n_cur, 2);
3233
3234        ret_val = htmlNodeDump(buf, doc, cur);
3235        desret_int(ret_val);
3236        call_tests++;
3237        des_xmlBufferPtr(n_buf, buf, 0);
3238        des_xmlDocPtr(n_doc, doc, 1);
3239        des_xmlNodePtr(n_cur, cur, 2);
3240        xmlResetLastError();
3241        if (mem_base != xmlMemBlocks()) {
3242            printf("Leak of %d blocks found in htmlNodeDump",
3243	           xmlMemBlocks() - mem_base);
3244	    test_ret++;
3245            printf(" %d", n_buf);
3246            printf(" %d", n_doc);
3247            printf(" %d", n_cur);
3248            printf("\n");
3249        }
3250    }
3251    }
3252    }
3253    function_tests++;
3254#endif
3255
3256    return(test_ret);
3257}
3258
3259
3260static int
3261test_htmlNodeDumpFile(void) {
3262    int test_ret = 0;
3263
3264#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3265    int mem_base;
3266    FILE * out; /* the FILE pointer */
3267    int n_out;
3268    xmlDocPtr doc; /* the document */
3269    int n_doc;
3270    xmlNodePtr cur; /* the current node */
3271    int n_cur;
3272
3273    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3274    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3275    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3276        mem_base = xmlMemBlocks();
3277        out = gen_FILE_ptr(n_out, 0);
3278        doc = gen_xmlDocPtr(n_doc, 1);
3279        cur = gen_xmlNodePtr(n_cur, 2);
3280
3281        htmlNodeDumpFile(out, doc, cur);
3282        call_tests++;
3283        des_FILE_ptr(n_out, out, 0);
3284        des_xmlDocPtr(n_doc, doc, 1);
3285        des_xmlNodePtr(n_cur, cur, 2);
3286        xmlResetLastError();
3287        if (mem_base != xmlMemBlocks()) {
3288            printf("Leak of %d blocks found in htmlNodeDumpFile",
3289	           xmlMemBlocks() - mem_base);
3290	    test_ret++;
3291            printf(" %d", n_out);
3292            printf(" %d", n_doc);
3293            printf(" %d", n_cur);
3294            printf("\n");
3295        }
3296    }
3297    }
3298    }
3299    function_tests++;
3300#endif
3301
3302    return(test_ret);
3303}
3304
3305
3306static int
3307test_htmlNodeDumpFileFormat(void) {
3308    int test_ret = 0;
3309
3310#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3311    int mem_base;
3312    int ret_val;
3313    FILE * out; /* the FILE pointer */
3314    int n_out;
3315    xmlDocPtr doc; /* the document */
3316    int n_doc;
3317    xmlNodePtr cur; /* the current node */
3318    int n_cur;
3319    char * encoding; /* the document encoding */
3320    int n_encoding;
3321    int format; /* should formatting spaces been added */
3322    int n_format;
3323
3324    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3325    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3326    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3327    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3328    for (n_format = 0;n_format < gen_nb_int;n_format++) {
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        encoding = gen_const_char_ptr(n_encoding, 3);
3334        format = gen_int(n_format, 4);
3335
3336        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3337        desret_int(ret_val);
3338        call_tests++;
3339        des_FILE_ptr(n_out, out, 0);
3340        des_xmlDocPtr(n_doc, doc, 1);
3341        des_xmlNodePtr(n_cur, cur, 2);
3342        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3343        des_int(n_format, format, 4);
3344        xmlResetLastError();
3345        if (mem_base != xmlMemBlocks()) {
3346            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3347	           xmlMemBlocks() - mem_base);
3348	    test_ret++;
3349            printf(" %d", n_out);
3350            printf(" %d", n_doc);
3351            printf(" %d", n_cur);
3352            printf(" %d", n_encoding);
3353            printf(" %d", n_format);
3354            printf("\n");
3355        }
3356    }
3357    }
3358    }
3359    }
3360    }
3361    function_tests++;
3362#endif
3363
3364    return(test_ret);
3365}
3366
3367
3368static int
3369test_htmlNodeDumpFormatOutput(void) {
3370    int test_ret = 0;
3371
3372#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3373    int mem_base;
3374    xmlOutputBufferPtr buf; /* the HTML buffer output */
3375    int n_buf;
3376    xmlDocPtr doc; /* the document */
3377    int n_doc;
3378    xmlNodePtr cur; /* the current node */
3379    int n_cur;
3380    char * encoding; /* the encoding string */
3381    int n_encoding;
3382    int format; /* should formatting spaces been added */
3383    int n_format;
3384
3385    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3386    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3387    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3388    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3389    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3390        mem_base = xmlMemBlocks();
3391        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3392        doc = gen_xmlDocPtr(n_doc, 1);
3393        cur = gen_xmlNodePtr(n_cur, 2);
3394        encoding = gen_const_char_ptr(n_encoding, 3);
3395        format = gen_int(n_format, 4);
3396
3397        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3398        call_tests++;
3399        des_xmlOutputBufferPtr(n_buf, buf, 0);
3400        des_xmlDocPtr(n_doc, doc, 1);
3401        des_xmlNodePtr(n_cur, cur, 2);
3402        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3403        des_int(n_format, format, 4);
3404        xmlResetLastError();
3405        if (mem_base != xmlMemBlocks()) {
3406            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3407	           xmlMemBlocks() - mem_base);
3408	    test_ret++;
3409            printf(" %d", n_buf);
3410            printf(" %d", n_doc);
3411            printf(" %d", n_cur);
3412            printf(" %d", n_encoding);
3413            printf(" %d", n_format);
3414            printf("\n");
3415        }
3416    }
3417    }
3418    }
3419    }
3420    }
3421    function_tests++;
3422#endif
3423
3424    return(test_ret);
3425}
3426
3427
3428static int
3429test_htmlNodeDumpOutput(void) {
3430    int test_ret = 0;
3431
3432#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3433    int mem_base;
3434    xmlOutputBufferPtr buf; /* the HTML buffer output */
3435    int n_buf;
3436    xmlDocPtr doc; /* the document */
3437    int n_doc;
3438    xmlNodePtr cur; /* the current node */
3439    int n_cur;
3440    char * encoding; /* the encoding string */
3441    int n_encoding;
3442
3443    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3444    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3445    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3446    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3447        mem_base = xmlMemBlocks();
3448        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3449        doc = gen_xmlDocPtr(n_doc, 1);
3450        cur = gen_xmlNodePtr(n_cur, 2);
3451        encoding = gen_const_char_ptr(n_encoding, 3);
3452
3453        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3454        call_tests++;
3455        des_xmlOutputBufferPtr(n_buf, buf, 0);
3456        des_xmlDocPtr(n_doc, doc, 1);
3457        des_xmlNodePtr(n_cur, cur, 2);
3458        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3459        xmlResetLastError();
3460        if (mem_base != xmlMemBlocks()) {
3461            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3462	           xmlMemBlocks() - mem_base);
3463	    test_ret++;
3464            printf(" %d", n_buf);
3465            printf(" %d", n_doc);
3466            printf(" %d", n_cur);
3467            printf(" %d", n_encoding);
3468            printf("\n");
3469        }
3470    }
3471    }
3472    }
3473    }
3474    function_tests++;
3475#endif
3476
3477    return(test_ret);
3478}
3479
3480
3481static int
3482test_htmlSaveFile(void) {
3483    int test_ret = 0;
3484
3485#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3486    int mem_base;
3487    int ret_val;
3488    const char * filename; /* the filename (or URL) */
3489    int n_filename;
3490    xmlDocPtr cur; /* the document */
3491    int n_cur;
3492
3493    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3494    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3495        mem_base = xmlMemBlocks();
3496        filename = gen_fileoutput(n_filename, 0);
3497        cur = gen_xmlDocPtr(n_cur, 1);
3498
3499        ret_val = htmlSaveFile(filename, cur);
3500        desret_int(ret_val);
3501        call_tests++;
3502        des_fileoutput(n_filename, filename, 0);
3503        des_xmlDocPtr(n_cur, cur, 1);
3504        xmlResetLastError();
3505        if (mem_base != xmlMemBlocks()) {
3506            printf("Leak of %d blocks found in htmlSaveFile",
3507	           xmlMemBlocks() - mem_base);
3508	    test_ret++;
3509            printf(" %d", n_filename);
3510            printf(" %d", n_cur);
3511            printf("\n");
3512        }
3513    }
3514    }
3515    function_tests++;
3516#endif
3517
3518    return(test_ret);
3519}
3520
3521
3522static int
3523test_htmlSaveFileEnc(void) {
3524    int test_ret = 0;
3525
3526#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3527    int mem_base;
3528    int ret_val;
3529    const char * filename; /* the filename */
3530    int n_filename;
3531    xmlDocPtr cur; /* the document */
3532    int n_cur;
3533    char * encoding; /* the document encoding */
3534    int n_encoding;
3535
3536    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3537    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3538    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3539        mem_base = xmlMemBlocks();
3540        filename = gen_fileoutput(n_filename, 0);
3541        cur = gen_xmlDocPtr(n_cur, 1);
3542        encoding = gen_const_char_ptr(n_encoding, 2);
3543
3544        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3545        desret_int(ret_val);
3546        call_tests++;
3547        des_fileoutput(n_filename, filename, 0);
3548        des_xmlDocPtr(n_cur, cur, 1);
3549        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3550        xmlResetLastError();
3551        if (mem_base != xmlMemBlocks()) {
3552            printf("Leak of %d blocks found in htmlSaveFileEnc",
3553	           xmlMemBlocks() - mem_base);
3554	    test_ret++;
3555            printf(" %d", n_filename);
3556            printf(" %d", n_cur);
3557            printf(" %d", n_encoding);
3558            printf("\n");
3559        }
3560    }
3561    }
3562    }
3563    function_tests++;
3564#endif
3565
3566    return(test_ret);
3567}
3568
3569
3570static int
3571test_htmlSaveFileFormat(void) {
3572    int test_ret = 0;
3573
3574#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3575    int mem_base;
3576    int ret_val;
3577    const char * filename; /* the filename */
3578    int n_filename;
3579    xmlDocPtr cur; /* the document */
3580    int n_cur;
3581    char * encoding; /* the document encoding */
3582    int n_encoding;
3583    int format; /* should formatting spaces been added */
3584    int n_format;
3585
3586    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3587    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3588    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3589    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3590        mem_base = xmlMemBlocks();
3591        filename = gen_fileoutput(n_filename, 0);
3592        cur = gen_xmlDocPtr(n_cur, 1);
3593        encoding = gen_const_char_ptr(n_encoding, 2);
3594        format = gen_int(n_format, 3);
3595
3596        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3597        desret_int(ret_val);
3598        call_tests++;
3599        des_fileoutput(n_filename, filename, 0);
3600        des_xmlDocPtr(n_cur, cur, 1);
3601        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3602        des_int(n_format, format, 3);
3603        xmlResetLastError();
3604        if (mem_base != xmlMemBlocks()) {
3605            printf("Leak of %d blocks found in htmlSaveFileFormat",
3606	           xmlMemBlocks() - mem_base);
3607	    test_ret++;
3608            printf(" %d", n_filename);
3609            printf(" %d", n_cur);
3610            printf(" %d", n_encoding);
3611            printf(" %d", n_format);
3612            printf("\n");
3613        }
3614    }
3615    }
3616    }
3617    }
3618    function_tests++;
3619#endif
3620
3621    return(test_ret);
3622}
3623
3624
3625static int
3626test_htmlSetMetaEncoding(void) {
3627    int test_ret = 0;
3628
3629#if defined(LIBXML_HTML_ENABLED)
3630    int mem_base;
3631    int ret_val;
3632    htmlDocPtr doc; /* the document */
3633    int n_doc;
3634    xmlChar * encoding; /* the encoding string */
3635    int n_encoding;
3636
3637    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3638    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3639        mem_base = xmlMemBlocks();
3640        doc = gen_htmlDocPtr(n_doc, 0);
3641        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3642
3643        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3644        desret_int(ret_val);
3645        call_tests++;
3646        des_htmlDocPtr(n_doc, doc, 0);
3647        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3648        xmlResetLastError();
3649        if (mem_base != xmlMemBlocks()) {
3650            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3651	           xmlMemBlocks() - mem_base);
3652	    test_ret++;
3653            printf(" %d", n_doc);
3654            printf(" %d", n_encoding);
3655            printf("\n");
3656        }
3657    }
3658    }
3659    function_tests++;
3660#endif
3661
3662    return(test_ret);
3663}
3664
3665static int
3666test_HTMLtree(void) {
3667    int test_ret = 0;
3668
3669    if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3670    test_ret += test_htmlDocContentDumpFormatOutput();
3671    test_ret += test_htmlDocContentDumpOutput();
3672    test_ret += test_htmlDocDump();
3673    test_ret += test_htmlDocDumpMemory();
3674    test_ret += test_htmlDocDumpMemoryFormat();
3675    test_ret += test_htmlGetMetaEncoding();
3676    test_ret += test_htmlIsBooleanAttr();
3677    test_ret += test_htmlNewDoc();
3678    test_ret += test_htmlNewDocNoDtD();
3679    test_ret += test_htmlNodeDump();
3680    test_ret += test_htmlNodeDumpFile();
3681    test_ret += test_htmlNodeDumpFileFormat();
3682    test_ret += test_htmlNodeDumpFormatOutput();
3683    test_ret += test_htmlNodeDumpOutput();
3684    test_ret += test_htmlSaveFile();
3685    test_ret += test_htmlSaveFileEnc();
3686    test_ret += test_htmlSaveFileFormat();
3687    test_ret += test_htmlSetMetaEncoding();
3688
3689    if (test_ret != 0)
3690	printf("Module HTMLtree: %d errors\n", test_ret);
3691    return(test_ret);
3692}
3693
3694static int
3695test_docbDefaultSAXHandlerInit(void) {
3696    int test_ret = 0;
3697
3698#if defined(LIBXML_DOCB_ENABLED)
3699#ifdef LIBXML_DOCB_ENABLED
3700    int mem_base;
3701
3702        mem_base = xmlMemBlocks();
3703
3704        docbDefaultSAXHandlerInit();
3705        call_tests++;
3706        xmlResetLastError();
3707        if (mem_base != xmlMemBlocks()) {
3708            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3709	           xmlMemBlocks() - mem_base);
3710	    test_ret++;
3711            printf("\n");
3712        }
3713    function_tests++;
3714#endif
3715#endif
3716
3717    return(test_ret);
3718}
3719
3720
3721static int
3722test_htmlDefaultSAXHandlerInit(void) {
3723    int test_ret = 0;
3724
3725#if defined(LIBXML_HTML_ENABLED)
3726#ifdef LIBXML_HTML_ENABLED
3727    int mem_base;
3728
3729        mem_base = xmlMemBlocks();
3730
3731        htmlDefaultSAXHandlerInit();
3732        call_tests++;
3733        xmlResetLastError();
3734        if (mem_base != xmlMemBlocks()) {
3735            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3736	           xmlMemBlocks() - mem_base);
3737	    test_ret++;
3738            printf("\n");
3739        }
3740    function_tests++;
3741#endif
3742#endif
3743
3744    return(test_ret);
3745}
3746
3747
3748static int
3749test_xmlDefaultSAXHandlerInit(void) {
3750    int test_ret = 0;
3751
3752    int mem_base;
3753
3754        mem_base = xmlMemBlocks();
3755
3756        xmlDefaultSAXHandlerInit();
3757        call_tests++;
3758        xmlResetLastError();
3759        if (mem_base != xmlMemBlocks()) {
3760            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3761	           xmlMemBlocks() - mem_base);
3762	    test_ret++;
3763            printf("\n");
3764        }
3765    function_tests++;
3766
3767    return(test_ret);
3768}
3769
3770
3771#define gen_nb_xmlEnumerationPtr 1
3772static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3773    return(NULL);
3774}
3775static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3776}
3777
3778static int
3779test_xmlSAX2AttributeDecl(void) {
3780    int test_ret = 0;
3781
3782    int mem_base;
3783    void * ctx; /* the user data (XML parser context) */
3784    int n_ctx;
3785    xmlChar * elem; /* the name of the element */
3786    int n_elem;
3787    xmlChar * fullname; /* the attribute name */
3788    int n_fullname;
3789    int type; /* the attribute type */
3790    int n_type;
3791    int def; /* the type of default value */
3792    int n_def;
3793    xmlChar * defaultValue; /* the attribute default value */
3794    int n_defaultValue;
3795    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3796    int n_tree;
3797
3798    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3799    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3800    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3801    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3802    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3803    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3804    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3805        mem_base = xmlMemBlocks();
3806        ctx = gen_void_ptr(n_ctx, 0);
3807        elem = gen_const_xmlChar_ptr(n_elem, 1);
3808        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3809        type = gen_int(n_type, 3);
3810        def = gen_int(n_def, 4);
3811        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3812        tree = gen_xmlEnumerationPtr(n_tree, 6);
3813
3814        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3815        call_tests++;
3816        des_void_ptr(n_ctx, ctx, 0);
3817        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3818        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3819        des_int(n_type, type, 3);
3820        des_int(n_def, def, 4);
3821        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3822        des_xmlEnumerationPtr(n_tree, tree, 6);
3823        xmlResetLastError();
3824        if (mem_base != xmlMemBlocks()) {
3825            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3826	           xmlMemBlocks() - mem_base);
3827	    test_ret++;
3828            printf(" %d", n_ctx);
3829            printf(" %d", n_elem);
3830            printf(" %d", n_fullname);
3831            printf(" %d", n_type);
3832            printf(" %d", n_def);
3833            printf(" %d", n_defaultValue);
3834            printf(" %d", n_tree);
3835            printf("\n");
3836        }
3837    }
3838    }
3839    }
3840    }
3841    }
3842    }
3843    }
3844    function_tests++;
3845
3846    return(test_ret);
3847}
3848
3849
3850static int
3851test_xmlSAX2CDataBlock(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 * value; /* The pcdata content */
3858    int n_value;
3859    int len; /* the block length */
3860    int n_len;
3861
3862    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3863    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3864    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3865        mem_base = xmlMemBlocks();
3866        ctx = gen_void_ptr(n_ctx, 0);
3867        value = gen_const_xmlChar_ptr(n_value, 1);
3868        len = gen_int(n_len, 2);
3869
3870        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3871        call_tests++;
3872        des_void_ptr(n_ctx, ctx, 0);
3873        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3874        des_int(n_len, len, 2);
3875        xmlResetLastError();
3876        if (mem_base != xmlMemBlocks()) {
3877            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3878	           xmlMemBlocks() - mem_base);
3879	    test_ret++;
3880            printf(" %d", n_ctx);
3881            printf(" %d", n_value);
3882            printf(" %d", n_len);
3883            printf("\n");
3884        }
3885    }
3886    }
3887    }
3888    function_tests++;
3889
3890    return(test_ret);
3891}
3892
3893
3894static int
3895test_xmlSAX2Characters(void) {
3896    int test_ret = 0;
3897
3898    int mem_base;
3899    void * ctx; /* the user data (XML parser context) */
3900    int n_ctx;
3901    xmlChar * ch; /* a xmlChar string */
3902    int n_ch;
3903    int len; /* the number of xmlChar */
3904    int n_len;
3905
3906    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3907    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3908    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3909        mem_base = xmlMemBlocks();
3910        ctx = gen_void_ptr(n_ctx, 0);
3911        ch = gen_const_xmlChar_ptr(n_ch, 1);
3912        len = gen_int(n_len, 2);
3913
3914        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3915        call_tests++;
3916        des_void_ptr(n_ctx, ctx, 0);
3917        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3918        des_int(n_len, len, 2);
3919        xmlResetLastError();
3920        if (mem_base != xmlMemBlocks()) {
3921            printf("Leak of %d blocks found in xmlSAX2Characters",
3922	           xmlMemBlocks() - mem_base);
3923	    test_ret++;
3924            printf(" %d", n_ctx);
3925            printf(" %d", n_ch);
3926            printf(" %d", n_len);
3927            printf("\n");
3928        }
3929    }
3930    }
3931    }
3932    function_tests++;
3933
3934    return(test_ret);
3935}
3936
3937
3938static int
3939test_xmlSAX2Comment(void) {
3940    int test_ret = 0;
3941
3942    int mem_base;
3943    void * ctx; /* the user data (XML parser context) */
3944    int n_ctx;
3945    xmlChar * value; /* the xmlSAX2Comment content */
3946    int n_value;
3947
3948    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3949    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3950        mem_base = xmlMemBlocks();
3951        ctx = gen_void_ptr(n_ctx, 0);
3952        value = gen_const_xmlChar_ptr(n_value, 1);
3953
3954        xmlSAX2Comment(ctx, (const xmlChar *)value);
3955        call_tests++;
3956        des_void_ptr(n_ctx, ctx, 0);
3957        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3958        xmlResetLastError();
3959        if (mem_base != xmlMemBlocks()) {
3960            printf("Leak of %d blocks found in xmlSAX2Comment",
3961	           xmlMemBlocks() - mem_base);
3962	    test_ret++;
3963            printf(" %d", n_ctx);
3964            printf(" %d", n_value);
3965            printf("\n");
3966        }
3967    }
3968    }
3969    function_tests++;
3970
3971    return(test_ret);
3972}
3973
3974
3975static int
3976test_xmlSAX2ElementDecl(void) {
3977    int test_ret = 0;
3978
3979    int mem_base;
3980    void * ctx; /* the user data (XML parser context) */
3981    int n_ctx;
3982    xmlChar * name; /* the element name */
3983    int n_name;
3984    int type; /* the element type */
3985    int n_type;
3986    xmlElementContentPtr content; /* the element value tree */
3987    int n_content;
3988
3989    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3990    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3991    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3992    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3993        mem_base = xmlMemBlocks();
3994        ctx = gen_void_ptr(n_ctx, 0);
3995        name = gen_const_xmlChar_ptr(n_name, 1);
3996        type = gen_int(n_type, 2);
3997        content = gen_xmlElementContentPtr(n_content, 3);
3998
3999        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4000        call_tests++;
4001        des_void_ptr(n_ctx, ctx, 0);
4002        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4003        des_int(n_type, type, 2);
4004        des_xmlElementContentPtr(n_content, content, 3);
4005        xmlResetLastError();
4006        if (mem_base != xmlMemBlocks()) {
4007            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4008	           xmlMemBlocks() - mem_base);
4009	    test_ret++;
4010            printf(" %d", n_ctx);
4011            printf(" %d", n_name);
4012            printf(" %d", n_type);
4013            printf(" %d", n_content);
4014            printf("\n");
4015        }
4016    }
4017    }
4018    }
4019    }
4020    function_tests++;
4021
4022    return(test_ret);
4023}
4024
4025
4026static int
4027test_xmlSAX2EndDocument(void) {
4028    int test_ret = 0;
4029
4030    int mem_base;
4031    void * ctx; /* the user data (XML parser context) */
4032    int n_ctx;
4033
4034    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4035        mem_base = xmlMemBlocks();
4036        ctx = gen_void_ptr(n_ctx, 0);
4037
4038        xmlSAX2EndDocument(ctx);
4039        call_tests++;
4040        des_void_ptr(n_ctx, ctx, 0);
4041        xmlResetLastError();
4042        if (mem_base != xmlMemBlocks()) {
4043            printf("Leak of %d blocks found in xmlSAX2EndDocument",
4044	           xmlMemBlocks() - mem_base);
4045	    test_ret++;
4046            printf(" %d", n_ctx);
4047            printf("\n");
4048        }
4049    }
4050    function_tests++;
4051
4052    return(test_ret);
4053}
4054
4055
4056static int
4057test_xmlSAX2EndElement(void) {
4058    int test_ret = 0;
4059
4060#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4061#ifdef LIBXML_SAX1_ENABLED
4062    int mem_base;
4063    void * ctx; /* the user data (XML parser context) */
4064    int n_ctx;
4065    xmlChar * name; /* The element name */
4066    int n_name;
4067
4068    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4069    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4070        mem_base = xmlMemBlocks();
4071        ctx = gen_void_ptr(n_ctx, 0);
4072        name = gen_const_xmlChar_ptr(n_name, 1);
4073
4074        xmlSAX2EndElement(ctx, (const xmlChar *)name);
4075        call_tests++;
4076        des_void_ptr(n_ctx, ctx, 0);
4077        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4078        xmlResetLastError();
4079        if (mem_base != xmlMemBlocks()) {
4080            printf("Leak of %d blocks found in xmlSAX2EndElement",
4081	           xmlMemBlocks() - mem_base);
4082	    test_ret++;
4083            printf(" %d", n_ctx);
4084            printf(" %d", n_name);
4085            printf("\n");
4086        }
4087    }
4088    }
4089    function_tests++;
4090#endif
4091#endif
4092
4093    return(test_ret);
4094}
4095
4096
4097static int
4098test_xmlSAX2EndElementNs(void) {
4099    int test_ret = 0;
4100
4101    int mem_base;
4102    void * ctx; /* the user data (XML parser context) */
4103    int n_ctx;
4104    xmlChar * localname; /* the local name of the element */
4105    int n_localname;
4106    xmlChar * prefix; /* the element namespace prefix if available */
4107    int n_prefix;
4108    xmlChar * URI; /* the element namespace name if available */
4109    int n_URI;
4110
4111    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4112    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4113    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4114    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4115        mem_base = xmlMemBlocks();
4116        ctx = gen_void_ptr(n_ctx, 0);
4117        localname = gen_const_xmlChar_ptr(n_localname, 1);
4118        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4119        URI = gen_const_xmlChar_ptr(n_URI, 3);
4120
4121        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4122        call_tests++;
4123        des_void_ptr(n_ctx, ctx, 0);
4124        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4125        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4126        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4127        xmlResetLastError();
4128        if (mem_base != xmlMemBlocks()) {
4129            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4130	           xmlMemBlocks() - mem_base);
4131	    test_ret++;
4132            printf(" %d", n_ctx);
4133            printf(" %d", n_localname);
4134            printf(" %d", n_prefix);
4135            printf(" %d", n_URI);
4136            printf("\n");
4137        }
4138    }
4139    }
4140    }
4141    }
4142    function_tests++;
4143
4144    return(test_ret);
4145}
4146
4147
4148static int
4149test_xmlSAX2EntityDecl(void) {
4150    int test_ret = 0;
4151
4152    int mem_base;
4153    void * ctx; /* the user data (XML parser context) */
4154    int n_ctx;
4155    xmlChar * name; /* the entity name */
4156    int n_name;
4157    int type; /* the entity type */
4158    int n_type;
4159    xmlChar * publicId; /* The public ID of the entity */
4160    int n_publicId;
4161    xmlChar * systemId; /* The system ID of the entity */
4162    int n_systemId;
4163    xmlChar * content; /* the entity value (without processing). */
4164    int n_content;
4165
4166    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4167    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4168    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4169    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4170    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4171    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4172        mem_base = xmlMemBlocks();
4173        ctx = gen_void_ptr(n_ctx, 0);
4174        name = gen_const_xmlChar_ptr(n_name, 1);
4175        type = gen_int(n_type, 2);
4176        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4177        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4178        content = gen_xmlChar_ptr(n_content, 5);
4179
4180        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4181        call_tests++;
4182        des_void_ptr(n_ctx, ctx, 0);
4183        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4184        des_int(n_type, type, 2);
4185        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4186        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4187        des_xmlChar_ptr(n_content, content, 5);
4188        xmlResetLastError();
4189        if (mem_base != xmlMemBlocks()) {
4190            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4191	           xmlMemBlocks() - mem_base);
4192	    test_ret++;
4193            printf(" %d", n_ctx);
4194            printf(" %d", n_name);
4195            printf(" %d", n_type);
4196            printf(" %d", n_publicId);
4197            printf(" %d", n_systemId);
4198            printf(" %d", n_content);
4199            printf("\n");
4200        }
4201    }
4202    }
4203    }
4204    }
4205    }
4206    }
4207    function_tests++;
4208
4209    return(test_ret);
4210}
4211
4212
4213static int
4214test_xmlSAX2ExternalSubset(void) {
4215    int test_ret = 0;
4216
4217    int mem_base;
4218    void * ctx; /* the user data (XML parser context) */
4219    int n_ctx;
4220    xmlChar * name; /* the root element name */
4221    int n_name;
4222    xmlChar * ExternalID; /* the external ID */
4223    int n_ExternalID;
4224    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4225    int n_SystemID;
4226
4227    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4228    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4229    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4230    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4231        mem_base = xmlMemBlocks();
4232        ctx = gen_void_ptr(n_ctx, 0);
4233        name = gen_const_xmlChar_ptr(n_name, 1);
4234        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4235        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4236
4237        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4238        call_tests++;
4239        des_void_ptr(n_ctx, ctx, 0);
4240        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4241        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4242        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4243        xmlResetLastError();
4244        if (mem_base != xmlMemBlocks()) {
4245            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4246	           xmlMemBlocks() - mem_base);
4247	    test_ret++;
4248            printf(" %d", n_ctx);
4249            printf(" %d", n_name);
4250            printf(" %d", n_ExternalID);
4251            printf(" %d", n_SystemID);
4252            printf("\n");
4253        }
4254    }
4255    }
4256    }
4257    }
4258    function_tests++;
4259
4260    return(test_ret);
4261}
4262
4263
4264static int
4265test_xmlSAX2GetColumnNumber(void) {
4266    int test_ret = 0;
4267
4268    int mem_base;
4269    int ret_val;
4270    void * ctx; /* the user data (XML parser context) */
4271    int n_ctx;
4272
4273    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4274        mem_base = xmlMemBlocks();
4275        ctx = gen_void_ptr(n_ctx, 0);
4276
4277        ret_val = xmlSAX2GetColumnNumber(ctx);
4278        desret_int(ret_val);
4279        call_tests++;
4280        des_void_ptr(n_ctx, ctx, 0);
4281        xmlResetLastError();
4282        if (mem_base != xmlMemBlocks()) {
4283            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4284	           xmlMemBlocks() - mem_base);
4285	    test_ret++;
4286            printf(" %d", n_ctx);
4287            printf("\n");
4288        }
4289    }
4290    function_tests++;
4291
4292    return(test_ret);
4293}
4294
4295
4296static int
4297test_xmlSAX2GetEntity(void) {
4298    int test_ret = 0;
4299
4300    int mem_base;
4301    xmlEntityPtr ret_val;
4302    void * ctx; /* the user data (XML parser context) */
4303    int n_ctx;
4304    xmlChar * name; /* The entity name */
4305    int n_name;
4306
4307    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4308    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4309        mem_base = xmlMemBlocks();
4310        ctx = gen_void_ptr(n_ctx, 0);
4311        name = gen_const_xmlChar_ptr(n_name, 1);
4312
4313        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4314        desret_xmlEntityPtr(ret_val);
4315        call_tests++;
4316        des_void_ptr(n_ctx, ctx, 0);
4317        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4318        xmlResetLastError();
4319        if (mem_base != xmlMemBlocks()) {
4320            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4321	           xmlMemBlocks() - mem_base);
4322	    test_ret++;
4323            printf(" %d", n_ctx);
4324            printf(" %d", n_name);
4325            printf("\n");
4326        }
4327    }
4328    }
4329    function_tests++;
4330
4331    return(test_ret);
4332}
4333
4334
4335static int
4336test_xmlSAX2GetLineNumber(void) {
4337    int test_ret = 0;
4338
4339    int mem_base;
4340    int ret_val;
4341    void * ctx; /* the user data (XML parser context) */
4342    int n_ctx;
4343
4344    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4345        mem_base = xmlMemBlocks();
4346        ctx = gen_void_ptr(n_ctx, 0);
4347
4348        ret_val = xmlSAX2GetLineNumber(ctx);
4349        desret_int(ret_val);
4350        call_tests++;
4351        des_void_ptr(n_ctx, ctx, 0);
4352        xmlResetLastError();
4353        if (mem_base != xmlMemBlocks()) {
4354            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4355	           xmlMemBlocks() - mem_base);
4356	    test_ret++;
4357            printf(" %d", n_ctx);
4358            printf("\n");
4359        }
4360    }
4361    function_tests++;
4362
4363    return(test_ret);
4364}
4365
4366
4367static int
4368test_xmlSAX2GetParameterEntity(void) {
4369    int test_ret = 0;
4370
4371    int mem_base;
4372    xmlEntityPtr ret_val;
4373    void * ctx; /* the user data (XML parser context) */
4374    int n_ctx;
4375    xmlChar * name; /* The entity name */
4376    int n_name;
4377
4378    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4379    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4380        mem_base = xmlMemBlocks();
4381        ctx = gen_void_ptr(n_ctx, 0);
4382        name = gen_const_xmlChar_ptr(n_name, 1);
4383
4384        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4385        desret_xmlEntityPtr(ret_val);
4386        call_tests++;
4387        des_void_ptr(n_ctx, ctx, 0);
4388        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4389        xmlResetLastError();
4390        if (mem_base != xmlMemBlocks()) {
4391            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4392	           xmlMemBlocks() - mem_base);
4393	    test_ret++;
4394            printf(" %d", n_ctx);
4395            printf(" %d", n_name);
4396            printf("\n");
4397        }
4398    }
4399    }
4400    function_tests++;
4401
4402    return(test_ret);
4403}
4404
4405
4406static int
4407test_xmlSAX2GetPublicId(void) {
4408    int test_ret = 0;
4409
4410    int mem_base;
4411    const xmlChar * ret_val;
4412    void * ctx; /* the user data (XML parser context) */
4413    int n_ctx;
4414
4415    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4416        mem_base = xmlMemBlocks();
4417        ctx = gen_void_ptr(n_ctx, 0);
4418
4419        ret_val = xmlSAX2GetPublicId(ctx);
4420        desret_const_xmlChar_ptr(ret_val);
4421        call_tests++;
4422        des_void_ptr(n_ctx, ctx, 0);
4423        xmlResetLastError();
4424        if (mem_base != xmlMemBlocks()) {
4425            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4426	           xmlMemBlocks() - mem_base);
4427	    test_ret++;
4428            printf(" %d", n_ctx);
4429            printf("\n");
4430        }
4431    }
4432    function_tests++;
4433
4434    return(test_ret);
4435}
4436
4437
4438static int
4439test_xmlSAX2GetSystemId(void) {
4440    int test_ret = 0;
4441
4442    int mem_base;
4443    const xmlChar * ret_val;
4444    void * ctx; /* the user data (XML parser context) */
4445    int n_ctx;
4446
4447    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4448        mem_base = xmlMemBlocks();
4449        ctx = gen_void_ptr(n_ctx, 0);
4450
4451        ret_val = xmlSAX2GetSystemId(ctx);
4452        desret_const_xmlChar_ptr(ret_val);
4453        call_tests++;
4454        des_void_ptr(n_ctx, ctx, 0);
4455        xmlResetLastError();
4456        if (mem_base != xmlMemBlocks()) {
4457            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4458	           xmlMemBlocks() - mem_base);
4459	    test_ret++;
4460            printf(" %d", n_ctx);
4461            printf("\n");
4462        }
4463    }
4464    function_tests++;
4465
4466    return(test_ret);
4467}
4468
4469
4470static int
4471test_xmlSAX2HasExternalSubset(void) {
4472    int test_ret = 0;
4473
4474    int mem_base;
4475    int ret_val;
4476    void * ctx; /* the user data (XML parser context) */
4477    int n_ctx;
4478
4479    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4480        mem_base = xmlMemBlocks();
4481        ctx = gen_void_ptr(n_ctx, 0);
4482
4483        ret_val = xmlSAX2HasExternalSubset(ctx);
4484        desret_int(ret_val);
4485        call_tests++;
4486        des_void_ptr(n_ctx, ctx, 0);
4487        xmlResetLastError();
4488        if (mem_base != xmlMemBlocks()) {
4489            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4490	           xmlMemBlocks() - mem_base);
4491	    test_ret++;
4492            printf(" %d", n_ctx);
4493            printf("\n");
4494        }
4495    }
4496    function_tests++;
4497
4498    return(test_ret);
4499}
4500
4501
4502static int
4503test_xmlSAX2HasInternalSubset(void) {
4504    int test_ret = 0;
4505
4506    int mem_base;
4507    int ret_val;
4508    void * ctx; /* the user data (XML parser context) */
4509    int n_ctx;
4510
4511    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4512        mem_base = xmlMemBlocks();
4513        ctx = gen_void_ptr(n_ctx, 0);
4514
4515        ret_val = xmlSAX2HasInternalSubset(ctx);
4516        desret_int(ret_val);
4517        call_tests++;
4518        des_void_ptr(n_ctx, ctx, 0);
4519        xmlResetLastError();
4520        if (mem_base != xmlMemBlocks()) {
4521            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4522	           xmlMemBlocks() - mem_base);
4523	    test_ret++;
4524            printf(" %d", n_ctx);
4525            printf("\n");
4526        }
4527    }
4528    function_tests++;
4529
4530    return(test_ret);
4531}
4532
4533
4534static int
4535test_xmlSAX2IgnorableWhitespace(void) {
4536    int test_ret = 0;
4537
4538    int mem_base;
4539    void * ctx; /* the user data (XML parser context) */
4540    int n_ctx;
4541    xmlChar * ch; /* a xmlChar string */
4542    int n_ch;
4543    int len; /* the number of xmlChar */
4544    int n_len;
4545
4546    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4547    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4548    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4549        mem_base = xmlMemBlocks();
4550        ctx = gen_void_ptr(n_ctx, 0);
4551        ch = gen_const_xmlChar_ptr(n_ch, 1);
4552        len = gen_int(n_len, 2);
4553
4554        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4555        call_tests++;
4556        des_void_ptr(n_ctx, ctx, 0);
4557        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4558        des_int(n_len, len, 2);
4559        xmlResetLastError();
4560        if (mem_base != xmlMemBlocks()) {
4561            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4562	           xmlMemBlocks() - mem_base);
4563	    test_ret++;
4564            printf(" %d", n_ctx);
4565            printf(" %d", n_ch);
4566            printf(" %d", n_len);
4567            printf("\n");
4568        }
4569    }
4570    }
4571    }
4572    function_tests++;
4573
4574    return(test_ret);
4575}
4576
4577
4578#define gen_nb_xmlSAXHandler_ptr 1
4579static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4580    return(NULL);
4581}
4582static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4583}
4584
4585static int
4586test_xmlSAX2InitDefaultSAXHandler(void) {
4587    int test_ret = 0;
4588
4589    int mem_base;
4590    xmlSAXHandler * hdlr; /* the SAX handler */
4591    int n_hdlr;
4592    int warning; /* flag if non-zero sets the handler warning procedure */
4593    int n_warning;
4594
4595    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4596    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4597        mem_base = xmlMemBlocks();
4598        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4599        warning = gen_int(n_warning, 1);
4600
4601        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4602        call_tests++;
4603        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4604        des_int(n_warning, warning, 1);
4605        xmlResetLastError();
4606        if (mem_base != xmlMemBlocks()) {
4607            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4608	           xmlMemBlocks() - mem_base);
4609	    test_ret++;
4610            printf(" %d", n_hdlr);
4611            printf(" %d", n_warning);
4612            printf("\n");
4613        }
4614    }
4615    }
4616    function_tests++;
4617
4618    return(test_ret);
4619}
4620
4621
4622static int
4623test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4624    int test_ret = 0;
4625
4626#if defined(LIBXML_DOCB_ENABLED)
4627    int mem_base;
4628    xmlSAXHandler * hdlr; /* the SAX handler */
4629    int n_hdlr;
4630
4631    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4632        mem_base = xmlMemBlocks();
4633        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4634
4635        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4636        call_tests++;
4637        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4638        xmlResetLastError();
4639        if (mem_base != xmlMemBlocks()) {
4640            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4641	           xmlMemBlocks() - mem_base);
4642	    test_ret++;
4643            printf(" %d", n_hdlr);
4644            printf("\n");
4645        }
4646    }
4647    function_tests++;
4648#endif
4649
4650    return(test_ret);
4651}
4652
4653
4654static int
4655test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4656    int test_ret = 0;
4657
4658#if defined(LIBXML_HTML_ENABLED)
4659    int mem_base;
4660    xmlSAXHandler * hdlr; /* the SAX handler */
4661    int n_hdlr;
4662
4663    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4664        mem_base = xmlMemBlocks();
4665        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4666
4667        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4668        call_tests++;
4669        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4670        xmlResetLastError();
4671        if (mem_base != xmlMemBlocks()) {
4672            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4673	           xmlMemBlocks() - mem_base);
4674	    test_ret++;
4675            printf(" %d", n_hdlr);
4676            printf("\n");
4677        }
4678    }
4679    function_tests++;
4680#endif
4681
4682    return(test_ret);
4683}
4684
4685
4686static int
4687test_xmlSAX2InternalSubset(void) {
4688    int test_ret = 0;
4689
4690    int mem_base;
4691    void * ctx; /* the user data (XML parser context) */
4692    int n_ctx;
4693    xmlChar * name; /* the root element name */
4694    int n_name;
4695    xmlChar * ExternalID; /* the external ID */
4696    int n_ExternalID;
4697    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4698    int n_SystemID;
4699
4700    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4701    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4702    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4703    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4704        mem_base = xmlMemBlocks();
4705        ctx = gen_void_ptr(n_ctx, 0);
4706        name = gen_const_xmlChar_ptr(n_name, 1);
4707        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4708        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4709
4710        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4711        call_tests++;
4712        des_void_ptr(n_ctx, ctx, 0);
4713        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4714        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4715        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4716        xmlResetLastError();
4717        if (mem_base != xmlMemBlocks()) {
4718            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4719	           xmlMemBlocks() - mem_base);
4720	    test_ret++;
4721            printf(" %d", n_ctx);
4722            printf(" %d", n_name);
4723            printf(" %d", n_ExternalID);
4724            printf(" %d", n_SystemID);
4725            printf("\n");
4726        }
4727    }
4728    }
4729    }
4730    }
4731    function_tests++;
4732
4733    return(test_ret);
4734}
4735
4736
4737static int
4738test_xmlSAX2IsStandalone(void) {
4739    int test_ret = 0;
4740
4741    int mem_base;
4742    int ret_val;
4743    void * ctx; /* the user data (XML parser context) */
4744    int n_ctx;
4745
4746    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4747        mem_base = xmlMemBlocks();
4748        ctx = gen_void_ptr(n_ctx, 0);
4749
4750        ret_val = xmlSAX2IsStandalone(ctx);
4751        desret_int(ret_val);
4752        call_tests++;
4753        des_void_ptr(n_ctx, ctx, 0);
4754        xmlResetLastError();
4755        if (mem_base != xmlMemBlocks()) {
4756            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4757	           xmlMemBlocks() - mem_base);
4758	    test_ret++;
4759            printf(" %d", n_ctx);
4760            printf("\n");
4761        }
4762    }
4763    function_tests++;
4764
4765    return(test_ret);
4766}
4767
4768
4769static int
4770test_xmlSAX2NotationDecl(void) {
4771    int test_ret = 0;
4772
4773    int mem_base;
4774    void * ctx; /* the user data (XML parser context) */
4775    int n_ctx;
4776    xmlChar * name; /* The name of the notation */
4777    int n_name;
4778    xmlChar * publicId; /* The public ID of the entity */
4779    int n_publicId;
4780    xmlChar * systemId; /* The system ID of the entity */
4781    int n_systemId;
4782
4783    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4784    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4785    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4786    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4787        mem_base = xmlMemBlocks();
4788        ctx = gen_void_ptr(n_ctx, 0);
4789        name = gen_const_xmlChar_ptr(n_name, 1);
4790        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4791        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4792
4793        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4794        call_tests++;
4795        des_void_ptr(n_ctx, ctx, 0);
4796        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4797        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4798        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4799        xmlResetLastError();
4800        if (mem_base != xmlMemBlocks()) {
4801            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4802	           xmlMemBlocks() - mem_base);
4803	    test_ret++;
4804            printf(" %d", n_ctx);
4805            printf(" %d", n_name);
4806            printf(" %d", n_publicId);
4807            printf(" %d", n_systemId);
4808            printf("\n");
4809        }
4810    }
4811    }
4812    }
4813    }
4814    function_tests++;
4815
4816    return(test_ret);
4817}
4818
4819
4820static int
4821test_xmlSAX2ProcessingInstruction(void) {
4822    int test_ret = 0;
4823
4824    int mem_base;
4825    void * ctx; /* the user data (XML parser context) */
4826    int n_ctx;
4827    xmlChar * target; /* the target name */
4828    int n_target;
4829    xmlChar * data; /* the PI data's */
4830    int n_data;
4831
4832    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4833    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4834    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4835        mem_base = xmlMemBlocks();
4836        ctx = gen_void_ptr(n_ctx, 0);
4837        target = gen_const_xmlChar_ptr(n_target, 1);
4838        data = gen_const_xmlChar_ptr(n_data, 2);
4839
4840        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4841        call_tests++;
4842        des_void_ptr(n_ctx, ctx, 0);
4843        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4844        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4845        xmlResetLastError();
4846        if (mem_base != xmlMemBlocks()) {
4847            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4848	           xmlMemBlocks() - mem_base);
4849	    test_ret++;
4850            printf(" %d", n_ctx);
4851            printf(" %d", n_target);
4852            printf(" %d", n_data);
4853            printf("\n");
4854        }
4855    }
4856    }
4857    }
4858    function_tests++;
4859
4860    return(test_ret);
4861}
4862
4863
4864static int
4865test_xmlSAX2Reference(void) {
4866    int test_ret = 0;
4867
4868    int mem_base;
4869    void * ctx; /* the user data (XML parser context) */
4870    int n_ctx;
4871    xmlChar * name; /* The entity name */
4872    int n_name;
4873
4874    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4875    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4876        mem_base = xmlMemBlocks();
4877        ctx = gen_void_ptr(n_ctx, 0);
4878        name = gen_const_xmlChar_ptr(n_name, 1);
4879
4880        xmlSAX2Reference(ctx, (const xmlChar *)name);
4881        call_tests++;
4882        des_void_ptr(n_ctx, ctx, 0);
4883        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4884        xmlResetLastError();
4885        if (mem_base != xmlMemBlocks()) {
4886            printf("Leak of %d blocks found in xmlSAX2Reference",
4887	           xmlMemBlocks() - mem_base);
4888	    test_ret++;
4889            printf(" %d", n_ctx);
4890            printf(" %d", n_name);
4891            printf("\n");
4892        }
4893    }
4894    }
4895    function_tests++;
4896
4897    return(test_ret);
4898}
4899
4900
4901static int
4902test_xmlSAX2ResolveEntity(void) {
4903    int test_ret = 0;
4904
4905    int mem_base;
4906    xmlParserInputPtr ret_val;
4907    void * ctx; /* the user data (XML parser context) */
4908    int n_ctx;
4909    xmlChar * publicId; /* The public ID of the entity */
4910    int n_publicId;
4911    xmlChar * systemId; /* The system ID of the entity */
4912    int n_systemId;
4913
4914    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4915    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4916    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4917        mem_base = xmlMemBlocks();
4918        ctx = gen_void_ptr(n_ctx, 0);
4919        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4920        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4921
4922        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4923        desret_xmlParserInputPtr(ret_val);
4924        call_tests++;
4925        des_void_ptr(n_ctx, ctx, 0);
4926        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4927        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4928        xmlResetLastError();
4929        if (mem_base != xmlMemBlocks()) {
4930            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4931	           xmlMemBlocks() - mem_base);
4932	    test_ret++;
4933            printf(" %d", n_ctx);
4934            printf(" %d", n_publicId);
4935            printf(" %d", n_systemId);
4936            printf("\n");
4937        }
4938    }
4939    }
4940    }
4941    function_tests++;
4942
4943    return(test_ret);
4944}
4945
4946
4947#define gen_nb_xmlSAXLocatorPtr 1
4948static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4949    return(NULL);
4950}
4951static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4952}
4953
4954static int
4955test_xmlSAX2SetDocumentLocator(void) {
4956    int test_ret = 0;
4957
4958    int mem_base;
4959    void * ctx; /* the user data (XML parser context) */
4960    int n_ctx;
4961    xmlSAXLocatorPtr loc; /* A SAX Locator */
4962    int n_loc;
4963
4964    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4965    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4966        mem_base = xmlMemBlocks();
4967        ctx = gen_void_ptr(n_ctx, 0);
4968        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4969
4970        xmlSAX2SetDocumentLocator(ctx, loc);
4971        call_tests++;
4972        des_void_ptr(n_ctx, ctx, 0);
4973        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4974        xmlResetLastError();
4975        if (mem_base != xmlMemBlocks()) {
4976            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4977	           xmlMemBlocks() - mem_base);
4978	    test_ret++;
4979            printf(" %d", n_ctx);
4980            printf(" %d", n_loc);
4981            printf("\n");
4982        }
4983    }
4984    }
4985    function_tests++;
4986
4987    return(test_ret);
4988}
4989
4990
4991static int
4992test_xmlSAX2StartDocument(void) {
4993    int test_ret = 0;
4994
4995    int mem_base;
4996    void * ctx; /* the user data (XML parser context) */
4997    int n_ctx;
4998
4999    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5000        mem_base = xmlMemBlocks();
5001        ctx = gen_void_ptr(n_ctx, 0);
5002
5003        xmlSAX2StartDocument(ctx);
5004        call_tests++;
5005        des_void_ptr(n_ctx, ctx, 0);
5006        xmlResetLastError();
5007        if (mem_base != xmlMemBlocks()) {
5008            printf("Leak of %d blocks found in xmlSAX2StartDocument",
5009	           xmlMemBlocks() - mem_base);
5010	    test_ret++;
5011            printf(" %d", n_ctx);
5012            printf("\n");
5013        }
5014    }
5015    function_tests++;
5016
5017    return(test_ret);
5018}
5019
5020
5021static int
5022test_xmlSAX2StartElement(void) {
5023    int test_ret = 0;
5024
5025#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
5026#ifdef LIBXML_SAX1_ENABLED
5027    int mem_base;
5028    void * ctx; /* the user data (XML parser context) */
5029    int n_ctx;
5030    xmlChar * fullname; /* The element name, including namespace prefix */
5031    int n_fullname;
5032    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5033    int n_atts;
5034
5035    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5036    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5037    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5038        mem_base = xmlMemBlocks();
5039        ctx = gen_void_ptr(n_ctx, 0);
5040        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5041        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5042
5043        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5044        call_tests++;
5045        des_void_ptr(n_ctx, ctx, 0);
5046        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5047        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5048        xmlResetLastError();
5049        if (mem_base != xmlMemBlocks()) {
5050            printf("Leak of %d blocks found in xmlSAX2StartElement",
5051	           xmlMemBlocks() - mem_base);
5052	    test_ret++;
5053            printf(" %d", n_ctx);
5054            printf(" %d", n_fullname);
5055            printf(" %d", n_atts);
5056            printf("\n");
5057        }
5058    }
5059    }
5060    }
5061    function_tests++;
5062#endif
5063#endif
5064
5065    return(test_ret);
5066}
5067
5068
5069static int
5070test_xmlSAX2StartElementNs(void) {
5071    int test_ret = 0;
5072
5073    int mem_base;
5074    void * ctx; /* the user data (XML parser context) */
5075    int n_ctx;
5076    xmlChar * localname; /* the local name of the element */
5077    int n_localname;
5078    xmlChar * prefix; /* the element namespace prefix if available */
5079    int n_prefix;
5080    xmlChar * URI; /* the element namespace name if available */
5081    int n_URI;
5082    int nb_namespaces; /* number of namespace definitions on that node */
5083    int n_nb_namespaces;
5084    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5085    int n_namespaces;
5086    int nb_attributes; /* the number of attributes on that node */
5087    int n_nb_attributes;
5088    int nb_defaulted; /* the number of defaulted attributes. */
5089    int n_nb_defaulted;
5090    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5091    int n_attributes;
5092
5093    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5094    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5095    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5096    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5097    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5098    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5099    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5100    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5101    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5102        mem_base = xmlMemBlocks();
5103        ctx = gen_void_ptr(n_ctx, 0);
5104        localname = gen_const_xmlChar_ptr(n_localname, 1);
5105        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5106        URI = gen_const_xmlChar_ptr(n_URI, 3);
5107        nb_namespaces = gen_int(n_nb_namespaces, 4);
5108        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5109        nb_attributes = gen_int(n_nb_attributes, 6);
5110        nb_defaulted = gen_int(n_nb_defaulted, 7);
5111        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5112
5113        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5114        call_tests++;
5115        des_void_ptr(n_ctx, ctx, 0);
5116        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5117        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5118        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5119        des_int(n_nb_namespaces, nb_namespaces, 4);
5120        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5121        des_int(n_nb_attributes, nb_attributes, 6);
5122        des_int(n_nb_defaulted, nb_defaulted, 7);
5123        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5124        xmlResetLastError();
5125        if (mem_base != xmlMemBlocks()) {
5126            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5127	           xmlMemBlocks() - mem_base);
5128	    test_ret++;
5129            printf(" %d", n_ctx);
5130            printf(" %d", n_localname);
5131            printf(" %d", n_prefix);
5132            printf(" %d", n_URI);
5133            printf(" %d", n_nb_namespaces);
5134            printf(" %d", n_namespaces);
5135            printf(" %d", n_nb_attributes);
5136            printf(" %d", n_nb_defaulted);
5137            printf(" %d", n_attributes);
5138            printf("\n");
5139        }
5140    }
5141    }
5142    }
5143    }
5144    }
5145    }
5146    }
5147    }
5148    }
5149    function_tests++;
5150
5151    return(test_ret);
5152}
5153
5154
5155static int
5156test_xmlSAX2UnparsedEntityDecl(void) {
5157    int test_ret = 0;
5158
5159    int mem_base;
5160    void * ctx; /* the user data (XML parser context) */
5161    int n_ctx;
5162    xmlChar * name; /* The name of the entity */
5163    int n_name;
5164    xmlChar * publicId; /* The public ID of the entity */
5165    int n_publicId;
5166    xmlChar * systemId; /* The system ID of the entity */
5167    int n_systemId;
5168    xmlChar * notationName; /* the name of the notation */
5169    int n_notationName;
5170
5171    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5172    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5173    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5174    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5175    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5176        mem_base = xmlMemBlocks();
5177        ctx = gen_void_ptr(n_ctx, 0);
5178        name = gen_const_xmlChar_ptr(n_name, 1);
5179        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5180        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5181        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5182
5183        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5184        call_tests++;
5185        des_void_ptr(n_ctx, ctx, 0);
5186        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5187        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5188        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5189        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5190        xmlResetLastError();
5191        if (mem_base != xmlMemBlocks()) {
5192            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5193	           xmlMemBlocks() - mem_base);
5194	    test_ret++;
5195            printf(" %d", n_ctx);
5196            printf(" %d", n_name);
5197            printf(" %d", n_publicId);
5198            printf(" %d", n_systemId);
5199            printf(" %d", n_notationName);
5200            printf("\n");
5201        }
5202    }
5203    }
5204    }
5205    }
5206    }
5207    function_tests++;
5208
5209    return(test_ret);
5210}
5211
5212
5213static int
5214test_xmlSAXDefaultVersion(void) {
5215    int test_ret = 0;
5216
5217#if defined(LIBXML_SAX1_ENABLED)
5218#ifdef LIBXML_SAX1_ENABLED
5219    int mem_base;
5220    int ret_val;
5221    int version; /* the version, 1 or 2 */
5222    int n_version;
5223
5224    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5225        mem_base = xmlMemBlocks();
5226        version = gen_int(n_version, 0);
5227
5228        ret_val = xmlSAXDefaultVersion(version);
5229        desret_int(ret_val);
5230        call_tests++;
5231        des_int(n_version, version, 0);
5232        xmlResetLastError();
5233        if (mem_base != xmlMemBlocks()) {
5234            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5235	           xmlMemBlocks() - mem_base);
5236	    test_ret++;
5237            printf(" %d", n_version);
5238            printf("\n");
5239        }
5240    }
5241    function_tests++;
5242#endif
5243#endif
5244
5245    return(test_ret);
5246}
5247
5248
5249static int
5250test_xmlSAXVersion(void) {
5251    int test_ret = 0;
5252
5253    int mem_base;
5254    int ret_val;
5255    xmlSAXHandler * hdlr; /* the SAX handler */
5256    int n_hdlr;
5257    int version; /* the version, 1 or 2 */
5258    int n_version;
5259
5260    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5261    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5262        mem_base = xmlMemBlocks();
5263        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5264        version = gen_int(n_version, 1);
5265
5266        ret_val = xmlSAXVersion(hdlr, version);
5267        desret_int(ret_val);
5268        call_tests++;
5269        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5270        des_int(n_version, version, 1);
5271        xmlResetLastError();
5272        if (mem_base != xmlMemBlocks()) {
5273            printf("Leak of %d blocks found in xmlSAXVersion",
5274	           xmlMemBlocks() - mem_base);
5275	    test_ret++;
5276            printf(" %d", n_hdlr);
5277            printf(" %d", n_version);
5278            printf("\n");
5279        }
5280    }
5281    }
5282    function_tests++;
5283
5284    return(test_ret);
5285}
5286
5287static int
5288test_SAX2(void) {
5289    int test_ret = 0;
5290
5291    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5292    test_ret += test_docbDefaultSAXHandlerInit();
5293    test_ret += test_htmlDefaultSAXHandlerInit();
5294    test_ret += test_xmlDefaultSAXHandlerInit();
5295    test_ret += test_xmlSAX2AttributeDecl();
5296    test_ret += test_xmlSAX2CDataBlock();
5297    test_ret += test_xmlSAX2Characters();
5298    test_ret += test_xmlSAX2Comment();
5299    test_ret += test_xmlSAX2ElementDecl();
5300    test_ret += test_xmlSAX2EndDocument();
5301    test_ret += test_xmlSAX2EndElement();
5302    test_ret += test_xmlSAX2EndElementNs();
5303    test_ret += test_xmlSAX2EntityDecl();
5304    test_ret += test_xmlSAX2ExternalSubset();
5305    test_ret += test_xmlSAX2GetColumnNumber();
5306    test_ret += test_xmlSAX2GetEntity();
5307    test_ret += test_xmlSAX2GetLineNumber();
5308    test_ret += test_xmlSAX2GetParameterEntity();
5309    test_ret += test_xmlSAX2GetPublicId();
5310    test_ret += test_xmlSAX2GetSystemId();
5311    test_ret += test_xmlSAX2HasExternalSubset();
5312    test_ret += test_xmlSAX2HasInternalSubset();
5313    test_ret += test_xmlSAX2IgnorableWhitespace();
5314    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5315    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5316    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5317    test_ret += test_xmlSAX2InternalSubset();
5318    test_ret += test_xmlSAX2IsStandalone();
5319    test_ret += test_xmlSAX2NotationDecl();
5320    test_ret += test_xmlSAX2ProcessingInstruction();
5321    test_ret += test_xmlSAX2Reference();
5322    test_ret += test_xmlSAX2ResolveEntity();
5323    test_ret += test_xmlSAX2SetDocumentLocator();
5324    test_ret += test_xmlSAX2StartDocument();
5325    test_ret += test_xmlSAX2StartElement();
5326    test_ret += test_xmlSAX2StartElementNs();
5327    test_ret += test_xmlSAX2UnparsedEntityDecl();
5328    test_ret += test_xmlSAXDefaultVersion();
5329    test_ret += test_xmlSAXVersion();
5330
5331    if (test_ret != 0)
5332	printf("Module SAX2: %d errors\n", test_ret);
5333    return(test_ret);
5334}
5335
5336static int
5337test_xmlC14NDocDumpMemory(void) {
5338    int test_ret = 0;
5339
5340#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5341    int mem_base;
5342    int ret_val;
5343    xmlDocPtr doc; /* the XML document for canonization */
5344    int n_doc;
5345    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5346    int n_nodes;
5347    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5348    int n_exclusive;
5349    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) */
5350    int n_inclusive_ns_prefixes;
5351    int with_comments; /* include comments in the result (!=0) or not (==0) */
5352    int n_with_comments;
5353    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 */
5354    int n_doc_txt_ptr;
5355
5356    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5357    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5358    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5359    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5360    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5361    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5362        mem_base = xmlMemBlocks();
5363        doc = gen_xmlDocPtr(n_doc, 0);
5364        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5365        exclusive = gen_int(n_exclusive, 2);
5366        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5367        with_comments = gen_int(n_with_comments, 4);
5368        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5369
5370        ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5371        desret_int(ret_val);
5372        call_tests++;
5373        des_xmlDocPtr(n_doc, doc, 0);
5374        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5375        des_int(n_exclusive, exclusive, 2);
5376        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5377        des_int(n_with_comments, with_comments, 4);
5378        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5379        xmlResetLastError();
5380        if (mem_base != xmlMemBlocks()) {
5381            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5382	           xmlMemBlocks() - mem_base);
5383	    test_ret++;
5384            printf(" %d", n_doc);
5385            printf(" %d", n_nodes);
5386            printf(" %d", n_exclusive);
5387            printf(" %d", n_inclusive_ns_prefixes);
5388            printf(" %d", n_with_comments);
5389            printf(" %d", n_doc_txt_ptr);
5390            printf("\n");
5391        }
5392    }
5393    }
5394    }
5395    }
5396    }
5397    }
5398    function_tests++;
5399#endif
5400
5401    return(test_ret);
5402}
5403
5404
5405static int
5406test_xmlC14NDocSave(void) {
5407    int test_ret = 0;
5408
5409#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5410    int mem_base;
5411    int ret_val;
5412    xmlDocPtr doc; /* the XML document for canonization */
5413    int n_doc;
5414    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5415    int n_nodes;
5416    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5417    int n_exclusive;
5418    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) */
5419    int n_inclusive_ns_prefixes;
5420    int with_comments; /* include comments in the result (!=0) or not (==0) */
5421    int n_with_comments;
5422    const char * filename; /* the filename to store canonical XML image */
5423    int n_filename;
5424    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5425    int n_compression;
5426
5427    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5428    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5429    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5430    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5431    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5432    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5433    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5434        mem_base = xmlMemBlocks();
5435        doc = gen_xmlDocPtr(n_doc, 0);
5436        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5437        exclusive = gen_int(n_exclusive, 2);
5438        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5439        with_comments = gen_int(n_with_comments, 4);
5440        filename = gen_fileoutput(n_filename, 5);
5441        compression = gen_int(n_compression, 6);
5442
5443        ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5444        desret_int(ret_val);
5445        call_tests++;
5446        des_xmlDocPtr(n_doc, doc, 0);
5447        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5448        des_int(n_exclusive, exclusive, 2);
5449        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5450        des_int(n_with_comments, with_comments, 4);
5451        des_fileoutput(n_filename, filename, 5);
5452        des_int(n_compression, compression, 6);
5453        xmlResetLastError();
5454        if (mem_base != xmlMemBlocks()) {
5455            printf("Leak of %d blocks found in xmlC14NDocSave",
5456	           xmlMemBlocks() - mem_base);
5457	    test_ret++;
5458            printf(" %d", n_doc);
5459            printf(" %d", n_nodes);
5460            printf(" %d", n_exclusive);
5461            printf(" %d", n_inclusive_ns_prefixes);
5462            printf(" %d", n_with_comments);
5463            printf(" %d", n_filename);
5464            printf(" %d", n_compression);
5465            printf("\n");
5466        }
5467    }
5468    }
5469    }
5470    }
5471    }
5472    }
5473    }
5474    function_tests++;
5475#endif
5476
5477    return(test_ret);
5478}
5479
5480
5481static int
5482test_xmlC14NDocSaveTo(void) {
5483    int test_ret = 0;
5484
5485#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5486    int mem_base;
5487    int ret_val;
5488    xmlDocPtr doc; /* the XML document for canonization */
5489    int n_doc;
5490    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5491    int n_nodes;
5492    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5493    int n_exclusive;
5494    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) */
5495    int n_inclusive_ns_prefixes;
5496    int with_comments; /* include comments in the result (!=0) or not (==0) */
5497    int n_with_comments;
5498    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5499    int n_buf;
5500
5501    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5502    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5503    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5504    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5505    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5506    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5507        mem_base = xmlMemBlocks();
5508        doc = gen_xmlDocPtr(n_doc, 0);
5509        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5510        exclusive = gen_int(n_exclusive, 2);
5511        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5512        with_comments = gen_int(n_with_comments, 4);
5513        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5514
5515        ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5516        desret_int(ret_val);
5517        call_tests++;
5518        des_xmlDocPtr(n_doc, doc, 0);
5519        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5520        des_int(n_exclusive, exclusive, 2);
5521        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5522        des_int(n_with_comments, with_comments, 4);
5523        des_xmlOutputBufferPtr(n_buf, buf, 5);
5524        xmlResetLastError();
5525        if (mem_base != xmlMemBlocks()) {
5526            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5527	           xmlMemBlocks() - mem_base);
5528	    test_ret++;
5529            printf(" %d", n_doc);
5530            printf(" %d", n_nodes);
5531            printf(" %d", n_exclusive);
5532            printf(" %d", n_inclusive_ns_prefixes);
5533            printf(" %d", n_with_comments);
5534            printf(" %d", n_buf);
5535            printf("\n");
5536        }
5537    }
5538    }
5539    }
5540    }
5541    }
5542    }
5543    function_tests++;
5544#endif
5545
5546    return(test_ret);
5547}
5548
5549
5550static int
5551test_xmlC14NExecute(void) {
5552    int test_ret = 0;
5553
5554
5555    /* missing type support */
5556    return(test_ret);
5557}
5558
5559static int
5560test_c14n(void) {
5561    int test_ret = 0;
5562
5563    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5564    test_ret += test_xmlC14NDocDumpMemory();
5565    test_ret += test_xmlC14NDocSave();
5566    test_ret += test_xmlC14NDocSaveTo();
5567    test_ret += test_xmlC14NExecute();
5568
5569    if (test_ret != 0)
5570	printf("Module c14n: %d errors\n", test_ret);
5571    return(test_ret);
5572}
5573#ifdef LIBXML_CATALOG_ENABLED
5574
5575#define gen_nb_xmlCatalogPtr 1
5576static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5577    return(NULL);
5578}
5579static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5580}
5581#endif
5582
5583
5584static int
5585test_xmlACatalogAdd(void) {
5586    int test_ret = 0;
5587
5588#if defined(LIBXML_CATALOG_ENABLED)
5589    int mem_base;
5590    int ret_val;
5591    xmlCatalogPtr catal; /* a Catalog */
5592    int n_catal;
5593    xmlChar * type; /* the type of record to add to the catalog */
5594    int n_type;
5595    xmlChar * orig; /* the system, public or prefix to match */
5596    int n_orig;
5597    xmlChar * replace; /* the replacement value for the match */
5598    int n_replace;
5599
5600    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5601    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5602    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5603    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5604        mem_base = xmlMemBlocks();
5605        catal = gen_xmlCatalogPtr(n_catal, 0);
5606        type = gen_const_xmlChar_ptr(n_type, 1);
5607        orig = gen_const_xmlChar_ptr(n_orig, 2);
5608        replace = gen_const_xmlChar_ptr(n_replace, 3);
5609
5610        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5611        desret_int(ret_val);
5612        call_tests++;
5613        des_xmlCatalogPtr(n_catal, catal, 0);
5614        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5615        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5616        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5617        xmlResetLastError();
5618        if (mem_base != xmlMemBlocks()) {
5619            printf("Leak of %d blocks found in xmlACatalogAdd",
5620	           xmlMemBlocks() - mem_base);
5621	    test_ret++;
5622            printf(" %d", n_catal);
5623            printf(" %d", n_type);
5624            printf(" %d", n_orig);
5625            printf(" %d", n_replace);
5626            printf("\n");
5627        }
5628    }
5629    }
5630    }
5631    }
5632    function_tests++;
5633#endif
5634
5635    return(test_ret);
5636}
5637
5638
5639static int
5640test_xmlACatalogDump(void) {
5641    int test_ret = 0;
5642
5643#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5644    int mem_base;
5645    xmlCatalogPtr catal; /* a Catalog */
5646    int n_catal;
5647    FILE * out; /* the file. */
5648    int n_out;
5649
5650    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5651    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5652        mem_base = xmlMemBlocks();
5653        catal = gen_xmlCatalogPtr(n_catal, 0);
5654        out = gen_FILE_ptr(n_out, 1);
5655
5656        xmlACatalogDump(catal, out);
5657        call_tests++;
5658        des_xmlCatalogPtr(n_catal, catal, 0);
5659        des_FILE_ptr(n_out, out, 1);
5660        xmlResetLastError();
5661        if (mem_base != xmlMemBlocks()) {
5662            printf("Leak of %d blocks found in xmlACatalogDump",
5663	           xmlMemBlocks() - mem_base);
5664	    test_ret++;
5665            printf(" %d", n_catal);
5666            printf(" %d", n_out);
5667            printf("\n");
5668        }
5669    }
5670    }
5671    function_tests++;
5672#endif
5673
5674    return(test_ret);
5675}
5676
5677
5678static int
5679test_xmlACatalogRemove(void) {
5680    int test_ret = 0;
5681
5682#if defined(LIBXML_CATALOG_ENABLED)
5683    int mem_base;
5684    int ret_val;
5685    xmlCatalogPtr catal; /* a Catalog */
5686    int n_catal;
5687    xmlChar * value; /* the value to remove */
5688    int n_value;
5689
5690    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5691    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5692        mem_base = xmlMemBlocks();
5693        catal = gen_xmlCatalogPtr(n_catal, 0);
5694        value = gen_const_xmlChar_ptr(n_value, 1);
5695
5696        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5697        desret_int(ret_val);
5698        call_tests++;
5699        des_xmlCatalogPtr(n_catal, catal, 0);
5700        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5701        xmlResetLastError();
5702        if (mem_base != xmlMemBlocks()) {
5703            printf("Leak of %d blocks found in xmlACatalogRemove",
5704	           xmlMemBlocks() - mem_base);
5705	    test_ret++;
5706            printf(" %d", n_catal);
5707            printf(" %d", n_value);
5708            printf("\n");
5709        }
5710    }
5711    }
5712    function_tests++;
5713#endif
5714
5715    return(test_ret);
5716}
5717
5718
5719static int
5720test_xmlACatalogResolve(void) {
5721    int test_ret = 0;
5722
5723#if defined(LIBXML_CATALOG_ENABLED)
5724    int mem_base;
5725    xmlChar * ret_val;
5726    xmlCatalogPtr catal; /* a Catalog */
5727    int n_catal;
5728    xmlChar * pubID; /* the public ID string */
5729    int n_pubID;
5730    xmlChar * sysID; /* the system ID string */
5731    int n_sysID;
5732
5733    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5734    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5735    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5736        mem_base = xmlMemBlocks();
5737        catal = gen_xmlCatalogPtr(n_catal, 0);
5738        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5739        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5740
5741        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5742        desret_xmlChar_ptr(ret_val);
5743        call_tests++;
5744        des_xmlCatalogPtr(n_catal, catal, 0);
5745        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5746        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5747        xmlResetLastError();
5748        if (mem_base != xmlMemBlocks()) {
5749            printf("Leak of %d blocks found in xmlACatalogResolve",
5750	           xmlMemBlocks() - mem_base);
5751	    test_ret++;
5752            printf(" %d", n_catal);
5753            printf(" %d", n_pubID);
5754            printf(" %d", n_sysID);
5755            printf("\n");
5756        }
5757    }
5758    }
5759    }
5760    function_tests++;
5761#endif
5762
5763    return(test_ret);
5764}
5765
5766
5767static int
5768test_xmlACatalogResolvePublic(void) {
5769    int test_ret = 0;
5770
5771#if defined(LIBXML_CATALOG_ENABLED)
5772    int mem_base;
5773    xmlChar * ret_val;
5774    xmlCatalogPtr catal; /* a Catalog */
5775    int n_catal;
5776    xmlChar * pubID; /* the public ID string */
5777    int n_pubID;
5778
5779    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5780    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5781        mem_base = xmlMemBlocks();
5782        catal = gen_xmlCatalogPtr(n_catal, 0);
5783        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5784
5785        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5786        desret_xmlChar_ptr(ret_val);
5787        call_tests++;
5788        des_xmlCatalogPtr(n_catal, catal, 0);
5789        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5790        xmlResetLastError();
5791        if (mem_base != xmlMemBlocks()) {
5792            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5793	           xmlMemBlocks() - mem_base);
5794	    test_ret++;
5795            printf(" %d", n_catal);
5796            printf(" %d", n_pubID);
5797            printf("\n");
5798        }
5799    }
5800    }
5801    function_tests++;
5802#endif
5803
5804    return(test_ret);
5805}
5806
5807
5808static int
5809test_xmlACatalogResolveSystem(void) {
5810    int test_ret = 0;
5811
5812#if defined(LIBXML_CATALOG_ENABLED)
5813    int mem_base;
5814    xmlChar * ret_val;
5815    xmlCatalogPtr catal; /* a Catalog */
5816    int n_catal;
5817    xmlChar * sysID; /* the system ID string */
5818    int n_sysID;
5819
5820    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5821    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5822        mem_base = xmlMemBlocks();
5823        catal = gen_xmlCatalogPtr(n_catal, 0);
5824        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5825
5826        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5827        desret_xmlChar_ptr(ret_val);
5828        call_tests++;
5829        des_xmlCatalogPtr(n_catal, catal, 0);
5830        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5831        xmlResetLastError();
5832        if (mem_base != xmlMemBlocks()) {
5833            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5834	           xmlMemBlocks() - mem_base);
5835	    test_ret++;
5836            printf(" %d", n_catal);
5837            printf(" %d", n_sysID);
5838            printf("\n");
5839        }
5840    }
5841    }
5842    function_tests++;
5843#endif
5844
5845    return(test_ret);
5846}
5847
5848
5849static int
5850test_xmlACatalogResolveURI(void) {
5851    int test_ret = 0;
5852
5853#if defined(LIBXML_CATALOG_ENABLED)
5854    int mem_base;
5855    xmlChar * ret_val;
5856    xmlCatalogPtr catal; /* a Catalog */
5857    int n_catal;
5858    xmlChar * URI; /* the URI */
5859    int n_URI;
5860
5861    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5862    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5863        mem_base = xmlMemBlocks();
5864        catal = gen_xmlCatalogPtr(n_catal, 0);
5865        URI = gen_const_xmlChar_ptr(n_URI, 1);
5866
5867        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5868        desret_xmlChar_ptr(ret_val);
5869        call_tests++;
5870        des_xmlCatalogPtr(n_catal, catal, 0);
5871        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5872        xmlResetLastError();
5873        if (mem_base != xmlMemBlocks()) {
5874            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5875	           xmlMemBlocks() - mem_base);
5876	    test_ret++;
5877            printf(" %d", n_catal);
5878            printf(" %d", n_URI);
5879            printf("\n");
5880        }
5881    }
5882    }
5883    function_tests++;
5884#endif
5885
5886    return(test_ret);
5887}
5888
5889
5890static int
5891test_xmlCatalogAdd(void) {
5892    int test_ret = 0;
5893
5894#if defined(LIBXML_CATALOG_ENABLED)
5895    int mem_base;
5896    int ret_val;
5897    xmlChar * type; /* the type of record to add to the catalog */
5898    int n_type;
5899    xmlChar * orig; /* the system, public or prefix to match */
5900    int n_orig;
5901    xmlChar * replace; /* the replacement value for the match */
5902    int n_replace;
5903
5904    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5905    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5906    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5907        mem_base = xmlMemBlocks();
5908        type = gen_const_xmlChar_ptr(n_type, 0);
5909        orig = gen_const_xmlChar_ptr(n_orig, 1);
5910        replace = gen_const_xmlChar_ptr(n_replace, 2);
5911
5912        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5913        desret_int(ret_val);
5914        call_tests++;
5915        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5916        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5917        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5918        xmlResetLastError();
5919        if (mem_base != xmlMemBlocks()) {
5920            printf("Leak of %d blocks found in xmlCatalogAdd",
5921	           xmlMemBlocks() - mem_base);
5922	    test_ret++;
5923            printf(" %d", n_type);
5924            printf(" %d", n_orig);
5925            printf(" %d", n_replace);
5926            printf("\n");
5927        }
5928    }
5929    }
5930    }
5931    function_tests++;
5932#endif
5933
5934    return(test_ret);
5935}
5936
5937
5938static int
5939test_xmlCatalogCleanup(void) {
5940    int test_ret = 0;
5941
5942#if defined(LIBXML_CATALOG_ENABLED)
5943
5944
5945        xmlCatalogCleanup();
5946        call_tests++;
5947        xmlResetLastError();
5948    function_tests++;
5949#endif
5950
5951    return(test_ret);
5952}
5953
5954
5955static int
5956test_xmlCatalogConvert(void) {
5957    int test_ret = 0;
5958
5959#if defined(LIBXML_CATALOG_ENABLED)
5960    int ret_val;
5961
5962
5963        ret_val = xmlCatalogConvert();
5964        desret_int(ret_val);
5965        call_tests++;
5966        xmlResetLastError();
5967    function_tests++;
5968#endif
5969
5970    return(test_ret);
5971}
5972
5973
5974static int
5975test_xmlCatalogDump(void) {
5976    int test_ret = 0;
5977
5978#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5979    int mem_base;
5980    FILE * out; /* the file. */
5981    int n_out;
5982
5983    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5984        mem_base = xmlMemBlocks();
5985        out = gen_FILE_ptr(n_out, 0);
5986
5987        xmlCatalogDump(out);
5988        call_tests++;
5989        des_FILE_ptr(n_out, out, 0);
5990        xmlResetLastError();
5991        if (mem_base != xmlMemBlocks()) {
5992            printf("Leak of %d blocks found in xmlCatalogDump",
5993	           xmlMemBlocks() - mem_base);
5994	    test_ret++;
5995            printf(" %d", n_out);
5996            printf("\n");
5997        }
5998    }
5999    function_tests++;
6000#endif
6001
6002    return(test_ret);
6003}
6004
6005
6006static int
6007test_xmlCatalogGetDefaults(void) {
6008    int test_ret = 0;
6009
6010#if defined(LIBXML_CATALOG_ENABLED)
6011    int mem_base;
6012    xmlCatalogAllow ret_val;
6013
6014        mem_base = xmlMemBlocks();
6015
6016        ret_val = xmlCatalogGetDefaults();
6017        desret_xmlCatalogAllow(ret_val);
6018        call_tests++;
6019        xmlResetLastError();
6020        if (mem_base != xmlMemBlocks()) {
6021            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6022	           xmlMemBlocks() - mem_base);
6023	    test_ret++;
6024            printf("\n");
6025        }
6026    function_tests++;
6027#endif
6028
6029    return(test_ret);
6030}
6031
6032
6033static int
6034test_xmlCatalogIsEmpty(void) {
6035    int test_ret = 0;
6036
6037#if defined(LIBXML_CATALOG_ENABLED)
6038    int mem_base;
6039    int ret_val;
6040    xmlCatalogPtr catal; /* should this create an SGML catalog */
6041    int n_catal;
6042
6043    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6044        mem_base = xmlMemBlocks();
6045        catal = gen_xmlCatalogPtr(n_catal, 0);
6046
6047        ret_val = xmlCatalogIsEmpty(catal);
6048        desret_int(ret_val);
6049        call_tests++;
6050        des_xmlCatalogPtr(n_catal, catal, 0);
6051        xmlResetLastError();
6052        if (mem_base != xmlMemBlocks()) {
6053            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6054	           xmlMemBlocks() - mem_base);
6055	    test_ret++;
6056            printf(" %d", n_catal);
6057            printf("\n");
6058        }
6059    }
6060    function_tests++;
6061#endif
6062
6063    return(test_ret);
6064}
6065
6066
6067static int
6068test_xmlCatalogLocalResolve(void) {
6069    int test_ret = 0;
6070
6071#if defined(LIBXML_CATALOG_ENABLED)
6072    int mem_base;
6073    xmlChar * ret_val;
6074    void * catalogs; /* a document's list of catalogs */
6075    int n_catalogs;
6076    xmlChar * pubID; /* the public ID string */
6077    int n_pubID;
6078    xmlChar * sysID; /* the system ID string */
6079    int n_sysID;
6080
6081    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6082    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6083    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6084        mem_base = xmlMemBlocks();
6085        catalogs = gen_void_ptr(n_catalogs, 0);
6086        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6087        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6088
6089        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6090        desret_xmlChar_ptr(ret_val);
6091        call_tests++;
6092        des_void_ptr(n_catalogs, catalogs, 0);
6093        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6094        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6095        xmlResetLastError();
6096        if (mem_base != xmlMemBlocks()) {
6097            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6098	           xmlMemBlocks() - mem_base);
6099	    test_ret++;
6100            printf(" %d", n_catalogs);
6101            printf(" %d", n_pubID);
6102            printf(" %d", n_sysID);
6103            printf("\n");
6104        }
6105    }
6106    }
6107    }
6108    function_tests++;
6109#endif
6110
6111    return(test_ret);
6112}
6113
6114
6115static int
6116test_xmlCatalogLocalResolveURI(void) {
6117    int test_ret = 0;
6118
6119#if defined(LIBXML_CATALOG_ENABLED)
6120    int mem_base;
6121    xmlChar * ret_val;
6122    void * catalogs; /* a document's list of catalogs */
6123    int n_catalogs;
6124    xmlChar * URI; /* the URI */
6125    int n_URI;
6126
6127    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6128    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6129        mem_base = xmlMemBlocks();
6130        catalogs = gen_void_ptr(n_catalogs, 0);
6131        URI = gen_const_xmlChar_ptr(n_URI, 1);
6132
6133        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6134        desret_xmlChar_ptr(ret_val);
6135        call_tests++;
6136        des_void_ptr(n_catalogs, catalogs, 0);
6137        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6138        xmlResetLastError();
6139        if (mem_base != xmlMemBlocks()) {
6140            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6141	           xmlMemBlocks() - mem_base);
6142	    test_ret++;
6143            printf(" %d", n_catalogs);
6144            printf(" %d", n_URI);
6145            printf("\n");
6146        }
6147    }
6148    }
6149    function_tests++;
6150#endif
6151
6152    return(test_ret);
6153}
6154
6155
6156static int
6157test_xmlCatalogRemove(void) {
6158    int test_ret = 0;
6159
6160#if defined(LIBXML_CATALOG_ENABLED)
6161    int ret_val;
6162    xmlChar * value; /* the value to remove */
6163    int n_value;
6164
6165    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6166        value = gen_const_xmlChar_ptr(n_value, 0);
6167
6168        ret_val = xmlCatalogRemove((const xmlChar *)value);
6169        desret_int(ret_val);
6170        call_tests++;
6171        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6172        xmlResetLastError();
6173    }
6174    function_tests++;
6175#endif
6176
6177    return(test_ret);
6178}
6179
6180
6181static int
6182test_xmlCatalogResolve(void) {
6183    int test_ret = 0;
6184
6185#if defined(LIBXML_CATALOG_ENABLED)
6186    xmlChar * ret_val;
6187    xmlChar * pubID; /* the public ID string */
6188    int n_pubID;
6189    xmlChar * sysID; /* the system ID string */
6190    int n_sysID;
6191
6192    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6193    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6194        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6195        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6196
6197        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6198        desret_xmlChar_ptr(ret_val);
6199        call_tests++;
6200        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6201        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6202        xmlResetLastError();
6203    }
6204    }
6205    function_tests++;
6206#endif
6207
6208    return(test_ret);
6209}
6210
6211
6212static int
6213test_xmlCatalogResolvePublic(void) {
6214    int test_ret = 0;
6215
6216#if defined(LIBXML_CATALOG_ENABLED)
6217    int mem_base;
6218    xmlChar * ret_val;
6219    xmlChar * pubID; /* the public ID string */
6220    int n_pubID;
6221
6222    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6223        mem_base = xmlMemBlocks();
6224        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6225
6226        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6227        desret_xmlChar_ptr(ret_val);
6228        call_tests++;
6229        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6230        xmlResetLastError();
6231        if (mem_base != xmlMemBlocks()) {
6232            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6233	           xmlMemBlocks() - mem_base);
6234	    test_ret++;
6235            printf(" %d", n_pubID);
6236            printf("\n");
6237        }
6238    }
6239    function_tests++;
6240#endif
6241
6242    return(test_ret);
6243}
6244
6245
6246static int
6247test_xmlCatalogResolveSystem(void) {
6248    int test_ret = 0;
6249
6250#if defined(LIBXML_CATALOG_ENABLED)
6251    int mem_base;
6252    xmlChar * ret_val;
6253    xmlChar * sysID; /* the system ID string */
6254    int n_sysID;
6255
6256    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6257        mem_base = xmlMemBlocks();
6258        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6259
6260        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6261        desret_xmlChar_ptr(ret_val);
6262        call_tests++;
6263        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6264        xmlResetLastError();
6265        if (mem_base != xmlMemBlocks()) {
6266            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6267	           xmlMemBlocks() - mem_base);
6268	    test_ret++;
6269            printf(" %d", n_sysID);
6270            printf("\n");
6271        }
6272    }
6273    function_tests++;
6274#endif
6275
6276    return(test_ret);
6277}
6278
6279
6280static int
6281test_xmlCatalogResolveURI(void) {
6282    int test_ret = 0;
6283
6284#if defined(LIBXML_CATALOG_ENABLED)
6285    int mem_base;
6286    xmlChar * ret_val;
6287    xmlChar * URI; /* the URI */
6288    int n_URI;
6289
6290    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6291        mem_base = xmlMemBlocks();
6292        URI = gen_const_xmlChar_ptr(n_URI, 0);
6293
6294        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6295        desret_xmlChar_ptr(ret_val);
6296        call_tests++;
6297        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6298        xmlResetLastError();
6299        if (mem_base != xmlMemBlocks()) {
6300            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6301	           xmlMemBlocks() - mem_base);
6302	    test_ret++;
6303            printf(" %d", n_URI);
6304            printf("\n");
6305        }
6306    }
6307    function_tests++;
6308#endif
6309
6310    return(test_ret);
6311}
6312
6313
6314static int
6315test_xmlCatalogSetDefaultPrefer(void) {
6316    int test_ret = 0;
6317
6318#if defined(LIBXML_CATALOG_ENABLED)
6319    int mem_base;
6320    xmlCatalogPrefer ret_val;
6321    xmlCatalogPrefer prefer; /* the default preference for delegation */
6322    int n_prefer;
6323
6324    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6325        mem_base = xmlMemBlocks();
6326        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6327
6328        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6329        desret_xmlCatalogPrefer(ret_val);
6330        call_tests++;
6331        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6332        xmlResetLastError();
6333        if (mem_base != xmlMemBlocks()) {
6334            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6335	           xmlMemBlocks() - mem_base);
6336	    test_ret++;
6337            printf(" %d", n_prefer);
6338            printf("\n");
6339        }
6340    }
6341    function_tests++;
6342#endif
6343
6344    return(test_ret);
6345}
6346
6347
6348static int
6349test_xmlCatalogSetDefaults(void) {
6350    int test_ret = 0;
6351
6352#if defined(LIBXML_CATALOG_ENABLED)
6353    int mem_base;
6354    xmlCatalogAllow allow; /* what catalogs should be accepted */
6355    int n_allow;
6356
6357    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6358        mem_base = xmlMemBlocks();
6359        allow = gen_xmlCatalogAllow(n_allow, 0);
6360
6361        xmlCatalogSetDefaults(allow);
6362        call_tests++;
6363        des_xmlCatalogAllow(n_allow, allow, 0);
6364        xmlResetLastError();
6365        if (mem_base != xmlMemBlocks()) {
6366            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6367	           xmlMemBlocks() - mem_base);
6368	    test_ret++;
6369            printf(" %d", n_allow);
6370            printf("\n");
6371        }
6372    }
6373    function_tests++;
6374#endif
6375
6376    return(test_ret);
6377}
6378
6379
6380static int
6381test_xmlConvertSGMLCatalog(void) {
6382    int test_ret = 0;
6383
6384#if defined(LIBXML_CATALOG_ENABLED)
6385    int mem_base;
6386    int ret_val;
6387    xmlCatalogPtr catal; /* the catalog */
6388    int n_catal;
6389
6390    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6391        mem_base = xmlMemBlocks();
6392        catal = gen_xmlCatalogPtr(n_catal, 0);
6393
6394        ret_val = xmlConvertSGMLCatalog(catal);
6395        desret_int(ret_val);
6396        call_tests++;
6397        des_xmlCatalogPtr(n_catal, catal, 0);
6398        xmlResetLastError();
6399        if (mem_base != xmlMemBlocks()) {
6400            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6401	           xmlMemBlocks() - mem_base);
6402	    test_ret++;
6403            printf(" %d", n_catal);
6404            printf("\n");
6405        }
6406    }
6407    function_tests++;
6408#endif
6409
6410    return(test_ret);
6411}
6412
6413
6414static int
6415test_xmlInitializeCatalog(void) {
6416    int test_ret = 0;
6417
6418#if defined(LIBXML_CATALOG_ENABLED)
6419    int mem_base;
6420
6421        mem_base = xmlMemBlocks();
6422
6423        xmlInitializeCatalog();
6424        call_tests++;
6425        xmlResetLastError();
6426        if (mem_base != xmlMemBlocks()) {
6427            printf("Leak of %d blocks found in xmlInitializeCatalog",
6428	           xmlMemBlocks() - mem_base);
6429	    test_ret++;
6430            printf("\n");
6431        }
6432    function_tests++;
6433#endif
6434
6435    return(test_ret);
6436}
6437
6438
6439static int
6440test_xmlLoadACatalog(void) {
6441    int test_ret = 0;
6442
6443
6444    /* missing type support */
6445    return(test_ret);
6446}
6447
6448
6449static int
6450test_xmlLoadCatalog(void) {
6451    int test_ret = 0;
6452
6453#if defined(LIBXML_CATALOG_ENABLED)
6454    int ret_val;
6455    const char * filename; /* a file path */
6456    int n_filename;
6457
6458    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6459        filename = gen_filepath(n_filename, 0);
6460
6461        ret_val = xmlLoadCatalog(filename);
6462        desret_int(ret_val);
6463        call_tests++;
6464        des_filepath(n_filename, filename, 0);
6465        xmlResetLastError();
6466    }
6467    function_tests++;
6468#endif
6469
6470    return(test_ret);
6471}
6472
6473
6474static int
6475test_xmlLoadCatalogs(void) {
6476    int test_ret = 0;
6477
6478#if defined(LIBXML_CATALOG_ENABLED)
6479    char * pathss; /* a list of directories separated by a colon or a space. */
6480    int n_pathss;
6481
6482    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6483        pathss = gen_const_char_ptr(n_pathss, 0);
6484
6485        xmlLoadCatalogs((const char *)pathss);
6486        call_tests++;
6487        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6488        xmlResetLastError();
6489    }
6490    function_tests++;
6491#endif
6492
6493    return(test_ret);
6494}
6495
6496
6497static int
6498test_xmlLoadSGMLSuperCatalog(void) {
6499    int test_ret = 0;
6500
6501
6502    /* missing type support */
6503    return(test_ret);
6504}
6505
6506
6507static int
6508test_xmlNewCatalog(void) {
6509    int test_ret = 0;
6510
6511
6512    /* missing type support */
6513    return(test_ret);
6514}
6515
6516
6517static int
6518test_xmlParseCatalogFile(void) {
6519    int test_ret = 0;
6520
6521#if defined(LIBXML_CATALOG_ENABLED)
6522    int mem_base;
6523    xmlDocPtr ret_val;
6524    const char * filename; /* the filename */
6525    int n_filename;
6526
6527    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6528        mem_base = xmlMemBlocks();
6529        filename = gen_filepath(n_filename, 0);
6530
6531        ret_val = xmlParseCatalogFile(filename);
6532        desret_xmlDocPtr(ret_val);
6533        call_tests++;
6534        des_filepath(n_filename, filename, 0);
6535        xmlResetLastError();
6536        if (mem_base != xmlMemBlocks()) {
6537            printf("Leak of %d blocks found in xmlParseCatalogFile",
6538	           xmlMemBlocks() - mem_base);
6539	    test_ret++;
6540            printf(" %d", n_filename);
6541            printf("\n");
6542        }
6543    }
6544    function_tests++;
6545#endif
6546
6547    return(test_ret);
6548}
6549
6550static int
6551test_catalog(void) {
6552    int test_ret = 0;
6553
6554    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6555    test_ret += test_xmlACatalogAdd();
6556    test_ret += test_xmlACatalogDump();
6557    test_ret += test_xmlACatalogRemove();
6558    test_ret += test_xmlACatalogResolve();
6559    test_ret += test_xmlACatalogResolvePublic();
6560    test_ret += test_xmlACatalogResolveSystem();
6561    test_ret += test_xmlACatalogResolveURI();
6562    test_ret += test_xmlCatalogAdd();
6563    test_ret += test_xmlCatalogCleanup();
6564    test_ret += test_xmlCatalogConvert();
6565    test_ret += test_xmlCatalogDump();
6566    test_ret += test_xmlCatalogGetDefaults();
6567    test_ret += test_xmlCatalogIsEmpty();
6568    test_ret += test_xmlCatalogLocalResolve();
6569    test_ret += test_xmlCatalogLocalResolveURI();
6570    test_ret += test_xmlCatalogRemove();
6571    test_ret += test_xmlCatalogResolve();
6572    test_ret += test_xmlCatalogResolvePublic();
6573    test_ret += test_xmlCatalogResolveSystem();
6574    test_ret += test_xmlCatalogResolveURI();
6575    test_ret += test_xmlCatalogSetDefaultPrefer();
6576    test_ret += test_xmlCatalogSetDefaults();
6577    test_ret += test_xmlConvertSGMLCatalog();
6578    test_ret += test_xmlInitializeCatalog();
6579    test_ret += test_xmlLoadACatalog();
6580    test_ret += test_xmlLoadCatalog();
6581    test_ret += test_xmlLoadCatalogs();
6582    test_ret += test_xmlLoadSGMLSuperCatalog();
6583    test_ret += test_xmlNewCatalog();
6584    test_ret += test_xmlParseCatalogFile();
6585
6586    if (test_ret != 0)
6587	printf("Module catalog: %d errors\n", test_ret);
6588    return(test_ret);
6589}
6590
6591#define gen_nb_const_xmlChRangeGroup_ptr 1
6592static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6593    return(NULL);
6594}
6595static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6596}
6597
6598static int
6599test_xmlCharInRange(void) {
6600    int test_ret = 0;
6601
6602    int mem_base;
6603    int ret_val;
6604    unsigned int val; /* character to be validated */
6605    int n_val;
6606    xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6607    int n_rptr;
6608
6609    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6610    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6611        mem_base = xmlMemBlocks();
6612        val = gen_unsigned_int(n_val, 0);
6613        rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6614
6615        ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6616        desret_int(ret_val);
6617        call_tests++;
6618        des_unsigned_int(n_val, val, 0);
6619        des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6620        xmlResetLastError();
6621        if (mem_base != xmlMemBlocks()) {
6622            printf("Leak of %d blocks found in xmlCharInRange",
6623	           xmlMemBlocks() - mem_base);
6624	    test_ret++;
6625            printf(" %d", n_val);
6626            printf(" %d", n_rptr);
6627            printf("\n");
6628        }
6629    }
6630    }
6631    function_tests++;
6632
6633    return(test_ret);
6634}
6635
6636
6637static int
6638test_xmlIsBaseChar(void) {
6639    int test_ret = 0;
6640
6641    int mem_base;
6642    int ret_val;
6643    unsigned int ch; /* character to validate */
6644    int n_ch;
6645
6646    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6647        mem_base = xmlMemBlocks();
6648        ch = gen_unsigned_int(n_ch, 0);
6649
6650        ret_val = xmlIsBaseChar(ch);
6651        desret_int(ret_val);
6652        call_tests++;
6653        des_unsigned_int(n_ch, ch, 0);
6654        xmlResetLastError();
6655        if (mem_base != xmlMemBlocks()) {
6656            printf("Leak of %d blocks found in xmlIsBaseChar",
6657	           xmlMemBlocks() - mem_base);
6658	    test_ret++;
6659            printf(" %d", n_ch);
6660            printf("\n");
6661        }
6662    }
6663    function_tests++;
6664
6665    return(test_ret);
6666}
6667
6668
6669static int
6670test_xmlIsBlank(void) {
6671    int test_ret = 0;
6672
6673    int mem_base;
6674    int ret_val;
6675    unsigned int ch; /* character to validate */
6676    int n_ch;
6677
6678    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6679        mem_base = xmlMemBlocks();
6680        ch = gen_unsigned_int(n_ch, 0);
6681
6682        ret_val = xmlIsBlank(ch);
6683        desret_int(ret_val);
6684        call_tests++;
6685        des_unsigned_int(n_ch, ch, 0);
6686        xmlResetLastError();
6687        if (mem_base != xmlMemBlocks()) {
6688            printf("Leak of %d blocks found in xmlIsBlank",
6689	           xmlMemBlocks() - mem_base);
6690	    test_ret++;
6691            printf(" %d", n_ch);
6692            printf("\n");
6693        }
6694    }
6695    function_tests++;
6696
6697    return(test_ret);
6698}
6699
6700
6701static int
6702test_xmlIsChar(void) {
6703    int test_ret = 0;
6704
6705    int mem_base;
6706    int ret_val;
6707    unsigned int ch; /* character to validate */
6708    int n_ch;
6709
6710    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6711        mem_base = xmlMemBlocks();
6712        ch = gen_unsigned_int(n_ch, 0);
6713
6714        ret_val = xmlIsChar(ch);
6715        desret_int(ret_val);
6716        call_tests++;
6717        des_unsigned_int(n_ch, ch, 0);
6718        xmlResetLastError();
6719        if (mem_base != xmlMemBlocks()) {
6720            printf("Leak of %d blocks found in xmlIsChar",
6721	           xmlMemBlocks() - mem_base);
6722	    test_ret++;
6723            printf(" %d", n_ch);
6724            printf("\n");
6725        }
6726    }
6727    function_tests++;
6728
6729    return(test_ret);
6730}
6731
6732
6733static int
6734test_xmlIsCombining(void) {
6735    int test_ret = 0;
6736
6737    int mem_base;
6738    int ret_val;
6739    unsigned int ch; /* character to validate */
6740    int n_ch;
6741
6742    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6743        mem_base = xmlMemBlocks();
6744        ch = gen_unsigned_int(n_ch, 0);
6745
6746        ret_val = xmlIsCombining(ch);
6747        desret_int(ret_val);
6748        call_tests++;
6749        des_unsigned_int(n_ch, ch, 0);
6750        xmlResetLastError();
6751        if (mem_base != xmlMemBlocks()) {
6752            printf("Leak of %d blocks found in xmlIsCombining",
6753	           xmlMemBlocks() - mem_base);
6754	    test_ret++;
6755            printf(" %d", n_ch);
6756            printf("\n");
6757        }
6758    }
6759    function_tests++;
6760
6761    return(test_ret);
6762}
6763
6764
6765static int
6766test_xmlIsDigit(void) {
6767    int test_ret = 0;
6768
6769    int mem_base;
6770    int ret_val;
6771    unsigned int ch; /* character to validate */
6772    int n_ch;
6773
6774    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6775        mem_base = xmlMemBlocks();
6776        ch = gen_unsigned_int(n_ch, 0);
6777
6778        ret_val = xmlIsDigit(ch);
6779        desret_int(ret_val);
6780        call_tests++;
6781        des_unsigned_int(n_ch, ch, 0);
6782        xmlResetLastError();
6783        if (mem_base != xmlMemBlocks()) {
6784            printf("Leak of %d blocks found in xmlIsDigit",
6785	           xmlMemBlocks() - mem_base);
6786	    test_ret++;
6787            printf(" %d", n_ch);
6788            printf("\n");
6789        }
6790    }
6791    function_tests++;
6792
6793    return(test_ret);
6794}
6795
6796
6797static int
6798test_xmlIsExtender(void) {
6799    int test_ret = 0;
6800
6801    int mem_base;
6802    int ret_val;
6803    unsigned int ch; /* character to validate */
6804    int n_ch;
6805
6806    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6807        mem_base = xmlMemBlocks();
6808        ch = gen_unsigned_int(n_ch, 0);
6809
6810        ret_val = xmlIsExtender(ch);
6811        desret_int(ret_val);
6812        call_tests++;
6813        des_unsigned_int(n_ch, ch, 0);
6814        xmlResetLastError();
6815        if (mem_base != xmlMemBlocks()) {
6816            printf("Leak of %d blocks found in xmlIsExtender",
6817	           xmlMemBlocks() - mem_base);
6818	    test_ret++;
6819            printf(" %d", n_ch);
6820            printf("\n");
6821        }
6822    }
6823    function_tests++;
6824
6825    return(test_ret);
6826}
6827
6828
6829static int
6830test_xmlIsIdeographic(void) {
6831    int test_ret = 0;
6832
6833    int mem_base;
6834    int ret_val;
6835    unsigned int ch; /* character to validate */
6836    int n_ch;
6837
6838    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6839        mem_base = xmlMemBlocks();
6840        ch = gen_unsigned_int(n_ch, 0);
6841
6842        ret_val = xmlIsIdeographic(ch);
6843        desret_int(ret_val);
6844        call_tests++;
6845        des_unsigned_int(n_ch, ch, 0);
6846        xmlResetLastError();
6847        if (mem_base != xmlMemBlocks()) {
6848            printf("Leak of %d blocks found in xmlIsIdeographic",
6849	           xmlMemBlocks() - mem_base);
6850	    test_ret++;
6851            printf(" %d", n_ch);
6852            printf("\n");
6853        }
6854    }
6855    function_tests++;
6856
6857    return(test_ret);
6858}
6859
6860
6861static int
6862test_xmlIsPubidChar(void) {
6863    int test_ret = 0;
6864
6865    int mem_base;
6866    int ret_val;
6867    unsigned int ch; /* character to validate */
6868    int n_ch;
6869
6870    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6871        mem_base = xmlMemBlocks();
6872        ch = gen_unsigned_int(n_ch, 0);
6873
6874        ret_val = xmlIsPubidChar(ch);
6875        desret_int(ret_val);
6876        call_tests++;
6877        des_unsigned_int(n_ch, ch, 0);
6878        xmlResetLastError();
6879        if (mem_base != xmlMemBlocks()) {
6880            printf("Leak of %d blocks found in xmlIsPubidChar",
6881	           xmlMemBlocks() - mem_base);
6882	    test_ret++;
6883            printf(" %d", n_ch);
6884            printf("\n");
6885        }
6886    }
6887    function_tests++;
6888
6889    return(test_ret);
6890}
6891
6892static int
6893test_chvalid(void) {
6894    int test_ret = 0;
6895
6896    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6897    test_ret += test_xmlCharInRange();
6898    test_ret += test_xmlIsBaseChar();
6899    test_ret += test_xmlIsBlank();
6900    test_ret += test_xmlIsChar();
6901    test_ret += test_xmlIsCombining();
6902    test_ret += test_xmlIsDigit();
6903    test_ret += test_xmlIsExtender();
6904    test_ret += test_xmlIsIdeographic();
6905    test_ret += test_xmlIsPubidChar();
6906
6907    if (test_ret != 0)
6908	printf("Module chvalid: %d errors\n", test_ret);
6909    return(test_ret);
6910}
6911
6912static int
6913test_xmlBoolToText(void) {
6914    int test_ret = 0;
6915
6916#if defined(LIBXML_DEBUG_ENABLED)
6917    int mem_base;
6918    const char * ret_val;
6919    int boolval; /* a bool to turn into text */
6920    int n_boolval;
6921
6922    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6923        mem_base = xmlMemBlocks();
6924        boolval = gen_int(n_boolval, 0);
6925
6926        ret_val = xmlBoolToText(boolval);
6927        desret_const_char_ptr(ret_val);
6928        call_tests++;
6929        des_int(n_boolval, boolval, 0);
6930        xmlResetLastError();
6931        if (mem_base != xmlMemBlocks()) {
6932            printf("Leak of %d blocks found in xmlBoolToText",
6933	           xmlMemBlocks() - mem_base);
6934	    test_ret++;
6935            printf(" %d", n_boolval);
6936            printf("\n");
6937        }
6938    }
6939    function_tests++;
6940#endif
6941
6942    return(test_ret);
6943}
6944
6945
6946static int
6947test_xmlDebugCheckDocument(void) {
6948    int test_ret = 0;
6949
6950#if defined(LIBXML_DEBUG_ENABLED)
6951    int mem_base;
6952    int ret_val;
6953    FILE * output; /* the FILE * for the output */
6954    int n_output;
6955    xmlDocPtr doc; /* the document */
6956    int n_doc;
6957
6958    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6959    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6960        mem_base = xmlMemBlocks();
6961        output = gen_debug_FILE_ptr(n_output, 0);
6962        doc = gen_xmlDocPtr(n_doc, 1);
6963
6964        ret_val = xmlDebugCheckDocument(output, doc);
6965        desret_int(ret_val);
6966        call_tests++;
6967        des_debug_FILE_ptr(n_output, output, 0);
6968        des_xmlDocPtr(n_doc, doc, 1);
6969        xmlResetLastError();
6970        if (mem_base != xmlMemBlocks()) {
6971            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6972	           xmlMemBlocks() - mem_base);
6973	    test_ret++;
6974            printf(" %d", n_output);
6975            printf(" %d", n_doc);
6976            printf("\n");
6977        }
6978    }
6979    }
6980    function_tests++;
6981#endif
6982
6983    return(test_ret);
6984}
6985
6986
6987static int
6988test_xmlDebugDumpAttr(void) {
6989    int test_ret = 0;
6990
6991#if defined(LIBXML_DEBUG_ENABLED)
6992    int mem_base;
6993    FILE * output; /* the FILE * for the output */
6994    int n_output;
6995    xmlAttrPtr attr; /* the attribute */
6996    int n_attr;
6997    int depth; /* the indentation level. */
6998    int n_depth;
6999
7000    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7001    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7002    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7003        mem_base = xmlMemBlocks();
7004        output = gen_debug_FILE_ptr(n_output, 0);
7005        attr = gen_xmlAttrPtr(n_attr, 1);
7006        depth = gen_int(n_depth, 2);
7007
7008        xmlDebugDumpAttr(output, attr, depth);
7009        call_tests++;
7010        des_debug_FILE_ptr(n_output, output, 0);
7011        des_xmlAttrPtr(n_attr, attr, 1);
7012        des_int(n_depth, depth, 2);
7013        xmlResetLastError();
7014        if (mem_base != xmlMemBlocks()) {
7015            printf("Leak of %d blocks found in xmlDebugDumpAttr",
7016	           xmlMemBlocks() - mem_base);
7017	    test_ret++;
7018            printf(" %d", n_output);
7019            printf(" %d", n_attr);
7020            printf(" %d", n_depth);
7021            printf("\n");
7022        }
7023    }
7024    }
7025    }
7026    function_tests++;
7027#endif
7028
7029    return(test_ret);
7030}
7031
7032
7033static int
7034test_xmlDebugDumpAttrList(void) {
7035    int test_ret = 0;
7036
7037#if defined(LIBXML_DEBUG_ENABLED)
7038    int mem_base;
7039    FILE * output; /* the FILE * for the output */
7040    int n_output;
7041    xmlAttrPtr attr; /* the attribute list */
7042    int n_attr;
7043    int depth; /* the indentation level. */
7044    int n_depth;
7045
7046    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7047    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7048    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7049        mem_base = xmlMemBlocks();
7050        output = gen_debug_FILE_ptr(n_output, 0);
7051        attr = gen_xmlAttrPtr(n_attr, 1);
7052        depth = gen_int(n_depth, 2);
7053
7054        xmlDebugDumpAttrList(output, attr, depth);
7055        call_tests++;
7056        des_debug_FILE_ptr(n_output, output, 0);
7057        des_xmlAttrPtr(n_attr, attr, 1);
7058        des_int(n_depth, depth, 2);
7059        xmlResetLastError();
7060        if (mem_base != xmlMemBlocks()) {
7061            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7062	           xmlMemBlocks() - mem_base);
7063	    test_ret++;
7064            printf(" %d", n_output);
7065            printf(" %d", n_attr);
7066            printf(" %d", n_depth);
7067            printf("\n");
7068        }
7069    }
7070    }
7071    }
7072    function_tests++;
7073#endif
7074
7075    return(test_ret);
7076}
7077
7078
7079static int
7080test_xmlDebugDumpDTD(void) {
7081    int test_ret = 0;
7082
7083#if defined(LIBXML_DEBUG_ENABLED)
7084    int mem_base;
7085    FILE * output; /* the FILE * for the output */
7086    int n_output;
7087    xmlDtdPtr dtd; /* the DTD */
7088    int n_dtd;
7089
7090    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7091    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7092        mem_base = xmlMemBlocks();
7093        output = gen_debug_FILE_ptr(n_output, 0);
7094        dtd = gen_xmlDtdPtr(n_dtd, 1);
7095
7096        xmlDebugDumpDTD(output, dtd);
7097        call_tests++;
7098        des_debug_FILE_ptr(n_output, output, 0);
7099        des_xmlDtdPtr(n_dtd, dtd, 1);
7100        xmlResetLastError();
7101        if (mem_base != xmlMemBlocks()) {
7102            printf("Leak of %d blocks found in xmlDebugDumpDTD",
7103	           xmlMemBlocks() - mem_base);
7104	    test_ret++;
7105            printf(" %d", n_output);
7106            printf(" %d", n_dtd);
7107            printf("\n");
7108        }
7109    }
7110    }
7111    function_tests++;
7112#endif
7113
7114    return(test_ret);
7115}
7116
7117
7118static int
7119test_xmlDebugDumpDocument(void) {
7120    int test_ret = 0;
7121
7122#if defined(LIBXML_DEBUG_ENABLED)
7123    int mem_base;
7124    FILE * output; /* the FILE * for the output */
7125    int n_output;
7126    xmlDocPtr doc; /* the document */
7127    int n_doc;
7128
7129    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7130    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7131        mem_base = xmlMemBlocks();
7132        output = gen_debug_FILE_ptr(n_output, 0);
7133        doc = gen_xmlDocPtr(n_doc, 1);
7134
7135        xmlDebugDumpDocument(output, doc);
7136        call_tests++;
7137        des_debug_FILE_ptr(n_output, output, 0);
7138        des_xmlDocPtr(n_doc, doc, 1);
7139        xmlResetLastError();
7140        if (mem_base != xmlMemBlocks()) {
7141            printf("Leak of %d blocks found in xmlDebugDumpDocument",
7142	           xmlMemBlocks() - mem_base);
7143	    test_ret++;
7144            printf(" %d", n_output);
7145            printf(" %d", n_doc);
7146            printf("\n");
7147        }
7148    }
7149    }
7150    function_tests++;
7151#endif
7152
7153    return(test_ret);
7154}
7155
7156
7157static int
7158test_xmlDebugDumpDocumentHead(void) {
7159    int test_ret = 0;
7160
7161#if defined(LIBXML_DEBUG_ENABLED)
7162    int mem_base;
7163    FILE * output; /* the FILE * for the output */
7164    int n_output;
7165    xmlDocPtr doc; /* the document */
7166    int n_doc;
7167
7168    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7169    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7170        mem_base = xmlMemBlocks();
7171        output = gen_debug_FILE_ptr(n_output, 0);
7172        doc = gen_xmlDocPtr(n_doc, 1);
7173
7174        xmlDebugDumpDocumentHead(output, doc);
7175        call_tests++;
7176        des_debug_FILE_ptr(n_output, output, 0);
7177        des_xmlDocPtr(n_doc, doc, 1);
7178        xmlResetLastError();
7179        if (mem_base != xmlMemBlocks()) {
7180            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7181	           xmlMemBlocks() - mem_base);
7182	    test_ret++;
7183            printf(" %d", n_output);
7184            printf(" %d", n_doc);
7185            printf("\n");
7186        }
7187    }
7188    }
7189    function_tests++;
7190#endif
7191
7192    return(test_ret);
7193}
7194
7195
7196static int
7197test_xmlDebugDumpEntities(void) {
7198    int test_ret = 0;
7199
7200#if defined(LIBXML_DEBUG_ENABLED)
7201    int mem_base;
7202    FILE * output; /* the FILE * for the output */
7203    int n_output;
7204    xmlDocPtr doc; /* the document */
7205    int n_doc;
7206
7207    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7208    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7209        mem_base = xmlMemBlocks();
7210        output = gen_debug_FILE_ptr(n_output, 0);
7211        doc = gen_xmlDocPtr(n_doc, 1);
7212
7213        xmlDebugDumpEntities(output, doc);
7214        call_tests++;
7215        des_debug_FILE_ptr(n_output, output, 0);
7216        des_xmlDocPtr(n_doc, doc, 1);
7217        xmlResetLastError();
7218        if (mem_base != xmlMemBlocks()) {
7219            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7220	           xmlMemBlocks() - mem_base);
7221	    test_ret++;
7222            printf(" %d", n_output);
7223            printf(" %d", n_doc);
7224            printf("\n");
7225        }
7226    }
7227    }
7228    function_tests++;
7229#endif
7230
7231    return(test_ret);
7232}
7233
7234
7235static int
7236test_xmlDebugDumpNode(void) {
7237    int test_ret = 0;
7238
7239#if defined(LIBXML_DEBUG_ENABLED)
7240    int mem_base;
7241    FILE * output; /* the FILE * for the output */
7242    int n_output;
7243    xmlNodePtr node; /* the node */
7244    int n_node;
7245    int depth; /* the indentation level. */
7246    int n_depth;
7247
7248    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7249    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7250    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7251        mem_base = xmlMemBlocks();
7252        output = gen_debug_FILE_ptr(n_output, 0);
7253        node = gen_xmlNodePtr(n_node, 1);
7254        depth = gen_int(n_depth, 2);
7255
7256        xmlDebugDumpNode(output, node, depth);
7257        call_tests++;
7258        des_debug_FILE_ptr(n_output, output, 0);
7259        des_xmlNodePtr(n_node, node, 1);
7260        des_int(n_depth, depth, 2);
7261        xmlResetLastError();
7262        if (mem_base != xmlMemBlocks()) {
7263            printf("Leak of %d blocks found in xmlDebugDumpNode",
7264	           xmlMemBlocks() - mem_base);
7265	    test_ret++;
7266            printf(" %d", n_output);
7267            printf(" %d", n_node);
7268            printf(" %d", n_depth);
7269            printf("\n");
7270        }
7271    }
7272    }
7273    }
7274    function_tests++;
7275#endif
7276
7277    return(test_ret);
7278}
7279
7280
7281static int
7282test_xmlDebugDumpNodeList(void) {
7283    int test_ret = 0;
7284
7285#if defined(LIBXML_DEBUG_ENABLED)
7286    int mem_base;
7287    FILE * output; /* the FILE * for the output */
7288    int n_output;
7289    xmlNodePtr node; /* the node list */
7290    int n_node;
7291    int depth; /* the indentation level. */
7292    int n_depth;
7293
7294    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7295    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7296    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7297        mem_base = xmlMemBlocks();
7298        output = gen_debug_FILE_ptr(n_output, 0);
7299        node = gen_xmlNodePtr(n_node, 1);
7300        depth = gen_int(n_depth, 2);
7301
7302        xmlDebugDumpNodeList(output, node, depth);
7303        call_tests++;
7304        des_debug_FILE_ptr(n_output, output, 0);
7305        des_xmlNodePtr(n_node, node, 1);
7306        des_int(n_depth, depth, 2);
7307        xmlResetLastError();
7308        if (mem_base != xmlMemBlocks()) {
7309            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7310	           xmlMemBlocks() - mem_base);
7311	    test_ret++;
7312            printf(" %d", n_output);
7313            printf(" %d", n_node);
7314            printf(" %d", n_depth);
7315            printf("\n");
7316        }
7317    }
7318    }
7319    }
7320    function_tests++;
7321#endif
7322
7323    return(test_ret);
7324}
7325
7326
7327static int
7328test_xmlDebugDumpOneNode(void) {
7329    int test_ret = 0;
7330
7331#if defined(LIBXML_DEBUG_ENABLED)
7332    int mem_base;
7333    FILE * output; /* the FILE * for the output */
7334    int n_output;
7335    xmlNodePtr node; /* the node */
7336    int n_node;
7337    int depth; /* the indentation level. */
7338    int n_depth;
7339
7340    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7341    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7342    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7343        mem_base = xmlMemBlocks();
7344        output = gen_debug_FILE_ptr(n_output, 0);
7345        node = gen_xmlNodePtr(n_node, 1);
7346        depth = gen_int(n_depth, 2);
7347
7348        xmlDebugDumpOneNode(output, node, depth);
7349        call_tests++;
7350        des_debug_FILE_ptr(n_output, output, 0);
7351        des_xmlNodePtr(n_node, node, 1);
7352        des_int(n_depth, depth, 2);
7353        xmlResetLastError();
7354        if (mem_base != xmlMemBlocks()) {
7355            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7356	           xmlMemBlocks() - mem_base);
7357	    test_ret++;
7358            printf(" %d", n_output);
7359            printf(" %d", n_node);
7360            printf(" %d", n_depth);
7361            printf("\n");
7362        }
7363    }
7364    }
7365    }
7366    function_tests++;
7367#endif
7368
7369    return(test_ret);
7370}
7371
7372
7373static int
7374test_xmlDebugDumpString(void) {
7375    int test_ret = 0;
7376
7377#if defined(LIBXML_DEBUG_ENABLED)
7378    int mem_base;
7379    FILE * output; /* the FILE * for the output */
7380    int n_output;
7381    xmlChar * str; /* the string */
7382    int n_str;
7383
7384    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7385    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7386        mem_base = xmlMemBlocks();
7387        output = gen_debug_FILE_ptr(n_output, 0);
7388        str = gen_const_xmlChar_ptr(n_str, 1);
7389
7390        xmlDebugDumpString(output, (const xmlChar *)str);
7391        call_tests++;
7392        des_debug_FILE_ptr(n_output, output, 0);
7393        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7394        xmlResetLastError();
7395        if (mem_base != xmlMemBlocks()) {
7396            printf("Leak of %d blocks found in xmlDebugDumpString",
7397	           xmlMemBlocks() - mem_base);
7398	    test_ret++;
7399            printf(" %d", n_output);
7400            printf(" %d", n_str);
7401            printf("\n");
7402        }
7403    }
7404    }
7405    function_tests++;
7406#endif
7407
7408    return(test_ret);
7409}
7410
7411
7412static int
7413test_xmlLsCountNode(void) {
7414    int test_ret = 0;
7415
7416#if defined(LIBXML_DEBUG_ENABLED)
7417    int mem_base;
7418    int ret_val;
7419    xmlNodePtr node; /* the node to count */
7420    int n_node;
7421
7422    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7423        mem_base = xmlMemBlocks();
7424        node = gen_xmlNodePtr(n_node, 0);
7425
7426        ret_val = xmlLsCountNode(node);
7427        desret_int(ret_val);
7428        call_tests++;
7429        des_xmlNodePtr(n_node, node, 0);
7430        xmlResetLastError();
7431        if (mem_base != xmlMemBlocks()) {
7432            printf("Leak of %d blocks found in xmlLsCountNode",
7433	           xmlMemBlocks() - mem_base);
7434	    test_ret++;
7435            printf(" %d", n_node);
7436            printf("\n");
7437        }
7438    }
7439    function_tests++;
7440#endif
7441
7442    return(test_ret);
7443}
7444
7445
7446static int
7447test_xmlLsOneNode(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 to dump */
7455    int n_node;
7456
7457    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7458    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7459        mem_base = xmlMemBlocks();
7460        output = gen_debug_FILE_ptr(n_output, 0);
7461        node = gen_xmlNodePtr(n_node, 1);
7462
7463        xmlLsOneNode(output, node);
7464        call_tests++;
7465        des_debug_FILE_ptr(n_output, output, 0);
7466        des_xmlNodePtr(n_node, node, 1);
7467        xmlResetLastError();
7468        if (mem_base != xmlMemBlocks()) {
7469            printf("Leak of %d blocks found in xmlLsOneNode",
7470	           xmlMemBlocks() - mem_base);
7471	    test_ret++;
7472            printf(" %d", n_output);
7473            printf(" %d", n_node);
7474            printf("\n");
7475        }
7476    }
7477    }
7478    function_tests++;
7479#endif
7480
7481    return(test_ret);
7482}
7483
7484
7485#define gen_nb_char_ptr 1
7486static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7487    return(NULL);
7488}
7489static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7490}
7491
7492static int
7493test_xmlShell(void) {
7494    int test_ret = 0;
7495
7496
7497    /* missing type support */
7498    return(test_ret);
7499}
7500
7501
7502static int
7503test_xmlShellBase(void) {
7504    int test_ret = 0;
7505
7506#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7507    int mem_base;
7508    int ret_val;
7509    xmlShellCtxtPtr ctxt; /* the shell context */
7510    int n_ctxt;
7511    char * arg; /* unused */
7512    int n_arg;
7513    xmlNodePtr node; /* a node */
7514    int n_node;
7515    xmlNodePtr node2; /* unused */
7516    int n_node2;
7517
7518    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7519    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7520    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7521    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7522        mem_base = xmlMemBlocks();
7523        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7524        arg = gen_char_ptr(n_arg, 1);
7525        node = gen_xmlNodePtr(n_node, 2);
7526        node2 = gen_xmlNodePtr(n_node2, 3);
7527
7528        ret_val = xmlShellBase(ctxt, arg, node, node2);
7529        desret_int(ret_val);
7530        call_tests++;
7531        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7532        des_char_ptr(n_arg, arg, 1);
7533        des_xmlNodePtr(n_node, node, 2);
7534        des_xmlNodePtr(n_node2, node2, 3);
7535        xmlResetLastError();
7536        if (mem_base != xmlMemBlocks()) {
7537            printf("Leak of %d blocks found in xmlShellBase",
7538	           xmlMemBlocks() - mem_base);
7539	    test_ret++;
7540            printf(" %d", n_ctxt);
7541            printf(" %d", n_arg);
7542            printf(" %d", n_node);
7543            printf(" %d", n_node2);
7544            printf("\n");
7545        }
7546    }
7547    }
7548    }
7549    }
7550    function_tests++;
7551#endif
7552
7553    return(test_ret);
7554}
7555
7556
7557static int
7558test_xmlShellCat(void) {
7559    int test_ret = 0;
7560
7561#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7562    int mem_base;
7563    int ret_val;
7564    xmlShellCtxtPtr ctxt; /* the shell context */
7565    int n_ctxt;
7566    char * arg; /* unused */
7567    int n_arg;
7568    xmlNodePtr node; /* a node */
7569    int n_node;
7570    xmlNodePtr node2; /* unused */
7571    int n_node2;
7572
7573    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7574    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7575    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7576    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7577        mem_base = xmlMemBlocks();
7578        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7579        arg = gen_char_ptr(n_arg, 1);
7580        node = gen_xmlNodePtr(n_node, 2);
7581        node2 = gen_xmlNodePtr(n_node2, 3);
7582
7583        ret_val = xmlShellCat(ctxt, arg, node, node2);
7584        desret_int(ret_val);
7585        call_tests++;
7586        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7587        des_char_ptr(n_arg, arg, 1);
7588        des_xmlNodePtr(n_node, node, 2);
7589        des_xmlNodePtr(n_node2, node2, 3);
7590        xmlResetLastError();
7591        if (mem_base != xmlMemBlocks()) {
7592            printf("Leak of %d blocks found in xmlShellCat",
7593	           xmlMemBlocks() - mem_base);
7594	    test_ret++;
7595            printf(" %d", n_ctxt);
7596            printf(" %d", n_arg);
7597            printf(" %d", n_node);
7598            printf(" %d", n_node2);
7599            printf("\n");
7600        }
7601    }
7602    }
7603    }
7604    }
7605    function_tests++;
7606#endif
7607
7608    return(test_ret);
7609}
7610
7611
7612static int
7613test_xmlShellDir(void) {
7614    int test_ret = 0;
7615
7616#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7617    int mem_base;
7618    int ret_val;
7619    xmlShellCtxtPtr ctxt; /* the shell context */
7620    int n_ctxt;
7621    char * arg; /* unused */
7622    int n_arg;
7623    xmlNodePtr node; /* a node */
7624    int n_node;
7625    xmlNodePtr node2; /* unused */
7626    int n_node2;
7627
7628    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7629    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7630    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7631    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7632        mem_base = xmlMemBlocks();
7633        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7634        arg = gen_char_ptr(n_arg, 1);
7635        node = gen_xmlNodePtr(n_node, 2);
7636        node2 = gen_xmlNodePtr(n_node2, 3);
7637
7638        ret_val = xmlShellDir(ctxt, arg, node, node2);
7639        desret_int(ret_val);
7640        call_tests++;
7641        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7642        des_char_ptr(n_arg, arg, 1);
7643        des_xmlNodePtr(n_node, node, 2);
7644        des_xmlNodePtr(n_node2, node2, 3);
7645        xmlResetLastError();
7646        if (mem_base != xmlMemBlocks()) {
7647            printf("Leak of %d blocks found in xmlShellDir",
7648	           xmlMemBlocks() - mem_base);
7649	    test_ret++;
7650            printf(" %d", n_ctxt);
7651            printf(" %d", n_arg);
7652            printf(" %d", n_node);
7653            printf(" %d", n_node2);
7654            printf("\n");
7655        }
7656    }
7657    }
7658    }
7659    }
7660    function_tests++;
7661#endif
7662
7663    return(test_ret);
7664}
7665
7666
7667static int
7668test_xmlShellDu(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 tree; /* a node defining a subtree */
7679    int n_tree;
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_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
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        tree = gen_xmlNodePtr(n_tree, 2);
7691        node2 = gen_xmlNodePtr(n_node2, 3);
7692
7693        ret_val = xmlShellDu(ctxt, arg, tree, 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_tree, tree, 2);
7699        des_xmlNodePtr(n_node2, node2, 3);
7700        xmlResetLastError();
7701        if (mem_base != xmlMemBlocks()) {
7702            printf("Leak of %d blocks found in xmlShellDu",
7703	           xmlMemBlocks() - mem_base);
7704	    test_ret++;
7705            printf(" %d", n_ctxt);
7706            printf(" %d", n_arg);
7707            printf(" %d", n_tree);
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
7722static int
7723test_xmlShellList(void) {
7724    int test_ret = 0;
7725
7726#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_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 = xmlShellList(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 xmlShellList",
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
7777static int
7778test_xmlShellLoad(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 * filename; /* the file name */
7787    int n_filename;
7788    xmlNodePtr node; /* unused */
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_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
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        filename = gen_char_ptr(n_filename, 1);
7800        node = gen_xmlNodePtr(n_node, 2);
7801        node2 = gen_xmlNodePtr(n_node2, 3);
7802
7803        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7804        desret_int(ret_val);
7805        call_tests++;
7806        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7807        des_char_ptr(n_filename, filename, 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 xmlShellLoad",
7813	           xmlMemBlocks() - mem_base);
7814	    test_ret++;
7815            printf(" %d", n_ctxt);
7816            printf(" %d", n_filename);
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
7832static int
7833test_xmlShellPrintXPathResult(void) {
7834    int test_ret = 0;
7835
7836#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7837    int mem_base;
7838    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7839    int n_list;
7840
7841    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7842        mem_base = xmlMemBlocks();
7843        list = gen_xmlXPathObjectPtr(n_list, 0);
7844
7845        xmlShellPrintXPathResult(list);
7846        call_tests++;
7847        des_xmlXPathObjectPtr(n_list, list, 0);
7848        xmlResetLastError();
7849        if (mem_base != xmlMemBlocks()) {
7850            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7851	           xmlMemBlocks() - mem_base);
7852	    test_ret++;
7853            printf(" %d", n_list);
7854            printf("\n");
7855        }
7856    }
7857    function_tests++;
7858#endif
7859
7860    return(test_ret);
7861}
7862
7863
7864static int
7865test_xmlShellPwd(void) {
7866    int test_ret = 0;
7867
7868#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7869    int mem_base;
7870    int ret_val;
7871    xmlShellCtxtPtr ctxt; /* the shell context */
7872    int n_ctxt;
7873    char * buffer; /* the output buffer */
7874    int n_buffer;
7875    xmlNodePtr node; /* a node */
7876    int n_node;
7877    xmlNodePtr node2; /* unused */
7878    int n_node2;
7879
7880    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7881    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7882    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7883    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7884        mem_base = xmlMemBlocks();
7885        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7886        buffer = gen_char_ptr(n_buffer, 1);
7887        node = gen_xmlNodePtr(n_node, 2);
7888        node2 = gen_xmlNodePtr(n_node2, 3);
7889
7890        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7891        desret_int(ret_val);
7892        call_tests++;
7893        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7894        des_char_ptr(n_buffer, buffer, 1);
7895        des_xmlNodePtr(n_node, node, 2);
7896        des_xmlNodePtr(n_node2, node2, 3);
7897        xmlResetLastError();
7898        if (mem_base != xmlMemBlocks()) {
7899            printf("Leak of %d blocks found in xmlShellPwd",
7900	           xmlMemBlocks() - mem_base);
7901	    test_ret++;
7902            printf(" %d", n_ctxt);
7903            printf(" %d", n_buffer);
7904            printf(" %d", n_node);
7905            printf(" %d", n_node2);
7906            printf("\n");
7907        }
7908    }
7909    }
7910    }
7911    }
7912    function_tests++;
7913#endif
7914
7915    return(test_ret);
7916}
7917
7918
7919static int
7920test_xmlShellSave(void) {
7921    int test_ret = 0;
7922
7923#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7924    int mem_base;
7925    int ret_val;
7926    xmlShellCtxtPtr ctxt; /* the shell context */
7927    int n_ctxt;
7928    char * filename; /* the file name (optional) */
7929    int n_filename;
7930    xmlNodePtr node; /* unused */
7931    int n_node;
7932    xmlNodePtr node2; /* unused */
7933    int n_node2;
7934
7935    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7936    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7937    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7938    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7939        mem_base = xmlMemBlocks();
7940        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7941        filename = gen_char_ptr(n_filename, 1);
7942        node = gen_xmlNodePtr(n_node, 2);
7943        node2 = gen_xmlNodePtr(n_node2, 3);
7944
7945        ret_val = xmlShellSave(ctxt, filename, node, node2);
7946        desret_int(ret_val);
7947        call_tests++;
7948        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7949        des_char_ptr(n_filename, filename, 1);
7950        des_xmlNodePtr(n_node, node, 2);
7951        des_xmlNodePtr(n_node2, node2, 3);
7952        xmlResetLastError();
7953        if (mem_base != xmlMemBlocks()) {
7954            printf("Leak of %d blocks found in xmlShellSave",
7955	           xmlMemBlocks() - mem_base);
7956	    test_ret++;
7957            printf(" %d", n_ctxt);
7958            printf(" %d", n_filename);
7959            printf(" %d", n_node);
7960            printf(" %d", n_node2);
7961            printf("\n");
7962        }
7963    }
7964    }
7965    }
7966    }
7967    function_tests++;
7968#endif
7969
7970    return(test_ret);
7971}
7972
7973
7974static int
7975test_xmlShellValidate(void) {
7976    int test_ret = 0;
7977
7978#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7979    int mem_base;
7980    int ret_val;
7981    xmlShellCtxtPtr ctxt; /* the shell context */
7982    int n_ctxt;
7983    char * dtd; /* the DTD URI (optional) */
7984    int n_dtd;
7985    xmlNodePtr node; /* unused */
7986    int n_node;
7987    xmlNodePtr node2; /* unused */
7988    int n_node2;
7989
7990    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7991    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7992    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7993    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7994        mem_base = xmlMemBlocks();
7995        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7996        dtd = gen_char_ptr(n_dtd, 1);
7997        node = gen_xmlNodePtr(n_node, 2);
7998        node2 = gen_xmlNodePtr(n_node2, 3);
7999
8000        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8001        desret_int(ret_val);
8002        call_tests++;
8003        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8004        des_char_ptr(n_dtd, dtd, 1);
8005        des_xmlNodePtr(n_node, node, 2);
8006        des_xmlNodePtr(n_node2, node2, 3);
8007        xmlResetLastError();
8008        if (mem_base != xmlMemBlocks()) {
8009            printf("Leak of %d blocks found in xmlShellValidate",
8010	           xmlMemBlocks() - mem_base);
8011	    test_ret++;
8012            printf(" %d", n_ctxt);
8013            printf(" %d", n_dtd);
8014            printf(" %d", n_node);
8015            printf(" %d", n_node2);
8016            printf("\n");
8017        }
8018    }
8019    }
8020    }
8021    }
8022    function_tests++;
8023#endif
8024
8025    return(test_ret);
8026}
8027
8028
8029static int
8030test_xmlShellWrite(void) {
8031    int test_ret = 0;
8032
8033#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8034    int mem_base;
8035    int ret_val;
8036    xmlShellCtxtPtr ctxt; /* the shell context */
8037    int n_ctxt;
8038    char * filename; /* the file name */
8039    int n_filename;
8040    xmlNodePtr node; /* a node in the tree */
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_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
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        filename = gen_char_ptr(n_filename, 1);
8052        node = gen_xmlNodePtr(n_node, 2);
8053        node2 = gen_xmlNodePtr(n_node2, 3);
8054
8055        ret_val = xmlShellWrite(ctxt, filename, node, node2);
8056        desret_int(ret_val);
8057        call_tests++;
8058        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8059        des_char_ptr(n_filename, filename, 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 xmlShellWrite",
8065	           xmlMemBlocks() - mem_base);
8066	    test_ret++;
8067            printf(" %d", n_ctxt);
8068            printf(" %d", n_filename);
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
8083static int
8084test_debugXML(void) {
8085    int test_ret = 0;
8086
8087    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8088    test_ret += test_xmlBoolToText();
8089    test_ret += test_xmlDebugCheckDocument();
8090    test_ret += test_xmlDebugDumpAttr();
8091    test_ret += test_xmlDebugDumpAttrList();
8092    test_ret += test_xmlDebugDumpDTD();
8093    test_ret += test_xmlDebugDumpDocument();
8094    test_ret += test_xmlDebugDumpDocumentHead();
8095    test_ret += test_xmlDebugDumpEntities();
8096    test_ret += test_xmlDebugDumpNode();
8097    test_ret += test_xmlDebugDumpNodeList();
8098    test_ret += test_xmlDebugDumpOneNode();
8099    test_ret += test_xmlDebugDumpString();
8100    test_ret += test_xmlLsCountNode();
8101    test_ret += test_xmlLsOneNode();
8102    test_ret += test_xmlShell();
8103    test_ret += test_xmlShellBase();
8104    test_ret += test_xmlShellCat();
8105    test_ret += test_xmlShellDir();
8106    test_ret += test_xmlShellDu();
8107    test_ret += test_xmlShellList();
8108    test_ret += test_xmlShellLoad();
8109    test_ret += test_xmlShellPrintXPathResult();
8110    test_ret += test_xmlShellPwd();
8111    test_ret += test_xmlShellSave();
8112    test_ret += test_xmlShellValidate();
8113    test_ret += test_xmlShellWrite();
8114
8115    if (test_ret != 0)
8116	printf("Module debugXML: %d errors\n", test_ret);
8117    return(test_ret);
8118}
8119
8120static int
8121test_xmlDictCleanup(void) {
8122    int test_ret = 0;
8123
8124    int mem_base;
8125
8126        mem_base = xmlMemBlocks();
8127
8128        xmlDictCleanup();
8129        call_tests++;
8130        xmlResetLastError();
8131        if (mem_base != xmlMemBlocks()) {
8132            printf("Leak of %d blocks found in xmlDictCleanup",
8133	           xmlMemBlocks() - mem_base);
8134	    test_ret++;
8135            printf("\n");
8136        }
8137    function_tests++;
8138
8139    return(test_ret);
8140}
8141
8142
8143static int
8144test_xmlDictCreate(void) {
8145    int test_ret = 0;
8146
8147    int mem_base;
8148    xmlDictPtr ret_val;
8149
8150        mem_base = xmlMemBlocks();
8151
8152        ret_val = xmlDictCreate();
8153        desret_xmlDictPtr(ret_val);
8154        call_tests++;
8155        xmlResetLastError();
8156        if (mem_base != xmlMemBlocks()) {
8157            printf("Leak of %d blocks found in xmlDictCreate",
8158	           xmlMemBlocks() - mem_base);
8159	    test_ret++;
8160            printf("\n");
8161        }
8162    function_tests++;
8163
8164    return(test_ret);
8165}
8166
8167
8168static int
8169test_xmlDictCreateSub(void) {
8170    int test_ret = 0;
8171
8172    int mem_base;
8173    xmlDictPtr ret_val;
8174    xmlDictPtr sub; /* an existing dictionnary */
8175    int n_sub;
8176
8177    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8178        mem_base = xmlMemBlocks();
8179        sub = gen_xmlDictPtr(n_sub, 0);
8180
8181        ret_val = xmlDictCreateSub(sub);
8182        desret_xmlDictPtr(ret_val);
8183        call_tests++;
8184        des_xmlDictPtr(n_sub, sub, 0);
8185        xmlResetLastError();
8186        if (mem_base != xmlMemBlocks()) {
8187            printf("Leak of %d blocks found in xmlDictCreateSub",
8188	           xmlMemBlocks() - mem_base);
8189	    test_ret++;
8190            printf(" %d", n_sub);
8191            printf("\n");
8192        }
8193    }
8194    function_tests++;
8195
8196    return(test_ret);
8197}
8198
8199
8200static int
8201test_xmlDictExists(void) {
8202    int test_ret = 0;
8203
8204    int mem_base;
8205    const xmlChar * ret_val;
8206    xmlDictPtr dict; /* the dictionnary */
8207    int n_dict;
8208    xmlChar * name; /* the name of the userdata */
8209    int n_name;
8210    int len; /* the length of the name, if -1 it is recomputed */
8211    int n_len;
8212
8213    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8214    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8215    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8216        mem_base = xmlMemBlocks();
8217        dict = gen_xmlDictPtr(n_dict, 0);
8218        name = gen_const_xmlChar_ptr(n_name, 1);
8219        len = gen_int(n_len, 2);
8220
8221        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8222        desret_const_xmlChar_ptr(ret_val);
8223        call_tests++;
8224        des_xmlDictPtr(n_dict, dict, 0);
8225        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8226        des_int(n_len, len, 2);
8227        xmlResetLastError();
8228        if (mem_base != xmlMemBlocks()) {
8229            printf("Leak of %d blocks found in xmlDictExists",
8230	           xmlMemBlocks() - mem_base);
8231	    test_ret++;
8232            printf(" %d", n_dict);
8233            printf(" %d", n_name);
8234            printf(" %d", n_len);
8235            printf("\n");
8236        }
8237    }
8238    }
8239    }
8240    function_tests++;
8241
8242    return(test_ret);
8243}
8244
8245
8246static int
8247test_xmlDictLookup(void) {
8248    int test_ret = 0;
8249
8250    int mem_base;
8251    const xmlChar * ret_val;
8252    xmlDictPtr dict; /* the dictionnary */
8253    int n_dict;
8254    xmlChar * name; /* the name of the userdata */
8255    int n_name;
8256    int len; /* the length of the name, if -1 it is recomputed */
8257    int n_len;
8258
8259    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8260    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8261    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8262        mem_base = xmlMemBlocks();
8263        dict = gen_xmlDictPtr(n_dict, 0);
8264        name = gen_const_xmlChar_ptr(n_name, 1);
8265        len = gen_int(n_len, 2);
8266
8267        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8268        desret_const_xmlChar_ptr(ret_val);
8269        call_tests++;
8270        des_xmlDictPtr(n_dict, dict, 0);
8271        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8272        des_int(n_len, len, 2);
8273        xmlResetLastError();
8274        if (mem_base != xmlMemBlocks()) {
8275            printf("Leak of %d blocks found in xmlDictLookup",
8276	           xmlMemBlocks() - mem_base);
8277	    test_ret++;
8278            printf(" %d", n_dict);
8279            printf(" %d", n_name);
8280            printf(" %d", n_len);
8281            printf("\n");
8282        }
8283    }
8284    }
8285    }
8286    function_tests++;
8287
8288    return(test_ret);
8289}
8290
8291
8292static int
8293test_xmlDictOwns(void) {
8294    int test_ret = 0;
8295
8296    int mem_base;
8297    int ret_val;
8298    xmlDictPtr dict; /* the dictionnary */
8299    int n_dict;
8300    xmlChar * str; /* the string */
8301    int n_str;
8302
8303    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8304    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8305        mem_base = xmlMemBlocks();
8306        dict = gen_xmlDictPtr(n_dict, 0);
8307        str = gen_const_xmlChar_ptr(n_str, 1);
8308
8309        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8310        desret_int(ret_val);
8311        call_tests++;
8312        des_xmlDictPtr(n_dict, dict, 0);
8313        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8314        xmlResetLastError();
8315        if (mem_base != xmlMemBlocks()) {
8316            printf("Leak of %d blocks found in xmlDictOwns",
8317	           xmlMemBlocks() - mem_base);
8318	    test_ret++;
8319            printf(" %d", n_dict);
8320            printf(" %d", n_str);
8321            printf("\n");
8322        }
8323    }
8324    }
8325    function_tests++;
8326
8327    return(test_ret);
8328}
8329
8330
8331static int
8332test_xmlDictQLookup(void) {
8333    int test_ret = 0;
8334
8335    int mem_base;
8336    const xmlChar * ret_val;
8337    xmlDictPtr dict; /* the dictionnary */
8338    int n_dict;
8339    xmlChar * prefix; /* the prefix */
8340    int n_prefix;
8341    xmlChar * name; /* the name */
8342    int n_name;
8343
8344    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8345    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8346    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8347        mem_base = xmlMemBlocks();
8348        dict = gen_xmlDictPtr(n_dict, 0);
8349        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8350        name = gen_const_xmlChar_ptr(n_name, 2);
8351
8352        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8353        desret_const_xmlChar_ptr(ret_val);
8354        call_tests++;
8355        des_xmlDictPtr(n_dict, dict, 0);
8356        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8357        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8358        xmlResetLastError();
8359        if (mem_base != xmlMemBlocks()) {
8360            printf("Leak of %d blocks found in xmlDictQLookup",
8361	           xmlMemBlocks() - mem_base);
8362	    test_ret++;
8363            printf(" %d", n_dict);
8364            printf(" %d", n_prefix);
8365            printf(" %d", n_name);
8366            printf("\n");
8367        }
8368    }
8369    }
8370    }
8371    function_tests++;
8372
8373    return(test_ret);
8374}
8375
8376
8377static int
8378test_xmlDictReference(void) {
8379    int test_ret = 0;
8380
8381    int mem_base;
8382    int ret_val;
8383    xmlDictPtr dict; /* the dictionnary */
8384    int n_dict;
8385
8386    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8387        mem_base = xmlMemBlocks();
8388        dict = gen_xmlDictPtr(n_dict, 0);
8389
8390        ret_val = xmlDictReference(dict);
8391        xmlDictFree(dict);
8392        desret_int(ret_val);
8393        call_tests++;
8394        des_xmlDictPtr(n_dict, dict, 0);
8395        xmlResetLastError();
8396        if (mem_base != xmlMemBlocks()) {
8397            printf("Leak of %d blocks found in xmlDictReference",
8398	           xmlMemBlocks() - mem_base);
8399	    test_ret++;
8400            printf(" %d", n_dict);
8401            printf("\n");
8402        }
8403    }
8404    function_tests++;
8405
8406    return(test_ret);
8407}
8408
8409
8410static int
8411test_xmlDictSize(void) {
8412    int test_ret = 0;
8413
8414    int mem_base;
8415    int ret_val;
8416    xmlDictPtr dict; /* the dictionnary */
8417    int n_dict;
8418
8419    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8420        mem_base = xmlMemBlocks();
8421        dict = gen_xmlDictPtr(n_dict, 0);
8422
8423        ret_val = xmlDictSize(dict);
8424        desret_int(ret_val);
8425        call_tests++;
8426        des_xmlDictPtr(n_dict, dict, 0);
8427        xmlResetLastError();
8428        if (mem_base != xmlMemBlocks()) {
8429            printf("Leak of %d blocks found in xmlDictSize",
8430	           xmlMemBlocks() - mem_base);
8431	    test_ret++;
8432            printf(" %d", n_dict);
8433            printf("\n");
8434        }
8435    }
8436    function_tests++;
8437
8438    return(test_ret);
8439}
8440
8441static int
8442test_dict(void) {
8443    int test_ret = 0;
8444
8445    if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8446    test_ret += test_xmlDictCleanup();
8447    test_ret += test_xmlDictCreate();
8448    test_ret += test_xmlDictCreateSub();
8449    test_ret += test_xmlDictExists();
8450    test_ret += test_xmlDictLookup();
8451    test_ret += test_xmlDictOwns();
8452    test_ret += test_xmlDictQLookup();
8453    test_ret += test_xmlDictReference();
8454    test_ret += test_xmlDictSize();
8455
8456    if (test_ret != 0)
8457	printf("Module dict: %d errors\n", test_ret);
8458    return(test_ret);
8459}
8460
8461static int
8462test_UTF8Toisolat1(void) {
8463    int test_ret = 0;
8464
8465#if defined(LIBXML_OUTPUT_ENABLED)
8466#ifdef LIBXML_OUTPUT_ENABLED
8467    int mem_base;
8468    int ret_val;
8469    unsigned char * out; /* a pointer to an array of bytes to store the result */
8470    int n_out;
8471    int * outlen; /* the length of @out */
8472    int n_outlen;
8473    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8474    int n_in;
8475    int * inlen; /* the length of @in */
8476    int n_inlen;
8477
8478    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8479    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8480    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8481    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8482        mem_base = xmlMemBlocks();
8483        out = gen_unsigned_char_ptr(n_out, 0);
8484        outlen = gen_int_ptr(n_outlen, 1);
8485        in = gen_const_unsigned_char_ptr(n_in, 2);
8486        inlen = gen_int_ptr(n_inlen, 3);
8487
8488        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8489        desret_int(ret_val);
8490        call_tests++;
8491        des_unsigned_char_ptr(n_out, out, 0);
8492        des_int_ptr(n_outlen, outlen, 1);
8493        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8494        des_int_ptr(n_inlen, inlen, 3);
8495        xmlResetLastError();
8496        if (mem_base != xmlMemBlocks()) {
8497            printf("Leak of %d blocks found in UTF8Toisolat1",
8498	           xmlMemBlocks() - mem_base);
8499	    test_ret++;
8500            printf(" %d", n_out);
8501            printf(" %d", n_outlen);
8502            printf(" %d", n_in);
8503            printf(" %d", n_inlen);
8504            printf("\n");
8505        }
8506    }
8507    }
8508    }
8509    }
8510    function_tests++;
8511#endif
8512#endif
8513
8514    return(test_ret);
8515}
8516
8517
8518static int
8519test_isolat1ToUTF8(void) {
8520    int test_ret = 0;
8521
8522    int mem_base;
8523    int ret_val;
8524    unsigned char * out; /* a pointer to an array of bytes to store the result */
8525    int n_out;
8526    int * outlen; /* the length of @out */
8527    int n_outlen;
8528    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8529    int n_in;
8530    int * inlen; /* the length of @in */
8531    int n_inlen;
8532
8533    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8534    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8535    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8536    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8537        mem_base = xmlMemBlocks();
8538        out = gen_unsigned_char_ptr(n_out, 0);
8539        outlen = gen_int_ptr(n_outlen, 1);
8540        in = gen_const_unsigned_char_ptr(n_in, 2);
8541        inlen = gen_int_ptr(n_inlen, 3);
8542
8543        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8544        desret_int(ret_val);
8545        call_tests++;
8546        des_unsigned_char_ptr(n_out, out, 0);
8547        des_int_ptr(n_outlen, outlen, 1);
8548        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8549        des_int_ptr(n_inlen, inlen, 3);
8550        xmlResetLastError();
8551        if (mem_base != xmlMemBlocks()) {
8552            printf("Leak of %d blocks found in isolat1ToUTF8",
8553	           xmlMemBlocks() - mem_base);
8554	    test_ret++;
8555            printf(" %d", n_out);
8556            printf(" %d", n_outlen);
8557            printf(" %d", n_in);
8558            printf(" %d", n_inlen);
8559            printf("\n");
8560        }
8561    }
8562    }
8563    }
8564    }
8565    function_tests++;
8566
8567    return(test_ret);
8568}
8569
8570
8571static int
8572test_xmlAddEncodingAlias(void) {
8573    int test_ret = 0;
8574
8575    int ret_val;
8576    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8577    int n_name;
8578    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8579    int n_alias;
8580
8581    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8582    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8583        name = gen_const_char_ptr(n_name, 0);
8584        alias = gen_const_char_ptr(n_alias, 1);
8585
8586        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8587        desret_int(ret_val);
8588        call_tests++;
8589        des_const_char_ptr(n_name, (const char *)name, 0);
8590        des_const_char_ptr(n_alias, (const char *)alias, 1);
8591        xmlResetLastError();
8592    }
8593    }
8594    function_tests++;
8595
8596    return(test_ret);
8597}
8598
8599
8600#define gen_nb_xmlCharEncodingHandler_ptr 1
8601static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8602    return(NULL);
8603}
8604static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8605}
8606
8607static int
8608test_xmlCharEncCloseFunc(void) {
8609    int test_ret = 0;
8610
8611    int mem_base;
8612    int ret_val;
8613    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8614    int n_handler;
8615
8616    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8617        mem_base = xmlMemBlocks();
8618        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8619
8620        ret_val = xmlCharEncCloseFunc(handler);
8621        desret_int(ret_val);
8622        call_tests++;
8623        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8624        xmlResetLastError();
8625        if (mem_base != xmlMemBlocks()) {
8626            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8627	           xmlMemBlocks() - mem_base);
8628	    test_ret++;
8629            printf(" %d", n_handler);
8630            printf("\n");
8631        }
8632    }
8633    function_tests++;
8634
8635    return(test_ret);
8636}
8637
8638
8639static int
8640test_xmlCharEncFirstLine(void) {
8641    int test_ret = 0;
8642
8643    int mem_base;
8644    int ret_val;
8645    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8646    int n_handler;
8647    xmlBufferPtr out; /* an xmlBuffer for the output. */
8648    int n_out;
8649    xmlBufferPtr in; /* an xmlBuffer for the input */
8650    int n_in;
8651
8652    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8653    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8654    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8655        mem_base = xmlMemBlocks();
8656        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8657        out = gen_xmlBufferPtr(n_out, 1);
8658        in = gen_xmlBufferPtr(n_in, 2);
8659
8660        ret_val = xmlCharEncFirstLine(handler, out, in);
8661        desret_int(ret_val);
8662        call_tests++;
8663        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8664        des_xmlBufferPtr(n_out, out, 1);
8665        des_xmlBufferPtr(n_in, in, 2);
8666        xmlResetLastError();
8667        if (mem_base != xmlMemBlocks()) {
8668            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8669	           xmlMemBlocks() - mem_base);
8670	    test_ret++;
8671            printf(" %d", n_handler);
8672            printf(" %d", n_out);
8673            printf(" %d", n_in);
8674            printf("\n");
8675        }
8676    }
8677    }
8678    }
8679    function_tests++;
8680
8681    return(test_ret);
8682}
8683
8684
8685static int
8686test_xmlCharEncInFunc(void) {
8687    int test_ret = 0;
8688
8689    int mem_base;
8690    int ret_val;
8691    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8692    int n_handler;
8693    xmlBufferPtr out; /* an xmlBuffer for the output. */
8694    int n_out;
8695    xmlBufferPtr in; /* an xmlBuffer for the input */
8696    int n_in;
8697
8698    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8699    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8700    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8701        mem_base = xmlMemBlocks();
8702        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8703        out = gen_xmlBufferPtr(n_out, 1);
8704        in = gen_xmlBufferPtr(n_in, 2);
8705
8706        ret_val = xmlCharEncInFunc(handler, out, in);
8707        desret_int(ret_val);
8708        call_tests++;
8709        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8710        des_xmlBufferPtr(n_out, out, 1);
8711        des_xmlBufferPtr(n_in, in, 2);
8712        xmlResetLastError();
8713        if (mem_base != xmlMemBlocks()) {
8714            printf("Leak of %d blocks found in xmlCharEncInFunc",
8715	           xmlMemBlocks() - mem_base);
8716	    test_ret++;
8717            printf(" %d", n_handler);
8718            printf(" %d", n_out);
8719            printf(" %d", n_in);
8720            printf("\n");
8721        }
8722    }
8723    }
8724    }
8725    function_tests++;
8726
8727    return(test_ret);
8728}
8729
8730
8731static int
8732test_xmlCharEncOutFunc(void) {
8733    int test_ret = 0;
8734
8735    int mem_base;
8736    int ret_val;
8737    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8738    int n_handler;
8739    xmlBufferPtr out; /* an xmlBuffer for the output. */
8740    int n_out;
8741    xmlBufferPtr in; /* an xmlBuffer for the input */
8742    int n_in;
8743
8744    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8745    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8746    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8747        mem_base = xmlMemBlocks();
8748        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8749        out = gen_xmlBufferPtr(n_out, 1);
8750        in = gen_xmlBufferPtr(n_in, 2);
8751
8752        ret_val = xmlCharEncOutFunc(handler, out, in);
8753        desret_int(ret_val);
8754        call_tests++;
8755        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8756        des_xmlBufferPtr(n_out, out, 1);
8757        des_xmlBufferPtr(n_in, in, 2);
8758        xmlResetLastError();
8759        if (mem_base != xmlMemBlocks()) {
8760            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8761	           xmlMemBlocks() - mem_base);
8762	    test_ret++;
8763            printf(" %d", n_handler);
8764            printf(" %d", n_out);
8765            printf(" %d", n_in);
8766            printf("\n");
8767        }
8768    }
8769    }
8770    }
8771    function_tests++;
8772
8773    return(test_ret);
8774}
8775
8776
8777static int
8778test_xmlCleanupCharEncodingHandlers(void) {
8779    int test_ret = 0;
8780
8781
8782
8783        xmlCleanupCharEncodingHandlers();
8784        call_tests++;
8785        xmlResetLastError();
8786    function_tests++;
8787
8788    return(test_ret);
8789}
8790
8791
8792static int
8793test_xmlCleanupEncodingAliases(void) {
8794    int test_ret = 0;
8795
8796    int mem_base;
8797
8798        mem_base = xmlMemBlocks();
8799
8800        xmlCleanupEncodingAliases();
8801        call_tests++;
8802        xmlResetLastError();
8803        if (mem_base != xmlMemBlocks()) {
8804            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8805	           xmlMemBlocks() - mem_base);
8806	    test_ret++;
8807            printf("\n");
8808        }
8809    function_tests++;
8810
8811    return(test_ret);
8812}
8813
8814
8815static int
8816test_xmlDelEncodingAlias(void) {
8817    int test_ret = 0;
8818
8819    int mem_base;
8820    int ret_val;
8821    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8822    int n_alias;
8823
8824    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8825        mem_base = xmlMemBlocks();
8826        alias = gen_const_char_ptr(n_alias, 0);
8827
8828        ret_val = xmlDelEncodingAlias((const char *)alias);
8829        desret_int(ret_val);
8830        call_tests++;
8831        des_const_char_ptr(n_alias, (const char *)alias, 0);
8832        xmlResetLastError();
8833        if (mem_base != xmlMemBlocks()) {
8834            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8835	           xmlMemBlocks() - mem_base);
8836	    test_ret++;
8837            printf(" %d", n_alias);
8838            printf("\n");
8839        }
8840    }
8841    function_tests++;
8842
8843    return(test_ret);
8844}
8845
8846
8847static int
8848test_xmlDetectCharEncoding(void) {
8849    int test_ret = 0;
8850
8851    int mem_base;
8852    xmlCharEncoding ret_val;
8853    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). */
8854    int n_in;
8855    int len; /* pointer to the length of the buffer */
8856    int n_len;
8857
8858    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8859    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8860        mem_base = xmlMemBlocks();
8861        in = gen_const_unsigned_char_ptr(n_in, 0);
8862        len = gen_int(n_len, 1);
8863
8864        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8865        desret_xmlCharEncoding(ret_val);
8866        call_tests++;
8867        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8868        des_int(n_len, len, 1);
8869        xmlResetLastError();
8870        if (mem_base != xmlMemBlocks()) {
8871            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8872	           xmlMemBlocks() - mem_base);
8873	    test_ret++;
8874            printf(" %d", n_in);
8875            printf(" %d", n_len);
8876            printf("\n");
8877        }
8878    }
8879    }
8880    function_tests++;
8881
8882    return(test_ret);
8883}
8884
8885
8886static int
8887test_xmlFindCharEncodingHandler(void) {
8888    int test_ret = 0;
8889
8890
8891    /* missing type support */
8892    return(test_ret);
8893}
8894
8895
8896static int
8897test_xmlGetCharEncodingHandler(void) {
8898    int test_ret = 0;
8899
8900
8901    /* missing type support */
8902    return(test_ret);
8903}
8904
8905
8906static int
8907test_xmlGetCharEncodingName(void) {
8908    int test_ret = 0;
8909
8910    int mem_base;
8911    const char * ret_val;
8912    xmlCharEncoding enc; /* the encoding */
8913    int n_enc;
8914
8915    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8916        mem_base = xmlMemBlocks();
8917        enc = gen_xmlCharEncoding(n_enc, 0);
8918
8919        ret_val = xmlGetCharEncodingName(enc);
8920        desret_const_char_ptr(ret_val);
8921        call_tests++;
8922        des_xmlCharEncoding(n_enc, enc, 0);
8923        xmlResetLastError();
8924        if (mem_base != xmlMemBlocks()) {
8925            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8926	           xmlMemBlocks() - mem_base);
8927	    test_ret++;
8928            printf(" %d", n_enc);
8929            printf("\n");
8930        }
8931    }
8932    function_tests++;
8933
8934    return(test_ret);
8935}
8936
8937
8938static int
8939test_xmlGetEncodingAlias(void) {
8940    int test_ret = 0;
8941
8942    int mem_base;
8943    const char * ret_val;
8944    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8945    int n_alias;
8946
8947    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8948        mem_base = xmlMemBlocks();
8949        alias = gen_const_char_ptr(n_alias, 0);
8950
8951        ret_val = xmlGetEncodingAlias((const char *)alias);
8952        desret_const_char_ptr(ret_val);
8953        call_tests++;
8954        des_const_char_ptr(n_alias, (const char *)alias, 0);
8955        xmlResetLastError();
8956        if (mem_base != xmlMemBlocks()) {
8957            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8958	           xmlMemBlocks() - mem_base);
8959	    test_ret++;
8960            printf(" %d", n_alias);
8961            printf("\n");
8962        }
8963    }
8964    function_tests++;
8965
8966    return(test_ret);
8967}
8968
8969
8970static int
8971test_xmlInitCharEncodingHandlers(void) {
8972    int test_ret = 0;
8973
8974
8975
8976        xmlInitCharEncodingHandlers();
8977        call_tests++;
8978        xmlResetLastError();
8979    function_tests++;
8980
8981    return(test_ret);
8982}
8983
8984
8985static int
8986test_xmlNewCharEncodingHandler(void) {
8987    int test_ret = 0;
8988
8989
8990    /* missing type support */
8991    return(test_ret);
8992}
8993
8994
8995static int
8996test_xmlParseCharEncoding(void) {
8997    int test_ret = 0;
8998
8999    int mem_base;
9000    xmlCharEncoding ret_val;
9001    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9002    int n_name;
9003
9004    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9005        mem_base = xmlMemBlocks();
9006        name = gen_const_char_ptr(n_name, 0);
9007
9008        ret_val = xmlParseCharEncoding((const char *)name);
9009        desret_xmlCharEncoding(ret_val);
9010        call_tests++;
9011        des_const_char_ptr(n_name, (const char *)name, 0);
9012        xmlResetLastError();
9013        if (mem_base != xmlMemBlocks()) {
9014            printf("Leak of %d blocks found in xmlParseCharEncoding",
9015	           xmlMemBlocks() - mem_base);
9016	    test_ret++;
9017            printf(" %d", n_name);
9018            printf("\n");
9019        }
9020    }
9021    function_tests++;
9022
9023    return(test_ret);
9024}
9025
9026
9027#define gen_nb_xmlCharEncodingHandlerPtr 1
9028static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9029    return(NULL);
9030}
9031static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9032}
9033
9034static int
9035test_xmlRegisterCharEncodingHandler(void) {
9036    int test_ret = 0;
9037
9038    int mem_base;
9039    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9040    int n_handler;
9041
9042    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9043        mem_base = xmlMemBlocks();
9044        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9045
9046        xmlRegisterCharEncodingHandler(handler);
9047        call_tests++;
9048        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9049        xmlResetLastError();
9050        if (mem_base != xmlMemBlocks()) {
9051            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9052	           xmlMemBlocks() - mem_base);
9053	    test_ret++;
9054            printf(" %d", n_handler);
9055            printf("\n");
9056        }
9057    }
9058    function_tests++;
9059
9060    return(test_ret);
9061}
9062
9063static int
9064test_encoding(void) {
9065    int test_ret = 0;
9066
9067    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9068    test_ret += test_UTF8Toisolat1();
9069    test_ret += test_isolat1ToUTF8();
9070    test_ret += test_xmlAddEncodingAlias();
9071    test_ret += test_xmlCharEncCloseFunc();
9072    test_ret += test_xmlCharEncFirstLine();
9073    test_ret += test_xmlCharEncInFunc();
9074    test_ret += test_xmlCharEncOutFunc();
9075    test_ret += test_xmlCleanupCharEncodingHandlers();
9076    test_ret += test_xmlCleanupEncodingAliases();
9077    test_ret += test_xmlDelEncodingAlias();
9078    test_ret += test_xmlDetectCharEncoding();
9079    test_ret += test_xmlFindCharEncodingHandler();
9080    test_ret += test_xmlGetCharEncodingHandler();
9081    test_ret += test_xmlGetCharEncodingName();
9082    test_ret += test_xmlGetEncodingAlias();
9083    test_ret += test_xmlInitCharEncodingHandlers();
9084    test_ret += test_xmlNewCharEncodingHandler();
9085    test_ret += test_xmlParseCharEncoding();
9086    test_ret += test_xmlRegisterCharEncodingHandler();
9087
9088    if (test_ret != 0)
9089	printf("Module encoding: %d errors\n", test_ret);
9090    return(test_ret);
9091}
9092
9093static int
9094test_xmlAddDocEntity(void) {
9095    int test_ret = 0;
9096
9097    int mem_base;
9098    xmlEntityPtr ret_val;
9099    xmlDocPtr doc; /* the document */
9100    int n_doc;
9101    xmlChar * name; /* the entity name */
9102    int n_name;
9103    int type; /* the entity type XML_xxx_yyy_ENTITY */
9104    int n_type;
9105    xmlChar * ExternalID; /* the entity external ID if available */
9106    int n_ExternalID;
9107    xmlChar * SystemID; /* the entity system ID if available */
9108    int n_SystemID;
9109    xmlChar * content; /* the entity content */
9110    int n_content;
9111
9112    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9113    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9114    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9115    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9116    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9117    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9118        mem_base = xmlMemBlocks();
9119        doc = gen_xmlDocPtr(n_doc, 0);
9120        name = gen_const_xmlChar_ptr(n_name, 1);
9121        type = gen_int(n_type, 2);
9122        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9123        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9124        content = gen_const_xmlChar_ptr(n_content, 5);
9125
9126        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9127        desret_xmlEntityPtr(ret_val);
9128        call_tests++;
9129        des_xmlDocPtr(n_doc, doc, 0);
9130        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9131        des_int(n_type, type, 2);
9132        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9133        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9134        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9135        xmlResetLastError();
9136        if (mem_base != xmlMemBlocks()) {
9137            printf("Leak of %d blocks found in xmlAddDocEntity",
9138	           xmlMemBlocks() - mem_base);
9139	    test_ret++;
9140            printf(" %d", n_doc);
9141            printf(" %d", n_name);
9142            printf(" %d", n_type);
9143            printf(" %d", n_ExternalID);
9144            printf(" %d", n_SystemID);
9145            printf(" %d", n_content);
9146            printf("\n");
9147        }
9148    }
9149    }
9150    }
9151    }
9152    }
9153    }
9154    function_tests++;
9155
9156    return(test_ret);
9157}
9158
9159
9160static int
9161test_xmlAddDtdEntity(void) {
9162    int test_ret = 0;
9163
9164    int mem_base;
9165    xmlEntityPtr ret_val;
9166    xmlDocPtr doc; /* the document */
9167    int n_doc;
9168    xmlChar * name; /* the entity name */
9169    int n_name;
9170    int type; /* the entity type XML_xxx_yyy_ENTITY */
9171    int n_type;
9172    xmlChar * ExternalID; /* the entity external ID if available */
9173    int n_ExternalID;
9174    xmlChar * SystemID; /* the entity system ID if available */
9175    int n_SystemID;
9176    xmlChar * content; /* the entity content */
9177    int n_content;
9178
9179    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9180    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9181    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9182    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9183    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9184    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9185        mem_base = xmlMemBlocks();
9186        doc = gen_xmlDocPtr(n_doc, 0);
9187        name = gen_const_xmlChar_ptr(n_name, 1);
9188        type = gen_int(n_type, 2);
9189        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9190        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9191        content = gen_const_xmlChar_ptr(n_content, 5);
9192
9193        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9194        desret_xmlEntityPtr(ret_val);
9195        call_tests++;
9196        des_xmlDocPtr(n_doc, doc, 0);
9197        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9198        des_int(n_type, type, 2);
9199        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9200        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9201        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9202        xmlResetLastError();
9203        if (mem_base != xmlMemBlocks()) {
9204            printf("Leak of %d blocks found in xmlAddDtdEntity",
9205	           xmlMemBlocks() - mem_base);
9206	    test_ret++;
9207            printf(" %d", n_doc);
9208            printf(" %d", n_name);
9209            printf(" %d", n_type);
9210            printf(" %d", n_ExternalID);
9211            printf(" %d", n_SystemID);
9212            printf(" %d", n_content);
9213            printf("\n");
9214        }
9215    }
9216    }
9217    }
9218    }
9219    }
9220    }
9221    function_tests++;
9222
9223    return(test_ret);
9224}
9225
9226
9227static int
9228test_xmlCleanupPredefinedEntities(void) {
9229    int test_ret = 0;
9230
9231#if defined(LIBXML_LEGACY_ENABLED)
9232#ifdef LIBXML_LEGACY_ENABLED
9233    int mem_base;
9234
9235        mem_base = xmlMemBlocks();
9236
9237        xmlCleanupPredefinedEntities();
9238        call_tests++;
9239        xmlResetLastError();
9240        if (mem_base != xmlMemBlocks()) {
9241            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9242	           xmlMemBlocks() - mem_base);
9243	    test_ret++;
9244            printf("\n");
9245        }
9246    function_tests++;
9247#endif
9248#endif
9249
9250    return(test_ret);
9251}
9252
9253
9254#define gen_nb_xmlEntitiesTablePtr 1
9255static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9256    return(NULL);
9257}
9258static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9259}
9260
9261static int
9262test_xmlCopyEntitiesTable(void) {
9263    int test_ret = 0;
9264
9265
9266    /* missing type support */
9267    return(test_ret);
9268}
9269
9270
9271static int
9272test_xmlCreateEntitiesTable(void) {
9273    int test_ret = 0;
9274
9275
9276    /* missing type support */
9277    return(test_ret);
9278}
9279
9280
9281static int
9282test_xmlDumpEntitiesTable(void) {
9283    int test_ret = 0;
9284
9285#if defined(LIBXML_OUTPUT_ENABLED)
9286    int mem_base;
9287    xmlBufferPtr buf; /* An XML buffer. */
9288    int n_buf;
9289    xmlEntitiesTablePtr table; /* An entity table */
9290    int n_table;
9291
9292    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9293    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9294        mem_base = xmlMemBlocks();
9295        buf = gen_xmlBufferPtr(n_buf, 0);
9296        table = gen_xmlEntitiesTablePtr(n_table, 1);
9297
9298        xmlDumpEntitiesTable(buf, table);
9299        call_tests++;
9300        des_xmlBufferPtr(n_buf, buf, 0);
9301        des_xmlEntitiesTablePtr(n_table, table, 1);
9302        xmlResetLastError();
9303        if (mem_base != xmlMemBlocks()) {
9304            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9305	           xmlMemBlocks() - mem_base);
9306	    test_ret++;
9307            printf(" %d", n_buf);
9308            printf(" %d", n_table);
9309            printf("\n");
9310        }
9311    }
9312    }
9313    function_tests++;
9314#endif
9315
9316    return(test_ret);
9317}
9318
9319
9320#define gen_nb_xmlEntityPtr 1
9321static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9322    return(NULL);
9323}
9324static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9325}
9326
9327static int
9328test_xmlDumpEntityDecl(void) {
9329    int test_ret = 0;
9330
9331#if defined(LIBXML_OUTPUT_ENABLED)
9332    int mem_base;
9333    xmlBufferPtr buf; /* An XML buffer. */
9334    int n_buf;
9335    xmlEntityPtr ent; /* An entity table */
9336    int n_ent;
9337
9338    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9339    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9340        mem_base = xmlMemBlocks();
9341        buf = gen_xmlBufferPtr(n_buf, 0);
9342        ent = gen_xmlEntityPtr(n_ent, 1);
9343
9344        xmlDumpEntityDecl(buf, ent);
9345        call_tests++;
9346        des_xmlBufferPtr(n_buf, buf, 0);
9347        des_xmlEntityPtr(n_ent, ent, 1);
9348        xmlResetLastError();
9349        if (mem_base != xmlMemBlocks()) {
9350            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9351	           xmlMemBlocks() - mem_base);
9352	    test_ret++;
9353            printf(" %d", n_buf);
9354            printf(" %d", n_ent);
9355            printf("\n");
9356        }
9357    }
9358    }
9359    function_tests++;
9360#endif
9361
9362    return(test_ret);
9363}
9364
9365
9366static int
9367test_xmlEncodeEntitiesReentrant(void) {
9368    int test_ret = 0;
9369
9370    int mem_base;
9371    xmlChar * ret_val;
9372    xmlDocPtr doc; /* the document containing the string */
9373    int n_doc;
9374    xmlChar * input; /* A string to convert to XML. */
9375    int n_input;
9376
9377    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9378    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9379        mem_base = xmlMemBlocks();
9380        doc = gen_xmlDocPtr(n_doc, 0);
9381        input = gen_const_xmlChar_ptr(n_input, 1);
9382
9383        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9384        desret_xmlChar_ptr(ret_val);
9385        call_tests++;
9386        des_xmlDocPtr(n_doc, doc, 0);
9387        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9388        xmlResetLastError();
9389        if (mem_base != xmlMemBlocks()) {
9390            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9391	           xmlMemBlocks() - mem_base);
9392	    test_ret++;
9393            printf(" %d", n_doc);
9394            printf(" %d", n_input);
9395            printf("\n");
9396        }
9397    }
9398    }
9399    function_tests++;
9400
9401    return(test_ret);
9402}
9403
9404
9405static int
9406test_xmlEncodeSpecialChars(void) {
9407    int test_ret = 0;
9408
9409    int mem_base;
9410    xmlChar * ret_val;
9411    xmlDocPtr doc; /* the document containing the string */
9412    int n_doc;
9413    xmlChar * input; /* A string to convert to XML. */
9414    int n_input;
9415
9416    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9417    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9418        mem_base = xmlMemBlocks();
9419        doc = gen_xmlDocPtr(n_doc, 0);
9420        input = gen_const_xmlChar_ptr(n_input, 1);
9421
9422        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9423        desret_xmlChar_ptr(ret_val);
9424        call_tests++;
9425        des_xmlDocPtr(n_doc, doc, 0);
9426        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9427        xmlResetLastError();
9428        if (mem_base != xmlMemBlocks()) {
9429            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9430	           xmlMemBlocks() - mem_base);
9431	    test_ret++;
9432            printf(" %d", n_doc);
9433            printf(" %d", n_input);
9434            printf("\n");
9435        }
9436    }
9437    }
9438    function_tests++;
9439
9440    return(test_ret);
9441}
9442
9443
9444static int
9445test_xmlGetDocEntity(void) {
9446    int test_ret = 0;
9447
9448    int mem_base;
9449    xmlEntityPtr ret_val;
9450    xmlDocPtr doc; /* the document referencing the entity */
9451    int n_doc;
9452    xmlChar * name; /* the entity name */
9453    int n_name;
9454
9455    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9456    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9457        mem_base = xmlMemBlocks();
9458        doc = gen_xmlDocPtr(n_doc, 0);
9459        name = gen_const_xmlChar_ptr(n_name, 1);
9460
9461        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9462        desret_xmlEntityPtr(ret_val);
9463        call_tests++;
9464        des_xmlDocPtr(n_doc, doc, 0);
9465        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9466        xmlResetLastError();
9467        if (mem_base != xmlMemBlocks()) {
9468            printf("Leak of %d blocks found in xmlGetDocEntity",
9469	           xmlMemBlocks() - mem_base);
9470	    test_ret++;
9471            printf(" %d", n_doc);
9472            printf(" %d", n_name);
9473            printf("\n");
9474        }
9475    }
9476    }
9477    function_tests++;
9478
9479    return(test_ret);
9480}
9481
9482
9483static int
9484test_xmlGetDtdEntity(void) {
9485    int test_ret = 0;
9486
9487    int mem_base;
9488    xmlEntityPtr ret_val;
9489    xmlDocPtr doc; /* the document referencing the entity */
9490    int n_doc;
9491    xmlChar * name; /* the entity name */
9492    int n_name;
9493
9494    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9495    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9496        mem_base = xmlMemBlocks();
9497        doc = gen_xmlDocPtr(n_doc, 0);
9498        name = gen_const_xmlChar_ptr(n_name, 1);
9499
9500        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9501        desret_xmlEntityPtr(ret_val);
9502        call_tests++;
9503        des_xmlDocPtr(n_doc, doc, 0);
9504        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9505        xmlResetLastError();
9506        if (mem_base != xmlMemBlocks()) {
9507            printf("Leak of %d blocks found in xmlGetDtdEntity",
9508	           xmlMemBlocks() - mem_base);
9509	    test_ret++;
9510            printf(" %d", n_doc);
9511            printf(" %d", n_name);
9512            printf("\n");
9513        }
9514    }
9515    }
9516    function_tests++;
9517
9518    return(test_ret);
9519}
9520
9521
9522static int
9523test_xmlGetParameterEntity(void) {
9524    int test_ret = 0;
9525
9526    int mem_base;
9527    xmlEntityPtr ret_val;
9528    xmlDocPtr doc; /* the document referencing the entity */
9529    int n_doc;
9530    xmlChar * name; /* the entity name */
9531    int n_name;
9532
9533    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9534    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9535        mem_base = xmlMemBlocks();
9536        doc = gen_xmlDocPtr(n_doc, 0);
9537        name = gen_const_xmlChar_ptr(n_name, 1);
9538
9539        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9540        desret_xmlEntityPtr(ret_val);
9541        call_tests++;
9542        des_xmlDocPtr(n_doc, doc, 0);
9543        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9544        xmlResetLastError();
9545        if (mem_base != xmlMemBlocks()) {
9546            printf("Leak of %d blocks found in xmlGetParameterEntity",
9547	           xmlMemBlocks() - mem_base);
9548	    test_ret++;
9549            printf(" %d", n_doc);
9550            printf(" %d", n_name);
9551            printf("\n");
9552        }
9553    }
9554    }
9555    function_tests++;
9556
9557    return(test_ret);
9558}
9559
9560
9561static int
9562test_xmlGetPredefinedEntity(void) {
9563    int test_ret = 0;
9564
9565    int mem_base;
9566    xmlEntityPtr ret_val;
9567    xmlChar * name; /* the entity name */
9568    int n_name;
9569
9570    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9571        mem_base = xmlMemBlocks();
9572        name = gen_const_xmlChar_ptr(n_name, 0);
9573
9574        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9575        desret_xmlEntityPtr(ret_val);
9576        call_tests++;
9577        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9578        xmlResetLastError();
9579        if (mem_base != xmlMemBlocks()) {
9580            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9581	           xmlMemBlocks() - mem_base);
9582	    test_ret++;
9583            printf(" %d", n_name);
9584            printf("\n");
9585        }
9586    }
9587    function_tests++;
9588
9589    return(test_ret);
9590}
9591
9592
9593static int
9594test_xmlInitializePredefinedEntities(void) {
9595    int test_ret = 0;
9596
9597#if defined(LIBXML_LEGACY_ENABLED)
9598#ifdef LIBXML_LEGACY_ENABLED
9599    int mem_base;
9600
9601        mem_base = xmlMemBlocks();
9602
9603        xmlInitializePredefinedEntities();
9604        call_tests++;
9605        xmlResetLastError();
9606        if (mem_base != xmlMemBlocks()) {
9607            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9608	           xmlMemBlocks() - mem_base);
9609	    test_ret++;
9610            printf("\n");
9611        }
9612    function_tests++;
9613#endif
9614#endif
9615
9616    return(test_ret);
9617}
9618
9619
9620static int
9621test_xmlNewEntity(void) {
9622    int test_ret = 0;
9623
9624    int mem_base;
9625    xmlEntityPtr ret_val;
9626    xmlDocPtr doc; /* the document */
9627    int n_doc;
9628    xmlChar * name; /* the entity name */
9629    int n_name;
9630    int type; /* the entity type XML_xxx_yyy_ENTITY */
9631    int n_type;
9632    xmlChar * ExternalID; /* the entity external ID if available */
9633    int n_ExternalID;
9634    xmlChar * SystemID; /* the entity system ID if available */
9635    int n_SystemID;
9636    xmlChar * content; /* the entity content */
9637    int n_content;
9638
9639    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9640    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9641    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9642    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9643    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9644    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9645        mem_base = xmlMemBlocks();
9646        doc = gen_xmlDocPtr(n_doc, 0);
9647        name = gen_const_xmlChar_ptr(n_name, 1);
9648        type = gen_int(n_type, 2);
9649        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9650        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9651        content = gen_const_xmlChar_ptr(n_content, 5);
9652
9653        ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9654        desret_xmlEntityPtr(ret_val);
9655        call_tests++;
9656        des_xmlDocPtr(n_doc, doc, 0);
9657        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9658        des_int(n_type, type, 2);
9659        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9660        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9661        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9662        xmlResetLastError();
9663        if (mem_base != xmlMemBlocks()) {
9664            printf("Leak of %d blocks found in xmlNewEntity",
9665	           xmlMemBlocks() - mem_base);
9666	    test_ret++;
9667            printf(" %d", n_doc);
9668            printf(" %d", n_name);
9669            printf(" %d", n_type);
9670            printf(" %d", n_ExternalID);
9671            printf(" %d", n_SystemID);
9672            printf(" %d", n_content);
9673            printf("\n");
9674        }
9675    }
9676    }
9677    }
9678    }
9679    }
9680    }
9681    function_tests++;
9682
9683    return(test_ret);
9684}
9685
9686static int
9687test_entities(void) {
9688    int test_ret = 0;
9689
9690    if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9691    test_ret += test_xmlAddDocEntity();
9692    test_ret += test_xmlAddDtdEntity();
9693    test_ret += test_xmlCleanupPredefinedEntities();
9694    test_ret += test_xmlCopyEntitiesTable();
9695    test_ret += test_xmlCreateEntitiesTable();
9696    test_ret += test_xmlDumpEntitiesTable();
9697    test_ret += test_xmlDumpEntityDecl();
9698    test_ret += test_xmlEncodeEntitiesReentrant();
9699    test_ret += test_xmlEncodeSpecialChars();
9700    test_ret += test_xmlGetDocEntity();
9701    test_ret += test_xmlGetDtdEntity();
9702    test_ret += test_xmlGetParameterEntity();
9703    test_ret += test_xmlGetPredefinedEntity();
9704    test_ret += test_xmlInitializePredefinedEntities();
9705    test_ret += test_xmlNewEntity();
9706
9707    if (test_ret != 0)
9708	printf("Module entities: %d errors\n", test_ret);
9709    return(test_ret);
9710}
9711
9712static int
9713test_xmlHashAddEntry(void) {
9714    int test_ret = 0;
9715
9716    int mem_base;
9717    int ret_val;
9718    xmlHashTablePtr table; /* the hash table */
9719    int n_table;
9720    xmlChar * name; /* the name of the userdata */
9721    int n_name;
9722    void * userdata; /* a pointer to the userdata */
9723    int n_userdata;
9724
9725    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9726    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9727    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9728        mem_base = xmlMemBlocks();
9729        table = gen_xmlHashTablePtr(n_table, 0);
9730        name = gen_const_xmlChar_ptr(n_name, 1);
9731        userdata = gen_userdata(n_userdata, 2);
9732
9733        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9734        desret_int(ret_val);
9735        call_tests++;
9736        des_xmlHashTablePtr(n_table, table, 0);
9737        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9738        des_userdata(n_userdata, userdata, 2);
9739        xmlResetLastError();
9740        if (mem_base != xmlMemBlocks()) {
9741            printf("Leak of %d blocks found in xmlHashAddEntry",
9742	           xmlMemBlocks() - mem_base);
9743	    test_ret++;
9744            printf(" %d", n_table);
9745            printf(" %d", n_name);
9746            printf(" %d", n_userdata);
9747            printf("\n");
9748        }
9749    }
9750    }
9751    }
9752    function_tests++;
9753
9754    return(test_ret);
9755}
9756
9757
9758static int
9759test_xmlHashAddEntry2(void) {
9760    int test_ret = 0;
9761
9762    int mem_base;
9763    int ret_val;
9764    xmlHashTablePtr table; /* the hash table */
9765    int n_table;
9766    xmlChar * name; /* the name of the userdata */
9767    int n_name;
9768    xmlChar * name2; /* a second name of the userdata */
9769    int n_name2;
9770    void * userdata; /* a pointer to the userdata */
9771    int n_userdata;
9772
9773    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9774    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9775    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9776    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9777        mem_base = xmlMemBlocks();
9778        table = gen_xmlHashTablePtr(n_table, 0);
9779        name = gen_const_xmlChar_ptr(n_name, 1);
9780        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9781        userdata = gen_userdata(n_userdata, 3);
9782
9783        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9784        desret_int(ret_val);
9785        call_tests++;
9786        des_xmlHashTablePtr(n_table, table, 0);
9787        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9788        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9789        des_userdata(n_userdata, userdata, 3);
9790        xmlResetLastError();
9791        if (mem_base != xmlMemBlocks()) {
9792            printf("Leak of %d blocks found in xmlHashAddEntry2",
9793	           xmlMemBlocks() - mem_base);
9794	    test_ret++;
9795            printf(" %d", n_table);
9796            printf(" %d", n_name);
9797            printf(" %d", n_name2);
9798            printf(" %d", n_userdata);
9799            printf("\n");
9800        }
9801    }
9802    }
9803    }
9804    }
9805    function_tests++;
9806
9807    return(test_ret);
9808}
9809
9810
9811static int
9812test_xmlHashAddEntry3(void) {
9813    int test_ret = 0;
9814
9815    int mem_base;
9816    int ret_val;
9817    xmlHashTablePtr table; /* the hash table */
9818    int n_table;
9819    xmlChar * name; /* the name of the userdata */
9820    int n_name;
9821    xmlChar * name2; /* a second name of the userdata */
9822    int n_name2;
9823    xmlChar * name3; /* a third name of the userdata */
9824    int n_name3;
9825    void * userdata; /* a pointer to the userdata */
9826    int n_userdata;
9827
9828    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9829    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9830    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9831    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9832    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9833        mem_base = xmlMemBlocks();
9834        table = gen_xmlHashTablePtr(n_table, 0);
9835        name = gen_const_xmlChar_ptr(n_name, 1);
9836        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9837        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9838        userdata = gen_userdata(n_userdata, 4);
9839
9840        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9841        desret_int(ret_val);
9842        call_tests++;
9843        des_xmlHashTablePtr(n_table, table, 0);
9844        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9845        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9846        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9847        des_userdata(n_userdata, userdata, 4);
9848        xmlResetLastError();
9849        if (mem_base != xmlMemBlocks()) {
9850            printf("Leak of %d blocks found in xmlHashAddEntry3",
9851	           xmlMemBlocks() - mem_base);
9852	    test_ret++;
9853            printf(" %d", n_table);
9854            printf(" %d", n_name);
9855            printf(" %d", n_name2);
9856            printf(" %d", n_name3);
9857            printf(" %d", n_userdata);
9858            printf("\n");
9859        }
9860    }
9861    }
9862    }
9863    }
9864    }
9865    function_tests++;
9866
9867    return(test_ret);
9868}
9869
9870
9871static int
9872test_xmlHashCopy(void) {
9873    int test_ret = 0;
9874
9875
9876    /* missing type support */
9877    return(test_ret);
9878}
9879
9880
9881static int
9882test_xmlHashCreate(void) {
9883    int test_ret = 0;
9884
9885
9886    /* missing type support */
9887    return(test_ret);
9888}
9889
9890
9891static int
9892test_xmlHashCreateDict(void) {
9893    int test_ret = 0;
9894
9895
9896    /* missing type support */
9897    return(test_ret);
9898}
9899
9900
9901static int
9902test_xmlHashLookup(void) {
9903    int test_ret = 0;
9904
9905    int mem_base;
9906    void * ret_val;
9907    xmlHashTablePtr table; /* the hash table */
9908    int n_table;
9909    xmlChar * name; /* the name of the userdata */
9910    int n_name;
9911
9912    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9913    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9914        mem_base = xmlMemBlocks();
9915        table = gen_xmlHashTablePtr(n_table, 0);
9916        name = gen_const_xmlChar_ptr(n_name, 1);
9917
9918        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9919        desret_void_ptr(ret_val);
9920        call_tests++;
9921        des_xmlHashTablePtr(n_table, table, 0);
9922        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9923        xmlResetLastError();
9924        if (mem_base != xmlMemBlocks()) {
9925            printf("Leak of %d blocks found in xmlHashLookup",
9926	           xmlMemBlocks() - mem_base);
9927	    test_ret++;
9928            printf(" %d", n_table);
9929            printf(" %d", n_name);
9930            printf("\n");
9931        }
9932    }
9933    }
9934    function_tests++;
9935
9936    return(test_ret);
9937}
9938
9939
9940static int
9941test_xmlHashLookup2(void) {
9942    int test_ret = 0;
9943
9944    int mem_base;
9945    void * ret_val;
9946    xmlHashTablePtr table; /* the hash table */
9947    int n_table;
9948    xmlChar * name; /* the name of the userdata */
9949    int n_name;
9950    xmlChar * name2; /* a second name of the userdata */
9951    int n_name2;
9952
9953    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9954    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9955    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9956        mem_base = xmlMemBlocks();
9957        table = gen_xmlHashTablePtr(n_table, 0);
9958        name = gen_const_xmlChar_ptr(n_name, 1);
9959        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9960
9961        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9962        desret_void_ptr(ret_val);
9963        call_tests++;
9964        des_xmlHashTablePtr(n_table, table, 0);
9965        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9966        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9967        xmlResetLastError();
9968        if (mem_base != xmlMemBlocks()) {
9969            printf("Leak of %d blocks found in xmlHashLookup2",
9970	           xmlMemBlocks() - mem_base);
9971	    test_ret++;
9972            printf(" %d", n_table);
9973            printf(" %d", n_name);
9974            printf(" %d", n_name2);
9975            printf("\n");
9976        }
9977    }
9978    }
9979    }
9980    function_tests++;
9981
9982    return(test_ret);
9983}
9984
9985
9986static int
9987test_xmlHashLookup3(void) {
9988    int test_ret = 0;
9989
9990    int mem_base;
9991    void * ret_val;
9992    xmlHashTablePtr table; /* the hash table */
9993    int n_table;
9994    xmlChar * name; /* the name of the userdata */
9995    int n_name;
9996    xmlChar * name2; /* a second name of the userdata */
9997    int n_name2;
9998    xmlChar * name3; /* a third name of the userdata */
9999    int n_name3;
10000
10001    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10002    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10003    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10004    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10005        mem_base = xmlMemBlocks();
10006        table = gen_xmlHashTablePtr(n_table, 0);
10007        name = gen_const_xmlChar_ptr(n_name, 1);
10008        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10009        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10010
10011        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10012        desret_void_ptr(ret_val);
10013        call_tests++;
10014        des_xmlHashTablePtr(n_table, table, 0);
10015        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10016        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10017        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10018        xmlResetLastError();
10019        if (mem_base != xmlMemBlocks()) {
10020            printf("Leak of %d blocks found in xmlHashLookup3",
10021	           xmlMemBlocks() - mem_base);
10022	    test_ret++;
10023            printf(" %d", n_table);
10024            printf(" %d", n_name);
10025            printf(" %d", n_name2);
10026            printf(" %d", n_name3);
10027            printf("\n");
10028        }
10029    }
10030    }
10031    }
10032    }
10033    function_tests++;
10034
10035    return(test_ret);
10036}
10037
10038
10039static int
10040test_xmlHashQLookup(void) {
10041    int test_ret = 0;
10042
10043    int mem_base;
10044    void * ret_val;
10045    xmlHashTablePtr table; /* the hash table */
10046    int n_table;
10047    xmlChar * prefix; /* the prefix of the userdata */
10048    int n_prefix;
10049    xmlChar * name; /* the name of the userdata */
10050    int n_name;
10051
10052    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10053    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10054    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10055        mem_base = xmlMemBlocks();
10056        table = gen_xmlHashTablePtr(n_table, 0);
10057        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10058        name = gen_const_xmlChar_ptr(n_name, 2);
10059
10060        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10061        desret_void_ptr(ret_val);
10062        call_tests++;
10063        des_xmlHashTablePtr(n_table, table, 0);
10064        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10065        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10066        xmlResetLastError();
10067        if (mem_base != xmlMemBlocks()) {
10068            printf("Leak of %d blocks found in xmlHashQLookup",
10069	           xmlMemBlocks() - mem_base);
10070	    test_ret++;
10071            printf(" %d", n_table);
10072            printf(" %d", n_prefix);
10073            printf(" %d", n_name);
10074            printf("\n");
10075        }
10076    }
10077    }
10078    }
10079    function_tests++;
10080
10081    return(test_ret);
10082}
10083
10084
10085static int
10086test_xmlHashQLookup2(void) {
10087    int test_ret = 0;
10088
10089    int mem_base;
10090    void * ret_val;
10091    xmlHashTablePtr table; /* the hash table */
10092    int n_table;
10093    xmlChar * prefix; /* the prefix of the userdata */
10094    int n_prefix;
10095    xmlChar * name; /* the name of the userdata */
10096    int n_name;
10097    xmlChar * prefix2; /* the second prefix of the userdata */
10098    int n_prefix2;
10099    xmlChar * name2; /* a second name of the userdata */
10100    int n_name2;
10101
10102    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10103    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10104    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10105    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10106    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10107        mem_base = xmlMemBlocks();
10108        table = gen_xmlHashTablePtr(n_table, 0);
10109        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10110        name = gen_const_xmlChar_ptr(n_name, 2);
10111        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10112        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10113
10114        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10115        desret_void_ptr(ret_val);
10116        call_tests++;
10117        des_xmlHashTablePtr(n_table, table, 0);
10118        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10119        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10120        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10121        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10122        xmlResetLastError();
10123        if (mem_base != xmlMemBlocks()) {
10124            printf("Leak of %d blocks found in xmlHashQLookup2",
10125	           xmlMemBlocks() - mem_base);
10126	    test_ret++;
10127            printf(" %d", n_table);
10128            printf(" %d", n_prefix);
10129            printf(" %d", n_name);
10130            printf(" %d", n_prefix2);
10131            printf(" %d", n_name2);
10132            printf("\n");
10133        }
10134    }
10135    }
10136    }
10137    }
10138    }
10139    function_tests++;
10140
10141    return(test_ret);
10142}
10143
10144
10145static int
10146test_xmlHashQLookup3(void) {
10147    int test_ret = 0;
10148
10149    int mem_base;
10150    void * ret_val;
10151    xmlHashTablePtr table; /* the hash table */
10152    int n_table;
10153    xmlChar * prefix; /* the prefix of the userdata */
10154    int n_prefix;
10155    xmlChar * name; /* the name of the userdata */
10156    int n_name;
10157    xmlChar * prefix2; /* the second prefix of the userdata */
10158    int n_prefix2;
10159    xmlChar * name2; /* a second name of the userdata */
10160    int n_name2;
10161    xmlChar * prefix3; /* the third prefix of the userdata */
10162    int n_prefix3;
10163    xmlChar * name3; /* a third name of the userdata */
10164    int n_name3;
10165
10166    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10167    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10168    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10169    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10170    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10171    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10172    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10173        mem_base = xmlMemBlocks();
10174        table = gen_xmlHashTablePtr(n_table, 0);
10175        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10176        name = gen_const_xmlChar_ptr(n_name, 2);
10177        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10178        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10179        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10180        name3 = gen_const_xmlChar_ptr(n_name3, 6);
10181
10182        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10183        desret_void_ptr(ret_val);
10184        call_tests++;
10185        des_xmlHashTablePtr(n_table, table, 0);
10186        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10187        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10188        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10189        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10190        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10191        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10192        xmlResetLastError();
10193        if (mem_base != xmlMemBlocks()) {
10194            printf("Leak of %d blocks found in xmlHashQLookup3",
10195	           xmlMemBlocks() - mem_base);
10196	    test_ret++;
10197            printf(" %d", n_table);
10198            printf(" %d", n_prefix);
10199            printf(" %d", n_name);
10200            printf(" %d", n_prefix2);
10201            printf(" %d", n_name2);
10202            printf(" %d", n_prefix3);
10203            printf(" %d", n_name3);
10204            printf("\n");
10205        }
10206    }
10207    }
10208    }
10209    }
10210    }
10211    }
10212    }
10213    function_tests++;
10214
10215    return(test_ret);
10216}
10217
10218
10219static int
10220test_xmlHashRemoveEntry(void) {
10221    int test_ret = 0;
10222
10223    int mem_base;
10224    int ret_val;
10225    xmlHashTablePtr table; /* the hash table */
10226    int n_table;
10227    xmlChar * name; /* the name of the userdata */
10228    int n_name;
10229    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10230    int n_f;
10231
10232    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10233    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10234    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10235        mem_base = xmlMemBlocks();
10236        table = gen_xmlHashTablePtr(n_table, 0);
10237        name = gen_const_xmlChar_ptr(n_name, 1);
10238        f = gen_xmlHashDeallocator(n_f, 2);
10239
10240        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10241        desret_int(ret_val);
10242        call_tests++;
10243        des_xmlHashTablePtr(n_table, table, 0);
10244        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10245        des_xmlHashDeallocator(n_f, f, 2);
10246        xmlResetLastError();
10247        if (mem_base != xmlMemBlocks()) {
10248            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10249	           xmlMemBlocks() - mem_base);
10250	    test_ret++;
10251            printf(" %d", n_table);
10252            printf(" %d", n_name);
10253            printf(" %d", n_f);
10254            printf("\n");
10255        }
10256    }
10257    }
10258    }
10259    function_tests++;
10260
10261    return(test_ret);
10262}
10263
10264
10265static int
10266test_xmlHashRemoveEntry2(void) {
10267    int test_ret = 0;
10268
10269    int mem_base;
10270    int ret_val;
10271    xmlHashTablePtr table; /* the hash table */
10272    int n_table;
10273    xmlChar * name; /* the name of the userdata */
10274    int n_name;
10275    xmlChar * name2; /* a second name of the userdata */
10276    int n_name2;
10277    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10278    int n_f;
10279
10280    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10281    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10282    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10283    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10284        mem_base = xmlMemBlocks();
10285        table = gen_xmlHashTablePtr(n_table, 0);
10286        name = gen_const_xmlChar_ptr(n_name, 1);
10287        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10288        f = gen_xmlHashDeallocator(n_f, 3);
10289
10290        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10291        desret_int(ret_val);
10292        call_tests++;
10293        des_xmlHashTablePtr(n_table, table, 0);
10294        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10295        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10296        des_xmlHashDeallocator(n_f, f, 3);
10297        xmlResetLastError();
10298        if (mem_base != xmlMemBlocks()) {
10299            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10300	           xmlMemBlocks() - mem_base);
10301	    test_ret++;
10302            printf(" %d", n_table);
10303            printf(" %d", n_name);
10304            printf(" %d", n_name2);
10305            printf(" %d", n_f);
10306            printf("\n");
10307        }
10308    }
10309    }
10310    }
10311    }
10312    function_tests++;
10313
10314    return(test_ret);
10315}
10316
10317
10318static int
10319test_xmlHashRemoveEntry3(void) {
10320    int test_ret = 0;
10321
10322    int mem_base;
10323    int ret_val;
10324    xmlHashTablePtr table; /* the hash table */
10325    int n_table;
10326    xmlChar * name; /* the name of the userdata */
10327    int n_name;
10328    xmlChar * name2; /* a second name of the userdata */
10329    int n_name2;
10330    xmlChar * name3; /* a third name of the userdata */
10331    int n_name3;
10332    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10333    int n_f;
10334
10335    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10336    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10337    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10338    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10339    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10340        mem_base = xmlMemBlocks();
10341        table = gen_xmlHashTablePtr(n_table, 0);
10342        name = gen_const_xmlChar_ptr(n_name, 1);
10343        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10344        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10345        f = gen_xmlHashDeallocator(n_f, 4);
10346
10347        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10348        desret_int(ret_val);
10349        call_tests++;
10350        des_xmlHashTablePtr(n_table, table, 0);
10351        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10352        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10353        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10354        des_xmlHashDeallocator(n_f, f, 4);
10355        xmlResetLastError();
10356        if (mem_base != xmlMemBlocks()) {
10357            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10358	           xmlMemBlocks() - mem_base);
10359	    test_ret++;
10360            printf(" %d", n_table);
10361            printf(" %d", n_name);
10362            printf(" %d", n_name2);
10363            printf(" %d", n_name3);
10364            printf(" %d", n_f);
10365            printf("\n");
10366        }
10367    }
10368    }
10369    }
10370    }
10371    }
10372    function_tests++;
10373
10374    return(test_ret);
10375}
10376
10377
10378static int
10379test_xmlHashScan(void) {
10380    int test_ret = 0;
10381
10382
10383    /* missing type support */
10384    return(test_ret);
10385}
10386
10387
10388static int
10389test_xmlHashScan3(void) {
10390    int test_ret = 0;
10391
10392
10393    /* missing type support */
10394    return(test_ret);
10395}
10396
10397
10398static int
10399test_xmlHashScanFull(void) {
10400    int test_ret = 0;
10401
10402
10403    /* missing type support */
10404    return(test_ret);
10405}
10406
10407
10408static int
10409test_xmlHashScanFull3(void) {
10410    int test_ret = 0;
10411
10412
10413    /* missing type support */
10414    return(test_ret);
10415}
10416
10417
10418static int
10419test_xmlHashSize(void) {
10420    int test_ret = 0;
10421
10422    int mem_base;
10423    int ret_val;
10424    xmlHashTablePtr table; /* the hash table */
10425    int n_table;
10426
10427    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10428        mem_base = xmlMemBlocks();
10429        table = gen_xmlHashTablePtr(n_table, 0);
10430
10431        ret_val = xmlHashSize(table);
10432        desret_int(ret_val);
10433        call_tests++;
10434        des_xmlHashTablePtr(n_table, table, 0);
10435        xmlResetLastError();
10436        if (mem_base != xmlMemBlocks()) {
10437            printf("Leak of %d blocks found in xmlHashSize",
10438	           xmlMemBlocks() - mem_base);
10439	    test_ret++;
10440            printf(" %d", n_table);
10441            printf("\n");
10442        }
10443    }
10444    function_tests++;
10445
10446    return(test_ret);
10447}
10448
10449
10450static int
10451test_xmlHashUpdateEntry(void) {
10452    int test_ret = 0;
10453
10454    int mem_base;
10455    int ret_val;
10456    xmlHashTablePtr table; /* the hash table */
10457    int n_table;
10458    xmlChar * name; /* the name of the userdata */
10459    int n_name;
10460    void * userdata; /* a pointer to the userdata */
10461    int n_userdata;
10462    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10463    int n_f;
10464
10465    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10466    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10467    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10468    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10469        mem_base = xmlMemBlocks();
10470        table = gen_xmlHashTablePtr(n_table, 0);
10471        name = gen_const_xmlChar_ptr(n_name, 1);
10472        userdata = gen_userdata(n_userdata, 2);
10473        f = gen_xmlHashDeallocator(n_f, 3);
10474
10475        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10476        desret_int(ret_val);
10477        call_tests++;
10478        des_xmlHashTablePtr(n_table, table, 0);
10479        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10480        des_userdata(n_userdata, userdata, 2);
10481        des_xmlHashDeallocator(n_f, f, 3);
10482        xmlResetLastError();
10483        if (mem_base != xmlMemBlocks()) {
10484            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10485	           xmlMemBlocks() - mem_base);
10486	    test_ret++;
10487            printf(" %d", n_table);
10488            printf(" %d", n_name);
10489            printf(" %d", n_userdata);
10490            printf(" %d", n_f);
10491            printf("\n");
10492        }
10493    }
10494    }
10495    }
10496    }
10497    function_tests++;
10498
10499    return(test_ret);
10500}
10501
10502
10503static int
10504test_xmlHashUpdateEntry2(void) {
10505    int test_ret = 0;
10506
10507    int mem_base;
10508    int ret_val;
10509    xmlHashTablePtr table; /* the hash table */
10510    int n_table;
10511    xmlChar * name; /* the name of the userdata */
10512    int n_name;
10513    xmlChar * name2; /* a second name of the userdata */
10514    int n_name2;
10515    void * userdata; /* a pointer to the userdata */
10516    int n_userdata;
10517    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10518    int n_f;
10519
10520    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10521    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10522    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10523    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10524    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10525        mem_base = xmlMemBlocks();
10526        table = gen_xmlHashTablePtr(n_table, 0);
10527        name = gen_const_xmlChar_ptr(n_name, 1);
10528        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10529        userdata = gen_userdata(n_userdata, 3);
10530        f = gen_xmlHashDeallocator(n_f, 4);
10531
10532        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10533        desret_int(ret_val);
10534        call_tests++;
10535        des_xmlHashTablePtr(n_table, table, 0);
10536        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10537        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10538        des_userdata(n_userdata, userdata, 3);
10539        des_xmlHashDeallocator(n_f, f, 4);
10540        xmlResetLastError();
10541        if (mem_base != xmlMemBlocks()) {
10542            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10543	           xmlMemBlocks() - mem_base);
10544	    test_ret++;
10545            printf(" %d", n_table);
10546            printf(" %d", n_name);
10547            printf(" %d", n_name2);
10548            printf(" %d", n_userdata);
10549            printf(" %d", n_f);
10550            printf("\n");
10551        }
10552    }
10553    }
10554    }
10555    }
10556    }
10557    function_tests++;
10558
10559    return(test_ret);
10560}
10561
10562
10563static int
10564test_xmlHashUpdateEntry3(void) {
10565    int test_ret = 0;
10566
10567    int mem_base;
10568    int ret_val;
10569    xmlHashTablePtr table; /* the hash table */
10570    int n_table;
10571    xmlChar * name; /* the name of the userdata */
10572    int n_name;
10573    xmlChar * name2; /* a second name of the userdata */
10574    int n_name2;
10575    xmlChar * name3; /* a third name of the userdata */
10576    int n_name3;
10577    void * userdata; /* a pointer to the userdata */
10578    int n_userdata;
10579    xmlHashDeallocator f; /* the deallocator function for replaced 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_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10586    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10587    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10588        mem_base = xmlMemBlocks();
10589        table = gen_xmlHashTablePtr(n_table, 0);
10590        name = gen_const_xmlChar_ptr(n_name, 1);
10591        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10592        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10593        userdata = gen_userdata(n_userdata, 4);
10594        f = gen_xmlHashDeallocator(n_f, 5);
10595
10596        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10597        desret_int(ret_val);
10598        call_tests++;
10599        des_xmlHashTablePtr(n_table, table, 0);
10600        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10601        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10602        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10603        des_userdata(n_userdata, userdata, 4);
10604        des_xmlHashDeallocator(n_f, f, 5);
10605        xmlResetLastError();
10606        if (mem_base != xmlMemBlocks()) {
10607            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10608	           xmlMemBlocks() - mem_base);
10609	    test_ret++;
10610            printf(" %d", n_table);
10611            printf(" %d", n_name);
10612            printf(" %d", n_name2);
10613            printf(" %d", n_name3);
10614            printf(" %d", n_userdata);
10615            printf(" %d", n_f);
10616            printf("\n");
10617        }
10618    }
10619    }
10620    }
10621    }
10622    }
10623    }
10624    function_tests++;
10625
10626    return(test_ret);
10627}
10628
10629static int
10630test_hash(void) {
10631    int test_ret = 0;
10632
10633    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10634    test_ret += test_xmlHashAddEntry();
10635    test_ret += test_xmlHashAddEntry2();
10636    test_ret += test_xmlHashAddEntry3();
10637    test_ret += test_xmlHashCopy();
10638    test_ret += test_xmlHashCreate();
10639    test_ret += test_xmlHashCreateDict();
10640    test_ret += test_xmlHashLookup();
10641    test_ret += test_xmlHashLookup2();
10642    test_ret += test_xmlHashLookup3();
10643    test_ret += test_xmlHashQLookup();
10644    test_ret += test_xmlHashQLookup2();
10645    test_ret += test_xmlHashQLookup3();
10646    test_ret += test_xmlHashRemoveEntry();
10647    test_ret += test_xmlHashRemoveEntry2();
10648    test_ret += test_xmlHashRemoveEntry3();
10649    test_ret += test_xmlHashScan();
10650    test_ret += test_xmlHashScan3();
10651    test_ret += test_xmlHashScanFull();
10652    test_ret += test_xmlHashScanFull3();
10653    test_ret += test_xmlHashSize();
10654    test_ret += test_xmlHashUpdateEntry();
10655    test_ret += test_xmlHashUpdateEntry2();
10656    test_ret += test_xmlHashUpdateEntry3();
10657
10658    if (test_ret != 0)
10659	printf("Module hash: %d errors\n", test_ret);
10660    return(test_ret);
10661}
10662
10663#define gen_nb_xmlLinkPtr 1
10664static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10665    return(NULL);
10666}
10667static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10668}
10669
10670static int
10671test_xmlLinkGetData(void) {
10672    int test_ret = 0;
10673
10674    int mem_base;
10675    void * ret_val;
10676    xmlLinkPtr lk; /* a link */
10677    int n_lk;
10678
10679    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10680        mem_base = xmlMemBlocks();
10681        lk = gen_xmlLinkPtr(n_lk, 0);
10682
10683        ret_val = xmlLinkGetData(lk);
10684        desret_void_ptr(ret_val);
10685        call_tests++;
10686        des_xmlLinkPtr(n_lk, lk, 0);
10687        xmlResetLastError();
10688        if (mem_base != xmlMemBlocks()) {
10689            printf("Leak of %d blocks found in xmlLinkGetData",
10690	           xmlMemBlocks() - mem_base);
10691	    test_ret++;
10692            printf(" %d", n_lk);
10693            printf("\n");
10694        }
10695    }
10696    function_tests++;
10697
10698    return(test_ret);
10699}
10700
10701
10702static int
10703test_xmlListAppend(void) {
10704    int test_ret = 0;
10705
10706    int mem_base;
10707    int ret_val;
10708    xmlListPtr l; /* a list */
10709    int n_l;
10710    void * data; /* the data */
10711    int n_data;
10712
10713    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10714    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10715        mem_base = xmlMemBlocks();
10716        l = gen_xmlListPtr(n_l, 0);
10717        data = gen_userdata(n_data, 1);
10718
10719        ret_val = xmlListAppend(l, data);
10720        desret_int(ret_val);
10721        call_tests++;
10722        des_xmlListPtr(n_l, l, 0);
10723        des_userdata(n_data, data, 1);
10724        xmlResetLastError();
10725        if (mem_base != xmlMemBlocks()) {
10726            printf("Leak of %d blocks found in xmlListAppend",
10727	           xmlMemBlocks() - mem_base);
10728	    test_ret++;
10729            printf(" %d", n_l);
10730            printf(" %d", n_data);
10731            printf("\n");
10732        }
10733    }
10734    }
10735    function_tests++;
10736
10737    return(test_ret);
10738}
10739
10740
10741static int
10742test_xmlListClear(void) {
10743    int test_ret = 0;
10744
10745    int mem_base;
10746    xmlListPtr l; /* a list */
10747    int n_l;
10748
10749    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10750        mem_base = xmlMemBlocks();
10751        l = gen_xmlListPtr(n_l, 0);
10752
10753        xmlListClear(l);
10754        call_tests++;
10755        des_xmlListPtr(n_l, l, 0);
10756        xmlResetLastError();
10757        if (mem_base != xmlMemBlocks()) {
10758            printf("Leak of %d blocks found in xmlListClear",
10759	           xmlMemBlocks() - mem_base);
10760	    test_ret++;
10761            printf(" %d", n_l);
10762            printf("\n");
10763        }
10764    }
10765    function_tests++;
10766
10767    return(test_ret);
10768}
10769
10770
10771#define gen_nb_const_xmlListPtr 1
10772static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10773    return(NULL);
10774}
10775static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10776}
10777
10778static int
10779test_xmlListCopy(void) {
10780    int test_ret = 0;
10781
10782    int mem_base;
10783    int ret_val;
10784    xmlListPtr cur; /* the new list */
10785    int n_cur;
10786    xmlListPtr old; /* the old list */
10787    int n_old;
10788
10789    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10790    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10791        mem_base = xmlMemBlocks();
10792        cur = gen_xmlListPtr(n_cur, 0);
10793        old = gen_const_xmlListPtr(n_old, 1);
10794
10795        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10796        desret_int(ret_val);
10797        call_tests++;
10798        des_xmlListPtr(n_cur, cur, 0);
10799        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10800        xmlResetLastError();
10801        if (mem_base != xmlMemBlocks()) {
10802            printf("Leak of %d blocks found in xmlListCopy",
10803	           xmlMemBlocks() - mem_base);
10804	    test_ret++;
10805            printf(" %d", n_cur);
10806            printf(" %d", n_old);
10807            printf("\n");
10808        }
10809    }
10810    }
10811    function_tests++;
10812
10813    return(test_ret);
10814}
10815
10816
10817static int
10818test_xmlListCreate(void) {
10819    int test_ret = 0;
10820
10821
10822    /* missing type support */
10823    return(test_ret);
10824}
10825
10826
10827static int
10828test_xmlListDup(void) {
10829    int test_ret = 0;
10830
10831
10832    /* missing type support */
10833    return(test_ret);
10834}
10835
10836
10837static int
10838test_xmlListEmpty(void) {
10839    int test_ret = 0;
10840
10841    int mem_base;
10842    int ret_val;
10843    xmlListPtr l; /* a list */
10844    int n_l;
10845
10846    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10847        mem_base = xmlMemBlocks();
10848        l = gen_xmlListPtr(n_l, 0);
10849
10850        ret_val = xmlListEmpty(l);
10851        desret_int(ret_val);
10852        call_tests++;
10853        des_xmlListPtr(n_l, l, 0);
10854        xmlResetLastError();
10855        if (mem_base != xmlMemBlocks()) {
10856            printf("Leak of %d blocks found in xmlListEmpty",
10857	           xmlMemBlocks() - mem_base);
10858	    test_ret++;
10859            printf(" %d", n_l);
10860            printf("\n");
10861        }
10862    }
10863    function_tests++;
10864
10865    return(test_ret);
10866}
10867
10868
10869static int
10870test_xmlListEnd(void) {
10871    int test_ret = 0;
10872
10873
10874    /* missing type support */
10875    return(test_ret);
10876}
10877
10878
10879static int
10880test_xmlListFront(void) {
10881    int test_ret = 0;
10882
10883
10884    /* missing type support */
10885    return(test_ret);
10886}
10887
10888
10889static int
10890test_xmlListInsert(void) {
10891    int test_ret = 0;
10892
10893    int mem_base;
10894    int ret_val;
10895    xmlListPtr l; /* a list */
10896    int n_l;
10897    void * data; /* the data */
10898    int n_data;
10899
10900    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10901    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10902        mem_base = xmlMemBlocks();
10903        l = gen_xmlListPtr(n_l, 0);
10904        data = gen_userdata(n_data, 1);
10905
10906        ret_val = xmlListInsert(l, data);
10907        desret_int(ret_val);
10908        call_tests++;
10909        des_xmlListPtr(n_l, l, 0);
10910        des_userdata(n_data, data, 1);
10911        xmlResetLastError();
10912        if (mem_base != xmlMemBlocks()) {
10913            printf("Leak of %d blocks found in xmlListInsert",
10914	           xmlMemBlocks() - mem_base);
10915	    test_ret++;
10916            printf(" %d", n_l);
10917            printf(" %d", n_data);
10918            printf("\n");
10919        }
10920    }
10921    }
10922    function_tests++;
10923
10924    return(test_ret);
10925}
10926
10927
10928static int
10929test_xmlListMerge(void) {
10930    int test_ret = 0;
10931
10932    int mem_base;
10933    xmlListPtr l1; /* the original list */
10934    int n_l1;
10935    xmlListPtr l2; /* the new list */
10936    int n_l2;
10937
10938    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10939    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10940        mem_base = xmlMemBlocks();
10941        l1 = gen_xmlListPtr(n_l1, 0);
10942        l2 = gen_xmlListPtr(n_l2, 1);
10943
10944        xmlListMerge(l1, l2);
10945        call_tests++;
10946        des_xmlListPtr(n_l1, l1, 0);
10947        des_xmlListPtr(n_l2, l2, 1);
10948        xmlResetLastError();
10949        if (mem_base != xmlMemBlocks()) {
10950            printf("Leak of %d blocks found in xmlListMerge",
10951	           xmlMemBlocks() - mem_base);
10952	    test_ret++;
10953            printf(" %d", n_l1);
10954            printf(" %d", n_l2);
10955            printf("\n");
10956        }
10957    }
10958    }
10959    function_tests++;
10960
10961    return(test_ret);
10962}
10963
10964
10965static int
10966test_xmlListPopBack(void) {
10967    int test_ret = 0;
10968
10969    int mem_base;
10970    xmlListPtr l; /* a list */
10971    int n_l;
10972
10973    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10974        mem_base = xmlMemBlocks();
10975        l = gen_xmlListPtr(n_l, 0);
10976
10977        xmlListPopBack(l);
10978        call_tests++;
10979        des_xmlListPtr(n_l, l, 0);
10980        xmlResetLastError();
10981        if (mem_base != xmlMemBlocks()) {
10982            printf("Leak of %d blocks found in xmlListPopBack",
10983	           xmlMemBlocks() - mem_base);
10984	    test_ret++;
10985            printf(" %d", n_l);
10986            printf("\n");
10987        }
10988    }
10989    function_tests++;
10990
10991    return(test_ret);
10992}
10993
10994
10995static int
10996test_xmlListPopFront(void) {
10997    int test_ret = 0;
10998
10999    int mem_base;
11000    xmlListPtr l; /* a list */
11001    int n_l;
11002
11003    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11004        mem_base = xmlMemBlocks();
11005        l = gen_xmlListPtr(n_l, 0);
11006
11007        xmlListPopFront(l);
11008        call_tests++;
11009        des_xmlListPtr(n_l, l, 0);
11010        xmlResetLastError();
11011        if (mem_base != xmlMemBlocks()) {
11012            printf("Leak of %d blocks found in xmlListPopFront",
11013	           xmlMemBlocks() - mem_base);
11014	    test_ret++;
11015            printf(" %d", n_l);
11016            printf("\n");
11017        }
11018    }
11019    function_tests++;
11020
11021    return(test_ret);
11022}
11023
11024
11025static int
11026test_xmlListPushBack(void) {
11027    int test_ret = 0;
11028
11029    int mem_base;
11030    int ret_val;
11031    xmlListPtr l; /* a list */
11032    int n_l;
11033    void * data; /* new data */
11034    int n_data;
11035
11036    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11037    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11038        mem_base = xmlMemBlocks();
11039        l = gen_xmlListPtr(n_l, 0);
11040        data = gen_userdata(n_data, 1);
11041
11042        ret_val = xmlListPushBack(l, data);
11043        desret_int(ret_val);
11044        call_tests++;
11045        des_xmlListPtr(n_l, l, 0);
11046        des_userdata(n_data, data, 1);
11047        xmlResetLastError();
11048        if (mem_base != xmlMemBlocks()) {
11049            printf("Leak of %d blocks found in xmlListPushBack",
11050	           xmlMemBlocks() - mem_base);
11051	    test_ret++;
11052            printf(" %d", n_l);
11053            printf(" %d", n_data);
11054            printf("\n");
11055        }
11056    }
11057    }
11058    function_tests++;
11059
11060    return(test_ret);
11061}
11062
11063
11064static int
11065test_xmlListPushFront(void) {
11066    int test_ret = 0;
11067
11068    int mem_base;
11069    int ret_val;
11070    xmlListPtr l; /* a list */
11071    int n_l;
11072    void * data; /* new data */
11073    int n_data;
11074
11075    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11076    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11077        mem_base = xmlMemBlocks();
11078        l = gen_xmlListPtr(n_l, 0);
11079        data = gen_userdata(n_data, 1);
11080
11081        ret_val = xmlListPushFront(l, data);
11082        desret_int(ret_val);
11083        call_tests++;
11084        des_xmlListPtr(n_l, l, 0);
11085        des_userdata(n_data, data, 1);
11086        xmlResetLastError();
11087        if (mem_base != xmlMemBlocks()) {
11088            printf("Leak of %d blocks found in xmlListPushFront",
11089	           xmlMemBlocks() - mem_base);
11090	    test_ret++;
11091            printf(" %d", n_l);
11092            printf(" %d", n_data);
11093            printf("\n");
11094        }
11095    }
11096    }
11097    function_tests++;
11098
11099    return(test_ret);
11100}
11101
11102
11103static int
11104test_xmlListRemoveAll(void) {
11105    int test_ret = 0;
11106
11107    int mem_base;
11108    int ret_val;
11109    xmlListPtr l; /* a list */
11110    int n_l;
11111    void * data; /* list data */
11112    int n_data;
11113
11114    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11115    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11116        mem_base = xmlMemBlocks();
11117        l = gen_xmlListPtr(n_l, 0);
11118        data = gen_userdata(n_data, 1);
11119
11120        ret_val = xmlListRemoveAll(l, data);
11121        desret_int(ret_val);
11122        call_tests++;
11123        des_xmlListPtr(n_l, l, 0);
11124        des_userdata(n_data, data, 1);
11125        xmlResetLastError();
11126        if (mem_base != xmlMemBlocks()) {
11127            printf("Leak of %d blocks found in xmlListRemoveAll",
11128	           xmlMemBlocks() - mem_base);
11129	    test_ret++;
11130            printf(" %d", n_l);
11131            printf(" %d", n_data);
11132            printf("\n");
11133        }
11134    }
11135    }
11136    function_tests++;
11137
11138    return(test_ret);
11139}
11140
11141
11142static int
11143test_xmlListRemoveFirst(void) {
11144    int test_ret = 0;
11145
11146    int mem_base;
11147    int ret_val;
11148    xmlListPtr l; /* a list */
11149    int n_l;
11150    void * data; /* list data */
11151    int n_data;
11152
11153    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11154    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11155        mem_base = xmlMemBlocks();
11156        l = gen_xmlListPtr(n_l, 0);
11157        data = gen_userdata(n_data, 1);
11158
11159        ret_val = xmlListRemoveFirst(l, data);
11160        desret_int(ret_val);
11161        call_tests++;
11162        des_xmlListPtr(n_l, l, 0);
11163        des_userdata(n_data, data, 1);
11164        xmlResetLastError();
11165        if (mem_base != xmlMemBlocks()) {
11166            printf("Leak of %d blocks found in xmlListRemoveFirst",
11167	           xmlMemBlocks() - mem_base);
11168	    test_ret++;
11169            printf(" %d", n_l);
11170            printf(" %d", n_data);
11171            printf("\n");
11172        }
11173    }
11174    }
11175    function_tests++;
11176
11177    return(test_ret);
11178}
11179
11180
11181static int
11182test_xmlListRemoveLast(void) {
11183    int test_ret = 0;
11184
11185    int mem_base;
11186    int ret_val;
11187    xmlListPtr l; /* a list */
11188    int n_l;
11189    void * data; /* list data */
11190    int n_data;
11191
11192    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11193    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11194        mem_base = xmlMemBlocks();
11195        l = gen_xmlListPtr(n_l, 0);
11196        data = gen_userdata(n_data, 1);
11197
11198        ret_val = xmlListRemoveLast(l, data);
11199        desret_int(ret_val);
11200        call_tests++;
11201        des_xmlListPtr(n_l, l, 0);
11202        des_userdata(n_data, data, 1);
11203        xmlResetLastError();
11204        if (mem_base != xmlMemBlocks()) {
11205            printf("Leak of %d blocks found in xmlListRemoveLast",
11206	           xmlMemBlocks() - mem_base);
11207	    test_ret++;
11208            printf(" %d", n_l);
11209            printf(" %d", n_data);
11210            printf("\n");
11211        }
11212    }
11213    }
11214    function_tests++;
11215
11216    return(test_ret);
11217}
11218
11219
11220static int
11221test_xmlListReverse(void) {
11222    int test_ret = 0;
11223
11224    int mem_base;
11225    xmlListPtr l; /* a list */
11226    int n_l;
11227
11228    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11229        mem_base = xmlMemBlocks();
11230        l = gen_xmlListPtr(n_l, 0);
11231
11232        xmlListReverse(l);
11233        call_tests++;
11234        des_xmlListPtr(n_l, l, 0);
11235        xmlResetLastError();
11236        if (mem_base != xmlMemBlocks()) {
11237            printf("Leak of %d blocks found in xmlListReverse",
11238	           xmlMemBlocks() - mem_base);
11239	    test_ret++;
11240            printf(" %d", n_l);
11241            printf("\n");
11242        }
11243    }
11244    function_tests++;
11245
11246    return(test_ret);
11247}
11248
11249
11250static int
11251test_xmlListReverseSearch(void) {
11252    int test_ret = 0;
11253
11254    int mem_base;
11255    void * ret_val;
11256    xmlListPtr l; /* a list */
11257    int n_l;
11258    void * data; /* a search value */
11259    int n_data;
11260
11261    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11262    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11263        mem_base = xmlMemBlocks();
11264        l = gen_xmlListPtr(n_l, 0);
11265        data = gen_userdata(n_data, 1);
11266
11267        ret_val = xmlListReverseSearch(l, data);
11268        desret_void_ptr(ret_val);
11269        call_tests++;
11270        des_xmlListPtr(n_l, l, 0);
11271        des_userdata(n_data, data, 1);
11272        xmlResetLastError();
11273        if (mem_base != xmlMemBlocks()) {
11274            printf("Leak of %d blocks found in xmlListReverseSearch",
11275	           xmlMemBlocks() - mem_base);
11276	    test_ret++;
11277            printf(" %d", n_l);
11278            printf(" %d", n_data);
11279            printf("\n");
11280        }
11281    }
11282    }
11283    function_tests++;
11284
11285    return(test_ret);
11286}
11287
11288
11289static int
11290test_xmlListReverseWalk(void) {
11291    int test_ret = 0;
11292
11293
11294    /* missing type support */
11295    return(test_ret);
11296}
11297
11298
11299static int
11300test_xmlListSearch(void) {
11301    int test_ret = 0;
11302
11303    int mem_base;
11304    void * ret_val;
11305    xmlListPtr l; /* a list */
11306    int n_l;
11307    void * data; /* a search value */
11308    int n_data;
11309
11310    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11311    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11312        mem_base = xmlMemBlocks();
11313        l = gen_xmlListPtr(n_l, 0);
11314        data = gen_userdata(n_data, 1);
11315
11316        ret_val = xmlListSearch(l, data);
11317        desret_void_ptr(ret_val);
11318        call_tests++;
11319        des_xmlListPtr(n_l, l, 0);
11320        des_userdata(n_data, data, 1);
11321        xmlResetLastError();
11322        if (mem_base != xmlMemBlocks()) {
11323            printf("Leak of %d blocks found in xmlListSearch",
11324	           xmlMemBlocks() - mem_base);
11325	    test_ret++;
11326            printf(" %d", n_l);
11327            printf(" %d", n_data);
11328            printf("\n");
11329        }
11330    }
11331    }
11332    function_tests++;
11333
11334    return(test_ret);
11335}
11336
11337
11338static int
11339test_xmlListSize(void) {
11340    int test_ret = 0;
11341
11342    int mem_base;
11343    int ret_val;
11344    xmlListPtr l; /* a list */
11345    int n_l;
11346
11347    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11348        mem_base = xmlMemBlocks();
11349        l = gen_xmlListPtr(n_l, 0);
11350
11351        ret_val = xmlListSize(l);
11352        desret_int(ret_val);
11353        call_tests++;
11354        des_xmlListPtr(n_l, l, 0);
11355        xmlResetLastError();
11356        if (mem_base != xmlMemBlocks()) {
11357            printf("Leak of %d blocks found in xmlListSize",
11358	           xmlMemBlocks() - mem_base);
11359	    test_ret++;
11360            printf(" %d", n_l);
11361            printf("\n");
11362        }
11363    }
11364    function_tests++;
11365
11366    return(test_ret);
11367}
11368
11369
11370static int
11371test_xmlListSort(void) {
11372    int test_ret = 0;
11373
11374    int mem_base;
11375    xmlListPtr l; /* a list */
11376    int n_l;
11377
11378    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11379        mem_base = xmlMemBlocks();
11380        l = gen_xmlListPtr(n_l, 0);
11381
11382        xmlListSort(l);
11383        call_tests++;
11384        des_xmlListPtr(n_l, l, 0);
11385        xmlResetLastError();
11386        if (mem_base != xmlMemBlocks()) {
11387            printf("Leak of %d blocks found in xmlListSort",
11388	           xmlMemBlocks() - mem_base);
11389	    test_ret++;
11390            printf(" %d", n_l);
11391            printf("\n");
11392        }
11393    }
11394    function_tests++;
11395
11396    return(test_ret);
11397}
11398
11399
11400static int
11401test_xmlListWalk(void) {
11402    int test_ret = 0;
11403
11404
11405    /* missing type support */
11406    return(test_ret);
11407}
11408
11409static int
11410test_list(void) {
11411    int test_ret = 0;
11412
11413    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11414    test_ret += test_xmlLinkGetData();
11415    test_ret += test_xmlListAppend();
11416    test_ret += test_xmlListClear();
11417    test_ret += test_xmlListCopy();
11418    test_ret += test_xmlListCreate();
11419    test_ret += test_xmlListDup();
11420    test_ret += test_xmlListEmpty();
11421    test_ret += test_xmlListEnd();
11422    test_ret += test_xmlListFront();
11423    test_ret += test_xmlListInsert();
11424    test_ret += test_xmlListMerge();
11425    test_ret += test_xmlListPopBack();
11426    test_ret += test_xmlListPopFront();
11427    test_ret += test_xmlListPushBack();
11428    test_ret += test_xmlListPushFront();
11429    test_ret += test_xmlListRemoveAll();
11430    test_ret += test_xmlListRemoveFirst();
11431    test_ret += test_xmlListRemoveLast();
11432    test_ret += test_xmlListReverse();
11433    test_ret += test_xmlListReverseSearch();
11434    test_ret += test_xmlListReverseWalk();
11435    test_ret += test_xmlListSearch();
11436    test_ret += test_xmlListSize();
11437    test_ret += test_xmlListSort();
11438    test_ret += test_xmlListWalk();
11439
11440    if (test_ret != 0)
11441	printf("Module list: %d errors\n", test_ret);
11442    return(test_ret);
11443}
11444
11445static int
11446test_xmlNanoFTPCheckResponse(void) {
11447    int test_ret = 0;
11448
11449#if defined(LIBXML_FTP_ENABLED)
11450    int mem_base;
11451    int ret_val;
11452    void * ctx; /* an FTP context */
11453    int n_ctx;
11454
11455    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11456        mem_base = xmlMemBlocks();
11457        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11458
11459        ret_val = xmlNanoFTPCheckResponse(ctx);
11460        desret_int(ret_val);
11461        call_tests++;
11462        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11463        xmlResetLastError();
11464        if (mem_base != xmlMemBlocks()) {
11465            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11466	           xmlMemBlocks() - mem_base);
11467	    test_ret++;
11468            printf(" %d", n_ctx);
11469            printf("\n");
11470        }
11471    }
11472    function_tests++;
11473#endif
11474
11475    return(test_ret);
11476}
11477
11478
11479static int
11480test_xmlNanoFTPCleanup(void) {
11481    int test_ret = 0;
11482
11483#if defined(LIBXML_FTP_ENABLED)
11484    int mem_base;
11485
11486        mem_base = xmlMemBlocks();
11487
11488        xmlNanoFTPCleanup();
11489        call_tests++;
11490        xmlResetLastError();
11491        if (mem_base != xmlMemBlocks()) {
11492            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11493	           xmlMemBlocks() - mem_base);
11494	    test_ret++;
11495            printf("\n");
11496        }
11497    function_tests++;
11498#endif
11499
11500    return(test_ret);
11501}
11502
11503
11504static int
11505test_xmlNanoFTPCloseConnection(void) {
11506    int test_ret = 0;
11507
11508#if defined(LIBXML_FTP_ENABLED)
11509    int mem_base;
11510    int ret_val;
11511    void * ctx; /* an FTP context */
11512    int n_ctx;
11513
11514    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11515        mem_base = xmlMemBlocks();
11516        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11517
11518        ret_val = xmlNanoFTPCloseConnection(ctx);
11519        desret_int(ret_val);
11520        call_tests++;
11521        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11522        xmlResetLastError();
11523        if (mem_base != xmlMemBlocks()) {
11524            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11525	           xmlMemBlocks() - mem_base);
11526	    test_ret++;
11527            printf(" %d", n_ctx);
11528            printf("\n");
11529        }
11530    }
11531    function_tests++;
11532#endif
11533
11534    return(test_ret);
11535}
11536
11537
11538static int
11539test_xmlNanoFTPCwd(void) {
11540    int test_ret = 0;
11541
11542#if defined(LIBXML_FTP_ENABLED)
11543    int mem_base;
11544    int ret_val;
11545    void * ctx; /* an FTP context */
11546    int n_ctx;
11547    char * directory; /* a directory on the server */
11548    int n_directory;
11549
11550    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11551    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11552        mem_base = xmlMemBlocks();
11553        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11554        directory = gen_const_char_ptr(n_directory, 1);
11555
11556        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11557        desret_int(ret_val);
11558        call_tests++;
11559        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11560        des_const_char_ptr(n_directory, (const char *)directory, 1);
11561        xmlResetLastError();
11562        if (mem_base != xmlMemBlocks()) {
11563            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11564	           xmlMemBlocks() - mem_base);
11565	    test_ret++;
11566            printf(" %d", n_ctx);
11567            printf(" %d", n_directory);
11568            printf("\n");
11569        }
11570    }
11571    }
11572    function_tests++;
11573#endif
11574
11575    return(test_ret);
11576}
11577
11578
11579static int
11580test_xmlNanoFTPDele(void) {
11581    int test_ret = 0;
11582
11583#if defined(LIBXML_FTP_ENABLED)
11584    int mem_base;
11585    int ret_val;
11586    void * ctx; /* an FTP context */
11587    int n_ctx;
11588    const char * file; /* a file or directory on the server */
11589    int n_file;
11590
11591    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11592    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11593        mem_base = xmlMemBlocks();
11594        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11595        file = gen_filepath(n_file, 1);
11596
11597        ret_val = xmlNanoFTPDele(ctx, file);
11598        desret_int(ret_val);
11599        call_tests++;
11600        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11601        des_filepath(n_file, file, 1);
11602        xmlResetLastError();
11603        if (mem_base != xmlMemBlocks()) {
11604            printf("Leak of %d blocks found in xmlNanoFTPDele",
11605	           xmlMemBlocks() - mem_base);
11606	    test_ret++;
11607            printf(" %d", n_ctx);
11608            printf(" %d", n_file);
11609            printf("\n");
11610        }
11611    }
11612    }
11613    function_tests++;
11614#endif
11615
11616    return(test_ret);
11617}
11618
11619
11620static int
11621test_xmlNanoFTPGet(void) {
11622    int test_ret = 0;
11623
11624
11625    /* missing type support */
11626    return(test_ret);
11627}
11628
11629
11630static int
11631test_xmlNanoFTPGetConnection(void) {
11632    int test_ret = 0;
11633
11634#if defined(LIBXML_FTP_ENABLED)
11635    int mem_base;
11636    int ret_val;
11637    void * ctx; /* an FTP context */
11638    int n_ctx;
11639
11640    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11641        mem_base = xmlMemBlocks();
11642        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11643
11644        ret_val = xmlNanoFTPGetConnection(ctx);
11645        desret_int(ret_val);
11646        call_tests++;
11647        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11648        xmlResetLastError();
11649        if (mem_base != xmlMemBlocks()) {
11650            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11651	           xmlMemBlocks() - mem_base);
11652	    test_ret++;
11653            printf(" %d", n_ctx);
11654            printf("\n");
11655        }
11656    }
11657    function_tests++;
11658#endif
11659
11660    return(test_ret);
11661}
11662
11663
11664static int
11665test_xmlNanoFTPGetResponse(void) {
11666    int test_ret = 0;
11667
11668#if defined(LIBXML_FTP_ENABLED)
11669    int mem_base;
11670    int ret_val;
11671    void * ctx; /* an FTP context */
11672    int n_ctx;
11673
11674    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11675        mem_base = xmlMemBlocks();
11676        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11677
11678        ret_val = xmlNanoFTPGetResponse(ctx);
11679        desret_int(ret_val);
11680        call_tests++;
11681        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11682        xmlResetLastError();
11683        if (mem_base != xmlMemBlocks()) {
11684            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11685	           xmlMemBlocks() - mem_base);
11686	    test_ret++;
11687            printf(" %d", n_ctx);
11688            printf("\n");
11689        }
11690    }
11691    function_tests++;
11692#endif
11693
11694    return(test_ret);
11695}
11696
11697
11698static int
11699test_xmlNanoFTPGetSocket(void) {
11700    int test_ret = 0;
11701
11702#if defined(LIBXML_FTP_ENABLED)
11703    int mem_base;
11704    int ret_val;
11705    void * ctx; /* an FTP context */
11706    int n_ctx;
11707    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11708    int n_filename;
11709
11710    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11711    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11712        mem_base = xmlMemBlocks();
11713        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11714        filename = gen_filepath(n_filename, 1);
11715
11716        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11717        desret_int(ret_val);
11718        call_tests++;
11719        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11720        des_filepath(n_filename, filename, 1);
11721        xmlResetLastError();
11722        if (mem_base != xmlMemBlocks()) {
11723            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11724	           xmlMemBlocks() - mem_base);
11725	    test_ret++;
11726            printf(" %d", n_ctx);
11727            printf(" %d", n_filename);
11728            printf("\n");
11729        }
11730    }
11731    }
11732    function_tests++;
11733#endif
11734
11735    return(test_ret);
11736}
11737
11738
11739static int
11740test_xmlNanoFTPInit(void) {
11741    int test_ret = 0;
11742
11743#if defined(LIBXML_FTP_ENABLED)
11744    int mem_base;
11745
11746        mem_base = xmlMemBlocks();
11747
11748        xmlNanoFTPInit();
11749        call_tests++;
11750        xmlResetLastError();
11751        if (mem_base != xmlMemBlocks()) {
11752            printf("Leak of %d blocks found in xmlNanoFTPInit",
11753	           xmlMemBlocks() - mem_base);
11754	    test_ret++;
11755            printf("\n");
11756        }
11757    function_tests++;
11758#endif
11759
11760    return(test_ret);
11761}
11762
11763
11764static int
11765test_xmlNanoFTPList(void) {
11766    int test_ret = 0;
11767
11768
11769    /* missing type support */
11770    return(test_ret);
11771}
11772
11773
11774static int
11775test_xmlNanoFTPNewCtxt(void) {
11776    int test_ret = 0;
11777
11778#if defined(LIBXML_FTP_ENABLED)
11779    int mem_base;
11780    void * ret_val;
11781    const char * URL; /* The URL used to initialize the context */
11782    int n_URL;
11783
11784    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11785        mem_base = xmlMemBlocks();
11786        URL = gen_filepath(n_URL, 0);
11787
11788        ret_val = xmlNanoFTPNewCtxt(URL);
11789        desret_xmlNanoFTPCtxtPtr(ret_val);
11790        call_tests++;
11791        des_filepath(n_URL, URL, 0);
11792        xmlResetLastError();
11793        if (mem_base != xmlMemBlocks()) {
11794            printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11795	           xmlMemBlocks() - mem_base);
11796	    test_ret++;
11797            printf(" %d", n_URL);
11798            printf("\n");
11799        }
11800    }
11801    function_tests++;
11802#endif
11803
11804    return(test_ret);
11805}
11806
11807
11808static int
11809test_xmlNanoFTPOpen(void) {
11810    int test_ret = 0;
11811
11812#if defined(LIBXML_FTP_ENABLED)
11813    int mem_base;
11814    void * ret_val;
11815    const char * URL; /* the URL to the resource */
11816    int n_URL;
11817
11818    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11819        mem_base = xmlMemBlocks();
11820        URL = gen_filepath(n_URL, 0);
11821
11822        ret_val = xmlNanoFTPOpen(URL);
11823        desret_xmlNanoFTPCtxtPtr(ret_val);
11824        call_tests++;
11825        des_filepath(n_URL, URL, 0);
11826        xmlResetLastError();
11827        if (mem_base != xmlMemBlocks()) {
11828            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11829	           xmlMemBlocks() - mem_base);
11830	    test_ret++;
11831            printf(" %d", n_URL);
11832            printf("\n");
11833        }
11834    }
11835    function_tests++;
11836#endif
11837
11838    return(test_ret);
11839}
11840
11841
11842static int
11843test_xmlNanoFTPProxy(void) {
11844    int test_ret = 0;
11845
11846#if defined(LIBXML_FTP_ENABLED)
11847    char * host; /* the proxy host name */
11848    int n_host;
11849    int port; /* the proxy port */
11850    int n_port;
11851    char * user; /* the proxy user name */
11852    int n_user;
11853    char * passwd; /* the proxy password */
11854    int n_passwd;
11855    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11856    int n_type;
11857
11858    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11859    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11860    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11861    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11862    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11863        host = gen_const_char_ptr(n_host, 0);
11864        port = gen_int(n_port, 1);
11865        user = gen_const_char_ptr(n_user, 2);
11866        passwd = gen_const_char_ptr(n_passwd, 3);
11867        type = gen_int(n_type, 4);
11868
11869        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11870        call_tests++;
11871        des_const_char_ptr(n_host, (const char *)host, 0);
11872        des_int(n_port, port, 1);
11873        des_const_char_ptr(n_user, (const char *)user, 2);
11874        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11875        des_int(n_type, type, 4);
11876        xmlResetLastError();
11877    }
11878    }
11879    }
11880    }
11881    }
11882    function_tests++;
11883#endif
11884
11885    return(test_ret);
11886}
11887
11888
11889static int
11890test_xmlNanoFTPQuit(void) {
11891    int test_ret = 0;
11892
11893#if defined(LIBXML_FTP_ENABLED)
11894    int mem_base;
11895    int ret_val;
11896    void * ctx; /* an FTP context */
11897    int n_ctx;
11898
11899    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11900        mem_base = xmlMemBlocks();
11901        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11902
11903        ret_val = xmlNanoFTPQuit(ctx);
11904        desret_int(ret_val);
11905        call_tests++;
11906        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11907        xmlResetLastError();
11908        if (mem_base != xmlMemBlocks()) {
11909            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11910	           xmlMemBlocks() - mem_base);
11911	    test_ret++;
11912            printf(" %d", n_ctx);
11913            printf("\n");
11914        }
11915    }
11916    function_tests++;
11917#endif
11918
11919    return(test_ret);
11920}
11921
11922
11923static int
11924test_xmlNanoFTPRead(void) {
11925    int test_ret = 0;
11926
11927#if defined(LIBXML_FTP_ENABLED)
11928    int mem_base;
11929    int ret_val;
11930    void * ctx; /* the FTP context */
11931    int n_ctx;
11932    void * dest; /* a buffer */
11933    int n_dest;
11934    int len; /* the buffer length */
11935    int n_len;
11936
11937    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11938    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11939    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11940        mem_base = xmlMemBlocks();
11941        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11942        dest = gen_void_ptr(n_dest, 1);
11943        len = gen_int(n_len, 2);
11944
11945        ret_val = xmlNanoFTPRead(ctx, dest, len);
11946        desret_int(ret_val);
11947        call_tests++;
11948        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11949        des_void_ptr(n_dest, dest, 1);
11950        des_int(n_len, len, 2);
11951        xmlResetLastError();
11952        if (mem_base != xmlMemBlocks()) {
11953            printf("Leak of %d blocks found in xmlNanoFTPRead",
11954	           xmlMemBlocks() - mem_base);
11955	    test_ret++;
11956            printf(" %d", n_ctx);
11957            printf(" %d", n_dest);
11958            printf(" %d", n_len);
11959            printf("\n");
11960        }
11961    }
11962    }
11963    }
11964    function_tests++;
11965#endif
11966
11967    return(test_ret);
11968}
11969
11970
11971static int
11972test_xmlNanoFTPScanProxy(void) {
11973    int test_ret = 0;
11974
11975#if defined(LIBXML_FTP_ENABLED)
11976    const char * URL; /* The proxy URL used to initialize the proxy context */
11977    int n_URL;
11978
11979    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11980        URL = gen_filepath(n_URL, 0);
11981
11982        xmlNanoFTPScanProxy(URL);
11983        call_tests++;
11984        des_filepath(n_URL, URL, 0);
11985        xmlResetLastError();
11986    }
11987    function_tests++;
11988#endif
11989
11990    return(test_ret);
11991}
11992
11993
11994static int
11995test_xmlNanoFTPUpdateURL(void) {
11996    int test_ret = 0;
11997
11998#if defined(LIBXML_FTP_ENABLED)
11999    int mem_base;
12000    int ret_val;
12001    void * ctx; /* an FTP context */
12002    int n_ctx;
12003    const char * URL; /* The URL used to update the context */
12004    int n_URL;
12005
12006    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12007    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12008        mem_base = xmlMemBlocks();
12009        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12010        URL = gen_filepath(n_URL, 1);
12011
12012        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12013        desret_int(ret_val);
12014        call_tests++;
12015        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12016        des_filepath(n_URL, URL, 1);
12017        xmlResetLastError();
12018        if (mem_base != xmlMemBlocks()) {
12019            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12020	           xmlMemBlocks() - mem_base);
12021	    test_ret++;
12022            printf(" %d", n_ctx);
12023            printf(" %d", n_URL);
12024            printf("\n");
12025        }
12026    }
12027    }
12028    function_tests++;
12029#endif
12030
12031    return(test_ret);
12032}
12033
12034static int
12035test_nanoftp(void) {
12036    int test_ret = 0;
12037
12038    if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
12039    test_ret += test_xmlNanoFTPCheckResponse();
12040    test_ret += test_xmlNanoFTPCleanup();
12041    test_ret += test_xmlNanoFTPCloseConnection();
12042    test_ret += test_xmlNanoFTPCwd();
12043    test_ret += test_xmlNanoFTPDele();
12044    test_ret += test_xmlNanoFTPGet();
12045    test_ret += test_xmlNanoFTPGetConnection();
12046    test_ret += test_xmlNanoFTPGetResponse();
12047    test_ret += test_xmlNanoFTPGetSocket();
12048    test_ret += test_xmlNanoFTPInit();
12049    test_ret += test_xmlNanoFTPList();
12050    test_ret += test_xmlNanoFTPNewCtxt();
12051    test_ret += test_xmlNanoFTPOpen();
12052    test_ret += test_xmlNanoFTPProxy();
12053    test_ret += test_xmlNanoFTPQuit();
12054    test_ret += test_xmlNanoFTPRead();
12055    test_ret += test_xmlNanoFTPScanProxy();
12056    test_ret += test_xmlNanoFTPUpdateURL();
12057
12058    if (test_ret != 0)
12059	printf("Module nanoftp: %d errors\n", test_ret);
12060    return(test_ret);
12061}
12062
12063static int
12064test_xmlNanoHTTPAuthHeader(void) {
12065    int test_ret = 0;
12066
12067#if defined(LIBXML_HTTP_ENABLED)
12068    int mem_base;
12069    const char * ret_val;
12070    void * ctx; /* the HTTP context */
12071    int n_ctx;
12072
12073    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12074        mem_base = xmlMemBlocks();
12075        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12076
12077        ret_val = xmlNanoHTTPAuthHeader(ctx);
12078        desret_const_char_ptr(ret_val);
12079        call_tests++;
12080        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12081        xmlResetLastError();
12082        if (mem_base != xmlMemBlocks()) {
12083            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12084	           xmlMemBlocks() - mem_base);
12085	    test_ret++;
12086            printf(" %d", n_ctx);
12087            printf("\n");
12088        }
12089    }
12090    function_tests++;
12091#endif
12092
12093    return(test_ret);
12094}
12095
12096
12097static int
12098test_xmlNanoHTTPCleanup(void) {
12099    int test_ret = 0;
12100
12101#if defined(LIBXML_HTTP_ENABLED)
12102    int mem_base;
12103
12104        mem_base = xmlMemBlocks();
12105
12106        xmlNanoHTTPCleanup();
12107        call_tests++;
12108        xmlResetLastError();
12109        if (mem_base != xmlMemBlocks()) {
12110            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12111	           xmlMemBlocks() - mem_base);
12112	    test_ret++;
12113            printf("\n");
12114        }
12115    function_tests++;
12116#endif
12117
12118    return(test_ret);
12119}
12120
12121
12122static int
12123test_xmlNanoHTTPContentLength(void) {
12124    int test_ret = 0;
12125
12126#if defined(LIBXML_HTTP_ENABLED)
12127    int mem_base;
12128    int ret_val;
12129    void * ctx; /* the HTTP context */
12130    int n_ctx;
12131
12132    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12133        mem_base = xmlMemBlocks();
12134        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12135
12136        ret_val = xmlNanoHTTPContentLength(ctx);
12137        desret_int(ret_val);
12138        call_tests++;
12139        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12140        xmlResetLastError();
12141        if (mem_base != xmlMemBlocks()) {
12142            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12143	           xmlMemBlocks() - mem_base);
12144	    test_ret++;
12145            printf(" %d", n_ctx);
12146            printf("\n");
12147        }
12148    }
12149    function_tests++;
12150#endif
12151
12152    return(test_ret);
12153}
12154
12155
12156static int
12157test_xmlNanoHTTPEncoding(void) {
12158    int test_ret = 0;
12159
12160#if defined(LIBXML_HTTP_ENABLED)
12161    int mem_base;
12162    const char * ret_val;
12163    void * ctx; /* the HTTP context */
12164    int n_ctx;
12165
12166    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12167        mem_base = xmlMemBlocks();
12168        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12169
12170        ret_val = xmlNanoHTTPEncoding(ctx);
12171        desret_const_char_ptr(ret_val);
12172        call_tests++;
12173        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12174        xmlResetLastError();
12175        if (mem_base != xmlMemBlocks()) {
12176            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12177	           xmlMemBlocks() - mem_base);
12178	    test_ret++;
12179            printf(" %d", n_ctx);
12180            printf("\n");
12181        }
12182    }
12183    function_tests++;
12184#endif
12185
12186    return(test_ret);
12187}
12188
12189
12190#define gen_nb_char_ptr_ptr 1
12191static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12192    return(NULL);
12193}
12194static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12195}
12196
12197static int
12198test_xmlNanoHTTPFetch(void) {
12199    int test_ret = 0;
12200
12201#if defined(LIBXML_HTTP_ENABLED)
12202    int mem_base;
12203    int ret_val;
12204    const char * URL; /* The URL to load */
12205    int n_URL;
12206    const char * filename; /* the filename where the content should be saved */
12207    int n_filename;
12208    char ** contentType; /* if available the Content-Type information will be returned at that location */
12209    int n_contentType;
12210
12211    for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12212    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12213    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12214        mem_base = xmlMemBlocks();
12215        URL = gen_fileoutput(n_URL, 0);
12216        filename = gen_fileoutput(n_filename, 1);
12217        contentType = gen_char_ptr_ptr(n_contentType, 2);
12218
12219        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12220        desret_int(ret_val);
12221        call_tests++;
12222        des_fileoutput(n_URL, URL, 0);
12223        des_fileoutput(n_filename, filename, 1);
12224        des_char_ptr_ptr(n_contentType, contentType, 2);
12225        xmlResetLastError();
12226        if (mem_base != xmlMemBlocks()) {
12227            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12228	           xmlMemBlocks() - mem_base);
12229	    test_ret++;
12230            printf(" %d", n_URL);
12231            printf(" %d", n_filename);
12232            printf(" %d", n_contentType);
12233            printf("\n");
12234        }
12235    }
12236    }
12237    }
12238    function_tests++;
12239#endif
12240
12241    return(test_ret);
12242}
12243
12244
12245static int
12246test_xmlNanoHTTPInit(void) {
12247    int test_ret = 0;
12248
12249#if defined(LIBXML_HTTP_ENABLED)
12250    int mem_base;
12251
12252        mem_base = xmlMemBlocks();
12253
12254        xmlNanoHTTPInit();
12255        call_tests++;
12256        xmlResetLastError();
12257        if (mem_base != xmlMemBlocks()) {
12258            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12259	           xmlMemBlocks() - mem_base);
12260	    test_ret++;
12261            printf("\n");
12262        }
12263    function_tests++;
12264#endif
12265
12266    return(test_ret);
12267}
12268
12269
12270static int
12271test_xmlNanoHTTPMimeType(void) {
12272    int test_ret = 0;
12273
12274#if defined(LIBXML_HTTP_ENABLED)
12275    int mem_base;
12276    const char * ret_val;
12277    void * ctx; /* the HTTP context */
12278    int n_ctx;
12279
12280    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12281        mem_base = xmlMemBlocks();
12282        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12283
12284        ret_val = xmlNanoHTTPMimeType(ctx);
12285        desret_const_char_ptr(ret_val);
12286        call_tests++;
12287        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12288        xmlResetLastError();
12289        if (mem_base != xmlMemBlocks()) {
12290            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12291	           xmlMemBlocks() - mem_base);
12292	    test_ret++;
12293            printf(" %d", n_ctx);
12294            printf("\n");
12295        }
12296    }
12297    function_tests++;
12298#endif
12299
12300    return(test_ret);
12301}
12302
12303
12304static int
12305test_xmlNanoHTTPOpen(void) {
12306    int test_ret = 0;
12307
12308#if defined(LIBXML_HTTP_ENABLED)
12309    int mem_base;
12310    void * ret_val;
12311    const char * URL; /* The URL to load */
12312    int n_URL;
12313    char ** contentType; /* if available the Content-Type information will be returned at that location */
12314    int n_contentType;
12315
12316    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12317    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12318        mem_base = xmlMemBlocks();
12319        URL = gen_filepath(n_URL, 0);
12320        contentType = gen_char_ptr_ptr(n_contentType, 1);
12321
12322        ret_val = xmlNanoHTTPOpen(URL, contentType);
12323        desret_xmlNanoHTTPCtxtPtr(ret_val);
12324        call_tests++;
12325        des_filepath(n_URL, URL, 0);
12326        des_char_ptr_ptr(n_contentType, contentType, 1);
12327        xmlResetLastError();
12328        if (mem_base != xmlMemBlocks()) {
12329            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12330	           xmlMemBlocks() - mem_base);
12331	    test_ret++;
12332            printf(" %d", n_URL);
12333            printf(" %d", n_contentType);
12334            printf("\n");
12335        }
12336    }
12337    }
12338    function_tests++;
12339#endif
12340
12341    return(test_ret);
12342}
12343
12344
12345static int
12346test_xmlNanoHTTPOpenRedir(void) {
12347    int test_ret = 0;
12348
12349#if defined(LIBXML_HTTP_ENABLED)
12350    int mem_base;
12351    void * ret_val;
12352    const char * URL; /* The URL to load */
12353    int n_URL;
12354    char ** contentType; /* if available the Content-Type information will be returned at that location */
12355    int n_contentType;
12356    char ** redir; /* if available the redirected URL will be returned */
12357    int n_redir;
12358
12359    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12360    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12361    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12362        mem_base = xmlMemBlocks();
12363        URL = gen_filepath(n_URL, 0);
12364        contentType = gen_char_ptr_ptr(n_contentType, 1);
12365        redir = gen_char_ptr_ptr(n_redir, 2);
12366
12367        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12368        desret_xmlNanoHTTPCtxtPtr(ret_val);
12369        call_tests++;
12370        des_filepath(n_URL, URL, 0);
12371        des_char_ptr_ptr(n_contentType, contentType, 1);
12372        des_char_ptr_ptr(n_redir, redir, 2);
12373        xmlResetLastError();
12374        if (mem_base != xmlMemBlocks()) {
12375            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12376	           xmlMemBlocks() - mem_base);
12377	    test_ret++;
12378            printf(" %d", n_URL);
12379            printf(" %d", n_contentType);
12380            printf(" %d", n_redir);
12381            printf("\n");
12382        }
12383    }
12384    }
12385    }
12386    function_tests++;
12387#endif
12388
12389    return(test_ret);
12390}
12391
12392
12393static int
12394test_xmlNanoHTTPRead(void) {
12395    int test_ret = 0;
12396
12397#if defined(LIBXML_HTTP_ENABLED)
12398    int mem_base;
12399    int ret_val;
12400    void * ctx; /* the HTTP context */
12401    int n_ctx;
12402    void * dest; /* a buffer */
12403    int n_dest;
12404    int len; /* the buffer length */
12405    int n_len;
12406
12407    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12408    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12409    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12410        mem_base = xmlMemBlocks();
12411        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12412        dest = gen_void_ptr(n_dest, 1);
12413        len = gen_int(n_len, 2);
12414
12415        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12416        desret_int(ret_val);
12417        call_tests++;
12418        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12419        des_void_ptr(n_dest, dest, 1);
12420        des_int(n_len, len, 2);
12421        xmlResetLastError();
12422        if (mem_base != xmlMemBlocks()) {
12423            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12424	           xmlMemBlocks() - mem_base);
12425	    test_ret++;
12426            printf(" %d", n_ctx);
12427            printf(" %d", n_dest);
12428            printf(" %d", n_len);
12429            printf("\n");
12430        }
12431    }
12432    }
12433    }
12434    function_tests++;
12435#endif
12436
12437    return(test_ret);
12438}
12439
12440
12441static int
12442test_xmlNanoHTTPRedir(void) {
12443    int test_ret = 0;
12444
12445
12446    /* missing type support */
12447    return(test_ret);
12448}
12449
12450
12451static int
12452test_xmlNanoHTTPReturnCode(void) {
12453    int test_ret = 0;
12454
12455#if defined(LIBXML_HTTP_ENABLED)
12456    int mem_base;
12457    int ret_val;
12458    void * ctx; /* the HTTP context */
12459    int n_ctx;
12460
12461    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12462        mem_base = xmlMemBlocks();
12463        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12464
12465        ret_val = xmlNanoHTTPReturnCode(ctx);
12466        desret_int(ret_val);
12467        call_tests++;
12468        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12469        xmlResetLastError();
12470        if (mem_base != xmlMemBlocks()) {
12471            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12472	           xmlMemBlocks() - mem_base);
12473	    test_ret++;
12474            printf(" %d", n_ctx);
12475            printf("\n");
12476        }
12477    }
12478    function_tests++;
12479#endif
12480
12481    return(test_ret);
12482}
12483
12484
12485static int
12486test_xmlNanoHTTPSave(void) {
12487    int test_ret = 0;
12488
12489#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12490    int mem_base;
12491    int ret_val;
12492    void * ctxt; /* the HTTP context */
12493    int n_ctxt;
12494    const char * filename; /* the filename where the content should be saved */
12495    int n_filename;
12496
12497    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12498    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12499        mem_base = xmlMemBlocks();
12500        ctxt = gen_void_ptr(n_ctxt, 0);
12501        filename = gen_fileoutput(n_filename, 1);
12502
12503        ret_val = xmlNanoHTTPSave(ctxt, filename);
12504        desret_int(ret_val);
12505        call_tests++;
12506        des_void_ptr(n_ctxt, ctxt, 0);
12507        des_fileoutput(n_filename, filename, 1);
12508        xmlResetLastError();
12509        if (mem_base != xmlMemBlocks()) {
12510            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12511	           xmlMemBlocks() - mem_base);
12512	    test_ret++;
12513            printf(" %d", n_ctxt);
12514            printf(" %d", n_filename);
12515            printf("\n");
12516        }
12517    }
12518    }
12519    function_tests++;
12520#endif
12521
12522    return(test_ret);
12523}
12524
12525
12526static int
12527test_xmlNanoHTTPScanProxy(void) {
12528    int test_ret = 0;
12529
12530#if defined(LIBXML_HTTP_ENABLED)
12531    const char * URL; /* The proxy URL used to initialize the proxy context */
12532    int n_URL;
12533
12534    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12535        URL = gen_filepath(n_URL, 0);
12536
12537        xmlNanoHTTPScanProxy(URL);
12538        call_tests++;
12539        des_filepath(n_URL, URL, 0);
12540        xmlResetLastError();
12541    }
12542    function_tests++;
12543#endif
12544
12545    return(test_ret);
12546}
12547
12548static int
12549test_nanohttp(void) {
12550    int test_ret = 0;
12551
12552    if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12553    test_ret += test_xmlNanoHTTPAuthHeader();
12554    test_ret += test_xmlNanoHTTPCleanup();
12555    test_ret += test_xmlNanoHTTPContentLength();
12556    test_ret += test_xmlNanoHTTPEncoding();
12557    test_ret += test_xmlNanoHTTPFetch();
12558    test_ret += test_xmlNanoHTTPInit();
12559    test_ret += test_xmlNanoHTTPMimeType();
12560    test_ret += test_xmlNanoHTTPOpen();
12561    test_ret += test_xmlNanoHTTPOpenRedir();
12562    test_ret += test_xmlNanoHTTPRead();
12563    test_ret += test_xmlNanoHTTPRedir();
12564    test_ret += test_xmlNanoHTTPReturnCode();
12565    test_ret += test_xmlNanoHTTPSave();
12566    test_ret += test_xmlNanoHTTPScanProxy();
12567
12568    if (test_ret != 0)
12569	printf("Module nanohttp: %d errors\n", test_ret);
12570    return(test_ret);
12571}
12572
12573static int
12574test_xmlByteConsumed(void) {
12575    int test_ret = 0;
12576
12577    int mem_base;
12578    long ret_val;
12579    xmlParserCtxtPtr ctxt; /* an XML parser context */
12580    int n_ctxt;
12581
12582    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12583        mem_base = xmlMemBlocks();
12584        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12585
12586        ret_val = xmlByteConsumed(ctxt);
12587        desret_long(ret_val);
12588        call_tests++;
12589        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12590        xmlResetLastError();
12591        if (mem_base != xmlMemBlocks()) {
12592            printf("Leak of %d blocks found in xmlByteConsumed",
12593	           xmlMemBlocks() - mem_base);
12594	    test_ret++;
12595            printf(" %d", n_ctxt);
12596            printf("\n");
12597        }
12598    }
12599    function_tests++;
12600
12601    return(test_ret);
12602}
12603
12604
12605static int
12606test_xmlClearNodeInfoSeq(void) {
12607    int test_ret = 0;
12608
12609    int mem_base;
12610    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12611    int n_seq;
12612
12613    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12614        mem_base = xmlMemBlocks();
12615        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12616
12617        xmlClearNodeInfoSeq(seq);
12618        call_tests++;
12619        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12620        xmlResetLastError();
12621        if (mem_base != xmlMemBlocks()) {
12622            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12623	           xmlMemBlocks() - mem_base);
12624	    test_ret++;
12625            printf(" %d", n_seq);
12626            printf("\n");
12627        }
12628    }
12629    function_tests++;
12630
12631    return(test_ret);
12632}
12633
12634
12635static int
12636test_xmlClearParserCtxt(void) {
12637    int test_ret = 0;
12638
12639    int mem_base;
12640    xmlParserCtxtPtr ctxt; /* an XML parser context */
12641    int n_ctxt;
12642
12643    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12644        mem_base = xmlMemBlocks();
12645        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12646
12647        xmlClearParserCtxt(ctxt);
12648        call_tests++;
12649        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12650        xmlResetLastError();
12651        if (mem_base != xmlMemBlocks()) {
12652            printf("Leak of %d blocks found in xmlClearParserCtxt",
12653	           xmlMemBlocks() - mem_base);
12654	    test_ret++;
12655            printf(" %d", n_ctxt);
12656            printf("\n");
12657        }
12658    }
12659    function_tests++;
12660
12661    return(test_ret);
12662}
12663
12664
12665static int
12666test_xmlCreateDocParserCtxt(void) {
12667    int test_ret = 0;
12668
12669    int mem_base;
12670    xmlParserCtxtPtr ret_val;
12671    xmlChar * cur; /* a pointer to an array of xmlChar */
12672    int n_cur;
12673
12674    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12675        mem_base = xmlMemBlocks();
12676        cur = gen_const_xmlChar_ptr(n_cur, 0);
12677
12678        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12679        desret_xmlParserCtxtPtr(ret_val);
12680        call_tests++;
12681        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12682        xmlResetLastError();
12683        if (mem_base != xmlMemBlocks()) {
12684            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12685	           xmlMemBlocks() - mem_base);
12686	    test_ret++;
12687            printf(" %d", n_cur);
12688            printf("\n");
12689        }
12690    }
12691    function_tests++;
12692
12693    return(test_ret);
12694}
12695
12696
12697static int
12698test_xmlCreatePushParserCtxt(void) {
12699    int test_ret = 0;
12700
12701#if defined(LIBXML_PUSH_ENABLED)
12702    int mem_base;
12703    xmlParserCtxtPtr ret_val;
12704    xmlSAXHandlerPtr sax; /* a SAX handler */
12705    int n_sax;
12706    void * user_data; /* The user data returned on SAX callbacks */
12707    int n_user_data;
12708    char * chunk; /* a pointer to an array of chars */
12709    int n_chunk;
12710    int size; /* number of chars in the array */
12711    int n_size;
12712    const char * filename; /* an optional file name or URI */
12713    int n_filename;
12714
12715    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12716    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12717    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12718    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12719    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12720        mem_base = xmlMemBlocks();
12721        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12722        user_data = gen_userdata(n_user_data, 1);
12723        chunk = gen_const_char_ptr(n_chunk, 2);
12724        size = gen_int(n_size, 3);
12725        filename = gen_fileoutput(n_filename, 4);
12726
12727        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12728        desret_xmlParserCtxtPtr(ret_val);
12729        call_tests++;
12730        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12731        des_userdata(n_user_data, user_data, 1);
12732        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12733        des_int(n_size, size, 3);
12734        des_fileoutput(n_filename, filename, 4);
12735        xmlResetLastError();
12736        if (mem_base != xmlMemBlocks()) {
12737            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12738	           xmlMemBlocks() - mem_base);
12739	    test_ret++;
12740            printf(" %d", n_sax);
12741            printf(" %d", n_user_data);
12742            printf(" %d", n_chunk);
12743            printf(" %d", n_size);
12744            printf(" %d", n_filename);
12745            printf("\n");
12746        }
12747    }
12748    }
12749    }
12750    }
12751    }
12752    function_tests++;
12753#endif
12754
12755    return(test_ret);
12756}
12757
12758
12759static int
12760test_xmlCtxtReadDoc(void) {
12761    int test_ret = 0;
12762
12763    int mem_base;
12764    xmlDocPtr ret_val;
12765    xmlParserCtxtPtr ctxt; /* an XML parser context */
12766    int n_ctxt;
12767    xmlChar * cur; /* a pointer to a zero terminated string */
12768    int n_cur;
12769    const char * URL; /* the base URL to use for the document */
12770    int n_URL;
12771    char * encoding; /* the document encoding, or NULL */
12772    int n_encoding;
12773    int options; /* a combination of xmlParserOption */
12774    int n_options;
12775
12776    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12777    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12778    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12779    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12780    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12781        mem_base = xmlMemBlocks();
12782        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12783        cur = gen_const_xmlChar_ptr(n_cur, 1);
12784        URL = gen_filepath(n_URL, 2);
12785        encoding = gen_const_char_ptr(n_encoding, 3);
12786        options = gen_parseroptions(n_options, 4);
12787
12788        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12789        desret_xmlDocPtr(ret_val);
12790        call_tests++;
12791        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12792        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12793        des_filepath(n_URL, URL, 2);
12794        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12795        des_parseroptions(n_options, options, 4);
12796        xmlResetLastError();
12797        if (mem_base != xmlMemBlocks()) {
12798            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12799	           xmlMemBlocks() - mem_base);
12800	    test_ret++;
12801            printf(" %d", n_ctxt);
12802            printf(" %d", n_cur);
12803            printf(" %d", n_URL);
12804            printf(" %d", n_encoding);
12805            printf(" %d", n_options);
12806            printf("\n");
12807        }
12808    }
12809    }
12810    }
12811    }
12812    }
12813    function_tests++;
12814
12815    return(test_ret);
12816}
12817
12818
12819static int
12820test_xmlCtxtReadFile(void) {
12821    int test_ret = 0;
12822
12823    int mem_base;
12824    xmlDocPtr ret_val;
12825    xmlParserCtxtPtr ctxt; /* an XML parser context */
12826    int n_ctxt;
12827    const char * filename; /* a file or URL */
12828    int n_filename;
12829    char * encoding; /* the document encoding, or NULL */
12830    int n_encoding;
12831    int options; /* a combination of xmlParserOption */
12832    int n_options;
12833
12834    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12835    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12836    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12837    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12838        mem_base = xmlMemBlocks();
12839        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12840        filename = gen_filepath(n_filename, 1);
12841        encoding = gen_const_char_ptr(n_encoding, 2);
12842        options = gen_parseroptions(n_options, 3);
12843
12844        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12845        desret_xmlDocPtr(ret_val);
12846        call_tests++;
12847        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12848        des_filepath(n_filename, filename, 1);
12849        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12850        des_parseroptions(n_options, options, 3);
12851        xmlResetLastError();
12852        if (mem_base != xmlMemBlocks()) {
12853            printf("Leak of %d blocks found in xmlCtxtReadFile",
12854	           xmlMemBlocks() - mem_base);
12855	    test_ret++;
12856            printf(" %d", n_ctxt);
12857            printf(" %d", n_filename);
12858            printf(" %d", n_encoding);
12859            printf(" %d", n_options);
12860            printf("\n");
12861        }
12862    }
12863    }
12864    }
12865    }
12866    function_tests++;
12867
12868    return(test_ret);
12869}
12870
12871
12872static int
12873test_xmlCtxtReadMemory(void) {
12874    int test_ret = 0;
12875
12876    int mem_base;
12877    xmlDocPtr ret_val;
12878    xmlParserCtxtPtr ctxt; /* an XML parser context */
12879    int n_ctxt;
12880    char * buffer; /* a pointer to a char array */
12881    int n_buffer;
12882    int size; /* the size of the array */
12883    int n_size;
12884    const char * URL; /* the base URL to use for the document */
12885    int n_URL;
12886    char * encoding; /* the document encoding, or NULL */
12887    int n_encoding;
12888    int options; /* a combination of xmlParserOption */
12889    int n_options;
12890
12891    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12892    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12893    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12894    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12895    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12896    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12897        mem_base = xmlMemBlocks();
12898        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12899        buffer = gen_const_char_ptr(n_buffer, 1);
12900        size = gen_int(n_size, 2);
12901        URL = gen_filepath(n_URL, 3);
12902        encoding = gen_const_char_ptr(n_encoding, 4);
12903        options = gen_parseroptions(n_options, 5);
12904
12905        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12906        desret_xmlDocPtr(ret_val);
12907        call_tests++;
12908        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12909        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12910        des_int(n_size, size, 2);
12911        des_filepath(n_URL, URL, 3);
12912        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12913        des_parseroptions(n_options, options, 5);
12914        xmlResetLastError();
12915        if (mem_base != xmlMemBlocks()) {
12916            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12917	           xmlMemBlocks() - mem_base);
12918	    test_ret++;
12919            printf(" %d", n_ctxt);
12920            printf(" %d", n_buffer);
12921            printf(" %d", n_size);
12922            printf(" %d", n_URL);
12923            printf(" %d", n_encoding);
12924            printf(" %d", n_options);
12925            printf("\n");
12926        }
12927    }
12928    }
12929    }
12930    }
12931    }
12932    }
12933    function_tests++;
12934
12935    return(test_ret);
12936}
12937
12938
12939static int
12940test_xmlCtxtReset(void) {
12941    int test_ret = 0;
12942
12943    int mem_base;
12944    xmlParserCtxtPtr ctxt; /* an XML parser context */
12945    int n_ctxt;
12946
12947    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12948        mem_base = xmlMemBlocks();
12949        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12950
12951        xmlCtxtReset(ctxt);
12952        call_tests++;
12953        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12954        xmlResetLastError();
12955        if (mem_base != xmlMemBlocks()) {
12956            printf("Leak of %d blocks found in xmlCtxtReset",
12957	           xmlMemBlocks() - mem_base);
12958	    test_ret++;
12959            printf(" %d", n_ctxt);
12960            printf("\n");
12961        }
12962    }
12963    function_tests++;
12964
12965    return(test_ret);
12966}
12967
12968
12969static int
12970test_xmlCtxtResetPush(void) {
12971    int test_ret = 0;
12972
12973    int mem_base;
12974    int ret_val;
12975    xmlParserCtxtPtr ctxt; /* an XML parser context */
12976    int n_ctxt;
12977    char * chunk; /* a pointer to an array of chars */
12978    int n_chunk;
12979    int size; /* number of chars in the array */
12980    int n_size;
12981    const char * filename; /* an optional file name or URI */
12982    int n_filename;
12983    char * encoding; /* the document encoding, or NULL */
12984    int n_encoding;
12985
12986    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12987    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12988    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12989    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12990    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12991        mem_base = xmlMemBlocks();
12992        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12993        chunk = gen_const_char_ptr(n_chunk, 1);
12994        size = gen_int(n_size, 2);
12995        filename = gen_filepath(n_filename, 3);
12996        encoding = gen_const_char_ptr(n_encoding, 4);
12997
12998        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12999        desret_int(ret_val);
13000        call_tests++;
13001        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13002        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13003        des_int(n_size, size, 2);
13004        des_filepath(n_filename, filename, 3);
13005        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13006        xmlResetLastError();
13007        if (mem_base != xmlMemBlocks()) {
13008            printf("Leak of %d blocks found in xmlCtxtResetPush",
13009	           xmlMemBlocks() - mem_base);
13010	    test_ret++;
13011            printf(" %d", n_ctxt);
13012            printf(" %d", n_chunk);
13013            printf(" %d", n_size);
13014            printf(" %d", n_filename);
13015            printf(" %d", n_encoding);
13016            printf("\n");
13017        }
13018    }
13019    }
13020    }
13021    }
13022    }
13023    function_tests++;
13024
13025    return(test_ret);
13026}
13027
13028
13029static int
13030test_xmlCtxtUseOptions(void) {
13031    int test_ret = 0;
13032
13033    int mem_base;
13034    int ret_val;
13035    xmlParserCtxtPtr ctxt; /* an XML parser context */
13036    int n_ctxt;
13037    int options; /* a combination of xmlParserOption */
13038    int n_options;
13039
13040    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13041    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13042        mem_base = xmlMemBlocks();
13043        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13044        options = gen_parseroptions(n_options, 1);
13045
13046        ret_val = xmlCtxtUseOptions(ctxt, options);
13047        desret_int(ret_val);
13048        call_tests++;
13049        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13050        des_parseroptions(n_options, options, 1);
13051        xmlResetLastError();
13052        if (mem_base != xmlMemBlocks()) {
13053            printf("Leak of %d blocks found in xmlCtxtUseOptions",
13054	           xmlMemBlocks() - mem_base);
13055	    test_ret++;
13056            printf(" %d", n_ctxt);
13057            printf(" %d", n_options);
13058            printf("\n");
13059        }
13060    }
13061    }
13062    function_tests++;
13063
13064    return(test_ret);
13065}
13066
13067
13068static int
13069test_xmlGetExternalEntityLoader(void) {
13070    int test_ret = 0;
13071
13072
13073    /* missing type support */
13074    return(test_ret);
13075}
13076
13077
13078static int
13079test_xmlGetFeature(void) {
13080    int test_ret = 0;
13081
13082#if defined(LIBXML_LEGACY_ENABLED)
13083#ifdef LIBXML_LEGACY_ENABLED
13084    int mem_base;
13085    int ret_val;
13086    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13087    int n_ctxt;
13088    char * name; /* the feature name */
13089    int n_name;
13090    void * result; /* location to store the result */
13091    int n_result;
13092
13093    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13094    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13095    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13096        mem_base = xmlMemBlocks();
13097        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13098        name = gen_const_char_ptr(n_name, 1);
13099        result = gen_void_ptr(n_result, 2);
13100
13101        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13102        desret_int(ret_val);
13103        call_tests++;
13104        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13105        des_const_char_ptr(n_name, (const char *)name, 1);
13106        des_void_ptr(n_result, result, 2);
13107        xmlResetLastError();
13108        if (mem_base != xmlMemBlocks()) {
13109            printf("Leak of %d blocks found in xmlGetFeature",
13110	           xmlMemBlocks() - mem_base);
13111	    test_ret++;
13112            printf(" %d", n_ctxt);
13113            printf(" %d", n_name);
13114            printf(" %d", n_result);
13115            printf("\n");
13116        }
13117    }
13118    }
13119    }
13120    function_tests++;
13121#endif
13122#endif
13123
13124    return(test_ret);
13125}
13126
13127
13128#define gen_nb_const_char_ptr_ptr 1
13129static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13130    return(NULL);
13131}
13132static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13133}
13134
13135static int
13136test_xmlGetFeaturesList(void) {
13137    int test_ret = 0;
13138
13139#if defined(LIBXML_LEGACY_ENABLED)
13140#ifdef LIBXML_LEGACY_ENABLED
13141    int mem_base;
13142    int ret_val;
13143    int * len; /* the length of the features name array (input/output) */
13144    int n_len;
13145    char ** result; /* an array of string to be filled with the features name. */
13146    int n_result;
13147
13148    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13149    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13150        mem_base = xmlMemBlocks();
13151        len = gen_int_ptr(n_len, 0);
13152        result = gen_const_char_ptr_ptr(n_result, 1);
13153
13154        ret_val = xmlGetFeaturesList(len, (const char **)result);
13155        desret_int(ret_val);
13156        call_tests++;
13157        des_int_ptr(n_len, len, 0);
13158        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13159        xmlResetLastError();
13160        if (mem_base != xmlMemBlocks()) {
13161            printf("Leak of %d blocks found in xmlGetFeaturesList",
13162	           xmlMemBlocks() - mem_base);
13163	    test_ret++;
13164            printf(" %d", n_len);
13165            printf(" %d", n_result);
13166            printf("\n");
13167        }
13168    }
13169    }
13170    function_tests++;
13171#endif
13172#endif
13173
13174    return(test_ret);
13175}
13176
13177
13178static int
13179test_xmlHasFeature(void) {
13180    int test_ret = 0;
13181
13182    int mem_base;
13183    int ret_val;
13184    xmlFeature feature; /* the feature to be examined */
13185    int n_feature;
13186
13187    for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13188        mem_base = xmlMemBlocks();
13189        feature = gen_xmlFeature(n_feature, 0);
13190
13191        ret_val = xmlHasFeature(feature);
13192        desret_int(ret_val);
13193        call_tests++;
13194        des_xmlFeature(n_feature, feature, 0);
13195        xmlResetLastError();
13196        if (mem_base != xmlMemBlocks()) {
13197            printf("Leak of %d blocks found in xmlHasFeature",
13198	           xmlMemBlocks() - mem_base);
13199	    test_ret++;
13200            printf(" %d", n_feature);
13201            printf("\n");
13202        }
13203    }
13204    function_tests++;
13205
13206    return(test_ret);
13207}
13208
13209
13210static int
13211test_xmlIOParseDTD(void) {
13212    int test_ret = 0;
13213
13214#if defined(LIBXML_VALID_ENABLED)
13215#ifdef LIBXML_VALID_ENABLED
13216    xmlDtdPtr ret_val;
13217    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13218    int n_sax;
13219    xmlParserInputBufferPtr input; /* an Input Buffer */
13220    int n_input;
13221    xmlCharEncoding enc; /* the charset encoding if known */
13222    int n_enc;
13223
13224    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13225    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13226    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13227        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13228        input = gen_xmlParserInputBufferPtr(n_input, 1);
13229        enc = gen_xmlCharEncoding(n_enc, 2);
13230
13231        ret_val = xmlIOParseDTD(sax, input, enc);
13232        input = NULL;
13233        desret_xmlDtdPtr(ret_val);
13234        call_tests++;
13235        des_xmlSAXHandlerPtr(n_sax, sax, 0);
13236        des_xmlParserInputBufferPtr(n_input, input, 1);
13237        des_xmlCharEncoding(n_enc, enc, 2);
13238        xmlResetLastError();
13239    }
13240    }
13241    }
13242    function_tests++;
13243#endif
13244#endif
13245
13246    return(test_ret);
13247}
13248
13249
13250static int
13251test_xmlInitNodeInfoSeq(void) {
13252    int test_ret = 0;
13253
13254    int mem_base;
13255    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13256    int n_seq;
13257
13258    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13259        mem_base = xmlMemBlocks();
13260        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13261
13262        xmlInitNodeInfoSeq(seq);
13263        call_tests++;
13264        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13265        xmlResetLastError();
13266        if (mem_base != xmlMemBlocks()) {
13267            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13268	           xmlMemBlocks() - mem_base);
13269	    test_ret++;
13270            printf(" %d", n_seq);
13271            printf("\n");
13272        }
13273    }
13274    function_tests++;
13275
13276    return(test_ret);
13277}
13278
13279
13280static int
13281test_xmlInitParser(void) {
13282    int test_ret = 0;
13283
13284    int mem_base;
13285
13286        mem_base = xmlMemBlocks();
13287
13288        xmlInitParser();
13289        call_tests++;
13290        xmlResetLastError();
13291        if (mem_base != xmlMemBlocks()) {
13292            printf("Leak of %d blocks found in xmlInitParser",
13293	           xmlMemBlocks() - mem_base);
13294	    test_ret++;
13295            printf("\n");
13296        }
13297    function_tests++;
13298
13299    return(test_ret);
13300}
13301
13302
13303static int
13304test_xmlInitParserCtxt(void) {
13305    int test_ret = 0;
13306
13307    int mem_base;
13308    int ret_val;
13309    xmlParserCtxtPtr ctxt; /* an XML parser context */
13310    int n_ctxt;
13311
13312    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13313        mem_base = xmlMemBlocks();
13314        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13315
13316        ret_val = xmlInitParserCtxt(ctxt);
13317        desret_int(ret_val);
13318        call_tests++;
13319        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13320        xmlResetLastError();
13321        if (mem_base != xmlMemBlocks()) {
13322            printf("Leak of %d blocks found in xmlInitParserCtxt",
13323	           xmlMemBlocks() - mem_base);
13324	    test_ret++;
13325            printf(" %d", n_ctxt);
13326            printf("\n");
13327        }
13328    }
13329    function_tests++;
13330
13331    return(test_ret);
13332}
13333
13334
13335static int
13336test_xmlKeepBlanksDefault(void) {
13337    int test_ret = 0;
13338
13339    int mem_base;
13340    int ret_val;
13341    int val; /* int 0 or 1 */
13342    int n_val;
13343
13344    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13345        mem_base = xmlMemBlocks();
13346        val = gen_int(n_val, 0);
13347
13348        ret_val = xmlKeepBlanksDefault(val);
13349        desret_int(ret_val);
13350        call_tests++;
13351        des_int(n_val, val, 0);
13352        xmlResetLastError();
13353        if (mem_base != xmlMemBlocks()) {
13354            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13355	           xmlMemBlocks() - mem_base);
13356	    test_ret++;
13357            printf(" %d", n_val);
13358            printf("\n");
13359        }
13360    }
13361    function_tests++;
13362
13363    return(test_ret);
13364}
13365
13366
13367static int
13368test_xmlLineNumbersDefault(void) {
13369    int test_ret = 0;
13370
13371    int mem_base;
13372    int ret_val;
13373    int val; /* int 0 or 1 */
13374    int n_val;
13375
13376    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13377        mem_base = xmlMemBlocks();
13378        val = gen_int(n_val, 0);
13379
13380        ret_val = xmlLineNumbersDefault(val);
13381        desret_int(ret_val);
13382        call_tests++;
13383        des_int(n_val, val, 0);
13384        xmlResetLastError();
13385        if (mem_base != xmlMemBlocks()) {
13386            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13387	           xmlMemBlocks() - mem_base);
13388	    test_ret++;
13389            printf(" %d", n_val);
13390            printf("\n");
13391        }
13392    }
13393    function_tests++;
13394
13395    return(test_ret);
13396}
13397
13398
13399static int
13400test_xmlLoadExternalEntity(void) {
13401    int test_ret = 0;
13402
13403    int mem_base;
13404    xmlParserInputPtr ret_val;
13405    const char * URL; /* the URL for the entity to load */
13406    int n_URL;
13407    char * ID; /* the Public ID for the entity to load */
13408    int n_ID;
13409    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13410    int n_ctxt;
13411
13412    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13413    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13414    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13415        mem_base = xmlMemBlocks();
13416        URL = gen_filepath(n_URL, 0);
13417        ID = gen_const_char_ptr(n_ID, 1);
13418        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13419
13420        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13421        desret_xmlParserInputPtr(ret_val);
13422        call_tests++;
13423        des_filepath(n_URL, URL, 0);
13424        des_const_char_ptr(n_ID, (const char *)ID, 1);
13425        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13426        xmlResetLastError();
13427        if (mem_base != xmlMemBlocks()) {
13428            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13429	           xmlMemBlocks() - mem_base);
13430	    test_ret++;
13431            printf(" %d", n_URL);
13432            printf(" %d", n_ID);
13433            printf(" %d", n_ctxt);
13434            printf("\n");
13435        }
13436    }
13437    }
13438    }
13439    function_tests++;
13440
13441    return(test_ret);
13442}
13443
13444
13445static int
13446test_xmlNewIOInputStream(void) {
13447    int test_ret = 0;
13448
13449    int mem_base;
13450    xmlParserInputPtr ret_val;
13451    xmlParserCtxtPtr ctxt; /* an XML parser context */
13452    int n_ctxt;
13453    xmlParserInputBufferPtr input; /* an I/O Input */
13454    int n_input;
13455    xmlCharEncoding enc; /* the charset encoding if known */
13456    int n_enc;
13457
13458    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13459    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13460    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13461        mem_base = xmlMemBlocks();
13462        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13463        input = gen_xmlParserInputBufferPtr(n_input, 1);
13464        enc = gen_xmlCharEncoding(n_enc, 2);
13465
13466        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13467        if (ret_val != NULL) input = NULL;
13468        desret_xmlParserInputPtr(ret_val);
13469        call_tests++;
13470        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13471        des_xmlParserInputBufferPtr(n_input, input, 1);
13472        des_xmlCharEncoding(n_enc, enc, 2);
13473        xmlResetLastError();
13474        if (mem_base != xmlMemBlocks()) {
13475            printf("Leak of %d blocks found in xmlNewIOInputStream",
13476	           xmlMemBlocks() - mem_base);
13477	    test_ret++;
13478            printf(" %d", n_ctxt);
13479            printf(" %d", n_input);
13480            printf(" %d", n_enc);
13481            printf("\n");
13482        }
13483    }
13484    }
13485    }
13486    function_tests++;
13487
13488    return(test_ret);
13489}
13490
13491
13492static int
13493test_xmlNewParserCtxt(void) {
13494    int test_ret = 0;
13495
13496    int mem_base;
13497    xmlParserCtxtPtr ret_val;
13498
13499        mem_base = xmlMemBlocks();
13500
13501        ret_val = xmlNewParserCtxt();
13502        desret_xmlParserCtxtPtr(ret_val);
13503        call_tests++;
13504        xmlResetLastError();
13505        if (mem_base != xmlMemBlocks()) {
13506            printf("Leak of %d blocks found in xmlNewParserCtxt",
13507	           xmlMemBlocks() - mem_base);
13508	    test_ret++;
13509            printf("\n");
13510        }
13511    function_tests++;
13512
13513    return(test_ret);
13514}
13515
13516
13517#define gen_nb_xmlNodePtr_ptr 1
13518static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13519    return(NULL);
13520}
13521static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13522}
13523
13524static int
13525test_xmlParseBalancedChunkMemory(void) {
13526    int test_ret = 0;
13527
13528#if defined(LIBXML_SAX1_ENABLED)
13529#ifdef LIBXML_SAX1_ENABLED
13530    int mem_base;
13531    int ret_val;
13532    xmlDocPtr doc; /* the document the chunk pertains to */
13533    int n_doc;
13534    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13535    int n_sax;
13536    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13537    int n_user_data;
13538    int depth; /* Used for loop detection, use 0 */
13539    int n_depth;
13540    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13541    int n_string;
13542    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13543    int n_lst;
13544
13545    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13546    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13547    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13548    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13549    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13550    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13551        mem_base = xmlMemBlocks();
13552        doc = gen_xmlDocPtr(n_doc, 0);
13553        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13554        user_data = gen_userdata(n_user_data, 2);
13555        depth = gen_int(n_depth, 3);
13556        string = gen_const_xmlChar_ptr(n_string, 4);
13557        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13558
13559#ifdef LIBXML_SAX1_ENABLED
13560        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13561#endif
13562
13563
13564        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13565        desret_int(ret_val);
13566        call_tests++;
13567        des_xmlDocPtr(n_doc, doc, 0);
13568        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13569        des_userdata(n_user_data, user_data, 2);
13570        des_int(n_depth, depth, 3);
13571        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13572        des_xmlNodePtr_ptr(n_lst, lst, 5);
13573        xmlResetLastError();
13574        if (mem_base != xmlMemBlocks()) {
13575            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13576	           xmlMemBlocks() - mem_base);
13577	    test_ret++;
13578            printf(" %d", n_doc);
13579            printf(" %d", n_sax);
13580            printf(" %d", n_user_data);
13581            printf(" %d", n_depth);
13582            printf(" %d", n_string);
13583            printf(" %d", n_lst);
13584            printf("\n");
13585        }
13586    }
13587    }
13588    }
13589    }
13590    }
13591    }
13592    function_tests++;
13593#endif
13594#endif
13595
13596    return(test_ret);
13597}
13598
13599
13600static int
13601test_xmlParseBalancedChunkMemoryRecover(void) {
13602    int test_ret = 0;
13603
13604#if defined(LIBXML_SAX1_ENABLED)
13605#ifdef LIBXML_SAX1_ENABLED
13606    int mem_base;
13607    int ret_val;
13608    xmlDocPtr doc; /* the document the chunk pertains to */
13609    int n_doc;
13610    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13611    int n_sax;
13612    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13613    int n_user_data;
13614    int depth; /* Used for loop detection, use 0 */
13615    int n_depth;
13616    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13617    int n_string;
13618    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13619    int n_lst;
13620    int recover; /* return nodes even if the data is broken (use 0) */
13621    int n_recover;
13622
13623    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13624    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13625    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13626    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13627    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13628    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13629    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13630        mem_base = xmlMemBlocks();
13631        doc = gen_xmlDocPtr(n_doc, 0);
13632        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13633        user_data = gen_userdata(n_user_data, 2);
13634        depth = gen_int(n_depth, 3);
13635        string = gen_const_xmlChar_ptr(n_string, 4);
13636        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13637        recover = gen_int(n_recover, 6);
13638
13639#ifdef LIBXML_SAX1_ENABLED
13640        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13641#endif
13642
13643
13644        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13645        desret_int(ret_val);
13646        call_tests++;
13647        des_xmlDocPtr(n_doc, doc, 0);
13648        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13649        des_userdata(n_user_data, user_data, 2);
13650        des_int(n_depth, depth, 3);
13651        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13652        des_xmlNodePtr_ptr(n_lst, lst, 5);
13653        des_int(n_recover, recover, 6);
13654        xmlResetLastError();
13655        if (mem_base != xmlMemBlocks()) {
13656            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13657	           xmlMemBlocks() - mem_base);
13658	    test_ret++;
13659            printf(" %d", n_doc);
13660            printf(" %d", n_sax);
13661            printf(" %d", n_user_data);
13662            printf(" %d", n_depth);
13663            printf(" %d", n_string);
13664            printf(" %d", n_lst);
13665            printf(" %d", n_recover);
13666            printf("\n");
13667        }
13668    }
13669    }
13670    }
13671    }
13672    }
13673    }
13674    }
13675    function_tests++;
13676#endif
13677#endif
13678
13679    return(test_ret);
13680}
13681
13682
13683static int
13684test_xmlParseChunk(void) {
13685    int test_ret = 0;
13686
13687#if defined(LIBXML_PUSH_ENABLED)
13688    int mem_base;
13689    int ret_val;
13690    xmlParserCtxtPtr ctxt; /* an XML parser context */
13691    int n_ctxt;
13692    char * chunk; /* an char array */
13693    int n_chunk;
13694    int size; /* the size in byte of the chunk */
13695    int n_size;
13696    int terminate; /* last chunk indicator */
13697    int n_terminate;
13698
13699    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13700    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13701    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13702    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13703        mem_base = xmlMemBlocks();
13704        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13705        chunk = gen_const_char_ptr(n_chunk, 1);
13706        size = gen_int(n_size, 2);
13707        terminate = gen_int(n_terminate, 3);
13708
13709        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13710        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13711        desret_int(ret_val);
13712        call_tests++;
13713        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13714        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13715        des_int(n_size, size, 2);
13716        des_int(n_terminate, terminate, 3);
13717        xmlResetLastError();
13718        if (mem_base != xmlMemBlocks()) {
13719            printf("Leak of %d blocks found in xmlParseChunk",
13720	           xmlMemBlocks() - mem_base);
13721	    test_ret++;
13722            printf(" %d", n_ctxt);
13723            printf(" %d", n_chunk);
13724            printf(" %d", n_size);
13725            printf(" %d", n_terminate);
13726            printf("\n");
13727        }
13728    }
13729    }
13730    }
13731    }
13732    function_tests++;
13733#endif
13734
13735    return(test_ret);
13736}
13737
13738
13739static int
13740test_xmlParseCtxtExternalEntity(void) {
13741    int test_ret = 0;
13742
13743    int mem_base;
13744    int ret_val;
13745    xmlParserCtxtPtr ctx; /* the existing parsing context */
13746    int n_ctx;
13747    xmlChar * URL; /* the URL for the entity to load */
13748    int n_URL;
13749    xmlChar * ID; /* the System ID for the entity to load */
13750    int n_ID;
13751    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13752    int n_lst;
13753
13754    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13755    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13756    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13757    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13758        mem_base = xmlMemBlocks();
13759        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13760        URL = gen_const_xmlChar_ptr(n_URL, 1);
13761        ID = gen_const_xmlChar_ptr(n_ID, 2);
13762        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13763
13764        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13765        desret_int(ret_val);
13766        call_tests++;
13767        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13768        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13769        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13770        des_xmlNodePtr_ptr(n_lst, lst, 3);
13771        xmlResetLastError();
13772        if (mem_base != xmlMemBlocks()) {
13773            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13774	           xmlMemBlocks() - mem_base);
13775	    test_ret++;
13776            printf(" %d", n_ctx);
13777            printf(" %d", n_URL);
13778            printf(" %d", n_ID);
13779            printf(" %d", n_lst);
13780            printf("\n");
13781        }
13782    }
13783    }
13784    }
13785    }
13786    function_tests++;
13787
13788    return(test_ret);
13789}
13790
13791
13792static int
13793test_xmlParseDTD(void) {
13794    int test_ret = 0;
13795
13796#if defined(LIBXML_VALID_ENABLED)
13797#ifdef LIBXML_VALID_ENABLED
13798    int mem_base;
13799    xmlDtdPtr ret_val;
13800    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13801    int n_ExternalID;
13802    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13803    int n_SystemID;
13804
13805    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13806    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13807        mem_base = xmlMemBlocks();
13808        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13809        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13810
13811        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13812        desret_xmlDtdPtr(ret_val);
13813        call_tests++;
13814        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13815        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13816        xmlResetLastError();
13817        if (mem_base != xmlMemBlocks()) {
13818            printf("Leak of %d blocks found in xmlParseDTD",
13819	           xmlMemBlocks() - mem_base);
13820	    test_ret++;
13821            printf(" %d", n_ExternalID);
13822            printf(" %d", n_SystemID);
13823            printf("\n");
13824        }
13825    }
13826    }
13827    function_tests++;
13828#endif
13829#endif
13830
13831    return(test_ret);
13832}
13833
13834
13835static int
13836test_xmlParseDoc(void) {
13837    int test_ret = 0;
13838
13839#if defined(LIBXML_SAX1_ENABLED)
13840#ifdef LIBXML_SAX1_ENABLED
13841    int mem_base;
13842    xmlDocPtr ret_val;
13843    xmlChar * cur; /* a pointer to an array of xmlChar */
13844    int n_cur;
13845
13846    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13847        mem_base = xmlMemBlocks();
13848        cur = gen_const_xmlChar_ptr(n_cur, 0);
13849
13850        ret_val = xmlParseDoc((const xmlChar *)cur);
13851        desret_xmlDocPtr(ret_val);
13852        call_tests++;
13853        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13854        xmlResetLastError();
13855        if (mem_base != xmlMemBlocks()) {
13856            printf("Leak of %d blocks found in xmlParseDoc",
13857	           xmlMemBlocks() - mem_base);
13858	    test_ret++;
13859            printf(" %d", n_cur);
13860            printf("\n");
13861        }
13862    }
13863    function_tests++;
13864#endif
13865#endif
13866
13867    return(test_ret);
13868}
13869
13870
13871static int
13872test_xmlParseDocument(void) {
13873    int test_ret = 0;
13874
13875    int mem_base;
13876    int ret_val;
13877    xmlParserCtxtPtr ctxt; /* an XML parser context */
13878    int n_ctxt;
13879
13880    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13881        mem_base = xmlMemBlocks();
13882        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13883
13884        ret_val = xmlParseDocument(ctxt);
13885        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13886        desret_int(ret_val);
13887        call_tests++;
13888        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13889        xmlResetLastError();
13890        if (mem_base != xmlMemBlocks()) {
13891            printf("Leak of %d blocks found in xmlParseDocument",
13892	           xmlMemBlocks() - mem_base);
13893	    test_ret++;
13894            printf(" %d", n_ctxt);
13895            printf("\n");
13896        }
13897    }
13898    function_tests++;
13899
13900    return(test_ret);
13901}
13902
13903
13904static int
13905test_xmlParseEntity(void) {
13906    int test_ret = 0;
13907
13908#if defined(LIBXML_SAX1_ENABLED)
13909#ifdef LIBXML_SAX1_ENABLED
13910    int mem_base;
13911    xmlDocPtr ret_val;
13912    const char * filename; /* the filename */
13913    int n_filename;
13914
13915    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13916        mem_base = xmlMemBlocks();
13917        filename = gen_filepath(n_filename, 0);
13918
13919        ret_val = xmlParseEntity(filename);
13920        desret_xmlDocPtr(ret_val);
13921        call_tests++;
13922        des_filepath(n_filename, filename, 0);
13923        xmlResetLastError();
13924        if (mem_base != xmlMemBlocks()) {
13925            printf("Leak of %d blocks found in xmlParseEntity",
13926	           xmlMemBlocks() - mem_base);
13927	    test_ret++;
13928            printf(" %d", n_filename);
13929            printf("\n");
13930        }
13931    }
13932    function_tests++;
13933#endif
13934#endif
13935
13936    return(test_ret);
13937}
13938
13939
13940static int
13941test_xmlParseExtParsedEnt(void) {
13942    int test_ret = 0;
13943
13944    int mem_base;
13945    int ret_val;
13946    xmlParserCtxtPtr ctxt; /* an XML parser context */
13947    int n_ctxt;
13948
13949    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13950        mem_base = xmlMemBlocks();
13951        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13952
13953        ret_val = xmlParseExtParsedEnt(ctxt);
13954        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13955        desret_int(ret_val);
13956        call_tests++;
13957        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13958        xmlResetLastError();
13959        if (mem_base != xmlMemBlocks()) {
13960            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13961	           xmlMemBlocks() - mem_base);
13962	    test_ret++;
13963            printf(" %d", n_ctxt);
13964            printf("\n");
13965        }
13966    }
13967    function_tests++;
13968
13969    return(test_ret);
13970}
13971
13972
13973static int
13974test_xmlParseExternalEntity(void) {
13975    int test_ret = 0;
13976
13977#if defined(LIBXML_SAX1_ENABLED)
13978#ifdef LIBXML_SAX1_ENABLED
13979    int mem_base;
13980    int ret_val;
13981    xmlDocPtr doc; /* the document the chunk pertains to */
13982    int n_doc;
13983    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13984    int n_sax;
13985    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13986    int n_user_data;
13987    int depth; /* Used for loop detection, use 0 */
13988    int n_depth;
13989    xmlChar * URL; /* the URL for the entity to load */
13990    int n_URL;
13991    xmlChar * ID; /* the System ID for the entity to load */
13992    int n_ID;
13993    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13994    int n_lst;
13995
13996    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13997    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13998    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13999    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14000    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14001    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14002    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14003        mem_base = xmlMemBlocks();
14004        doc = gen_xmlDocPtr(n_doc, 0);
14005        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14006        user_data = gen_userdata(n_user_data, 2);
14007        depth = gen_int(n_depth, 3);
14008        URL = gen_const_xmlChar_ptr(n_URL, 4);
14009        ID = gen_const_xmlChar_ptr(n_ID, 5);
14010        lst = gen_xmlNodePtr_ptr(n_lst, 6);
14011
14012        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14013        desret_int(ret_val);
14014        call_tests++;
14015        des_xmlDocPtr(n_doc, doc, 0);
14016        des_xmlSAXHandlerPtr(n_sax, sax, 1);
14017        des_userdata(n_user_data, user_data, 2);
14018        des_int(n_depth, depth, 3);
14019        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14020        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14021        des_xmlNodePtr_ptr(n_lst, lst, 6);
14022        xmlResetLastError();
14023        if (mem_base != xmlMemBlocks()) {
14024            printf("Leak of %d blocks found in xmlParseExternalEntity",
14025	           xmlMemBlocks() - mem_base);
14026	    test_ret++;
14027            printf(" %d", n_doc);
14028            printf(" %d", n_sax);
14029            printf(" %d", n_user_data);
14030            printf(" %d", n_depth);
14031            printf(" %d", n_URL);
14032            printf(" %d", n_ID);
14033            printf(" %d", n_lst);
14034            printf("\n");
14035        }
14036    }
14037    }
14038    }
14039    }
14040    }
14041    }
14042    }
14043    function_tests++;
14044#endif
14045#endif
14046
14047    return(test_ret);
14048}
14049
14050
14051static int
14052test_xmlParseFile(void) {
14053    int test_ret = 0;
14054
14055#if defined(LIBXML_SAX1_ENABLED)
14056#ifdef LIBXML_SAX1_ENABLED
14057    int mem_base;
14058    xmlDocPtr ret_val;
14059    const char * filename; /* the filename */
14060    int n_filename;
14061
14062    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14063        mem_base = xmlMemBlocks();
14064        filename = gen_filepath(n_filename, 0);
14065
14066        ret_val = xmlParseFile(filename);
14067        desret_xmlDocPtr(ret_val);
14068        call_tests++;
14069        des_filepath(n_filename, filename, 0);
14070        xmlResetLastError();
14071        if (mem_base != xmlMemBlocks()) {
14072            printf("Leak of %d blocks found in xmlParseFile",
14073	           xmlMemBlocks() - mem_base);
14074	    test_ret++;
14075            printf(" %d", n_filename);
14076            printf("\n");
14077        }
14078    }
14079    function_tests++;
14080#endif
14081#endif
14082
14083    return(test_ret);
14084}
14085
14086
14087static int
14088test_xmlParseInNodeContext(void) {
14089    int test_ret = 0;
14090
14091    int mem_base;
14092    xmlParserErrors ret_val;
14093    xmlNodePtr node; /* the context node */
14094    int n_node;
14095    char * data; /* the input string */
14096    int n_data;
14097    int datalen; /* the input string length in bytes */
14098    int n_datalen;
14099    int options; /* a combination of xmlParserOption */
14100    int n_options;
14101    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14102    int n_lst;
14103
14104    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14105    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14106    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14107    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14108    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14109        mem_base = xmlMemBlocks();
14110        node = gen_xmlNodePtr(n_node, 0);
14111        data = gen_const_char_ptr(n_data, 1);
14112        datalen = gen_int(n_datalen, 2);
14113        options = gen_parseroptions(n_options, 3);
14114        lst = gen_xmlNodePtr_ptr(n_lst, 4);
14115
14116        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14117        desret_xmlParserErrors(ret_val);
14118        call_tests++;
14119        des_xmlNodePtr(n_node, node, 0);
14120        des_const_char_ptr(n_data, (const char *)data, 1);
14121        des_int(n_datalen, datalen, 2);
14122        des_parseroptions(n_options, options, 3);
14123        des_xmlNodePtr_ptr(n_lst, lst, 4);
14124        xmlResetLastError();
14125        if (mem_base != xmlMemBlocks()) {
14126            printf("Leak of %d blocks found in xmlParseInNodeContext",
14127	           xmlMemBlocks() - mem_base);
14128	    test_ret++;
14129            printf(" %d", n_node);
14130            printf(" %d", n_data);
14131            printf(" %d", n_datalen);
14132            printf(" %d", n_options);
14133            printf(" %d", n_lst);
14134            printf("\n");
14135        }
14136    }
14137    }
14138    }
14139    }
14140    }
14141    function_tests++;
14142
14143    return(test_ret);
14144}
14145
14146
14147static int
14148test_xmlParseMemory(void) {
14149    int test_ret = 0;
14150
14151#if defined(LIBXML_SAX1_ENABLED)
14152#ifdef LIBXML_SAX1_ENABLED
14153    int mem_base;
14154    xmlDocPtr ret_val;
14155    char * buffer; /* an pointer to a char array */
14156    int n_buffer;
14157    int size; /* the size of the array */
14158    int n_size;
14159
14160    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14161    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14162        mem_base = xmlMemBlocks();
14163        buffer = gen_const_char_ptr(n_buffer, 0);
14164        size = gen_int(n_size, 1);
14165
14166        ret_val = xmlParseMemory((const char *)buffer, size);
14167        desret_xmlDocPtr(ret_val);
14168        call_tests++;
14169        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14170        des_int(n_size, size, 1);
14171        xmlResetLastError();
14172        if (mem_base != xmlMemBlocks()) {
14173            printf("Leak of %d blocks found in xmlParseMemory",
14174	           xmlMemBlocks() - mem_base);
14175	    test_ret++;
14176            printf(" %d", n_buffer);
14177            printf(" %d", n_size);
14178            printf("\n");
14179        }
14180    }
14181    }
14182    function_tests++;
14183#endif
14184#endif
14185
14186    return(test_ret);
14187}
14188
14189
14190#define gen_nb_const_xmlParserNodeInfoPtr 1
14191static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14192    return(NULL);
14193}
14194static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14195}
14196
14197static int
14198test_xmlParserAddNodeInfo(void) {
14199    int test_ret = 0;
14200
14201    int mem_base;
14202    xmlParserCtxtPtr ctxt; /* an XML parser context */
14203    int n_ctxt;
14204    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14205    int n_info;
14206
14207    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14208    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14209        mem_base = xmlMemBlocks();
14210        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14211        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14212
14213        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14214        call_tests++;
14215        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14216        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14217        xmlResetLastError();
14218        if (mem_base != xmlMemBlocks()) {
14219            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14220	           xmlMemBlocks() - mem_base);
14221	    test_ret++;
14222            printf(" %d", n_ctxt);
14223            printf(" %d", n_info);
14224            printf("\n");
14225        }
14226    }
14227    }
14228    function_tests++;
14229
14230    return(test_ret);
14231}
14232
14233
14234#define gen_nb_const_xmlParserCtxtPtr 1
14235static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14236    return(NULL);
14237}
14238static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14239}
14240
14241#define gen_nb_const_xmlNodePtr 1
14242static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14243    return(NULL);
14244}
14245static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14246}
14247
14248static int
14249test_xmlParserFindNodeInfo(void) {
14250    int test_ret = 0;
14251
14252    int mem_base;
14253    const xmlParserNodeInfo * ret_val;
14254    xmlParserCtxtPtr ctx; /* an XML parser context */
14255    int n_ctx;
14256    xmlNodePtr node; /* an XML node within the tree */
14257    int n_node;
14258
14259    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14260    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14261        mem_base = xmlMemBlocks();
14262        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14263        node = gen_const_xmlNodePtr(n_node, 1);
14264
14265        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14266        desret_const_xmlParserNodeInfo_ptr(ret_val);
14267        call_tests++;
14268        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14269        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14270        xmlResetLastError();
14271        if (mem_base != xmlMemBlocks()) {
14272            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14273	           xmlMemBlocks() - mem_base);
14274	    test_ret++;
14275            printf(" %d", n_ctx);
14276            printf(" %d", n_node);
14277            printf("\n");
14278        }
14279    }
14280    }
14281    function_tests++;
14282
14283    return(test_ret);
14284}
14285
14286
14287#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14288static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14289    return(NULL);
14290}
14291static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14292}
14293
14294static int
14295test_xmlParserFindNodeInfoIndex(void) {
14296    int test_ret = 0;
14297
14298    int mem_base;
14299    unsigned long ret_val;
14300    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14301    int n_seq;
14302    xmlNodePtr node; /* an XML node pointer */
14303    int n_node;
14304
14305    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14306    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14307        mem_base = xmlMemBlocks();
14308        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14309        node = gen_const_xmlNodePtr(n_node, 1);
14310
14311        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14312        desret_unsigned_long(ret_val);
14313        call_tests++;
14314        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14315        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14316        xmlResetLastError();
14317        if (mem_base != xmlMemBlocks()) {
14318            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14319	           xmlMemBlocks() - mem_base);
14320	    test_ret++;
14321            printf(" %d", n_seq);
14322            printf(" %d", n_node);
14323            printf("\n");
14324        }
14325    }
14326    }
14327    function_tests++;
14328
14329    return(test_ret);
14330}
14331
14332
14333#define gen_nb_xmlParserInputPtr 1
14334static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14335    return(NULL);
14336}
14337static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14338}
14339
14340static int
14341test_xmlParserInputGrow(void) {
14342    int test_ret = 0;
14343
14344    int mem_base;
14345    int ret_val;
14346    xmlParserInputPtr in; /* an XML parser input */
14347    int n_in;
14348    int len; /* an indicative size for the lookahead */
14349    int n_len;
14350
14351    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14352    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14353        mem_base = xmlMemBlocks();
14354        in = gen_xmlParserInputPtr(n_in, 0);
14355        len = gen_int(n_len, 1);
14356
14357        ret_val = xmlParserInputGrow(in, len);
14358        desret_int(ret_val);
14359        call_tests++;
14360        des_xmlParserInputPtr(n_in, in, 0);
14361        des_int(n_len, len, 1);
14362        xmlResetLastError();
14363        if (mem_base != xmlMemBlocks()) {
14364            printf("Leak of %d blocks found in xmlParserInputGrow",
14365	           xmlMemBlocks() - mem_base);
14366	    test_ret++;
14367            printf(" %d", n_in);
14368            printf(" %d", n_len);
14369            printf("\n");
14370        }
14371    }
14372    }
14373    function_tests++;
14374
14375    return(test_ret);
14376}
14377
14378
14379static int
14380test_xmlParserInputRead(void) {
14381    int test_ret = 0;
14382
14383    int mem_base;
14384    int ret_val;
14385    xmlParserInputPtr in; /* an XML parser input */
14386    int n_in;
14387    int len; /* an indicative size for the lookahead */
14388    int n_len;
14389
14390    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14391    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14392        mem_base = xmlMemBlocks();
14393        in = gen_xmlParserInputPtr(n_in, 0);
14394        len = gen_int(n_len, 1);
14395
14396        ret_val = xmlParserInputRead(in, len);
14397        desret_int(ret_val);
14398        call_tests++;
14399        des_xmlParserInputPtr(n_in, in, 0);
14400        des_int(n_len, len, 1);
14401        xmlResetLastError();
14402        if (mem_base != xmlMemBlocks()) {
14403            printf("Leak of %d blocks found in xmlParserInputRead",
14404	           xmlMemBlocks() - mem_base);
14405	    test_ret++;
14406            printf(" %d", n_in);
14407            printf(" %d", n_len);
14408            printf("\n");
14409        }
14410    }
14411    }
14412    function_tests++;
14413
14414    return(test_ret);
14415}
14416
14417
14418static int
14419test_xmlPedanticParserDefault(void) {
14420    int test_ret = 0;
14421
14422    int mem_base;
14423    int ret_val;
14424    int val; /* int 0 or 1 */
14425    int n_val;
14426
14427    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14428        mem_base = xmlMemBlocks();
14429        val = gen_int(n_val, 0);
14430
14431        ret_val = xmlPedanticParserDefault(val);
14432        desret_int(ret_val);
14433        call_tests++;
14434        des_int(n_val, val, 0);
14435        xmlResetLastError();
14436        if (mem_base != xmlMemBlocks()) {
14437            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14438	           xmlMemBlocks() - mem_base);
14439	    test_ret++;
14440            printf(" %d", n_val);
14441            printf("\n");
14442        }
14443    }
14444    function_tests++;
14445
14446    return(test_ret);
14447}
14448
14449
14450static int
14451test_xmlReadDoc(void) {
14452    int test_ret = 0;
14453
14454    int mem_base;
14455    xmlDocPtr ret_val;
14456    xmlChar * cur; /* a pointer to a zero terminated string */
14457    int n_cur;
14458    const char * URL; /* the base URL to use for the document */
14459    int n_URL;
14460    char * encoding; /* the document encoding, or NULL */
14461    int n_encoding;
14462    int options; /* a combination of xmlParserOption */
14463    int n_options;
14464
14465    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14466    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14467    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14468    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14469        mem_base = xmlMemBlocks();
14470        cur = gen_const_xmlChar_ptr(n_cur, 0);
14471        URL = gen_filepath(n_URL, 1);
14472        encoding = gen_const_char_ptr(n_encoding, 2);
14473        options = gen_parseroptions(n_options, 3);
14474
14475        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14476        desret_xmlDocPtr(ret_val);
14477        call_tests++;
14478        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14479        des_filepath(n_URL, URL, 1);
14480        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14481        des_parseroptions(n_options, options, 3);
14482        xmlResetLastError();
14483        if (mem_base != xmlMemBlocks()) {
14484            printf("Leak of %d blocks found in xmlReadDoc",
14485	           xmlMemBlocks() - mem_base);
14486	    test_ret++;
14487            printf(" %d", n_cur);
14488            printf(" %d", n_URL);
14489            printf(" %d", n_encoding);
14490            printf(" %d", n_options);
14491            printf("\n");
14492        }
14493    }
14494    }
14495    }
14496    }
14497    function_tests++;
14498
14499    return(test_ret);
14500}
14501
14502
14503static int
14504test_xmlReadFile(void) {
14505    int test_ret = 0;
14506
14507    int mem_base;
14508    xmlDocPtr ret_val;
14509    const char * filename; /* a file or URL */
14510    int n_filename;
14511    char * encoding; /* the document encoding, or NULL */
14512    int n_encoding;
14513    int options; /* a combination of xmlParserOption */
14514    int n_options;
14515
14516    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14517    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14518    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14519        mem_base = xmlMemBlocks();
14520        filename = gen_filepath(n_filename, 0);
14521        encoding = gen_const_char_ptr(n_encoding, 1);
14522        options = gen_parseroptions(n_options, 2);
14523
14524        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14525        desret_xmlDocPtr(ret_val);
14526        call_tests++;
14527        des_filepath(n_filename, filename, 0);
14528        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14529        des_parseroptions(n_options, options, 2);
14530        xmlResetLastError();
14531        if (mem_base != xmlMemBlocks()) {
14532            printf("Leak of %d blocks found in xmlReadFile",
14533	           xmlMemBlocks() - mem_base);
14534	    test_ret++;
14535            printf(" %d", n_filename);
14536            printf(" %d", n_encoding);
14537            printf(" %d", n_options);
14538            printf("\n");
14539        }
14540    }
14541    }
14542    }
14543    function_tests++;
14544
14545    return(test_ret);
14546}
14547
14548
14549static int
14550test_xmlReadMemory(void) {
14551    int test_ret = 0;
14552
14553    int mem_base;
14554    xmlDocPtr ret_val;
14555    char * buffer; /* a pointer to a char array */
14556    int n_buffer;
14557    int size; /* the size of the array */
14558    int n_size;
14559    const char * URL; /* the base URL to use for the document */
14560    int n_URL;
14561    char * encoding; /* the document encoding, or NULL */
14562    int n_encoding;
14563    int options; /* a combination of xmlParserOption */
14564    int n_options;
14565
14566    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14567    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14568    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14569    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14570    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14571        mem_base = xmlMemBlocks();
14572        buffer = gen_const_char_ptr(n_buffer, 0);
14573        size = gen_int(n_size, 1);
14574        URL = gen_filepath(n_URL, 2);
14575        encoding = gen_const_char_ptr(n_encoding, 3);
14576        options = gen_parseroptions(n_options, 4);
14577
14578        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14579        desret_xmlDocPtr(ret_val);
14580        call_tests++;
14581        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14582        des_int(n_size, size, 1);
14583        des_filepath(n_URL, URL, 2);
14584        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14585        des_parseroptions(n_options, options, 4);
14586        xmlResetLastError();
14587        if (mem_base != xmlMemBlocks()) {
14588            printf("Leak of %d blocks found in xmlReadMemory",
14589	           xmlMemBlocks() - mem_base);
14590	    test_ret++;
14591            printf(" %d", n_buffer);
14592            printf(" %d", n_size);
14593            printf(" %d", n_URL);
14594            printf(" %d", n_encoding);
14595            printf(" %d", n_options);
14596            printf("\n");
14597        }
14598    }
14599    }
14600    }
14601    }
14602    }
14603    function_tests++;
14604
14605    return(test_ret);
14606}
14607
14608
14609static int
14610test_xmlRecoverDoc(void) {
14611    int test_ret = 0;
14612
14613#if defined(LIBXML_SAX1_ENABLED)
14614#ifdef LIBXML_SAX1_ENABLED
14615    int mem_base;
14616    xmlDocPtr ret_val;
14617    xmlChar * cur; /* a pointer to an array of xmlChar */
14618    int n_cur;
14619
14620    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14621        mem_base = xmlMemBlocks();
14622        cur = gen_xmlChar_ptr(n_cur, 0);
14623
14624        ret_val = xmlRecoverDoc(cur);
14625        desret_xmlDocPtr(ret_val);
14626        call_tests++;
14627        des_xmlChar_ptr(n_cur, cur, 0);
14628        xmlResetLastError();
14629        if (mem_base != xmlMemBlocks()) {
14630            printf("Leak of %d blocks found in xmlRecoverDoc",
14631	           xmlMemBlocks() - mem_base);
14632	    test_ret++;
14633            printf(" %d", n_cur);
14634            printf("\n");
14635        }
14636    }
14637    function_tests++;
14638#endif
14639#endif
14640
14641    return(test_ret);
14642}
14643
14644
14645static int
14646test_xmlRecoverFile(void) {
14647    int test_ret = 0;
14648
14649#if defined(LIBXML_SAX1_ENABLED)
14650#ifdef LIBXML_SAX1_ENABLED
14651    int mem_base;
14652    xmlDocPtr ret_val;
14653    const char * filename; /* the filename */
14654    int n_filename;
14655
14656    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14657        mem_base = xmlMemBlocks();
14658        filename = gen_filepath(n_filename, 0);
14659
14660        ret_val = xmlRecoverFile(filename);
14661        desret_xmlDocPtr(ret_val);
14662        call_tests++;
14663        des_filepath(n_filename, filename, 0);
14664        xmlResetLastError();
14665        if (mem_base != xmlMemBlocks()) {
14666            printf("Leak of %d blocks found in xmlRecoverFile",
14667	           xmlMemBlocks() - mem_base);
14668	    test_ret++;
14669            printf(" %d", n_filename);
14670            printf("\n");
14671        }
14672    }
14673    function_tests++;
14674#endif
14675#endif
14676
14677    return(test_ret);
14678}
14679
14680
14681static int
14682test_xmlRecoverMemory(void) {
14683    int test_ret = 0;
14684
14685#if defined(LIBXML_SAX1_ENABLED)
14686#ifdef LIBXML_SAX1_ENABLED
14687    int mem_base;
14688    xmlDocPtr ret_val;
14689    char * buffer; /* an pointer to a char array */
14690    int n_buffer;
14691    int size; /* the size of the array */
14692    int n_size;
14693
14694    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14695    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14696        mem_base = xmlMemBlocks();
14697        buffer = gen_const_char_ptr(n_buffer, 0);
14698        size = gen_int(n_size, 1);
14699
14700        ret_val = xmlRecoverMemory((const char *)buffer, size);
14701        desret_xmlDocPtr(ret_val);
14702        call_tests++;
14703        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14704        des_int(n_size, size, 1);
14705        xmlResetLastError();
14706        if (mem_base != xmlMemBlocks()) {
14707            printf("Leak of %d blocks found in xmlRecoverMemory",
14708	           xmlMemBlocks() - mem_base);
14709	    test_ret++;
14710            printf(" %d", n_buffer);
14711            printf(" %d", n_size);
14712            printf("\n");
14713        }
14714    }
14715    }
14716    function_tests++;
14717#endif
14718#endif
14719
14720    return(test_ret);
14721}
14722
14723
14724static int
14725test_xmlSAXParseDTD(void) {
14726    int test_ret = 0;
14727
14728#if defined(LIBXML_VALID_ENABLED)
14729#ifdef LIBXML_SAX1_ENABLED
14730    int mem_base;
14731    xmlDtdPtr ret_val;
14732    xmlSAXHandlerPtr sax; /* the SAX handler block */
14733    int n_sax;
14734    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14735    int n_ExternalID;
14736    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14737    int n_SystemID;
14738
14739    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14740    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14741    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14742        mem_base = xmlMemBlocks();
14743        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14744        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14745        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14746
14747        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14748        desret_xmlDtdPtr(ret_val);
14749        call_tests++;
14750        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14751        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14752        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14753        xmlResetLastError();
14754        if (mem_base != xmlMemBlocks()) {
14755            printf("Leak of %d blocks found in xmlSAXParseDTD",
14756	           xmlMemBlocks() - mem_base);
14757	    test_ret++;
14758            printf(" %d", n_sax);
14759            printf(" %d", n_ExternalID);
14760            printf(" %d", n_SystemID);
14761            printf("\n");
14762        }
14763    }
14764    }
14765    }
14766    function_tests++;
14767#endif
14768#endif
14769
14770    return(test_ret);
14771}
14772
14773
14774static int
14775test_xmlSAXParseDoc(void) {
14776    int test_ret = 0;
14777
14778#if defined(LIBXML_SAX1_ENABLED)
14779#ifdef LIBXML_SAX1_ENABLED
14780    int mem_base;
14781    xmlDocPtr ret_val;
14782    xmlSAXHandlerPtr sax; /* the SAX handler block */
14783    int n_sax;
14784    xmlChar * cur; /* a pointer to an array of xmlChar */
14785    int n_cur;
14786    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14787    int n_recovery;
14788
14789    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14790    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14791    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14792        mem_base = xmlMemBlocks();
14793        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14794        cur = gen_const_xmlChar_ptr(n_cur, 1);
14795        recovery = gen_int(n_recovery, 2);
14796
14797        ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14798        desret_xmlDocPtr(ret_val);
14799        call_tests++;
14800        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14801        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14802        des_int(n_recovery, recovery, 2);
14803        xmlResetLastError();
14804        if (mem_base != xmlMemBlocks()) {
14805            printf("Leak of %d blocks found in xmlSAXParseDoc",
14806	           xmlMemBlocks() - mem_base);
14807	    test_ret++;
14808            printf(" %d", n_sax);
14809            printf(" %d", n_cur);
14810            printf(" %d", n_recovery);
14811            printf("\n");
14812        }
14813    }
14814    }
14815    }
14816    function_tests++;
14817#endif
14818#endif
14819
14820    return(test_ret);
14821}
14822
14823
14824static int
14825test_xmlSAXParseEntity(void) {
14826    int test_ret = 0;
14827
14828#if defined(LIBXML_SAX1_ENABLED)
14829#ifdef LIBXML_SAX1_ENABLED
14830    int mem_base;
14831    xmlDocPtr ret_val;
14832    xmlSAXHandlerPtr sax; /* the SAX handler block */
14833    int n_sax;
14834    const char * filename; /* the filename */
14835    int n_filename;
14836
14837    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14838    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14839        mem_base = xmlMemBlocks();
14840        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14841        filename = gen_filepath(n_filename, 1);
14842
14843        ret_val = xmlSAXParseEntity(sax, filename);
14844        desret_xmlDocPtr(ret_val);
14845        call_tests++;
14846        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14847        des_filepath(n_filename, filename, 1);
14848        xmlResetLastError();
14849        if (mem_base != xmlMemBlocks()) {
14850            printf("Leak of %d blocks found in xmlSAXParseEntity",
14851	           xmlMemBlocks() - mem_base);
14852	    test_ret++;
14853            printf(" %d", n_sax);
14854            printf(" %d", n_filename);
14855            printf("\n");
14856        }
14857    }
14858    }
14859    function_tests++;
14860#endif
14861#endif
14862
14863    return(test_ret);
14864}
14865
14866
14867static int
14868test_xmlSAXParseFile(void) {
14869    int test_ret = 0;
14870
14871#if defined(LIBXML_SAX1_ENABLED)
14872#ifdef LIBXML_SAX1_ENABLED
14873    int mem_base;
14874    xmlDocPtr ret_val;
14875    xmlSAXHandlerPtr sax; /* the SAX handler block */
14876    int n_sax;
14877    const char * filename; /* the filename */
14878    int n_filename;
14879    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14880    int n_recovery;
14881
14882    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14883    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14884    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14885        mem_base = xmlMemBlocks();
14886        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14887        filename = gen_filepath(n_filename, 1);
14888        recovery = gen_int(n_recovery, 2);
14889
14890        ret_val = xmlSAXParseFile(sax, filename, recovery);
14891        desret_xmlDocPtr(ret_val);
14892        call_tests++;
14893        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14894        des_filepath(n_filename, filename, 1);
14895        des_int(n_recovery, recovery, 2);
14896        xmlResetLastError();
14897        if (mem_base != xmlMemBlocks()) {
14898            printf("Leak of %d blocks found in xmlSAXParseFile",
14899	           xmlMemBlocks() - mem_base);
14900	    test_ret++;
14901            printf(" %d", n_sax);
14902            printf(" %d", n_filename);
14903            printf(" %d", n_recovery);
14904            printf("\n");
14905        }
14906    }
14907    }
14908    }
14909    function_tests++;
14910#endif
14911#endif
14912
14913    return(test_ret);
14914}
14915
14916
14917static int
14918test_xmlSAXParseFileWithData(void) {
14919    int test_ret = 0;
14920
14921#if defined(LIBXML_SAX1_ENABLED)
14922#ifdef LIBXML_SAX1_ENABLED
14923    int mem_base;
14924    xmlDocPtr ret_val;
14925    xmlSAXHandlerPtr sax; /* the SAX handler block */
14926    int n_sax;
14927    const char * filename; /* the filename */
14928    int n_filename;
14929    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14930    int n_recovery;
14931    void * data; /* the userdata */
14932    int n_data;
14933
14934    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14935    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14936    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14937    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14938        mem_base = xmlMemBlocks();
14939        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14940        filename = gen_filepath(n_filename, 1);
14941        recovery = gen_int(n_recovery, 2);
14942        data = gen_userdata(n_data, 3);
14943
14944        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14945        desret_xmlDocPtr(ret_val);
14946        call_tests++;
14947        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14948        des_filepath(n_filename, filename, 1);
14949        des_int(n_recovery, recovery, 2);
14950        des_userdata(n_data, data, 3);
14951        xmlResetLastError();
14952        if (mem_base != xmlMemBlocks()) {
14953            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14954	           xmlMemBlocks() - mem_base);
14955	    test_ret++;
14956            printf(" %d", n_sax);
14957            printf(" %d", n_filename);
14958            printf(" %d", n_recovery);
14959            printf(" %d", n_data);
14960            printf("\n");
14961        }
14962    }
14963    }
14964    }
14965    }
14966    function_tests++;
14967#endif
14968#endif
14969
14970    return(test_ret);
14971}
14972
14973
14974static int
14975test_xmlSAXParseMemory(void) {
14976    int test_ret = 0;
14977
14978#if defined(LIBXML_SAX1_ENABLED)
14979#ifdef LIBXML_SAX1_ENABLED
14980    int mem_base;
14981    xmlDocPtr ret_val;
14982    xmlSAXHandlerPtr sax; /* the SAX handler block */
14983    int n_sax;
14984    char * buffer; /* an pointer to a char array */
14985    int n_buffer;
14986    int size; /* the size of the array */
14987    int n_size;
14988    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14989    int n_recovery;
14990
14991    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14992    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14993    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14994    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14995        mem_base = xmlMemBlocks();
14996        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14997        buffer = gen_const_char_ptr(n_buffer, 1);
14998        size = gen_int(n_size, 2);
14999        recovery = gen_int(n_recovery, 3);
15000
15001        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15002        desret_xmlDocPtr(ret_val);
15003        call_tests++;
15004        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15005        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15006        des_int(n_size, size, 2);
15007        des_int(n_recovery, recovery, 3);
15008        xmlResetLastError();
15009        if (mem_base != xmlMemBlocks()) {
15010            printf("Leak of %d blocks found in xmlSAXParseMemory",
15011	           xmlMemBlocks() - mem_base);
15012	    test_ret++;
15013            printf(" %d", n_sax);
15014            printf(" %d", n_buffer);
15015            printf(" %d", n_size);
15016            printf(" %d", n_recovery);
15017            printf("\n");
15018        }
15019    }
15020    }
15021    }
15022    }
15023    function_tests++;
15024#endif
15025#endif
15026
15027    return(test_ret);
15028}
15029
15030
15031static int
15032test_xmlSAXParseMemoryWithData(void) {
15033    int test_ret = 0;
15034
15035#if defined(LIBXML_SAX1_ENABLED)
15036#ifdef LIBXML_SAX1_ENABLED
15037    int mem_base;
15038    xmlDocPtr ret_val;
15039    xmlSAXHandlerPtr sax; /* the SAX handler block */
15040    int n_sax;
15041    char * buffer; /* an pointer to a char array */
15042    int n_buffer;
15043    int size; /* the size of the array */
15044    int n_size;
15045    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15046    int n_recovery;
15047    void * data; /* the userdata */
15048    int n_data;
15049
15050    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15051    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15052    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15053    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15054    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15055        mem_base = xmlMemBlocks();
15056        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15057        buffer = gen_const_char_ptr(n_buffer, 1);
15058        size = gen_int(n_size, 2);
15059        recovery = gen_int(n_recovery, 3);
15060        data = gen_userdata(n_data, 4);
15061
15062        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15063        desret_xmlDocPtr(ret_val);
15064        call_tests++;
15065        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15066        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15067        des_int(n_size, size, 2);
15068        des_int(n_recovery, recovery, 3);
15069        des_userdata(n_data, data, 4);
15070        xmlResetLastError();
15071        if (mem_base != xmlMemBlocks()) {
15072            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15073	           xmlMemBlocks() - mem_base);
15074	    test_ret++;
15075            printf(" %d", n_sax);
15076            printf(" %d", n_buffer);
15077            printf(" %d", n_size);
15078            printf(" %d", n_recovery);
15079            printf(" %d", n_data);
15080            printf("\n");
15081        }
15082    }
15083    }
15084    }
15085    }
15086    }
15087    function_tests++;
15088#endif
15089#endif
15090
15091    return(test_ret);
15092}
15093
15094
15095static int
15096test_xmlSAXUserParseFile(void) {
15097    int test_ret = 0;
15098
15099#if defined(LIBXML_SAX1_ENABLED)
15100#ifdef LIBXML_SAX1_ENABLED
15101    int mem_base;
15102    int ret_val;
15103    xmlSAXHandlerPtr sax; /* a SAX handler */
15104    int n_sax;
15105    void * user_data; /* The user data returned on SAX callbacks */
15106    int n_user_data;
15107    const char * filename; /* a file name */
15108    int n_filename;
15109
15110    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15111    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15112    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15113        mem_base = xmlMemBlocks();
15114        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15115        user_data = gen_userdata(n_user_data, 1);
15116        filename = gen_filepath(n_filename, 2);
15117
15118#ifdef LIBXML_SAX1_ENABLED
15119        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15120#endif
15121
15122
15123        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15124        desret_int(ret_val);
15125        call_tests++;
15126        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15127        des_userdata(n_user_data, user_data, 1);
15128        des_filepath(n_filename, filename, 2);
15129        xmlResetLastError();
15130        if (mem_base != xmlMemBlocks()) {
15131            printf("Leak of %d blocks found in xmlSAXUserParseFile",
15132	           xmlMemBlocks() - mem_base);
15133	    test_ret++;
15134            printf(" %d", n_sax);
15135            printf(" %d", n_user_data);
15136            printf(" %d", n_filename);
15137            printf("\n");
15138        }
15139    }
15140    }
15141    }
15142    function_tests++;
15143#endif
15144#endif
15145
15146    return(test_ret);
15147}
15148
15149
15150static int
15151test_xmlSAXUserParseMemory(void) {
15152    int test_ret = 0;
15153
15154#if defined(LIBXML_SAX1_ENABLED)
15155#ifdef LIBXML_SAX1_ENABLED
15156    int mem_base;
15157    int ret_val;
15158    xmlSAXHandlerPtr sax; /* a SAX handler */
15159    int n_sax;
15160    void * user_data; /* The user data returned on SAX callbacks */
15161    int n_user_data;
15162    char * buffer; /* an in-memory XML document input */
15163    int n_buffer;
15164    int size; /* the length of the XML document in bytes */
15165    int n_size;
15166
15167    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15168    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15169    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15170    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15171        mem_base = xmlMemBlocks();
15172        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15173        user_data = gen_userdata(n_user_data, 1);
15174        buffer = gen_const_char_ptr(n_buffer, 2);
15175        size = gen_int(n_size, 3);
15176
15177#ifdef LIBXML_SAX1_ENABLED
15178        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15179#endif
15180
15181
15182        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15183        desret_int(ret_val);
15184        call_tests++;
15185        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15186        des_userdata(n_user_data, user_data, 1);
15187        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15188        des_int(n_size, size, 3);
15189        xmlResetLastError();
15190        if (mem_base != xmlMemBlocks()) {
15191            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15192	           xmlMemBlocks() - mem_base);
15193	    test_ret++;
15194            printf(" %d", n_sax);
15195            printf(" %d", n_user_data);
15196            printf(" %d", n_buffer);
15197            printf(" %d", n_size);
15198            printf("\n");
15199        }
15200    }
15201    }
15202    }
15203    }
15204    function_tests++;
15205#endif
15206#endif
15207
15208    return(test_ret);
15209}
15210
15211
15212static int
15213test_xmlSetExternalEntityLoader(void) {
15214    int test_ret = 0;
15215
15216
15217    /* missing type support */
15218    return(test_ret);
15219}
15220
15221
15222static int
15223test_xmlSetFeature(void) {
15224    int test_ret = 0;
15225
15226#if defined(LIBXML_LEGACY_ENABLED)
15227#ifdef LIBXML_LEGACY_ENABLED
15228    int mem_base;
15229    int ret_val;
15230    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15231    int n_ctxt;
15232    char * name; /* the feature name */
15233    int n_name;
15234    void * value; /* pointer to the location of the new value */
15235    int n_value;
15236
15237    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15238    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15239    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15240        mem_base = xmlMemBlocks();
15241        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15242        name = gen_const_char_ptr(n_name, 1);
15243        value = gen_void_ptr(n_value, 2);
15244
15245        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15246        desret_int(ret_val);
15247        call_tests++;
15248        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15249        des_const_char_ptr(n_name, (const char *)name, 1);
15250        des_void_ptr(n_value, value, 2);
15251        xmlResetLastError();
15252        if (mem_base != xmlMemBlocks()) {
15253            printf("Leak of %d blocks found in xmlSetFeature",
15254	           xmlMemBlocks() - mem_base);
15255	    test_ret++;
15256            printf(" %d", n_ctxt);
15257            printf(" %d", n_name);
15258            printf(" %d", n_value);
15259            printf("\n");
15260        }
15261    }
15262    }
15263    }
15264    function_tests++;
15265#endif
15266#endif
15267
15268    return(test_ret);
15269}
15270
15271
15272static int
15273test_xmlSetupParserForBuffer(void) {
15274    int test_ret = 0;
15275
15276#if defined(LIBXML_SAX1_ENABLED)
15277#ifdef LIBXML_SAX1_ENABLED
15278    int mem_base;
15279    xmlParserCtxtPtr ctxt; /* an XML parser context */
15280    int n_ctxt;
15281    xmlChar * buffer; /* a xmlChar * buffer */
15282    int n_buffer;
15283    const char * filename; /* a file name */
15284    int n_filename;
15285
15286    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15287    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15288    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15289        mem_base = xmlMemBlocks();
15290        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15291        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15292        filename = gen_filepath(n_filename, 2);
15293
15294        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15295        call_tests++;
15296        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15297        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15298        des_filepath(n_filename, filename, 2);
15299        xmlResetLastError();
15300        if (mem_base != xmlMemBlocks()) {
15301            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15302	           xmlMemBlocks() - mem_base);
15303	    test_ret++;
15304            printf(" %d", n_ctxt);
15305            printf(" %d", n_buffer);
15306            printf(" %d", n_filename);
15307            printf("\n");
15308        }
15309    }
15310    }
15311    }
15312    function_tests++;
15313#endif
15314#endif
15315
15316    return(test_ret);
15317}
15318
15319
15320static int
15321test_xmlStopParser(void) {
15322    int test_ret = 0;
15323
15324#ifdef LIBXML_PUSH_ENABLED
15325    int mem_base;
15326    xmlParserCtxtPtr ctxt; /* an XML parser context */
15327    int n_ctxt;
15328
15329    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15330        mem_base = xmlMemBlocks();
15331        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15332
15333        xmlStopParser(ctxt);
15334        call_tests++;
15335        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15336        xmlResetLastError();
15337        if (mem_base != xmlMemBlocks()) {
15338            printf("Leak of %d blocks found in xmlStopParser",
15339	           xmlMemBlocks() - mem_base);
15340	    test_ret++;
15341            printf(" %d", n_ctxt);
15342            printf("\n");
15343        }
15344    }
15345    function_tests++;
15346#endif
15347
15348    return(test_ret);
15349}
15350
15351
15352static int
15353test_xmlSubstituteEntitiesDefault(void) {
15354    int test_ret = 0;
15355
15356    int mem_base;
15357    int ret_val;
15358    int val; /* int 0 or 1 */
15359    int n_val;
15360
15361    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15362        mem_base = xmlMemBlocks();
15363        val = gen_int(n_val, 0);
15364
15365        ret_val = xmlSubstituteEntitiesDefault(val);
15366        desret_int(ret_val);
15367        call_tests++;
15368        des_int(n_val, val, 0);
15369        xmlResetLastError();
15370        if (mem_base != xmlMemBlocks()) {
15371            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15372	           xmlMemBlocks() - mem_base);
15373	    test_ret++;
15374            printf(" %d", n_val);
15375            printf("\n");
15376        }
15377    }
15378    function_tests++;
15379
15380    return(test_ret);
15381}
15382
15383static int
15384test_parser(void) {
15385    int test_ret = 0;
15386
15387    if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15388    test_ret += test_xmlByteConsumed();
15389    test_ret += test_xmlClearNodeInfoSeq();
15390    test_ret += test_xmlClearParserCtxt();
15391    test_ret += test_xmlCreateDocParserCtxt();
15392    test_ret += test_xmlCreatePushParserCtxt();
15393    test_ret += test_xmlCtxtReadDoc();
15394    test_ret += test_xmlCtxtReadFile();
15395    test_ret += test_xmlCtxtReadMemory();
15396    test_ret += test_xmlCtxtReset();
15397    test_ret += test_xmlCtxtResetPush();
15398    test_ret += test_xmlCtxtUseOptions();
15399    test_ret += test_xmlGetExternalEntityLoader();
15400    test_ret += test_xmlGetFeature();
15401    test_ret += test_xmlGetFeaturesList();
15402    test_ret += test_xmlHasFeature();
15403    test_ret += test_xmlIOParseDTD();
15404    test_ret += test_xmlInitNodeInfoSeq();
15405    test_ret += test_xmlInitParser();
15406    test_ret += test_xmlInitParserCtxt();
15407    test_ret += test_xmlKeepBlanksDefault();
15408    test_ret += test_xmlLineNumbersDefault();
15409    test_ret += test_xmlLoadExternalEntity();
15410    test_ret += test_xmlNewIOInputStream();
15411    test_ret += test_xmlNewParserCtxt();
15412    test_ret += test_xmlParseBalancedChunkMemory();
15413    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15414    test_ret += test_xmlParseChunk();
15415    test_ret += test_xmlParseCtxtExternalEntity();
15416    test_ret += test_xmlParseDTD();
15417    test_ret += test_xmlParseDoc();
15418    test_ret += test_xmlParseDocument();
15419    test_ret += test_xmlParseEntity();
15420    test_ret += test_xmlParseExtParsedEnt();
15421    test_ret += test_xmlParseExternalEntity();
15422    test_ret += test_xmlParseFile();
15423    test_ret += test_xmlParseInNodeContext();
15424    test_ret += test_xmlParseMemory();
15425    test_ret += test_xmlParserAddNodeInfo();
15426    test_ret += test_xmlParserFindNodeInfo();
15427    test_ret += test_xmlParserFindNodeInfoIndex();
15428    test_ret += test_xmlParserInputGrow();
15429    test_ret += test_xmlParserInputRead();
15430    test_ret += test_xmlPedanticParserDefault();
15431    test_ret += test_xmlReadDoc();
15432    test_ret += test_xmlReadFile();
15433    test_ret += test_xmlReadMemory();
15434    test_ret += test_xmlRecoverDoc();
15435    test_ret += test_xmlRecoverFile();
15436    test_ret += test_xmlRecoverMemory();
15437    test_ret += test_xmlSAXParseDTD();
15438    test_ret += test_xmlSAXParseDoc();
15439    test_ret += test_xmlSAXParseEntity();
15440    test_ret += test_xmlSAXParseFile();
15441    test_ret += test_xmlSAXParseFileWithData();
15442    test_ret += test_xmlSAXParseMemory();
15443    test_ret += test_xmlSAXParseMemoryWithData();
15444    test_ret += test_xmlSAXUserParseFile();
15445    test_ret += test_xmlSAXUserParseMemory();
15446    test_ret += test_xmlSetExternalEntityLoader();
15447    test_ret += test_xmlSetFeature();
15448    test_ret += test_xmlSetupParserForBuffer();
15449    test_ret += test_xmlStopParser();
15450    test_ret += test_xmlSubstituteEntitiesDefault();
15451
15452    if (test_ret != 0)
15453	printf("Module parser: %d errors\n", test_ret);
15454    return(test_ret);
15455}
15456
15457static int
15458test_htmlCreateFileParserCtxt(void) {
15459    int test_ret = 0;
15460
15461#if defined(LIBXML_HTML_ENABLED)
15462    int mem_base;
15463    htmlParserCtxtPtr ret_val;
15464    const char * filename; /* the filename */
15465    int n_filename;
15466    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15467    int n_encoding;
15468
15469    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15470    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15471        mem_base = xmlMemBlocks();
15472        filename = gen_fileoutput(n_filename, 0);
15473        encoding = gen_const_char_ptr(n_encoding, 1);
15474
15475        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15476        desret_htmlParserCtxtPtr(ret_val);
15477        call_tests++;
15478        des_fileoutput(n_filename, filename, 0);
15479        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15480        xmlResetLastError();
15481        if (mem_base != xmlMemBlocks()) {
15482            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15483	           xmlMemBlocks() - mem_base);
15484	    test_ret++;
15485            printf(" %d", n_filename);
15486            printf(" %d", n_encoding);
15487            printf("\n");
15488        }
15489    }
15490    }
15491    function_tests++;
15492#endif
15493
15494    return(test_ret);
15495}
15496
15497
15498static int
15499test_htmlInitAutoClose(void) {
15500    int test_ret = 0;
15501
15502#if defined(LIBXML_HTML_ENABLED)
15503    int mem_base;
15504
15505        mem_base = xmlMemBlocks();
15506
15507        htmlInitAutoClose();
15508        call_tests++;
15509        xmlResetLastError();
15510        if (mem_base != xmlMemBlocks()) {
15511            printf("Leak of %d blocks found in htmlInitAutoClose",
15512	           xmlMemBlocks() - mem_base);
15513	    test_ret++;
15514            printf("\n");
15515        }
15516    function_tests++;
15517#endif
15518
15519    return(test_ret);
15520}
15521
15522
15523static int
15524test_inputPop(void) {
15525    int test_ret = 0;
15526
15527    int mem_base;
15528    xmlParserInputPtr ret_val;
15529    xmlParserCtxtPtr ctxt; /* an XML parser context */
15530    int n_ctxt;
15531
15532    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15533        mem_base = xmlMemBlocks();
15534        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15535
15536        ret_val = inputPop(ctxt);
15537        desret_xmlParserInputPtr(ret_val);
15538        call_tests++;
15539        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15540        xmlResetLastError();
15541        if (mem_base != xmlMemBlocks()) {
15542            printf("Leak of %d blocks found in inputPop",
15543	           xmlMemBlocks() - mem_base);
15544	    test_ret++;
15545            printf(" %d", n_ctxt);
15546            printf("\n");
15547        }
15548    }
15549    function_tests++;
15550
15551    return(test_ret);
15552}
15553
15554
15555static int
15556test_inputPush(void) {
15557    int test_ret = 0;
15558
15559    int mem_base;
15560    int ret_val;
15561    xmlParserCtxtPtr ctxt; /* an XML parser context */
15562    int n_ctxt;
15563    xmlParserInputPtr value; /* the parser input */
15564    int n_value;
15565
15566    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15567    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15568        mem_base = xmlMemBlocks();
15569        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15570        value = gen_xmlParserInputPtr(n_value, 1);
15571
15572        ret_val = inputPush(ctxt, value);
15573        desret_int(ret_val);
15574        call_tests++;
15575        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15576        des_xmlParserInputPtr(n_value, value, 1);
15577        xmlResetLastError();
15578        if (mem_base != xmlMemBlocks()) {
15579            printf("Leak of %d blocks found in inputPush",
15580	           xmlMemBlocks() - mem_base);
15581	    test_ret++;
15582            printf(" %d", n_ctxt);
15583            printf(" %d", n_value);
15584            printf("\n");
15585        }
15586    }
15587    }
15588    function_tests++;
15589
15590    return(test_ret);
15591}
15592
15593
15594static int
15595test_namePop(void) {
15596    int test_ret = 0;
15597
15598    int mem_base;
15599    const xmlChar * ret_val;
15600    xmlParserCtxtPtr ctxt; /* an XML parser context */
15601    int n_ctxt;
15602
15603    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15604        mem_base = xmlMemBlocks();
15605        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15606
15607        ret_val = namePop(ctxt);
15608        desret_const_xmlChar_ptr(ret_val);
15609        call_tests++;
15610        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15611        xmlResetLastError();
15612        if (mem_base != xmlMemBlocks()) {
15613            printf("Leak of %d blocks found in namePop",
15614	           xmlMemBlocks() - mem_base);
15615	    test_ret++;
15616            printf(" %d", n_ctxt);
15617            printf("\n");
15618        }
15619    }
15620    function_tests++;
15621
15622    return(test_ret);
15623}
15624
15625
15626static int
15627test_namePush(void) {
15628    int test_ret = 0;
15629
15630    int mem_base;
15631    int ret_val;
15632    xmlParserCtxtPtr ctxt; /* an XML parser context */
15633    int n_ctxt;
15634    xmlChar * value; /* the element name */
15635    int n_value;
15636
15637    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15638    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15639        mem_base = xmlMemBlocks();
15640        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15641        value = gen_const_xmlChar_ptr(n_value, 1);
15642
15643        ret_val = namePush(ctxt, (const xmlChar *)value);
15644        desret_int(ret_val);
15645        call_tests++;
15646        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15647        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15648        xmlResetLastError();
15649        if (mem_base != xmlMemBlocks()) {
15650            printf("Leak of %d blocks found in namePush",
15651	           xmlMemBlocks() - mem_base);
15652	    test_ret++;
15653            printf(" %d", n_ctxt);
15654            printf(" %d", n_value);
15655            printf("\n");
15656        }
15657    }
15658    }
15659    function_tests++;
15660
15661    return(test_ret);
15662}
15663
15664
15665static int
15666test_nodePop(void) {
15667    int test_ret = 0;
15668
15669    int mem_base;
15670    xmlNodePtr ret_val;
15671    xmlParserCtxtPtr ctxt; /* an XML parser context */
15672    int n_ctxt;
15673
15674    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15675        mem_base = xmlMemBlocks();
15676        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15677
15678        ret_val = nodePop(ctxt);
15679        desret_xmlNodePtr(ret_val);
15680        call_tests++;
15681        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15682        xmlResetLastError();
15683        if (mem_base != xmlMemBlocks()) {
15684            printf("Leak of %d blocks found in nodePop",
15685	           xmlMemBlocks() - mem_base);
15686	    test_ret++;
15687            printf(" %d", n_ctxt);
15688            printf("\n");
15689        }
15690    }
15691    function_tests++;
15692
15693    return(test_ret);
15694}
15695
15696
15697static int
15698test_nodePush(void) {
15699    int test_ret = 0;
15700
15701    int mem_base;
15702    int ret_val;
15703    xmlParserCtxtPtr ctxt; /* an XML parser context */
15704    int n_ctxt;
15705    xmlNodePtr value; /* the element node */
15706    int n_value;
15707
15708    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15709    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15710        mem_base = xmlMemBlocks();
15711        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15712        value = gen_xmlNodePtr(n_value, 1);
15713
15714        ret_val = nodePush(ctxt, value);
15715        desret_int(ret_val);
15716        call_tests++;
15717        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15718        des_xmlNodePtr(n_value, value, 1);
15719        xmlResetLastError();
15720        if (mem_base != xmlMemBlocks()) {
15721            printf("Leak of %d blocks found in nodePush",
15722	           xmlMemBlocks() - mem_base);
15723	    test_ret++;
15724            printf(" %d", n_ctxt);
15725            printf(" %d", n_value);
15726            printf("\n");
15727        }
15728    }
15729    }
15730    function_tests++;
15731
15732    return(test_ret);
15733}
15734
15735
15736static int
15737test_xmlCheckLanguageID(void) {
15738    int test_ret = 0;
15739
15740    int mem_base;
15741    int ret_val;
15742    xmlChar * lang; /* pointer to the string value */
15743    int n_lang;
15744
15745    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15746        mem_base = xmlMemBlocks();
15747        lang = gen_const_xmlChar_ptr(n_lang, 0);
15748
15749        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15750        desret_int(ret_val);
15751        call_tests++;
15752        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15753        xmlResetLastError();
15754        if (mem_base != xmlMemBlocks()) {
15755            printf("Leak of %d blocks found in xmlCheckLanguageID",
15756	           xmlMemBlocks() - mem_base);
15757	    test_ret++;
15758            printf(" %d", n_lang);
15759            printf("\n");
15760        }
15761    }
15762    function_tests++;
15763
15764    return(test_ret);
15765}
15766
15767
15768static int
15769test_xmlCopyChar(void) {
15770    int test_ret = 0;
15771
15772    int mem_base;
15773    int ret_val;
15774    int len; /* Ignored, compatibility */
15775    int n_len;
15776    xmlChar * out; /* pointer to an array of xmlChar */
15777    int n_out;
15778    int val; /* the char value */
15779    int n_val;
15780
15781    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15782    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15783    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15784        mem_base = xmlMemBlocks();
15785        len = gen_int(n_len, 0);
15786        out = gen_xmlChar_ptr(n_out, 1);
15787        val = gen_int(n_val, 2);
15788
15789        ret_val = xmlCopyChar(len, out, val);
15790        desret_int(ret_val);
15791        call_tests++;
15792        des_int(n_len, len, 0);
15793        des_xmlChar_ptr(n_out, out, 1);
15794        des_int(n_val, val, 2);
15795        xmlResetLastError();
15796        if (mem_base != xmlMemBlocks()) {
15797            printf("Leak of %d blocks found in xmlCopyChar",
15798	           xmlMemBlocks() - mem_base);
15799	    test_ret++;
15800            printf(" %d", n_len);
15801            printf(" %d", n_out);
15802            printf(" %d", n_val);
15803            printf("\n");
15804        }
15805    }
15806    }
15807    }
15808    function_tests++;
15809
15810    return(test_ret);
15811}
15812
15813
15814static int
15815test_xmlCopyCharMultiByte(void) {
15816    int test_ret = 0;
15817
15818    int mem_base;
15819    int ret_val;
15820    xmlChar * out; /* pointer to an array of xmlChar */
15821    int n_out;
15822    int val; /* the char value */
15823    int n_val;
15824
15825    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15826    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15827        mem_base = xmlMemBlocks();
15828        out = gen_xmlChar_ptr(n_out, 0);
15829        val = gen_int(n_val, 1);
15830
15831        ret_val = xmlCopyCharMultiByte(out, val);
15832        desret_int(ret_val);
15833        call_tests++;
15834        des_xmlChar_ptr(n_out, out, 0);
15835        des_int(n_val, val, 1);
15836        xmlResetLastError();
15837        if (mem_base != xmlMemBlocks()) {
15838            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15839	           xmlMemBlocks() - mem_base);
15840	    test_ret++;
15841            printf(" %d", n_out);
15842            printf(" %d", n_val);
15843            printf("\n");
15844        }
15845    }
15846    }
15847    function_tests++;
15848
15849    return(test_ret);
15850}
15851
15852
15853static int
15854test_xmlCreateEntityParserCtxt(void) {
15855    int test_ret = 0;
15856
15857    int mem_base;
15858    xmlParserCtxtPtr ret_val;
15859    xmlChar * URL; /* the entity URL */
15860    int n_URL;
15861    xmlChar * ID; /* the entity PUBLIC ID */
15862    int n_ID;
15863    xmlChar * base; /* a possible base for the target URI */
15864    int n_base;
15865
15866    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15867    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15868    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15869        mem_base = xmlMemBlocks();
15870        URL = gen_const_xmlChar_ptr(n_URL, 0);
15871        ID = gen_const_xmlChar_ptr(n_ID, 1);
15872        base = gen_const_xmlChar_ptr(n_base, 2);
15873
15874        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15875        desret_xmlParserCtxtPtr(ret_val);
15876        call_tests++;
15877        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15878        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15879        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15880        xmlResetLastError();
15881        if (mem_base != xmlMemBlocks()) {
15882            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15883	           xmlMemBlocks() - mem_base);
15884	    test_ret++;
15885            printf(" %d", n_URL);
15886            printf(" %d", n_ID);
15887            printf(" %d", n_base);
15888            printf("\n");
15889        }
15890    }
15891    }
15892    }
15893    function_tests++;
15894
15895    return(test_ret);
15896}
15897
15898
15899static int
15900test_xmlCreateFileParserCtxt(void) {
15901    int test_ret = 0;
15902
15903    int mem_base;
15904    xmlParserCtxtPtr ret_val;
15905    const char * filename; /* the filename */
15906    int n_filename;
15907
15908    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15909        mem_base = xmlMemBlocks();
15910        filename = gen_fileoutput(n_filename, 0);
15911
15912        ret_val = xmlCreateFileParserCtxt(filename);
15913        desret_xmlParserCtxtPtr(ret_val);
15914        call_tests++;
15915        des_fileoutput(n_filename, filename, 0);
15916        xmlResetLastError();
15917        if (mem_base != xmlMemBlocks()) {
15918            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15919	           xmlMemBlocks() - mem_base);
15920	    test_ret++;
15921            printf(" %d", n_filename);
15922            printf("\n");
15923        }
15924    }
15925    function_tests++;
15926
15927    return(test_ret);
15928}
15929
15930
15931static int
15932test_xmlCreateMemoryParserCtxt(void) {
15933    int test_ret = 0;
15934
15935    int mem_base;
15936    xmlParserCtxtPtr ret_val;
15937    char * buffer; /* a pointer to a char array */
15938    int n_buffer;
15939    int size; /* the size of the array */
15940    int n_size;
15941
15942    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15943    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15944        mem_base = xmlMemBlocks();
15945        buffer = gen_const_char_ptr(n_buffer, 0);
15946        size = gen_int(n_size, 1);
15947
15948        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15949        desret_xmlParserCtxtPtr(ret_val);
15950        call_tests++;
15951        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15952        des_int(n_size, size, 1);
15953        xmlResetLastError();
15954        if (mem_base != xmlMemBlocks()) {
15955            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15956	           xmlMemBlocks() - mem_base);
15957	    test_ret++;
15958            printf(" %d", n_buffer);
15959            printf(" %d", n_size);
15960            printf("\n");
15961        }
15962    }
15963    }
15964    function_tests++;
15965
15966    return(test_ret);
15967}
15968
15969
15970static int
15971test_xmlCreateURLParserCtxt(void) {
15972    int test_ret = 0;
15973
15974    int mem_base;
15975    xmlParserCtxtPtr ret_val;
15976    const char * filename; /* the filename or URL */
15977    int n_filename;
15978    int options; /* a combination of xmlParserOption */
15979    int n_options;
15980
15981    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15982    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15983        mem_base = xmlMemBlocks();
15984        filename = gen_fileoutput(n_filename, 0);
15985        options = gen_int(n_options, 1);
15986
15987        ret_val = xmlCreateURLParserCtxt(filename, options);
15988        desret_xmlParserCtxtPtr(ret_val);
15989        call_tests++;
15990        des_fileoutput(n_filename, filename, 0);
15991        des_int(n_options, options, 1);
15992        xmlResetLastError();
15993        if (mem_base != xmlMemBlocks()) {
15994            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15995	           xmlMemBlocks() - mem_base);
15996	    test_ret++;
15997            printf(" %d", n_filename);
15998            printf(" %d", n_options);
15999            printf("\n");
16000        }
16001    }
16002    }
16003    function_tests++;
16004
16005    return(test_ret);
16006}
16007
16008
16009static int
16010test_xmlCurrentChar(void) {
16011    int test_ret = 0;
16012
16013    int mem_base;
16014    int ret_val;
16015    xmlParserCtxtPtr ctxt; /* the XML parser context */
16016    int n_ctxt;
16017    int * len; /* pointer to the length of the char read */
16018    int n_len;
16019
16020    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16021    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16022        mem_base = xmlMemBlocks();
16023        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16024        len = gen_int_ptr(n_len, 1);
16025
16026        ret_val = xmlCurrentChar(ctxt, len);
16027        desret_int(ret_val);
16028        call_tests++;
16029        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16030        des_int_ptr(n_len, len, 1);
16031        xmlResetLastError();
16032        if (mem_base != xmlMemBlocks()) {
16033            printf("Leak of %d blocks found in xmlCurrentChar",
16034	           xmlMemBlocks() - mem_base);
16035	    test_ret++;
16036            printf(" %d", n_ctxt);
16037            printf(" %d", n_len);
16038            printf("\n");
16039        }
16040    }
16041    }
16042    function_tests++;
16043
16044    return(test_ret);
16045}
16046
16047
16048static int
16049test_xmlErrMemory(void) {
16050    int test_ret = 0;
16051
16052    int mem_base;
16053    xmlParserCtxtPtr ctxt; /* an XML parser context */
16054    int n_ctxt;
16055    char * extra; /* extra informations */
16056    int n_extra;
16057
16058    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16059    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16060        mem_base = xmlMemBlocks();
16061        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16062        extra = gen_const_char_ptr(n_extra, 1);
16063
16064        xmlErrMemory(ctxt, (const char *)extra);
16065        call_tests++;
16066        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16067        des_const_char_ptr(n_extra, (const char *)extra, 1);
16068        xmlResetLastError();
16069        if (mem_base != xmlMemBlocks()) {
16070            printf("Leak of %d blocks found in xmlErrMemory",
16071	           xmlMemBlocks() - mem_base);
16072	    test_ret++;
16073            printf(" %d", n_ctxt);
16074            printf(" %d", n_extra);
16075            printf("\n");
16076        }
16077    }
16078    }
16079    function_tests++;
16080
16081    return(test_ret);
16082}
16083
16084
16085static int
16086test_xmlIsLetter(void) {
16087    int test_ret = 0;
16088
16089    int mem_base;
16090    int ret_val;
16091    int c; /* an unicode character (int) */
16092    int n_c;
16093
16094    for (n_c = 0;n_c < gen_nb_int;n_c++) {
16095        mem_base = xmlMemBlocks();
16096        c = gen_int(n_c, 0);
16097
16098        ret_val = xmlIsLetter(c);
16099        desret_int(ret_val);
16100        call_tests++;
16101        des_int(n_c, c, 0);
16102        xmlResetLastError();
16103        if (mem_base != xmlMemBlocks()) {
16104            printf("Leak of %d blocks found in xmlIsLetter",
16105	           xmlMemBlocks() - mem_base);
16106	    test_ret++;
16107            printf(" %d", n_c);
16108            printf("\n");
16109        }
16110    }
16111    function_tests++;
16112
16113    return(test_ret);
16114}
16115
16116
16117static int
16118test_xmlNewEntityInputStream(void) {
16119    int test_ret = 0;
16120
16121    int mem_base;
16122    xmlParserInputPtr ret_val;
16123    xmlParserCtxtPtr ctxt; /* an XML parser context */
16124    int n_ctxt;
16125    xmlEntityPtr entity; /* an Entity pointer */
16126    int n_entity;
16127
16128    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16129    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16130        mem_base = xmlMemBlocks();
16131        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16132        entity = gen_xmlEntityPtr(n_entity, 1);
16133
16134        ret_val = xmlNewEntityInputStream(ctxt, entity);
16135        desret_xmlParserInputPtr(ret_val);
16136        call_tests++;
16137        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16138        des_xmlEntityPtr(n_entity, entity, 1);
16139        xmlResetLastError();
16140        if (mem_base != xmlMemBlocks()) {
16141            printf("Leak of %d blocks found in xmlNewEntityInputStream",
16142	           xmlMemBlocks() - mem_base);
16143	    test_ret++;
16144            printf(" %d", n_ctxt);
16145            printf(" %d", n_entity);
16146            printf("\n");
16147        }
16148    }
16149    }
16150    function_tests++;
16151
16152    return(test_ret);
16153}
16154
16155
16156static int
16157test_xmlNewInputFromFile(void) {
16158    int test_ret = 0;
16159
16160    int mem_base;
16161    xmlParserInputPtr ret_val;
16162    xmlParserCtxtPtr ctxt; /* an XML parser context */
16163    int n_ctxt;
16164    const char * filename; /* the filename to use as entity */
16165    int n_filename;
16166
16167    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16168    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16169        mem_base = xmlMemBlocks();
16170        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16171        filename = gen_filepath(n_filename, 1);
16172
16173        ret_val = xmlNewInputFromFile(ctxt, filename);
16174        desret_xmlParserInputPtr(ret_val);
16175        call_tests++;
16176        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16177        des_filepath(n_filename, filename, 1);
16178        xmlResetLastError();
16179        if (mem_base != xmlMemBlocks()) {
16180            printf("Leak of %d blocks found in xmlNewInputFromFile",
16181	           xmlMemBlocks() - mem_base);
16182	    test_ret++;
16183            printf(" %d", n_ctxt);
16184            printf(" %d", n_filename);
16185            printf("\n");
16186        }
16187    }
16188    }
16189    function_tests++;
16190
16191    return(test_ret);
16192}
16193
16194
16195static int
16196test_xmlNewInputStream(void) {
16197    int test_ret = 0;
16198
16199    int mem_base;
16200    xmlParserInputPtr ret_val;
16201    xmlParserCtxtPtr ctxt; /* an XML parser context */
16202    int n_ctxt;
16203
16204    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16205        mem_base = xmlMemBlocks();
16206        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16207
16208        ret_val = xmlNewInputStream(ctxt);
16209        desret_xmlParserInputPtr(ret_val);
16210        call_tests++;
16211        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16212        xmlResetLastError();
16213        if (mem_base != xmlMemBlocks()) {
16214            printf("Leak of %d blocks found in xmlNewInputStream",
16215	           xmlMemBlocks() - mem_base);
16216	    test_ret++;
16217            printf(" %d", n_ctxt);
16218            printf("\n");
16219        }
16220    }
16221    function_tests++;
16222
16223    return(test_ret);
16224}
16225
16226
16227static int
16228test_xmlNewStringInputStream(void) {
16229    int test_ret = 0;
16230
16231    int mem_base;
16232    xmlParserInputPtr ret_val;
16233    xmlParserCtxtPtr ctxt; /* an XML parser context */
16234    int n_ctxt;
16235    xmlChar * buffer; /* an memory buffer */
16236    int n_buffer;
16237
16238    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16239    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16240        mem_base = xmlMemBlocks();
16241        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16242        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16243
16244        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16245        desret_xmlParserInputPtr(ret_val);
16246        call_tests++;
16247        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16248        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16249        xmlResetLastError();
16250        if (mem_base != xmlMemBlocks()) {
16251            printf("Leak of %d blocks found in xmlNewStringInputStream",
16252	           xmlMemBlocks() - mem_base);
16253	    test_ret++;
16254            printf(" %d", n_ctxt);
16255            printf(" %d", n_buffer);
16256            printf("\n");
16257        }
16258    }
16259    }
16260    function_tests++;
16261
16262    return(test_ret);
16263}
16264
16265
16266static int
16267test_xmlNextChar(void) {
16268    int test_ret = 0;
16269
16270    int mem_base;
16271    xmlParserCtxtPtr ctxt; /* the XML parser context */
16272    int n_ctxt;
16273
16274    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16275        mem_base = xmlMemBlocks();
16276        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16277
16278        xmlNextChar(ctxt);
16279        call_tests++;
16280        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16281        xmlResetLastError();
16282        if (mem_base != xmlMemBlocks()) {
16283            printf("Leak of %d blocks found in xmlNextChar",
16284	           xmlMemBlocks() - mem_base);
16285	    test_ret++;
16286            printf(" %d", n_ctxt);
16287            printf("\n");
16288        }
16289    }
16290    function_tests++;
16291
16292    return(test_ret);
16293}
16294
16295
16296static int
16297test_xmlParserInputShrink(void) {
16298    int test_ret = 0;
16299
16300    int mem_base;
16301    xmlParserInputPtr in; /* an XML parser input */
16302    int n_in;
16303
16304    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16305        mem_base = xmlMemBlocks();
16306        in = gen_xmlParserInputPtr(n_in, 0);
16307
16308        xmlParserInputShrink(in);
16309        call_tests++;
16310        des_xmlParserInputPtr(n_in, in, 0);
16311        xmlResetLastError();
16312        if (mem_base != xmlMemBlocks()) {
16313            printf("Leak of %d blocks found in xmlParserInputShrink",
16314	           xmlMemBlocks() - mem_base);
16315	    test_ret++;
16316            printf(" %d", n_in);
16317            printf("\n");
16318        }
16319    }
16320    function_tests++;
16321
16322    return(test_ret);
16323}
16324
16325
16326static int
16327test_xmlPopInput(void) {
16328    int test_ret = 0;
16329
16330    int mem_base;
16331    xmlChar ret_val;
16332    xmlParserCtxtPtr ctxt; /* an XML parser context */
16333    int n_ctxt;
16334
16335    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16336        mem_base = xmlMemBlocks();
16337        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16338
16339        ret_val = xmlPopInput(ctxt);
16340        desret_xmlChar(ret_val);
16341        call_tests++;
16342        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16343        xmlResetLastError();
16344        if (mem_base != xmlMemBlocks()) {
16345            printf("Leak of %d blocks found in xmlPopInput",
16346	           xmlMemBlocks() - mem_base);
16347	    test_ret++;
16348            printf(" %d", n_ctxt);
16349            printf("\n");
16350        }
16351    }
16352    function_tests++;
16353
16354    return(test_ret);
16355}
16356
16357
16358static int
16359test_xmlPushInput(void) {
16360    int test_ret = 0;
16361
16362    int mem_base;
16363    int ret_val;
16364    xmlParserCtxtPtr ctxt; /* an XML parser context */
16365    int n_ctxt;
16366    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16367    int n_input;
16368
16369    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16370    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16371        mem_base = xmlMemBlocks();
16372        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16373        input = gen_xmlParserInputPtr(n_input, 1);
16374
16375        ret_val = xmlPushInput(ctxt, input);
16376        desret_int(ret_val);
16377        call_tests++;
16378        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16379        des_xmlParserInputPtr(n_input, input, 1);
16380        xmlResetLastError();
16381        if (mem_base != xmlMemBlocks()) {
16382            printf("Leak of %d blocks found in xmlPushInput",
16383	           xmlMemBlocks() - mem_base);
16384	    test_ret++;
16385            printf(" %d", n_ctxt);
16386            printf(" %d", n_input);
16387            printf("\n");
16388        }
16389    }
16390    }
16391    function_tests++;
16392
16393    return(test_ret);
16394}
16395
16396
16397static int
16398test_xmlSetEntityReferenceFunc(void) {
16399    int test_ret = 0;
16400
16401
16402    /* missing type support */
16403    return(test_ret);
16404}
16405
16406
16407static int
16408test_xmlSplitQName(void) {
16409    int test_ret = 0;
16410
16411    int mem_base;
16412    xmlChar * ret_val;
16413    xmlParserCtxtPtr ctxt; /* an XML parser context */
16414    int n_ctxt;
16415    xmlChar * name; /* an XML parser context */
16416    int n_name;
16417    xmlChar ** prefix; /* a xmlChar ** */
16418    int n_prefix;
16419
16420    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16421    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16422    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16423        mem_base = xmlMemBlocks();
16424        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16425        name = gen_const_xmlChar_ptr(n_name, 1);
16426        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16427
16428        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16429        desret_xmlChar_ptr(ret_val);
16430        call_tests++;
16431        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16432        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16433        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16434        xmlResetLastError();
16435        if (mem_base != xmlMemBlocks()) {
16436            printf("Leak of %d blocks found in xmlSplitQName",
16437	           xmlMemBlocks() - mem_base);
16438	    test_ret++;
16439            printf(" %d", n_ctxt);
16440            printf(" %d", n_name);
16441            printf(" %d", n_prefix);
16442            printf("\n");
16443        }
16444    }
16445    }
16446    }
16447    function_tests++;
16448
16449    return(test_ret);
16450}
16451
16452
16453static int
16454test_xmlStringCurrentChar(void) {
16455    int test_ret = 0;
16456
16457    int mem_base;
16458    int ret_val;
16459    xmlParserCtxtPtr ctxt; /* the XML parser context */
16460    int n_ctxt;
16461    xmlChar * cur; /* pointer to the beginning of the char */
16462    int n_cur;
16463    int * len; /* pointer to the length of the char read */
16464    int n_len;
16465
16466    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16467    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16468    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16469        mem_base = xmlMemBlocks();
16470        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16471        cur = gen_const_xmlChar_ptr(n_cur, 1);
16472        len = gen_int_ptr(n_len, 2);
16473
16474        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16475        desret_int(ret_val);
16476        call_tests++;
16477        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16478        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16479        des_int_ptr(n_len, len, 2);
16480        xmlResetLastError();
16481        if (mem_base != xmlMemBlocks()) {
16482            printf("Leak of %d blocks found in xmlStringCurrentChar",
16483	           xmlMemBlocks() - mem_base);
16484	    test_ret++;
16485            printf(" %d", n_ctxt);
16486            printf(" %d", n_cur);
16487            printf(" %d", n_len);
16488            printf("\n");
16489        }
16490    }
16491    }
16492    }
16493    function_tests++;
16494
16495    return(test_ret);
16496}
16497
16498
16499static int
16500test_xmlStringDecodeEntities(void) {
16501    int test_ret = 0;
16502
16503    int mem_base;
16504    xmlChar * ret_val;
16505    xmlParserCtxtPtr ctxt; /* the parser context */
16506    int n_ctxt;
16507    xmlChar * str; /* the input string */
16508    int n_str;
16509    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16510    int n_what;
16511    xmlChar end; /* an end marker xmlChar, 0 if none */
16512    int n_end;
16513    xmlChar end2; /* an end marker xmlChar, 0 if none */
16514    int n_end2;
16515    xmlChar end3; /* an end marker xmlChar, 0 if none */
16516    int n_end3;
16517
16518    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16519    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16520    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16521    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16522    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16523    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16524        mem_base = xmlMemBlocks();
16525        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16526        str = gen_const_xmlChar_ptr(n_str, 1);
16527        what = gen_int(n_what, 2);
16528        end = gen_xmlChar(n_end, 3);
16529        end2 = gen_xmlChar(n_end2, 4);
16530        end3 = gen_xmlChar(n_end3, 5);
16531
16532        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16533        desret_xmlChar_ptr(ret_val);
16534        call_tests++;
16535        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16536        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16537        des_int(n_what, what, 2);
16538        des_xmlChar(n_end, end, 3);
16539        des_xmlChar(n_end2, end2, 4);
16540        des_xmlChar(n_end3, end3, 5);
16541        xmlResetLastError();
16542        if (mem_base != xmlMemBlocks()) {
16543            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16544	           xmlMemBlocks() - mem_base);
16545	    test_ret++;
16546            printf(" %d", n_ctxt);
16547            printf(" %d", n_str);
16548            printf(" %d", n_what);
16549            printf(" %d", n_end);
16550            printf(" %d", n_end2);
16551            printf(" %d", n_end3);
16552            printf("\n");
16553        }
16554    }
16555    }
16556    }
16557    }
16558    }
16559    }
16560    function_tests++;
16561
16562    return(test_ret);
16563}
16564
16565
16566static int
16567test_xmlStringLenDecodeEntities(void) {
16568    int test_ret = 0;
16569
16570    int mem_base;
16571    xmlChar * ret_val;
16572    xmlParserCtxtPtr ctxt; /* the parser context */
16573    int n_ctxt;
16574    xmlChar * str; /* the input string */
16575    int n_str;
16576    int len; /* the string length */
16577    int n_len;
16578    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16579    int n_what;
16580    xmlChar end; /* an end marker xmlChar, 0 if none */
16581    int n_end;
16582    xmlChar end2; /* an end marker xmlChar, 0 if none */
16583    int n_end2;
16584    xmlChar end3; /* an end marker xmlChar, 0 if none */
16585    int n_end3;
16586
16587    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16588    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16589    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16590    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16591    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16592    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16593    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16594        mem_base = xmlMemBlocks();
16595        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16596        str = gen_const_xmlChar_ptr(n_str, 1);
16597        len = gen_int(n_len, 2);
16598        what = gen_int(n_what, 3);
16599        end = gen_xmlChar(n_end, 4);
16600        end2 = gen_xmlChar(n_end2, 5);
16601        end3 = gen_xmlChar(n_end3, 6);
16602
16603        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16604        desret_xmlChar_ptr(ret_val);
16605        call_tests++;
16606        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16607        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16608        des_int(n_len, len, 2);
16609        des_int(n_what, what, 3);
16610        des_xmlChar(n_end, end, 4);
16611        des_xmlChar(n_end2, end2, 5);
16612        des_xmlChar(n_end3, end3, 6);
16613        xmlResetLastError();
16614        if (mem_base != xmlMemBlocks()) {
16615            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16616	           xmlMemBlocks() - mem_base);
16617	    test_ret++;
16618            printf(" %d", n_ctxt);
16619            printf(" %d", n_str);
16620            printf(" %d", n_len);
16621            printf(" %d", n_what);
16622            printf(" %d", n_end);
16623            printf(" %d", n_end2);
16624            printf(" %d", n_end3);
16625            printf("\n");
16626        }
16627    }
16628    }
16629    }
16630    }
16631    }
16632    }
16633    }
16634    function_tests++;
16635
16636    return(test_ret);
16637}
16638
16639
16640static int
16641test_xmlSwitchEncoding(void) {
16642    int test_ret = 0;
16643
16644    int mem_base;
16645    int ret_val;
16646    xmlParserCtxtPtr ctxt; /* the parser context */
16647    int n_ctxt;
16648    xmlCharEncoding enc; /* the encoding value (number) */
16649    int n_enc;
16650
16651    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16652    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16653        mem_base = xmlMemBlocks();
16654        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16655        enc = gen_xmlCharEncoding(n_enc, 1);
16656
16657        ret_val = xmlSwitchEncoding(ctxt, enc);
16658        desret_int(ret_val);
16659        call_tests++;
16660        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16661        des_xmlCharEncoding(n_enc, enc, 1);
16662        xmlResetLastError();
16663        if (mem_base != xmlMemBlocks()) {
16664            printf("Leak of %d blocks found in xmlSwitchEncoding",
16665	           xmlMemBlocks() - mem_base);
16666	    test_ret++;
16667            printf(" %d", n_ctxt);
16668            printf(" %d", n_enc);
16669            printf("\n");
16670        }
16671    }
16672    }
16673    function_tests++;
16674
16675    return(test_ret);
16676}
16677
16678
16679static int
16680test_xmlSwitchInputEncoding(void) {
16681    int test_ret = 0;
16682
16683    int mem_base;
16684    int ret_val;
16685    xmlParserCtxtPtr ctxt; /* the parser context */
16686    int n_ctxt;
16687    xmlParserInputPtr input; /* the input stream */
16688    int n_input;
16689    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16690    int n_handler;
16691
16692    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16693    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16694    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16695        mem_base = xmlMemBlocks();
16696        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16697        input = gen_xmlParserInputPtr(n_input, 1);
16698        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16699
16700        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16701        desret_int(ret_val);
16702        call_tests++;
16703        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16704        des_xmlParserInputPtr(n_input, input, 1);
16705        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16706        xmlResetLastError();
16707        if (mem_base != xmlMemBlocks()) {
16708            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16709	           xmlMemBlocks() - mem_base);
16710	    test_ret++;
16711            printf(" %d", n_ctxt);
16712            printf(" %d", n_input);
16713            printf(" %d", n_handler);
16714            printf("\n");
16715        }
16716    }
16717    }
16718    }
16719    function_tests++;
16720
16721    return(test_ret);
16722}
16723
16724
16725static int
16726test_xmlSwitchToEncoding(void) {
16727    int test_ret = 0;
16728
16729    int mem_base;
16730    int ret_val;
16731    xmlParserCtxtPtr ctxt; /* the parser context */
16732    int n_ctxt;
16733    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16734    int n_handler;
16735
16736    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16737    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16738        mem_base = xmlMemBlocks();
16739        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16740        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16741
16742        ret_val = xmlSwitchToEncoding(ctxt, handler);
16743        desret_int(ret_val);
16744        call_tests++;
16745        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16746        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16747        xmlResetLastError();
16748        if (mem_base != xmlMemBlocks()) {
16749            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16750	           xmlMemBlocks() - mem_base);
16751	    test_ret++;
16752            printf(" %d", n_ctxt);
16753            printf(" %d", n_handler);
16754            printf("\n");
16755        }
16756    }
16757    }
16758    function_tests++;
16759
16760    return(test_ret);
16761}
16762
16763static int
16764test_parserInternals(void) {
16765    int test_ret = 0;
16766
16767    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16768    test_ret += test_htmlCreateFileParserCtxt();
16769    test_ret += test_htmlInitAutoClose();
16770    test_ret += test_inputPop();
16771    test_ret += test_inputPush();
16772    test_ret += test_namePop();
16773    test_ret += test_namePush();
16774    test_ret += test_nodePop();
16775    test_ret += test_nodePush();
16776    test_ret += test_xmlCheckLanguageID();
16777    test_ret += test_xmlCopyChar();
16778    test_ret += test_xmlCopyCharMultiByte();
16779    test_ret += test_xmlCreateEntityParserCtxt();
16780    test_ret += test_xmlCreateFileParserCtxt();
16781    test_ret += test_xmlCreateMemoryParserCtxt();
16782    test_ret += test_xmlCreateURLParserCtxt();
16783    test_ret += test_xmlCurrentChar();
16784    test_ret += test_xmlErrMemory();
16785    test_ret += test_xmlIsLetter();
16786    test_ret += test_xmlNewEntityInputStream();
16787    test_ret += test_xmlNewInputFromFile();
16788    test_ret += test_xmlNewInputStream();
16789    test_ret += test_xmlNewStringInputStream();
16790    test_ret += test_xmlNextChar();
16791    test_ret += test_xmlParserInputShrink();
16792    test_ret += test_xmlPopInput();
16793    test_ret += test_xmlPushInput();
16794    test_ret += test_xmlSetEntityReferenceFunc();
16795    test_ret += test_xmlSplitQName();
16796    test_ret += test_xmlStringCurrentChar();
16797    test_ret += test_xmlStringDecodeEntities();
16798    test_ret += test_xmlStringLenDecodeEntities();
16799    test_ret += test_xmlSwitchEncoding();
16800    test_ret += test_xmlSwitchInputEncoding();
16801    test_ret += test_xmlSwitchToEncoding();
16802
16803    if (test_ret != 0)
16804	printf("Module parserInternals: %d errors\n", test_ret);
16805    return(test_ret);
16806}
16807
16808static int
16809test_xmlPatternFromRoot(void) {
16810    int test_ret = 0;
16811
16812#if defined(LIBXML_PATTERN_ENABLED)
16813    int mem_base;
16814    int ret_val;
16815    xmlPatternPtr comp; /* the precompiled pattern */
16816    int n_comp;
16817
16818    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16819        mem_base = xmlMemBlocks();
16820        comp = gen_xmlPatternPtr(n_comp, 0);
16821
16822        ret_val = xmlPatternFromRoot(comp);
16823        desret_int(ret_val);
16824        call_tests++;
16825        des_xmlPatternPtr(n_comp, comp, 0);
16826        xmlResetLastError();
16827        if (mem_base != xmlMemBlocks()) {
16828            printf("Leak of %d blocks found in xmlPatternFromRoot",
16829	           xmlMemBlocks() - mem_base);
16830	    test_ret++;
16831            printf(" %d", n_comp);
16832            printf("\n");
16833        }
16834    }
16835    function_tests++;
16836#endif
16837
16838    return(test_ret);
16839}
16840
16841
16842static int
16843test_xmlPatternGetStreamCtxt(void) {
16844    int test_ret = 0;
16845
16846
16847    /* missing type support */
16848    return(test_ret);
16849}
16850
16851
16852static int
16853test_xmlPatternMatch(void) {
16854    int test_ret = 0;
16855
16856#if defined(LIBXML_PATTERN_ENABLED)
16857    int mem_base;
16858    int ret_val;
16859    xmlPatternPtr comp; /* the precompiled pattern */
16860    int n_comp;
16861    xmlNodePtr node; /* a node */
16862    int n_node;
16863
16864    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16865    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16866        mem_base = xmlMemBlocks();
16867        comp = gen_xmlPatternPtr(n_comp, 0);
16868        node = gen_xmlNodePtr(n_node, 1);
16869
16870        ret_val = xmlPatternMatch(comp, node);
16871        desret_int(ret_val);
16872        call_tests++;
16873        des_xmlPatternPtr(n_comp, comp, 0);
16874        des_xmlNodePtr(n_node, node, 1);
16875        xmlResetLastError();
16876        if (mem_base != xmlMemBlocks()) {
16877            printf("Leak of %d blocks found in xmlPatternMatch",
16878	           xmlMemBlocks() - mem_base);
16879	    test_ret++;
16880            printf(" %d", n_comp);
16881            printf(" %d", n_node);
16882            printf("\n");
16883        }
16884    }
16885    }
16886    function_tests++;
16887#endif
16888
16889    return(test_ret);
16890}
16891
16892
16893static int
16894test_xmlPatternMaxDepth(void) {
16895    int test_ret = 0;
16896
16897#if defined(LIBXML_PATTERN_ENABLED)
16898    int mem_base;
16899    int ret_val;
16900    xmlPatternPtr comp; /* the precompiled pattern */
16901    int n_comp;
16902
16903    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16904        mem_base = xmlMemBlocks();
16905        comp = gen_xmlPatternPtr(n_comp, 0);
16906
16907        ret_val = xmlPatternMaxDepth(comp);
16908        desret_int(ret_val);
16909        call_tests++;
16910        des_xmlPatternPtr(n_comp, comp, 0);
16911        xmlResetLastError();
16912        if (mem_base != xmlMemBlocks()) {
16913            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16914	           xmlMemBlocks() - mem_base);
16915	    test_ret++;
16916            printf(" %d", n_comp);
16917            printf("\n");
16918        }
16919    }
16920    function_tests++;
16921#endif
16922
16923    return(test_ret);
16924}
16925
16926
16927static int
16928test_xmlPatternMinDepth(void) {
16929    int test_ret = 0;
16930
16931#if defined(LIBXML_PATTERN_ENABLED)
16932    int mem_base;
16933    int ret_val;
16934    xmlPatternPtr comp; /* the precompiled pattern */
16935    int n_comp;
16936
16937    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16938        mem_base = xmlMemBlocks();
16939        comp = gen_xmlPatternPtr(n_comp, 0);
16940
16941        ret_val = xmlPatternMinDepth(comp);
16942        desret_int(ret_val);
16943        call_tests++;
16944        des_xmlPatternPtr(n_comp, comp, 0);
16945        xmlResetLastError();
16946        if (mem_base != xmlMemBlocks()) {
16947            printf("Leak of %d blocks found in xmlPatternMinDepth",
16948	           xmlMemBlocks() - mem_base);
16949	    test_ret++;
16950            printf(" %d", n_comp);
16951            printf("\n");
16952        }
16953    }
16954    function_tests++;
16955#endif
16956
16957    return(test_ret);
16958}
16959
16960
16961static int
16962test_xmlPatternStreamable(void) {
16963    int test_ret = 0;
16964
16965#if defined(LIBXML_PATTERN_ENABLED)
16966    int mem_base;
16967    int ret_val;
16968    xmlPatternPtr comp; /* the precompiled pattern */
16969    int n_comp;
16970
16971    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16972        mem_base = xmlMemBlocks();
16973        comp = gen_xmlPatternPtr(n_comp, 0);
16974
16975        ret_val = xmlPatternStreamable(comp);
16976        desret_int(ret_val);
16977        call_tests++;
16978        des_xmlPatternPtr(n_comp, comp, 0);
16979        xmlResetLastError();
16980        if (mem_base != xmlMemBlocks()) {
16981            printf("Leak of %d blocks found in xmlPatternStreamable",
16982	           xmlMemBlocks() - mem_base);
16983	    test_ret++;
16984            printf(" %d", n_comp);
16985            printf("\n");
16986        }
16987    }
16988    function_tests++;
16989#endif
16990
16991    return(test_ret);
16992}
16993
16994
16995static int
16996test_xmlPatterncompile(void) {
16997    int test_ret = 0;
16998
16999
17000    /* missing type support */
17001    return(test_ret);
17002}
17003
17004#ifdef LIBXML_PATTERN_ENABLED
17005
17006#define gen_nb_xmlStreamCtxtPtr 1
17007static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17008    return(NULL);
17009}
17010static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17011}
17012#endif
17013
17014
17015static int
17016test_xmlStreamPop(void) {
17017    int test_ret = 0;
17018
17019#if defined(LIBXML_PATTERN_ENABLED)
17020    int mem_base;
17021    int ret_val;
17022    xmlStreamCtxtPtr stream; /* the stream context */
17023    int n_stream;
17024
17025    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17026        mem_base = xmlMemBlocks();
17027        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17028
17029        ret_val = xmlStreamPop(stream);
17030        desret_int(ret_val);
17031        call_tests++;
17032        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17033        xmlResetLastError();
17034        if (mem_base != xmlMemBlocks()) {
17035            printf("Leak of %d blocks found in xmlStreamPop",
17036	           xmlMemBlocks() - mem_base);
17037	    test_ret++;
17038            printf(" %d", n_stream);
17039            printf("\n");
17040        }
17041    }
17042    function_tests++;
17043#endif
17044
17045    return(test_ret);
17046}
17047
17048
17049static int
17050test_xmlStreamPush(void) {
17051    int test_ret = 0;
17052
17053#if defined(LIBXML_PATTERN_ENABLED)
17054    int mem_base;
17055    int ret_val;
17056    xmlStreamCtxtPtr stream; /* the stream context */
17057    int n_stream;
17058    xmlChar * name; /* the current name */
17059    int n_name;
17060    xmlChar * ns; /* the namespace name */
17061    int n_ns;
17062
17063    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17064    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17065    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17066        mem_base = xmlMemBlocks();
17067        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17068        name = gen_const_xmlChar_ptr(n_name, 1);
17069        ns = gen_const_xmlChar_ptr(n_ns, 2);
17070
17071        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17072        desret_int(ret_val);
17073        call_tests++;
17074        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17075        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17076        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17077        xmlResetLastError();
17078        if (mem_base != xmlMemBlocks()) {
17079            printf("Leak of %d blocks found in xmlStreamPush",
17080	           xmlMemBlocks() - mem_base);
17081	    test_ret++;
17082            printf(" %d", n_stream);
17083            printf(" %d", n_name);
17084            printf(" %d", n_ns);
17085            printf("\n");
17086        }
17087    }
17088    }
17089    }
17090    function_tests++;
17091#endif
17092
17093    return(test_ret);
17094}
17095
17096
17097static int
17098test_xmlStreamPushAttr(void) {
17099    int test_ret = 0;
17100
17101#if defined(LIBXML_PATTERN_ENABLED)
17102    int mem_base;
17103    int ret_val;
17104    xmlStreamCtxtPtr stream; /* the stream context */
17105    int n_stream;
17106    xmlChar * name; /* the current name */
17107    int n_name;
17108    xmlChar * ns; /* the namespace name */
17109    int n_ns;
17110
17111    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17112    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17113    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17114        mem_base = xmlMemBlocks();
17115        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17116        name = gen_const_xmlChar_ptr(n_name, 1);
17117        ns = gen_const_xmlChar_ptr(n_ns, 2);
17118
17119        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17120        desret_int(ret_val);
17121        call_tests++;
17122        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17123        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17124        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17125        xmlResetLastError();
17126        if (mem_base != xmlMemBlocks()) {
17127            printf("Leak of %d blocks found in xmlStreamPushAttr",
17128	           xmlMemBlocks() - mem_base);
17129	    test_ret++;
17130            printf(" %d", n_stream);
17131            printf(" %d", n_name);
17132            printf(" %d", n_ns);
17133            printf("\n");
17134        }
17135    }
17136    }
17137    }
17138    function_tests++;
17139#endif
17140
17141    return(test_ret);
17142}
17143
17144
17145static int
17146test_xmlStreamPushNode(void) {
17147    int test_ret = 0;
17148
17149#if defined(LIBXML_PATTERN_ENABLED)
17150    int mem_base;
17151    int ret_val;
17152    xmlStreamCtxtPtr stream; /* the stream context */
17153    int n_stream;
17154    xmlChar * name; /* the current name */
17155    int n_name;
17156    xmlChar * ns; /* the namespace name */
17157    int n_ns;
17158    int nodeType; /* the type of the node being pushed */
17159    int n_nodeType;
17160
17161    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17162    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17163    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17164    for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17165        mem_base = xmlMemBlocks();
17166        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17167        name = gen_const_xmlChar_ptr(n_name, 1);
17168        ns = gen_const_xmlChar_ptr(n_ns, 2);
17169        nodeType = gen_int(n_nodeType, 3);
17170
17171        ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17172        desret_int(ret_val);
17173        call_tests++;
17174        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17175        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17176        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17177        des_int(n_nodeType, nodeType, 3);
17178        xmlResetLastError();
17179        if (mem_base != xmlMemBlocks()) {
17180            printf("Leak of %d blocks found in xmlStreamPushNode",
17181	           xmlMemBlocks() - mem_base);
17182	    test_ret++;
17183            printf(" %d", n_stream);
17184            printf(" %d", n_name);
17185            printf(" %d", n_ns);
17186            printf(" %d", n_nodeType);
17187            printf("\n");
17188        }
17189    }
17190    }
17191    }
17192    }
17193    function_tests++;
17194#endif
17195
17196    return(test_ret);
17197}
17198
17199
17200static int
17201test_xmlStreamWantsAnyNode(void) {
17202    int test_ret = 0;
17203
17204#if defined(LIBXML_PATTERN_ENABLED)
17205    int mem_base;
17206    int ret_val;
17207    xmlStreamCtxtPtr streamCtxt; /* the stream context */
17208    int n_streamCtxt;
17209
17210    for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17211        mem_base = xmlMemBlocks();
17212        streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17213
17214        ret_val = xmlStreamWantsAnyNode(streamCtxt);
17215        desret_int(ret_val);
17216        call_tests++;
17217        des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17218        xmlResetLastError();
17219        if (mem_base != xmlMemBlocks()) {
17220            printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17221	           xmlMemBlocks() - mem_base);
17222	    test_ret++;
17223            printf(" %d", n_streamCtxt);
17224            printf("\n");
17225        }
17226    }
17227    function_tests++;
17228#endif
17229
17230    return(test_ret);
17231}
17232
17233static int
17234test_pattern(void) {
17235    int test_ret = 0;
17236
17237    if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17238    test_ret += test_xmlPatternFromRoot();
17239    test_ret += test_xmlPatternGetStreamCtxt();
17240    test_ret += test_xmlPatternMatch();
17241    test_ret += test_xmlPatternMaxDepth();
17242    test_ret += test_xmlPatternMinDepth();
17243    test_ret += test_xmlPatternStreamable();
17244    test_ret += test_xmlPatterncompile();
17245    test_ret += test_xmlStreamPop();
17246    test_ret += test_xmlStreamPush();
17247    test_ret += test_xmlStreamPushAttr();
17248    test_ret += test_xmlStreamPushNode();
17249    test_ret += test_xmlStreamWantsAnyNode();
17250
17251    if (test_ret != 0)
17252	printf("Module pattern: %d errors\n", test_ret);
17253    return(test_ret);
17254}
17255#ifdef LIBXML_SCHEMAS_ENABLED
17256
17257#define gen_nb_xmlRelaxNGPtr 1
17258static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17259    return(NULL);
17260}
17261static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17262}
17263#endif
17264
17265
17266static int
17267test_xmlRelaxNGDump(void) {
17268    int test_ret = 0;
17269
17270#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17271    int mem_base;
17272    FILE * output; /* the file output */
17273    int n_output;
17274    xmlRelaxNGPtr schema; /* a schema structure */
17275    int n_schema;
17276
17277    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17278    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17279        mem_base = xmlMemBlocks();
17280        output = gen_FILE_ptr(n_output, 0);
17281        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17282
17283        xmlRelaxNGDump(output, schema);
17284        call_tests++;
17285        des_FILE_ptr(n_output, output, 0);
17286        des_xmlRelaxNGPtr(n_schema, schema, 1);
17287        xmlResetLastError();
17288        if (mem_base != xmlMemBlocks()) {
17289            printf("Leak of %d blocks found in xmlRelaxNGDump",
17290	           xmlMemBlocks() - mem_base);
17291	    test_ret++;
17292            printf(" %d", n_output);
17293            printf(" %d", n_schema);
17294            printf("\n");
17295        }
17296    }
17297    }
17298    function_tests++;
17299#endif
17300
17301    return(test_ret);
17302}
17303
17304
17305static int
17306test_xmlRelaxNGDumpTree(void) {
17307    int test_ret = 0;
17308
17309#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17310    int mem_base;
17311    FILE * output; /* the file output */
17312    int n_output;
17313    xmlRelaxNGPtr schema; /* a schema structure */
17314    int n_schema;
17315
17316    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17317    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17318        mem_base = xmlMemBlocks();
17319        output = gen_FILE_ptr(n_output, 0);
17320        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17321
17322        xmlRelaxNGDumpTree(output, schema);
17323        call_tests++;
17324        des_FILE_ptr(n_output, output, 0);
17325        des_xmlRelaxNGPtr(n_schema, schema, 1);
17326        xmlResetLastError();
17327        if (mem_base != xmlMemBlocks()) {
17328            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17329	           xmlMemBlocks() - mem_base);
17330	    test_ret++;
17331            printf(" %d", n_output);
17332            printf(" %d", n_schema);
17333            printf("\n");
17334        }
17335    }
17336    }
17337    function_tests++;
17338#endif
17339
17340    return(test_ret);
17341}
17342
17343#ifdef LIBXML_SCHEMAS_ENABLED
17344
17345#define gen_nb_xmlRelaxNGParserCtxtPtr 1
17346static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17347    return(NULL);
17348}
17349static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17350}
17351#endif
17352
17353#ifdef LIBXML_SCHEMAS_ENABLED
17354
17355#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17356static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17357    return(NULL);
17358}
17359static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17360}
17361#endif
17362
17363#ifdef LIBXML_SCHEMAS_ENABLED
17364
17365#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17366static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17367    return(NULL);
17368}
17369static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17370}
17371#endif
17372
17373#ifdef LIBXML_SCHEMAS_ENABLED
17374
17375#define gen_nb_void_ptr_ptr 1
17376static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17377    return(NULL);
17378}
17379static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17380}
17381#endif
17382
17383
17384static int
17385test_xmlRelaxNGGetParserErrors(void) {
17386    int test_ret = 0;
17387
17388#if defined(LIBXML_SCHEMAS_ENABLED)
17389    int mem_base;
17390    int ret_val;
17391    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17392    int n_ctxt;
17393    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17394    int n_err;
17395    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17396    int n_warn;
17397    void ** ctx; /* contextual data for the callbacks result */
17398    int n_ctx;
17399
17400    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17401    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17402    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17403    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17404        mem_base = xmlMemBlocks();
17405        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17406        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17407        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17408        ctx = gen_void_ptr_ptr(n_ctx, 3);
17409
17410        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17411        desret_int(ret_val);
17412        call_tests++;
17413        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17414        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17415        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17416        des_void_ptr_ptr(n_ctx, ctx, 3);
17417        xmlResetLastError();
17418        if (mem_base != xmlMemBlocks()) {
17419            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17420	           xmlMemBlocks() - mem_base);
17421	    test_ret++;
17422            printf(" %d", n_ctxt);
17423            printf(" %d", n_err);
17424            printf(" %d", n_warn);
17425            printf(" %d", n_ctx);
17426            printf("\n");
17427        }
17428    }
17429    }
17430    }
17431    }
17432    function_tests++;
17433#endif
17434
17435    return(test_ret);
17436}
17437
17438#ifdef LIBXML_SCHEMAS_ENABLED
17439
17440#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17441static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17442    return(NULL);
17443}
17444static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17445}
17446#endif
17447
17448
17449static int
17450test_xmlRelaxNGGetValidErrors(void) {
17451    int test_ret = 0;
17452
17453#if defined(LIBXML_SCHEMAS_ENABLED)
17454    int mem_base;
17455    int ret_val;
17456    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17457    int n_ctxt;
17458    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17459    int n_err;
17460    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17461    int n_warn;
17462    void ** ctx; /* the functions context result */
17463    int n_ctx;
17464
17465    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17466    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17467    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17468    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17469        mem_base = xmlMemBlocks();
17470        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17471        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17472        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17473        ctx = gen_void_ptr_ptr(n_ctx, 3);
17474
17475        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17476        desret_int(ret_val);
17477        call_tests++;
17478        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17479        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17480        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17481        des_void_ptr_ptr(n_ctx, ctx, 3);
17482        xmlResetLastError();
17483        if (mem_base != xmlMemBlocks()) {
17484            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17485	           xmlMemBlocks() - mem_base);
17486	    test_ret++;
17487            printf(" %d", n_ctxt);
17488            printf(" %d", n_err);
17489            printf(" %d", n_warn);
17490            printf(" %d", n_ctx);
17491            printf("\n");
17492        }
17493    }
17494    }
17495    }
17496    }
17497    function_tests++;
17498#endif
17499
17500    return(test_ret);
17501}
17502
17503
17504static int
17505test_xmlRelaxNGInitTypes(void) {
17506    int test_ret = 0;
17507
17508#if defined(LIBXML_SCHEMAS_ENABLED)
17509    int mem_base;
17510    int ret_val;
17511
17512        mem_base = xmlMemBlocks();
17513
17514        ret_val = xmlRelaxNGInitTypes();
17515        desret_int(ret_val);
17516        call_tests++;
17517        xmlResetLastError();
17518        if (mem_base != xmlMemBlocks()) {
17519            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17520	           xmlMemBlocks() - mem_base);
17521	    test_ret++;
17522            printf("\n");
17523        }
17524    function_tests++;
17525#endif
17526
17527    return(test_ret);
17528}
17529
17530
17531static int
17532test_xmlRelaxNGNewDocParserCtxt(void) {
17533    int test_ret = 0;
17534
17535#if defined(LIBXML_SCHEMAS_ENABLED)
17536    int mem_base;
17537    xmlRelaxNGParserCtxtPtr ret_val;
17538    xmlDocPtr doc; /* a preparsed document tree */
17539    int n_doc;
17540
17541    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17542        mem_base = xmlMemBlocks();
17543        doc = gen_xmlDocPtr(n_doc, 0);
17544
17545        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17546        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17547        call_tests++;
17548        des_xmlDocPtr(n_doc, doc, 0);
17549        xmlResetLastError();
17550        if (mem_base != xmlMemBlocks()) {
17551            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17552	           xmlMemBlocks() - mem_base);
17553	    test_ret++;
17554            printf(" %d", n_doc);
17555            printf("\n");
17556        }
17557    }
17558    function_tests++;
17559#endif
17560
17561    return(test_ret);
17562}
17563
17564
17565static int
17566test_xmlRelaxNGNewMemParserCtxt(void) {
17567    int test_ret = 0;
17568
17569#if defined(LIBXML_SCHEMAS_ENABLED)
17570    int mem_base;
17571    xmlRelaxNGParserCtxtPtr ret_val;
17572    char * buffer; /* a pointer to a char array containing the schemas */
17573    int n_buffer;
17574    int size; /* the size of the array */
17575    int n_size;
17576
17577    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17578    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17579        mem_base = xmlMemBlocks();
17580        buffer = gen_const_char_ptr(n_buffer, 0);
17581        size = gen_int(n_size, 1);
17582
17583        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17584        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17585        call_tests++;
17586        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17587        des_int(n_size, size, 1);
17588        xmlResetLastError();
17589        if (mem_base != xmlMemBlocks()) {
17590            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17591	           xmlMemBlocks() - mem_base);
17592	    test_ret++;
17593            printf(" %d", n_buffer);
17594            printf(" %d", n_size);
17595            printf("\n");
17596        }
17597    }
17598    }
17599    function_tests++;
17600#endif
17601
17602    return(test_ret);
17603}
17604
17605
17606static int
17607test_xmlRelaxNGNewParserCtxt(void) {
17608    int test_ret = 0;
17609
17610#if defined(LIBXML_SCHEMAS_ENABLED)
17611    int mem_base;
17612    xmlRelaxNGParserCtxtPtr ret_val;
17613    char * URL; /* the location of the schema */
17614    int n_URL;
17615
17616    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17617        mem_base = xmlMemBlocks();
17618        URL = gen_const_char_ptr(n_URL, 0);
17619
17620        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17621        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17622        call_tests++;
17623        des_const_char_ptr(n_URL, (const char *)URL, 0);
17624        xmlResetLastError();
17625        if (mem_base != xmlMemBlocks()) {
17626            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17627	           xmlMemBlocks() - mem_base);
17628	    test_ret++;
17629            printf(" %d", n_URL);
17630            printf("\n");
17631        }
17632    }
17633    function_tests++;
17634#endif
17635
17636    return(test_ret);
17637}
17638
17639
17640static int
17641test_xmlRelaxNGNewValidCtxt(void) {
17642    int test_ret = 0;
17643
17644
17645    /* missing type support */
17646    return(test_ret);
17647}
17648
17649
17650static int
17651test_xmlRelaxNGParse(void) {
17652    int test_ret = 0;
17653
17654
17655    /* missing type support */
17656    return(test_ret);
17657}
17658
17659
17660static int
17661test_xmlRelaxNGSetParserErrors(void) {
17662    int test_ret = 0;
17663
17664
17665    /* missing type support */
17666    return(test_ret);
17667}
17668
17669
17670static int
17671test_xmlRelaxNGSetParserStructuredErrors(void) {
17672    int test_ret = 0;
17673
17674
17675    /* missing type support */
17676    return(test_ret);
17677}
17678
17679
17680static int
17681test_xmlRelaxNGSetValidErrors(void) {
17682    int test_ret = 0;
17683
17684
17685    /* missing type support */
17686    return(test_ret);
17687}
17688
17689
17690static int
17691test_xmlRelaxNGSetValidStructuredErrors(void) {
17692    int test_ret = 0;
17693
17694
17695    /* missing type support */
17696    return(test_ret);
17697}
17698
17699
17700static int
17701test_xmlRelaxNGValidateDoc(void) {
17702    int test_ret = 0;
17703
17704#if defined(LIBXML_SCHEMAS_ENABLED)
17705    int mem_base;
17706    int ret_val;
17707    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17708    int n_ctxt;
17709    xmlDocPtr doc; /* a parsed document tree */
17710    int n_doc;
17711
17712    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17713    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17714        mem_base = xmlMemBlocks();
17715        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17716        doc = gen_xmlDocPtr(n_doc, 1);
17717
17718        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17719        desret_int(ret_val);
17720        call_tests++;
17721        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17722        des_xmlDocPtr(n_doc, doc, 1);
17723        xmlResetLastError();
17724        if (mem_base != xmlMemBlocks()) {
17725            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17726	           xmlMemBlocks() - mem_base);
17727	    test_ret++;
17728            printf(" %d", n_ctxt);
17729            printf(" %d", n_doc);
17730            printf("\n");
17731        }
17732    }
17733    }
17734    function_tests++;
17735#endif
17736
17737    return(test_ret);
17738}
17739
17740
17741static int
17742test_xmlRelaxNGValidateFullElement(void) {
17743    int test_ret = 0;
17744
17745#if defined(LIBXML_SCHEMAS_ENABLED)
17746    int mem_base;
17747    int ret_val;
17748    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17749    int n_ctxt;
17750    xmlDocPtr doc; /* a document instance */
17751    int n_doc;
17752    xmlNodePtr elem; /* an element instance */
17753    int n_elem;
17754
17755    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17756    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17757    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17758        mem_base = xmlMemBlocks();
17759        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17760        doc = gen_xmlDocPtr(n_doc, 1);
17761        elem = gen_xmlNodePtr(n_elem, 2);
17762
17763        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17764        desret_int(ret_val);
17765        call_tests++;
17766        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17767        des_xmlDocPtr(n_doc, doc, 1);
17768        des_xmlNodePtr(n_elem, elem, 2);
17769        xmlResetLastError();
17770        if (mem_base != xmlMemBlocks()) {
17771            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17772	           xmlMemBlocks() - mem_base);
17773	    test_ret++;
17774            printf(" %d", n_ctxt);
17775            printf(" %d", n_doc);
17776            printf(" %d", n_elem);
17777            printf("\n");
17778        }
17779    }
17780    }
17781    }
17782    function_tests++;
17783#endif
17784
17785    return(test_ret);
17786}
17787
17788
17789static int
17790test_xmlRelaxNGValidatePopElement(void) {
17791    int test_ret = 0;
17792
17793#if defined(LIBXML_SCHEMAS_ENABLED)
17794    int mem_base;
17795    int ret_val;
17796    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17797    int n_ctxt;
17798    xmlDocPtr doc; /* a document instance */
17799    int n_doc;
17800    xmlNodePtr elem; /* an element instance */
17801    int n_elem;
17802
17803    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17804    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17805    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17806        mem_base = xmlMemBlocks();
17807        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17808        doc = gen_xmlDocPtr(n_doc, 1);
17809        elem = gen_xmlNodePtr(n_elem, 2);
17810
17811        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17812        desret_int(ret_val);
17813        call_tests++;
17814        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17815        des_xmlDocPtr(n_doc, doc, 1);
17816        des_xmlNodePtr(n_elem, elem, 2);
17817        xmlResetLastError();
17818        if (mem_base != xmlMemBlocks()) {
17819            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17820	           xmlMemBlocks() - mem_base);
17821	    test_ret++;
17822            printf(" %d", n_ctxt);
17823            printf(" %d", n_doc);
17824            printf(" %d", n_elem);
17825            printf("\n");
17826        }
17827    }
17828    }
17829    }
17830    function_tests++;
17831#endif
17832
17833    return(test_ret);
17834}
17835
17836
17837static int
17838test_xmlRelaxNGValidatePushCData(void) {
17839    int test_ret = 0;
17840
17841#if defined(LIBXML_SCHEMAS_ENABLED)
17842    int mem_base;
17843    int ret_val;
17844    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17845    int n_ctxt;
17846    xmlChar * data; /* some character data read */
17847    int n_data;
17848    int len; /* the lenght of the data */
17849    int n_len;
17850
17851    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17852    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17853    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17854        mem_base = xmlMemBlocks();
17855        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17856        data = gen_const_xmlChar_ptr(n_data, 1);
17857        len = gen_int(n_len, 2);
17858
17859        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17860        desret_int(ret_val);
17861        call_tests++;
17862        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17863        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17864        des_int(n_len, len, 2);
17865        xmlResetLastError();
17866        if (mem_base != xmlMemBlocks()) {
17867            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17868	           xmlMemBlocks() - mem_base);
17869	    test_ret++;
17870            printf(" %d", n_ctxt);
17871            printf(" %d", n_data);
17872            printf(" %d", n_len);
17873            printf("\n");
17874        }
17875    }
17876    }
17877    }
17878    function_tests++;
17879#endif
17880
17881    return(test_ret);
17882}
17883
17884
17885static int
17886test_xmlRelaxNGValidatePushElement(void) {
17887    int test_ret = 0;
17888
17889#if defined(LIBXML_SCHEMAS_ENABLED)
17890    int mem_base;
17891    int ret_val;
17892    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17893    int n_ctxt;
17894    xmlDocPtr doc; /* a document instance */
17895    int n_doc;
17896    xmlNodePtr elem; /* an element instance */
17897    int n_elem;
17898
17899    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17900    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17901    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17902        mem_base = xmlMemBlocks();
17903        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17904        doc = gen_xmlDocPtr(n_doc, 1);
17905        elem = gen_xmlNodePtr(n_elem, 2);
17906
17907        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17908        desret_int(ret_val);
17909        call_tests++;
17910        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17911        des_xmlDocPtr(n_doc, doc, 1);
17912        des_xmlNodePtr(n_elem, elem, 2);
17913        xmlResetLastError();
17914        if (mem_base != xmlMemBlocks()) {
17915            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17916	           xmlMemBlocks() - mem_base);
17917	    test_ret++;
17918            printf(" %d", n_ctxt);
17919            printf(" %d", n_doc);
17920            printf(" %d", n_elem);
17921            printf("\n");
17922        }
17923    }
17924    }
17925    }
17926    function_tests++;
17927#endif
17928
17929    return(test_ret);
17930}
17931
17932
17933static int
17934test_xmlRelaxParserSetFlag(void) {
17935    int test_ret = 0;
17936
17937#if defined(LIBXML_SCHEMAS_ENABLED)
17938    int mem_base;
17939    int ret_val;
17940    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17941    int n_ctxt;
17942    int flags; /* a set of flags values */
17943    int n_flags;
17944
17945    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17946    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17947        mem_base = xmlMemBlocks();
17948        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17949        flags = gen_int(n_flags, 1);
17950
17951        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17952        desret_int(ret_val);
17953        call_tests++;
17954        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17955        des_int(n_flags, flags, 1);
17956        xmlResetLastError();
17957        if (mem_base != xmlMemBlocks()) {
17958            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17959	           xmlMemBlocks() - mem_base);
17960	    test_ret++;
17961            printf(" %d", n_ctxt);
17962            printf(" %d", n_flags);
17963            printf("\n");
17964        }
17965    }
17966    }
17967    function_tests++;
17968#endif
17969
17970    return(test_ret);
17971}
17972
17973static int
17974test_relaxng(void) {
17975    int test_ret = 0;
17976
17977    if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17978    test_ret += test_xmlRelaxNGDump();
17979    test_ret += test_xmlRelaxNGDumpTree();
17980    test_ret += test_xmlRelaxNGGetParserErrors();
17981    test_ret += test_xmlRelaxNGGetValidErrors();
17982    test_ret += test_xmlRelaxNGInitTypes();
17983    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17984    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17985    test_ret += test_xmlRelaxNGNewParserCtxt();
17986    test_ret += test_xmlRelaxNGNewValidCtxt();
17987    test_ret += test_xmlRelaxNGParse();
17988    test_ret += test_xmlRelaxNGSetParserErrors();
17989    test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17990    test_ret += test_xmlRelaxNGSetValidErrors();
17991    test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17992    test_ret += test_xmlRelaxNGValidateDoc();
17993    test_ret += test_xmlRelaxNGValidateFullElement();
17994    test_ret += test_xmlRelaxNGValidatePopElement();
17995    test_ret += test_xmlRelaxNGValidatePushCData();
17996    test_ret += test_xmlRelaxNGValidatePushElement();
17997    test_ret += test_xmlRelaxParserSetFlag();
17998
17999    if (test_ret != 0)
18000	printf("Module relaxng: %d errors\n", test_ret);
18001    return(test_ret);
18002}
18003static int
18004test_schemasInternals(void) {
18005    int test_ret = 0;
18006
18007    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18008
18009    if (test_ret != 0)
18010	printf("Module schemasInternals: %d errors\n", test_ret);
18011    return(test_ret);
18012}
18013
18014static int
18015test_xmlSchematronNewDocParserCtxt(void) {
18016    int test_ret = 0;
18017
18018
18019    /* missing type support */
18020    return(test_ret);
18021}
18022
18023
18024static int
18025test_xmlSchematronNewMemParserCtxt(void) {
18026    int test_ret = 0;
18027
18028
18029    /* missing type support */
18030    return(test_ret);
18031}
18032
18033
18034static int
18035test_xmlSchematronNewParserCtxt(void) {
18036    int test_ret = 0;
18037
18038
18039    /* missing type support */
18040    return(test_ret);
18041}
18042
18043#ifdef LIBXML_SCHEMATRON_ENABLED
18044
18045#define gen_nb_xmlSchematronPtr 1
18046static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18047    return(NULL);
18048}
18049static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18050}
18051#endif
18052
18053
18054static int
18055test_xmlSchematronNewValidCtxt(void) {
18056    int test_ret = 0;
18057
18058
18059    /* missing type support */
18060    return(test_ret);
18061}
18062
18063#ifdef LIBXML_SCHEMATRON_ENABLED
18064
18065#define gen_nb_xmlSchematronParserCtxtPtr 1
18066static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18067    return(NULL);
18068}
18069static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18070}
18071#endif
18072
18073
18074static int
18075test_xmlSchematronParse(void) {
18076    int test_ret = 0;
18077
18078
18079    /* missing type support */
18080    return(test_ret);
18081}
18082
18083#ifdef LIBXML_SCHEMATRON_ENABLED
18084
18085#define gen_nb_xmlSchematronValidCtxtPtr 1
18086static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18087    return(NULL);
18088}
18089static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18090}
18091#endif
18092
18093
18094static int
18095test_xmlSchematronSetValidStructuredErrors(void) {
18096    int test_ret = 0;
18097
18098
18099    /* missing type support */
18100    return(test_ret);
18101}
18102
18103
18104static int
18105test_xmlSchematronValidateDoc(void) {
18106    int test_ret = 0;
18107
18108#if defined(LIBXML_SCHEMATRON_ENABLED)
18109    int mem_base;
18110    int ret_val;
18111    xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18112    int n_ctxt;
18113    xmlDocPtr instance; /* the document instace tree */
18114    int n_instance;
18115
18116    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18117    for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18118        mem_base = xmlMemBlocks();
18119        ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18120        instance = gen_xmlDocPtr(n_instance, 1);
18121
18122        ret_val = xmlSchematronValidateDoc(ctxt, instance);
18123        desret_int(ret_val);
18124        call_tests++;
18125        des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18126        des_xmlDocPtr(n_instance, instance, 1);
18127        xmlResetLastError();
18128        if (mem_base != xmlMemBlocks()) {
18129            printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18130	           xmlMemBlocks() - mem_base);
18131	    test_ret++;
18132            printf(" %d", n_ctxt);
18133            printf(" %d", n_instance);
18134            printf("\n");
18135        }
18136    }
18137    }
18138    function_tests++;
18139#endif
18140
18141    return(test_ret);
18142}
18143
18144static int
18145test_schematron(void) {
18146    int test_ret = 0;
18147
18148    if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18149    test_ret += test_xmlSchematronNewDocParserCtxt();
18150    test_ret += test_xmlSchematronNewMemParserCtxt();
18151    test_ret += test_xmlSchematronNewParserCtxt();
18152    test_ret += test_xmlSchematronNewValidCtxt();
18153    test_ret += test_xmlSchematronParse();
18154    test_ret += test_xmlSchematronSetValidStructuredErrors();
18155    test_ret += test_xmlSchematronValidateDoc();
18156
18157    if (test_ret != 0)
18158	printf("Module schematron: %d errors\n", test_ret);
18159    return(test_ret);
18160}
18161
18162static int
18163test_xmlAddChild(void) {
18164    int test_ret = 0;
18165
18166    int mem_base;
18167    xmlNodePtr ret_val;
18168    xmlNodePtr parent; /* the parent node */
18169    int n_parent;
18170    xmlNodePtr cur; /* the child node */
18171    int n_cur;
18172
18173    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18174    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18175        mem_base = xmlMemBlocks();
18176        parent = gen_xmlNodePtr(n_parent, 0);
18177        cur = gen_xmlNodePtr_in(n_cur, 1);
18178
18179        ret_val = xmlAddChild(parent, cur);
18180        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18181        desret_xmlNodePtr(ret_val);
18182        call_tests++;
18183        des_xmlNodePtr(n_parent, parent, 0);
18184        des_xmlNodePtr_in(n_cur, cur, 1);
18185        xmlResetLastError();
18186        if (mem_base != xmlMemBlocks()) {
18187            printf("Leak of %d blocks found in xmlAddChild",
18188	           xmlMemBlocks() - mem_base);
18189	    test_ret++;
18190            printf(" %d", n_parent);
18191            printf(" %d", n_cur);
18192            printf("\n");
18193        }
18194    }
18195    }
18196    function_tests++;
18197
18198    return(test_ret);
18199}
18200
18201
18202static int
18203test_xmlAddChildList(void) {
18204    int test_ret = 0;
18205
18206    int mem_base;
18207    xmlNodePtr ret_val;
18208    xmlNodePtr parent; /* the parent node */
18209    int n_parent;
18210    xmlNodePtr cur; /* the first node in the list */
18211    int n_cur;
18212
18213    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18214    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18215        mem_base = xmlMemBlocks();
18216        parent = gen_xmlNodePtr(n_parent, 0);
18217        cur = gen_xmlNodePtr_in(n_cur, 1);
18218
18219        ret_val = xmlAddChildList(parent, cur);
18220        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18221        desret_xmlNodePtr(ret_val);
18222        call_tests++;
18223        des_xmlNodePtr(n_parent, parent, 0);
18224        des_xmlNodePtr_in(n_cur, cur, 1);
18225        xmlResetLastError();
18226        if (mem_base != xmlMemBlocks()) {
18227            printf("Leak of %d blocks found in xmlAddChildList",
18228	           xmlMemBlocks() - mem_base);
18229	    test_ret++;
18230            printf(" %d", n_parent);
18231            printf(" %d", n_cur);
18232            printf("\n");
18233        }
18234    }
18235    }
18236    function_tests++;
18237
18238    return(test_ret);
18239}
18240
18241
18242static int
18243test_xmlAddNextSibling(void) {
18244    int test_ret = 0;
18245
18246    int mem_base;
18247    xmlNodePtr ret_val;
18248    xmlNodePtr cur; /* the child node */
18249    int n_cur;
18250    xmlNodePtr elem; /* the new node */
18251    int n_elem;
18252
18253    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18254    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18255        mem_base = xmlMemBlocks();
18256        cur = gen_xmlNodePtr(n_cur, 0);
18257        elem = gen_xmlNodePtr_in(n_elem, 1);
18258
18259        ret_val = xmlAddNextSibling(cur, elem);
18260        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18261        desret_xmlNodePtr(ret_val);
18262        call_tests++;
18263        des_xmlNodePtr(n_cur, cur, 0);
18264        des_xmlNodePtr_in(n_elem, elem, 1);
18265        xmlResetLastError();
18266        if (mem_base != xmlMemBlocks()) {
18267            printf("Leak of %d blocks found in xmlAddNextSibling",
18268	           xmlMemBlocks() - mem_base);
18269	    test_ret++;
18270            printf(" %d", n_cur);
18271            printf(" %d", n_elem);
18272            printf("\n");
18273        }
18274    }
18275    }
18276    function_tests++;
18277
18278    return(test_ret);
18279}
18280
18281
18282static int
18283test_xmlAddPrevSibling(void) {
18284    int test_ret = 0;
18285
18286#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18287    int mem_base;
18288    xmlNodePtr ret_val;
18289    xmlNodePtr cur; /* the child node */
18290    int n_cur;
18291    xmlNodePtr elem; /* the new node */
18292    int n_elem;
18293
18294    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18295    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18296        mem_base = xmlMemBlocks();
18297        cur = gen_xmlNodePtr(n_cur, 0);
18298        elem = gen_xmlNodePtr_in(n_elem, 1);
18299
18300        ret_val = xmlAddPrevSibling(cur, elem);
18301        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18302        desret_xmlNodePtr(ret_val);
18303        call_tests++;
18304        des_xmlNodePtr(n_cur, cur, 0);
18305        des_xmlNodePtr_in(n_elem, elem, 1);
18306        xmlResetLastError();
18307        if (mem_base != xmlMemBlocks()) {
18308            printf("Leak of %d blocks found in xmlAddPrevSibling",
18309	           xmlMemBlocks() - mem_base);
18310	    test_ret++;
18311            printf(" %d", n_cur);
18312            printf(" %d", n_elem);
18313            printf("\n");
18314        }
18315    }
18316    }
18317    function_tests++;
18318#endif
18319
18320    return(test_ret);
18321}
18322
18323
18324static int
18325test_xmlAddSibling(void) {
18326    int test_ret = 0;
18327
18328    int mem_base;
18329    xmlNodePtr ret_val;
18330    xmlNodePtr cur; /* the child node */
18331    int n_cur;
18332    xmlNodePtr elem; /* the new node */
18333    int n_elem;
18334
18335    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18336    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18337        mem_base = xmlMemBlocks();
18338        cur = gen_xmlNodePtr(n_cur, 0);
18339        elem = gen_xmlNodePtr_in(n_elem, 1);
18340
18341        ret_val = xmlAddSibling(cur, elem);
18342        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18343        desret_xmlNodePtr(ret_val);
18344        call_tests++;
18345        des_xmlNodePtr(n_cur, cur, 0);
18346        des_xmlNodePtr_in(n_elem, elem, 1);
18347        xmlResetLastError();
18348        if (mem_base != xmlMemBlocks()) {
18349            printf("Leak of %d blocks found in xmlAddSibling",
18350	           xmlMemBlocks() - mem_base);
18351	    test_ret++;
18352            printf(" %d", n_cur);
18353            printf(" %d", n_elem);
18354            printf("\n");
18355        }
18356    }
18357    }
18358    function_tests++;
18359
18360    return(test_ret);
18361}
18362
18363
18364static int
18365test_xmlAttrSerializeTxtContent(void) {
18366    int test_ret = 0;
18367
18368#if defined(LIBXML_OUTPUT_ENABLED)
18369#ifdef LIBXML_OUTPUT_ENABLED
18370    int mem_base;
18371    xmlBufferPtr buf; /* the XML buffer output */
18372    int n_buf;
18373    xmlDocPtr doc; /* the document */
18374    int n_doc;
18375    xmlAttrPtr attr; /* the attribute node */
18376    int n_attr;
18377    xmlChar * string; /* the text content */
18378    int n_string;
18379
18380    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18381    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18382    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18383    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18384        mem_base = xmlMemBlocks();
18385        buf = gen_xmlBufferPtr(n_buf, 0);
18386        doc = gen_xmlDocPtr(n_doc, 1);
18387        attr = gen_xmlAttrPtr(n_attr, 2);
18388        string = gen_const_xmlChar_ptr(n_string, 3);
18389
18390        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18391        call_tests++;
18392        des_xmlBufferPtr(n_buf, buf, 0);
18393        des_xmlDocPtr(n_doc, doc, 1);
18394        des_xmlAttrPtr(n_attr, attr, 2);
18395        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18396        xmlResetLastError();
18397        if (mem_base != xmlMemBlocks()) {
18398            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18399	           xmlMemBlocks() - mem_base);
18400	    test_ret++;
18401            printf(" %d", n_buf);
18402            printf(" %d", n_doc);
18403            printf(" %d", n_attr);
18404            printf(" %d", n_string);
18405            printf("\n");
18406        }
18407    }
18408    }
18409    }
18410    }
18411    function_tests++;
18412#endif
18413#endif
18414
18415    return(test_ret);
18416}
18417
18418
18419static int
18420test_xmlBufferAdd(void) {
18421    int test_ret = 0;
18422
18423    int mem_base;
18424    int ret_val;
18425    xmlBufferPtr buf; /* the buffer to dump */
18426    int n_buf;
18427    xmlChar * str; /* the #xmlChar string */
18428    int n_str;
18429    int len; /* the number of #xmlChar to add */
18430    int n_len;
18431
18432    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18433    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18434    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18435        mem_base = xmlMemBlocks();
18436        buf = gen_xmlBufferPtr(n_buf, 0);
18437        str = gen_const_xmlChar_ptr(n_str, 1);
18438        len = gen_int(n_len, 2);
18439
18440        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18441        desret_int(ret_val);
18442        call_tests++;
18443        des_xmlBufferPtr(n_buf, buf, 0);
18444        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18445        des_int(n_len, len, 2);
18446        xmlResetLastError();
18447        if (mem_base != xmlMemBlocks()) {
18448            printf("Leak of %d blocks found in xmlBufferAdd",
18449	           xmlMemBlocks() - mem_base);
18450	    test_ret++;
18451            printf(" %d", n_buf);
18452            printf(" %d", n_str);
18453            printf(" %d", n_len);
18454            printf("\n");
18455        }
18456    }
18457    }
18458    }
18459    function_tests++;
18460
18461    return(test_ret);
18462}
18463
18464
18465static int
18466test_xmlBufferAddHead(void) {
18467    int test_ret = 0;
18468
18469    int mem_base;
18470    int ret_val;
18471    xmlBufferPtr buf; /* the buffer */
18472    int n_buf;
18473    xmlChar * str; /* the #xmlChar string */
18474    int n_str;
18475    int len; /* the number of #xmlChar to add */
18476    int n_len;
18477
18478    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18479    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18480    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18481        mem_base = xmlMemBlocks();
18482        buf = gen_xmlBufferPtr(n_buf, 0);
18483        str = gen_const_xmlChar_ptr(n_str, 1);
18484        len = gen_int(n_len, 2);
18485
18486        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18487        desret_int(ret_val);
18488        call_tests++;
18489        des_xmlBufferPtr(n_buf, buf, 0);
18490        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18491        des_int(n_len, len, 2);
18492        xmlResetLastError();
18493        if (mem_base != xmlMemBlocks()) {
18494            printf("Leak of %d blocks found in xmlBufferAddHead",
18495	           xmlMemBlocks() - mem_base);
18496	    test_ret++;
18497            printf(" %d", n_buf);
18498            printf(" %d", n_str);
18499            printf(" %d", n_len);
18500            printf("\n");
18501        }
18502    }
18503    }
18504    }
18505    function_tests++;
18506
18507    return(test_ret);
18508}
18509
18510
18511static int
18512test_xmlBufferCCat(void) {
18513    int test_ret = 0;
18514
18515    int mem_base;
18516    int ret_val;
18517    xmlBufferPtr buf; /* the buffer to dump */
18518    int n_buf;
18519    char * str; /* the C char string */
18520    int n_str;
18521
18522    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18523    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18524        mem_base = xmlMemBlocks();
18525        buf = gen_xmlBufferPtr(n_buf, 0);
18526        str = gen_const_char_ptr(n_str, 1);
18527
18528        ret_val = xmlBufferCCat(buf, (const char *)str);
18529        desret_int(ret_val);
18530        call_tests++;
18531        des_xmlBufferPtr(n_buf, buf, 0);
18532        des_const_char_ptr(n_str, (const char *)str, 1);
18533        xmlResetLastError();
18534        if (mem_base != xmlMemBlocks()) {
18535            printf("Leak of %d blocks found in xmlBufferCCat",
18536	           xmlMemBlocks() - mem_base);
18537	    test_ret++;
18538            printf(" %d", n_buf);
18539            printf(" %d", n_str);
18540            printf("\n");
18541        }
18542    }
18543    }
18544    function_tests++;
18545
18546    return(test_ret);
18547}
18548
18549
18550static int
18551test_xmlBufferCat(void) {
18552    int test_ret = 0;
18553
18554    int mem_base;
18555    int ret_val;
18556    xmlBufferPtr buf; /* the buffer to add to */
18557    int n_buf;
18558    xmlChar * str; /* the #xmlChar string */
18559    int n_str;
18560
18561    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18562    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18563        mem_base = xmlMemBlocks();
18564        buf = gen_xmlBufferPtr(n_buf, 0);
18565        str = gen_const_xmlChar_ptr(n_str, 1);
18566
18567        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18568        desret_int(ret_val);
18569        call_tests++;
18570        des_xmlBufferPtr(n_buf, buf, 0);
18571        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18572        xmlResetLastError();
18573        if (mem_base != xmlMemBlocks()) {
18574            printf("Leak of %d blocks found in xmlBufferCat",
18575	           xmlMemBlocks() - mem_base);
18576	    test_ret++;
18577            printf(" %d", n_buf);
18578            printf(" %d", n_str);
18579            printf("\n");
18580        }
18581    }
18582    }
18583    function_tests++;
18584
18585    return(test_ret);
18586}
18587
18588
18589#define gen_nb_const_xmlBufferPtr 1
18590static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18591    return(NULL);
18592}
18593static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18594}
18595
18596static int
18597test_xmlBufferContent(void) {
18598    int test_ret = 0;
18599
18600    int mem_base;
18601    const xmlChar * ret_val;
18602    xmlBufferPtr buf; /* the buffer */
18603    int n_buf;
18604
18605    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18606        mem_base = xmlMemBlocks();
18607        buf = gen_const_xmlBufferPtr(n_buf, 0);
18608
18609        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18610        desret_const_xmlChar_ptr(ret_val);
18611        call_tests++;
18612        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18613        xmlResetLastError();
18614        if (mem_base != xmlMemBlocks()) {
18615            printf("Leak of %d blocks found in xmlBufferContent",
18616	           xmlMemBlocks() - mem_base);
18617	    test_ret++;
18618            printf(" %d", n_buf);
18619            printf("\n");
18620        }
18621    }
18622    function_tests++;
18623
18624    return(test_ret);
18625}
18626
18627
18628static int
18629test_xmlBufferCreate(void) {
18630    int test_ret = 0;
18631
18632    int mem_base;
18633    xmlBufferPtr ret_val;
18634
18635        mem_base = xmlMemBlocks();
18636
18637        ret_val = xmlBufferCreate();
18638        desret_xmlBufferPtr(ret_val);
18639        call_tests++;
18640        xmlResetLastError();
18641        if (mem_base != xmlMemBlocks()) {
18642            printf("Leak of %d blocks found in xmlBufferCreate",
18643	           xmlMemBlocks() - mem_base);
18644	    test_ret++;
18645            printf("\n");
18646        }
18647    function_tests++;
18648
18649    return(test_ret);
18650}
18651
18652
18653static int
18654test_xmlBufferCreateSize(void) {
18655    int test_ret = 0;
18656
18657
18658    /* missing type support */
18659    return(test_ret);
18660}
18661
18662
18663static int
18664test_xmlBufferCreateStatic(void) {
18665    int test_ret = 0;
18666
18667
18668    /* missing type support */
18669    return(test_ret);
18670}
18671
18672
18673static int
18674test_xmlBufferEmpty(void) {
18675    int test_ret = 0;
18676
18677    int mem_base;
18678    xmlBufferPtr buf; /* the buffer */
18679    int n_buf;
18680
18681    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18682        mem_base = xmlMemBlocks();
18683        buf = gen_xmlBufferPtr(n_buf, 0);
18684
18685        xmlBufferEmpty(buf);
18686        call_tests++;
18687        des_xmlBufferPtr(n_buf, buf, 0);
18688        xmlResetLastError();
18689        if (mem_base != xmlMemBlocks()) {
18690            printf("Leak of %d blocks found in xmlBufferEmpty",
18691	           xmlMemBlocks() - mem_base);
18692	    test_ret++;
18693            printf(" %d", n_buf);
18694            printf("\n");
18695        }
18696    }
18697    function_tests++;
18698
18699    return(test_ret);
18700}
18701
18702
18703static int
18704test_xmlBufferGrow(void) {
18705    int test_ret = 0;
18706
18707    int mem_base;
18708    int ret_val;
18709    xmlBufferPtr buf; /* the buffer */
18710    int n_buf;
18711    unsigned int len; /* the minimum free size to allocate */
18712    int n_len;
18713
18714    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18715    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18716        mem_base = xmlMemBlocks();
18717        buf = gen_xmlBufferPtr(n_buf, 0);
18718        len = gen_unsigned_int(n_len, 1);
18719
18720        ret_val = xmlBufferGrow(buf, len);
18721        desret_int(ret_val);
18722        call_tests++;
18723        des_xmlBufferPtr(n_buf, buf, 0);
18724        des_unsigned_int(n_len, len, 1);
18725        xmlResetLastError();
18726        if (mem_base != xmlMemBlocks()) {
18727            printf("Leak of %d blocks found in xmlBufferGrow",
18728	           xmlMemBlocks() - mem_base);
18729	    test_ret++;
18730            printf(" %d", n_buf);
18731            printf(" %d", n_len);
18732            printf("\n");
18733        }
18734    }
18735    }
18736    function_tests++;
18737
18738    return(test_ret);
18739}
18740
18741
18742static int
18743test_xmlBufferLength(void) {
18744    int test_ret = 0;
18745
18746    int mem_base;
18747    int ret_val;
18748    xmlBufferPtr buf; /* the buffer */
18749    int n_buf;
18750
18751    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18752        mem_base = xmlMemBlocks();
18753        buf = gen_const_xmlBufferPtr(n_buf, 0);
18754
18755        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18756        desret_int(ret_val);
18757        call_tests++;
18758        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18759        xmlResetLastError();
18760        if (mem_base != xmlMemBlocks()) {
18761            printf("Leak of %d blocks found in xmlBufferLength",
18762	           xmlMemBlocks() - mem_base);
18763	    test_ret++;
18764            printf(" %d", n_buf);
18765            printf("\n");
18766        }
18767    }
18768    function_tests++;
18769
18770    return(test_ret);
18771}
18772
18773
18774static int
18775test_xmlBufferResize(void) {
18776    int test_ret = 0;
18777
18778    int mem_base;
18779    int ret_val;
18780    xmlBufferPtr buf; /* the buffer to resize */
18781    int n_buf;
18782    unsigned int size; /* the desired size */
18783    int n_size;
18784
18785    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18786    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18787        mem_base = xmlMemBlocks();
18788        buf = gen_xmlBufferPtr(n_buf, 0);
18789        size = gen_unsigned_int(n_size, 1);
18790
18791        ret_val = xmlBufferResize(buf, size);
18792        desret_int(ret_val);
18793        call_tests++;
18794        des_xmlBufferPtr(n_buf, buf, 0);
18795        des_unsigned_int(n_size, size, 1);
18796        xmlResetLastError();
18797        if (mem_base != xmlMemBlocks()) {
18798            printf("Leak of %d blocks found in xmlBufferResize",
18799	           xmlMemBlocks() - mem_base);
18800	    test_ret++;
18801            printf(" %d", n_buf);
18802            printf(" %d", n_size);
18803            printf("\n");
18804        }
18805    }
18806    }
18807    function_tests++;
18808
18809    return(test_ret);
18810}
18811
18812
18813static int
18814test_xmlBufferSetAllocationScheme(void) {
18815    int test_ret = 0;
18816
18817    int mem_base;
18818    xmlBufferPtr buf; /* the buffer to tune */
18819    int n_buf;
18820    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18821    int n_scheme;
18822
18823    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18824    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18825        mem_base = xmlMemBlocks();
18826        buf = gen_xmlBufferPtr(n_buf, 0);
18827        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18828
18829        xmlBufferSetAllocationScheme(buf, scheme);
18830        call_tests++;
18831        des_xmlBufferPtr(n_buf, buf, 0);
18832        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18833        xmlResetLastError();
18834        if (mem_base != xmlMemBlocks()) {
18835            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18836	           xmlMemBlocks() - mem_base);
18837	    test_ret++;
18838            printf(" %d", n_buf);
18839            printf(" %d", n_scheme);
18840            printf("\n");
18841        }
18842    }
18843    }
18844    function_tests++;
18845
18846    return(test_ret);
18847}
18848
18849
18850static int
18851test_xmlBufferShrink(void) {
18852    int test_ret = 0;
18853
18854    int mem_base;
18855    int ret_val;
18856    xmlBufferPtr buf; /* the buffer to dump */
18857    int n_buf;
18858    unsigned int len; /* the number of xmlChar to remove */
18859    int n_len;
18860
18861    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18862    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18863        mem_base = xmlMemBlocks();
18864        buf = gen_xmlBufferPtr(n_buf, 0);
18865        len = gen_unsigned_int(n_len, 1);
18866
18867        ret_val = xmlBufferShrink(buf, len);
18868        desret_int(ret_val);
18869        call_tests++;
18870        des_xmlBufferPtr(n_buf, buf, 0);
18871        des_unsigned_int(n_len, len, 1);
18872        xmlResetLastError();
18873        if (mem_base != xmlMemBlocks()) {
18874            printf("Leak of %d blocks found in xmlBufferShrink",
18875	           xmlMemBlocks() - mem_base);
18876	    test_ret++;
18877            printf(" %d", n_buf);
18878            printf(" %d", n_len);
18879            printf("\n");
18880        }
18881    }
18882    }
18883    function_tests++;
18884
18885    return(test_ret);
18886}
18887
18888
18889static int
18890test_xmlBufferWriteCHAR(void) {
18891    int test_ret = 0;
18892
18893    int mem_base;
18894    xmlBufferPtr buf; /* the XML buffer */
18895    int n_buf;
18896    xmlChar * string; /* the string to add */
18897    int n_string;
18898
18899    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18900    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18901        mem_base = xmlMemBlocks();
18902        buf = gen_xmlBufferPtr(n_buf, 0);
18903        string = gen_const_xmlChar_ptr(n_string, 1);
18904
18905        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18906        call_tests++;
18907        des_xmlBufferPtr(n_buf, buf, 0);
18908        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18909        xmlResetLastError();
18910        if (mem_base != xmlMemBlocks()) {
18911            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18912	           xmlMemBlocks() - mem_base);
18913	    test_ret++;
18914            printf(" %d", n_buf);
18915            printf(" %d", n_string);
18916            printf("\n");
18917        }
18918    }
18919    }
18920    function_tests++;
18921
18922    return(test_ret);
18923}
18924
18925
18926static int
18927test_xmlBufferWriteChar(void) {
18928    int test_ret = 0;
18929
18930    int mem_base;
18931    xmlBufferPtr buf; /* the XML buffer output */
18932    int n_buf;
18933    char * string; /* the string to add */
18934    int n_string;
18935
18936    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18937    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18938        mem_base = xmlMemBlocks();
18939        buf = gen_xmlBufferPtr(n_buf, 0);
18940        string = gen_const_char_ptr(n_string, 1);
18941
18942        xmlBufferWriteChar(buf, (const char *)string);
18943        call_tests++;
18944        des_xmlBufferPtr(n_buf, buf, 0);
18945        des_const_char_ptr(n_string, (const char *)string, 1);
18946        xmlResetLastError();
18947        if (mem_base != xmlMemBlocks()) {
18948            printf("Leak of %d blocks found in xmlBufferWriteChar",
18949	           xmlMemBlocks() - mem_base);
18950	    test_ret++;
18951            printf(" %d", n_buf);
18952            printf(" %d", n_string);
18953            printf("\n");
18954        }
18955    }
18956    }
18957    function_tests++;
18958
18959    return(test_ret);
18960}
18961
18962
18963static int
18964test_xmlBufferWriteQuotedString(void) {
18965    int test_ret = 0;
18966
18967    int mem_base;
18968    xmlBufferPtr buf; /* the XML buffer output */
18969    int n_buf;
18970    xmlChar * string; /* the string to add */
18971    int n_string;
18972
18973    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18974    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18975        mem_base = xmlMemBlocks();
18976        buf = gen_xmlBufferPtr(n_buf, 0);
18977        string = gen_const_xmlChar_ptr(n_string, 1);
18978
18979        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18980        call_tests++;
18981        des_xmlBufferPtr(n_buf, buf, 0);
18982        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18983        xmlResetLastError();
18984        if (mem_base != xmlMemBlocks()) {
18985            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18986	           xmlMemBlocks() - mem_base);
18987	    test_ret++;
18988            printf(" %d", n_buf);
18989            printf(" %d", n_string);
18990            printf("\n");
18991        }
18992    }
18993    }
18994    function_tests++;
18995
18996    return(test_ret);
18997}
18998
18999
19000static int
19001test_xmlBuildQName(void) {
19002    int test_ret = 0;
19003
19004    int mem_base;
19005    xmlChar * ret_val;
19006    xmlChar * ncname; /* the Name */
19007    int n_ncname;
19008    xmlChar * prefix; /* the prefix */
19009    int n_prefix;
19010    xmlChar * memory; /* preallocated memory */
19011    int n_memory;
19012    int len; /* preallocated memory length */
19013    int n_len;
19014
19015    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19016    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19017    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19018    for (n_len = 0;n_len < gen_nb_int;n_len++) {
19019        mem_base = xmlMemBlocks();
19020        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19021        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19022        memory = gen_xmlChar_ptr(n_memory, 2);
19023        len = gen_int(n_len, 3);
19024
19025        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19026        if ((ret_val != NULL) && (ret_val != ncname) &&
19027              (ret_val != prefix) && (ret_val != memory))
19028              xmlFree(ret_val);
19029	  ret_val = NULL;
19030        desret_xmlChar_ptr(ret_val);
19031        call_tests++;
19032        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19033        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19034        des_xmlChar_ptr(n_memory, memory, 2);
19035        des_int(n_len, len, 3);
19036        xmlResetLastError();
19037        if (mem_base != xmlMemBlocks()) {
19038            printf("Leak of %d blocks found in xmlBuildQName",
19039	           xmlMemBlocks() - mem_base);
19040	    test_ret++;
19041            printf(" %d", n_ncname);
19042            printf(" %d", n_prefix);
19043            printf(" %d", n_memory);
19044            printf(" %d", n_len);
19045            printf("\n");
19046        }
19047    }
19048    }
19049    }
19050    }
19051    function_tests++;
19052
19053    return(test_ret);
19054}
19055
19056
19057static int
19058test_xmlCopyDoc(void) {
19059    int test_ret = 0;
19060
19061#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19062    int mem_base;
19063    xmlDocPtr ret_val;
19064    xmlDocPtr doc; /* the document */
19065    int n_doc;
19066    int recursive; /* if not zero do a recursive copy. */
19067    int n_recursive;
19068
19069    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19070    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19071        mem_base = xmlMemBlocks();
19072        doc = gen_xmlDocPtr(n_doc, 0);
19073        recursive = gen_int(n_recursive, 1);
19074
19075        ret_val = xmlCopyDoc(doc, recursive);
19076        desret_xmlDocPtr(ret_val);
19077        call_tests++;
19078        des_xmlDocPtr(n_doc, doc, 0);
19079        des_int(n_recursive, recursive, 1);
19080        xmlResetLastError();
19081        if (mem_base != xmlMemBlocks()) {
19082            printf("Leak of %d blocks found in xmlCopyDoc",
19083	           xmlMemBlocks() - mem_base);
19084	    test_ret++;
19085            printf(" %d", n_doc);
19086            printf(" %d", n_recursive);
19087            printf("\n");
19088        }
19089    }
19090    }
19091    function_tests++;
19092#endif
19093
19094    return(test_ret);
19095}
19096
19097
19098static int
19099test_xmlCopyDtd(void) {
19100    int test_ret = 0;
19101
19102#if defined(LIBXML_TREE_ENABLED)
19103    int mem_base;
19104    xmlDtdPtr ret_val;
19105    xmlDtdPtr dtd; /* the dtd */
19106    int n_dtd;
19107
19108    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19109        mem_base = xmlMemBlocks();
19110        dtd = gen_xmlDtdPtr(n_dtd, 0);
19111
19112        ret_val = xmlCopyDtd(dtd);
19113        desret_xmlDtdPtr(ret_val);
19114        call_tests++;
19115        des_xmlDtdPtr(n_dtd, dtd, 0);
19116        xmlResetLastError();
19117        if (mem_base != xmlMemBlocks()) {
19118            printf("Leak of %d blocks found in xmlCopyDtd",
19119	           xmlMemBlocks() - mem_base);
19120	    test_ret++;
19121            printf(" %d", n_dtd);
19122            printf("\n");
19123        }
19124    }
19125    function_tests++;
19126#endif
19127
19128    return(test_ret);
19129}
19130
19131
19132static int
19133test_xmlCopyNamespace(void) {
19134    int test_ret = 0;
19135
19136    int mem_base;
19137    xmlNsPtr ret_val;
19138    xmlNsPtr cur; /* the namespace */
19139    int n_cur;
19140
19141    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19142        mem_base = xmlMemBlocks();
19143        cur = gen_xmlNsPtr(n_cur, 0);
19144
19145        ret_val = xmlCopyNamespace(cur);
19146        if (ret_val != NULL) xmlFreeNs(ret_val);
19147        desret_xmlNsPtr(ret_val);
19148        call_tests++;
19149        des_xmlNsPtr(n_cur, cur, 0);
19150        xmlResetLastError();
19151        if (mem_base != xmlMemBlocks()) {
19152            printf("Leak of %d blocks found in xmlCopyNamespace",
19153	           xmlMemBlocks() - mem_base);
19154	    test_ret++;
19155            printf(" %d", n_cur);
19156            printf("\n");
19157        }
19158    }
19159    function_tests++;
19160
19161    return(test_ret);
19162}
19163
19164
19165static int
19166test_xmlCopyNamespaceList(void) {
19167    int test_ret = 0;
19168
19169    int mem_base;
19170    xmlNsPtr ret_val;
19171    xmlNsPtr cur; /* the first namespace */
19172    int n_cur;
19173
19174    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19175        mem_base = xmlMemBlocks();
19176        cur = gen_xmlNsPtr(n_cur, 0);
19177
19178        ret_val = xmlCopyNamespaceList(cur);
19179        if (ret_val != NULL) xmlFreeNsList(ret_val);
19180        desret_xmlNsPtr(ret_val);
19181        call_tests++;
19182        des_xmlNsPtr(n_cur, cur, 0);
19183        xmlResetLastError();
19184        if (mem_base != xmlMemBlocks()) {
19185            printf("Leak of %d blocks found in xmlCopyNamespaceList",
19186	           xmlMemBlocks() - mem_base);
19187	    test_ret++;
19188            printf(" %d", n_cur);
19189            printf("\n");
19190        }
19191    }
19192    function_tests++;
19193
19194    return(test_ret);
19195}
19196
19197
19198static int
19199test_xmlCopyNode(void) {
19200    int test_ret = 0;
19201
19202    int mem_base;
19203    xmlNodePtr ret_val;
19204    xmlNodePtr node; /* the node */
19205    int n_node;
19206    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19207    int n_extended;
19208
19209    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19210    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19211        mem_base = xmlMemBlocks();
19212        node = gen_const_xmlNodePtr(n_node, 0);
19213        extended = gen_int(n_extended, 1);
19214
19215        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19216        desret_xmlNodePtr(ret_val);
19217        call_tests++;
19218        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19219        des_int(n_extended, extended, 1);
19220        xmlResetLastError();
19221        if (mem_base != xmlMemBlocks()) {
19222            printf("Leak of %d blocks found in xmlCopyNode",
19223	           xmlMemBlocks() - mem_base);
19224	    test_ret++;
19225            printf(" %d", n_node);
19226            printf(" %d", n_extended);
19227            printf("\n");
19228        }
19229    }
19230    }
19231    function_tests++;
19232
19233    return(test_ret);
19234}
19235
19236
19237static int
19238test_xmlCopyNodeList(void) {
19239    int test_ret = 0;
19240
19241    int mem_base;
19242    xmlNodePtr ret_val;
19243    xmlNodePtr node; /* the first node in the list. */
19244    int n_node;
19245
19246    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19247        mem_base = xmlMemBlocks();
19248        node = gen_const_xmlNodePtr(n_node, 0);
19249
19250        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19251        desret_xmlNodePtr(ret_val);
19252        call_tests++;
19253        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19254        xmlResetLastError();
19255        if (mem_base != xmlMemBlocks()) {
19256            printf("Leak of %d blocks found in xmlCopyNodeList",
19257	           xmlMemBlocks() - mem_base);
19258	    test_ret++;
19259            printf(" %d", n_node);
19260            printf("\n");
19261        }
19262    }
19263    function_tests++;
19264
19265    return(test_ret);
19266}
19267
19268
19269static int
19270test_xmlCopyProp(void) {
19271    int test_ret = 0;
19272
19273    int mem_base;
19274    xmlAttrPtr ret_val;
19275    xmlNodePtr target; /* the element where the attribute will be grafted */
19276    int n_target;
19277    xmlAttrPtr cur; /* the attribute */
19278    int n_cur;
19279
19280    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19281    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19282        mem_base = xmlMemBlocks();
19283        target = gen_xmlNodePtr(n_target, 0);
19284        cur = gen_xmlAttrPtr(n_cur, 1);
19285
19286        ret_val = xmlCopyProp(target, cur);
19287        desret_xmlAttrPtr(ret_val);
19288        call_tests++;
19289        des_xmlNodePtr(n_target, target, 0);
19290        des_xmlAttrPtr(n_cur, cur, 1);
19291        xmlResetLastError();
19292        if (mem_base != xmlMemBlocks()) {
19293            printf("Leak of %d blocks found in xmlCopyProp",
19294	           xmlMemBlocks() - mem_base);
19295	    test_ret++;
19296            printf(" %d", n_target);
19297            printf(" %d", n_cur);
19298            printf("\n");
19299        }
19300    }
19301    }
19302    function_tests++;
19303
19304    return(test_ret);
19305}
19306
19307
19308static int
19309test_xmlCopyPropList(void) {
19310    int test_ret = 0;
19311
19312    int mem_base;
19313    xmlAttrPtr ret_val;
19314    xmlNodePtr target; /* the element where the attributes will be grafted */
19315    int n_target;
19316    xmlAttrPtr cur; /* the first attribute */
19317    int n_cur;
19318
19319    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19320    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19321        mem_base = xmlMemBlocks();
19322        target = gen_xmlNodePtr(n_target, 0);
19323        cur = gen_xmlAttrPtr(n_cur, 1);
19324
19325        ret_val = xmlCopyPropList(target, cur);
19326        desret_xmlAttrPtr(ret_val);
19327        call_tests++;
19328        des_xmlNodePtr(n_target, target, 0);
19329        des_xmlAttrPtr(n_cur, cur, 1);
19330        xmlResetLastError();
19331        if (mem_base != xmlMemBlocks()) {
19332            printf("Leak of %d blocks found in xmlCopyPropList",
19333	           xmlMemBlocks() - mem_base);
19334	    test_ret++;
19335            printf(" %d", n_target);
19336            printf(" %d", n_cur);
19337            printf("\n");
19338        }
19339    }
19340    }
19341    function_tests++;
19342
19343    return(test_ret);
19344}
19345
19346
19347static int
19348test_xmlCreateIntSubset(void) {
19349    int test_ret = 0;
19350
19351    int mem_base;
19352    xmlDtdPtr ret_val;
19353    xmlDocPtr doc; /* the document pointer */
19354    int n_doc;
19355    xmlChar * name; /* the DTD name */
19356    int n_name;
19357    xmlChar * ExternalID; /* the external (PUBLIC) ID */
19358    int n_ExternalID;
19359    xmlChar * SystemID; /* the system ID */
19360    int n_SystemID;
19361
19362    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19363    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19364    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19365    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19366        mem_base = xmlMemBlocks();
19367        doc = gen_xmlDocPtr(n_doc, 0);
19368        name = gen_const_xmlChar_ptr(n_name, 1);
19369        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19370        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19371
19372        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19373        desret_xmlDtdPtr(ret_val);
19374        call_tests++;
19375        des_xmlDocPtr(n_doc, doc, 0);
19376        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19377        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19378        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19379        xmlResetLastError();
19380        if (mem_base != xmlMemBlocks()) {
19381            printf("Leak of %d blocks found in xmlCreateIntSubset",
19382	           xmlMemBlocks() - mem_base);
19383	    test_ret++;
19384            printf(" %d", n_doc);
19385            printf(" %d", n_name);
19386            printf(" %d", n_ExternalID);
19387            printf(" %d", n_SystemID);
19388            printf("\n");
19389        }
19390    }
19391    }
19392    }
19393    }
19394    function_tests++;
19395
19396    return(test_ret);
19397}
19398
19399
19400#define gen_nb_xmlDOMWrapCtxtPtr 1
19401static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19402    return(NULL);
19403}
19404static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19405}
19406
19407static int
19408test_xmlDOMWrapAdoptNode(void) {
19409    int test_ret = 0;
19410
19411    int mem_base;
19412    int ret_val;
19413    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19414    int n_ctxt;
19415    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19416    int n_sourceDoc;
19417    xmlNodePtr node; /* the node to start with */
19418    int n_node;
19419    xmlDocPtr destDoc; /* the destination doc */
19420    int n_destDoc;
19421    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19422    int n_destParent;
19423    int options; /* option flags */
19424    int n_options;
19425
19426    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19427    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19428    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19429    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19430    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19431    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19432        mem_base = xmlMemBlocks();
19433        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19434        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19435        node = gen_xmlNodePtr(n_node, 2);
19436        destDoc = gen_xmlDocPtr(n_destDoc, 3);
19437        destParent = gen_xmlNodePtr(n_destParent, 4);
19438        options = gen_int(n_options, 5);
19439
19440        ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19441        if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19442        desret_int(ret_val);
19443        call_tests++;
19444        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19445        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19446        des_xmlNodePtr(n_node, node, 2);
19447        des_xmlDocPtr(n_destDoc, destDoc, 3);
19448        des_xmlNodePtr(n_destParent, destParent, 4);
19449        des_int(n_options, options, 5);
19450        xmlResetLastError();
19451        if (mem_base != xmlMemBlocks()) {
19452            printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19453	           xmlMemBlocks() - mem_base);
19454	    test_ret++;
19455            printf(" %d", n_ctxt);
19456            printf(" %d", n_sourceDoc);
19457            printf(" %d", n_node);
19458            printf(" %d", n_destDoc);
19459            printf(" %d", n_destParent);
19460            printf(" %d", n_options);
19461            printf("\n");
19462        }
19463    }
19464    }
19465    }
19466    }
19467    }
19468    }
19469    function_tests++;
19470
19471    return(test_ret);
19472}
19473
19474
19475static int
19476test_xmlDOMWrapCloneNode(void) {
19477    int test_ret = 0;
19478
19479    int mem_base;
19480    int ret_val;
19481    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19482    int n_ctxt;
19483    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19484    int n_sourceDoc;
19485    xmlNodePtr node; /* the node to start with */
19486    int n_node;
19487    xmlNodePtr * resNode; /* the clone of the given @node */
19488    int n_resNode;
19489    xmlDocPtr destDoc; /* the destination doc */
19490    int n_destDoc;
19491    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19492    int n_destParent;
19493    int deep; /* descend into child if set */
19494    int n_deep;
19495    int options; /* option flags */
19496    int n_options;
19497
19498    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19499    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19500    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19501    for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19502    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19503    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19504    for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19505    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19506        mem_base = xmlMemBlocks();
19507        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19508        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19509        node = gen_xmlNodePtr(n_node, 2);
19510        resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19511        destDoc = gen_xmlDocPtr(n_destDoc, 4);
19512        destParent = gen_xmlNodePtr(n_destParent, 5);
19513        deep = gen_int(n_deep, 6);
19514        options = gen_int(n_options, 7);
19515
19516        ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19517        desret_int(ret_val);
19518        call_tests++;
19519        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19520        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19521        des_xmlNodePtr(n_node, node, 2);
19522        des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19523        des_xmlDocPtr(n_destDoc, destDoc, 4);
19524        des_xmlNodePtr(n_destParent, destParent, 5);
19525        des_int(n_deep, deep, 6);
19526        des_int(n_options, options, 7);
19527        xmlResetLastError();
19528        if (mem_base != xmlMemBlocks()) {
19529            printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19530	           xmlMemBlocks() - mem_base);
19531	    test_ret++;
19532            printf(" %d", n_ctxt);
19533            printf(" %d", n_sourceDoc);
19534            printf(" %d", n_node);
19535            printf(" %d", n_resNode);
19536            printf(" %d", n_destDoc);
19537            printf(" %d", n_destParent);
19538            printf(" %d", n_deep);
19539            printf(" %d", n_options);
19540            printf("\n");
19541        }
19542    }
19543    }
19544    }
19545    }
19546    }
19547    }
19548    }
19549    }
19550    function_tests++;
19551
19552    return(test_ret);
19553}
19554
19555
19556static int
19557test_xmlDOMWrapNewCtxt(void) {
19558    int test_ret = 0;
19559
19560
19561    /* missing type support */
19562    return(test_ret);
19563}
19564
19565
19566static int
19567test_xmlDOMWrapReconcileNamespaces(void) {
19568    int test_ret = 0;
19569
19570    int mem_base;
19571    int ret_val;
19572    xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19573    int n_ctxt;
19574    xmlNodePtr elem; /* the element-node */
19575    int n_elem;
19576    int options; /* option flags */
19577    int n_options;
19578
19579    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19580    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19581    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19582        mem_base = xmlMemBlocks();
19583        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19584        elem = gen_xmlNodePtr(n_elem, 1);
19585        options = gen_int(n_options, 2);
19586
19587        ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19588        desret_int(ret_val);
19589        call_tests++;
19590        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19591        des_xmlNodePtr(n_elem, elem, 1);
19592        des_int(n_options, options, 2);
19593        xmlResetLastError();
19594        if (mem_base != xmlMemBlocks()) {
19595            printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19596	           xmlMemBlocks() - mem_base);
19597	    test_ret++;
19598            printf(" %d", n_ctxt);
19599            printf(" %d", n_elem);
19600            printf(" %d", n_options);
19601            printf("\n");
19602        }
19603    }
19604    }
19605    }
19606    function_tests++;
19607
19608    return(test_ret);
19609}
19610
19611
19612static int
19613test_xmlDOMWrapRemoveNode(void) {
19614    int test_ret = 0;
19615
19616    int mem_base;
19617    int ret_val;
19618    xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19619    int n_ctxt;
19620    xmlDocPtr doc; /* the doc */
19621    int n_doc;
19622    xmlNodePtr node; /* the node to be removed. */
19623    int n_node;
19624    int options; /* set of options, unused at the moment */
19625    int n_options;
19626
19627    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19628    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19629    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19630    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19631        mem_base = xmlMemBlocks();
19632        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19633        doc = gen_xmlDocPtr(n_doc, 1);
19634        node = gen_xmlNodePtr(n_node, 2);
19635        options = gen_int(n_options, 3);
19636
19637        ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19638        desret_int(ret_val);
19639        call_tests++;
19640        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19641        des_xmlDocPtr(n_doc, doc, 1);
19642        des_xmlNodePtr(n_node, node, 2);
19643        des_int(n_options, options, 3);
19644        xmlResetLastError();
19645        if (mem_base != xmlMemBlocks()) {
19646            printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19647	           xmlMemBlocks() - mem_base);
19648	    test_ret++;
19649            printf(" %d", n_ctxt);
19650            printf(" %d", n_doc);
19651            printf(" %d", n_node);
19652            printf(" %d", n_options);
19653            printf("\n");
19654        }
19655    }
19656    }
19657    }
19658    }
19659    function_tests++;
19660
19661    return(test_ret);
19662}
19663
19664
19665static int
19666test_xmlDocCopyNode(void) {
19667    int test_ret = 0;
19668
19669    int mem_base;
19670    xmlNodePtr ret_val;
19671    xmlNodePtr node; /* the node */
19672    int n_node;
19673    xmlDocPtr doc; /* the document */
19674    int n_doc;
19675    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19676    int n_extended;
19677
19678    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19679    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19680    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19681        mem_base = xmlMemBlocks();
19682        node = gen_const_xmlNodePtr(n_node, 0);
19683        doc = gen_xmlDocPtr(n_doc, 1);
19684        extended = gen_int(n_extended, 2);
19685
19686        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19687        desret_xmlNodePtr(ret_val);
19688        call_tests++;
19689        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19690        des_xmlDocPtr(n_doc, doc, 1);
19691        des_int(n_extended, extended, 2);
19692        xmlResetLastError();
19693        if (mem_base != xmlMemBlocks()) {
19694            printf("Leak of %d blocks found in xmlDocCopyNode",
19695	           xmlMemBlocks() - mem_base);
19696	    test_ret++;
19697            printf(" %d", n_node);
19698            printf(" %d", n_doc);
19699            printf(" %d", n_extended);
19700            printf("\n");
19701        }
19702    }
19703    }
19704    }
19705    function_tests++;
19706
19707    return(test_ret);
19708}
19709
19710
19711static int
19712test_xmlDocCopyNodeList(void) {
19713    int test_ret = 0;
19714
19715    int mem_base;
19716    xmlNodePtr ret_val;
19717    xmlDocPtr doc; /* the target document */
19718    int n_doc;
19719    xmlNodePtr node; /* the first node in the list. */
19720    int n_node;
19721
19722    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19723    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19724        mem_base = xmlMemBlocks();
19725        doc = gen_xmlDocPtr(n_doc, 0);
19726        node = gen_const_xmlNodePtr(n_node, 1);
19727
19728        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19729        desret_xmlNodePtr(ret_val);
19730        call_tests++;
19731        des_xmlDocPtr(n_doc, doc, 0);
19732        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19733        xmlResetLastError();
19734        if (mem_base != xmlMemBlocks()) {
19735            printf("Leak of %d blocks found in xmlDocCopyNodeList",
19736	           xmlMemBlocks() - mem_base);
19737	    test_ret++;
19738            printf(" %d", n_doc);
19739            printf(" %d", n_node);
19740            printf("\n");
19741        }
19742    }
19743    }
19744    function_tests++;
19745
19746    return(test_ret);
19747}
19748
19749
19750static int
19751test_xmlDocDump(void) {
19752    int test_ret = 0;
19753
19754#if defined(LIBXML_OUTPUT_ENABLED)
19755    int mem_base;
19756    int ret_val;
19757    FILE * f; /* the FILE* */
19758    int n_f;
19759    xmlDocPtr cur; /* the document */
19760    int n_cur;
19761
19762    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19763    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19764        mem_base = xmlMemBlocks();
19765        f = gen_FILE_ptr(n_f, 0);
19766        cur = gen_xmlDocPtr(n_cur, 1);
19767
19768        ret_val = xmlDocDump(f, cur);
19769        desret_int(ret_val);
19770        call_tests++;
19771        des_FILE_ptr(n_f, f, 0);
19772        des_xmlDocPtr(n_cur, cur, 1);
19773        xmlResetLastError();
19774        if (mem_base != xmlMemBlocks()) {
19775            printf("Leak of %d blocks found in xmlDocDump",
19776	           xmlMemBlocks() - mem_base);
19777	    test_ret++;
19778            printf(" %d", n_f);
19779            printf(" %d", n_cur);
19780            printf("\n");
19781        }
19782    }
19783    }
19784    function_tests++;
19785#endif
19786
19787    return(test_ret);
19788}
19789
19790
19791static int
19792test_xmlDocDumpFormatMemory(void) {
19793    int test_ret = 0;
19794
19795#if defined(LIBXML_OUTPUT_ENABLED)
19796    int mem_base;
19797    xmlDocPtr cur; /* the document */
19798    int n_cur;
19799    xmlChar ** mem; /* OUT: the memory pointer */
19800    int n_mem;
19801    int * size; /* OUT: the memory length */
19802    int n_size;
19803    int format; /* should formatting spaces been added */
19804    int n_format;
19805
19806    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19807    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19808    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19809    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19810        mem_base = xmlMemBlocks();
19811        cur = gen_xmlDocPtr(n_cur, 0);
19812        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19813        size = gen_int_ptr(n_size, 2);
19814        format = gen_int(n_format, 3);
19815
19816        xmlDocDumpFormatMemory(cur, mem, size, format);
19817        call_tests++;
19818        des_xmlDocPtr(n_cur, cur, 0);
19819        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19820        des_int_ptr(n_size, size, 2);
19821        des_int(n_format, format, 3);
19822        xmlResetLastError();
19823        if (mem_base != xmlMemBlocks()) {
19824            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19825	           xmlMemBlocks() - mem_base);
19826	    test_ret++;
19827            printf(" %d", n_cur);
19828            printf(" %d", n_mem);
19829            printf(" %d", n_size);
19830            printf(" %d", n_format);
19831            printf("\n");
19832        }
19833    }
19834    }
19835    }
19836    }
19837    function_tests++;
19838#endif
19839
19840    return(test_ret);
19841}
19842
19843
19844static int
19845test_xmlDocDumpFormatMemoryEnc(void) {
19846    int test_ret = 0;
19847
19848#if defined(LIBXML_OUTPUT_ENABLED)
19849    int mem_base;
19850    xmlDocPtr out_doc; /* Document to generate XML text from */
19851    int n_out_doc;
19852    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19853    int n_doc_txt_ptr;
19854    int * doc_txt_len; /* Length of the generated XML text */
19855    int n_doc_txt_len;
19856    char * txt_encoding; /* Character encoding to use when generating XML text */
19857    int n_txt_encoding;
19858    int format; /* should formatting spaces been added */
19859    int n_format;
19860
19861    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19862    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19863    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19864    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19865    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19866        mem_base = xmlMemBlocks();
19867        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19868        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19869        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19870        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19871        format = gen_int(n_format, 4);
19872
19873        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19874        call_tests++;
19875        des_xmlDocPtr(n_out_doc, out_doc, 0);
19876        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19877        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19878        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19879        des_int(n_format, format, 4);
19880        xmlResetLastError();
19881        if (mem_base != xmlMemBlocks()) {
19882            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19883	           xmlMemBlocks() - mem_base);
19884	    test_ret++;
19885            printf(" %d", n_out_doc);
19886            printf(" %d", n_doc_txt_ptr);
19887            printf(" %d", n_doc_txt_len);
19888            printf(" %d", n_txt_encoding);
19889            printf(" %d", n_format);
19890            printf("\n");
19891        }
19892    }
19893    }
19894    }
19895    }
19896    }
19897    function_tests++;
19898#endif
19899
19900    return(test_ret);
19901}
19902
19903
19904static int
19905test_xmlDocDumpMemory(void) {
19906    int test_ret = 0;
19907
19908#if defined(LIBXML_OUTPUT_ENABLED)
19909    int mem_base;
19910    xmlDocPtr cur; /* the document */
19911    int n_cur;
19912    xmlChar ** mem; /* OUT: the memory pointer */
19913    int n_mem;
19914    int * size; /* OUT: the memory length */
19915    int n_size;
19916
19917    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19918    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19919    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19920        mem_base = xmlMemBlocks();
19921        cur = gen_xmlDocPtr(n_cur, 0);
19922        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19923        size = gen_int_ptr(n_size, 2);
19924
19925        xmlDocDumpMemory(cur, mem, size);
19926        call_tests++;
19927        des_xmlDocPtr(n_cur, cur, 0);
19928        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19929        des_int_ptr(n_size, size, 2);
19930        xmlResetLastError();
19931        if (mem_base != xmlMemBlocks()) {
19932            printf("Leak of %d blocks found in xmlDocDumpMemory",
19933	           xmlMemBlocks() - mem_base);
19934	    test_ret++;
19935            printf(" %d", n_cur);
19936            printf(" %d", n_mem);
19937            printf(" %d", n_size);
19938            printf("\n");
19939        }
19940    }
19941    }
19942    }
19943    function_tests++;
19944#endif
19945
19946    return(test_ret);
19947}
19948
19949
19950static int
19951test_xmlDocDumpMemoryEnc(void) {
19952    int test_ret = 0;
19953
19954#if defined(LIBXML_OUTPUT_ENABLED)
19955    int mem_base;
19956    xmlDocPtr out_doc; /* Document to generate XML text from */
19957    int n_out_doc;
19958    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19959    int n_doc_txt_ptr;
19960    int * doc_txt_len; /* Length of the generated XML text */
19961    int n_doc_txt_len;
19962    char * txt_encoding; /* Character encoding to use when generating XML text */
19963    int n_txt_encoding;
19964
19965    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19966    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19967    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19968    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19969        mem_base = xmlMemBlocks();
19970        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19971        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19972        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19973        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19974
19975        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19976        call_tests++;
19977        des_xmlDocPtr(n_out_doc, out_doc, 0);
19978        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19979        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19980        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19981        xmlResetLastError();
19982        if (mem_base != xmlMemBlocks()) {
19983            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19984	           xmlMemBlocks() - mem_base);
19985	    test_ret++;
19986            printf(" %d", n_out_doc);
19987            printf(" %d", n_doc_txt_ptr);
19988            printf(" %d", n_doc_txt_len);
19989            printf(" %d", n_txt_encoding);
19990            printf("\n");
19991        }
19992    }
19993    }
19994    }
19995    }
19996    function_tests++;
19997#endif
19998
19999    return(test_ret);
20000}
20001
20002
20003static int
20004test_xmlDocFormatDump(void) {
20005    int test_ret = 0;
20006
20007#if defined(LIBXML_OUTPUT_ENABLED)
20008    int mem_base;
20009    int ret_val;
20010    FILE * f; /* the FILE* */
20011    int n_f;
20012    xmlDocPtr cur; /* the document */
20013    int n_cur;
20014    int format; /* should formatting spaces been added */
20015    int n_format;
20016
20017    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20018    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20019    for (n_format = 0;n_format < gen_nb_int;n_format++) {
20020        mem_base = xmlMemBlocks();
20021        f = gen_FILE_ptr(n_f, 0);
20022        cur = gen_xmlDocPtr(n_cur, 1);
20023        format = gen_int(n_format, 2);
20024
20025        ret_val = xmlDocFormatDump(f, cur, format);
20026        desret_int(ret_val);
20027        call_tests++;
20028        des_FILE_ptr(n_f, f, 0);
20029        des_xmlDocPtr(n_cur, cur, 1);
20030        des_int(n_format, format, 2);
20031        xmlResetLastError();
20032        if (mem_base != xmlMemBlocks()) {
20033            printf("Leak of %d blocks found in xmlDocFormatDump",
20034	           xmlMemBlocks() - mem_base);
20035	    test_ret++;
20036            printf(" %d", n_f);
20037            printf(" %d", n_cur);
20038            printf(" %d", n_format);
20039            printf("\n");
20040        }
20041    }
20042    }
20043    }
20044    function_tests++;
20045#endif
20046
20047    return(test_ret);
20048}
20049
20050
20051static int
20052test_xmlDocGetRootElement(void) {
20053    int test_ret = 0;
20054
20055    int mem_base;
20056    xmlNodePtr ret_val;
20057    xmlDocPtr doc; /* the document */
20058    int n_doc;
20059
20060    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20061        mem_base = xmlMemBlocks();
20062        doc = gen_xmlDocPtr(n_doc, 0);
20063
20064        ret_val = xmlDocGetRootElement(doc);
20065        desret_xmlNodePtr(ret_val);
20066        call_tests++;
20067        des_xmlDocPtr(n_doc, doc, 0);
20068        xmlResetLastError();
20069        if (mem_base != xmlMemBlocks()) {
20070            printf("Leak of %d blocks found in xmlDocGetRootElement",
20071	           xmlMemBlocks() - mem_base);
20072	    test_ret++;
20073            printf(" %d", n_doc);
20074            printf("\n");
20075        }
20076    }
20077    function_tests++;
20078
20079    return(test_ret);
20080}
20081
20082
20083static int
20084test_xmlDocSetRootElement(void) {
20085    int test_ret = 0;
20086
20087#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20088    int mem_base;
20089    xmlNodePtr ret_val;
20090    xmlDocPtr doc; /* the document */
20091    int n_doc;
20092    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. */
20093    int n_root;
20094
20095    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20096    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20097        mem_base = xmlMemBlocks();
20098        doc = gen_xmlDocPtr(n_doc, 0);
20099        root = gen_xmlNodePtr_in(n_root, 1);
20100
20101        ret_val = xmlDocSetRootElement(doc, root);
20102        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20103        desret_xmlNodePtr(ret_val);
20104        call_tests++;
20105        des_xmlDocPtr(n_doc, doc, 0);
20106        des_xmlNodePtr_in(n_root, root, 1);
20107        xmlResetLastError();
20108        if (mem_base != xmlMemBlocks()) {
20109            printf("Leak of %d blocks found in xmlDocSetRootElement",
20110	           xmlMemBlocks() - mem_base);
20111	    test_ret++;
20112            printf(" %d", n_doc);
20113            printf(" %d", n_root);
20114            printf("\n");
20115        }
20116    }
20117    }
20118    function_tests++;
20119#endif
20120
20121    return(test_ret);
20122}
20123
20124
20125static int
20126test_xmlElemDump(void) {
20127    int test_ret = 0;
20128
20129#if defined(LIBXML_OUTPUT_ENABLED)
20130    int mem_base;
20131    FILE * f; /* the FILE * for the output */
20132    int n_f;
20133    xmlDocPtr doc; /* the document */
20134    int n_doc;
20135    xmlNodePtr cur; /* the current node */
20136    int n_cur;
20137
20138    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20139    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20140    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20141        mem_base = xmlMemBlocks();
20142        f = gen_FILE_ptr(n_f, 0);
20143        doc = gen_xmlDocPtr(n_doc, 1);
20144        cur = gen_xmlNodePtr(n_cur, 2);
20145
20146        xmlElemDump(f, doc, cur);
20147        call_tests++;
20148        des_FILE_ptr(n_f, f, 0);
20149        des_xmlDocPtr(n_doc, doc, 1);
20150        des_xmlNodePtr(n_cur, cur, 2);
20151        xmlResetLastError();
20152        if (mem_base != xmlMemBlocks()) {
20153            printf("Leak of %d blocks found in xmlElemDump",
20154	           xmlMemBlocks() - mem_base);
20155	    test_ret++;
20156            printf(" %d", n_f);
20157            printf(" %d", n_doc);
20158            printf(" %d", n_cur);
20159            printf("\n");
20160        }
20161    }
20162    }
20163    }
20164    function_tests++;
20165#endif
20166
20167    return(test_ret);
20168}
20169
20170
20171static int
20172test_xmlGetBufferAllocationScheme(void) {
20173    int test_ret = 0;
20174
20175    int mem_base;
20176    xmlBufferAllocationScheme ret_val;
20177
20178        mem_base = xmlMemBlocks();
20179
20180        ret_val = xmlGetBufferAllocationScheme();
20181        desret_xmlBufferAllocationScheme(ret_val);
20182        call_tests++;
20183        xmlResetLastError();
20184        if (mem_base != xmlMemBlocks()) {
20185            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20186	           xmlMemBlocks() - mem_base);
20187	    test_ret++;
20188            printf("\n");
20189        }
20190    function_tests++;
20191
20192    return(test_ret);
20193}
20194
20195
20196static int
20197test_xmlGetCompressMode(void) {
20198    int test_ret = 0;
20199
20200    int mem_base;
20201    int ret_val;
20202
20203        mem_base = xmlMemBlocks();
20204
20205        ret_val = xmlGetCompressMode();
20206        desret_int(ret_val);
20207        call_tests++;
20208        xmlResetLastError();
20209        if (mem_base != xmlMemBlocks()) {
20210            printf("Leak of %d blocks found in xmlGetCompressMode",
20211	           xmlMemBlocks() - mem_base);
20212	    test_ret++;
20213            printf("\n");
20214        }
20215    function_tests++;
20216
20217    return(test_ret);
20218}
20219
20220
20221static int
20222test_xmlGetDocCompressMode(void) {
20223    int test_ret = 0;
20224
20225    int mem_base;
20226    int ret_val;
20227    xmlDocPtr doc; /* the document */
20228    int n_doc;
20229
20230    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20231        mem_base = xmlMemBlocks();
20232        doc = gen_xmlDocPtr(n_doc, 0);
20233
20234        ret_val = xmlGetDocCompressMode(doc);
20235        desret_int(ret_val);
20236        call_tests++;
20237        des_xmlDocPtr(n_doc, doc, 0);
20238        xmlResetLastError();
20239        if (mem_base != xmlMemBlocks()) {
20240            printf("Leak of %d blocks found in xmlGetDocCompressMode",
20241	           xmlMemBlocks() - mem_base);
20242	    test_ret++;
20243            printf(" %d", n_doc);
20244            printf("\n");
20245        }
20246    }
20247    function_tests++;
20248
20249    return(test_ret);
20250}
20251
20252
20253static int
20254test_xmlGetIntSubset(void) {
20255    int test_ret = 0;
20256
20257    int mem_base;
20258    xmlDtdPtr ret_val;
20259    xmlDocPtr doc; /* the document pointer */
20260    int n_doc;
20261
20262    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20263        mem_base = xmlMemBlocks();
20264        doc = gen_xmlDocPtr(n_doc, 0);
20265
20266        ret_val = xmlGetIntSubset(doc);
20267        desret_xmlDtdPtr(ret_val);
20268        call_tests++;
20269        des_xmlDocPtr(n_doc, doc, 0);
20270        xmlResetLastError();
20271        if (mem_base != xmlMemBlocks()) {
20272            printf("Leak of %d blocks found in xmlGetIntSubset",
20273	           xmlMemBlocks() - mem_base);
20274	    test_ret++;
20275            printf(" %d", n_doc);
20276            printf("\n");
20277        }
20278    }
20279    function_tests++;
20280
20281    return(test_ret);
20282}
20283
20284
20285static int
20286test_xmlGetLastChild(void) {
20287    int test_ret = 0;
20288
20289    int mem_base;
20290    xmlNodePtr ret_val;
20291    xmlNodePtr parent; /* the parent node */
20292    int n_parent;
20293
20294    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20295        mem_base = xmlMemBlocks();
20296        parent = gen_xmlNodePtr(n_parent, 0);
20297
20298        ret_val = xmlGetLastChild(parent);
20299        desret_xmlNodePtr(ret_val);
20300        call_tests++;
20301        des_xmlNodePtr(n_parent, parent, 0);
20302        xmlResetLastError();
20303        if (mem_base != xmlMemBlocks()) {
20304            printf("Leak of %d blocks found in xmlGetLastChild",
20305	           xmlMemBlocks() - mem_base);
20306	    test_ret++;
20307            printf(" %d", n_parent);
20308            printf("\n");
20309        }
20310    }
20311    function_tests++;
20312
20313    return(test_ret);
20314}
20315
20316
20317static int
20318test_xmlGetLineNo(void) {
20319    int test_ret = 0;
20320
20321    int mem_base;
20322    long ret_val;
20323    xmlNodePtr node; /* valid node */
20324    int n_node;
20325
20326    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20327        mem_base = xmlMemBlocks();
20328        node = gen_xmlNodePtr(n_node, 0);
20329
20330        ret_val = xmlGetLineNo(node);
20331        desret_long(ret_val);
20332        call_tests++;
20333        des_xmlNodePtr(n_node, node, 0);
20334        xmlResetLastError();
20335        if (mem_base != xmlMemBlocks()) {
20336            printf("Leak of %d blocks found in xmlGetLineNo",
20337	           xmlMemBlocks() - mem_base);
20338	    test_ret++;
20339            printf(" %d", n_node);
20340            printf("\n");
20341        }
20342    }
20343    function_tests++;
20344
20345    return(test_ret);
20346}
20347
20348
20349static int
20350test_xmlGetNoNsProp(void) {
20351    int test_ret = 0;
20352
20353    int mem_base;
20354    xmlChar * ret_val;
20355    xmlNodePtr node; /* the node */
20356    int n_node;
20357    xmlChar * name; /* the attribute name */
20358    int n_name;
20359
20360    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20361    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20362        mem_base = xmlMemBlocks();
20363        node = gen_xmlNodePtr(n_node, 0);
20364        name = gen_const_xmlChar_ptr(n_name, 1);
20365
20366        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20367        desret_xmlChar_ptr(ret_val);
20368        call_tests++;
20369        des_xmlNodePtr(n_node, node, 0);
20370        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20371        xmlResetLastError();
20372        if (mem_base != xmlMemBlocks()) {
20373            printf("Leak of %d blocks found in xmlGetNoNsProp",
20374	           xmlMemBlocks() - mem_base);
20375	    test_ret++;
20376            printf(" %d", n_node);
20377            printf(" %d", n_name);
20378            printf("\n");
20379        }
20380    }
20381    }
20382    function_tests++;
20383
20384    return(test_ret);
20385}
20386
20387
20388static int
20389test_xmlGetNodePath(void) {
20390    int test_ret = 0;
20391
20392#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20393    int mem_base;
20394    xmlChar * ret_val;
20395    xmlNodePtr node; /* a node */
20396    int n_node;
20397
20398    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20399        mem_base = xmlMemBlocks();
20400        node = gen_xmlNodePtr(n_node, 0);
20401
20402        ret_val = xmlGetNodePath(node);
20403        desret_xmlChar_ptr(ret_val);
20404        call_tests++;
20405        des_xmlNodePtr(n_node, node, 0);
20406        xmlResetLastError();
20407        if (mem_base != xmlMemBlocks()) {
20408            printf("Leak of %d blocks found in xmlGetNodePath",
20409	           xmlMemBlocks() - mem_base);
20410	    test_ret++;
20411            printf(" %d", n_node);
20412            printf("\n");
20413        }
20414    }
20415    function_tests++;
20416#endif
20417
20418    return(test_ret);
20419}
20420
20421
20422static int
20423test_xmlGetNsList(void) {
20424    int test_ret = 0;
20425
20426
20427    /* missing type support */
20428    return(test_ret);
20429}
20430
20431
20432static int
20433test_xmlGetNsProp(void) {
20434    int test_ret = 0;
20435
20436    int mem_base;
20437    xmlChar * ret_val;
20438    xmlNodePtr node; /* the node */
20439    int n_node;
20440    xmlChar * name; /* the attribute name */
20441    int n_name;
20442    xmlChar * nameSpace; /* the URI of the namespace */
20443    int n_nameSpace;
20444
20445    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20446    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20447    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20448        mem_base = xmlMemBlocks();
20449        node = gen_xmlNodePtr(n_node, 0);
20450        name = gen_const_xmlChar_ptr(n_name, 1);
20451        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20452
20453        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20454        desret_xmlChar_ptr(ret_val);
20455        call_tests++;
20456        des_xmlNodePtr(n_node, node, 0);
20457        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20458        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20459        xmlResetLastError();
20460        if (mem_base != xmlMemBlocks()) {
20461            printf("Leak of %d blocks found in xmlGetNsProp",
20462	           xmlMemBlocks() - mem_base);
20463	    test_ret++;
20464            printf(" %d", n_node);
20465            printf(" %d", n_name);
20466            printf(" %d", n_nameSpace);
20467            printf("\n");
20468        }
20469    }
20470    }
20471    }
20472    function_tests++;
20473
20474    return(test_ret);
20475}
20476
20477
20478static int
20479test_xmlGetProp(void) {
20480    int test_ret = 0;
20481
20482    int mem_base;
20483    xmlChar * ret_val;
20484    xmlNodePtr node; /* the node */
20485    int n_node;
20486    xmlChar * name; /* the attribute name */
20487    int n_name;
20488
20489    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20490    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20491        mem_base = xmlMemBlocks();
20492        node = gen_xmlNodePtr(n_node, 0);
20493        name = gen_const_xmlChar_ptr(n_name, 1);
20494
20495        ret_val = xmlGetProp(node, (const xmlChar *)name);
20496        desret_xmlChar_ptr(ret_val);
20497        call_tests++;
20498        des_xmlNodePtr(n_node, node, 0);
20499        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20500        xmlResetLastError();
20501        if (mem_base != xmlMemBlocks()) {
20502            printf("Leak of %d blocks found in xmlGetProp",
20503	           xmlMemBlocks() - mem_base);
20504	    test_ret++;
20505            printf(" %d", n_node);
20506            printf(" %d", n_name);
20507            printf("\n");
20508        }
20509    }
20510    }
20511    function_tests++;
20512
20513    return(test_ret);
20514}
20515
20516
20517static int
20518test_xmlHasNsProp(void) {
20519    int test_ret = 0;
20520
20521    int mem_base;
20522    xmlAttrPtr ret_val;
20523    xmlNodePtr node; /* the node */
20524    int n_node;
20525    xmlChar * name; /* the attribute name */
20526    int n_name;
20527    xmlChar * nameSpace; /* the URI of the namespace */
20528    int n_nameSpace;
20529
20530    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20531    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20532    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20533        mem_base = xmlMemBlocks();
20534        node = gen_xmlNodePtr(n_node, 0);
20535        name = gen_const_xmlChar_ptr(n_name, 1);
20536        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20537
20538        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20539        desret_xmlAttrPtr(ret_val);
20540        call_tests++;
20541        des_xmlNodePtr(n_node, node, 0);
20542        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20543        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20544        xmlResetLastError();
20545        if (mem_base != xmlMemBlocks()) {
20546            printf("Leak of %d blocks found in xmlHasNsProp",
20547	           xmlMemBlocks() - mem_base);
20548	    test_ret++;
20549            printf(" %d", n_node);
20550            printf(" %d", n_name);
20551            printf(" %d", n_nameSpace);
20552            printf("\n");
20553        }
20554    }
20555    }
20556    }
20557    function_tests++;
20558
20559    return(test_ret);
20560}
20561
20562
20563static int
20564test_xmlHasProp(void) {
20565    int test_ret = 0;
20566
20567    int mem_base;
20568    xmlAttrPtr ret_val;
20569    xmlNodePtr node; /* the node */
20570    int n_node;
20571    xmlChar * name; /* the attribute name */
20572    int n_name;
20573
20574    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20575    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20576        mem_base = xmlMemBlocks();
20577        node = gen_xmlNodePtr(n_node, 0);
20578        name = gen_const_xmlChar_ptr(n_name, 1);
20579
20580        ret_val = xmlHasProp(node, (const xmlChar *)name);
20581        desret_xmlAttrPtr(ret_val);
20582        call_tests++;
20583        des_xmlNodePtr(n_node, node, 0);
20584        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20585        xmlResetLastError();
20586        if (mem_base != xmlMemBlocks()) {
20587            printf("Leak of %d blocks found in xmlHasProp",
20588	           xmlMemBlocks() - mem_base);
20589	    test_ret++;
20590            printf(" %d", n_node);
20591            printf(" %d", n_name);
20592            printf("\n");
20593        }
20594    }
20595    }
20596    function_tests++;
20597
20598    return(test_ret);
20599}
20600
20601
20602static int
20603test_xmlIsBlankNode(void) {
20604    int test_ret = 0;
20605
20606    int mem_base;
20607    int ret_val;
20608    xmlNodePtr node; /* the node */
20609    int n_node;
20610
20611    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20612        mem_base = xmlMemBlocks();
20613        node = gen_xmlNodePtr(n_node, 0);
20614
20615        ret_val = xmlIsBlankNode(node);
20616        desret_int(ret_val);
20617        call_tests++;
20618        des_xmlNodePtr(n_node, node, 0);
20619        xmlResetLastError();
20620        if (mem_base != xmlMemBlocks()) {
20621            printf("Leak of %d blocks found in xmlIsBlankNode",
20622	           xmlMemBlocks() - mem_base);
20623	    test_ret++;
20624            printf(" %d", n_node);
20625            printf("\n");
20626        }
20627    }
20628    function_tests++;
20629
20630    return(test_ret);
20631}
20632
20633
20634static int
20635test_xmlIsXHTML(void) {
20636    int test_ret = 0;
20637
20638    int mem_base;
20639    int ret_val;
20640    xmlChar * systemID; /* the system identifier */
20641    int n_systemID;
20642    xmlChar * publicID; /* the public identifier */
20643    int n_publicID;
20644
20645    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20646    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20647        mem_base = xmlMemBlocks();
20648        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20649        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20650
20651        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20652        desret_int(ret_val);
20653        call_tests++;
20654        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20655        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20656        xmlResetLastError();
20657        if (mem_base != xmlMemBlocks()) {
20658            printf("Leak of %d blocks found in xmlIsXHTML",
20659	           xmlMemBlocks() - mem_base);
20660	    test_ret++;
20661            printf(" %d", n_systemID);
20662            printf(" %d", n_publicID);
20663            printf("\n");
20664        }
20665    }
20666    }
20667    function_tests++;
20668
20669    return(test_ret);
20670}
20671
20672
20673static int
20674test_xmlNewCDataBlock(void) {
20675    int test_ret = 0;
20676
20677    int mem_base;
20678    xmlNodePtr ret_val;
20679    xmlDocPtr doc; /* the document */
20680    int n_doc;
20681    xmlChar * content; /* the CDATA block content content */
20682    int n_content;
20683    int len; /* the length of the block */
20684    int n_len;
20685
20686    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20687    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20688    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20689        mem_base = xmlMemBlocks();
20690        doc = gen_xmlDocPtr(n_doc, 0);
20691        content = gen_const_xmlChar_ptr(n_content, 1);
20692        len = gen_int(n_len, 2);
20693
20694        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20695        desret_xmlNodePtr(ret_val);
20696        call_tests++;
20697        des_xmlDocPtr(n_doc, doc, 0);
20698        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20699        des_int(n_len, len, 2);
20700        xmlResetLastError();
20701        if (mem_base != xmlMemBlocks()) {
20702            printf("Leak of %d blocks found in xmlNewCDataBlock",
20703	           xmlMemBlocks() - mem_base);
20704	    test_ret++;
20705            printf(" %d", n_doc);
20706            printf(" %d", n_content);
20707            printf(" %d", n_len);
20708            printf("\n");
20709        }
20710    }
20711    }
20712    }
20713    function_tests++;
20714
20715    return(test_ret);
20716}
20717
20718
20719static int
20720test_xmlNewCharRef(void) {
20721    int test_ret = 0;
20722
20723    int mem_base;
20724    xmlNodePtr ret_val;
20725    xmlDocPtr doc; /* the document */
20726    int n_doc;
20727    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20728    int n_name;
20729
20730    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20731    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20732        mem_base = xmlMemBlocks();
20733        doc = gen_xmlDocPtr(n_doc, 0);
20734        name = gen_const_xmlChar_ptr(n_name, 1);
20735
20736        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20737        desret_xmlNodePtr(ret_val);
20738        call_tests++;
20739        des_xmlDocPtr(n_doc, doc, 0);
20740        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20741        xmlResetLastError();
20742        if (mem_base != xmlMemBlocks()) {
20743            printf("Leak of %d blocks found in xmlNewCharRef",
20744	           xmlMemBlocks() - mem_base);
20745	    test_ret++;
20746            printf(" %d", n_doc);
20747            printf(" %d", n_name);
20748            printf("\n");
20749        }
20750    }
20751    }
20752    function_tests++;
20753
20754    return(test_ret);
20755}
20756
20757
20758static int
20759test_xmlNewChild(void) {
20760    int test_ret = 0;
20761
20762#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20763#ifdef LIBXML_TREE_ENABLED
20764    int mem_base;
20765    xmlNodePtr ret_val;
20766    xmlNodePtr parent; /* the parent node */
20767    int n_parent;
20768    xmlNsPtr ns; /* a namespace if any */
20769    int n_ns;
20770    xmlChar * name; /* the name of the child */
20771    int n_name;
20772    xmlChar * content; /* the XML content of the child if any. */
20773    int n_content;
20774
20775    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20776    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20777    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20778    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20779        mem_base = xmlMemBlocks();
20780        parent = gen_xmlNodePtr(n_parent, 0);
20781        ns = gen_xmlNsPtr(n_ns, 1);
20782        name = gen_const_xmlChar_ptr(n_name, 2);
20783        content = gen_const_xmlChar_ptr(n_content, 3);
20784
20785        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20786        desret_xmlNodePtr(ret_val);
20787        call_tests++;
20788        des_xmlNodePtr(n_parent, parent, 0);
20789        des_xmlNsPtr(n_ns, ns, 1);
20790        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20791        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20792        xmlResetLastError();
20793        if (mem_base != xmlMemBlocks()) {
20794            printf("Leak of %d blocks found in xmlNewChild",
20795	           xmlMemBlocks() - mem_base);
20796	    test_ret++;
20797            printf(" %d", n_parent);
20798            printf(" %d", n_ns);
20799            printf(" %d", n_name);
20800            printf(" %d", n_content);
20801            printf("\n");
20802        }
20803    }
20804    }
20805    }
20806    }
20807    function_tests++;
20808#endif
20809#endif
20810
20811    return(test_ret);
20812}
20813
20814
20815static int
20816test_xmlNewComment(void) {
20817    int test_ret = 0;
20818
20819    int mem_base;
20820    xmlNodePtr ret_val;
20821    xmlChar * content; /* the comment content */
20822    int n_content;
20823
20824    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20825        mem_base = xmlMemBlocks();
20826        content = gen_const_xmlChar_ptr(n_content, 0);
20827
20828        ret_val = xmlNewComment((const xmlChar *)content);
20829        desret_xmlNodePtr(ret_val);
20830        call_tests++;
20831        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20832        xmlResetLastError();
20833        if (mem_base != xmlMemBlocks()) {
20834            printf("Leak of %d blocks found in xmlNewComment",
20835	           xmlMemBlocks() - mem_base);
20836	    test_ret++;
20837            printf(" %d", n_content);
20838            printf("\n");
20839        }
20840    }
20841    function_tests++;
20842
20843    return(test_ret);
20844}
20845
20846
20847static int
20848test_xmlNewDoc(void) {
20849    int test_ret = 0;
20850
20851    int mem_base;
20852    xmlDocPtr ret_val;
20853    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20854    int n_version;
20855
20856    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20857        mem_base = xmlMemBlocks();
20858        version = gen_const_xmlChar_ptr(n_version, 0);
20859
20860        ret_val = xmlNewDoc((const xmlChar *)version);
20861        desret_xmlDocPtr(ret_val);
20862        call_tests++;
20863        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20864        xmlResetLastError();
20865        if (mem_base != xmlMemBlocks()) {
20866            printf("Leak of %d blocks found in xmlNewDoc",
20867	           xmlMemBlocks() - mem_base);
20868	    test_ret++;
20869            printf(" %d", n_version);
20870            printf("\n");
20871        }
20872    }
20873    function_tests++;
20874
20875    return(test_ret);
20876}
20877
20878
20879static int
20880test_xmlNewDocComment(void) {
20881    int test_ret = 0;
20882
20883    int mem_base;
20884    xmlNodePtr ret_val;
20885    xmlDocPtr doc; /* the document */
20886    int n_doc;
20887    xmlChar * content; /* the comment content */
20888    int n_content;
20889
20890    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20891    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20892        mem_base = xmlMemBlocks();
20893        doc = gen_xmlDocPtr(n_doc, 0);
20894        content = gen_const_xmlChar_ptr(n_content, 1);
20895
20896        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20897        desret_xmlNodePtr(ret_val);
20898        call_tests++;
20899        des_xmlDocPtr(n_doc, doc, 0);
20900        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20901        xmlResetLastError();
20902        if (mem_base != xmlMemBlocks()) {
20903            printf("Leak of %d blocks found in xmlNewDocComment",
20904	           xmlMemBlocks() - mem_base);
20905	    test_ret++;
20906            printf(" %d", n_doc);
20907            printf(" %d", n_content);
20908            printf("\n");
20909        }
20910    }
20911    }
20912    function_tests++;
20913
20914    return(test_ret);
20915}
20916
20917
20918static int
20919test_xmlNewDocFragment(void) {
20920    int test_ret = 0;
20921
20922#if defined(LIBXML_TREE_ENABLED)
20923    int mem_base;
20924    xmlNodePtr ret_val;
20925    xmlDocPtr doc; /* the document owning the fragment */
20926    int n_doc;
20927
20928    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20929        mem_base = xmlMemBlocks();
20930        doc = gen_xmlDocPtr(n_doc, 0);
20931
20932        ret_val = xmlNewDocFragment(doc);
20933        desret_xmlNodePtr(ret_val);
20934        call_tests++;
20935        des_xmlDocPtr(n_doc, doc, 0);
20936        xmlResetLastError();
20937        if (mem_base != xmlMemBlocks()) {
20938            printf("Leak of %d blocks found in xmlNewDocFragment",
20939	           xmlMemBlocks() - mem_base);
20940	    test_ret++;
20941            printf(" %d", n_doc);
20942            printf("\n");
20943        }
20944    }
20945    function_tests++;
20946#endif
20947
20948    return(test_ret);
20949}
20950
20951
20952static int
20953test_xmlNewDocNode(void) {
20954    int test_ret = 0;
20955
20956    int mem_base;
20957    xmlNodePtr ret_val;
20958    xmlDocPtr doc; /* the document */
20959    int n_doc;
20960    xmlNsPtr ns; /* namespace if any */
20961    int n_ns;
20962    xmlChar * name; /* the node name */
20963    int n_name;
20964    xmlChar * content; /* the XML text content if any */
20965    int n_content;
20966
20967    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20968    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20969    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20970    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20971        mem_base = xmlMemBlocks();
20972        doc = gen_xmlDocPtr(n_doc, 0);
20973        ns = gen_xmlNsPtr(n_ns, 1);
20974        name = gen_const_xmlChar_ptr(n_name, 2);
20975        content = gen_const_xmlChar_ptr(n_content, 3);
20976
20977        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20978        desret_xmlNodePtr(ret_val);
20979        call_tests++;
20980        des_xmlDocPtr(n_doc, doc, 0);
20981        des_xmlNsPtr(n_ns, ns, 1);
20982        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20983        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20984        xmlResetLastError();
20985        if (mem_base != xmlMemBlocks()) {
20986            printf("Leak of %d blocks found in xmlNewDocNode",
20987	           xmlMemBlocks() - mem_base);
20988	    test_ret++;
20989            printf(" %d", n_doc);
20990            printf(" %d", n_ns);
20991            printf(" %d", n_name);
20992            printf(" %d", n_content);
20993            printf("\n");
20994        }
20995    }
20996    }
20997    }
20998    }
20999    function_tests++;
21000
21001    return(test_ret);
21002}
21003
21004
21005static int
21006test_xmlNewDocNodeEatName(void) {
21007    int test_ret = 0;
21008
21009    int mem_base;
21010    xmlNodePtr ret_val;
21011    xmlDocPtr doc; /* the document */
21012    int n_doc;
21013    xmlNsPtr ns; /* namespace if any */
21014    int n_ns;
21015    xmlChar * name; /* the node name */
21016    int n_name;
21017    xmlChar * content; /* the XML text content if any */
21018    int n_content;
21019
21020    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21021    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21022    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21023    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21024        mem_base = xmlMemBlocks();
21025        doc = gen_xmlDocPtr(n_doc, 0);
21026        ns = gen_xmlNsPtr(n_ns, 1);
21027        name = gen_eaten_name(n_name, 2);
21028        content = gen_const_xmlChar_ptr(n_content, 3);
21029
21030        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21031        desret_xmlNodePtr(ret_val);
21032        call_tests++;
21033        des_xmlDocPtr(n_doc, doc, 0);
21034        des_xmlNsPtr(n_ns, ns, 1);
21035        des_eaten_name(n_name, name, 2);
21036        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21037        xmlResetLastError();
21038        if (mem_base != xmlMemBlocks()) {
21039            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21040	           xmlMemBlocks() - mem_base);
21041	    test_ret++;
21042            printf(" %d", n_doc);
21043            printf(" %d", n_ns);
21044            printf(" %d", n_name);
21045            printf(" %d", n_content);
21046            printf("\n");
21047        }
21048    }
21049    }
21050    }
21051    }
21052    function_tests++;
21053
21054    return(test_ret);
21055}
21056
21057
21058static int
21059test_xmlNewDocPI(void) {
21060    int test_ret = 0;
21061
21062    int mem_base;
21063    xmlNodePtr ret_val;
21064    xmlDocPtr doc; /* the target document */
21065    int n_doc;
21066    xmlChar * name; /* the processing instruction name */
21067    int n_name;
21068    xmlChar * content; /* the PI content */
21069    int n_content;
21070
21071    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21072    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21073    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21074        mem_base = xmlMemBlocks();
21075        doc = gen_xmlDocPtr(n_doc, 0);
21076        name = gen_const_xmlChar_ptr(n_name, 1);
21077        content = gen_const_xmlChar_ptr(n_content, 2);
21078
21079        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21080        desret_xmlNodePtr(ret_val);
21081        call_tests++;
21082        des_xmlDocPtr(n_doc, doc, 0);
21083        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21084        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21085        xmlResetLastError();
21086        if (mem_base != xmlMemBlocks()) {
21087            printf("Leak of %d blocks found in xmlNewDocPI",
21088	           xmlMemBlocks() - mem_base);
21089	    test_ret++;
21090            printf(" %d", n_doc);
21091            printf(" %d", n_name);
21092            printf(" %d", n_content);
21093            printf("\n");
21094        }
21095    }
21096    }
21097    }
21098    function_tests++;
21099
21100    return(test_ret);
21101}
21102
21103
21104static int
21105test_xmlNewDocProp(void) {
21106    int test_ret = 0;
21107
21108    int mem_base;
21109    xmlAttrPtr ret_val;
21110    xmlDocPtr doc; /* the document */
21111    int n_doc;
21112    xmlChar * name; /* the name of the attribute */
21113    int n_name;
21114    xmlChar * value; /* the value of the attribute */
21115    int n_value;
21116
21117    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21118    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21119    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21120        mem_base = xmlMemBlocks();
21121        doc = gen_xmlDocPtr(n_doc, 0);
21122        name = gen_const_xmlChar_ptr(n_name, 1);
21123        value = gen_const_xmlChar_ptr(n_value, 2);
21124
21125        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21126        desret_xmlAttrPtr(ret_val);
21127        call_tests++;
21128        des_xmlDocPtr(n_doc, doc, 0);
21129        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21130        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21131        xmlResetLastError();
21132        if (mem_base != xmlMemBlocks()) {
21133            printf("Leak of %d blocks found in xmlNewDocProp",
21134	           xmlMemBlocks() - mem_base);
21135	    test_ret++;
21136            printf(" %d", n_doc);
21137            printf(" %d", n_name);
21138            printf(" %d", n_value);
21139            printf("\n");
21140        }
21141    }
21142    }
21143    }
21144    function_tests++;
21145
21146    return(test_ret);
21147}
21148
21149
21150static int
21151test_xmlNewDocRawNode(void) {
21152    int test_ret = 0;
21153
21154#if defined(LIBXML_TREE_ENABLED)
21155#ifdef LIBXML_TREE_ENABLED
21156    int mem_base;
21157    xmlNodePtr ret_val;
21158    xmlDocPtr doc; /* the document */
21159    int n_doc;
21160    xmlNsPtr ns; /* namespace if any */
21161    int n_ns;
21162    xmlChar * name; /* the node name */
21163    int n_name;
21164    xmlChar * content; /* the text content if any */
21165    int n_content;
21166
21167    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21168    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21169    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21170    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21171        mem_base = xmlMemBlocks();
21172        doc = gen_xmlDocPtr(n_doc, 0);
21173        ns = gen_xmlNsPtr(n_ns, 1);
21174        name = gen_const_xmlChar_ptr(n_name, 2);
21175        content = gen_const_xmlChar_ptr(n_content, 3);
21176
21177        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21178        desret_xmlNodePtr(ret_val);
21179        call_tests++;
21180        des_xmlDocPtr(n_doc, doc, 0);
21181        des_xmlNsPtr(n_ns, ns, 1);
21182        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21183        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21184        xmlResetLastError();
21185        if (mem_base != xmlMemBlocks()) {
21186            printf("Leak of %d blocks found in xmlNewDocRawNode",
21187	           xmlMemBlocks() - mem_base);
21188	    test_ret++;
21189            printf(" %d", n_doc);
21190            printf(" %d", n_ns);
21191            printf(" %d", n_name);
21192            printf(" %d", n_content);
21193            printf("\n");
21194        }
21195    }
21196    }
21197    }
21198    }
21199    function_tests++;
21200#endif
21201#endif
21202
21203    return(test_ret);
21204}
21205
21206
21207static int
21208test_xmlNewDocText(void) {
21209    int test_ret = 0;
21210
21211    int mem_base;
21212    xmlNodePtr ret_val;
21213    xmlDocPtr doc; /* the document */
21214    int n_doc;
21215    xmlChar * content; /* the text content */
21216    int n_content;
21217
21218    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21219    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21220        mem_base = xmlMemBlocks();
21221        doc = gen_xmlDocPtr(n_doc, 0);
21222        content = gen_const_xmlChar_ptr(n_content, 1);
21223
21224        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21225        desret_xmlNodePtr(ret_val);
21226        call_tests++;
21227        des_xmlDocPtr(n_doc, doc, 0);
21228        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21229        xmlResetLastError();
21230        if (mem_base != xmlMemBlocks()) {
21231            printf("Leak of %d blocks found in xmlNewDocText",
21232	           xmlMemBlocks() - mem_base);
21233	    test_ret++;
21234            printf(" %d", n_doc);
21235            printf(" %d", n_content);
21236            printf("\n");
21237        }
21238    }
21239    }
21240    function_tests++;
21241
21242    return(test_ret);
21243}
21244
21245
21246static int
21247test_xmlNewDocTextLen(void) {
21248    int test_ret = 0;
21249
21250    int mem_base;
21251    xmlNodePtr ret_val;
21252    xmlDocPtr doc; /* the document */
21253    int n_doc;
21254    xmlChar * content; /* the text content */
21255    int n_content;
21256    int len; /* the text len. */
21257    int n_len;
21258
21259    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21260    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21261    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21262        mem_base = xmlMemBlocks();
21263        doc = gen_xmlDocPtr(n_doc, 0);
21264        content = gen_const_xmlChar_ptr(n_content, 1);
21265        len = gen_int(n_len, 2);
21266
21267        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21268        desret_xmlNodePtr(ret_val);
21269        call_tests++;
21270        des_xmlDocPtr(n_doc, doc, 0);
21271        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21272        des_int(n_len, len, 2);
21273        xmlResetLastError();
21274        if (mem_base != xmlMemBlocks()) {
21275            printf("Leak of %d blocks found in xmlNewDocTextLen",
21276	           xmlMemBlocks() - mem_base);
21277	    test_ret++;
21278            printf(" %d", n_doc);
21279            printf(" %d", n_content);
21280            printf(" %d", n_len);
21281            printf("\n");
21282        }
21283    }
21284    }
21285    }
21286    function_tests++;
21287
21288    return(test_ret);
21289}
21290
21291
21292static int
21293test_xmlNewDtd(void) {
21294    int test_ret = 0;
21295
21296    int mem_base;
21297    xmlDtdPtr ret_val;
21298    xmlDocPtr doc; /* the document pointer */
21299    int n_doc;
21300    xmlChar * name; /* the DTD name */
21301    int n_name;
21302    xmlChar * ExternalID; /* the external ID */
21303    int n_ExternalID;
21304    xmlChar * SystemID; /* the system ID */
21305    int n_SystemID;
21306
21307    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21308    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21309    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21310    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21311        mem_base = xmlMemBlocks();
21312        doc = gen_xmlDocPtr(n_doc, 0);
21313        name = gen_const_xmlChar_ptr(n_name, 1);
21314        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21315        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21316
21317        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21318        desret_xmlDtdPtr(ret_val);
21319        call_tests++;
21320        des_xmlDocPtr(n_doc, doc, 0);
21321        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21322        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21323        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21324        xmlResetLastError();
21325        if (mem_base != xmlMemBlocks()) {
21326            printf("Leak of %d blocks found in xmlNewDtd",
21327	           xmlMemBlocks() - mem_base);
21328	    test_ret++;
21329            printf(" %d", n_doc);
21330            printf(" %d", n_name);
21331            printf(" %d", n_ExternalID);
21332            printf(" %d", n_SystemID);
21333            printf("\n");
21334        }
21335    }
21336    }
21337    }
21338    }
21339    function_tests++;
21340
21341    return(test_ret);
21342}
21343
21344
21345static int
21346test_xmlNewNode(void) {
21347    int test_ret = 0;
21348
21349    int mem_base;
21350    xmlNodePtr ret_val;
21351    xmlNsPtr ns; /* namespace if any */
21352    int n_ns;
21353    xmlChar * name; /* the node name */
21354    int n_name;
21355
21356    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21357    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21358        mem_base = xmlMemBlocks();
21359        ns = gen_xmlNsPtr(n_ns, 0);
21360        name = gen_const_xmlChar_ptr(n_name, 1);
21361
21362        ret_val = xmlNewNode(ns, (const xmlChar *)name);
21363        desret_xmlNodePtr(ret_val);
21364        call_tests++;
21365        des_xmlNsPtr(n_ns, ns, 0);
21366        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21367        xmlResetLastError();
21368        if (mem_base != xmlMemBlocks()) {
21369            printf("Leak of %d blocks found in xmlNewNode",
21370	           xmlMemBlocks() - mem_base);
21371	    test_ret++;
21372            printf(" %d", n_ns);
21373            printf(" %d", n_name);
21374            printf("\n");
21375        }
21376    }
21377    }
21378    function_tests++;
21379
21380    return(test_ret);
21381}
21382
21383
21384static int
21385test_xmlNewNodeEatName(void) {
21386    int test_ret = 0;
21387
21388    int mem_base;
21389    xmlNodePtr ret_val;
21390    xmlNsPtr ns; /* namespace if any */
21391    int n_ns;
21392    xmlChar * name; /* the node name */
21393    int n_name;
21394
21395    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21396    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21397        mem_base = xmlMemBlocks();
21398        ns = gen_xmlNsPtr(n_ns, 0);
21399        name = gen_eaten_name(n_name, 1);
21400
21401        ret_val = xmlNewNodeEatName(ns, name);
21402        desret_xmlNodePtr(ret_val);
21403        call_tests++;
21404        des_xmlNsPtr(n_ns, ns, 0);
21405        des_eaten_name(n_name, name, 1);
21406        xmlResetLastError();
21407        if (mem_base != xmlMemBlocks()) {
21408            printf("Leak of %d blocks found in xmlNewNodeEatName",
21409	           xmlMemBlocks() - mem_base);
21410	    test_ret++;
21411            printf(" %d", n_ns);
21412            printf(" %d", n_name);
21413            printf("\n");
21414        }
21415    }
21416    }
21417    function_tests++;
21418
21419    return(test_ret);
21420}
21421
21422
21423static int
21424test_xmlNewNs(void) {
21425    int test_ret = 0;
21426
21427    int mem_base;
21428    xmlNsPtr ret_val;
21429    xmlNodePtr node; /* the element carrying the namespace */
21430    int n_node;
21431    xmlChar * href; /* the URI associated */
21432    int n_href;
21433    xmlChar * prefix; /* the prefix for the namespace */
21434    int n_prefix;
21435
21436    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21437    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21438    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21439        mem_base = xmlMemBlocks();
21440        node = gen_xmlNodePtr(n_node, 0);
21441        href = gen_const_xmlChar_ptr(n_href, 1);
21442        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21443
21444        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21445        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21446        desret_xmlNsPtr(ret_val);
21447        call_tests++;
21448        des_xmlNodePtr(n_node, node, 0);
21449        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21450        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21451        xmlResetLastError();
21452        if (mem_base != xmlMemBlocks()) {
21453            printf("Leak of %d blocks found in xmlNewNs",
21454	           xmlMemBlocks() - mem_base);
21455	    test_ret++;
21456            printf(" %d", n_node);
21457            printf(" %d", n_href);
21458            printf(" %d", n_prefix);
21459            printf("\n");
21460        }
21461    }
21462    }
21463    }
21464    function_tests++;
21465
21466    return(test_ret);
21467}
21468
21469
21470static int
21471test_xmlNewNsProp(void) {
21472    int test_ret = 0;
21473
21474    int mem_base;
21475    xmlAttrPtr ret_val;
21476    xmlNodePtr node; /* the holding node */
21477    int n_node;
21478    xmlNsPtr ns; /* the namespace */
21479    int n_ns;
21480    xmlChar * name; /* the name of the attribute */
21481    int n_name;
21482    xmlChar * value; /* the value of the attribute */
21483    int n_value;
21484
21485    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21486    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21487    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21488    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21489        mem_base = xmlMemBlocks();
21490        node = gen_xmlNodePtr(n_node, 0);
21491        ns = gen_xmlNsPtr(n_ns, 1);
21492        name = gen_const_xmlChar_ptr(n_name, 2);
21493        value = gen_const_xmlChar_ptr(n_value, 3);
21494
21495        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21496        desret_xmlAttrPtr(ret_val);
21497        call_tests++;
21498        des_xmlNodePtr(n_node, node, 0);
21499        des_xmlNsPtr(n_ns, ns, 1);
21500        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21501        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21502        xmlResetLastError();
21503        if (mem_base != xmlMemBlocks()) {
21504            printf("Leak of %d blocks found in xmlNewNsProp",
21505	           xmlMemBlocks() - mem_base);
21506	    test_ret++;
21507            printf(" %d", n_node);
21508            printf(" %d", n_ns);
21509            printf(" %d", n_name);
21510            printf(" %d", n_value);
21511            printf("\n");
21512        }
21513    }
21514    }
21515    }
21516    }
21517    function_tests++;
21518
21519    return(test_ret);
21520}
21521
21522
21523static int
21524test_xmlNewNsPropEatName(void) {
21525    int test_ret = 0;
21526
21527    int mem_base;
21528    xmlAttrPtr ret_val;
21529    xmlNodePtr node; /* the holding node */
21530    int n_node;
21531    xmlNsPtr ns; /* the namespace */
21532    int n_ns;
21533    xmlChar * name; /* the name of the attribute */
21534    int n_name;
21535    xmlChar * value; /* the value of the attribute */
21536    int n_value;
21537
21538    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21539    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21540    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21541    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21542        mem_base = xmlMemBlocks();
21543        node = gen_xmlNodePtr(n_node, 0);
21544        ns = gen_xmlNsPtr(n_ns, 1);
21545        name = gen_eaten_name(n_name, 2);
21546        value = gen_const_xmlChar_ptr(n_value, 3);
21547
21548        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21549        desret_xmlAttrPtr(ret_val);
21550        call_tests++;
21551        des_xmlNodePtr(n_node, node, 0);
21552        des_xmlNsPtr(n_ns, ns, 1);
21553        des_eaten_name(n_name, name, 2);
21554        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21555        xmlResetLastError();
21556        if (mem_base != xmlMemBlocks()) {
21557            printf("Leak of %d blocks found in xmlNewNsPropEatName",
21558	           xmlMemBlocks() - mem_base);
21559	    test_ret++;
21560            printf(" %d", n_node);
21561            printf(" %d", n_ns);
21562            printf(" %d", n_name);
21563            printf(" %d", n_value);
21564            printf("\n");
21565        }
21566    }
21567    }
21568    }
21569    }
21570    function_tests++;
21571
21572    return(test_ret);
21573}
21574
21575
21576static int
21577test_xmlNewPI(void) {
21578    int test_ret = 0;
21579
21580    int mem_base;
21581    xmlNodePtr ret_val;
21582    xmlChar * name; /* the processing instruction name */
21583    int n_name;
21584    xmlChar * content; /* the PI content */
21585    int n_content;
21586
21587    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21588    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21589        mem_base = xmlMemBlocks();
21590        name = gen_const_xmlChar_ptr(n_name, 0);
21591        content = gen_const_xmlChar_ptr(n_content, 1);
21592
21593        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21594        desret_xmlNodePtr(ret_val);
21595        call_tests++;
21596        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21597        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21598        xmlResetLastError();
21599        if (mem_base != xmlMemBlocks()) {
21600            printf("Leak of %d blocks found in xmlNewPI",
21601	           xmlMemBlocks() - mem_base);
21602	    test_ret++;
21603            printf(" %d", n_name);
21604            printf(" %d", n_content);
21605            printf("\n");
21606        }
21607    }
21608    }
21609    function_tests++;
21610
21611    return(test_ret);
21612}
21613
21614
21615static int
21616test_xmlNewProp(void) {
21617    int test_ret = 0;
21618
21619#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21620#ifdef LIBXML_TREE_ENABLED
21621    int mem_base;
21622    xmlAttrPtr ret_val;
21623    xmlNodePtr node; /* the holding node */
21624    int n_node;
21625    xmlChar * name; /* the name of the attribute */
21626    int n_name;
21627    xmlChar * value; /* the value of the attribute */
21628    int n_value;
21629
21630    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21631    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21632    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21633        mem_base = xmlMemBlocks();
21634        node = gen_xmlNodePtr(n_node, 0);
21635        name = gen_const_xmlChar_ptr(n_name, 1);
21636        value = gen_const_xmlChar_ptr(n_value, 2);
21637
21638        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21639        desret_xmlAttrPtr(ret_val);
21640        call_tests++;
21641        des_xmlNodePtr(n_node, node, 0);
21642        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21643        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21644        xmlResetLastError();
21645        if (mem_base != xmlMemBlocks()) {
21646            printf("Leak of %d blocks found in xmlNewProp",
21647	           xmlMemBlocks() - mem_base);
21648	    test_ret++;
21649            printf(" %d", n_node);
21650            printf(" %d", n_name);
21651            printf(" %d", n_value);
21652            printf("\n");
21653        }
21654    }
21655    }
21656    }
21657    function_tests++;
21658#endif
21659#endif
21660
21661    return(test_ret);
21662}
21663
21664
21665static int
21666test_xmlNewReference(void) {
21667    int test_ret = 0;
21668
21669    int mem_base;
21670    xmlNodePtr ret_val;
21671    xmlDocPtr doc; /* the document */
21672    int n_doc;
21673    xmlChar * name; /* the reference name, or the reference string with & and ; */
21674    int n_name;
21675
21676    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21677    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21678        mem_base = xmlMemBlocks();
21679        doc = gen_xmlDocPtr(n_doc, 0);
21680        name = gen_const_xmlChar_ptr(n_name, 1);
21681
21682        ret_val = xmlNewReference(doc, (const xmlChar *)name);
21683        desret_xmlNodePtr(ret_val);
21684        call_tests++;
21685        des_xmlDocPtr(n_doc, doc, 0);
21686        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21687        xmlResetLastError();
21688        if (mem_base != xmlMemBlocks()) {
21689            printf("Leak of %d blocks found in xmlNewReference",
21690	           xmlMemBlocks() - mem_base);
21691	    test_ret++;
21692            printf(" %d", n_doc);
21693            printf(" %d", n_name);
21694            printf("\n");
21695        }
21696    }
21697    }
21698    function_tests++;
21699
21700    return(test_ret);
21701}
21702
21703
21704static int
21705test_xmlNewText(void) {
21706    int test_ret = 0;
21707
21708    int mem_base;
21709    xmlNodePtr ret_val;
21710    xmlChar * content; /* the text content */
21711    int n_content;
21712
21713    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21714        mem_base = xmlMemBlocks();
21715        content = gen_const_xmlChar_ptr(n_content, 0);
21716
21717        ret_val = xmlNewText((const xmlChar *)content);
21718        desret_xmlNodePtr(ret_val);
21719        call_tests++;
21720        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21721        xmlResetLastError();
21722        if (mem_base != xmlMemBlocks()) {
21723            printf("Leak of %d blocks found in xmlNewText",
21724	           xmlMemBlocks() - mem_base);
21725	    test_ret++;
21726            printf(" %d", n_content);
21727            printf("\n");
21728        }
21729    }
21730    function_tests++;
21731
21732    return(test_ret);
21733}
21734
21735
21736static int
21737test_xmlNewTextChild(void) {
21738    int test_ret = 0;
21739
21740#if defined(LIBXML_TREE_ENABLED)
21741#ifdef LIBXML_TREE_ENABLED
21742    int mem_base;
21743    xmlNodePtr ret_val;
21744    xmlNodePtr parent; /* the parent node */
21745    int n_parent;
21746    xmlNsPtr ns; /* a namespace if any */
21747    int n_ns;
21748    xmlChar * name; /* the name of the child */
21749    int n_name;
21750    xmlChar * content; /* the text content of the child if any. */
21751    int n_content;
21752
21753    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21754    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21755    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21756    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21757        mem_base = xmlMemBlocks();
21758        parent = gen_xmlNodePtr(n_parent, 0);
21759        ns = gen_xmlNsPtr(n_ns, 1);
21760        name = gen_const_xmlChar_ptr(n_name, 2);
21761        content = gen_const_xmlChar_ptr(n_content, 3);
21762
21763        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21764        desret_xmlNodePtr(ret_val);
21765        call_tests++;
21766        des_xmlNodePtr(n_parent, parent, 0);
21767        des_xmlNsPtr(n_ns, ns, 1);
21768        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21769        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21770        xmlResetLastError();
21771        if (mem_base != xmlMemBlocks()) {
21772            printf("Leak of %d blocks found in xmlNewTextChild",
21773	           xmlMemBlocks() - mem_base);
21774	    test_ret++;
21775            printf(" %d", n_parent);
21776            printf(" %d", n_ns);
21777            printf(" %d", n_name);
21778            printf(" %d", n_content);
21779            printf("\n");
21780        }
21781    }
21782    }
21783    }
21784    }
21785    function_tests++;
21786#endif
21787#endif
21788
21789    return(test_ret);
21790}
21791
21792
21793static int
21794test_xmlNewTextLen(void) {
21795    int test_ret = 0;
21796
21797    int mem_base;
21798    xmlNodePtr ret_val;
21799    xmlChar * content; /* the text content */
21800    int n_content;
21801    int len; /* the text len. */
21802    int n_len;
21803
21804    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21805    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21806        mem_base = xmlMemBlocks();
21807        content = gen_const_xmlChar_ptr(n_content, 0);
21808        len = gen_int(n_len, 1);
21809
21810        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21811        desret_xmlNodePtr(ret_val);
21812        call_tests++;
21813        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21814        des_int(n_len, len, 1);
21815        xmlResetLastError();
21816        if (mem_base != xmlMemBlocks()) {
21817            printf("Leak of %d blocks found in xmlNewTextLen",
21818	           xmlMemBlocks() - mem_base);
21819	    test_ret++;
21820            printf(" %d", n_content);
21821            printf(" %d", n_len);
21822            printf("\n");
21823        }
21824    }
21825    }
21826    function_tests++;
21827
21828    return(test_ret);
21829}
21830
21831
21832static int
21833test_xmlNodeAddContent(void) {
21834    int test_ret = 0;
21835
21836    int mem_base;
21837    xmlNodePtr cur; /* the node being modified */
21838    int n_cur;
21839    xmlChar * content; /* extra content */
21840    int n_content;
21841
21842    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21843    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21844        mem_base = xmlMemBlocks();
21845        cur = gen_xmlNodePtr(n_cur, 0);
21846        content = gen_const_xmlChar_ptr(n_content, 1);
21847
21848        xmlNodeAddContent(cur, (const xmlChar *)content);
21849        call_tests++;
21850        des_xmlNodePtr(n_cur, cur, 0);
21851        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21852        xmlResetLastError();
21853        if (mem_base != xmlMemBlocks()) {
21854            printf("Leak of %d blocks found in xmlNodeAddContent",
21855	           xmlMemBlocks() - mem_base);
21856	    test_ret++;
21857            printf(" %d", n_cur);
21858            printf(" %d", n_content);
21859            printf("\n");
21860        }
21861    }
21862    }
21863    function_tests++;
21864
21865    return(test_ret);
21866}
21867
21868
21869static int
21870test_xmlNodeAddContentLen(void) {
21871    int test_ret = 0;
21872
21873    int mem_base;
21874    xmlNodePtr cur; /* the node being modified */
21875    int n_cur;
21876    xmlChar * content; /* extra content */
21877    int n_content;
21878    int len; /* the size of @content */
21879    int n_len;
21880
21881    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21882    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21883    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21884        mem_base = xmlMemBlocks();
21885        cur = gen_xmlNodePtr(n_cur, 0);
21886        content = gen_const_xmlChar_ptr(n_content, 1);
21887        len = gen_int(n_len, 2);
21888
21889        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21890        call_tests++;
21891        des_xmlNodePtr(n_cur, cur, 0);
21892        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21893        des_int(n_len, len, 2);
21894        xmlResetLastError();
21895        if (mem_base != xmlMemBlocks()) {
21896            printf("Leak of %d blocks found in xmlNodeAddContentLen",
21897	           xmlMemBlocks() - mem_base);
21898	    test_ret++;
21899            printf(" %d", n_cur);
21900            printf(" %d", n_content);
21901            printf(" %d", n_len);
21902            printf("\n");
21903        }
21904    }
21905    }
21906    }
21907    function_tests++;
21908
21909    return(test_ret);
21910}
21911
21912
21913static int
21914test_xmlNodeBufGetContent(void) {
21915    int test_ret = 0;
21916
21917    int mem_base;
21918    int ret_val;
21919    xmlBufferPtr buffer; /* a buffer */
21920    int n_buffer;
21921    xmlNodePtr cur; /* the node being read */
21922    int n_cur;
21923
21924    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21925    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21926        mem_base = xmlMemBlocks();
21927        buffer = gen_xmlBufferPtr(n_buffer, 0);
21928        cur = gen_xmlNodePtr(n_cur, 1);
21929
21930        ret_val = xmlNodeBufGetContent(buffer, cur);
21931        desret_int(ret_val);
21932        call_tests++;
21933        des_xmlBufferPtr(n_buffer, buffer, 0);
21934        des_xmlNodePtr(n_cur, cur, 1);
21935        xmlResetLastError();
21936        if (mem_base != xmlMemBlocks()) {
21937            printf("Leak of %d blocks found in xmlNodeBufGetContent",
21938	           xmlMemBlocks() - mem_base);
21939	    test_ret++;
21940            printf(" %d", n_buffer);
21941            printf(" %d", n_cur);
21942            printf("\n");
21943        }
21944    }
21945    }
21946    function_tests++;
21947
21948    return(test_ret);
21949}
21950
21951
21952static int
21953test_xmlNodeDump(void) {
21954    int test_ret = 0;
21955
21956#if defined(LIBXML_OUTPUT_ENABLED)
21957    int mem_base;
21958    int ret_val;
21959    xmlBufferPtr buf; /* the XML buffer output */
21960    int n_buf;
21961    xmlDocPtr doc; /* the document */
21962    int n_doc;
21963    xmlNodePtr cur; /* the current node */
21964    int n_cur;
21965    int level; /* the imbrication level for indenting */
21966    int n_level;
21967    int format; /* is formatting allowed */
21968    int n_format;
21969
21970    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21971    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21972    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21973    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21974    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21975        mem_base = xmlMemBlocks();
21976        buf = gen_xmlBufferPtr(n_buf, 0);
21977        doc = gen_xmlDocPtr(n_doc, 1);
21978        cur = gen_xmlNodePtr(n_cur, 2);
21979        level = gen_int(n_level, 3);
21980        format = gen_int(n_format, 4);
21981
21982        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21983        desret_int(ret_val);
21984        call_tests++;
21985        des_xmlBufferPtr(n_buf, buf, 0);
21986        des_xmlDocPtr(n_doc, doc, 1);
21987        des_xmlNodePtr(n_cur, cur, 2);
21988        des_int(n_level, level, 3);
21989        des_int(n_format, format, 4);
21990        xmlResetLastError();
21991        if (mem_base != xmlMemBlocks()) {
21992            printf("Leak of %d blocks found in xmlNodeDump",
21993	           xmlMemBlocks() - mem_base);
21994	    test_ret++;
21995            printf(" %d", n_buf);
21996            printf(" %d", n_doc);
21997            printf(" %d", n_cur);
21998            printf(" %d", n_level);
21999            printf(" %d", n_format);
22000            printf("\n");
22001        }
22002    }
22003    }
22004    }
22005    }
22006    }
22007    function_tests++;
22008#endif
22009
22010    return(test_ret);
22011}
22012
22013
22014static int
22015test_xmlNodeDumpOutput(void) {
22016    int test_ret = 0;
22017
22018#if defined(LIBXML_OUTPUT_ENABLED)
22019    int mem_base;
22020    xmlOutputBufferPtr buf; /* the XML buffer output */
22021    int n_buf;
22022    xmlDocPtr doc; /* the document */
22023    int n_doc;
22024    xmlNodePtr cur; /* the current node */
22025    int n_cur;
22026    int level; /* the imbrication level for indenting */
22027    int n_level;
22028    int format; /* is formatting allowed */
22029    int n_format;
22030    char * encoding; /* an optional encoding string */
22031    int n_encoding;
22032
22033    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22034    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22035    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22036    for (n_level = 0;n_level < gen_nb_int;n_level++) {
22037    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22038    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22039        mem_base = xmlMemBlocks();
22040        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22041        doc = gen_xmlDocPtr(n_doc, 1);
22042        cur = gen_xmlNodePtr(n_cur, 2);
22043        level = gen_int(n_level, 3);
22044        format = gen_int(n_format, 4);
22045        encoding = gen_const_char_ptr(n_encoding, 5);
22046
22047        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22048        call_tests++;
22049        des_xmlOutputBufferPtr(n_buf, buf, 0);
22050        des_xmlDocPtr(n_doc, doc, 1);
22051        des_xmlNodePtr(n_cur, cur, 2);
22052        des_int(n_level, level, 3);
22053        des_int(n_format, format, 4);
22054        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22055        xmlResetLastError();
22056        if (mem_base != xmlMemBlocks()) {
22057            printf("Leak of %d blocks found in xmlNodeDumpOutput",
22058	           xmlMemBlocks() - mem_base);
22059	    test_ret++;
22060            printf(" %d", n_buf);
22061            printf(" %d", n_doc);
22062            printf(" %d", n_cur);
22063            printf(" %d", n_level);
22064            printf(" %d", n_format);
22065            printf(" %d", n_encoding);
22066            printf("\n");
22067        }
22068    }
22069    }
22070    }
22071    }
22072    }
22073    }
22074    function_tests++;
22075#endif
22076
22077    return(test_ret);
22078}
22079
22080
22081static int
22082test_xmlNodeGetBase(void) {
22083    int test_ret = 0;
22084
22085    int mem_base;
22086    xmlChar * ret_val;
22087    xmlDocPtr doc; /* the document the node pertains to */
22088    int n_doc;
22089    xmlNodePtr cur; /* the node being checked */
22090    int n_cur;
22091
22092    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22093    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22094        mem_base = xmlMemBlocks();
22095        doc = gen_xmlDocPtr(n_doc, 0);
22096        cur = gen_xmlNodePtr(n_cur, 1);
22097
22098        ret_val = xmlNodeGetBase(doc, cur);
22099        desret_xmlChar_ptr(ret_val);
22100        call_tests++;
22101        des_xmlDocPtr(n_doc, doc, 0);
22102        des_xmlNodePtr(n_cur, cur, 1);
22103        xmlResetLastError();
22104        if (mem_base != xmlMemBlocks()) {
22105            printf("Leak of %d blocks found in xmlNodeGetBase",
22106	           xmlMemBlocks() - mem_base);
22107	    test_ret++;
22108            printf(" %d", n_doc);
22109            printf(" %d", n_cur);
22110            printf("\n");
22111        }
22112    }
22113    }
22114    function_tests++;
22115
22116    return(test_ret);
22117}
22118
22119
22120static int
22121test_xmlNodeGetContent(void) {
22122    int test_ret = 0;
22123
22124    int mem_base;
22125    xmlChar * ret_val;
22126    xmlNodePtr cur; /* the node being read */
22127    int n_cur;
22128
22129    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22130        mem_base = xmlMemBlocks();
22131        cur = gen_xmlNodePtr(n_cur, 0);
22132
22133        ret_val = xmlNodeGetContent(cur);
22134        desret_xmlChar_ptr(ret_val);
22135        call_tests++;
22136        des_xmlNodePtr(n_cur, cur, 0);
22137        xmlResetLastError();
22138        if (mem_base != xmlMemBlocks()) {
22139            printf("Leak of %d blocks found in xmlNodeGetContent",
22140	           xmlMemBlocks() - mem_base);
22141	    test_ret++;
22142            printf(" %d", n_cur);
22143            printf("\n");
22144        }
22145    }
22146    function_tests++;
22147
22148    return(test_ret);
22149}
22150
22151
22152static int
22153test_xmlNodeGetLang(void) {
22154    int test_ret = 0;
22155
22156    int mem_base;
22157    xmlChar * ret_val;
22158    xmlNodePtr cur; /* the node being checked */
22159    int n_cur;
22160
22161    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22162        mem_base = xmlMemBlocks();
22163        cur = gen_xmlNodePtr(n_cur, 0);
22164
22165        ret_val = xmlNodeGetLang(cur);
22166        desret_xmlChar_ptr(ret_val);
22167        call_tests++;
22168        des_xmlNodePtr(n_cur, cur, 0);
22169        xmlResetLastError();
22170        if (mem_base != xmlMemBlocks()) {
22171            printf("Leak of %d blocks found in xmlNodeGetLang",
22172	           xmlMemBlocks() - mem_base);
22173	    test_ret++;
22174            printf(" %d", n_cur);
22175            printf("\n");
22176        }
22177    }
22178    function_tests++;
22179
22180    return(test_ret);
22181}
22182
22183
22184static int
22185test_xmlNodeGetSpacePreserve(void) {
22186    int test_ret = 0;
22187
22188    int mem_base;
22189    int ret_val;
22190    xmlNodePtr cur; /* the node being checked */
22191    int n_cur;
22192
22193    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22194        mem_base = xmlMemBlocks();
22195        cur = gen_xmlNodePtr(n_cur, 0);
22196
22197        ret_val = xmlNodeGetSpacePreserve(cur);
22198        desret_int(ret_val);
22199        call_tests++;
22200        des_xmlNodePtr(n_cur, cur, 0);
22201        xmlResetLastError();
22202        if (mem_base != xmlMemBlocks()) {
22203            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22204	           xmlMemBlocks() - mem_base);
22205	    test_ret++;
22206            printf(" %d", n_cur);
22207            printf("\n");
22208        }
22209    }
22210    function_tests++;
22211
22212    return(test_ret);
22213}
22214
22215
22216static int
22217test_xmlNodeIsText(void) {
22218    int test_ret = 0;
22219
22220    int mem_base;
22221    int ret_val;
22222    xmlNodePtr node; /* the node */
22223    int n_node;
22224
22225    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22226        mem_base = xmlMemBlocks();
22227        node = gen_xmlNodePtr(n_node, 0);
22228
22229        ret_val = xmlNodeIsText(node);
22230        desret_int(ret_val);
22231        call_tests++;
22232        des_xmlNodePtr(n_node, node, 0);
22233        xmlResetLastError();
22234        if (mem_base != xmlMemBlocks()) {
22235            printf("Leak of %d blocks found in xmlNodeIsText",
22236	           xmlMemBlocks() - mem_base);
22237	    test_ret++;
22238            printf(" %d", n_node);
22239            printf("\n");
22240        }
22241    }
22242    function_tests++;
22243
22244    return(test_ret);
22245}
22246
22247
22248static int
22249test_xmlNodeListGetRawString(void) {
22250    int test_ret = 0;
22251
22252#if defined(LIBXML_TREE_ENABLED)
22253    int mem_base;
22254    xmlChar * ret_val;
22255    xmlDocPtr doc; /* the document */
22256    int n_doc;
22257    xmlNodePtr list; /* a Node list */
22258    int n_list;
22259    int inLine; /* should we replace entity contents or show their external form */
22260    int n_inLine;
22261
22262    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22263    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22264    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22265        mem_base = xmlMemBlocks();
22266        doc = gen_xmlDocPtr(n_doc, 0);
22267        list = gen_xmlNodePtr(n_list, 1);
22268        inLine = gen_int(n_inLine, 2);
22269
22270        ret_val = xmlNodeListGetRawString(doc, list, inLine);
22271        desret_xmlChar_ptr(ret_val);
22272        call_tests++;
22273        des_xmlDocPtr(n_doc, doc, 0);
22274        des_xmlNodePtr(n_list, list, 1);
22275        des_int(n_inLine, inLine, 2);
22276        xmlResetLastError();
22277        if (mem_base != xmlMemBlocks()) {
22278            printf("Leak of %d blocks found in xmlNodeListGetRawString",
22279	           xmlMemBlocks() - mem_base);
22280	    test_ret++;
22281            printf(" %d", n_doc);
22282            printf(" %d", n_list);
22283            printf(" %d", n_inLine);
22284            printf("\n");
22285        }
22286    }
22287    }
22288    }
22289    function_tests++;
22290#endif
22291
22292    return(test_ret);
22293}
22294
22295
22296static int
22297test_xmlNodeListGetString(void) {
22298    int test_ret = 0;
22299
22300    int mem_base;
22301    xmlChar * ret_val;
22302    xmlDocPtr doc; /* the document */
22303    int n_doc;
22304    xmlNodePtr list; /* a Node list */
22305    int n_list;
22306    int inLine; /* should we replace entity contents or show their external form */
22307    int n_inLine;
22308
22309    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22310    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22311    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22312        mem_base = xmlMemBlocks();
22313        doc = gen_xmlDocPtr(n_doc, 0);
22314        list = gen_xmlNodePtr(n_list, 1);
22315        inLine = gen_int(n_inLine, 2);
22316
22317        ret_val = xmlNodeListGetString(doc, list, inLine);
22318        desret_xmlChar_ptr(ret_val);
22319        call_tests++;
22320        des_xmlDocPtr(n_doc, doc, 0);
22321        des_xmlNodePtr(n_list, list, 1);
22322        des_int(n_inLine, inLine, 2);
22323        xmlResetLastError();
22324        if (mem_base != xmlMemBlocks()) {
22325            printf("Leak of %d blocks found in xmlNodeListGetString",
22326	           xmlMemBlocks() - mem_base);
22327	    test_ret++;
22328            printf(" %d", n_doc);
22329            printf(" %d", n_list);
22330            printf(" %d", n_inLine);
22331            printf("\n");
22332        }
22333    }
22334    }
22335    }
22336    function_tests++;
22337
22338    return(test_ret);
22339}
22340
22341
22342static int
22343test_xmlNodeSetBase(void) {
22344    int test_ret = 0;
22345
22346#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22347    int mem_base;
22348    xmlNodePtr cur; /* the node being changed */
22349    int n_cur;
22350    xmlChar * uri; /* the new base URI */
22351    int n_uri;
22352
22353    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22354    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22355        mem_base = xmlMemBlocks();
22356        cur = gen_xmlNodePtr(n_cur, 0);
22357        uri = gen_const_xmlChar_ptr(n_uri, 1);
22358
22359        xmlNodeSetBase(cur, (const xmlChar *)uri);
22360        call_tests++;
22361        des_xmlNodePtr(n_cur, cur, 0);
22362        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22363        xmlResetLastError();
22364        if (mem_base != xmlMemBlocks()) {
22365            printf("Leak of %d blocks found in xmlNodeSetBase",
22366	           xmlMemBlocks() - mem_base);
22367	    test_ret++;
22368            printf(" %d", n_cur);
22369            printf(" %d", n_uri);
22370            printf("\n");
22371        }
22372    }
22373    }
22374    function_tests++;
22375#endif
22376
22377    return(test_ret);
22378}
22379
22380
22381static int
22382test_xmlNodeSetContent(void) {
22383    int test_ret = 0;
22384
22385    int mem_base;
22386    xmlNodePtr cur; /* the node being modified */
22387    int n_cur;
22388    xmlChar * content; /* the new value of the content */
22389    int n_content;
22390
22391    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22392    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22393        mem_base = xmlMemBlocks();
22394        cur = gen_xmlNodePtr(n_cur, 0);
22395        content = gen_const_xmlChar_ptr(n_content, 1);
22396
22397        xmlNodeSetContent(cur, (const xmlChar *)content);
22398        call_tests++;
22399        des_xmlNodePtr(n_cur, cur, 0);
22400        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22401        xmlResetLastError();
22402        if (mem_base != xmlMemBlocks()) {
22403            printf("Leak of %d blocks found in xmlNodeSetContent",
22404	           xmlMemBlocks() - mem_base);
22405	    test_ret++;
22406            printf(" %d", n_cur);
22407            printf(" %d", n_content);
22408            printf("\n");
22409        }
22410    }
22411    }
22412    function_tests++;
22413
22414    return(test_ret);
22415}
22416
22417
22418static int
22419test_xmlNodeSetContentLen(void) {
22420    int test_ret = 0;
22421
22422#if defined(LIBXML_TREE_ENABLED)
22423    int mem_base;
22424    xmlNodePtr cur; /* the node being modified */
22425    int n_cur;
22426    xmlChar * content; /* the new value of the content */
22427    int n_content;
22428    int len; /* the size of @content */
22429    int n_len;
22430
22431    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22432    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22433    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22434        mem_base = xmlMemBlocks();
22435        cur = gen_xmlNodePtr(n_cur, 0);
22436        content = gen_const_xmlChar_ptr(n_content, 1);
22437        len = gen_int(n_len, 2);
22438
22439        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22440        call_tests++;
22441        des_xmlNodePtr(n_cur, cur, 0);
22442        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22443        des_int(n_len, len, 2);
22444        xmlResetLastError();
22445        if (mem_base != xmlMemBlocks()) {
22446            printf("Leak of %d blocks found in xmlNodeSetContentLen",
22447	           xmlMemBlocks() - mem_base);
22448	    test_ret++;
22449            printf(" %d", n_cur);
22450            printf(" %d", n_content);
22451            printf(" %d", n_len);
22452            printf("\n");
22453        }
22454    }
22455    }
22456    }
22457    function_tests++;
22458#endif
22459
22460    return(test_ret);
22461}
22462
22463
22464static int
22465test_xmlNodeSetLang(void) {
22466    int test_ret = 0;
22467
22468#if defined(LIBXML_TREE_ENABLED)
22469    int mem_base;
22470    xmlNodePtr cur; /* the node being changed */
22471    int n_cur;
22472    xmlChar * lang; /* the language description */
22473    int n_lang;
22474
22475    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22476    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22477        mem_base = xmlMemBlocks();
22478        cur = gen_xmlNodePtr(n_cur, 0);
22479        lang = gen_const_xmlChar_ptr(n_lang, 1);
22480
22481        xmlNodeSetLang(cur, (const xmlChar *)lang);
22482        call_tests++;
22483        des_xmlNodePtr(n_cur, cur, 0);
22484        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22485        xmlResetLastError();
22486        if (mem_base != xmlMemBlocks()) {
22487            printf("Leak of %d blocks found in xmlNodeSetLang",
22488	           xmlMemBlocks() - mem_base);
22489	    test_ret++;
22490            printf(" %d", n_cur);
22491            printf(" %d", n_lang);
22492            printf("\n");
22493        }
22494    }
22495    }
22496    function_tests++;
22497#endif
22498
22499    return(test_ret);
22500}
22501
22502
22503static int
22504test_xmlNodeSetName(void) {
22505    int test_ret = 0;
22506
22507#if defined(LIBXML_TREE_ENABLED)
22508    int mem_base;
22509    xmlNodePtr cur; /* the node being changed */
22510    int n_cur;
22511    xmlChar * name; /* the new tag name */
22512    int n_name;
22513
22514    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22515    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22516        mem_base = xmlMemBlocks();
22517        cur = gen_xmlNodePtr(n_cur, 0);
22518        name = gen_const_xmlChar_ptr(n_name, 1);
22519
22520        xmlNodeSetName(cur, (const xmlChar *)name);
22521        call_tests++;
22522        des_xmlNodePtr(n_cur, cur, 0);
22523        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22524        xmlResetLastError();
22525        if (mem_base != xmlMemBlocks()) {
22526            printf("Leak of %d blocks found in xmlNodeSetName",
22527	           xmlMemBlocks() - mem_base);
22528	    test_ret++;
22529            printf(" %d", n_cur);
22530            printf(" %d", n_name);
22531            printf("\n");
22532        }
22533    }
22534    }
22535    function_tests++;
22536#endif
22537
22538    return(test_ret);
22539}
22540
22541
22542static int
22543test_xmlNodeSetSpacePreserve(void) {
22544    int test_ret = 0;
22545
22546#if defined(LIBXML_TREE_ENABLED)
22547    int mem_base;
22548    xmlNodePtr cur; /* the node being changed */
22549    int n_cur;
22550    int val; /* the xml:space value ("0": default, 1: "preserve") */
22551    int n_val;
22552
22553    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22554    for (n_val = 0;n_val < gen_nb_int;n_val++) {
22555        mem_base = xmlMemBlocks();
22556        cur = gen_xmlNodePtr(n_cur, 0);
22557        val = gen_int(n_val, 1);
22558
22559        xmlNodeSetSpacePreserve(cur, val);
22560        call_tests++;
22561        des_xmlNodePtr(n_cur, cur, 0);
22562        des_int(n_val, val, 1);
22563        xmlResetLastError();
22564        if (mem_base != xmlMemBlocks()) {
22565            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22566	           xmlMemBlocks() - mem_base);
22567	    test_ret++;
22568            printf(" %d", n_cur);
22569            printf(" %d", n_val);
22570            printf("\n");
22571        }
22572    }
22573    }
22574    function_tests++;
22575#endif
22576
22577    return(test_ret);
22578}
22579
22580
22581static int
22582test_xmlReconciliateNs(void) {
22583    int test_ret = 0;
22584
22585#if defined(LIBXML_TREE_ENABLED)
22586#ifdef LIBXML_TREE_ENABLED
22587    int mem_base;
22588    int ret_val;
22589    xmlDocPtr doc; /* the document */
22590    int n_doc;
22591    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22592    int n_tree;
22593
22594    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22595    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22596        mem_base = xmlMemBlocks();
22597        doc = gen_xmlDocPtr(n_doc, 0);
22598        tree = gen_xmlNodePtr(n_tree, 1);
22599
22600        ret_val = xmlReconciliateNs(doc, tree);
22601        desret_int(ret_val);
22602        call_tests++;
22603        des_xmlDocPtr(n_doc, doc, 0);
22604        des_xmlNodePtr(n_tree, tree, 1);
22605        xmlResetLastError();
22606        if (mem_base != xmlMemBlocks()) {
22607            printf("Leak of %d blocks found in xmlReconciliateNs",
22608	           xmlMemBlocks() - mem_base);
22609	    test_ret++;
22610            printf(" %d", n_doc);
22611            printf(" %d", n_tree);
22612            printf("\n");
22613        }
22614    }
22615    }
22616    function_tests++;
22617#endif
22618#endif
22619
22620    return(test_ret);
22621}
22622
22623
22624static int
22625test_xmlRemoveProp(void) {
22626    int test_ret = 0;
22627
22628    int mem_base;
22629    int ret_val;
22630    xmlAttrPtr cur; /* an attribute */
22631    int n_cur;
22632
22633    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22634        mem_base = xmlMemBlocks();
22635        cur = gen_xmlAttrPtr(n_cur, 0);
22636
22637        ret_val = xmlRemoveProp(cur);
22638        cur = NULL;
22639        desret_int(ret_val);
22640        call_tests++;
22641        des_xmlAttrPtr(n_cur, cur, 0);
22642        xmlResetLastError();
22643        if (mem_base != xmlMemBlocks()) {
22644            printf("Leak of %d blocks found in xmlRemoveProp",
22645	           xmlMemBlocks() - mem_base);
22646	    test_ret++;
22647            printf(" %d", n_cur);
22648            printf("\n");
22649        }
22650    }
22651    function_tests++;
22652
22653    return(test_ret);
22654}
22655
22656
22657static int
22658test_xmlReplaceNode(void) {
22659    int test_ret = 0;
22660
22661#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22662    int mem_base;
22663    xmlNodePtr ret_val;
22664    xmlNodePtr old; /* the old node */
22665    int n_old;
22666    xmlNodePtr cur; /* the node */
22667    int n_cur;
22668
22669    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22670    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22671        mem_base = xmlMemBlocks();
22672        old = gen_xmlNodePtr(n_old, 0);
22673        cur = gen_xmlNodePtr_in(n_cur, 1);
22674
22675        ret_val = xmlReplaceNode(old, cur);
22676        if (cur != NULL) {
22677              xmlUnlinkNode(cur);
22678              xmlFreeNode(cur) ; cur = NULL ; }
22679          if (old != NULL) {
22680              xmlUnlinkNode(old);
22681              xmlFreeNode(old) ; old = NULL ; }
22682	  ret_val = NULL;
22683        desret_xmlNodePtr(ret_val);
22684        call_tests++;
22685        des_xmlNodePtr(n_old, old, 0);
22686        des_xmlNodePtr_in(n_cur, cur, 1);
22687        xmlResetLastError();
22688        if (mem_base != xmlMemBlocks()) {
22689            printf("Leak of %d blocks found in xmlReplaceNode",
22690	           xmlMemBlocks() - mem_base);
22691	    test_ret++;
22692            printf(" %d", n_old);
22693            printf(" %d", n_cur);
22694            printf("\n");
22695        }
22696    }
22697    }
22698    function_tests++;
22699#endif
22700
22701    return(test_ret);
22702}
22703
22704
22705static int
22706test_xmlSaveFile(void) {
22707    int test_ret = 0;
22708
22709#if defined(LIBXML_OUTPUT_ENABLED)
22710    int mem_base;
22711    int ret_val;
22712    const char * filename; /* the filename (or URL) */
22713    int n_filename;
22714    xmlDocPtr cur; /* the document */
22715    int n_cur;
22716
22717    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22718    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22719        mem_base = xmlMemBlocks();
22720        filename = gen_fileoutput(n_filename, 0);
22721        cur = gen_xmlDocPtr(n_cur, 1);
22722
22723        ret_val = xmlSaveFile(filename, cur);
22724        desret_int(ret_val);
22725        call_tests++;
22726        des_fileoutput(n_filename, filename, 0);
22727        des_xmlDocPtr(n_cur, cur, 1);
22728        xmlResetLastError();
22729        if (mem_base != xmlMemBlocks()) {
22730            printf("Leak of %d blocks found in xmlSaveFile",
22731	           xmlMemBlocks() - mem_base);
22732	    test_ret++;
22733            printf(" %d", n_filename);
22734            printf(" %d", n_cur);
22735            printf("\n");
22736        }
22737    }
22738    }
22739    function_tests++;
22740#endif
22741
22742    return(test_ret);
22743}
22744
22745
22746static int
22747test_xmlSaveFileEnc(void) {
22748    int test_ret = 0;
22749
22750#if defined(LIBXML_OUTPUT_ENABLED)
22751    int mem_base;
22752    int ret_val;
22753    const char * filename; /* the filename (or URL) */
22754    int n_filename;
22755    xmlDocPtr cur; /* the document */
22756    int n_cur;
22757    char * encoding; /* the name of an encoding (or NULL) */
22758    int n_encoding;
22759
22760    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22761    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22762    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22763        mem_base = xmlMemBlocks();
22764        filename = gen_fileoutput(n_filename, 0);
22765        cur = gen_xmlDocPtr(n_cur, 1);
22766        encoding = gen_const_char_ptr(n_encoding, 2);
22767
22768        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22769        desret_int(ret_val);
22770        call_tests++;
22771        des_fileoutput(n_filename, filename, 0);
22772        des_xmlDocPtr(n_cur, cur, 1);
22773        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22774        xmlResetLastError();
22775        if (mem_base != xmlMemBlocks()) {
22776            printf("Leak of %d blocks found in xmlSaveFileEnc",
22777	           xmlMemBlocks() - mem_base);
22778	    test_ret++;
22779            printf(" %d", n_filename);
22780            printf(" %d", n_cur);
22781            printf(" %d", n_encoding);
22782            printf("\n");
22783        }
22784    }
22785    }
22786    }
22787    function_tests++;
22788#endif
22789
22790    return(test_ret);
22791}
22792
22793
22794static int
22795test_xmlSaveFileTo(void) {
22796    int test_ret = 0;
22797
22798#if defined(LIBXML_OUTPUT_ENABLED)
22799    int mem_base;
22800    int ret_val;
22801    xmlOutputBufferPtr buf; /* an output I/O buffer */
22802    int n_buf;
22803    xmlDocPtr cur; /* the document */
22804    int n_cur;
22805    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22806    int n_encoding;
22807
22808    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22809    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22810    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22811        mem_base = xmlMemBlocks();
22812        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22813        cur = gen_xmlDocPtr(n_cur, 1);
22814        encoding = gen_const_char_ptr(n_encoding, 2);
22815
22816        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22817        buf = NULL;
22818        desret_int(ret_val);
22819        call_tests++;
22820        des_xmlOutputBufferPtr(n_buf, buf, 0);
22821        des_xmlDocPtr(n_cur, cur, 1);
22822        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22823        xmlResetLastError();
22824        if (mem_base != xmlMemBlocks()) {
22825            printf("Leak of %d blocks found in xmlSaveFileTo",
22826	           xmlMemBlocks() - mem_base);
22827	    test_ret++;
22828            printf(" %d", n_buf);
22829            printf(" %d", n_cur);
22830            printf(" %d", n_encoding);
22831            printf("\n");
22832        }
22833    }
22834    }
22835    }
22836    function_tests++;
22837#endif
22838
22839    return(test_ret);
22840}
22841
22842
22843static int
22844test_xmlSaveFormatFile(void) {
22845    int test_ret = 0;
22846
22847#if defined(LIBXML_OUTPUT_ENABLED)
22848    int mem_base;
22849    int ret_val;
22850    const char * filename; /* the filename (or URL) */
22851    int n_filename;
22852    xmlDocPtr cur; /* the document */
22853    int n_cur;
22854    int format; /* should formatting spaces been added */
22855    int n_format;
22856
22857    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22858    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22859    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22860        mem_base = xmlMemBlocks();
22861        filename = gen_fileoutput(n_filename, 0);
22862        cur = gen_xmlDocPtr(n_cur, 1);
22863        format = gen_int(n_format, 2);
22864
22865        ret_val = xmlSaveFormatFile(filename, cur, format);
22866        desret_int(ret_val);
22867        call_tests++;
22868        des_fileoutput(n_filename, filename, 0);
22869        des_xmlDocPtr(n_cur, cur, 1);
22870        des_int(n_format, format, 2);
22871        xmlResetLastError();
22872        if (mem_base != xmlMemBlocks()) {
22873            printf("Leak of %d blocks found in xmlSaveFormatFile",
22874	           xmlMemBlocks() - mem_base);
22875	    test_ret++;
22876            printf(" %d", n_filename);
22877            printf(" %d", n_cur);
22878            printf(" %d", n_format);
22879            printf("\n");
22880        }
22881    }
22882    }
22883    }
22884    function_tests++;
22885#endif
22886
22887    return(test_ret);
22888}
22889
22890
22891static int
22892test_xmlSaveFormatFileEnc(void) {
22893    int test_ret = 0;
22894
22895#if defined(LIBXML_OUTPUT_ENABLED)
22896    int mem_base;
22897    int ret_val;
22898    const char * filename; /* the filename or URL to output */
22899    int n_filename;
22900    xmlDocPtr cur; /* the document being saved */
22901    int n_cur;
22902    char * encoding; /* the name of the encoding to use or NULL. */
22903    int n_encoding;
22904    int format; /* should formatting spaces be added. */
22905    int n_format;
22906
22907    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22908    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22909    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22910    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22911        mem_base = xmlMemBlocks();
22912        filename = gen_fileoutput(n_filename, 0);
22913        cur = gen_xmlDocPtr(n_cur, 1);
22914        encoding = gen_const_char_ptr(n_encoding, 2);
22915        format = gen_int(n_format, 3);
22916
22917        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22918        desret_int(ret_val);
22919        call_tests++;
22920        des_fileoutput(n_filename, filename, 0);
22921        des_xmlDocPtr(n_cur, cur, 1);
22922        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22923        des_int(n_format, format, 3);
22924        xmlResetLastError();
22925        if (mem_base != xmlMemBlocks()) {
22926            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22927	           xmlMemBlocks() - mem_base);
22928	    test_ret++;
22929            printf(" %d", n_filename);
22930            printf(" %d", n_cur);
22931            printf(" %d", n_encoding);
22932            printf(" %d", n_format);
22933            printf("\n");
22934        }
22935    }
22936    }
22937    }
22938    }
22939    function_tests++;
22940#endif
22941
22942    return(test_ret);
22943}
22944
22945
22946static int
22947test_xmlSaveFormatFileTo(void) {
22948    int test_ret = 0;
22949
22950#if defined(LIBXML_OUTPUT_ENABLED)
22951    int mem_base;
22952    int ret_val;
22953    xmlOutputBufferPtr buf; /* an output I/O buffer */
22954    int n_buf;
22955    xmlDocPtr cur; /* the document */
22956    int n_cur;
22957    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22958    int n_encoding;
22959    int format; /* should formatting spaces been added */
22960    int n_format;
22961
22962    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22963    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22964    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22965    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22966        mem_base = xmlMemBlocks();
22967        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22968        cur = gen_xmlDocPtr(n_cur, 1);
22969        encoding = gen_const_char_ptr(n_encoding, 2);
22970        format = gen_int(n_format, 3);
22971
22972        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22973        buf = NULL;
22974        desret_int(ret_val);
22975        call_tests++;
22976        des_xmlOutputBufferPtr(n_buf, buf, 0);
22977        des_xmlDocPtr(n_cur, cur, 1);
22978        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22979        des_int(n_format, format, 3);
22980        xmlResetLastError();
22981        if (mem_base != xmlMemBlocks()) {
22982            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22983	           xmlMemBlocks() - mem_base);
22984	    test_ret++;
22985            printf(" %d", n_buf);
22986            printf(" %d", n_cur);
22987            printf(" %d", n_encoding);
22988            printf(" %d", n_format);
22989            printf("\n");
22990        }
22991    }
22992    }
22993    }
22994    }
22995    function_tests++;
22996#endif
22997
22998    return(test_ret);
22999}
23000
23001
23002static int
23003test_xmlSearchNs(void) {
23004    int test_ret = 0;
23005
23006    int mem_base;
23007    xmlNsPtr ret_val;
23008    xmlDocPtr doc; /* the document */
23009    int n_doc;
23010    xmlNodePtr node; /* the current node */
23011    int n_node;
23012    xmlChar * nameSpace; /* the namespace prefix */
23013    int n_nameSpace;
23014
23015    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23016    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23017    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23018        mem_base = xmlMemBlocks();
23019        doc = gen_xmlDocPtr(n_doc, 0);
23020        node = gen_xmlNodePtr(n_node, 1);
23021        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23022
23023        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23024        desret_xmlNsPtr(ret_val);
23025        call_tests++;
23026        des_xmlDocPtr(n_doc, doc, 0);
23027        des_xmlNodePtr(n_node, node, 1);
23028        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23029        xmlResetLastError();
23030        if (mem_base != xmlMemBlocks()) {
23031            printf("Leak of %d blocks found in xmlSearchNs",
23032	           xmlMemBlocks() - mem_base);
23033	    test_ret++;
23034            printf(" %d", n_doc);
23035            printf(" %d", n_node);
23036            printf(" %d", n_nameSpace);
23037            printf("\n");
23038        }
23039    }
23040    }
23041    }
23042    function_tests++;
23043
23044    return(test_ret);
23045}
23046
23047
23048static int
23049test_xmlSearchNsByHref(void) {
23050    int test_ret = 0;
23051
23052    int mem_base;
23053    xmlNsPtr ret_val;
23054    xmlDocPtr doc; /* the document */
23055    int n_doc;
23056    xmlNodePtr node; /* the current node */
23057    int n_node;
23058    xmlChar * href; /* the namespace value */
23059    int n_href;
23060
23061    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23062    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23063    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23064        mem_base = xmlMemBlocks();
23065        doc = gen_xmlDocPtr(n_doc, 0);
23066        node = gen_xmlNodePtr(n_node, 1);
23067        href = gen_const_xmlChar_ptr(n_href, 2);
23068
23069        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23070        desret_xmlNsPtr(ret_val);
23071        call_tests++;
23072        des_xmlDocPtr(n_doc, doc, 0);
23073        des_xmlNodePtr(n_node, node, 1);
23074        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23075        xmlResetLastError();
23076        if (mem_base != xmlMemBlocks()) {
23077            printf("Leak of %d blocks found in xmlSearchNsByHref",
23078	           xmlMemBlocks() - mem_base);
23079	    test_ret++;
23080            printf(" %d", n_doc);
23081            printf(" %d", n_node);
23082            printf(" %d", n_href);
23083            printf("\n");
23084        }
23085    }
23086    }
23087    }
23088    function_tests++;
23089
23090    return(test_ret);
23091}
23092
23093
23094static int
23095test_xmlSetBufferAllocationScheme(void) {
23096    int test_ret = 0;
23097
23098    int mem_base;
23099    xmlBufferAllocationScheme scheme; /* allocation method to use */
23100    int n_scheme;
23101
23102    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23103        mem_base = xmlMemBlocks();
23104        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23105
23106        xmlSetBufferAllocationScheme(scheme);
23107        call_tests++;
23108        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23109        xmlResetLastError();
23110        if (mem_base != xmlMemBlocks()) {
23111            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23112	           xmlMemBlocks() - mem_base);
23113	    test_ret++;
23114            printf(" %d", n_scheme);
23115            printf("\n");
23116        }
23117    }
23118    function_tests++;
23119
23120    return(test_ret);
23121}
23122
23123
23124static int
23125test_xmlSetCompressMode(void) {
23126    int test_ret = 0;
23127
23128    int mem_base;
23129    int mode; /* the compression ratio */
23130    int n_mode;
23131
23132    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23133        mem_base = xmlMemBlocks();
23134        mode = gen_int(n_mode, 0);
23135
23136        xmlSetCompressMode(mode);
23137        call_tests++;
23138        des_int(n_mode, mode, 0);
23139        xmlResetLastError();
23140        if (mem_base != xmlMemBlocks()) {
23141            printf("Leak of %d blocks found in xmlSetCompressMode",
23142	           xmlMemBlocks() - mem_base);
23143	    test_ret++;
23144            printf(" %d", n_mode);
23145            printf("\n");
23146        }
23147    }
23148    function_tests++;
23149
23150    return(test_ret);
23151}
23152
23153
23154static int
23155test_xmlSetDocCompressMode(void) {
23156    int test_ret = 0;
23157
23158    int mem_base;
23159    xmlDocPtr doc; /* the document */
23160    int n_doc;
23161    int mode; /* the compression ratio */
23162    int n_mode;
23163
23164    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23165    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23166        mem_base = xmlMemBlocks();
23167        doc = gen_xmlDocPtr(n_doc, 0);
23168        mode = gen_int(n_mode, 1);
23169
23170        xmlSetDocCompressMode(doc, mode);
23171        call_tests++;
23172        des_xmlDocPtr(n_doc, doc, 0);
23173        des_int(n_mode, mode, 1);
23174        xmlResetLastError();
23175        if (mem_base != xmlMemBlocks()) {
23176            printf("Leak of %d blocks found in xmlSetDocCompressMode",
23177	           xmlMemBlocks() - mem_base);
23178	    test_ret++;
23179            printf(" %d", n_doc);
23180            printf(" %d", n_mode);
23181            printf("\n");
23182        }
23183    }
23184    }
23185    function_tests++;
23186
23187    return(test_ret);
23188}
23189
23190
23191static int
23192test_xmlSetNs(void) {
23193    int test_ret = 0;
23194
23195    int mem_base;
23196    xmlNodePtr node; /* a node in the document */
23197    int n_node;
23198    xmlNsPtr ns; /* a namespace pointer */
23199    int n_ns;
23200
23201    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23202    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23203        mem_base = xmlMemBlocks();
23204        node = gen_xmlNodePtr(n_node, 0);
23205        ns = gen_xmlNsPtr(n_ns, 1);
23206
23207        xmlSetNs(node, ns);
23208        call_tests++;
23209        des_xmlNodePtr(n_node, node, 0);
23210        des_xmlNsPtr(n_ns, ns, 1);
23211        xmlResetLastError();
23212        if (mem_base != xmlMemBlocks()) {
23213            printf("Leak of %d blocks found in xmlSetNs",
23214	           xmlMemBlocks() - mem_base);
23215	    test_ret++;
23216            printf(" %d", n_node);
23217            printf(" %d", n_ns);
23218            printf("\n");
23219        }
23220    }
23221    }
23222    function_tests++;
23223
23224    return(test_ret);
23225}
23226
23227
23228static int
23229test_xmlSetNsProp(void) {
23230    int test_ret = 0;
23231
23232#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23233    int mem_base;
23234    xmlAttrPtr ret_val;
23235    xmlNodePtr node; /* the node */
23236    int n_node;
23237    xmlNsPtr ns; /* the namespace definition */
23238    int n_ns;
23239    xmlChar * name; /* the attribute name */
23240    int n_name;
23241    xmlChar * value; /* the attribute value */
23242    int n_value;
23243
23244    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23245    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23246    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23247    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23248        mem_base = xmlMemBlocks();
23249        node = gen_xmlNodePtr(n_node, 0);
23250        ns = gen_xmlNsPtr(n_ns, 1);
23251        name = gen_const_xmlChar_ptr(n_name, 2);
23252        value = gen_const_xmlChar_ptr(n_value, 3);
23253
23254        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23255        desret_xmlAttrPtr(ret_val);
23256        call_tests++;
23257        des_xmlNodePtr(n_node, node, 0);
23258        des_xmlNsPtr(n_ns, ns, 1);
23259        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23260        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23261        xmlResetLastError();
23262        if (mem_base != xmlMemBlocks()) {
23263            printf("Leak of %d blocks found in xmlSetNsProp",
23264	           xmlMemBlocks() - mem_base);
23265	    test_ret++;
23266            printf(" %d", n_node);
23267            printf(" %d", n_ns);
23268            printf(" %d", n_name);
23269            printf(" %d", n_value);
23270            printf("\n");
23271        }
23272    }
23273    }
23274    }
23275    }
23276    function_tests++;
23277#endif
23278
23279    return(test_ret);
23280}
23281
23282
23283static int
23284test_xmlSetProp(void) {
23285    int test_ret = 0;
23286
23287#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23288    int mem_base;
23289    xmlAttrPtr ret_val;
23290    xmlNodePtr node; /* the node */
23291    int n_node;
23292    xmlChar * name; /* the attribute name (a QName) */
23293    int n_name;
23294    xmlChar * value; /* the attribute value */
23295    int n_value;
23296
23297    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23298    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23299    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23300        mem_base = xmlMemBlocks();
23301        node = gen_xmlNodePtr(n_node, 0);
23302        name = gen_const_xmlChar_ptr(n_name, 1);
23303        value = gen_const_xmlChar_ptr(n_value, 2);
23304
23305        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23306        desret_xmlAttrPtr(ret_val);
23307        call_tests++;
23308        des_xmlNodePtr(n_node, node, 0);
23309        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23310        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23311        xmlResetLastError();
23312        if (mem_base != xmlMemBlocks()) {
23313            printf("Leak of %d blocks found in xmlSetProp",
23314	           xmlMemBlocks() - mem_base);
23315	    test_ret++;
23316            printf(" %d", n_node);
23317            printf(" %d", n_name);
23318            printf(" %d", n_value);
23319            printf("\n");
23320        }
23321    }
23322    }
23323    }
23324    function_tests++;
23325#endif
23326
23327    return(test_ret);
23328}
23329
23330
23331static int
23332test_xmlSplitQName2(void) {
23333    int test_ret = 0;
23334
23335    int mem_base;
23336    xmlChar * ret_val;
23337    xmlChar * name; /* the full QName */
23338    int n_name;
23339    xmlChar ** prefix; /* a xmlChar ** */
23340    int n_prefix;
23341
23342    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23343    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23344        mem_base = xmlMemBlocks();
23345        name = gen_const_xmlChar_ptr(n_name, 0);
23346        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23347
23348        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23349        desret_xmlChar_ptr(ret_val);
23350        call_tests++;
23351        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23352        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23353        xmlResetLastError();
23354        if (mem_base != xmlMemBlocks()) {
23355            printf("Leak of %d blocks found in xmlSplitQName2",
23356	           xmlMemBlocks() - mem_base);
23357	    test_ret++;
23358            printf(" %d", n_name);
23359            printf(" %d", n_prefix);
23360            printf("\n");
23361        }
23362    }
23363    }
23364    function_tests++;
23365
23366    return(test_ret);
23367}
23368
23369
23370static int
23371test_xmlSplitQName3(void) {
23372    int test_ret = 0;
23373
23374    int mem_base;
23375    const xmlChar * ret_val;
23376    xmlChar * name; /* the full QName */
23377    int n_name;
23378    int * len; /* an int * */
23379    int n_len;
23380
23381    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23382    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23383        mem_base = xmlMemBlocks();
23384        name = gen_const_xmlChar_ptr(n_name, 0);
23385        len = gen_int_ptr(n_len, 1);
23386
23387        ret_val = xmlSplitQName3((const xmlChar *)name, len);
23388        desret_const_xmlChar_ptr(ret_val);
23389        call_tests++;
23390        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23391        des_int_ptr(n_len, len, 1);
23392        xmlResetLastError();
23393        if (mem_base != xmlMemBlocks()) {
23394            printf("Leak of %d blocks found in xmlSplitQName3",
23395	           xmlMemBlocks() - mem_base);
23396	    test_ret++;
23397            printf(" %d", n_name);
23398            printf(" %d", n_len);
23399            printf("\n");
23400        }
23401    }
23402    }
23403    function_tests++;
23404
23405    return(test_ret);
23406}
23407
23408
23409static int
23410test_xmlStringGetNodeList(void) {
23411    int test_ret = 0;
23412
23413    int mem_base;
23414    xmlNodePtr ret_val;
23415    xmlDocPtr doc; /* the document */
23416    int n_doc;
23417    xmlChar * value; /* the value of the attribute */
23418    int n_value;
23419
23420    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23421    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23422        mem_base = xmlMemBlocks();
23423        doc = gen_xmlDocPtr(n_doc, 0);
23424        value = gen_const_xmlChar_ptr(n_value, 1);
23425
23426        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23427        desret_xmlNodePtr(ret_val);
23428        call_tests++;
23429        des_xmlDocPtr(n_doc, doc, 0);
23430        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23431        xmlResetLastError();
23432        if (mem_base != xmlMemBlocks()) {
23433            printf("Leak of %d blocks found in xmlStringGetNodeList",
23434	           xmlMemBlocks() - mem_base);
23435	    test_ret++;
23436            printf(" %d", n_doc);
23437            printf(" %d", n_value);
23438            printf("\n");
23439        }
23440    }
23441    }
23442    function_tests++;
23443
23444    return(test_ret);
23445}
23446
23447
23448static int
23449test_xmlStringLenGetNodeList(void) {
23450    int test_ret = 0;
23451
23452    int mem_base;
23453    xmlNodePtr ret_val;
23454    xmlDocPtr doc; /* the document */
23455    int n_doc;
23456    xmlChar * value; /* the value of the text */
23457    int n_value;
23458    int len; /* the length of the string value */
23459    int n_len;
23460
23461    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23462    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23463    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23464        mem_base = xmlMemBlocks();
23465        doc = gen_xmlDocPtr(n_doc, 0);
23466        value = gen_const_xmlChar_ptr(n_value, 1);
23467        len = gen_int(n_len, 2);
23468
23469        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23470        desret_xmlNodePtr(ret_val);
23471        call_tests++;
23472        des_xmlDocPtr(n_doc, doc, 0);
23473        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23474        des_int(n_len, len, 2);
23475        xmlResetLastError();
23476        if (mem_base != xmlMemBlocks()) {
23477            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23478	           xmlMemBlocks() - mem_base);
23479	    test_ret++;
23480            printf(" %d", n_doc);
23481            printf(" %d", n_value);
23482            printf(" %d", n_len);
23483            printf("\n");
23484        }
23485    }
23486    }
23487    }
23488    function_tests++;
23489
23490    return(test_ret);
23491}
23492
23493
23494static int
23495test_xmlTextConcat(void) {
23496    int test_ret = 0;
23497
23498    int mem_base;
23499    int ret_val;
23500    xmlNodePtr node; /* the node */
23501    int n_node;
23502    xmlChar * content; /* the content */
23503    int n_content;
23504    int len; /* @content length */
23505    int n_len;
23506
23507    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23508    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23509    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23510        mem_base = xmlMemBlocks();
23511        node = gen_xmlNodePtr(n_node, 0);
23512        content = gen_const_xmlChar_ptr(n_content, 1);
23513        len = gen_int(n_len, 2);
23514
23515        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23516        desret_int(ret_val);
23517        call_tests++;
23518        des_xmlNodePtr(n_node, node, 0);
23519        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23520        des_int(n_len, len, 2);
23521        xmlResetLastError();
23522        if (mem_base != xmlMemBlocks()) {
23523            printf("Leak of %d blocks found in xmlTextConcat",
23524	           xmlMemBlocks() - mem_base);
23525	    test_ret++;
23526            printf(" %d", n_node);
23527            printf(" %d", n_content);
23528            printf(" %d", n_len);
23529            printf("\n");
23530        }
23531    }
23532    }
23533    }
23534    function_tests++;
23535
23536    return(test_ret);
23537}
23538
23539
23540static int
23541test_xmlTextMerge(void) {
23542    int test_ret = 0;
23543
23544    int mem_base;
23545    xmlNodePtr ret_val;
23546    xmlNodePtr first; /* the first text node */
23547    int n_first;
23548    xmlNodePtr second; /* the second text node being merged */
23549    int n_second;
23550
23551    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23552    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23553        mem_base = xmlMemBlocks();
23554        first = gen_xmlNodePtr_in(n_first, 0);
23555        second = gen_xmlNodePtr_in(n_second, 1);
23556
23557        ret_val = xmlTextMerge(first, second);
23558        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23559              xmlUnlinkNode(second);
23560              xmlFreeNode(second) ; second = NULL ; }
23561        desret_xmlNodePtr(ret_val);
23562        call_tests++;
23563        des_xmlNodePtr_in(n_first, first, 0);
23564        des_xmlNodePtr_in(n_second, second, 1);
23565        xmlResetLastError();
23566        if (mem_base != xmlMemBlocks()) {
23567            printf("Leak of %d blocks found in xmlTextMerge",
23568	           xmlMemBlocks() - mem_base);
23569	    test_ret++;
23570            printf(" %d", n_first);
23571            printf(" %d", n_second);
23572            printf("\n");
23573        }
23574    }
23575    }
23576    function_tests++;
23577
23578    return(test_ret);
23579}
23580
23581
23582static int
23583test_xmlUnsetNsProp(void) {
23584    int test_ret = 0;
23585
23586#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23587    int mem_base;
23588    int ret_val;
23589    xmlNodePtr node; /* the node */
23590    int n_node;
23591    xmlNsPtr ns; /* the namespace definition */
23592    int n_ns;
23593    xmlChar * name; /* the attribute name */
23594    int n_name;
23595
23596    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23597    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23598    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23599        mem_base = xmlMemBlocks();
23600        node = gen_xmlNodePtr(n_node, 0);
23601        ns = gen_xmlNsPtr(n_ns, 1);
23602        name = gen_const_xmlChar_ptr(n_name, 2);
23603
23604        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23605        desret_int(ret_val);
23606        call_tests++;
23607        des_xmlNodePtr(n_node, node, 0);
23608        des_xmlNsPtr(n_ns, ns, 1);
23609        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23610        xmlResetLastError();
23611        if (mem_base != xmlMemBlocks()) {
23612            printf("Leak of %d blocks found in xmlUnsetNsProp",
23613	           xmlMemBlocks() - mem_base);
23614	    test_ret++;
23615            printf(" %d", n_node);
23616            printf(" %d", n_ns);
23617            printf(" %d", n_name);
23618            printf("\n");
23619        }
23620    }
23621    }
23622    }
23623    function_tests++;
23624#endif
23625
23626    return(test_ret);
23627}
23628
23629
23630static int
23631test_xmlUnsetProp(void) {
23632    int test_ret = 0;
23633
23634#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23635    int mem_base;
23636    int ret_val;
23637    xmlNodePtr node; /* the node */
23638    int n_node;
23639    xmlChar * name; /* the attribute name */
23640    int n_name;
23641
23642    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23643    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23644        mem_base = xmlMemBlocks();
23645        node = gen_xmlNodePtr(n_node, 0);
23646        name = gen_const_xmlChar_ptr(n_name, 1);
23647
23648        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23649        desret_int(ret_val);
23650        call_tests++;
23651        des_xmlNodePtr(n_node, node, 0);
23652        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23653        xmlResetLastError();
23654        if (mem_base != xmlMemBlocks()) {
23655            printf("Leak of %d blocks found in xmlUnsetProp",
23656	           xmlMemBlocks() - mem_base);
23657	    test_ret++;
23658            printf(" %d", n_node);
23659            printf(" %d", n_name);
23660            printf("\n");
23661        }
23662    }
23663    }
23664    function_tests++;
23665#endif
23666
23667    return(test_ret);
23668}
23669
23670
23671static int
23672test_xmlValidateNCName(void) {
23673    int test_ret = 0;
23674
23675#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)
23676#ifdef LIBXML_TREE_ENABLED
23677    int mem_base;
23678    int ret_val;
23679    xmlChar * value; /* the value to check */
23680    int n_value;
23681    int space; /* allow spaces in front and end of the string */
23682    int n_space;
23683
23684    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23685    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23686        mem_base = xmlMemBlocks();
23687        value = gen_const_xmlChar_ptr(n_value, 0);
23688        space = gen_int(n_space, 1);
23689
23690        ret_val = xmlValidateNCName((const xmlChar *)value, space);
23691        desret_int(ret_val);
23692        call_tests++;
23693        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23694        des_int(n_space, space, 1);
23695        xmlResetLastError();
23696        if (mem_base != xmlMemBlocks()) {
23697            printf("Leak of %d blocks found in xmlValidateNCName",
23698	           xmlMemBlocks() - mem_base);
23699	    test_ret++;
23700            printf(" %d", n_value);
23701            printf(" %d", n_space);
23702            printf("\n");
23703        }
23704    }
23705    }
23706    function_tests++;
23707#endif
23708#endif
23709
23710    return(test_ret);
23711}
23712
23713
23714static int
23715test_xmlValidateNMToken(void) {
23716    int test_ret = 0;
23717
23718#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23719#ifdef LIBXML_TREE_ENABLED
23720    int mem_base;
23721    int ret_val;
23722    xmlChar * value; /* the value to check */
23723    int n_value;
23724    int space; /* allow spaces in front and end of the string */
23725    int n_space;
23726
23727    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23728    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23729        mem_base = xmlMemBlocks();
23730        value = gen_const_xmlChar_ptr(n_value, 0);
23731        space = gen_int(n_space, 1);
23732
23733        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23734        desret_int(ret_val);
23735        call_tests++;
23736        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23737        des_int(n_space, space, 1);
23738        xmlResetLastError();
23739        if (mem_base != xmlMemBlocks()) {
23740            printf("Leak of %d blocks found in xmlValidateNMToken",
23741	           xmlMemBlocks() - mem_base);
23742	    test_ret++;
23743            printf(" %d", n_value);
23744            printf(" %d", n_space);
23745            printf("\n");
23746        }
23747    }
23748    }
23749    function_tests++;
23750#endif
23751#endif
23752
23753    return(test_ret);
23754}
23755
23756
23757static int
23758test_xmlValidateName(void) {
23759    int test_ret = 0;
23760
23761#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23762#ifdef LIBXML_TREE_ENABLED
23763    int mem_base;
23764    int ret_val;
23765    xmlChar * value; /* the value to check */
23766    int n_value;
23767    int space; /* allow spaces in front and end of the string */
23768    int n_space;
23769
23770    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23771    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23772        mem_base = xmlMemBlocks();
23773        value = gen_const_xmlChar_ptr(n_value, 0);
23774        space = gen_int(n_space, 1);
23775
23776        ret_val = xmlValidateName((const xmlChar *)value, space);
23777        desret_int(ret_val);
23778        call_tests++;
23779        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23780        des_int(n_space, space, 1);
23781        xmlResetLastError();
23782        if (mem_base != xmlMemBlocks()) {
23783            printf("Leak of %d blocks found in xmlValidateName",
23784	           xmlMemBlocks() - mem_base);
23785	    test_ret++;
23786            printf(" %d", n_value);
23787            printf(" %d", n_space);
23788            printf("\n");
23789        }
23790    }
23791    }
23792    function_tests++;
23793#endif
23794#endif
23795
23796    return(test_ret);
23797}
23798
23799
23800static int
23801test_xmlValidateQName(void) {
23802    int test_ret = 0;
23803
23804#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23805#ifdef LIBXML_TREE_ENABLED
23806    int mem_base;
23807    int ret_val;
23808    xmlChar * value; /* the value to check */
23809    int n_value;
23810    int space; /* allow spaces in front and end of the string */
23811    int n_space;
23812
23813    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23814    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23815        mem_base = xmlMemBlocks();
23816        value = gen_const_xmlChar_ptr(n_value, 0);
23817        space = gen_int(n_space, 1);
23818
23819        ret_val = xmlValidateQName((const xmlChar *)value, space);
23820        desret_int(ret_val);
23821        call_tests++;
23822        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23823        des_int(n_space, space, 1);
23824        xmlResetLastError();
23825        if (mem_base != xmlMemBlocks()) {
23826            printf("Leak of %d blocks found in xmlValidateQName",
23827	           xmlMemBlocks() - mem_base);
23828	    test_ret++;
23829            printf(" %d", n_value);
23830            printf(" %d", n_space);
23831            printf("\n");
23832        }
23833    }
23834    }
23835    function_tests++;
23836#endif
23837#endif
23838
23839    return(test_ret);
23840}
23841
23842static int
23843test_tree(void) {
23844    int test_ret = 0;
23845
23846    if (quiet == 0) printf("Testing tree : 133 of 152 functions ...\n");
23847    test_ret += test_xmlAddChild();
23848    test_ret += test_xmlAddChildList();
23849    test_ret += test_xmlAddNextSibling();
23850    test_ret += test_xmlAddPrevSibling();
23851    test_ret += test_xmlAddSibling();
23852    test_ret += test_xmlAttrSerializeTxtContent();
23853    test_ret += test_xmlBufferAdd();
23854    test_ret += test_xmlBufferAddHead();
23855    test_ret += test_xmlBufferCCat();
23856    test_ret += test_xmlBufferCat();
23857    test_ret += test_xmlBufferContent();
23858    test_ret += test_xmlBufferCreate();
23859    test_ret += test_xmlBufferCreateSize();
23860    test_ret += test_xmlBufferCreateStatic();
23861    test_ret += test_xmlBufferEmpty();
23862    test_ret += test_xmlBufferGrow();
23863    test_ret += test_xmlBufferLength();
23864    test_ret += test_xmlBufferResize();
23865    test_ret += test_xmlBufferSetAllocationScheme();
23866    test_ret += test_xmlBufferShrink();
23867    test_ret += test_xmlBufferWriteCHAR();
23868    test_ret += test_xmlBufferWriteChar();
23869    test_ret += test_xmlBufferWriteQuotedString();
23870    test_ret += test_xmlBuildQName();
23871    test_ret += test_xmlCopyDoc();
23872    test_ret += test_xmlCopyDtd();
23873    test_ret += test_xmlCopyNamespace();
23874    test_ret += test_xmlCopyNamespaceList();
23875    test_ret += test_xmlCopyNode();
23876    test_ret += test_xmlCopyNodeList();
23877    test_ret += test_xmlCopyProp();
23878    test_ret += test_xmlCopyPropList();
23879    test_ret += test_xmlCreateIntSubset();
23880    test_ret += test_xmlDOMWrapAdoptNode();
23881    test_ret += test_xmlDOMWrapCloneNode();
23882    test_ret += test_xmlDOMWrapNewCtxt();
23883    test_ret += test_xmlDOMWrapReconcileNamespaces();
23884    test_ret += test_xmlDOMWrapRemoveNode();
23885    test_ret += test_xmlDocCopyNode();
23886    test_ret += test_xmlDocCopyNodeList();
23887    test_ret += test_xmlDocDump();
23888    test_ret += test_xmlDocDumpFormatMemory();
23889    test_ret += test_xmlDocDumpFormatMemoryEnc();
23890    test_ret += test_xmlDocDumpMemory();
23891    test_ret += test_xmlDocDumpMemoryEnc();
23892    test_ret += test_xmlDocFormatDump();
23893    test_ret += test_xmlDocGetRootElement();
23894    test_ret += test_xmlDocSetRootElement();
23895    test_ret += test_xmlElemDump();
23896    test_ret += test_xmlGetBufferAllocationScheme();
23897    test_ret += test_xmlGetCompressMode();
23898    test_ret += test_xmlGetDocCompressMode();
23899    test_ret += test_xmlGetIntSubset();
23900    test_ret += test_xmlGetLastChild();
23901    test_ret += test_xmlGetLineNo();
23902    test_ret += test_xmlGetNoNsProp();
23903    test_ret += test_xmlGetNodePath();
23904    test_ret += test_xmlGetNsList();
23905    test_ret += test_xmlGetNsProp();
23906    test_ret += test_xmlGetProp();
23907    test_ret += test_xmlHasNsProp();
23908    test_ret += test_xmlHasProp();
23909    test_ret += test_xmlIsBlankNode();
23910    test_ret += test_xmlIsXHTML();
23911    test_ret += test_xmlNewCDataBlock();
23912    test_ret += test_xmlNewCharRef();
23913    test_ret += test_xmlNewChild();
23914    test_ret += test_xmlNewComment();
23915    test_ret += test_xmlNewDoc();
23916    test_ret += test_xmlNewDocComment();
23917    test_ret += test_xmlNewDocFragment();
23918    test_ret += test_xmlNewDocNode();
23919    test_ret += test_xmlNewDocNodeEatName();
23920    test_ret += test_xmlNewDocPI();
23921    test_ret += test_xmlNewDocProp();
23922    test_ret += test_xmlNewDocRawNode();
23923    test_ret += test_xmlNewDocText();
23924    test_ret += test_xmlNewDocTextLen();
23925    test_ret += test_xmlNewDtd();
23926    test_ret += test_xmlNewNode();
23927    test_ret += test_xmlNewNodeEatName();
23928    test_ret += test_xmlNewNs();
23929    test_ret += test_xmlNewNsProp();
23930    test_ret += test_xmlNewNsPropEatName();
23931    test_ret += test_xmlNewPI();
23932    test_ret += test_xmlNewProp();
23933    test_ret += test_xmlNewReference();
23934    test_ret += test_xmlNewText();
23935    test_ret += test_xmlNewTextChild();
23936    test_ret += test_xmlNewTextLen();
23937    test_ret += test_xmlNodeAddContent();
23938    test_ret += test_xmlNodeAddContentLen();
23939    test_ret += test_xmlNodeBufGetContent();
23940    test_ret += test_xmlNodeDump();
23941    test_ret += test_xmlNodeDumpOutput();
23942    test_ret += test_xmlNodeGetBase();
23943    test_ret += test_xmlNodeGetContent();
23944    test_ret += test_xmlNodeGetLang();
23945    test_ret += test_xmlNodeGetSpacePreserve();
23946    test_ret += test_xmlNodeIsText();
23947    test_ret += test_xmlNodeListGetRawString();
23948    test_ret += test_xmlNodeListGetString();
23949    test_ret += test_xmlNodeSetBase();
23950    test_ret += test_xmlNodeSetContent();
23951    test_ret += test_xmlNodeSetContentLen();
23952    test_ret += test_xmlNodeSetLang();
23953    test_ret += test_xmlNodeSetName();
23954    test_ret += test_xmlNodeSetSpacePreserve();
23955    test_ret += test_xmlReconciliateNs();
23956    test_ret += test_xmlRemoveProp();
23957    test_ret += test_xmlReplaceNode();
23958    test_ret += test_xmlSaveFile();
23959    test_ret += test_xmlSaveFileEnc();
23960    test_ret += test_xmlSaveFileTo();
23961    test_ret += test_xmlSaveFormatFile();
23962    test_ret += test_xmlSaveFormatFileEnc();
23963    test_ret += test_xmlSaveFormatFileTo();
23964    test_ret += test_xmlSearchNs();
23965    test_ret += test_xmlSearchNsByHref();
23966    test_ret += test_xmlSetBufferAllocationScheme();
23967    test_ret += test_xmlSetCompressMode();
23968    test_ret += test_xmlSetDocCompressMode();
23969    test_ret += test_xmlSetNs();
23970    test_ret += test_xmlSetNsProp();
23971    test_ret += test_xmlSetProp();
23972    test_ret += test_xmlSplitQName2();
23973    test_ret += test_xmlSplitQName3();
23974    test_ret += test_xmlStringGetNodeList();
23975    test_ret += test_xmlStringLenGetNodeList();
23976    test_ret += test_xmlTextConcat();
23977    test_ret += test_xmlTextMerge();
23978    test_ret += test_xmlUnsetNsProp();
23979    test_ret += test_xmlUnsetProp();
23980    test_ret += test_xmlValidateNCName();
23981    test_ret += test_xmlValidateNMToken();
23982    test_ret += test_xmlValidateName();
23983    test_ret += test_xmlValidateQName();
23984
23985    if (test_ret != 0)
23986	printf("Module tree: %d errors\n", test_ret);
23987    return(test_ret);
23988}
23989
23990static int
23991test_xmlBuildRelativeURI(void) {
23992    int test_ret = 0;
23993
23994    int mem_base;
23995    xmlChar * ret_val;
23996    xmlChar * URI; /* the URI reference under consideration */
23997    int n_URI;
23998    xmlChar * base; /* the base value */
23999    int n_base;
24000
24001    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24002    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24003        mem_base = xmlMemBlocks();
24004        URI = gen_const_xmlChar_ptr(n_URI, 0);
24005        base = gen_const_xmlChar_ptr(n_base, 1);
24006
24007        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24008        desret_xmlChar_ptr(ret_val);
24009        call_tests++;
24010        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24011        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24012        xmlResetLastError();
24013        if (mem_base != xmlMemBlocks()) {
24014            printf("Leak of %d blocks found in xmlBuildRelativeURI",
24015	           xmlMemBlocks() - mem_base);
24016	    test_ret++;
24017            printf(" %d", n_URI);
24018            printf(" %d", n_base);
24019            printf("\n");
24020        }
24021    }
24022    }
24023    function_tests++;
24024
24025    return(test_ret);
24026}
24027
24028
24029static int
24030test_xmlBuildURI(void) {
24031    int test_ret = 0;
24032
24033    int mem_base;
24034    xmlChar * ret_val;
24035    xmlChar * URI; /* the URI instance found in the document */
24036    int n_URI;
24037    xmlChar * base; /* the base value */
24038    int n_base;
24039
24040    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24041    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24042        mem_base = xmlMemBlocks();
24043        URI = gen_const_xmlChar_ptr(n_URI, 0);
24044        base = gen_const_xmlChar_ptr(n_base, 1);
24045
24046        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24047        desret_xmlChar_ptr(ret_val);
24048        call_tests++;
24049        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24050        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24051        xmlResetLastError();
24052        if (mem_base != xmlMemBlocks()) {
24053            printf("Leak of %d blocks found in xmlBuildURI",
24054	           xmlMemBlocks() - mem_base);
24055	    test_ret++;
24056            printf(" %d", n_URI);
24057            printf(" %d", n_base);
24058            printf("\n");
24059        }
24060    }
24061    }
24062    function_tests++;
24063
24064    return(test_ret);
24065}
24066
24067
24068static int
24069test_xmlCanonicPath(void) {
24070    int test_ret = 0;
24071
24072    int mem_base;
24073    xmlChar * ret_val;
24074    xmlChar * path; /* the resource locator in a filesystem notation */
24075    int n_path;
24076
24077    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24078        mem_base = xmlMemBlocks();
24079        path = gen_const_xmlChar_ptr(n_path, 0);
24080
24081        ret_val = xmlCanonicPath((const xmlChar *)path);
24082        desret_xmlChar_ptr(ret_val);
24083        call_tests++;
24084        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24085        xmlResetLastError();
24086        if (mem_base != xmlMemBlocks()) {
24087            printf("Leak of %d blocks found in xmlCanonicPath",
24088	           xmlMemBlocks() - mem_base);
24089	    test_ret++;
24090            printf(" %d", n_path);
24091            printf("\n");
24092        }
24093    }
24094    function_tests++;
24095
24096    return(test_ret);
24097}
24098
24099
24100static int
24101test_xmlCreateURI(void) {
24102    int test_ret = 0;
24103
24104
24105    /* missing type support */
24106    return(test_ret);
24107}
24108
24109
24110static int
24111test_xmlNormalizeURIPath(void) {
24112    int test_ret = 0;
24113
24114    int mem_base;
24115    int ret_val;
24116    char * path; /* pointer to the path string */
24117    int n_path;
24118
24119    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24120        mem_base = xmlMemBlocks();
24121        path = gen_char_ptr(n_path, 0);
24122
24123        ret_val = xmlNormalizeURIPath(path);
24124        desret_int(ret_val);
24125        call_tests++;
24126        des_char_ptr(n_path, path, 0);
24127        xmlResetLastError();
24128        if (mem_base != xmlMemBlocks()) {
24129            printf("Leak of %d blocks found in xmlNormalizeURIPath",
24130	           xmlMemBlocks() - mem_base);
24131	    test_ret++;
24132            printf(" %d", n_path);
24133            printf("\n");
24134        }
24135    }
24136    function_tests++;
24137
24138    return(test_ret);
24139}
24140
24141
24142static int
24143test_xmlParseURI(void) {
24144    int test_ret = 0;
24145
24146
24147    /* missing type support */
24148    return(test_ret);
24149}
24150
24151
24152static int
24153test_xmlParseURIRaw(void) {
24154    int test_ret = 0;
24155
24156
24157    /* missing type support */
24158    return(test_ret);
24159}
24160
24161
24162#define gen_nb_xmlURIPtr 1
24163static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24164    return(NULL);
24165}
24166static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24167}
24168
24169static int
24170test_xmlParseURIReference(void) {
24171    int test_ret = 0;
24172
24173    int mem_base;
24174    int ret_val;
24175    xmlURIPtr uri; /* pointer to an URI structure */
24176    int n_uri;
24177    char * str; /* the string to analyze */
24178    int n_str;
24179
24180    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24181    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24182        mem_base = xmlMemBlocks();
24183        uri = gen_xmlURIPtr(n_uri, 0);
24184        str = gen_const_char_ptr(n_str, 1);
24185
24186        ret_val = xmlParseURIReference(uri, (const char *)str);
24187        desret_int(ret_val);
24188        call_tests++;
24189        des_xmlURIPtr(n_uri, uri, 0);
24190        des_const_char_ptr(n_str, (const char *)str, 1);
24191        xmlResetLastError();
24192        if (mem_base != xmlMemBlocks()) {
24193            printf("Leak of %d blocks found in xmlParseURIReference",
24194	           xmlMemBlocks() - mem_base);
24195	    test_ret++;
24196            printf(" %d", n_uri);
24197            printf(" %d", n_str);
24198            printf("\n");
24199        }
24200    }
24201    }
24202    function_tests++;
24203
24204    return(test_ret);
24205}
24206
24207
24208static int
24209test_xmlPathToURI(void) {
24210    int test_ret = 0;
24211
24212    int mem_base;
24213    xmlChar * ret_val;
24214    xmlChar * path; /* the resource locator in a filesystem notation */
24215    int n_path;
24216
24217    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24218        mem_base = xmlMemBlocks();
24219        path = gen_const_xmlChar_ptr(n_path, 0);
24220
24221        ret_val = xmlPathToURI((const xmlChar *)path);
24222        desret_xmlChar_ptr(ret_val);
24223        call_tests++;
24224        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24225        xmlResetLastError();
24226        if (mem_base != xmlMemBlocks()) {
24227            printf("Leak of %d blocks found in xmlPathToURI",
24228	           xmlMemBlocks() - mem_base);
24229	    test_ret++;
24230            printf(" %d", n_path);
24231            printf("\n");
24232        }
24233    }
24234    function_tests++;
24235
24236    return(test_ret);
24237}
24238
24239
24240static int
24241test_xmlPrintURI(void) {
24242    int test_ret = 0;
24243
24244    int mem_base;
24245    FILE * stream; /* a FILE* for the output */
24246    int n_stream;
24247    xmlURIPtr uri; /* pointer to an xmlURI */
24248    int n_uri;
24249
24250    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24251    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24252        mem_base = xmlMemBlocks();
24253        stream = gen_FILE_ptr(n_stream, 0);
24254        uri = gen_xmlURIPtr(n_uri, 1);
24255
24256        xmlPrintURI(stream, uri);
24257        call_tests++;
24258        des_FILE_ptr(n_stream, stream, 0);
24259        des_xmlURIPtr(n_uri, uri, 1);
24260        xmlResetLastError();
24261        if (mem_base != xmlMemBlocks()) {
24262            printf("Leak of %d blocks found in xmlPrintURI",
24263	           xmlMemBlocks() - mem_base);
24264	    test_ret++;
24265            printf(" %d", n_stream);
24266            printf(" %d", n_uri);
24267            printf("\n");
24268        }
24269    }
24270    }
24271    function_tests++;
24272
24273    return(test_ret);
24274}
24275
24276
24277static int
24278test_xmlSaveUri(void) {
24279    int test_ret = 0;
24280
24281    int mem_base;
24282    xmlChar * ret_val;
24283    xmlURIPtr uri; /* pointer to an xmlURI */
24284    int n_uri;
24285
24286    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24287        mem_base = xmlMemBlocks();
24288        uri = gen_xmlURIPtr(n_uri, 0);
24289
24290        ret_val = xmlSaveUri(uri);
24291        desret_xmlChar_ptr(ret_val);
24292        call_tests++;
24293        des_xmlURIPtr(n_uri, uri, 0);
24294        xmlResetLastError();
24295        if (mem_base != xmlMemBlocks()) {
24296            printf("Leak of %d blocks found in xmlSaveUri",
24297	           xmlMemBlocks() - mem_base);
24298	    test_ret++;
24299            printf(" %d", n_uri);
24300            printf("\n");
24301        }
24302    }
24303    function_tests++;
24304
24305    return(test_ret);
24306}
24307
24308
24309static int
24310test_xmlURIEscape(void) {
24311    int test_ret = 0;
24312
24313    int mem_base;
24314    xmlChar * ret_val;
24315    xmlChar * str; /* the string of the URI to escape */
24316    int n_str;
24317
24318    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24319        mem_base = xmlMemBlocks();
24320        str = gen_const_xmlChar_ptr(n_str, 0);
24321
24322        ret_val = xmlURIEscape((const xmlChar *)str);
24323        desret_xmlChar_ptr(ret_val);
24324        call_tests++;
24325        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24326        xmlResetLastError();
24327        if (mem_base != xmlMemBlocks()) {
24328            printf("Leak of %d blocks found in xmlURIEscape",
24329	           xmlMemBlocks() - mem_base);
24330	    test_ret++;
24331            printf(" %d", n_str);
24332            printf("\n");
24333        }
24334    }
24335    function_tests++;
24336
24337    return(test_ret);
24338}
24339
24340
24341static int
24342test_xmlURIEscapeStr(void) {
24343    int test_ret = 0;
24344
24345    int mem_base;
24346    xmlChar * ret_val;
24347    xmlChar * str; /* string to escape */
24348    int n_str;
24349    xmlChar * list; /* exception list string of chars not to escape */
24350    int n_list;
24351
24352    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24353    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24354        mem_base = xmlMemBlocks();
24355        str = gen_const_xmlChar_ptr(n_str, 0);
24356        list = gen_const_xmlChar_ptr(n_list, 1);
24357
24358        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24359        desret_xmlChar_ptr(ret_val);
24360        call_tests++;
24361        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24362        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24363        xmlResetLastError();
24364        if (mem_base != xmlMemBlocks()) {
24365            printf("Leak of %d blocks found in xmlURIEscapeStr",
24366	           xmlMemBlocks() - mem_base);
24367	    test_ret++;
24368            printf(" %d", n_str);
24369            printf(" %d", n_list);
24370            printf("\n");
24371        }
24372    }
24373    }
24374    function_tests++;
24375
24376    return(test_ret);
24377}
24378
24379
24380static int
24381test_xmlURIUnescapeString(void) {
24382    int test_ret = 0;
24383
24384
24385    /* missing type support */
24386    return(test_ret);
24387}
24388
24389static int
24390test_uri(void) {
24391    int test_ret = 0;
24392
24393    if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24394    test_ret += test_xmlBuildRelativeURI();
24395    test_ret += test_xmlBuildURI();
24396    test_ret += test_xmlCanonicPath();
24397    test_ret += test_xmlCreateURI();
24398    test_ret += test_xmlNormalizeURIPath();
24399    test_ret += test_xmlParseURI();
24400    test_ret += test_xmlParseURIRaw();
24401    test_ret += test_xmlParseURIReference();
24402    test_ret += test_xmlPathToURI();
24403    test_ret += test_xmlPrintURI();
24404    test_ret += test_xmlSaveUri();
24405    test_ret += test_xmlURIEscape();
24406    test_ret += test_xmlURIEscapeStr();
24407    test_ret += test_xmlURIUnescapeString();
24408
24409    if (test_ret != 0)
24410	printf("Module uri: %d errors\n", test_ret);
24411    return(test_ret);
24412}
24413
24414static int
24415test_xmlAddAttributeDecl(void) {
24416    int test_ret = 0;
24417
24418    int mem_base;
24419    xmlAttributePtr ret_val;
24420    xmlValidCtxtPtr ctxt; /* the validation context */
24421    int n_ctxt;
24422    xmlDtdPtr dtd; /* pointer to the DTD */
24423    int n_dtd;
24424    xmlChar * elem; /* the element name */
24425    int n_elem;
24426    xmlChar * name; /* the attribute name */
24427    int n_name;
24428    xmlChar * ns; /* the attribute namespace prefix */
24429    int n_ns;
24430    xmlAttributeType type; /* the attribute type */
24431    int n_type;
24432    xmlAttributeDefault def; /* the attribute default type */
24433    int n_def;
24434    xmlChar * defaultValue; /* the attribute default value */
24435    int n_defaultValue;
24436    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24437    int n_tree;
24438
24439    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24440    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24441    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24442    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24443    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24444    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24445    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24446    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24447    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24448        mem_base = xmlMemBlocks();
24449        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24450        dtd = gen_xmlDtdPtr(n_dtd, 1);
24451        elem = gen_const_xmlChar_ptr(n_elem, 2);
24452        name = gen_const_xmlChar_ptr(n_name, 3);
24453        ns = gen_const_xmlChar_ptr(n_ns, 4);
24454        type = gen_xmlAttributeType(n_type, 5);
24455        def = gen_xmlAttributeDefault(n_def, 6);
24456        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24457        tree = gen_xmlEnumerationPtr(n_tree, 8);
24458
24459        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24460        desret_xmlAttributePtr(ret_val);
24461        call_tests++;
24462        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24463        des_xmlDtdPtr(n_dtd, dtd, 1);
24464        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24465        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24466        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24467        des_xmlAttributeType(n_type, type, 5);
24468        des_xmlAttributeDefault(n_def, def, 6);
24469        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24470        des_xmlEnumerationPtr(n_tree, tree, 8);
24471        xmlResetLastError();
24472        if (mem_base != xmlMemBlocks()) {
24473            printf("Leak of %d blocks found in xmlAddAttributeDecl",
24474	           xmlMemBlocks() - mem_base);
24475	    test_ret++;
24476            printf(" %d", n_ctxt);
24477            printf(" %d", n_dtd);
24478            printf(" %d", n_elem);
24479            printf(" %d", n_name);
24480            printf(" %d", n_ns);
24481            printf(" %d", n_type);
24482            printf(" %d", n_def);
24483            printf(" %d", n_defaultValue);
24484            printf(" %d", n_tree);
24485            printf("\n");
24486        }
24487    }
24488    }
24489    }
24490    }
24491    }
24492    }
24493    }
24494    }
24495    }
24496    function_tests++;
24497
24498    return(test_ret);
24499}
24500
24501
24502static int
24503test_xmlAddElementDecl(void) {
24504    int test_ret = 0;
24505
24506    int mem_base;
24507    xmlElementPtr ret_val;
24508    xmlValidCtxtPtr ctxt; /* the validation context */
24509    int n_ctxt;
24510    xmlDtdPtr dtd; /* pointer to the DTD */
24511    int n_dtd;
24512    xmlChar * name; /* the entity name */
24513    int n_name;
24514    xmlElementTypeVal type; /* the element type */
24515    int n_type;
24516    xmlElementContentPtr content; /* the element content tree or NULL */
24517    int n_content;
24518
24519    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24520    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24521    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24522    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24523    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24524        mem_base = xmlMemBlocks();
24525        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24526        dtd = gen_xmlDtdPtr(n_dtd, 1);
24527        name = gen_const_xmlChar_ptr(n_name, 2);
24528        type = gen_xmlElementTypeVal(n_type, 3);
24529        content = gen_xmlElementContentPtr(n_content, 4);
24530
24531        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24532        desret_xmlElementPtr(ret_val);
24533        call_tests++;
24534        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24535        des_xmlDtdPtr(n_dtd, dtd, 1);
24536        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24537        des_xmlElementTypeVal(n_type, type, 3);
24538        des_xmlElementContentPtr(n_content, content, 4);
24539        xmlResetLastError();
24540        if (mem_base != xmlMemBlocks()) {
24541            printf("Leak of %d blocks found in xmlAddElementDecl",
24542	           xmlMemBlocks() - mem_base);
24543	    test_ret++;
24544            printf(" %d", n_ctxt);
24545            printf(" %d", n_dtd);
24546            printf(" %d", n_name);
24547            printf(" %d", n_type);
24548            printf(" %d", n_content);
24549            printf("\n");
24550        }
24551    }
24552    }
24553    }
24554    }
24555    }
24556    function_tests++;
24557
24558    return(test_ret);
24559}
24560
24561
24562static int
24563test_xmlAddID(void) {
24564    int test_ret = 0;
24565
24566
24567    /* missing type support */
24568    return(test_ret);
24569}
24570
24571
24572static int
24573test_xmlAddNotationDecl(void) {
24574    int test_ret = 0;
24575
24576
24577    /* missing type support */
24578    return(test_ret);
24579}
24580
24581
24582static int
24583test_xmlAddRef(void) {
24584    int test_ret = 0;
24585
24586
24587    /* missing type support */
24588    return(test_ret);
24589}
24590
24591
24592#define gen_nb_xmlAttributeTablePtr 1
24593static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24594    return(NULL);
24595}
24596static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24597}
24598
24599static int
24600test_xmlCopyAttributeTable(void) {
24601    int test_ret = 0;
24602
24603
24604    /* missing type support */
24605    return(test_ret);
24606}
24607
24608
24609static int
24610test_xmlCopyDocElementContent(void) {
24611    int test_ret = 0;
24612
24613    int mem_base;
24614    xmlElementContentPtr ret_val;
24615    xmlDocPtr doc; /* the document owning the element declaration */
24616    int n_doc;
24617    xmlElementContentPtr cur; /* An element content pointer. */
24618    int n_cur;
24619
24620    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24621    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24622        mem_base = xmlMemBlocks();
24623        doc = gen_xmlDocPtr(n_doc, 0);
24624        cur = gen_xmlElementContentPtr(n_cur, 1);
24625
24626        ret_val = xmlCopyDocElementContent(doc, cur);
24627        desret_xmlElementContentPtr(ret_val);
24628        call_tests++;
24629        des_xmlDocPtr(n_doc, doc, 0);
24630        des_xmlElementContentPtr(n_cur, cur, 1);
24631        xmlResetLastError();
24632        if (mem_base != xmlMemBlocks()) {
24633            printf("Leak of %d blocks found in xmlCopyDocElementContent",
24634	           xmlMemBlocks() - mem_base);
24635	    test_ret++;
24636            printf(" %d", n_doc);
24637            printf(" %d", n_cur);
24638            printf("\n");
24639        }
24640    }
24641    }
24642    function_tests++;
24643
24644    return(test_ret);
24645}
24646
24647
24648static int
24649test_xmlCopyElementContent(void) {
24650    int test_ret = 0;
24651
24652    int mem_base;
24653    xmlElementContentPtr ret_val;
24654    xmlElementContentPtr cur; /* An element content pointer. */
24655    int n_cur;
24656
24657    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24658        mem_base = xmlMemBlocks();
24659        cur = gen_xmlElementContentPtr(n_cur, 0);
24660
24661        ret_val = xmlCopyElementContent(cur);
24662        desret_xmlElementContentPtr(ret_val);
24663        call_tests++;
24664        des_xmlElementContentPtr(n_cur, cur, 0);
24665        xmlResetLastError();
24666        if (mem_base != xmlMemBlocks()) {
24667            printf("Leak of %d blocks found in xmlCopyElementContent",
24668	           xmlMemBlocks() - mem_base);
24669	    test_ret++;
24670            printf(" %d", n_cur);
24671            printf("\n");
24672        }
24673    }
24674    function_tests++;
24675
24676    return(test_ret);
24677}
24678
24679
24680#define gen_nb_xmlElementTablePtr 1
24681static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24682    return(NULL);
24683}
24684static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24685}
24686
24687static int
24688test_xmlCopyElementTable(void) {
24689    int test_ret = 0;
24690
24691
24692    /* missing type support */
24693    return(test_ret);
24694}
24695
24696
24697static int
24698test_xmlCopyEnumeration(void) {
24699    int test_ret = 0;
24700
24701
24702    /* missing type support */
24703    return(test_ret);
24704}
24705
24706
24707#define gen_nb_xmlNotationTablePtr 1
24708static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24709    return(NULL);
24710}
24711static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24712}
24713
24714static int
24715test_xmlCopyNotationTable(void) {
24716    int test_ret = 0;
24717
24718
24719    /* missing type support */
24720    return(test_ret);
24721}
24722
24723
24724static int
24725test_xmlCreateEnumeration(void) {
24726    int test_ret = 0;
24727
24728
24729    /* missing type support */
24730    return(test_ret);
24731}
24732
24733
24734#define gen_nb_xmlAttributePtr 1
24735static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24736    return(NULL);
24737}
24738static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24739}
24740
24741static int
24742test_xmlDumpAttributeDecl(void) {
24743    int test_ret = 0;
24744
24745#if defined(LIBXML_OUTPUT_ENABLED)
24746    int mem_base;
24747    xmlBufferPtr buf; /* the XML buffer output */
24748    int n_buf;
24749    xmlAttributePtr attr; /* An attribute declaration */
24750    int n_attr;
24751
24752    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24753    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24754        mem_base = xmlMemBlocks();
24755        buf = gen_xmlBufferPtr(n_buf, 0);
24756        attr = gen_xmlAttributePtr(n_attr, 1);
24757
24758        xmlDumpAttributeDecl(buf, attr);
24759        call_tests++;
24760        des_xmlBufferPtr(n_buf, buf, 0);
24761        des_xmlAttributePtr(n_attr, attr, 1);
24762        xmlResetLastError();
24763        if (mem_base != xmlMemBlocks()) {
24764            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24765	           xmlMemBlocks() - mem_base);
24766	    test_ret++;
24767            printf(" %d", n_buf);
24768            printf(" %d", n_attr);
24769            printf("\n");
24770        }
24771    }
24772    }
24773    function_tests++;
24774#endif
24775
24776    return(test_ret);
24777}
24778
24779
24780static int
24781test_xmlDumpAttributeTable(void) {
24782    int test_ret = 0;
24783
24784#if defined(LIBXML_OUTPUT_ENABLED)
24785    int mem_base;
24786    xmlBufferPtr buf; /* the XML buffer output */
24787    int n_buf;
24788    xmlAttributeTablePtr table; /* An attribute table */
24789    int n_table;
24790
24791    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24792    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24793        mem_base = xmlMemBlocks();
24794        buf = gen_xmlBufferPtr(n_buf, 0);
24795        table = gen_xmlAttributeTablePtr(n_table, 1);
24796
24797        xmlDumpAttributeTable(buf, table);
24798        call_tests++;
24799        des_xmlBufferPtr(n_buf, buf, 0);
24800        des_xmlAttributeTablePtr(n_table, table, 1);
24801        xmlResetLastError();
24802        if (mem_base != xmlMemBlocks()) {
24803            printf("Leak of %d blocks found in xmlDumpAttributeTable",
24804	           xmlMemBlocks() - mem_base);
24805	    test_ret++;
24806            printf(" %d", n_buf);
24807            printf(" %d", n_table);
24808            printf("\n");
24809        }
24810    }
24811    }
24812    function_tests++;
24813#endif
24814
24815    return(test_ret);
24816}
24817
24818
24819#define gen_nb_xmlElementPtr 1
24820static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24821    return(NULL);
24822}
24823static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24824}
24825
24826static int
24827test_xmlDumpElementDecl(void) {
24828    int test_ret = 0;
24829
24830#if defined(LIBXML_OUTPUT_ENABLED)
24831    int mem_base;
24832    xmlBufferPtr buf; /* the XML buffer output */
24833    int n_buf;
24834    xmlElementPtr elem; /* An element table */
24835    int n_elem;
24836
24837    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24838    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24839        mem_base = xmlMemBlocks();
24840        buf = gen_xmlBufferPtr(n_buf, 0);
24841        elem = gen_xmlElementPtr(n_elem, 1);
24842
24843        xmlDumpElementDecl(buf, elem);
24844        call_tests++;
24845        des_xmlBufferPtr(n_buf, buf, 0);
24846        des_xmlElementPtr(n_elem, elem, 1);
24847        xmlResetLastError();
24848        if (mem_base != xmlMemBlocks()) {
24849            printf("Leak of %d blocks found in xmlDumpElementDecl",
24850	           xmlMemBlocks() - mem_base);
24851	    test_ret++;
24852            printf(" %d", n_buf);
24853            printf(" %d", n_elem);
24854            printf("\n");
24855        }
24856    }
24857    }
24858    function_tests++;
24859#endif
24860
24861    return(test_ret);
24862}
24863
24864
24865static int
24866test_xmlDumpElementTable(void) {
24867    int test_ret = 0;
24868
24869#if defined(LIBXML_OUTPUT_ENABLED)
24870    int mem_base;
24871    xmlBufferPtr buf; /* the XML buffer output */
24872    int n_buf;
24873    xmlElementTablePtr table; /* An element table */
24874    int n_table;
24875
24876    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24877    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24878        mem_base = xmlMemBlocks();
24879        buf = gen_xmlBufferPtr(n_buf, 0);
24880        table = gen_xmlElementTablePtr(n_table, 1);
24881
24882        xmlDumpElementTable(buf, table);
24883        call_tests++;
24884        des_xmlBufferPtr(n_buf, buf, 0);
24885        des_xmlElementTablePtr(n_table, table, 1);
24886        xmlResetLastError();
24887        if (mem_base != xmlMemBlocks()) {
24888            printf("Leak of %d blocks found in xmlDumpElementTable",
24889	           xmlMemBlocks() - mem_base);
24890	    test_ret++;
24891            printf(" %d", n_buf);
24892            printf(" %d", n_table);
24893            printf("\n");
24894        }
24895    }
24896    }
24897    function_tests++;
24898#endif
24899
24900    return(test_ret);
24901}
24902
24903
24904#define gen_nb_xmlNotationPtr 1
24905static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24906    return(NULL);
24907}
24908static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24909}
24910
24911static int
24912test_xmlDumpNotationDecl(void) {
24913    int test_ret = 0;
24914
24915#if defined(LIBXML_OUTPUT_ENABLED)
24916    int mem_base;
24917    xmlBufferPtr buf; /* the XML buffer output */
24918    int n_buf;
24919    xmlNotationPtr nota; /* A notation declaration */
24920    int n_nota;
24921
24922    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24923    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24924        mem_base = xmlMemBlocks();
24925        buf = gen_xmlBufferPtr(n_buf, 0);
24926        nota = gen_xmlNotationPtr(n_nota, 1);
24927
24928        xmlDumpNotationDecl(buf, nota);
24929        call_tests++;
24930        des_xmlBufferPtr(n_buf, buf, 0);
24931        des_xmlNotationPtr(n_nota, nota, 1);
24932        xmlResetLastError();
24933        if (mem_base != xmlMemBlocks()) {
24934            printf("Leak of %d blocks found in xmlDumpNotationDecl",
24935	           xmlMemBlocks() - mem_base);
24936	    test_ret++;
24937            printf(" %d", n_buf);
24938            printf(" %d", n_nota);
24939            printf("\n");
24940        }
24941    }
24942    }
24943    function_tests++;
24944#endif
24945
24946    return(test_ret);
24947}
24948
24949
24950static int
24951test_xmlDumpNotationTable(void) {
24952    int test_ret = 0;
24953
24954#if defined(LIBXML_OUTPUT_ENABLED)
24955    int mem_base;
24956    xmlBufferPtr buf; /* the XML buffer output */
24957    int n_buf;
24958    xmlNotationTablePtr table; /* A notation table */
24959    int n_table;
24960
24961    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24962    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24963        mem_base = xmlMemBlocks();
24964        buf = gen_xmlBufferPtr(n_buf, 0);
24965        table = gen_xmlNotationTablePtr(n_table, 1);
24966
24967        xmlDumpNotationTable(buf, table);
24968        call_tests++;
24969        des_xmlBufferPtr(n_buf, buf, 0);
24970        des_xmlNotationTablePtr(n_table, table, 1);
24971        xmlResetLastError();
24972        if (mem_base != xmlMemBlocks()) {
24973            printf("Leak of %d blocks found in xmlDumpNotationTable",
24974	           xmlMemBlocks() - mem_base);
24975	    test_ret++;
24976            printf(" %d", n_buf);
24977            printf(" %d", n_table);
24978            printf("\n");
24979        }
24980    }
24981    }
24982    function_tests++;
24983#endif
24984
24985    return(test_ret);
24986}
24987
24988
24989static int
24990test_xmlGetDtdAttrDesc(void) {
24991    int test_ret = 0;
24992
24993    int mem_base;
24994    xmlAttributePtr ret_val;
24995    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24996    int n_dtd;
24997    xmlChar * elem; /* the element name */
24998    int n_elem;
24999    xmlChar * name; /* the attribute name */
25000    int n_name;
25001
25002    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25003    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25004    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25005        mem_base = xmlMemBlocks();
25006        dtd = gen_xmlDtdPtr(n_dtd, 0);
25007        elem = gen_const_xmlChar_ptr(n_elem, 1);
25008        name = gen_const_xmlChar_ptr(n_name, 2);
25009
25010        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25011        desret_xmlAttributePtr(ret_val);
25012        call_tests++;
25013        des_xmlDtdPtr(n_dtd, dtd, 0);
25014        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25015        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25016        xmlResetLastError();
25017        if (mem_base != xmlMemBlocks()) {
25018            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25019	           xmlMemBlocks() - mem_base);
25020	    test_ret++;
25021            printf(" %d", n_dtd);
25022            printf(" %d", n_elem);
25023            printf(" %d", n_name);
25024            printf("\n");
25025        }
25026    }
25027    }
25028    }
25029    function_tests++;
25030
25031    return(test_ret);
25032}
25033
25034
25035static int
25036test_xmlGetDtdElementDesc(void) {
25037    int test_ret = 0;
25038
25039    int mem_base;
25040    xmlElementPtr ret_val;
25041    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25042    int n_dtd;
25043    xmlChar * name; /* the element name */
25044    int n_name;
25045
25046    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25047    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25048        mem_base = xmlMemBlocks();
25049        dtd = gen_xmlDtdPtr(n_dtd, 0);
25050        name = gen_const_xmlChar_ptr(n_name, 1);
25051
25052        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25053        desret_xmlElementPtr(ret_val);
25054        call_tests++;
25055        des_xmlDtdPtr(n_dtd, dtd, 0);
25056        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25057        xmlResetLastError();
25058        if (mem_base != xmlMemBlocks()) {
25059            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25060	           xmlMemBlocks() - mem_base);
25061	    test_ret++;
25062            printf(" %d", n_dtd);
25063            printf(" %d", n_name);
25064            printf("\n");
25065        }
25066    }
25067    }
25068    function_tests++;
25069
25070    return(test_ret);
25071}
25072
25073
25074static int
25075test_xmlGetDtdNotationDesc(void) {
25076    int test_ret = 0;
25077
25078
25079    /* missing type support */
25080    return(test_ret);
25081}
25082
25083
25084static int
25085test_xmlGetDtdQAttrDesc(void) {
25086    int test_ret = 0;
25087
25088    int mem_base;
25089    xmlAttributePtr ret_val;
25090    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25091    int n_dtd;
25092    xmlChar * elem; /* the element name */
25093    int n_elem;
25094    xmlChar * name; /* the attribute name */
25095    int n_name;
25096    xmlChar * prefix; /* the attribute namespace prefix */
25097    int n_prefix;
25098
25099    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25100    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25101    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25102    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25103        mem_base = xmlMemBlocks();
25104        dtd = gen_xmlDtdPtr(n_dtd, 0);
25105        elem = gen_const_xmlChar_ptr(n_elem, 1);
25106        name = gen_const_xmlChar_ptr(n_name, 2);
25107        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25108
25109        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25110        desret_xmlAttributePtr(ret_val);
25111        call_tests++;
25112        des_xmlDtdPtr(n_dtd, dtd, 0);
25113        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25114        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25115        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25116        xmlResetLastError();
25117        if (mem_base != xmlMemBlocks()) {
25118            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25119	           xmlMemBlocks() - mem_base);
25120	    test_ret++;
25121            printf(" %d", n_dtd);
25122            printf(" %d", n_elem);
25123            printf(" %d", n_name);
25124            printf(" %d", n_prefix);
25125            printf("\n");
25126        }
25127    }
25128    }
25129    }
25130    }
25131    function_tests++;
25132
25133    return(test_ret);
25134}
25135
25136
25137static int
25138test_xmlGetDtdQElementDesc(void) {
25139    int test_ret = 0;
25140
25141    int mem_base;
25142    xmlElementPtr ret_val;
25143    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25144    int n_dtd;
25145    xmlChar * name; /* the element name */
25146    int n_name;
25147    xmlChar * prefix; /* the element namespace prefix */
25148    int n_prefix;
25149
25150    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25151    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25152    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25153        mem_base = xmlMemBlocks();
25154        dtd = gen_xmlDtdPtr(n_dtd, 0);
25155        name = gen_const_xmlChar_ptr(n_name, 1);
25156        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25157
25158        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25159        desret_xmlElementPtr(ret_val);
25160        call_tests++;
25161        des_xmlDtdPtr(n_dtd, dtd, 0);
25162        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25163        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25164        xmlResetLastError();
25165        if (mem_base != xmlMemBlocks()) {
25166            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25167	           xmlMemBlocks() - mem_base);
25168	    test_ret++;
25169            printf(" %d", n_dtd);
25170            printf(" %d", n_name);
25171            printf(" %d", n_prefix);
25172            printf("\n");
25173        }
25174    }
25175    }
25176    }
25177    function_tests++;
25178
25179    return(test_ret);
25180}
25181
25182
25183static int
25184test_xmlGetID(void) {
25185    int test_ret = 0;
25186
25187    int mem_base;
25188    xmlAttrPtr ret_val;
25189    xmlDocPtr doc; /* pointer to the document */
25190    int n_doc;
25191    xmlChar * ID; /* the ID value */
25192    int n_ID;
25193
25194    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25195    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25196        mem_base = xmlMemBlocks();
25197        doc = gen_xmlDocPtr(n_doc, 0);
25198        ID = gen_const_xmlChar_ptr(n_ID, 1);
25199
25200        ret_val = xmlGetID(doc, (const xmlChar *)ID);
25201        desret_xmlAttrPtr(ret_val);
25202        call_tests++;
25203        des_xmlDocPtr(n_doc, doc, 0);
25204        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25205        xmlResetLastError();
25206        if (mem_base != xmlMemBlocks()) {
25207            printf("Leak of %d blocks found in xmlGetID",
25208	           xmlMemBlocks() - mem_base);
25209	    test_ret++;
25210            printf(" %d", n_doc);
25211            printf(" %d", n_ID);
25212            printf("\n");
25213        }
25214    }
25215    }
25216    function_tests++;
25217
25218    return(test_ret);
25219}
25220
25221
25222static int
25223test_xmlGetRefs(void) {
25224    int test_ret = 0;
25225
25226
25227    /* missing type support */
25228    return(test_ret);
25229}
25230
25231
25232static int
25233test_xmlIsID(void) {
25234    int test_ret = 0;
25235
25236    int mem_base;
25237    int ret_val;
25238    xmlDocPtr doc; /* the document */
25239    int n_doc;
25240    xmlNodePtr elem; /* the element carrying the attribute */
25241    int n_elem;
25242    xmlAttrPtr attr; /* the attribute */
25243    int n_attr;
25244
25245    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25246    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25247    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25248        mem_base = xmlMemBlocks();
25249        doc = gen_xmlDocPtr(n_doc, 0);
25250        elem = gen_xmlNodePtr(n_elem, 1);
25251        attr = gen_xmlAttrPtr(n_attr, 2);
25252
25253        ret_val = xmlIsID(doc, elem, attr);
25254        desret_int(ret_val);
25255        call_tests++;
25256        des_xmlDocPtr(n_doc, doc, 0);
25257        des_xmlNodePtr(n_elem, elem, 1);
25258        des_xmlAttrPtr(n_attr, attr, 2);
25259        xmlResetLastError();
25260        if (mem_base != xmlMemBlocks()) {
25261            printf("Leak of %d blocks found in xmlIsID",
25262	           xmlMemBlocks() - mem_base);
25263	    test_ret++;
25264            printf(" %d", n_doc);
25265            printf(" %d", n_elem);
25266            printf(" %d", n_attr);
25267            printf("\n");
25268        }
25269    }
25270    }
25271    }
25272    function_tests++;
25273
25274    return(test_ret);
25275}
25276
25277
25278static int
25279test_xmlIsMixedElement(void) {
25280    int test_ret = 0;
25281
25282    int mem_base;
25283    int ret_val;
25284    xmlDocPtr doc; /* the document */
25285    int n_doc;
25286    xmlChar * name; /* the element name */
25287    int n_name;
25288
25289    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25290    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25291        mem_base = xmlMemBlocks();
25292        doc = gen_xmlDocPtr(n_doc, 0);
25293        name = gen_const_xmlChar_ptr(n_name, 1);
25294
25295        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25296        desret_int(ret_val);
25297        call_tests++;
25298        des_xmlDocPtr(n_doc, doc, 0);
25299        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25300        xmlResetLastError();
25301        if (mem_base != xmlMemBlocks()) {
25302            printf("Leak of %d blocks found in xmlIsMixedElement",
25303	           xmlMemBlocks() - mem_base);
25304	    test_ret++;
25305            printf(" %d", n_doc);
25306            printf(" %d", n_name);
25307            printf("\n");
25308        }
25309    }
25310    }
25311    function_tests++;
25312
25313    return(test_ret);
25314}
25315
25316
25317static int
25318test_xmlIsRef(void) {
25319    int test_ret = 0;
25320
25321    int mem_base;
25322    int ret_val;
25323    xmlDocPtr doc; /* the document */
25324    int n_doc;
25325    xmlNodePtr elem; /* the element carrying the attribute */
25326    int n_elem;
25327    xmlAttrPtr attr; /* the attribute */
25328    int n_attr;
25329
25330    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25331    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25332    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25333        mem_base = xmlMemBlocks();
25334        doc = gen_xmlDocPtr(n_doc, 0);
25335        elem = gen_xmlNodePtr(n_elem, 1);
25336        attr = gen_xmlAttrPtr(n_attr, 2);
25337
25338        ret_val = xmlIsRef(doc, elem, attr);
25339        desret_int(ret_val);
25340        call_tests++;
25341        des_xmlDocPtr(n_doc, doc, 0);
25342        des_xmlNodePtr(n_elem, elem, 1);
25343        des_xmlAttrPtr(n_attr, attr, 2);
25344        xmlResetLastError();
25345        if (mem_base != xmlMemBlocks()) {
25346            printf("Leak of %d blocks found in xmlIsRef",
25347	           xmlMemBlocks() - mem_base);
25348	    test_ret++;
25349            printf(" %d", n_doc);
25350            printf(" %d", n_elem);
25351            printf(" %d", n_attr);
25352            printf("\n");
25353        }
25354    }
25355    }
25356    }
25357    function_tests++;
25358
25359    return(test_ret);
25360}
25361
25362
25363static int
25364test_xmlNewDocElementContent(void) {
25365    int test_ret = 0;
25366
25367    int mem_base;
25368    xmlElementContentPtr ret_val;
25369    xmlDocPtr doc; /* the document */
25370    int n_doc;
25371    xmlChar * name; /* the subelement name or NULL */
25372    int n_name;
25373    xmlElementContentType type; /* the type of element content decl */
25374    int n_type;
25375
25376    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25377    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25378    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25379        mem_base = xmlMemBlocks();
25380        doc = gen_xmlDocPtr(n_doc, 0);
25381        name = gen_const_xmlChar_ptr(n_name, 1);
25382        type = gen_xmlElementContentType(n_type, 2);
25383
25384        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25385        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25386        desret_xmlElementContentPtr(ret_val);
25387        call_tests++;
25388        des_xmlDocPtr(n_doc, doc, 0);
25389        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25390        des_xmlElementContentType(n_type, type, 2);
25391        xmlResetLastError();
25392        if (mem_base != xmlMemBlocks()) {
25393            printf("Leak of %d blocks found in xmlNewDocElementContent",
25394	           xmlMemBlocks() - mem_base);
25395	    test_ret++;
25396            printf(" %d", n_doc);
25397            printf(" %d", n_name);
25398            printf(" %d", n_type);
25399            printf("\n");
25400        }
25401    }
25402    }
25403    }
25404    function_tests++;
25405
25406    return(test_ret);
25407}
25408
25409
25410static int
25411test_xmlNewElementContent(void) {
25412    int test_ret = 0;
25413
25414    int mem_base;
25415    xmlElementContentPtr ret_val;
25416    xmlChar * name; /* the subelement name or NULL */
25417    int n_name;
25418    xmlElementContentType type; /* the type of element content decl */
25419    int n_type;
25420
25421    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25422    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25423        mem_base = xmlMemBlocks();
25424        name = gen_const_xmlChar_ptr(n_name, 0);
25425        type = gen_xmlElementContentType(n_type, 1);
25426
25427        ret_val = xmlNewElementContent((const xmlChar *)name, type);
25428        desret_xmlElementContentPtr(ret_val);
25429        call_tests++;
25430        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25431        des_xmlElementContentType(n_type, type, 1);
25432        xmlResetLastError();
25433        if (mem_base != xmlMemBlocks()) {
25434            printf("Leak of %d blocks found in xmlNewElementContent",
25435	           xmlMemBlocks() - mem_base);
25436	    test_ret++;
25437            printf(" %d", n_name);
25438            printf(" %d", n_type);
25439            printf("\n");
25440        }
25441    }
25442    }
25443    function_tests++;
25444
25445    return(test_ret);
25446}
25447
25448
25449static int
25450test_xmlNewValidCtxt(void) {
25451    int test_ret = 0;
25452
25453
25454    /* missing type support */
25455    return(test_ret);
25456}
25457
25458
25459static int
25460test_xmlRemoveID(void) {
25461    int test_ret = 0;
25462
25463    int mem_base;
25464    int ret_val;
25465    xmlDocPtr doc; /* the document */
25466    int n_doc;
25467    xmlAttrPtr attr; /* the attribute */
25468    int n_attr;
25469
25470    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25471    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25472        mem_base = xmlMemBlocks();
25473        doc = gen_xmlDocPtr(n_doc, 0);
25474        attr = gen_xmlAttrPtr(n_attr, 1);
25475
25476        ret_val = xmlRemoveID(doc, attr);
25477        desret_int(ret_val);
25478        call_tests++;
25479        des_xmlDocPtr(n_doc, doc, 0);
25480        des_xmlAttrPtr(n_attr, attr, 1);
25481        xmlResetLastError();
25482        if (mem_base != xmlMemBlocks()) {
25483            printf("Leak of %d blocks found in xmlRemoveID",
25484	           xmlMemBlocks() - mem_base);
25485	    test_ret++;
25486            printf(" %d", n_doc);
25487            printf(" %d", n_attr);
25488            printf("\n");
25489        }
25490    }
25491    }
25492    function_tests++;
25493
25494    return(test_ret);
25495}
25496
25497
25498static int
25499test_xmlRemoveRef(void) {
25500    int test_ret = 0;
25501
25502    int mem_base;
25503    int ret_val;
25504    xmlDocPtr doc; /* the document */
25505    int n_doc;
25506    xmlAttrPtr attr; /* the attribute */
25507    int n_attr;
25508
25509    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25510    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25511        mem_base = xmlMemBlocks();
25512        doc = gen_xmlDocPtr(n_doc, 0);
25513        attr = gen_xmlAttrPtr(n_attr, 1);
25514
25515        ret_val = xmlRemoveRef(doc, attr);
25516        desret_int(ret_val);
25517        call_tests++;
25518        des_xmlDocPtr(n_doc, doc, 0);
25519        des_xmlAttrPtr(n_attr, attr, 1);
25520        xmlResetLastError();
25521        if (mem_base != xmlMemBlocks()) {
25522            printf("Leak of %d blocks found in xmlRemoveRef",
25523	           xmlMemBlocks() - mem_base);
25524	    test_ret++;
25525            printf(" %d", n_doc);
25526            printf(" %d", n_attr);
25527            printf("\n");
25528        }
25529    }
25530    }
25531    function_tests++;
25532
25533    return(test_ret);
25534}
25535
25536
25537static int
25538test_xmlSnprintfElementContent(void) {
25539    int test_ret = 0;
25540
25541    int mem_base;
25542    char * buf; /* an output buffer */
25543    int n_buf;
25544    int size; /* the buffer size */
25545    int n_size;
25546    xmlElementContentPtr content; /* An element table */
25547    int n_content;
25548    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25549    int n_englob;
25550
25551    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25552    for (n_size = 0;n_size < gen_nb_int;n_size++) {
25553    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25554    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25555        mem_base = xmlMemBlocks();
25556        buf = gen_char_ptr(n_buf, 0);
25557        size = gen_int(n_size, 1);
25558        content = gen_xmlElementContentPtr(n_content, 2);
25559        englob = gen_int(n_englob, 3);
25560
25561        xmlSnprintfElementContent(buf, size, content, englob);
25562        call_tests++;
25563        des_char_ptr(n_buf, buf, 0);
25564        des_int(n_size, size, 1);
25565        des_xmlElementContentPtr(n_content, content, 2);
25566        des_int(n_englob, englob, 3);
25567        xmlResetLastError();
25568        if (mem_base != xmlMemBlocks()) {
25569            printf("Leak of %d blocks found in xmlSnprintfElementContent",
25570	           xmlMemBlocks() - mem_base);
25571	    test_ret++;
25572            printf(" %d", n_buf);
25573            printf(" %d", n_size);
25574            printf(" %d", n_content);
25575            printf(" %d", n_englob);
25576            printf("\n");
25577        }
25578    }
25579    }
25580    }
25581    }
25582    function_tests++;
25583
25584    return(test_ret);
25585}
25586
25587
25588static int
25589test_xmlSprintfElementContent(void) {
25590    int test_ret = 0;
25591
25592#if defined(LIBXML_OUTPUT_ENABLED)
25593#ifdef LIBXML_OUTPUT_ENABLED
25594    int mem_base;
25595    char * buf; /* an output buffer */
25596    int n_buf;
25597    xmlElementContentPtr content; /* An element table */
25598    int n_content;
25599    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25600    int n_englob;
25601
25602    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25603    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25604    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25605        mem_base = xmlMemBlocks();
25606        buf = gen_char_ptr(n_buf, 0);
25607        content = gen_xmlElementContentPtr(n_content, 1);
25608        englob = gen_int(n_englob, 2);
25609
25610        xmlSprintfElementContent(buf, content, englob);
25611        call_tests++;
25612        des_char_ptr(n_buf, buf, 0);
25613        des_xmlElementContentPtr(n_content, content, 1);
25614        des_int(n_englob, englob, 2);
25615        xmlResetLastError();
25616        if (mem_base != xmlMemBlocks()) {
25617            printf("Leak of %d blocks found in xmlSprintfElementContent",
25618	           xmlMemBlocks() - mem_base);
25619	    test_ret++;
25620            printf(" %d", n_buf);
25621            printf(" %d", n_content);
25622            printf(" %d", n_englob);
25623            printf("\n");
25624        }
25625    }
25626    }
25627    }
25628    function_tests++;
25629#endif
25630#endif
25631
25632    return(test_ret);
25633}
25634
25635
25636static int
25637test_xmlValidBuildContentModel(void) {
25638    int test_ret = 0;
25639
25640#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25641    int mem_base;
25642    int ret_val;
25643    xmlValidCtxtPtr ctxt; /* a validation context */
25644    int n_ctxt;
25645    xmlElementPtr elem; /* an element declaration node */
25646    int n_elem;
25647
25648    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25649    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25650        mem_base = xmlMemBlocks();
25651        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25652        elem = gen_xmlElementPtr(n_elem, 1);
25653
25654        ret_val = xmlValidBuildContentModel(ctxt, elem);
25655        desret_int(ret_val);
25656        call_tests++;
25657        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25658        des_xmlElementPtr(n_elem, elem, 1);
25659        xmlResetLastError();
25660        if (mem_base != xmlMemBlocks()) {
25661            printf("Leak of %d blocks found in xmlValidBuildContentModel",
25662	           xmlMemBlocks() - mem_base);
25663	    test_ret++;
25664            printf(" %d", n_ctxt);
25665            printf(" %d", n_elem);
25666            printf("\n");
25667        }
25668    }
25669    }
25670    function_tests++;
25671#endif
25672
25673    return(test_ret);
25674}
25675
25676
25677static int
25678test_xmlValidCtxtNormalizeAttributeValue(void) {
25679    int test_ret = 0;
25680
25681#if defined(LIBXML_VALID_ENABLED)
25682    int mem_base;
25683    xmlChar * ret_val;
25684    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25685    int n_ctxt;
25686    xmlDocPtr doc; /* the document */
25687    int n_doc;
25688    xmlNodePtr elem; /* the parent */
25689    int n_elem;
25690    xmlChar * name; /* the attribute name */
25691    int n_name;
25692    xmlChar * value; /* the attribute value */
25693    int n_value;
25694
25695    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25696    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25697    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25698    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25699    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25700        mem_base = xmlMemBlocks();
25701        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25702        doc = gen_xmlDocPtr(n_doc, 1);
25703        elem = gen_xmlNodePtr(n_elem, 2);
25704        name = gen_const_xmlChar_ptr(n_name, 3);
25705        value = gen_const_xmlChar_ptr(n_value, 4);
25706
25707        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25708        desret_xmlChar_ptr(ret_val);
25709        call_tests++;
25710        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25711        des_xmlDocPtr(n_doc, doc, 1);
25712        des_xmlNodePtr(n_elem, elem, 2);
25713        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25714        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25715        xmlResetLastError();
25716        if (mem_base != xmlMemBlocks()) {
25717            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25718	           xmlMemBlocks() - mem_base);
25719	    test_ret++;
25720            printf(" %d", n_ctxt);
25721            printf(" %d", n_doc);
25722            printf(" %d", n_elem);
25723            printf(" %d", n_name);
25724            printf(" %d", n_value);
25725            printf("\n");
25726        }
25727    }
25728    }
25729    }
25730    }
25731    }
25732    function_tests++;
25733#endif
25734
25735    return(test_ret);
25736}
25737
25738
25739#define gen_nb_xmlElementContent_ptr 1
25740static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25741    return(NULL);
25742}
25743static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25744}
25745
25746static int
25747test_xmlValidGetPotentialChildren(void) {
25748    int test_ret = 0;
25749
25750#if defined(LIBXML_VALID_ENABLED)
25751#ifdef LIBXML_VALID_ENABLED
25752    int mem_base;
25753    int ret_val;
25754    xmlElementContent * ctree; /* an element content tree */
25755    int n_ctree;
25756    xmlChar ** names; /* an array to store the list of child names */
25757    int n_names;
25758    int * len; /* a pointer to the number of element in the list */
25759    int n_len;
25760    int max; /* the size of the array */
25761    int n_max;
25762
25763    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25764    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25765    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25766    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25767        mem_base = xmlMemBlocks();
25768        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25769        names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25770        len = gen_int_ptr(n_len, 2);
25771        max = gen_int(n_max, 3);
25772
25773        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25774        desret_int(ret_val);
25775        call_tests++;
25776        des_xmlElementContent_ptr(n_ctree, ctree, 0);
25777        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25778        des_int_ptr(n_len, len, 2);
25779        des_int(n_max, max, 3);
25780        xmlResetLastError();
25781        if (mem_base != xmlMemBlocks()) {
25782            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25783	           xmlMemBlocks() - mem_base);
25784	    test_ret++;
25785            printf(" %d", n_ctree);
25786            printf(" %d", n_names);
25787            printf(" %d", n_len);
25788            printf(" %d", n_max);
25789            printf("\n");
25790        }
25791    }
25792    }
25793    }
25794    }
25795    function_tests++;
25796#endif
25797#endif
25798
25799    return(test_ret);
25800}
25801
25802
25803static int
25804test_xmlValidGetValidElements(void) {
25805    int test_ret = 0;
25806
25807#if defined(LIBXML_VALID_ENABLED)
25808#ifdef LIBXML_VALID_ENABLED
25809    int mem_base;
25810    int ret_val;
25811    xmlNode * prev; /* an element to insert after */
25812    int n_prev;
25813    xmlNode * next; /* an element to insert next */
25814    int n_next;
25815    xmlChar ** names; /* an array to store the list of child names */
25816    int n_names;
25817    int max; /* the size of the array */
25818    int n_max;
25819
25820    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25821    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25822    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25823    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25824        mem_base = xmlMemBlocks();
25825        prev = gen_xmlNodePtr(n_prev, 0);
25826        next = gen_xmlNodePtr(n_next, 1);
25827        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25828        max = gen_int(n_max, 3);
25829
25830        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25831        desret_int(ret_val);
25832        call_tests++;
25833        des_xmlNodePtr(n_prev, prev, 0);
25834        des_xmlNodePtr(n_next, next, 1);
25835        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25836        des_int(n_max, max, 3);
25837        xmlResetLastError();
25838        if (mem_base != xmlMemBlocks()) {
25839            printf("Leak of %d blocks found in xmlValidGetValidElements",
25840	           xmlMemBlocks() - mem_base);
25841	    test_ret++;
25842            printf(" %d", n_prev);
25843            printf(" %d", n_next);
25844            printf(" %d", n_names);
25845            printf(" %d", n_max);
25846            printf("\n");
25847        }
25848    }
25849    }
25850    }
25851    }
25852    function_tests++;
25853#endif
25854#endif
25855
25856    return(test_ret);
25857}
25858
25859
25860static int
25861test_xmlValidNormalizeAttributeValue(void) {
25862    int test_ret = 0;
25863
25864#if defined(LIBXML_VALID_ENABLED)
25865    int mem_base;
25866    xmlChar * ret_val;
25867    xmlDocPtr doc; /* the document */
25868    int n_doc;
25869    xmlNodePtr elem; /* the parent */
25870    int n_elem;
25871    xmlChar * name; /* the attribute name */
25872    int n_name;
25873    xmlChar * value; /* the attribute value */
25874    int n_value;
25875
25876    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25877    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25878    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25879    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25880        mem_base = xmlMemBlocks();
25881        doc = gen_xmlDocPtr(n_doc, 0);
25882        elem = gen_xmlNodePtr(n_elem, 1);
25883        name = gen_const_xmlChar_ptr(n_name, 2);
25884        value = gen_const_xmlChar_ptr(n_value, 3);
25885
25886        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25887        desret_xmlChar_ptr(ret_val);
25888        call_tests++;
25889        des_xmlDocPtr(n_doc, doc, 0);
25890        des_xmlNodePtr(n_elem, elem, 1);
25891        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25892        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25893        xmlResetLastError();
25894        if (mem_base != xmlMemBlocks()) {
25895            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25896	           xmlMemBlocks() - mem_base);
25897	    test_ret++;
25898            printf(" %d", n_doc);
25899            printf(" %d", n_elem);
25900            printf(" %d", n_name);
25901            printf(" %d", n_value);
25902            printf("\n");
25903        }
25904    }
25905    }
25906    }
25907    }
25908    function_tests++;
25909#endif
25910
25911    return(test_ret);
25912}
25913
25914
25915static int
25916test_xmlValidateAttributeDecl(void) {
25917    int test_ret = 0;
25918
25919#if defined(LIBXML_VALID_ENABLED)
25920    int mem_base;
25921    int ret_val;
25922    xmlValidCtxtPtr ctxt; /* the validation context */
25923    int n_ctxt;
25924    xmlDocPtr doc; /* a document instance */
25925    int n_doc;
25926    xmlAttributePtr attr; /* an attribute definition */
25927    int n_attr;
25928
25929    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25930    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25931    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25932        mem_base = xmlMemBlocks();
25933        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25934        doc = gen_xmlDocPtr(n_doc, 1);
25935        attr = gen_xmlAttributePtr(n_attr, 2);
25936
25937        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25938        desret_int(ret_val);
25939        call_tests++;
25940        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25941        des_xmlDocPtr(n_doc, doc, 1);
25942        des_xmlAttributePtr(n_attr, attr, 2);
25943        xmlResetLastError();
25944        if (mem_base != xmlMemBlocks()) {
25945            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25946	           xmlMemBlocks() - mem_base);
25947	    test_ret++;
25948            printf(" %d", n_ctxt);
25949            printf(" %d", n_doc);
25950            printf(" %d", n_attr);
25951            printf("\n");
25952        }
25953    }
25954    }
25955    }
25956    function_tests++;
25957#endif
25958
25959    return(test_ret);
25960}
25961
25962
25963static int
25964test_xmlValidateAttributeValue(void) {
25965    int test_ret = 0;
25966
25967#if defined(LIBXML_VALID_ENABLED)
25968    int mem_base;
25969    int ret_val;
25970    xmlAttributeType type; /*  */
25971    int n_type;
25972    xmlChar * value; /*  */
25973    int n_value;
25974
25975    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25976    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25977        mem_base = xmlMemBlocks();
25978        type = gen_xmlAttributeType(n_type, 0);
25979        value = gen_const_xmlChar_ptr(n_value, 1);
25980
25981        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25982        desret_int(ret_val);
25983        call_tests++;
25984        des_xmlAttributeType(n_type, type, 0);
25985        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25986        xmlResetLastError();
25987        if (mem_base != xmlMemBlocks()) {
25988            printf("Leak of %d blocks found in xmlValidateAttributeValue",
25989	           xmlMemBlocks() - mem_base);
25990	    test_ret++;
25991            printf(" %d", n_type);
25992            printf(" %d", n_value);
25993            printf("\n");
25994        }
25995    }
25996    }
25997    function_tests++;
25998#endif
25999
26000    return(test_ret);
26001}
26002
26003
26004static int
26005test_xmlValidateDocument(void) {
26006    int test_ret = 0;
26007
26008#if defined(LIBXML_VALID_ENABLED)
26009    int mem_base;
26010    int ret_val;
26011    xmlValidCtxtPtr ctxt; /* the validation context */
26012    int n_ctxt;
26013    xmlDocPtr doc; /* a document instance */
26014    int n_doc;
26015
26016    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26017    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26018        mem_base = xmlMemBlocks();
26019        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26020        doc = gen_xmlDocPtr(n_doc, 1);
26021
26022        ret_val = xmlValidateDocument(ctxt, doc);
26023        desret_int(ret_val);
26024        call_tests++;
26025        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26026        des_xmlDocPtr(n_doc, doc, 1);
26027        xmlResetLastError();
26028        if (mem_base != xmlMemBlocks()) {
26029            printf("Leak of %d blocks found in xmlValidateDocument",
26030	           xmlMemBlocks() - mem_base);
26031	    test_ret++;
26032            printf(" %d", n_ctxt);
26033            printf(" %d", n_doc);
26034            printf("\n");
26035        }
26036    }
26037    }
26038    function_tests++;
26039#endif
26040
26041    return(test_ret);
26042}
26043
26044
26045static int
26046test_xmlValidateDocumentFinal(void) {
26047    int test_ret = 0;
26048
26049#if defined(LIBXML_VALID_ENABLED)
26050    int mem_base;
26051    int ret_val;
26052    xmlValidCtxtPtr ctxt; /* the validation context */
26053    int n_ctxt;
26054    xmlDocPtr doc; /* a document instance */
26055    int n_doc;
26056
26057    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26058    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26059        mem_base = xmlMemBlocks();
26060        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26061        doc = gen_xmlDocPtr(n_doc, 1);
26062
26063        ret_val = xmlValidateDocumentFinal(ctxt, doc);
26064        desret_int(ret_val);
26065        call_tests++;
26066        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26067        des_xmlDocPtr(n_doc, doc, 1);
26068        xmlResetLastError();
26069        if (mem_base != xmlMemBlocks()) {
26070            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26071	           xmlMemBlocks() - mem_base);
26072	    test_ret++;
26073            printf(" %d", n_ctxt);
26074            printf(" %d", n_doc);
26075            printf("\n");
26076        }
26077    }
26078    }
26079    function_tests++;
26080#endif
26081
26082    return(test_ret);
26083}
26084
26085
26086static int
26087test_xmlValidateDtd(void) {
26088    int test_ret = 0;
26089
26090#if defined(LIBXML_VALID_ENABLED)
26091    int mem_base;
26092    int ret_val;
26093    xmlValidCtxtPtr ctxt; /* the validation context */
26094    int n_ctxt;
26095    xmlDocPtr doc; /* a document instance */
26096    int n_doc;
26097    xmlDtdPtr dtd; /* a dtd instance */
26098    int n_dtd;
26099
26100    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26101    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26102    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26103        mem_base = xmlMemBlocks();
26104        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26105        doc = gen_xmlDocPtr(n_doc, 1);
26106        dtd = gen_xmlDtdPtr(n_dtd, 2);
26107
26108        ret_val = xmlValidateDtd(ctxt, doc, dtd);
26109        desret_int(ret_val);
26110        call_tests++;
26111        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26112        des_xmlDocPtr(n_doc, doc, 1);
26113        des_xmlDtdPtr(n_dtd, dtd, 2);
26114        xmlResetLastError();
26115        if (mem_base != xmlMemBlocks()) {
26116            printf("Leak of %d blocks found in xmlValidateDtd",
26117	           xmlMemBlocks() - mem_base);
26118	    test_ret++;
26119            printf(" %d", n_ctxt);
26120            printf(" %d", n_doc);
26121            printf(" %d", n_dtd);
26122            printf("\n");
26123        }
26124    }
26125    }
26126    }
26127    function_tests++;
26128#endif
26129
26130    return(test_ret);
26131}
26132
26133
26134static int
26135test_xmlValidateDtdFinal(void) {
26136    int test_ret = 0;
26137
26138#if defined(LIBXML_VALID_ENABLED)
26139    int mem_base;
26140    int ret_val;
26141    xmlValidCtxtPtr ctxt; /* the validation context */
26142    int n_ctxt;
26143    xmlDocPtr doc; /* a document instance */
26144    int n_doc;
26145
26146    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26147    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26148        mem_base = xmlMemBlocks();
26149        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26150        doc = gen_xmlDocPtr(n_doc, 1);
26151
26152        ret_val = xmlValidateDtdFinal(ctxt, doc);
26153        desret_int(ret_val);
26154        call_tests++;
26155        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26156        des_xmlDocPtr(n_doc, doc, 1);
26157        xmlResetLastError();
26158        if (mem_base != xmlMemBlocks()) {
26159            printf("Leak of %d blocks found in xmlValidateDtdFinal",
26160	           xmlMemBlocks() - mem_base);
26161	    test_ret++;
26162            printf(" %d", n_ctxt);
26163            printf(" %d", n_doc);
26164            printf("\n");
26165        }
26166    }
26167    }
26168    function_tests++;
26169#endif
26170
26171    return(test_ret);
26172}
26173
26174
26175static int
26176test_xmlValidateElement(void) {
26177    int test_ret = 0;
26178
26179#if defined(LIBXML_VALID_ENABLED)
26180    int mem_base;
26181    int ret_val;
26182    xmlValidCtxtPtr ctxt; /* the validation context */
26183    int n_ctxt;
26184    xmlDocPtr doc; /* a document instance */
26185    int n_doc;
26186    xmlNodePtr elem; /* an element instance */
26187    int n_elem;
26188
26189    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26190    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26191    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26192        mem_base = xmlMemBlocks();
26193        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26194        doc = gen_xmlDocPtr(n_doc, 1);
26195        elem = gen_xmlNodePtr(n_elem, 2);
26196
26197        ret_val = xmlValidateElement(ctxt, doc, elem);
26198        desret_int(ret_val);
26199        call_tests++;
26200        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26201        des_xmlDocPtr(n_doc, doc, 1);
26202        des_xmlNodePtr(n_elem, elem, 2);
26203        xmlResetLastError();
26204        if (mem_base != xmlMemBlocks()) {
26205            printf("Leak of %d blocks found in xmlValidateElement",
26206	           xmlMemBlocks() - mem_base);
26207	    test_ret++;
26208            printf(" %d", n_ctxt);
26209            printf(" %d", n_doc);
26210            printf(" %d", n_elem);
26211            printf("\n");
26212        }
26213    }
26214    }
26215    }
26216    function_tests++;
26217#endif
26218
26219    return(test_ret);
26220}
26221
26222
26223static int
26224test_xmlValidateElementDecl(void) {
26225    int test_ret = 0;
26226
26227#if defined(LIBXML_VALID_ENABLED)
26228    int mem_base;
26229    int ret_val;
26230    xmlValidCtxtPtr ctxt; /* the validation context */
26231    int n_ctxt;
26232    xmlDocPtr doc; /* a document instance */
26233    int n_doc;
26234    xmlElementPtr elem; /* an element definition */
26235    int n_elem;
26236
26237    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26238    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26239    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26240        mem_base = xmlMemBlocks();
26241        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26242        doc = gen_xmlDocPtr(n_doc, 1);
26243        elem = gen_xmlElementPtr(n_elem, 2);
26244
26245        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26246        desret_int(ret_val);
26247        call_tests++;
26248        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26249        des_xmlDocPtr(n_doc, doc, 1);
26250        des_xmlElementPtr(n_elem, elem, 2);
26251        xmlResetLastError();
26252        if (mem_base != xmlMemBlocks()) {
26253            printf("Leak of %d blocks found in xmlValidateElementDecl",
26254	           xmlMemBlocks() - mem_base);
26255	    test_ret++;
26256            printf(" %d", n_ctxt);
26257            printf(" %d", n_doc);
26258            printf(" %d", n_elem);
26259            printf("\n");
26260        }
26261    }
26262    }
26263    }
26264    function_tests++;
26265#endif
26266
26267    return(test_ret);
26268}
26269
26270
26271static int
26272test_xmlValidateNameValue(void) {
26273    int test_ret = 0;
26274
26275#if defined(LIBXML_VALID_ENABLED)
26276    int mem_base;
26277    int ret_val;
26278    xmlChar * value; /* an Name value */
26279    int n_value;
26280
26281    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26282        mem_base = xmlMemBlocks();
26283        value = gen_const_xmlChar_ptr(n_value, 0);
26284
26285        ret_val = xmlValidateNameValue((const xmlChar *)value);
26286        desret_int(ret_val);
26287        call_tests++;
26288        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26289        xmlResetLastError();
26290        if (mem_base != xmlMemBlocks()) {
26291            printf("Leak of %d blocks found in xmlValidateNameValue",
26292	           xmlMemBlocks() - mem_base);
26293	    test_ret++;
26294            printf(" %d", n_value);
26295            printf("\n");
26296        }
26297    }
26298    function_tests++;
26299#endif
26300
26301    return(test_ret);
26302}
26303
26304
26305static int
26306test_xmlValidateNamesValue(void) {
26307    int test_ret = 0;
26308
26309#if defined(LIBXML_VALID_ENABLED)
26310    int mem_base;
26311    int ret_val;
26312    xmlChar * value; /* an Names value */
26313    int n_value;
26314
26315    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26316        mem_base = xmlMemBlocks();
26317        value = gen_const_xmlChar_ptr(n_value, 0);
26318
26319        ret_val = xmlValidateNamesValue((const xmlChar *)value);
26320        desret_int(ret_val);
26321        call_tests++;
26322        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26323        xmlResetLastError();
26324        if (mem_base != xmlMemBlocks()) {
26325            printf("Leak of %d blocks found in xmlValidateNamesValue",
26326	           xmlMemBlocks() - mem_base);
26327	    test_ret++;
26328            printf(" %d", n_value);
26329            printf("\n");
26330        }
26331    }
26332    function_tests++;
26333#endif
26334
26335    return(test_ret);
26336}
26337
26338
26339static int
26340test_xmlValidateNmtokenValue(void) {
26341    int test_ret = 0;
26342
26343#if defined(LIBXML_VALID_ENABLED)
26344    int mem_base;
26345    int ret_val;
26346    xmlChar * value; /* an Nmtoken value */
26347    int n_value;
26348
26349    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26350        mem_base = xmlMemBlocks();
26351        value = gen_const_xmlChar_ptr(n_value, 0);
26352
26353        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26354        desret_int(ret_val);
26355        call_tests++;
26356        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26357        xmlResetLastError();
26358        if (mem_base != xmlMemBlocks()) {
26359            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26360	           xmlMemBlocks() - mem_base);
26361	    test_ret++;
26362            printf(" %d", n_value);
26363            printf("\n");
26364        }
26365    }
26366    function_tests++;
26367#endif
26368
26369    return(test_ret);
26370}
26371
26372
26373static int
26374test_xmlValidateNmtokensValue(void) {
26375    int test_ret = 0;
26376
26377#if defined(LIBXML_VALID_ENABLED)
26378    int mem_base;
26379    int ret_val;
26380    xmlChar * value; /* an Nmtokens value */
26381    int n_value;
26382
26383    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26384        mem_base = xmlMemBlocks();
26385        value = gen_const_xmlChar_ptr(n_value, 0);
26386
26387        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26388        desret_int(ret_val);
26389        call_tests++;
26390        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26391        xmlResetLastError();
26392        if (mem_base != xmlMemBlocks()) {
26393            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26394	           xmlMemBlocks() - mem_base);
26395	    test_ret++;
26396            printf(" %d", n_value);
26397            printf("\n");
26398        }
26399    }
26400    function_tests++;
26401#endif
26402
26403    return(test_ret);
26404}
26405
26406
26407static int
26408test_xmlValidateNotationDecl(void) {
26409    int test_ret = 0;
26410
26411#if defined(LIBXML_VALID_ENABLED)
26412    int mem_base;
26413    int ret_val;
26414    xmlValidCtxtPtr ctxt; /* the validation context */
26415    int n_ctxt;
26416    xmlDocPtr doc; /* a document instance */
26417    int n_doc;
26418    xmlNotationPtr nota; /* a notation definition */
26419    int n_nota;
26420
26421    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26422    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26423    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26424        mem_base = xmlMemBlocks();
26425        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26426        doc = gen_xmlDocPtr(n_doc, 1);
26427        nota = gen_xmlNotationPtr(n_nota, 2);
26428
26429        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26430        desret_int(ret_val);
26431        call_tests++;
26432        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26433        des_xmlDocPtr(n_doc, doc, 1);
26434        des_xmlNotationPtr(n_nota, nota, 2);
26435        xmlResetLastError();
26436        if (mem_base != xmlMemBlocks()) {
26437            printf("Leak of %d blocks found in xmlValidateNotationDecl",
26438	           xmlMemBlocks() - mem_base);
26439	    test_ret++;
26440            printf(" %d", n_ctxt);
26441            printf(" %d", n_doc);
26442            printf(" %d", n_nota);
26443            printf("\n");
26444        }
26445    }
26446    }
26447    }
26448    function_tests++;
26449#endif
26450
26451    return(test_ret);
26452}
26453
26454
26455static int
26456test_xmlValidateNotationUse(void) {
26457    int test_ret = 0;
26458
26459#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26460    int mem_base;
26461    int ret_val;
26462    xmlValidCtxtPtr ctxt; /* the validation context */
26463    int n_ctxt;
26464    xmlDocPtr doc; /* the document */
26465    int n_doc;
26466    xmlChar * notationName; /* the notation name to check */
26467    int n_notationName;
26468
26469    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26470    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26471    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26472        mem_base = xmlMemBlocks();
26473        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26474        doc = gen_xmlDocPtr(n_doc, 1);
26475        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26476
26477        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26478        desret_int(ret_val);
26479        call_tests++;
26480        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26481        des_xmlDocPtr(n_doc, doc, 1);
26482        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26483        xmlResetLastError();
26484        if (mem_base != xmlMemBlocks()) {
26485            printf("Leak of %d blocks found in xmlValidateNotationUse",
26486	           xmlMemBlocks() - mem_base);
26487	    test_ret++;
26488            printf(" %d", n_ctxt);
26489            printf(" %d", n_doc);
26490            printf(" %d", n_notationName);
26491            printf("\n");
26492        }
26493    }
26494    }
26495    }
26496    function_tests++;
26497#endif
26498
26499    return(test_ret);
26500}
26501
26502
26503static int
26504test_xmlValidateOneAttribute(void) {
26505    int test_ret = 0;
26506
26507#if defined(LIBXML_VALID_ENABLED)
26508    int mem_base;
26509    int ret_val;
26510    xmlValidCtxtPtr ctxt; /* the validation context */
26511    int n_ctxt;
26512    xmlDocPtr doc; /* a document instance */
26513    int n_doc;
26514    xmlNodePtr elem; /* an element instance */
26515    int n_elem;
26516    xmlAttrPtr attr; /* an attribute instance */
26517    int n_attr;
26518    xmlChar * value; /* the attribute value (without entities processing) */
26519    int n_value;
26520
26521    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26522    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26523    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26524    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26525    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26526        mem_base = xmlMemBlocks();
26527        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26528        doc = gen_xmlDocPtr(n_doc, 1);
26529        elem = gen_xmlNodePtr(n_elem, 2);
26530        attr = gen_xmlAttrPtr(n_attr, 3);
26531        value = gen_const_xmlChar_ptr(n_value, 4);
26532
26533        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26534        desret_int(ret_val);
26535        call_tests++;
26536        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26537        des_xmlDocPtr(n_doc, doc, 1);
26538        des_xmlNodePtr(n_elem, elem, 2);
26539        des_xmlAttrPtr(n_attr, attr, 3);
26540        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26541        xmlResetLastError();
26542        if (mem_base != xmlMemBlocks()) {
26543            printf("Leak of %d blocks found in xmlValidateOneAttribute",
26544	           xmlMemBlocks() - mem_base);
26545	    test_ret++;
26546            printf(" %d", n_ctxt);
26547            printf(" %d", n_doc);
26548            printf(" %d", n_elem);
26549            printf(" %d", n_attr);
26550            printf(" %d", n_value);
26551            printf("\n");
26552        }
26553    }
26554    }
26555    }
26556    }
26557    }
26558    function_tests++;
26559#endif
26560
26561    return(test_ret);
26562}
26563
26564
26565static int
26566test_xmlValidateOneElement(void) {
26567    int test_ret = 0;
26568
26569#if defined(LIBXML_VALID_ENABLED)
26570    int mem_base;
26571    int ret_val;
26572    xmlValidCtxtPtr ctxt; /* the validation context */
26573    int n_ctxt;
26574    xmlDocPtr doc; /* a document instance */
26575    int n_doc;
26576    xmlNodePtr elem; /* an element instance */
26577    int n_elem;
26578
26579    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26580    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26581    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26582        mem_base = xmlMemBlocks();
26583        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26584        doc = gen_xmlDocPtr(n_doc, 1);
26585        elem = gen_xmlNodePtr(n_elem, 2);
26586
26587        ret_val = xmlValidateOneElement(ctxt, doc, elem);
26588        desret_int(ret_val);
26589        call_tests++;
26590        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26591        des_xmlDocPtr(n_doc, doc, 1);
26592        des_xmlNodePtr(n_elem, elem, 2);
26593        xmlResetLastError();
26594        if (mem_base != xmlMemBlocks()) {
26595            printf("Leak of %d blocks found in xmlValidateOneElement",
26596	           xmlMemBlocks() - mem_base);
26597	    test_ret++;
26598            printf(" %d", n_ctxt);
26599            printf(" %d", n_doc);
26600            printf(" %d", n_elem);
26601            printf("\n");
26602        }
26603    }
26604    }
26605    }
26606    function_tests++;
26607#endif
26608
26609    return(test_ret);
26610}
26611
26612
26613static int
26614test_xmlValidateOneNamespace(void) {
26615    int test_ret = 0;
26616
26617#if defined(LIBXML_VALID_ENABLED)
26618    int mem_base;
26619    int ret_val;
26620    xmlValidCtxtPtr ctxt; /* the validation context */
26621    int n_ctxt;
26622    xmlDocPtr doc; /* a document instance */
26623    int n_doc;
26624    xmlNodePtr elem; /* an element instance */
26625    int n_elem;
26626    xmlChar * prefix; /* the namespace prefix */
26627    int n_prefix;
26628    xmlNsPtr ns; /* an namespace declaration instance */
26629    int n_ns;
26630    xmlChar * value; /* the attribute value (without entities processing) */
26631    int n_value;
26632
26633    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26634    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26635    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26636    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26637    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26638    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26639        mem_base = xmlMemBlocks();
26640        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26641        doc = gen_xmlDocPtr(n_doc, 1);
26642        elem = gen_xmlNodePtr(n_elem, 2);
26643        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26644        ns = gen_xmlNsPtr(n_ns, 4);
26645        value = gen_const_xmlChar_ptr(n_value, 5);
26646
26647        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26648        desret_int(ret_val);
26649        call_tests++;
26650        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26651        des_xmlDocPtr(n_doc, doc, 1);
26652        des_xmlNodePtr(n_elem, elem, 2);
26653        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26654        des_xmlNsPtr(n_ns, ns, 4);
26655        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26656        xmlResetLastError();
26657        if (mem_base != xmlMemBlocks()) {
26658            printf("Leak of %d blocks found in xmlValidateOneNamespace",
26659	           xmlMemBlocks() - mem_base);
26660	    test_ret++;
26661            printf(" %d", n_ctxt);
26662            printf(" %d", n_doc);
26663            printf(" %d", n_elem);
26664            printf(" %d", n_prefix);
26665            printf(" %d", n_ns);
26666            printf(" %d", n_value);
26667            printf("\n");
26668        }
26669    }
26670    }
26671    }
26672    }
26673    }
26674    }
26675    function_tests++;
26676#endif
26677
26678    return(test_ret);
26679}
26680
26681
26682static int
26683test_xmlValidatePopElement(void) {
26684    int test_ret = 0;
26685
26686#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26687    int mem_base;
26688    int ret_val;
26689    xmlValidCtxtPtr ctxt; /* the validation context */
26690    int n_ctxt;
26691    xmlDocPtr doc; /* a document instance */
26692    int n_doc;
26693    xmlNodePtr elem; /* an element instance */
26694    int n_elem;
26695    xmlChar * qname; /* the qualified name as appearing in the serialization */
26696    int n_qname;
26697
26698    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26699    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26700    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26701    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26702        mem_base = xmlMemBlocks();
26703        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26704        doc = gen_xmlDocPtr(n_doc, 1);
26705        elem = gen_xmlNodePtr(n_elem, 2);
26706        qname = gen_const_xmlChar_ptr(n_qname, 3);
26707
26708        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26709        desret_int(ret_val);
26710        call_tests++;
26711        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26712        des_xmlDocPtr(n_doc, doc, 1);
26713        des_xmlNodePtr(n_elem, elem, 2);
26714        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26715        xmlResetLastError();
26716        if (mem_base != xmlMemBlocks()) {
26717            printf("Leak of %d blocks found in xmlValidatePopElement",
26718	           xmlMemBlocks() - mem_base);
26719	    test_ret++;
26720            printf(" %d", n_ctxt);
26721            printf(" %d", n_doc);
26722            printf(" %d", n_elem);
26723            printf(" %d", n_qname);
26724            printf("\n");
26725        }
26726    }
26727    }
26728    }
26729    }
26730    function_tests++;
26731#endif
26732
26733    return(test_ret);
26734}
26735
26736
26737static int
26738test_xmlValidatePushCData(void) {
26739    int test_ret = 0;
26740
26741#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26742    int mem_base;
26743    int ret_val;
26744    xmlValidCtxtPtr ctxt; /* the validation context */
26745    int n_ctxt;
26746    xmlChar * data; /* some character data read */
26747    int n_data;
26748    int len; /* the lenght of the data */
26749    int n_len;
26750
26751    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26752    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26753    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26754        mem_base = xmlMemBlocks();
26755        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26756        data = gen_const_xmlChar_ptr(n_data, 1);
26757        len = gen_int(n_len, 2);
26758
26759        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26760        desret_int(ret_val);
26761        call_tests++;
26762        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26763        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26764        des_int(n_len, len, 2);
26765        xmlResetLastError();
26766        if (mem_base != xmlMemBlocks()) {
26767            printf("Leak of %d blocks found in xmlValidatePushCData",
26768	           xmlMemBlocks() - mem_base);
26769	    test_ret++;
26770            printf(" %d", n_ctxt);
26771            printf(" %d", n_data);
26772            printf(" %d", n_len);
26773            printf("\n");
26774        }
26775    }
26776    }
26777    }
26778    function_tests++;
26779#endif
26780
26781    return(test_ret);
26782}
26783
26784
26785static int
26786test_xmlValidatePushElement(void) {
26787    int test_ret = 0;
26788
26789#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26790    int mem_base;
26791    int ret_val;
26792    xmlValidCtxtPtr ctxt; /* the validation context */
26793    int n_ctxt;
26794    xmlDocPtr doc; /* a document instance */
26795    int n_doc;
26796    xmlNodePtr elem; /* an element instance */
26797    int n_elem;
26798    xmlChar * qname; /* the qualified name as appearing in the serialization */
26799    int n_qname;
26800
26801    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26802    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26803    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26804    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26805        mem_base = xmlMemBlocks();
26806        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26807        doc = gen_xmlDocPtr(n_doc, 1);
26808        elem = gen_xmlNodePtr(n_elem, 2);
26809        qname = gen_const_xmlChar_ptr(n_qname, 3);
26810
26811        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26812        desret_int(ret_val);
26813        call_tests++;
26814        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26815        des_xmlDocPtr(n_doc, doc, 1);
26816        des_xmlNodePtr(n_elem, elem, 2);
26817        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26818        xmlResetLastError();
26819        if (mem_base != xmlMemBlocks()) {
26820            printf("Leak of %d blocks found in xmlValidatePushElement",
26821	           xmlMemBlocks() - mem_base);
26822	    test_ret++;
26823            printf(" %d", n_ctxt);
26824            printf(" %d", n_doc);
26825            printf(" %d", n_elem);
26826            printf(" %d", n_qname);
26827            printf("\n");
26828        }
26829    }
26830    }
26831    }
26832    }
26833    function_tests++;
26834#endif
26835
26836    return(test_ret);
26837}
26838
26839
26840static int
26841test_xmlValidateRoot(void) {
26842    int test_ret = 0;
26843
26844#if defined(LIBXML_VALID_ENABLED)
26845    int mem_base;
26846    int ret_val;
26847    xmlValidCtxtPtr ctxt; /* the validation context */
26848    int n_ctxt;
26849    xmlDocPtr doc; /* a document instance */
26850    int n_doc;
26851
26852    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26853    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26854        mem_base = xmlMemBlocks();
26855        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26856        doc = gen_xmlDocPtr(n_doc, 1);
26857
26858        ret_val = xmlValidateRoot(ctxt, doc);
26859        desret_int(ret_val);
26860        call_tests++;
26861        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26862        des_xmlDocPtr(n_doc, doc, 1);
26863        xmlResetLastError();
26864        if (mem_base != xmlMemBlocks()) {
26865            printf("Leak of %d blocks found in xmlValidateRoot",
26866	           xmlMemBlocks() - mem_base);
26867	    test_ret++;
26868            printf(" %d", n_ctxt);
26869            printf(" %d", n_doc);
26870            printf("\n");
26871        }
26872    }
26873    }
26874    function_tests++;
26875#endif
26876
26877    return(test_ret);
26878}
26879
26880static int
26881test_valid(void) {
26882    int test_ret = 0;
26883
26884    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26885    test_ret += test_xmlAddAttributeDecl();
26886    test_ret += test_xmlAddElementDecl();
26887    test_ret += test_xmlAddID();
26888    test_ret += test_xmlAddNotationDecl();
26889    test_ret += test_xmlAddRef();
26890    test_ret += test_xmlCopyAttributeTable();
26891    test_ret += test_xmlCopyDocElementContent();
26892    test_ret += test_xmlCopyElementContent();
26893    test_ret += test_xmlCopyElementTable();
26894    test_ret += test_xmlCopyEnumeration();
26895    test_ret += test_xmlCopyNotationTable();
26896    test_ret += test_xmlCreateEnumeration();
26897    test_ret += test_xmlDumpAttributeDecl();
26898    test_ret += test_xmlDumpAttributeTable();
26899    test_ret += test_xmlDumpElementDecl();
26900    test_ret += test_xmlDumpElementTable();
26901    test_ret += test_xmlDumpNotationDecl();
26902    test_ret += test_xmlDumpNotationTable();
26903    test_ret += test_xmlGetDtdAttrDesc();
26904    test_ret += test_xmlGetDtdElementDesc();
26905    test_ret += test_xmlGetDtdNotationDesc();
26906    test_ret += test_xmlGetDtdQAttrDesc();
26907    test_ret += test_xmlGetDtdQElementDesc();
26908    test_ret += test_xmlGetID();
26909    test_ret += test_xmlGetRefs();
26910    test_ret += test_xmlIsID();
26911    test_ret += test_xmlIsMixedElement();
26912    test_ret += test_xmlIsRef();
26913    test_ret += test_xmlNewDocElementContent();
26914    test_ret += test_xmlNewElementContent();
26915    test_ret += test_xmlNewValidCtxt();
26916    test_ret += test_xmlRemoveID();
26917    test_ret += test_xmlRemoveRef();
26918    test_ret += test_xmlSnprintfElementContent();
26919    test_ret += test_xmlSprintfElementContent();
26920    test_ret += test_xmlValidBuildContentModel();
26921    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26922    test_ret += test_xmlValidGetPotentialChildren();
26923    test_ret += test_xmlValidGetValidElements();
26924    test_ret += test_xmlValidNormalizeAttributeValue();
26925    test_ret += test_xmlValidateAttributeDecl();
26926    test_ret += test_xmlValidateAttributeValue();
26927    test_ret += test_xmlValidateDocument();
26928    test_ret += test_xmlValidateDocumentFinal();
26929    test_ret += test_xmlValidateDtd();
26930    test_ret += test_xmlValidateDtdFinal();
26931    test_ret += test_xmlValidateElement();
26932    test_ret += test_xmlValidateElementDecl();
26933    test_ret += test_xmlValidateNameValue();
26934    test_ret += test_xmlValidateNamesValue();
26935    test_ret += test_xmlValidateNmtokenValue();
26936    test_ret += test_xmlValidateNmtokensValue();
26937    test_ret += test_xmlValidateNotationDecl();
26938    test_ret += test_xmlValidateNotationUse();
26939    test_ret += test_xmlValidateOneAttribute();
26940    test_ret += test_xmlValidateOneElement();
26941    test_ret += test_xmlValidateOneNamespace();
26942    test_ret += test_xmlValidatePopElement();
26943    test_ret += test_xmlValidatePushCData();
26944    test_ret += test_xmlValidatePushElement();
26945    test_ret += test_xmlValidateRoot();
26946
26947    if (test_ret != 0)
26948	printf("Module valid: %d errors\n", test_ret);
26949    return(test_ret);
26950}
26951
26952static int
26953test_xmlXIncludeNewContext(void) {
26954    int test_ret = 0;
26955
26956
26957    /* missing type support */
26958    return(test_ret);
26959}
26960
26961
26962static int
26963test_xmlXIncludeProcess(void) {
26964    int test_ret = 0;
26965
26966#if defined(LIBXML_XINCLUDE_ENABLED)
26967    int mem_base;
26968    int ret_val;
26969    xmlDocPtr doc; /* an XML document */
26970    int n_doc;
26971
26972    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26973        mem_base = xmlMemBlocks();
26974        doc = gen_xmlDocPtr(n_doc, 0);
26975
26976        ret_val = xmlXIncludeProcess(doc);
26977        desret_int(ret_val);
26978        call_tests++;
26979        des_xmlDocPtr(n_doc, doc, 0);
26980        xmlResetLastError();
26981        if (mem_base != xmlMemBlocks()) {
26982            printf("Leak of %d blocks found in xmlXIncludeProcess",
26983	           xmlMemBlocks() - mem_base);
26984	    test_ret++;
26985            printf(" %d", n_doc);
26986            printf("\n");
26987        }
26988    }
26989    function_tests++;
26990#endif
26991
26992    return(test_ret);
26993}
26994
26995
26996static int
26997test_xmlXIncludeProcessFlags(void) {
26998    int test_ret = 0;
26999
27000#if defined(LIBXML_XINCLUDE_ENABLED)
27001    int mem_base;
27002    int ret_val;
27003    xmlDocPtr doc; /* an XML document */
27004    int n_doc;
27005    int flags; /* a set of xmlParserOption used for parsing XML includes */
27006    int n_flags;
27007
27008    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27009    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27010        mem_base = xmlMemBlocks();
27011        doc = gen_xmlDocPtr(n_doc, 0);
27012        flags = gen_int(n_flags, 1);
27013
27014        ret_val = xmlXIncludeProcessFlags(doc, flags);
27015        desret_int(ret_val);
27016        call_tests++;
27017        des_xmlDocPtr(n_doc, doc, 0);
27018        des_int(n_flags, flags, 1);
27019        xmlResetLastError();
27020        if (mem_base != xmlMemBlocks()) {
27021            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27022	           xmlMemBlocks() - mem_base);
27023	    test_ret++;
27024            printf(" %d", n_doc);
27025            printf(" %d", n_flags);
27026            printf("\n");
27027        }
27028    }
27029    }
27030    function_tests++;
27031#endif
27032
27033    return(test_ret);
27034}
27035
27036
27037static int
27038test_xmlXIncludeProcessFlagsData(void) {
27039    int test_ret = 0;
27040
27041#if defined(LIBXML_XINCLUDE_ENABLED)
27042    int mem_base;
27043    int ret_val;
27044    xmlDocPtr doc; /* an XML document */
27045    int n_doc;
27046    int flags; /* a set of xmlParserOption used for parsing XML includes */
27047    int n_flags;
27048    void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27049    int n_data;
27050
27051    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27052    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27053    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27054        mem_base = xmlMemBlocks();
27055        doc = gen_xmlDocPtr(n_doc, 0);
27056        flags = gen_int(n_flags, 1);
27057        data = gen_userdata(n_data, 2);
27058
27059        ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27060        desret_int(ret_val);
27061        call_tests++;
27062        des_xmlDocPtr(n_doc, doc, 0);
27063        des_int(n_flags, flags, 1);
27064        des_userdata(n_data, data, 2);
27065        xmlResetLastError();
27066        if (mem_base != xmlMemBlocks()) {
27067            printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27068	           xmlMemBlocks() - mem_base);
27069	    test_ret++;
27070            printf(" %d", n_doc);
27071            printf(" %d", n_flags);
27072            printf(" %d", n_data);
27073            printf("\n");
27074        }
27075    }
27076    }
27077    }
27078    function_tests++;
27079#endif
27080
27081    return(test_ret);
27082}
27083
27084#ifdef LIBXML_XINCLUDE_ENABLED
27085
27086#define gen_nb_xmlXIncludeCtxtPtr 1
27087static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27088    return(NULL);
27089}
27090static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27091}
27092#endif
27093
27094
27095static int
27096test_xmlXIncludeProcessNode(void) {
27097    int test_ret = 0;
27098
27099#if defined(LIBXML_XINCLUDE_ENABLED)
27100    int mem_base;
27101    int ret_val;
27102    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27103    int n_ctxt;
27104    xmlNodePtr node; /* a node in an XML document */
27105    int n_node;
27106
27107    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27108    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27109        mem_base = xmlMemBlocks();
27110        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27111        node = gen_xmlNodePtr(n_node, 1);
27112
27113        ret_val = xmlXIncludeProcessNode(ctxt, node);
27114        desret_int(ret_val);
27115        call_tests++;
27116        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27117        des_xmlNodePtr(n_node, node, 1);
27118        xmlResetLastError();
27119        if (mem_base != xmlMemBlocks()) {
27120            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27121	           xmlMemBlocks() - mem_base);
27122	    test_ret++;
27123            printf(" %d", n_ctxt);
27124            printf(" %d", n_node);
27125            printf("\n");
27126        }
27127    }
27128    }
27129    function_tests++;
27130#endif
27131
27132    return(test_ret);
27133}
27134
27135
27136static int
27137test_xmlXIncludeProcessTree(void) {
27138    int test_ret = 0;
27139
27140#if defined(LIBXML_XINCLUDE_ENABLED)
27141    int mem_base;
27142    int ret_val;
27143    xmlNodePtr tree; /* a node in an XML document */
27144    int n_tree;
27145
27146    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27147        mem_base = xmlMemBlocks();
27148        tree = gen_xmlNodePtr(n_tree, 0);
27149
27150        ret_val = xmlXIncludeProcessTree(tree);
27151        desret_int(ret_val);
27152        call_tests++;
27153        des_xmlNodePtr(n_tree, tree, 0);
27154        xmlResetLastError();
27155        if (mem_base != xmlMemBlocks()) {
27156            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27157	           xmlMemBlocks() - mem_base);
27158	    test_ret++;
27159            printf(" %d", n_tree);
27160            printf("\n");
27161        }
27162    }
27163    function_tests++;
27164#endif
27165
27166    return(test_ret);
27167}
27168
27169
27170static int
27171test_xmlXIncludeProcessTreeFlags(void) {
27172    int test_ret = 0;
27173
27174#if defined(LIBXML_XINCLUDE_ENABLED)
27175    int mem_base;
27176    int ret_val;
27177    xmlNodePtr tree; /* a node in an XML document */
27178    int n_tree;
27179    int flags; /* a set of xmlParserOption used for parsing XML includes */
27180    int n_flags;
27181
27182    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27183    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27184        mem_base = xmlMemBlocks();
27185        tree = gen_xmlNodePtr(n_tree, 0);
27186        flags = gen_int(n_flags, 1);
27187
27188        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27189        desret_int(ret_val);
27190        call_tests++;
27191        des_xmlNodePtr(n_tree, tree, 0);
27192        des_int(n_flags, flags, 1);
27193        xmlResetLastError();
27194        if (mem_base != xmlMemBlocks()) {
27195            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27196	           xmlMemBlocks() - mem_base);
27197	    test_ret++;
27198            printf(" %d", n_tree);
27199            printf(" %d", n_flags);
27200            printf("\n");
27201        }
27202    }
27203    }
27204    function_tests++;
27205#endif
27206
27207    return(test_ret);
27208}
27209
27210
27211static int
27212test_xmlXIncludeSetFlags(void) {
27213    int test_ret = 0;
27214
27215#if defined(LIBXML_XINCLUDE_ENABLED)
27216    int mem_base;
27217    int ret_val;
27218    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27219    int n_ctxt;
27220    int flags; /* a set of xmlParserOption used for parsing XML includes */
27221    int n_flags;
27222
27223    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27224    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27225        mem_base = xmlMemBlocks();
27226        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27227        flags = gen_int(n_flags, 1);
27228
27229        ret_val = xmlXIncludeSetFlags(ctxt, flags);
27230        desret_int(ret_val);
27231        call_tests++;
27232        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27233        des_int(n_flags, flags, 1);
27234        xmlResetLastError();
27235        if (mem_base != xmlMemBlocks()) {
27236            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27237	           xmlMemBlocks() - mem_base);
27238	    test_ret++;
27239            printf(" %d", n_ctxt);
27240            printf(" %d", n_flags);
27241            printf("\n");
27242        }
27243    }
27244    }
27245    function_tests++;
27246#endif
27247
27248    return(test_ret);
27249}
27250
27251static int
27252test_xinclude(void) {
27253    int test_ret = 0;
27254
27255    if (quiet == 0) printf("Testing xinclude : 7 of 9 functions ...\n");
27256    test_ret += test_xmlXIncludeNewContext();
27257    test_ret += test_xmlXIncludeProcess();
27258    test_ret += test_xmlXIncludeProcessFlags();
27259    test_ret += test_xmlXIncludeProcessFlagsData();
27260    test_ret += test_xmlXIncludeProcessNode();
27261    test_ret += test_xmlXIncludeProcessTree();
27262    test_ret += test_xmlXIncludeProcessTreeFlags();
27263    test_ret += test_xmlXIncludeSetFlags();
27264
27265    if (test_ret != 0)
27266	printf("Module xinclude: %d errors\n", test_ret);
27267    return(test_ret);
27268}
27269
27270static int
27271test_xmlAllocOutputBuffer(void) {
27272    int test_ret = 0;
27273
27274#if defined(LIBXML_OUTPUT_ENABLED)
27275    int mem_base;
27276    xmlOutputBufferPtr ret_val;
27277    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27278    int n_encoder;
27279
27280    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27281        mem_base = xmlMemBlocks();
27282        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27283
27284        ret_val = xmlAllocOutputBuffer(encoder);
27285        desret_xmlOutputBufferPtr(ret_val);
27286        call_tests++;
27287        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27288        xmlResetLastError();
27289        if (mem_base != xmlMemBlocks()) {
27290            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27291	           xmlMemBlocks() - mem_base);
27292	    test_ret++;
27293            printf(" %d", n_encoder);
27294            printf("\n");
27295        }
27296    }
27297    function_tests++;
27298#endif
27299
27300    return(test_ret);
27301}
27302
27303
27304static int
27305test_xmlAllocParserInputBuffer(void) {
27306    int test_ret = 0;
27307
27308    int mem_base;
27309    xmlParserInputBufferPtr ret_val;
27310    xmlCharEncoding enc; /* the charset encoding if known */
27311    int n_enc;
27312
27313    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27314        mem_base = xmlMemBlocks();
27315        enc = gen_xmlCharEncoding(n_enc, 0);
27316
27317        ret_val = xmlAllocParserInputBuffer(enc);
27318        desret_xmlParserInputBufferPtr(ret_val);
27319        call_tests++;
27320        des_xmlCharEncoding(n_enc, enc, 0);
27321        xmlResetLastError();
27322        if (mem_base != xmlMemBlocks()) {
27323            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27324	           xmlMemBlocks() - mem_base);
27325	    test_ret++;
27326            printf(" %d", n_enc);
27327            printf("\n");
27328        }
27329    }
27330    function_tests++;
27331
27332    return(test_ret);
27333}
27334
27335
27336static int
27337test_xmlCheckFilename(void) {
27338    int test_ret = 0;
27339
27340    int mem_base;
27341    int ret_val;
27342    char * path; /* the path to check */
27343    int n_path;
27344
27345    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27346        mem_base = xmlMemBlocks();
27347        path = gen_const_char_ptr(n_path, 0);
27348
27349        ret_val = xmlCheckFilename((const char *)path);
27350        desret_int(ret_val);
27351        call_tests++;
27352        des_const_char_ptr(n_path, (const char *)path, 0);
27353        xmlResetLastError();
27354        if (mem_base != xmlMemBlocks()) {
27355            printf("Leak of %d blocks found in xmlCheckFilename",
27356	           xmlMemBlocks() - mem_base);
27357	    test_ret++;
27358            printf(" %d", n_path);
27359            printf("\n");
27360        }
27361    }
27362    function_tests++;
27363
27364    return(test_ret);
27365}
27366
27367
27368static int
27369test_xmlCheckHTTPInput(void) {
27370    int test_ret = 0;
27371
27372    int mem_base;
27373    xmlParserInputPtr ret_val;
27374    xmlParserCtxtPtr ctxt; /* an XML parser context */
27375    int n_ctxt;
27376    xmlParserInputPtr ret; /* an XML parser input */
27377    int n_ret;
27378
27379    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27380    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27381        mem_base = xmlMemBlocks();
27382        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27383        ret = gen_xmlParserInputPtr(n_ret, 1);
27384
27385        ret_val = xmlCheckHTTPInput(ctxt, ret);
27386        desret_xmlParserInputPtr(ret_val);
27387        call_tests++;
27388        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27389        des_xmlParserInputPtr(n_ret, ret, 1);
27390        xmlResetLastError();
27391        if (mem_base != xmlMemBlocks()) {
27392            printf("Leak of %d blocks found in xmlCheckHTTPInput",
27393	           xmlMemBlocks() - mem_base);
27394	    test_ret++;
27395            printf(" %d", n_ctxt);
27396            printf(" %d", n_ret);
27397            printf("\n");
27398        }
27399    }
27400    }
27401    function_tests++;
27402
27403    return(test_ret);
27404}
27405
27406
27407static int
27408test_xmlCleanupInputCallbacks(void) {
27409    int test_ret = 0;
27410
27411    int mem_base;
27412
27413        mem_base = xmlMemBlocks();
27414
27415        xmlCleanupInputCallbacks();
27416        call_tests++;
27417        xmlResetLastError();
27418        if (mem_base != xmlMemBlocks()) {
27419            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27420	           xmlMemBlocks() - mem_base);
27421	    test_ret++;
27422            printf("\n");
27423        }
27424    function_tests++;
27425
27426    return(test_ret);
27427}
27428
27429
27430static int
27431test_xmlCleanupOutputCallbacks(void) {
27432    int test_ret = 0;
27433
27434#if defined(LIBXML_OUTPUT_ENABLED)
27435    int mem_base;
27436
27437        mem_base = xmlMemBlocks();
27438
27439        xmlCleanupOutputCallbacks();
27440        call_tests++;
27441        xmlResetLastError();
27442        if (mem_base != xmlMemBlocks()) {
27443            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27444	           xmlMemBlocks() - mem_base);
27445	    test_ret++;
27446            printf("\n");
27447        }
27448    function_tests++;
27449#endif
27450
27451    return(test_ret);
27452}
27453
27454
27455static int
27456test_xmlFileClose(void) {
27457    int test_ret = 0;
27458
27459    int mem_base;
27460    int ret_val;
27461    void * context; /* the I/O context */
27462    int n_context;
27463
27464    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27465        mem_base = xmlMemBlocks();
27466        context = gen_void_ptr(n_context, 0);
27467
27468        ret_val = xmlFileClose(context);
27469        desret_int(ret_val);
27470        call_tests++;
27471        des_void_ptr(n_context, context, 0);
27472        xmlResetLastError();
27473        if (mem_base != xmlMemBlocks()) {
27474            printf("Leak of %d blocks found in xmlFileClose",
27475	           xmlMemBlocks() - mem_base);
27476	    test_ret++;
27477            printf(" %d", n_context);
27478            printf("\n");
27479        }
27480    }
27481    function_tests++;
27482
27483    return(test_ret);
27484}
27485
27486
27487static int
27488test_xmlFileMatch(void) {
27489    int test_ret = 0;
27490
27491    int mem_base;
27492    int ret_val;
27493    const char * filename; /* the URI for matching */
27494    int n_filename;
27495
27496    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27497        mem_base = xmlMemBlocks();
27498        filename = gen_filepath(n_filename, 0);
27499
27500        ret_val = xmlFileMatch(filename);
27501        desret_int(ret_val);
27502        call_tests++;
27503        des_filepath(n_filename, filename, 0);
27504        xmlResetLastError();
27505        if (mem_base != xmlMemBlocks()) {
27506            printf("Leak of %d blocks found in xmlFileMatch",
27507	           xmlMemBlocks() - mem_base);
27508	    test_ret++;
27509            printf(" %d", n_filename);
27510            printf("\n");
27511        }
27512    }
27513    function_tests++;
27514
27515    return(test_ret);
27516}
27517
27518
27519static int
27520test_xmlFileOpen(void) {
27521    int test_ret = 0;
27522
27523    int mem_base;
27524    void * ret_val;
27525    const char * filename; /* the URI for matching */
27526    int n_filename;
27527
27528    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27529        mem_base = xmlMemBlocks();
27530        filename = gen_filepath(n_filename, 0);
27531
27532        ret_val = xmlFileOpen(filename);
27533        desret_void_ptr(ret_val);
27534        call_tests++;
27535        des_filepath(n_filename, filename, 0);
27536        xmlResetLastError();
27537        if (mem_base != xmlMemBlocks()) {
27538            printf("Leak of %d blocks found in xmlFileOpen",
27539	           xmlMemBlocks() - mem_base);
27540	    test_ret++;
27541            printf(" %d", n_filename);
27542            printf("\n");
27543        }
27544    }
27545    function_tests++;
27546
27547    return(test_ret);
27548}
27549
27550
27551static int
27552test_xmlFileRead(void) {
27553    int test_ret = 0;
27554
27555    int mem_base;
27556    int ret_val;
27557    void * context; /* the I/O context */
27558    int n_context;
27559    char * buffer; /* where to drop data */
27560    int n_buffer;
27561    int len; /* number of bytes to write */
27562    int n_len;
27563
27564    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27565    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27566    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27567        mem_base = xmlMemBlocks();
27568        context = gen_void_ptr(n_context, 0);
27569        buffer = gen_char_ptr(n_buffer, 1);
27570        len = gen_int(n_len, 2);
27571
27572        ret_val = xmlFileRead(context, buffer, len);
27573        desret_int(ret_val);
27574        call_tests++;
27575        des_void_ptr(n_context, context, 0);
27576        des_char_ptr(n_buffer, buffer, 1);
27577        des_int(n_len, len, 2);
27578        xmlResetLastError();
27579        if (mem_base != xmlMemBlocks()) {
27580            printf("Leak of %d blocks found in xmlFileRead",
27581	           xmlMemBlocks() - mem_base);
27582	    test_ret++;
27583            printf(" %d", n_context);
27584            printf(" %d", n_buffer);
27585            printf(" %d", n_len);
27586            printf("\n");
27587        }
27588    }
27589    }
27590    }
27591    function_tests++;
27592
27593    return(test_ret);
27594}
27595
27596
27597static int
27598test_xmlIOFTPClose(void) {
27599    int test_ret = 0;
27600
27601#if defined(LIBXML_FTP_ENABLED)
27602    int mem_base;
27603    int ret_val;
27604    void * context; /* the I/O context */
27605    int n_context;
27606
27607    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27608        mem_base = xmlMemBlocks();
27609        context = gen_void_ptr(n_context, 0);
27610
27611        ret_val = xmlIOFTPClose(context);
27612        desret_int(ret_val);
27613        call_tests++;
27614        des_void_ptr(n_context, context, 0);
27615        xmlResetLastError();
27616        if (mem_base != xmlMemBlocks()) {
27617            printf("Leak of %d blocks found in xmlIOFTPClose",
27618	           xmlMemBlocks() - mem_base);
27619	    test_ret++;
27620            printf(" %d", n_context);
27621            printf("\n");
27622        }
27623    }
27624    function_tests++;
27625#endif
27626
27627    return(test_ret);
27628}
27629
27630
27631static int
27632test_xmlIOFTPMatch(void) {
27633    int test_ret = 0;
27634
27635#if defined(LIBXML_FTP_ENABLED)
27636    int mem_base;
27637    int ret_val;
27638    const char * filename; /* the URI for matching */
27639    int n_filename;
27640
27641    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27642        mem_base = xmlMemBlocks();
27643        filename = gen_filepath(n_filename, 0);
27644
27645        ret_val = xmlIOFTPMatch(filename);
27646        desret_int(ret_val);
27647        call_tests++;
27648        des_filepath(n_filename, filename, 0);
27649        xmlResetLastError();
27650        if (mem_base != xmlMemBlocks()) {
27651            printf("Leak of %d blocks found in xmlIOFTPMatch",
27652	           xmlMemBlocks() - mem_base);
27653	    test_ret++;
27654            printf(" %d", n_filename);
27655            printf("\n");
27656        }
27657    }
27658    function_tests++;
27659#endif
27660
27661    return(test_ret);
27662}
27663
27664
27665static int
27666test_xmlIOFTPOpen(void) {
27667    int test_ret = 0;
27668
27669#if defined(LIBXML_FTP_ENABLED)
27670    int mem_base;
27671    void * ret_val;
27672    const char * filename; /* the URI for matching */
27673    int n_filename;
27674
27675    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27676        mem_base = xmlMemBlocks();
27677        filename = gen_filepath(n_filename, 0);
27678
27679        ret_val = xmlIOFTPOpen(filename);
27680        desret_void_ptr(ret_val);
27681        call_tests++;
27682        des_filepath(n_filename, filename, 0);
27683        xmlResetLastError();
27684        if (mem_base != xmlMemBlocks()) {
27685            printf("Leak of %d blocks found in xmlIOFTPOpen",
27686	           xmlMemBlocks() - mem_base);
27687	    test_ret++;
27688            printf(" %d", n_filename);
27689            printf("\n");
27690        }
27691    }
27692    function_tests++;
27693#endif
27694
27695    return(test_ret);
27696}
27697
27698
27699static int
27700test_xmlIOFTPRead(void) {
27701    int test_ret = 0;
27702
27703#if defined(LIBXML_FTP_ENABLED)
27704    int mem_base;
27705    int ret_val;
27706    void * context; /* the I/O context */
27707    int n_context;
27708    char * buffer; /* where to drop data */
27709    int n_buffer;
27710    int len; /* number of bytes to write */
27711    int n_len;
27712
27713    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27714    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27715    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27716        mem_base = xmlMemBlocks();
27717        context = gen_void_ptr(n_context, 0);
27718        buffer = gen_char_ptr(n_buffer, 1);
27719        len = gen_int(n_len, 2);
27720
27721        ret_val = xmlIOFTPRead(context, buffer, len);
27722        desret_int(ret_val);
27723        call_tests++;
27724        des_void_ptr(n_context, context, 0);
27725        des_char_ptr(n_buffer, buffer, 1);
27726        des_int(n_len, len, 2);
27727        xmlResetLastError();
27728        if (mem_base != xmlMemBlocks()) {
27729            printf("Leak of %d blocks found in xmlIOFTPRead",
27730	           xmlMemBlocks() - mem_base);
27731	    test_ret++;
27732            printf(" %d", n_context);
27733            printf(" %d", n_buffer);
27734            printf(" %d", n_len);
27735            printf("\n");
27736        }
27737    }
27738    }
27739    }
27740    function_tests++;
27741#endif
27742
27743    return(test_ret);
27744}
27745
27746
27747static int
27748test_xmlIOHTTPClose(void) {
27749    int test_ret = 0;
27750
27751#if defined(LIBXML_HTTP_ENABLED)
27752    int mem_base;
27753    int ret_val;
27754    void * context; /* the I/O context */
27755    int n_context;
27756
27757    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27758        mem_base = xmlMemBlocks();
27759        context = gen_void_ptr(n_context, 0);
27760
27761        ret_val = xmlIOHTTPClose(context);
27762        desret_int(ret_val);
27763        call_tests++;
27764        des_void_ptr(n_context, context, 0);
27765        xmlResetLastError();
27766        if (mem_base != xmlMemBlocks()) {
27767            printf("Leak of %d blocks found in xmlIOHTTPClose",
27768	           xmlMemBlocks() - mem_base);
27769	    test_ret++;
27770            printf(" %d", n_context);
27771            printf("\n");
27772        }
27773    }
27774    function_tests++;
27775#endif
27776
27777    return(test_ret);
27778}
27779
27780
27781static int
27782test_xmlIOHTTPMatch(void) {
27783    int test_ret = 0;
27784
27785#if defined(LIBXML_HTTP_ENABLED)
27786    int mem_base;
27787    int ret_val;
27788    const char * filename; /* the URI for matching */
27789    int n_filename;
27790
27791    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27792        mem_base = xmlMemBlocks();
27793        filename = gen_filepath(n_filename, 0);
27794
27795        ret_val = xmlIOHTTPMatch(filename);
27796        desret_int(ret_val);
27797        call_tests++;
27798        des_filepath(n_filename, filename, 0);
27799        xmlResetLastError();
27800        if (mem_base != xmlMemBlocks()) {
27801            printf("Leak of %d blocks found in xmlIOHTTPMatch",
27802	           xmlMemBlocks() - mem_base);
27803	    test_ret++;
27804            printf(" %d", n_filename);
27805            printf("\n");
27806        }
27807    }
27808    function_tests++;
27809#endif
27810
27811    return(test_ret);
27812}
27813
27814
27815static int
27816test_xmlIOHTTPOpen(void) {
27817    int test_ret = 0;
27818
27819#if defined(LIBXML_HTTP_ENABLED)
27820    int mem_base;
27821    void * ret_val;
27822    const char * filename; /* the URI for matching */
27823    int n_filename;
27824
27825    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27826        mem_base = xmlMemBlocks();
27827        filename = gen_filepath(n_filename, 0);
27828
27829        ret_val = xmlIOHTTPOpen(filename);
27830        desret_xmlNanoHTTPCtxtPtr(ret_val);
27831        call_tests++;
27832        des_filepath(n_filename, filename, 0);
27833        xmlResetLastError();
27834        if (mem_base != xmlMemBlocks()) {
27835            printf("Leak of %d blocks found in xmlIOHTTPOpen",
27836	           xmlMemBlocks() - mem_base);
27837	    test_ret++;
27838            printf(" %d", n_filename);
27839            printf("\n");
27840        }
27841    }
27842    function_tests++;
27843#endif
27844
27845    return(test_ret);
27846}
27847
27848
27849static int
27850test_xmlIOHTTPRead(void) {
27851    int test_ret = 0;
27852
27853#if defined(LIBXML_HTTP_ENABLED)
27854    int mem_base;
27855    int ret_val;
27856    void * context; /* the I/O context */
27857    int n_context;
27858    char * buffer; /* where to drop data */
27859    int n_buffer;
27860    int len; /* number of bytes to write */
27861    int n_len;
27862
27863    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27864    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27865    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27866        mem_base = xmlMemBlocks();
27867        context = gen_void_ptr(n_context, 0);
27868        buffer = gen_char_ptr(n_buffer, 1);
27869        len = gen_int(n_len, 2);
27870
27871        ret_val = xmlIOHTTPRead(context, buffer, len);
27872        desret_int(ret_val);
27873        call_tests++;
27874        des_void_ptr(n_context, context, 0);
27875        des_char_ptr(n_buffer, buffer, 1);
27876        des_int(n_len, len, 2);
27877        xmlResetLastError();
27878        if (mem_base != xmlMemBlocks()) {
27879            printf("Leak of %d blocks found in xmlIOHTTPRead",
27880	           xmlMemBlocks() - mem_base);
27881	    test_ret++;
27882            printf(" %d", n_context);
27883            printf(" %d", n_buffer);
27884            printf(" %d", n_len);
27885            printf("\n");
27886        }
27887    }
27888    }
27889    }
27890    function_tests++;
27891#endif
27892
27893    return(test_ret);
27894}
27895
27896
27897static int
27898test_xmlNoNetExternalEntityLoader(void) {
27899    int test_ret = 0;
27900
27901    int mem_base;
27902    xmlParserInputPtr ret_val;
27903    const char * URL; /* the URL for the entity to load */
27904    int n_URL;
27905    char * ID; /* the System ID for the entity to load */
27906    int n_ID;
27907    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27908    int n_ctxt;
27909
27910    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27911    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27912    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27913        mem_base = xmlMemBlocks();
27914        URL = gen_filepath(n_URL, 0);
27915        ID = gen_const_char_ptr(n_ID, 1);
27916        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27917
27918        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27919        desret_xmlParserInputPtr(ret_val);
27920        call_tests++;
27921        des_filepath(n_URL, URL, 0);
27922        des_const_char_ptr(n_ID, (const char *)ID, 1);
27923        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27924        xmlResetLastError();
27925        if (mem_base != xmlMemBlocks()) {
27926            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27927	           xmlMemBlocks() - mem_base);
27928	    test_ret++;
27929            printf(" %d", n_URL);
27930            printf(" %d", n_ID);
27931            printf(" %d", n_ctxt);
27932            printf("\n");
27933        }
27934    }
27935    }
27936    }
27937    function_tests++;
27938
27939    return(test_ret);
27940}
27941
27942
27943static int
27944test_xmlNormalizeWindowsPath(void) {
27945    int test_ret = 0;
27946
27947    int mem_base;
27948    xmlChar * ret_val;
27949    xmlChar * path; /* the input file path */
27950    int n_path;
27951
27952    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27953        mem_base = xmlMemBlocks();
27954        path = gen_const_xmlChar_ptr(n_path, 0);
27955
27956        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27957        desret_xmlChar_ptr(ret_val);
27958        call_tests++;
27959        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27960        xmlResetLastError();
27961        if (mem_base != xmlMemBlocks()) {
27962            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27963	           xmlMemBlocks() - mem_base);
27964	    test_ret++;
27965            printf(" %d", n_path);
27966            printf("\n");
27967        }
27968    }
27969    function_tests++;
27970
27971    return(test_ret);
27972}
27973
27974
27975static int
27976test_xmlOutputBufferCreateBuffer(void) {
27977    int test_ret = 0;
27978
27979#if defined(LIBXML_OUTPUT_ENABLED)
27980    int mem_base;
27981    xmlOutputBufferPtr ret_val;
27982    xmlBufferPtr buffer; /* a xmlBufferPtr */
27983    int n_buffer;
27984    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27985    int n_encoder;
27986
27987    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
27988    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27989        mem_base = xmlMemBlocks();
27990        buffer = gen_xmlBufferPtr(n_buffer, 0);
27991        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27992
27993        ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
27994        desret_xmlOutputBufferPtr(ret_val);
27995        call_tests++;
27996        des_xmlBufferPtr(n_buffer, buffer, 0);
27997        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27998        xmlResetLastError();
27999        if (mem_base != xmlMemBlocks()) {
28000            printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28001	           xmlMemBlocks() - mem_base);
28002	    test_ret++;
28003            printf(" %d", n_buffer);
28004            printf(" %d", n_encoder);
28005            printf("\n");
28006        }
28007    }
28008    }
28009    function_tests++;
28010#endif
28011
28012    return(test_ret);
28013}
28014
28015
28016static int
28017test_xmlOutputBufferCreateFd(void) {
28018    int test_ret = 0;
28019
28020#if defined(LIBXML_OUTPUT_ENABLED)
28021    int mem_base;
28022    xmlOutputBufferPtr ret_val;
28023    int fd; /* a file descriptor number */
28024    int n_fd;
28025    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28026    int n_encoder;
28027
28028    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28029    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28030        mem_base = xmlMemBlocks();
28031        fd = gen_int(n_fd, 0);
28032        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28033
28034        ret_val = xmlOutputBufferCreateFd(fd, encoder);
28035        desret_xmlOutputBufferPtr(ret_val);
28036        call_tests++;
28037        des_int(n_fd, fd, 0);
28038        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28039        xmlResetLastError();
28040        if (mem_base != xmlMemBlocks()) {
28041            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28042	           xmlMemBlocks() - mem_base);
28043	    test_ret++;
28044            printf(" %d", n_fd);
28045            printf(" %d", n_encoder);
28046            printf("\n");
28047        }
28048    }
28049    }
28050    function_tests++;
28051#endif
28052
28053    return(test_ret);
28054}
28055
28056
28057static int
28058test_xmlOutputBufferCreateFile(void) {
28059    int test_ret = 0;
28060
28061#if defined(LIBXML_OUTPUT_ENABLED)
28062    int mem_base;
28063    xmlOutputBufferPtr ret_val;
28064    FILE * file; /* a FILE* */
28065    int n_file;
28066    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28067    int n_encoder;
28068
28069    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28070    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28071        mem_base = xmlMemBlocks();
28072        file = gen_FILE_ptr(n_file, 0);
28073        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28074
28075        ret_val = xmlOutputBufferCreateFile(file, encoder);
28076        desret_xmlOutputBufferPtr(ret_val);
28077        call_tests++;
28078        des_FILE_ptr(n_file, file, 0);
28079        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28080        xmlResetLastError();
28081        if (mem_base != xmlMemBlocks()) {
28082            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28083	           xmlMemBlocks() - mem_base);
28084	    test_ret++;
28085            printf(" %d", n_file);
28086            printf(" %d", n_encoder);
28087            printf("\n");
28088        }
28089    }
28090    }
28091    function_tests++;
28092#endif
28093
28094    return(test_ret);
28095}
28096
28097
28098static int
28099test_xmlOutputBufferCreateFilename(void) {
28100    int test_ret = 0;
28101
28102#if defined(LIBXML_OUTPUT_ENABLED)
28103    int mem_base;
28104    xmlOutputBufferPtr ret_val;
28105    const char * URI; /* a C string containing the URI or filename */
28106    int n_URI;
28107    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28108    int n_encoder;
28109    int compression; /* the compression ration (0 none, 9 max). */
28110    int n_compression;
28111
28112    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28113    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28114    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28115        mem_base = xmlMemBlocks();
28116        URI = gen_fileoutput(n_URI, 0);
28117        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28118        compression = gen_int(n_compression, 2);
28119
28120        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28121        desret_xmlOutputBufferPtr(ret_val);
28122        call_tests++;
28123        des_fileoutput(n_URI, URI, 0);
28124        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28125        des_int(n_compression, compression, 2);
28126        xmlResetLastError();
28127        if (mem_base != xmlMemBlocks()) {
28128            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28129	           xmlMemBlocks() - mem_base);
28130	    test_ret++;
28131            printf(" %d", n_URI);
28132            printf(" %d", n_encoder);
28133            printf(" %d", n_compression);
28134            printf("\n");
28135        }
28136    }
28137    }
28138    }
28139    function_tests++;
28140#endif
28141
28142    return(test_ret);
28143}
28144
28145
28146static int
28147test_xmlOutputBufferFlush(void) {
28148    int test_ret = 0;
28149
28150#if defined(LIBXML_OUTPUT_ENABLED)
28151    int mem_base;
28152    int ret_val;
28153    xmlOutputBufferPtr out; /* a buffered output */
28154    int n_out;
28155
28156    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28157        mem_base = xmlMemBlocks();
28158        out = gen_xmlOutputBufferPtr(n_out, 0);
28159
28160        ret_val = xmlOutputBufferFlush(out);
28161        desret_int(ret_val);
28162        call_tests++;
28163        des_xmlOutputBufferPtr(n_out, out, 0);
28164        xmlResetLastError();
28165        if (mem_base != xmlMemBlocks()) {
28166            printf("Leak of %d blocks found in xmlOutputBufferFlush",
28167	           xmlMemBlocks() - mem_base);
28168	    test_ret++;
28169            printf(" %d", n_out);
28170            printf("\n");
28171        }
28172    }
28173    function_tests++;
28174#endif
28175
28176    return(test_ret);
28177}
28178
28179
28180static int
28181test_xmlOutputBufferWrite(void) {
28182    int test_ret = 0;
28183
28184#if defined(LIBXML_OUTPUT_ENABLED)
28185    int mem_base;
28186    int ret_val;
28187    xmlOutputBufferPtr out; /* a buffered parser output */
28188    int n_out;
28189    int len; /* the size in bytes of the array. */
28190    int n_len;
28191    char * buf; /* an char array */
28192    int n_buf;
28193
28194    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28195    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28196    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28197        mem_base = xmlMemBlocks();
28198        out = gen_xmlOutputBufferPtr(n_out, 0);
28199        len = gen_int(n_len, 1);
28200        buf = gen_const_char_ptr(n_buf, 2);
28201
28202        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28203        desret_int(ret_val);
28204        call_tests++;
28205        des_xmlOutputBufferPtr(n_out, out, 0);
28206        des_int(n_len, len, 1);
28207        des_const_char_ptr(n_buf, (const char *)buf, 2);
28208        xmlResetLastError();
28209        if (mem_base != xmlMemBlocks()) {
28210            printf("Leak of %d blocks found in xmlOutputBufferWrite",
28211	           xmlMemBlocks() - mem_base);
28212	    test_ret++;
28213            printf(" %d", n_out);
28214            printf(" %d", n_len);
28215            printf(" %d", n_buf);
28216            printf("\n");
28217        }
28218    }
28219    }
28220    }
28221    function_tests++;
28222#endif
28223
28224    return(test_ret);
28225}
28226
28227
28228static int
28229test_xmlOutputBufferWriteEscape(void) {
28230    int test_ret = 0;
28231
28232
28233    /* missing type support */
28234    return(test_ret);
28235}
28236
28237
28238static int
28239test_xmlOutputBufferWriteString(void) {
28240    int test_ret = 0;
28241
28242#if defined(LIBXML_OUTPUT_ENABLED)
28243    int mem_base;
28244    int ret_val;
28245    xmlOutputBufferPtr out; /* a buffered parser output */
28246    int n_out;
28247    char * str; /* a zero terminated C string */
28248    int n_str;
28249
28250    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28251    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28252        mem_base = xmlMemBlocks();
28253        out = gen_xmlOutputBufferPtr(n_out, 0);
28254        str = gen_const_char_ptr(n_str, 1);
28255
28256        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28257        desret_int(ret_val);
28258        call_tests++;
28259        des_xmlOutputBufferPtr(n_out, out, 0);
28260        des_const_char_ptr(n_str, (const char *)str, 1);
28261        xmlResetLastError();
28262        if (mem_base != xmlMemBlocks()) {
28263            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28264	           xmlMemBlocks() - mem_base);
28265	    test_ret++;
28266            printf(" %d", n_out);
28267            printf(" %d", n_str);
28268            printf("\n");
28269        }
28270    }
28271    }
28272    function_tests++;
28273#endif
28274
28275    return(test_ret);
28276}
28277
28278
28279static int
28280test_xmlParserGetDirectory(void) {
28281    int test_ret = 0;
28282
28283
28284    /* missing type support */
28285    return(test_ret);
28286}
28287
28288
28289static int
28290test_xmlParserInputBufferCreateFd(void) {
28291    int test_ret = 0;
28292
28293    int mem_base;
28294    xmlParserInputBufferPtr ret_val;
28295    int fd; /* a file descriptor number */
28296    int n_fd;
28297    xmlCharEncoding enc; /* the charset encoding if known */
28298    int n_enc;
28299
28300    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28301    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28302        mem_base = xmlMemBlocks();
28303        fd = gen_int(n_fd, 0);
28304        enc = gen_xmlCharEncoding(n_enc, 1);
28305        if (fd >= 0) fd = -1;
28306
28307        ret_val = xmlParserInputBufferCreateFd(fd, enc);
28308        desret_xmlParserInputBufferPtr(ret_val);
28309        call_tests++;
28310        des_int(n_fd, fd, 0);
28311        des_xmlCharEncoding(n_enc, enc, 1);
28312        xmlResetLastError();
28313        if (mem_base != xmlMemBlocks()) {
28314            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28315	           xmlMemBlocks() - mem_base);
28316	    test_ret++;
28317            printf(" %d", n_fd);
28318            printf(" %d", n_enc);
28319            printf("\n");
28320        }
28321    }
28322    }
28323    function_tests++;
28324
28325    return(test_ret);
28326}
28327
28328
28329static int
28330test_xmlParserInputBufferCreateFile(void) {
28331    int test_ret = 0;
28332
28333    int mem_base;
28334    xmlParserInputBufferPtr ret_val;
28335    FILE * file; /* a FILE* */
28336    int n_file;
28337    xmlCharEncoding enc; /* the charset encoding if known */
28338    int n_enc;
28339
28340    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28341    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28342        mem_base = xmlMemBlocks();
28343        file = gen_FILE_ptr(n_file, 0);
28344        enc = gen_xmlCharEncoding(n_enc, 1);
28345
28346        ret_val = xmlParserInputBufferCreateFile(file, enc);
28347        desret_xmlParserInputBufferPtr(ret_val);
28348        call_tests++;
28349        des_FILE_ptr(n_file, file, 0);
28350        des_xmlCharEncoding(n_enc, enc, 1);
28351        xmlResetLastError();
28352        if (mem_base != xmlMemBlocks()) {
28353            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28354	           xmlMemBlocks() - mem_base);
28355	    test_ret++;
28356            printf(" %d", n_file);
28357            printf(" %d", n_enc);
28358            printf("\n");
28359        }
28360    }
28361    }
28362    function_tests++;
28363
28364    return(test_ret);
28365}
28366
28367
28368static int
28369test_xmlParserInputBufferCreateFilename(void) {
28370    int test_ret = 0;
28371
28372    int mem_base;
28373    xmlParserInputBufferPtr ret_val;
28374    const char * URI; /* a C string containing the URI or filename */
28375    int n_URI;
28376    xmlCharEncoding enc; /* the charset encoding if known */
28377    int n_enc;
28378
28379    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28380    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28381        mem_base = xmlMemBlocks();
28382        URI = gen_fileoutput(n_URI, 0);
28383        enc = gen_xmlCharEncoding(n_enc, 1);
28384
28385        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28386        desret_xmlParserInputBufferPtr(ret_val);
28387        call_tests++;
28388        des_fileoutput(n_URI, URI, 0);
28389        des_xmlCharEncoding(n_enc, enc, 1);
28390        xmlResetLastError();
28391        if (mem_base != xmlMemBlocks()) {
28392            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28393	           xmlMemBlocks() - mem_base);
28394	    test_ret++;
28395            printf(" %d", n_URI);
28396            printf(" %d", n_enc);
28397            printf("\n");
28398        }
28399    }
28400    }
28401    function_tests++;
28402
28403    return(test_ret);
28404}
28405
28406
28407static int
28408test_xmlParserInputBufferCreateMem(void) {
28409    int test_ret = 0;
28410
28411    int mem_base;
28412    xmlParserInputBufferPtr ret_val;
28413    char * mem; /* the memory input */
28414    int n_mem;
28415    int size; /* the length of the memory block */
28416    int n_size;
28417    xmlCharEncoding enc; /* the charset encoding if known */
28418    int n_enc;
28419
28420    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28421    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28422    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28423        mem_base = xmlMemBlocks();
28424        mem = gen_const_char_ptr(n_mem, 0);
28425        size = gen_int(n_size, 1);
28426        enc = gen_xmlCharEncoding(n_enc, 2);
28427
28428        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28429        desret_xmlParserInputBufferPtr(ret_val);
28430        call_tests++;
28431        des_const_char_ptr(n_mem, (const char *)mem, 0);
28432        des_int(n_size, size, 1);
28433        des_xmlCharEncoding(n_enc, enc, 2);
28434        xmlResetLastError();
28435        if (mem_base != xmlMemBlocks()) {
28436            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28437	           xmlMemBlocks() - mem_base);
28438	    test_ret++;
28439            printf(" %d", n_mem);
28440            printf(" %d", n_size);
28441            printf(" %d", n_enc);
28442            printf("\n");
28443        }
28444    }
28445    }
28446    }
28447    function_tests++;
28448
28449    return(test_ret);
28450}
28451
28452
28453static int
28454test_xmlParserInputBufferCreateStatic(void) {
28455    int test_ret = 0;
28456
28457    int mem_base;
28458    xmlParserInputBufferPtr ret_val;
28459    char * mem; /* the memory input */
28460    int n_mem;
28461    int size; /* the length of the memory block */
28462    int n_size;
28463    xmlCharEncoding enc; /* the charset encoding if known */
28464    int n_enc;
28465
28466    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28467    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28468    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28469        mem_base = xmlMemBlocks();
28470        mem = gen_const_char_ptr(n_mem, 0);
28471        size = gen_int(n_size, 1);
28472        enc = gen_xmlCharEncoding(n_enc, 2);
28473
28474        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28475        desret_xmlParserInputBufferPtr(ret_val);
28476        call_tests++;
28477        des_const_char_ptr(n_mem, (const char *)mem, 0);
28478        des_int(n_size, size, 1);
28479        des_xmlCharEncoding(n_enc, enc, 2);
28480        xmlResetLastError();
28481        if (mem_base != xmlMemBlocks()) {
28482            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28483	           xmlMemBlocks() - mem_base);
28484	    test_ret++;
28485            printf(" %d", n_mem);
28486            printf(" %d", n_size);
28487            printf(" %d", n_enc);
28488            printf("\n");
28489        }
28490    }
28491    }
28492    }
28493    function_tests++;
28494
28495    return(test_ret);
28496}
28497
28498
28499static int
28500test_xmlParserInputBufferGrow(void) {
28501    int test_ret = 0;
28502
28503    int mem_base;
28504    int ret_val;
28505    xmlParserInputBufferPtr in; /* a buffered parser input */
28506    int n_in;
28507    int len; /* indicative value of the amount of chars to read */
28508    int n_len;
28509
28510    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28511    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28512        mem_base = xmlMemBlocks();
28513        in = gen_xmlParserInputBufferPtr(n_in, 0);
28514        len = gen_int(n_len, 1);
28515
28516        ret_val = xmlParserInputBufferGrow(in, len);
28517        desret_int(ret_val);
28518        call_tests++;
28519        des_xmlParserInputBufferPtr(n_in, in, 0);
28520        des_int(n_len, len, 1);
28521        xmlResetLastError();
28522        if (mem_base != xmlMemBlocks()) {
28523            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28524	           xmlMemBlocks() - mem_base);
28525	    test_ret++;
28526            printf(" %d", n_in);
28527            printf(" %d", n_len);
28528            printf("\n");
28529        }
28530    }
28531    }
28532    function_tests++;
28533
28534    return(test_ret);
28535}
28536
28537
28538static int
28539test_xmlParserInputBufferPush(void) {
28540    int test_ret = 0;
28541
28542    int mem_base;
28543    int ret_val;
28544    xmlParserInputBufferPtr in; /* a buffered parser input */
28545    int n_in;
28546    int len; /* the size in bytes of the array. */
28547    int n_len;
28548    char * buf; /* an char array */
28549    int n_buf;
28550
28551    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28552    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28553    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28554        mem_base = xmlMemBlocks();
28555        in = gen_xmlParserInputBufferPtr(n_in, 0);
28556        len = gen_int(n_len, 1);
28557        buf = gen_const_char_ptr(n_buf, 2);
28558
28559        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28560        desret_int(ret_val);
28561        call_tests++;
28562        des_xmlParserInputBufferPtr(n_in, in, 0);
28563        des_int(n_len, len, 1);
28564        des_const_char_ptr(n_buf, (const char *)buf, 2);
28565        xmlResetLastError();
28566        if (mem_base != xmlMemBlocks()) {
28567            printf("Leak of %d blocks found in xmlParserInputBufferPush",
28568	           xmlMemBlocks() - mem_base);
28569	    test_ret++;
28570            printf(" %d", n_in);
28571            printf(" %d", n_len);
28572            printf(" %d", n_buf);
28573            printf("\n");
28574        }
28575    }
28576    }
28577    }
28578    function_tests++;
28579
28580    return(test_ret);
28581}
28582
28583
28584static int
28585test_xmlParserInputBufferRead(void) {
28586    int test_ret = 0;
28587
28588    int mem_base;
28589    int ret_val;
28590    xmlParserInputBufferPtr in; /* a buffered parser input */
28591    int n_in;
28592    int len; /* indicative value of the amount of chars to read */
28593    int n_len;
28594
28595    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28596    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28597        mem_base = xmlMemBlocks();
28598        in = gen_xmlParserInputBufferPtr(n_in, 0);
28599        len = gen_int(n_len, 1);
28600
28601        ret_val = xmlParserInputBufferRead(in, len);
28602        desret_int(ret_val);
28603        call_tests++;
28604        des_xmlParserInputBufferPtr(n_in, in, 0);
28605        des_int(n_len, len, 1);
28606        xmlResetLastError();
28607        if (mem_base != xmlMemBlocks()) {
28608            printf("Leak of %d blocks found in xmlParserInputBufferRead",
28609	           xmlMemBlocks() - mem_base);
28610	    test_ret++;
28611            printf(" %d", n_in);
28612            printf(" %d", n_len);
28613            printf("\n");
28614        }
28615    }
28616    }
28617    function_tests++;
28618
28619    return(test_ret);
28620}
28621
28622
28623static int
28624test_xmlPopInputCallbacks(void) {
28625    int test_ret = 0;
28626
28627    int mem_base;
28628    int ret_val;
28629
28630        mem_base = xmlMemBlocks();
28631
28632        ret_val = xmlPopInputCallbacks();
28633        desret_int(ret_val);
28634        call_tests++;
28635        xmlResetLastError();
28636        if (mem_base != xmlMemBlocks()) {
28637            printf("Leak of %d blocks found in xmlPopInputCallbacks",
28638	           xmlMemBlocks() - mem_base);
28639	    test_ret++;
28640            printf("\n");
28641        }
28642    function_tests++;
28643
28644    return(test_ret);
28645}
28646
28647
28648static int
28649test_xmlRegisterDefaultInputCallbacks(void) {
28650    int test_ret = 0;
28651
28652    int mem_base;
28653
28654        mem_base = xmlMemBlocks();
28655
28656        xmlRegisterDefaultInputCallbacks();
28657        call_tests++;
28658        xmlResetLastError();
28659        if (mem_base != xmlMemBlocks()) {
28660            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28661	           xmlMemBlocks() - mem_base);
28662	    test_ret++;
28663            printf("\n");
28664        }
28665    function_tests++;
28666
28667    return(test_ret);
28668}
28669
28670
28671static int
28672test_xmlRegisterDefaultOutputCallbacks(void) {
28673    int test_ret = 0;
28674
28675#if defined(LIBXML_OUTPUT_ENABLED)
28676    int mem_base;
28677
28678        mem_base = xmlMemBlocks();
28679
28680        xmlRegisterDefaultOutputCallbacks();
28681        call_tests++;
28682        xmlResetLastError();
28683        if (mem_base != xmlMemBlocks()) {
28684            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28685	           xmlMemBlocks() - mem_base);
28686	    test_ret++;
28687            printf("\n");
28688        }
28689    function_tests++;
28690#endif
28691
28692    return(test_ret);
28693}
28694
28695
28696static int
28697test_xmlRegisterHTTPPostCallbacks(void) {
28698    int test_ret = 0;
28699
28700#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28701    int mem_base;
28702
28703        mem_base = xmlMemBlocks();
28704
28705        xmlRegisterHTTPPostCallbacks();
28706        call_tests++;
28707        xmlResetLastError();
28708        if (mem_base != xmlMemBlocks()) {
28709            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28710	           xmlMemBlocks() - mem_base);
28711	    test_ret++;
28712            printf("\n");
28713        }
28714    function_tests++;
28715#endif
28716
28717    return(test_ret);
28718}
28719
28720static int
28721test_xmlIO(void) {
28722    int test_ret = 0;
28723
28724    if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28725    test_ret += test_xmlAllocOutputBuffer();
28726    test_ret += test_xmlAllocParserInputBuffer();
28727    test_ret += test_xmlCheckFilename();
28728    test_ret += test_xmlCheckHTTPInput();
28729    test_ret += test_xmlCleanupInputCallbacks();
28730    test_ret += test_xmlCleanupOutputCallbacks();
28731    test_ret += test_xmlFileClose();
28732    test_ret += test_xmlFileMatch();
28733    test_ret += test_xmlFileOpen();
28734    test_ret += test_xmlFileRead();
28735    test_ret += test_xmlIOFTPClose();
28736    test_ret += test_xmlIOFTPMatch();
28737    test_ret += test_xmlIOFTPOpen();
28738    test_ret += test_xmlIOFTPRead();
28739    test_ret += test_xmlIOHTTPClose();
28740    test_ret += test_xmlIOHTTPMatch();
28741    test_ret += test_xmlIOHTTPOpen();
28742    test_ret += test_xmlIOHTTPRead();
28743    test_ret += test_xmlNoNetExternalEntityLoader();
28744    test_ret += test_xmlNormalizeWindowsPath();
28745    test_ret += test_xmlOutputBufferCreateBuffer();
28746    test_ret += test_xmlOutputBufferCreateFd();
28747    test_ret += test_xmlOutputBufferCreateFile();
28748    test_ret += test_xmlOutputBufferCreateFilename();
28749    test_ret += test_xmlOutputBufferFlush();
28750    test_ret += test_xmlOutputBufferWrite();
28751    test_ret += test_xmlOutputBufferWriteEscape();
28752    test_ret += test_xmlOutputBufferWriteString();
28753    test_ret += test_xmlParserGetDirectory();
28754    test_ret += test_xmlParserInputBufferCreateFd();
28755    test_ret += test_xmlParserInputBufferCreateFile();
28756    test_ret += test_xmlParserInputBufferCreateFilename();
28757    test_ret += test_xmlParserInputBufferCreateMem();
28758    test_ret += test_xmlParserInputBufferCreateStatic();
28759    test_ret += test_xmlParserInputBufferGrow();
28760    test_ret += test_xmlParserInputBufferPush();
28761    test_ret += test_xmlParserInputBufferRead();
28762    test_ret += test_xmlPopInputCallbacks();
28763    test_ret += test_xmlRegisterDefaultInputCallbacks();
28764    test_ret += test_xmlRegisterDefaultOutputCallbacks();
28765    test_ret += test_xmlRegisterHTTPPostCallbacks();
28766
28767    if (test_ret != 0)
28768	printf("Module xmlIO: %d errors\n", test_ret);
28769    return(test_ret);
28770}
28771#ifdef LIBXML_AUTOMATA_ENABLED
28772
28773#define gen_nb_xmlAutomataPtr 1
28774static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28775    return(NULL);
28776}
28777static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28778}
28779#endif
28780
28781
28782static int
28783test_xmlAutomataCompile(void) {
28784    int test_ret = 0;
28785
28786
28787    /* missing type support */
28788    return(test_ret);
28789}
28790
28791
28792static int
28793test_xmlAutomataGetInitState(void) {
28794    int test_ret = 0;
28795
28796
28797    /* missing type support */
28798    return(test_ret);
28799}
28800
28801
28802static int
28803test_xmlAutomataIsDeterminist(void) {
28804    int test_ret = 0;
28805
28806#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28807    int mem_base;
28808    int ret_val;
28809    xmlAutomataPtr am; /* an automata */
28810    int n_am;
28811
28812    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28813        mem_base = xmlMemBlocks();
28814        am = gen_xmlAutomataPtr(n_am, 0);
28815
28816        ret_val = xmlAutomataIsDeterminist(am);
28817        desret_int(ret_val);
28818        call_tests++;
28819        des_xmlAutomataPtr(n_am, am, 0);
28820        xmlResetLastError();
28821        if (mem_base != xmlMemBlocks()) {
28822            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28823	           xmlMemBlocks() - mem_base);
28824	    test_ret++;
28825            printf(" %d", n_am);
28826            printf("\n");
28827        }
28828    }
28829    function_tests++;
28830#endif
28831
28832    return(test_ret);
28833}
28834
28835#ifdef LIBXML_AUTOMATA_ENABLED
28836
28837#define gen_nb_xmlAutomataStatePtr 1
28838static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28839    return(NULL);
28840}
28841static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28842}
28843#endif
28844
28845
28846static int
28847test_xmlAutomataNewAllTrans(void) {
28848    int test_ret = 0;
28849
28850
28851    /* missing type support */
28852    return(test_ret);
28853}
28854
28855
28856static int
28857test_xmlAutomataNewCountTrans(void) {
28858    int test_ret = 0;
28859
28860
28861    /* missing type support */
28862    return(test_ret);
28863}
28864
28865
28866static int
28867test_xmlAutomataNewCountTrans2(void) {
28868    int test_ret = 0;
28869
28870
28871    /* missing type support */
28872    return(test_ret);
28873}
28874
28875
28876static int
28877test_xmlAutomataNewCountedTrans(void) {
28878    int test_ret = 0;
28879
28880
28881    /* missing type support */
28882    return(test_ret);
28883}
28884
28885
28886static int
28887test_xmlAutomataNewCounter(void) {
28888    int test_ret = 0;
28889
28890#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28891    int mem_base;
28892    int ret_val;
28893    xmlAutomataPtr am; /* an automata */
28894    int n_am;
28895    int min; /* the minimal value on the counter */
28896    int n_min;
28897    int max; /* the maximal value on the counter */
28898    int n_max;
28899
28900    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28901    for (n_min = 0;n_min < gen_nb_int;n_min++) {
28902    for (n_max = 0;n_max < gen_nb_int;n_max++) {
28903        mem_base = xmlMemBlocks();
28904        am = gen_xmlAutomataPtr(n_am, 0);
28905        min = gen_int(n_min, 1);
28906        max = gen_int(n_max, 2);
28907
28908        ret_val = xmlAutomataNewCounter(am, min, max);
28909        desret_int(ret_val);
28910        call_tests++;
28911        des_xmlAutomataPtr(n_am, am, 0);
28912        des_int(n_min, min, 1);
28913        des_int(n_max, max, 2);
28914        xmlResetLastError();
28915        if (mem_base != xmlMemBlocks()) {
28916            printf("Leak of %d blocks found in xmlAutomataNewCounter",
28917	           xmlMemBlocks() - mem_base);
28918	    test_ret++;
28919            printf(" %d", n_am);
28920            printf(" %d", n_min);
28921            printf(" %d", n_max);
28922            printf("\n");
28923        }
28924    }
28925    }
28926    }
28927    function_tests++;
28928#endif
28929
28930    return(test_ret);
28931}
28932
28933
28934static int
28935test_xmlAutomataNewCounterTrans(void) {
28936    int test_ret = 0;
28937
28938
28939    /* missing type support */
28940    return(test_ret);
28941}
28942
28943
28944static int
28945test_xmlAutomataNewEpsilon(void) {
28946    int test_ret = 0;
28947
28948
28949    /* missing type support */
28950    return(test_ret);
28951}
28952
28953
28954static int
28955test_xmlAutomataNewNegTrans(void) {
28956    int test_ret = 0;
28957
28958
28959    /* missing type support */
28960    return(test_ret);
28961}
28962
28963
28964static int
28965test_xmlAutomataNewOnceTrans(void) {
28966    int test_ret = 0;
28967
28968
28969    /* missing type support */
28970    return(test_ret);
28971}
28972
28973
28974static int
28975test_xmlAutomataNewOnceTrans2(void) {
28976    int test_ret = 0;
28977
28978
28979    /* missing type support */
28980    return(test_ret);
28981}
28982
28983
28984static int
28985test_xmlAutomataNewState(void) {
28986    int test_ret = 0;
28987
28988
28989    /* missing type support */
28990    return(test_ret);
28991}
28992
28993
28994static int
28995test_xmlAutomataNewTransition(void) {
28996    int test_ret = 0;
28997
28998
28999    /* missing type support */
29000    return(test_ret);
29001}
29002
29003
29004static int
29005test_xmlAutomataNewTransition2(void) {
29006    int test_ret = 0;
29007
29008
29009    /* missing type support */
29010    return(test_ret);
29011}
29012
29013
29014static int
29015test_xmlAutomataSetFinalState(void) {
29016    int test_ret = 0;
29017
29018#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29019    int mem_base;
29020    int ret_val;
29021    xmlAutomataPtr am; /* an automata */
29022    int n_am;
29023    xmlAutomataStatePtr state; /* a state in this automata */
29024    int n_state;
29025
29026    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29027    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29028        mem_base = xmlMemBlocks();
29029        am = gen_xmlAutomataPtr(n_am, 0);
29030        state = gen_xmlAutomataStatePtr(n_state, 1);
29031
29032        ret_val = xmlAutomataSetFinalState(am, state);
29033        desret_int(ret_val);
29034        call_tests++;
29035        des_xmlAutomataPtr(n_am, am, 0);
29036        des_xmlAutomataStatePtr(n_state, state, 1);
29037        xmlResetLastError();
29038        if (mem_base != xmlMemBlocks()) {
29039            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29040	           xmlMemBlocks() - mem_base);
29041	    test_ret++;
29042            printf(" %d", n_am);
29043            printf(" %d", n_state);
29044            printf("\n");
29045        }
29046    }
29047    }
29048    function_tests++;
29049#endif
29050
29051    return(test_ret);
29052}
29053
29054
29055static int
29056test_xmlNewAutomata(void) {
29057    int test_ret = 0;
29058
29059
29060    /* missing type support */
29061    return(test_ret);
29062}
29063
29064static int
29065test_xmlautomata(void) {
29066    int test_ret = 0;
29067
29068    if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29069    test_ret += test_xmlAutomataCompile();
29070    test_ret += test_xmlAutomataGetInitState();
29071    test_ret += test_xmlAutomataIsDeterminist();
29072    test_ret += test_xmlAutomataNewAllTrans();
29073    test_ret += test_xmlAutomataNewCountTrans();
29074    test_ret += test_xmlAutomataNewCountTrans2();
29075    test_ret += test_xmlAutomataNewCountedTrans();
29076    test_ret += test_xmlAutomataNewCounter();
29077    test_ret += test_xmlAutomataNewCounterTrans();
29078    test_ret += test_xmlAutomataNewEpsilon();
29079    test_ret += test_xmlAutomataNewNegTrans();
29080    test_ret += test_xmlAutomataNewOnceTrans();
29081    test_ret += test_xmlAutomataNewOnceTrans2();
29082    test_ret += test_xmlAutomataNewState();
29083    test_ret += test_xmlAutomataNewTransition();
29084    test_ret += test_xmlAutomataNewTransition2();
29085    test_ret += test_xmlAutomataSetFinalState();
29086    test_ret += test_xmlNewAutomata();
29087
29088    if (test_ret != 0)
29089	printf("Module xmlautomata: %d errors\n", test_ret);
29090    return(test_ret);
29091}
29092
29093#define gen_nb_xmlGenericErrorFunc_ptr 1
29094static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29095    return(NULL);
29096}
29097static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29098}
29099
29100static int
29101test_initGenericErrorDefaultFunc(void) {
29102    int test_ret = 0;
29103
29104    int mem_base;
29105    xmlGenericErrorFunc * handler; /* the handler */
29106    int n_handler;
29107
29108    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29109        mem_base = xmlMemBlocks();
29110        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29111
29112        initGenericErrorDefaultFunc(handler);
29113        call_tests++;
29114        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29115        xmlResetLastError();
29116        if (mem_base != xmlMemBlocks()) {
29117            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29118	           xmlMemBlocks() - mem_base);
29119	    test_ret++;
29120            printf(" %d", n_handler);
29121            printf("\n");
29122        }
29123    }
29124    function_tests++;
29125
29126    return(test_ret);
29127}
29128
29129
29130#define gen_nb_xmlErrorPtr 1
29131static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29132    return(NULL);
29133}
29134static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29135}
29136
29137static int
29138test_xmlCopyError(void) {
29139    int test_ret = 0;
29140
29141    int mem_base;
29142    int ret_val;
29143    xmlErrorPtr from; /* a source error */
29144    int n_from;
29145    xmlErrorPtr to; /* a target error */
29146    int n_to;
29147
29148    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29149    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29150        mem_base = xmlMemBlocks();
29151        from = gen_xmlErrorPtr(n_from, 0);
29152        to = gen_xmlErrorPtr(n_to, 1);
29153
29154        ret_val = xmlCopyError(from, to);
29155        desret_int(ret_val);
29156        call_tests++;
29157        des_xmlErrorPtr(n_from, from, 0);
29158        des_xmlErrorPtr(n_to, to, 1);
29159        xmlResetLastError();
29160        if (mem_base != xmlMemBlocks()) {
29161            printf("Leak of %d blocks found in xmlCopyError",
29162	           xmlMemBlocks() - mem_base);
29163	    test_ret++;
29164            printf(" %d", n_from);
29165            printf(" %d", n_to);
29166            printf("\n");
29167        }
29168    }
29169    }
29170    function_tests++;
29171
29172    return(test_ret);
29173}
29174
29175
29176static int
29177test_xmlCtxtGetLastError(void) {
29178    int test_ret = 0;
29179
29180
29181    /* missing type support */
29182    return(test_ret);
29183}
29184
29185
29186static int
29187test_xmlCtxtResetLastError(void) {
29188    int test_ret = 0;
29189
29190    int mem_base;
29191    void * ctx; /* an XML parser context */
29192    int n_ctx;
29193
29194    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29195        mem_base = xmlMemBlocks();
29196        ctx = gen_void_ptr(n_ctx, 0);
29197
29198        xmlCtxtResetLastError(ctx);
29199        call_tests++;
29200        des_void_ptr(n_ctx, ctx, 0);
29201        xmlResetLastError();
29202        if (mem_base != xmlMemBlocks()) {
29203            printf("Leak of %d blocks found in xmlCtxtResetLastError",
29204	           xmlMemBlocks() - mem_base);
29205	    test_ret++;
29206            printf(" %d", n_ctx);
29207            printf("\n");
29208        }
29209    }
29210    function_tests++;
29211
29212    return(test_ret);
29213}
29214
29215
29216static int
29217test_xmlGetLastError(void) {
29218    int test_ret = 0;
29219
29220
29221    /* missing type support */
29222    return(test_ret);
29223}
29224
29225
29226static int
29227test_xmlParserError(void) {
29228    int test_ret = 0;
29229
29230
29231    /* missing type support */
29232    return(test_ret);
29233}
29234
29235
29236static int
29237test_xmlParserPrintFileContext(void) {
29238    int test_ret = 0;
29239
29240    int mem_base;
29241    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29242    int n_input;
29243
29244    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29245        mem_base = xmlMemBlocks();
29246        input = gen_xmlParserInputPtr(n_input, 0);
29247
29248        xmlParserPrintFileContext(input);
29249        call_tests++;
29250        des_xmlParserInputPtr(n_input, input, 0);
29251        xmlResetLastError();
29252        if (mem_base != xmlMemBlocks()) {
29253            printf("Leak of %d blocks found in xmlParserPrintFileContext",
29254	           xmlMemBlocks() - mem_base);
29255	    test_ret++;
29256            printf(" %d", n_input);
29257            printf("\n");
29258        }
29259    }
29260    function_tests++;
29261
29262    return(test_ret);
29263}
29264
29265
29266static int
29267test_xmlParserPrintFileInfo(void) {
29268    int test_ret = 0;
29269
29270    int mem_base;
29271    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29272    int n_input;
29273
29274    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29275        mem_base = xmlMemBlocks();
29276        input = gen_xmlParserInputPtr(n_input, 0);
29277
29278        xmlParserPrintFileInfo(input);
29279        call_tests++;
29280        des_xmlParserInputPtr(n_input, input, 0);
29281        xmlResetLastError();
29282        if (mem_base != xmlMemBlocks()) {
29283            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29284	           xmlMemBlocks() - mem_base);
29285	    test_ret++;
29286            printf(" %d", n_input);
29287            printf("\n");
29288        }
29289    }
29290    function_tests++;
29291
29292    return(test_ret);
29293}
29294
29295
29296static int
29297test_xmlParserValidityError(void) {
29298    int test_ret = 0;
29299
29300
29301    /* missing type support */
29302    return(test_ret);
29303}
29304
29305
29306static int
29307test_xmlParserValidityWarning(void) {
29308    int test_ret = 0;
29309
29310
29311    /* missing type support */
29312    return(test_ret);
29313}
29314
29315
29316static int
29317test_xmlParserWarning(void) {
29318    int test_ret = 0;
29319
29320
29321    /* missing type support */
29322    return(test_ret);
29323}
29324
29325
29326static int
29327test_xmlResetError(void) {
29328    int test_ret = 0;
29329
29330    int mem_base;
29331    xmlErrorPtr err; /* pointer to the error. */
29332    int n_err;
29333
29334    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29335        mem_base = xmlMemBlocks();
29336        err = gen_xmlErrorPtr(n_err, 0);
29337
29338        xmlResetError(err);
29339        call_tests++;
29340        des_xmlErrorPtr(n_err, err, 0);
29341        xmlResetLastError();
29342        if (mem_base != xmlMemBlocks()) {
29343            printf("Leak of %d blocks found in xmlResetError",
29344	           xmlMemBlocks() - mem_base);
29345	    test_ret++;
29346            printf(" %d", n_err);
29347            printf("\n");
29348        }
29349    }
29350    function_tests++;
29351
29352    return(test_ret);
29353}
29354
29355
29356static int
29357test_xmlResetLastError(void) {
29358    int test_ret = 0;
29359
29360
29361
29362        xmlResetLastError();
29363        call_tests++;
29364        xmlResetLastError();
29365    function_tests++;
29366
29367    return(test_ret);
29368}
29369
29370
29371static int
29372test_xmlSetGenericErrorFunc(void) {
29373    int test_ret = 0;
29374
29375
29376    /* missing type support */
29377    return(test_ret);
29378}
29379
29380
29381static int
29382test_xmlSetStructuredErrorFunc(void) {
29383    int test_ret = 0;
29384
29385
29386    /* missing type support */
29387    return(test_ret);
29388}
29389
29390static int
29391test_xmlerror(void) {
29392    int test_ret = 0;
29393
29394    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29395    test_ret += test_initGenericErrorDefaultFunc();
29396    test_ret += test_xmlCopyError();
29397    test_ret += test_xmlCtxtGetLastError();
29398    test_ret += test_xmlCtxtResetLastError();
29399    test_ret += test_xmlGetLastError();
29400    test_ret += test_xmlParserError();
29401    test_ret += test_xmlParserPrintFileContext();
29402    test_ret += test_xmlParserPrintFileInfo();
29403    test_ret += test_xmlParserValidityError();
29404    test_ret += test_xmlParserValidityWarning();
29405    test_ret += test_xmlParserWarning();
29406    test_ret += test_xmlResetError();
29407    test_ret += test_xmlResetLastError();
29408    test_ret += test_xmlSetGenericErrorFunc();
29409    test_ret += test_xmlSetStructuredErrorFunc();
29410
29411    if (test_ret != 0)
29412	printf("Module xmlerror: %d errors\n", test_ret);
29413    return(test_ret);
29414}
29415#ifdef LIBXML_MODULES_ENABLED
29416
29417#define gen_nb_xmlModulePtr 1
29418static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29419    return(NULL);
29420}
29421static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29422}
29423#endif
29424
29425
29426static int
29427test_xmlModuleClose(void) {
29428    int test_ret = 0;
29429
29430#if defined(LIBXML_MODULES_ENABLED)
29431    int mem_base;
29432    int ret_val;
29433    xmlModulePtr module; /* the module handle */
29434    int n_module;
29435
29436    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29437        mem_base = xmlMemBlocks();
29438        module = gen_xmlModulePtr(n_module, 0);
29439
29440        ret_val = xmlModuleClose(module);
29441        desret_int(ret_val);
29442        call_tests++;
29443        des_xmlModulePtr(n_module, module, 0);
29444        xmlResetLastError();
29445        if (mem_base != xmlMemBlocks()) {
29446            printf("Leak of %d blocks found in xmlModuleClose",
29447	           xmlMemBlocks() - mem_base);
29448	    test_ret++;
29449            printf(" %d", n_module);
29450            printf("\n");
29451        }
29452    }
29453    function_tests++;
29454#endif
29455
29456    return(test_ret);
29457}
29458
29459
29460static int
29461test_xmlModuleOpen(void) {
29462    int test_ret = 0;
29463
29464
29465    /* missing type support */
29466    return(test_ret);
29467}
29468
29469
29470static int
29471test_xmlModuleSymbol(void) {
29472    int test_ret = 0;
29473
29474#if defined(LIBXML_MODULES_ENABLED)
29475    int mem_base;
29476    int ret_val;
29477    xmlModulePtr module; /* the module */
29478    int n_module;
29479    char * name; /* the name of the symbol */
29480    int n_name;
29481    void ** symbol; /* the resulting symbol address */
29482    int n_symbol;
29483
29484    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29485    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29486    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29487        mem_base = xmlMemBlocks();
29488        module = gen_xmlModulePtr(n_module, 0);
29489        name = gen_const_char_ptr(n_name, 1);
29490        symbol = gen_void_ptr_ptr(n_symbol, 2);
29491
29492        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29493        desret_int(ret_val);
29494        call_tests++;
29495        des_xmlModulePtr(n_module, module, 0);
29496        des_const_char_ptr(n_name, (const char *)name, 1);
29497        des_void_ptr_ptr(n_symbol, symbol, 2);
29498        xmlResetLastError();
29499        if (mem_base != xmlMemBlocks()) {
29500            printf("Leak of %d blocks found in xmlModuleSymbol",
29501	           xmlMemBlocks() - mem_base);
29502	    test_ret++;
29503            printf(" %d", n_module);
29504            printf(" %d", n_name);
29505            printf(" %d", n_symbol);
29506            printf("\n");
29507        }
29508    }
29509    }
29510    }
29511    function_tests++;
29512#endif
29513
29514    return(test_ret);
29515}
29516
29517static int
29518test_xmlmodule(void) {
29519    int test_ret = 0;
29520
29521    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29522    test_ret += test_xmlModuleClose();
29523    test_ret += test_xmlModuleOpen();
29524    test_ret += test_xmlModuleSymbol();
29525
29526    if (test_ret != 0)
29527	printf("Module xmlmodule: %d errors\n", test_ret);
29528    return(test_ret);
29529}
29530
29531static int
29532test_xmlNewTextReader(void) {
29533    int test_ret = 0;
29534
29535#if defined(LIBXML_READER_ENABLED)
29536    int mem_base;
29537    xmlTextReaderPtr ret_val;
29538    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29539    int n_input;
29540    const char * URI; /* the URI information for the source if available */
29541    int n_URI;
29542
29543    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29544    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29545        mem_base = xmlMemBlocks();
29546        input = gen_xmlParserInputBufferPtr(n_input, 0);
29547        URI = gen_filepath(n_URI, 1);
29548
29549        ret_val = xmlNewTextReader(input, URI);
29550        desret_xmlTextReaderPtr(ret_val);
29551        call_tests++;
29552        des_xmlParserInputBufferPtr(n_input, input, 0);
29553        des_filepath(n_URI, URI, 1);
29554        xmlResetLastError();
29555        if (mem_base != xmlMemBlocks()) {
29556            printf("Leak of %d blocks found in xmlNewTextReader",
29557	           xmlMemBlocks() - mem_base);
29558	    test_ret++;
29559            printf(" %d", n_input);
29560            printf(" %d", n_URI);
29561            printf("\n");
29562        }
29563    }
29564    }
29565    function_tests++;
29566#endif
29567
29568    return(test_ret);
29569}
29570
29571
29572static int
29573test_xmlNewTextReaderFilename(void) {
29574    int test_ret = 0;
29575
29576#if defined(LIBXML_READER_ENABLED)
29577    int mem_base;
29578    xmlTextReaderPtr ret_val;
29579    const char * URI; /* the URI of the resource to process */
29580    int n_URI;
29581
29582    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29583        mem_base = xmlMemBlocks();
29584        URI = gen_filepath(n_URI, 0);
29585
29586        ret_val = xmlNewTextReaderFilename(URI);
29587        desret_xmlTextReaderPtr(ret_val);
29588        call_tests++;
29589        des_filepath(n_URI, URI, 0);
29590        xmlResetLastError();
29591        if (mem_base != xmlMemBlocks()) {
29592            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29593	           xmlMemBlocks() - mem_base);
29594	    test_ret++;
29595            printf(" %d", n_URI);
29596            printf("\n");
29597        }
29598    }
29599    function_tests++;
29600#endif
29601
29602    return(test_ret);
29603}
29604
29605
29606static int
29607test_xmlReaderForDoc(void) {
29608    int test_ret = 0;
29609
29610#if defined(LIBXML_READER_ENABLED)
29611    int mem_base;
29612    xmlTextReaderPtr ret_val;
29613    xmlChar * cur; /* a pointer to a zero terminated string */
29614    int n_cur;
29615    const char * URL; /* the base URL to use for the document */
29616    int n_URL;
29617    char * encoding; /* the document encoding, or NULL */
29618    int n_encoding;
29619    int options; /* a combination of xmlParserOption */
29620    int n_options;
29621
29622    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29623    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29624    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29625    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29626        mem_base = xmlMemBlocks();
29627        cur = gen_const_xmlChar_ptr(n_cur, 0);
29628        URL = gen_filepath(n_URL, 1);
29629        encoding = gen_const_char_ptr(n_encoding, 2);
29630        options = gen_parseroptions(n_options, 3);
29631
29632        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29633        desret_xmlTextReaderPtr(ret_val);
29634        call_tests++;
29635        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29636        des_filepath(n_URL, URL, 1);
29637        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29638        des_parseroptions(n_options, options, 3);
29639        xmlResetLastError();
29640        if (mem_base != xmlMemBlocks()) {
29641            printf("Leak of %d blocks found in xmlReaderForDoc",
29642	           xmlMemBlocks() - mem_base);
29643	    test_ret++;
29644            printf(" %d", n_cur);
29645            printf(" %d", n_URL);
29646            printf(" %d", n_encoding);
29647            printf(" %d", n_options);
29648            printf("\n");
29649        }
29650    }
29651    }
29652    }
29653    }
29654    function_tests++;
29655#endif
29656
29657    return(test_ret);
29658}
29659
29660
29661static int
29662test_xmlReaderForFile(void) {
29663    int test_ret = 0;
29664
29665#if defined(LIBXML_READER_ENABLED)
29666    int mem_base;
29667    xmlTextReaderPtr ret_val;
29668    const char * filename; /* a file or URL */
29669    int n_filename;
29670    char * encoding; /* the document encoding, or NULL */
29671    int n_encoding;
29672    int options; /* a combination of xmlParserOption */
29673    int n_options;
29674
29675    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29676    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29677    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29678        mem_base = xmlMemBlocks();
29679        filename = gen_filepath(n_filename, 0);
29680        encoding = gen_const_char_ptr(n_encoding, 1);
29681        options = gen_parseroptions(n_options, 2);
29682
29683        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29684        desret_xmlTextReaderPtr(ret_val);
29685        call_tests++;
29686        des_filepath(n_filename, filename, 0);
29687        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29688        des_parseroptions(n_options, options, 2);
29689        xmlResetLastError();
29690        if (mem_base != xmlMemBlocks()) {
29691            printf("Leak of %d blocks found in xmlReaderForFile",
29692	           xmlMemBlocks() - mem_base);
29693	    test_ret++;
29694            printf(" %d", n_filename);
29695            printf(" %d", n_encoding);
29696            printf(" %d", n_options);
29697            printf("\n");
29698        }
29699    }
29700    }
29701    }
29702    function_tests++;
29703#endif
29704
29705    return(test_ret);
29706}
29707
29708
29709static int
29710test_xmlReaderForMemory(void) {
29711    int test_ret = 0;
29712
29713#if defined(LIBXML_READER_ENABLED)
29714    int mem_base;
29715    xmlTextReaderPtr ret_val;
29716    char * buffer; /* a pointer to a char array */
29717    int n_buffer;
29718    int size; /* the size of the array */
29719    int n_size;
29720    const char * URL; /* the base URL to use for the document */
29721    int n_URL;
29722    char * encoding; /* the document encoding, or NULL */
29723    int n_encoding;
29724    int options; /* a combination of xmlParserOption */
29725    int n_options;
29726
29727    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29728    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29729    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29730    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29731    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29732        mem_base = xmlMemBlocks();
29733        buffer = gen_const_char_ptr(n_buffer, 0);
29734        size = gen_int(n_size, 1);
29735        URL = gen_filepath(n_URL, 2);
29736        encoding = gen_const_char_ptr(n_encoding, 3);
29737        options = gen_parseroptions(n_options, 4);
29738
29739        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29740        desret_xmlTextReaderPtr(ret_val);
29741        call_tests++;
29742        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29743        des_int(n_size, size, 1);
29744        des_filepath(n_URL, URL, 2);
29745        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29746        des_parseroptions(n_options, options, 4);
29747        xmlResetLastError();
29748        if (mem_base != xmlMemBlocks()) {
29749            printf("Leak of %d blocks found in xmlReaderForMemory",
29750	           xmlMemBlocks() - mem_base);
29751	    test_ret++;
29752            printf(" %d", n_buffer);
29753            printf(" %d", n_size);
29754            printf(" %d", n_URL);
29755            printf(" %d", n_encoding);
29756            printf(" %d", n_options);
29757            printf("\n");
29758        }
29759    }
29760    }
29761    }
29762    }
29763    }
29764    function_tests++;
29765#endif
29766
29767    return(test_ret);
29768}
29769
29770
29771static int
29772test_xmlReaderNewDoc(void) {
29773    int test_ret = 0;
29774
29775#if defined(LIBXML_READER_ENABLED)
29776    int mem_base;
29777    int ret_val;
29778    xmlTextReaderPtr reader; /* an XML reader */
29779    int n_reader;
29780    xmlChar * cur; /* a pointer to a zero terminated string */
29781    int n_cur;
29782    const char * URL; /* the base URL to use for the document */
29783    int n_URL;
29784    char * encoding; /* the document encoding, or NULL */
29785    int n_encoding;
29786    int options; /* a combination of xmlParserOption */
29787    int n_options;
29788
29789    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29790    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29791    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29792    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29793    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29794        mem_base = xmlMemBlocks();
29795        reader = gen_xmlTextReaderPtr(n_reader, 0);
29796        cur = gen_const_xmlChar_ptr(n_cur, 1);
29797        URL = gen_filepath(n_URL, 2);
29798        encoding = gen_const_char_ptr(n_encoding, 3);
29799        options = gen_parseroptions(n_options, 4);
29800
29801        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29802        desret_int(ret_val);
29803        call_tests++;
29804        des_xmlTextReaderPtr(n_reader, reader, 0);
29805        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29806        des_filepath(n_URL, URL, 2);
29807        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29808        des_parseroptions(n_options, options, 4);
29809        xmlResetLastError();
29810        if (mem_base != xmlMemBlocks()) {
29811            printf("Leak of %d blocks found in xmlReaderNewDoc",
29812	           xmlMemBlocks() - mem_base);
29813	    test_ret++;
29814            printf(" %d", n_reader);
29815            printf(" %d", n_cur);
29816            printf(" %d", n_URL);
29817            printf(" %d", n_encoding);
29818            printf(" %d", n_options);
29819            printf("\n");
29820        }
29821    }
29822    }
29823    }
29824    }
29825    }
29826    function_tests++;
29827#endif
29828
29829    return(test_ret);
29830}
29831
29832
29833static int
29834test_xmlReaderNewFile(void) {
29835    int test_ret = 0;
29836
29837#if defined(LIBXML_READER_ENABLED)
29838    int mem_base;
29839    int ret_val;
29840    xmlTextReaderPtr reader; /* an XML reader */
29841    int n_reader;
29842    const char * filename; /* a file or URL */
29843    int n_filename;
29844    char * encoding; /* the document encoding, or NULL */
29845    int n_encoding;
29846    int options; /* a combination of xmlParserOption */
29847    int n_options;
29848
29849    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29850    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29851    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29852    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29853        mem_base = xmlMemBlocks();
29854        reader = gen_xmlTextReaderPtr(n_reader, 0);
29855        filename = gen_filepath(n_filename, 1);
29856        encoding = gen_const_char_ptr(n_encoding, 2);
29857        options = gen_parseroptions(n_options, 3);
29858
29859        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
29860        desret_int(ret_val);
29861        call_tests++;
29862        des_xmlTextReaderPtr(n_reader, reader, 0);
29863        des_filepath(n_filename, filename, 1);
29864        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29865        des_parseroptions(n_options, options, 3);
29866        xmlResetLastError();
29867        if (mem_base != xmlMemBlocks()) {
29868            printf("Leak of %d blocks found in xmlReaderNewFile",
29869	           xmlMemBlocks() - mem_base);
29870	    test_ret++;
29871            printf(" %d", n_reader);
29872            printf(" %d", n_filename);
29873            printf(" %d", n_encoding);
29874            printf(" %d", n_options);
29875            printf("\n");
29876        }
29877    }
29878    }
29879    }
29880    }
29881    function_tests++;
29882#endif
29883
29884    return(test_ret);
29885}
29886
29887
29888static int
29889test_xmlReaderNewMemory(void) {
29890    int test_ret = 0;
29891
29892#if defined(LIBXML_READER_ENABLED)
29893    int mem_base;
29894    int ret_val;
29895    xmlTextReaderPtr reader; /* an XML reader */
29896    int n_reader;
29897    char * buffer; /* a pointer to a char array */
29898    int n_buffer;
29899    int size; /* the size of the array */
29900    int n_size;
29901    const char * URL; /* the base URL to use for the document */
29902    int n_URL;
29903    char * encoding; /* the document encoding, or NULL */
29904    int n_encoding;
29905    int options; /* a combination of xmlParserOption */
29906    int n_options;
29907
29908    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29909    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29910    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29911    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29912    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29913    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29914        mem_base = xmlMemBlocks();
29915        reader = gen_xmlTextReaderPtr(n_reader, 0);
29916        buffer = gen_const_char_ptr(n_buffer, 1);
29917        size = gen_int(n_size, 2);
29918        URL = gen_filepath(n_URL, 3);
29919        encoding = gen_const_char_ptr(n_encoding, 4);
29920        options = gen_parseroptions(n_options, 5);
29921
29922        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
29923        desret_int(ret_val);
29924        call_tests++;
29925        des_xmlTextReaderPtr(n_reader, reader, 0);
29926        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
29927        des_int(n_size, size, 2);
29928        des_filepath(n_URL, URL, 3);
29929        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
29930        des_parseroptions(n_options, options, 5);
29931        xmlResetLastError();
29932        if (mem_base != xmlMemBlocks()) {
29933            printf("Leak of %d blocks found in xmlReaderNewMemory",
29934	           xmlMemBlocks() - mem_base);
29935	    test_ret++;
29936            printf(" %d", n_reader);
29937            printf(" %d", n_buffer);
29938            printf(" %d", n_size);
29939            printf(" %d", n_URL);
29940            printf(" %d", n_encoding);
29941            printf(" %d", n_options);
29942            printf("\n");
29943        }
29944    }
29945    }
29946    }
29947    }
29948    }
29949    }
29950    function_tests++;
29951#endif
29952
29953    return(test_ret);
29954}
29955
29956
29957static int
29958test_xmlReaderNewWalker(void) {
29959    int test_ret = 0;
29960
29961#if defined(LIBXML_READER_ENABLED)
29962    int mem_base;
29963    int ret_val;
29964    xmlTextReaderPtr reader; /* an XML reader */
29965    int n_reader;
29966    xmlDocPtr doc; /* a preparsed document */
29967    int n_doc;
29968
29969    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29970    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29971        mem_base = xmlMemBlocks();
29972        reader = gen_xmlTextReaderPtr(n_reader, 0);
29973        doc = gen_xmlDocPtr(n_doc, 1);
29974
29975        ret_val = xmlReaderNewWalker(reader, doc);
29976        desret_int(ret_val);
29977        call_tests++;
29978        des_xmlTextReaderPtr(n_reader, reader, 0);
29979        des_xmlDocPtr(n_doc, doc, 1);
29980        xmlResetLastError();
29981        if (mem_base != xmlMemBlocks()) {
29982            printf("Leak of %d blocks found in xmlReaderNewWalker",
29983	           xmlMemBlocks() - mem_base);
29984	    test_ret++;
29985            printf(" %d", n_reader);
29986            printf(" %d", n_doc);
29987            printf("\n");
29988        }
29989    }
29990    }
29991    function_tests++;
29992#endif
29993
29994    return(test_ret);
29995}
29996
29997
29998static int
29999test_xmlReaderWalker(void) {
30000    int test_ret = 0;
30001
30002#if defined(LIBXML_READER_ENABLED)
30003    int mem_base;
30004    xmlTextReaderPtr ret_val;
30005    xmlDocPtr doc; /* a preparsed document */
30006    int n_doc;
30007
30008    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30009        mem_base = xmlMemBlocks();
30010        doc = gen_xmlDocPtr(n_doc, 0);
30011
30012        ret_val = xmlReaderWalker(doc);
30013        desret_xmlTextReaderPtr(ret_val);
30014        call_tests++;
30015        des_xmlDocPtr(n_doc, doc, 0);
30016        xmlResetLastError();
30017        if (mem_base != xmlMemBlocks()) {
30018            printf("Leak of %d blocks found in xmlReaderWalker",
30019	           xmlMemBlocks() - mem_base);
30020	    test_ret++;
30021            printf(" %d", n_doc);
30022            printf("\n");
30023        }
30024    }
30025    function_tests++;
30026#endif
30027
30028    return(test_ret);
30029}
30030
30031
30032static int
30033test_xmlTextReaderAttributeCount(void) {
30034    int test_ret = 0;
30035
30036#if defined(LIBXML_READER_ENABLED)
30037    int mem_base;
30038    int ret_val;
30039    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30040    int n_reader;
30041
30042    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30043        mem_base = xmlMemBlocks();
30044        reader = gen_xmlTextReaderPtr(n_reader, 0);
30045
30046        ret_val = xmlTextReaderAttributeCount(reader);
30047        desret_int(ret_val);
30048        call_tests++;
30049        des_xmlTextReaderPtr(n_reader, reader, 0);
30050        xmlResetLastError();
30051        if (mem_base != xmlMemBlocks()) {
30052            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30053	           xmlMemBlocks() - mem_base);
30054	    test_ret++;
30055            printf(" %d", n_reader);
30056            printf("\n");
30057        }
30058    }
30059    function_tests++;
30060#endif
30061
30062    return(test_ret);
30063}
30064
30065
30066static int
30067test_xmlTextReaderBaseUri(void) {
30068    int test_ret = 0;
30069
30070#if defined(LIBXML_READER_ENABLED)
30071    int mem_base;
30072    xmlChar * ret_val;
30073    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30074    int n_reader;
30075
30076    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30077        mem_base = xmlMemBlocks();
30078        reader = gen_xmlTextReaderPtr(n_reader, 0);
30079
30080        ret_val = xmlTextReaderBaseUri(reader);
30081        desret_xmlChar_ptr(ret_val);
30082        call_tests++;
30083        des_xmlTextReaderPtr(n_reader, reader, 0);
30084        xmlResetLastError();
30085        if (mem_base != xmlMemBlocks()) {
30086            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30087	           xmlMemBlocks() - mem_base);
30088	    test_ret++;
30089            printf(" %d", n_reader);
30090            printf("\n");
30091        }
30092    }
30093    function_tests++;
30094#endif
30095
30096    return(test_ret);
30097}
30098
30099
30100static int
30101test_xmlTextReaderByteConsumed(void) {
30102    int test_ret = 0;
30103
30104#if defined(LIBXML_READER_ENABLED)
30105    int mem_base;
30106    long ret_val;
30107    xmlTextReaderPtr reader; /* an XML reader */
30108    int n_reader;
30109
30110    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30111        mem_base = xmlMemBlocks();
30112        reader = gen_xmlTextReaderPtr(n_reader, 0);
30113
30114        ret_val = xmlTextReaderByteConsumed(reader);
30115        desret_long(ret_val);
30116        call_tests++;
30117        des_xmlTextReaderPtr(n_reader, reader, 0);
30118        xmlResetLastError();
30119        if (mem_base != xmlMemBlocks()) {
30120            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30121	           xmlMemBlocks() - mem_base);
30122	    test_ret++;
30123            printf(" %d", n_reader);
30124            printf("\n");
30125        }
30126    }
30127    function_tests++;
30128#endif
30129
30130    return(test_ret);
30131}
30132
30133
30134static int
30135test_xmlTextReaderClose(void) {
30136    int test_ret = 0;
30137
30138#if defined(LIBXML_READER_ENABLED)
30139    int mem_base;
30140    int ret_val;
30141    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30142    int n_reader;
30143
30144    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30145        mem_base = xmlMemBlocks();
30146        reader = gen_xmlTextReaderPtr(n_reader, 0);
30147
30148        ret_val = xmlTextReaderClose(reader);
30149        desret_int(ret_val);
30150        call_tests++;
30151        des_xmlTextReaderPtr(n_reader, reader, 0);
30152        xmlResetLastError();
30153        if (mem_base != xmlMemBlocks()) {
30154            printf("Leak of %d blocks found in xmlTextReaderClose",
30155	           xmlMemBlocks() - mem_base);
30156	    test_ret++;
30157            printf(" %d", n_reader);
30158            printf("\n");
30159        }
30160    }
30161    function_tests++;
30162#endif
30163
30164    return(test_ret);
30165}
30166
30167
30168static int
30169test_xmlTextReaderConstBaseUri(void) {
30170    int test_ret = 0;
30171
30172#if defined(LIBXML_READER_ENABLED)
30173    int mem_base;
30174    const xmlChar * ret_val;
30175    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30176    int n_reader;
30177
30178    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30179        mem_base = xmlMemBlocks();
30180        reader = gen_xmlTextReaderPtr(n_reader, 0);
30181
30182        ret_val = xmlTextReaderConstBaseUri(reader);
30183        desret_const_xmlChar_ptr(ret_val);
30184        call_tests++;
30185        des_xmlTextReaderPtr(n_reader, reader, 0);
30186        xmlResetLastError();
30187        if (mem_base != xmlMemBlocks()) {
30188            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30189	           xmlMemBlocks() - mem_base);
30190	    test_ret++;
30191            printf(" %d", n_reader);
30192            printf("\n");
30193        }
30194    }
30195    function_tests++;
30196#endif
30197
30198    return(test_ret);
30199}
30200
30201
30202static int
30203test_xmlTextReaderConstEncoding(void) {
30204    int test_ret = 0;
30205
30206#if defined(LIBXML_READER_ENABLED)
30207    int mem_base;
30208    const xmlChar * ret_val;
30209    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30210    int n_reader;
30211
30212    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30213        mem_base = xmlMemBlocks();
30214        reader = gen_xmlTextReaderPtr(n_reader, 0);
30215
30216        ret_val = xmlTextReaderConstEncoding(reader);
30217        desret_const_xmlChar_ptr(ret_val);
30218        call_tests++;
30219        des_xmlTextReaderPtr(n_reader, reader, 0);
30220        xmlResetLastError();
30221        if (mem_base != xmlMemBlocks()) {
30222            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30223	           xmlMemBlocks() - mem_base);
30224	    test_ret++;
30225            printf(" %d", n_reader);
30226            printf("\n");
30227        }
30228    }
30229    function_tests++;
30230#endif
30231
30232    return(test_ret);
30233}
30234
30235
30236static int
30237test_xmlTextReaderConstLocalName(void) {
30238    int test_ret = 0;
30239
30240#if defined(LIBXML_READER_ENABLED)
30241    int mem_base;
30242    const xmlChar * ret_val;
30243    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30244    int n_reader;
30245
30246    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30247        mem_base = xmlMemBlocks();
30248        reader = gen_xmlTextReaderPtr(n_reader, 0);
30249
30250        ret_val = xmlTextReaderConstLocalName(reader);
30251        desret_const_xmlChar_ptr(ret_val);
30252        call_tests++;
30253        des_xmlTextReaderPtr(n_reader, reader, 0);
30254        xmlResetLastError();
30255        if (mem_base != xmlMemBlocks()) {
30256            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30257	           xmlMemBlocks() - mem_base);
30258	    test_ret++;
30259            printf(" %d", n_reader);
30260            printf("\n");
30261        }
30262    }
30263    function_tests++;
30264#endif
30265
30266    return(test_ret);
30267}
30268
30269
30270static int
30271test_xmlTextReaderConstName(void) {
30272    int test_ret = 0;
30273
30274#if defined(LIBXML_READER_ENABLED)
30275    int mem_base;
30276    const xmlChar * ret_val;
30277    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30278    int n_reader;
30279
30280    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30281        mem_base = xmlMemBlocks();
30282        reader = gen_xmlTextReaderPtr(n_reader, 0);
30283
30284        ret_val = xmlTextReaderConstName(reader);
30285        desret_const_xmlChar_ptr(ret_val);
30286        call_tests++;
30287        des_xmlTextReaderPtr(n_reader, reader, 0);
30288        xmlResetLastError();
30289        if (mem_base != xmlMemBlocks()) {
30290            printf("Leak of %d blocks found in xmlTextReaderConstName",
30291	           xmlMemBlocks() - mem_base);
30292	    test_ret++;
30293            printf(" %d", n_reader);
30294            printf("\n");
30295        }
30296    }
30297    function_tests++;
30298#endif
30299
30300    return(test_ret);
30301}
30302
30303
30304static int
30305test_xmlTextReaderConstNamespaceUri(void) {
30306    int test_ret = 0;
30307
30308#if defined(LIBXML_READER_ENABLED)
30309    int mem_base;
30310    const xmlChar * ret_val;
30311    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30312    int n_reader;
30313
30314    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30315        mem_base = xmlMemBlocks();
30316        reader = gen_xmlTextReaderPtr(n_reader, 0);
30317
30318        ret_val = xmlTextReaderConstNamespaceUri(reader);
30319        desret_const_xmlChar_ptr(ret_val);
30320        call_tests++;
30321        des_xmlTextReaderPtr(n_reader, reader, 0);
30322        xmlResetLastError();
30323        if (mem_base != xmlMemBlocks()) {
30324            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30325	           xmlMemBlocks() - mem_base);
30326	    test_ret++;
30327            printf(" %d", n_reader);
30328            printf("\n");
30329        }
30330    }
30331    function_tests++;
30332#endif
30333
30334    return(test_ret);
30335}
30336
30337
30338static int
30339test_xmlTextReaderConstPrefix(void) {
30340    int test_ret = 0;
30341
30342#if defined(LIBXML_READER_ENABLED)
30343    int mem_base;
30344    const xmlChar * ret_val;
30345    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30346    int n_reader;
30347
30348    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30349        mem_base = xmlMemBlocks();
30350        reader = gen_xmlTextReaderPtr(n_reader, 0);
30351
30352        ret_val = xmlTextReaderConstPrefix(reader);
30353        desret_const_xmlChar_ptr(ret_val);
30354        call_tests++;
30355        des_xmlTextReaderPtr(n_reader, reader, 0);
30356        xmlResetLastError();
30357        if (mem_base != xmlMemBlocks()) {
30358            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30359	           xmlMemBlocks() - mem_base);
30360	    test_ret++;
30361            printf(" %d", n_reader);
30362            printf("\n");
30363        }
30364    }
30365    function_tests++;
30366#endif
30367
30368    return(test_ret);
30369}
30370
30371
30372static int
30373test_xmlTextReaderConstString(void) {
30374    int test_ret = 0;
30375
30376#if defined(LIBXML_READER_ENABLED)
30377    int mem_base;
30378    const xmlChar * ret_val;
30379    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30380    int n_reader;
30381    xmlChar * str; /* the string to intern. */
30382    int n_str;
30383
30384    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30385    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30386        mem_base = xmlMemBlocks();
30387        reader = gen_xmlTextReaderPtr(n_reader, 0);
30388        str = gen_const_xmlChar_ptr(n_str, 1);
30389
30390        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30391        desret_const_xmlChar_ptr(ret_val);
30392        call_tests++;
30393        des_xmlTextReaderPtr(n_reader, reader, 0);
30394        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30395        xmlResetLastError();
30396        if (mem_base != xmlMemBlocks()) {
30397            printf("Leak of %d blocks found in xmlTextReaderConstString",
30398	           xmlMemBlocks() - mem_base);
30399	    test_ret++;
30400            printf(" %d", n_reader);
30401            printf(" %d", n_str);
30402            printf("\n");
30403        }
30404    }
30405    }
30406    function_tests++;
30407#endif
30408
30409    return(test_ret);
30410}
30411
30412
30413static int
30414test_xmlTextReaderConstValue(void) {
30415    int test_ret = 0;
30416
30417#if defined(LIBXML_READER_ENABLED)
30418    int mem_base;
30419    const xmlChar * ret_val;
30420    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30421    int n_reader;
30422
30423    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30424        mem_base = xmlMemBlocks();
30425        reader = gen_xmlTextReaderPtr(n_reader, 0);
30426
30427        ret_val = xmlTextReaderConstValue(reader);
30428        desret_const_xmlChar_ptr(ret_val);
30429        call_tests++;
30430        des_xmlTextReaderPtr(n_reader, reader, 0);
30431        xmlResetLastError();
30432        if (mem_base != xmlMemBlocks()) {
30433            printf("Leak of %d blocks found in xmlTextReaderConstValue",
30434	           xmlMemBlocks() - mem_base);
30435	    test_ret++;
30436            printf(" %d", n_reader);
30437            printf("\n");
30438        }
30439    }
30440    function_tests++;
30441#endif
30442
30443    return(test_ret);
30444}
30445
30446
30447static int
30448test_xmlTextReaderConstXmlLang(void) {
30449    int test_ret = 0;
30450
30451#if defined(LIBXML_READER_ENABLED)
30452    int mem_base;
30453    const xmlChar * ret_val;
30454    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30455    int n_reader;
30456
30457    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30458        mem_base = xmlMemBlocks();
30459        reader = gen_xmlTextReaderPtr(n_reader, 0);
30460
30461        ret_val = xmlTextReaderConstXmlLang(reader);
30462        desret_const_xmlChar_ptr(ret_val);
30463        call_tests++;
30464        des_xmlTextReaderPtr(n_reader, reader, 0);
30465        xmlResetLastError();
30466        if (mem_base != xmlMemBlocks()) {
30467            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30468	           xmlMemBlocks() - mem_base);
30469	    test_ret++;
30470            printf(" %d", n_reader);
30471            printf("\n");
30472        }
30473    }
30474    function_tests++;
30475#endif
30476
30477    return(test_ret);
30478}
30479
30480
30481static int
30482test_xmlTextReaderConstXmlVersion(void) {
30483    int test_ret = 0;
30484
30485#if defined(LIBXML_READER_ENABLED)
30486    int mem_base;
30487    const xmlChar * ret_val;
30488    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30489    int n_reader;
30490
30491    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30492        mem_base = xmlMemBlocks();
30493        reader = gen_xmlTextReaderPtr(n_reader, 0);
30494
30495        ret_val = xmlTextReaderConstXmlVersion(reader);
30496        desret_const_xmlChar_ptr(ret_val);
30497        call_tests++;
30498        des_xmlTextReaderPtr(n_reader, reader, 0);
30499        xmlResetLastError();
30500        if (mem_base != xmlMemBlocks()) {
30501            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30502	           xmlMemBlocks() - mem_base);
30503	    test_ret++;
30504            printf(" %d", n_reader);
30505            printf("\n");
30506        }
30507    }
30508    function_tests++;
30509#endif
30510
30511    return(test_ret);
30512}
30513
30514
30515static int
30516test_xmlTextReaderCurrentDoc(void) {
30517    int test_ret = 0;
30518
30519#if defined(LIBXML_READER_ENABLED)
30520    int mem_base;
30521    xmlDocPtr ret_val;
30522    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30523    int n_reader;
30524
30525    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30526        mem_base = xmlMemBlocks();
30527        reader = gen_xmlTextReaderPtr(n_reader, 0);
30528
30529        ret_val = xmlTextReaderCurrentDoc(reader);
30530        desret_xmlDocPtr(ret_val);
30531        call_tests++;
30532        des_xmlTextReaderPtr(n_reader, reader, 0);
30533        xmlResetLastError();
30534        if (mem_base != xmlMemBlocks()) {
30535            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30536	           xmlMemBlocks() - mem_base);
30537	    test_ret++;
30538            printf(" %d", n_reader);
30539            printf("\n");
30540        }
30541    }
30542    function_tests++;
30543#endif
30544
30545    return(test_ret);
30546}
30547
30548
30549static int
30550test_xmlTextReaderCurrentNode(void) {
30551    int test_ret = 0;
30552
30553#if defined(LIBXML_READER_ENABLED)
30554    int mem_base;
30555    xmlNodePtr ret_val;
30556    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30557    int n_reader;
30558
30559    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30560        mem_base = xmlMemBlocks();
30561        reader = gen_xmlTextReaderPtr(n_reader, 0);
30562
30563        ret_val = xmlTextReaderCurrentNode(reader);
30564        desret_xmlNodePtr(ret_val);
30565        call_tests++;
30566        des_xmlTextReaderPtr(n_reader, reader, 0);
30567        xmlResetLastError();
30568        if (mem_base != xmlMemBlocks()) {
30569            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30570	           xmlMemBlocks() - mem_base);
30571	    test_ret++;
30572            printf(" %d", n_reader);
30573            printf("\n");
30574        }
30575    }
30576    function_tests++;
30577#endif
30578
30579    return(test_ret);
30580}
30581
30582
30583static int
30584test_xmlTextReaderDepth(void) {
30585    int test_ret = 0;
30586
30587#if defined(LIBXML_READER_ENABLED)
30588    int mem_base;
30589    int ret_val;
30590    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30591    int n_reader;
30592
30593    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30594        mem_base = xmlMemBlocks();
30595        reader = gen_xmlTextReaderPtr(n_reader, 0);
30596
30597        ret_val = xmlTextReaderDepth(reader);
30598        desret_int(ret_val);
30599        call_tests++;
30600        des_xmlTextReaderPtr(n_reader, reader, 0);
30601        xmlResetLastError();
30602        if (mem_base != xmlMemBlocks()) {
30603            printf("Leak of %d blocks found in xmlTextReaderDepth",
30604	           xmlMemBlocks() - mem_base);
30605	    test_ret++;
30606            printf(" %d", n_reader);
30607            printf("\n");
30608        }
30609    }
30610    function_tests++;
30611#endif
30612
30613    return(test_ret);
30614}
30615
30616
30617static int
30618test_xmlTextReaderExpand(void) {
30619    int test_ret = 0;
30620
30621#if defined(LIBXML_READER_ENABLED)
30622    int mem_base;
30623    xmlNodePtr ret_val;
30624    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30625    int n_reader;
30626
30627    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30628        mem_base = xmlMemBlocks();
30629        reader = gen_xmlTextReaderPtr(n_reader, 0);
30630
30631        ret_val = xmlTextReaderExpand(reader);
30632        desret_xmlNodePtr(ret_val);
30633        call_tests++;
30634        des_xmlTextReaderPtr(n_reader, reader, 0);
30635        xmlResetLastError();
30636        if (mem_base != xmlMemBlocks()) {
30637            printf("Leak of %d blocks found in xmlTextReaderExpand",
30638	           xmlMemBlocks() - mem_base);
30639	    test_ret++;
30640            printf(" %d", n_reader);
30641            printf("\n");
30642        }
30643    }
30644    function_tests++;
30645#endif
30646
30647    return(test_ret);
30648}
30649
30650
30651static int
30652test_xmlTextReaderGetAttribute(void) {
30653    int test_ret = 0;
30654
30655#if defined(LIBXML_READER_ENABLED)
30656    int mem_base;
30657    xmlChar * ret_val;
30658    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30659    int n_reader;
30660    xmlChar * name; /* the qualified name of the attribute. */
30661    int n_name;
30662
30663    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30664    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30665        mem_base = xmlMemBlocks();
30666        reader = gen_xmlTextReaderPtr(n_reader, 0);
30667        name = gen_const_xmlChar_ptr(n_name, 1);
30668
30669        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30670        desret_xmlChar_ptr(ret_val);
30671        call_tests++;
30672        des_xmlTextReaderPtr(n_reader, reader, 0);
30673        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30674        xmlResetLastError();
30675        if (mem_base != xmlMemBlocks()) {
30676            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30677	           xmlMemBlocks() - mem_base);
30678	    test_ret++;
30679            printf(" %d", n_reader);
30680            printf(" %d", n_name);
30681            printf("\n");
30682        }
30683    }
30684    }
30685    function_tests++;
30686#endif
30687
30688    return(test_ret);
30689}
30690
30691
30692static int
30693test_xmlTextReaderGetAttributeNo(void) {
30694    int test_ret = 0;
30695
30696#if defined(LIBXML_READER_ENABLED)
30697    int mem_base;
30698    xmlChar * ret_val;
30699    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30700    int n_reader;
30701    int no; /* the zero-based index of the attribute relative to the containing element */
30702    int n_no;
30703
30704    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30705    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30706        mem_base = xmlMemBlocks();
30707        reader = gen_xmlTextReaderPtr(n_reader, 0);
30708        no = gen_int(n_no, 1);
30709
30710        ret_val = xmlTextReaderGetAttributeNo(reader, no);
30711        desret_xmlChar_ptr(ret_val);
30712        call_tests++;
30713        des_xmlTextReaderPtr(n_reader, reader, 0);
30714        des_int(n_no, no, 1);
30715        xmlResetLastError();
30716        if (mem_base != xmlMemBlocks()) {
30717            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30718	           xmlMemBlocks() - mem_base);
30719	    test_ret++;
30720            printf(" %d", n_reader);
30721            printf(" %d", n_no);
30722            printf("\n");
30723        }
30724    }
30725    }
30726    function_tests++;
30727#endif
30728
30729    return(test_ret);
30730}
30731
30732
30733static int
30734test_xmlTextReaderGetAttributeNs(void) {
30735    int test_ret = 0;
30736
30737#if defined(LIBXML_READER_ENABLED)
30738    int mem_base;
30739    xmlChar * ret_val;
30740    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30741    int n_reader;
30742    xmlChar * localName; /* the local name of the attribute. */
30743    int n_localName;
30744    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30745    int n_namespaceURI;
30746
30747    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30748    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30749    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30750        mem_base = xmlMemBlocks();
30751        reader = gen_xmlTextReaderPtr(n_reader, 0);
30752        localName = gen_const_xmlChar_ptr(n_localName, 1);
30753        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30754
30755        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30756        desret_xmlChar_ptr(ret_val);
30757        call_tests++;
30758        des_xmlTextReaderPtr(n_reader, reader, 0);
30759        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30760        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30761        xmlResetLastError();
30762        if (mem_base != xmlMemBlocks()) {
30763            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30764	           xmlMemBlocks() - mem_base);
30765	    test_ret++;
30766            printf(" %d", n_reader);
30767            printf(" %d", n_localName);
30768            printf(" %d", n_namespaceURI);
30769            printf("\n");
30770        }
30771    }
30772    }
30773    }
30774    function_tests++;
30775#endif
30776
30777    return(test_ret);
30778}
30779
30780#ifdef LIBXML_READER_ENABLED
30781
30782#define gen_nb_xmlTextReaderErrorFunc_ptr 1
30783static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30784    return(NULL);
30785}
30786static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30787}
30788#endif
30789
30790
30791static int
30792test_xmlTextReaderGetErrorHandler(void) {
30793    int test_ret = 0;
30794
30795#if defined(LIBXML_READER_ENABLED)
30796    int mem_base;
30797    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30798    int n_reader;
30799    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30800    int n_f;
30801    void ** arg; /* a user argument */
30802    int n_arg;
30803
30804    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30805    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30806    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30807        mem_base = xmlMemBlocks();
30808        reader = gen_xmlTextReaderPtr(n_reader, 0);
30809        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30810        arg = gen_void_ptr_ptr(n_arg, 2);
30811
30812        xmlTextReaderGetErrorHandler(reader, f, arg);
30813        call_tests++;
30814        des_xmlTextReaderPtr(n_reader, reader, 0);
30815        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30816        des_void_ptr_ptr(n_arg, arg, 2);
30817        xmlResetLastError();
30818        if (mem_base != xmlMemBlocks()) {
30819            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30820	           xmlMemBlocks() - mem_base);
30821	    test_ret++;
30822            printf(" %d", n_reader);
30823            printf(" %d", n_f);
30824            printf(" %d", n_arg);
30825            printf("\n");
30826        }
30827    }
30828    }
30829    }
30830    function_tests++;
30831#endif
30832
30833    return(test_ret);
30834}
30835
30836
30837static int
30838test_xmlTextReaderGetParserColumnNumber(void) {
30839    int test_ret = 0;
30840
30841#if defined(LIBXML_READER_ENABLED)
30842    int mem_base;
30843    int ret_val;
30844    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30845    int n_reader;
30846
30847    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30848        mem_base = xmlMemBlocks();
30849        reader = gen_xmlTextReaderPtr(n_reader, 0);
30850
30851        ret_val = xmlTextReaderGetParserColumnNumber(reader);
30852        desret_int(ret_val);
30853        call_tests++;
30854        des_xmlTextReaderPtr(n_reader, reader, 0);
30855        xmlResetLastError();
30856        if (mem_base != xmlMemBlocks()) {
30857            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
30858	           xmlMemBlocks() - mem_base);
30859	    test_ret++;
30860            printf(" %d", n_reader);
30861            printf("\n");
30862        }
30863    }
30864    function_tests++;
30865#endif
30866
30867    return(test_ret);
30868}
30869
30870
30871static int
30872test_xmlTextReaderGetParserLineNumber(void) {
30873    int test_ret = 0;
30874
30875#if defined(LIBXML_READER_ENABLED)
30876    int mem_base;
30877    int ret_val;
30878    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30879    int n_reader;
30880
30881    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30882        mem_base = xmlMemBlocks();
30883        reader = gen_xmlTextReaderPtr(n_reader, 0);
30884
30885        ret_val = xmlTextReaderGetParserLineNumber(reader);
30886        desret_int(ret_val);
30887        call_tests++;
30888        des_xmlTextReaderPtr(n_reader, reader, 0);
30889        xmlResetLastError();
30890        if (mem_base != xmlMemBlocks()) {
30891            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
30892	           xmlMemBlocks() - mem_base);
30893	    test_ret++;
30894            printf(" %d", n_reader);
30895            printf("\n");
30896        }
30897    }
30898    function_tests++;
30899#endif
30900
30901    return(test_ret);
30902}
30903
30904
30905static int
30906test_xmlTextReaderGetParserProp(void) {
30907    int test_ret = 0;
30908
30909#if defined(LIBXML_READER_ENABLED)
30910    int mem_base;
30911    int ret_val;
30912    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30913    int n_reader;
30914    int prop; /* the xmlParserProperties to get */
30915    int n_prop;
30916
30917    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30918    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30919        mem_base = xmlMemBlocks();
30920        reader = gen_xmlTextReaderPtr(n_reader, 0);
30921        prop = gen_int(n_prop, 1);
30922
30923        ret_val = xmlTextReaderGetParserProp(reader, prop);
30924        desret_int(ret_val);
30925        call_tests++;
30926        des_xmlTextReaderPtr(n_reader, reader, 0);
30927        des_int(n_prop, prop, 1);
30928        xmlResetLastError();
30929        if (mem_base != xmlMemBlocks()) {
30930            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
30931	           xmlMemBlocks() - mem_base);
30932	    test_ret++;
30933            printf(" %d", n_reader);
30934            printf(" %d", n_prop);
30935            printf("\n");
30936        }
30937    }
30938    }
30939    function_tests++;
30940#endif
30941
30942    return(test_ret);
30943}
30944
30945
30946static int
30947test_xmlTextReaderGetRemainder(void) {
30948    int test_ret = 0;
30949
30950#if defined(LIBXML_READER_ENABLED)
30951    int mem_base;
30952    xmlParserInputBufferPtr ret_val;
30953    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30954    int n_reader;
30955
30956    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30957        mem_base = xmlMemBlocks();
30958        reader = gen_xmlTextReaderPtr(n_reader, 0);
30959
30960        ret_val = xmlTextReaderGetRemainder(reader);
30961        desret_xmlParserInputBufferPtr(ret_val);
30962        call_tests++;
30963        des_xmlTextReaderPtr(n_reader, reader, 0);
30964        xmlResetLastError();
30965        if (mem_base != xmlMemBlocks()) {
30966            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30967	           xmlMemBlocks() - mem_base);
30968	    test_ret++;
30969            printf(" %d", n_reader);
30970            printf("\n");
30971        }
30972    }
30973    function_tests++;
30974#endif
30975
30976    return(test_ret);
30977}
30978
30979
30980static int
30981test_xmlTextReaderHasAttributes(void) {
30982    int test_ret = 0;
30983
30984#if defined(LIBXML_READER_ENABLED)
30985    int mem_base;
30986    int ret_val;
30987    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30988    int n_reader;
30989
30990    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30991        mem_base = xmlMemBlocks();
30992        reader = gen_xmlTextReaderPtr(n_reader, 0);
30993
30994        ret_val = xmlTextReaderHasAttributes(reader);
30995        desret_int(ret_val);
30996        call_tests++;
30997        des_xmlTextReaderPtr(n_reader, reader, 0);
30998        xmlResetLastError();
30999        if (mem_base != xmlMemBlocks()) {
31000            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31001	           xmlMemBlocks() - mem_base);
31002	    test_ret++;
31003            printf(" %d", n_reader);
31004            printf("\n");
31005        }
31006    }
31007    function_tests++;
31008#endif
31009
31010    return(test_ret);
31011}
31012
31013
31014static int
31015test_xmlTextReaderHasValue(void) {
31016    int test_ret = 0;
31017
31018#if defined(LIBXML_READER_ENABLED)
31019    int mem_base;
31020    int ret_val;
31021    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31022    int n_reader;
31023
31024    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31025        mem_base = xmlMemBlocks();
31026        reader = gen_xmlTextReaderPtr(n_reader, 0);
31027
31028        ret_val = xmlTextReaderHasValue(reader);
31029        desret_int(ret_val);
31030        call_tests++;
31031        des_xmlTextReaderPtr(n_reader, reader, 0);
31032        xmlResetLastError();
31033        if (mem_base != xmlMemBlocks()) {
31034            printf("Leak of %d blocks found in xmlTextReaderHasValue",
31035	           xmlMemBlocks() - mem_base);
31036	    test_ret++;
31037            printf(" %d", n_reader);
31038            printf("\n");
31039        }
31040    }
31041    function_tests++;
31042#endif
31043
31044    return(test_ret);
31045}
31046
31047
31048static int
31049test_xmlTextReaderIsDefault(void) {
31050    int test_ret = 0;
31051
31052#if defined(LIBXML_READER_ENABLED)
31053    int mem_base;
31054    int ret_val;
31055    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31056    int n_reader;
31057
31058    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31059        mem_base = xmlMemBlocks();
31060        reader = gen_xmlTextReaderPtr(n_reader, 0);
31061
31062        ret_val = xmlTextReaderIsDefault(reader);
31063        desret_int(ret_val);
31064        call_tests++;
31065        des_xmlTextReaderPtr(n_reader, reader, 0);
31066        xmlResetLastError();
31067        if (mem_base != xmlMemBlocks()) {
31068            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31069	           xmlMemBlocks() - mem_base);
31070	    test_ret++;
31071            printf(" %d", n_reader);
31072            printf("\n");
31073        }
31074    }
31075    function_tests++;
31076#endif
31077
31078    return(test_ret);
31079}
31080
31081
31082static int
31083test_xmlTextReaderIsEmptyElement(void) {
31084    int test_ret = 0;
31085
31086#if defined(LIBXML_READER_ENABLED)
31087    int mem_base;
31088    int ret_val;
31089    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31090    int n_reader;
31091
31092    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31093        mem_base = xmlMemBlocks();
31094        reader = gen_xmlTextReaderPtr(n_reader, 0);
31095
31096        ret_val = xmlTextReaderIsEmptyElement(reader);
31097        desret_int(ret_val);
31098        call_tests++;
31099        des_xmlTextReaderPtr(n_reader, reader, 0);
31100        xmlResetLastError();
31101        if (mem_base != xmlMemBlocks()) {
31102            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31103	           xmlMemBlocks() - mem_base);
31104	    test_ret++;
31105            printf(" %d", n_reader);
31106            printf("\n");
31107        }
31108    }
31109    function_tests++;
31110#endif
31111
31112    return(test_ret);
31113}
31114
31115
31116static int
31117test_xmlTextReaderIsNamespaceDecl(void) {
31118    int test_ret = 0;
31119
31120#if defined(LIBXML_READER_ENABLED)
31121    int mem_base;
31122    int ret_val;
31123    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31124    int n_reader;
31125
31126    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31127        mem_base = xmlMemBlocks();
31128        reader = gen_xmlTextReaderPtr(n_reader, 0);
31129
31130        ret_val = xmlTextReaderIsNamespaceDecl(reader);
31131        desret_int(ret_val);
31132        call_tests++;
31133        des_xmlTextReaderPtr(n_reader, reader, 0);
31134        xmlResetLastError();
31135        if (mem_base != xmlMemBlocks()) {
31136            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31137	           xmlMemBlocks() - mem_base);
31138	    test_ret++;
31139            printf(" %d", n_reader);
31140            printf("\n");
31141        }
31142    }
31143    function_tests++;
31144#endif
31145
31146    return(test_ret);
31147}
31148
31149
31150static int
31151test_xmlTextReaderIsValid(void) {
31152    int test_ret = 0;
31153
31154#if defined(LIBXML_READER_ENABLED)
31155    int mem_base;
31156    int ret_val;
31157    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31158    int n_reader;
31159
31160    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31161        mem_base = xmlMemBlocks();
31162        reader = gen_xmlTextReaderPtr(n_reader, 0);
31163
31164        ret_val = xmlTextReaderIsValid(reader);
31165        desret_int(ret_val);
31166        call_tests++;
31167        des_xmlTextReaderPtr(n_reader, reader, 0);
31168        xmlResetLastError();
31169        if (mem_base != xmlMemBlocks()) {
31170            printf("Leak of %d blocks found in xmlTextReaderIsValid",
31171	           xmlMemBlocks() - mem_base);
31172	    test_ret++;
31173            printf(" %d", n_reader);
31174            printf("\n");
31175        }
31176    }
31177    function_tests++;
31178#endif
31179
31180    return(test_ret);
31181}
31182
31183
31184static int
31185test_xmlTextReaderLocalName(void) {
31186    int test_ret = 0;
31187
31188#if defined(LIBXML_READER_ENABLED)
31189    int mem_base;
31190    xmlChar * ret_val;
31191    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31192    int n_reader;
31193
31194    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31195        mem_base = xmlMemBlocks();
31196        reader = gen_xmlTextReaderPtr(n_reader, 0);
31197
31198        ret_val = xmlTextReaderLocalName(reader);
31199        desret_xmlChar_ptr(ret_val);
31200        call_tests++;
31201        des_xmlTextReaderPtr(n_reader, reader, 0);
31202        xmlResetLastError();
31203        if (mem_base != xmlMemBlocks()) {
31204            printf("Leak of %d blocks found in xmlTextReaderLocalName",
31205	           xmlMemBlocks() - mem_base);
31206	    test_ret++;
31207            printf(" %d", n_reader);
31208            printf("\n");
31209        }
31210    }
31211    function_tests++;
31212#endif
31213
31214    return(test_ret);
31215}
31216
31217#ifdef LIBXML_READER_ENABLED
31218
31219#define gen_nb_xmlTextReaderLocatorPtr 1
31220static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31221    return(NULL);
31222}
31223static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31224}
31225#endif
31226
31227
31228static int
31229test_xmlTextReaderLocatorBaseURI(void) {
31230    int test_ret = 0;
31231
31232#if defined(LIBXML_READER_ENABLED)
31233    int mem_base;
31234    xmlChar * ret_val;
31235    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31236    int n_locator;
31237
31238    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31239        mem_base = xmlMemBlocks();
31240        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31241
31242        ret_val = xmlTextReaderLocatorBaseURI(locator);
31243        desret_xmlChar_ptr(ret_val);
31244        call_tests++;
31245        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31246        xmlResetLastError();
31247        if (mem_base != xmlMemBlocks()) {
31248            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31249	           xmlMemBlocks() - mem_base);
31250	    test_ret++;
31251            printf(" %d", n_locator);
31252            printf("\n");
31253        }
31254    }
31255    function_tests++;
31256#endif
31257
31258    return(test_ret);
31259}
31260
31261
31262static int
31263test_xmlTextReaderLocatorLineNumber(void) {
31264    int test_ret = 0;
31265
31266#if defined(LIBXML_READER_ENABLED)
31267    int mem_base;
31268    int ret_val;
31269    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31270    int n_locator;
31271
31272    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31273        mem_base = xmlMemBlocks();
31274        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31275
31276        ret_val = xmlTextReaderLocatorLineNumber(locator);
31277        desret_int(ret_val);
31278        call_tests++;
31279        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31280        xmlResetLastError();
31281        if (mem_base != xmlMemBlocks()) {
31282            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31283	           xmlMemBlocks() - mem_base);
31284	    test_ret++;
31285            printf(" %d", n_locator);
31286            printf("\n");
31287        }
31288    }
31289    function_tests++;
31290#endif
31291
31292    return(test_ret);
31293}
31294
31295
31296static int
31297test_xmlTextReaderLookupNamespace(void) {
31298    int test_ret = 0;
31299
31300#if defined(LIBXML_READER_ENABLED)
31301    int mem_base;
31302    xmlChar * ret_val;
31303    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31304    int n_reader;
31305    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31306    int n_prefix;
31307
31308    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31309    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31310        mem_base = xmlMemBlocks();
31311        reader = gen_xmlTextReaderPtr(n_reader, 0);
31312        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31313
31314        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31315        desret_xmlChar_ptr(ret_val);
31316        call_tests++;
31317        des_xmlTextReaderPtr(n_reader, reader, 0);
31318        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31319        xmlResetLastError();
31320        if (mem_base != xmlMemBlocks()) {
31321            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31322	           xmlMemBlocks() - mem_base);
31323	    test_ret++;
31324            printf(" %d", n_reader);
31325            printf(" %d", n_prefix);
31326            printf("\n");
31327        }
31328    }
31329    }
31330    function_tests++;
31331#endif
31332
31333    return(test_ret);
31334}
31335
31336
31337static int
31338test_xmlTextReaderMoveToAttribute(void) {
31339    int test_ret = 0;
31340
31341#if defined(LIBXML_READER_ENABLED)
31342    int mem_base;
31343    int ret_val;
31344    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31345    int n_reader;
31346    xmlChar * name; /* the qualified name of the attribute. */
31347    int n_name;
31348
31349    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31350    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31351        mem_base = xmlMemBlocks();
31352        reader = gen_xmlTextReaderPtr(n_reader, 0);
31353        name = gen_const_xmlChar_ptr(n_name, 1);
31354
31355        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31356        desret_int(ret_val);
31357        call_tests++;
31358        des_xmlTextReaderPtr(n_reader, reader, 0);
31359        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31360        xmlResetLastError();
31361        if (mem_base != xmlMemBlocks()) {
31362            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31363	           xmlMemBlocks() - mem_base);
31364	    test_ret++;
31365            printf(" %d", n_reader);
31366            printf(" %d", n_name);
31367            printf("\n");
31368        }
31369    }
31370    }
31371    function_tests++;
31372#endif
31373
31374    return(test_ret);
31375}
31376
31377
31378static int
31379test_xmlTextReaderMoveToAttributeNo(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    int no; /* the zero-based index of the attribute relative to the containing element. */
31388    int n_no;
31389
31390    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31391    for (n_no = 0;n_no < gen_nb_int;n_no++) {
31392        mem_base = xmlMemBlocks();
31393        reader = gen_xmlTextReaderPtr(n_reader, 0);
31394        no = gen_int(n_no, 1);
31395
31396        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31397        desret_int(ret_val);
31398        call_tests++;
31399        des_xmlTextReaderPtr(n_reader, reader, 0);
31400        des_int(n_no, no, 1);
31401        xmlResetLastError();
31402        if (mem_base != xmlMemBlocks()) {
31403            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31404	           xmlMemBlocks() - mem_base);
31405	    test_ret++;
31406            printf(" %d", n_reader);
31407            printf(" %d", n_no);
31408            printf("\n");
31409        }
31410    }
31411    }
31412    function_tests++;
31413#endif
31414
31415    return(test_ret);
31416}
31417
31418
31419static int
31420test_xmlTextReaderMoveToAttributeNs(void) {
31421    int test_ret = 0;
31422
31423#if defined(LIBXML_READER_ENABLED)
31424    int mem_base;
31425    int ret_val;
31426    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31427    int n_reader;
31428    xmlChar * localName; /* the local name of the attribute. */
31429    int n_localName;
31430    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31431    int n_namespaceURI;
31432
31433    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31434    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31435    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31436        mem_base = xmlMemBlocks();
31437        reader = gen_xmlTextReaderPtr(n_reader, 0);
31438        localName = gen_const_xmlChar_ptr(n_localName, 1);
31439        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31440
31441        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31442        desret_int(ret_val);
31443        call_tests++;
31444        des_xmlTextReaderPtr(n_reader, reader, 0);
31445        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31446        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31447        xmlResetLastError();
31448        if (mem_base != xmlMemBlocks()) {
31449            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31450	           xmlMemBlocks() - mem_base);
31451	    test_ret++;
31452            printf(" %d", n_reader);
31453            printf(" %d", n_localName);
31454            printf(" %d", n_namespaceURI);
31455            printf("\n");
31456        }
31457    }
31458    }
31459    }
31460    function_tests++;
31461#endif
31462
31463    return(test_ret);
31464}
31465
31466
31467static int
31468test_xmlTextReaderMoveToElement(void) {
31469    int test_ret = 0;
31470
31471#if defined(LIBXML_READER_ENABLED)
31472    int mem_base;
31473    int ret_val;
31474    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31475    int n_reader;
31476
31477    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31478        mem_base = xmlMemBlocks();
31479        reader = gen_xmlTextReaderPtr(n_reader, 0);
31480
31481        ret_val = xmlTextReaderMoveToElement(reader);
31482        desret_int(ret_val);
31483        call_tests++;
31484        des_xmlTextReaderPtr(n_reader, reader, 0);
31485        xmlResetLastError();
31486        if (mem_base != xmlMemBlocks()) {
31487            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31488	           xmlMemBlocks() - mem_base);
31489	    test_ret++;
31490            printf(" %d", n_reader);
31491            printf("\n");
31492        }
31493    }
31494    function_tests++;
31495#endif
31496
31497    return(test_ret);
31498}
31499
31500
31501static int
31502test_xmlTextReaderMoveToFirstAttribute(void) {
31503    int test_ret = 0;
31504
31505#if defined(LIBXML_READER_ENABLED)
31506    int mem_base;
31507    int ret_val;
31508    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31509    int n_reader;
31510
31511    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31512        mem_base = xmlMemBlocks();
31513        reader = gen_xmlTextReaderPtr(n_reader, 0);
31514
31515        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31516        desret_int(ret_val);
31517        call_tests++;
31518        des_xmlTextReaderPtr(n_reader, reader, 0);
31519        xmlResetLastError();
31520        if (mem_base != xmlMemBlocks()) {
31521            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31522	           xmlMemBlocks() - mem_base);
31523	    test_ret++;
31524            printf(" %d", n_reader);
31525            printf("\n");
31526        }
31527    }
31528    function_tests++;
31529#endif
31530
31531    return(test_ret);
31532}
31533
31534
31535static int
31536test_xmlTextReaderMoveToNextAttribute(void) {
31537    int test_ret = 0;
31538
31539#if defined(LIBXML_READER_ENABLED)
31540    int mem_base;
31541    int ret_val;
31542    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31543    int n_reader;
31544
31545    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31546        mem_base = xmlMemBlocks();
31547        reader = gen_xmlTextReaderPtr(n_reader, 0);
31548
31549        ret_val = xmlTextReaderMoveToNextAttribute(reader);
31550        desret_int(ret_val);
31551        call_tests++;
31552        des_xmlTextReaderPtr(n_reader, reader, 0);
31553        xmlResetLastError();
31554        if (mem_base != xmlMemBlocks()) {
31555            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31556	           xmlMemBlocks() - mem_base);
31557	    test_ret++;
31558            printf(" %d", n_reader);
31559            printf("\n");
31560        }
31561    }
31562    function_tests++;
31563#endif
31564
31565    return(test_ret);
31566}
31567
31568
31569static int
31570test_xmlTextReaderName(void) {
31571    int test_ret = 0;
31572
31573#if defined(LIBXML_READER_ENABLED)
31574    int mem_base;
31575    xmlChar * ret_val;
31576    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31577    int n_reader;
31578
31579    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31580        mem_base = xmlMemBlocks();
31581        reader = gen_xmlTextReaderPtr(n_reader, 0);
31582
31583        ret_val = xmlTextReaderName(reader);
31584        desret_xmlChar_ptr(ret_val);
31585        call_tests++;
31586        des_xmlTextReaderPtr(n_reader, reader, 0);
31587        xmlResetLastError();
31588        if (mem_base != xmlMemBlocks()) {
31589            printf("Leak of %d blocks found in xmlTextReaderName",
31590	           xmlMemBlocks() - mem_base);
31591	    test_ret++;
31592            printf(" %d", n_reader);
31593            printf("\n");
31594        }
31595    }
31596    function_tests++;
31597#endif
31598
31599    return(test_ret);
31600}
31601
31602
31603static int
31604test_xmlTextReaderNamespaceUri(void) {
31605    int test_ret = 0;
31606
31607#if defined(LIBXML_READER_ENABLED)
31608    int mem_base;
31609    xmlChar * ret_val;
31610    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31611    int n_reader;
31612
31613    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31614        mem_base = xmlMemBlocks();
31615        reader = gen_xmlTextReaderPtr(n_reader, 0);
31616
31617        ret_val = xmlTextReaderNamespaceUri(reader);
31618        desret_xmlChar_ptr(ret_val);
31619        call_tests++;
31620        des_xmlTextReaderPtr(n_reader, reader, 0);
31621        xmlResetLastError();
31622        if (mem_base != xmlMemBlocks()) {
31623            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31624	           xmlMemBlocks() - mem_base);
31625	    test_ret++;
31626            printf(" %d", n_reader);
31627            printf("\n");
31628        }
31629    }
31630    function_tests++;
31631#endif
31632
31633    return(test_ret);
31634}
31635
31636
31637static int
31638test_xmlTextReaderNext(void) {
31639    int test_ret = 0;
31640
31641#if defined(LIBXML_READER_ENABLED)
31642    int mem_base;
31643    int ret_val;
31644    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31645    int n_reader;
31646
31647    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31648        mem_base = xmlMemBlocks();
31649        reader = gen_xmlTextReaderPtr(n_reader, 0);
31650
31651        ret_val = xmlTextReaderNext(reader);
31652        desret_int(ret_val);
31653        call_tests++;
31654        des_xmlTextReaderPtr(n_reader, reader, 0);
31655        xmlResetLastError();
31656        if (mem_base != xmlMemBlocks()) {
31657            printf("Leak of %d blocks found in xmlTextReaderNext",
31658	           xmlMemBlocks() - mem_base);
31659	    test_ret++;
31660            printf(" %d", n_reader);
31661            printf("\n");
31662        }
31663    }
31664    function_tests++;
31665#endif
31666
31667    return(test_ret);
31668}
31669
31670
31671static int
31672test_xmlTextReaderNextSibling(void) {
31673    int test_ret = 0;
31674
31675#if defined(LIBXML_READER_ENABLED)
31676    int mem_base;
31677    int ret_val;
31678    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31679    int n_reader;
31680
31681    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31682        mem_base = xmlMemBlocks();
31683        reader = gen_xmlTextReaderPtr(n_reader, 0);
31684
31685        ret_val = xmlTextReaderNextSibling(reader);
31686        desret_int(ret_val);
31687        call_tests++;
31688        des_xmlTextReaderPtr(n_reader, reader, 0);
31689        xmlResetLastError();
31690        if (mem_base != xmlMemBlocks()) {
31691            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31692	           xmlMemBlocks() - mem_base);
31693	    test_ret++;
31694            printf(" %d", n_reader);
31695            printf("\n");
31696        }
31697    }
31698    function_tests++;
31699#endif
31700
31701    return(test_ret);
31702}
31703
31704
31705static int
31706test_xmlTextReaderNodeType(void) {
31707    int test_ret = 0;
31708
31709#if defined(LIBXML_READER_ENABLED)
31710    int mem_base;
31711    int ret_val;
31712    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31713    int n_reader;
31714
31715    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31716        mem_base = xmlMemBlocks();
31717        reader = gen_xmlTextReaderPtr(n_reader, 0);
31718
31719        ret_val = xmlTextReaderNodeType(reader);
31720        desret_int(ret_val);
31721        call_tests++;
31722        des_xmlTextReaderPtr(n_reader, reader, 0);
31723        xmlResetLastError();
31724        if (mem_base != xmlMemBlocks()) {
31725            printf("Leak of %d blocks found in xmlTextReaderNodeType",
31726	           xmlMemBlocks() - mem_base);
31727	    test_ret++;
31728            printf(" %d", n_reader);
31729            printf("\n");
31730        }
31731    }
31732    function_tests++;
31733#endif
31734
31735    return(test_ret);
31736}
31737
31738
31739static int
31740test_xmlTextReaderNormalization(void) {
31741    int test_ret = 0;
31742
31743#if defined(LIBXML_READER_ENABLED)
31744    int mem_base;
31745    int ret_val;
31746    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31747    int n_reader;
31748
31749    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31750        mem_base = xmlMemBlocks();
31751        reader = gen_xmlTextReaderPtr(n_reader, 0);
31752
31753        ret_val = xmlTextReaderNormalization(reader);
31754        desret_int(ret_val);
31755        call_tests++;
31756        des_xmlTextReaderPtr(n_reader, reader, 0);
31757        xmlResetLastError();
31758        if (mem_base != xmlMemBlocks()) {
31759            printf("Leak of %d blocks found in xmlTextReaderNormalization",
31760	           xmlMemBlocks() - mem_base);
31761	    test_ret++;
31762            printf(" %d", n_reader);
31763            printf("\n");
31764        }
31765    }
31766    function_tests++;
31767#endif
31768
31769    return(test_ret);
31770}
31771
31772
31773static int
31774test_xmlTextReaderPrefix(void) {
31775    int test_ret = 0;
31776
31777#if defined(LIBXML_READER_ENABLED)
31778    int mem_base;
31779    xmlChar * ret_val;
31780    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31781    int n_reader;
31782
31783    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31784        mem_base = xmlMemBlocks();
31785        reader = gen_xmlTextReaderPtr(n_reader, 0);
31786
31787        ret_val = xmlTextReaderPrefix(reader);
31788        desret_xmlChar_ptr(ret_val);
31789        call_tests++;
31790        des_xmlTextReaderPtr(n_reader, reader, 0);
31791        xmlResetLastError();
31792        if (mem_base != xmlMemBlocks()) {
31793            printf("Leak of %d blocks found in xmlTextReaderPrefix",
31794	           xmlMemBlocks() - mem_base);
31795	    test_ret++;
31796            printf(" %d", n_reader);
31797            printf("\n");
31798        }
31799    }
31800    function_tests++;
31801#endif
31802
31803    return(test_ret);
31804}
31805
31806
31807static int
31808test_xmlTextReaderPreserve(void) {
31809    int test_ret = 0;
31810
31811#if defined(LIBXML_READER_ENABLED)
31812    int mem_base;
31813    xmlNodePtr ret_val;
31814    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31815    int n_reader;
31816
31817    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31818        mem_base = xmlMemBlocks();
31819        reader = gen_xmlTextReaderPtr(n_reader, 0);
31820
31821        ret_val = xmlTextReaderPreserve(reader);
31822        desret_xmlNodePtr(ret_val);
31823        call_tests++;
31824        des_xmlTextReaderPtr(n_reader, reader, 0);
31825        xmlResetLastError();
31826        if (mem_base != xmlMemBlocks()) {
31827            printf("Leak of %d blocks found in xmlTextReaderPreserve",
31828	           xmlMemBlocks() - mem_base);
31829	    test_ret++;
31830            printf(" %d", n_reader);
31831            printf("\n");
31832        }
31833    }
31834    function_tests++;
31835#endif
31836
31837    return(test_ret);
31838}
31839
31840
31841static int
31842test_xmlTextReaderPreservePattern(void) {
31843    int test_ret = 0;
31844
31845#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
31846#ifdef LIBXML_PATTERN_ENABLED
31847    int mem_base;
31848    int ret_val;
31849    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31850    int n_reader;
31851    xmlChar * pattern; /* an XPath subset pattern */
31852    int n_pattern;
31853    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
31854    int n_namespaces;
31855
31856    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31857    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
31858    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
31859        mem_base = xmlMemBlocks();
31860        reader = gen_xmlTextReaderPtr(n_reader, 0);
31861        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
31862        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
31863
31864        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
31865        desret_int(ret_val);
31866        call_tests++;
31867        des_xmlTextReaderPtr(n_reader, reader, 0);
31868        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
31869        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
31870        xmlResetLastError();
31871        if (mem_base != xmlMemBlocks()) {
31872            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
31873	           xmlMemBlocks() - mem_base);
31874	    test_ret++;
31875            printf(" %d", n_reader);
31876            printf(" %d", n_pattern);
31877            printf(" %d", n_namespaces);
31878            printf("\n");
31879        }
31880    }
31881    }
31882    }
31883    function_tests++;
31884#endif
31885#endif
31886
31887    return(test_ret);
31888}
31889
31890
31891static int
31892test_xmlTextReaderQuoteChar(void) {
31893    int test_ret = 0;
31894
31895#if defined(LIBXML_READER_ENABLED)
31896    int mem_base;
31897    int ret_val;
31898    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31899    int n_reader;
31900
31901    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31902        mem_base = xmlMemBlocks();
31903        reader = gen_xmlTextReaderPtr(n_reader, 0);
31904
31905        ret_val = xmlTextReaderQuoteChar(reader);
31906        desret_int(ret_val);
31907        call_tests++;
31908        des_xmlTextReaderPtr(n_reader, reader, 0);
31909        xmlResetLastError();
31910        if (mem_base != xmlMemBlocks()) {
31911            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
31912	           xmlMemBlocks() - mem_base);
31913	    test_ret++;
31914            printf(" %d", n_reader);
31915            printf("\n");
31916        }
31917    }
31918    function_tests++;
31919#endif
31920
31921    return(test_ret);
31922}
31923
31924
31925static int
31926test_xmlTextReaderRead(void) {
31927    int test_ret = 0;
31928
31929#if defined(LIBXML_READER_ENABLED)
31930    int mem_base;
31931    int ret_val;
31932    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31933    int n_reader;
31934
31935    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31936        mem_base = xmlMemBlocks();
31937        reader = gen_xmlTextReaderPtr(n_reader, 0);
31938
31939        ret_val = xmlTextReaderRead(reader);
31940        desret_int(ret_val);
31941        call_tests++;
31942        des_xmlTextReaderPtr(n_reader, reader, 0);
31943        xmlResetLastError();
31944        if (mem_base != xmlMemBlocks()) {
31945            printf("Leak of %d blocks found in xmlTextReaderRead",
31946	           xmlMemBlocks() - mem_base);
31947	    test_ret++;
31948            printf(" %d", n_reader);
31949            printf("\n");
31950        }
31951    }
31952    function_tests++;
31953#endif
31954
31955    return(test_ret);
31956}
31957
31958
31959static int
31960test_xmlTextReaderReadAttributeValue(void) {
31961    int test_ret = 0;
31962
31963#if defined(LIBXML_READER_ENABLED)
31964    int mem_base;
31965    int ret_val;
31966    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31967    int n_reader;
31968
31969    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31970        mem_base = xmlMemBlocks();
31971        reader = gen_xmlTextReaderPtr(n_reader, 0);
31972
31973        ret_val = xmlTextReaderReadAttributeValue(reader);
31974        desret_int(ret_val);
31975        call_tests++;
31976        des_xmlTextReaderPtr(n_reader, reader, 0);
31977        xmlResetLastError();
31978        if (mem_base != xmlMemBlocks()) {
31979            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31980	           xmlMemBlocks() - mem_base);
31981	    test_ret++;
31982            printf(" %d", n_reader);
31983            printf("\n");
31984        }
31985    }
31986    function_tests++;
31987#endif
31988
31989    return(test_ret);
31990}
31991
31992
31993static int
31994test_xmlTextReaderReadState(void) {
31995    int test_ret = 0;
31996
31997#if defined(LIBXML_READER_ENABLED)
31998    int mem_base;
31999    int ret_val;
32000    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32001    int n_reader;
32002
32003    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32004        mem_base = xmlMemBlocks();
32005        reader = gen_xmlTextReaderPtr(n_reader, 0);
32006
32007        ret_val = xmlTextReaderReadState(reader);
32008        desret_int(ret_val);
32009        call_tests++;
32010        des_xmlTextReaderPtr(n_reader, reader, 0);
32011        xmlResetLastError();
32012        if (mem_base != xmlMemBlocks()) {
32013            printf("Leak of %d blocks found in xmlTextReaderReadState",
32014	           xmlMemBlocks() - mem_base);
32015	    test_ret++;
32016            printf(" %d", n_reader);
32017            printf("\n");
32018        }
32019    }
32020    function_tests++;
32021#endif
32022
32023    return(test_ret);
32024}
32025
32026
32027static int
32028test_xmlTextReaderRelaxNGSetSchema(void) {
32029    int test_ret = 0;
32030
32031#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32032    int mem_base;
32033    int ret_val;
32034    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32035    int n_reader;
32036    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32037    int n_schema;
32038
32039    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32040    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32041        mem_base = xmlMemBlocks();
32042        reader = gen_xmlTextReaderPtr(n_reader, 0);
32043        schema = gen_xmlRelaxNGPtr(n_schema, 1);
32044
32045        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32046        desret_int(ret_val);
32047        call_tests++;
32048        des_xmlTextReaderPtr(n_reader, reader, 0);
32049        des_xmlRelaxNGPtr(n_schema, schema, 1);
32050        xmlResetLastError();
32051        if (mem_base != xmlMemBlocks()) {
32052            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32053	           xmlMemBlocks() - mem_base);
32054	    test_ret++;
32055            printf(" %d", n_reader);
32056            printf(" %d", n_schema);
32057            printf("\n");
32058        }
32059    }
32060    }
32061    function_tests++;
32062#endif
32063
32064    return(test_ret);
32065}
32066
32067
32068static int
32069test_xmlTextReaderRelaxNGValidate(void) {
32070    int test_ret = 0;
32071
32072#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32073    int mem_base;
32074    int ret_val;
32075    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32076    int n_reader;
32077    char * rng; /* the path to a RelaxNG schema or NULL */
32078    int n_rng;
32079
32080    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32081    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32082        mem_base = xmlMemBlocks();
32083        reader = gen_xmlTextReaderPtr(n_reader, 0);
32084        rng = gen_const_char_ptr(n_rng, 1);
32085
32086        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32087        desret_int(ret_val);
32088        call_tests++;
32089        des_xmlTextReaderPtr(n_reader, reader, 0);
32090        des_const_char_ptr(n_rng, (const char *)rng, 1);
32091        xmlResetLastError();
32092        if (mem_base != xmlMemBlocks()) {
32093            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32094	           xmlMemBlocks() - mem_base);
32095	    test_ret++;
32096            printf(" %d", n_reader);
32097            printf(" %d", n_rng);
32098            printf("\n");
32099        }
32100    }
32101    }
32102    function_tests++;
32103#endif
32104
32105    return(test_ret);
32106}
32107
32108
32109static int
32110test_xmlTextReaderSchemaValidate(void) {
32111    int test_ret = 0;
32112
32113#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32114    int ret_val;
32115    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32116    int n_reader;
32117    char * xsd; /* the path to a W3C XSD schema or NULL */
32118    int n_xsd;
32119
32120    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32121    for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32122        reader = gen_xmlTextReaderPtr(n_reader, 0);
32123        xsd = gen_const_char_ptr(n_xsd, 1);
32124
32125        ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32126        desret_int(ret_val);
32127        call_tests++;
32128        des_xmlTextReaderPtr(n_reader, reader, 0);
32129        des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32130        xmlResetLastError();
32131    }
32132    }
32133    function_tests++;
32134#endif
32135
32136    return(test_ret);
32137}
32138
32139
32140static int
32141test_xmlTextReaderSchemaValidateCtxt(void) {
32142    int test_ret = 0;
32143
32144#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32145    int mem_base;
32146    int ret_val;
32147    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32148    int n_reader;
32149    xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32150    int n_ctxt;
32151    int options; /* options (not used yet) */
32152    int n_options;
32153
32154    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32155    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32156    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32157        mem_base = xmlMemBlocks();
32158        reader = gen_xmlTextReaderPtr(n_reader, 0);
32159        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32160        options = gen_parseroptions(n_options, 2);
32161
32162        ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32163        desret_int(ret_val);
32164        call_tests++;
32165        des_xmlTextReaderPtr(n_reader, reader, 0);
32166        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32167        des_parseroptions(n_options, options, 2);
32168        xmlResetLastError();
32169        if (mem_base != xmlMemBlocks()) {
32170            printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32171	           xmlMemBlocks() - mem_base);
32172	    test_ret++;
32173            printf(" %d", n_reader);
32174            printf(" %d", n_ctxt);
32175            printf(" %d", n_options);
32176            printf("\n");
32177        }
32178    }
32179    }
32180    }
32181    function_tests++;
32182#endif
32183
32184    return(test_ret);
32185}
32186
32187
32188static int
32189test_xmlTextReaderSetErrorHandler(void) {
32190    int test_ret = 0;
32191
32192
32193    /* missing type support */
32194    return(test_ret);
32195}
32196
32197
32198static int
32199test_xmlTextReaderSetParserProp(void) {
32200    int test_ret = 0;
32201
32202#if defined(LIBXML_READER_ENABLED)
32203    int mem_base;
32204    int ret_val;
32205    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32206    int n_reader;
32207    int prop; /* the xmlParserProperties to set */
32208    int n_prop;
32209    int value; /* usually 0 or 1 to (de)activate it */
32210    int n_value;
32211
32212    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32213    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32214    for (n_value = 0;n_value < gen_nb_int;n_value++) {
32215        mem_base = xmlMemBlocks();
32216        reader = gen_xmlTextReaderPtr(n_reader, 0);
32217        prop = gen_int(n_prop, 1);
32218        value = gen_int(n_value, 2);
32219
32220        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32221        desret_int(ret_val);
32222        call_tests++;
32223        des_xmlTextReaderPtr(n_reader, reader, 0);
32224        des_int(n_prop, prop, 1);
32225        des_int(n_value, value, 2);
32226        xmlResetLastError();
32227        if (mem_base != xmlMemBlocks()) {
32228            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32229	           xmlMemBlocks() - mem_base);
32230	    test_ret++;
32231            printf(" %d", n_reader);
32232            printf(" %d", n_prop);
32233            printf(" %d", n_value);
32234            printf("\n");
32235        }
32236    }
32237    }
32238    }
32239    function_tests++;
32240#endif
32241
32242    return(test_ret);
32243}
32244
32245
32246static int
32247test_xmlTextReaderSetSchema(void) {
32248    int test_ret = 0;
32249
32250#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32251    int mem_base;
32252    int ret_val;
32253    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32254    int n_reader;
32255    xmlSchemaPtr schema; /* a precompiled Schema schema */
32256    int n_schema;
32257
32258    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32259    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32260        mem_base = xmlMemBlocks();
32261        reader = gen_xmlTextReaderPtr(n_reader, 0);
32262        schema = gen_xmlSchemaPtr(n_schema, 1);
32263
32264        ret_val = xmlTextReaderSetSchema(reader, schema);
32265        desret_int(ret_val);
32266        call_tests++;
32267        des_xmlTextReaderPtr(n_reader, reader, 0);
32268        des_xmlSchemaPtr(n_schema, schema, 1);
32269        xmlResetLastError();
32270        if (mem_base != xmlMemBlocks()) {
32271            printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32272	           xmlMemBlocks() - mem_base);
32273	    test_ret++;
32274            printf(" %d", n_reader);
32275            printf(" %d", n_schema);
32276            printf("\n");
32277        }
32278    }
32279    }
32280    function_tests++;
32281#endif
32282
32283    return(test_ret);
32284}
32285
32286
32287static int
32288test_xmlTextReaderSetStructuredErrorHandler(void) {
32289    int test_ret = 0;
32290
32291
32292    /* missing type support */
32293    return(test_ret);
32294}
32295
32296
32297static int
32298test_xmlTextReaderSetup(void) {
32299    int test_ret = 0;
32300
32301#if defined(LIBXML_READER_ENABLED)
32302    int mem_base;
32303    int ret_val;
32304    xmlTextReaderPtr reader; /* an XML reader */
32305    int n_reader;
32306    xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32307    int n_input;
32308    const char * URL; /* the base URL to use for the document */
32309    int n_URL;
32310    char * encoding; /* the document encoding, or NULL */
32311    int n_encoding;
32312    int options; /* a combination of xmlParserOption */
32313    int n_options;
32314
32315    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32316    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32317    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32318    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32319    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32320        mem_base = xmlMemBlocks();
32321        reader = gen_xmlTextReaderPtr(n_reader, 0);
32322        input = gen_xmlParserInputBufferPtr(n_input, 1);
32323        URL = gen_filepath(n_URL, 2);
32324        encoding = gen_const_char_ptr(n_encoding, 3);
32325        options = gen_parseroptions(n_options, 4);
32326
32327        ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32328        desret_int(ret_val);
32329        call_tests++;
32330        des_xmlTextReaderPtr(n_reader, reader, 0);
32331        des_filepath(n_URL, URL, 2);
32332        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32333        des_parseroptions(n_options, options, 4);
32334        xmlResetLastError();
32335        if (mem_base != xmlMemBlocks()) {
32336            printf("Leak of %d blocks found in xmlTextReaderSetup",
32337	           xmlMemBlocks() - mem_base);
32338	    test_ret++;
32339            printf(" %d", n_reader);
32340            printf(" %d", n_input);
32341            printf(" %d", n_URL);
32342            printf(" %d", n_encoding);
32343            printf(" %d", n_options);
32344            printf("\n");
32345        }
32346    }
32347    }
32348    }
32349    }
32350    }
32351    function_tests++;
32352#endif
32353
32354    return(test_ret);
32355}
32356
32357
32358static int
32359test_xmlTextReaderStandalone(void) {
32360    int test_ret = 0;
32361
32362#if defined(LIBXML_READER_ENABLED)
32363    int mem_base;
32364    int ret_val;
32365    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32366    int n_reader;
32367
32368    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32369        mem_base = xmlMemBlocks();
32370        reader = gen_xmlTextReaderPtr(n_reader, 0);
32371
32372        ret_val = xmlTextReaderStandalone(reader);
32373        desret_int(ret_val);
32374        call_tests++;
32375        des_xmlTextReaderPtr(n_reader, reader, 0);
32376        xmlResetLastError();
32377        if (mem_base != xmlMemBlocks()) {
32378            printf("Leak of %d blocks found in xmlTextReaderStandalone",
32379	           xmlMemBlocks() - mem_base);
32380	    test_ret++;
32381            printf(" %d", n_reader);
32382            printf("\n");
32383        }
32384    }
32385    function_tests++;
32386#endif
32387
32388    return(test_ret);
32389}
32390
32391
32392static int
32393test_xmlTextReaderValue(void) {
32394    int test_ret = 0;
32395
32396#if defined(LIBXML_READER_ENABLED)
32397    int mem_base;
32398    xmlChar * ret_val;
32399    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32400    int n_reader;
32401
32402    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32403        mem_base = xmlMemBlocks();
32404        reader = gen_xmlTextReaderPtr(n_reader, 0);
32405
32406        ret_val = xmlTextReaderValue(reader);
32407        desret_xmlChar_ptr(ret_val);
32408        call_tests++;
32409        des_xmlTextReaderPtr(n_reader, reader, 0);
32410        xmlResetLastError();
32411        if (mem_base != xmlMemBlocks()) {
32412            printf("Leak of %d blocks found in xmlTextReaderValue",
32413	           xmlMemBlocks() - mem_base);
32414	    test_ret++;
32415            printf(" %d", n_reader);
32416            printf("\n");
32417        }
32418    }
32419    function_tests++;
32420#endif
32421
32422    return(test_ret);
32423}
32424
32425
32426static int
32427test_xmlTextReaderXmlLang(void) {
32428    int test_ret = 0;
32429
32430#if defined(LIBXML_READER_ENABLED)
32431    int mem_base;
32432    xmlChar * ret_val;
32433    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32434    int n_reader;
32435
32436    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32437        mem_base = xmlMemBlocks();
32438        reader = gen_xmlTextReaderPtr(n_reader, 0);
32439
32440        ret_val = xmlTextReaderXmlLang(reader);
32441        desret_xmlChar_ptr(ret_val);
32442        call_tests++;
32443        des_xmlTextReaderPtr(n_reader, reader, 0);
32444        xmlResetLastError();
32445        if (mem_base != xmlMemBlocks()) {
32446            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32447	           xmlMemBlocks() - mem_base);
32448	    test_ret++;
32449            printf(" %d", n_reader);
32450            printf("\n");
32451        }
32452    }
32453    function_tests++;
32454#endif
32455
32456    return(test_ret);
32457}
32458
32459static int
32460test_xmlreader(void) {
32461    int test_ret = 0;
32462
32463    if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n");
32464    test_ret += test_xmlNewTextReader();
32465    test_ret += test_xmlNewTextReaderFilename();
32466    test_ret += test_xmlReaderForDoc();
32467    test_ret += test_xmlReaderForFile();
32468    test_ret += test_xmlReaderForMemory();
32469    test_ret += test_xmlReaderNewDoc();
32470    test_ret += test_xmlReaderNewFile();
32471    test_ret += test_xmlReaderNewMemory();
32472    test_ret += test_xmlReaderNewWalker();
32473    test_ret += test_xmlReaderWalker();
32474    test_ret += test_xmlTextReaderAttributeCount();
32475    test_ret += test_xmlTextReaderBaseUri();
32476    test_ret += test_xmlTextReaderByteConsumed();
32477    test_ret += test_xmlTextReaderClose();
32478    test_ret += test_xmlTextReaderConstBaseUri();
32479    test_ret += test_xmlTextReaderConstEncoding();
32480    test_ret += test_xmlTextReaderConstLocalName();
32481    test_ret += test_xmlTextReaderConstName();
32482    test_ret += test_xmlTextReaderConstNamespaceUri();
32483    test_ret += test_xmlTextReaderConstPrefix();
32484    test_ret += test_xmlTextReaderConstString();
32485    test_ret += test_xmlTextReaderConstValue();
32486    test_ret += test_xmlTextReaderConstXmlLang();
32487    test_ret += test_xmlTextReaderConstXmlVersion();
32488    test_ret += test_xmlTextReaderCurrentDoc();
32489    test_ret += test_xmlTextReaderCurrentNode();
32490    test_ret += test_xmlTextReaderDepth();
32491    test_ret += test_xmlTextReaderExpand();
32492    test_ret += test_xmlTextReaderGetAttribute();
32493    test_ret += test_xmlTextReaderGetAttributeNo();
32494    test_ret += test_xmlTextReaderGetAttributeNs();
32495    test_ret += test_xmlTextReaderGetErrorHandler();
32496    test_ret += test_xmlTextReaderGetParserColumnNumber();
32497    test_ret += test_xmlTextReaderGetParserLineNumber();
32498    test_ret += test_xmlTextReaderGetParserProp();
32499    test_ret += test_xmlTextReaderGetRemainder();
32500    test_ret += test_xmlTextReaderHasAttributes();
32501    test_ret += test_xmlTextReaderHasValue();
32502    test_ret += test_xmlTextReaderIsDefault();
32503    test_ret += test_xmlTextReaderIsEmptyElement();
32504    test_ret += test_xmlTextReaderIsNamespaceDecl();
32505    test_ret += test_xmlTextReaderIsValid();
32506    test_ret += test_xmlTextReaderLocalName();
32507    test_ret += test_xmlTextReaderLocatorBaseURI();
32508    test_ret += test_xmlTextReaderLocatorLineNumber();
32509    test_ret += test_xmlTextReaderLookupNamespace();
32510    test_ret += test_xmlTextReaderMoveToAttribute();
32511    test_ret += test_xmlTextReaderMoveToAttributeNo();
32512    test_ret += test_xmlTextReaderMoveToAttributeNs();
32513    test_ret += test_xmlTextReaderMoveToElement();
32514    test_ret += test_xmlTextReaderMoveToFirstAttribute();
32515    test_ret += test_xmlTextReaderMoveToNextAttribute();
32516    test_ret += test_xmlTextReaderName();
32517    test_ret += test_xmlTextReaderNamespaceUri();
32518    test_ret += test_xmlTextReaderNext();
32519    test_ret += test_xmlTextReaderNextSibling();
32520    test_ret += test_xmlTextReaderNodeType();
32521    test_ret += test_xmlTextReaderNormalization();
32522    test_ret += test_xmlTextReaderPrefix();
32523    test_ret += test_xmlTextReaderPreserve();
32524    test_ret += test_xmlTextReaderPreservePattern();
32525    test_ret += test_xmlTextReaderQuoteChar();
32526    test_ret += test_xmlTextReaderRead();
32527    test_ret += test_xmlTextReaderReadAttributeValue();
32528    test_ret += test_xmlTextReaderReadState();
32529    test_ret += test_xmlTextReaderRelaxNGSetSchema();
32530    test_ret += test_xmlTextReaderRelaxNGValidate();
32531    test_ret += test_xmlTextReaderSchemaValidate();
32532    test_ret += test_xmlTextReaderSchemaValidateCtxt();
32533    test_ret += test_xmlTextReaderSetErrorHandler();
32534    test_ret += test_xmlTextReaderSetParserProp();
32535    test_ret += test_xmlTextReaderSetSchema();
32536    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32537    test_ret += test_xmlTextReaderSetup();
32538    test_ret += test_xmlTextReaderStandalone();
32539    test_ret += test_xmlTextReaderValue();
32540    test_ret += test_xmlTextReaderXmlLang();
32541
32542    if (test_ret != 0)
32543	printf("Module xmlreader: %d errors\n", test_ret);
32544    return(test_ret);
32545}
32546
32547static int
32548test_xmlExpCtxtNbCons(void) {
32549    int test_ret = 0;
32550
32551#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32552    int mem_base;
32553    int ret_val;
32554    xmlExpCtxtPtr ctxt; /* an expression context */
32555    int n_ctxt;
32556
32557    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32558        mem_base = xmlMemBlocks();
32559        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32560
32561        ret_val = xmlExpCtxtNbCons(ctxt);
32562        desret_int(ret_val);
32563        call_tests++;
32564        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32565        xmlResetLastError();
32566        if (mem_base != xmlMemBlocks()) {
32567            printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32568	           xmlMemBlocks() - mem_base);
32569	    test_ret++;
32570            printf(" %d", n_ctxt);
32571            printf("\n");
32572        }
32573    }
32574    function_tests++;
32575#endif
32576
32577    return(test_ret);
32578}
32579
32580
32581static int
32582test_xmlExpCtxtNbNodes(void) {
32583    int test_ret = 0;
32584
32585#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32586    int mem_base;
32587    int ret_val;
32588    xmlExpCtxtPtr ctxt; /* an expression context */
32589    int n_ctxt;
32590
32591    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32592        mem_base = xmlMemBlocks();
32593        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32594
32595        ret_val = xmlExpCtxtNbNodes(ctxt);
32596        desret_int(ret_val);
32597        call_tests++;
32598        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32599        xmlResetLastError();
32600        if (mem_base != xmlMemBlocks()) {
32601            printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32602	           xmlMemBlocks() - mem_base);
32603	    test_ret++;
32604            printf(" %d", n_ctxt);
32605            printf("\n");
32606        }
32607    }
32608    function_tests++;
32609#endif
32610
32611    return(test_ret);
32612}
32613
32614
32615static int
32616test_xmlExpDump(void) {
32617    int test_ret = 0;
32618
32619#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32620    int mem_base;
32621    xmlBufferPtr buf; /* a buffer to receive the output */
32622    int n_buf;
32623    xmlExpNodePtr expr; /* the compiled expression */
32624    int n_expr;
32625
32626    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32627    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32628        mem_base = xmlMemBlocks();
32629        buf = gen_xmlBufferPtr(n_buf, 0);
32630        expr = gen_xmlExpNodePtr(n_expr, 1);
32631
32632        xmlExpDump(buf, expr);
32633        call_tests++;
32634        des_xmlBufferPtr(n_buf, buf, 0);
32635        des_xmlExpNodePtr(n_expr, expr, 1);
32636        xmlResetLastError();
32637        if (mem_base != xmlMemBlocks()) {
32638            printf("Leak of %d blocks found in xmlExpDump",
32639	           xmlMemBlocks() - mem_base);
32640	    test_ret++;
32641            printf(" %d", n_buf);
32642            printf(" %d", n_expr);
32643            printf("\n");
32644        }
32645    }
32646    }
32647    function_tests++;
32648#endif
32649
32650    return(test_ret);
32651}
32652
32653
32654static int
32655test_xmlExpExpDerive(void) {
32656    int test_ret = 0;
32657
32658
32659    /* missing type support */
32660    return(test_ret);
32661}
32662
32663
32664static int
32665test_xmlExpGetLanguage(void) {
32666    int test_ret = 0;
32667
32668#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32669    int mem_base;
32670    int ret_val;
32671    xmlExpCtxtPtr ctxt; /* the expression context */
32672    int n_ctxt;
32673    xmlExpNodePtr exp; /* the expression */
32674    int n_exp;
32675    xmlChar ** langList; /* where to store the tokens */
32676    int n_langList;
32677    int len; /* the allocated lenght of @list */
32678    int n_len;
32679
32680    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32681    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32682    for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32683    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32684        mem_base = xmlMemBlocks();
32685        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32686        exp = gen_xmlExpNodePtr(n_exp, 1);
32687        langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32688        len = gen_int(n_len, 3);
32689
32690        ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32691        desret_int(ret_val);
32692        call_tests++;
32693        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32694        des_xmlExpNodePtr(n_exp, exp, 1);
32695        des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32696        des_int(n_len, len, 3);
32697        xmlResetLastError();
32698        if (mem_base != xmlMemBlocks()) {
32699            printf("Leak of %d blocks found in xmlExpGetLanguage",
32700	           xmlMemBlocks() - mem_base);
32701	    test_ret++;
32702            printf(" %d", n_ctxt);
32703            printf(" %d", n_exp);
32704            printf(" %d", n_langList);
32705            printf(" %d", n_len);
32706            printf("\n");
32707        }
32708    }
32709    }
32710    }
32711    }
32712    function_tests++;
32713#endif
32714
32715    return(test_ret);
32716}
32717
32718
32719static int
32720test_xmlExpGetStart(void) {
32721    int test_ret = 0;
32722
32723#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32724    int mem_base;
32725    int ret_val;
32726    xmlExpCtxtPtr ctxt; /* the expression context */
32727    int n_ctxt;
32728    xmlExpNodePtr exp; /* the expression */
32729    int n_exp;
32730    xmlChar ** tokList; /* where to store the tokens */
32731    int n_tokList;
32732    int len; /* the allocated lenght of @list */
32733    int n_len;
32734
32735    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32736    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32737    for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32738    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32739        mem_base = xmlMemBlocks();
32740        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32741        exp = gen_xmlExpNodePtr(n_exp, 1);
32742        tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32743        len = gen_int(n_len, 3);
32744
32745        ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32746        desret_int(ret_val);
32747        call_tests++;
32748        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32749        des_xmlExpNodePtr(n_exp, exp, 1);
32750        des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32751        des_int(n_len, len, 3);
32752        xmlResetLastError();
32753        if (mem_base != xmlMemBlocks()) {
32754            printf("Leak of %d blocks found in xmlExpGetStart",
32755	           xmlMemBlocks() - mem_base);
32756	    test_ret++;
32757            printf(" %d", n_ctxt);
32758            printf(" %d", n_exp);
32759            printf(" %d", n_tokList);
32760            printf(" %d", n_len);
32761            printf("\n");
32762        }
32763    }
32764    }
32765    }
32766    }
32767    function_tests++;
32768#endif
32769
32770    return(test_ret);
32771}
32772
32773
32774static int
32775test_xmlExpIsNillable(void) {
32776    int test_ret = 0;
32777
32778#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32779    int mem_base;
32780    int ret_val;
32781    xmlExpNodePtr exp; /* the expression */
32782    int n_exp;
32783
32784    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32785        mem_base = xmlMemBlocks();
32786        exp = gen_xmlExpNodePtr(n_exp, 0);
32787
32788        ret_val = xmlExpIsNillable(exp);
32789        desret_int(ret_val);
32790        call_tests++;
32791        des_xmlExpNodePtr(n_exp, exp, 0);
32792        xmlResetLastError();
32793        if (mem_base != xmlMemBlocks()) {
32794            printf("Leak of %d blocks found in xmlExpIsNillable",
32795	           xmlMemBlocks() - mem_base);
32796	    test_ret++;
32797            printf(" %d", n_exp);
32798            printf("\n");
32799        }
32800    }
32801    function_tests++;
32802#endif
32803
32804    return(test_ret);
32805}
32806
32807
32808static int
32809test_xmlExpMaxToken(void) {
32810    int test_ret = 0;
32811
32812#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32813    int mem_base;
32814    int ret_val;
32815    xmlExpNodePtr expr; /* a compiled expression */
32816    int n_expr;
32817
32818    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32819        mem_base = xmlMemBlocks();
32820        expr = gen_xmlExpNodePtr(n_expr, 0);
32821
32822        ret_val = xmlExpMaxToken(expr);
32823        desret_int(ret_val);
32824        call_tests++;
32825        des_xmlExpNodePtr(n_expr, expr, 0);
32826        xmlResetLastError();
32827        if (mem_base != xmlMemBlocks()) {
32828            printf("Leak of %d blocks found in xmlExpMaxToken",
32829	           xmlMemBlocks() - mem_base);
32830	    test_ret++;
32831            printf(" %d", n_expr);
32832            printf("\n");
32833        }
32834    }
32835    function_tests++;
32836#endif
32837
32838    return(test_ret);
32839}
32840
32841
32842static int
32843test_xmlExpNewAtom(void) {
32844    int test_ret = 0;
32845
32846
32847    /* missing type support */
32848    return(test_ret);
32849}
32850
32851
32852static int
32853test_xmlExpNewCtxt(void) {
32854    int test_ret = 0;
32855
32856
32857    /* missing type support */
32858    return(test_ret);
32859}
32860
32861
32862static int
32863test_xmlExpNewOr(void) {
32864    int test_ret = 0;
32865
32866
32867    /* missing type support */
32868    return(test_ret);
32869}
32870
32871
32872static int
32873test_xmlExpNewRange(void) {
32874    int test_ret = 0;
32875
32876
32877    /* missing type support */
32878    return(test_ret);
32879}
32880
32881
32882static int
32883test_xmlExpNewSeq(void) {
32884    int test_ret = 0;
32885
32886
32887    /* missing type support */
32888    return(test_ret);
32889}
32890
32891
32892static int
32893test_xmlExpParse(void) {
32894    int test_ret = 0;
32895
32896
32897    /* missing type support */
32898    return(test_ret);
32899}
32900
32901
32902static int
32903test_xmlExpRef(void) {
32904    int test_ret = 0;
32905
32906#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32907    int mem_base;
32908    xmlExpNodePtr exp; /* the expression */
32909    int n_exp;
32910
32911    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32912        mem_base = xmlMemBlocks();
32913        exp = gen_xmlExpNodePtr(n_exp, 0);
32914
32915        xmlExpRef(exp);
32916        call_tests++;
32917        des_xmlExpNodePtr(n_exp, exp, 0);
32918        xmlResetLastError();
32919        if (mem_base != xmlMemBlocks()) {
32920            printf("Leak of %d blocks found in xmlExpRef",
32921	           xmlMemBlocks() - mem_base);
32922	    test_ret++;
32923            printf(" %d", n_exp);
32924            printf("\n");
32925        }
32926    }
32927    function_tests++;
32928#endif
32929
32930    return(test_ret);
32931}
32932
32933
32934static int
32935test_xmlExpStringDerive(void) {
32936    int test_ret = 0;
32937
32938
32939    /* missing type support */
32940    return(test_ret);
32941}
32942
32943
32944static int
32945test_xmlExpSubsume(void) {
32946    int test_ret = 0;
32947
32948#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32949    int mem_base;
32950    int ret_val;
32951    xmlExpCtxtPtr ctxt; /* the expressions context */
32952    int n_ctxt;
32953    xmlExpNodePtr exp; /* the englobing expression */
32954    int n_exp;
32955    xmlExpNodePtr sub; /* the subexpression */
32956    int n_sub;
32957
32958    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32959    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32960    for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
32961        mem_base = xmlMemBlocks();
32962        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32963        exp = gen_xmlExpNodePtr(n_exp, 1);
32964        sub = gen_xmlExpNodePtr(n_sub, 2);
32965
32966        ret_val = xmlExpSubsume(ctxt, exp, sub);
32967        desret_int(ret_val);
32968        call_tests++;
32969        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32970        des_xmlExpNodePtr(n_exp, exp, 1);
32971        des_xmlExpNodePtr(n_sub, sub, 2);
32972        xmlResetLastError();
32973        if (mem_base != xmlMemBlocks()) {
32974            printf("Leak of %d blocks found in xmlExpSubsume",
32975	           xmlMemBlocks() - mem_base);
32976	    test_ret++;
32977            printf(" %d", n_ctxt);
32978            printf(" %d", n_exp);
32979            printf(" %d", n_sub);
32980            printf("\n");
32981        }
32982    }
32983    }
32984    }
32985    function_tests++;
32986#endif
32987
32988    return(test_ret);
32989}
32990
32991#ifdef LIBXML_REGEXP_ENABLED
32992
32993#define gen_nb_xmlRegExecCtxtPtr 1
32994static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32995    return(NULL);
32996}
32997static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32998}
32999#endif
33000
33001
33002static int
33003test_xmlRegExecErrInfo(void) {
33004    int test_ret = 0;
33005
33006#if defined(LIBXML_REGEXP_ENABLED)
33007    int mem_base;
33008    int ret_val;
33009    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33010    int n_exec;
33011    xmlChar ** string; /* return value for the error string */
33012    int n_string;
33013    int * nbval; /* pointer to the number of accepted values IN/OUT */
33014    int n_nbval;
33015    int * nbneg; /* return number of negative transitions */
33016    int n_nbneg;
33017    xmlChar ** values; /* pointer to the array of acceptable values */
33018    int n_values;
33019    int * terminal; /* return value if this was a terminal state */
33020    int n_terminal;
33021
33022    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33023    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33024    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33025    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33026    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33027    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33028        mem_base = xmlMemBlocks();
33029        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33030        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33031        nbval = gen_int_ptr(n_nbval, 2);
33032        nbneg = gen_int_ptr(n_nbneg, 3);
33033        values = gen_xmlChar_ptr_ptr(n_values, 4);
33034        terminal = gen_int_ptr(n_terminal, 5);
33035
33036        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33037        desret_int(ret_val);
33038        call_tests++;
33039        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33040        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33041        des_int_ptr(n_nbval, nbval, 2);
33042        des_int_ptr(n_nbneg, nbneg, 3);
33043        des_xmlChar_ptr_ptr(n_values, values, 4);
33044        des_int_ptr(n_terminal, terminal, 5);
33045        xmlResetLastError();
33046        if (mem_base != xmlMemBlocks()) {
33047            printf("Leak of %d blocks found in xmlRegExecErrInfo",
33048	           xmlMemBlocks() - mem_base);
33049	    test_ret++;
33050            printf(" %d", n_exec);
33051            printf(" %d", n_string);
33052            printf(" %d", n_nbval);
33053            printf(" %d", n_nbneg);
33054            printf(" %d", n_values);
33055            printf(" %d", n_terminal);
33056            printf("\n");
33057        }
33058    }
33059    }
33060    }
33061    }
33062    }
33063    }
33064    function_tests++;
33065#endif
33066
33067    return(test_ret);
33068}
33069
33070
33071static int
33072test_xmlRegExecNextValues(void) {
33073    int test_ret = 0;
33074
33075#if defined(LIBXML_REGEXP_ENABLED)
33076    int mem_base;
33077    int ret_val;
33078    xmlRegExecCtxtPtr exec; /* a regexp execution context */
33079    int n_exec;
33080    int * nbval; /* pointer to the number of accepted values IN/OUT */
33081    int n_nbval;
33082    int * nbneg; /* return number of negative transitions */
33083    int n_nbneg;
33084    xmlChar ** values; /* pointer to the array of acceptable values */
33085    int n_values;
33086    int * terminal; /* return value if this was a terminal state */
33087    int n_terminal;
33088
33089    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33090    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33091    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33092    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33093    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33094        mem_base = xmlMemBlocks();
33095        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33096        nbval = gen_int_ptr(n_nbval, 1);
33097        nbneg = gen_int_ptr(n_nbneg, 2);
33098        values = gen_xmlChar_ptr_ptr(n_values, 3);
33099        terminal = gen_int_ptr(n_terminal, 4);
33100
33101        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33102        desret_int(ret_val);
33103        call_tests++;
33104        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33105        des_int_ptr(n_nbval, nbval, 1);
33106        des_int_ptr(n_nbneg, nbneg, 2);
33107        des_xmlChar_ptr_ptr(n_values, values, 3);
33108        des_int_ptr(n_terminal, terminal, 4);
33109        xmlResetLastError();
33110        if (mem_base != xmlMemBlocks()) {
33111            printf("Leak of %d blocks found in xmlRegExecNextValues",
33112	           xmlMemBlocks() - mem_base);
33113	    test_ret++;
33114            printf(" %d", n_exec);
33115            printf(" %d", n_nbval);
33116            printf(" %d", n_nbneg);
33117            printf(" %d", n_values);
33118            printf(" %d", n_terminal);
33119            printf("\n");
33120        }
33121    }
33122    }
33123    }
33124    }
33125    }
33126    function_tests++;
33127#endif
33128
33129    return(test_ret);
33130}
33131
33132
33133static int
33134test_xmlRegExecPushString(void) {
33135    int test_ret = 0;
33136
33137#if defined(LIBXML_REGEXP_ENABLED)
33138    int mem_base;
33139    int ret_val;
33140    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33141    int n_exec;
33142    xmlChar * value; /* a string token input */
33143    int n_value;
33144    void * data; /* data associated to the token to reuse in callbacks */
33145    int n_data;
33146
33147    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33148    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33149    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33150        mem_base = xmlMemBlocks();
33151        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33152        value = gen_const_xmlChar_ptr(n_value, 1);
33153        data = gen_userdata(n_data, 2);
33154
33155        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33156        desret_int(ret_val);
33157        call_tests++;
33158        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33159        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33160        des_userdata(n_data, data, 2);
33161        xmlResetLastError();
33162        if (mem_base != xmlMemBlocks()) {
33163            printf("Leak of %d blocks found in xmlRegExecPushString",
33164	           xmlMemBlocks() - mem_base);
33165	    test_ret++;
33166            printf(" %d", n_exec);
33167            printf(" %d", n_value);
33168            printf(" %d", n_data);
33169            printf("\n");
33170        }
33171    }
33172    }
33173    }
33174    function_tests++;
33175#endif
33176
33177    return(test_ret);
33178}
33179
33180
33181static int
33182test_xmlRegExecPushString2(void) {
33183    int test_ret = 0;
33184
33185#if defined(LIBXML_REGEXP_ENABLED)
33186    int mem_base;
33187    int ret_val;
33188    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33189    int n_exec;
33190    xmlChar * value; /* the first string token input */
33191    int n_value;
33192    xmlChar * value2; /* the second string token input */
33193    int n_value2;
33194    void * data; /* data associated to the token to reuse in callbacks */
33195    int n_data;
33196
33197    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33198    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33199    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33200    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33201        mem_base = xmlMemBlocks();
33202        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33203        value = gen_const_xmlChar_ptr(n_value, 1);
33204        value2 = gen_const_xmlChar_ptr(n_value2, 2);
33205        data = gen_userdata(n_data, 3);
33206
33207        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33208        desret_int(ret_val);
33209        call_tests++;
33210        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33211        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33212        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33213        des_userdata(n_data, data, 3);
33214        xmlResetLastError();
33215        if (mem_base != xmlMemBlocks()) {
33216            printf("Leak of %d blocks found in xmlRegExecPushString2",
33217	           xmlMemBlocks() - mem_base);
33218	    test_ret++;
33219            printf(" %d", n_exec);
33220            printf(" %d", n_value);
33221            printf(" %d", n_value2);
33222            printf(" %d", n_data);
33223            printf("\n");
33224        }
33225    }
33226    }
33227    }
33228    }
33229    function_tests++;
33230#endif
33231
33232    return(test_ret);
33233}
33234
33235#ifdef LIBXML_REGEXP_ENABLED
33236
33237#define gen_nb_xmlRegexpPtr 1
33238static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33239    return(NULL);
33240}
33241static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33242}
33243#endif
33244
33245
33246static int
33247test_xmlRegNewExecCtxt(void) {
33248    int test_ret = 0;
33249
33250
33251    /* missing type support */
33252    return(test_ret);
33253}
33254
33255
33256static int
33257test_xmlRegexpCompile(void) {
33258    int test_ret = 0;
33259
33260
33261    /* missing type support */
33262    return(test_ret);
33263}
33264
33265
33266static int
33267test_xmlRegexpExec(void) {
33268    int test_ret = 0;
33269
33270#if defined(LIBXML_REGEXP_ENABLED)
33271    int mem_base;
33272    int ret_val;
33273    xmlRegexpPtr comp; /* the compiled regular expression */
33274    int n_comp;
33275    xmlChar * content; /* the value to check against the regular expression */
33276    int n_content;
33277
33278    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33279    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33280        mem_base = xmlMemBlocks();
33281        comp = gen_xmlRegexpPtr(n_comp, 0);
33282        content = gen_const_xmlChar_ptr(n_content, 1);
33283
33284        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33285        desret_int(ret_val);
33286        call_tests++;
33287        des_xmlRegexpPtr(n_comp, comp, 0);
33288        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33289        xmlResetLastError();
33290        if (mem_base != xmlMemBlocks()) {
33291            printf("Leak of %d blocks found in xmlRegexpExec",
33292	           xmlMemBlocks() - mem_base);
33293	    test_ret++;
33294            printf(" %d", n_comp);
33295            printf(" %d", n_content);
33296            printf("\n");
33297        }
33298    }
33299    }
33300    function_tests++;
33301#endif
33302
33303    return(test_ret);
33304}
33305
33306
33307static int
33308test_xmlRegexpIsDeterminist(void) {
33309    int test_ret = 0;
33310
33311#if defined(LIBXML_REGEXP_ENABLED)
33312    int mem_base;
33313    int ret_val;
33314    xmlRegexpPtr comp; /* the compiled regular expression */
33315    int n_comp;
33316
33317    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33318        mem_base = xmlMemBlocks();
33319        comp = gen_xmlRegexpPtr(n_comp, 0);
33320
33321        ret_val = xmlRegexpIsDeterminist(comp);
33322        desret_int(ret_val);
33323        call_tests++;
33324        des_xmlRegexpPtr(n_comp, comp, 0);
33325        xmlResetLastError();
33326        if (mem_base != xmlMemBlocks()) {
33327            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33328	           xmlMemBlocks() - mem_base);
33329	    test_ret++;
33330            printf(" %d", n_comp);
33331            printf("\n");
33332        }
33333    }
33334    function_tests++;
33335#endif
33336
33337    return(test_ret);
33338}
33339
33340
33341static int
33342test_xmlRegexpPrint(void) {
33343    int test_ret = 0;
33344
33345#if defined(LIBXML_REGEXP_ENABLED)
33346    int mem_base;
33347    FILE * output; /* the file for the output debug */
33348    int n_output;
33349    xmlRegexpPtr regexp; /* the compiled regexp */
33350    int n_regexp;
33351
33352    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33353    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33354        mem_base = xmlMemBlocks();
33355        output = gen_FILE_ptr(n_output, 0);
33356        regexp = gen_xmlRegexpPtr(n_regexp, 1);
33357
33358        xmlRegexpPrint(output, regexp);
33359        call_tests++;
33360        des_FILE_ptr(n_output, output, 0);
33361        des_xmlRegexpPtr(n_regexp, regexp, 1);
33362        xmlResetLastError();
33363        if (mem_base != xmlMemBlocks()) {
33364            printf("Leak of %d blocks found in xmlRegexpPrint",
33365	           xmlMemBlocks() - mem_base);
33366	    test_ret++;
33367            printf(" %d", n_output);
33368            printf(" %d", n_regexp);
33369            printf("\n");
33370        }
33371    }
33372    }
33373    function_tests++;
33374#endif
33375
33376    return(test_ret);
33377}
33378
33379static int
33380test_xmlregexp(void) {
33381    int test_ret = 0;
33382
33383    if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33384    test_ret += test_xmlExpCtxtNbCons();
33385    test_ret += test_xmlExpCtxtNbNodes();
33386    test_ret += test_xmlExpDump();
33387    test_ret += test_xmlExpExpDerive();
33388    test_ret += test_xmlExpGetLanguage();
33389    test_ret += test_xmlExpGetStart();
33390    test_ret += test_xmlExpIsNillable();
33391    test_ret += test_xmlExpMaxToken();
33392    test_ret += test_xmlExpNewAtom();
33393    test_ret += test_xmlExpNewCtxt();
33394    test_ret += test_xmlExpNewOr();
33395    test_ret += test_xmlExpNewRange();
33396    test_ret += test_xmlExpNewSeq();
33397    test_ret += test_xmlExpParse();
33398    test_ret += test_xmlExpRef();
33399    test_ret += test_xmlExpStringDerive();
33400    test_ret += test_xmlExpSubsume();
33401    test_ret += test_xmlRegExecErrInfo();
33402    test_ret += test_xmlRegExecNextValues();
33403    test_ret += test_xmlRegExecPushString();
33404    test_ret += test_xmlRegExecPushString2();
33405    test_ret += test_xmlRegNewExecCtxt();
33406    test_ret += test_xmlRegexpCompile();
33407    test_ret += test_xmlRegexpExec();
33408    test_ret += test_xmlRegexpIsDeterminist();
33409    test_ret += test_xmlRegexpPrint();
33410
33411    if (test_ret != 0)
33412	printf("Module xmlregexp: %d errors\n", test_ret);
33413    return(test_ret);
33414}
33415#ifdef LIBXML_OUTPUT_ENABLED
33416
33417#define gen_nb_xmlSaveCtxtPtr 1
33418static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33419    return(NULL);
33420}
33421static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33422}
33423#endif
33424
33425
33426static int
33427test_xmlSaveClose(void) {
33428    int test_ret = 0;
33429
33430#if defined(LIBXML_OUTPUT_ENABLED)
33431    int mem_base;
33432    int ret_val;
33433    xmlSaveCtxtPtr ctxt; /* a document saving context */
33434    int n_ctxt;
33435
33436    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33437        mem_base = xmlMemBlocks();
33438        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33439
33440        ret_val = xmlSaveClose(ctxt);
33441        desret_int(ret_val);
33442        call_tests++;
33443        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33444        xmlResetLastError();
33445        if (mem_base != xmlMemBlocks()) {
33446            printf("Leak of %d blocks found in xmlSaveClose",
33447	           xmlMemBlocks() - mem_base);
33448	    test_ret++;
33449            printf(" %d", n_ctxt);
33450            printf("\n");
33451        }
33452    }
33453    function_tests++;
33454#endif
33455
33456    return(test_ret);
33457}
33458
33459
33460static int
33461test_xmlSaveDoc(void) {
33462    int test_ret = 0;
33463
33464#if defined(LIBXML_OUTPUT_ENABLED)
33465    int mem_base;
33466    long ret_val;
33467    xmlSaveCtxtPtr ctxt; /* a document saving context */
33468    int n_ctxt;
33469    xmlDocPtr doc; /* a document */
33470    int n_doc;
33471
33472    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33473    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33474        mem_base = xmlMemBlocks();
33475        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33476        doc = gen_xmlDocPtr(n_doc, 1);
33477
33478        ret_val = xmlSaveDoc(ctxt, doc);
33479        desret_long(ret_val);
33480        call_tests++;
33481        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33482        des_xmlDocPtr(n_doc, doc, 1);
33483        xmlResetLastError();
33484        if (mem_base != xmlMemBlocks()) {
33485            printf("Leak of %d blocks found in xmlSaveDoc",
33486	           xmlMemBlocks() - mem_base);
33487	    test_ret++;
33488            printf(" %d", n_ctxt);
33489            printf(" %d", n_doc);
33490            printf("\n");
33491        }
33492    }
33493    }
33494    function_tests++;
33495#endif
33496
33497    return(test_ret);
33498}
33499
33500
33501static int
33502test_xmlSaveFlush(void) {
33503    int test_ret = 0;
33504
33505#if defined(LIBXML_OUTPUT_ENABLED)
33506    int mem_base;
33507    int ret_val;
33508    xmlSaveCtxtPtr ctxt; /* a document saving context */
33509    int n_ctxt;
33510
33511    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33512        mem_base = xmlMemBlocks();
33513        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33514
33515        ret_val = xmlSaveFlush(ctxt);
33516        desret_int(ret_val);
33517        call_tests++;
33518        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33519        xmlResetLastError();
33520        if (mem_base != xmlMemBlocks()) {
33521            printf("Leak of %d blocks found in xmlSaveFlush",
33522	           xmlMemBlocks() - mem_base);
33523	    test_ret++;
33524            printf(" %d", n_ctxt);
33525            printf("\n");
33526        }
33527    }
33528    function_tests++;
33529#endif
33530
33531    return(test_ret);
33532}
33533
33534
33535static int
33536test_xmlSaveSetAttrEscape(void) {
33537    int test_ret = 0;
33538
33539
33540    /* missing type support */
33541    return(test_ret);
33542}
33543
33544
33545static int
33546test_xmlSaveSetEscape(void) {
33547    int test_ret = 0;
33548
33549
33550    /* missing type support */
33551    return(test_ret);
33552}
33553
33554
33555static int
33556test_xmlSaveToBuffer(void) {
33557    int test_ret = 0;
33558
33559
33560    /* missing type support */
33561    return(test_ret);
33562}
33563
33564
33565static int
33566test_xmlSaveToFd(void) {
33567    int test_ret = 0;
33568
33569
33570    /* missing type support */
33571    return(test_ret);
33572}
33573
33574
33575static int
33576test_xmlSaveToFilename(void) {
33577    int test_ret = 0;
33578
33579
33580    /* missing type support */
33581    return(test_ret);
33582}
33583
33584
33585static int
33586test_xmlSaveTree(void) {
33587    int test_ret = 0;
33588
33589#if defined(LIBXML_OUTPUT_ENABLED)
33590    int mem_base;
33591    long ret_val;
33592    xmlSaveCtxtPtr ctxt; /* a document saving context */
33593    int n_ctxt;
33594    xmlNodePtr node; /* the top node of the subtree to save */
33595    int n_node;
33596
33597    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33598    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33599        mem_base = xmlMemBlocks();
33600        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33601        node = gen_xmlNodePtr(n_node, 1);
33602
33603        ret_val = xmlSaveTree(ctxt, node);
33604        desret_long(ret_val);
33605        call_tests++;
33606        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33607        des_xmlNodePtr(n_node, node, 1);
33608        xmlResetLastError();
33609        if (mem_base != xmlMemBlocks()) {
33610            printf("Leak of %d blocks found in xmlSaveTree",
33611	           xmlMemBlocks() - mem_base);
33612	    test_ret++;
33613            printf(" %d", n_ctxt);
33614            printf(" %d", n_node);
33615            printf("\n");
33616        }
33617    }
33618    }
33619    function_tests++;
33620#endif
33621
33622    return(test_ret);
33623}
33624
33625static int
33626test_xmlsave(void) {
33627    int test_ret = 0;
33628
33629    if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33630    test_ret += test_xmlSaveClose();
33631    test_ret += test_xmlSaveDoc();
33632    test_ret += test_xmlSaveFlush();
33633    test_ret += test_xmlSaveSetAttrEscape();
33634    test_ret += test_xmlSaveSetEscape();
33635    test_ret += test_xmlSaveToBuffer();
33636    test_ret += test_xmlSaveToFd();
33637    test_ret += test_xmlSaveToFilename();
33638    test_ret += test_xmlSaveTree();
33639
33640    if (test_ret != 0)
33641	printf("Module xmlsave: %d errors\n", test_ret);
33642    return(test_ret);
33643}
33644
33645static int
33646test_xmlSchemaDump(void) {
33647    int test_ret = 0;
33648
33649#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33650    int mem_base;
33651    FILE * output; /* the file output */
33652    int n_output;
33653    xmlSchemaPtr schema; /* a schema structure */
33654    int n_schema;
33655
33656    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33657    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33658        mem_base = xmlMemBlocks();
33659        output = gen_FILE_ptr(n_output, 0);
33660        schema = gen_xmlSchemaPtr(n_schema, 1);
33661
33662        xmlSchemaDump(output, schema);
33663        call_tests++;
33664        des_FILE_ptr(n_output, output, 0);
33665        des_xmlSchemaPtr(n_schema, schema, 1);
33666        xmlResetLastError();
33667        if (mem_base != xmlMemBlocks()) {
33668            printf("Leak of %d blocks found in xmlSchemaDump",
33669	           xmlMemBlocks() - mem_base);
33670	    test_ret++;
33671            printf(" %d", n_output);
33672            printf(" %d", n_schema);
33673            printf("\n");
33674        }
33675    }
33676    }
33677    function_tests++;
33678#endif
33679
33680    return(test_ret);
33681}
33682
33683#ifdef LIBXML_SCHEMAS_ENABLED
33684
33685#define gen_nb_xmlSchemaParserCtxtPtr 1
33686static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33687    return(NULL);
33688}
33689static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33690}
33691#endif
33692
33693#ifdef LIBXML_SCHEMAS_ENABLED
33694
33695#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33696static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33697    return(NULL);
33698}
33699static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33700}
33701#endif
33702
33703#ifdef LIBXML_SCHEMAS_ENABLED
33704
33705#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33706static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33707    return(NULL);
33708}
33709static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33710}
33711#endif
33712
33713
33714static int
33715test_xmlSchemaGetParserErrors(void) {
33716    int test_ret = 0;
33717
33718#if defined(LIBXML_SCHEMAS_ENABLED)
33719    int mem_base;
33720    int ret_val;
33721    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33722    int n_ctxt;
33723    xmlSchemaValidityErrorFunc * err; /* the error callback result */
33724    int n_err;
33725    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33726    int n_warn;
33727    void ** ctx; /* contextual data for the callbacks result */
33728    int n_ctx;
33729
33730    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33731    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33732    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33733    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33734        mem_base = xmlMemBlocks();
33735        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33736        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33737        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33738        ctx = gen_void_ptr_ptr(n_ctx, 3);
33739
33740        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33741        desret_int(ret_val);
33742        call_tests++;
33743        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33744        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33745        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33746        des_void_ptr_ptr(n_ctx, ctx, 3);
33747        xmlResetLastError();
33748        if (mem_base != xmlMemBlocks()) {
33749            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33750	           xmlMemBlocks() - mem_base);
33751	    test_ret++;
33752            printf(" %d", n_ctxt);
33753            printf(" %d", n_err);
33754            printf(" %d", n_warn);
33755            printf(" %d", n_ctx);
33756            printf("\n");
33757        }
33758    }
33759    }
33760    }
33761    }
33762    function_tests++;
33763#endif
33764
33765    return(test_ret);
33766}
33767
33768
33769static int
33770test_xmlSchemaGetValidErrors(void) {
33771    int test_ret = 0;
33772
33773#if defined(LIBXML_SCHEMAS_ENABLED)
33774    int mem_base;
33775    int ret_val;
33776    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
33777    int n_ctxt;
33778    xmlSchemaValidityErrorFunc * err; /* the error function result */
33779    int n_err;
33780    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
33781    int n_warn;
33782    void ** ctx; /* the functions context result */
33783    int n_ctx;
33784
33785    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33786    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33787    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33788    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33789        mem_base = xmlMemBlocks();
33790        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33791        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33792        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33793        ctx = gen_void_ptr_ptr(n_ctx, 3);
33794
33795        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33796        desret_int(ret_val);
33797        call_tests++;
33798        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33799        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33800        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33801        des_void_ptr_ptr(n_ctx, ctx, 3);
33802        xmlResetLastError();
33803        if (mem_base != xmlMemBlocks()) {
33804            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33805	           xmlMemBlocks() - mem_base);
33806	    test_ret++;
33807            printf(" %d", n_ctxt);
33808            printf(" %d", n_err);
33809            printf(" %d", n_warn);
33810            printf(" %d", n_ctx);
33811            printf("\n");
33812        }
33813    }
33814    }
33815    }
33816    }
33817    function_tests++;
33818#endif
33819
33820    return(test_ret);
33821}
33822
33823
33824static int
33825test_xmlSchemaIsValid(void) {
33826    int test_ret = 0;
33827
33828#if defined(LIBXML_SCHEMAS_ENABLED)
33829    int mem_base;
33830    int ret_val;
33831    xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
33832    int n_ctxt;
33833
33834    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33835        mem_base = xmlMemBlocks();
33836        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33837
33838        ret_val = xmlSchemaIsValid(ctxt);
33839        desret_int(ret_val);
33840        call_tests++;
33841        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33842        xmlResetLastError();
33843        if (mem_base != xmlMemBlocks()) {
33844            printf("Leak of %d blocks found in xmlSchemaIsValid",
33845	           xmlMemBlocks() - mem_base);
33846	    test_ret++;
33847            printf(" %d", n_ctxt);
33848            printf("\n");
33849        }
33850    }
33851    function_tests++;
33852#endif
33853
33854    return(test_ret);
33855}
33856
33857
33858static int
33859test_xmlSchemaNewDocParserCtxt(void) {
33860    int test_ret = 0;
33861
33862#if defined(LIBXML_SCHEMAS_ENABLED)
33863    int mem_base;
33864    xmlSchemaParserCtxtPtr ret_val;
33865    xmlDocPtr doc; /* a preparsed document tree */
33866    int n_doc;
33867
33868    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33869        mem_base = xmlMemBlocks();
33870        doc = gen_xmlDocPtr(n_doc, 0);
33871
33872        ret_val = xmlSchemaNewDocParserCtxt(doc);
33873        desret_xmlSchemaParserCtxtPtr(ret_val);
33874        call_tests++;
33875        des_xmlDocPtr(n_doc, doc, 0);
33876        xmlResetLastError();
33877        if (mem_base != xmlMemBlocks()) {
33878            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
33879	           xmlMemBlocks() - mem_base);
33880	    test_ret++;
33881            printf(" %d", n_doc);
33882            printf("\n");
33883        }
33884    }
33885    function_tests++;
33886#endif
33887
33888    return(test_ret);
33889}
33890
33891
33892static int
33893test_xmlSchemaNewMemParserCtxt(void) {
33894    int test_ret = 0;
33895
33896#if defined(LIBXML_SCHEMAS_ENABLED)
33897    int mem_base;
33898    xmlSchemaParserCtxtPtr ret_val;
33899    char * buffer; /* a pointer to a char array containing the schemas */
33900    int n_buffer;
33901    int size; /* the size of the array */
33902    int n_size;
33903
33904    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
33905    for (n_size = 0;n_size < gen_nb_int;n_size++) {
33906        mem_base = xmlMemBlocks();
33907        buffer = gen_const_char_ptr(n_buffer, 0);
33908        size = gen_int(n_size, 1);
33909
33910        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
33911        desret_xmlSchemaParserCtxtPtr(ret_val);
33912        call_tests++;
33913        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
33914        des_int(n_size, size, 1);
33915        xmlResetLastError();
33916        if (mem_base != xmlMemBlocks()) {
33917            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
33918	           xmlMemBlocks() - mem_base);
33919	    test_ret++;
33920            printf(" %d", n_buffer);
33921            printf(" %d", n_size);
33922            printf("\n");
33923        }
33924    }
33925    }
33926    function_tests++;
33927#endif
33928
33929    return(test_ret);
33930}
33931
33932
33933static int
33934test_xmlSchemaNewParserCtxt(void) {
33935    int test_ret = 0;
33936
33937#if defined(LIBXML_SCHEMAS_ENABLED)
33938    int mem_base;
33939    xmlSchemaParserCtxtPtr ret_val;
33940    char * URL; /* the location of the schema */
33941    int n_URL;
33942
33943    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
33944        mem_base = xmlMemBlocks();
33945        URL = gen_const_char_ptr(n_URL, 0);
33946
33947        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
33948        desret_xmlSchemaParserCtxtPtr(ret_val);
33949        call_tests++;
33950        des_const_char_ptr(n_URL, (const char *)URL, 0);
33951        xmlResetLastError();
33952        if (mem_base != xmlMemBlocks()) {
33953            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
33954	           xmlMemBlocks() - mem_base);
33955	    test_ret++;
33956            printf(" %d", n_URL);
33957            printf("\n");
33958        }
33959    }
33960    function_tests++;
33961#endif
33962
33963    return(test_ret);
33964}
33965
33966
33967static int
33968test_xmlSchemaNewValidCtxt(void) {
33969    int test_ret = 0;
33970
33971
33972    /* missing type support */
33973    return(test_ret);
33974}
33975
33976
33977static int
33978test_xmlSchemaParse(void) {
33979    int test_ret = 0;
33980
33981
33982    /* missing type support */
33983    return(test_ret);
33984}
33985
33986#ifdef LIBXML_SCHEMAS_ENABLED
33987
33988#define gen_nb_xmlSAXHandlerPtr_ptr 1
33989static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33990    return(NULL);
33991}
33992static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33993}
33994#endif
33995
33996
33997static int
33998test_xmlSchemaSAXPlug(void) {
33999    int test_ret = 0;
34000
34001
34002    /* missing type support */
34003    return(test_ret);
34004}
34005
34006#ifdef LIBXML_SCHEMAS_ENABLED
34007
34008#define gen_nb_xmlSchemaSAXPlugPtr 1
34009static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34010    return(NULL);
34011}
34012static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34013}
34014#endif
34015
34016
34017static int
34018test_xmlSchemaSAXUnplug(void) {
34019    int test_ret = 0;
34020
34021#if defined(LIBXML_SCHEMAS_ENABLED)
34022    int mem_base;
34023    int ret_val;
34024    xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34025    int n_plug;
34026
34027    for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34028        mem_base = xmlMemBlocks();
34029        plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34030
34031        ret_val = xmlSchemaSAXUnplug(plug);
34032        desret_int(ret_val);
34033        call_tests++;
34034        des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34035        xmlResetLastError();
34036        if (mem_base != xmlMemBlocks()) {
34037            printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34038	           xmlMemBlocks() - mem_base);
34039	    test_ret++;
34040            printf(" %d", n_plug);
34041            printf("\n");
34042        }
34043    }
34044    function_tests++;
34045#endif
34046
34047    return(test_ret);
34048}
34049
34050
34051static int
34052test_xmlSchemaSetParserErrors(void) {
34053    int test_ret = 0;
34054
34055
34056    /* missing type support */
34057    return(test_ret);
34058}
34059
34060
34061static int
34062test_xmlSchemaSetParserStructuredErrors(void) {
34063    int test_ret = 0;
34064
34065
34066    /* missing type support */
34067    return(test_ret);
34068}
34069
34070
34071static int
34072test_xmlSchemaSetValidErrors(void) {
34073    int test_ret = 0;
34074
34075
34076    /* missing type support */
34077    return(test_ret);
34078}
34079
34080
34081static int
34082test_xmlSchemaSetValidOptions(void) {
34083    int test_ret = 0;
34084
34085#if defined(LIBXML_SCHEMAS_ENABLED)
34086    int mem_base;
34087    int ret_val;
34088    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34089    int n_ctxt;
34090    int options; /* a combination of xmlSchemaValidOption */
34091    int n_options;
34092
34093    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34094    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34095        mem_base = xmlMemBlocks();
34096        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34097        options = gen_int(n_options, 1);
34098
34099        ret_val = xmlSchemaSetValidOptions(ctxt, options);
34100        desret_int(ret_val);
34101        call_tests++;
34102        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34103        des_int(n_options, options, 1);
34104        xmlResetLastError();
34105        if (mem_base != xmlMemBlocks()) {
34106            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34107	           xmlMemBlocks() - mem_base);
34108	    test_ret++;
34109            printf(" %d", n_ctxt);
34110            printf(" %d", n_options);
34111            printf("\n");
34112        }
34113    }
34114    }
34115    function_tests++;
34116#endif
34117
34118    return(test_ret);
34119}
34120
34121
34122static int
34123test_xmlSchemaSetValidStructuredErrors(void) {
34124    int test_ret = 0;
34125
34126
34127    /* missing type support */
34128    return(test_ret);
34129}
34130
34131
34132static int
34133test_xmlSchemaValidCtxtGetOptions(void) {
34134    int test_ret = 0;
34135
34136#if defined(LIBXML_SCHEMAS_ENABLED)
34137    int mem_base;
34138    int ret_val;
34139    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34140    int n_ctxt;
34141
34142    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34143        mem_base = xmlMemBlocks();
34144        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34145
34146        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34147        desret_int(ret_val);
34148        call_tests++;
34149        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34150        xmlResetLastError();
34151        if (mem_base != xmlMemBlocks()) {
34152            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34153	           xmlMemBlocks() - mem_base);
34154	    test_ret++;
34155            printf(" %d", n_ctxt);
34156            printf("\n");
34157        }
34158    }
34159    function_tests++;
34160#endif
34161
34162    return(test_ret);
34163}
34164
34165
34166static int
34167test_xmlSchemaValidCtxtGetParserCtxt(void) {
34168    int test_ret = 0;
34169
34170#if defined(LIBXML_SCHEMAS_ENABLED)
34171    int mem_base;
34172    xmlParserCtxtPtr ret_val;
34173    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34174    int n_ctxt;
34175
34176    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34177        mem_base = xmlMemBlocks();
34178        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34179
34180        ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34181        desret_xmlParserCtxtPtr(ret_val);
34182        call_tests++;
34183        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34184        xmlResetLastError();
34185        if (mem_base != xmlMemBlocks()) {
34186            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34187	           xmlMemBlocks() - mem_base);
34188	    test_ret++;
34189            printf(" %d", n_ctxt);
34190            printf("\n");
34191        }
34192    }
34193    function_tests++;
34194#endif
34195
34196    return(test_ret);
34197}
34198
34199
34200static int
34201test_xmlSchemaValidateDoc(void) {
34202    int test_ret = 0;
34203
34204#if defined(LIBXML_SCHEMAS_ENABLED)
34205    int mem_base;
34206    int ret_val;
34207    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34208    int n_ctxt;
34209    xmlDocPtr doc; /* a parsed document tree */
34210    int n_doc;
34211
34212    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34213    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34214        mem_base = xmlMemBlocks();
34215        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34216        doc = gen_xmlDocPtr(n_doc, 1);
34217
34218        ret_val = xmlSchemaValidateDoc(ctxt, doc);
34219        desret_int(ret_val);
34220        call_tests++;
34221        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34222        des_xmlDocPtr(n_doc, doc, 1);
34223        xmlResetLastError();
34224        if (mem_base != xmlMemBlocks()) {
34225            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34226	           xmlMemBlocks() - mem_base);
34227	    test_ret++;
34228            printf(" %d", n_ctxt);
34229            printf(" %d", n_doc);
34230            printf("\n");
34231        }
34232    }
34233    }
34234    function_tests++;
34235#endif
34236
34237    return(test_ret);
34238}
34239
34240
34241static int
34242test_xmlSchemaValidateFile(void) {
34243    int test_ret = 0;
34244
34245#if defined(LIBXML_SCHEMAS_ENABLED)
34246    int mem_base;
34247    int ret_val;
34248    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34249    int n_ctxt;
34250    const char * filename; /* the URI of the instance */
34251    int n_filename;
34252    int options; /* a future set of options, currently unused */
34253    int n_options;
34254
34255    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34256    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34257    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34258        mem_base = xmlMemBlocks();
34259        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34260        filename = gen_filepath(n_filename, 1);
34261        options = gen_int(n_options, 2);
34262
34263        ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34264        desret_int(ret_val);
34265        call_tests++;
34266        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34267        des_filepath(n_filename, filename, 1);
34268        des_int(n_options, options, 2);
34269        xmlResetLastError();
34270        if (mem_base != xmlMemBlocks()) {
34271            printf("Leak of %d blocks found in xmlSchemaValidateFile",
34272	           xmlMemBlocks() - mem_base);
34273	    test_ret++;
34274            printf(" %d", n_ctxt);
34275            printf(" %d", n_filename);
34276            printf(" %d", n_options);
34277            printf("\n");
34278        }
34279    }
34280    }
34281    }
34282    function_tests++;
34283#endif
34284
34285    return(test_ret);
34286}
34287
34288
34289static int
34290test_xmlSchemaValidateOneElement(void) {
34291    int test_ret = 0;
34292
34293#if defined(LIBXML_SCHEMAS_ENABLED)
34294    int mem_base;
34295    int ret_val;
34296    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34297    int n_ctxt;
34298    xmlNodePtr elem; /* an element node */
34299    int n_elem;
34300
34301    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34302    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34303        mem_base = xmlMemBlocks();
34304        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34305        elem = gen_xmlNodePtr(n_elem, 1);
34306
34307        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34308        desret_int(ret_val);
34309        call_tests++;
34310        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34311        des_xmlNodePtr(n_elem, elem, 1);
34312        xmlResetLastError();
34313        if (mem_base != xmlMemBlocks()) {
34314            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34315	           xmlMemBlocks() - mem_base);
34316	    test_ret++;
34317            printf(" %d", n_ctxt);
34318            printf(" %d", n_elem);
34319            printf("\n");
34320        }
34321    }
34322    }
34323    function_tests++;
34324#endif
34325
34326    return(test_ret);
34327}
34328
34329
34330static int
34331test_xmlSchemaValidateStream(void) {
34332    int test_ret = 0;
34333
34334#if defined(LIBXML_SCHEMAS_ENABLED)
34335    int mem_base;
34336    int ret_val;
34337    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34338    int n_ctxt;
34339    xmlParserInputBufferPtr input; /* the input to use for reading the data */
34340    int n_input;
34341    xmlCharEncoding enc; /* an optional encoding information */
34342    int n_enc;
34343    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34344    int n_sax;
34345    void * user_data; /* the context to provide to the SAX handler. */
34346    int n_user_data;
34347
34348    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34349    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34350    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34351    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34352    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34353        mem_base = xmlMemBlocks();
34354        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34355        input = gen_xmlParserInputBufferPtr(n_input, 1);
34356        enc = gen_xmlCharEncoding(n_enc, 2);
34357        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34358        user_data = gen_userdata(n_user_data, 4);
34359
34360        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34361        desret_int(ret_val);
34362        call_tests++;
34363        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34364        des_xmlParserInputBufferPtr(n_input, input, 1);
34365        des_xmlCharEncoding(n_enc, enc, 2);
34366        des_xmlSAXHandlerPtr(n_sax, sax, 3);
34367        des_userdata(n_user_data, user_data, 4);
34368        xmlResetLastError();
34369        if (mem_base != xmlMemBlocks()) {
34370            printf("Leak of %d blocks found in xmlSchemaValidateStream",
34371	           xmlMemBlocks() - mem_base);
34372	    test_ret++;
34373            printf(" %d", n_ctxt);
34374            printf(" %d", n_input);
34375            printf(" %d", n_enc);
34376            printf(" %d", n_sax);
34377            printf(" %d", n_user_data);
34378            printf("\n");
34379        }
34380    }
34381    }
34382    }
34383    }
34384    }
34385    function_tests++;
34386#endif
34387
34388    return(test_ret);
34389}
34390
34391static int
34392test_xmlschemas(void) {
34393    int test_ret = 0;
34394
34395    if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34396    test_ret += test_xmlSchemaDump();
34397    test_ret += test_xmlSchemaGetParserErrors();
34398    test_ret += test_xmlSchemaGetValidErrors();
34399    test_ret += test_xmlSchemaIsValid();
34400    test_ret += test_xmlSchemaNewDocParserCtxt();
34401    test_ret += test_xmlSchemaNewMemParserCtxt();
34402    test_ret += test_xmlSchemaNewParserCtxt();
34403    test_ret += test_xmlSchemaNewValidCtxt();
34404    test_ret += test_xmlSchemaParse();
34405    test_ret += test_xmlSchemaSAXPlug();
34406    test_ret += test_xmlSchemaSAXUnplug();
34407    test_ret += test_xmlSchemaSetParserErrors();
34408    test_ret += test_xmlSchemaSetParserStructuredErrors();
34409    test_ret += test_xmlSchemaSetValidErrors();
34410    test_ret += test_xmlSchemaSetValidOptions();
34411    test_ret += test_xmlSchemaSetValidStructuredErrors();
34412    test_ret += test_xmlSchemaValidCtxtGetOptions();
34413    test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34414    test_ret += test_xmlSchemaValidateDoc();
34415    test_ret += test_xmlSchemaValidateFile();
34416    test_ret += test_xmlSchemaValidateOneElement();
34417    test_ret += test_xmlSchemaValidateStream();
34418
34419    if (test_ret != 0)
34420	printf("Module xmlschemas: %d errors\n", test_ret);
34421    return(test_ret);
34422}
34423#ifdef LIBXML_SCHEMAS_ENABLED
34424
34425#define gen_nb_xmlSchemaFacetPtr 1
34426static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34427    return(NULL);
34428}
34429static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34430}
34431#endif
34432
34433#ifdef LIBXML_SCHEMAS_ENABLED
34434
34435#define gen_nb_xmlSchemaTypePtr 1
34436static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34437    return(NULL);
34438}
34439static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34440}
34441#endif
34442
34443
34444static int
34445test_xmlSchemaCheckFacet(void) {
34446    int test_ret = 0;
34447
34448#if defined(LIBXML_SCHEMAS_ENABLED)
34449    int mem_base;
34450    int ret_val;
34451    xmlSchemaFacetPtr facet; /* the facet */
34452    int n_facet;
34453    xmlSchemaTypePtr typeDecl; /* the schema type definition */
34454    int n_typeDecl;
34455    xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34456    int n_pctxt;
34457    xmlChar * name; /* the optional name of the type */
34458    int n_name;
34459
34460    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34461    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34462    for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34463    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34464        mem_base = xmlMemBlocks();
34465        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34466        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34467        pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34468        name = gen_const_xmlChar_ptr(n_name, 3);
34469
34470        ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34471        desret_int(ret_val);
34472        call_tests++;
34473        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34474        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34475        des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34476        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34477        xmlResetLastError();
34478        if (mem_base != xmlMemBlocks()) {
34479            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34480	           xmlMemBlocks() - mem_base);
34481	    test_ret++;
34482            printf(" %d", n_facet);
34483            printf(" %d", n_typeDecl);
34484            printf(" %d", n_pctxt);
34485            printf(" %d", n_name);
34486            printf("\n");
34487        }
34488    }
34489    }
34490    }
34491    }
34492    function_tests++;
34493#endif
34494
34495    return(test_ret);
34496}
34497
34498
34499static int
34500test_xmlSchemaCleanupTypes(void) {
34501    int test_ret = 0;
34502
34503#if defined(LIBXML_SCHEMAS_ENABLED)
34504
34505
34506        xmlSchemaCleanupTypes();
34507        call_tests++;
34508        xmlResetLastError();
34509    function_tests++;
34510#endif
34511
34512    return(test_ret);
34513}
34514
34515
34516static int
34517test_xmlSchemaCollapseString(void) {
34518    int test_ret = 0;
34519
34520#if defined(LIBXML_SCHEMAS_ENABLED)
34521    int mem_base;
34522    xmlChar * ret_val;
34523    xmlChar * value; /* a value */
34524    int n_value;
34525
34526    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34527        mem_base = xmlMemBlocks();
34528        value = gen_const_xmlChar_ptr(n_value, 0);
34529
34530        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34531        desret_xmlChar_ptr(ret_val);
34532        call_tests++;
34533        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34534        xmlResetLastError();
34535        if (mem_base != xmlMemBlocks()) {
34536            printf("Leak of %d blocks found in xmlSchemaCollapseString",
34537	           xmlMemBlocks() - mem_base);
34538	    test_ret++;
34539            printf(" %d", n_value);
34540            printf("\n");
34541        }
34542    }
34543    function_tests++;
34544#endif
34545
34546    return(test_ret);
34547}
34548
34549#ifdef LIBXML_SCHEMAS_ENABLED
34550
34551#define gen_nb_xmlSchemaValPtr 1
34552static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34553    return(NULL);
34554}
34555static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34556}
34557#endif
34558
34559
34560static int
34561test_xmlSchemaCompareValues(void) {
34562    int test_ret = 0;
34563
34564#if defined(LIBXML_SCHEMAS_ENABLED)
34565    int mem_base;
34566    int ret_val;
34567    xmlSchemaValPtr x; /* a first value */
34568    int n_x;
34569    xmlSchemaValPtr y; /* a second value */
34570    int n_y;
34571
34572    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34573    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34574        mem_base = xmlMemBlocks();
34575        x = gen_xmlSchemaValPtr(n_x, 0);
34576        y = gen_xmlSchemaValPtr(n_y, 1);
34577
34578        ret_val = xmlSchemaCompareValues(x, y);
34579        desret_int(ret_val);
34580        call_tests++;
34581        des_xmlSchemaValPtr(n_x, x, 0);
34582        des_xmlSchemaValPtr(n_y, y, 1);
34583        xmlResetLastError();
34584        if (mem_base != xmlMemBlocks()) {
34585            printf("Leak of %d blocks found in xmlSchemaCompareValues",
34586	           xmlMemBlocks() - mem_base);
34587	    test_ret++;
34588            printf(" %d", n_x);
34589            printf(" %d", n_y);
34590            printf("\n");
34591        }
34592    }
34593    }
34594    function_tests++;
34595#endif
34596
34597    return(test_ret);
34598}
34599
34600
34601static int
34602test_xmlSchemaCompareValuesWhtsp(void) {
34603    int test_ret = 0;
34604
34605#if defined(LIBXML_SCHEMAS_ENABLED)
34606    int mem_base;
34607    int ret_val;
34608    xmlSchemaValPtr x; /* a first value */
34609    int n_x;
34610    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34611    int n_xws;
34612    xmlSchemaValPtr y; /* a second value */
34613    int n_y;
34614    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34615    int n_yws;
34616
34617    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34618    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34619    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34620    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34621        mem_base = xmlMemBlocks();
34622        x = gen_xmlSchemaValPtr(n_x, 0);
34623        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34624        y = gen_xmlSchemaValPtr(n_y, 2);
34625        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34626
34627        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34628        desret_int(ret_val);
34629        call_tests++;
34630        des_xmlSchemaValPtr(n_x, x, 0);
34631        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34632        des_xmlSchemaValPtr(n_y, y, 2);
34633        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34634        xmlResetLastError();
34635        if (mem_base != xmlMemBlocks()) {
34636            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34637	           xmlMemBlocks() - mem_base);
34638	    test_ret++;
34639            printf(" %d", n_x);
34640            printf(" %d", n_xws);
34641            printf(" %d", n_y);
34642            printf(" %d", n_yws);
34643            printf("\n");
34644        }
34645    }
34646    }
34647    }
34648    }
34649    function_tests++;
34650#endif
34651
34652    return(test_ret);
34653}
34654
34655
34656static int
34657test_xmlSchemaCopyValue(void) {
34658    int test_ret = 0;
34659
34660
34661    /* missing type support */
34662    return(test_ret);
34663}
34664
34665
34666static int
34667test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34668    int test_ret = 0;
34669
34670#if defined(LIBXML_SCHEMAS_ENABLED)
34671    int mem_base;
34672    xmlSchemaTypePtr ret_val;
34673    xmlSchemaTypePtr type; /* the built-in simple type. */
34674    int n_type;
34675
34676    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34677        mem_base = xmlMemBlocks();
34678        type = gen_xmlSchemaTypePtr(n_type, 0);
34679
34680        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34681        desret_xmlSchemaTypePtr(ret_val);
34682        call_tests++;
34683        des_xmlSchemaTypePtr(n_type, type, 0);
34684        xmlResetLastError();
34685        if (mem_base != xmlMemBlocks()) {
34686            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34687	           xmlMemBlocks() - mem_base);
34688	    test_ret++;
34689            printf(" %d", n_type);
34690            printf("\n");
34691        }
34692    }
34693    function_tests++;
34694#endif
34695
34696    return(test_ret);
34697}
34698
34699
34700static int
34701test_xmlSchemaGetBuiltInType(void) {
34702    int test_ret = 0;
34703
34704#if defined(LIBXML_SCHEMAS_ENABLED)
34705    xmlSchemaTypePtr ret_val;
34706    xmlSchemaValType type; /* the type of the built in type */
34707    int n_type;
34708
34709    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34710        type = gen_xmlSchemaValType(n_type, 0);
34711
34712        ret_val = xmlSchemaGetBuiltInType(type);
34713        desret_xmlSchemaTypePtr(ret_val);
34714        call_tests++;
34715        des_xmlSchemaValType(n_type, type, 0);
34716        xmlResetLastError();
34717    }
34718    function_tests++;
34719#endif
34720
34721    return(test_ret);
34722}
34723
34724
34725static int
34726test_xmlSchemaGetCanonValue(void) {
34727    int test_ret = 0;
34728
34729#if defined(LIBXML_SCHEMAS_ENABLED)
34730    int mem_base;
34731    int ret_val;
34732    xmlSchemaValPtr val; /* the precomputed value */
34733    int n_val;
34734    xmlChar ** retValue; /* the returned value */
34735    int n_retValue;
34736
34737    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34738    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34739        mem_base = xmlMemBlocks();
34740        val = gen_xmlSchemaValPtr(n_val, 0);
34741        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34742
34743        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34744        desret_int(ret_val);
34745        call_tests++;
34746        des_xmlSchemaValPtr(n_val, val, 0);
34747        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34748        xmlResetLastError();
34749        if (mem_base != xmlMemBlocks()) {
34750            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34751	           xmlMemBlocks() - mem_base);
34752	    test_ret++;
34753            printf(" %d", n_val);
34754            printf(" %d", n_retValue);
34755            printf("\n");
34756        }
34757    }
34758    }
34759    function_tests++;
34760#endif
34761
34762    return(test_ret);
34763}
34764
34765
34766static int
34767test_xmlSchemaGetCanonValueWhtsp(void) {
34768    int test_ret = 0;
34769
34770#if defined(LIBXML_SCHEMAS_ENABLED)
34771    int mem_base;
34772    int ret_val;
34773    xmlSchemaValPtr val; /* the precomputed value */
34774    int n_val;
34775    xmlChar ** retValue; /* the returned value */
34776    int n_retValue;
34777    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34778    int n_ws;
34779
34780    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34781    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34782    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34783        mem_base = xmlMemBlocks();
34784        val = gen_xmlSchemaValPtr(n_val, 0);
34785        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34786        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34787
34788        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34789        desret_int(ret_val);
34790        call_tests++;
34791        des_xmlSchemaValPtr(n_val, val, 0);
34792        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34793        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34794        xmlResetLastError();
34795        if (mem_base != xmlMemBlocks()) {
34796            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34797	           xmlMemBlocks() - mem_base);
34798	    test_ret++;
34799            printf(" %d", n_val);
34800            printf(" %d", n_retValue);
34801            printf(" %d", n_ws);
34802            printf("\n");
34803        }
34804    }
34805    }
34806    }
34807    function_tests++;
34808#endif
34809
34810    return(test_ret);
34811}
34812
34813
34814static int
34815test_xmlSchemaGetFacetValueAsULong(void) {
34816    int test_ret = 0;
34817
34818#if defined(LIBXML_SCHEMAS_ENABLED)
34819    int mem_base;
34820    unsigned long ret_val;
34821    xmlSchemaFacetPtr facet; /* an schemas type facet */
34822    int n_facet;
34823
34824    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34825        mem_base = xmlMemBlocks();
34826        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34827
34828        ret_val = xmlSchemaGetFacetValueAsULong(facet);
34829        desret_unsigned_long(ret_val);
34830        call_tests++;
34831        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34832        xmlResetLastError();
34833        if (mem_base != xmlMemBlocks()) {
34834            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
34835	           xmlMemBlocks() - mem_base);
34836	    test_ret++;
34837            printf(" %d", n_facet);
34838            printf("\n");
34839        }
34840    }
34841    function_tests++;
34842#endif
34843
34844    return(test_ret);
34845}
34846
34847
34848static int
34849test_xmlSchemaGetPredefinedType(void) {
34850    int test_ret = 0;
34851
34852#if defined(LIBXML_SCHEMAS_ENABLED)
34853    int mem_base;
34854    xmlSchemaTypePtr ret_val;
34855    xmlChar * name; /* the type name */
34856    int n_name;
34857    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
34858    int n_ns;
34859
34860    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34861    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
34862        mem_base = xmlMemBlocks();
34863        name = gen_const_xmlChar_ptr(n_name, 0);
34864        ns = gen_const_xmlChar_ptr(n_ns, 1);
34865
34866        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
34867        desret_xmlSchemaTypePtr(ret_val);
34868        call_tests++;
34869        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
34870        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
34871        xmlResetLastError();
34872        if (mem_base != xmlMemBlocks()) {
34873            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
34874	           xmlMemBlocks() - mem_base);
34875	    test_ret++;
34876            printf(" %d", n_name);
34877            printf(" %d", n_ns);
34878            printf("\n");
34879        }
34880    }
34881    }
34882    function_tests++;
34883#endif
34884
34885    return(test_ret);
34886}
34887
34888
34889static int
34890test_xmlSchemaGetValType(void) {
34891    int test_ret = 0;
34892
34893#if defined(LIBXML_SCHEMAS_ENABLED)
34894    int mem_base;
34895    xmlSchemaValType ret_val;
34896    xmlSchemaValPtr val; /* a schemas value */
34897    int n_val;
34898
34899    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34900        mem_base = xmlMemBlocks();
34901        val = gen_xmlSchemaValPtr(n_val, 0);
34902
34903        ret_val = xmlSchemaGetValType(val);
34904        desret_xmlSchemaValType(ret_val);
34905        call_tests++;
34906        des_xmlSchemaValPtr(n_val, val, 0);
34907        xmlResetLastError();
34908        if (mem_base != xmlMemBlocks()) {
34909            printf("Leak of %d blocks found in xmlSchemaGetValType",
34910	           xmlMemBlocks() - mem_base);
34911	    test_ret++;
34912            printf(" %d", n_val);
34913            printf("\n");
34914        }
34915    }
34916    function_tests++;
34917#endif
34918
34919    return(test_ret);
34920}
34921
34922
34923static int
34924test_xmlSchemaInitTypes(void) {
34925    int test_ret = 0;
34926
34927#if defined(LIBXML_SCHEMAS_ENABLED)
34928
34929
34930        xmlSchemaInitTypes();
34931        call_tests++;
34932        xmlResetLastError();
34933    function_tests++;
34934#endif
34935
34936    return(test_ret);
34937}
34938
34939
34940static int
34941test_xmlSchemaIsBuiltInTypeFacet(void) {
34942    int test_ret = 0;
34943
34944#if defined(LIBXML_SCHEMAS_ENABLED)
34945    int mem_base;
34946    int ret_val;
34947    xmlSchemaTypePtr type; /* the built-in type */
34948    int n_type;
34949    int facetType; /* the facet type */
34950    int n_facetType;
34951
34952    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34953    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
34954        mem_base = xmlMemBlocks();
34955        type = gen_xmlSchemaTypePtr(n_type, 0);
34956        facetType = gen_int(n_facetType, 1);
34957
34958        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
34959        desret_int(ret_val);
34960        call_tests++;
34961        des_xmlSchemaTypePtr(n_type, type, 0);
34962        des_int(n_facetType, facetType, 1);
34963        xmlResetLastError();
34964        if (mem_base != xmlMemBlocks()) {
34965            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
34966	           xmlMemBlocks() - mem_base);
34967	    test_ret++;
34968            printf(" %d", n_type);
34969            printf(" %d", n_facetType);
34970            printf("\n");
34971        }
34972    }
34973    }
34974    function_tests++;
34975#endif
34976
34977    return(test_ret);
34978}
34979
34980
34981static int
34982test_xmlSchemaNewFacet(void) {
34983    int test_ret = 0;
34984
34985
34986    /* missing type support */
34987    return(test_ret);
34988}
34989
34990
34991static int
34992test_xmlSchemaNewNOTATIONValue(void) {
34993    int test_ret = 0;
34994
34995
34996    /* missing type support */
34997    return(test_ret);
34998}
34999
35000
35001static int
35002test_xmlSchemaNewQNameValue(void) {
35003    int test_ret = 0;
35004
35005
35006    /* missing type support */
35007    return(test_ret);
35008}
35009
35010
35011static int
35012test_xmlSchemaNewStringValue(void) {
35013    int test_ret = 0;
35014
35015
35016    /* missing type support */
35017    return(test_ret);
35018}
35019
35020#ifdef LIBXML_SCHEMAS_ENABLED
35021
35022#define gen_nb_xmlSchemaValPtr_ptr 1
35023static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35024    return(NULL);
35025}
35026static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35027}
35028#endif
35029
35030
35031static int
35032test_xmlSchemaValPredefTypeNode(void) {
35033    int test_ret = 0;
35034
35035#if defined(LIBXML_SCHEMAS_ENABLED)
35036    int mem_base;
35037    int ret_val;
35038    xmlSchemaTypePtr type; /* the predefined type */
35039    int n_type;
35040    xmlChar * value; /* the value to check */
35041    int n_value;
35042    xmlSchemaValPtr * val; /* the return computed value */
35043    int n_val;
35044    xmlNodePtr node; /* the node containing the value */
35045    int n_node;
35046
35047    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35048    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35049    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35050    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35051        mem_base = xmlMemBlocks();
35052        type = gen_xmlSchemaTypePtr(n_type, 0);
35053        value = gen_const_xmlChar_ptr(n_value, 1);
35054        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35055        node = gen_xmlNodePtr(n_node, 3);
35056
35057        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35058        desret_int(ret_val);
35059        call_tests++;
35060        des_xmlSchemaTypePtr(n_type, type, 0);
35061        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35062        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35063        des_xmlNodePtr(n_node, node, 3);
35064        xmlResetLastError();
35065        if (mem_base != xmlMemBlocks()) {
35066            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35067	           xmlMemBlocks() - mem_base);
35068	    test_ret++;
35069            printf(" %d", n_type);
35070            printf(" %d", n_value);
35071            printf(" %d", n_val);
35072            printf(" %d", n_node);
35073            printf("\n");
35074        }
35075    }
35076    }
35077    }
35078    }
35079    function_tests++;
35080#endif
35081
35082    return(test_ret);
35083}
35084
35085
35086static int
35087test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35088    int test_ret = 0;
35089
35090#if defined(LIBXML_SCHEMAS_ENABLED)
35091    int mem_base;
35092    int ret_val;
35093    xmlSchemaTypePtr type; /* the predefined type */
35094    int n_type;
35095    xmlChar * value; /* the value to check */
35096    int n_value;
35097    xmlSchemaValPtr * val; /* the return computed value */
35098    int n_val;
35099    xmlNodePtr node; /* the node containing the value */
35100    int n_node;
35101
35102    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35103    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35104    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35105    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35106        mem_base = xmlMemBlocks();
35107        type = gen_xmlSchemaTypePtr(n_type, 0);
35108        value = gen_const_xmlChar_ptr(n_value, 1);
35109        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35110        node = gen_xmlNodePtr(n_node, 3);
35111
35112        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35113        desret_int(ret_val);
35114        call_tests++;
35115        des_xmlSchemaTypePtr(n_type, type, 0);
35116        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35117        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35118        des_xmlNodePtr(n_node, node, 3);
35119        xmlResetLastError();
35120        if (mem_base != xmlMemBlocks()) {
35121            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35122	           xmlMemBlocks() - mem_base);
35123	    test_ret++;
35124            printf(" %d", n_type);
35125            printf(" %d", n_value);
35126            printf(" %d", n_val);
35127            printf(" %d", n_node);
35128            printf("\n");
35129        }
35130    }
35131    }
35132    }
35133    }
35134    function_tests++;
35135#endif
35136
35137    return(test_ret);
35138}
35139
35140
35141static int
35142test_xmlSchemaValidateFacet(void) {
35143    int test_ret = 0;
35144
35145#if defined(LIBXML_SCHEMAS_ENABLED)
35146    int mem_base;
35147    int ret_val;
35148    xmlSchemaTypePtr base; /* the base type */
35149    int n_base;
35150    xmlSchemaFacetPtr facet; /* the facet to check */
35151    int n_facet;
35152    xmlChar * value; /* the lexical repr of the value to validate */
35153    int n_value;
35154    xmlSchemaValPtr val; /* the precomputed value */
35155    int n_val;
35156
35157    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35158    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35159    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35160    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35161        mem_base = xmlMemBlocks();
35162        base = gen_xmlSchemaTypePtr(n_base, 0);
35163        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35164        value = gen_const_xmlChar_ptr(n_value, 2);
35165        val = gen_xmlSchemaValPtr(n_val, 3);
35166
35167        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35168        desret_int(ret_val);
35169        call_tests++;
35170        des_xmlSchemaTypePtr(n_base, base, 0);
35171        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35172        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35173        des_xmlSchemaValPtr(n_val, val, 3);
35174        xmlResetLastError();
35175        if (mem_base != xmlMemBlocks()) {
35176            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35177	           xmlMemBlocks() - mem_base);
35178	    test_ret++;
35179            printf(" %d", n_base);
35180            printf(" %d", n_facet);
35181            printf(" %d", n_value);
35182            printf(" %d", n_val);
35183            printf("\n");
35184        }
35185    }
35186    }
35187    }
35188    }
35189    function_tests++;
35190#endif
35191
35192    return(test_ret);
35193}
35194
35195
35196static int
35197test_xmlSchemaValidateFacetWhtsp(void) {
35198    int test_ret = 0;
35199
35200#if defined(LIBXML_SCHEMAS_ENABLED)
35201    int mem_base;
35202    int ret_val;
35203    xmlSchemaFacetPtr facet; /* the facet to check */
35204    int n_facet;
35205    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35206    int n_fws;
35207    xmlSchemaValType valType; /* the built-in type of the value */
35208    int n_valType;
35209    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35210    int n_value;
35211    xmlSchemaValPtr val; /* the precomputed value */
35212    int n_val;
35213    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35214    int n_ws;
35215
35216    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35217    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35218    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35219    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35220    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35221    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35222        mem_base = xmlMemBlocks();
35223        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35224        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35225        valType = gen_xmlSchemaValType(n_valType, 2);
35226        value = gen_const_xmlChar_ptr(n_value, 3);
35227        val = gen_xmlSchemaValPtr(n_val, 4);
35228        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35229
35230        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35231        desret_int(ret_val);
35232        call_tests++;
35233        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35234        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35235        des_xmlSchemaValType(n_valType, valType, 2);
35236        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35237        des_xmlSchemaValPtr(n_val, val, 4);
35238        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35239        xmlResetLastError();
35240        if (mem_base != xmlMemBlocks()) {
35241            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35242	           xmlMemBlocks() - mem_base);
35243	    test_ret++;
35244            printf(" %d", n_facet);
35245            printf(" %d", n_fws);
35246            printf(" %d", n_valType);
35247            printf(" %d", n_value);
35248            printf(" %d", n_val);
35249            printf(" %d", n_ws);
35250            printf("\n");
35251        }
35252    }
35253    }
35254    }
35255    }
35256    }
35257    }
35258    function_tests++;
35259#endif
35260
35261    return(test_ret);
35262}
35263
35264
35265static int
35266test_xmlSchemaValidateLengthFacet(void) {
35267    int test_ret = 0;
35268
35269#if defined(LIBXML_SCHEMAS_ENABLED)
35270    int mem_base;
35271    int ret_val;
35272    xmlSchemaTypePtr type; /* the built-in type */
35273    int n_type;
35274    xmlSchemaFacetPtr facet; /* the facet to check */
35275    int n_facet;
35276    xmlChar * value; /* the lexical repr. of the value to be validated */
35277    int n_value;
35278    xmlSchemaValPtr val; /* the precomputed value */
35279    int n_val;
35280    unsigned long * length; /* the actual length of the value */
35281    int n_length;
35282
35283    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35284    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35285    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35286    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35287    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35288        mem_base = xmlMemBlocks();
35289        type = gen_xmlSchemaTypePtr(n_type, 0);
35290        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35291        value = gen_const_xmlChar_ptr(n_value, 2);
35292        val = gen_xmlSchemaValPtr(n_val, 3);
35293        length = gen_unsigned_long_ptr(n_length, 4);
35294
35295        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35296        desret_int(ret_val);
35297        call_tests++;
35298        des_xmlSchemaTypePtr(n_type, type, 0);
35299        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35300        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35301        des_xmlSchemaValPtr(n_val, val, 3);
35302        des_unsigned_long_ptr(n_length, length, 4);
35303        xmlResetLastError();
35304        if (mem_base != xmlMemBlocks()) {
35305            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35306	           xmlMemBlocks() - mem_base);
35307	    test_ret++;
35308            printf(" %d", n_type);
35309            printf(" %d", n_facet);
35310            printf(" %d", n_value);
35311            printf(" %d", n_val);
35312            printf(" %d", n_length);
35313            printf("\n");
35314        }
35315    }
35316    }
35317    }
35318    }
35319    }
35320    function_tests++;
35321#endif
35322
35323    return(test_ret);
35324}
35325
35326
35327static int
35328test_xmlSchemaValidateLengthFacetWhtsp(void) {
35329    int test_ret = 0;
35330
35331#if defined(LIBXML_SCHEMAS_ENABLED)
35332    int mem_base;
35333    int ret_val;
35334    xmlSchemaFacetPtr facet; /* the facet to check */
35335    int n_facet;
35336    xmlSchemaValType valType; /* the built-in type */
35337    int n_valType;
35338    xmlChar * value; /* the lexical repr. of the value to be validated */
35339    int n_value;
35340    xmlSchemaValPtr val; /* the precomputed value */
35341    int n_val;
35342    unsigned long * length; /* the actual length of the value */
35343    int n_length;
35344    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35345    int n_ws;
35346
35347    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35348    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35349    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35350    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35351    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35352    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35353        mem_base = xmlMemBlocks();
35354        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35355        valType = gen_xmlSchemaValType(n_valType, 1);
35356        value = gen_const_xmlChar_ptr(n_value, 2);
35357        val = gen_xmlSchemaValPtr(n_val, 3);
35358        length = gen_unsigned_long_ptr(n_length, 4);
35359        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35360
35361        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35362        desret_int(ret_val);
35363        call_tests++;
35364        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35365        des_xmlSchemaValType(n_valType, valType, 1);
35366        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35367        des_xmlSchemaValPtr(n_val, val, 3);
35368        des_unsigned_long_ptr(n_length, length, 4);
35369        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35370        xmlResetLastError();
35371        if (mem_base != xmlMemBlocks()) {
35372            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35373	           xmlMemBlocks() - mem_base);
35374	    test_ret++;
35375            printf(" %d", n_facet);
35376            printf(" %d", n_valType);
35377            printf(" %d", n_value);
35378            printf(" %d", n_val);
35379            printf(" %d", n_length);
35380            printf(" %d", n_ws);
35381            printf("\n");
35382        }
35383    }
35384    }
35385    }
35386    }
35387    }
35388    }
35389    function_tests++;
35390#endif
35391
35392    return(test_ret);
35393}
35394
35395
35396static int
35397test_xmlSchemaValidateListSimpleTypeFacet(void) {
35398    int test_ret = 0;
35399
35400#if defined(LIBXML_SCHEMAS_ENABLED)
35401    int mem_base;
35402    int ret_val;
35403    xmlSchemaFacetPtr facet; /* the facet to check */
35404    int n_facet;
35405    xmlChar * value; /* the lexical repr of the value to validate */
35406    int n_value;
35407    unsigned long actualLen; /* the number of list items */
35408    int n_actualLen;
35409    unsigned long * expectedLen; /* the resulting expected number of list items */
35410    int n_expectedLen;
35411
35412    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35413    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35414    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35415    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35416        mem_base = xmlMemBlocks();
35417        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35418        value = gen_const_xmlChar_ptr(n_value, 1);
35419        actualLen = gen_unsigned_long(n_actualLen, 2);
35420        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35421
35422        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35423        desret_int(ret_val);
35424        call_tests++;
35425        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35426        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35427        des_unsigned_long(n_actualLen, actualLen, 2);
35428        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35429        xmlResetLastError();
35430        if (mem_base != xmlMemBlocks()) {
35431            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35432	           xmlMemBlocks() - mem_base);
35433	    test_ret++;
35434            printf(" %d", n_facet);
35435            printf(" %d", n_value);
35436            printf(" %d", n_actualLen);
35437            printf(" %d", n_expectedLen);
35438            printf("\n");
35439        }
35440    }
35441    }
35442    }
35443    }
35444    function_tests++;
35445#endif
35446
35447    return(test_ret);
35448}
35449
35450
35451static int
35452test_xmlSchemaValidatePredefinedType(void) {
35453    int test_ret = 0;
35454
35455#if defined(LIBXML_SCHEMAS_ENABLED)
35456    int mem_base;
35457    int ret_val;
35458    xmlSchemaTypePtr type; /* the predefined type */
35459    int n_type;
35460    xmlChar * value; /* the value to check */
35461    int n_value;
35462    xmlSchemaValPtr * val; /* the return computed value */
35463    int n_val;
35464
35465    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35466    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35467    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35468        mem_base = xmlMemBlocks();
35469        type = gen_xmlSchemaTypePtr(n_type, 0);
35470        value = gen_const_xmlChar_ptr(n_value, 1);
35471        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35472
35473        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35474        desret_int(ret_val);
35475        call_tests++;
35476        des_xmlSchemaTypePtr(n_type, type, 0);
35477        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35478        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35479        xmlResetLastError();
35480        if (mem_base != xmlMemBlocks()) {
35481            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35482	           xmlMemBlocks() - mem_base);
35483	    test_ret++;
35484            printf(" %d", n_type);
35485            printf(" %d", n_value);
35486            printf(" %d", n_val);
35487            printf("\n");
35488        }
35489    }
35490    }
35491    }
35492    function_tests++;
35493#endif
35494
35495    return(test_ret);
35496}
35497
35498
35499static int
35500test_xmlSchemaValueAppend(void) {
35501    int test_ret = 0;
35502
35503#if defined(LIBXML_SCHEMAS_ENABLED)
35504    int mem_base;
35505    int ret_val;
35506    xmlSchemaValPtr prev; /* the value */
35507    int n_prev;
35508    xmlSchemaValPtr cur; /* the value to be appended */
35509    int n_cur;
35510
35511    for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35512    for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35513        mem_base = xmlMemBlocks();
35514        prev = gen_xmlSchemaValPtr(n_prev, 0);
35515        cur = gen_xmlSchemaValPtr(n_cur, 1);
35516
35517        ret_val = xmlSchemaValueAppend(prev, cur);
35518        desret_int(ret_val);
35519        call_tests++;
35520        des_xmlSchemaValPtr(n_prev, prev, 0);
35521        des_xmlSchemaValPtr(n_cur, cur, 1);
35522        xmlResetLastError();
35523        if (mem_base != xmlMemBlocks()) {
35524            printf("Leak of %d blocks found in xmlSchemaValueAppend",
35525	           xmlMemBlocks() - mem_base);
35526	    test_ret++;
35527            printf(" %d", n_prev);
35528            printf(" %d", n_cur);
35529            printf("\n");
35530        }
35531    }
35532    }
35533    function_tests++;
35534#endif
35535
35536    return(test_ret);
35537}
35538
35539
35540static int
35541test_xmlSchemaValueGetAsBoolean(void) {
35542    int test_ret = 0;
35543
35544#if defined(LIBXML_SCHEMAS_ENABLED)
35545    int mem_base;
35546    int ret_val;
35547    xmlSchemaValPtr val; /* the value */
35548    int n_val;
35549
35550    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35551        mem_base = xmlMemBlocks();
35552        val = gen_xmlSchemaValPtr(n_val, 0);
35553
35554        ret_val = xmlSchemaValueGetAsBoolean(val);
35555        desret_int(ret_val);
35556        call_tests++;
35557        des_xmlSchemaValPtr(n_val, val, 0);
35558        xmlResetLastError();
35559        if (mem_base != xmlMemBlocks()) {
35560            printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35561	           xmlMemBlocks() - mem_base);
35562	    test_ret++;
35563            printf(" %d", n_val);
35564            printf("\n");
35565        }
35566    }
35567    function_tests++;
35568#endif
35569
35570    return(test_ret);
35571}
35572
35573
35574static int
35575test_xmlSchemaValueGetAsString(void) {
35576    int test_ret = 0;
35577
35578#if defined(LIBXML_SCHEMAS_ENABLED)
35579    int mem_base;
35580    const xmlChar * ret_val;
35581    xmlSchemaValPtr val; /* the value */
35582    int n_val;
35583
35584    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35585        mem_base = xmlMemBlocks();
35586        val = gen_xmlSchemaValPtr(n_val, 0);
35587
35588        ret_val = xmlSchemaValueGetAsString(val);
35589        desret_const_xmlChar_ptr(ret_val);
35590        call_tests++;
35591        des_xmlSchemaValPtr(n_val, val, 0);
35592        xmlResetLastError();
35593        if (mem_base != xmlMemBlocks()) {
35594            printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35595	           xmlMemBlocks() - mem_base);
35596	    test_ret++;
35597            printf(" %d", n_val);
35598            printf("\n");
35599        }
35600    }
35601    function_tests++;
35602#endif
35603
35604    return(test_ret);
35605}
35606
35607
35608static int
35609test_xmlSchemaValueGetNext(void) {
35610    int test_ret = 0;
35611
35612
35613    /* missing type support */
35614    return(test_ret);
35615}
35616
35617
35618static int
35619test_xmlSchemaWhiteSpaceReplace(void) {
35620    int test_ret = 0;
35621
35622#if defined(LIBXML_SCHEMAS_ENABLED)
35623    int mem_base;
35624    xmlChar * ret_val;
35625    xmlChar * value; /* a value */
35626    int n_value;
35627
35628    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35629        mem_base = xmlMemBlocks();
35630        value = gen_const_xmlChar_ptr(n_value, 0);
35631
35632        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35633        desret_xmlChar_ptr(ret_val);
35634        call_tests++;
35635        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35636        xmlResetLastError();
35637        if (mem_base != xmlMemBlocks()) {
35638            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35639	           xmlMemBlocks() - mem_base);
35640	    test_ret++;
35641            printf(" %d", n_value);
35642            printf("\n");
35643        }
35644    }
35645    function_tests++;
35646#endif
35647
35648    return(test_ret);
35649}
35650
35651static int
35652test_xmlschemastypes(void) {
35653    int test_ret = 0;
35654
35655    if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35656    test_ret += test_xmlSchemaCheckFacet();
35657    test_ret += test_xmlSchemaCleanupTypes();
35658    test_ret += test_xmlSchemaCollapseString();
35659    test_ret += test_xmlSchemaCompareValues();
35660    test_ret += test_xmlSchemaCompareValuesWhtsp();
35661    test_ret += test_xmlSchemaCopyValue();
35662    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35663    test_ret += test_xmlSchemaGetBuiltInType();
35664    test_ret += test_xmlSchemaGetCanonValue();
35665    test_ret += test_xmlSchemaGetCanonValueWhtsp();
35666    test_ret += test_xmlSchemaGetFacetValueAsULong();
35667    test_ret += test_xmlSchemaGetPredefinedType();
35668    test_ret += test_xmlSchemaGetValType();
35669    test_ret += test_xmlSchemaInitTypes();
35670    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35671    test_ret += test_xmlSchemaNewFacet();
35672    test_ret += test_xmlSchemaNewNOTATIONValue();
35673    test_ret += test_xmlSchemaNewQNameValue();
35674    test_ret += test_xmlSchemaNewStringValue();
35675    test_ret += test_xmlSchemaValPredefTypeNode();
35676    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35677    test_ret += test_xmlSchemaValidateFacet();
35678    test_ret += test_xmlSchemaValidateFacetWhtsp();
35679    test_ret += test_xmlSchemaValidateLengthFacet();
35680    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35681    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35682    test_ret += test_xmlSchemaValidatePredefinedType();
35683    test_ret += test_xmlSchemaValueAppend();
35684    test_ret += test_xmlSchemaValueGetAsBoolean();
35685    test_ret += test_xmlSchemaValueGetAsString();
35686    test_ret += test_xmlSchemaValueGetNext();
35687    test_ret += test_xmlSchemaWhiteSpaceReplace();
35688
35689    if (test_ret != 0)
35690	printf("Module xmlschemastypes: %d errors\n", test_ret);
35691    return(test_ret);
35692}
35693
35694static int
35695test_xmlCharStrdup(void) {
35696    int test_ret = 0;
35697
35698    int mem_base;
35699    xmlChar * ret_val;
35700    char * cur; /* the input char * */
35701    int n_cur;
35702
35703    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35704        mem_base = xmlMemBlocks();
35705        cur = gen_const_char_ptr(n_cur, 0);
35706
35707        ret_val = xmlCharStrdup((const char *)cur);
35708        desret_xmlChar_ptr(ret_val);
35709        call_tests++;
35710        des_const_char_ptr(n_cur, (const char *)cur, 0);
35711        xmlResetLastError();
35712        if (mem_base != xmlMemBlocks()) {
35713            printf("Leak of %d blocks found in xmlCharStrdup",
35714	           xmlMemBlocks() - mem_base);
35715	    test_ret++;
35716            printf(" %d", n_cur);
35717            printf("\n");
35718        }
35719    }
35720    function_tests++;
35721
35722    return(test_ret);
35723}
35724
35725
35726static int
35727test_xmlCharStrndup(void) {
35728    int test_ret = 0;
35729
35730    int mem_base;
35731    xmlChar * ret_val;
35732    char * cur; /* the input char * */
35733    int n_cur;
35734    int len; /* the len of @cur */
35735    int n_len;
35736
35737    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35738    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35739        mem_base = xmlMemBlocks();
35740        cur = gen_const_char_ptr(n_cur, 0);
35741        len = gen_int(n_len, 1);
35742
35743        ret_val = xmlCharStrndup((const char *)cur, len);
35744        desret_xmlChar_ptr(ret_val);
35745        call_tests++;
35746        des_const_char_ptr(n_cur, (const char *)cur, 0);
35747        des_int(n_len, len, 1);
35748        xmlResetLastError();
35749        if (mem_base != xmlMemBlocks()) {
35750            printf("Leak of %d blocks found in xmlCharStrndup",
35751	           xmlMemBlocks() - mem_base);
35752	    test_ret++;
35753            printf(" %d", n_cur);
35754            printf(" %d", n_len);
35755            printf("\n");
35756        }
35757    }
35758    }
35759    function_tests++;
35760
35761    return(test_ret);
35762}
35763
35764
35765static int
35766test_xmlCheckUTF8(void) {
35767    int test_ret = 0;
35768
35769    int mem_base;
35770    int ret_val;
35771    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35772    int n_utf;
35773
35774    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35775        mem_base = xmlMemBlocks();
35776        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35777
35778        ret_val = xmlCheckUTF8((const unsigned char *)utf);
35779        desret_int(ret_val);
35780        call_tests++;
35781        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35782        xmlResetLastError();
35783        if (mem_base != xmlMemBlocks()) {
35784            printf("Leak of %d blocks found in xmlCheckUTF8",
35785	           xmlMemBlocks() - mem_base);
35786	    test_ret++;
35787            printf(" %d", n_utf);
35788            printf("\n");
35789        }
35790    }
35791    function_tests++;
35792
35793    return(test_ret);
35794}
35795
35796
35797static int
35798test_xmlGetUTF8Char(void) {
35799    int test_ret = 0;
35800
35801    int mem_base;
35802    int ret_val;
35803    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35804    int n_utf;
35805    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. */
35806    int n_len;
35807
35808    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35809    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35810        mem_base = xmlMemBlocks();
35811        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35812        len = gen_int_ptr(n_len, 1);
35813
35814        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35815        desret_int(ret_val);
35816        call_tests++;
35817        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35818        des_int_ptr(n_len, len, 1);
35819        xmlResetLastError();
35820        if (mem_base != xmlMemBlocks()) {
35821            printf("Leak of %d blocks found in xmlGetUTF8Char",
35822	           xmlMemBlocks() - mem_base);
35823	    test_ret++;
35824            printf(" %d", n_utf);
35825            printf(" %d", n_len);
35826            printf("\n");
35827        }
35828    }
35829    }
35830    function_tests++;
35831
35832    return(test_ret);
35833}
35834
35835
35836static int
35837test_xmlStrEqual(void) {
35838    int test_ret = 0;
35839
35840    int mem_base;
35841    int ret_val;
35842    xmlChar * str1; /* the first xmlChar * */
35843    int n_str1;
35844    xmlChar * str2; /* the second xmlChar * */
35845    int n_str2;
35846
35847    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35848    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35849        mem_base = xmlMemBlocks();
35850        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35851        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35852
35853        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
35854        desret_int(ret_val);
35855        call_tests++;
35856        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35857        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35858        xmlResetLastError();
35859        if (mem_base != xmlMemBlocks()) {
35860            printf("Leak of %d blocks found in xmlStrEqual",
35861	           xmlMemBlocks() - mem_base);
35862	    test_ret++;
35863            printf(" %d", n_str1);
35864            printf(" %d", n_str2);
35865            printf("\n");
35866        }
35867    }
35868    }
35869    function_tests++;
35870
35871    return(test_ret);
35872}
35873
35874
35875static int
35876test_xmlStrPrintf(void) {
35877    int test_ret = 0;
35878
35879
35880    /* missing type support */
35881    return(test_ret);
35882}
35883
35884
35885static int
35886test_xmlStrQEqual(void) {
35887    int test_ret = 0;
35888
35889    int mem_base;
35890    int ret_val;
35891    xmlChar * pref; /* the prefix of the QName */
35892    int n_pref;
35893    xmlChar * name; /* the localname of the QName */
35894    int n_name;
35895    xmlChar * str; /* the second xmlChar * */
35896    int n_str;
35897
35898    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
35899    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35900    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35901        mem_base = xmlMemBlocks();
35902        pref = gen_const_xmlChar_ptr(n_pref, 0);
35903        name = gen_const_xmlChar_ptr(n_name, 1);
35904        str = gen_const_xmlChar_ptr(n_str, 2);
35905
35906        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
35907        desret_int(ret_val);
35908        call_tests++;
35909        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
35910        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
35911        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
35912        xmlResetLastError();
35913        if (mem_base != xmlMemBlocks()) {
35914            printf("Leak of %d blocks found in xmlStrQEqual",
35915	           xmlMemBlocks() - mem_base);
35916	    test_ret++;
35917            printf(" %d", n_pref);
35918            printf(" %d", n_name);
35919            printf(" %d", n_str);
35920            printf("\n");
35921        }
35922    }
35923    }
35924    }
35925    function_tests++;
35926
35927    return(test_ret);
35928}
35929
35930
35931static int
35932test_xmlStrVPrintf(void) {
35933    int test_ret = 0;
35934
35935
35936    /* missing type support */
35937    return(test_ret);
35938}
35939
35940
35941static int
35942test_xmlStrcasecmp(void) {
35943    int test_ret = 0;
35944
35945    int mem_base;
35946    int ret_val;
35947    xmlChar * str1; /* the first xmlChar * */
35948    int n_str1;
35949    xmlChar * str2; /* the second xmlChar * */
35950    int n_str2;
35951
35952    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35953    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35954        mem_base = xmlMemBlocks();
35955        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35956        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35957
35958        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
35959        desret_int(ret_val);
35960        call_tests++;
35961        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35962        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35963        xmlResetLastError();
35964        if (mem_base != xmlMemBlocks()) {
35965            printf("Leak of %d blocks found in xmlStrcasecmp",
35966	           xmlMemBlocks() - mem_base);
35967	    test_ret++;
35968            printf(" %d", n_str1);
35969            printf(" %d", n_str2);
35970            printf("\n");
35971        }
35972    }
35973    }
35974    function_tests++;
35975
35976    return(test_ret);
35977}
35978
35979
35980static int
35981test_xmlStrcasestr(void) {
35982    int test_ret = 0;
35983
35984    int mem_base;
35985    const xmlChar * ret_val;
35986    xmlChar * str; /* the xmlChar * array (haystack) */
35987    int n_str;
35988    xmlChar * val; /* the xmlChar to search (needle) */
35989    int n_val;
35990
35991    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35992    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
35993        mem_base = xmlMemBlocks();
35994        str = gen_const_xmlChar_ptr(n_str, 0);
35995        val = gen_xmlChar_ptr(n_val, 1);
35996
35997        ret_val = xmlStrcasestr((const xmlChar *)str, val);
35998        desret_const_xmlChar_ptr(ret_val);
35999        call_tests++;
36000        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36001        des_xmlChar_ptr(n_val, val, 1);
36002        xmlResetLastError();
36003        if (mem_base != xmlMemBlocks()) {
36004            printf("Leak of %d blocks found in xmlStrcasestr",
36005	           xmlMemBlocks() - mem_base);
36006	    test_ret++;
36007            printf(" %d", n_str);
36008            printf(" %d", n_val);
36009            printf("\n");
36010        }
36011    }
36012    }
36013    function_tests++;
36014
36015    return(test_ret);
36016}
36017
36018
36019static int
36020test_xmlStrchr(void) {
36021    int test_ret = 0;
36022
36023    int mem_base;
36024    const xmlChar * ret_val;
36025    xmlChar * str; /* the xmlChar * array */
36026    int n_str;
36027    xmlChar val; /* the xmlChar to search */
36028    int n_val;
36029
36030    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36031    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36032        mem_base = xmlMemBlocks();
36033        str = gen_const_xmlChar_ptr(n_str, 0);
36034        val = gen_xmlChar(n_val, 1);
36035
36036        ret_val = xmlStrchr((const xmlChar *)str, val);
36037        desret_const_xmlChar_ptr(ret_val);
36038        call_tests++;
36039        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36040        des_xmlChar(n_val, val, 1);
36041        xmlResetLastError();
36042        if (mem_base != xmlMemBlocks()) {
36043            printf("Leak of %d blocks found in xmlStrchr",
36044	           xmlMemBlocks() - mem_base);
36045	    test_ret++;
36046            printf(" %d", n_str);
36047            printf(" %d", n_val);
36048            printf("\n");
36049        }
36050    }
36051    }
36052    function_tests++;
36053
36054    return(test_ret);
36055}
36056
36057
36058static int
36059test_xmlStrcmp(void) {
36060    int test_ret = 0;
36061
36062    int mem_base;
36063    int ret_val;
36064    xmlChar * str1; /* the first xmlChar * */
36065    int n_str1;
36066    xmlChar * str2; /* the second xmlChar * */
36067    int n_str2;
36068
36069    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36070    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36071        mem_base = xmlMemBlocks();
36072        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36073        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36074
36075        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36076        desret_int(ret_val);
36077        call_tests++;
36078        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36079        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36080        xmlResetLastError();
36081        if (mem_base != xmlMemBlocks()) {
36082            printf("Leak of %d blocks found in xmlStrcmp",
36083	           xmlMemBlocks() - mem_base);
36084	    test_ret++;
36085            printf(" %d", n_str1);
36086            printf(" %d", n_str2);
36087            printf("\n");
36088        }
36089    }
36090    }
36091    function_tests++;
36092
36093    return(test_ret);
36094}
36095
36096
36097static int
36098test_xmlStrdup(void) {
36099    int test_ret = 0;
36100
36101    int mem_base;
36102    xmlChar * ret_val;
36103    xmlChar * cur; /* the input xmlChar * */
36104    int n_cur;
36105
36106    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36107        mem_base = xmlMemBlocks();
36108        cur = gen_const_xmlChar_ptr(n_cur, 0);
36109
36110        ret_val = xmlStrdup((const xmlChar *)cur);
36111        desret_xmlChar_ptr(ret_val);
36112        call_tests++;
36113        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36114        xmlResetLastError();
36115        if (mem_base != xmlMemBlocks()) {
36116            printf("Leak of %d blocks found in xmlStrdup",
36117	           xmlMemBlocks() - mem_base);
36118	    test_ret++;
36119            printf(" %d", n_cur);
36120            printf("\n");
36121        }
36122    }
36123    function_tests++;
36124
36125    return(test_ret);
36126}
36127
36128
36129static int
36130test_xmlStrlen(void) {
36131    int test_ret = 0;
36132
36133    int mem_base;
36134    int ret_val;
36135    xmlChar * str; /* the xmlChar * array */
36136    int n_str;
36137
36138    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36139        mem_base = xmlMemBlocks();
36140        str = gen_const_xmlChar_ptr(n_str, 0);
36141
36142        ret_val = xmlStrlen((const xmlChar *)str);
36143        desret_int(ret_val);
36144        call_tests++;
36145        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36146        xmlResetLastError();
36147        if (mem_base != xmlMemBlocks()) {
36148            printf("Leak of %d blocks found in xmlStrlen",
36149	           xmlMemBlocks() - mem_base);
36150	    test_ret++;
36151            printf(" %d", n_str);
36152            printf("\n");
36153        }
36154    }
36155    function_tests++;
36156
36157    return(test_ret);
36158}
36159
36160
36161static int
36162test_xmlStrncasecmp(void) {
36163    int test_ret = 0;
36164
36165    int mem_base;
36166    int ret_val;
36167    xmlChar * str1; /* the first xmlChar * */
36168    int n_str1;
36169    xmlChar * str2; /* the second xmlChar * */
36170    int n_str2;
36171    int len; /* the max comparison length */
36172    int n_len;
36173
36174    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36175    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36176    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36177        mem_base = xmlMemBlocks();
36178        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36179        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36180        len = gen_int(n_len, 2);
36181
36182        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36183        desret_int(ret_val);
36184        call_tests++;
36185        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36186        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36187        des_int(n_len, len, 2);
36188        xmlResetLastError();
36189        if (mem_base != xmlMemBlocks()) {
36190            printf("Leak of %d blocks found in xmlStrncasecmp",
36191	           xmlMemBlocks() - mem_base);
36192	    test_ret++;
36193            printf(" %d", n_str1);
36194            printf(" %d", n_str2);
36195            printf(" %d", n_len);
36196            printf("\n");
36197        }
36198    }
36199    }
36200    }
36201    function_tests++;
36202
36203    return(test_ret);
36204}
36205
36206
36207static int
36208test_xmlStrncatNew(void) {
36209    int test_ret = 0;
36210
36211    int mem_base;
36212    xmlChar * ret_val;
36213    xmlChar * str1; /* first xmlChar string */
36214    int n_str1;
36215    xmlChar * str2; /* second xmlChar string */
36216    int n_str2;
36217    int len; /* the len of @str2 or < 0 */
36218    int n_len;
36219
36220    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36221    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36222    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36223        mem_base = xmlMemBlocks();
36224        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36225        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36226        len = gen_int(n_len, 2);
36227
36228        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36229        desret_xmlChar_ptr(ret_val);
36230        call_tests++;
36231        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36232        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36233        des_int(n_len, len, 2);
36234        xmlResetLastError();
36235        if (mem_base != xmlMemBlocks()) {
36236            printf("Leak of %d blocks found in xmlStrncatNew",
36237	           xmlMemBlocks() - mem_base);
36238	    test_ret++;
36239            printf(" %d", n_str1);
36240            printf(" %d", n_str2);
36241            printf(" %d", n_len);
36242            printf("\n");
36243        }
36244    }
36245    }
36246    }
36247    function_tests++;
36248
36249    return(test_ret);
36250}
36251
36252
36253static int
36254test_xmlStrncmp(void) {
36255    int test_ret = 0;
36256
36257    int mem_base;
36258    int ret_val;
36259    xmlChar * str1; /* the first xmlChar * */
36260    int n_str1;
36261    xmlChar * str2; /* the second xmlChar * */
36262    int n_str2;
36263    int len; /* the max comparison length */
36264    int n_len;
36265
36266    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36267    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36268    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36269        mem_base = xmlMemBlocks();
36270        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36271        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36272        len = gen_int(n_len, 2);
36273
36274        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36275        desret_int(ret_val);
36276        call_tests++;
36277        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36278        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36279        des_int(n_len, len, 2);
36280        xmlResetLastError();
36281        if (mem_base != xmlMemBlocks()) {
36282            printf("Leak of %d blocks found in xmlStrncmp",
36283	           xmlMemBlocks() - mem_base);
36284	    test_ret++;
36285            printf(" %d", n_str1);
36286            printf(" %d", n_str2);
36287            printf(" %d", n_len);
36288            printf("\n");
36289        }
36290    }
36291    }
36292    }
36293    function_tests++;
36294
36295    return(test_ret);
36296}
36297
36298
36299static int
36300test_xmlStrndup(void) {
36301    int test_ret = 0;
36302
36303    int mem_base;
36304    xmlChar * ret_val;
36305    xmlChar * cur; /* the input xmlChar * */
36306    int n_cur;
36307    int len; /* the len of @cur */
36308    int n_len;
36309
36310    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36311    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36312        mem_base = xmlMemBlocks();
36313        cur = gen_const_xmlChar_ptr(n_cur, 0);
36314        len = gen_int(n_len, 1);
36315
36316        ret_val = xmlStrndup((const xmlChar *)cur, len);
36317        desret_xmlChar_ptr(ret_val);
36318        call_tests++;
36319        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36320        des_int(n_len, len, 1);
36321        xmlResetLastError();
36322        if (mem_base != xmlMemBlocks()) {
36323            printf("Leak of %d blocks found in xmlStrndup",
36324	           xmlMemBlocks() - mem_base);
36325	    test_ret++;
36326            printf(" %d", n_cur);
36327            printf(" %d", n_len);
36328            printf("\n");
36329        }
36330    }
36331    }
36332    function_tests++;
36333
36334    return(test_ret);
36335}
36336
36337
36338static int
36339test_xmlStrstr(void) {
36340    int test_ret = 0;
36341
36342    int mem_base;
36343    const xmlChar * ret_val;
36344    xmlChar * str; /* the xmlChar * array (haystack) */
36345    int n_str;
36346    xmlChar * val; /* the xmlChar to search (needle) */
36347    int n_val;
36348
36349    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36350    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36351        mem_base = xmlMemBlocks();
36352        str = gen_const_xmlChar_ptr(n_str, 0);
36353        val = gen_const_xmlChar_ptr(n_val, 1);
36354
36355        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36356        desret_const_xmlChar_ptr(ret_val);
36357        call_tests++;
36358        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36359        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36360        xmlResetLastError();
36361        if (mem_base != xmlMemBlocks()) {
36362            printf("Leak of %d blocks found in xmlStrstr",
36363	           xmlMemBlocks() - mem_base);
36364	    test_ret++;
36365            printf(" %d", n_str);
36366            printf(" %d", n_val);
36367            printf("\n");
36368        }
36369    }
36370    }
36371    function_tests++;
36372
36373    return(test_ret);
36374}
36375
36376
36377static int
36378test_xmlStrsub(void) {
36379    int test_ret = 0;
36380
36381    int mem_base;
36382    xmlChar * ret_val;
36383    xmlChar * str; /* the xmlChar * array (haystack) */
36384    int n_str;
36385    int start; /* the index of the first char (zero based) */
36386    int n_start;
36387    int len; /* the length of the substring */
36388    int n_len;
36389
36390    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36391    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36392    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36393        mem_base = xmlMemBlocks();
36394        str = gen_const_xmlChar_ptr(n_str, 0);
36395        start = gen_int(n_start, 1);
36396        len = gen_int(n_len, 2);
36397
36398        ret_val = xmlStrsub((const xmlChar *)str, start, len);
36399        desret_xmlChar_ptr(ret_val);
36400        call_tests++;
36401        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36402        des_int(n_start, start, 1);
36403        des_int(n_len, len, 2);
36404        xmlResetLastError();
36405        if (mem_base != xmlMemBlocks()) {
36406            printf("Leak of %d blocks found in xmlStrsub",
36407	           xmlMemBlocks() - mem_base);
36408	    test_ret++;
36409            printf(" %d", n_str);
36410            printf(" %d", n_start);
36411            printf(" %d", n_len);
36412            printf("\n");
36413        }
36414    }
36415    }
36416    }
36417    function_tests++;
36418
36419    return(test_ret);
36420}
36421
36422
36423static int
36424test_xmlUTF8Charcmp(void) {
36425    int test_ret = 0;
36426
36427    int mem_base;
36428    int ret_val;
36429    xmlChar * utf1; /* pointer to first UTF8 char */
36430    int n_utf1;
36431    xmlChar * utf2; /* pointer to second UTF8 char */
36432    int n_utf2;
36433
36434    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36435    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36436        mem_base = xmlMemBlocks();
36437        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36438        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36439
36440        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36441        desret_int(ret_val);
36442        call_tests++;
36443        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36444        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36445        xmlResetLastError();
36446        if (mem_base != xmlMemBlocks()) {
36447            printf("Leak of %d blocks found in xmlUTF8Charcmp",
36448	           xmlMemBlocks() - mem_base);
36449	    test_ret++;
36450            printf(" %d", n_utf1);
36451            printf(" %d", n_utf2);
36452            printf("\n");
36453        }
36454    }
36455    }
36456    function_tests++;
36457
36458    return(test_ret);
36459}
36460
36461
36462static int
36463test_xmlUTF8Size(void) {
36464    int test_ret = 0;
36465
36466    int mem_base;
36467    int ret_val;
36468    xmlChar * utf; /* pointer to the UTF8 character */
36469    int n_utf;
36470
36471    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36472        mem_base = xmlMemBlocks();
36473        utf = gen_const_xmlChar_ptr(n_utf, 0);
36474
36475        ret_val = xmlUTF8Size((const xmlChar *)utf);
36476        desret_int(ret_val);
36477        call_tests++;
36478        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36479        xmlResetLastError();
36480        if (mem_base != xmlMemBlocks()) {
36481            printf("Leak of %d blocks found in xmlUTF8Size",
36482	           xmlMemBlocks() - mem_base);
36483	    test_ret++;
36484            printf(" %d", n_utf);
36485            printf("\n");
36486        }
36487    }
36488    function_tests++;
36489
36490    return(test_ret);
36491}
36492
36493
36494static int
36495test_xmlUTF8Strlen(void) {
36496    int test_ret = 0;
36497
36498    int mem_base;
36499    int ret_val;
36500    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36501    int n_utf;
36502
36503    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36504        mem_base = xmlMemBlocks();
36505        utf = gen_const_xmlChar_ptr(n_utf, 0);
36506
36507        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36508        desret_int(ret_val);
36509        call_tests++;
36510        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36511        xmlResetLastError();
36512        if (mem_base != xmlMemBlocks()) {
36513            printf("Leak of %d blocks found in xmlUTF8Strlen",
36514	           xmlMemBlocks() - mem_base);
36515	    test_ret++;
36516            printf(" %d", n_utf);
36517            printf("\n");
36518        }
36519    }
36520    function_tests++;
36521
36522    return(test_ret);
36523}
36524
36525
36526static int
36527test_xmlUTF8Strloc(void) {
36528    int test_ret = 0;
36529
36530    int mem_base;
36531    int ret_val;
36532    xmlChar * utf; /* the input UTF8 * */
36533    int n_utf;
36534    xmlChar * utfchar; /* the UTF8 character to be found */
36535    int n_utfchar;
36536
36537    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36538    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36539        mem_base = xmlMemBlocks();
36540        utf = gen_const_xmlChar_ptr(n_utf, 0);
36541        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36542
36543        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36544        desret_int(ret_val);
36545        call_tests++;
36546        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36547        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36548        xmlResetLastError();
36549        if (mem_base != xmlMemBlocks()) {
36550            printf("Leak of %d blocks found in xmlUTF8Strloc",
36551	           xmlMemBlocks() - mem_base);
36552	    test_ret++;
36553            printf(" %d", n_utf);
36554            printf(" %d", n_utfchar);
36555            printf("\n");
36556        }
36557    }
36558    }
36559    function_tests++;
36560
36561    return(test_ret);
36562}
36563
36564
36565static int
36566test_xmlUTF8Strndup(void) {
36567    int test_ret = 0;
36568
36569    int mem_base;
36570    xmlChar * ret_val;
36571    xmlChar * utf; /* the input UTF8 * */
36572    int n_utf;
36573    int len; /* the len of @utf (in chars) */
36574    int n_len;
36575
36576    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36577    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36578        mem_base = xmlMemBlocks();
36579        utf = gen_const_xmlChar_ptr(n_utf, 0);
36580        len = gen_int(n_len, 1);
36581
36582        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36583        desret_xmlChar_ptr(ret_val);
36584        call_tests++;
36585        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36586        des_int(n_len, len, 1);
36587        xmlResetLastError();
36588        if (mem_base != xmlMemBlocks()) {
36589            printf("Leak of %d blocks found in xmlUTF8Strndup",
36590	           xmlMemBlocks() - mem_base);
36591	    test_ret++;
36592            printf(" %d", n_utf);
36593            printf(" %d", n_len);
36594            printf("\n");
36595        }
36596    }
36597    }
36598    function_tests++;
36599
36600    return(test_ret);
36601}
36602
36603
36604static int
36605test_xmlUTF8Strpos(void) {
36606    int test_ret = 0;
36607
36608    int mem_base;
36609    const xmlChar * ret_val;
36610    xmlChar * utf; /* the input UTF8 * */
36611    int n_utf;
36612    int pos; /* the position of the desired UTF8 char (in chars) */
36613    int n_pos;
36614
36615    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36616    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36617        mem_base = xmlMemBlocks();
36618        utf = gen_const_xmlChar_ptr(n_utf, 0);
36619        pos = gen_int(n_pos, 1);
36620
36621        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36622        desret_const_xmlChar_ptr(ret_val);
36623        call_tests++;
36624        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36625        des_int(n_pos, pos, 1);
36626        xmlResetLastError();
36627        if (mem_base != xmlMemBlocks()) {
36628            printf("Leak of %d blocks found in xmlUTF8Strpos",
36629	           xmlMemBlocks() - mem_base);
36630	    test_ret++;
36631            printf(" %d", n_utf);
36632            printf(" %d", n_pos);
36633            printf("\n");
36634        }
36635    }
36636    }
36637    function_tests++;
36638
36639    return(test_ret);
36640}
36641
36642
36643static int
36644test_xmlUTF8Strsize(void) {
36645    int test_ret = 0;
36646
36647    int mem_base;
36648    int ret_val;
36649    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36650    int n_utf;
36651    int len; /* the number of characters in the array */
36652    int n_len;
36653
36654    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36655    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36656        mem_base = xmlMemBlocks();
36657        utf = gen_const_xmlChar_ptr(n_utf, 0);
36658        len = gen_int(n_len, 1);
36659
36660        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36661        desret_int(ret_val);
36662        call_tests++;
36663        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36664        des_int(n_len, len, 1);
36665        xmlResetLastError();
36666        if (mem_base != xmlMemBlocks()) {
36667            printf("Leak of %d blocks found in xmlUTF8Strsize",
36668	           xmlMemBlocks() - mem_base);
36669	    test_ret++;
36670            printf(" %d", n_utf);
36671            printf(" %d", n_len);
36672            printf("\n");
36673        }
36674    }
36675    }
36676    function_tests++;
36677
36678    return(test_ret);
36679}
36680
36681
36682static int
36683test_xmlUTF8Strsub(void) {
36684    int test_ret = 0;
36685
36686    int mem_base;
36687    xmlChar * ret_val;
36688    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36689    int n_utf;
36690    int start; /* relative pos of first char */
36691    int n_start;
36692    int len; /* total number to copy */
36693    int n_len;
36694
36695    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36696    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36697    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36698        mem_base = xmlMemBlocks();
36699        utf = gen_const_xmlChar_ptr(n_utf, 0);
36700        start = gen_int(n_start, 1);
36701        len = gen_int(n_len, 2);
36702
36703        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36704        desret_xmlChar_ptr(ret_val);
36705        call_tests++;
36706        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36707        des_int(n_start, start, 1);
36708        des_int(n_len, len, 2);
36709        xmlResetLastError();
36710        if (mem_base != xmlMemBlocks()) {
36711            printf("Leak of %d blocks found in xmlUTF8Strsub",
36712	           xmlMemBlocks() - mem_base);
36713	    test_ret++;
36714            printf(" %d", n_utf);
36715            printf(" %d", n_start);
36716            printf(" %d", n_len);
36717            printf("\n");
36718        }
36719    }
36720    }
36721    }
36722    function_tests++;
36723
36724    return(test_ret);
36725}
36726
36727static int
36728test_xmlstring(void) {
36729    int test_ret = 0;
36730
36731    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36732    test_ret += test_xmlCharStrdup();
36733    test_ret += test_xmlCharStrndup();
36734    test_ret += test_xmlCheckUTF8();
36735    test_ret += test_xmlGetUTF8Char();
36736    test_ret += test_xmlStrEqual();
36737    test_ret += test_xmlStrPrintf();
36738    test_ret += test_xmlStrQEqual();
36739    test_ret += test_xmlStrVPrintf();
36740    test_ret += test_xmlStrcasecmp();
36741    test_ret += test_xmlStrcasestr();
36742    test_ret += test_xmlStrchr();
36743    test_ret += test_xmlStrcmp();
36744    test_ret += test_xmlStrdup();
36745    test_ret += test_xmlStrlen();
36746    test_ret += test_xmlStrncasecmp();
36747    test_ret += test_xmlStrncatNew();
36748    test_ret += test_xmlStrncmp();
36749    test_ret += test_xmlStrndup();
36750    test_ret += test_xmlStrstr();
36751    test_ret += test_xmlStrsub();
36752    test_ret += test_xmlUTF8Charcmp();
36753    test_ret += test_xmlUTF8Size();
36754    test_ret += test_xmlUTF8Strlen();
36755    test_ret += test_xmlUTF8Strloc();
36756    test_ret += test_xmlUTF8Strndup();
36757    test_ret += test_xmlUTF8Strpos();
36758    test_ret += test_xmlUTF8Strsize();
36759    test_ret += test_xmlUTF8Strsub();
36760
36761    if (test_ret != 0)
36762	printf("Module xmlstring: %d errors\n", test_ret);
36763    return(test_ret);
36764}
36765
36766static int
36767test_xmlUCSIsAegeanNumbers(void) {
36768    int test_ret = 0;
36769
36770#if defined(LIBXML_UNICODE_ENABLED)
36771    int mem_base;
36772    int ret_val;
36773    int code; /* UCS code point */
36774    int n_code;
36775
36776    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36777        mem_base = xmlMemBlocks();
36778        code = gen_int(n_code, 0);
36779
36780        ret_val = xmlUCSIsAegeanNumbers(code);
36781        desret_int(ret_val);
36782        call_tests++;
36783        des_int(n_code, code, 0);
36784        xmlResetLastError();
36785        if (mem_base != xmlMemBlocks()) {
36786            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36787	           xmlMemBlocks() - mem_base);
36788	    test_ret++;
36789            printf(" %d", n_code);
36790            printf("\n");
36791        }
36792    }
36793    function_tests++;
36794#endif
36795
36796    return(test_ret);
36797}
36798
36799
36800static int
36801test_xmlUCSIsAlphabeticPresentationForms(void) {
36802    int test_ret = 0;
36803
36804#if defined(LIBXML_UNICODE_ENABLED)
36805    int mem_base;
36806    int ret_val;
36807    int code; /* UCS code point */
36808    int n_code;
36809
36810    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36811        mem_base = xmlMemBlocks();
36812        code = gen_int(n_code, 0);
36813
36814        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36815        desret_int(ret_val);
36816        call_tests++;
36817        des_int(n_code, code, 0);
36818        xmlResetLastError();
36819        if (mem_base != xmlMemBlocks()) {
36820            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36821	           xmlMemBlocks() - mem_base);
36822	    test_ret++;
36823            printf(" %d", n_code);
36824            printf("\n");
36825        }
36826    }
36827    function_tests++;
36828#endif
36829
36830    return(test_ret);
36831}
36832
36833
36834static int
36835test_xmlUCSIsArabic(void) {
36836    int test_ret = 0;
36837
36838#if defined(LIBXML_UNICODE_ENABLED)
36839    int mem_base;
36840    int ret_val;
36841    int code; /* UCS code point */
36842    int n_code;
36843
36844    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36845        mem_base = xmlMemBlocks();
36846        code = gen_int(n_code, 0);
36847
36848        ret_val = xmlUCSIsArabic(code);
36849        desret_int(ret_val);
36850        call_tests++;
36851        des_int(n_code, code, 0);
36852        xmlResetLastError();
36853        if (mem_base != xmlMemBlocks()) {
36854            printf("Leak of %d blocks found in xmlUCSIsArabic",
36855	           xmlMemBlocks() - mem_base);
36856	    test_ret++;
36857            printf(" %d", n_code);
36858            printf("\n");
36859        }
36860    }
36861    function_tests++;
36862#endif
36863
36864    return(test_ret);
36865}
36866
36867
36868static int
36869test_xmlUCSIsArabicPresentationFormsA(void) {
36870    int test_ret = 0;
36871
36872#if defined(LIBXML_UNICODE_ENABLED)
36873    int mem_base;
36874    int ret_val;
36875    int code; /* UCS code point */
36876    int n_code;
36877
36878    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36879        mem_base = xmlMemBlocks();
36880        code = gen_int(n_code, 0);
36881
36882        ret_val = xmlUCSIsArabicPresentationFormsA(code);
36883        desret_int(ret_val);
36884        call_tests++;
36885        des_int(n_code, code, 0);
36886        xmlResetLastError();
36887        if (mem_base != xmlMemBlocks()) {
36888            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
36889	           xmlMemBlocks() - mem_base);
36890	    test_ret++;
36891            printf(" %d", n_code);
36892            printf("\n");
36893        }
36894    }
36895    function_tests++;
36896#endif
36897
36898    return(test_ret);
36899}
36900
36901
36902static int
36903test_xmlUCSIsArabicPresentationFormsB(void) {
36904    int test_ret = 0;
36905
36906#if defined(LIBXML_UNICODE_ENABLED)
36907    int mem_base;
36908    int ret_val;
36909    int code; /* UCS code point */
36910    int n_code;
36911
36912    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36913        mem_base = xmlMemBlocks();
36914        code = gen_int(n_code, 0);
36915
36916        ret_val = xmlUCSIsArabicPresentationFormsB(code);
36917        desret_int(ret_val);
36918        call_tests++;
36919        des_int(n_code, code, 0);
36920        xmlResetLastError();
36921        if (mem_base != xmlMemBlocks()) {
36922            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
36923	           xmlMemBlocks() - mem_base);
36924	    test_ret++;
36925            printf(" %d", n_code);
36926            printf("\n");
36927        }
36928    }
36929    function_tests++;
36930#endif
36931
36932    return(test_ret);
36933}
36934
36935
36936static int
36937test_xmlUCSIsArmenian(void) {
36938    int test_ret = 0;
36939
36940#if defined(LIBXML_UNICODE_ENABLED)
36941    int mem_base;
36942    int ret_val;
36943    int code; /* UCS code point */
36944    int n_code;
36945
36946    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36947        mem_base = xmlMemBlocks();
36948        code = gen_int(n_code, 0);
36949
36950        ret_val = xmlUCSIsArmenian(code);
36951        desret_int(ret_val);
36952        call_tests++;
36953        des_int(n_code, code, 0);
36954        xmlResetLastError();
36955        if (mem_base != xmlMemBlocks()) {
36956            printf("Leak of %d blocks found in xmlUCSIsArmenian",
36957	           xmlMemBlocks() - mem_base);
36958	    test_ret++;
36959            printf(" %d", n_code);
36960            printf("\n");
36961        }
36962    }
36963    function_tests++;
36964#endif
36965
36966    return(test_ret);
36967}
36968
36969
36970static int
36971test_xmlUCSIsArrows(void) {
36972    int test_ret = 0;
36973
36974#if defined(LIBXML_UNICODE_ENABLED)
36975    int mem_base;
36976    int ret_val;
36977    int code; /* UCS code point */
36978    int n_code;
36979
36980    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36981        mem_base = xmlMemBlocks();
36982        code = gen_int(n_code, 0);
36983
36984        ret_val = xmlUCSIsArrows(code);
36985        desret_int(ret_val);
36986        call_tests++;
36987        des_int(n_code, code, 0);
36988        xmlResetLastError();
36989        if (mem_base != xmlMemBlocks()) {
36990            printf("Leak of %d blocks found in xmlUCSIsArrows",
36991	           xmlMemBlocks() - mem_base);
36992	    test_ret++;
36993            printf(" %d", n_code);
36994            printf("\n");
36995        }
36996    }
36997    function_tests++;
36998#endif
36999
37000    return(test_ret);
37001}
37002
37003
37004static int
37005test_xmlUCSIsBasicLatin(void) {
37006    int test_ret = 0;
37007
37008#if defined(LIBXML_UNICODE_ENABLED)
37009    int mem_base;
37010    int ret_val;
37011    int code; /* UCS code point */
37012    int n_code;
37013
37014    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37015        mem_base = xmlMemBlocks();
37016        code = gen_int(n_code, 0);
37017
37018        ret_val = xmlUCSIsBasicLatin(code);
37019        desret_int(ret_val);
37020        call_tests++;
37021        des_int(n_code, code, 0);
37022        xmlResetLastError();
37023        if (mem_base != xmlMemBlocks()) {
37024            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37025	           xmlMemBlocks() - mem_base);
37026	    test_ret++;
37027            printf(" %d", n_code);
37028            printf("\n");
37029        }
37030    }
37031    function_tests++;
37032#endif
37033
37034    return(test_ret);
37035}
37036
37037
37038static int
37039test_xmlUCSIsBengali(void) {
37040    int test_ret = 0;
37041
37042#if defined(LIBXML_UNICODE_ENABLED)
37043    int mem_base;
37044    int ret_val;
37045    int code; /* UCS code point */
37046    int n_code;
37047
37048    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37049        mem_base = xmlMemBlocks();
37050        code = gen_int(n_code, 0);
37051
37052        ret_val = xmlUCSIsBengali(code);
37053        desret_int(ret_val);
37054        call_tests++;
37055        des_int(n_code, code, 0);
37056        xmlResetLastError();
37057        if (mem_base != xmlMemBlocks()) {
37058            printf("Leak of %d blocks found in xmlUCSIsBengali",
37059	           xmlMemBlocks() - mem_base);
37060	    test_ret++;
37061            printf(" %d", n_code);
37062            printf("\n");
37063        }
37064    }
37065    function_tests++;
37066#endif
37067
37068    return(test_ret);
37069}
37070
37071
37072static int
37073test_xmlUCSIsBlock(void) {
37074    int test_ret = 0;
37075
37076#if defined(LIBXML_UNICODE_ENABLED)
37077    int mem_base;
37078    int ret_val;
37079    int code; /* UCS code point */
37080    int n_code;
37081    char * block; /* UCS block name */
37082    int n_block;
37083
37084    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37085    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37086        mem_base = xmlMemBlocks();
37087        code = gen_int(n_code, 0);
37088        block = gen_const_char_ptr(n_block, 1);
37089
37090        ret_val = xmlUCSIsBlock(code, (const char *)block);
37091        desret_int(ret_val);
37092        call_tests++;
37093        des_int(n_code, code, 0);
37094        des_const_char_ptr(n_block, (const char *)block, 1);
37095        xmlResetLastError();
37096        if (mem_base != xmlMemBlocks()) {
37097            printf("Leak of %d blocks found in xmlUCSIsBlock",
37098	           xmlMemBlocks() - mem_base);
37099	    test_ret++;
37100            printf(" %d", n_code);
37101            printf(" %d", n_block);
37102            printf("\n");
37103        }
37104    }
37105    }
37106    function_tests++;
37107#endif
37108
37109    return(test_ret);
37110}
37111
37112
37113static int
37114test_xmlUCSIsBlockElements(void) {
37115    int test_ret = 0;
37116
37117#if defined(LIBXML_UNICODE_ENABLED)
37118    int mem_base;
37119    int ret_val;
37120    int code; /* UCS code point */
37121    int n_code;
37122
37123    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37124        mem_base = xmlMemBlocks();
37125        code = gen_int(n_code, 0);
37126
37127        ret_val = xmlUCSIsBlockElements(code);
37128        desret_int(ret_val);
37129        call_tests++;
37130        des_int(n_code, code, 0);
37131        xmlResetLastError();
37132        if (mem_base != xmlMemBlocks()) {
37133            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37134	           xmlMemBlocks() - mem_base);
37135	    test_ret++;
37136            printf(" %d", n_code);
37137            printf("\n");
37138        }
37139    }
37140    function_tests++;
37141#endif
37142
37143    return(test_ret);
37144}
37145
37146
37147static int
37148test_xmlUCSIsBopomofo(void) {
37149    int test_ret = 0;
37150
37151#if defined(LIBXML_UNICODE_ENABLED)
37152    int mem_base;
37153    int ret_val;
37154    int code; /* UCS code point */
37155    int n_code;
37156
37157    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37158        mem_base = xmlMemBlocks();
37159        code = gen_int(n_code, 0);
37160
37161        ret_val = xmlUCSIsBopomofo(code);
37162        desret_int(ret_val);
37163        call_tests++;
37164        des_int(n_code, code, 0);
37165        xmlResetLastError();
37166        if (mem_base != xmlMemBlocks()) {
37167            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37168	           xmlMemBlocks() - mem_base);
37169	    test_ret++;
37170            printf(" %d", n_code);
37171            printf("\n");
37172        }
37173    }
37174    function_tests++;
37175#endif
37176
37177    return(test_ret);
37178}
37179
37180
37181static int
37182test_xmlUCSIsBopomofoExtended(void) {
37183    int test_ret = 0;
37184
37185#if defined(LIBXML_UNICODE_ENABLED)
37186    int mem_base;
37187    int ret_val;
37188    int code; /* UCS code point */
37189    int n_code;
37190
37191    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37192        mem_base = xmlMemBlocks();
37193        code = gen_int(n_code, 0);
37194
37195        ret_val = xmlUCSIsBopomofoExtended(code);
37196        desret_int(ret_val);
37197        call_tests++;
37198        des_int(n_code, code, 0);
37199        xmlResetLastError();
37200        if (mem_base != xmlMemBlocks()) {
37201            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37202	           xmlMemBlocks() - mem_base);
37203	    test_ret++;
37204            printf(" %d", n_code);
37205            printf("\n");
37206        }
37207    }
37208    function_tests++;
37209#endif
37210
37211    return(test_ret);
37212}
37213
37214
37215static int
37216test_xmlUCSIsBoxDrawing(void) {
37217    int test_ret = 0;
37218
37219#if defined(LIBXML_UNICODE_ENABLED)
37220    int mem_base;
37221    int ret_val;
37222    int code; /* UCS code point */
37223    int n_code;
37224
37225    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37226        mem_base = xmlMemBlocks();
37227        code = gen_int(n_code, 0);
37228
37229        ret_val = xmlUCSIsBoxDrawing(code);
37230        desret_int(ret_val);
37231        call_tests++;
37232        des_int(n_code, code, 0);
37233        xmlResetLastError();
37234        if (mem_base != xmlMemBlocks()) {
37235            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37236	           xmlMemBlocks() - mem_base);
37237	    test_ret++;
37238            printf(" %d", n_code);
37239            printf("\n");
37240        }
37241    }
37242    function_tests++;
37243#endif
37244
37245    return(test_ret);
37246}
37247
37248
37249static int
37250test_xmlUCSIsBraillePatterns(void) {
37251    int test_ret = 0;
37252
37253#if defined(LIBXML_UNICODE_ENABLED)
37254    int mem_base;
37255    int ret_val;
37256    int code; /* UCS code point */
37257    int n_code;
37258
37259    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37260        mem_base = xmlMemBlocks();
37261        code = gen_int(n_code, 0);
37262
37263        ret_val = xmlUCSIsBraillePatterns(code);
37264        desret_int(ret_val);
37265        call_tests++;
37266        des_int(n_code, code, 0);
37267        xmlResetLastError();
37268        if (mem_base != xmlMemBlocks()) {
37269            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37270	           xmlMemBlocks() - mem_base);
37271	    test_ret++;
37272            printf(" %d", n_code);
37273            printf("\n");
37274        }
37275    }
37276    function_tests++;
37277#endif
37278
37279    return(test_ret);
37280}
37281
37282
37283static int
37284test_xmlUCSIsBuhid(void) {
37285    int test_ret = 0;
37286
37287#if defined(LIBXML_UNICODE_ENABLED)
37288    int mem_base;
37289    int ret_val;
37290    int code; /* UCS code point */
37291    int n_code;
37292
37293    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37294        mem_base = xmlMemBlocks();
37295        code = gen_int(n_code, 0);
37296
37297        ret_val = xmlUCSIsBuhid(code);
37298        desret_int(ret_val);
37299        call_tests++;
37300        des_int(n_code, code, 0);
37301        xmlResetLastError();
37302        if (mem_base != xmlMemBlocks()) {
37303            printf("Leak of %d blocks found in xmlUCSIsBuhid",
37304	           xmlMemBlocks() - mem_base);
37305	    test_ret++;
37306            printf(" %d", n_code);
37307            printf("\n");
37308        }
37309    }
37310    function_tests++;
37311#endif
37312
37313    return(test_ret);
37314}
37315
37316
37317static int
37318test_xmlUCSIsByzantineMusicalSymbols(void) {
37319    int test_ret = 0;
37320
37321#if defined(LIBXML_UNICODE_ENABLED)
37322    int mem_base;
37323    int ret_val;
37324    int code; /* UCS code point */
37325    int n_code;
37326
37327    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37328        mem_base = xmlMemBlocks();
37329        code = gen_int(n_code, 0);
37330
37331        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37332        desret_int(ret_val);
37333        call_tests++;
37334        des_int(n_code, code, 0);
37335        xmlResetLastError();
37336        if (mem_base != xmlMemBlocks()) {
37337            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37338	           xmlMemBlocks() - mem_base);
37339	    test_ret++;
37340            printf(" %d", n_code);
37341            printf("\n");
37342        }
37343    }
37344    function_tests++;
37345#endif
37346
37347    return(test_ret);
37348}
37349
37350
37351static int
37352test_xmlUCSIsCJKCompatibility(void) {
37353    int test_ret = 0;
37354
37355#if defined(LIBXML_UNICODE_ENABLED)
37356    int mem_base;
37357    int ret_val;
37358    int code; /* UCS code point */
37359    int n_code;
37360
37361    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37362        mem_base = xmlMemBlocks();
37363        code = gen_int(n_code, 0);
37364
37365        ret_val = xmlUCSIsCJKCompatibility(code);
37366        desret_int(ret_val);
37367        call_tests++;
37368        des_int(n_code, code, 0);
37369        xmlResetLastError();
37370        if (mem_base != xmlMemBlocks()) {
37371            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37372	           xmlMemBlocks() - mem_base);
37373	    test_ret++;
37374            printf(" %d", n_code);
37375            printf("\n");
37376        }
37377    }
37378    function_tests++;
37379#endif
37380
37381    return(test_ret);
37382}
37383
37384
37385static int
37386test_xmlUCSIsCJKCompatibilityForms(void) {
37387    int test_ret = 0;
37388
37389#if defined(LIBXML_UNICODE_ENABLED)
37390    int mem_base;
37391    int ret_val;
37392    int code; /* UCS code point */
37393    int n_code;
37394
37395    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37396        mem_base = xmlMemBlocks();
37397        code = gen_int(n_code, 0);
37398
37399        ret_val = xmlUCSIsCJKCompatibilityForms(code);
37400        desret_int(ret_val);
37401        call_tests++;
37402        des_int(n_code, code, 0);
37403        xmlResetLastError();
37404        if (mem_base != xmlMemBlocks()) {
37405            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37406	           xmlMemBlocks() - mem_base);
37407	    test_ret++;
37408            printf(" %d", n_code);
37409            printf("\n");
37410        }
37411    }
37412    function_tests++;
37413#endif
37414
37415    return(test_ret);
37416}
37417
37418
37419static int
37420test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37421    int test_ret = 0;
37422
37423#if defined(LIBXML_UNICODE_ENABLED)
37424    int mem_base;
37425    int ret_val;
37426    int code; /* UCS code point */
37427    int n_code;
37428
37429    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37430        mem_base = xmlMemBlocks();
37431        code = gen_int(n_code, 0);
37432
37433        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37434        desret_int(ret_val);
37435        call_tests++;
37436        des_int(n_code, code, 0);
37437        xmlResetLastError();
37438        if (mem_base != xmlMemBlocks()) {
37439            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37440	           xmlMemBlocks() - mem_base);
37441	    test_ret++;
37442            printf(" %d", n_code);
37443            printf("\n");
37444        }
37445    }
37446    function_tests++;
37447#endif
37448
37449    return(test_ret);
37450}
37451
37452
37453static int
37454test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37455    int test_ret = 0;
37456
37457#if defined(LIBXML_UNICODE_ENABLED)
37458    int mem_base;
37459    int ret_val;
37460    int code; /* UCS code point */
37461    int n_code;
37462
37463    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37464        mem_base = xmlMemBlocks();
37465        code = gen_int(n_code, 0);
37466
37467        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37468        desret_int(ret_val);
37469        call_tests++;
37470        des_int(n_code, code, 0);
37471        xmlResetLastError();
37472        if (mem_base != xmlMemBlocks()) {
37473            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37474	           xmlMemBlocks() - mem_base);
37475	    test_ret++;
37476            printf(" %d", n_code);
37477            printf("\n");
37478        }
37479    }
37480    function_tests++;
37481#endif
37482
37483    return(test_ret);
37484}
37485
37486
37487static int
37488test_xmlUCSIsCJKRadicalsSupplement(void) {
37489    int test_ret = 0;
37490
37491#if defined(LIBXML_UNICODE_ENABLED)
37492    int mem_base;
37493    int ret_val;
37494    int code; /* UCS code point */
37495    int n_code;
37496
37497    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37498        mem_base = xmlMemBlocks();
37499        code = gen_int(n_code, 0);
37500
37501        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37502        desret_int(ret_val);
37503        call_tests++;
37504        des_int(n_code, code, 0);
37505        xmlResetLastError();
37506        if (mem_base != xmlMemBlocks()) {
37507            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37508	           xmlMemBlocks() - mem_base);
37509	    test_ret++;
37510            printf(" %d", n_code);
37511            printf("\n");
37512        }
37513    }
37514    function_tests++;
37515#endif
37516
37517    return(test_ret);
37518}
37519
37520
37521static int
37522test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37523    int test_ret = 0;
37524
37525#if defined(LIBXML_UNICODE_ENABLED)
37526    int mem_base;
37527    int ret_val;
37528    int code; /* UCS code point */
37529    int n_code;
37530
37531    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37532        mem_base = xmlMemBlocks();
37533        code = gen_int(n_code, 0);
37534
37535        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37536        desret_int(ret_val);
37537        call_tests++;
37538        des_int(n_code, code, 0);
37539        xmlResetLastError();
37540        if (mem_base != xmlMemBlocks()) {
37541            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37542	           xmlMemBlocks() - mem_base);
37543	    test_ret++;
37544            printf(" %d", n_code);
37545            printf("\n");
37546        }
37547    }
37548    function_tests++;
37549#endif
37550
37551    return(test_ret);
37552}
37553
37554
37555static int
37556test_xmlUCSIsCJKUnifiedIdeographs(void) {
37557    int test_ret = 0;
37558
37559#if defined(LIBXML_UNICODE_ENABLED)
37560    int mem_base;
37561    int ret_val;
37562    int code; /* UCS code point */
37563    int n_code;
37564
37565    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37566        mem_base = xmlMemBlocks();
37567        code = gen_int(n_code, 0);
37568
37569        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37570        desret_int(ret_val);
37571        call_tests++;
37572        des_int(n_code, code, 0);
37573        xmlResetLastError();
37574        if (mem_base != xmlMemBlocks()) {
37575            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37576	           xmlMemBlocks() - mem_base);
37577	    test_ret++;
37578            printf(" %d", n_code);
37579            printf("\n");
37580        }
37581    }
37582    function_tests++;
37583#endif
37584
37585    return(test_ret);
37586}
37587
37588
37589static int
37590test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37591    int test_ret = 0;
37592
37593#if defined(LIBXML_UNICODE_ENABLED)
37594    int mem_base;
37595    int ret_val;
37596    int code; /* UCS code point */
37597    int n_code;
37598
37599    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37600        mem_base = xmlMemBlocks();
37601        code = gen_int(n_code, 0);
37602
37603        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37604        desret_int(ret_val);
37605        call_tests++;
37606        des_int(n_code, code, 0);
37607        xmlResetLastError();
37608        if (mem_base != xmlMemBlocks()) {
37609            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37610	           xmlMemBlocks() - mem_base);
37611	    test_ret++;
37612            printf(" %d", n_code);
37613            printf("\n");
37614        }
37615    }
37616    function_tests++;
37617#endif
37618
37619    return(test_ret);
37620}
37621
37622
37623static int
37624test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37625    int test_ret = 0;
37626
37627#if defined(LIBXML_UNICODE_ENABLED)
37628    int mem_base;
37629    int ret_val;
37630    int code; /* UCS code point */
37631    int n_code;
37632
37633    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37634        mem_base = xmlMemBlocks();
37635        code = gen_int(n_code, 0);
37636
37637        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37638        desret_int(ret_val);
37639        call_tests++;
37640        des_int(n_code, code, 0);
37641        xmlResetLastError();
37642        if (mem_base != xmlMemBlocks()) {
37643            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37644	           xmlMemBlocks() - mem_base);
37645	    test_ret++;
37646            printf(" %d", n_code);
37647            printf("\n");
37648        }
37649    }
37650    function_tests++;
37651#endif
37652
37653    return(test_ret);
37654}
37655
37656
37657static int
37658test_xmlUCSIsCat(void) {
37659    int test_ret = 0;
37660
37661#if defined(LIBXML_UNICODE_ENABLED)
37662    int mem_base;
37663    int ret_val;
37664    int code; /* UCS code point */
37665    int n_code;
37666    char * cat; /* UCS Category name */
37667    int n_cat;
37668
37669    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37670    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37671        mem_base = xmlMemBlocks();
37672        code = gen_int(n_code, 0);
37673        cat = gen_const_char_ptr(n_cat, 1);
37674
37675        ret_val = xmlUCSIsCat(code, (const char *)cat);
37676        desret_int(ret_val);
37677        call_tests++;
37678        des_int(n_code, code, 0);
37679        des_const_char_ptr(n_cat, (const char *)cat, 1);
37680        xmlResetLastError();
37681        if (mem_base != xmlMemBlocks()) {
37682            printf("Leak of %d blocks found in xmlUCSIsCat",
37683	           xmlMemBlocks() - mem_base);
37684	    test_ret++;
37685            printf(" %d", n_code);
37686            printf(" %d", n_cat);
37687            printf("\n");
37688        }
37689    }
37690    }
37691    function_tests++;
37692#endif
37693
37694    return(test_ret);
37695}
37696
37697
37698static int
37699test_xmlUCSIsCatC(void) {
37700    int test_ret = 0;
37701
37702#if defined(LIBXML_UNICODE_ENABLED)
37703    int mem_base;
37704    int ret_val;
37705    int code; /* UCS code point */
37706    int n_code;
37707
37708    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37709        mem_base = xmlMemBlocks();
37710        code = gen_int(n_code, 0);
37711
37712        ret_val = xmlUCSIsCatC(code);
37713        desret_int(ret_val);
37714        call_tests++;
37715        des_int(n_code, code, 0);
37716        xmlResetLastError();
37717        if (mem_base != xmlMemBlocks()) {
37718            printf("Leak of %d blocks found in xmlUCSIsCatC",
37719	           xmlMemBlocks() - mem_base);
37720	    test_ret++;
37721            printf(" %d", n_code);
37722            printf("\n");
37723        }
37724    }
37725    function_tests++;
37726#endif
37727
37728    return(test_ret);
37729}
37730
37731
37732static int
37733test_xmlUCSIsCatCc(void) {
37734    int test_ret = 0;
37735
37736#if defined(LIBXML_UNICODE_ENABLED)
37737    int mem_base;
37738    int ret_val;
37739    int code; /* UCS code point */
37740    int n_code;
37741
37742    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37743        mem_base = xmlMemBlocks();
37744        code = gen_int(n_code, 0);
37745
37746        ret_val = xmlUCSIsCatCc(code);
37747        desret_int(ret_val);
37748        call_tests++;
37749        des_int(n_code, code, 0);
37750        xmlResetLastError();
37751        if (mem_base != xmlMemBlocks()) {
37752            printf("Leak of %d blocks found in xmlUCSIsCatCc",
37753	           xmlMemBlocks() - mem_base);
37754	    test_ret++;
37755            printf(" %d", n_code);
37756            printf("\n");
37757        }
37758    }
37759    function_tests++;
37760#endif
37761
37762    return(test_ret);
37763}
37764
37765
37766static int
37767test_xmlUCSIsCatCf(void) {
37768    int test_ret = 0;
37769
37770#if defined(LIBXML_UNICODE_ENABLED)
37771    int mem_base;
37772    int ret_val;
37773    int code; /* UCS code point */
37774    int n_code;
37775
37776    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37777        mem_base = xmlMemBlocks();
37778        code = gen_int(n_code, 0);
37779
37780        ret_val = xmlUCSIsCatCf(code);
37781        desret_int(ret_val);
37782        call_tests++;
37783        des_int(n_code, code, 0);
37784        xmlResetLastError();
37785        if (mem_base != xmlMemBlocks()) {
37786            printf("Leak of %d blocks found in xmlUCSIsCatCf",
37787	           xmlMemBlocks() - mem_base);
37788	    test_ret++;
37789            printf(" %d", n_code);
37790            printf("\n");
37791        }
37792    }
37793    function_tests++;
37794#endif
37795
37796    return(test_ret);
37797}
37798
37799
37800static int
37801test_xmlUCSIsCatCo(void) {
37802    int test_ret = 0;
37803
37804#if defined(LIBXML_UNICODE_ENABLED)
37805    int mem_base;
37806    int ret_val;
37807    int code; /* UCS code point */
37808    int n_code;
37809
37810    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37811        mem_base = xmlMemBlocks();
37812        code = gen_int(n_code, 0);
37813
37814        ret_val = xmlUCSIsCatCo(code);
37815        desret_int(ret_val);
37816        call_tests++;
37817        des_int(n_code, code, 0);
37818        xmlResetLastError();
37819        if (mem_base != xmlMemBlocks()) {
37820            printf("Leak of %d blocks found in xmlUCSIsCatCo",
37821	           xmlMemBlocks() - mem_base);
37822	    test_ret++;
37823            printf(" %d", n_code);
37824            printf("\n");
37825        }
37826    }
37827    function_tests++;
37828#endif
37829
37830    return(test_ret);
37831}
37832
37833
37834static int
37835test_xmlUCSIsCatCs(void) {
37836    int test_ret = 0;
37837
37838#if defined(LIBXML_UNICODE_ENABLED)
37839    int mem_base;
37840    int ret_val;
37841    int code; /* UCS code point */
37842    int n_code;
37843
37844    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37845        mem_base = xmlMemBlocks();
37846        code = gen_int(n_code, 0);
37847
37848        ret_val = xmlUCSIsCatCs(code);
37849        desret_int(ret_val);
37850        call_tests++;
37851        des_int(n_code, code, 0);
37852        xmlResetLastError();
37853        if (mem_base != xmlMemBlocks()) {
37854            printf("Leak of %d blocks found in xmlUCSIsCatCs",
37855	           xmlMemBlocks() - mem_base);
37856	    test_ret++;
37857            printf(" %d", n_code);
37858            printf("\n");
37859        }
37860    }
37861    function_tests++;
37862#endif
37863
37864    return(test_ret);
37865}
37866
37867
37868static int
37869test_xmlUCSIsCatL(void) {
37870    int test_ret = 0;
37871
37872#if defined(LIBXML_UNICODE_ENABLED)
37873    int mem_base;
37874    int ret_val;
37875    int code; /* UCS code point */
37876    int n_code;
37877
37878    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37879        mem_base = xmlMemBlocks();
37880        code = gen_int(n_code, 0);
37881
37882        ret_val = xmlUCSIsCatL(code);
37883        desret_int(ret_val);
37884        call_tests++;
37885        des_int(n_code, code, 0);
37886        xmlResetLastError();
37887        if (mem_base != xmlMemBlocks()) {
37888            printf("Leak of %d blocks found in xmlUCSIsCatL",
37889	           xmlMemBlocks() - mem_base);
37890	    test_ret++;
37891            printf(" %d", n_code);
37892            printf("\n");
37893        }
37894    }
37895    function_tests++;
37896#endif
37897
37898    return(test_ret);
37899}
37900
37901
37902static int
37903test_xmlUCSIsCatLl(void) {
37904    int test_ret = 0;
37905
37906#if defined(LIBXML_UNICODE_ENABLED)
37907    int mem_base;
37908    int ret_val;
37909    int code; /* UCS code point */
37910    int n_code;
37911
37912    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37913        mem_base = xmlMemBlocks();
37914        code = gen_int(n_code, 0);
37915
37916        ret_val = xmlUCSIsCatLl(code);
37917        desret_int(ret_val);
37918        call_tests++;
37919        des_int(n_code, code, 0);
37920        xmlResetLastError();
37921        if (mem_base != xmlMemBlocks()) {
37922            printf("Leak of %d blocks found in xmlUCSIsCatLl",
37923	           xmlMemBlocks() - mem_base);
37924	    test_ret++;
37925            printf(" %d", n_code);
37926            printf("\n");
37927        }
37928    }
37929    function_tests++;
37930#endif
37931
37932    return(test_ret);
37933}
37934
37935
37936static int
37937test_xmlUCSIsCatLm(void) {
37938    int test_ret = 0;
37939
37940#if defined(LIBXML_UNICODE_ENABLED)
37941    int mem_base;
37942    int ret_val;
37943    int code; /* UCS code point */
37944    int n_code;
37945
37946    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37947        mem_base = xmlMemBlocks();
37948        code = gen_int(n_code, 0);
37949
37950        ret_val = xmlUCSIsCatLm(code);
37951        desret_int(ret_val);
37952        call_tests++;
37953        des_int(n_code, code, 0);
37954        xmlResetLastError();
37955        if (mem_base != xmlMemBlocks()) {
37956            printf("Leak of %d blocks found in xmlUCSIsCatLm",
37957	           xmlMemBlocks() - mem_base);
37958	    test_ret++;
37959            printf(" %d", n_code);
37960            printf("\n");
37961        }
37962    }
37963    function_tests++;
37964#endif
37965
37966    return(test_ret);
37967}
37968
37969
37970static int
37971test_xmlUCSIsCatLo(void) {
37972    int test_ret = 0;
37973
37974#if defined(LIBXML_UNICODE_ENABLED)
37975    int mem_base;
37976    int ret_val;
37977    int code; /* UCS code point */
37978    int n_code;
37979
37980    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37981        mem_base = xmlMemBlocks();
37982        code = gen_int(n_code, 0);
37983
37984        ret_val = xmlUCSIsCatLo(code);
37985        desret_int(ret_val);
37986        call_tests++;
37987        des_int(n_code, code, 0);
37988        xmlResetLastError();
37989        if (mem_base != xmlMemBlocks()) {
37990            printf("Leak of %d blocks found in xmlUCSIsCatLo",
37991	           xmlMemBlocks() - mem_base);
37992	    test_ret++;
37993            printf(" %d", n_code);
37994            printf("\n");
37995        }
37996    }
37997    function_tests++;
37998#endif
37999
38000    return(test_ret);
38001}
38002
38003
38004static int
38005test_xmlUCSIsCatLt(void) {
38006    int test_ret = 0;
38007
38008#if defined(LIBXML_UNICODE_ENABLED)
38009    int mem_base;
38010    int ret_val;
38011    int code; /* UCS code point */
38012    int n_code;
38013
38014    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38015        mem_base = xmlMemBlocks();
38016        code = gen_int(n_code, 0);
38017
38018        ret_val = xmlUCSIsCatLt(code);
38019        desret_int(ret_val);
38020        call_tests++;
38021        des_int(n_code, code, 0);
38022        xmlResetLastError();
38023        if (mem_base != xmlMemBlocks()) {
38024            printf("Leak of %d blocks found in xmlUCSIsCatLt",
38025	           xmlMemBlocks() - mem_base);
38026	    test_ret++;
38027            printf(" %d", n_code);
38028            printf("\n");
38029        }
38030    }
38031    function_tests++;
38032#endif
38033
38034    return(test_ret);
38035}
38036
38037
38038static int
38039test_xmlUCSIsCatLu(void) {
38040    int test_ret = 0;
38041
38042#if defined(LIBXML_UNICODE_ENABLED)
38043    int mem_base;
38044    int ret_val;
38045    int code; /* UCS code point */
38046    int n_code;
38047
38048    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38049        mem_base = xmlMemBlocks();
38050        code = gen_int(n_code, 0);
38051
38052        ret_val = xmlUCSIsCatLu(code);
38053        desret_int(ret_val);
38054        call_tests++;
38055        des_int(n_code, code, 0);
38056        xmlResetLastError();
38057        if (mem_base != xmlMemBlocks()) {
38058            printf("Leak of %d blocks found in xmlUCSIsCatLu",
38059	           xmlMemBlocks() - mem_base);
38060	    test_ret++;
38061            printf(" %d", n_code);
38062            printf("\n");
38063        }
38064    }
38065    function_tests++;
38066#endif
38067
38068    return(test_ret);
38069}
38070
38071
38072static int
38073test_xmlUCSIsCatM(void) {
38074    int test_ret = 0;
38075
38076#if defined(LIBXML_UNICODE_ENABLED)
38077    int mem_base;
38078    int ret_val;
38079    int code; /* UCS code point */
38080    int n_code;
38081
38082    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38083        mem_base = xmlMemBlocks();
38084        code = gen_int(n_code, 0);
38085
38086        ret_val = xmlUCSIsCatM(code);
38087        desret_int(ret_val);
38088        call_tests++;
38089        des_int(n_code, code, 0);
38090        xmlResetLastError();
38091        if (mem_base != xmlMemBlocks()) {
38092            printf("Leak of %d blocks found in xmlUCSIsCatM",
38093	           xmlMemBlocks() - mem_base);
38094	    test_ret++;
38095            printf(" %d", n_code);
38096            printf("\n");
38097        }
38098    }
38099    function_tests++;
38100#endif
38101
38102    return(test_ret);
38103}
38104
38105
38106static int
38107test_xmlUCSIsCatMc(void) {
38108    int test_ret = 0;
38109
38110#if defined(LIBXML_UNICODE_ENABLED)
38111    int mem_base;
38112    int ret_val;
38113    int code; /* UCS code point */
38114    int n_code;
38115
38116    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38117        mem_base = xmlMemBlocks();
38118        code = gen_int(n_code, 0);
38119
38120        ret_val = xmlUCSIsCatMc(code);
38121        desret_int(ret_val);
38122        call_tests++;
38123        des_int(n_code, code, 0);
38124        xmlResetLastError();
38125        if (mem_base != xmlMemBlocks()) {
38126            printf("Leak of %d blocks found in xmlUCSIsCatMc",
38127	           xmlMemBlocks() - mem_base);
38128	    test_ret++;
38129            printf(" %d", n_code);
38130            printf("\n");
38131        }
38132    }
38133    function_tests++;
38134#endif
38135
38136    return(test_ret);
38137}
38138
38139
38140static int
38141test_xmlUCSIsCatMe(void) {
38142    int test_ret = 0;
38143
38144#if defined(LIBXML_UNICODE_ENABLED)
38145    int mem_base;
38146    int ret_val;
38147    int code; /* UCS code point */
38148    int n_code;
38149
38150    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38151        mem_base = xmlMemBlocks();
38152        code = gen_int(n_code, 0);
38153
38154        ret_val = xmlUCSIsCatMe(code);
38155        desret_int(ret_val);
38156        call_tests++;
38157        des_int(n_code, code, 0);
38158        xmlResetLastError();
38159        if (mem_base != xmlMemBlocks()) {
38160            printf("Leak of %d blocks found in xmlUCSIsCatMe",
38161	           xmlMemBlocks() - mem_base);
38162	    test_ret++;
38163            printf(" %d", n_code);
38164            printf("\n");
38165        }
38166    }
38167    function_tests++;
38168#endif
38169
38170    return(test_ret);
38171}
38172
38173
38174static int
38175test_xmlUCSIsCatMn(void) {
38176    int test_ret = 0;
38177
38178#if defined(LIBXML_UNICODE_ENABLED)
38179    int mem_base;
38180    int ret_val;
38181    int code; /* UCS code point */
38182    int n_code;
38183
38184    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38185        mem_base = xmlMemBlocks();
38186        code = gen_int(n_code, 0);
38187
38188        ret_val = xmlUCSIsCatMn(code);
38189        desret_int(ret_val);
38190        call_tests++;
38191        des_int(n_code, code, 0);
38192        xmlResetLastError();
38193        if (mem_base != xmlMemBlocks()) {
38194            printf("Leak of %d blocks found in xmlUCSIsCatMn",
38195	           xmlMemBlocks() - mem_base);
38196	    test_ret++;
38197            printf(" %d", n_code);
38198            printf("\n");
38199        }
38200    }
38201    function_tests++;
38202#endif
38203
38204    return(test_ret);
38205}
38206
38207
38208static int
38209test_xmlUCSIsCatN(void) {
38210    int test_ret = 0;
38211
38212#if defined(LIBXML_UNICODE_ENABLED)
38213    int mem_base;
38214    int ret_val;
38215    int code; /* UCS code point */
38216    int n_code;
38217
38218    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38219        mem_base = xmlMemBlocks();
38220        code = gen_int(n_code, 0);
38221
38222        ret_val = xmlUCSIsCatN(code);
38223        desret_int(ret_val);
38224        call_tests++;
38225        des_int(n_code, code, 0);
38226        xmlResetLastError();
38227        if (mem_base != xmlMemBlocks()) {
38228            printf("Leak of %d blocks found in xmlUCSIsCatN",
38229	           xmlMemBlocks() - mem_base);
38230	    test_ret++;
38231            printf(" %d", n_code);
38232            printf("\n");
38233        }
38234    }
38235    function_tests++;
38236#endif
38237
38238    return(test_ret);
38239}
38240
38241
38242static int
38243test_xmlUCSIsCatNd(void) {
38244    int test_ret = 0;
38245
38246#if defined(LIBXML_UNICODE_ENABLED)
38247    int mem_base;
38248    int ret_val;
38249    int code; /* UCS code point */
38250    int n_code;
38251
38252    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38253        mem_base = xmlMemBlocks();
38254        code = gen_int(n_code, 0);
38255
38256        ret_val = xmlUCSIsCatNd(code);
38257        desret_int(ret_val);
38258        call_tests++;
38259        des_int(n_code, code, 0);
38260        xmlResetLastError();
38261        if (mem_base != xmlMemBlocks()) {
38262            printf("Leak of %d blocks found in xmlUCSIsCatNd",
38263	           xmlMemBlocks() - mem_base);
38264	    test_ret++;
38265            printf(" %d", n_code);
38266            printf("\n");
38267        }
38268    }
38269    function_tests++;
38270#endif
38271
38272    return(test_ret);
38273}
38274
38275
38276static int
38277test_xmlUCSIsCatNl(void) {
38278    int test_ret = 0;
38279
38280#if defined(LIBXML_UNICODE_ENABLED)
38281    int mem_base;
38282    int ret_val;
38283    int code; /* UCS code point */
38284    int n_code;
38285
38286    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38287        mem_base = xmlMemBlocks();
38288        code = gen_int(n_code, 0);
38289
38290        ret_val = xmlUCSIsCatNl(code);
38291        desret_int(ret_val);
38292        call_tests++;
38293        des_int(n_code, code, 0);
38294        xmlResetLastError();
38295        if (mem_base != xmlMemBlocks()) {
38296            printf("Leak of %d blocks found in xmlUCSIsCatNl",
38297	           xmlMemBlocks() - mem_base);
38298	    test_ret++;
38299            printf(" %d", n_code);
38300            printf("\n");
38301        }
38302    }
38303    function_tests++;
38304#endif
38305
38306    return(test_ret);
38307}
38308
38309
38310static int
38311test_xmlUCSIsCatNo(void) {
38312    int test_ret = 0;
38313
38314#if defined(LIBXML_UNICODE_ENABLED)
38315    int mem_base;
38316    int ret_val;
38317    int code; /* UCS code point */
38318    int n_code;
38319
38320    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38321        mem_base = xmlMemBlocks();
38322        code = gen_int(n_code, 0);
38323
38324        ret_val = xmlUCSIsCatNo(code);
38325        desret_int(ret_val);
38326        call_tests++;
38327        des_int(n_code, code, 0);
38328        xmlResetLastError();
38329        if (mem_base != xmlMemBlocks()) {
38330            printf("Leak of %d blocks found in xmlUCSIsCatNo",
38331	           xmlMemBlocks() - mem_base);
38332	    test_ret++;
38333            printf(" %d", n_code);
38334            printf("\n");
38335        }
38336    }
38337    function_tests++;
38338#endif
38339
38340    return(test_ret);
38341}
38342
38343
38344static int
38345test_xmlUCSIsCatP(void) {
38346    int test_ret = 0;
38347
38348#if defined(LIBXML_UNICODE_ENABLED)
38349    int mem_base;
38350    int ret_val;
38351    int code; /* UCS code point */
38352    int n_code;
38353
38354    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38355        mem_base = xmlMemBlocks();
38356        code = gen_int(n_code, 0);
38357
38358        ret_val = xmlUCSIsCatP(code);
38359        desret_int(ret_val);
38360        call_tests++;
38361        des_int(n_code, code, 0);
38362        xmlResetLastError();
38363        if (mem_base != xmlMemBlocks()) {
38364            printf("Leak of %d blocks found in xmlUCSIsCatP",
38365	           xmlMemBlocks() - mem_base);
38366	    test_ret++;
38367            printf(" %d", n_code);
38368            printf("\n");
38369        }
38370    }
38371    function_tests++;
38372#endif
38373
38374    return(test_ret);
38375}
38376
38377
38378static int
38379test_xmlUCSIsCatPc(void) {
38380    int test_ret = 0;
38381
38382#if defined(LIBXML_UNICODE_ENABLED)
38383    int mem_base;
38384    int ret_val;
38385    int code; /* UCS code point */
38386    int n_code;
38387
38388    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38389        mem_base = xmlMemBlocks();
38390        code = gen_int(n_code, 0);
38391
38392        ret_val = xmlUCSIsCatPc(code);
38393        desret_int(ret_val);
38394        call_tests++;
38395        des_int(n_code, code, 0);
38396        xmlResetLastError();
38397        if (mem_base != xmlMemBlocks()) {
38398            printf("Leak of %d blocks found in xmlUCSIsCatPc",
38399	           xmlMemBlocks() - mem_base);
38400	    test_ret++;
38401            printf(" %d", n_code);
38402            printf("\n");
38403        }
38404    }
38405    function_tests++;
38406#endif
38407
38408    return(test_ret);
38409}
38410
38411
38412static int
38413test_xmlUCSIsCatPd(void) {
38414    int test_ret = 0;
38415
38416#if defined(LIBXML_UNICODE_ENABLED)
38417    int mem_base;
38418    int ret_val;
38419    int code; /* UCS code point */
38420    int n_code;
38421
38422    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38423        mem_base = xmlMemBlocks();
38424        code = gen_int(n_code, 0);
38425
38426        ret_val = xmlUCSIsCatPd(code);
38427        desret_int(ret_val);
38428        call_tests++;
38429        des_int(n_code, code, 0);
38430        xmlResetLastError();
38431        if (mem_base != xmlMemBlocks()) {
38432            printf("Leak of %d blocks found in xmlUCSIsCatPd",
38433	           xmlMemBlocks() - mem_base);
38434	    test_ret++;
38435            printf(" %d", n_code);
38436            printf("\n");
38437        }
38438    }
38439    function_tests++;
38440#endif
38441
38442    return(test_ret);
38443}
38444
38445
38446static int
38447test_xmlUCSIsCatPe(void) {
38448    int test_ret = 0;
38449
38450#if defined(LIBXML_UNICODE_ENABLED)
38451    int mem_base;
38452    int ret_val;
38453    int code; /* UCS code point */
38454    int n_code;
38455
38456    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38457        mem_base = xmlMemBlocks();
38458        code = gen_int(n_code, 0);
38459
38460        ret_val = xmlUCSIsCatPe(code);
38461        desret_int(ret_val);
38462        call_tests++;
38463        des_int(n_code, code, 0);
38464        xmlResetLastError();
38465        if (mem_base != xmlMemBlocks()) {
38466            printf("Leak of %d blocks found in xmlUCSIsCatPe",
38467	           xmlMemBlocks() - mem_base);
38468	    test_ret++;
38469            printf(" %d", n_code);
38470            printf("\n");
38471        }
38472    }
38473    function_tests++;
38474#endif
38475
38476    return(test_ret);
38477}
38478
38479
38480static int
38481test_xmlUCSIsCatPf(void) {
38482    int test_ret = 0;
38483
38484#if defined(LIBXML_UNICODE_ENABLED)
38485    int mem_base;
38486    int ret_val;
38487    int code; /* UCS code point */
38488    int n_code;
38489
38490    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38491        mem_base = xmlMemBlocks();
38492        code = gen_int(n_code, 0);
38493
38494        ret_val = xmlUCSIsCatPf(code);
38495        desret_int(ret_val);
38496        call_tests++;
38497        des_int(n_code, code, 0);
38498        xmlResetLastError();
38499        if (mem_base != xmlMemBlocks()) {
38500            printf("Leak of %d blocks found in xmlUCSIsCatPf",
38501	           xmlMemBlocks() - mem_base);
38502	    test_ret++;
38503            printf(" %d", n_code);
38504            printf("\n");
38505        }
38506    }
38507    function_tests++;
38508#endif
38509
38510    return(test_ret);
38511}
38512
38513
38514static int
38515test_xmlUCSIsCatPi(void) {
38516    int test_ret = 0;
38517
38518#if defined(LIBXML_UNICODE_ENABLED)
38519    int mem_base;
38520    int ret_val;
38521    int code; /* UCS code point */
38522    int n_code;
38523
38524    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38525        mem_base = xmlMemBlocks();
38526        code = gen_int(n_code, 0);
38527
38528        ret_val = xmlUCSIsCatPi(code);
38529        desret_int(ret_val);
38530        call_tests++;
38531        des_int(n_code, code, 0);
38532        xmlResetLastError();
38533        if (mem_base != xmlMemBlocks()) {
38534            printf("Leak of %d blocks found in xmlUCSIsCatPi",
38535	           xmlMemBlocks() - mem_base);
38536	    test_ret++;
38537            printf(" %d", n_code);
38538            printf("\n");
38539        }
38540    }
38541    function_tests++;
38542#endif
38543
38544    return(test_ret);
38545}
38546
38547
38548static int
38549test_xmlUCSIsCatPo(void) {
38550    int test_ret = 0;
38551
38552#if defined(LIBXML_UNICODE_ENABLED)
38553    int mem_base;
38554    int ret_val;
38555    int code; /* UCS code point */
38556    int n_code;
38557
38558    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38559        mem_base = xmlMemBlocks();
38560        code = gen_int(n_code, 0);
38561
38562        ret_val = xmlUCSIsCatPo(code);
38563        desret_int(ret_val);
38564        call_tests++;
38565        des_int(n_code, code, 0);
38566        xmlResetLastError();
38567        if (mem_base != xmlMemBlocks()) {
38568            printf("Leak of %d blocks found in xmlUCSIsCatPo",
38569	           xmlMemBlocks() - mem_base);
38570	    test_ret++;
38571            printf(" %d", n_code);
38572            printf("\n");
38573        }
38574    }
38575    function_tests++;
38576#endif
38577
38578    return(test_ret);
38579}
38580
38581
38582static int
38583test_xmlUCSIsCatPs(void) {
38584    int test_ret = 0;
38585
38586#if defined(LIBXML_UNICODE_ENABLED)
38587    int mem_base;
38588    int ret_val;
38589    int code; /* UCS code point */
38590    int n_code;
38591
38592    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38593        mem_base = xmlMemBlocks();
38594        code = gen_int(n_code, 0);
38595
38596        ret_val = xmlUCSIsCatPs(code);
38597        desret_int(ret_val);
38598        call_tests++;
38599        des_int(n_code, code, 0);
38600        xmlResetLastError();
38601        if (mem_base != xmlMemBlocks()) {
38602            printf("Leak of %d blocks found in xmlUCSIsCatPs",
38603	           xmlMemBlocks() - mem_base);
38604	    test_ret++;
38605            printf(" %d", n_code);
38606            printf("\n");
38607        }
38608    }
38609    function_tests++;
38610#endif
38611
38612    return(test_ret);
38613}
38614
38615
38616static int
38617test_xmlUCSIsCatS(void) {
38618    int test_ret = 0;
38619
38620#if defined(LIBXML_UNICODE_ENABLED)
38621    int mem_base;
38622    int ret_val;
38623    int code; /* UCS code point */
38624    int n_code;
38625
38626    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38627        mem_base = xmlMemBlocks();
38628        code = gen_int(n_code, 0);
38629
38630        ret_val = xmlUCSIsCatS(code);
38631        desret_int(ret_val);
38632        call_tests++;
38633        des_int(n_code, code, 0);
38634        xmlResetLastError();
38635        if (mem_base != xmlMemBlocks()) {
38636            printf("Leak of %d blocks found in xmlUCSIsCatS",
38637	           xmlMemBlocks() - mem_base);
38638	    test_ret++;
38639            printf(" %d", n_code);
38640            printf("\n");
38641        }
38642    }
38643    function_tests++;
38644#endif
38645
38646    return(test_ret);
38647}
38648
38649
38650static int
38651test_xmlUCSIsCatSc(void) {
38652    int test_ret = 0;
38653
38654#if defined(LIBXML_UNICODE_ENABLED)
38655    int mem_base;
38656    int ret_val;
38657    int code; /* UCS code point */
38658    int n_code;
38659
38660    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38661        mem_base = xmlMemBlocks();
38662        code = gen_int(n_code, 0);
38663
38664        ret_val = xmlUCSIsCatSc(code);
38665        desret_int(ret_val);
38666        call_tests++;
38667        des_int(n_code, code, 0);
38668        xmlResetLastError();
38669        if (mem_base != xmlMemBlocks()) {
38670            printf("Leak of %d blocks found in xmlUCSIsCatSc",
38671	           xmlMemBlocks() - mem_base);
38672	    test_ret++;
38673            printf(" %d", n_code);
38674            printf("\n");
38675        }
38676    }
38677    function_tests++;
38678#endif
38679
38680    return(test_ret);
38681}
38682
38683
38684static int
38685test_xmlUCSIsCatSk(void) {
38686    int test_ret = 0;
38687
38688#if defined(LIBXML_UNICODE_ENABLED)
38689    int mem_base;
38690    int ret_val;
38691    int code; /* UCS code point */
38692    int n_code;
38693
38694    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38695        mem_base = xmlMemBlocks();
38696        code = gen_int(n_code, 0);
38697
38698        ret_val = xmlUCSIsCatSk(code);
38699        desret_int(ret_val);
38700        call_tests++;
38701        des_int(n_code, code, 0);
38702        xmlResetLastError();
38703        if (mem_base != xmlMemBlocks()) {
38704            printf("Leak of %d blocks found in xmlUCSIsCatSk",
38705	           xmlMemBlocks() - mem_base);
38706	    test_ret++;
38707            printf(" %d", n_code);
38708            printf("\n");
38709        }
38710    }
38711    function_tests++;
38712#endif
38713
38714    return(test_ret);
38715}
38716
38717
38718static int
38719test_xmlUCSIsCatSm(void) {
38720    int test_ret = 0;
38721
38722#if defined(LIBXML_UNICODE_ENABLED)
38723    int mem_base;
38724    int ret_val;
38725    int code; /* UCS code point */
38726    int n_code;
38727
38728    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38729        mem_base = xmlMemBlocks();
38730        code = gen_int(n_code, 0);
38731
38732        ret_val = xmlUCSIsCatSm(code);
38733        desret_int(ret_val);
38734        call_tests++;
38735        des_int(n_code, code, 0);
38736        xmlResetLastError();
38737        if (mem_base != xmlMemBlocks()) {
38738            printf("Leak of %d blocks found in xmlUCSIsCatSm",
38739	           xmlMemBlocks() - mem_base);
38740	    test_ret++;
38741            printf(" %d", n_code);
38742            printf("\n");
38743        }
38744    }
38745    function_tests++;
38746#endif
38747
38748    return(test_ret);
38749}
38750
38751
38752static int
38753test_xmlUCSIsCatSo(void) {
38754    int test_ret = 0;
38755
38756#if defined(LIBXML_UNICODE_ENABLED)
38757    int mem_base;
38758    int ret_val;
38759    int code; /* UCS code point */
38760    int n_code;
38761
38762    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38763        mem_base = xmlMemBlocks();
38764        code = gen_int(n_code, 0);
38765
38766        ret_val = xmlUCSIsCatSo(code);
38767        desret_int(ret_val);
38768        call_tests++;
38769        des_int(n_code, code, 0);
38770        xmlResetLastError();
38771        if (mem_base != xmlMemBlocks()) {
38772            printf("Leak of %d blocks found in xmlUCSIsCatSo",
38773	           xmlMemBlocks() - mem_base);
38774	    test_ret++;
38775            printf(" %d", n_code);
38776            printf("\n");
38777        }
38778    }
38779    function_tests++;
38780#endif
38781
38782    return(test_ret);
38783}
38784
38785
38786static int
38787test_xmlUCSIsCatZ(void) {
38788    int test_ret = 0;
38789
38790#if defined(LIBXML_UNICODE_ENABLED)
38791    int mem_base;
38792    int ret_val;
38793    int code; /* UCS code point */
38794    int n_code;
38795
38796    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38797        mem_base = xmlMemBlocks();
38798        code = gen_int(n_code, 0);
38799
38800        ret_val = xmlUCSIsCatZ(code);
38801        desret_int(ret_val);
38802        call_tests++;
38803        des_int(n_code, code, 0);
38804        xmlResetLastError();
38805        if (mem_base != xmlMemBlocks()) {
38806            printf("Leak of %d blocks found in xmlUCSIsCatZ",
38807	           xmlMemBlocks() - mem_base);
38808	    test_ret++;
38809            printf(" %d", n_code);
38810            printf("\n");
38811        }
38812    }
38813    function_tests++;
38814#endif
38815
38816    return(test_ret);
38817}
38818
38819
38820static int
38821test_xmlUCSIsCatZl(void) {
38822    int test_ret = 0;
38823
38824#if defined(LIBXML_UNICODE_ENABLED)
38825    int mem_base;
38826    int ret_val;
38827    int code; /* UCS code point */
38828    int n_code;
38829
38830    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38831        mem_base = xmlMemBlocks();
38832        code = gen_int(n_code, 0);
38833
38834        ret_val = xmlUCSIsCatZl(code);
38835        desret_int(ret_val);
38836        call_tests++;
38837        des_int(n_code, code, 0);
38838        xmlResetLastError();
38839        if (mem_base != xmlMemBlocks()) {
38840            printf("Leak of %d blocks found in xmlUCSIsCatZl",
38841	           xmlMemBlocks() - mem_base);
38842	    test_ret++;
38843            printf(" %d", n_code);
38844            printf("\n");
38845        }
38846    }
38847    function_tests++;
38848#endif
38849
38850    return(test_ret);
38851}
38852
38853
38854static int
38855test_xmlUCSIsCatZp(void) {
38856    int test_ret = 0;
38857
38858#if defined(LIBXML_UNICODE_ENABLED)
38859    int mem_base;
38860    int ret_val;
38861    int code; /* UCS code point */
38862    int n_code;
38863
38864    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38865        mem_base = xmlMemBlocks();
38866        code = gen_int(n_code, 0);
38867
38868        ret_val = xmlUCSIsCatZp(code);
38869        desret_int(ret_val);
38870        call_tests++;
38871        des_int(n_code, code, 0);
38872        xmlResetLastError();
38873        if (mem_base != xmlMemBlocks()) {
38874            printf("Leak of %d blocks found in xmlUCSIsCatZp",
38875	           xmlMemBlocks() - mem_base);
38876	    test_ret++;
38877            printf(" %d", n_code);
38878            printf("\n");
38879        }
38880    }
38881    function_tests++;
38882#endif
38883
38884    return(test_ret);
38885}
38886
38887
38888static int
38889test_xmlUCSIsCatZs(void) {
38890    int test_ret = 0;
38891
38892#if defined(LIBXML_UNICODE_ENABLED)
38893    int mem_base;
38894    int ret_val;
38895    int code; /* UCS code point */
38896    int n_code;
38897
38898    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38899        mem_base = xmlMemBlocks();
38900        code = gen_int(n_code, 0);
38901
38902        ret_val = xmlUCSIsCatZs(code);
38903        desret_int(ret_val);
38904        call_tests++;
38905        des_int(n_code, code, 0);
38906        xmlResetLastError();
38907        if (mem_base != xmlMemBlocks()) {
38908            printf("Leak of %d blocks found in xmlUCSIsCatZs",
38909	           xmlMemBlocks() - mem_base);
38910	    test_ret++;
38911            printf(" %d", n_code);
38912            printf("\n");
38913        }
38914    }
38915    function_tests++;
38916#endif
38917
38918    return(test_ret);
38919}
38920
38921
38922static int
38923test_xmlUCSIsCherokee(void) {
38924    int test_ret = 0;
38925
38926#if defined(LIBXML_UNICODE_ENABLED)
38927    int mem_base;
38928    int ret_val;
38929    int code; /* UCS code point */
38930    int n_code;
38931
38932    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38933        mem_base = xmlMemBlocks();
38934        code = gen_int(n_code, 0);
38935
38936        ret_val = xmlUCSIsCherokee(code);
38937        desret_int(ret_val);
38938        call_tests++;
38939        des_int(n_code, code, 0);
38940        xmlResetLastError();
38941        if (mem_base != xmlMemBlocks()) {
38942            printf("Leak of %d blocks found in xmlUCSIsCherokee",
38943	           xmlMemBlocks() - mem_base);
38944	    test_ret++;
38945            printf(" %d", n_code);
38946            printf("\n");
38947        }
38948    }
38949    function_tests++;
38950#endif
38951
38952    return(test_ret);
38953}
38954
38955
38956static int
38957test_xmlUCSIsCombiningDiacriticalMarks(void) {
38958    int test_ret = 0;
38959
38960#if defined(LIBXML_UNICODE_ENABLED)
38961    int mem_base;
38962    int ret_val;
38963    int code; /* UCS code point */
38964    int n_code;
38965
38966    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38967        mem_base = xmlMemBlocks();
38968        code = gen_int(n_code, 0);
38969
38970        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
38971        desret_int(ret_val);
38972        call_tests++;
38973        des_int(n_code, code, 0);
38974        xmlResetLastError();
38975        if (mem_base != xmlMemBlocks()) {
38976            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
38977	           xmlMemBlocks() - mem_base);
38978	    test_ret++;
38979            printf(" %d", n_code);
38980            printf("\n");
38981        }
38982    }
38983    function_tests++;
38984#endif
38985
38986    return(test_ret);
38987}
38988
38989
38990static int
38991test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
38992    int test_ret = 0;
38993
38994#if defined(LIBXML_UNICODE_ENABLED)
38995    int mem_base;
38996    int ret_val;
38997    int code; /* UCS code point */
38998    int n_code;
38999
39000    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39001        mem_base = xmlMemBlocks();
39002        code = gen_int(n_code, 0);
39003
39004        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39005        desret_int(ret_val);
39006        call_tests++;
39007        des_int(n_code, code, 0);
39008        xmlResetLastError();
39009        if (mem_base != xmlMemBlocks()) {
39010            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39011	           xmlMemBlocks() - mem_base);
39012	    test_ret++;
39013            printf(" %d", n_code);
39014            printf("\n");
39015        }
39016    }
39017    function_tests++;
39018#endif
39019
39020    return(test_ret);
39021}
39022
39023
39024static int
39025test_xmlUCSIsCombiningHalfMarks(void) {
39026    int test_ret = 0;
39027
39028#if defined(LIBXML_UNICODE_ENABLED)
39029    int mem_base;
39030    int ret_val;
39031    int code; /* UCS code point */
39032    int n_code;
39033
39034    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39035        mem_base = xmlMemBlocks();
39036        code = gen_int(n_code, 0);
39037
39038        ret_val = xmlUCSIsCombiningHalfMarks(code);
39039        desret_int(ret_val);
39040        call_tests++;
39041        des_int(n_code, code, 0);
39042        xmlResetLastError();
39043        if (mem_base != xmlMemBlocks()) {
39044            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39045	           xmlMemBlocks() - mem_base);
39046	    test_ret++;
39047            printf(" %d", n_code);
39048            printf("\n");
39049        }
39050    }
39051    function_tests++;
39052#endif
39053
39054    return(test_ret);
39055}
39056
39057
39058static int
39059test_xmlUCSIsCombiningMarksforSymbols(void) {
39060    int test_ret = 0;
39061
39062#if defined(LIBXML_UNICODE_ENABLED)
39063    int mem_base;
39064    int ret_val;
39065    int code; /* UCS code point */
39066    int n_code;
39067
39068    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39069        mem_base = xmlMemBlocks();
39070        code = gen_int(n_code, 0);
39071
39072        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39073        desret_int(ret_val);
39074        call_tests++;
39075        des_int(n_code, code, 0);
39076        xmlResetLastError();
39077        if (mem_base != xmlMemBlocks()) {
39078            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39079	           xmlMemBlocks() - mem_base);
39080	    test_ret++;
39081            printf(" %d", n_code);
39082            printf("\n");
39083        }
39084    }
39085    function_tests++;
39086#endif
39087
39088    return(test_ret);
39089}
39090
39091
39092static int
39093test_xmlUCSIsControlPictures(void) {
39094    int test_ret = 0;
39095
39096#if defined(LIBXML_UNICODE_ENABLED)
39097    int mem_base;
39098    int ret_val;
39099    int code; /* UCS code point */
39100    int n_code;
39101
39102    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39103        mem_base = xmlMemBlocks();
39104        code = gen_int(n_code, 0);
39105
39106        ret_val = xmlUCSIsControlPictures(code);
39107        desret_int(ret_val);
39108        call_tests++;
39109        des_int(n_code, code, 0);
39110        xmlResetLastError();
39111        if (mem_base != xmlMemBlocks()) {
39112            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39113	           xmlMemBlocks() - mem_base);
39114	    test_ret++;
39115            printf(" %d", n_code);
39116            printf("\n");
39117        }
39118    }
39119    function_tests++;
39120#endif
39121
39122    return(test_ret);
39123}
39124
39125
39126static int
39127test_xmlUCSIsCurrencySymbols(void) {
39128    int test_ret = 0;
39129
39130#if defined(LIBXML_UNICODE_ENABLED)
39131    int mem_base;
39132    int ret_val;
39133    int code; /* UCS code point */
39134    int n_code;
39135
39136    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39137        mem_base = xmlMemBlocks();
39138        code = gen_int(n_code, 0);
39139
39140        ret_val = xmlUCSIsCurrencySymbols(code);
39141        desret_int(ret_val);
39142        call_tests++;
39143        des_int(n_code, code, 0);
39144        xmlResetLastError();
39145        if (mem_base != xmlMemBlocks()) {
39146            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39147	           xmlMemBlocks() - mem_base);
39148	    test_ret++;
39149            printf(" %d", n_code);
39150            printf("\n");
39151        }
39152    }
39153    function_tests++;
39154#endif
39155
39156    return(test_ret);
39157}
39158
39159
39160static int
39161test_xmlUCSIsCypriotSyllabary(void) {
39162    int test_ret = 0;
39163
39164#if defined(LIBXML_UNICODE_ENABLED)
39165    int mem_base;
39166    int ret_val;
39167    int code; /* UCS code point */
39168    int n_code;
39169
39170    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39171        mem_base = xmlMemBlocks();
39172        code = gen_int(n_code, 0);
39173
39174        ret_val = xmlUCSIsCypriotSyllabary(code);
39175        desret_int(ret_val);
39176        call_tests++;
39177        des_int(n_code, code, 0);
39178        xmlResetLastError();
39179        if (mem_base != xmlMemBlocks()) {
39180            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39181	           xmlMemBlocks() - mem_base);
39182	    test_ret++;
39183            printf(" %d", n_code);
39184            printf("\n");
39185        }
39186    }
39187    function_tests++;
39188#endif
39189
39190    return(test_ret);
39191}
39192
39193
39194static int
39195test_xmlUCSIsCyrillic(void) {
39196    int test_ret = 0;
39197
39198#if defined(LIBXML_UNICODE_ENABLED)
39199    int mem_base;
39200    int ret_val;
39201    int code; /* UCS code point */
39202    int n_code;
39203
39204    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39205        mem_base = xmlMemBlocks();
39206        code = gen_int(n_code, 0);
39207
39208        ret_val = xmlUCSIsCyrillic(code);
39209        desret_int(ret_val);
39210        call_tests++;
39211        des_int(n_code, code, 0);
39212        xmlResetLastError();
39213        if (mem_base != xmlMemBlocks()) {
39214            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39215	           xmlMemBlocks() - mem_base);
39216	    test_ret++;
39217            printf(" %d", n_code);
39218            printf("\n");
39219        }
39220    }
39221    function_tests++;
39222#endif
39223
39224    return(test_ret);
39225}
39226
39227
39228static int
39229test_xmlUCSIsCyrillicSupplement(void) {
39230    int test_ret = 0;
39231
39232#if defined(LIBXML_UNICODE_ENABLED)
39233    int mem_base;
39234    int ret_val;
39235    int code; /* UCS code point */
39236    int n_code;
39237
39238    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39239        mem_base = xmlMemBlocks();
39240        code = gen_int(n_code, 0);
39241
39242        ret_val = xmlUCSIsCyrillicSupplement(code);
39243        desret_int(ret_val);
39244        call_tests++;
39245        des_int(n_code, code, 0);
39246        xmlResetLastError();
39247        if (mem_base != xmlMemBlocks()) {
39248            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39249	           xmlMemBlocks() - mem_base);
39250	    test_ret++;
39251            printf(" %d", n_code);
39252            printf("\n");
39253        }
39254    }
39255    function_tests++;
39256#endif
39257
39258    return(test_ret);
39259}
39260
39261
39262static int
39263test_xmlUCSIsDeseret(void) {
39264    int test_ret = 0;
39265
39266#if defined(LIBXML_UNICODE_ENABLED)
39267    int mem_base;
39268    int ret_val;
39269    int code; /* UCS code point */
39270    int n_code;
39271
39272    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39273        mem_base = xmlMemBlocks();
39274        code = gen_int(n_code, 0);
39275
39276        ret_val = xmlUCSIsDeseret(code);
39277        desret_int(ret_val);
39278        call_tests++;
39279        des_int(n_code, code, 0);
39280        xmlResetLastError();
39281        if (mem_base != xmlMemBlocks()) {
39282            printf("Leak of %d blocks found in xmlUCSIsDeseret",
39283	           xmlMemBlocks() - mem_base);
39284	    test_ret++;
39285            printf(" %d", n_code);
39286            printf("\n");
39287        }
39288    }
39289    function_tests++;
39290#endif
39291
39292    return(test_ret);
39293}
39294
39295
39296static int
39297test_xmlUCSIsDevanagari(void) {
39298    int test_ret = 0;
39299
39300#if defined(LIBXML_UNICODE_ENABLED)
39301    int mem_base;
39302    int ret_val;
39303    int code; /* UCS code point */
39304    int n_code;
39305
39306    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39307        mem_base = xmlMemBlocks();
39308        code = gen_int(n_code, 0);
39309
39310        ret_val = xmlUCSIsDevanagari(code);
39311        desret_int(ret_val);
39312        call_tests++;
39313        des_int(n_code, code, 0);
39314        xmlResetLastError();
39315        if (mem_base != xmlMemBlocks()) {
39316            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39317	           xmlMemBlocks() - mem_base);
39318	    test_ret++;
39319            printf(" %d", n_code);
39320            printf("\n");
39321        }
39322    }
39323    function_tests++;
39324#endif
39325
39326    return(test_ret);
39327}
39328
39329
39330static int
39331test_xmlUCSIsDingbats(void) {
39332    int test_ret = 0;
39333
39334#if defined(LIBXML_UNICODE_ENABLED)
39335    int mem_base;
39336    int ret_val;
39337    int code; /* UCS code point */
39338    int n_code;
39339
39340    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39341        mem_base = xmlMemBlocks();
39342        code = gen_int(n_code, 0);
39343
39344        ret_val = xmlUCSIsDingbats(code);
39345        desret_int(ret_val);
39346        call_tests++;
39347        des_int(n_code, code, 0);
39348        xmlResetLastError();
39349        if (mem_base != xmlMemBlocks()) {
39350            printf("Leak of %d blocks found in xmlUCSIsDingbats",
39351	           xmlMemBlocks() - mem_base);
39352	    test_ret++;
39353            printf(" %d", n_code);
39354            printf("\n");
39355        }
39356    }
39357    function_tests++;
39358#endif
39359
39360    return(test_ret);
39361}
39362
39363
39364static int
39365test_xmlUCSIsEnclosedAlphanumerics(void) {
39366    int test_ret = 0;
39367
39368#if defined(LIBXML_UNICODE_ENABLED)
39369    int mem_base;
39370    int ret_val;
39371    int code; /* UCS code point */
39372    int n_code;
39373
39374    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39375        mem_base = xmlMemBlocks();
39376        code = gen_int(n_code, 0);
39377
39378        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39379        desret_int(ret_val);
39380        call_tests++;
39381        des_int(n_code, code, 0);
39382        xmlResetLastError();
39383        if (mem_base != xmlMemBlocks()) {
39384            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39385	           xmlMemBlocks() - mem_base);
39386	    test_ret++;
39387            printf(" %d", n_code);
39388            printf("\n");
39389        }
39390    }
39391    function_tests++;
39392#endif
39393
39394    return(test_ret);
39395}
39396
39397
39398static int
39399test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39400    int test_ret = 0;
39401
39402#if defined(LIBXML_UNICODE_ENABLED)
39403    int mem_base;
39404    int ret_val;
39405    int code; /* UCS code point */
39406    int n_code;
39407
39408    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39409        mem_base = xmlMemBlocks();
39410        code = gen_int(n_code, 0);
39411
39412        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39413        desret_int(ret_val);
39414        call_tests++;
39415        des_int(n_code, code, 0);
39416        xmlResetLastError();
39417        if (mem_base != xmlMemBlocks()) {
39418            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39419	           xmlMemBlocks() - mem_base);
39420	    test_ret++;
39421            printf(" %d", n_code);
39422            printf("\n");
39423        }
39424    }
39425    function_tests++;
39426#endif
39427
39428    return(test_ret);
39429}
39430
39431
39432static int
39433test_xmlUCSIsEthiopic(void) {
39434    int test_ret = 0;
39435
39436#if defined(LIBXML_UNICODE_ENABLED)
39437    int mem_base;
39438    int ret_val;
39439    int code; /* UCS code point */
39440    int n_code;
39441
39442    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39443        mem_base = xmlMemBlocks();
39444        code = gen_int(n_code, 0);
39445
39446        ret_val = xmlUCSIsEthiopic(code);
39447        desret_int(ret_val);
39448        call_tests++;
39449        des_int(n_code, code, 0);
39450        xmlResetLastError();
39451        if (mem_base != xmlMemBlocks()) {
39452            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39453	           xmlMemBlocks() - mem_base);
39454	    test_ret++;
39455            printf(" %d", n_code);
39456            printf("\n");
39457        }
39458    }
39459    function_tests++;
39460#endif
39461
39462    return(test_ret);
39463}
39464
39465
39466static int
39467test_xmlUCSIsGeneralPunctuation(void) {
39468    int test_ret = 0;
39469
39470#if defined(LIBXML_UNICODE_ENABLED)
39471    int mem_base;
39472    int ret_val;
39473    int code; /* UCS code point */
39474    int n_code;
39475
39476    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39477        mem_base = xmlMemBlocks();
39478        code = gen_int(n_code, 0);
39479
39480        ret_val = xmlUCSIsGeneralPunctuation(code);
39481        desret_int(ret_val);
39482        call_tests++;
39483        des_int(n_code, code, 0);
39484        xmlResetLastError();
39485        if (mem_base != xmlMemBlocks()) {
39486            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39487	           xmlMemBlocks() - mem_base);
39488	    test_ret++;
39489            printf(" %d", n_code);
39490            printf("\n");
39491        }
39492    }
39493    function_tests++;
39494#endif
39495
39496    return(test_ret);
39497}
39498
39499
39500static int
39501test_xmlUCSIsGeometricShapes(void) {
39502    int test_ret = 0;
39503
39504#if defined(LIBXML_UNICODE_ENABLED)
39505    int mem_base;
39506    int ret_val;
39507    int code; /* UCS code point */
39508    int n_code;
39509
39510    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39511        mem_base = xmlMemBlocks();
39512        code = gen_int(n_code, 0);
39513
39514        ret_val = xmlUCSIsGeometricShapes(code);
39515        desret_int(ret_val);
39516        call_tests++;
39517        des_int(n_code, code, 0);
39518        xmlResetLastError();
39519        if (mem_base != xmlMemBlocks()) {
39520            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39521	           xmlMemBlocks() - mem_base);
39522	    test_ret++;
39523            printf(" %d", n_code);
39524            printf("\n");
39525        }
39526    }
39527    function_tests++;
39528#endif
39529
39530    return(test_ret);
39531}
39532
39533
39534static int
39535test_xmlUCSIsGeorgian(void) {
39536    int test_ret = 0;
39537
39538#if defined(LIBXML_UNICODE_ENABLED)
39539    int mem_base;
39540    int ret_val;
39541    int code; /* UCS code point */
39542    int n_code;
39543
39544    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39545        mem_base = xmlMemBlocks();
39546        code = gen_int(n_code, 0);
39547
39548        ret_val = xmlUCSIsGeorgian(code);
39549        desret_int(ret_val);
39550        call_tests++;
39551        des_int(n_code, code, 0);
39552        xmlResetLastError();
39553        if (mem_base != xmlMemBlocks()) {
39554            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39555	           xmlMemBlocks() - mem_base);
39556	    test_ret++;
39557            printf(" %d", n_code);
39558            printf("\n");
39559        }
39560    }
39561    function_tests++;
39562#endif
39563
39564    return(test_ret);
39565}
39566
39567
39568static int
39569test_xmlUCSIsGothic(void) {
39570    int test_ret = 0;
39571
39572#if defined(LIBXML_UNICODE_ENABLED)
39573    int mem_base;
39574    int ret_val;
39575    int code; /* UCS code point */
39576    int n_code;
39577
39578    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39579        mem_base = xmlMemBlocks();
39580        code = gen_int(n_code, 0);
39581
39582        ret_val = xmlUCSIsGothic(code);
39583        desret_int(ret_val);
39584        call_tests++;
39585        des_int(n_code, code, 0);
39586        xmlResetLastError();
39587        if (mem_base != xmlMemBlocks()) {
39588            printf("Leak of %d blocks found in xmlUCSIsGothic",
39589	           xmlMemBlocks() - mem_base);
39590	    test_ret++;
39591            printf(" %d", n_code);
39592            printf("\n");
39593        }
39594    }
39595    function_tests++;
39596#endif
39597
39598    return(test_ret);
39599}
39600
39601
39602static int
39603test_xmlUCSIsGreek(void) {
39604    int test_ret = 0;
39605
39606#if defined(LIBXML_UNICODE_ENABLED)
39607    int mem_base;
39608    int ret_val;
39609    int code; /* UCS code point */
39610    int n_code;
39611
39612    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39613        mem_base = xmlMemBlocks();
39614        code = gen_int(n_code, 0);
39615
39616        ret_val = xmlUCSIsGreek(code);
39617        desret_int(ret_val);
39618        call_tests++;
39619        des_int(n_code, code, 0);
39620        xmlResetLastError();
39621        if (mem_base != xmlMemBlocks()) {
39622            printf("Leak of %d blocks found in xmlUCSIsGreek",
39623	           xmlMemBlocks() - mem_base);
39624	    test_ret++;
39625            printf(" %d", n_code);
39626            printf("\n");
39627        }
39628    }
39629    function_tests++;
39630#endif
39631
39632    return(test_ret);
39633}
39634
39635
39636static int
39637test_xmlUCSIsGreekExtended(void) {
39638    int test_ret = 0;
39639
39640#if defined(LIBXML_UNICODE_ENABLED)
39641    int mem_base;
39642    int ret_val;
39643    int code; /* UCS code point */
39644    int n_code;
39645
39646    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39647        mem_base = xmlMemBlocks();
39648        code = gen_int(n_code, 0);
39649
39650        ret_val = xmlUCSIsGreekExtended(code);
39651        desret_int(ret_val);
39652        call_tests++;
39653        des_int(n_code, code, 0);
39654        xmlResetLastError();
39655        if (mem_base != xmlMemBlocks()) {
39656            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39657	           xmlMemBlocks() - mem_base);
39658	    test_ret++;
39659            printf(" %d", n_code);
39660            printf("\n");
39661        }
39662    }
39663    function_tests++;
39664#endif
39665
39666    return(test_ret);
39667}
39668
39669
39670static int
39671test_xmlUCSIsGreekandCoptic(void) {
39672    int test_ret = 0;
39673
39674#if defined(LIBXML_UNICODE_ENABLED)
39675    int mem_base;
39676    int ret_val;
39677    int code; /* UCS code point */
39678    int n_code;
39679
39680    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39681        mem_base = xmlMemBlocks();
39682        code = gen_int(n_code, 0);
39683
39684        ret_val = xmlUCSIsGreekandCoptic(code);
39685        desret_int(ret_val);
39686        call_tests++;
39687        des_int(n_code, code, 0);
39688        xmlResetLastError();
39689        if (mem_base != xmlMemBlocks()) {
39690            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39691	           xmlMemBlocks() - mem_base);
39692	    test_ret++;
39693            printf(" %d", n_code);
39694            printf("\n");
39695        }
39696    }
39697    function_tests++;
39698#endif
39699
39700    return(test_ret);
39701}
39702
39703
39704static int
39705test_xmlUCSIsGujarati(void) {
39706    int test_ret = 0;
39707
39708#if defined(LIBXML_UNICODE_ENABLED)
39709    int mem_base;
39710    int ret_val;
39711    int code; /* UCS code point */
39712    int n_code;
39713
39714    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39715        mem_base = xmlMemBlocks();
39716        code = gen_int(n_code, 0);
39717
39718        ret_val = xmlUCSIsGujarati(code);
39719        desret_int(ret_val);
39720        call_tests++;
39721        des_int(n_code, code, 0);
39722        xmlResetLastError();
39723        if (mem_base != xmlMemBlocks()) {
39724            printf("Leak of %d blocks found in xmlUCSIsGujarati",
39725	           xmlMemBlocks() - mem_base);
39726	    test_ret++;
39727            printf(" %d", n_code);
39728            printf("\n");
39729        }
39730    }
39731    function_tests++;
39732#endif
39733
39734    return(test_ret);
39735}
39736
39737
39738static int
39739test_xmlUCSIsGurmukhi(void) {
39740    int test_ret = 0;
39741
39742#if defined(LIBXML_UNICODE_ENABLED)
39743    int mem_base;
39744    int ret_val;
39745    int code; /* UCS code point */
39746    int n_code;
39747
39748    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39749        mem_base = xmlMemBlocks();
39750        code = gen_int(n_code, 0);
39751
39752        ret_val = xmlUCSIsGurmukhi(code);
39753        desret_int(ret_val);
39754        call_tests++;
39755        des_int(n_code, code, 0);
39756        xmlResetLastError();
39757        if (mem_base != xmlMemBlocks()) {
39758            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39759	           xmlMemBlocks() - mem_base);
39760	    test_ret++;
39761            printf(" %d", n_code);
39762            printf("\n");
39763        }
39764    }
39765    function_tests++;
39766#endif
39767
39768    return(test_ret);
39769}
39770
39771
39772static int
39773test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39774    int test_ret = 0;
39775
39776#if defined(LIBXML_UNICODE_ENABLED)
39777    int mem_base;
39778    int ret_val;
39779    int code; /* UCS code point */
39780    int n_code;
39781
39782    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39783        mem_base = xmlMemBlocks();
39784        code = gen_int(n_code, 0);
39785
39786        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
39787        desret_int(ret_val);
39788        call_tests++;
39789        des_int(n_code, code, 0);
39790        xmlResetLastError();
39791        if (mem_base != xmlMemBlocks()) {
39792            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
39793	           xmlMemBlocks() - mem_base);
39794	    test_ret++;
39795            printf(" %d", n_code);
39796            printf("\n");
39797        }
39798    }
39799    function_tests++;
39800#endif
39801
39802    return(test_ret);
39803}
39804
39805
39806static int
39807test_xmlUCSIsHangulCompatibilityJamo(void) {
39808    int test_ret = 0;
39809
39810#if defined(LIBXML_UNICODE_ENABLED)
39811    int mem_base;
39812    int ret_val;
39813    int code; /* UCS code point */
39814    int n_code;
39815
39816    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39817        mem_base = xmlMemBlocks();
39818        code = gen_int(n_code, 0);
39819
39820        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
39821        desret_int(ret_val);
39822        call_tests++;
39823        des_int(n_code, code, 0);
39824        xmlResetLastError();
39825        if (mem_base != xmlMemBlocks()) {
39826            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
39827	           xmlMemBlocks() - mem_base);
39828	    test_ret++;
39829            printf(" %d", n_code);
39830            printf("\n");
39831        }
39832    }
39833    function_tests++;
39834#endif
39835
39836    return(test_ret);
39837}
39838
39839
39840static int
39841test_xmlUCSIsHangulJamo(void) {
39842    int test_ret = 0;
39843
39844#if defined(LIBXML_UNICODE_ENABLED)
39845    int mem_base;
39846    int ret_val;
39847    int code; /* UCS code point */
39848    int n_code;
39849
39850    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39851        mem_base = xmlMemBlocks();
39852        code = gen_int(n_code, 0);
39853
39854        ret_val = xmlUCSIsHangulJamo(code);
39855        desret_int(ret_val);
39856        call_tests++;
39857        des_int(n_code, code, 0);
39858        xmlResetLastError();
39859        if (mem_base != xmlMemBlocks()) {
39860            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
39861	           xmlMemBlocks() - mem_base);
39862	    test_ret++;
39863            printf(" %d", n_code);
39864            printf("\n");
39865        }
39866    }
39867    function_tests++;
39868#endif
39869
39870    return(test_ret);
39871}
39872
39873
39874static int
39875test_xmlUCSIsHangulSyllables(void) {
39876    int test_ret = 0;
39877
39878#if defined(LIBXML_UNICODE_ENABLED)
39879    int mem_base;
39880    int ret_val;
39881    int code; /* UCS code point */
39882    int n_code;
39883
39884    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39885        mem_base = xmlMemBlocks();
39886        code = gen_int(n_code, 0);
39887
39888        ret_val = xmlUCSIsHangulSyllables(code);
39889        desret_int(ret_val);
39890        call_tests++;
39891        des_int(n_code, code, 0);
39892        xmlResetLastError();
39893        if (mem_base != xmlMemBlocks()) {
39894            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
39895	           xmlMemBlocks() - mem_base);
39896	    test_ret++;
39897            printf(" %d", n_code);
39898            printf("\n");
39899        }
39900    }
39901    function_tests++;
39902#endif
39903
39904    return(test_ret);
39905}
39906
39907
39908static int
39909test_xmlUCSIsHanunoo(void) {
39910    int test_ret = 0;
39911
39912#if defined(LIBXML_UNICODE_ENABLED)
39913    int mem_base;
39914    int ret_val;
39915    int code; /* UCS code point */
39916    int n_code;
39917
39918    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39919        mem_base = xmlMemBlocks();
39920        code = gen_int(n_code, 0);
39921
39922        ret_val = xmlUCSIsHanunoo(code);
39923        desret_int(ret_val);
39924        call_tests++;
39925        des_int(n_code, code, 0);
39926        xmlResetLastError();
39927        if (mem_base != xmlMemBlocks()) {
39928            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
39929	           xmlMemBlocks() - mem_base);
39930	    test_ret++;
39931            printf(" %d", n_code);
39932            printf("\n");
39933        }
39934    }
39935    function_tests++;
39936#endif
39937
39938    return(test_ret);
39939}
39940
39941
39942static int
39943test_xmlUCSIsHebrew(void) {
39944    int test_ret = 0;
39945
39946#if defined(LIBXML_UNICODE_ENABLED)
39947    int mem_base;
39948    int ret_val;
39949    int code; /* UCS code point */
39950    int n_code;
39951
39952    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39953        mem_base = xmlMemBlocks();
39954        code = gen_int(n_code, 0);
39955
39956        ret_val = xmlUCSIsHebrew(code);
39957        desret_int(ret_val);
39958        call_tests++;
39959        des_int(n_code, code, 0);
39960        xmlResetLastError();
39961        if (mem_base != xmlMemBlocks()) {
39962            printf("Leak of %d blocks found in xmlUCSIsHebrew",
39963	           xmlMemBlocks() - mem_base);
39964	    test_ret++;
39965            printf(" %d", n_code);
39966            printf("\n");
39967        }
39968    }
39969    function_tests++;
39970#endif
39971
39972    return(test_ret);
39973}
39974
39975
39976static int
39977test_xmlUCSIsHighPrivateUseSurrogates(void) {
39978    int test_ret = 0;
39979
39980#if defined(LIBXML_UNICODE_ENABLED)
39981    int mem_base;
39982    int ret_val;
39983    int code; /* UCS code point */
39984    int n_code;
39985
39986    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39987        mem_base = xmlMemBlocks();
39988        code = gen_int(n_code, 0);
39989
39990        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
39991        desret_int(ret_val);
39992        call_tests++;
39993        des_int(n_code, code, 0);
39994        xmlResetLastError();
39995        if (mem_base != xmlMemBlocks()) {
39996            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
39997	           xmlMemBlocks() - mem_base);
39998	    test_ret++;
39999            printf(" %d", n_code);
40000            printf("\n");
40001        }
40002    }
40003    function_tests++;
40004#endif
40005
40006    return(test_ret);
40007}
40008
40009
40010static int
40011test_xmlUCSIsHighSurrogates(void) {
40012    int test_ret = 0;
40013
40014#if defined(LIBXML_UNICODE_ENABLED)
40015    int mem_base;
40016    int ret_val;
40017    int code; /* UCS code point */
40018    int n_code;
40019
40020    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40021        mem_base = xmlMemBlocks();
40022        code = gen_int(n_code, 0);
40023
40024        ret_val = xmlUCSIsHighSurrogates(code);
40025        desret_int(ret_val);
40026        call_tests++;
40027        des_int(n_code, code, 0);
40028        xmlResetLastError();
40029        if (mem_base != xmlMemBlocks()) {
40030            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40031	           xmlMemBlocks() - mem_base);
40032	    test_ret++;
40033            printf(" %d", n_code);
40034            printf("\n");
40035        }
40036    }
40037    function_tests++;
40038#endif
40039
40040    return(test_ret);
40041}
40042
40043
40044static int
40045test_xmlUCSIsHiragana(void) {
40046    int test_ret = 0;
40047
40048#if defined(LIBXML_UNICODE_ENABLED)
40049    int mem_base;
40050    int ret_val;
40051    int code; /* UCS code point */
40052    int n_code;
40053
40054    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40055        mem_base = xmlMemBlocks();
40056        code = gen_int(n_code, 0);
40057
40058        ret_val = xmlUCSIsHiragana(code);
40059        desret_int(ret_val);
40060        call_tests++;
40061        des_int(n_code, code, 0);
40062        xmlResetLastError();
40063        if (mem_base != xmlMemBlocks()) {
40064            printf("Leak of %d blocks found in xmlUCSIsHiragana",
40065	           xmlMemBlocks() - mem_base);
40066	    test_ret++;
40067            printf(" %d", n_code);
40068            printf("\n");
40069        }
40070    }
40071    function_tests++;
40072#endif
40073
40074    return(test_ret);
40075}
40076
40077
40078static int
40079test_xmlUCSIsIPAExtensions(void) {
40080    int test_ret = 0;
40081
40082#if defined(LIBXML_UNICODE_ENABLED)
40083    int mem_base;
40084    int ret_val;
40085    int code; /* UCS code point */
40086    int n_code;
40087
40088    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40089        mem_base = xmlMemBlocks();
40090        code = gen_int(n_code, 0);
40091
40092        ret_val = xmlUCSIsIPAExtensions(code);
40093        desret_int(ret_val);
40094        call_tests++;
40095        des_int(n_code, code, 0);
40096        xmlResetLastError();
40097        if (mem_base != xmlMemBlocks()) {
40098            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40099	           xmlMemBlocks() - mem_base);
40100	    test_ret++;
40101            printf(" %d", n_code);
40102            printf("\n");
40103        }
40104    }
40105    function_tests++;
40106#endif
40107
40108    return(test_ret);
40109}
40110
40111
40112static int
40113test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40114    int test_ret = 0;
40115
40116#if defined(LIBXML_UNICODE_ENABLED)
40117    int mem_base;
40118    int ret_val;
40119    int code; /* UCS code point */
40120    int n_code;
40121
40122    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40123        mem_base = xmlMemBlocks();
40124        code = gen_int(n_code, 0);
40125
40126        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40127        desret_int(ret_val);
40128        call_tests++;
40129        des_int(n_code, code, 0);
40130        xmlResetLastError();
40131        if (mem_base != xmlMemBlocks()) {
40132            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40133	           xmlMemBlocks() - mem_base);
40134	    test_ret++;
40135            printf(" %d", n_code);
40136            printf("\n");
40137        }
40138    }
40139    function_tests++;
40140#endif
40141
40142    return(test_ret);
40143}
40144
40145
40146static int
40147test_xmlUCSIsKanbun(void) {
40148    int test_ret = 0;
40149
40150#if defined(LIBXML_UNICODE_ENABLED)
40151    int mem_base;
40152    int ret_val;
40153    int code; /* UCS code point */
40154    int n_code;
40155
40156    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40157        mem_base = xmlMemBlocks();
40158        code = gen_int(n_code, 0);
40159
40160        ret_val = xmlUCSIsKanbun(code);
40161        desret_int(ret_val);
40162        call_tests++;
40163        des_int(n_code, code, 0);
40164        xmlResetLastError();
40165        if (mem_base != xmlMemBlocks()) {
40166            printf("Leak of %d blocks found in xmlUCSIsKanbun",
40167	           xmlMemBlocks() - mem_base);
40168	    test_ret++;
40169            printf(" %d", n_code);
40170            printf("\n");
40171        }
40172    }
40173    function_tests++;
40174#endif
40175
40176    return(test_ret);
40177}
40178
40179
40180static int
40181test_xmlUCSIsKangxiRadicals(void) {
40182    int test_ret = 0;
40183
40184#if defined(LIBXML_UNICODE_ENABLED)
40185    int mem_base;
40186    int ret_val;
40187    int code; /* UCS code point */
40188    int n_code;
40189
40190    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40191        mem_base = xmlMemBlocks();
40192        code = gen_int(n_code, 0);
40193
40194        ret_val = xmlUCSIsKangxiRadicals(code);
40195        desret_int(ret_val);
40196        call_tests++;
40197        des_int(n_code, code, 0);
40198        xmlResetLastError();
40199        if (mem_base != xmlMemBlocks()) {
40200            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40201	           xmlMemBlocks() - mem_base);
40202	    test_ret++;
40203            printf(" %d", n_code);
40204            printf("\n");
40205        }
40206    }
40207    function_tests++;
40208#endif
40209
40210    return(test_ret);
40211}
40212
40213
40214static int
40215test_xmlUCSIsKannada(void) {
40216    int test_ret = 0;
40217
40218#if defined(LIBXML_UNICODE_ENABLED)
40219    int mem_base;
40220    int ret_val;
40221    int code; /* UCS code point */
40222    int n_code;
40223
40224    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40225        mem_base = xmlMemBlocks();
40226        code = gen_int(n_code, 0);
40227
40228        ret_val = xmlUCSIsKannada(code);
40229        desret_int(ret_val);
40230        call_tests++;
40231        des_int(n_code, code, 0);
40232        xmlResetLastError();
40233        if (mem_base != xmlMemBlocks()) {
40234            printf("Leak of %d blocks found in xmlUCSIsKannada",
40235	           xmlMemBlocks() - mem_base);
40236	    test_ret++;
40237            printf(" %d", n_code);
40238            printf("\n");
40239        }
40240    }
40241    function_tests++;
40242#endif
40243
40244    return(test_ret);
40245}
40246
40247
40248static int
40249test_xmlUCSIsKatakana(void) {
40250    int test_ret = 0;
40251
40252#if defined(LIBXML_UNICODE_ENABLED)
40253    int mem_base;
40254    int ret_val;
40255    int code; /* UCS code point */
40256    int n_code;
40257
40258    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40259        mem_base = xmlMemBlocks();
40260        code = gen_int(n_code, 0);
40261
40262        ret_val = xmlUCSIsKatakana(code);
40263        desret_int(ret_val);
40264        call_tests++;
40265        des_int(n_code, code, 0);
40266        xmlResetLastError();
40267        if (mem_base != xmlMemBlocks()) {
40268            printf("Leak of %d blocks found in xmlUCSIsKatakana",
40269	           xmlMemBlocks() - mem_base);
40270	    test_ret++;
40271            printf(" %d", n_code);
40272            printf("\n");
40273        }
40274    }
40275    function_tests++;
40276#endif
40277
40278    return(test_ret);
40279}
40280
40281
40282static int
40283test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40284    int test_ret = 0;
40285
40286#if defined(LIBXML_UNICODE_ENABLED)
40287    int mem_base;
40288    int ret_val;
40289    int code; /* UCS code point */
40290    int n_code;
40291
40292    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40293        mem_base = xmlMemBlocks();
40294        code = gen_int(n_code, 0);
40295
40296        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40297        desret_int(ret_val);
40298        call_tests++;
40299        des_int(n_code, code, 0);
40300        xmlResetLastError();
40301        if (mem_base != xmlMemBlocks()) {
40302            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40303	           xmlMemBlocks() - mem_base);
40304	    test_ret++;
40305            printf(" %d", n_code);
40306            printf("\n");
40307        }
40308    }
40309    function_tests++;
40310#endif
40311
40312    return(test_ret);
40313}
40314
40315
40316static int
40317test_xmlUCSIsKhmer(void) {
40318    int test_ret = 0;
40319
40320#if defined(LIBXML_UNICODE_ENABLED)
40321    int mem_base;
40322    int ret_val;
40323    int code; /* UCS code point */
40324    int n_code;
40325
40326    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40327        mem_base = xmlMemBlocks();
40328        code = gen_int(n_code, 0);
40329
40330        ret_val = xmlUCSIsKhmer(code);
40331        desret_int(ret_val);
40332        call_tests++;
40333        des_int(n_code, code, 0);
40334        xmlResetLastError();
40335        if (mem_base != xmlMemBlocks()) {
40336            printf("Leak of %d blocks found in xmlUCSIsKhmer",
40337	           xmlMemBlocks() - mem_base);
40338	    test_ret++;
40339            printf(" %d", n_code);
40340            printf("\n");
40341        }
40342    }
40343    function_tests++;
40344#endif
40345
40346    return(test_ret);
40347}
40348
40349
40350static int
40351test_xmlUCSIsKhmerSymbols(void) {
40352    int test_ret = 0;
40353
40354#if defined(LIBXML_UNICODE_ENABLED)
40355    int mem_base;
40356    int ret_val;
40357    int code; /* UCS code point */
40358    int n_code;
40359
40360    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40361        mem_base = xmlMemBlocks();
40362        code = gen_int(n_code, 0);
40363
40364        ret_val = xmlUCSIsKhmerSymbols(code);
40365        desret_int(ret_val);
40366        call_tests++;
40367        des_int(n_code, code, 0);
40368        xmlResetLastError();
40369        if (mem_base != xmlMemBlocks()) {
40370            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40371	           xmlMemBlocks() - mem_base);
40372	    test_ret++;
40373            printf(" %d", n_code);
40374            printf("\n");
40375        }
40376    }
40377    function_tests++;
40378#endif
40379
40380    return(test_ret);
40381}
40382
40383
40384static int
40385test_xmlUCSIsLao(void) {
40386    int test_ret = 0;
40387
40388#if defined(LIBXML_UNICODE_ENABLED)
40389    int mem_base;
40390    int ret_val;
40391    int code; /* UCS code point */
40392    int n_code;
40393
40394    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40395        mem_base = xmlMemBlocks();
40396        code = gen_int(n_code, 0);
40397
40398        ret_val = xmlUCSIsLao(code);
40399        desret_int(ret_val);
40400        call_tests++;
40401        des_int(n_code, code, 0);
40402        xmlResetLastError();
40403        if (mem_base != xmlMemBlocks()) {
40404            printf("Leak of %d blocks found in xmlUCSIsLao",
40405	           xmlMemBlocks() - mem_base);
40406	    test_ret++;
40407            printf(" %d", n_code);
40408            printf("\n");
40409        }
40410    }
40411    function_tests++;
40412#endif
40413
40414    return(test_ret);
40415}
40416
40417
40418static int
40419test_xmlUCSIsLatin1Supplement(void) {
40420    int test_ret = 0;
40421
40422#if defined(LIBXML_UNICODE_ENABLED)
40423    int mem_base;
40424    int ret_val;
40425    int code; /* UCS code point */
40426    int n_code;
40427
40428    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40429        mem_base = xmlMemBlocks();
40430        code = gen_int(n_code, 0);
40431
40432        ret_val = xmlUCSIsLatin1Supplement(code);
40433        desret_int(ret_val);
40434        call_tests++;
40435        des_int(n_code, code, 0);
40436        xmlResetLastError();
40437        if (mem_base != xmlMemBlocks()) {
40438            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40439	           xmlMemBlocks() - mem_base);
40440	    test_ret++;
40441            printf(" %d", n_code);
40442            printf("\n");
40443        }
40444    }
40445    function_tests++;
40446#endif
40447
40448    return(test_ret);
40449}
40450
40451
40452static int
40453test_xmlUCSIsLatinExtendedA(void) {
40454    int test_ret = 0;
40455
40456#if defined(LIBXML_UNICODE_ENABLED)
40457    int mem_base;
40458    int ret_val;
40459    int code; /* UCS code point */
40460    int n_code;
40461
40462    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40463        mem_base = xmlMemBlocks();
40464        code = gen_int(n_code, 0);
40465
40466        ret_val = xmlUCSIsLatinExtendedA(code);
40467        desret_int(ret_val);
40468        call_tests++;
40469        des_int(n_code, code, 0);
40470        xmlResetLastError();
40471        if (mem_base != xmlMemBlocks()) {
40472            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40473	           xmlMemBlocks() - mem_base);
40474	    test_ret++;
40475            printf(" %d", n_code);
40476            printf("\n");
40477        }
40478    }
40479    function_tests++;
40480#endif
40481
40482    return(test_ret);
40483}
40484
40485
40486static int
40487test_xmlUCSIsLatinExtendedAdditional(void) {
40488    int test_ret = 0;
40489
40490#if defined(LIBXML_UNICODE_ENABLED)
40491    int mem_base;
40492    int ret_val;
40493    int code; /* UCS code point */
40494    int n_code;
40495
40496    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40497        mem_base = xmlMemBlocks();
40498        code = gen_int(n_code, 0);
40499
40500        ret_val = xmlUCSIsLatinExtendedAdditional(code);
40501        desret_int(ret_val);
40502        call_tests++;
40503        des_int(n_code, code, 0);
40504        xmlResetLastError();
40505        if (mem_base != xmlMemBlocks()) {
40506            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40507	           xmlMemBlocks() - mem_base);
40508	    test_ret++;
40509            printf(" %d", n_code);
40510            printf("\n");
40511        }
40512    }
40513    function_tests++;
40514#endif
40515
40516    return(test_ret);
40517}
40518
40519
40520static int
40521test_xmlUCSIsLatinExtendedB(void) {
40522    int test_ret = 0;
40523
40524#if defined(LIBXML_UNICODE_ENABLED)
40525    int mem_base;
40526    int ret_val;
40527    int code; /* UCS code point */
40528    int n_code;
40529
40530    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40531        mem_base = xmlMemBlocks();
40532        code = gen_int(n_code, 0);
40533
40534        ret_val = xmlUCSIsLatinExtendedB(code);
40535        desret_int(ret_val);
40536        call_tests++;
40537        des_int(n_code, code, 0);
40538        xmlResetLastError();
40539        if (mem_base != xmlMemBlocks()) {
40540            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40541	           xmlMemBlocks() - mem_base);
40542	    test_ret++;
40543            printf(" %d", n_code);
40544            printf("\n");
40545        }
40546    }
40547    function_tests++;
40548#endif
40549
40550    return(test_ret);
40551}
40552
40553
40554static int
40555test_xmlUCSIsLetterlikeSymbols(void) {
40556    int test_ret = 0;
40557
40558#if defined(LIBXML_UNICODE_ENABLED)
40559    int mem_base;
40560    int ret_val;
40561    int code; /* UCS code point */
40562    int n_code;
40563
40564    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40565        mem_base = xmlMemBlocks();
40566        code = gen_int(n_code, 0);
40567
40568        ret_val = xmlUCSIsLetterlikeSymbols(code);
40569        desret_int(ret_val);
40570        call_tests++;
40571        des_int(n_code, code, 0);
40572        xmlResetLastError();
40573        if (mem_base != xmlMemBlocks()) {
40574            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40575	           xmlMemBlocks() - mem_base);
40576	    test_ret++;
40577            printf(" %d", n_code);
40578            printf("\n");
40579        }
40580    }
40581    function_tests++;
40582#endif
40583
40584    return(test_ret);
40585}
40586
40587
40588static int
40589test_xmlUCSIsLimbu(void) {
40590    int test_ret = 0;
40591
40592#if defined(LIBXML_UNICODE_ENABLED)
40593    int mem_base;
40594    int ret_val;
40595    int code; /* UCS code point */
40596    int n_code;
40597
40598    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40599        mem_base = xmlMemBlocks();
40600        code = gen_int(n_code, 0);
40601
40602        ret_val = xmlUCSIsLimbu(code);
40603        desret_int(ret_val);
40604        call_tests++;
40605        des_int(n_code, code, 0);
40606        xmlResetLastError();
40607        if (mem_base != xmlMemBlocks()) {
40608            printf("Leak of %d blocks found in xmlUCSIsLimbu",
40609	           xmlMemBlocks() - mem_base);
40610	    test_ret++;
40611            printf(" %d", n_code);
40612            printf("\n");
40613        }
40614    }
40615    function_tests++;
40616#endif
40617
40618    return(test_ret);
40619}
40620
40621
40622static int
40623test_xmlUCSIsLinearBIdeograms(void) {
40624    int test_ret = 0;
40625
40626#if defined(LIBXML_UNICODE_ENABLED)
40627    int mem_base;
40628    int ret_val;
40629    int code; /* UCS code point */
40630    int n_code;
40631
40632    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40633        mem_base = xmlMemBlocks();
40634        code = gen_int(n_code, 0);
40635
40636        ret_val = xmlUCSIsLinearBIdeograms(code);
40637        desret_int(ret_val);
40638        call_tests++;
40639        des_int(n_code, code, 0);
40640        xmlResetLastError();
40641        if (mem_base != xmlMemBlocks()) {
40642            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40643	           xmlMemBlocks() - mem_base);
40644	    test_ret++;
40645            printf(" %d", n_code);
40646            printf("\n");
40647        }
40648    }
40649    function_tests++;
40650#endif
40651
40652    return(test_ret);
40653}
40654
40655
40656static int
40657test_xmlUCSIsLinearBSyllabary(void) {
40658    int test_ret = 0;
40659
40660#if defined(LIBXML_UNICODE_ENABLED)
40661    int mem_base;
40662    int ret_val;
40663    int code; /* UCS code point */
40664    int n_code;
40665
40666    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40667        mem_base = xmlMemBlocks();
40668        code = gen_int(n_code, 0);
40669
40670        ret_val = xmlUCSIsLinearBSyllabary(code);
40671        desret_int(ret_val);
40672        call_tests++;
40673        des_int(n_code, code, 0);
40674        xmlResetLastError();
40675        if (mem_base != xmlMemBlocks()) {
40676            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40677	           xmlMemBlocks() - mem_base);
40678	    test_ret++;
40679            printf(" %d", n_code);
40680            printf("\n");
40681        }
40682    }
40683    function_tests++;
40684#endif
40685
40686    return(test_ret);
40687}
40688
40689
40690static int
40691test_xmlUCSIsLowSurrogates(void) {
40692    int test_ret = 0;
40693
40694#if defined(LIBXML_UNICODE_ENABLED)
40695    int mem_base;
40696    int ret_val;
40697    int code; /* UCS code point */
40698    int n_code;
40699
40700    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40701        mem_base = xmlMemBlocks();
40702        code = gen_int(n_code, 0);
40703
40704        ret_val = xmlUCSIsLowSurrogates(code);
40705        desret_int(ret_val);
40706        call_tests++;
40707        des_int(n_code, code, 0);
40708        xmlResetLastError();
40709        if (mem_base != xmlMemBlocks()) {
40710            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40711	           xmlMemBlocks() - mem_base);
40712	    test_ret++;
40713            printf(" %d", n_code);
40714            printf("\n");
40715        }
40716    }
40717    function_tests++;
40718#endif
40719
40720    return(test_ret);
40721}
40722
40723
40724static int
40725test_xmlUCSIsMalayalam(void) {
40726    int test_ret = 0;
40727
40728#if defined(LIBXML_UNICODE_ENABLED)
40729    int mem_base;
40730    int ret_val;
40731    int code; /* UCS code point */
40732    int n_code;
40733
40734    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40735        mem_base = xmlMemBlocks();
40736        code = gen_int(n_code, 0);
40737
40738        ret_val = xmlUCSIsMalayalam(code);
40739        desret_int(ret_val);
40740        call_tests++;
40741        des_int(n_code, code, 0);
40742        xmlResetLastError();
40743        if (mem_base != xmlMemBlocks()) {
40744            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40745	           xmlMemBlocks() - mem_base);
40746	    test_ret++;
40747            printf(" %d", n_code);
40748            printf("\n");
40749        }
40750    }
40751    function_tests++;
40752#endif
40753
40754    return(test_ret);
40755}
40756
40757
40758static int
40759test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40760    int test_ret = 0;
40761
40762#if defined(LIBXML_UNICODE_ENABLED)
40763    int mem_base;
40764    int ret_val;
40765    int code; /* UCS code point */
40766    int n_code;
40767
40768    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40769        mem_base = xmlMemBlocks();
40770        code = gen_int(n_code, 0);
40771
40772        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40773        desret_int(ret_val);
40774        call_tests++;
40775        des_int(n_code, code, 0);
40776        xmlResetLastError();
40777        if (mem_base != xmlMemBlocks()) {
40778            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
40779	           xmlMemBlocks() - mem_base);
40780	    test_ret++;
40781            printf(" %d", n_code);
40782            printf("\n");
40783        }
40784    }
40785    function_tests++;
40786#endif
40787
40788    return(test_ret);
40789}
40790
40791
40792static int
40793test_xmlUCSIsMathematicalOperators(void) {
40794    int test_ret = 0;
40795
40796#if defined(LIBXML_UNICODE_ENABLED)
40797    int mem_base;
40798    int ret_val;
40799    int code; /* UCS code point */
40800    int n_code;
40801
40802    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40803        mem_base = xmlMemBlocks();
40804        code = gen_int(n_code, 0);
40805
40806        ret_val = xmlUCSIsMathematicalOperators(code);
40807        desret_int(ret_val);
40808        call_tests++;
40809        des_int(n_code, code, 0);
40810        xmlResetLastError();
40811        if (mem_base != xmlMemBlocks()) {
40812            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
40813	           xmlMemBlocks() - mem_base);
40814	    test_ret++;
40815            printf(" %d", n_code);
40816            printf("\n");
40817        }
40818    }
40819    function_tests++;
40820#endif
40821
40822    return(test_ret);
40823}
40824
40825
40826static int
40827test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
40828    int test_ret = 0;
40829
40830#if defined(LIBXML_UNICODE_ENABLED)
40831    int mem_base;
40832    int ret_val;
40833    int code; /* UCS code point */
40834    int n_code;
40835
40836    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40837        mem_base = xmlMemBlocks();
40838        code = gen_int(n_code, 0);
40839
40840        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
40841        desret_int(ret_val);
40842        call_tests++;
40843        des_int(n_code, code, 0);
40844        xmlResetLastError();
40845        if (mem_base != xmlMemBlocks()) {
40846            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
40847	           xmlMemBlocks() - mem_base);
40848	    test_ret++;
40849            printf(" %d", n_code);
40850            printf("\n");
40851        }
40852    }
40853    function_tests++;
40854#endif
40855
40856    return(test_ret);
40857}
40858
40859
40860static int
40861test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
40862    int test_ret = 0;
40863
40864#if defined(LIBXML_UNICODE_ENABLED)
40865    int mem_base;
40866    int ret_val;
40867    int code; /* UCS code point */
40868    int n_code;
40869
40870    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40871        mem_base = xmlMemBlocks();
40872        code = gen_int(n_code, 0);
40873
40874        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
40875        desret_int(ret_val);
40876        call_tests++;
40877        des_int(n_code, code, 0);
40878        xmlResetLastError();
40879        if (mem_base != xmlMemBlocks()) {
40880            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
40881	           xmlMemBlocks() - mem_base);
40882	    test_ret++;
40883            printf(" %d", n_code);
40884            printf("\n");
40885        }
40886    }
40887    function_tests++;
40888#endif
40889
40890    return(test_ret);
40891}
40892
40893
40894static int
40895test_xmlUCSIsMiscellaneousSymbols(void) {
40896    int test_ret = 0;
40897
40898#if defined(LIBXML_UNICODE_ENABLED)
40899    int mem_base;
40900    int ret_val;
40901    int code; /* UCS code point */
40902    int n_code;
40903
40904    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40905        mem_base = xmlMemBlocks();
40906        code = gen_int(n_code, 0);
40907
40908        ret_val = xmlUCSIsMiscellaneousSymbols(code);
40909        desret_int(ret_val);
40910        call_tests++;
40911        des_int(n_code, code, 0);
40912        xmlResetLastError();
40913        if (mem_base != xmlMemBlocks()) {
40914            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
40915	           xmlMemBlocks() - mem_base);
40916	    test_ret++;
40917            printf(" %d", n_code);
40918            printf("\n");
40919        }
40920    }
40921    function_tests++;
40922#endif
40923
40924    return(test_ret);
40925}
40926
40927
40928static int
40929test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
40930    int test_ret = 0;
40931
40932#if defined(LIBXML_UNICODE_ENABLED)
40933    int mem_base;
40934    int ret_val;
40935    int code; /* UCS code point */
40936    int n_code;
40937
40938    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40939        mem_base = xmlMemBlocks();
40940        code = gen_int(n_code, 0);
40941
40942        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
40943        desret_int(ret_val);
40944        call_tests++;
40945        des_int(n_code, code, 0);
40946        xmlResetLastError();
40947        if (mem_base != xmlMemBlocks()) {
40948            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
40949	           xmlMemBlocks() - mem_base);
40950	    test_ret++;
40951            printf(" %d", n_code);
40952            printf("\n");
40953        }
40954    }
40955    function_tests++;
40956#endif
40957
40958    return(test_ret);
40959}
40960
40961
40962static int
40963test_xmlUCSIsMiscellaneousTechnical(void) {
40964    int test_ret = 0;
40965
40966#if defined(LIBXML_UNICODE_ENABLED)
40967    int mem_base;
40968    int ret_val;
40969    int code; /* UCS code point */
40970    int n_code;
40971
40972    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40973        mem_base = xmlMemBlocks();
40974        code = gen_int(n_code, 0);
40975
40976        ret_val = xmlUCSIsMiscellaneousTechnical(code);
40977        desret_int(ret_val);
40978        call_tests++;
40979        des_int(n_code, code, 0);
40980        xmlResetLastError();
40981        if (mem_base != xmlMemBlocks()) {
40982            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
40983	           xmlMemBlocks() - mem_base);
40984	    test_ret++;
40985            printf(" %d", n_code);
40986            printf("\n");
40987        }
40988    }
40989    function_tests++;
40990#endif
40991
40992    return(test_ret);
40993}
40994
40995
40996static int
40997test_xmlUCSIsMongolian(void) {
40998    int test_ret = 0;
40999
41000#if defined(LIBXML_UNICODE_ENABLED)
41001    int mem_base;
41002    int ret_val;
41003    int code; /* UCS code point */
41004    int n_code;
41005
41006    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41007        mem_base = xmlMemBlocks();
41008        code = gen_int(n_code, 0);
41009
41010        ret_val = xmlUCSIsMongolian(code);
41011        desret_int(ret_val);
41012        call_tests++;
41013        des_int(n_code, code, 0);
41014        xmlResetLastError();
41015        if (mem_base != xmlMemBlocks()) {
41016            printf("Leak of %d blocks found in xmlUCSIsMongolian",
41017	           xmlMemBlocks() - mem_base);
41018	    test_ret++;
41019            printf(" %d", n_code);
41020            printf("\n");
41021        }
41022    }
41023    function_tests++;
41024#endif
41025
41026    return(test_ret);
41027}
41028
41029
41030static int
41031test_xmlUCSIsMusicalSymbols(void) {
41032    int test_ret = 0;
41033
41034#if defined(LIBXML_UNICODE_ENABLED)
41035    int mem_base;
41036    int ret_val;
41037    int code; /* UCS code point */
41038    int n_code;
41039
41040    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41041        mem_base = xmlMemBlocks();
41042        code = gen_int(n_code, 0);
41043
41044        ret_val = xmlUCSIsMusicalSymbols(code);
41045        desret_int(ret_val);
41046        call_tests++;
41047        des_int(n_code, code, 0);
41048        xmlResetLastError();
41049        if (mem_base != xmlMemBlocks()) {
41050            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41051	           xmlMemBlocks() - mem_base);
41052	    test_ret++;
41053            printf(" %d", n_code);
41054            printf("\n");
41055        }
41056    }
41057    function_tests++;
41058#endif
41059
41060    return(test_ret);
41061}
41062
41063
41064static int
41065test_xmlUCSIsMyanmar(void) {
41066    int test_ret = 0;
41067
41068#if defined(LIBXML_UNICODE_ENABLED)
41069    int mem_base;
41070    int ret_val;
41071    int code; /* UCS code point */
41072    int n_code;
41073
41074    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41075        mem_base = xmlMemBlocks();
41076        code = gen_int(n_code, 0);
41077
41078        ret_val = xmlUCSIsMyanmar(code);
41079        desret_int(ret_val);
41080        call_tests++;
41081        des_int(n_code, code, 0);
41082        xmlResetLastError();
41083        if (mem_base != xmlMemBlocks()) {
41084            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41085	           xmlMemBlocks() - mem_base);
41086	    test_ret++;
41087            printf(" %d", n_code);
41088            printf("\n");
41089        }
41090    }
41091    function_tests++;
41092#endif
41093
41094    return(test_ret);
41095}
41096
41097
41098static int
41099test_xmlUCSIsNumberForms(void) {
41100    int test_ret = 0;
41101
41102#if defined(LIBXML_UNICODE_ENABLED)
41103    int mem_base;
41104    int ret_val;
41105    int code; /* UCS code point */
41106    int n_code;
41107
41108    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41109        mem_base = xmlMemBlocks();
41110        code = gen_int(n_code, 0);
41111
41112        ret_val = xmlUCSIsNumberForms(code);
41113        desret_int(ret_val);
41114        call_tests++;
41115        des_int(n_code, code, 0);
41116        xmlResetLastError();
41117        if (mem_base != xmlMemBlocks()) {
41118            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41119	           xmlMemBlocks() - mem_base);
41120	    test_ret++;
41121            printf(" %d", n_code);
41122            printf("\n");
41123        }
41124    }
41125    function_tests++;
41126#endif
41127
41128    return(test_ret);
41129}
41130
41131
41132static int
41133test_xmlUCSIsOgham(void) {
41134    int test_ret = 0;
41135
41136#if defined(LIBXML_UNICODE_ENABLED)
41137    int mem_base;
41138    int ret_val;
41139    int code; /* UCS code point */
41140    int n_code;
41141
41142    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41143        mem_base = xmlMemBlocks();
41144        code = gen_int(n_code, 0);
41145
41146        ret_val = xmlUCSIsOgham(code);
41147        desret_int(ret_val);
41148        call_tests++;
41149        des_int(n_code, code, 0);
41150        xmlResetLastError();
41151        if (mem_base != xmlMemBlocks()) {
41152            printf("Leak of %d blocks found in xmlUCSIsOgham",
41153	           xmlMemBlocks() - mem_base);
41154	    test_ret++;
41155            printf(" %d", n_code);
41156            printf("\n");
41157        }
41158    }
41159    function_tests++;
41160#endif
41161
41162    return(test_ret);
41163}
41164
41165
41166static int
41167test_xmlUCSIsOldItalic(void) {
41168    int test_ret = 0;
41169
41170#if defined(LIBXML_UNICODE_ENABLED)
41171    int mem_base;
41172    int ret_val;
41173    int code; /* UCS code point */
41174    int n_code;
41175
41176    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41177        mem_base = xmlMemBlocks();
41178        code = gen_int(n_code, 0);
41179
41180        ret_val = xmlUCSIsOldItalic(code);
41181        desret_int(ret_val);
41182        call_tests++;
41183        des_int(n_code, code, 0);
41184        xmlResetLastError();
41185        if (mem_base != xmlMemBlocks()) {
41186            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41187	           xmlMemBlocks() - mem_base);
41188	    test_ret++;
41189            printf(" %d", n_code);
41190            printf("\n");
41191        }
41192    }
41193    function_tests++;
41194#endif
41195
41196    return(test_ret);
41197}
41198
41199
41200static int
41201test_xmlUCSIsOpticalCharacterRecognition(void) {
41202    int test_ret = 0;
41203
41204#if defined(LIBXML_UNICODE_ENABLED)
41205    int mem_base;
41206    int ret_val;
41207    int code; /* UCS code point */
41208    int n_code;
41209
41210    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41211        mem_base = xmlMemBlocks();
41212        code = gen_int(n_code, 0);
41213
41214        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41215        desret_int(ret_val);
41216        call_tests++;
41217        des_int(n_code, code, 0);
41218        xmlResetLastError();
41219        if (mem_base != xmlMemBlocks()) {
41220            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41221	           xmlMemBlocks() - mem_base);
41222	    test_ret++;
41223            printf(" %d", n_code);
41224            printf("\n");
41225        }
41226    }
41227    function_tests++;
41228#endif
41229
41230    return(test_ret);
41231}
41232
41233
41234static int
41235test_xmlUCSIsOriya(void) {
41236    int test_ret = 0;
41237
41238#if defined(LIBXML_UNICODE_ENABLED)
41239    int mem_base;
41240    int ret_val;
41241    int code; /* UCS code point */
41242    int n_code;
41243
41244    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41245        mem_base = xmlMemBlocks();
41246        code = gen_int(n_code, 0);
41247
41248        ret_val = xmlUCSIsOriya(code);
41249        desret_int(ret_val);
41250        call_tests++;
41251        des_int(n_code, code, 0);
41252        xmlResetLastError();
41253        if (mem_base != xmlMemBlocks()) {
41254            printf("Leak of %d blocks found in xmlUCSIsOriya",
41255	           xmlMemBlocks() - mem_base);
41256	    test_ret++;
41257            printf(" %d", n_code);
41258            printf("\n");
41259        }
41260    }
41261    function_tests++;
41262#endif
41263
41264    return(test_ret);
41265}
41266
41267
41268static int
41269test_xmlUCSIsOsmanya(void) {
41270    int test_ret = 0;
41271
41272#if defined(LIBXML_UNICODE_ENABLED)
41273    int mem_base;
41274    int ret_val;
41275    int code; /* UCS code point */
41276    int n_code;
41277
41278    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41279        mem_base = xmlMemBlocks();
41280        code = gen_int(n_code, 0);
41281
41282        ret_val = xmlUCSIsOsmanya(code);
41283        desret_int(ret_val);
41284        call_tests++;
41285        des_int(n_code, code, 0);
41286        xmlResetLastError();
41287        if (mem_base != xmlMemBlocks()) {
41288            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41289	           xmlMemBlocks() - mem_base);
41290	    test_ret++;
41291            printf(" %d", n_code);
41292            printf("\n");
41293        }
41294    }
41295    function_tests++;
41296#endif
41297
41298    return(test_ret);
41299}
41300
41301
41302static int
41303test_xmlUCSIsPhoneticExtensions(void) {
41304    int test_ret = 0;
41305
41306#if defined(LIBXML_UNICODE_ENABLED)
41307    int mem_base;
41308    int ret_val;
41309    int code; /* UCS code point */
41310    int n_code;
41311
41312    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41313        mem_base = xmlMemBlocks();
41314        code = gen_int(n_code, 0);
41315
41316        ret_val = xmlUCSIsPhoneticExtensions(code);
41317        desret_int(ret_val);
41318        call_tests++;
41319        des_int(n_code, code, 0);
41320        xmlResetLastError();
41321        if (mem_base != xmlMemBlocks()) {
41322            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41323	           xmlMemBlocks() - mem_base);
41324	    test_ret++;
41325            printf(" %d", n_code);
41326            printf("\n");
41327        }
41328    }
41329    function_tests++;
41330#endif
41331
41332    return(test_ret);
41333}
41334
41335
41336static int
41337test_xmlUCSIsPrivateUse(void) {
41338    int test_ret = 0;
41339
41340#if defined(LIBXML_UNICODE_ENABLED)
41341    int mem_base;
41342    int ret_val;
41343    int code; /* UCS code point */
41344    int n_code;
41345
41346    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41347        mem_base = xmlMemBlocks();
41348        code = gen_int(n_code, 0);
41349
41350        ret_val = xmlUCSIsPrivateUse(code);
41351        desret_int(ret_val);
41352        call_tests++;
41353        des_int(n_code, code, 0);
41354        xmlResetLastError();
41355        if (mem_base != xmlMemBlocks()) {
41356            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41357	           xmlMemBlocks() - mem_base);
41358	    test_ret++;
41359            printf(" %d", n_code);
41360            printf("\n");
41361        }
41362    }
41363    function_tests++;
41364#endif
41365
41366    return(test_ret);
41367}
41368
41369
41370static int
41371test_xmlUCSIsPrivateUseArea(void) {
41372    int test_ret = 0;
41373
41374#if defined(LIBXML_UNICODE_ENABLED)
41375    int mem_base;
41376    int ret_val;
41377    int code; /* UCS code point */
41378    int n_code;
41379
41380    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41381        mem_base = xmlMemBlocks();
41382        code = gen_int(n_code, 0);
41383
41384        ret_val = xmlUCSIsPrivateUseArea(code);
41385        desret_int(ret_val);
41386        call_tests++;
41387        des_int(n_code, code, 0);
41388        xmlResetLastError();
41389        if (mem_base != xmlMemBlocks()) {
41390            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41391	           xmlMemBlocks() - mem_base);
41392	    test_ret++;
41393            printf(" %d", n_code);
41394            printf("\n");
41395        }
41396    }
41397    function_tests++;
41398#endif
41399
41400    return(test_ret);
41401}
41402
41403
41404static int
41405test_xmlUCSIsRunic(void) {
41406    int test_ret = 0;
41407
41408#if defined(LIBXML_UNICODE_ENABLED)
41409    int mem_base;
41410    int ret_val;
41411    int code; /* UCS code point */
41412    int n_code;
41413
41414    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41415        mem_base = xmlMemBlocks();
41416        code = gen_int(n_code, 0);
41417
41418        ret_val = xmlUCSIsRunic(code);
41419        desret_int(ret_val);
41420        call_tests++;
41421        des_int(n_code, code, 0);
41422        xmlResetLastError();
41423        if (mem_base != xmlMemBlocks()) {
41424            printf("Leak of %d blocks found in xmlUCSIsRunic",
41425	           xmlMemBlocks() - mem_base);
41426	    test_ret++;
41427            printf(" %d", n_code);
41428            printf("\n");
41429        }
41430    }
41431    function_tests++;
41432#endif
41433
41434    return(test_ret);
41435}
41436
41437
41438static int
41439test_xmlUCSIsShavian(void) {
41440    int test_ret = 0;
41441
41442#if defined(LIBXML_UNICODE_ENABLED)
41443    int mem_base;
41444    int ret_val;
41445    int code; /* UCS code point */
41446    int n_code;
41447
41448    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41449        mem_base = xmlMemBlocks();
41450        code = gen_int(n_code, 0);
41451
41452        ret_val = xmlUCSIsShavian(code);
41453        desret_int(ret_val);
41454        call_tests++;
41455        des_int(n_code, code, 0);
41456        xmlResetLastError();
41457        if (mem_base != xmlMemBlocks()) {
41458            printf("Leak of %d blocks found in xmlUCSIsShavian",
41459	           xmlMemBlocks() - mem_base);
41460	    test_ret++;
41461            printf(" %d", n_code);
41462            printf("\n");
41463        }
41464    }
41465    function_tests++;
41466#endif
41467
41468    return(test_ret);
41469}
41470
41471
41472static int
41473test_xmlUCSIsSinhala(void) {
41474    int test_ret = 0;
41475
41476#if defined(LIBXML_UNICODE_ENABLED)
41477    int mem_base;
41478    int ret_val;
41479    int code; /* UCS code point */
41480    int n_code;
41481
41482    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41483        mem_base = xmlMemBlocks();
41484        code = gen_int(n_code, 0);
41485
41486        ret_val = xmlUCSIsSinhala(code);
41487        desret_int(ret_val);
41488        call_tests++;
41489        des_int(n_code, code, 0);
41490        xmlResetLastError();
41491        if (mem_base != xmlMemBlocks()) {
41492            printf("Leak of %d blocks found in xmlUCSIsSinhala",
41493	           xmlMemBlocks() - mem_base);
41494	    test_ret++;
41495            printf(" %d", n_code);
41496            printf("\n");
41497        }
41498    }
41499    function_tests++;
41500#endif
41501
41502    return(test_ret);
41503}
41504
41505
41506static int
41507test_xmlUCSIsSmallFormVariants(void) {
41508    int test_ret = 0;
41509
41510#if defined(LIBXML_UNICODE_ENABLED)
41511    int mem_base;
41512    int ret_val;
41513    int code; /* UCS code point */
41514    int n_code;
41515
41516    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41517        mem_base = xmlMemBlocks();
41518        code = gen_int(n_code, 0);
41519
41520        ret_val = xmlUCSIsSmallFormVariants(code);
41521        desret_int(ret_val);
41522        call_tests++;
41523        des_int(n_code, code, 0);
41524        xmlResetLastError();
41525        if (mem_base != xmlMemBlocks()) {
41526            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41527	           xmlMemBlocks() - mem_base);
41528	    test_ret++;
41529            printf(" %d", n_code);
41530            printf("\n");
41531        }
41532    }
41533    function_tests++;
41534#endif
41535
41536    return(test_ret);
41537}
41538
41539
41540static int
41541test_xmlUCSIsSpacingModifierLetters(void) {
41542    int test_ret = 0;
41543
41544#if defined(LIBXML_UNICODE_ENABLED)
41545    int mem_base;
41546    int ret_val;
41547    int code; /* UCS code point */
41548    int n_code;
41549
41550    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41551        mem_base = xmlMemBlocks();
41552        code = gen_int(n_code, 0);
41553
41554        ret_val = xmlUCSIsSpacingModifierLetters(code);
41555        desret_int(ret_val);
41556        call_tests++;
41557        des_int(n_code, code, 0);
41558        xmlResetLastError();
41559        if (mem_base != xmlMemBlocks()) {
41560            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41561	           xmlMemBlocks() - mem_base);
41562	    test_ret++;
41563            printf(" %d", n_code);
41564            printf("\n");
41565        }
41566    }
41567    function_tests++;
41568#endif
41569
41570    return(test_ret);
41571}
41572
41573
41574static int
41575test_xmlUCSIsSpecials(void) {
41576    int test_ret = 0;
41577
41578#if defined(LIBXML_UNICODE_ENABLED)
41579    int mem_base;
41580    int ret_val;
41581    int code; /* UCS code point */
41582    int n_code;
41583
41584    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41585        mem_base = xmlMemBlocks();
41586        code = gen_int(n_code, 0);
41587
41588        ret_val = xmlUCSIsSpecials(code);
41589        desret_int(ret_val);
41590        call_tests++;
41591        des_int(n_code, code, 0);
41592        xmlResetLastError();
41593        if (mem_base != xmlMemBlocks()) {
41594            printf("Leak of %d blocks found in xmlUCSIsSpecials",
41595	           xmlMemBlocks() - mem_base);
41596	    test_ret++;
41597            printf(" %d", n_code);
41598            printf("\n");
41599        }
41600    }
41601    function_tests++;
41602#endif
41603
41604    return(test_ret);
41605}
41606
41607
41608static int
41609test_xmlUCSIsSuperscriptsandSubscripts(void) {
41610    int test_ret = 0;
41611
41612#if defined(LIBXML_UNICODE_ENABLED)
41613    int mem_base;
41614    int ret_val;
41615    int code; /* UCS code point */
41616    int n_code;
41617
41618    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41619        mem_base = xmlMemBlocks();
41620        code = gen_int(n_code, 0);
41621
41622        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41623        desret_int(ret_val);
41624        call_tests++;
41625        des_int(n_code, code, 0);
41626        xmlResetLastError();
41627        if (mem_base != xmlMemBlocks()) {
41628            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41629	           xmlMemBlocks() - mem_base);
41630	    test_ret++;
41631            printf(" %d", n_code);
41632            printf("\n");
41633        }
41634    }
41635    function_tests++;
41636#endif
41637
41638    return(test_ret);
41639}
41640
41641
41642static int
41643test_xmlUCSIsSupplementalArrowsA(void) {
41644    int test_ret = 0;
41645
41646#if defined(LIBXML_UNICODE_ENABLED)
41647    int mem_base;
41648    int ret_val;
41649    int code; /* UCS code point */
41650    int n_code;
41651
41652    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41653        mem_base = xmlMemBlocks();
41654        code = gen_int(n_code, 0);
41655
41656        ret_val = xmlUCSIsSupplementalArrowsA(code);
41657        desret_int(ret_val);
41658        call_tests++;
41659        des_int(n_code, code, 0);
41660        xmlResetLastError();
41661        if (mem_base != xmlMemBlocks()) {
41662            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41663	           xmlMemBlocks() - mem_base);
41664	    test_ret++;
41665            printf(" %d", n_code);
41666            printf("\n");
41667        }
41668    }
41669    function_tests++;
41670#endif
41671
41672    return(test_ret);
41673}
41674
41675
41676static int
41677test_xmlUCSIsSupplementalArrowsB(void) {
41678    int test_ret = 0;
41679
41680#if defined(LIBXML_UNICODE_ENABLED)
41681    int mem_base;
41682    int ret_val;
41683    int code; /* UCS code point */
41684    int n_code;
41685
41686    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41687        mem_base = xmlMemBlocks();
41688        code = gen_int(n_code, 0);
41689
41690        ret_val = xmlUCSIsSupplementalArrowsB(code);
41691        desret_int(ret_val);
41692        call_tests++;
41693        des_int(n_code, code, 0);
41694        xmlResetLastError();
41695        if (mem_base != xmlMemBlocks()) {
41696            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41697	           xmlMemBlocks() - mem_base);
41698	    test_ret++;
41699            printf(" %d", n_code);
41700            printf("\n");
41701        }
41702    }
41703    function_tests++;
41704#endif
41705
41706    return(test_ret);
41707}
41708
41709
41710static int
41711test_xmlUCSIsSupplementalMathematicalOperators(void) {
41712    int test_ret = 0;
41713
41714#if defined(LIBXML_UNICODE_ENABLED)
41715    int mem_base;
41716    int ret_val;
41717    int code; /* UCS code point */
41718    int n_code;
41719
41720    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41721        mem_base = xmlMemBlocks();
41722        code = gen_int(n_code, 0);
41723
41724        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41725        desret_int(ret_val);
41726        call_tests++;
41727        des_int(n_code, code, 0);
41728        xmlResetLastError();
41729        if (mem_base != xmlMemBlocks()) {
41730            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41731	           xmlMemBlocks() - mem_base);
41732	    test_ret++;
41733            printf(" %d", n_code);
41734            printf("\n");
41735        }
41736    }
41737    function_tests++;
41738#endif
41739
41740    return(test_ret);
41741}
41742
41743
41744static int
41745test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41746    int test_ret = 0;
41747
41748#if defined(LIBXML_UNICODE_ENABLED)
41749    int mem_base;
41750    int ret_val;
41751    int code; /* UCS code point */
41752    int n_code;
41753
41754    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41755        mem_base = xmlMemBlocks();
41756        code = gen_int(n_code, 0);
41757
41758        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41759        desret_int(ret_val);
41760        call_tests++;
41761        des_int(n_code, code, 0);
41762        xmlResetLastError();
41763        if (mem_base != xmlMemBlocks()) {
41764            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41765	           xmlMemBlocks() - mem_base);
41766	    test_ret++;
41767            printf(" %d", n_code);
41768            printf("\n");
41769        }
41770    }
41771    function_tests++;
41772#endif
41773
41774    return(test_ret);
41775}
41776
41777
41778static int
41779test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
41780    int test_ret = 0;
41781
41782#if defined(LIBXML_UNICODE_ENABLED)
41783    int mem_base;
41784    int ret_val;
41785    int code; /* UCS code point */
41786    int n_code;
41787
41788    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41789        mem_base = xmlMemBlocks();
41790        code = gen_int(n_code, 0);
41791
41792        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
41793        desret_int(ret_val);
41794        call_tests++;
41795        des_int(n_code, code, 0);
41796        xmlResetLastError();
41797        if (mem_base != xmlMemBlocks()) {
41798            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
41799	           xmlMemBlocks() - mem_base);
41800	    test_ret++;
41801            printf(" %d", n_code);
41802            printf("\n");
41803        }
41804    }
41805    function_tests++;
41806#endif
41807
41808    return(test_ret);
41809}
41810
41811
41812static int
41813test_xmlUCSIsSyriac(void) {
41814    int test_ret = 0;
41815
41816#if defined(LIBXML_UNICODE_ENABLED)
41817    int mem_base;
41818    int ret_val;
41819    int code; /* UCS code point */
41820    int n_code;
41821
41822    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41823        mem_base = xmlMemBlocks();
41824        code = gen_int(n_code, 0);
41825
41826        ret_val = xmlUCSIsSyriac(code);
41827        desret_int(ret_val);
41828        call_tests++;
41829        des_int(n_code, code, 0);
41830        xmlResetLastError();
41831        if (mem_base != xmlMemBlocks()) {
41832            printf("Leak of %d blocks found in xmlUCSIsSyriac",
41833	           xmlMemBlocks() - mem_base);
41834	    test_ret++;
41835            printf(" %d", n_code);
41836            printf("\n");
41837        }
41838    }
41839    function_tests++;
41840#endif
41841
41842    return(test_ret);
41843}
41844
41845
41846static int
41847test_xmlUCSIsTagalog(void) {
41848    int test_ret = 0;
41849
41850#if defined(LIBXML_UNICODE_ENABLED)
41851    int mem_base;
41852    int ret_val;
41853    int code; /* UCS code point */
41854    int n_code;
41855
41856    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41857        mem_base = xmlMemBlocks();
41858        code = gen_int(n_code, 0);
41859
41860        ret_val = xmlUCSIsTagalog(code);
41861        desret_int(ret_val);
41862        call_tests++;
41863        des_int(n_code, code, 0);
41864        xmlResetLastError();
41865        if (mem_base != xmlMemBlocks()) {
41866            printf("Leak of %d blocks found in xmlUCSIsTagalog",
41867	           xmlMemBlocks() - mem_base);
41868	    test_ret++;
41869            printf(" %d", n_code);
41870            printf("\n");
41871        }
41872    }
41873    function_tests++;
41874#endif
41875
41876    return(test_ret);
41877}
41878
41879
41880static int
41881test_xmlUCSIsTagbanwa(void) {
41882    int test_ret = 0;
41883
41884#if defined(LIBXML_UNICODE_ENABLED)
41885    int mem_base;
41886    int ret_val;
41887    int code; /* UCS code point */
41888    int n_code;
41889
41890    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41891        mem_base = xmlMemBlocks();
41892        code = gen_int(n_code, 0);
41893
41894        ret_val = xmlUCSIsTagbanwa(code);
41895        desret_int(ret_val);
41896        call_tests++;
41897        des_int(n_code, code, 0);
41898        xmlResetLastError();
41899        if (mem_base != xmlMemBlocks()) {
41900            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
41901	           xmlMemBlocks() - mem_base);
41902	    test_ret++;
41903            printf(" %d", n_code);
41904            printf("\n");
41905        }
41906    }
41907    function_tests++;
41908#endif
41909
41910    return(test_ret);
41911}
41912
41913
41914static int
41915test_xmlUCSIsTags(void) {
41916    int test_ret = 0;
41917
41918#if defined(LIBXML_UNICODE_ENABLED)
41919    int mem_base;
41920    int ret_val;
41921    int code; /* UCS code point */
41922    int n_code;
41923
41924    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41925        mem_base = xmlMemBlocks();
41926        code = gen_int(n_code, 0);
41927
41928        ret_val = xmlUCSIsTags(code);
41929        desret_int(ret_val);
41930        call_tests++;
41931        des_int(n_code, code, 0);
41932        xmlResetLastError();
41933        if (mem_base != xmlMemBlocks()) {
41934            printf("Leak of %d blocks found in xmlUCSIsTags",
41935	           xmlMemBlocks() - mem_base);
41936	    test_ret++;
41937            printf(" %d", n_code);
41938            printf("\n");
41939        }
41940    }
41941    function_tests++;
41942#endif
41943
41944    return(test_ret);
41945}
41946
41947
41948static int
41949test_xmlUCSIsTaiLe(void) {
41950    int test_ret = 0;
41951
41952#if defined(LIBXML_UNICODE_ENABLED)
41953    int mem_base;
41954    int ret_val;
41955    int code; /* UCS code point */
41956    int n_code;
41957
41958    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41959        mem_base = xmlMemBlocks();
41960        code = gen_int(n_code, 0);
41961
41962        ret_val = xmlUCSIsTaiLe(code);
41963        desret_int(ret_val);
41964        call_tests++;
41965        des_int(n_code, code, 0);
41966        xmlResetLastError();
41967        if (mem_base != xmlMemBlocks()) {
41968            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
41969	           xmlMemBlocks() - mem_base);
41970	    test_ret++;
41971            printf(" %d", n_code);
41972            printf("\n");
41973        }
41974    }
41975    function_tests++;
41976#endif
41977
41978    return(test_ret);
41979}
41980
41981
41982static int
41983test_xmlUCSIsTaiXuanJingSymbols(void) {
41984    int test_ret = 0;
41985
41986#if defined(LIBXML_UNICODE_ENABLED)
41987    int mem_base;
41988    int ret_val;
41989    int code; /* UCS code point */
41990    int n_code;
41991
41992    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41993        mem_base = xmlMemBlocks();
41994        code = gen_int(n_code, 0);
41995
41996        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
41997        desret_int(ret_val);
41998        call_tests++;
41999        des_int(n_code, code, 0);
42000        xmlResetLastError();
42001        if (mem_base != xmlMemBlocks()) {
42002            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42003	           xmlMemBlocks() - mem_base);
42004	    test_ret++;
42005            printf(" %d", n_code);
42006            printf("\n");
42007        }
42008    }
42009    function_tests++;
42010#endif
42011
42012    return(test_ret);
42013}
42014
42015
42016static int
42017test_xmlUCSIsTamil(void) {
42018    int test_ret = 0;
42019
42020#if defined(LIBXML_UNICODE_ENABLED)
42021    int mem_base;
42022    int ret_val;
42023    int code; /* UCS code point */
42024    int n_code;
42025
42026    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42027        mem_base = xmlMemBlocks();
42028        code = gen_int(n_code, 0);
42029
42030        ret_val = xmlUCSIsTamil(code);
42031        desret_int(ret_val);
42032        call_tests++;
42033        des_int(n_code, code, 0);
42034        xmlResetLastError();
42035        if (mem_base != xmlMemBlocks()) {
42036            printf("Leak of %d blocks found in xmlUCSIsTamil",
42037	           xmlMemBlocks() - mem_base);
42038	    test_ret++;
42039            printf(" %d", n_code);
42040            printf("\n");
42041        }
42042    }
42043    function_tests++;
42044#endif
42045
42046    return(test_ret);
42047}
42048
42049
42050static int
42051test_xmlUCSIsTelugu(void) {
42052    int test_ret = 0;
42053
42054#if defined(LIBXML_UNICODE_ENABLED)
42055    int mem_base;
42056    int ret_val;
42057    int code; /* UCS code point */
42058    int n_code;
42059
42060    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42061        mem_base = xmlMemBlocks();
42062        code = gen_int(n_code, 0);
42063
42064        ret_val = xmlUCSIsTelugu(code);
42065        desret_int(ret_val);
42066        call_tests++;
42067        des_int(n_code, code, 0);
42068        xmlResetLastError();
42069        if (mem_base != xmlMemBlocks()) {
42070            printf("Leak of %d blocks found in xmlUCSIsTelugu",
42071	           xmlMemBlocks() - mem_base);
42072	    test_ret++;
42073            printf(" %d", n_code);
42074            printf("\n");
42075        }
42076    }
42077    function_tests++;
42078#endif
42079
42080    return(test_ret);
42081}
42082
42083
42084static int
42085test_xmlUCSIsThaana(void) {
42086    int test_ret = 0;
42087
42088#if defined(LIBXML_UNICODE_ENABLED)
42089    int mem_base;
42090    int ret_val;
42091    int code; /* UCS code point */
42092    int n_code;
42093
42094    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42095        mem_base = xmlMemBlocks();
42096        code = gen_int(n_code, 0);
42097
42098        ret_val = xmlUCSIsThaana(code);
42099        desret_int(ret_val);
42100        call_tests++;
42101        des_int(n_code, code, 0);
42102        xmlResetLastError();
42103        if (mem_base != xmlMemBlocks()) {
42104            printf("Leak of %d blocks found in xmlUCSIsThaana",
42105	           xmlMemBlocks() - mem_base);
42106	    test_ret++;
42107            printf(" %d", n_code);
42108            printf("\n");
42109        }
42110    }
42111    function_tests++;
42112#endif
42113
42114    return(test_ret);
42115}
42116
42117
42118static int
42119test_xmlUCSIsThai(void) {
42120    int test_ret = 0;
42121
42122#if defined(LIBXML_UNICODE_ENABLED)
42123    int mem_base;
42124    int ret_val;
42125    int code; /* UCS code point */
42126    int n_code;
42127
42128    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42129        mem_base = xmlMemBlocks();
42130        code = gen_int(n_code, 0);
42131
42132        ret_val = xmlUCSIsThai(code);
42133        desret_int(ret_val);
42134        call_tests++;
42135        des_int(n_code, code, 0);
42136        xmlResetLastError();
42137        if (mem_base != xmlMemBlocks()) {
42138            printf("Leak of %d blocks found in xmlUCSIsThai",
42139	           xmlMemBlocks() - mem_base);
42140	    test_ret++;
42141            printf(" %d", n_code);
42142            printf("\n");
42143        }
42144    }
42145    function_tests++;
42146#endif
42147
42148    return(test_ret);
42149}
42150
42151
42152static int
42153test_xmlUCSIsTibetan(void) {
42154    int test_ret = 0;
42155
42156#if defined(LIBXML_UNICODE_ENABLED)
42157    int mem_base;
42158    int ret_val;
42159    int code; /* UCS code point */
42160    int n_code;
42161
42162    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42163        mem_base = xmlMemBlocks();
42164        code = gen_int(n_code, 0);
42165
42166        ret_val = xmlUCSIsTibetan(code);
42167        desret_int(ret_val);
42168        call_tests++;
42169        des_int(n_code, code, 0);
42170        xmlResetLastError();
42171        if (mem_base != xmlMemBlocks()) {
42172            printf("Leak of %d blocks found in xmlUCSIsTibetan",
42173	           xmlMemBlocks() - mem_base);
42174	    test_ret++;
42175            printf(" %d", n_code);
42176            printf("\n");
42177        }
42178    }
42179    function_tests++;
42180#endif
42181
42182    return(test_ret);
42183}
42184
42185
42186static int
42187test_xmlUCSIsUgaritic(void) {
42188    int test_ret = 0;
42189
42190#if defined(LIBXML_UNICODE_ENABLED)
42191    int mem_base;
42192    int ret_val;
42193    int code; /* UCS code point */
42194    int n_code;
42195
42196    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42197        mem_base = xmlMemBlocks();
42198        code = gen_int(n_code, 0);
42199
42200        ret_val = xmlUCSIsUgaritic(code);
42201        desret_int(ret_val);
42202        call_tests++;
42203        des_int(n_code, code, 0);
42204        xmlResetLastError();
42205        if (mem_base != xmlMemBlocks()) {
42206            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42207	           xmlMemBlocks() - mem_base);
42208	    test_ret++;
42209            printf(" %d", n_code);
42210            printf("\n");
42211        }
42212    }
42213    function_tests++;
42214#endif
42215
42216    return(test_ret);
42217}
42218
42219
42220static int
42221test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42222    int test_ret = 0;
42223
42224#if defined(LIBXML_UNICODE_ENABLED)
42225    int mem_base;
42226    int ret_val;
42227    int code; /* UCS code point */
42228    int n_code;
42229
42230    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42231        mem_base = xmlMemBlocks();
42232        code = gen_int(n_code, 0);
42233
42234        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42235        desret_int(ret_val);
42236        call_tests++;
42237        des_int(n_code, code, 0);
42238        xmlResetLastError();
42239        if (mem_base != xmlMemBlocks()) {
42240            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42241	           xmlMemBlocks() - mem_base);
42242	    test_ret++;
42243            printf(" %d", n_code);
42244            printf("\n");
42245        }
42246    }
42247    function_tests++;
42248#endif
42249
42250    return(test_ret);
42251}
42252
42253
42254static int
42255test_xmlUCSIsVariationSelectors(void) {
42256    int test_ret = 0;
42257
42258#if defined(LIBXML_UNICODE_ENABLED)
42259    int mem_base;
42260    int ret_val;
42261    int code; /* UCS code point */
42262    int n_code;
42263
42264    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42265        mem_base = xmlMemBlocks();
42266        code = gen_int(n_code, 0);
42267
42268        ret_val = xmlUCSIsVariationSelectors(code);
42269        desret_int(ret_val);
42270        call_tests++;
42271        des_int(n_code, code, 0);
42272        xmlResetLastError();
42273        if (mem_base != xmlMemBlocks()) {
42274            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42275	           xmlMemBlocks() - mem_base);
42276	    test_ret++;
42277            printf(" %d", n_code);
42278            printf("\n");
42279        }
42280    }
42281    function_tests++;
42282#endif
42283
42284    return(test_ret);
42285}
42286
42287
42288static int
42289test_xmlUCSIsVariationSelectorsSupplement(void) {
42290    int test_ret = 0;
42291
42292#if defined(LIBXML_UNICODE_ENABLED)
42293    int mem_base;
42294    int ret_val;
42295    int code; /* UCS code point */
42296    int n_code;
42297
42298    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42299        mem_base = xmlMemBlocks();
42300        code = gen_int(n_code, 0);
42301
42302        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42303        desret_int(ret_val);
42304        call_tests++;
42305        des_int(n_code, code, 0);
42306        xmlResetLastError();
42307        if (mem_base != xmlMemBlocks()) {
42308            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42309	           xmlMemBlocks() - mem_base);
42310	    test_ret++;
42311            printf(" %d", n_code);
42312            printf("\n");
42313        }
42314    }
42315    function_tests++;
42316#endif
42317
42318    return(test_ret);
42319}
42320
42321
42322static int
42323test_xmlUCSIsYiRadicals(void) {
42324    int test_ret = 0;
42325
42326#if defined(LIBXML_UNICODE_ENABLED)
42327    int mem_base;
42328    int ret_val;
42329    int code; /* UCS code point */
42330    int n_code;
42331
42332    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42333        mem_base = xmlMemBlocks();
42334        code = gen_int(n_code, 0);
42335
42336        ret_val = xmlUCSIsYiRadicals(code);
42337        desret_int(ret_val);
42338        call_tests++;
42339        des_int(n_code, code, 0);
42340        xmlResetLastError();
42341        if (mem_base != xmlMemBlocks()) {
42342            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42343	           xmlMemBlocks() - mem_base);
42344	    test_ret++;
42345            printf(" %d", n_code);
42346            printf("\n");
42347        }
42348    }
42349    function_tests++;
42350#endif
42351
42352    return(test_ret);
42353}
42354
42355
42356static int
42357test_xmlUCSIsYiSyllables(void) {
42358    int test_ret = 0;
42359
42360#if defined(LIBXML_UNICODE_ENABLED)
42361    int mem_base;
42362    int ret_val;
42363    int code; /* UCS code point */
42364    int n_code;
42365
42366    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42367        mem_base = xmlMemBlocks();
42368        code = gen_int(n_code, 0);
42369
42370        ret_val = xmlUCSIsYiSyllables(code);
42371        desret_int(ret_val);
42372        call_tests++;
42373        des_int(n_code, code, 0);
42374        xmlResetLastError();
42375        if (mem_base != xmlMemBlocks()) {
42376            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42377	           xmlMemBlocks() - mem_base);
42378	    test_ret++;
42379            printf(" %d", n_code);
42380            printf("\n");
42381        }
42382    }
42383    function_tests++;
42384#endif
42385
42386    return(test_ret);
42387}
42388
42389
42390static int
42391test_xmlUCSIsYijingHexagramSymbols(void) {
42392    int test_ret = 0;
42393
42394#if defined(LIBXML_UNICODE_ENABLED)
42395    int mem_base;
42396    int ret_val;
42397    int code; /* UCS code point */
42398    int n_code;
42399
42400    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42401        mem_base = xmlMemBlocks();
42402        code = gen_int(n_code, 0);
42403
42404        ret_val = xmlUCSIsYijingHexagramSymbols(code);
42405        desret_int(ret_val);
42406        call_tests++;
42407        des_int(n_code, code, 0);
42408        xmlResetLastError();
42409        if (mem_base != xmlMemBlocks()) {
42410            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42411	           xmlMemBlocks() - mem_base);
42412	    test_ret++;
42413            printf(" %d", n_code);
42414            printf("\n");
42415        }
42416    }
42417    function_tests++;
42418#endif
42419
42420    return(test_ret);
42421}
42422
42423static int
42424test_xmlunicode(void) {
42425    int test_ret = 0;
42426
42427    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42428    test_ret += test_xmlUCSIsAegeanNumbers();
42429    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42430    test_ret += test_xmlUCSIsArabic();
42431    test_ret += test_xmlUCSIsArabicPresentationFormsA();
42432    test_ret += test_xmlUCSIsArabicPresentationFormsB();
42433    test_ret += test_xmlUCSIsArmenian();
42434    test_ret += test_xmlUCSIsArrows();
42435    test_ret += test_xmlUCSIsBasicLatin();
42436    test_ret += test_xmlUCSIsBengali();
42437    test_ret += test_xmlUCSIsBlock();
42438    test_ret += test_xmlUCSIsBlockElements();
42439    test_ret += test_xmlUCSIsBopomofo();
42440    test_ret += test_xmlUCSIsBopomofoExtended();
42441    test_ret += test_xmlUCSIsBoxDrawing();
42442    test_ret += test_xmlUCSIsBraillePatterns();
42443    test_ret += test_xmlUCSIsBuhid();
42444    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42445    test_ret += test_xmlUCSIsCJKCompatibility();
42446    test_ret += test_xmlUCSIsCJKCompatibilityForms();
42447    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42448    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42449    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42450    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42451    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42452    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42453    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42454    test_ret += test_xmlUCSIsCat();
42455    test_ret += test_xmlUCSIsCatC();
42456    test_ret += test_xmlUCSIsCatCc();
42457    test_ret += test_xmlUCSIsCatCf();
42458    test_ret += test_xmlUCSIsCatCo();
42459    test_ret += test_xmlUCSIsCatCs();
42460    test_ret += test_xmlUCSIsCatL();
42461    test_ret += test_xmlUCSIsCatLl();
42462    test_ret += test_xmlUCSIsCatLm();
42463    test_ret += test_xmlUCSIsCatLo();
42464    test_ret += test_xmlUCSIsCatLt();
42465    test_ret += test_xmlUCSIsCatLu();
42466    test_ret += test_xmlUCSIsCatM();
42467    test_ret += test_xmlUCSIsCatMc();
42468    test_ret += test_xmlUCSIsCatMe();
42469    test_ret += test_xmlUCSIsCatMn();
42470    test_ret += test_xmlUCSIsCatN();
42471    test_ret += test_xmlUCSIsCatNd();
42472    test_ret += test_xmlUCSIsCatNl();
42473    test_ret += test_xmlUCSIsCatNo();
42474    test_ret += test_xmlUCSIsCatP();
42475    test_ret += test_xmlUCSIsCatPc();
42476    test_ret += test_xmlUCSIsCatPd();
42477    test_ret += test_xmlUCSIsCatPe();
42478    test_ret += test_xmlUCSIsCatPf();
42479    test_ret += test_xmlUCSIsCatPi();
42480    test_ret += test_xmlUCSIsCatPo();
42481    test_ret += test_xmlUCSIsCatPs();
42482    test_ret += test_xmlUCSIsCatS();
42483    test_ret += test_xmlUCSIsCatSc();
42484    test_ret += test_xmlUCSIsCatSk();
42485    test_ret += test_xmlUCSIsCatSm();
42486    test_ret += test_xmlUCSIsCatSo();
42487    test_ret += test_xmlUCSIsCatZ();
42488    test_ret += test_xmlUCSIsCatZl();
42489    test_ret += test_xmlUCSIsCatZp();
42490    test_ret += test_xmlUCSIsCatZs();
42491    test_ret += test_xmlUCSIsCherokee();
42492    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42493    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42494    test_ret += test_xmlUCSIsCombiningHalfMarks();
42495    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42496    test_ret += test_xmlUCSIsControlPictures();
42497    test_ret += test_xmlUCSIsCurrencySymbols();
42498    test_ret += test_xmlUCSIsCypriotSyllabary();
42499    test_ret += test_xmlUCSIsCyrillic();
42500    test_ret += test_xmlUCSIsCyrillicSupplement();
42501    test_ret += test_xmlUCSIsDeseret();
42502    test_ret += test_xmlUCSIsDevanagari();
42503    test_ret += test_xmlUCSIsDingbats();
42504    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42505    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42506    test_ret += test_xmlUCSIsEthiopic();
42507    test_ret += test_xmlUCSIsGeneralPunctuation();
42508    test_ret += test_xmlUCSIsGeometricShapes();
42509    test_ret += test_xmlUCSIsGeorgian();
42510    test_ret += test_xmlUCSIsGothic();
42511    test_ret += test_xmlUCSIsGreek();
42512    test_ret += test_xmlUCSIsGreekExtended();
42513    test_ret += test_xmlUCSIsGreekandCoptic();
42514    test_ret += test_xmlUCSIsGujarati();
42515    test_ret += test_xmlUCSIsGurmukhi();
42516    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42517    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42518    test_ret += test_xmlUCSIsHangulJamo();
42519    test_ret += test_xmlUCSIsHangulSyllables();
42520    test_ret += test_xmlUCSIsHanunoo();
42521    test_ret += test_xmlUCSIsHebrew();
42522    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42523    test_ret += test_xmlUCSIsHighSurrogates();
42524    test_ret += test_xmlUCSIsHiragana();
42525    test_ret += test_xmlUCSIsIPAExtensions();
42526    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42527    test_ret += test_xmlUCSIsKanbun();
42528    test_ret += test_xmlUCSIsKangxiRadicals();
42529    test_ret += test_xmlUCSIsKannada();
42530    test_ret += test_xmlUCSIsKatakana();
42531    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42532    test_ret += test_xmlUCSIsKhmer();
42533    test_ret += test_xmlUCSIsKhmerSymbols();
42534    test_ret += test_xmlUCSIsLao();
42535    test_ret += test_xmlUCSIsLatin1Supplement();
42536    test_ret += test_xmlUCSIsLatinExtendedA();
42537    test_ret += test_xmlUCSIsLatinExtendedAdditional();
42538    test_ret += test_xmlUCSIsLatinExtendedB();
42539    test_ret += test_xmlUCSIsLetterlikeSymbols();
42540    test_ret += test_xmlUCSIsLimbu();
42541    test_ret += test_xmlUCSIsLinearBIdeograms();
42542    test_ret += test_xmlUCSIsLinearBSyllabary();
42543    test_ret += test_xmlUCSIsLowSurrogates();
42544    test_ret += test_xmlUCSIsMalayalam();
42545    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42546    test_ret += test_xmlUCSIsMathematicalOperators();
42547    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42548    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42549    test_ret += test_xmlUCSIsMiscellaneousSymbols();
42550    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42551    test_ret += test_xmlUCSIsMiscellaneousTechnical();
42552    test_ret += test_xmlUCSIsMongolian();
42553    test_ret += test_xmlUCSIsMusicalSymbols();
42554    test_ret += test_xmlUCSIsMyanmar();
42555    test_ret += test_xmlUCSIsNumberForms();
42556    test_ret += test_xmlUCSIsOgham();
42557    test_ret += test_xmlUCSIsOldItalic();
42558    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42559    test_ret += test_xmlUCSIsOriya();
42560    test_ret += test_xmlUCSIsOsmanya();
42561    test_ret += test_xmlUCSIsPhoneticExtensions();
42562    test_ret += test_xmlUCSIsPrivateUse();
42563    test_ret += test_xmlUCSIsPrivateUseArea();
42564    test_ret += test_xmlUCSIsRunic();
42565    test_ret += test_xmlUCSIsShavian();
42566    test_ret += test_xmlUCSIsSinhala();
42567    test_ret += test_xmlUCSIsSmallFormVariants();
42568    test_ret += test_xmlUCSIsSpacingModifierLetters();
42569    test_ret += test_xmlUCSIsSpecials();
42570    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42571    test_ret += test_xmlUCSIsSupplementalArrowsA();
42572    test_ret += test_xmlUCSIsSupplementalArrowsB();
42573    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42574    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42575    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42576    test_ret += test_xmlUCSIsSyriac();
42577    test_ret += test_xmlUCSIsTagalog();
42578    test_ret += test_xmlUCSIsTagbanwa();
42579    test_ret += test_xmlUCSIsTags();
42580    test_ret += test_xmlUCSIsTaiLe();
42581    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42582    test_ret += test_xmlUCSIsTamil();
42583    test_ret += test_xmlUCSIsTelugu();
42584    test_ret += test_xmlUCSIsThaana();
42585    test_ret += test_xmlUCSIsThai();
42586    test_ret += test_xmlUCSIsTibetan();
42587    test_ret += test_xmlUCSIsUgaritic();
42588    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42589    test_ret += test_xmlUCSIsVariationSelectors();
42590    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42591    test_ret += test_xmlUCSIsYiRadicals();
42592    test_ret += test_xmlUCSIsYiSyllables();
42593    test_ret += test_xmlUCSIsYijingHexagramSymbols();
42594
42595    if (test_ret != 0)
42596	printf("Module xmlunicode: %d errors\n", test_ret);
42597    return(test_ret);
42598}
42599
42600static int
42601test_xmlNewTextWriter(void) {
42602    int test_ret = 0;
42603
42604#if defined(LIBXML_WRITER_ENABLED)
42605    int mem_base;
42606    xmlTextWriterPtr ret_val;
42607    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42608    int n_out;
42609
42610    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42611        mem_base = xmlMemBlocks();
42612        out = gen_xmlOutputBufferPtr(n_out, 0);
42613
42614        ret_val = xmlNewTextWriter(out);
42615        if (ret_val != NULL) out = NULL;
42616        desret_xmlTextWriterPtr(ret_val);
42617        call_tests++;
42618        des_xmlOutputBufferPtr(n_out, out, 0);
42619        xmlResetLastError();
42620        if (mem_base != xmlMemBlocks()) {
42621            printf("Leak of %d blocks found in xmlNewTextWriter",
42622	           xmlMemBlocks() - mem_base);
42623	    test_ret++;
42624            printf(" %d", n_out);
42625            printf("\n");
42626        }
42627    }
42628    function_tests++;
42629#endif
42630
42631    return(test_ret);
42632}
42633
42634
42635static int
42636test_xmlNewTextWriterFilename(void) {
42637    int test_ret = 0;
42638
42639#if defined(LIBXML_WRITER_ENABLED)
42640    int mem_base;
42641    xmlTextWriterPtr ret_val;
42642    const char * uri; /* the URI of the resource for the output */
42643    int n_uri;
42644    int compression; /* compress the output? */
42645    int n_compression;
42646
42647    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42648    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42649        mem_base = xmlMemBlocks();
42650        uri = gen_fileoutput(n_uri, 0);
42651        compression = gen_int(n_compression, 1);
42652
42653        ret_val = xmlNewTextWriterFilename(uri, compression);
42654        desret_xmlTextWriterPtr(ret_val);
42655        call_tests++;
42656        des_fileoutput(n_uri, uri, 0);
42657        des_int(n_compression, compression, 1);
42658        xmlResetLastError();
42659        if (mem_base != xmlMemBlocks()) {
42660            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42661	           xmlMemBlocks() - mem_base);
42662	    test_ret++;
42663            printf(" %d", n_uri);
42664            printf(" %d", n_compression);
42665            printf("\n");
42666        }
42667    }
42668    }
42669    function_tests++;
42670#endif
42671
42672    return(test_ret);
42673}
42674
42675
42676static int
42677test_xmlNewTextWriterMemory(void) {
42678    int test_ret = 0;
42679
42680#if defined(LIBXML_WRITER_ENABLED)
42681    int mem_base;
42682    xmlTextWriterPtr ret_val;
42683    xmlBufferPtr buf; /* xmlBufferPtr */
42684    int n_buf;
42685    int compression; /* compress the output? */
42686    int n_compression;
42687
42688    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42689    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42690        mem_base = xmlMemBlocks();
42691        buf = gen_xmlBufferPtr(n_buf, 0);
42692        compression = gen_int(n_compression, 1);
42693
42694        ret_val = xmlNewTextWriterMemory(buf, compression);
42695        desret_xmlTextWriterPtr(ret_val);
42696        call_tests++;
42697        des_xmlBufferPtr(n_buf, buf, 0);
42698        des_int(n_compression, compression, 1);
42699        xmlResetLastError();
42700        if (mem_base != xmlMemBlocks()) {
42701            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42702	           xmlMemBlocks() - mem_base);
42703	    test_ret++;
42704            printf(" %d", n_buf);
42705            printf(" %d", n_compression);
42706            printf("\n");
42707        }
42708    }
42709    }
42710    function_tests++;
42711#endif
42712
42713    return(test_ret);
42714}
42715
42716
42717static int
42718test_xmlNewTextWriterPushParser(void) {
42719    int test_ret = 0;
42720
42721#if defined(LIBXML_WRITER_ENABLED)
42722    int mem_base;
42723    xmlTextWriterPtr ret_val;
42724    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42725    int n_ctxt;
42726    int compression; /* compress the output? */
42727    int n_compression;
42728
42729    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42730    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42731        mem_base = xmlMemBlocks();
42732        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42733        compression = gen_int(n_compression, 1);
42734
42735        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42736        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42737        desret_xmlTextWriterPtr(ret_val);
42738        call_tests++;
42739        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42740        des_int(n_compression, compression, 1);
42741        xmlResetLastError();
42742        if (mem_base != xmlMemBlocks()) {
42743            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42744	           xmlMemBlocks() - mem_base);
42745	    test_ret++;
42746            printf(" %d", n_ctxt);
42747            printf(" %d", n_compression);
42748            printf("\n");
42749        }
42750    }
42751    }
42752    function_tests++;
42753#endif
42754
42755    return(test_ret);
42756}
42757
42758
42759static int
42760test_xmlNewTextWriterTree(void) {
42761    int test_ret = 0;
42762
42763#if defined(LIBXML_WRITER_ENABLED)
42764    int mem_base;
42765    xmlTextWriterPtr ret_val;
42766    xmlDocPtr doc; /* xmlDocPtr */
42767    int n_doc;
42768    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42769    int n_node;
42770    int compression; /* compress the output? */
42771    int n_compression;
42772
42773    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42774    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42775    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42776        mem_base = xmlMemBlocks();
42777        doc = gen_xmlDocPtr(n_doc, 0);
42778        node = gen_xmlNodePtr(n_node, 1);
42779        compression = gen_int(n_compression, 2);
42780
42781        ret_val = xmlNewTextWriterTree(doc, node, compression);
42782        desret_xmlTextWriterPtr(ret_val);
42783        call_tests++;
42784        des_xmlDocPtr(n_doc, doc, 0);
42785        des_xmlNodePtr(n_node, node, 1);
42786        des_int(n_compression, compression, 2);
42787        xmlResetLastError();
42788        if (mem_base != xmlMemBlocks()) {
42789            printf("Leak of %d blocks found in xmlNewTextWriterTree",
42790	           xmlMemBlocks() - mem_base);
42791	    test_ret++;
42792            printf(" %d", n_doc);
42793            printf(" %d", n_node);
42794            printf(" %d", n_compression);
42795            printf("\n");
42796        }
42797    }
42798    }
42799    }
42800    function_tests++;
42801#endif
42802
42803    return(test_ret);
42804}
42805
42806
42807static int
42808test_xmlTextWriterEndAttribute(void) {
42809    int test_ret = 0;
42810
42811#if defined(LIBXML_WRITER_ENABLED)
42812    int mem_base;
42813    int ret_val;
42814    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42815    int n_writer;
42816
42817    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42818        mem_base = xmlMemBlocks();
42819        writer = gen_xmlTextWriterPtr(n_writer, 0);
42820
42821        ret_val = xmlTextWriterEndAttribute(writer);
42822        desret_int(ret_val);
42823        call_tests++;
42824        des_xmlTextWriterPtr(n_writer, writer, 0);
42825        xmlResetLastError();
42826        if (mem_base != xmlMemBlocks()) {
42827            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42828	           xmlMemBlocks() - mem_base);
42829	    test_ret++;
42830            printf(" %d", n_writer);
42831            printf("\n");
42832        }
42833    }
42834    function_tests++;
42835#endif
42836
42837    return(test_ret);
42838}
42839
42840
42841static int
42842test_xmlTextWriterEndCDATA(void) {
42843    int test_ret = 0;
42844
42845#if defined(LIBXML_WRITER_ENABLED)
42846    int mem_base;
42847    int ret_val;
42848    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42849    int n_writer;
42850
42851    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42852        mem_base = xmlMemBlocks();
42853        writer = gen_xmlTextWriterPtr(n_writer, 0);
42854
42855        ret_val = xmlTextWriterEndCDATA(writer);
42856        desret_int(ret_val);
42857        call_tests++;
42858        des_xmlTextWriterPtr(n_writer, writer, 0);
42859        xmlResetLastError();
42860        if (mem_base != xmlMemBlocks()) {
42861            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
42862	           xmlMemBlocks() - mem_base);
42863	    test_ret++;
42864            printf(" %d", n_writer);
42865            printf("\n");
42866        }
42867    }
42868    function_tests++;
42869#endif
42870
42871    return(test_ret);
42872}
42873
42874
42875static int
42876test_xmlTextWriterEndComment(void) {
42877    int test_ret = 0;
42878
42879#if defined(LIBXML_WRITER_ENABLED)
42880    int mem_base;
42881    int ret_val;
42882    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42883    int n_writer;
42884
42885    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42886        mem_base = xmlMemBlocks();
42887        writer = gen_xmlTextWriterPtr(n_writer, 0);
42888
42889        ret_val = xmlTextWriterEndComment(writer);
42890        desret_int(ret_val);
42891        call_tests++;
42892        des_xmlTextWriterPtr(n_writer, writer, 0);
42893        xmlResetLastError();
42894        if (mem_base != xmlMemBlocks()) {
42895            printf("Leak of %d blocks found in xmlTextWriterEndComment",
42896	           xmlMemBlocks() - mem_base);
42897	    test_ret++;
42898            printf(" %d", n_writer);
42899            printf("\n");
42900        }
42901    }
42902    function_tests++;
42903#endif
42904
42905    return(test_ret);
42906}
42907
42908
42909static int
42910test_xmlTextWriterEndDTD(void) {
42911    int test_ret = 0;
42912
42913#if defined(LIBXML_WRITER_ENABLED)
42914    int mem_base;
42915    int ret_val;
42916    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42917    int n_writer;
42918
42919    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42920        mem_base = xmlMemBlocks();
42921        writer = gen_xmlTextWriterPtr(n_writer, 0);
42922
42923        ret_val = xmlTextWriterEndDTD(writer);
42924        desret_int(ret_val);
42925        call_tests++;
42926        des_xmlTextWriterPtr(n_writer, writer, 0);
42927        xmlResetLastError();
42928        if (mem_base != xmlMemBlocks()) {
42929            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
42930	           xmlMemBlocks() - mem_base);
42931	    test_ret++;
42932            printf(" %d", n_writer);
42933            printf("\n");
42934        }
42935    }
42936    function_tests++;
42937#endif
42938
42939    return(test_ret);
42940}
42941
42942
42943static int
42944test_xmlTextWriterEndDTDAttlist(void) {
42945    int test_ret = 0;
42946
42947#if defined(LIBXML_WRITER_ENABLED)
42948    int mem_base;
42949    int ret_val;
42950    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42951    int n_writer;
42952
42953    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42954        mem_base = xmlMemBlocks();
42955        writer = gen_xmlTextWriterPtr(n_writer, 0);
42956
42957        ret_val = xmlTextWriterEndDTDAttlist(writer);
42958        desret_int(ret_val);
42959        call_tests++;
42960        des_xmlTextWriterPtr(n_writer, writer, 0);
42961        xmlResetLastError();
42962        if (mem_base != xmlMemBlocks()) {
42963            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
42964	           xmlMemBlocks() - mem_base);
42965	    test_ret++;
42966            printf(" %d", n_writer);
42967            printf("\n");
42968        }
42969    }
42970    function_tests++;
42971#endif
42972
42973    return(test_ret);
42974}
42975
42976
42977static int
42978test_xmlTextWriterEndDTDElement(void) {
42979    int test_ret = 0;
42980
42981#if defined(LIBXML_WRITER_ENABLED)
42982    int mem_base;
42983    int ret_val;
42984    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42985    int n_writer;
42986
42987    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42988        mem_base = xmlMemBlocks();
42989        writer = gen_xmlTextWriterPtr(n_writer, 0);
42990
42991        ret_val = xmlTextWriterEndDTDElement(writer);
42992        desret_int(ret_val);
42993        call_tests++;
42994        des_xmlTextWriterPtr(n_writer, writer, 0);
42995        xmlResetLastError();
42996        if (mem_base != xmlMemBlocks()) {
42997            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
42998	           xmlMemBlocks() - mem_base);
42999	    test_ret++;
43000            printf(" %d", n_writer);
43001            printf("\n");
43002        }
43003    }
43004    function_tests++;
43005#endif
43006
43007    return(test_ret);
43008}
43009
43010
43011static int
43012test_xmlTextWriterEndDTDEntity(void) {
43013    int test_ret = 0;
43014
43015#if defined(LIBXML_WRITER_ENABLED)
43016    int mem_base;
43017    int ret_val;
43018    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43019    int n_writer;
43020
43021    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43022        mem_base = xmlMemBlocks();
43023        writer = gen_xmlTextWriterPtr(n_writer, 0);
43024
43025        ret_val = xmlTextWriterEndDTDEntity(writer);
43026        desret_int(ret_val);
43027        call_tests++;
43028        des_xmlTextWriterPtr(n_writer, writer, 0);
43029        xmlResetLastError();
43030        if (mem_base != xmlMemBlocks()) {
43031            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43032	           xmlMemBlocks() - mem_base);
43033	    test_ret++;
43034            printf(" %d", n_writer);
43035            printf("\n");
43036        }
43037    }
43038    function_tests++;
43039#endif
43040
43041    return(test_ret);
43042}
43043
43044
43045static int
43046test_xmlTextWriterEndDocument(void) {
43047    int test_ret = 0;
43048
43049#if defined(LIBXML_WRITER_ENABLED)
43050    int mem_base;
43051    int ret_val;
43052    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43053    int n_writer;
43054
43055    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43056        mem_base = xmlMemBlocks();
43057        writer = gen_xmlTextWriterPtr(n_writer, 0);
43058
43059        ret_val = xmlTextWriterEndDocument(writer);
43060        desret_int(ret_val);
43061        call_tests++;
43062        des_xmlTextWriterPtr(n_writer, writer, 0);
43063        xmlResetLastError();
43064        if (mem_base != xmlMemBlocks()) {
43065            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43066	           xmlMemBlocks() - mem_base);
43067	    test_ret++;
43068            printf(" %d", n_writer);
43069            printf("\n");
43070        }
43071    }
43072    function_tests++;
43073#endif
43074
43075    return(test_ret);
43076}
43077
43078
43079static int
43080test_xmlTextWriterEndElement(void) {
43081    int test_ret = 0;
43082
43083#if defined(LIBXML_WRITER_ENABLED)
43084    int mem_base;
43085    int ret_val;
43086    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43087    int n_writer;
43088
43089    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43090        mem_base = xmlMemBlocks();
43091        writer = gen_xmlTextWriterPtr(n_writer, 0);
43092
43093        ret_val = xmlTextWriterEndElement(writer);
43094        desret_int(ret_val);
43095        call_tests++;
43096        des_xmlTextWriterPtr(n_writer, writer, 0);
43097        xmlResetLastError();
43098        if (mem_base != xmlMemBlocks()) {
43099            printf("Leak of %d blocks found in xmlTextWriterEndElement",
43100	           xmlMemBlocks() - mem_base);
43101	    test_ret++;
43102            printf(" %d", n_writer);
43103            printf("\n");
43104        }
43105    }
43106    function_tests++;
43107#endif
43108
43109    return(test_ret);
43110}
43111
43112
43113static int
43114test_xmlTextWriterEndPI(void) {
43115    int test_ret = 0;
43116
43117#if defined(LIBXML_WRITER_ENABLED)
43118    int mem_base;
43119    int ret_val;
43120    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43121    int n_writer;
43122
43123    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43124        mem_base = xmlMemBlocks();
43125        writer = gen_xmlTextWriterPtr(n_writer, 0);
43126
43127        ret_val = xmlTextWriterEndPI(writer);
43128        desret_int(ret_val);
43129        call_tests++;
43130        des_xmlTextWriterPtr(n_writer, writer, 0);
43131        xmlResetLastError();
43132        if (mem_base != xmlMemBlocks()) {
43133            printf("Leak of %d blocks found in xmlTextWriterEndPI",
43134	           xmlMemBlocks() - mem_base);
43135	    test_ret++;
43136            printf(" %d", n_writer);
43137            printf("\n");
43138        }
43139    }
43140    function_tests++;
43141#endif
43142
43143    return(test_ret);
43144}
43145
43146
43147static int
43148test_xmlTextWriterFlush(void) {
43149    int test_ret = 0;
43150
43151#if defined(LIBXML_WRITER_ENABLED)
43152    int mem_base;
43153    int ret_val;
43154    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43155    int n_writer;
43156
43157    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43158        mem_base = xmlMemBlocks();
43159        writer = gen_xmlTextWriterPtr(n_writer, 0);
43160
43161        ret_val = xmlTextWriterFlush(writer);
43162        desret_int(ret_val);
43163        call_tests++;
43164        des_xmlTextWriterPtr(n_writer, writer, 0);
43165        xmlResetLastError();
43166        if (mem_base != xmlMemBlocks()) {
43167            printf("Leak of %d blocks found in xmlTextWriterFlush",
43168	           xmlMemBlocks() - mem_base);
43169	    test_ret++;
43170            printf(" %d", n_writer);
43171            printf("\n");
43172        }
43173    }
43174    function_tests++;
43175#endif
43176
43177    return(test_ret);
43178}
43179
43180
43181static int
43182test_xmlTextWriterFullEndElement(void) {
43183    int test_ret = 0;
43184
43185#if defined(LIBXML_WRITER_ENABLED)
43186    int mem_base;
43187    int ret_val;
43188    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43189    int n_writer;
43190
43191    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43192        mem_base = xmlMemBlocks();
43193        writer = gen_xmlTextWriterPtr(n_writer, 0);
43194
43195        ret_val = xmlTextWriterFullEndElement(writer);
43196        desret_int(ret_val);
43197        call_tests++;
43198        des_xmlTextWriterPtr(n_writer, writer, 0);
43199        xmlResetLastError();
43200        if (mem_base != xmlMemBlocks()) {
43201            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43202	           xmlMemBlocks() - mem_base);
43203	    test_ret++;
43204            printf(" %d", n_writer);
43205            printf("\n");
43206        }
43207    }
43208    function_tests++;
43209#endif
43210
43211    return(test_ret);
43212}
43213
43214
43215static int
43216test_xmlTextWriterSetIndent(void) {
43217    int test_ret = 0;
43218
43219#if defined(LIBXML_WRITER_ENABLED)
43220    int mem_base;
43221    int ret_val;
43222    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43223    int n_writer;
43224    int indent; /* do indentation? */
43225    int n_indent;
43226
43227    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43228    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43229        mem_base = xmlMemBlocks();
43230        writer = gen_xmlTextWriterPtr(n_writer, 0);
43231        indent = gen_int(n_indent, 1);
43232
43233        ret_val = xmlTextWriterSetIndent(writer, indent);
43234        desret_int(ret_val);
43235        call_tests++;
43236        des_xmlTextWriterPtr(n_writer, writer, 0);
43237        des_int(n_indent, indent, 1);
43238        xmlResetLastError();
43239        if (mem_base != xmlMemBlocks()) {
43240            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43241	           xmlMemBlocks() - mem_base);
43242	    test_ret++;
43243            printf(" %d", n_writer);
43244            printf(" %d", n_indent);
43245            printf("\n");
43246        }
43247    }
43248    }
43249    function_tests++;
43250#endif
43251
43252    return(test_ret);
43253}
43254
43255
43256static int
43257test_xmlTextWriterSetIndentString(void) {
43258    int test_ret = 0;
43259
43260#if defined(LIBXML_WRITER_ENABLED)
43261    int mem_base;
43262    int ret_val;
43263    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43264    int n_writer;
43265    xmlChar * str; /* the xmlChar string */
43266    int n_str;
43267
43268    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43269    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43270        mem_base = xmlMemBlocks();
43271        writer = gen_xmlTextWriterPtr(n_writer, 0);
43272        str = gen_const_xmlChar_ptr(n_str, 1);
43273
43274        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43275        desret_int(ret_val);
43276        call_tests++;
43277        des_xmlTextWriterPtr(n_writer, writer, 0);
43278        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43279        xmlResetLastError();
43280        if (mem_base != xmlMemBlocks()) {
43281            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43282	           xmlMemBlocks() - mem_base);
43283	    test_ret++;
43284            printf(" %d", n_writer);
43285            printf(" %d", n_str);
43286            printf("\n");
43287        }
43288    }
43289    }
43290    function_tests++;
43291#endif
43292
43293    return(test_ret);
43294}
43295
43296
43297static int
43298test_xmlTextWriterStartAttribute(void) {
43299    int test_ret = 0;
43300
43301#if defined(LIBXML_WRITER_ENABLED)
43302    int mem_base;
43303    int ret_val;
43304    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43305    int n_writer;
43306    xmlChar * name; /* element name */
43307    int n_name;
43308
43309    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43310    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43311        mem_base = xmlMemBlocks();
43312        writer = gen_xmlTextWriterPtr(n_writer, 0);
43313        name = gen_const_xmlChar_ptr(n_name, 1);
43314
43315        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43316        desret_int(ret_val);
43317        call_tests++;
43318        des_xmlTextWriterPtr(n_writer, writer, 0);
43319        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43320        xmlResetLastError();
43321        if (mem_base != xmlMemBlocks()) {
43322            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43323	           xmlMemBlocks() - mem_base);
43324	    test_ret++;
43325            printf(" %d", n_writer);
43326            printf(" %d", n_name);
43327            printf("\n");
43328        }
43329    }
43330    }
43331    function_tests++;
43332#endif
43333
43334    return(test_ret);
43335}
43336
43337
43338static int
43339test_xmlTextWriterStartAttributeNS(void) {
43340    int test_ret = 0;
43341
43342#if defined(LIBXML_WRITER_ENABLED)
43343    int mem_base;
43344    int ret_val;
43345    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43346    int n_writer;
43347    xmlChar * prefix; /* namespace prefix or NULL */
43348    int n_prefix;
43349    xmlChar * name; /* element local name */
43350    int n_name;
43351    xmlChar * namespaceURI; /* namespace URI or NULL */
43352    int n_namespaceURI;
43353
43354    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43355    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43356    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43357    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43358        mem_base = xmlMemBlocks();
43359        writer = gen_xmlTextWriterPtr(n_writer, 0);
43360        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43361        name = gen_const_xmlChar_ptr(n_name, 2);
43362        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43363
43364        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43365        desret_int(ret_val);
43366        call_tests++;
43367        des_xmlTextWriterPtr(n_writer, writer, 0);
43368        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43369        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43370        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43371        xmlResetLastError();
43372        if (mem_base != xmlMemBlocks()) {
43373            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43374	           xmlMemBlocks() - mem_base);
43375	    test_ret++;
43376            printf(" %d", n_writer);
43377            printf(" %d", n_prefix);
43378            printf(" %d", n_name);
43379            printf(" %d", n_namespaceURI);
43380            printf("\n");
43381        }
43382    }
43383    }
43384    }
43385    }
43386    function_tests++;
43387#endif
43388
43389    return(test_ret);
43390}
43391
43392
43393static int
43394test_xmlTextWriterStartCDATA(void) {
43395    int test_ret = 0;
43396
43397#if defined(LIBXML_WRITER_ENABLED)
43398    int mem_base;
43399    int ret_val;
43400    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43401    int n_writer;
43402
43403    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43404        mem_base = xmlMemBlocks();
43405        writer = gen_xmlTextWriterPtr(n_writer, 0);
43406
43407        ret_val = xmlTextWriterStartCDATA(writer);
43408        desret_int(ret_val);
43409        call_tests++;
43410        des_xmlTextWriterPtr(n_writer, writer, 0);
43411        xmlResetLastError();
43412        if (mem_base != xmlMemBlocks()) {
43413            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43414	           xmlMemBlocks() - mem_base);
43415	    test_ret++;
43416            printf(" %d", n_writer);
43417            printf("\n");
43418        }
43419    }
43420    function_tests++;
43421#endif
43422
43423    return(test_ret);
43424}
43425
43426
43427static int
43428test_xmlTextWriterStartComment(void) {
43429    int test_ret = 0;
43430
43431#if defined(LIBXML_WRITER_ENABLED)
43432    int mem_base;
43433    int ret_val;
43434    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43435    int n_writer;
43436
43437    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43438        mem_base = xmlMemBlocks();
43439        writer = gen_xmlTextWriterPtr(n_writer, 0);
43440
43441        ret_val = xmlTextWriterStartComment(writer);
43442        desret_int(ret_val);
43443        call_tests++;
43444        des_xmlTextWriterPtr(n_writer, writer, 0);
43445        xmlResetLastError();
43446        if (mem_base != xmlMemBlocks()) {
43447            printf("Leak of %d blocks found in xmlTextWriterStartComment",
43448	           xmlMemBlocks() - mem_base);
43449	    test_ret++;
43450            printf(" %d", n_writer);
43451            printf("\n");
43452        }
43453    }
43454    function_tests++;
43455#endif
43456
43457    return(test_ret);
43458}
43459
43460
43461static int
43462test_xmlTextWriterStartDTD(void) {
43463    int test_ret = 0;
43464
43465#if defined(LIBXML_WRITER_ENABLED)
43466    int mem_base;
43467    int ret_val;
43468    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43469    int n_writer;
43470    xmlChar * name; /* the name of the DTD */
43471    int n_name;
43472    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43473    int n_pubid;
43474    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43475    int n_sysid;
43476
43477    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43478    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43479    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43480    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43481        mem_base = xmlMemBlocks();
43482        writer = gen_xmlTextWriterPtr(n_writer, 0);
43483        name = gen_const_xmlChar_ptr(n_name, 1);
43484        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43485        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43486
43487        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43488        desret_int(ret_val);
43489        call_tests++;
43490        des_xmlTextWriterPtr(n_writer, writer, 0);
43491        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43492        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43493        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43494        xmlResetLastError();
43495        if (mem_base != xmlMemBlocks()) {
43496            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43497	           xmlMemBlocks() - mem_base);
43498	    test_ret++;
43499            printf(" %d", n_writer);
43500            printf(" %d", n_name);
43501            printf(" %d", n_pubid);
43502            printf(" %d", n_sysid);
43503            printf("\n");
43504        }
43505    }
43506    }
43507    }
43508    }
43509    function_tests++;
43510#endif
43511
43512    return(test_ret);
43513}
43514
43515
43516static int
43517test_xmlTextWriterStartDTDAttlist(void) {
43518    int test_ret = 0;
43519
43520#if defined(LIBXML_WRITER_ENABLED)
43521    int mem_base;
43522    int ret_val;
43523    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43524    int n_writer;
43525    xmlChar * name; /* the name of the DTD ATTLIST */
43526    int n_name;
43527
43528    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43529    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43530        mem_base = xmlMemBlocks();
43531        writer = gen_xmlTextWriterPtr(n_writer, 0);
43532        name = gen_const_xmlChar_ptr(n_name, 1);
43533
43534        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43535        desret_int(ret_val);
43536        call_tests++;
43537        des_xmlTextWriterPtr(n_writer, writer, 0);
43538        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43539        xmlResetLastError();
43540        if (mem_base != xmlMemBlocks()) {
43541            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43542	           xmlMemBlocks() - mem_base);
43543	    test_ret++;
43544            printf(" %d", n_writer);
43545            printf(" %d", n_name);
43546            printf("\n");
43547        }
43548    }
43549    }
43550    function_tests++;
43551#endif
43552
43553    return(test_ret);
43554}
43555
43556
43557static int
43558test_xmlTextWriterStartDTDElement(void) {
43559    int test_ret = 0;
43560
43561#if defined(LIBXML_WRITER_ENABLED)
43562    int mem_base;
43563    int ret_val;
43564    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43565    int n_writer;
43566    xmlChar * name; /* the name of the DTD element */
43567    int n_name;
43568
43569    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43570    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43571        mem_base = xmlMemBlocks();
43572        writer = gen_xmlTextWriterPtr(n_writer, 0);
43573        name = gen_const_xmlChar_ptr(n_name, 1);
43574
43575        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43576        desret_int(ret_val);
43577        call_tests++;
43578        des_xmlTextWriterPtr(n_writer, writer, 0);
43579        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43580        xmlResetLastError();
43581        if (mem_base != xmlMemBlocks()) {
43582            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43583	           xmlMemBlocks() - mem_base);
43584	    test_ret++;
43585            printf(" %d", n_writer);
43586            printf(" %d", n_name);
43587            printf("\n");
43588        }
43589    }
43590    }
43591    function_tests++;
43592#endif
43593
43594    return(test_ret);
43595}
43596
43597
43598static int
43599test_xmlTextWriterStartDTDEntity(void) {
43600    int test_ret = 0;
43601
43602#if defined(LIBXML_WRITER_ENABLED)
43603    int mem_base;
43604    int ret_val;
43605    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43606    int n_writer;
43607    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43608    int n_pe;
43609    xmlChar * name; /* the name of the DTD ATTLIST */
43610    int n_name;
43611
43612    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43613    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43614    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43615        mem_base = xmlMemBlocks();
43616        writer = gen_xmlTextWriterPtr(n_writer, 0);
43617        pe = gen_int(n_pe, 1);
43618        name = gen_const_xmlChar_ptr(n_name, 2);
43619
43620        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43621        desret_int(ret_val);
43622        call_tests++;
43623        des_xmlTextWriterPtr(n_writer, writer, 0);
43624        des_int(n_pe, pe, 1);
43625        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43626        xmlResetLastError();
43627        if (mem_base != xmlMemBlocks()) {
43628            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43629	           xmlMemBlocks() - mem_base);
43630	    test_ret++;
43631            printf(" %d", n_writer);
43632            printf(" %d", n_pe);
43633            printf(" %d", n_name);
43634            printf("\n");
43635        }
43636    }
43637    }
43638    }
43639    function_tests++;
43640#endif
43641
43642    return(test_ret);
43643}
43644
43645
43646static int
43647test_xmlTextWriterStartDocument(void) {
43648    int test_ret = 0;
43649
43650#if defined(LIBXML_WRITER_ENABLED)
43651    int mem_base;
43652    int ret_val;
43653    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43654    int n_writer;
43655    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43656    int n_version;
43657    char * encoding; /* the encoding or NULL for default */
43658    int n_encoding;
43659    char * standalone; /* "yes" or "no" or NULL for default */
43660    int n_standalone;
43661
43662    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43663    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43664    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43665    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43666        mem_base = xmlMemBlocks();
43667        writer = gen_xmlTextWriterPtr(n_writer, 0);
43668        version = gen_const_char_ptr(n_version, 1);
43669        encoding = gen_const_char_ptr(n_encoding, 2);
43670        standalone = gen_const_char_ptr(n_standalone, 3);
43671
43672        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43673        desret_int(ret_val);
43674        call_tests++;
43675        des_xmlTextWriterPtr(n_writer, writer, 0);
43676        des_const_char_ptr(n_version, (const char *)version, 1);
43677        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43678        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43679        xmlResetLastError();
43680        if (mem_base != xmlMemBlocks()) {
43681            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43682	           xmlMemBlocks() - mem_base);
43683	    test_ret++;
43684            printf(" %d", n_writer);
43685            printf(" %d", n_version);
43686            printf(" %d", n_encoding);
43687            printf(" %d", n_standalone);
43688            printf("\n");
43689        }
43690    }
43691    }
43692    }
43693    }
43694    function_tests++;
43695#endif
43696
43697    return(test_ret);
43698}
43699
43700
43701static int
43702test_xmlTextWriterStartElement(void) {
43703    int test_ret = 0;
43704
43705#if defined(LIBXML_WRITER_ENABLED)
43706    int mem_base;
43707    int ret_val;
43708    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43709    int n_writer;
43710    xmlChar * name; /* element name */
43711    int n_name;
43712
43713    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43714    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43715        mem_base = xmlMemBlocks();
43716        writer = gen_xmlTextWriterPtr(n_writer, 0);
43717        name = gen_const_xmlChar_ptr(n_name, 1);
43718
43719        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43720        desret_int(ret_val);
43721        call_tests++;
43722        des_xmlTextWriterPtr(n_writer, writer, 0);
43723        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43724        xmlResetLastError();
43725        if (mem_base != xmlMemBlocks()) {
43726            printf("Leak of %d blocks found in xmlTextWriterStartElement",
43727	           xmlMemBlocks() - mem_base);
43728	    test_ret++;
43729            printf(" %d", n_writer);
43730            printf(" %d", n_name);
43731            printf("\n");
43732        }
43733    }
43734    }
43735    function_tests++;
43736#endif
43737
43738    return(test_ret);
43739}
43740
43741
43742static int
43743test_xmlTextWriterStartElementNS(void) {
43744    int test_ret = 0;
43745
43746#if defined(LIBXML_WRITER_ENABLED)
43747    int mem_base;
43748    int ret_val;
43749    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43750    int n_writer;
43751    xmlChar * prefix; /* namespace prefix or NULL */
43752    int n_prefix;
43753    xmlChar * name; /* element local name */
43754    int n_name;
43755    xmlChar * namespaceURI; /* namespace URI or NULL */
43756    int n_namespaceURI;
43757
43758    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43759    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43760    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43761    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43762        mem_base = xmlMemBlocks();
43763        writer = gen_xmlTextWriterPtr(n_writer, 0);
43764        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43765        name = gen_const_xmlChar_ptr(n_name, 2);
43766        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43767
43768        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43769        desret_int(ret_val);
43770        call_tests++;
43771        des_xmlTextWriterPtr(n_writer, writer, 0);
43772        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43773        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43774        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43775        xmlResetLastError();
43776        if (mem_base != xmlMemBlocks()) {
43777            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43778	           xmlMemBlocks() - mem_base);
43779	    test_ret++;
43780            printf(" %d", n_writer);
43781            printf(" %d", n_prefix);
43782            printf(" %d", n_name);
43783            printf(" %d", n_namespaceURI);
43784            printf("\n");
43785        }
43786    }
43787    }
43788    }
43789    }
43790    function_tests++;
43791#endif
43792
43793    return(test_ret);
43794}
43795
43796
43797static int
43798test_xmlTextWriterStartPI(void) {
43799    int test_ret = 0;
43800
43801#if defined(LIBXML_WRITER_ENABLED)
43802    int mem_base;
43803    int ret_val;
43804    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43805    int n_writer;
43806    xmlChar * target; /* PI target */
43807    int n_target;
43808
43809    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43810    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43811        mem_base = xmlMemBlocks();
43812        writer = gen_xmlTextWriterPtr(n_writer, 0);
43813        target = gen_const_xmlChar_ptr(n_target, 1);
43814
43815        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43816        desret_int(ret_val);
43817        call_tests++;
43818        des_xmlTextWriterPtr(n_writer, writer, 0);
43819        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43820        xmlResetLastError();
43821        if (mem_base != xmlMemBlocks()) {
43822            printf("Leak of %d blocks found in xmlTextWriterStartPI",
43823	           xmlMemBlocks() - mem_base);
43824	    test_ret++;
43825            printf(" %d", n_writer);
43826            printf(" %d", n_target);
43827            printf("\n");
43828        }
43829    }
43830    }
43831    function_tests++;
43832#endif
43833
43834    return(test_ret);
43835}
43836
43837
43838static int
43839test_xmlTextWriterWriteAttribute(void) {
43840    int test_ret = 0;
43841
43842#if defined(LIBXML_WRITER_ENABLED)
43843    int mem_base;
43844    int ret_val;
43845    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43846    int n_writer;
43847    xmlChar * name; /* attribute name */
43848    int n_name;
43849    xmlChar * content; /* attribute content */
43850    int n_content;
43851
43852    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43853    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43854    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43855        mem_base = xmlMemBlocks();
43856        writer = gen_xmlTextWriterPtr(n_writer, 0);
43857        name = gen_const_xmlChar_ptr(n_name, 1);
43858        content = gen_const_xmlChar_ptr(n_content, 2);
43859
43860        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
43861        desret_int(ret_val);
43862        call_tests++;
43863        des_xmlTextWriterPtr(n_writer, writer, 0);
43864        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43865        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43866        xmlResetLastError();
43867        if (mem_base != xmlMemBlocks()) {
43868            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
43869	           xmlMemBlocks() - mem_base);
43870	    test_ret++;
43871            printf(" %d", n_writer);
43872            printf(" %d", n_name);
43873            printf(" %d", n_content);
43874            printf("\n");
43875        }
43876    }
43877    }
43878    }
43879    function_tests++;
43880#endif
43881
43882    return(test_ret);
43883}
43884
43885
43886static int
43887test_xmlTextWriterWriteAttributeNS(void) {
43888    int test_ret = 0;
43889
43890#if defined(LIBXML_WRITER_ENABLED)
43891    int mem_base;
43892    int ret_val;
43893    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43894    int n_writer;
43895    xmlChar * prefix; /* namespace prefix */
43896    int n_prefix;
43897    xmlChar * name; /* attribute local name */
43898    int n_name;
43899    xmlChar * namespaceURI; /* namespace URI */
43900    int n_namespaceURI;
43901    xmlChar * content; /* attribute content */
43902    int n_content;
43903
43904    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43905    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43906    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43907    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43908    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43909        mem_base = xmlMemBlocks();
43910        writer = gen_xmlTextWriterPtr(n_writer, 0);
43911        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43912        name = gen_const_xmlChar_ptr(n_name, 2);
43913        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43914        content = gen_const_xmlChar_ptr(n_content, 4);
43915
43916        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
43917        desret_int(ret_val);
43918        call_tests++;
43919        des_xmlTextWriterPtr(n_writer, writer, 0);
43920        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43921        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43922        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43923        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
43924        xmlResetLastError();
43925        if (mem_base != xmlMemBlocks()) {
43926            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
43927	           xmlMemBlocks() - mem_base);
43928	    test_ret++;
43929            printf(" %d", n_writer);
43930            printf(" %d", n_prefix);
43931            printf(" %d", n_name);
43932            printf(" %d", n_namespaceURI);
43933            printf(" %d", n_content);
43934            printf("\n");
43935        }
43936    }
43937    }
43938    }
43939    }
43940    }
43941    function_tests++;
43942#endif
43943
43944    return(test_ret);
43945}
43946
43947
43948static int
43949test_xmlTextWriterWriteBase64(void) {
43950    int test_ret = 0;
43951
43952#if defined(LIBXML_WRITER_ENABLED)
43953    int mem_base;
43954    int ret_val;
43955    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43956    int n_writer;
43957    char * data; /* binary data */
43958    int n_data;
43959    int start; /* the position within the data of the first byte to encode */
43960    int n_start;
43961    int len; /* the number of bytes to encode */
43962    int n_len;
43963
43964    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43965    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43966    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43967    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43968        mem_base = xmlMemBlocks();
43969        writer = gen_xmlTextWriterPtr(n_writer, 0);
43970        data = gen_const_char_ptr(n_data, 1);
43971        start = gen_int(n_start, 2);
43972        len = gen_int(n_len, 3);
43973
43974        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
43975        desret_int(ret_val);
43976        call_tests++;
43977        des_xmlTextWriterPtr(n_writer, writer, 0);
43978        des_const_char_ptr(n_data, (const char *)data, 1);
43979        des_int(n_start, start, 2);
43980        des_int(n_len, len, 3);
43981        xmlResetLastError();
43982        if (mem_base != xmlMemBlocks()) {
43983            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
43984	           xmlMemBlocks() - mem_base);
43985	    test_ret++;
43986            printf(" %d", n_writer);
43987            printf(" %d", n_data);
43988            printf(" %d", n_start);
43989            printf(" %d", n_len);
43990            printf("\n");
43991        }
43992    }
43993    }
43994    }
43995    }
43996    function_tests++;
43997#endif
43998
43999    return(test_ret);
44000}
44001
44002
44003static int
44004test_xmlTextWriterWriteBinHex(void) {
44005    int test_ret = 0;
44006
44007#if defined(LIBXML_WRITER_ENABLED)
44008    int mem_base;
44009    int ret_val;
44010    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44011    int n_writer;
44012    char * data; /* binary data */
44013    int n_data;
44014    int start; /* the position within the data of the first byte to encode */
44015    int n_start;
44016    int len; /* the number of bytes to encode */
44017    int n_len;
44018
44019    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44020    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44021    for (n_start = 0;n_start < gen_nb_int;n_start++) {
44022    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44023        mem_base = xmlMemBlocks();
44024        writer = gen_xmlTextWriterPtr(n_writer, 0);
44025        data = gen_const_char_ptr(n_data, 1);
44026        start = gen_int(n_start, 2);
44027        len = gen_int(n_len, 3);
44028
44029        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44030        desret_int(ret_val);
44031        call_tests++;
44032        des_xmlTextWriterPtr(n_writer, writer, 0);
44033        des_const_char_ptr(n_data, (const char *)data, 1);
44034        des_int(n_start, start, 2);
44035        des_int(n_len, len, 3);
44036        xmlResetLastError();
44037        if (mem_base != xmlMemBlocks()) {
44038            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44039	           xmlMemBlocks() - mem_base);
44040	    test_ret++;
44041            printf(" %d", n_writer);
44042            printf(" %d", n_data);
44043            printf(" %d", n_start);
44044            printf(" %d", n_len);
44045            printf("\n");
44046        }
44047    }
44048    }
44049    }
44050    }
44051    function_tests++;
44052#endif
44053
44054    return(test_ret);
44055}
44056
44057
44058static int
44059test_xmlTextWriterWriteCDATA(void) {
44060    int test_ret = 0;
44061
44062#if defined(LIBXML_WRITER_ENABLED)
44063    int mem_base;
44064    int ret_val;
44065    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44066    int n_writer;
44067    xmlChar * content; /* CDATA content */
44068    int n_content;
44069
44070    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44071    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44072        mem_base = xmlMemBlocks();
44073        writer = gen_xmlTextWriterPtr(n_writer, 0);
44074        content = gen_const_xmlChar_ptr(n_content, 1);
44075
44076        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44077        desret_int(ret_val);
44078        call_tests++;
44079        des_xmlTextWriterPtr(n_writer, writer, 0);
44080        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44081        xmlResetLastError();
44082        if (mem_base != xmlMemBlocks()) {
44083            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44084	           xmlMemBlocks() - mem_base);
44085	    test_ret++;
44086            printf(" %d", n_writer);
44087            printf(" %d", n_content);
44088            printf("\n");
44089        }
44090    }
44091    }
44092    function_tests++;
44093#endif
44094
44095    return(test_ret);
44096}
44097
44098
44099static int
44100test_xmlTextWriterWriteComment(void) {
44101    int test_ret = 0;
44102
44103#if defined(LIBXML_WRITER_ENABLED)
44104    int mem_base;
44105    int ret_val;
44106    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44107    int n_writer;
44108    xmlChar * content; /* comment string */
44109    int n_content;
44110
44111    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44112    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44113        mem_base = xmlMemBlocks();
44114        writer = gen_xmlTextWriterPtr(n_writer, 0);
44115        content = gen_const_xmlChar_ptr(n_content, 1);
44116
44117        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44118        desret_int(ret_val);
44119        call_tests++;
44120        des_xmlTextWriterPtr(n_writer, writer, 0);
44121        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44122        xmlResetLastError();
44123        if (mem_base != xmlMemBlocks()) {
44124            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44125	           xmlMemBlocks() - mem_base);
44126	    test_ret++;
44127            printf(" %d", n_writer);
44128            printf(" %d", n_content);
44129            printf("\n");
44130        }
44131    }
44132    }
44133    function_tests++;
44134#endif
44135
44136    return(test_ret);
44137}
44138
44139
44140static int
44141test_xmlTextWriterWriteDTD(void) {
44142    int test_ret = 0;
44143
44144#if defined(LIBXML_WRITER_ENABLED)
44145    int mem_base;
44146    int ret_val;
44147    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44148    int n_writer;
44149    xmlChar * name; /* the name of the DTD */
44150    int n_name;
44151    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44152    int n_pubid;
44153    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44154    int n_sysid;
44155    xmlChar * subset; /* string content of the DTD */
44156    int n_subset;
44157
44158    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44159    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44160    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44161    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44162    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44163        mem_base = xmlMemBlocks();
44164        writer = gen_xmlTextWriterPtr(n_writer, 0);
44165        name = gen_const_xmlChar_ptr(n_name, 1);
44166        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44167        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44168        subset = gen_const_xmlChar_ptr(n_subset, 4);
44169
44170        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44171        desret_int(ret_val);
44172        call_tests++;
44173        des_xmlTextWriterPtr(n_writer, writer, 0);
44174        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44175        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44176        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44177        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44178        xmlResetLastError();
44179        if (mem_base != xmlMemBlocks()) {
44180            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44181	           xmlMemBlocks() - mem_base);
44182	    test_ret++;
44183            printf(" %d", n_writer);
44184            printf(" %d", n_name);
44185            printf(" %d", n_pubid);
44186            printf(" %d", n_sysid);
44187            printf(" %d", n_subset);
44188            printf("\n");
44189        }
44190    }
44191    }
44192    }
44193    }
44194    }
44195    function_tests++;
44196#endif
44197
44198    return(test_ret);
44199}
44200
44201
44202static int
44203test_xmlTextWriterWriteDTDAttlist(void) {
44204    int test_ret = 0;
44205
44206#if defined(LIBXML_WRITER_ENABLED)
44207    int mem_base;
44208    int ret_val;
44209    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44210    int n_writer;
44211    xmlChar * name; /* the name of the DTD ATTLIST */
44212    int n_name;
44213    xmlChar * content; /* content of the ATTLIST */
44214    int n_content;
44215
44216    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44217    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44218    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44219        mem_base = xmlMemBlocks();
44220        writer = gen_xmlTextWriterPtr(n_writer, 0);
44221        name = gen_const_xmlChar_ptr(n_name, 1);
44222        content = gen_const_xmlChar_ptr(n_content, 2);
44223
44224        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44225        desret_int(ret_val);
44226        call_tests++;
44227        des_xmlTextWriterPtr(n_writer, writer, 0);
44228        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44229        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44230        xmlResetLastError();
44231        if (mem_base != xmlMemBlocks()) {
44232            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44233	           xmlMemBlocks() - mem_base);
44234	    test_ret++;
44235            printf(" %d", n_writer);
44236            printf(" %d", n_name);
44237            printf(" %d", n_content);
44238            printf("\n");
44239        }
44240    }
44241    }
44242    }
44243    function_tests++;
44244#endif
44245
44246    return(test_ret);
44247}
44248
44249
44250static int
44251test_xmlTextWriterWriteDTDElement(void) {
44252    int test_ret = 0;
44253
44254#if defined(LIBXML_WRITER_ENABLED)
44255    int mem_base;
44256    int ret_val;
44257    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44258    int n_writer;
44259    xmlChar * name; /* the name of the DTD element */
44260    int n_name;
44261    xmlChar * content; /* content of the element */
44262    int n_content;
44263
44264    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44265    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44266    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44267        mem_base = xmlMemBlocks();
44268        writer = gen_xmlTextWriterPtr(n_writer, 0);
44269        name = gen_const_xmlChar_ptr(n_name, 1);
44270        content = gen_const_xmlChar_ptr(n_content, 2);
44271
44272        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44273        desret_int(ret_val);
44274        call_tests++;
44275        des_xmlTextWriterPtr(n_writer, writer, 0);
44276        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44277        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44278        xmlResetLastError();
44279        if (mem_base != xmlMemBlocks()) {
44280            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44281	           xmlMemBlocks() - mem_base);
44282	    test_ret++;
44283            printf(" %d", n_writer);
44284            printf(" %d", n_name);
44285            printf(" %d", n_content);
44286            printf("\n");
44287        }
44288    }
44289    }
44290    }
44291    function_tests++;
44292#endif
44293
44294    return(test_ret);
44295}
44296
44297
44298static int
44299test_xmlTextWriterWriteDTDEntity(void) {
44300    int test_ret = 0;
44301
44302#if defined(LIBXML_WRITER_ENABLED)
44303    int mem_base;
44304    int ret_val;
44305    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44306    int n_writer;
44307    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44308    int n_pe;
44309    xmlChar * name; /* the name of the DTD entity */
44310    int n_name;
44311    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44312    int n_pubid;
44313    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44314    int n_sysid;
44315    xmlChar * ndataid; /* the xml notation name. */
44316    int n_ndataid;
44317    xmlChar * content; /* content of the entity */
44318    int n_content;
44319
44320    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44321    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44322    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44323    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44324    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44325    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44326    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44327        mem_base = xmlMemBlocks();
44328        writer = gen_xmlTextWriterPtr(n_writer, 0);
44329        pe = gen_int(n_pe, 1);
44330        name = gen_const_xmlChar_ptr(n_name, 2);
44331        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44332        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44333        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44334        content = gen_const_xmlChar_ptr(n_content, 6);
44335
44336        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44337        desret_int(ret_val);
44338        call_tests++;
44339        des_xmlTextWriterPtr(n_writer, writer, 0);
44340        des_int(n_pe, pe, 1);
44341        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44342        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44343        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44344        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44345        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44346        xmlResetLastError();
44347        if (mem_base != xmlMemBlocks()) {
44348            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44349	           xmlMemBlocks() - mem_base);
44350	    test_ret++;
44351            printf(" %d", n_writer);
44352            printf(" %d", n_pe);
44353            printf(" %d", n_name);
44354            printf(" %d", n_pubid);
44355            printf(" %d", n_sysid);
44356            printf(" %d", n_ndataid);
44357            printf(" %d", n_content);
44358            printf("\n");
44359        }
44360    }
44361    }
44362    }
44363    }
44364    }
44365    }
44366    }
44367    function_tests++;
44368#endif
44369
44370    return(test_ret);
44371}
44372
44373
44374static int
44375test_xmlTextWriterWriteDTDExternalEntity(void) {
44376    int test_ret = 0;
44377
44378#if defined(LIBXML_WRITER_ENABLED)
44379    int mem_base;
44380    int ret_val;
44381    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44382    int n_writer;
44383    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44384    int n_pe;
44385    xmlChar * name; /* the name of the DTD entity */
44386    int n_name;
44387    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44388    int n_pubid;
44389    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44390    int n_sysid;
44391    xmlChar * ndataid; /* the xml notation name. */
44392    int n_ndataid;
44393
44394    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44395    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44396    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44397    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44398    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44399    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44400        mem_base = xmlMemBlocks();
44401        writer = gen_xmlTextWriterPtr(n_writer, 0);
44402        pe = gen_int(n_pe, 1);
44403        name = gen_const_xmlChar_ptr(n_name, 2);
44404        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44405        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44406        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44407
44408        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44409        desret_int(ret_val);
44410        call_tests++;
44411        des_xmlTextWriterPtr(n_writer, writer, 0);
44412        des_int(n_pe, pe, 1);
44413        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44414        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44415        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44416        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44417        xmlResetLastError();
44418        if (mem_base != xmlMemBlocks()) {
44419            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44420	           xmlMemBlocks() - mem_base);
44421	    test_ret++;
44422            printf(" %d", n_writer);
44423            printf(" %d", n_pe);
44424            printf(" %d", n_name);
44425            printf(" %d", n_pubid);
44426            printf(" %d", n_sysid);
44427            printf(" %d", n_ndataid);
44428            printf("\n");
44429        }
44430    }
44431    }
44432    }
44433    }
44434    }
44435    }
44436    function_tests++;
44437#endif
44438
44439    return(test_ret);
44440}
44441
44442
44443static int
44444test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44445    int test_ret = 0;
44446
44447#if defined(LIBXML_WRITER_ENABLED)
44448    int mem_base;
44449    int ret_val;
44450    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44451    int n_writer;
44452    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44453    int n_pubid;
44454    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44455    int n_sysid;
44456    xmlChar * ndataid; /* the xml notation name. */
44457    int n_ndataid;
44458
44459    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44460    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44461    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44462    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44463        mem_base = xmlMemBlocks();
44464        writer = gen_xmlTextWriterPtr(n_writer, 0);
44465        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44466        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44467        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44468
44469        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44470        desret_int(ret_val);
44471        call_tests++;
44472        des_xmlTextWriterPtr(n_writer, writer, 0);
44473        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44474        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44475        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44476        xmlResetLastError();
44477        if (mem_base != xmlMemBlocks()) {
44478            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44479	           xmlMemBlocks() - mem_base);
44480	    test_ret++;
44481            printf(" %d", n_writer);
44482            printf(" %d", n_pubid);
44483            printf(" %d", n_sysid);
44484            printf(" %d", n_ndataid);
44485            printf("\n");
44486        }
44487    }
44488    }
44489    }
44490    }
44491    function_tests++;
44492#endif
44493
44494    return(test_ret);
44495}
44496
44497
44498static int
44499test_xmlTextWriterWriteDTDInternalEntity(void) {
44500    int test_ret = 0;
44501
44502#if defined(LIBXML_WRITER_ENABLED)
44503    int mem_base;
44504    int ret_val;
44505    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44506    int n_writer;
44507    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44508    int n_pe;
44509    xmlChar * name; /* the name of the DTD entity */
44510    int n_name;
44511    xmlChar * content; /* content of the entity */
44512    int n_content;
44513
44514    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44515    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44516    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44517    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44518        mem_base = xmlMemBlocks();
44519        writer = gen_xmlTextWriterPtr(n_writer, 0);
44520        pe = gen_int(n_pe, 1);
44521        name = gen_const_xmlChar_ptr(n_name, 2);
44522        content = gen_const_xmlChar_ptr(n_content, 3);
44523
44524        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44525        desret_int(ret_val);
44526        call_tests++;
44527        des_xmlTextWriterPtr(n_writer, writer, 0);
44528        des_int(n_pe, pe, 1);
44529        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44530        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44531        xmlResetLastError();
44532        if (mem_base != xmlMemBlocks()) {
44533            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44534	           xmlMemBlocks() - mem_base);
44535	    test_ret++;
44536            printf(" %d", n_writer);
44537            printf(" %d", n_pe);
44538            printf(" %d", n_name);
44539            printf(" %d", n_content);
44540            printf("\n");
44541        }
44542    }
44543    }
44544    }
44545    }
44546    function_tests++;
44547#endif
44548
44549    return(test_ret);
44550}
44551
44552
44553static int
44554test_xmlTextWriterWriteDTDNotation(void) {
44555    int test_ret = 0;
44556
44557#if defined(LIBXML_WRITER_ENABLED)
44558    int mem_base;
44559    int ret_val;
44560    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44561    int n_writer;
44562    xmlChar * name; /* the name of the xml notation */
44563    int n_name;
44564    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44565    int n_pubid;
44566    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44567    int n_sysid;
44568
44569    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44570    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44571    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44572    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44573        mem_base = xmlMemBlocks();
44574        writer = gen_xmlTextWriterPtr(n_writer, 0);
44575        name = gen_const_xmlChar_ptr(n_name, 1);
44576        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44577        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44578
44579        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44580        desret_int(ret_val);
44581        call_tests++;
44582        des_xmlTextWriterPtr(n_writer, writer, 0);
44583        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44584        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44585        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44586        xmlResetLastError();
44587        if (mem_base != xmlMemBlocks()) {
44588            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44589	           xmlMemBlocks() - mem_base);
44590	    test_ret++;
44591            printf(" %d", n_writer);
44592            printf(" %d", n_name);
44593            printf(" %d", n_pubid);
44594            printf(" %d", n_sysid);
44595            printf("\n");
44596        }
44597    }
44598    }
44599    }
44600    }
44601    function_tests++;
44602#endif
44603
44604    return(test_ret);
44605}
44606
44607
44608static int
44609test_xmlTextWriterWriteElement(void) {
44610    int test_ret = 0;
44611
44612#if defined(LIBXML_WRITER_ENABLED)
44613    int mem_base;
44614    int ret_val;
44615    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44616    int n_writer;
44617    xmlChar * name; /* element name */
44618    int n_name;
44619    xmlChar * content; /* element content */
44620    int n_content;
44621
44622    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44623    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44624    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44625        mem_base = xmlMemBlocks();
44626        writer = gen_xmlTextWriterPtr(n_writer, 0);
44627        name = gen_const_xmlChar_ptr(n_name, 1);
44628        content = gen_const_xmlChar_ptr(n_content, 2);
44629
44630        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44631        desret_int(ret_val);
44632        call_tests++;
44633        des_xmlTextWriterPtr(n_writer, writer, 0);
44634        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44635        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44636        xmlResetLastError();
44637        if (mem_base != xmlMemBlocks()) {
44638            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44639	           xmlMemBlocks() - mem_base);
44640	    test_ret++;
44641            printf(" %d", n_writer);
44642            printf(" %d", n_name);
44643            printf(" %d", n_content);
44644            printf("\n");
44645        }
44646    }
44647    }
44648    }
44649    function_tests++;
44650#endif
44651
44652    return(test_ret);
44653}
44654
44655
44656static int
44657test_xmlTextWriterWriteElementNS(void) {
44658    int test_ret = 0;
44659
44660#if defined(LIBXML_WRITER_ENABLED)
44661    int mem_base;
44662    int ret_val;
44663    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44664    int n_writer;
44665    xmlChar * prefix; /* namespace prefix */
44666    int n_prefix;
44667    xmlChar * name; /* element local name */
44668    int n_name;
44669    xmlChar * namespaceURI; /* namespace URI */
44670    int n_namespaceURI;
44671    xmlChar * content; /* element content */
44672    int n_content;
44673
44674    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44675    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44676    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44677    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44678    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44679        mem_base = xmlMemBlocks();
44680        writer = gen_xmlTextWriterPtr(n_writer, 0);
44681        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44682        name = gen_const_xmlChar_ptr(n_name, 2);
44683        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44684        content = gen_const_xmlChar_ptr(n_content, 4);
44685
44686        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44687        desret_int(ret_val);
44688        call_tests++;
44689        des_xmlTextWriterPtr(n_writer, writer, 0);
44690        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44691        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44692        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44693        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44694        xmlResetLastError();
44695        if (mem_base != xmlMemBlocks()) {
44696            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44697	           xmlMemBlocks() - mem_base);
44698	    test_ret++;
44699            printf(" %d", n_writer);
44700            printf(" %d", n_prefix);
44701            printf(" %d", n_name);
44702            printf(" %d", n_namespaceURI);
44703            printf(" %d", n_content);
44704            printf("\n");
44705        }
44706    }
44707    }
44708    }
44709    }
44710    }
44711    function_tests++;
44712#endif
44713
44714    return(test_ret);
44715}
44716
44717
44718static int
44719test_xmlTextWriterWriteFormatAttribute(void) {
44720    int test_ret = 0;
44721
44722
44723    /* missing type support */
44724    return(test_ret);
44725}
44726
44727
44728static int
44729test_xmlTextWriterWriteFormatAttributeNS(void) {
44730    int test_ret = 0;
44731
44732
44733    /* missing type support */
44734    return(test_ret);
44735}
44736
44737
44738static int
44739test_xmlTextWriterWriteFormatCDATA(void) {
44740    int test_ret = 0;
44741
44742
44743    /* missing type support */
44744    return(test_ret);
44745}
44746
44747
44748static int
44749test_xmlTextWriterWriteFormatComment(void) {
44750    int test_ret = 0;
44751
44752
44753    /* missing type support */
44754    return(test_ret);
44755}
44756
44757
44758static int
44759test_xmlTextWriterWriteFormatDTD(void) {
44760    int test_ret = 0;
44761
44762
44763    /* missing type support */
44764    return(test_ret);
44765}
44766
44767
44768static int
44769test_xmlTextWriterWriteFormatDTDAttlist(void) {
44770    int test_ret = 0;
44771
44772
44773    /* missing type support */
44774    return(test_ret);
44775}
44776
44777
44778static int
44779test_xmlTextWriterWriteFormatDTDElement(void) {
44780    int test_ret = 0;
44781
44782
44783    /* missing type support */
44784    return(test_ret);
44785}
44786
44787
44788static int
44789test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44790    int test_ret = 0;
44791
44792
44793    /* missing type support */
44794    return(test_ret);
44795}
44796
44797
44798static int
44799test_xmlTextWriterWriteFormatElement(void) {
44800    int test_ret = 0;
44801
44802
44803    /* missing type support */
44804    return(test_ret);
44805}
44806
44807
44808static int
44809test_xmlTextWriterWriteFormatElementNS(void) {
44810    int test_ret = 0;
44811
44812
44813    /* missing type support */
44814    return(test_ret);
44815}
44816
44817
44818static int
44819test_xmlTextWriterWriteFormatPI(void) {
44820    int test_ret = 0;
44821
44822
44823    /* missing type support */
44824    return(test_ret);
44825}
44826
44827
44828static int
44829test_xmlTextWriterWriteFormatRaw(void) {
44830    int test_ret = 0;
44831
44832
44833    /* missing type support */
44834    return(test_ret);
44835}
44836
44837
44838static int
44839test_xmlTextWriterWriteFormatString(void) {
44840    int test_ret = 0;
44841
44842
44843    /* missing type support */
44844    return(test_ret);
44845}
44846
44847
44848static int
44849test_xmlTextWriterWritePI(void) {
44850    int test_ret = 0;
44851
44852#if defined(LIBXML_WRITER_ENABLED)
44853    int mem_base;
44854    int ret_val;
44855    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44856    int n_writer;
44857    xmlChar * target; /* PI target */
44858    int n_target;
44859    xmlChar * content; /* PI content */
44860    int n_content;
44861
44862    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44863    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44864    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44865        mem_base = xmlMemBlocks();
44866        writer = gen_xmlTextWriterPtr(n_writer, 0);
44867        target = gen_const_xmlChar_ptr(n_target, 1);
44868        content = gen_const_xmlChar_ptr(n_content, 2);
44869
44870        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
44871        desret_int(ret_val);
44872        call_tests++;
44873        des_xmlTextWriterPtr(n_writer, writer, 0);
44874        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44875        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44876        xmlResetLastError();
44877        if (mem_base != xmlMemBlocks()) {
44878            printf("Leak of %d blocks found in xmlTextWriterWritePI",
44879	           xmlMemBlocks() - mem_base);
44880	    test_ret++;
44881            printf(" %d", n_writer);
44882            printf(" %d", n_target);
44883            printf(" %d", n_content);
44884            printf("\n");
44885        }
44886    }
44887    }
44888    }
44889    function_tests++;
44890#endif
44891
44892    return(test_ret);
44893}
44894
44895
44896static int
44897test_xmlTextWriterWriteRaw(void) {
44898    int test_ret = 0;
44899
44900#if defined(LIBXML_WRITER_ENABLED)
44901    int mem_base;
44902    int ret_val;
44903    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44904    int n_writer;
44905    xmlChar * content; /* text string */
44906    int n_content;
44907
44908    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44909    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44910        mem_base = xmlMemBlocks();
44911        writer = gen_xmlTextWriterPtr(n_writer, 0);
44912        content = gen_const_xmlChar_ptr(n_content, 1);
44913
44914        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
44915        desret_int(ret_val);
44916        call_tests++;
44917        des_xmlTextWriterPtr(n_writer, writer, 0);
44918        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44919        xmlResetLastError();
44920        if (mem_base != xmlMemBlocks()) {
44921            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
44922	           xmlMemBlocks() - mem_base);
44923	    test_ret++;
44924            printf(" %d", n_writer);
44925            printf(" %d", n_content);
44926            printf("\n");
44927        }
44928    }
44929    }
44930    function_tests++;
44931#endif
44932
44933    return(test_ret);
44934}
44935
44936
44937static int
44938test_xmlTextWriterWriteRawLen(void) {
44939    int test_ret = 0;
44940
44941#if defined(LIBXML_WRITER_ENABLED)
44942    int mem_base;
44943    int ret_val;
44944    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44945    int n_writer;
44946    xmlChar * content; /* text string */
44947    int n_content;
44948    int len; /* length of the text string */
44949    int n_len;
44950
44951    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44952    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44953    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44954        mem_base = xmlMemBlocks();
44955        writer = gen_xmlTextWriterPtr(n_writer, 0);
44956        content = gen_const_xmlChar_ptr(n_content, 1);
44957        len = gen_int(n_len, 2);
44958
44959        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
44960        desret_int(ret_val);
44961        call_tests++;
44962        des_xmlTextWriterPtr(n_writer, writer, 0);
44963        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44964        des_int(n_len, len, 2);
44965        xmlResetLastError();
44966        if (mem_base != xmlMemBlocks()) {
44967            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
44968	           xmlMemBlocks() - mem_base);
44969	    test_ret++;
44970            printf(" %d", n_writer);
44971            printf(" %d", n_content);
44972            printf(" %d", n_len);
44973            printf("\n");
44974        }
44975    }
44976    }
44977    }
44978    function_tests++;
44979#endif
44980
44981    return(test_ret);
44982}
44983
44984
44985static int
44986test_xmlTextWriterWriteString(void) {
44987    int test_ret = 0;
44988
44989#if defined(LIBXML_WRITER_ENABLED)
44990    int mem_base;
44991    int ret_val;
44992    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44993    int n_writer;
44994    xmlChar * content; /* text string */
44995    int n_content;
44996
44997    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44998    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44999        mem_base = xmlMemBlocks();
45000        writer = gen_xmlTextWriterPtr(n_writer, 0);
45001        content = gen_const_xmlChar_ptr(n_content, 1);
45002
45003        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45004        desret_int(ret_val);
45005        call_tests++;
45006        des_xmlTextWriterPtr(n_writer, writer, 0);
45007        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45008        xmlResetLastError();
45009        if (mem_base != xmlMemBlocks()) {
45010            printf("Leak of %d blocks found in xmlTextWriterWriteString",
45011	           xmlMemBlocks() - mem_base);
45012	    test_ret++;
45013            printf(" %d", n_writer);
45014            printf(" %d", n_content);
45015            printf("\n");
45016        }
45017    }
45018    }
45019    function_tests++;
45020#endif
45021
45022    return(test_ret);
45023}
45024
45025
45026static int
45027test_xmlTextWriterWriteVFormatAttribute(void) {
45028    int test_ret = 0;
45029
45030
45031    /* missing type support */
45032    return(test_ret);
45033}
45034
45035
45036static int
45037test_xmlTextWriterWriteVFormatAttributeNS(void) {
45038    int test_ret = 0;
45039
45040
45041    /* missing type support */
45042    return(test_ret);
45043}
45044
45045
45046static int
45047test_xmlTextWriterWriteVFormatCDATA(void) {
45048    int test_ret = 0;
45049
45050
45051    /* missing type support */
45052    return(test_ret);
45053}
45054
45055
45056static int
45057test_xmlTextWriterWriteVFormatComment(void) {
45058    int test_ret = 0;
45059
45060
45061    /* missing type support */
45062    return(test_ret);
45063}
45064
45065
45066static int
45067test_xmlTextWriterWriteVFormatDTD(void) {
45068    int test_ret = 0;
45069
45070
45071    /* missing type support */
45072    return(test_ret);
45073}
45074
45075
45076static int
45077test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45078    int test_ret = 0;
45079
45080
45081    /* missing type support */
45082    return(test_ret);
45083}
45084
45085
45086static int
45087test_xmlTextWriterWriteVFormatDTDElement(void) {
45088    int test_ret = 0;
45089
45090
45091    /* missing type support */
45092    return(test_ret);
45093}
45094
45095
45096static int
45097test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45098    int test_ret = 0;
45099
45100
45101    /* missing type support */
45102    return(test_ret);
45103}
45104
45105
45106static int
45107test_xmlTextWriterWriteVFormatElement(void) {
45108    int test_ret = 0;
45109
45110
45111    /* missing type support */
45112    return(test_ret);
45113}
45114
45115
45116static int
45117test_xmlTextWriterWriteVFormatElementNS(void) {
45118    int test_ret = 0;
45119
45120
45121    /* missing type support */
45122    return(test_ret);
45123}
45124
45125
45126static int
45127test_xmlTextWriterWriteVFormatPI(void) {
45128    int test_ret = 0;
45129
45130
45131    /* missing type support */
45132    return(test_ret);
45133}
45134
45135
45136static int
45137test_xmlTextWriterWriteVFormatRaw(void) {
45138    int test_ret = 0;
45139
45140
45141    /* missing type support */
45142    return(test_ret);
45143}
45144
45145
45146static int
45147test_xmlTextWriterWriteVFormatString(void) {
45148    int test_ret = 0;
45149
45150
45151    /* missing type support */
45152    return(test_ret);
45153}
45154
45155static int
45156test_xmlwriter(void) {
45157    int test_ret = 0;
45158
45159    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45160    test_ret += test_xmlNewTextWriter();
45161    test_ret += test_xmlNewTextWriterFilename();
45162    test_ret += test_xmlNewTextWriterMemory();
45163    test_ret += test_xmlNewTextWriterPushParser();
45164    test_ret += test_xmlNewTextWriterTree();
45165    test_ret += test_xmlTextWriterEndAttribute();
45166    test_ret += test_xmlTextWriterEndCDATA();
45167    test_ret += test_xmlTextWriterEndComment();
45168    test_ret += test_xmlTextWriterEndDTD();
45169    test_ret += test_xmlTextWriterEndDTDAttlist();
45170    test_ret += test_xmlTextWriterEndDTDElement();
45171    test_ret += test_xmlTextWriterEndDTDEntity();
45172    test_ret += test_xmlTextWriterEndDocument();
45173    test_ret += test_xmlTextWriterEndElement();
45174    test_ret += test_xmlTextWriterEndPI();
45175    test_ret += test_xmlTextWriterFlush();
45176    test_ret += test_xmlTextWriterFullEndElement();
45177    test_ret += test_xmlTextWriterSetIndent();
45178    test_ret += test_xmlTextWriterSetIndentString();
45179    test_ret += test_xmlTextWriterStartAttribute();
45180    test_ret += test_xmlTextWriterStartAttributeNS();
45181    test_ret += test_xmlTextWriterStartCDATA();
45182    test_ret += test_xmlTextWriterStartComment();
45183    test_ret += test_xmlTextWriterStartDTD();
45184    test_ret += test_xmlTextWriterStartDTDAttlist();
45185    test_ret += test_xmlTextWriterStartDTDElement();
45186    test_ret += test_xmlTextWriterStartDTDEntity();
45187    test_ret += test_xmlTextWriterStartDocument();
45188    test_ret += test_xmlTextWriterStartElement();
45189    test_ret += test_xmlTextWriterStartElementNS();
45190    test_ret += test_xmlTextWriterStartPI();
45191    test_ret += test_xmlTextWriterWriteAttribute();
45192    test_ret += test_xmlTextWriterWriteAttributeNS();
45193    test_ret += test_xmlTextWriterWriteBase64();
45194    test_ret += test_xmlTextWriterWriteBinHex();
45195    test_ret += test_xmlTextWriterWriteCDATA();
45196    test_ret += test_xmlTextWriterWriteComment();
45197    test_ret += test_xmlTextWriterWriteDTD();
45198    test_ret += test_xmlTextWriterWriteDTDAttlist();
45199    test_ret += test_xmlTextWriterWriteDTDElement();
45200    test_ret += test_xmlTextWriterWriteDTDEntity();
45201    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45202    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45203    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45204    test_ret += test_xmlTextWriterWriteDTDNotation();
45205    test_ret += test_xmlTextWriterWriteElement();
45206    test_ret += test_xmlTextWriterWriteElementNS();
45207    test_ret += test_xmlTextWriterWriteFormatAttribute();
45208    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45209    test_ret += test_xmlTextWriterWriteFormatCDATA();
45210    test_ret += test_xmlTextWriterWriteFormatComment();
45211    test_ret += test_xmlTextWriterWriteFormatDTD();
45212    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45213    test_ret += test_xmlTextWriterWriteFormatDTDElement();
45214    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45215    test_ret += test_xmlTextWriterWriteFormatElement();
45216    test_ret += test_xmlTextWriterWriteFormatElementNS();
45217    test_ret += test_xmlTextWriterWriteFormatPI();
45218    test_ret += test_xmlTextWriterWriteFormatRaw();
45219    test_ret += test_xmlTextWriterWriteFormatString();
45220    test_ret += test_xmlTextWriterWritePI();
45221    test_ret += test_xmlTextWriterWriteRaw();
45222    test_ret += test_xmlTextWriterWriteRawLen();
45223    test_ret += test_xmlTextWriterWriteString();
45224    test_ret += test_xmlTextWriterWriteVFormatAttribute();
45225    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45226    test_ret += test_xmlTextWriterWriteVFormatCDATA();
45227    test_ret += test_xmlTextWriterWriteVFormatComment();
45228    test_ret += test_xmlTextWriterWriteVFormatDTD();
45229    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45230    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45231    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45232    test_ret += test_xmlTextWriterWriteVFormatElement();
45233    test_ret += test_xmlTextWriterWriteVFormatElementNS();
45234    test_ret += test_xmlTextWriterWriteVFormatPI();
45235    test_ret += test_xmlTextWriterWriteVFormatRaw();
45236    test_ret += test_xmlTextWriterWriteVFormatString();
45237
45238    if (test_ret != 0)
45239	printf("Module xmlwriter: %d errors\n", test_ret);
45240    return(test_ret);
45241}
45242
45243static int
45244test_xmlXPathCastBooleanToNumber(void) {
45245    int test_ret = 0;
45246
45247#if defined(LIBXML_XPATH_ENABLED)
45248    int mem_base;
45249    double ret_val;
45250    int val; /* a boolean */
45251    int n_val;
45252
45253    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45254        mem_base = xmlMemBlocks();
45255        val = gen_int(n_val, 0);
45256
45257        ret_val = xmlXPathCastBooleanToNumber(val);
45258        desret_double(ret_val);
45259        call_tests++;
45260        des_int(n_val, val, 0);
45261        xmlResetLastError();
45262        if (mem_base != xmlMemBlocks()) {
45263            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45264	           xmlMemBlocks() - mem_base);
45265	    test_ret++;
45266            printf(" %d", n_val);
45267            printf("\n");
45268        }
45269    }
45270    function_tests++;
45271#endif
45272
45273    return(test_ret);
45274}
45275
45276
45277static int
45278test_xmlXPathCastBooleanToString(void) {
45279    int test_ret = 0;
45280
45281#if defined(LIBXML_XPATH_ENABLED)
45282    int mem_base;
45283    xmlChar * ret_val;
45284    int val; /* a boolean */
45285    int n_val;
45286
45287    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45288        mem_base = xmlMemBlocks();
45289        val = gen_int(n_val, 0);
45290
45291        ret_val = xmlXPathCastBooleanToString(val);
45292        desret_xmlChar_ptr(ret_val);
45293        call_tests++;
45294        des_int(n_val, val, 0);
45295        xmlResetLastError();
45296        if (mem_base != xmlMemBlocks()) {
45297            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45298	           xmlMemBlocks() - mem_base);
45299	    test_ret++;
45300            printf(" %d", n_val);
45301            printf("\n");
45302        }
45303    }
45304    function_tests++;
45305#endif
45306
45307    return(test_ret);
45308}
45309
45310
45311static int
45312test_xmlXPathCastNodeSetToBoolean(void) {
45313    int test_ret = 0;
45314
45315#if defined(LIBXML_XPATH_ENABLED)
45316    int mem_base;
45317    int ret_val;
45318    xmlNodeSetPtr ns; /* a node-set */
45319    int n_ns;
45320
45321    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45322        mem_base = xmlMemBlocks();
45323        ns = gen_xmlNodeSetPtr(n_ns, 0);
45324
45325        ret_val = xmlXPathCastNodeSetToBoolean(ns);
45326        desret_int(ret_val);
45327        call_tests++;
45328        des_xmlNodeSetPtr(n_ns, ns, 0);
45329        xmlResetLastError();
45330        if (mem_base != xmlMemBlocks()) {
45331            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45332	           xmlMemBlocks() - mem_base);
45333	    test_ret++;
45334            printf(" %d", n_ns);
45335            printf("\n");
45336        }
45337    }
45338    function_tests++;
45339#endif
45340
45341    return(test_ret);
45342}
45343
45344
45345static int
45346test_xmlXPathCastNodeSetToNumber(void) {
45347    int test_ret = 0;
45348
45349#if defined(LIBXML_XPATH_ENABLED)
45350    int mem_base;
45351    double ret_val;
45352    xmlNodeSetPtr ns; /* a node-set */
45353    int n_ns;
45354
45355    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45356        mem_base = xmlMemBlocks();
45357        ns = gen_xmlNodeSetPtr(n_ns, 0);
45358
45359        ret_val = xmlXPathCastNodeSetToNumber(ns);
45360        desret_double(ret_val);
45361        call_tests++;
45362        des_xmlNodeSetPtr(n_ns, ns, 0);
45363        xmlResetLastError();
45364        if (mem_base != xmlMemBlocks()) {
45365            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45366	           xmlMemBlocks() - mem_base);
45367	    test_ret++;
45368            printf(" %d", n_ns);
45369            printf("\n");
45370        }
45371    }
45372    function_tests++;
45373#endif
45374
45375    return(test_ret);
45376}
45377
45378
45379static int
45380test_xmlXPathCastNodeSetToString(void) {
45381    int test_ret = 0;
45382
45383#if defined(LIBXML_XPATH_ENABLED)
45384    int mem_base;
45385    xmlChar * ret_val;
45386    xmlNodeSetPtr ns; /* a node-set */
45387    int n_ns;
45388
45389    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45390        mem_base = xmlMemBlocks();
45391        ns = gen_xmlNodeSetPtr(n_ns, 0);
45392
45393        ret_val = xmlXPathCastNodeSetToString(ns);
45394        desret_xmlChar_ptr(ret_val);
45395        call_tests++;
45396        des_xmlNodeSetPtr(n_ns, ns, 0);
45397        xmlResetLastError();
45398        if (mem_base != xmlMemBlocks()) {
45399            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45400	           xmlMemBlocks() - mem_base);
45401	    test_ret++;
45402            printf(" %d", n_ns);
45403            printf("\n");
45404        }
45405    }
45406    function_tests++;
45407#endif
45408
45409    return(test_ret);
45410}
45411
45412
45413static int
45414test_xmlXPathCastNodeToNumber(void) {
45415    int test_ret = 0;
45416
45417#if defined(LIBXML_XPATH_ENABLED)
45418    int mem_base;
45419    double ret_val;
45420    xmlNodePtr node; /* a node */
45421    int n_node;
45422
45423    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45424        mem_base = xmlMemBlocks();
45425        node = gen_xmlNodePtr(n_node, 0);
45426
45427        ret_val = xmlXPathCastNodeToNumber(node);
45428        desret_double(ret_val);
45429        call_tests++;
45430        des_xmlNodePtr(n_node, node, 0);
45431        xmlResetLastError();
45432        if (mem_base != xmlMemBlocks()) {
45433            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45434	           xmlMemBlocks() - mem_base);
45435	    test_ret++;
45436            printf(" %d", n_node);
45437            printf("\n");
45438        }
45439    }
45440    function_tests++;
45441#endif
45442
45443    return(test_ret);
45444}
45445
45446
45447static int
45448test_xmlXPathCastNodeToString(void) {
45449    int test_ret = 0;
45450
45451#if defined(LIBXML_XPATH_ENABLED)
45452    int mem_base;
45453    xmlChar * ret_val;
45454    xmlNodePtr node; /* a node */
45455    int n_node;
45456
45457    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45458        mem_base = xmlMemBlocks();
45459        node = gen_xmlNodePtr(n_node, 0);
45460
45461        ret_val = xmlXPathCastNodeToString(node);
45462        desret_xmlChar_ptr(ret_val);
45463        call_tests++;
45464        des_xmlNodePtr(n_node, node, 0);
45465        xmlResetLastError();
45466        if (mem_base != xmlMemBlocks()) {
45467            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45468	           xmlMemBlocks() - mem_base);
45469	    test_ret++;
45470            printf(" %d", n_node);
45471            printf("\n");
45472        }
45473    }
45474    function_tests++;
45475#endif
45476
45477    return(test_ret);
45478}
45479
45480
45481static int
45482test_xmlXPathCastNumberToBoolean(void) {
45483    int test_ret = 0;
45484
45485#if defined(LIBXML_XPATH_ENABLED)
45486    int mem_base;
45487    int ret_val;
45488    double val; /* a number */
45489    int n_val;
45490
45491    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45492        mem_base = xmlMemBlocks();
45493        val = gen_double(n_val, 0);
45494
45495        ret_val = xmlXPathCastNumberToBoolean(val);
45496        desret_int(ret_val);
45497        call_tests++;
45498        des_double(n_val, val, 0);
45499        xmlResetLastError();
45500        if (mem_base != xmlMemBlocks()) {
45501            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45502	           xmlMemBlocks() - mem_base);
45503	    test_ret++;
45504            printf(" %d", n_val);
45505            printf("\n");
45506        }
45507    }
45508    function_tests++;
45509#endif
45510
45511    return(test_ret);
45512}
45513
45514
45515static int
45516test_xmlXPathCastNumberToString(void) {
45517    int test_ret = 0;
45518
45519#if defined(LIBXML_XPATH_ENABLED)
45520    int mem_base;
45521    xmlChar * ret_val;
45522    double val; /* a number */
45523    int n_val;
45524
45525    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45526        mem_base = xmlMemBlocks();
45527        val = gen_double(n_val, 0);
45528
45529        ret_val = xmlXPathCastNumberToString(val);
45530        desret_xmlChar_ptr(ret_val);
45531        call_tests++;
45532        des_double(n_val, val, 0);
45533        xmlResetLastError();
45534        if (mem_base != xmlMemBlocks()) {
45535            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45536	           xmlMemBlocks() - mem_base);
45537	    test_ret++;
45538            printf(" %d", n_val);
45539            printf("\n");
45540        }
45541    }
45542    function_tests++;
45543#endif
45544
45545    return(test_ret);
45546}
45547
45548
45549static int
45550test_xmlXPathCastStringToBoolean(void) {
45551    int test_ret = 0;
45552
45553#if defined(LIBXML_XPATH_ENABLED)
45554    int mem_base;
45555    int ret_val;
45556    xmlChar * val; /* a string */
45557    int n_val;
45558
45559    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45560        mem_base = xmlMemBlocks();
45561        val = gen_const_xmlChar_ptr(n_val, 0);
45562
45563        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45564        desret_int(ret_val);
45565        call_tests++;
45566        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45567        xmlResetLastError();
45568        if (mem_base != xmlMemBlocks()) {
45569            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45570	           xmlMemBlocks() - mem_base);
45571	    test_ret++;
45572            printf(" %d", n_val);
45573            printf("\n");
45574        }
45575    }
45576    function_tests++;
45577#endif
45578
45579    return(test_ret);
45580}
45581
45582
45583static int
45584test_xmlXPathCastStringToNumber(void) {
45585    int test_ret = 0;
45586
45587#if defined(LIBXML_XPATH_ENABLED)
45588    int mem_base;
45589    double ret_val;
45590    xmlChar * val; /* a string */
45591    int n_val;
45592
45593    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45594        mem_base = xmlMemBlocks();
45595        val = gen_const_xmlChar_ptr(n_val, 0);
45596
45597        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45598        desret_double(ret_val);
45599        call_tests++;
45600        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45601        xmlResetLastError();
45602        if (mem_base != xmlMemBlocks()) {
45603            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45604	           xmlMemBlocks() - mem_base);
45605	    test_ret++;
45606            printf(" %d", n_val);
45607            printf("\n");
45608        }
45609    }
45610    function_tests++;
45611#endif
45612
45613    return(test_ret);
45614}
45615
45616
45617static int
45618test_xmlXPathCastToBoolean(void) {
45619    int test_ret = 0;
45620
45621#if defined(LIBXML_XPATH_ENABLED)
45622    int mem_base;
45623    int ret_val;
45624    xmlXPathObjectPtr val; /* an XPath object */
45625    int n_val;
45626
45627    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45628        mem_base = xmlMemBlocks();
45629        val = gen_xmlXPathObjectPtr(n_val, 0);
45630
45631        ret_val = xmlXPathCastToBoolean(val);
45632        desret_int(ret_val);
45633        call_tests++;
45634        des_xmlXPathObjectPtr(n_val, val, 0);
45635        xmlResetLastError();
45636        if (mem_base != xmlMemBlocks()) {
45637            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45638	           xmlMemBlocks() - mem_base);
45639	    test_ret++;
45640            printf(" %d", n_val);
45641            printf("\n");
45642        }
45643    }
45644    function_tests++;
45645#endif
45646
45647    return(test_ret);
45648}
45649
45650
45651static int
45652test_xmlXPathCastToNumber(void) {
45653    int test_ret = 0;
45654
45655#if defined(LIBXML_XPATH_ENABLED)
45656    int mem_base;
45657    double ret_val;
45658    xmlXPathObjectPtr val; /* an XPath object */
45659    int n_val;
45660
45661    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45662        mem_base = xmlMemBlocks();
45663        val = gen_xmlXPathObjectPtr(n_val, 0);
45664
45665        ret_val = xmlXPathCastToNumber(val);
45666        desret_double(ret_val);
45667        call_tests++;
45668        des_xmlXPathObjectPtr(n_val, val, 0);
45669        xmlResetLastError();
45670        if (mem_base != xmlMemBlocks()) {
45671            printf("Leak of %d blocks found in xmlXPathCastToNumber",
45672	           xmlMemBlocks() - mem_base);
45673	    test_ret++;
45674            printf(" %d", n_val);
45675            printf("\n");
45676        }
45677    }
45678    function_tests++;
45679#endif
45680
45681    return(test_ret);
45682}
45683
45684
45685static int
45686test_xmlXPathCastToString(void) {
45687    int test_ret = 0;
45688
45689#if defined(LIBXML_XPATH_ENABLED)
45690    int mem_base;
45691    xmlChar * ret_val;
45692    xmlXPathObjectPtr val; /* an XPath object */
45693    int n_val;
45694
45695    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45696        mem_base = xmlMemBlocks();
45697        val = gen_xmlXPathObjectPtr(n_val, 0);
45698
45699        ret_val = xmlXPathCastToString(val);
45700        desret_xmlChar_ptr(ret_val);
45701        call_tests++;
45702        des_xmlXPathObjectPtr(n_val, val, 0);
45703        xmlResetLastError();
45704        if (mem_base != xmlMemBlocks()) {
45705            printf("Leak of %d blocks found in xmlXPathCastToString",
45706	           xmlMemBlocks() - mem_base);
45707	    test_ret++;
45708            printf(" %d", n_val);
45709            printf("\n");
45710        }
45711    }
45712    function_tests++;
45713#endif
45714
45715    return(test_ret);
45716}
45717
45718
45719static int
45720test_xmlXPathCmpNodes(void) {
45721    int test_ret = 0;
45722
45723#if defined(LIBXML_XPATH_ENABLED)
45724    int mem_base;
45725    int ret_val;
45726    xmlNodePtr node1; /* the first node */
45727    int n_node1;
45728    xmlNodePtr node2; /* the second node */
45729    int n_node2;
45730
45731    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45732    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45733        mem_base = xmlMemBlocks();
45734        node1 = gen_xmlNodePtr(n_node1, 0);
45735        node2 = gen_xmlNodePtr(n_node2, 1);
45736
45737        ret_val = xmlXPathCmpNodes(node1, node2);
45738        desret_int(ret_val);
45739        call_tests++;
45740        des_xmlNodePtr(n_node1, node1, 0);
45741        des_xmlNodePtr(n_node2, node2, 1);
45742        xmlResetLastError();
45743        if (mem_base != xmlMemBlocks()) {
45744            printf("Leak of %d blocks found in xmlXPathCmpNodes",
45745	           xmlMemBlocks() - mem_base);
45746	    test_ret++;
45747            printf(" %d", n_node1);
45748            printf(" %d", n_node2);
45749            printf("\n");
45750        }
45751    }
45752    }
45753    function_tests++;
45754#endif
45755
45756    return(test_ret);
45757}
45758
45759
45760static int
45761test_xmlXPathCompile(void) {
45762    int test_ret = 0;
45763
45764
45765    /* missing type support */
45766    return(test_ret);
45767}
45768
45769#ifdef LIBXML_XPATH_ENABLED
45770
45771#define gen_nb_xmlXPathCompExprPtr 1
45772static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45773    return(NULL);
45774}
45775static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45776}
45777#endif
45778
45779#ifdef LIBXML_XPATH_ENABLED
45780
45781#define gen_nb_xmlXPathContextPtr 1
45782static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45783    return(NULL);
45784}
45785static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45786}
45787#endif
45788
45789
45790static int
45791test_xmlXPathCompiledEval(void) {
45792    int test_ret = 0;
45793
45794#if defined(LIBXML_XPATH_ENABLED)
45795    int mem_base;
45796    xmlXPathObjectPtr ret_val;
45797    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45798    int n_comp;
45799    xmlXPathContextPtr ctx; /* the XPath context */
45800    int n_ctx;
45801
45802    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45803    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45804        mem_base = xmlMemBlocks();
45805        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45806        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45807
45808        ret_val = xmlXPathCompiledEval(comp, ctx);
45809        desret_xmlXPathObjectPtr(ret_val);
45810        call_tests++;
45811        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45812        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45813        xmlResetLastError();
45814        if (mem_base != xmlMemBlocks()) {
45815            printf("Leak of %d blocks found in xmlXPathCompiledEval",
45816	           xmlMemBlocks() - mem_base);
45817	    test_ret++;
45818            printf(" %d", n_comp);
45819            printf(" %d", n_ctx);
45820            printf("\n");
45821        }
45822    }
45823    }
45824    function_tests++;
45825#endif
45826
45827    return(test_ret);
45828}
45829
45830
45831static int
45832test_xmlXPathCompiledEvalToBoolean(void) {
45833    int test_ret = 0;
45834
45835#if defined(LIBXML_XPATH_ENABLED)
45836    int mem_base;
45837    int ret_val;
45838    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45839    int n_comp;
45840    xmlXPathContextPtr ctxt; /* the XPath context */
45841    int n_ctxt;
45842
45843    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45844    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45845        mem_base = xmlMemBlocks();
45846        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45847        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
45848
45849        ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
45850        desret_int(ret_val);
45851        call_tests++;
45852        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45853        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
45854        xmlResetLastError();
45855        if (mem_base != xmlMemBlocks()) {
45856            printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
45857	           xmlMemBlocks() - mem_base);
45858	    test_ret++;
45859            printf(" %d", n_comp);
45860            printf(" %d", n_ctxt);
45861            printf("\n");
45862        }
45863    }
45864    }
45865    function_tests++;
45866#endif
45867
45868    return(test_ret);
45869}
45870
45871
45872static int
45873test_xmlXPathContextSetCache(void) {
45874    int test_ret = 0;
45875
45876#if defined(LIBXML_XPATH_ENABLED)
45877    int mem_base;
45878    int ret_val;
45879    xmlXPathContextPtr ctxt; /* the XPath context */
45880    int n_ctxt;
45881    int active; /* enables/disables (creates/frees) the cache */
45882    int n_active;
45883    int value; /* a value with semantics dependant on @options */
45884    int n_value;
45885    int options; /* options (currently only the value 0 is used) */
45886    int n_options;
45887
45888    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45889    for (n_active = 0;n_active < gen_nb_int;n_active++) {
45890    for (n_value = 0;n_value < gen_nb_int;n_value++) {
45891    for (n_options = 0;n_options < gen_nb_int;n_options++) {
45892        mem_base = xmlMemBlocks();
45893        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45894        active = gen_int(n_active, 1);
45895        value = gen_int(n_value, 2);
45896        options = gen_int(n_options, 3);
45897
45898        ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
45899        desret_int(ret_val);
45900        call_tests++;
45901        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45902        des_int(n_active, active, 1);
45903        des_int(n_value, value, 2);
45904        des_int(n_options, options, 3);
45905        xmlResetLastError();
45906        if (mem_base != xmlMemBlocks()) {
45907            printf("Leak of %d blocks found in xmlXPathContextSetCache",
45908	           xmlMemBlocks() - mem_base);
45909	    test_ret++;
45910            printf(" %d", n_ctxt);
45911            printf(" %d", n_active);
45912            printf(" %d", n_value);
45913            printf(" %d", n_options);
45914            printf("\n");
45915        }
45916    }
45917    }
45918    }
45919    }
45920    function_tests++;
45921#endif
45922
45923    return(test_ret);
45924}
45925
45926
45927static int
45928test_xmlXPathConvertBoolean(void) {
45929    int test_ret = 0;
45930
45931#if defined(LIBXML_XPATH_ENABLED)
45932    int mem_base;
45933    xmlXPathObjectPtr ret_val;
45934    xmlXPathObjectPtr val; /* an XPath object */
45935    int n_val;
45936
45937    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45938        mem_base = xmlMemBlocks();
45939        val = gen_xmlXPathObjectPtr(n_val, 0);
45940
45941        ret_val = xmlXPathConvertBoolean(val);
45942        val = NULL;
45943        desret_xmlXPathObjectPtr(ret_val);
45944        call_tests++;
45945        des_xmlXPathObjectPtr(n_val, val, 0);
45946        xmlResetLastError();
45947        if (mem_base != xmlMemBlocks()) {
45948            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
45949	           xmlMemBlocks() - mem_base);
45950	    test_ret++;
45951            printf(" %d", n_val);
45952            printf("\n");
45953        }
45954    }
45955    function_tests++;
45956#endif
45957
45958    return(test_ret);
45959}
45960
45961
45962static int
45963test_xmlXPathConvertNumber(void) {
45964    int test_ret = 0;
45965
45966#if defined(LIBXML_XPATH_ENABLED)
45967    int mem_base;
45968    xmlXPathObjectPtr ret_val;
45969    xmlXPathObjectPtr val; /* an XPath object */
45970    int n_val;
45971
45972    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45973        mem_base = xmlMemBlocks();
45974        val = gen_xmlXPathObjectPtr(n_val, 0);
45975
45976        ret_val = xmlXPathConvertNumber(val);
45977        val = NULL;
45978        desret_xmlXPathObjectPtr(ret_val);
45979        call_tests++;
45980        des_xmlXPathObjectPtr(n_val, val, 0);
45981        xmlResetLastError();
45982        if (mem_base != xmlMemBlocks()) {
45983            printf("Leak of %d blocks found in xmlXPathConvertNumber",
45984	           xmlMemBlocks() - mem_base);
45985	    test_ret++;
45986            printf(" %d", n_val);
45987            printf("\n");
45988        }
45989    }
45990    function_tests++;
45991#endif
45992
45993    return(test_ret);
45994}
45995
45996
45997static int
45998test_xmlXPathConvertString(void) {
45999    int test_ret = 0;
46000
46001#if defined(LIBXML_XPATH_ENABLED)
46002    int mem_base;
46003    xmlXPathObjectPtr ret_val;
46004    xmlXPathObjectPtr val; /* an XPath object */
46005    int n_val;
46006
46007    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46008        mem_base = xmlMemBlocks();
46009        val = gen_xmlXPathObjectPtr(n_val, 0);
46010
46011        ret_val = xmlXPathConvertString(val);
46012        val = NULL;
46013        desret_xmlXPathObjectPtr(ret_val);
46014        call_tests++;
46015        des_xmlXPathObjectPtr(n_val, val, 0);
46016        xmlResetLastError();
46017        if (mem_base != xmlMemBlocks()) {
46018            printf("Leak of %d blocks found in xmlXPathConvertString",
46019	           xmlMemBlocks() - mem_base);
46020	    test_ret++;
46021            printf(" %d", n_val);
46022            printf("\n");
46023        }
46024    }
46025    function_tests++;
46026#endif
46027
46028    return(test_ret);
46029}
46030
46031
46032static int
46033test_xmlXPathCtxtCompile(void) {
46034    int test_ret = 0;
46035
46036
46037    /* missing type support */
46038    return(test_ret);
46039}
46040
46041
46042static int
46043test_xmlXPathEval(void) {
46044    int test_ret = 0;
46045
46046#if defined(LIBXML_XPATH_ENABLED)
46047    int mem_base;
46048    xmlXPathObjectPtr ret_val;
46049    xmlChar * str; /* the XPath expression */
46050    int n_str;
46051    xmlXPathContextPtr ctx; /* the XPath context */
46052    int n_ctx;
46053
46054    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46055    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46056        mem_base = xmlMemBlocks();
46057        str = gen_const_xmlChar_ptr(n_str, 0);
46058        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46059
46060        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46061        desret_xmlXPathObjectPtr(ret_val);
46062        call_tests++;
46063        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46064        des_xmlXPathContextPtr(n_ctx, ctx, 1);
46065        xmlResetLastError();
46066        if (mem_base != xmlMemBlocks()) {
46067            printf("Leak of %d blocks found in xmlXPathEval",
46068	           xmlMemBlocks() - mem_base);
46069	    test_ret++;
46070            printf(" %d", n_str);
46071            printf(" %d", n_ctx);
46072            printf("\n");
46073        }
46074    }
46075    }
46076    function_tests++;
46077#endif
46078
46079    return(test_ret);
46080}
46081
46082
46083static int
46084test_xmlXPathEvalExpression(void) {
46085    int test_ret = 0;
46086
46087#if defined(LIBXML_XPATH_ENABLED)
46088    int mem_base;
46089    xmlXPathObjectPtr ret_val;
46090    xmlChar * str; /* the XPath expression */
46091    int n_str;
46092    xmlXPathContextPtr ctxt; /* the XPath context */
46093    int n_ctxt;
46094
46095    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46096    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46097        mem_base = xmlMemBlocks();
46098        str = gen_const_xmlChar_ptr(n_str, 0);
46099        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46100
46101        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46102        desret_xmlXPathObjectPtr(ret_val);
46103        call_tests++;
46104        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46105        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46106        xmlResetLastError();
46107        if (mem_base != xmlMemBlocks()) {
46108            printf("Leak of %d blocks found in xmlXPathEvalExpression",
46109	           xmlMemBlocks() - mem_base);
46110	    test_ret++;
46111            printf(" %d", n_str);
46112            printf(" %d", n_ctxt);
46113            printf("\n");
46114        }
46115    }
46116    }
46117    function_tests++;
46118#endif
46119
46120    return(test_ret);
46121}
46122
46123
46124static int
46125test_xmlXPathEvalPredicate(void) {
46126    int test_ret = 0;
46127
46128#if defined(LIBXML_XPATH_ENABLED)
46129    int mem_base;
46130    int ret_val;
46131    xmlXPathContextPtr ctxt; /* the XPath context */
46132    int n_ctxt;
46133    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46134    int n_res;
46135
46136    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46137    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46138        mem_base = xmlMemBlocks();
46139        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46140        res = gen_xmlXPathObjectPtr(n_res, 1);
46141
46142        ret_val = xmlXPathEvalPredicate(ctxt, res);
46143        desret_int(ret_val);
46144        call_tests++;
46145        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46146        des_xmlXPathObjectPtr(n_res, res, 1);
46147        xmlResetLastError();
46148        if (mem_base != xmlMemBlocks()) {
46149            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46150	           xmlMemBlocks() - mem_base);
46151	    test_ret++;
46152            printf(" %d", n_ctxt);
46153            printf(" %d", n_res);
46154            printf("\n");
46155        }
46156    }
46157    }
46158    function_tests++;
46159#endif
46160
46161    return(test_ret);
46162}
46163
46164
46165static int
46166test_xmlXPathInit(void) {
46167    int test_ret = 0;
46168
46169#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46170    int mem_base;
46171
46172        mem_base = xmlMemBlocks();
46173
46174        xmlXPathInit();
46175        call_tests++;
46176        xmlResetLastError();
46177        if (mem_base != xmlMemBlocks()) {
46178            printf("Leak of %d blocks found in xmlXPathInit",
46179	           xmlMemBlocks() - mem_base);
46180	    test_ret++;
46181            printf("\n");
46182        }
46183    function_tests++;
46184#endif
46185
46186    return(test_ret);
46187}
46188
46189
46190static int
46191test_xmlXPathIsInf(void) {
46192    int test_ret = 0;
46193
46194#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46195    int mem_base;
46196    int ret_val;
46197    double val; /* a double value */
46198    int n_val;
46199
46200    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46201        mem_base = xmlMemBlocks();
46202        val = gen_double(n_val, 0);
46203
46204        ret_val = xmlXPathIsInf(val);
46205        desret_int(ret_val);
46206        call_tests++;
46207        des_double(n_val, val, 0);
46208        xmlResetLastError();
46209        if (mem_base != xmlMemBlocks()) {
46210            printf("Leak of %d blocks found in xmlXPathIsInf",
46211	           xmlMemBlocks() - mem_base);
46212	    test_ret++;
46213            printf(" %d", n_val);
46214            printf("\n");
46215        }
46216    }
46217    function_tests++;
46218#endif
46219
46220    return(test_ret);
46221}
46222
46223
46224static int
46225test_xmlXPathIsNaN(void) {
46226    int test_ret = 0;
46227
46228#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46229    int mem_base;
46230    int ret_val;
46231    double val; /* a double value */
46232    int n_val;
46233
46234    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46235        mem_base = xmlMemBlocks();
46236        val = gen_double(n_val, 0);
46237
46238        ret_val = xmlXPathIsNaN(val);
46239        desret_int(ret_val);
46240        call_tests++;
46241        des_double(n_val, val, 0);
46242        xmlResetLastError();
46243        if (mem_base != xmlMemBlocks()) {
46244            printf("Leak of %d blocks found in xmlXPathIsNaN",
46245	           xmlMemBlocks() - mem_base);
46246	    test_ret++;
46247            printf(" %d", n_val);
46248            printf("\n");
46249        }
46250    }
46251    function_tests++;
46252#endif
46253
46254    return(test_ret);
46255}
46256
46257
46258static int
46259test_xmlXPathNewContext(void) {
46260    int test_ret = 0;
46261
46262
46263    /* missing type support */
46264    return(test_ret);
46265}
46266
46267
46268static int
46269test_xmlXPathNodeSetCreate(void) {
46270    int test_ret = 0;
46271
46272#if defined(LIBXML_XPATH_ENABLED)
46273    int mem_base;
46274    xmlNodeSetPtr ret_val;
46275    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46276    int n_val;
46277
46278    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46279        mem_base = xmlMemBlocks();
46280        val = gen_xmlNodePtr(n_val, 0);
46281
46282        ret_val = xmlXPathNodeSetCreate(val);
46283        desret_xmlNodeSetPtr(ret_val);
46284        call_tests++;
46285        des_xmlNodePtr(n_val, val, 0);
46286        xmlResetLastError();
46287        if (mem_base != xmlMemBlocks()) {
46288            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46289	           xmlMemBlocks() - mem_base);
46290	    test_ret++;
46291            printf(" %d", n_val);
46292            printf("\n");
46293        }
46294    }
46295    function_tests++;
46296#endif
46297
46298    return(test_ret);
46299}
46300
46301
46302static int
46303test_xmlXPathObjectCopy(void) {
46304    int test_ret = 0;
46305
46306#if defined(LIBXML_XPATH_ENABLED)
46307    int mem_base;
46308    xmlXPathObjectPtr ret_val;
46309    xmlXPathObjectPtr val; /* the original object */
46310    int n_val;
46311
46312    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46313        mem_base = xmlMemBlocks();
46314        val = gen_xmlXPathObjectPtr(n_val, 0);
46315
46316        ret_val = xmlXPathObjectCopy(val);
46317        desret_xmlXPathObjectPtr(ret_val);
46318        call_tests++;
46319        des_xmlXPathObjectPtr(n_val, val, 0);
46320        xmlResetLastError();
46321        if (mem_base != xmlMemBlocks()) {
46322            printf("Leak of %d blocks found in xmlXPathObjectCopy",
46323	           xmlMemBlocks() - mem_base);
46324	    test_ret++;
46325            printf(" %d", n_val);
46326            printf("\n");
46327        }
46328    }
46329    function_tests++;
46330#endif
46331
46332    return(test_ret);
46333}
46334
46335
46336static int
46337test_xmlXPathOrderDocElems(void) {
46338    int test_ret = 0;
46339
46340#if defined(LIBXML_XPATH_ENABLED)
46341    int mem_base;
46342    long ret_val;
46343    xmlDocPtr doc; /* an input document */
46344    int n_doc;
46345
46346    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46347        mem_base = xmlMemBlocks();
46348        doc = gen_xmlDocPtr(n_doc, 0);
46349
46350        ret_val = xmlXPathOrderDocElems(doc);
46351        desret_long(ret_val);
46352        call_tests++;
46353        des_xmlDocPtr(n_doc, doc, 0);
46354        xmlResetLastError();
46355        if (mem_base != xmlMemBlocks()) {
46356            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46357	           xmlMemBlocks() - mem_base);
46358	    test_ret++;
46359            printf(" %d", n_doc);
46360            printf("\n");
46361        }
46362    }
46363    function_tests++;
46364#endif
46365
46366    return(test_ret);
46367}
46368
46369static int
46370test_xpath(void) {
46371    int test_ret = 0;
46372
46373    if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46374    test_ret += test_xmlXPathCastBooleanToNumber();
46375    test_ret += test_xmlXPathCastBooleanToString();
46376    test_ret += test_xmlXPathCastNodeSetToBoolean();
46377    test_ret += test_xmlXPathCastNodeSetToNumber();
46378    test_ret += test_xmlXPathCastNodeSetToString();
46379    test_ret += test_xmlXPathCastNodeToNumber();
46380    test_ret += test_xmlXPathCastNodeToString();
46381    test_ret += test_xmlXPathCastNumberToBoolean();
46382    test_ret += test_xmlXPathCastNumberToString();
46383    test_ret += test_xmlXPathCastStringToBoolean();
46384    test_ret += test_xmlXPathCastStringToNumber();
46385    test_ret += test_xmlXPathCastToBoolean();
46386    test_ret += test_xmlXPathCastToNumber();
46387    test_ret += test_xmlXPathCastToString();
46388    test_ret += test_xmlXPathCmpNodes();
46389    test_ret += test_xmlXPathCompile();
46390    test_ret += test_xmlXPathCompiledEval();
46391    test_ret += test_xmlXPathCompiledEvalToBoolean();
46392    test_ret += test_xmlXPathContextSetCache();
46393    test_ret += test_xmlXPathConvertBoolean();
46394    test_ret += test_xmlXPathConvertNumber();
46395    test_ret += test_xmlXPathConvertString();
46396    test_ret += test_xmlXPathCtxtCompile();
46397    test_ret += test_xmlXPathEval();
46398    test_ret += test_xmlXPathEvalExpression();
46399    test_ret += test_xmlXPathEvalPredicate();
46400    test_ret += test_xmlXPathInit();
46401    test_ret += test_xmlXPathIsInf();
46402    test_ret += test_xmlXPathIsNaN();
46403    test_ret += test_xmlXPathNewContext();
46404    test_ret += test_xmlXPathNodeSetCreate();
46405    test_ret += test_xmlXPathObjectCopy();
46406    test_ret += test_xmlXPathOrderDocElems();
46407
46408    if (test_ret != 0)
46409	printf("Module xpath: %d errors\n", test_ret);
46410    return(test_ret);
46411}
46412#ifdef LIBXML_XPATH_ENABLED
46413
46414#define gen_nb_xmlXPathParserContextPtr 1
46415static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46416    return(NULL);
46417}
46418static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46419}
46420#endif
46421
46422
46423static int
46424test_valuePop(void) {
46425    int test_ret = 0;
46426
46427#if defined(LIBXML_XPATH_ENABLED)
46428    int mem_base;
46429    xmlXPathObjectPtr ret_val;
46430    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46431    int n_ctxt;
46432
46433    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46434        mem_base = xmlMemBlocks();
46435        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46436
46437        ret_val = valuePop(ctxt);
46438        desret_xmlXPathObjectPtr(ret_val);
46439        call_tests++;
46440        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46441        xmlResetLastError();
46442        if (mem_base != xmlMemBlocks()) {
46443            printf("Leak of %d blocks found in valuePop",
46444	           xmlMemBlocks() - mem_base);
46445	    test_ret++;
46446            printf(" %d", n_ctxt);
46447            printf("\n");
46448        }
46449    }
46450    function_tests++;
46451#endif
46452
46453    return(test_ret);
46454}
46455
46456
46457static int
46458test_valuePush(void) {
46459    int test_ret = 0;
46460
46461#if defined(LIBXML_XPATH_ENABLED)
46462    int mem_base;
46463    int ret_val;
46464    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46465    int n_ctxt;
46466    xmlXPathObjectPtr value; /* the XPath object */
46467    int n_value;
46468
46469    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46470    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46471        mem_base = xmlMemBlocks();
46472        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46473        value = gen_xmlXPathObjectPtr(n_value, 1);
46474
46475        ret_val = valuePush(ctxt, value);
46476        desret_int(ret_val);
46477        call_tests++;
46478        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46479        des_xmlXPathObjectPtr(n_value, value, 1);
46480        xmlResetLastError();
46481        if (mem_base != xmlMemBlocks()) {
46482            printf("Leak of %d blocks found in valuePush",
46483	           xmlMemBlocks() - mem_base);
46484	    test_ret++;
46485            printf(" %d", n_ctxt);
46486            printf(" %d", n_value);
46487            printf("\n");
46488        }
46489    }
46490    }
46491    function_tests++;
46492#endif
46493
46494    return(test_ret);
46495}
46496
46497
46498static int
46499test_xmlXPathAddValues(void) {
46500    int test_ret = 0;
46501
46502#if defined(LIBXML_XPATH_ENABLED)
46503    int mem_base;
46504    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46505    int n_ctxt;
46506
46507    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46508        mem_base = xmlMemBlocks();
46509        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46510
46511        xmlXPathAddValues(ctxt);
46512        call_tests++;
46513        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46514        xmlResetLastError();
46515        if (mem_base != xmlMemBlocks()) {
46516            printf("Leak of %d blocks found in xmlXPathAddValues",
46517	           xmlMemBlocks() - mem_base);
46518	    test_ret++;
46519            printf(" %d", n_ctxt);
46520            printf("\n");
46521        }
46522    }
46523    function_tests++;
46524#endif
46525
46526    return(test_ret);
46527}
46528
46529
46530static int
46531test_xmlXPathBooleanFunction(void) {
46532    int test_ret = 0;
46533
46534#if defined(LIBXML_XPATH_ENABLED)
46535    int mem_base;
46536    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46537    int n_ctxt;
46538    int nargs; /* the number of arguments */
46539    int n_nargs;
46540
46541    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46542    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46543        mem_base = xmlMemBlocks();
46544        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46545        nargs = gen_int(n_nargs, 1);
46546
46547        xmlXPathBooleanFunction(ctxt, nargs);
46548        call_tests++;
46549        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46550        des_int(n_nargs, nargs, 1);
46551        xmlResetLastError();
46552        if (mem_base != xmlMemBlocks()) {
46553            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46554	           xmlMemBlocks() - mem_base);
46555	    test_ret++;
46556            printf(" %d", n_ctxt);
46557            printf(" %d", n_nargs);
46558            printf("\n");
46559        }
46560    }
46561    }
46562    function_tests++;
46563#endif
46564
46565    return(test_ret);
46566}
46567
46568
46569static int
46570test_xmlXPathCeilingFunction(void) {
46571    int test_ret = 0;
46572
46573#if defined(LIBXML_XPATH_ENABLED)
46574    int mem_base;
46575    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46576    int n_ctxt;
46577    int nargs; /* the number of arguments */
46578    int n_nargs;
46579
46580    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46581    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46582        mem_base = xmlMemBlocks();
46583        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46584        nargs = gen_int(n_nargs, 1);
46585
46586        xmlXPathCeilingFunction(ctxt, nargs);
46587        call_tests++;
46588        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46589        des_int(n_nargs, nargs, 1);
46590        xmlResetLastError();
46591        if (mem_base != xmlMemBlocks()) {
46592            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46593	           xmlMemBlocks() - mem_base);
46594	    test_ret++;
46595            printf(" %d", n_ctxt);
46596            printf(" %d", n_nargs);
46597            printf("\n");
46598        }
46599    }
46600    }
46601    function_tests++;
46602#endif
46603
46604    return(test_ret);
46605}
46606
46607
46608static int
46609test_xmlXPathCompareValues(void) {
46610    int test_ret = 0;
46611
46612#if defined(LIBXML_XPATH_ENABLED)
46613    int mem_base;
46614    int ret_val;
46615    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46616    int n_ctxt;
46617    int inf; /* less than (1) or greater than (0) */
46618    int n_inf;
46619    int strict; /* is the comparison strict */
46620    int n_strict;
46621
46622    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46623    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46624    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46625        mem_base = xmlMemBlocks();
46626        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46627        inf = gen_int(n_inf, 1);
46628        strict = gen_int(n_strict, 2);
46629
46630        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46631        desret_int(ret_val);
46632        call_tests++;
46633        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46634        des_int(n_inf, inf, 1);
46635        des_int(n_strict, strict, 2);
46636        xmlResetLastError();
46637        if (mem_base != xmlMemBlocks()) {
46638            printf("Leak of %d blocks found in xmlXPathCompareValues",
46639	           xmlMemBlocks() - mem_base);
46640	    test_ret++;
46641            printf(" %d", n_ctxt);
46642            printf(" %d", n_inf);
46643            printf(" %d", n_strict);
46644            printf("\n");
46645        }
46646    }
46647    }
46648    }
46649    function_tests++;
46650#endif
46651
46652    return(test_ret);
46653}
46654
46655
46656static int
46657test_xmlXPathConcatFunction(void) {
46658    int test_ret = 0;
46659
46660#if defined(LIBXML_XPATH_ENABLED)
46661    int mem_base;
46662    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46663    int n_ctxt;
46664    int nargs; /* the number of arguments */
46665    int n_nargs;
46666
46667    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46668    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46669        mem_base = xmlMemBlocks();
46670        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46671        nargs = gen_int(n_nargs, 1);
46672
46673        xmlXPathConcatFunction(ctxt, nargs);
46674        call_tests++;
46675        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46676        des_int(n_nargs, nargs, 1);
46677        xmlResetLastError();
46678        if (mem_base != xmlMemBlocks()) {
46679            printf("Leak of %d blocks found in xmlXPathConcatFunction",
46680	           xmlMemBlocks() - mem_base);
46681	    test_ret++;
46682            printf(" %d", n_ctxt);
46683            printf(" %d", n_nargs);
46684            printf("\n");
46685        }
46686    }
46687    }
46688    function_tests++;
46689#endif
46690
46691    return(test_ret);
46692}
46693
46694
46695static int
46696test_xmlXPathContainsFunction(void) {
46697    int test_ret = 0;
46698
46699#if defined(LIBXML_XPATH_ENABLED)
46700    int mem_base;
46701    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46702    int n_ctxt;
46703    int nargs; /* the number of arguments */
46704    int n_nargs;
46705
46706    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46707    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46708        mem_base = xmlMemBlocks();
46709        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46710        nargs = gen_int(n_nargs, 1);
46711
46712        xmlXPathContainsFunction(ctxt, nargs);
46713        call_tests++;
46714        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46715        des_int(n_nargs, nargs, 1);
46716        xmlResetLastError();
46717        if (mem_base != xmlMemBlocks()) {
46718            printf("Leak of %d blocks found in xmlXPathContainsFunction",
46719	           xmlMemBlocks() - mem_base);
46720	    test_ret++;
46721            printf(" %d", n_ctxt);
46722            printf(" %d", n_nargs);
46723            printf("\n");
46724        }
46725    }
46726    }
46727    function_tests++;
46728#endif
46729
46730    return(test_ret);
46731}
46732
46733
46734static int
46735test_xmlXPathCountFunction(void) {
46736    int test_ret = 0;
46737
46738#if defined(LIBXML_XPATH_ENABLED)
46739    int mem_base;
46740    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46741    int n_ctxt;
46742    int nargs; /* the number of arguments */
46743    int n_nargs;
46744
46745    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46746    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46747        mem_base = xmlMemBlocks();
46748        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46749        nargs = gen_int(n_nargs, 1);
46750
46751        xmlXPathCountFunction(ctxt, nargs);
46752        call_tests++;
46753        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46754        des_int(n_nargs, nargs, 1);
46755        xmlResetLastError();
46756        if (mem_base != xmlMemBlocks()) {
46757            printf("Leak of %d blocks found in xmlXPathCountFunction",
46758	           xmlMemBlocks() - mem_base);
46759	    test_ret++;
46760            printf(" %d", n_ctxt);
46761            printf(" %d", n_nargs);
46762            printf("\n");
46763        }
46764    }
46765    }
46766    function_tests++;
46767#endif
46768
46769    return(test_ret);
46770}
46771
46772
46773static int
46774test_xmlXPathDebugDumpCompExpr(void) {
46775    int test_ret = 0;
46776
46777#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46778    int mem_base;
46779    FILE * output; /* the FILE * for the output */
46780    int n_output;
46781    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46782    int n_comp;
46783    int depth; /* the indentation level. */
46784    int n_depth;
46785
46786    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46787    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46788    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46789        mem_base = xmlMemBlocks();
46790        output = gen_FILE_ptr(n_output, 0);
46791        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46792        depth = gen_int(n_depth, 2);
46793
46794        xmlXPathDebugDumpCompExpr(output, comp, depth);
46795        call_tests++;
46796        des_FILE_ptr(n_output, output, 0);
46797        des_xmlXPathCompExprPtr(n_comp, comp, 1);
46798        des_int(n_depth, depth, 2);
46799        xmlResetLastError();
46800        if (mem_base != xmlMemBlocks()) {
46801            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46802	           xmlMemBlocks() - mem_base);
46803	    test_ret++;
46804            printf(" %d", n_output);
46805            printf(" %d", n_comp);
46806            printf(" %d", n_depth);
46807            printf("\n");
46808        }
46809    }
46810    }
46811    }
46812    function_tests++;
46813#endif
46814
46815    return(test_ret);
46816}
46817
46818
46819static int
46820test_xmlXPathDebugDumpObject(void) {
46821    int test_ret = 0;
46822
46823#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46824    int mem_base;
46825    FILE * output; /* the FILE * to dump the output */
46826    int n_output;
46827    xmlXPathObjectPtr cur; /* the object to inspect */
46828    int n_cur;
46829    int depth; /* indentation level */
46830    int n_depth;
46831
46832    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46833    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
46834    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46835        mem_base = xmlMemBlocks();
46836        output = gen_FILE_ptr(n_output, 0);
46837        cur = gen_xmlXPathObjectPtr(n_cur, 1);
46838        depth = gen_int(n_depth, 2);
46839
46840        xmlXPathDebugDumpObject(output, cur, depth);
46841        call_tests++;
46842        des_FILE_ptr(n_output, output, 0);
46843        des_xmlXPathObjectPtr(n_cur, cur, 1);
46844        des_int(n_depth, depth, 2);
46845        xmlResetLastError();
46846        if (mem_base != xmlMemBlocks()) {
46847            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
46848	           xmlMemBlocks() - mem_base);
46849	    test_ret++;
46850            printf(" %d", n_output);
46851            printf(" %d", n_cur);
46852            printf(" %d", n_depth);
46853            printf("\n");
46854        }
46855    }
46856    }
46857    }
46858    function_tests++;
46859#endif
46860
46861    return(test_ret);
46862}
46863
46864
46865static int
46866test_xmlXPathDifference(void) {
46867    int test_ret = 0;
46868
46869#if defined(LIBXML_XPATH_ENABLED)
46870    int mem_base;
46871    xmlNodeSetPtr ret_val;
46872    xmlNodeSetPtr nodes1; /* a node-set */
46873    int n_nodes1;
46874    xmlNodeSetPtr nodes2; /* a node-set */
46875    int n_nodes2;
46876
46877    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46878    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46879        mem_base = xmlMemBlocks();
46880        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46881        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46882
46883        ret_val = xmlXPathDifference(nodes1, nodes2);
46884        desret_xmlNodeSetPtr(ret_val);
46885        call_tests++;
46886        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46887        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46888        xmlResetLastError();
46889        if (mem_base != xmlMemBlocks()) {
46890            printf("Leak of %d blocks found in xmlXPathDifference",
46891	           xmlMemBlocks() - mem_base);
46892	    test_ret++;
46893            printf(" %d", n_nodes1);
46894            printf(" %d", n_nodes2);
46895            printf("\n");
46896        }
46897    }
46898    }
46899    function_tests++;
46900#endif
46901
46902    return(test_ret);
46903}
46904
46905
46906static int
46907test_xmlXPathDistinct(void) {
46908    int test_ret = 0;
46909
46910#if defined(LIBXML_XPATH_ENABLED)
46911    int mem_base;
46912    xmlNodeSetPtr ret_val;
46913    xmlNodeSetPtr nodes; /* a node-set */
46914    int n_nodes;
46915
46916    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46917        mem_base = xmlMemBlocks();
46918        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46919
46920        ret_val = xmlXPathDistinct(nodes);
46921        desret_xmlNodeSetPtr(ret_val);
46922        call_tests++;
46923        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46924        xmlResetLastError();
46925        if (mem_base != xmlMemBlocks()) {
46926            printf("Leak of %d blocks found in xmlXPathDistinct",
46927	           xmlMemBlocks() - mem_base);
46928	    test_ret++;
46929            printf(" %d", n_nodes);
46930            printf("\n");
46931        }
46932    }
46933    function_tests++;
46934#endif
46935
46936    return(test_ret);
46937}
46938
46939
46940static int
46941test_xmlXPathDistinctSorted(void) {
46942    int test_ret = 0;
46943
46944#if defined(LIBXML_XPATH_ENABLED)
46945    int mem_base;
46946    xmlNodeSetPtr ret_val;
46947    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46948    int n_nodes;
46949
46950    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46951        mem_base = xmlMemBlocks();
46952        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46953
46954        ret_val = xmlXPathDistinctSorted(nodes);
46955        desret_xmlNodeSetPtr(ret_val);
46956        call_tests++;
46957        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46958        xmlResetLastError();
46959        if (mem_base != xmlMemBlocks()) {
46960            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
46961	           xmlMemBlocks() - mem_base);
46962	    test_ret++;
46963            printf(" %d", n_nodes);
46964            printf("\n");
46965        }
46966    }
46967    function_tests++;
46968#endif
46969
46970    return(test_ret);
46971}
46972
46973
46974static int
46975test_xmlXPathDivValues(void) {
46976    int test_ret = 0;
46977
46978#if defined(LIBXML_XPATH_ENABLED)
46979    int mem_base;
46980    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46981    int n_ctxt;
46982
46983    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46984        mem_base = xmlMemBlocks();
46985        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46986
46987        xmlXPathDivValues(ctxt);
46988        call_tests++;
46989        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46990        xmlResetLastError();
46991        if (mem_base != xmlMemBlocks()) {
46992            printf("Leak of %d blocks found in xmlXPathDivValues",
46993	           xmlMemBlocks() - mem_base);
46994	    test_ret++;
46995            printf(" %d", n_ctxt);
46996            printf("\n");
46997        }
46998    }
46999    function_tests++;
47000#endif
47001
47002    return(test_ret);
47003}
47004
47005
47006static int
47007test_xmlXPathEqualValues(void) {
47008    int test_ret = 0;
47009
47010#if defined(LIBXML_XPATH_ENABLED)
47011    int mem_base;
47012    int ret_val;
47013    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47014    int n_ctxt;
47015
47016    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47017        mem_base = xmlMemBlocks();
47018        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47019
47020        ret_val = xmlXPathEqualValues(ctxt);
47021        desret_int(ret_val);
47022        call_tests++;
47023        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47024        xmlResetLastError();
47025        if (mem_base != xmlMemBlocks()) {
47026            printf("Leak of %d blocks found in xmlXPathEqualValues",
47027	           xmlMemBlocks() - mem_base);
47028	    test_ret++;
47029            printf(" %d", n_ctxt);
47030            printf("\n");
47031        }
47032    }
47033    function_tests++;
47034#endif
47035
47036    return(test_ret);
47037}
47038
47039
47040static int
47041test_xmlXPathErr(void) {
47042    int test_ret = 0;
47043
47044#if defined(LIBXML_XPATH_ENABLED)
47045    int mem_base;
47046    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47047    int n_ctxt;
47048    int error; /* the error code */
47049    int n_error;
47050
47051    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47052    for (n_error = 0;n_error < gen_nb_int;n_error++) {
47053        mem_base = xmlMemBlocks();
47054        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47055        error = gen_int(n_error, 1);
47056
47057        xmlXPathErr(ctxt, error);
47058        call_tests++;
47059        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47060        des_int(n_error, error, 1);
47061        xmlResetLastError();
47062        if (mem_base != xmlMemBlocks()) {
47063            printf("Leak of %d blocks found in xmlXPathErr",
47064	           xmlMemBlocks() - mem_base);
47065	    test_ret++;
47066            printf(" %d", n_ctxt);
47067            printf(" %d", n_error);
47068            printf("\n");
47069        }
47070    }
47071    }
47072    function_tests++;
47073#endif
47074
47075    return(test_ret);
47076}
47077
47078
47079static int
47080test_xmlXPathEvalExpr(void) {
47081    int test_ret = 0;
47082
47083#if defined(LIBXML_XPATH_ENABLED)
47084    int mem_base;
47085    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47086    int n_ctxt;
47087
47088    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47089        mem_base = xmlMemBlocks();
47090        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47091
47092        xmlXPathEvalExpr(ctxt);
47093        call_tests++;
47094        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47095        xmlResetLastError();
47096        if (mem_base != xmlMemBlocks()) {
47097            printf("Leak of %d blocks found in xmlXPathEvalExpr",
47098	           xmlMemBlocks() - mem_base);
47099	    test_ret++;
47100            printf(" %d", n_ctxt);
47101            printf("\n");
47102        }
47103    }
47104    function_tests++;
47105#endif
47106
47107    return(test_ret);
47108}
47109
47110
47111static int
47112test_xmlXPathEvaluatePredicateResult(void) {
47113    int test_ret = 0;
47114
47115#if defined(LIBXML_XPATH_ENABLED)
47116    int mem_base;
47117    int ret_val;
47118    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47119    int n_ctxt;
47120    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47121    int n_res;
47122
47123    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47124    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47125        mem_base = xmlMemBlocks();
47126        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47127        res = gen_xmlXPathObjectPtr(n_res, 1);
47128
47129        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47130        desret_int(ret_val);
47131        call_tests++;
47132        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47133        des_xmlXPathObjectPtr(n_res, res, 1);
47134        xmlResetLastError();
47135        if (mem_base != xmlMemBlocks()) {
47136            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47137	           xmlMemBlocks() - mem_base);
47138	    test_ret++;
47139            printf(" %d", n_ctxt);
47140            printf(" %d", n_res);
47141            printf("\n");
47142        }
47143    }
47144    }
47145    function_tests++;
47146#endif
47147
47148    return(test_ret);
47149}
47150
47151
47152static int
47153test_xmlXPathFalseFunction(void) {
47154    int test_ret = 0;
47155
47156#if defined(LIBXML_XPATH_ENABLED)
47157    int mem_base;
47158    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47159    int n_ctxt;
47160    int nargs; /* the number of arguments */
47161    int n_nargs;
47162
47163    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47164    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47165        mem_base = xmlMemBlocks();
47166        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47167        nargs = gen_int(n_nargs, 1);
47168
47169        xmlXPathFalseFunction(ctxt, nargs);
47170        call_tests++;
47171        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47172        des_int(n_nargs, nargs, 1);
47173        xmlResetLastError();
47174        if (mem_base != xmlMemBlocks()) {
47175            printf("Leak of %d blocks found in xmlXPathFalseFunction",
47176	           xmlMemBlocks() - mem_base);
47177	    test_ret++;
47178            printf(" %d", n_ctxt);
47179            printf(" %d", n_nargs);
47180            printf("\n");
47181        }
47182    }
47183    }
47184    function_tests++;
47185#endif
47186
47187    return(test_ret);
47188}
47189
47190
47191static int
47192test_xmlXPathFloorFunction(void) {
47193    int test_ret = 0;
47194
47195#if defined(LIBXML_XPATH_ENABLED)
47196    int mem_base;
47197    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47198    int n_ctxt;
47199    int nargs; /* the number of arguments */
47200    int n_nargs;
47201
47202    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47203    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47204        mem_base = xmlMemBlocks();
47205        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47206        nargs = gen_int(n_nargs, 1);
47207
47208        xmlXPathFloorFunction(ctxt, nargs);
47209        call_tests++;
47210        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47211        des_int(n_nargs, nargs, 1);
47212        xmlResetLastError();
47213        if (mem_base != xmlMemBlocks()) {
47214            printf("Leak of %d blocks found in xmlXPathFloorFunction",
47215	           xmlMemBlocks() - mem_base);
47216	    test_ret++;
47217            printf(" %d", n_ctxt);
47218            printf(" %d", n_nargs);
47219            printf("\n");
47220        }
47221    }
47222    }
47223    function_tests++;
47224#endif
47225
47226    return(test_ret);
47227}
47228
47229
47230static int
47231test_xmlXPathFunctionLookup(void) {
47232    int test_ret = 0;
47233
47234
47235    /* missing type support */
47236    return(test_ret);
47237}
47238
47239
47240static int
47241test_xmlXPathFunctionLookupNS(void) {
47242    int test_ret = 0;
47243
47244
47245    /* missing type support */
47246    return(test_ret);
47247}
47248
47249
47250static int
47251test_xmlXPathHasSameNodes(void) {
47252    int test_ret = 0;
47253
47254#if defined(LIBXML_XPATH_ENABLED)
47255    int mem_base;
47256    int ret_val;
47257    xmlNodeSetPtr nodes1; /* a node-set */
47258    int n_nodes1;
47259    xmlNodeSetPtr nodes2; /* a node-set */
47260    int n_nodes2;
47261
47262    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47263    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47264        mem_base = xmlMemBlocks();
47265        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47266        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47267
47268        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47269        desret_int(ret_val);
47270        call_tests++;
47271        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47272        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47273        xmlResetLastError();
47274        if (mem_base != xmlMemBlocks()) {
47275            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47276	           xmlMemBlocks() - mem_base);
47277	    test_ret++;
47278            printf(" %d", n_nodes1);
47279            printf(" %d", n_nodes2);
47280            printf("\n");
47281        }
47282    }
47283    }
47284    function_tests++;
47285#endif
47286
47287    return(test_ret);
47288}
47289
47290
47291static int
47292test_xmlXPathIdFunction(void) {
47293    int test_ret = 0;
47294
47295#if defined(LIBXML_XPATH_ENABLED)
47296    int mem_base;
47297    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47298    int n_ctxt;
47299    int nargs; /* the number of arguments */
47300    int n_nargs;
47301
47302    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47303    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47304        mem_base = xmlMemBlocks();
47305        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47306        nargs = gen_int(n_nargs, 1);
47307
47308        xmlXPathIdFunction(ctxt, nargs);
47309        call_tests++;
47310        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47311        des_int(n_nargs, nargs, 1);
47312        xmlResetLastError();
47313        if (mem_base != xmlMemBlocks()) {
47314            printf("Leak of %d blocks found in xmlXPathIdFunction",
47315	           xmlMemBlocks() - mem_base);
47316	    test_ret++;
47317            printf(" %d", n_ctxt);
47318            printf(" %d", n_nargs);
47319            printf("\n");
47320        }
47321    }
47322    }
47323    function_tests++;
47324#endif
47325
47326    return(test_ret);
47327}
47328
47329
47330static int
47331test_xmlXPathIntersection(void) {
47332    int test_ret = 0;
47333
47334#if defined(LIBXML_XPATH_ENABLED)
47335    int mem_base;
47336    xmlNodeSetPtr ret_val;
47337    xmlNodeSetPtr nodes1; /* a node-set */
47338    int n_nodes1;
47339    xmlNodeSetPtr nodes2; /* a node-set */
47340    int n_nodes2;
47341
47342    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47343    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47344        mem_base = xmlMemBlocks();
47345        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47346        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47347
47348        ret_val = xmlXPathIntersection(nodes1, nodes2);
47349        desret_xmlNodeSetPtr(ret_val);
47350        call_tests++;
47351        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47352        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47353        xmlResetLastError();
47354        if (mem_base != xmlMemBlocks()) {
47355            printf("Leak of %d blocks found in xmlXPathIntersection",
47356	           xmlMemBlocks() - mem_base);
47357	    test_ret++;
47358            printf(" %d", n_nodes1);
47359            printf(" %d", n_nodes2);
47360            printf("\n");
47361        }
47362    }
47363    }
47364    function_tests++;
47365#endif
47366
47367    return(test_ret);
47368}
47369
47370
47371static int
47372test_xmlXPathIsNodeType(void) {
47373    int test_ret = 0;
47374
47375#if defined(LIBXML_XPATH_ENABLED)
47376    int mem_base;
47377    int ret_val;
47378    xmlChar * name; /* a name string */
47379    int n_name;
47380
47381    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47382        mem_base = xmlMemBlocks();
47383        name = gen_const_xmlChar_ptr(n_name, 0);
47384
47385        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47386        desret_int(ret_val);
47387        call_tests++;
47388        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47389        xmlResetLastError();
47390        if (mem_base != xmlMemBlocks()) {
47391            printf("Leak of %d blocks found in xmlXPathIsNodeType",
47392	           xmlMemBlocks() - mem_base);
47393	    test_ret++;
47394            printf(" %d", n_name);
47395            printf("\n");
47396        }
47397    }
47398    function_tests++;
47399#endif
47400
47401    return(test_ret);
47402}
47403
47404
47405static int
47406test_xmlXPathLangFunction(void) {
47407    int test_ret = 0;
47408
47409#if defined(LIBXML_XPATH_ENABLED)
47410    int mem_base;
47411    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47412    int n_ctxt;
47413    int nargs; /* the number of arguments */
47414    int n_nargs;
47415
47416    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47417    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47418        mem_base = xmlMemBlocks();
47419        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47420        nargs = gen_int(n_nargs, 1);
47421
47422        xmlXPathLangFunction(ctxt, nargs);
47423        call_tests++;
47424        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47425        des_int(n_nargs, nargs, 1);
47426        xmlResetLastError();
47427        if (mem_base != xmlMemBlocks()) {
47428            printf("Leak of %d blocks found in xmlXPathLangFunction",
47429	           xmlMemBlocks() - mem_base);
47430	    test_ret++;
47431            printf(" %d", n_ctxt);
47432            printf(" %d", n_nargs);
47433            printf("\n");
47434        }
47435    }
47436    }
47437    function_tests++;
47438#endif
47439
47440    return(test_ret);
47441}
47442
47443
47444static int
47445test_xmlXPathLastFunction(void) {
47446    int test_ret = 0;
47447
47448#if defined(LIBXML_XPATH_ENABLED)
47449    int mem_base;
47450    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47451    int n_ctxt;
47452    int nargs; /* the number of arguments */
47453    int n_nargs;
47454
47455    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47456    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47457        mem_base = xmlMemBlocks();
47458        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47459        nargs = gen_int(n_nargs, 1);
47460
47461        xmlXPathLastFunction(ctxt, nargs);
47462        call_tests++;
47463        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47464        des_int(n_nargs, nargs, 1);
47465        xmlResetLastError();
47466        if (mem_base != xmlMemBlocks()) {
47467            printf("Leak of %d blocks found in xmlXPathLastFunction",
47468	           xmlMemBlocks() - mem_base);
47469	    test_ret++;
47470            printf(" %d", n_ctxt);
47471            printf(" %d", n_nargs);
47472            printf("\n");
47473        }
47474    }
47475    }
47476    function_tests++;
47477#endif
47478
47479    return(test_ret);
47480}
47481
47482
47483static int
47484test_xmlXPathLeading(void) {
47485    int test_ret = 0;
47486
47487#if defined(LIBXML_XPATH_ENABLED)
47488    int mem_base;
47489    xmlNodeSetPtr ret_val;
47490    xmlNodeSetPtr nodes1; /* a node-set */
47491    int n_nodes1;
47492    xmlNodeSetPtr nodes2; /* a node-set */
47493    int n_nodes2;
47494
47495    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47496    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47497        mem_base = xmlMemBlocks();
47498        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47499        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47500
47501        ret_val = xmlXPathLeading(nodes1, nodes2);
47502        desret_xmlNodeSetPtr(ret_val);
47503        call_tests++;
47504        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47505        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47506        xmlResetLastError();
47507        if (mem_base != xmlMemBlocks()) {
47508            printf("Leak of %d blocks found in xmlXPathLeading",
47509	           xmlMemBlocks() - mem_base);
47510	    test_ret++;
47511            printf(" %d", n_nodes1);
47512            printf(" %d", n_nodes2);
47513            printf("\n");
47514        }
47515    }
47516    }
47517    function_tests++;
47518#endif
47519
47520    return(test_ret);
47521}
47522
47523
47524static int
47525test_xmlXPathLeadingSorted(void) {
47526    int test_ret = 0;
47527
47528#if defined(LIBXML_XPATH_ENABLED)
47529    int mem_base;
47530    xmlNodeSetPtr ret_val;
47531    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47532    int n_nodes1;
47533    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47534    int n_nodes2;
47535
47536    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47537    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47538        mem_base = xmlMemBlocks();
47539        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47540        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47541
47542        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47543        desret_xmlNodeSetPtr(ret_val);
47544        call_tests++;
47545        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47546        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47547        xmlResetLastError();
47548        if (mem_base != xmlMemBlocks()) {
47549            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47550	           xmlMemBlocks() - mem_base);
47551	    test_ret++;
47552            printf(" %d", n_nodes1);
47553            printf(" %d", n_nodes2);
47554            printf("\n");
47555        }
47556    }
47557    }
47558    function_tests++;
47559#endif
47560
47561    return(test_ret);
47562}
47563
47564
47565static int
47566test_xmlXPathLocalNameFunction(void) {
47567    int test_ret = 0;
47568
47569#if defined(LIBXML_XPATH_ENABLED)
47570    int mem_base;
47571    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47572    int n_ctxt;
47573    int nargs; /* the number of arguments */
47574    int n_nargs;
47575
47576    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47577    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47578        mem_base = xmlMemBlocks();
47579        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47580        nargs = gen_int(n_nargs, 1);
47581
47582        xmlXPathLocalNameFunction(ctxt, nargs);
47583        call_tests++;
47584        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47585        des_int(n_nargs, nargs, 1);
47586        xmlResetLastError();
47587        if (mem_base != xmlMemBlocks()) {
47588            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47589	           xmlMemBlocks() - mem_base);
47590	    test_ret++;
47591            printf(" %d", n_ctxt);
47592            printf(" %d", n_nargs);
47593            printf("\n");
47594        }
47595    }
47596    }
47597    function_tests++;
47598#endif
47599
47600    return(test_ret);
47601}
47602
47603
47604static int
47605test_xmlXPathModValues(void) {
47606    int test_ret = 0;
47607
47608#if defined(LIBXML_XPATH_ENABLED)
47609    int mem_base;
47610    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47611    int n_ctxt;
47612
47613    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47614        mem_base = xmlMemBlocks();
47615        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47616
47617        xmlXPathModValues(ctxt);
47618        call_tests++;
47619        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47620        xmlResetLastError();
47621        if (mem_base != xmlMemBlocks()) {
47622            printf("Leak of %d blocks found in xmlXPathModValues",
47623	           xmlMemBlocks() - mem_base);
47624	    test_ret++;
47625            printf(" %d", n_ctxt);
47626            printf("\n");
47627        }
47628    }
47629    function_tests++;
47630#endif
47631
47632    return(test_ret);
47633}
47634
47635
47636static int
47637test_xmlXPathMultValues(void) {
47638    int test_ret = 0;
47639
47640#if defined(LIBXML_XPATH_ENABLED)
47641    int mem_base;
47642    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47643    int n_ctxt;
47644
47645    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47646        mem_base = xmlMemBlocks();
47647        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47648
47649        xmlXPathMultValues(ctxt);
47650        call_tests++;
47651        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47652        xmlResetLastError();
47653        if (mem_base != xmlMemBlocks()) {
47654            printf("Leak of %d blocks found in xmlXPathMultValues",
47655	           xmlMemBlocks() - mem_base);
47656	    test_ret++;
47657            printf(" %d", n_ctxt);
47658            printf("\n");
47659        }
47660    }
47661    function_tests++;
47662#endif
47663
47664    return(test_ret);
47665}
47666
47667
47668static int
47669test_xmlXPathNamespaceURIFunction(void) {
47670    int test_ret = 0;
47671
47672#if defined(LIBXML_XPATH_ENABLED)
47673    int mem_base;
47674    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47675    int n_ctxt;
47676    int nargs; /* the number of arguments */
47677    int n_nargs;
47678
47679    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47680    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47681        mem_base = xmlMemBlocks();
47682        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47683        nargs = gen_int(n_nargs, 1);
47684
47685        xmlXPathNamespaceURIFunction(ctxt, nargs);
47686        call_tests++;
47687        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47688        des_int(n_nargs, nargs, 1);
47689        xmlResetLastError();
47690        if (mem_base != xmlMemBlocks()) {
47691            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47692	           xmlMemBlocks() - mem_base);
47693	    test_ret++;
47694            printf(" %d", n_ctxt);
47695            printf(" %d", n_nargs);
47696            printf("\n");
47697        }
47698    }
47699    }
47700    function_tests++;
47701#endif
47702
47703    return(test_ret);
47704}
47705
47706
47707static int
47708test_xmlXPathNewBoolean(void) {
47709    int test_ret = 0;
47710
47711#if defined(LIBXML_XPATH_ENABLED)
47712    int mem_base;
47713    xmlXPathObjectPtr ret_val;
47714    int val; /* the boolean value */
47715    int n_val;
47716
47717    for (n_val = 0;n_val < gen_nb_int;n_val++) {
47718        mem_base = xmlMemBlocks();
47719        val = gen_int(n_val, 0);
47720
47721        ret_val = xmlXPathNewBoolean(val);
47722        desret_xmlXPathObjectPtr(ret_val);
47723        call_tests++;
47724        des_int(n_val, val, 0);
47725        xmlResetLastError();
47726        if (mem_base != xmlMemBlocks()) {
47727            printf("Leak of %d blocks found in xmlXPathNewBoolean",
47728	           xmlMemBlocks() - mem_base);
47729	    test_ret++;
47730            printf(" %d", n_val);
47731            printf("\n");
47732        }
47733    }
47734    function_tests++;
47735#endif
47736
47737    return(test_ret);
47738}
47739
47740
47741static int
47742test_xmlXPathNewCString(void) {
47743    int test_ret = 0;
47744
47745#if defined(LIBXML_XPATH_ENABLED)
47746    int mem_base;
47747    xmlXPathObjectPtr ret_val;
47748    char * val; /* the char * value */
47749    int n_val;
47750
47751    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47752        mem_base = xmlMemBlocks();
47753        val = gen_const_char_ptr(n_val, 0);
47754
47755        ret_val = xmlXPathNewCString((const char *)val);
47756        desret_xmlXPathObjectPtr(ret_val);
47757        call_tests++;
47758        des_const_char_ptr(n_val, (const char *)val, 0);
47759        xmlResetLastError();
47760        if (mem_base != xmlMemBlocks()) {
47761            printf("Leak of %d blocks found in xmlXPathNewCString",
47762	           xmlMemBlocks() - mem_base);
47763	    test_ret++;
47764            printf(" %d", n_val);
47765            printf("\n");
47766        }
47767    }
47768    function_tests++;
47769#endif
47770
47771    return(test_ret);
47772}
47773
47774
47775static int
47776test_xmlXPathNewFloat(void) {
47777    int test_ret = 0;
47778
47779#if defined(LIBXML_XPATH_ENABLED)
47780    int mem_base;
47781    xmlXPathObjectPtr ret_val;
47782    double val; /* the double value */
47783    int n_val;
47784
47785    for (n_val = 0;n_val < gen_nb_double;n_val++) {
47786        mem_base = xmlMemBlocks();
47787        val = gen_double(n_val, 0);
47788
47789        ret_val = xmlXPathNewFloat(val);
47790        desret_xmlXPathObjectPtr(ret_val);
47791        call_tests++;
47792        des_double(n_val, val, 0);
47793        xmlResetLastError();
47794        if (mem_base != xmlMemBlocks()) {
47795            printf("Leak of %d blocks found in xmlXPathNewFloat",
47796	           xmlMemBlocks() - mem_base);
47797	    test_ret++;
47798            printf(" %d", n_val);
47799            printf("\n");
47800        }
47801    }
47802    function_tests++;
47803#endif
47804
47805    return(test_ret);
47806}
47807
47808
47809static int
47810test_xmlXPathNewNodeSet(void) {
47811    int test_ret = 0;
47812
47813#if defined(LIBXML_XPATH_ENABLED)
47814    int mem_base;
47815    xmlXPathObjectPtr ret_val;
47816    xmlNodePtr val; /* the NodePtr value */
47817    int n_val;
47818
47819    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47820        mem_base = xmlMemBlocks();
47821        val = gen_xmlNodePtr(n_val, 0);
47822
47823        ret_val = xmlXPathNewNodeSet(val);
47824        desret_xmlXPathObjectPtr(ret_val);
47825        call_tests++;
47826        des_xmlNodePtr(n_val, val, 0);
47827        xmlResetLastError();
47828        if (mem_base != xmlMemBlocks()) {
47829            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47830	           xmlMemBlocks() - mem_base);
47831	    test_ret++;
47832            printf(" %d", n_val);
47833            printf("\n");
47834        }
47835    }
47836    function_tests++;
47837#endif
47838
47839    return(test_ret);
47840}
47841
47842
47843static int
47844test_xmlXPathNewNodeSetList(void) {
47845    int test_ret = 0;
47846
47847#if defined(LIBXML_XPATH_ENABLED)
47848    int mem_base;
47849    xmlXPathObjectPtr ret_val;
47850    xmlNodeSetPtr val; /* an existing NodeSet */
47851    int n_val;
47852
47853    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
47854        mem_base = xmlMemBlocks();
47855        val = gen_xmlNodeSetPtr(n_val, 0);
47856
47857        ret_val = xmlXPathNewNodeSetList(val);
47858        desret_xmlXPathObjectPtr(ret_val);
47859        call_tests++;
47860        des_xmlNodeSetPtr(n_val, val, 0);
47861        xmlResetLastError();
47862        if (mem_base != xmlMemBlocks()) {
47863            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
47864	           xmlMemBlocks() - mem_base);
47865	    test_ret++;
47866            printf(" %d", n_val);
47867            printf("\n");
47868        }
47869    }
47870    function_tests++;
47871#endif
47872
47873    return(test_ret);
47874}
47875
47876
47877static int
47878test_xmlXPathNewParserContext(void) {
47879    int test_ret = 0;
47880
47881
47882    /* missing type support */
47883    return(test_ret);
47884}
47885
47886
47887static int
47888test_xmlXPathNewString(void) {
47889    int test_ret = 0;
47890
47891#if defined(LIBXML_XPATH_ENABLED)
47892    int mem_base;
47893    xmlXPathObjectPtr ret_val;
47894    xmlChar * val; /* the xmlChar * value */
47895    int n_val;
47896
47897    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47898        mem_base = xmlMemBlocks();
47899        val = gen_const_xmlChar_ptr(n_val, 0);
47900
47901        ret_val = xmlXPathNewString((const xmlChar *)val);
47902        desret_xmlXPathObjectPtr(ret_val);
47903        call_tests++;
47904        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47905        xmlResetLastError();
47906        if (mem_base != xmlMemBlocks()) {
47907            printf("Leak of %d blocks found in xmlXPathNewString",
47908	           xmlMemBlocks() - mem_base);
47909	    test_ret++;
47910            printf(" %d", n_val);
47911            printf("\n");
47912        }
47913    }
47914    function_tests++;
47915#endif
47916
47917    return(test_ret);
47918}
47919
47920
47921static int
47922test_xmlXPathNextAncestor(void) {
47923    int test_ret = 0;
47924
47925#if defined(LIBXML_XPATH_ENABLED)
47926    int mem_base;
47927    xmlNodePtr ret_val;
47928    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47929    int n_ctxt;
47930    xmlNodePtr cur; /* the current node in the traversal */
47931    int n_cur;
47932
47933    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47934    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47935        mem_base = xmlMemBlocks();
47936        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47937        cur = gen_xmlNodePtr(n_cur, 1);
47938
47939        ret_val = xmlXPathNextAncestor(ctxt, cur);
47940        desret_xmlNodePtr(ret_val);
47941        call_tests++;
47942        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47943        des_xmlNodePtr(n_cur, cur, 1);
47944        xmlResetLastError();
47945        if (mem_base != xmlMemBlocks()) {
47946            printf("Leak of %d blocks found in xmlXPathNextAncestor",
47947	           xmlMemBlocks() - mem_base);
47948	    test_ret++;
47949            printf(" %d", n_ctxt);
47950            printf(" %d", n_cur);
47951            printf("\n");
47952        }
47953    }
47954    }
47955    function_tests++;
47956#endif
47957
47958    return(test_ret);
47959}
47960
47961
47962static int
47963test_xmlXPathNextAncestorOrSelf(void) {
47964    int test_ret = 0;
47965
47966#if defined(LIBXML_XPATH_ENABLED)
47967    int mem_base;
47968    xmlNodePtr ret_val;
47969    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47970    int n_ctxt;
47971    xmlNodePtr cur; /* the current node in the traversal */
47972    int n_cur;
47973
47974    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47975    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47976        mem_base = xmlMemBlocks();
47977        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47978        cur = gen_xmlNodePtr(n_cur, 1);
47979
47980        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
47981        desret_xmlNodePtr(ret_val);
47982        call_tests++;
47983        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47984        des_xmlNodePtr(n_cur, cur, 1);
47985        xmlResetLastError();
47986        if (mem_base != xmlMemBlocks()) {
47987            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
47988	           xmlMemBlocks() - mem_base);
47989	    test_ret++;
47990            printf(" %d", n_ctxt);
47991            printf(" %d", n_cur);
47992            printf("\n");
47993        }
47994    }
47995    }
47996    function_tests++;
47997#endif
47998
47999    return(test_ret);
48000}
48001
48002
48003static int
48004test_xmlXPathNextAttribute(void) {
48005    int test_ret = 0;
48006
48007#if defined(LIBXML_XPATH_ENABLED)
48008    int mem_base;
48009    xmlNodePtr ret_val;
48010    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48011    int n_ctxt;
48012    xmlNodePtr cur; /* the current attribute in the traversal */
48013    int n_cur;
48014
48015    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48016    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48017        mem_base = xmlMemBlocks();
48018        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48019        cur = gen_xmlNodePtr(n_cur, 1);
48020
48021        ret_val = xmlXPathNextAttribute(ctxt, cur);
48022        desret_xmlNodePtr(ret_val);
48023        call_tests++;
48024        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48025        des_xmlNodePtr(n_cur, cur, 1);
48026        xmlResetLastError();
48027        if (mem_base != xmlMemBlocks()) {
48028            printf("Leak of %d blocks found in xmlXPathNextAttribute",
48029	           xmlMemBlocks() - mem_base);
48030	    test_ret++;
48031            printf(" %d", n_ctxt);
48032            printf(" %d", n_cur);
48033            printf("\n");
48034        }
48035    }
48036    }
48037    function_tests++;
48038#endif
48039
48040    return(test_ret);
48041}
48042
48043
48044static int
48045test_xmlXPathNextChild(void) {
48046    int test_ret = 0;
48047
48048#if defined(LIBXML_XPATH_ENABLED)
48049    int mem_base;
48050    xmlNodePtr ret_val;
48051    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48052    int n_ctxt;
48053    xmlNodePtr cur; /* the current node in the traversal */
48054    int n_cur;
48055
48056    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48057    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48058        mem_base = xmlMemBlocks();
48059        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48060        cur = gen_xmlNodePtr(n_cur, 1);
48061
48062        ret_val = xmlXPathNextChild(ctxt, cur);
48063        desret_xmlNodePtr(ret_val);
48064        call_tests++;
48065        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48066        des_xmlNodePtr(n_cur, cur, 1);
48067        xmlResetLastError();
48068        if (mem_base != xmlMemBlocks()) {
48069            printf("Leak of %d blocks found in xmlXPathNextChild",
48070	           xmlMemBlocks() - mem_base);
48071	    test_ret++;
48072            printf(" %d", n_ctxt);
48073            printf(" %d", n_cur);
48074            printf("\n");
48075        }
48076    }
48077    }
48078    function_tests++;
48079#endif
48080
48081    return(test_ret);
48082}
48083
48084
48085static int
48086test_xmlXPathNextDescendant(void) {
48087    int test_ret = 0;
48088
48089#if defined(LIBXML_XPATH_ENABLED)
48090    int mem_base;
48091    xmlNodePtr ret_val;
48092    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48093    int n_ctxt;
48094    xmlNodePtr cur; /* the current node in the traversal */
48095    int n_cur;
48096
48097    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48098    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48099        mem_base = xmlMemBlocks();
48100        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48101        cur = gen_xmlNodePtr(n_cur, 1);
48102
48103        ret_val = xmlXPathNextDescendant(ctxt, cur);
48104        desret_xmlNodePtr(ret_val);
48105        call_tests++;
48106        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48107        des_xmlNodePtr(n_cur, cur, 1);
48108        xmlResetLastError();
48109        if (mem_base != xmlMemBlocks()) {
48110            printf("Leak of %d blocks found in xmlXPathNextDescendant",
48111	           xmlMemBlocks() - mem_base);
48112	    test_ret++;
48113            printf(" %d", n_ctxt);
48114            printf(" %d", n_cur);
48115            printf("\n");
48116        }
48117    }
48118    }
48119    function_tests++;
48120#endif
48121
48122    return(test_ret);
48123}
48124
48125
48126static int
48127test_xmlXPathNextDescendantOrSelf(void) {
48128    int test_ret = 0;
48129
48130#if defined(LIBXML_XPATH_ENABLED)
48131    int mem_base;
48132    xmlNodePtr ret_val;
48133    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48134    int n_ctxt;
48135    xmlNodePtr cur; /* the current node in the traversal */
48136    int n_cur;
48137
48138    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48139    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48140        mem_base = xmlMemBlocks();
48141        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48142        cur = gen_xmlNodePtr(n_cur, 1);
48143
48144        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48145        desret_xmlNodePtr(ret_val);
48146        call_tests++;
48147        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48148        des_xmlNodePtr(n_cur, cur, 1);
48149        xmlResetLastError();
48150        if (mem_base != xmlMemBlocks()) {
48151            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48152	           xmlMemBlocks() - mem_base);
48153	    test_ret++;
48154            printf(" %d", n_ctxt);
48155            printf(" %d", n_cur);
48156            printf("\n");
48157        }
48158    }
48159    }
48160    function_tests++;
48161#endif
48162
48163    return(test_ret);
48164}
48165
48166
48167static int
48168test_xmlXPathNextFollowing(void) {
48169    int test_ret = 0;
48170
48171#if defined(LIBXML_XPATH_ENABLED)
48172    int mem_base;
48173    xmlNodePtr ret_val;
48174    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48175    int n_ctxt;
48176    xmlNodePtr cur; /* the current node in the traversal */
48177    int n_cur;
48178
48179    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48180    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48181        mem_base = xmlMemBlocks();
48182        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48183        cur = gen_xmlNodePtr(n_cur, 1);
48184
48185        ret_val = xmlXPathNextFollowing(ctxt, cur);
48186        desret_xmlNodePtr(ret_val);
48187        call_tests++;
48188        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48189        des_xmlNodePtr(n_cur, cur, 1);
48190        xmlResetLastError();
48191        if (mem_base != xmlMemBlocks()) {
48192            printf("Leak of %d blocks found in xmlXPathNextFollowing",
48193	           xmlMemBlocks() - mem_base);
48194	    test_ret++;
48195            printf(" %d", n_ctxt);
48196            printf(" %d", n_cur);
48197            printf("\n");
48198        }
48199    }
48200    }
48201    function_tests++;
48202#endif
48203
48204    return(test_ret);
48205}
48206
48207
48208static int
48209test_xmlXPathNextFollowingSibling(void) {
48210    int test_ret = 0;
48211
48212#if defined(LIBXML_XPATH_ENABLED)
48213    int mem_base;
48214    xmlNodePtr ret_val;
48215    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48216    int n_ctxt;
48217    xmlNodePtr cur; /* the current node in the traversal */
48218    int n_cur;
48219
48220    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48221    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48222        mem_base = xmlMemBlocks();
48223        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48224        cur = gen_xmlNodePtr(n_cur, 1);
48225
48226        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48227        desret_xmlNodePtr(ret_val);
48228        call_tests++;
48229        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48230        des_xmlNodePtr(n_cur, cur, 1);
48231        xmlResetLastError();
48232        if (mem_base != xmlMemBlocks()) {
48233            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48234	           xmlMemBlocks() - mem_base);
48235	    test_ret++;
48236            printf(" %d", n_ctxt);
48237            printf(" %d", n_cur);
48238            printf("\n");
48239        }
48240    }
48241    }
48242    function_tests++;
48243#endif
48244
48245    return(test_ret);
48246}
48247
48248
48249static int
48250test_xmlXPathNextNamespace(void) {
48251    int test_ret = 0;
48252
48253#if defined(LIBXML_XPATH_ENABLED)
48254    int mem_base;
48255    xmlNodePtr ret_val;
48256    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48257    int n_ctxt;
48258    xmlNodePtr cur; /* the current attribute in the traversal */
48259    int n_cur;
48260
48261    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48262    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48263        mem_base = xmlMemBlocks();
48264        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48265        cur = gen_xmlNodePtr(n_cur, 1);
48266
48267        ret_val = xmlXPathNextNamespace(ctxt, cur);
48268        desret_xmlNodePtr(ret_val);
48269        call_tests++;
48270        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48271        des_xmlNodePtr(n_cur, cur, 1);
48272        xmlResetLastError();
48273        if (mem_base != xmlMemBlocks()) {
48274            printf("Leak of %d blocks found in xmlXPathNextNamespace",
48275	           xmlMemBlocks() - mem_base);
48276	    test_ret++;
48277            printf(" %d", n_ctxt);
48278            printf(" %d", n_cur);
48279            printf("\n");
48280        }
48281    }
48282    }
48283    function_tests++;
48284#endif
48285
48286    return(test_ret);
48287}
48288
48289
48290static int
48291test_xmlXPathNextParent(void) {
48292    int test_ret = 0;
48293
48294#if defined(LIBXML_XPATH_ENABLED)
48295    int mem_base;
48296    xmlNodePtr ret_val;
48297    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48298    int n_ctxt;
48299    xmlNodePtr cur; /* the current node in the traversal */
48300    int n_cur;
48301
48302    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48303    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48304        mem_base = xmlMemBlocks();
48305        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48306        cur = gen_xmlNodePtr(n_cur, 1);
48307
48308        ret_val = xmlXPathNextParent(ctxt, cur);
48309        desret_xmlNodePtr(ret_val);
48310        call_tests++;
48311        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48312        des_xmlNodePtr(n_cur, cur, 1);
48313        xmlResetLastError();
48314        if (mem_base != xmlMemBlocks()) {
48315            printf("Leak of %d blocks found in xmlXPathNextParent",
48316	           xmlMemBlocks() - mem_base);
48317	    test_ret++;
48318            printf(" %d", n_ctxt);
48319            printf(" %d", n_cur);
48320            printf("\n");
48321        }
48322    }
48323    }
48324    function_tests++;
48325#endif
48326
48327    return(test_ret);
48328}
48329
48330
48331static int
48332test_xmlXPathNextPreceding(void) {
48333    int test_ret = 0;
48334
48335#if defined(LIBXML_XPATH_ENABLED)
48336    int mem_base;
48337    xmlNodePtr ret_val;
48338    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48339    int n_ctxt;
48340    xmlNodePtr cur; /* the current node in the traversal */
48341    int n_cur;
48342
48343    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48344    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48345        mem_base = xmlMemBlocks();
48346        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48347        cur = gen_xmlNodePtr(n_cur, 1);
48348
48349        ret_val = xmlXPathNextPreceding(ctxt, cur);
48350        desret_xmlNodePtr(ret_val);
48351        call_tests++;
48352        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48353        des_xmlNodePtr(n_cur, cur, 1);
48354        xmlResetLastError();
48355        if (mem_base != xmlMemBlocks()) {
48356            printf("Leak of %d blocks found in xmlXPathNextPreceding",
48357	           xmlMemBlocks() - mem_base);
48358	    test_ret++;
48359            printf(" %d", n_ctxt);
48360            printf(" %d", n_cur);
48361            printf("\n");
48362        }
48363    }
48364    }
48365    function_tests++;
48366#endif
48367
48368    return(test_ret);
48369}
48370
48371
48372static int
48373test_xmlXPathNextPrecedingSibling(void) {
48374    int test_ret = 0;
48375
48376#if defined(LIBXML_XPATH_ENABLED)
48377    int mem_base;
48378    xmlNodePtr ret_val;
48379    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48380    int n_ctxt;
48381    xmlNodePtr cur; /* the current node in the traversal */
48382    int n_cur;
48383
48384    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48385    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48386        mem_base = xmlMemBlocks();
48387        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48388        cur = gen_xmlNodePtr(n_cur, 1);
48389
48390        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48391        desret_xmlNodePtr(ret_val);
48392        call_tests++;
48393        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48394        des_xmlNodePtr(n_cur, cur, 1);
48395        xmlResetLastError();
48396        if (mem_base != xmlMemBlocks()) {
48397            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48398	           xmlMemBlocks() - mem_base);
48399	    test_ret++;
48400            printf(" %d", n_ctxt);
48401            printf(" %d", n_cur);
48402            printf("\n");
48403        }
48404    }
48405    }
48406    function_tests++;
48407#endif
48408
48409    return(test_ret);
48410}
48411
48412
48413static int
48414test_xmlXPathNextSelf(void) {
48415    int test_ret = 0;
48416
48417#if defined(LIBXML_XPATH_ENABLED)
48418    int mem_base;
48419    xmlNodePtr ret_val;
48420    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48421    int n_ctxt;
48422    xmlNodePtr cur; /* the current node in the traversal */
48423    int n_cur;
48424
48425    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48426    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48427        mem_base = xmlMemBlocks();
48428        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48429        cur = gen_xmlNodePtr(n_cur, 1);
48430
48431        ret_val = xmlXPathNextSelf(ctxt, cur);
48432        desret_xmlNodePtr(ret_val);
48433        call_tests++;
48434        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48435        des_xmlNodePtr(n_cur, cur, 1);
48436        xmlResetLastError();
48437        if (mem_base != xmlMemBlocks()) {
48438            printf("Leak of %d blocks found in xmlXPathNextSelf",
48439	           xmlMemBlocks() - mem_base);
48440	    test_ret++;
48441            printf(" %d", n_ctxt);
48442            printf(" %d", n_cur);
48443            printf("\n");
48444        }
48445    }
48446    }
48447    function_tests++;
48448#endif
48449
48450    return(test_ret);
48451}
48452
48453
48454static int
48455test_xmlXPathNodeLeading(void) {
48456    int test_ret = 0;
48457
48458#if defined(LIBXML_XPATH_ENABLED)
48459    int mem_base;
48460    xmlNodeSetPtr ret_val;
48461    xmlNodeSetPtr nodes; /* a node-set */
48462    int n_nodes;
48463    xmlNodePtr node; /* a node */
48464    int n_node;
48465
48466    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48467    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48468        mem_base = xmlMemBlocks();
48469        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48470        node = gen_xmlNodePtr(n_node, 1);
48471
48472        ret_val = xmlXPathNodeLeading(nodes, node);
48473        desret_xmlNodeSetPtr(ret_val);
48474        call_tests++;
48475        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48476        des_xmlNodePtr(n_node, node, 1);
48477        xmlResetLastError();
48478        if (mem_base != xmlMemBlocks()) {
48479            printf("Leak of %d blocks found in xmlXPathNodeLeading",
48480	           xmlMemBlocks() - mem_base);
48481	    test_ret++;
48482            printf(" %d", n_nodes);
48483            printf(" %d", n_node);
48484            printf("\n");
48485        }
48486    }
48487    }
48488    function_tests++;
48489#endif
48490
48491    return(test_ret);
48492}
48493
48494
48495static int
48496test_xmlXPathNodeLeadingSorted(void) {
48497    int test_ret = 0;
48498
48499#if defined(LIBXML_XPATH_ENABLED)
48500    int mem_base;
48501    xmlNodeSetPtr ret_val;
48502    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48503    int n_nodes;
48504    xmlNodePtr node; /* a node */
48505    int n_node;
48506
48507    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48508    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48509        mem_base = xmlMemBlocks();
48510        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48511        node = gen_xmlNodePtr(n_node, 1);
48512
48513        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48514        desret_xmlNodeSetPtr(ret_val);
48515        call_tests++;
48516        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48517        des_xmlNodePtr(n_node, node, 1);
48518        xmlResetLastError();
48519        if (mem_base != xmlMemBlocks()) {
48520            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48521	           xmlMemBlocks() - mem_base);
48522	    test_ret++;
48523            printf(" %d", n_nodes);
48524            printf(" %d", n_node);
48525            printf("\n");
48526        }
48527    }
48528    }
48529    function_tests++;
48530#endif
48531
48532    return(test_ret);
48533}
48534
48535
48536static int
48537test_xmlXPathNodeSetAdd(void) {
48538    int test_ret = 0;
48539
48540#if defined(LIBXML_XPATH_ENABLED)
48541    int mem_base;
48542    xmlNodeSetPtr cur; /* the initial node set */
48543    int n_cur;
48544    xmlNodePtr val; /* a new xmlNodePtr */
48545    int n_val;
48546
48547    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48548    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48549        mem_base = xmlMemBlocks();
48550        cur = gen_xmlNodeSetPtr(n_cur, 0);
48551        val = gen_xmlNodePtr(n_val, 1);
48552
48553        xmlXPathNodeSetAdd(cur, val);
48554        call_tests++;
48555        des_xmlNodeSetPtr(n_cur, cur, 0);
48556        des_xmlNodePtr(n_val, val, 1);
48557        xmlResetLastError();
48558        if (mem_base != xmlMemBlocks()) {
48559            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48560	           xmlMemBlocks() - mem_base);
48561	    test_ret++;
48562            printf(" %d", n_cur);
48563            printf(" %d", n_val);
48564            printf("\n");
48565        }
48566    }
48567    }
48568    function_tests++;
48569#endif
48570
48571    return(test_ret);
48572}
48573
48574
48575static int
48576test_xmlXPathNodeSetAddNs(void) {
48577    int test_ret = 0;
48578
48579#if defined(LIBXML_XPATH_ENABLED)
48580    int mem_base;
48581    xmlNodeSetPtr cur; /* the initial node set */
48582    int n_cur;
48583    xmlNodePtr node; /* the hosting node */
48584    int n_node;
48585    xmlNsPtr ns; /* a the namespace node */
48586    int n_ns;
48587
48588    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48589    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48590    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48591        mem_base = xmlMemBlocks();
48592        cur = gen_xmlNodeSetPtr(n_cur, 0);
48593        node = gen_xmlNodePtr(n_node, 1);
48594        ns = gen_xmlNsPtr(n_ns, 2);
48595
48596        xmlXPathNodeSetAddNs(cur, node, ns);
48597        call_tests++;
48598        des_xmlNodeSetPtr(n_cur, cur, 0);
48599        des_xmlNodePtr(n_node, node, 1);
48600        des_xmlNsPtr(n_ns, ns, 2);
48601        xmlResetLastError();
48602        if (mem_base != xmlMemBlocks()) {
48603            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48604	           xmlMemBlocks() - mem_base);
48605	    test_ret++;
48606            printf(" %d", n_cur);
48607            printf(" %d", n_node);
48608            printf(" %d", n_ns);
48609            printf("\n");
48610        }
48611    }
48612    }
48613    }
48614    function_tests++;
48615#endif
48616
48617    return(test_ret);
48618}
48619
48620
48621static int
48622test_xmlXPathNodeSetAddUnique(void) {
48623    int test_ret = 0;
48624
48625#if defined(LIBXML_XPATH_ENABLED)
48626    int mem_base;
48627    xmlNodeSetPtr cur; /* the initial node set */
48628    int n_cur;
48629    xmlNodePtr val; /* a new xmlNodePtr */
48630    int n_val;
48631
48632    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48633    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48634        mem_base = xmlMemBlocks();
48635        cur = gen_xmlNodeSetPtr(n_cur, 0);
48636        val = gen_xmlNodePtr(n_val, 1);
48637
48638        xmlXPathNodeSetAddUnique(cur, val);
48639        call_tests++;
48640        des_xmlNodeSetPtr(n_cur, cur, 0);
48641        des_xmlNodePtr(n_val, val, 1);
48642        xmlResetLastError();
48643        if (mem_base != xmlMemBlocks()) {
48644            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48645	           xmlMemBlocks() - mem_base);
48646	    test_ret++;
48647            printf(" %d", n_cur);
48648            printf(" %d", n_val);
48649            printf("\n");
48650        }
48651    }
48652    }
48653    function_tests++;
48654#endif
48655
48656    return(test_ret);
48657}
48658
48659
48660static int
48661test_xmlXPathNodeSetContains(void) {
48662    int test_ret = 0;
48663
48664#if defined(LIBXML_XPATH_ENABLED)
48665    int mem_base;
48666    int ret_val;
48667    xmlNodeSetPtr cur; /* the node-set */
48668    int n_cur;
48669    xmlNodePtr val; /* the node */
48670    int n_val;
48671
48672    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48673    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48674        mem_base = xmlMemBlocks();
48675        cur = gen_xmlNodeSetPtr(n_cur, 0);
48676        val = gen_xmlNodePtr(n_val, 1);
48677
48678        ret_val = xmlXPathNodeSetContains(cur, val);
48679        desret_int(ret_val);
48680        call_tests++;
48681        des_xmlNodeSetPtr(n_cur, cur, 0);
48682        des_xmlNodePtr(n_val, val, 1);
48683        xmlResetLastError();
48684        if (mem_base != xmlMemBlocks()) {
48685            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48686	           xmlMemBlocks() - mem_base);
48687	    test_ret++;
48688            printf(" %d", n_cur);
48689            printf(" %d", n_val);
48690            printf("\n");
48691        }
48692    }
48693    }
48694    function_tests++;
48695#endif
48696
48697    return(test_ret);
48698}
48699
48700
48701static int
48702test_xmlXPathNodeSetDel(void) {
48703    int test_ret = 0;
48704
48705#if defined(LIBXML_XPATH_ENABLED)
48706    int mem_base;
48707    xmlNodeSetPtr cur; /* the initial node set */
48708    int n_cur;
48709    xmlNodePtr val; /* an xmlNodePtr */
48710    int n_val;
48711
48712    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48713    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48714        mem_base = xmlMemBlocks();
48715        cur = gen_xmlNodeSetPtr(n_cur, 0);
48716        val = gen_xmlNodePtr(n_val, 1);
48717
48718        xmlXPathNodeSetDel(cur, val);
48719        call_tests++;
48720        des_xmlNodeSetPtr(n_cur, cur, 0);
48721        des_xmlNodePtr(n_val, val, 1);
48722        xmlResetLastError();
48723        if (mem_base != xmlMemBlocks()) {
48724            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48725	           xmlMemBlocks() - mem_base);
48726	    test_ret++;
48727            printf(" %d", n_cur);
48728            printf(" %d", n_val);
48729            printf("\n");
48730        }
48731    }
48732    }
48733    function_tests++;
48734#endif
48735
48736    return(test_ret);
48737}
48738
48739
48740static int
48741test_xmlXPathNodeSetMerge(void) {
48742    int test_ret = 0;
48743
48744#if defined(LIBXML_XPATH_ENABLED)
48745    int mem_base;
48746    xmlNodeSetPtr ret_val;
48747    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48748    int n_val1;
48749    xmlNodeSetPtr val2; /* the second NodeSet */
48750    int n_val2;
48751
48752    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48753    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48754        mem_base = xmlMemBlocks();
48755        val1 = gen_xmlNodeSetPtr(n_val1, 0);
48756        val2 = gen_xmlNodeSetPtr(n_val2, 1);
48757
48758        ret_val = xmlXPathNodeSetMerge(val1, val2);
48759        desret_xmlNodeSetPtr(ret_val);
48760        call_tests++;
48761        des_xmlNodeSetPtr(n_val1, val1, 0);
48762        des_xmlNodeSetPtr(n_val2, val2, 1);
48763        xmlResetLastError();
48764        if (mem_base != xmlMemBlocks()) {
48765            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48766	           xmlMemBlocks() - mem_base);
48767	    test_ret++;
48768            printf(" %d", n_val1);
48769            printf(" %d", n_val2);
48770            printf("\n");
48771        }
48772    }
48773    }
48774    function_tests++;
48775#endif
48776
48777    return(test_ret);
48778}
48779
48780
48781static int
48782test_xmlXPathNodeSetRemove(void) {
48783    int test_ret = 0;
48784
48785#if defined(LIBXML_XPATH_ENABLED)
48786    int mem_base;
48787    xmlNodeSetPtr cur; /* the initial node set */
48788    int n_cur;
48789    int val; /* the index to remove */
48790    int n_val;
48791
48792    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48793    for (n_val = 0;n_val < gen_nb_int;n_val++) {
48794        mem_base = xmlMemBlocks();
48795        cur = gen_xmlNodeSetPtr(n_cur, 0);
48796        val = gen_int(n_val, 1);
48797
48798        xmlXPathNodeSetRemove(cur, val);
48799        call_tests++;
48800        des_xmlNodeSetPtr(n_cur, cur, 0);
48801        des_int(n_val, val, 1);
48802        xmlResetLastError();
48803        if (mem_base != xmlMemBlocks()) {
48804            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48805	           xmlMemBlocks() - mem_base);
48806	    test_ret++;
48807            printf(" %d", n_cur);
48808            printf(" %d", n_val);
48809            printf("\n");
48810        }
48811    }
48812    }
48813    function_tests++;
48814#endif
48815
48816    return(test_ret);
48817}
48818
48819
48820static int
48821test_xmlXPathNodeSetSort(void) {
48822    int test_ret = 0;
48823
48824#if defined(LIBXML_XPATH_ENABLED)
48825    int mem_base;
48826    xmlNodeSetPtr set; /* the node set */
48827    int n_set;
48828
48829    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48830        mem_base = xmlMemBlocks();
48831        set = gen_xmlNodeSetPtr(n_set, 0);
48832
48833        xmlXPathNodeSetSort(set);
48834        call_tests++;
48835        des_xmlNodeSetPtr(n_set, set, 0);
48836        xmlResetLastError();
48837        if (mem_base != xmlMemBlocks()) {
48838            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
48839	           xmlMemBlocks() - mem_base);
48840	    test_ret++;
48841            printf(" %d", n_set);
48842            printf("\n");
48843        }
48844    }
48845    function_tests++;
48846#endif
48847
48848    return(test_ret);
48849}
48850
48851
48852static int
48853test_xmlXPathNodeTrailing(void) {
48854    int test_ret = 0;
48855
48856#if defined(LIBXML_XPATH_ENABLED)
48857    int mem_base;
48858    xmlNodeSetPtr ret_val;
48859    xmlNodeSetPtr nodes; /* a node-set */
48860    int n_nodes;
48861    xmlNodePtr node; /* a node */
48862    int n_node;
48863
48864    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48865    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48866        mem_base = xmlMemBlocks();
48867        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48868        node = gen_xmlNodePtr(n_node, 1);
48869
48870        ret_val = xmlXPathNodeTrailing(nodes, node);
48871        desret_xmlNodeSetPtr(ret_val);
48872        call_tests++;
48873        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48874        des_xmlNodePtr(n_node, node, 1);
48875        xmlResetLastError();
48876        if (mem_base != xmlMemBlocks()) {
48877            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
48878	           xmlMemBlocks() - mem_base);
48879	    test_ret++;
48880            printf(" %d", n_nodes);
48881            printf(" %d", n_node);
48882            printf("\n");
48883        }
48884    }
48885    }
48886    function_tests++;
48887#endif
48888
48889    return(test_ret);
48890}
48891
48892
48893static int
48894test_xmlXPathNodeTrailingSorted(void) {
48895    int test_ret = 0;
48896
48897#if defined(LIBXML_XPATH_ENABLED)
48898    int mem_base;
48899    xmlNodeSetPtr ret_val;
48900    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48901    int n_nodes;
48902    xmlNodePtr node; /* a node */
48903    int n_node;
48904
48905    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48906    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48907        mem_base = xmlMemBlocks();
48908        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48909        node = gen_xmlNodePtr(n_node, 1);
48910
48911        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
48912        desret_xmlNodeSetPtr(ret_val);
48913        call_tests++;
48914        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48915        des_xmlNodePtr(n_node, node, 1);
48916        xmlResetLastError();
48917        if (mem_base != xmlMemBlocks()) {
48918            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
48919	           xmlMemBlocks() - mem_base);
48920	    test_ret++;
48921            printf(" %d", n_nodes);
48922            printf(" %d", n_node);
48923            printf("\n");
48924        }
48925    }
48926    }
48927    function_tests++;
48928#endif
48929
48930    return(test_ret);
48931}
48932
48933
48934static int
48935test_xmlXPathNormalizeFunction(void) {
48936    int test_ret = 0;
48937
48938#if defined(LIBXML_XPATH_ENABLED)
48939    int mem_base;
48940    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48941    int n_ctxt;
48942    int nargs; /* the number of arguments */
48943    int n_nargs;
48944
48945    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48946    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48947        mem_base = xmlMemBlocks();
48948        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48949        nargs = gen_int(n_nargs, 1);
48950
48951        xmlXPathNormalizeFunction(ctxt, nargs);
48952        call_tests++;
48953        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48954        des_int(n_nargs, nargs, 1);
48955        xmlResetLastError();
48956        if (mem_base != xmlMemBlocks()) {
48957            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
48958	           xmlMemBlocks() - mem_base);
48959	    test_ret++;
48960            printf(" %d", n_ctxt);
48961            printf(" %d", n_nargs);
48962            printf("\n");
48963        }
48964    }
48965    }
48966    function_tests++;
48967#endif
48968
48969    return(test_ret);
48970}
48971
48972
48973static int
48974test_xmlXPathNotEqualValues(void) {
48975    int test_ret = 0;
48976
48977#if defined(LIBXML_XPATH_ENABLED)
48978    int mem_base;
48979    int ret_val;
48980    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48981    int n_ctxt;
48982
48983    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48984        mem_base = xmlMemBlocks();
48985        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48986
48987        ret_val = xmlXPathNotEqualValues(ctxt);
48988        desret_int(ret_val);
48989        call_tests++;
48990        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48991        xmlResetLastError();
48992        if (mem_base != xmlMemBlocks()) {
48993            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
48994	           xmlMemBlocks() - mem_base);
48995	    test_ret++;
48996            printf(" %d", n_ctxt);
48997            printf("\n");
48998        }
48999    }
49000    function_tests++;
49001#endif
49002
49003    return(test_ret);
49004}
49005
49006
49007static int
49008test_xmlXPathNotFunction(void) {
49009    int test_ret = 0;
49010
49011#if defined(LIBXML_XPATH_ENABLED)
49012    int mem_base;
49013    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49014    int n_ctxt;
49015    int nargs; /* the number of arguments */
49016    int n_nargs;
49017
49018    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49019    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49020        mem_base = xmlMemBlocks();
49021        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49022        nargs = gen_int(n_nargs, 1);
49023
49024        xmlXPathNotFunction(ctxt, nargs);
49025        call_tests++;
49026        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49027        des_int(n_nargs, nargs, 1);
49028        xmlResetLastError();
49029        if (mem_base != xmlMemBlocks()) {
49030            printf("Leak of %d blocks found in xmlXPathNotFunction",
49031	           xmlMemBlocks() - mem_base);
49032	    test_ret++;
49033            printf(" %d", n_ctxt);
49034            printf(" %d", n_nargs);
49035            printf("\n");
49036        }
49037    }
49038    }
49039    function_tests++;
49040#endif
49041
49042    return(test_ret);
49043}
49044
49045
49046static int
49047test_xmlXPathNsLookup(void) {
49048    int test_ret = 0;
49049
49050#if defined(LIBXML_XPATH_ENABLED)
49051    int mem_base;
49052    const xmlChar * ret_val;
49053    xmlXPathContextPtr ctxt; /* the XPath context */
49054    int n_ctxt;
49055    xmlChar * prefix; /* the namespace prefix value */
49056    int n_prefix;
49057
49058    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49059    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49060        mem_base = xmlMemBlocks();
49061        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49062        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49063
49064        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49065        desret_const_xmlChar_ptr(ret_val);
49066        call_tests++;
49067        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49068        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49069        xmlResetLastError();
49070        if (mem_base != xmlMemBlocks()) {
49071            printf("Leak of %d blocks found in xmlXPathNsLookup",
49072	           xmlMemBlocks() - mem_base);
49073	    test_ret++;
49074            printf(" %d", n_ctxt);
49075            printf(" %d", n_prefix);
49076            printf("\n");
49077        }
49078    }
49079    }
49080    function_tests++;
49081#endif
49082
49083    return(test_ret);
49084}
49085
49086
49087static int
49088test_xmlXPathNumberFunction(void) {
49089    int test_ret = 0;
49090
49091#if defined(LIBXML_XPATH_ENABLED)
49092    int mem_base;
49093    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49094    int n_ctxt;
49095    int nargs; /* the number of arguments */
49096    int n_nargs;
49097
49098    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49099    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49100        mem_base = xmlMemBlocks();
49101        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49102        nargs = gen_int(n_nargs, 1);
49103
49104        xmlXPathNumberFunction(ctxt, nargs);
49105        call_tests++;
49106        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49107        des_int(n_nargs, nargs, 1);
49108        xmlResetLastError();
49109        if (mem_base != xmlMemBlocks()) {
49110            printf("Leak of %d blocks found in xmlXPathNumberFunction",
49111	           xmlMemBlocks() - mem_base);
49112	    test_ret++;
49113            printf(" %d", n_ctxt);
49114            printf(" %d", n_nargs);
49115            printf("\n");
49116        }
49117    }
49118    }
49119    function_tests++;
49120#endif
49121
49122    return(test_ret);
49123}
49124
49125
49126static int
49127test_xmlXPathParseNCName(void) {
49128    int test_ret = 0;
49129
49130#if defined(LIBXML_XPATH_ENABLED)
49131    int mem_base;
49132    xmlChar * ret_val;
49133    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49134    int n_ctxt;
49135
49136    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49137        mem_base = xmlMemBlocks();
49138        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49139
49140        ret_val = xmlXPathParseNCName(ctxt);
49141        desret_xmlChar_ptr(ret_val);
49142        call_tests++;
49143        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49144        xmlResetLastError();
49145        if (mem_base != xmlMemBlocks()) {
49146            printf("Leak of %d blocks found in xmlXPathParseNCName",
49147	           xmlMemBlocks() - mem_base);
49148	    test_ret++;
49149            printf(" %d", n_ctxt);
49150            printf("\n");
49151        }
49152    }
49153    function_tests++;
49154#endif
49155
49156    return(test_ret);
49157}
49158
49159
49160static int
49161test_xmlXPathParseName(void) {
49162    int test_ret = 0;
49163
49164#if defined(LIBXML_XPATH_ENABLED)
49165    int mem_base;
49166    xmlChar * ret_val;
49167    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49168    int n_ctxt;
49169
49170    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49171        mem_base = xmlMemBlocks();
49172        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49173
49174        ret_val = xmlXPathParseName(ctxt);
49175        desret_xmlChar_ptr(ret_val);
49176        call_tests++;
49177        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49178        xmlResetLastError();
49179        if (mem_base != xmlMemBlocks()) {
49180            printf("Leak of %d blocks found in xmlXPathParseName",
49181	           xmlMemBlocks() - mem_base);
49182	    test_ret++;
49183            printf(" %d", n_ctxt);
49184            printf("\n");
49185        }
49186    }
49187    function_tests++;
49188#endif
49189
49190    return(test_ret);
49191}
49192
49193
49194static int
49195test_xmlXPathPopBoolean(void) {
49196    int test_ret = 0;
49197
49198#if defined(LIBXML_XPATH_ENABLED)
49199    int mem_base;
49200    int ret_val;
49201    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49202    int n_ctxt;
49203
49204    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49205        mem_base = xmlMemBlocks();
49206        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49207
49208        ret_val = xmlXPathPopBoolean(ctxt);
49209        desret_int(ret_val);
49210        call_tests++;
49211        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49212        xmlResetLastError();
49213        if (mem_base != xmlMemBlocks()) {
49214            printf("Leak of %d blocks found in xmlXPathPopBoolean",
49215	           xmlMemBlocks() - mem_base);
49216	    test_ret++;
49217            printf(" %d", n_ctxt);
49218            printf("\n");
49219        }
49220    }
49221    function_tests++;
49222#endif
49223
49224    return(test_ret);
49225}
49226
49227
49228static int
49229test_xmlXPathPopExternal(void) {
49230    int test_ret = 0;
49231
49232#if defined(LIBXML_XPATH_ENABLED)
49233    int mem_base;
49234    void * ret_val;
49235    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49236    int n_ctxt;
49237
49238    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49239        mem_base = xmlMemBlocks();
49240        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49241
49242        ret_val = xmlXPathPopExternal(ctxt);
49243        desret_void_ptr(ret_val);
49244        call_tests++;
49245        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49246        xmlResetLastError();
49247        if (mem_base != xmlMemBlocks()) {
49248            printf("Leak of %d blocks found in xmlXPathPopExternal",
49249	           xmlMemBlocks() - mem_base);
49250	    test_ret++;
49251            printf(" %d", n_ctxt);
49252            printf("\n");
49253        }
49254    }
49255    function_tests++;
49256#endif
49257
49258    return(test_ret);
49259}
49260
49261
49262static int
49263test_xmlXPathPopNodeSet(void) {
49264    int test_ret = 0;
49265
49266#if defined(LIBXML_XPATH_ENABLED)
49267    int mem_base;
49268    xmlNodeSetPtr ret_val;
49269    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49270    int n_ctxt;
49271
49272    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49273        mem_base = xmlMemBlocks();
49274        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49275
49276        ret_val = xmlXPathPopNodeSet(ctxt);
49277        desret_xmlNodeSetPtr(ret_val);
49278        call_tests++;
49279        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49280        xmlResetLastError();
49281        if (mem_base != xmlMemBlocks()) {
49282            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49283	           xmlMemBlocks() - mem_base);
49284	    test_ret++;
49285            printf(" %d", n_ctxt);
49286            printf("\n");
49287        }
49288    }
49289    function_tests++;
49290#endif
49291
49292    return(test_ret);
49293}
49294
49295
49296static int
49297test_xmlXPathPopNumber(void) {
49298    int test_ret = 0;
49299
49300#if defined(LIBXML_XPATH_ENABLED)
49301    int mem_base;
49302    double ret_val;
49303    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49304    int n_ctxt;
49305
49306    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49307        mem_base = xmlMemBlocks();
49308        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49309
49310        ret_val = xmlXPathPopNumber(ctxt);
49311        desret_double(ret_val);
49312        call_tests++;
49313        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49314        xmlResetLastError();
49315        if (mem_base != xmlMemBlocks()) {
49316            printf("Leak of %d blocks found in xmlXPathPopNumber",
49317	           xmlMemBlocks() - mem_base);
49318	    test_ret++;
49319            printf(" %d", n_ctxt);
49320            printf("\n");
49321        }
49322    }
49323    function_tests++;
49324#endif
49325
49326    return(test_ret);
49327}
49328
49329
49330static int
49331test_xmlXPathPopString(void) {
49332    int test_ret = 0;
49333
49334#if defined(LIBXML_XPATH_ENABLED)
49335    int mem_base;
49336    xmlChar * ret_val;
49337    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49338    int n_ctxt;
49339
49340    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49341        mem_base = xmlMemBlocks();
49342        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49343
49344        ret_val = xmlXPathPopString(ctxt);
49345        desret_xmlChar_ptr(ret_val);
49346        call_tests++;
49347        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49348        xmlResetLastError();
49349        if (mem_base != xmlMemBlocks()) {
49350            printf("Leak of %d blocks found in xmlXPathPopString",
49351	           xmlMemBlocks() - mem_base);
49352	    test_ret++;
49353            printf(" %d", n_ctxt);
49354            printf("\n");
49355        }
49356    }
49357    function_tests++;
49358#endif
49359
49360    return(test_ret);
49361}
49362
49363
49364static int
49365test_xmlXPathPositionFunction(void) {
49366    int test_ret = 0;
49367
49368#if defined(LIBXML_XPATH_ENABLED)
49369    int mem_base;
49370    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49371    int n_ctxt;
49372    int nargs; /* the number of arguments */
49373    int n_nargs;
49374
49375    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49376    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49377        mem_base = xmlMemBlocks();
49378        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49379        nargs = gen_int(n_nargs, 1);
49380
49381        xmlXPathPositionFunction(ctxt, nargs);
49382        call_tests++;
49383        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49384        des_int(n_nargs, nargs, 1);
49385        xmlResetLastError();
49386        if (mem_base != xmlMemBlocks()) {
49387            printf("Leak of %d blocks found in xmlXPathPositionFunction",
49388	           xmlMemBlocks() - mem_base);
49389	    test_ret++;
49390            printf(" %d", n_ctxt);
49391            printf(" %d", n_nargs);
49392            printf("\n");
49393        }
49394    }
49395    }
49396    function_tests++;
49397#endif
49398
49399    return(test_ret);
49400}
49401
49402
49403static int
49404test_xmlXPathRegisterAllFunctions(void) {
49405    int test_ret = 0;
49406
49407#if defined(LIBXML_XPATH_ENABLED)
49408    int mem_base;
49409    xmlXPathContextPtr ctxt; /* the XPath context */
49410    int n_ctxt;
49411
49412    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49413        mem_base = xmlMemBlocks();
49414        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49415
49416        xmlXPathRegisterAllFunctions(ctxt);
49417        call_tests++;
49418        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49419        xmlResetLastError();
49420        if (mem_base != xmlMemBlocks()) {
49421            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49422	           xmlMemBlocks() - mem_base);
49423	    test_ret++;
49424            printf(" %d", n_ctxt);
49425            printf("\n");
49426        }
49427    }
49428    function_tests++;
49429#endif
49430
49431    return(test_ret);
49432}
49433
49434
49435static int
49436test_xmlXPathRegisterFunc(void) {
49437    int test_ret = 0;
49438
49439
49440    /* missing type support */
49441    return(test_ret);
49442}
49443
49444
49445static int
49446test_xmlXPathRegisterFuncLookup(void) {
49447    int test_ret = 0;
49448
49449
49450    /* missing type support */
49451    return(test_ret);
49452}
49453
49454
49455static int
49456test_xmlXPathRegisterFuncNS(void) {
49457    int test_ret = 0;
49458
49459
49460    /* missing type support */
49461    return(test_ret);
49462}
49463
49464
49465static int
49466test_xmlXPathRegisterNs(void) {
49467    int test_ret = 0;
49468
49469#if defined(LIBXML_XPATH_ENABLED)
49470    int mem_base;
49471    int ret_val;
49472    xmlXPathContextPtr ctxt; /* the XPath context */
49473    int n_ctxt;
49474    xmlChar * prefix; /* the namespace prefix */
49475    int n_prefix;
49476    xmlChar * ns_uri; /* the namespace name */
49477    int n_ns_uri;
49478
49479    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49480    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49481    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49482        mem_base = xmlMemBlocks();
49483        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49484        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49485        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49486
49487        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49488        desret_int(ret_val);
49489        call_tests++;
49490        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49491        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49492        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49493        xmlResetLastError();
49494        if (mem_base != xmlMemBlocks()) {
49495            printf("Leak of %d blocks found in xmlXPathRegisterNs",
49496	           xmlMemBlocks() - mem_base);
49497	    test_ret++;
49498            printf(" %d", n_ctxt);
49499            printf(" %d", n_prefix);
49500            printf(" %d", n_ns_uri);
49501            printf("\n");
49502        }
49503    }
49504    }
49505    }
49506    function_tests++;
49507#endif
49508
49509    return(test_ret);
49510}
49511
49512
49513static int
49514test_xmlXPathRegisterVariable(void) {
49515    int test_ret = 0;
49516
49517#if defined(LIBXML_XPATH_ENABLED)
49518    int mem_base;
49519    int ret_val;
49520    xmlXPathContextPtr ctxt; /* the XPath context */
49521    int n_ctxt;
49522    xmlChar * name; /* the variable name */
49523    int n_name;
49524    xmlXPathObjectPtr value; /* the variable value or NULL */
49525    int n_value;
49526
49527    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49528    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49529    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49530        mem_base = xmlMemBlocks();
49531        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49532        name = gen_const_xmlChar_ptr(n_name, 1);
49533        value = gen_xmlXPathObjectPtr(n_value, 2);
49534
49535        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49536        desret_int(ret_val);
49537        call_tests++;
49538        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49539        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49540        des_xmlXPathObjectPtr(n_value, value, 2);
49541        xmlResetLastError();
49542        if (mem_base != xmlMemBlocks()) {
49543            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49544	           xmlMemBlocks() - mem_base);
49545	    test_ret++;
49546            printf(" %d", n_ctxt);
49547            printf(" %d", n_name);
49548            printf(" %d", n_value);
49549            printf("\n");
49550        }
49551    }
49552    }
49553    }
49554    function_tests++;
49555#endif
49556
49557    return(test_ret);
49558}
49559
49560
49561static int
49562test_xmlXPathRegisterVariableLookup(void) {
49563    int test_ret = 0;
49564
49565
49566    /* missing type support */
49567    return(test_ret);
49568}
49569
49570
49571static int
49572test_xmlXPathRegisterVariableNS(void) {
49573    int test_ret = 0;
49574
49575#if defined(LIBXML_XPATH_ENABLED)
49576    int mem_base;
49577    int ret_val;
49578    xmlXPathContextPtr ctxt; /* the XPath context */
49579    int n_ctxt;
49580    xmlChar * name; /* the variable name */
49581    int n_name;
49582    xmlChar * ns_uri; /* the variable namespace URI */
49583    int n_ns_uri;
49584    xmlXPathObjectPtr value; /* the variable value or NULL */
49585    int n_value;
49586
49587    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49588    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49589    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49590    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49591        mem_base = xmlMemBlocks();
49592        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49593        name = gen_const_xmlChar_ptr(n_name, 1);
49594        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49595        value = gen_xmlXPathObjectPtr(n_value, 3);
49596
49597        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49598        desret_int(ret_val);
49599        call_tests++;
49600        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49601        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49602        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49603        des_xmlXPathObjectPtr(n_value, value, 3);
49604        xmlResetLastError();
49605        if (mem_base != xmlMemBlocks()) {
49606            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49607	           xmlMemBlocks() - mem_base);
49608	    test_ret++;
49609            printf(" %d", n_ctxt);
49610            printf(" %d", n_name);
49611            printf(" %d", n_ns_uri);
49612            printf(" %d", n_value);
49613            printf("\n");
49614        }
49615    }
49616    }
49617    }
49618    }
49619    function_tests++;
49620#endif
49621
49622    return(test_ret);
49623}
49624
49625
49626static int
49627test_xmlXPathRegisteredFuncsCleanup(void) {
49628    int test_ret = 0;
49629
49630#if defined(LIBXML_XPATH_ENABLED)
49631    int mem_base;
49632    xmlXPathContextPtr ctxt; /* the XPath context */
49633    int n_ctxt;
49634
49635    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49636        mem_base = xmlMemBlocks();
49637        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49638
49639        xmlXPathRegisteredFuncsCleanup(ctxt);
49640        call_tests++;
49641        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49642        xmlResetLastError();
49643        if (mem_base != xmlMemBlocks()) {
49644            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49645	           xmlMemBlocks() - mem_base);
49646	    test_ret++;
49647            printf(" %d", n_ctxt);
49648            printf("\n");
49649        }
49650    }
49651    function_tests++;
49652#endif
49653
49654    return(test_ret);
49655}
49656
49657
49658static int
49659test_xmlXPathRegisteredNsCleanup(void) {
49660    int test_ret = 0;
49661
49662#if defined(LIBXML_XPATH_ENABLED)
49663    int mem_base;
49664    xmlXPathContextPtr ctxt; /* the XPath context */
49665    int n_ctxt;
49666
49667    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49668        mem_base = xmlMemBlocks();
49669        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49670
49671        xmlXPathRegisteredNsCleanup(ctxt);
49672        call_tests++;
49673        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49674        xmlResetLastError();
49675        if (mem_base != xmlMemBlocks()) {
49676            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49677	           xmlMemBlocks() - mem_base);
49678	    test_ret++;
49679            printf(" %d", n_ctxt);
49680            printf("\n");
49681        }
49682    }
49683    function_tests++;
49684#endif
49685
49686    return(test_ret);
49687}
49688
49689
49690static int
49691test_xmlXPathRegisteredVariablesCleanup(void) {
49692    int test_ret = 0;
49693
49694#if defined(LIBXML_XPATH_ENABLED)
49695    int mem_base;
49696    xmlXPathContextPtr ctxt; /* the XPath context */
49697    int n_ctxt;
49698
49699    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49700        mem_base = xmlMemBlocks();
49701        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49702
49703        xmlXPathRegisteredVariablesCleanup(ctxt);
49704        call_tests++;
49705        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49706        xmlResetLastError();
49707        if (mem_base != xmlMemBlocks()) {
49708            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49709	           xmlMemBlocks() - mem_base);
49710	    test_ret++;
49711            printf(" %d", n_ctxt);
49712            printf("\n");
49713        }
49714    }
49715    function_tests++;
49716#endif
49717
49718    return(test_ret);
49719}
49720
49721
49722static int
49723test_xmlXPathRoot(void) {
49724    int test_ret = 0;
49725
49726#if defined(LIBXML_XPATH_ENABLED)
49727    int mem_base;
49728    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49729    int n_ctxt;
49730
49731    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49732        mem_base = xmlMemBlocks();
49733        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49734
49735        xmlXPathRoot(ctxt);
49736        call_tests++;
49737        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49738        xmlResetLastError();
49739        if (mem_base != xmlMemBlocks()) {
49740            printf("Leak of %d blocks found in xmlXPathRoot",
49741	           xmlMemBlocks() - mem_base);
49742	    test_ret++;
49743            printf(" %d", n_ctxt);
49744            printf("\n");
49745        }
49746    }
49747    function_tests++;
49748#endif
49749
49750    return(test_ret);
49751}
49752
49753
49754static int
49755test_xmlXPathRoundFunction(void) {
49756    int test_ret = 0;
49757
49758#if defined(LIBXML_XPATH_ENABLED)
49759    int mem_base;
49760    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49761    int n_ctxt;
49762    int nargs; /* the number of arguments */
49763    int n_nargs;
49764
49765    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49766    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49767        mem_base = xmlMemBlocks();
49768        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49769        nargs = gen_int(n_nargs, 1);
49770
49771        xmlXPathRoundFunction(ctxt, nargs);
49772        call_tests++;
49773        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49774        des_int(n_nargs, nargs, 1);
49775        xmlResetLastError();
49776        if (mem_base != xmlMemBlocks()) {
49777            printf("Leak of %d blocks found in xmlXPathRoundFunction",
49778	           xmlMemBlocks() - mem_base);
49779	    test_ret++;
49780            printf(" %d", n_ctxt);
49781            printf(" %d", n_nargs);
49782            printf("\n");
49783        }
49784    }
49785    }
49786    function_tests++;
49787#endif
49788
49789    return(test_ret);
49790}
49791
49792
49793static int
49794test_xmlXPathStartsWithFunction(void) {
49795    int test_ret = 0;
49796
49797#if defined(LIBXML_XPATH_ENABLED)
49798    int mem_base;
49799    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49800    int n_ctxt;
49801    int nargs; /* the number of arguments */
49802    int n_nargs;
49803
49804    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49805    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49806        mem_base = xmlMemBlocks();
49807        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49808        nargs = gen_int(n_nargs, 1);
49809
49810        xmlXPathStartsWithFunction(ctxt, nargs);
49811        call_tests++;
49812        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49813        des_int(n_nargs, nargs, 1);
49814        xmlResetLastError();
49815        if (mem_base != xmlMemBlocks()) {
49816            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49817	           xmlMemBlocks() - mem_base);
49818	    test_ret++;
49819            printf(" %d", n_ctxt);
49820            printf(" %d", n_nargs);
49821            printf("\n");
49822        }
49823    }
49824    }
49825    function_tests++;
49826#endif
49827
49828    return(test_ret);
49829}
49830
49831
49832static int
49833test_xmlXPathStringEvalNumber(void) {
49834    int test_ret = 0;
49835
49836#if defined(LIBXML_XPATH_ENABLED)
49837    int mem_base;
49838    double ret_val;
49839    xmlChar * str; /* A string to scan */
49840    int n_str;
49841
49842    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
49843        mem_base = xmlMemBlocks();
49844        str = gen_const_xmlChar_ptr(n_str, 0);
49845
49846        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
49847        desret_double(ret_val);
49848        call_tests++;
49849        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
49850        xmlResetLastError();
49851        if (mem_base != xmlMemBlocks()) {
49852            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
49853	           xmlMemBlocks() - mem_base);
49854	    test_ret++;
49855            printf(" %d", n_str);
49856            printf("\n");
49857        }
49858    }
49859    function_tests++;
49860#endif
49861
49862    return(test_ret);
49863}
49864
49865
49866static int
49867test_xmlXPathStringFunction(void) {
49868    int test_ret = 0;
49869
49870#if defined(LIBXML_XPATH_ENABLED)
49871    int mem_base;
49872    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49873    int n_ctxt;
49874    int nargs; /* the number of arguments */
49875    int n_nargs;
49876
49877    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49878    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49879        mem_base = xmlMemBlocks();
49880        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49881        nargs = gen_int(n_nargs, 1);
49882
49883        xmlXPathStringFunction(ctxt, nargs);
49884        call_tests++;
49885        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49886        des_int(n_nargs, nargs, 1);
49887        xmlResetLastError();
49888        if (mem_base != xmlMemBlocks()) {
49889            printf("Leak of %d blocks found in xmlXPathStringFunction",
49890	           xmlMemBlocks() - mem_base);
49891	    test_ret++;
49892            printf(" %d", n_ctxt);
49893            printf(" %d", n_nargs);
49894            printf("\n");
49895        }
49896    }
49897    }
49898    function_tests++;
49899#endif
49900
49901    return(test_ret);
49902}
49903
49904
49905static int
49906test_xmlXPathStringLengthFunction(void) {
49907    int test_ret = 0;
49908
49909#if defined(LIBXML_XPATH_ENABLED)
49910    int mem_base;
49911    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49912    int n_ctxt;
49913    int nargs; /* the number of arguments */
49914    int n_nargs;
49915
49916    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49917    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49918        mem_base = xmlMemBlocks();
49919        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49920        nargs = gen_int(n_nargs, 1);
49921
49922        xmlXPathStringLengthFunction(ctxt, nargs);
49923        call_tests++;
49924        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49925        des_int(n_nargs, nargs, 1);
49926        xmlResetLastError();
49927        if (mem_base != xmlMemBlocks()) {
49928            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
49929	           xmlMemBlocks() - mem_base);
49930	    test_ret++;
49931            printf(" %d", n_ctxt);
49932            printf(" %d", n_nargs);
49933            printf("\n");
49934        }
49935    }
49936    }
49937    function_tests++;
49938#endif
49939
49940    return(test_ret);
49941}
49942
49943
49944static int
49945test_xmlXPathSubValues(void) {
49946    int test_ret = 0;
49947
49948#if defined(LIBXML_XPATH_ENABLED)
49949    int mem_base;
49950    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49951    int n_ctxt;
49952
49953    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49954        mem_base = xmlMemBlocks();
49955        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49956
49957        xmlXPathSubValues(ctxt);
49958        call_tests++;
49959        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49960        xmlResetLastError();
49961        if (mem_base != xmlMemBlocks()) {
49962            printf("Leak of %d blocks found in xmlXPathSubValues",
49963	           xmlMemBlocks() - mem_base);
49964	    test_ret++;
49965            printf(" %d", n_ctxt);
49966            printf("\n");
49967        }
49968    }
49969    function_tests++;
49970#endif
49971
49972    return(test_ret);
49973}
49974
49975
49976static int
49977test_xmlXPathSubstringAfterFunction(void) {
49978    int test_ret = 0;
49979
49980#if defined(LIBXML_XPATH_ENABLED)
49981    int mem_base;
49982    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49983    int n_ctxt;
49984    int nargs; /* the number of arguments */
49985    int n_nargs;
49986
49987    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49988    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49989        mem_base = xmlMemBlocks();
49990        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49991        nargs = gen_int(n_nargs, 1);
49992
49993        xmlXPathSubstringAfterFunction(ctxt, nargs);
49994        call_tests++;
49995        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49996        des_int(n_nargs, nargs, 1);
49997        xmlResetLastError();
49998        if (mem_base != xmlMemBlocks()) {
49999            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50000	           xmlMemBlocks() - mem_base);
50001	    test_ret++;
50002            printf(" %d", n_ctxt);
50003            printf(" %d", n_nargs);
50004            printf("\n");
50005        }
50006    }
50007    }
50008    function_tests++;
50009#endif
50010
50011    return(test_ret);
50012}
50013
50014
50015static int
50016test_xmlXPathSubstringBeforeFunction(void) {
50017    int test_ret = 0;
50018
50019#if defined(LIBXML_XPATH_ENABLED)
50020    int mem_base;
50021    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50022    int n_ctxt;
50023    int nargs; /* the number of arguments */
50024    int n_nargs;
50025
50026    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50027    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50028        mem_base = xmlMemBlocks();
50029        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50030        nargs = gen_int(n_nargs, 1);
50031
50032        xmlXPathSubstringBeforeFunction(ctxt, nargs);
50033        call_tests++;
50034        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50035        des_int(n_nargs, nargs, 1);
50036        xmlResetLastError();
50037        if (mem_base != xmlMemBlocks()) {
50038            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50039	           xmlMemBlocks() - mem_base);
50040	    test_ret++;
50041            printf(" %d", n_ctxt);
50042            printf(" %d", n_nargs);
50043            printf("\n");
50044        }
50045    }
50046    }
50047    function_tests++;
50048#endif
50049
50050    return(test_ret);
50051}
50052
50053
50054static int
50055test_xmlXPathSubstringFunction(void) {
50056    int test_ret = 0;
50057
50058#if defined(LIBXML_XPATH_ENABLED)
50059    int mem_base;
50060    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50061    int n_ctxt;
50062    int nargs; /* the number of arguments */
50063    int n_nargs;
50064
50065    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50066    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50067        mem_base = xmlMemBlocks();
50068        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50069        nargs = gen_int(n_nargs, 1);
50070
50071        xmlXPathSubstringFunction(ctxt, nargs);
50072        call_tests++;
50073        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50074        des_int(n_nargs, nargs, 1);
50075        xmlResetLastError();
50076        if (mem_base != xmlMemBlocks()) {
50077            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50078	           xmlMemBlocks() - mem_base);
50079	    test_ret++;
50080            printf(" %d", n_ctxt);
50081            printf(" %d", n_nargs);
50082            printf("\n");
50083        }
50084    }
50085    }
50086    function_tests++;
50087#endif
50088
50089    return(test_ret);
50090}
50091
50092
50093static int
50094test_xmlXPathSumFunction(void) {
50095    int test_ret = 0;
50096
50097#if defined(LIBXML_XPATH_ENABLED)
50098    int mem_base;
50099    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50100    int n_ctxt;
50101    int nargs; /* the number of arguments */
50102    int n_nargs;
50103
50104    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50105    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50106        mem_base = xmlMemBlocks();
50107        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50108        nargs = gen_int(n_nargs, 1);
50109
50110        xmlXPathSumFunction(ctxt, nargs);
50111        call_tests++;
50112        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50113        des_int(n_nargs, nargs, 1);
50114        xmlResetLastError();
50115        if (mem_base != xmlMemBlocks()) {
50116            printf("Leak of %d blocks found in xmlXPathSumFunction",
50117	           xmlMemBlocks() - mem_base);
50118	    test_ret++;
50119            printf(" %d", n_ctxt);
50120            printf(" %d", n_nargs);
50121            printf("\n");
50122        }
50123    }
50124    }
50125    function_tests++;
50126#endif
50127
50128    return(test_ret);
50129}
50130
50131
50132static int
50133test_xmlXPathTrailing(void) {
50134    int test_ret = 0;
50135
50136#if defined(LIBXML_XPATH_ENABLED)
50137    int mem_base;
50138    xmlNodeSetPtr ret_val;
50139    xmlNodeSetPtr nodes1; /* a node-set */
50140    int n_nodes1;
50141    xmlNodeSetPtr nodes2; /* a node-set */
50142    int n_nodes2;
50143
50144    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50145    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50146        mem_base = xmlMemBlocks();
50147        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50148        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50149
50150        ret_val = xmlXPathTrailing(nodes1, nodes2);
50151        desret_xmlNodeSetPtr(ret_val);
50152        call_tests++;
50153        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50154        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50155        xmlResetLastError();
50156        if (mem_base != xmlMemBlocks()) {
50157            printf("Leak of %d blocks found in xmlXPathTrailing",
50158	           xmlMemBlocks() - mem_base);
50159	    test_ret++;
50160            printf(" %d", n_nodes1);
50161            printf(" %d", n_nodes2);
50162            printf("\n");
50163        }
50164    }
50165    }
50166    function_tests++;
50167#endif
50168
50169    return(test_ret);
50170}
50171
50172
50173static int
50174test_xmlXPathTrailingSorted(void) {
50175    int test_ret = 0;
50176
50177#if defined(LIBXML_XPATH_ENABLED)
50178    int mem_base;
50179    xmlNodeSetPtr ret_val;
50180    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50181    int n_nodes1;
50182    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50183    int n_nodes2;
50184
50185    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50186    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50187        mem_base = xmlMemBlocks();
50188        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50189        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50190
50191        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50192        desret_xmlNodeSetPtr(ret_val);
50193        call_tests++;
50194        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50195        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50196        xmlResetLastError();
50197        if (mem_base != xmlMemBlocks()) {
50198            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50199	           xmlMemBlocks() - mem_base);
50200	    test_ret++;
50201            printf(" %d", n_nodes1);
50202            printf(" %d", n_nodes2);
50203            printf("\n");
50204        }
50205    }
50206    }
50207    function_tests++;
50208#endif
50209
50210    return(test_ret);
50211}
50212
50213
50214static int
50215test_xmlXPathTranslateFunction(void) {
50216    int test_ret = 0;
50217
50218#if defined(LIBXML_XPATH_ENABLED)
50219    int mem_base;
50220    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50221    int n_ctxt;
50222    int nargs; /* the number of arguments */
50223    int n_nargs;
50224
50225    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50226    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50227        mem_base = xmlMemBlocks();
50228        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50229        nargs = gen_int(n_nargs, 1);
50230
50231        xmlXPathTranslateFunction(ctxt, nargs);
50232        call_tests++;
50233        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50234        des_int(n_nargs, nargs, 1);
50235        xmlResetLastError();
50236        if (mem_base != xmlMemBlocks()) {
50237            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50238	           xmlMemBlocks() - mem_base);
50239	    test_ret++;
50240            printf(" %d", n_ctxt);
50241            printf(" %d", n_nargs);
50242            printf("\n");
50243        }
50244    }
50245    }
50246    function_tests++;
50247#endif
50248
50249    return(test_ret);
50250}
50251
50252
50253static int
50254test_xmlXPathTrueFunction(void) {
50255    int test_ret = 0;
50256
50257#if defined(LIBXML_XPATH_ENABLED)
50258    int mem_base;
50259    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50260    int n_ctxt;
50261    int nargs; /* the number of arguments */
50262    int n_nargs;
50263
50264    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50265    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50266        mem_base = xmlMemBlocks();
50267        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50268        nargs = gen_int(n_nargs, 1);
50269
50270        xmlXPathTrueFunction(ctxt, nargs);
50271        call_tests++;
50272        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50273        des_int(n_nargs, nargs, 1);
50274        xmlResetLastError();
50275        if (mem_base != xmlMemBlocks()) {
50276            printf("Leak of %d blocks found in xmlXPathTrueFunction",
50277	           xmlMemBlocks() - mem_base);
50278	    test_ret++;
50279            printf(" %d", n_ctxt);
50280            printf(" %d", n_nargs);
50281            printf("\n");
50282        }
50283    }
50284    }
50285    function_tests++;
50286#endif
50287
50288    return(test_ret);
50289}
50290
50291
50292static int
50293test_xmlXPathValueFlipSign(void) {
50294    int test_ret = 0;
50295
50296#if defined(LIBXML_XPATH_ENABLED)
50297    int mem_base;
50298    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50299    int n_ctxt;
50300
50301    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50302        mem_base = xmlMemBlocks();
50303        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50304
50305        xmlXPathValueFlipSign(ctxt);
50306        call_tests++;
50307        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50308        xmlResetLastError();
50309        if (mem_base != xmlMemBlocks()) {
50310            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50311	           xmlMemBlocks() - mem_base);
50312	    test_ret++;
50313            printf(" %d", n_ctxt);
50314            printf("\n");
50315        }
50316    }
50317    function_tests++;
50318#endif
50319
50320    return(test_ret);
50321}
50322
50323
50324static int
50325test_xmlXPathVariableLookup(void) {
50326    int test_ret = 0;
50327
50328#if defined(LIBXML_XPATH_ENABLED)
50329    int mem_base;
50330    xmlXPathObjectPtr ret_val;
50331    xmlXPathContextPtr ctxt; /* the XPath context */
50332    int n_ctxt;
50333    xmlChar * name; /* the variable name */
50334    int n_name;
50335
50336    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50337    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50338        mem_base = xmlMemBlocks();
50339        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50340        name = gen_const_xmlChar_ptr(n_name, 1);
50341
50342        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50343        desret_xmlXPathObjectPtr(ret_val);
50344        call_tests++;
50345        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50346        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50347        xmlResetLastError();
50348        if (mem_base != xmlMemBlocks()) {
50349            printf("Leak of %d blocks found in xmlXPathVariableLookup",
50350	           xmlMemBlocks() - mem_base);
50351	    test_ret++;
50352            printf(" %d", n_ctxt);
50353            printf(" %d", n_name);
50354            printf("\n");
50355        }
50356    }
50357    }
50358    function_tests++;
50359#endif
50360
50361    return(test_ret);
50362}
50363
50364
50365static int
50366test_xmlXPathVariableLookupNS(void) {
50367    int test_ret = 0;
50368
50369#if defined(LIBXML_XPATH_ENABLED)
50370    int mem_base;
50371    xmlXPathObjectPtr ret_val;
50372    xmlXPathContextPtr ctxt; /* the XPath context */
50373    int n_ctxt;
50374    xmlChar * name; /* the variable name */
50375    int n_name;
50376    xmlChar * ns_uri; /* the variable namespace URI */
50377    int n_ns_uri;
50378
50379    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50380    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50381    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50382        mem_base = xmlMemBlocks();
50383        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50384        name = gen_const_xmlChar_ptr(n_name, 1);
50385        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50386
50387        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50388        desret_xmlXPathObjectPtr(ret_val);
50389        call_tests++;
50390        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50391        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50392        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50393        xmlResetLastError();
50394        if (mem_base != xmlMemBlocks()) {
50395            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50396	           xmlMemBlocks() - mem_base);
50397	    test_ret++;
50398            printf(" %d", n_ctxt);
50399            printf(" %d", n_name);
50400            printf(" %d", n_ns_uri);
50401            printf("\n");
50402        }
50403    }
50404    }
50405    }
50406    function_tests++;
50407#endif
50408
50409    return(test_ret);
50410}
50411
50412
50413static int
50414test_xmlXPathWrapCString(void) {
50415    int test_ret = 0;
50416
50417#if defined(LIBXML_XPATH_ENABLED)
50418    int mem_base;
50419    xmlXPathObjectPtr ret_val;
50420    char * val; /* the char * value */
50421    int n_val;
50422
50423    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50424        mem_base = xmlMemBlocks();
50425        val = gen_char_ptr(n_val, 0);
50426
50427        ret_val = xmlXPathWrapCString(val);
50428        desret_xmlXPathObjectPtr(ret_val);
50429        call_tests++;
50430        des_char_ptr(n_val, val, 0);
50431        xmlResetLastError();
50432        if (mem_base != xmlMemBlocks()) {
50433            printf("Leak of %d blocks found in xmlXPathWrapCString",
50434	           xmlMemBlocks() - mem_base);
50435	    test_ret++;
50436            printf(" %d", n_val);
50437            printf("\n");
50438        }
50439    }
50440    function_tests++;
50441#endif
50442
50443    return(test_ret);
50444}
50445
50446
50447static int
50448test_xmlXPathWrapExternal(void) {
50449    int test_ret = 0;
50450
50451#if defined(LIBXML_XPATH_ENABLED)
50452    int mem_base;
50453    xmlXPathObjectPtr ret_val;
50454    void * val; /* the user data */
50455    int n_val;
50456
50457    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50458        mem_base = xmlMemBlocks();
50459        val = gen_void_ptr(n_val, 0);
50460
50461        ret_val = xmlXPathWrapExternal(val);
50462        desret_xmlXPathObjectPtr(ret_val);
50463        call_tests++;
50464        des_void_ptr(n_val, val, 0);
50465        xmlResetLastError();
50466        if (mem_base != xmlMemBlocks()) {
50467            printf("Leak of %d blocks found in xmlXPathWrapExternal",
50468	           xmlMemBlocks() - mem_base);
50469	    test_ret++;
50470            printf(" %d", n_val);
50471            printf("\n");
50472        }
50473    }
50474    function_tests++;
50475#endif
50476
50477    return(test_ret);
50478}
50479
50480
50481static int
50482test_xmlXPathWrapNodeSet(void) {
50483    int test_ret = 0;
50484
50485#if defined(LIBXML_XPATH_ENABLED)
50486    int mem_base;
50487    xmlXPathObjectPtr ret_val;
50488    xmlNodeSetPtr val; /* the NodePtr value */
50489    int n_val;
50490
50491    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50492        mem_base = xmlMemBlocks();
50493        val = gen_xmlNodeSetPtr(n_val, 0);
50494
50495        ret_val = xmlXPathWrapNodeSet(val);
50496        desret_xmlXPathObjectPtr(ret_val);
50497        call_tests++;
50498        des_xmlNodeSetPtr(n_val, val, 0);
50499        xmlResetLastError();
50500        if (mem_base != xmlMemBlocks()) {
50501            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50502	           xmlMemBlocks() - mem_base);
50503	    test_ret++;
50504            printf(" %d", n_val);
50505            printf("\n");
50506        }
50507    }
50508    function_tests++;
50509#endif
50510
50511    return(test_ret);
50512}
50513
50514
50515static int
50516test_xmlXPatherror(void) {
50517    int test_ret = 0;
50518
50519#if defined(LIBXML_XPATH_ENABLED)
50520    int mem_base;
50521    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50522    int n_ctxt;
50523    const char * file; /* the file name */
50524    int n_file;
50525    int line; /* the line number */
50526    int n_line;
50527    int no; /* the error number */
50528    int n_no;
50529
50530    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50531    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50532    for (n_line = 0;n_line < gen_nb_int;n_line++) {
50533    for (n_no = 0;n_no < gen_nb_int;n_no++) {
50534        mem_base = xmlMemBlocks();
50535        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50536        file = gen_filepath(n_file, 1);
50537        line = gen_int(n_line, 2);
50538        no = gen_int(n_no, 3);
50539
50540        xmlXPatherror(ctxt, file, line, no);
50541        call_tests++;
50542        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50543        des_filepath(n_file, file, 1);
50544        des_int(n_line, line, 2);
50545        des_int(n_no, no, 3);
50546        xmlResetLastError();
50547        if (mem_base != xmlMemBlocks()) {
50548            printf("Leak of %d blocks found in xmlXPatherror",
50549	           xmlMemBlocks() - mem_base);
50550	    test_ret++;
50551            printf(" %d", n_ctxt);
50552            printf(" %d", n_file);
50553            printf(" %d", n_line);
50554            printf(" %d", n_no);
50555            printf("\n");
50556        }
50557    }
50558    }
50559    }
50560    }
50561    function_tests++;
50562#endif
50563
50564    return(test_ret);
50565}
50566
50567static int
50568test_xpathInternals(void) {
50569    int test_ret = 0;
50570
50571    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50572    test_ret += test_valuePop();
50573    test_ret += test_valuePush();
50574    test_ret += test_xmlXPathAddValues();
50575    test_ret += test_xmlXPathBooleanFunction();
50576    test_ret += test_xmlXPathCeilingFunction();
50577    test_ret += test_xmlXPathCompareValues();
50578    test_ret += test_xmlXPathConcatFunction();
50579    test_ret += test_xmlXPathContainsFunction();
50580    test_ret += test_xmlXPathCountFunction();
50581    test_ret += test_xmlXPathDebugDumpCompExpr();
50582    test_ret += test_xmlXPathDebugDumpObject();
50583    test_ret += test_xmlXPathDifference();
50584    test_ret += test_xmlXPathDistinct();
50585    test_ret += test_xmlXPathDistinctSorted();
50586    test_ret += test_xmlXPathDivValues();
50587    test_ret += test_xmlXPathEqualValues();
50588    test_ret += test_xmlXPathErr();
50589    test_ret += test_xmlXPathEvalExpr();
50590    test_ret += test_xmlXPathEvaluatePredicateResult();
50591    test_ret += test_xmlXPathFalseFunction();
50592    test_ret += test_xmlXPathFloorFunction();
50593    test_ret += test_xmlXPathFunctionLookup();
50594    test_ret += test_xmlXPathFunctionLookupNS();
50595    test_ret += test_xmlXPathHasSameNodes();
50596    test_ret += test_xmlXPathIdFunction();
50597    test_ret += test_xmlXPathIntersection();
50598    test_ret += test_xmlXPathIsNodeType();
50599    test_ret += test_xmlXPathLangFunction();
50600    test_ret += test_xmlXPathLastFunction();
50601    test_ret += test_xmlXPathLeading();
50602    test_ret += test_xmlXPathLeadingSorted();
50603    test_ret += test_xmlXPathLocalNameFunction();
50604    test_ret += test_xmlXPathModValues();
50605    test_ret += test_xmlXPathMultValues();
50606    test_ret += test_xmlXPathNamespaceURIFunction();
50607    test_ret += test_xmlXPathNewBoolean();
50608    test_ret += test_xmlXPathNewCString();
50609    test_ret += test_xmlXPathNewFloat();
50610    test_ret += test_xmlXPathNewNodeSet();
50611    test_ret += test_xmlXPathNewNodeSetList();
50612    test_ret += test_xmlXPathNewParserContext();
50613    test_ret += test_xmlXPathNewString();
50614    test_ret += test_xmlXPathNextAncestor();
50615    test_ret += test_xmlXPathNextAncestorOrSelf();
50616    test_ret += test_xmlXPathNextAttribute();
50617    test_ret += test_xmlXPathNextChild();
50618    test_ret += test_xmlXPathNextDescendant();
50619    test_ret += test_xmlXPathNextDescendantOrSelf();
50620    test_ret += test_xmlXPathNextFollowing();
50621    test_ret += test_xmlXPathNextFollowingSibling();
50622    test_ret += test_xmlXPathNextNamespace();
50623    test_ret += test_xmlXPathNextParent();
50624    test_ret += test_xmlXPathNextPreceding();
50625    test_ret += test_xmlXPathNextPrecedingSibling();
50626    test_ret += test_xmlXPathNextSelf();
50627    test_ret += test_xmlXPathNodeLeading();
50628    test_ret += test_xmlXPathNodeLeadingSorted();
50629    test_ret += test_xmlXPathNodeSetAdd();
50630    test_ret += test_xmlXPathNodeSetAddNs();
50631    test_ret += test_xmlXPathNodeSetAddUnique();
50632    test_ret += test_xmlXPathNodeSetContains();
50633    test_ret += test_xmlXPathNodeSetDel();
50634    test_ret += test_xmlXPathNodeSetMerge();
50635    test_ret += test_xmlXPathNodeSetRemove();
50636    test_ret += test_xmlXPathNodeSetSort();
50637    test_ret += test_xmlXPathNodeTrailing();
50638    test_ret += test_xmlXPathNodeTrailingSorted();
50639    test_ret += test_xmlXPathNormalizeFunction();
50640    test_ret += test_xmlXPathNotEqualValues();
50641    test_ret += test_xmlXPathNotFunction();
50642    test_ret += test_xmlXPathNsLookup();
50643    test_ret += test_xmlXPathNumberFunction();
50644    test_ret += test_xmlXPathParseNCName();
50645    test_ret += test_xmlXPathParseName();
50646    test_ret += test_xmlXPathPopBoolean();
50647    test_ret += test_xmlXPathPopExternal();
50648    test_ret += test_xmlXPathPopNodeSet();
50649    test_ret += test_xmlXPathPopNumber();
50650    test_ret += test_xmlXPathPopString();
50651    test_ret += test_xmlXPathPositionFunction();
50652    test_ret += test_xmlXPathRegisterAllFunctions();
50653    test_ret += test_xmlXPathRegisterFunc();
50654    test_ret += test_xmlXPathRegisterFuncLookup();
50655    test_ret += test_xmlXPathRegisterFuncNS();
50656    test_ret += test_xmlXPathRegisterNs();
50657    test_ret += test_xmlXPathRegisterVariable();
50658    test_ret += test_xmlXPathRegisterVariableLookup();
50659    test_ret += test_xmlXPathRegisterVariableNS();
50660    test_ret += test_xmlXPathRegisteredFuncsCleanup();
50661    test_ret += test_xmlXPathRegisteredNsCleanup();
50662    test_ret += test_xmlXPathRegisteredVariablesCleanup();
50663    test_ret += test_xmlXPathRoot();
50664    test_ret += test_xmlXPathRoundFunction();
50665    test_ret += test_xmlXPathStartsWithFunction();
50666    test_ret += test_xmlXPathStringEvalNumber();
50667    test_ret += test_xmlXPathStringFunction();
50668    test_ret += test_xmlXPathStringLengthFunction();
50669    test_ret += test_xmlXPathSubValues();
50670    test_ret += test_xmlXPathSubstringAfterFunction();
50671    test_ret += test_xmlXPathSubstringBeforeFunction();
50672    test_ret += test_xmlXPathSubstringFunction();
50673    test_ret += test_xmlXPathSumFunction();
50674    test_ret += test_xmlXPathTrailing();
50675    test_ret += test_xmlXPathTrailingSorted();
50676    test_ret += test_xmlXPathTranslateFunction();
50677    test_ret += test_xmlXPathTrueFunction();
50678    test_ret += test_xmlXPathValueFlipSign();
50679    test_ret += test_xmlXPathVariableLookup();
50680    test_ret += test_xmlXPathVariableLookupNS();
50681    test_ret += test_xmlXPathWrapCString();
50682    test_ret += test_xmlXPathWrapExternal();
50683    test_ret += test_xmlXPathWrapNodeSet();
50684    test_ret += test_xmlXPatherror();
50685
50686    if (test_ret != 0)
50687	printf("Module xpathInternals: %d errors\n", test_ret);
50688    return(test_ret);
50689}
50690
50691static int
50692test_xmlXPtrBuildNodeList(void) {
50693    int test_ret = 0;
50694
50695#if defined(LIBXML_XPTR_ENABLED)
50696    int mem_base;
50697    xmlNodePtr ret_val;
50698    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50699    int n_obj;
50700
50701    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50702        mem_base = xmlMemBlocks();
50703        obj = gen_xmlXPathObjectPtr(n_obj, 0);
50704
50705        ret_val = xmlXPtrBuildNodeList(obj);
50706        desret_xmlNodePtr(ret_val);
50707        call_tests++;
50708        des_xmlXPathObjectPtr(n_obj, obj, 0);
50709        xmlResetLastError();
50710        if (mem_base != xmlMemBlocks()) {
50711            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50712	           xmlMemBlocks() - mem_base);
50713	    test_ret++;
50714            printf(" %d", n_obj);
50715            printf("\n");
50716        }
50717    }
50718    function_tests++;
50719#endif
50720
50721    return(test_ret);
50722}
50723
50724
50725static int
50726test_xmlXPtrEval(void) {
50727    int test_ret = 0;
50728
50729#if defined(LIBXML_XPTR_ENABLED)
50730    int mem_base;
50731    xmlXPathObjectPtr ret_val;
50732    xmlChar * str; /* the XPointer expression */
50733    int n_str;
50734    xmlXPathContextPtr ctx; /* the XPointer context */
50735    int n_ctx;
50736
50737    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50738    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50739        mem_base = xmlMemBlocks();
50740        str = gen_const_xmlChar_ptr(n_str, 0);
50741        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50742
50743        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50744        desret_xmlXPathObjectPtr(ret_val);
50745        call_tests++;
50746        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50747        des_xmlXPathContextPtr(n_ctx, ctx, 1);
50748        xmlResetLastError();
50749        if (mem_base != xmlMemBlocks()) {
50750            printf("Leak of %d blocks found in xmlXPtrEval",
50751	           xmlMemBlocks() - mem_base);
50752	    test_ret++;
50753            printf(" %d", n_str);
50754            printf(" %d", n_ctx);
50755            printf("\n");
50756        }
50757    }
50758    }
50759    function_tests++;
50760#endif
50761
50762    return(test_ret);
50763}
50764
50765
50766static int
50767test_xmlXPtrEvalRangePredicate(void) {
50768    int test_ret = 0;
50769
50770#if defined(LIBXML_XPTR_ENABLED)
50771    int mem_base;
50772    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50773    int n_ctxt;
50774
50775    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50776        mem_base = xmlMemBlocks();
50777        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50778
50779        xmlXPtrEvalRangePredicate(ctxt);
50780        call_tests++;
50781        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50782        xmlResetLastError();
50783        if (mem_base != xmlMemBlocks()) {
50784            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50785	           xmlMemBlocks() - mem_base);
50786	    test_ret++;
50787            printf(" %d", n_ctxt);
50788            printf("\n");
50789        }
50790    }
50791    function_tests++;
50792#endif
50793
50794    return(test_ret);
50795}
50796
50797#ifdef LIBXML_XPTR_ENABLED
50798
50799#define gen_nb_xmlLocationSetPtr 1
50800static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50801    return(NULL);
50802}
50803static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50804}
50805#endif
50806
50807
50808static int
50809test_xmlXPtrLocationSetAdd(void) {
50810    int test_ret = 0;
50811
50812#if defined(LIBXML_XPTR_ENABLED)
50813    int mem_base;
50814    xmlLocationSetPtr cur; /* the initial range set */
50815    int n_cur;
50816    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50817    int n_val;
50818
50819    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50820    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50821        mem_base = xmlMemBlocks();
50822        cur = gen_xmlLocationSetPtr(n_cur, 0);
50823        val = gen_xmlXPathObjectPtr(n_val, 1);
50824
50825        xmlXPtrLocationSetAdd(cur, val);
50826        call_tests++;
50827        des_xmlLocationSetPtr(n_cur, cur, 0);
50828        des_xmlXPathObjectPtr(n_val, val, 1);
50829        xmlResetLastError();
50830        if (mem_base != xmlMemBlocks()) {
50831            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
50832	           xmlMemBlocks() - mem_base);
50833	    test_ret++;
50834            printf(" %d", n_cur);
50835            printf(" %d", n_val);
50836            printf("\n");
50837        }
50838    }
50839    }
50840    function_tests++;
50841#endif
50842
50843    return(test_ret);
50844}
50845
50846
50847static int
50848test_xmlXPtrLocationSetCreate(void) {
50849    int test_ret = 0;
50850
50851
50852    /* missing type support */
50853    return(test_ret);
50854}
50855
50856
50857static int
50858test_xmlXPtrLocationSetDel(void) {
50859    int test_ret = 0;
50860
50861#if defined(LIBXML_XPTR_ENABLED)
50862    int mem_base;
50863    xmlLocationSetPtr cur; /* the initial range set */
50864    int n_cur;
50865    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
50866    int n_val;
50867
50868    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50869    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50870        mem_base = xmlMemBlocks();
50871        cur = gen_xmlLocationSetPtr(n_cur, 0);
50872        val = gen_xmlXPathObjectPtr(n_val, 1);
50873
50874        xmlXPtrLocationSetDel(cur, val);
50875        call_tests++;
50876        des_xmlLocationSetPtr(n_cur, cur, 0);
50877        des_xmlXPathObjectPtr(n_val, val, 1);
50878        xmlResetLastError();
50879        if (mem_base != xmlMemBlocks()) {
50880            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
50881	           xmlMemBlocks() - mem_base);
50882	    test_ret++;
50883            printf(" %d", n_cur);
50884            printf(" %d", n_val);
50885            printf("\n");
50886        }
50887    }
50888    }
50889    function_tests++;
50890#endif
50891
50892    return(test_ret);
50893}
50894
50895
50896static int
50897test_xmlXPtrLocationSetMerge(void) {
50898    int test_ret = 0;
50899
50900
50901    /* missing type support */
50902    return(test_ret);
50903}
50904
50905
50906static int
50907test_xmlXPtrLocationSetRemove(void) {
50908    int test_ret = 0;
50909
50910#if defined(LIBXML_XPTR_ENABLED)
50911    int mem_base;
50912    xmlLocationSetPtr cur; /* the initial range set */
50913    int n_cur;
50914    int val; /* the index to remove */
50915    int n_val;
50916
50917    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50918    for (n_val = 0;n_val < gen_nb_int;n_val++) {
50919        mem_base = xmlMemBlocks();
50920        cur = gen_xmlLocationSetPtr(n_cur, 0);
50921        val = gen_int(n_val, 1);
50922
50923        xmlXPtrLocationSetRemove(cur, val);
50924        call_tests++;
50925        des_xmlLocationSetPtr(n_cur, cur, 0);
50926        des_int(n_val, val, 1);
50927        xmlResetLastError();
50928        if (mem_base != xmlMemBlocks()) {
50929            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
50930	           xmlMemBlocks() - mem_base);
50931	    test_ret++;
50932            printf(" %d", n_cur);
50933            printf(" %d", n_val);
50934            printf("\n");
50935        }
50936    }
50937    }
50938    function_tests++;
50939#endif
50940
50941    return(test_ret);
50942}
50943
50944
50945static int
50946test_xmlXPtrNewCollapsedRange(void) {
50947    int test_ret = 0;
50948
50949#if defined(LIBXML_XPTR_ENABLED)
50950    int mem_base;
50951    xmlXPathObjectPtr ret_val;
50952    xmlNodePtr start; /* the starting and ending node */
50953    int n_start;
50954
50955    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50956        mem_base = xmlMemBlocks();
50957        start = gen_xmlNodePtr(n_start, 0);
50958
50959        ret_val = xmlXPtrNewCollapsedRange(start);
50960        desret_xmlXPathObjectPtr(ret_val);
50961        call_tests++;
50962        des_xmlNodePtr(n_start, start, 0);
50963        xmlResetLastError();
50964        if (mem_base != xmlMemBlocks()) {
50965            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
50966	           xmlMemBlocks() - mem_base);
50967	    test_ret++;
50968            printf(" %d", n_start);
50969            printf("\n");
50970        }
50971    }
50972    function_tests++;
50973#endif
50974
50975    return(test_ret);
50976}
50977
50978
50979static int
50980test_xmlXPtrNewContext(void) {
50981    int test_ret = 0;
50982
50983
50984    /* missing type support */
50985    return(test_ret);
50986}
50987
50988
50989static int
50990test_xmlXPtrNewLocationSetNodeSet(void) {
50991    int test_ret = 0;
50992
50993#if defined(LIBXML_XPTR_ENABLED)
50994    int mem_base;
50995    xmlXPathObjectPtr ret_val;
50996    xmlNodeSetPtr set; /* a node set */
50997    int n_set;
50998
50999    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51000        mem_base = xmlMemBlocks();
51001        set = gen_xmlNodeSetPtr(n_set, 0);
51002
51003        ret_val = xmlXPtrNewLocationSetNodeSet(set);
51004        desret_xmlXPathObjectPtr(ret_val);
51005        call_tests++;
51006        des_xmlNodeSetPtr(n_set, set, 0);
51007        xmlResetLastError();
51008        if (mem_base != xmlMemBlocks()) {
51009            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51010	           xmlMemBlocks() - mem_base);
51011	    test_ret++;
51012            printf(" %d", n_set);
51013            printf("\n");
51014        }
51015    }
51016    function_tests++;
51017#endif
51018
51019    return(test_ret);
51020}
51021
51022
51023static int
51024test_xmlXPtrNewLocationSetNodes(void) {
51025    int test_ret = 0;
51026
51027#if defined(LIBXML_XPTR_ENABLED)
51028    int mem_base;
51029    xmlXPathObjectPtr ret_val;
51030    xmlNodePtr start; /* the start NodePtr value */
51031    int n_start;
51032    xmlNodePtr end; /* the end NodePtr value or NULL */
51033    int n_end;
51034
51035    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51036    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51037        mem_base = xmlMemBlocks();
51038        start = gen_xmlNodePtr(n_start, 0);
51039        end = gen_xmlNodePtr(n_end, 1);
51040
51041        ret_val = xmlXPtrNewLocationSetNodes(start, end);
51042        desret_xmlXPathObjectPtr(ret_val);
51043        call_tests++;
51044        des_xmlNodePtr(n_start, start, 0);
51045        des_xmlNodePtr(n_end, end, 1);
51046        xmlResetLastError();
51047        if (mem_base != xmlMemBlocks()) {
51048            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51049	           xmlMemBlocks() - mem_base);
51050	    test_ret++;
51051            printf(" %d", n_start);
51052            printf(" %d", n_end);
51053            printf("\n");
51054        }
51055    }
51056    }
51057    function_tests++;
51058#endif
51059
51060    return(test_ret);
51061}
51062
51063
51064static int
51065test_xmlXPtrNewRange(void) {
51066    int test_ret = 0;
51067
51068#if defined(LIBXML_XPTR_ENABLED)
51069    int mem_base;
51070    xmlXPathObjectPtr ret_val;
51071    xmlNodePtr start; /* the starting node */
51072    int n_start;
51073    int startindex; /* the start index */
51074    int n_startindex;
51075    xmlNodePtr end; /* the ending point */
51076    int n_end;
51077    int endindex; /* the ending index */
51078    int n_endindex;
51079
51080    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51081    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51082    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51083    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51084        mem_base = xmlMemBlocks();
51085        start = gen_xmlNodePtr(n_start, 0);
51086        startindex = gen_int(n_startindex, 1);
51087        end = gen_xmlNodePtr(n_end, 2);
51088        endindex = gen_int(n_endindex, 3);
51089
51090        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51091        desret_xmlXPathObjectPtr(ret_val);
51092        call_tests++;
51093        des_xmlNodePtr(n_start, start, 0);
51094        des_int(n_startindex, startindex, 1);
51095        des_xmlNodePtr(n_end, end, 2);
51096        des_int(n_endindex, endindex, 3);
51097        xmlResetLastError();
51098        if (mem_base != xmlMemBlocks()) {
51099            printf("Leak of %d blocks found in xmlXPtrNewRange",
51100	           xmlMemBlocks() - mem_base);
51101	    test_ret++;
51102            printf(" %d", n_start);
51103            printf(" %d", n_startindex);
51104            printf(" %d", n_end);
51105            printf(" %d", n_endindex);
51106            printf("\n");
51107        }
51108    }
51109    }
51110    }
51111    }
51112    function_tests++;
51113#endif
51114
51115    return(test_ret);
51116}
51117
51118
51119static int
51120test_xmlXPtrNewRangeNodeObject(void) {
51121    int test_ret = 0;
51122
51123#if defined(LIBXML_XPTR_ENABLED)
51124    int mem_base;
51125    xmlXPathObjectPtr ret_val;
51126    xmlNodePtr start; /* the starting node */
51127    int n_start;
51128    xmlXPathObjectPtr end; /* the ending object */
51129    int n_end;
51130
51131    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51132    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51133        mem_base = xmlMemBlocks();
51134        start = gen_xmlNodePtr(n_start, 0);
51135        end = gen_xmlXPathObjectPtr(n_end, 1);
51136
51137        ret_val = xmlXPtrNewRangeNodeObject(start, end);
51138        desret_xmlXPathObjectPtr(ret_val);
51139        call_tests++;
51140        des_xmlNodePtr(n_start, start, 0);
51141        des_xmlXPathObjectPtr(n_end, end, 1);
51142        xmlResetLastError();
51143        if (mem_base != xmlMemBlocks()) {
51144            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51145	           xmlMemBlocks() - mem_base);
51146	    test_ret++;
51147            printf(" %d", n_start);
51148            printf(" %d", n_end);
51149            printf("\n");
51150        }
51151    }
51152    }
51153    function_tests++;
51154#endif
51155
51156    return(test_ret);
51157}
51158
51159
51160static int
51161test_xmlXPtrNewRangeNodePoint(void) {
51162    int test_ret = 0;
51163
51164#if defined(LIBXML_XPTR_ENABLED)
51165    int mem_base;
51166    xmlXPathObjectPtr ret_val;
51167    xmlNodePtr start; /* the starting node */
51168    int n_start;
51169    xmlXPathObjectPtr end; /* the ending point */
51170    int n_end;
51171
51172    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51173    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51174        mem_base = xmlMemBlocks();
51175        start = gen_xmlNodePtr(n_start, 0);
51176        end = gen_xmlXPathObjectPtr(n_end, 1);
51177
51178        ret_val = xmlXPtrNewRangeNodePoint(start, end);
51179        desret_xmlXPathObjectPtr(ret_val);
51180        call_tests++;
51181        des_xmlNodePtr(n_start, start, 0);
51182        des_xmlXPathObjectPtr(n_end, end, 1);
51183        xmlResetLastError();
51184        if (mem_base != xmlMemBlocks()) {
51185            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51186	           xmlMemBlocks() - mem_base);
51187	    test_ret++;
51188            printf(" %d", n_start);
51189            printf(" %d", n_end);
51190            printf("\n");
51191        }
51192    }
51193    }
51194    function_tests++;
51195#endif
51196
51197    return(test_ret);
51198}
51199
51200
51201static int
51202test_xmlXPtrNewRangeNodes(void) {
51203    int test_ret = 0;
51204
51205#if defined(LIBXML_XPTR_ENABLED)
51206    int mem_base;
51207    xmlXPathObjectPtr ret_val;
51208    xmlNodePtr start; /* the starting node */
51209    int n_start;
51210    xmlNodePtr end; /* the ending node */
51211    int n_end;
51212
51213    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51214    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51215        mem_base = xmlMemBlocks();
51216        start = gen_xmlNodePtr(n_start, 0);
51217        end = gen_xmlNodePtr(n_end, 1);
51218
51219        ret_val = xmlXPtrNewRangeNodes(start, end);
51220        desret_xmlXPathObjectPtr(ret_val);
51221        call_tests++;
51222        des_xmlNodePtr(n_start, start, 0);
51223        des_xmlNodePtr(n_end, end, 1);
51224        xmlResetLastError();
51225        if (mem_base != xmlMemBlocks()) {
51226            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51227	           xmlMemBlocks() - mem_base);
51228	    test_ret++;
51229            printf(" %d", n_start);
51230            printf(" %d", n_end);
51231            printf("\n");
51232        }
51233    }
51234    }
51235    function_tests++;
51236#endif
51237
51238    return(test_ret);
51239}
51240
51241
51242static int
51243test_xmlXPtrNewRangePointNode(void) {
51244    int test_ret = 0;
51245
51246#if defined(LIBXML_XPTR_ENABLED)
51247    int mem_base;
51248    xmlXPathObjectPtr ret_val;
51249    xmlXPathObjectPtr start; /* the starting point */
51250    int n_start;
51251    xmlNodePtr end; /* the ending node */
51252    int n_end;
51253
51254    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51255    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51256        mem_base = xmlMemBlocks();
51257        start = gen_xmlXPathObjectPtr(n_start, 0);
51258        end = gen_xmlNodePtr(n_end, 1);
51259
51260        ret_val = xmlXPtrNewRangePointNode(start, end);
51261        desret_xmlXPathObjectPtr(ret_val);
51262        call_tests++;
51263        des_xmlXPathObjectPtr(n_start, start, 0);
51264        des_xmlNodePtr(n_end, end, 1);
51265        xmlResetLastError();
51266        if (mem_base != xmlMemBlocks()) {
51267            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51268	           xmlMemBlocks() - mem_base);
51269	    test_ret++;
51270            printf(" %d", n_start);
51271            printf(" %d", n_end);
51272            printf("\n");
51273        }
51274    }
51275    }
51276    function_tests++;
51277#endif
51278
51279    return(test_ret);
51280}
51281
51282
51283static int
51284test_xmlXPtrNewRangePoints(void) {
51285    int test_ret = 0;
51286
51287#if defined(LIBXML_XPTR_ENABLED)
51288    int mem_base;
51289    xmlXPathObjectPtr ret_val;
51290    xmlXPathObjectPtr start; /* the starting point */
51291    int n_start;
51292    xmlXPathObjectPtr end; /* the ending point */
51293    int n_end;
51294
51295    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51296    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51297        mem_base = xmlMemBlocks();
51298        start = gen_xmlXPathObjectPtr(n_start, 0);
51299        end = gen_xmlXPathObjectPtr(n_end, 1);
51300
51301        ret_val = xmlXPtrNewRangePoints(start, end);
51302        desret_xmlXPathObjectPtr(ret_val);
51303        call_tests++;
51304        des_xmlXPathObjectPtr(n_start, start, 0);
51305        des_xmlXPathObjectPtr(n_end, end, 1);
51306        xmlResetLastError();
51307        if (mem_base != xmlMemBlocks()) {
51308            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51309	           xmlMemBlocks() - mem_base);
51310	    test_ret++;
51311            printf(" %d", n_start);
51312            printf(" %d", n_end);
51313            printf("\n");
51314        }
51315    }
51316    }
51317    function_tests++;
51318#endif
51319
51320    return(test_ret);
51321}
51322
51323
51324static int
51325test_xmlXPtrRangeToFunction(void) {
51326    int test_ret = 0;
51327
51328#if defined(LIBXML_XPTR_ENABLED)
51329    int mem_base;
51330    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51331    int n_ctxt;
51332    int nargs; /* the number of args */
51333    int n_nargs;
51334
51335    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51336    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51337        mem_base = xmlMemBlocks();
51338        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51339        nargs = gen_int(n_nargs, 1);
51340
51341        xmlXPtrRangeToFunction(ctxt, nargs);
51342        call_tests++;
51343        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51344        des_int(n_nargs, nargs, 1);
51345        xmlResetLastError();
51346        if (mem_base != xmlMemBlocks()) {
51347            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51348	           xmlMemBlocks() - mem_base);
51349	    test_ret++;
51350            printf(" %d", n_ctxt);
51351            printf(" %d", n_nargs);
51352            printf("\n");
51353        }
51354    }
51355    }
51356    function_tests++;
51357#endif
51358
51359    return(test_ret);
51360}
51361
51362
51363static int
51364test_xmlXPtrWrapLocationSet(void) {
51365    int test_ret = 0;
51366
51367#if defined(LIBXML_XPTR_ENABLED)
51368    int mem_base;
51369    xmlXPathObjectPtr ret_val;
51370    xmlLocationSetPtr val; /* the LocationSet value */
51371    int n_val;
51372
51373    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51374        mem_base = xmlMemBlocks();
51375        val = gen_xmlLocationSetPtr(n_val, 0);
51376
51377        ret_val = xmlXPtrWrapLocationSet(val);
51378        desret_xmlXPathObjectPtr(ret_val);
51379        call_tests++;
51380        des_xmlLocationSetPtr(n_val, val, 0);
51381        xmlResetLastError();
51382        if (mem_base != xmlMemBlocks()) {
51383            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51384	           xmlMemBlocks() - mem_base);
51385	    test_ret++;
51386            printf(" %d", n_val);
51387            printf("\n");
51388        }
51389    }
51390    function_tests++;
51391#endif
51392
51393    return(test_ret);
51394}
51395
51396static int
51397test_xpointer(void) {
51398    int test_ret = 0;
51399
51400    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51401    test_ret += test_xmlXPtrBuildNodeList();
51402    test_ret += test_xmlXPtrEval();
51403    test_ret += test_xmlXPtrEvalRangePredicate();
51404    test_ret += test_xmlXPtrLocationSetAdd();
51405    test_ret += test_xmlXPtrLocationSetCreate();
51406    test_ret += test_xmlXPtrLocationSetDel();
51407    test_ret += test_xmlXPtrLocationSetMerge();
51408    test_ret += test_xmlXPtrLocationSetRemove();
51409    test_ret += test_xmlXPtrNewCollapsedRange();
51410    test_ret += test_xmlXPtrNewContext();
51411    test_ret += test_xmlXPtrNewLocationSetNodeSet();
51412    test_ret += test_xmlXPtrNewLocationSetNodes();
51413    test_ret += test_xmlXPtrNewRange();
51414    test_ret += test_xmlXPtrNewRangeNodeObject();
51415    test_ret += test_xmlXPtrNewRangeNodePoint();
51416    test_ret += test_xmlXPtrNewRangeNodes();
51417    test_ret += test_xmlXPtrNewRangePointNode();
51418    test_ret += test_xmlXPtrNewRangePoints();
51419    test_ret += test_xmlXPtrRangeToFunction();
51420    test_ret += test_xmlXPtrWrapLocationSet();
51421
51422    if (test_ret != 0)
51423	printf("Module xpointer: %d errors\n", test_ret);
51424    return(test_ret);
51425}
51426static int
51427test_module(const char *module) {
51428    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51429    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51430    if (!strcmp(module, "SAX2")) return(test_SAX2());
51431    if (!strcmp(module, "c14n")) return(test_c14n());
51432    if (!strcmp(module, "catalog")) return(test_catalog());
51433    if (!strcmp(module, "chvalid")) return(test_chvalid());
51434    if (!strcmp(module, "debugXML")) return(test_debugXML());
51435    if (!strcmp(module, "dict")) return(test_dict());
51436    if (!strcmp(module, "encoding")) return(test_encoding());
51437    if (!strcmp(module, "entities")) return(test_entities());
51438    if (!strcmp(module, "hash")) return(test_hash());
51439    if (!strcmp(module, "list")) return(test_list());
51440    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51441    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51442    if (!strcmp(module, "parser")) return(test_parser());
51443    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51444    if (!strcmp(module, "pattern")) return(test_pattern());
51445    if (!strcmp(module, "relaxng")) return(test_relaxng());
51446    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51447    if (!strcmp(module, "schematron")) return(test_schematron());
51448    if (!strcmp(module, "tree")) return(test_tree());
51449    if (!strcmp(module, "uri")) return(test_uri());
51450    if (!strcmp(module, "valid")) return(test_valid());
51451    if (!strcmp(module, "xinclude")) return(test_xinclude());
51452    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51453    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51454    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51455    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51456    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51457    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51458    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51459    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51460    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51461    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51462    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51463    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51464    if (!strcmp(module, "xpath")) return(test_xpath());
51465    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51466    if (!strcmp(module, "xpointer")) return(test_xpointer());
51467    return(0);
51468}
51469