testapi.c revision 2cba415895e2cf9a15567038151009869b6c52a7
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 3
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    return(0);
1037}
1038
1039static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1040}
1041
1042static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1043}
1044
1045#ifdef LIBXML_CATALOG_ENABLED
1046#define gen_nb_xmlCatalogAllow 4
1047static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1048    if (no == 1) return(XML_CATA_ALLOW_ALL);
1049    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1050    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1051    if (no == 4) return(XML_CATA_ALLOW_NONE);
1052    return(0);
1053}
1054
1055static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1056}
1057
1058static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1059}
1060
1061#endif
1062
1063#ifdef LIBXML_CATALOG_ENABLED
1064#define gen_nb_xmlCatalogPrefer 3
1065static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1066    if (no == 1) return(XML_CATA_PREFER_NONE);
1067    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1068    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1069    return(0);
1070}
1071
1072static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1073}
1074
1075static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1076}
1077
1078#endif
1079
1080#define gen_nb_xmlElementContentType 4
1081static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1082    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1083    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1084    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1085    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1086    return(0);
1087}
1088
1089static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1090}
1091
1092#define gen_nb_xmlElementTypeVal 4
1093static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1094    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1095    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1096    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1097    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1098    return(0);
1099}
1100
1101static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1102}
1103
1104#define gen_nb_xmlFeature 4
1105static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1106    if (no == 1) return(XML_WITH_AUTOMATA);
1107    if (no == 2) return(XML_WITH_C14N);
1108    if (no == 3) return(XML_WITH_CATALOG);
1109    if (no == 4) return(XML_WITH_DEBUG);
1110    return(0);
1111}
1112
1113static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1114}
1115
1116static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1117}
1118
1119#ifdef LIBXML_SCHEMAS_ENABLED
1120#define gen_nb_xmlSchemaValType 4
1121static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1122    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1123    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1124    if (no == 3) return(XML_SCHEMAS_ANYURI);
1125    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1126    return(0);
1127}
1128
1129static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1130}
1131
1132static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1133}
1134
1135#endif
1136
1137#ifdef LIBXML_SCHEMAS_ENABLED
1138#define gen_nb_xmlSchemaWhitespaceValueType 4
1139static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1140    if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1141    if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1142    if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1143    if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1144    return(0);
1145}
1146
1147static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1148}
1149
1150#endif
1151
1152#include <libxml/HTMLparser.h>
1153#include <libxml/HTMLtree.h>
1154#include <libxml/SAX2.h>
1155#include <libxml/c14n.h>
1156#include <libxml/catalog.h>
1157#include <libxml/chvalid.h>
1158#include <libxml/debugXML.h>
1159#include <libxml/dict.h>
1160#include <libxml/encoding.h>
1161#include <libxml/entities.h>
1162#include <libxml/hash.h>
1163#include <libxml/list.h>
1164#include <libxml/nanoftp.h>
1165#include <libxml/nanohttp.h>
1166#include <libxml/parser.h>
1167#include <libxml/parserInternals.h>
1168#include <libxml/pattern.h>
1169#include <libxml/relaxng.h>
1170#include <libxml/schemasInternals.h>
1171#include <libxml/schematron.h>
1172#include <libxml/tree.h>
1173#include <libxml/uri.h>
1174#include <libxml/valid.h>
1175#include <libxml/xinclude.h>
1176#include <libxml/xmlIO.h>
1177#include <libxml/xmlautomata.h>
1178#include <libxml/xmlerror.h>
1179#include <libxml/xmlmodule.h>
1180#include <libxml/xmlreader.h>
1181#include <libxml/xmlregexp.h>
1182#include <libxml/xmlsave.h>
1183#include <libxml/xmlschemas.h>
1184#include <libxml/xmlschemastypes.h>
1185#include <libxml/xmlstring.h>
1186#include <libxml/xmlunicode.h>
1187#include <libxml/xmlwriter.h>
1188#include <libxml/xpath.h>
1189#include <libxml/xpathInternals.h>
1190#include <libxml/xpointer.h>
1191static int test_HTMLparser(void);
1192static int test_HTMLtree(void);
1193static int test_SAX2(void);
1194static int test_c14n(void);
1195static int test_catalog(void);
1196static int test_chvalid(void);
1197static int test_debugXML(void);
1198static int test_dict(void);
1199static int test_encoding(void);
1200static int test_entities(void);
1201static int test_hash(void);
1202static int test_list(void);
1203static int test_nanoftp(void);
1204static int test_nanohttp(void);
1205static int test_parser(void);
1206static int test_parserInternals(void);
1207static int test_pattern(void);
1208static int test_relaxng(void);
1209static int test_schemasInternals(void);
1210static int test_schematron(void);
1211static int test_tree(void);
1212static int test_uri(void);
1213static int test_valid(void);
1214static int test_xinclude(void);
1215static int test_xmlIO(void);
1216static int test_xmlautomata(void);
1217static int test_xmlerror(void);
1218static int test_xmlmodule(void);
1219static int test_xmlreader(void);
1220static int test_xmlregexp(void);
1221static int test_xmlsave(void);
1222static int test_xmlschemas(void);
1223static int test_xmlschemastypes(void);
1224static int test_xmlstring(void);
1225static int test_xmlunicode(void);
1226static int test_xmlwriter(void);
1227static int test_xpath(void);
1228static int test_xpathInternals(void);
1229static int test_xpointer(void);
1230
1231/**
1232 * testlibxml2:
1233 *
1234 * Main entry point of the tester for the full libxml2 module,
1235 * it calls all the tester entry point for each module.
1236 *
1237 * Returns the number of error found
1238 */
1239static int
1240testlibxml2(void)
1241{
1242    int test_ret = 0;
1243
1244    test_ret += test_HTMLparser();
1245    test_ret += test_HTMLtree();
1246    test_ret += test_SAX2();
1247    test_ret += test_c14n();
1248    test_ret += test_catalog();
1249    test_ret += test_chvalid();
1250    test_ret += test_debugXML();
1251    test_ret += test_dict();
1252    test_ret += test_encoding();
1253    test_ret += test_entities();
1254    test_ret += test_hash();
1255    test_ret += test_list();
1256    test_ret += test_nanoftp();
1257    test_ret += test_nanohttp();
1258    test_ret += test_parser();
1259    test_ret += test_parserInternals();
1260    test_ret += test_pattern();
1261    test_ret += test_relaxng();
1262    test_ret += test_schemasInternals();
1263    test_ret += test_schematron();
1264    test_ret += test_tree();
1265    test_ret += test_uri();
1266    test_ret += test_valid();
1267    test_ret += test_xinclude();
1268    test_ret += test_xmlIO();
1269    test_ret += test_xmlautomata();
1270    test_ret += test_xmlerror();
1271    test_ret += test_xmlmodule();
1272    test_ret += test_xmlreader();
1273    test_ret += test_xmlregexp();
1274    test_ret += test_xmlsave();
1275    test_ret += test_xmlschemas();
1276    test_ret += test_xmlschemastypes();
1277    test_ret += test_xmlstring();
1278    test_ret += test_xmlunicode();
1279    test_ret += test_xmlwriter();
1280    test_ret += test_xpath();
1281    test_ret += test_xpathInternals();
1282    test_ret += test_xpointer();
1283
1284    printf("Total: %d functions, %d tests, %d errors\n",
1285           function_tests, call_tests, test_ret);
1286    return(test_ret);
1287}
1288
1289
1290static int
1291test_UTF8ToHtml(void) {
1292    int test_ret = 0;
1293
1294#if defined(LIBXML_HTML_ENABLED)
1295    int mem_base;
1296    int ret_val;
1297    unsigned char * out; /* a pointer to an array of bytes to store the result */
1298    int n_out;
1299    int * outlen; /* the length of @out */
1300    int n_outlen;
1301    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1302    int n_in;
1303    int * inlen; /* the length of @in */
1304    int n_inlen;
1305
1306    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1307    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1308    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1309    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1310        mem_base = xmlMemBlocks();
1311        out = gen_unsigned_char_ptr(n_out, 0);
1312        outlen = gen_int_ptr(n_outlen, 1);
1313        in = gen_const_unsigned_char_ptr(n_in, 2);
1314        inlen = gen_int_ptr(n_inlen, 3);
1315
1316        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1317        desret_int(ret_val);
1318        call_tests++;
1319        des_unsigned_char_ptr(n_out, out, 0);
1320        des_int_ptr(n_outlen, outlen, 1);
1321        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1322        des_int_ptr(n_inlen, inlen, 3);
1323        xmlResetLastError();
1324        if (mem_base != xmlMemBlocks()) {
1325            printf("Leak of %d blocks found in UTF8ToHtml",
1326	           xmlMemBlocks() - mem_base);
1327	    test_ret++;
1328            printf(" %d", n_out);
1329            printf(" %d", n_outlen);
1330            printf(" %d", n_in);
1331            printf(" %d", n_inlen);
1332            printf("\n");
1333        }
1334    }
1335    }
1336    }
1337    }
1338    function_tests++;
1339#endif
1340
1341    return(test_ret);
1342}
1343
1344#ifdef LIBXML_HTML_ENABLED
1345
1346#define gen_nb_const_htmlElemDesc_ptr 1
1347static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1348    return(NULL);
1349}
1350static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1351}
1352#endif
1353
1354
1355static int
1356test_htmlAttrAllowed(void) {
1357    int test_ret = 0;
1358
1359#if defined(LIBXML_HTML_ENABLED)
1360    int mem_base;
1361    htmlStatus ret_val;
1362    htmlElemDesc * elt; /* HTML element */
1363    int n_elt;
1364    xmlChar * attr; /* HTML attribute */
1365    int n_attr;
1366    int legacy; /* whether to allow deprecated attributes */
1367    int n_legacy;
1368
1369    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1370    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1371    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1372        mem_base = xmlMemBlocks();
1373        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1374        attr = gen_const_xmlChar_ptr(n_attr, 1);
1375        legacy = gen_int(n_legacy, 2);
1376
1377        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1378        desret_htmlStatus(ret_val);
1379        call_tests++;
1380        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1381        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1382        des_int(n_legacy, legacy, 2);
1383        xmlResetLastError();
1384        if (mem_base != xmlMemBlocks()) {
1385            printf("Leak of %d blocks found in htmlAttrAllowed",
1386	           xmlMemBlocks() - mem_base);
1387	    test_ret++;
1388            printf(" %d", n_elt);
1389            printf(" %d", n_attr);
1390            printf(" %d", n_legacy);
1391            printf("\n");
1392        }
1393    }
1394    }
1395    }
1396    function_tests++;
1397#endif
1398
1399    return(test_ret);
1400}
1401
1402#ifdef LIBXML_HTML_ENABLED
1403
1404#define gen_nb_htmlNodePtr 1
1405static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1406    return(NULL);
1407}
1408static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1409}
1410#endif
1411
1412
1413static int
1414test_htmlAutoCloseTag(void) {
1415    int test_ret = 0;
1416
1417#if defined(LIBXML_HTML_ENABLED)
1418    int mem_base;
1419    int ret_val;
1420    htmlDocPtr doc; /* the HTML document */
1421    int n_doc;
1422    xmlChar * name; /* The tag name */
1423    int n_name;
1424    htmlNodePtr elem; /* the HTML element */
1425    int n_elem;
1426
1427    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1428    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1429    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1430        mem_base = xmlMemBlocks();
1431        doc = gen_htmlDocPtr(n_doc, 0);
1432        name = gen_const_xmlChar_ptr(n_name, 1);
1433        elem = gen_htmlNodePtr(n_elem, 2);
1434
1435        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1436        desret_int(ret_val);
1437        call_tests++;
1438        des_htmlDocPtr(n_doc, doc, 0);
1439        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1440        des_htmlNodePtr(n_elem, elem, 2);
1441        xmlResetLastError();
1442        if (mem_base != xmlMemBlocks()) {
1443            printf("Leak of %d blocks found in htmlAutoCloseTag",
1444	           xmlMemBlocks() - mem_base);
1445	    test_ret++;
1446            printf(" %d", n_doc);
1447            printf(" %d", n_name);
1448            printf(" %d", n_elem);
1449            printf("\n");
1450        }
1451    }
1452    }
1453    }
1454    function_tests++;
1455#endif
1456
1457    return(test_ret);
1458}
1459
1460
1461static int
1462test_htmlCreateMemoryParserCtxt(void) {
1463    int test_ret = 0;
1464
1465#if defined(LIBXML_HTML_ENABLED)
1466    int mem_base;
1467    htmlParserCtxtPtr ret_val;
1468    char * buffer; /* a pointer to a char array */
1469    int n_buffer;
1470    int size; /* the size of the array */
1471    int n_size;
1472
1473    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1474    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1475        mem_base = xmlMemBlocks();
1476        buffer = gen_const_char_ptr(n_buffer, 0);
1477        size = gen_int(n_size, 1);
1478
1479        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1480        desret_htmlParserCtxtPtr(ret_val);
1481        call_tests++;
1482        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1483        des_int(n_size, size, 1);
1484        xmlResetLastError();
1485        if (mem_base != xmlMemBlocks()) {
1486            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1487	           xmlMemBlocks() - mem_base);
1488	    test_ret++;
1489            printf(" %d", n_buffer);
1490            printf(" %d", n_size);
1491            printf("\n");
1492        }
1493    }
1494    }
1495    function_tests++;
1496#endif
1497
1498    return(test_ret);
1499}
1500
1501#ifdef LIBXML_HTML_ENABLED
1502
1503#define gen_nb_htmlSAXHandlerPtr 1
1504static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1505    return(NULL);
1506}
1507static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1508}
1509#endif
1510
1511
1512static int
1513test_htmlCreatePushParserCtxt(void) {
1514    int test_ret = 0;
1515
1516#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1517    int mem_base;
1518    htmlParserCtxtPtr ret_val;
1519    htmlSAXHandlerPtr sax; /* a SAX handler */
1520    int n_sax;
1521    void * user_data; /* The user data returned on SAX callbacks */
1522    int n_user_data;
1523    char * chunk; /* a pointer to an array of chars */
1524    int n_chunk;
1525    int size; /* number of chars in the array */
1526    int n_size;
1527    const char * filename; /* an optional file name or URI */
1528    int n_filename;
1529    xmlCharEncoding enc; /* an optional encoding */
1530    int n_enc;
1531
1532    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1533    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1534    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1535    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1536    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1537    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1538        mem_base = xmlMemBlocks();
1539        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1540        user_data = gen_userdata(n_user_data, 1);
1541        chunk = gen_const_char_ptr(n_chunk, 2);
1542        size = gen_int(n_size, 3);
1543        filename = gen_fileoutput(n_filename, 4);
1544        enc = gen_xmlCharEncoding(n_enc, 5);
1545
1546        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1547        desret_htmlParserCtxtPtr(ret_val);
1548        call_tests++;
1549        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1550        des_userdata(n_user_data, user_data, 1);
1551        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1552        des_int(n_size, size, 3);
1553        des_fileoutput(n_filename, filename, 4);
1554        des_xmlCharEncoding(n_enc, enc, 5);
1555        xmlResetLastError();
1556        if (mem_base != xmlMemBlocks()) {
1557            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1558	           xmlMemBlocks() - mem_base);
1559	    test_ret++;
1560            printf(" %d", n_sax);
1561            printf(" %d", n_user_data);
1562            printf(" %d", n_chunk);
1563            printf(" %d", n_size);
1564            printf(" %d", n_filename);
1565            printf(" %d", n_enc);
1566            printf("\n");
1567        }
1568    }
1569    }
1570    }
1571    }
1572    }
1573    }
1574    function_tests++;
1575#endif
1576
1577    return(test_ret);
1578}
1579
1580
1581static int
1582test_htmlCtxtReadDoc(void) {
1583    int test_ret = 0;
1584
1585#if defined(LIBXML_HTML_ENABLED)
1586    int mem_base;
1587    htmlDocPtr ret_val;
1588    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1589    int n_ctxt;
1590    xmlChar * cur; /* a pointer to a zero terminated string */
1591    int n_cur;
1592    const char * URL; /* the base URL to use for the document */
1593    int n_URL;
1594    char * encoding; /* the document encoding, or NULL */
1595    int n_encoding;
1596    int options; /* a combination of htmlParserOption(s) */
1597    int n_options;
1598
1599    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1600    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1601    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1602    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1603    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1604        mem_base = xmlMemBlocks();
1605        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1606        cur = gen_const_xmlChar_ptr(n_cur, 1);
1607        URL = gen_filepath(n_URL, 2);
1608        encoding = gen_const_char_ptr(n_encoding, 3);
1609        options = gen_int(n_options, 4);
1610
1611        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1612        desret_htmlDocPtr(ret_val);
1613        call_tests++;
1614        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1615        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1616        des_filepath(n_URL, URL, 2);
1617        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1618        des_int(n_options, options, 4);
1619        xmlResetLastError();
1620        if (mem_base != xmlMemBlocks()) {
1621            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1622	           xmlMemBlocks() - mem_base);
1623	    test_ret++;
1624            printf(" %d", n_ctxt);
1625            printf(" %d", n_cur);
1626            printf(" %d", n_URL);
1627            printf(" %d", n_encoding);
1628            printf(" %d", n_options);
1629            printf("\n");
1630        }
1631    }
1632    }
1633    }
1634    }
1635    }
1636    function_tests++;
1637#endif
1638
1639    return(test_ret);
1640}
1641
1642
1643static int
1644test_htmlCtxtReadFile(void) {
1645    int test_ret = 0;
1646
1647#if defined(LIBXML_HTML_ENABLED)
1648    htmlDocPtr ret_val;
1649    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1650    int n_ctxt;
1651    const char * filename; /* a file or URL */
1652    int n_filename;
1653    char * encoding; /* the document encoding, or NULL */
1654    int n_encoding;
1655    int options; /* a combination of htmlParserOption(s) */
1656    int n_options;
1657
1658    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1659    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1660    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1661    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1662        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1663        filename = gen_filepath(n_filename, 1);
1664        encoding = gen_const_char_ptr(n_encoding, 2);
1665        options = gen_int(n_options, 3);
1666
1667        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1668        desret_htmlDocPtr(ret_val);
1669        call_tests++;
1670        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1671        des_filepath(n_filename, filename, 1);
1672        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1673        des_int(n_options, options, 3);
1674        xmlResetLastError();
1675    }
1676    }
1677    }
1678    }
1679    function_tests++;
1680#endif
1681
1682    return(test_ret);
1683}
1684
1685
1686static int
1687test_htmlCtxtReadMemory(void) {
1688    int test_ret = 0;
1689
1690#if defined(LIBXML_HTML_ENABLED)
1691    int mem_base;
1692    htmlDocPtr ret_val;
1693    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1694    int n_ctxt;
1695    char * buffer; /* a pointer to a char array */
1696    int n_buffer;
1697    int size; /* the size of the array */
1698    int n_size;
1699    const char * URL; /* the base URL to use for the document */
1700    int n_URL;
1701    char * encoding; /* the document encoding, or NULL */
1702    int n_encoding;
1703    int options; /* a combination of htmlParserOption(s) */
1704    int n_options;
1705
1706    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1707    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1708    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1709    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1710    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1711    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1712        mem_base = xmlMemBlocks();
1713        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1714        buffer = gen_const_char_ptr(n_buffer, 1);
1715        size = gen_int(n_size, 2);
1716        URL = gen_filepath(n_URL, 3);
1717        encoding = gen_const_char_ptr(n_encoding, 4);
1718        options = gen_int(n_options, 5);
1719
1720        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1721        desret_htmlDocPtr(ret_val);
1722        call_tests++;
1723        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1724        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1725        des_int(n_size, size, 2);
1726        des_filepath(n_URL, URL, 3);
1727        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1728        des_int(n_options, options, 5);
1729        xmlResetLastError();
1730        if (mem_base != xmlMemBlocks()) {
1731            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1732	           xmlMemBlocks() - mem_base);
1733	    test_ret++;
1734            printf(" %d", n_ctxt);
1735            printf(" %d", n_buffer);
1736            printf(" %d", n_size);
1737            printf(" %d", n_URL);
1738            printf(" %d", n_encoding);
1739            printf(" %d", n_options);
1740            printf("\n");
1741        }
1742    }
1743    }
1744    }
1745    }
1746    }
1747    }
1748    function_tests++;
1749#endif
1750
1751    return(test_ret);
1752}
1753
1754
1755static int
1756test_htmlCtxtReset(void) {
1757    int test_ret = 0;
1758
1759#if defined(LIBXML_HTML_ENABLED)
1760    int mem_base;
1761    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1762    int n_ctxt;
1763
1764    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1765        mem_base = xmlMemBlocks();
1766        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1767
1768        htmlCtxtReset(ctxt);
1769        call_tests++;
1770        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1771        xmlResetLastError();
1772        if (mem_base != xmlMemBlocks()) {
1773            printf("Leak of %d blocks found in htmlCtxtReset",
1774	           xmlMemBlocks() - mem_base);
1775	    test_ret++;
1776            printf(" %d", n_ctxt);
1777            printf("\n");
1778        }
1779    }
1780    function_tests++;
1781#endif
1782
1783    return(test_ret);
1784}
1785
1786
1787static int
1788test_htmlCtxtUseOptions(void) {
1789    int test_ret = 0;
1790
1791#if defined(LIBXML_HTML_ENABLED)
1792    int mem_base;
1793    int ret_val;
1794    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1795    int n_ctxt;
1796    int options; /* a combination of htmlParserOption(s) */
1797    int n_options;
1798
1799    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1800    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1801        mem_base = xmlMemBlocks();
1802        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1803        options = gen_int(n_options, 1);
1804
1805        ret_val = htmlCtxtUseOptions(ctxt, options);
1806        desret_int(ret_val);
1807        call_tests++;
1808        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1809        des_int(n_options, options, 1);
1810        xmlResetLastError();
1811        if (mem_base != xmlMemBlocks()) {
1812            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1813	           xmlMemBlocks() - mem_base);
1814	    test_ret++;
1815            printf(" %d", n_ctxt);
1816            printf(" %d", n_options);
1817            printf("\n");
1818        }
1819    }
1820    }
1821    function_tests++;
1822#endif
1823
1824    return(test_ret);
1825}
1826
1827
1828static int
1829test_htmlElementAllowedHere(void) {
1830    int test_ret = 0;
1831
1832#if defined(LIBXML_HTML_ENABLED)
1833    int mem_base;
1834    int ret_val;
1835    htmlElemDesc * parent; /* HTML parent element */
1836    int n_parent;
1837    xmlChar * elt; /* HTML element */
1838    int n_elt;
1839
1840    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1841    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1842        mem_base = xmlMemBlocks();
1843        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1844        elt = gen_const_xmlChar_ptr(n_elt, 1);
1845
1846        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1847        desret_int(ret_val);
1848        call_tests++;
1849        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1850        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1851        xmlResetLastError();
1852        if (mem_base != xmlMemBlocks()) {
1853            printf("Leak of %d blocks found in htmlElementAllowedHere",
1854	           xmlMemBlocks() - mem_base);
1855	    test_ret++;
1856            printf(" %d", n_parent);
1857            printf(" %d", n_elt);
1858            printf("\n");
1859        }
1860    }
1861    }
1862    function_tests++;
1863#endif
1864
1865    return(test_ret);
1866}
1867
1868
1869static int
1870test_htmlElementStatusHere(void) {
1871    int test_ret = 0;
1872
1873#if defined(LIBXML_HTML_ENABLED)
1874    int mem_base;
1875    htmlStatus ret_val;
1876    htmlElemDesc * parent; /* HTML parent element */
1877    int n_parent;
1878    htmlElemDesc * elt; /* HTML element */
1879    int n_elt;
1880
1881    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1882    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1883        mem_base = xmlMemBlocks();
1884        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1885        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1886
1887        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1888        desret_htmlStatus(ret_val);
1889        call_tests++;
1890        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1891        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1892        xmlResetLastError();
1893        if (mem_base != xmlMemBlocks()) {
1894            printf("Leak of %d blocks found in htmlElementStatusHere",
1895	           xmlMemBlocks() - mem_base);
1896	    test_ret++;
1897            printf(" %d", n_parent);
1898            printf(" %d", n_elt);
1899            printf("\n");
1900        }
1901    }
1902    }
1903    function_tests++;
1904#endif
1905
1906    return(test_ret);
1907}
1908
1909
1910static int
1911test_htmlEncodeEntities(void) {
1912    int test_ret = 0;
1913
1914#if defined(LIBXML_HTML_ENABLED)
1915    int mem_base;
1916    int ret_val;
1917    unsigned char * out; /* a pointer to an array of bytes to store the result */
1918    int n_out;
1919    int * outlen; /* the length of @out */
1920    int n_outlen;
1921    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1922    int n_in;
1923    int * inlen; /* the length of @in */
1924    int n_inlen;
1925    int quoteChar; /* the quote character to escape (' or ") or zero. */
1926    int n_quoteChar;
1927
1928    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1929    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1930    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1931    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1932    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1933        mem_base = xmlMemBlocks();
1934        out = gen_unsigned_char_ptr(n_out, 0);
1935        outlen = gen_int_ptr(n_outlen, 1);
1936        in = gen_const_unsigned_char_ptr(n_in, 2);
1937        inlen = gen_int_ptr(n_inlen, 3);
1938        quoteChar = gen_int(n_quoteChar, 4);
1939
1940        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1941        desret_int(ret_val);
1942        call_tests++;
1943        des_unsigned_char_ptr(n_out, out, 0);
1944        des_int_ptr(n_outlen, outlen, 1);
1945        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1946        des_int_ptr(n_inlen, inlen, 3);
1947        des_int(n_quoteChar, quoteChar, 4);
1948        xmlResetLastError();
1949        if (mem_base != xmlMemBlocks()) {
1950            printf("Leak of %d blocks found in htmlEncodeEntities",
1951	           xmlMemBlocks() - mem_base);
1952	    test_ret++;
1953            printf(" %d", n_out);
1954            printf(" %d", n_outlen);
1955            printf(" %d", n_in);
1956            printf(" %d", n_inlen);
1957            printf(" %d", n_quoteChar);
1958            printf("\n");
1959        }
1960    }
1961    }
1962    }
1963    }
1964    }
1965    function_tests++;
1966#endif
1967
1968    return(test_ret);
1969}
1970
1971
1972static int
1973test_htmlEntityLookup(void) {
1974    int test_ret = 0;
1975
1976#if defined(LIBXML_HTML_ENABLED)
1977    int mem_base;
1978    const htmlEntityDesc * ret_val;
1979    xmlChar * name; /* the entity name */
1980    int n_name;
1981
1982    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1983        mem_base = xmlMemBlocks();
1984        name = gen_const_xmlChar_ptr(n_name, 0);
1985
1986        ret_val = htmlEntityLookup((const xmlChar *)name);
1987        desret_const_htmlEntityDesc_ptr(ret_val);
1988        call_tests++;
1989        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1990        xmlResetLastError();
1991        if (mem_base != xmlMemBlocks()) {
1992            printf("Leak of %d blocks found in htmlEntityLookup",
1993	           xmlMemBlocks() - mem_base);
1994	    test_ret++;
1995            printf(" %d", n_name);
1996            printf("\n");
1997        }
1998    }
1999    function_tests++;
2000#endif
2001
2002    return(test_ret);
2003}
2004
2005
2006static int
2007test_htmlEntityValueLookup(void) {
2008    int test_ret = 0;
2009
2010#if defined(LIBXML_HTML_ENABLED)
2011    int mem_base;
2012    const htmlEntityDesc * ret_val;
2013    unsigned int value; /* the entity's unicode value */
2014    int n_value;
2015
2016    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2017        mem_base = xmlMemBlocks();
2018        value = gen_unsigned_int(n_value, 0);
2019
2020        ret_val = htmlEntityValueLookup(value);
2021        desret_const_htmlEntityDesc_ptr(ret_val);
2022        call_tests++;
2023        des_unsigned_int(n_value, value, 0);
2024        xmlResetLastError();
2025        if (mem_base != xmlMemBlocks()) {
2026            printf("Leak of %d blocks found in htmlEntityValueLookup",
2027	           xmlMemBlocks() - mem_base);
2028	    test_ret++;
2029            printf(" %d", n_value);
2030            printf("\n");
2031        }
2032    }
2033    function_tests++;
2034#endif
2035
2036    return(test_ret);
2037}
2038
2039
2040static int
2041test_htmlHandleOmittedElem(void) {
2042    int test_ret = 0;
2043
2044#if defined(LIBXML_HTML_ENABLED)
2045    int mem_base;
2046    int ret_val;
2047    int val; /* int 0 or 1 */
2048    int n_val;
2049
2050    for (n_val = 0;n_val < gen_nb_int;n_val++) {
2051        mem_base = xmlMemBlocks();
2052        val = gen_int(n_val, 0);
2053
2054        ret_val = htmlHandleOmittedElem(val);
2055        desret_int(ret_val);
2056        call_tests++;
2057        des_int(n_val, val, 0);
2058        xmlResetLastError();
2059        if (mem_base != xmlMemBlocks()) {
2060            printf("Leak of %d blocks found in htmlHandleOmittedElem",
2061	           xmlMemBlocks() - mem_base);
2062	    test_ret++;
2063            printf(" %d", n_val);
2064            printf("\n");
2065        }
2066    }
2067    function_tests++;
2068#endif
2069
2070    return(test_ret);
2071}
2072
2073
2074static int
2075test_htmlIsAutoClosed(void) {
2076    int test_ret = 0;
2077
2078#if defined(LIBXML_HTML_ENABLED)
2079    int mem_base;
2080    int ret_val;
2081    htmlDocPtr doc; /* the HTML document */
2082    int n_doc;
2083    htmlNodePtr elem; /* the HTML element */
2084    int n_elem;
2085
2086    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2087    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2088        mem_base = xmlMemBlocks();
2089        doc = gen_htmlDocPtr(n_doc, 0);
2090        elem = gen_htmlNodePtr(n_elem, 1);
2091
2092        ret_val = htmlIsAutoClosed(doc, elem);
2093        desret_int(ret_val);
2094        call_tests++;
2095        des_htmlDocPtr(n_doc, doc, 0);
2096        des_htmlNodePtr(n_elem, elem, 1);
2097        xmlResetLastError();
2098        if (mem_base != xmlMemBlocks()) {
2099            printf("Leak of %d blocks found in htmlIsAutoClosed",
2100	           xmlMemBlocks() - mem_base);
2101	    test_ret++;
2102            printf(" %d", n_doc);
2103            printf(" %d", n_elem);
2104            printf("\n");
2105        }
2106    }
2107    }
2108    function_tests++;
2109#endif
2110
2111    return(test_ret);
2112}
2113
2114
2115static int
2116test_htmlIsScriptAttribute(void) {
2117    int test_ret = 0;
2118
2119#if defined(LIBXML_HTML_ENABLED)
2120    int mem_base;
2121    int ret_val;
2122    xmlChar * name; /* an attribute name */
2123    int n_name;
2124
2125    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2126        mem_base = xmlMemBlocks();
2127        name = gen_const_xmlChar_ptr(n_name, 0);
2128
2129        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2130        desret_int(ret_val);
2131        call_tests++;
2132        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2133        xmlResetLastError();
2134        if (mem_base != xmlMemBlocks()) {
2135            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2136	           xmlMemBlocks() - mem_base);
2137	    test_ret++;
2138            printf(" %d", n_name);
2139            printf("\n");
2140        }
2141    }
2142    function_tests++;
2143#endif
2144
2145    return(test_ret);
2146}
2147
2148
2149static int
2150test_htmlNewParserCtxt(void) {
2151    int test_ret = 0;
2152
2153#if defined(LIBXML_HTML_ENABLED)
2154    int mem_base;
2155    htmlParserCtxtPtr ret_val;
2156
2157        mem_base = xmlMemBlocks();
2158
2159        ret_val = htmlNewParserCtxt();
2160        desret_htmlParserCtxtPtr(ret_val);
2161        call_tests++;
2162        xmlResetLastError();
2163        if (mem_base != xmlMemBlocks()) {
2164            printf("Leak of %d blocks found in htmlNewParserCtxt",
2165	           xmlMemBlocks() - mem_base);
2166	    test_ret++;
2167            printf("\n");
2168        }
2169    function_tests++;
2170#endif
2171
2172    return(test_ret);
2173}
2174
2175
2176static int
2177test_htmlNodeStatus(void) {
2178    int test_ret = 0;
2179
2180#if defined(LIBXML_HTML_ENABLED)
2181    int mem_base;
2182    htmlStatus ret_val;
2183    htmlNodePtr node; /* an htmlNodePtr in a tree */
2184    int n_node;
2185    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2186    int n_legacy;
2187
2188    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2189    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2190        mem_base = xmlMemBlocks();
2191        node = gen_const_htmlNodePtr(n_node, 0);
2192        legacy = gen_int(n_legacy, 1);
2193
2194        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2195        desret_htmlStatus(ret_val);
2196        call_tests++;
2197        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2198        des_int(n_legacy, legacy, 1);
2199        xmlResetLastError();
2200        if (mem_base != xmlMemBlocks()) {
2201            printf("Leak of %d blocks found in htmlNodeStatus",
2202	           xmlMemBlocks() - mem_base);
2203	    test_ret++;
2204            printf(" %d", n_node);
2205            printf(" %d", n_legacy);
2206            printf("\n");
2207        }
2208    }
2209    }
2210    function_tests++;
2211#endif
2212
2213    return(test_ret);
2214}
2215
2216
2217static int
2218test_htmlParseCharRef(void) {
2219    int test_ret = 0;
2220
2221#if defined(LIBXML_HTML_ENABLED)
2222    int mem_base;
2223    int ret_val;
2224    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2225    int n_ctxt;
2226
2227    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2228        mem_base = xmlMemBlocks();
2229        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2230
2231        ret_val = htmlParseCharRef(ctxt);
2232        desret_int(ret_val);
2233        call_tests++;
2234        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2235        xmlResetLastError();
2236        if (mem_base != xmlMemBlocks()) {
2237            printf("Leak of %d blocks found in htmlParseCharRef",
2238	           xmlMemBlocks() - mem_base);
2239	    test_ret++;
2240            printf(" %d", n_ctxt);
2241            printf("\n");
2242        }
2243    }
2244    function_tests++;
2245#endif
2246
2247    return(test_ret);
2248}
2249
2250
2251static int
2252test_htmlParseChunk(void) {
2253    int test_ret = 0;
2254
2255#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2256    int mem_base;
2257    int ret_val;
2258    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2259    int n_ctxt;
2260    char * chunk; /* an char array */
2261    int n_chunk;
2262    int size; /* the size in byte of the chunk */
2263    int n_size;
2264    int terminate; /* last chunk indicator */
2265    int n_terminate;
2266
2267    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2268    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2269    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2270    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2271        mem_base = xmlMemBlocks();
2272        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2273        chunk = gen_const_char_ptr(n_chunk, 1);
2274        size = gen_int(n_size, 2);
2275        terminate = gen_int(n_terminate, 3);
2276
2277        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2278        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2279        desret_int(ret_val);
2280        call_tests++;
2281        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2282        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2283        des_int(n_size, size, 2);
2284        des_int(n_terminate, terminate, 3);
2285        xmlResetLastError();
2286        if (mem_base != xmlMemBlocks()) {
2287            printf("Leak of %d blocks found in htmlParseChunk",
2288	           xmlMemBlocks() - mem_base);
2289	    test_ret++;
2290            printf(" %d", n_ctxt);
2291            printf(" %d", n_chunk);
2292            printf(" %d", n_size);
2293            printf(" %d", n_terminate);
2294            printf("\n");
2295        }
2296    }
2297    }
2298    }
2299    }
2300    function_tests++;
2301#endif
2302
2303    return(test_ret);
2304}
2305
2306
2307static int
2308test_htmlParseDoc(void) {
2309    int test_ret = 0;
2310
2311#if defined(LIBXML_HTML_ENABLED)
2312    int mem_base;
2313    htmlDocPtr ret_val;
2314    xmlChar * cur; /* a pointer to an array of xmlChar */
2315    int n_cur;
2316    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2317    int n_encoding;
2318
2319    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2320    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2321        mem_base = xmlMemBlocks();
2322        cur = gen_xmlChar_ptr(n_cur, 0);
2323        encoding = gen_const_char_ptr(n_encoding, 1);
2324
2325        ret_val = htmlParseDoc(cur, (const char *)encoding);
2326        desret_htmlDocPtr(ret_val);
2327        call_tests++;
2328        des_xmlChar_ptr(n_cur, cur, 0);
2329        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2330        xmlResetLastError();
2331        if (mem_base != xmlMemBlocks()) {
2332            printf("Leak of %d blocks found in htmlParseDoc",
2333	           xmlMemBlocks() - mem_base);
2334	    test_ret++;
2335            printf(" %d", n_cur);
2336            printf(" %d", n_encoding);
2337            printf("\n");
2338        }
2339    }
2340    }
2341    function_tests++;
2342#endif
2343
2344    return(test_ret);
2345}
2346
2347
2348static int
2349test_htmlParseDocument(void) {
2350    int test_ret = 0;
2351
2352#if defined(LIBXML_HTML_ENABLED)
2353    int mem_base;
2354    int ret_val;
2355    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2356    int n_ctxt;
2357
2358    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2359        mem_base = xmlMemBlocks();
2360        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2361
2362        ret_val = htmlParseDocument(ctxt);
2363        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2364        desret_int(ret_val);
2365        call_tests++;
2366        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2367        xmlResetLastError();
2368        if (mem_base != xmlMemBlocks()) {
2369            printf("Leak of %d blocks found in htmlParseDocument",
2370	           xmlMemBlocks() - mem_base);
2371	    test_ret++;
2372            printf(" %d", n_ctxt);
2373            printf("\n");
2374        }
2375    }
2376    function_tests++;
2377#endif
2378
2379    return(test_ret);
2380}
2381
2382
2383static int
2384test_htmlParseElement(void) {
2385    int test_ret = 0;
2386
2387#if defined(LIBXML_HTML_ENABLED)
2388    int mem_base;
2389    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2390    int n_ctxt;
2391
2392    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2393        mem_base = xmlMemBlocks();
2394        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2395
2396        htmlParseElement(ctxt);
2397        call_tests++;
2398        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2399        xmlResetLastError();
2400        if (mem_base != xmlMemBlocks()) {
2401            printf("Leak of %d blocks found in htmlParseElement",
2402	           xmlMemBlocks() - mem_base);
2403	    test_ret++;
2404            printf(" %d", n_ctxt);
2405            printf("\n");
2406        }
2407    }
2408    function_tests++;
2409#endif
2410
2411    return(test_ret);
2412}
2413
2414
2415static int
2416test_htmlParseEntityRef(void) {
2417    int test_ret = 0;
2418
2419#if defined(LIBXML_HTML_ENABLED)
2420    int mem_base;
2421    const htmlEntityDesc * ret_val;
2422    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2423    int n_ctxt;
2424    xmlChar ** str; /* location to store the entity name */
2425    int n_str;
2426
2427    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2428    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2429        mem_base = xmlMemBlocks();
2430        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2431        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2432
2433        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2434        desret_const_htmlEntityDesc_ptr(ret_val);
2435        call_tests++;
2436        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2437        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2438        xmlResetLastError();
2439        if (mem_base != xmlMemBlocks()) {
2440            printf("Leak of %d blocks found in htmlParseEntityRef",
2441	           xmlMemBlocks() - mem_base);
2442	    test_ret++;
2443            printf(" %d", n_ctxt);
2444            printf(" %d", n_str);
2445            printf("\n");
2446        }
2447    }
2448    }
2449    function_tests++;
2450#endif
2451
2452    return(test_ret);
2453}
2454
2455
2456static int
2457test_htmlParseFile(void) {
2458    int test_ret = 0;
2459
2460#if defined(LIBXML_HTML_ENABLED)
2461    htmlDocPtr ret_val;
2462    const char * filename; /* the filename */
2463    int n_filename;
2464    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2465    int n_encoding;
2466
2467    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2468    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2469        filename = gen_filepath(n_filename, 0);
2470        encoding = gen_const_char_ptr(n_encoding, 1);
2471
2472        ret_val = htmlParseFile(filename, (const char *)encoding);
2473        desret_htmlDocPtr(ret_val);
2474        call_tests++;
2475        des_filepath(n_filename, filename, 0);
2476        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2477        xmlResetLastError();
2478    }
2479    }
2480    function_tests++;
2481#endif
2482
2483    return(test_ret);
2484}
2485
2486
2487static int
2488test_htmlReadDoc(void) {
2489    int test_ret = 0;
2490
2491#if defined(LIBXML_HTML_ENABLED)
2492    int mem_base;
2493    htmlDocPtr ret_val;
2494    xmlChar * cur; /* a pointer to a zero terminated string */
2495    int n_cur;
2496    const char * URL; /* the base URL to use for the document */
2497    int n_URL;
2498    char * encoding; /* the document encoding, or NULL */
2499    int n_encoding;
2500    int options; /* a combination of htmlParserOption(s) */
2501    int n_options;
2502
2503    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2504    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2505    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2506    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2507        mem_base = xmlMemBlocks();
2508        cur = gen_const_xmlChar_ptr(n_cur, 0);
2509        URL = gen_filepath(n_URL, 1);
2510        encoding = gen_const_char_ptr(n_encoding, 2);
2511        options = gen_int(n_options, 3);
2512
2513        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2514        desret_htmlDocPtr(ret_val);
2515        call_tests++;
2516        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2517        des_filepath(n_URL, URL, 1);
2518        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2519        des_int(n_options, options, 3);
2520        xmlResetLastError();
2521        if (mem_base != xmlMemBlocks()) {
2522            printf("Leak of %d blocks found in htmlReadDoc",
2523	           xmlMemBlocks() - mem_base);
2524	    test_ret++;
2525            printf(" %d", n_cur);
2526            printf(" %d", n_URL);
2527            printf(" %d", n_encoding);
2528            printf(" %d", n_options);
2529            printf("\n");
2530        }
2531    }
2532    }
2533    }
2534    }
2535    function_tests++;
2536#endif
2537
2538    return(test_ret);
2539}
2540
2541
2542static int
2543test_htmlReadFile(void) {
2544    int test_ret = 0;
2545
2546#if defined(LIBXML_HTML_ENABLED)
2547    int mem_base;
2548    htmlDocPtr ret_val;
2549    const char * filename; /* a file or URL */
2550    int n_filename;
2551    char * encoding; /* the document encoding, or NULL */
2552    int n_encoding;
2553    int options; /* a combination of htmlParserOption(s) */
2554    int n_options;
2555
2556    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2557    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2558    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2559        mem_base = xmlMemBlocks();
2560        filename = gen_filepath(n_filename, 0);
2561        encoding = gen_const_char_ptr(n_encoding, 1);
2562        options = gen_int(n_options, 2);
2563
2564        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2565        desret_htmlDocPtr(ret_val);
2566        call_tests++;
2567        des_filepath(n_filename, filename, 0);
2568        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2569        des_int(n_options, options, 2);
2570        xmlResetLastError();
2571        if (mem_base != xmlMemBlocks()) {
2572            printf("Leak of %d blocks found in htmlReadFile",
2573	           xmlMemBlocks() - mem_base);
2574	    test_ret++;
2575            printf(" %d", n_filename);
2576            printf(" %d", n_encoding);
2577            printf(" %d", n_options);
2578            printf("\n");
2579        }
2580    }
2581    }
2582    }
2583    function_tests++;
2584#endif
2585
2586    return(test_ret);
2587}
2588
2589
2590static int
2591test_htmlReadMemory(void) {
2592    int test_ret = 0;
2593
2594#if defined(LIBXML_HTML_ENABLED)
2595    int mem_base;
2596    htmlDocPtr ret_val;
2597    char * buffer; /* a pointer to a char array */
2598    int n_buffer;
2599    int size; /* the size of the array */
2600    int n_size;
2601    const char * URL; /* the base URL to use for the document */
2602    int n_URL;
2603    char * encoding; /* the document encoding, or NULL */
2604    int n_encoding;
2605    int options; /* a combination of htmlParserOption(s) */
2606    int n_options;
2607
2608    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2609    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2610    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2611    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2612    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2613        mem_base = xmlMemBlocks();
2614        buffer = gen_const_char_ptr(n_buffer, 0);
2615        size = gen_int(n_size, 1);
2616        URL = gen_filepath(n_URL, 2);
2617        encoding = gen_const_char_ptr(n_encoding, 3);
2618        options = gen_int(n_options, 4);
2619
2620        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2621        desret_htmlDocPtr(ret_val);
2622        call_tests++;
2623        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2624        des_int(n_size, size, 1);
2625        des_filepath(n_URL, URL, 2);
2626        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2627        des_int(n_options, options, 4);
2628        xmlResetLastError();
2629        if (mem_base != xmlMemBlocks()) {
2630            printf("Leak of %d blocks found in htmlReadMemory",
2631	           xmlMemBlocks() - mem_base);
2632	    test_ret++;
2633            printf(" %d", n_buffer);
2634            printf(" %d", n_size);
2635            printf(" %d", n_URL);
2636            printf(" %d", n_encoding);
2637            printf(" %d", n_options);
2638            printf("\n");
2639        }
2640    }
2641    }
2642    }
2643    }
2644    }
2645    function_tests++;
2646#endif
2647
2648    return(test_ret);
2649}
2650
2651
2652static int
2653test_htmlSAXParseDoc(void) {
2654    int test_ret = 0;
2655
2656#if defined(LIBXML_HTML_ENABLED)
2657    int mem_base;
2658    htmlDocPtr ret_val;
2659    xmlChar * cur; /* a pointer to an array of xmlChar */
2660    int n_cur;
2661    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2662    int n_encoding;
2663    htmlSAXHandlerPtr sax; /* the SAX handler block */
2664    int n_sax;
2665    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2666    int n_userData;
2667
2668    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2669    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2670    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2671    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2672        mem_base = xmlMemBlocks();
2673        cur = gen_xmlChar_ptr(n_cur, 0);
2674        encoding = gen_const_char_ptr(n_encoding, 1);
2675        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2676        userData = gen_userdata(n_userData, 3);
2677
2678        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2679        desret_htmlDocPtr(ret_val);
2680        call_tests++;
2681        des_xmlChar_ptr(n_cur, cur, 0);
2682        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2683        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2684        des_userdata(n_userData, userData, 3);
2685        xmlResetLastError();
2686        if (mem_base != xmlMemBlocks()) {
2687            printf("Leak of %d blocks found in htmlSAXParseDoc",
2688	           xmlMemBlocks() - mem_base);
2689	    test_ret++;
2690            printf(" %d", n_cur);
2691            printf(" %d", n_encoding);
2692            printf(" %d", n_sax);
2693            printf(" %d", n_userData);
2694            printf("\n");
2695        }
2696    }
2697    }
2698    }
2699    }
2700    function_tests++;
2701#endif
2702
2703    return(test_ret);
2704}
2705
2706
2707static int
2708test_htmlSAXParseFile(void) {
2709    int test_ret = 0;
2710
2711#if defined(LIBXML_HTML_ENABLED)
2712    int mem_base;
2713    htmlDocPtr ret_val;
2714    const char * filename; /* the filename */
2715    int n_filename;
2716    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2717    int n_encoding;
2718    htmlSAXHandlerPtr sax; /* the SAX handler block */
2719    int n_sax;
2720    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2721    int n_userData;
2722
2723    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2724    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2725    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2726    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2727        mem_base = xmlMemBlocks();
2728        filename = gen_filepath(n_filename, 0);
2729        encoding = gen_const_char_ptr(n_encoding, 1);
2730        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2731        userData = gen_userdata(n_userData, 3);
2732
2733        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2734        desret_htmlDocPtr(ret_val);
2735        call_tests++;
2736        des_filepath(n_filename, filename, 0);
2737        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2738        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2739        des_userdata(n_userData, userData, 3);
2740        xmlResetLastError();
2741        if (mem_base != xmlMemBlocks()) {
2742            printf("Leak of %d blocks found in htmlSAXParseFile",
2743	           xmlMemBlocks() - mem_base);
2744	    test_ret++;
2745            printf(" %d", n_filename);
2746            printf(" %d", n_encoding);
2747            printf(" %d", n_sax);
2748            printf(" %d", n_userData);
2749            printf("\n");
2750        }
2751    }
2752    }
2753    }
2754    }
2755    function_tests++;
2756#endif
2757
2758    return(test_ret);
2759}
2760
2761
2762static int
2763test_htmlTagLookup(void) {
2764    int test_ret = 0;
2765
2766
2767    /* missing type support */
2768    return(test_ret);
2769}
2770
2771static int
2772test_HTMLparser(void) {
2773    int test_ret = 0;
2774
2775    if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2776    test_ret += test_UTF8ToHtml();
2777    test_ret += test_htmlAttrAllowed();
2778    test_ret += test_htmlAutoCloseTag();
2779    test_ret += test_htmlCreateMemoryParserCtxt();
2780    test_ret += test_htmlCreatePushParserCtxt();
2781    test_ret += test_htmlCtxtReadDoc();
2782    test_ret += test_htmlCtxtReadFile();
2783    test_ret += test_htmlCtxtReadMemory();
2784    test_ret += test_htmlCtxtReset();
2785    test_ret += test_htmlCtxtUseOptions();
2786    test_ret += test_htmlElementAllowedHere();
2787    test_ret += test_htmlElementStatusHere();
2788    test_ret += test_htmlEncodeEntities();
2789    test_ret += test_htmlEntityLookup();
2790    test_ret += test_htmlEntityValueLookup();
2791    test_ret += test_htmlHandleOmittedElem();
2792    test_ret += test_htmlIsAutoClosed();
2793    test_ret += test_htmlIsScriptAttribute();
2794    test_ret += test_htmlNewParserCtxt();
2795    test_ret += test_htmlNodeStatus();
2796    test_ret += test_htmlParseCharRef();
2797    test_ret += test_htmlParseChunk();
2798    test_ret += test_htmlParseDoc();
2799    test_ret += test_htmlParseDocument();
2800    test_ret += test_htmlParseElement();
2801    test_ret += test_htmlParseEntityRef();
2802    test_ret += test_htmlParseFile();
2803    test_ret += test_htmlReadDoc();
2804    test_ret += test_htmlReadFile();
2805    test_ret += test_htmlReadMemory();
2806    test_ret += test_htmlSAXParseDoc();
2807    test_ret += test_htmlSAXParseFile();
2808    test_ret += test_htmlTagLookup();
2809
2810    if (test_ret != 0)
2811	printf("Module HTMLparser: %d errors\n", test_ret);
2812    return(test_ret);
2813}
2814
2815static int
2816test_htmlDocContentDumpFormatOutput(void) {
2817    int test_ret = 0;
2818
2819#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2820    int mem_base;
2821    xmlOutputBufferPtr buf; /* the HTML buffer output */
2822    int n_buf;
2823    xmlDocPtr cur; /* the document */
2824    int n_cur;
2825    char * encoding; /* the encoding string */
2826    int n_encoding;
2827    int format; /* should formatting spaces been added */
2828    int n_format;
2829
2830    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2831    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2832    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2833    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2834        mem_base = xmlMemBlocks();
2835        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2836        cur = gen_xmlDocPtr(n_cur, 1);
2837        encoding = gen_const_char_ptr(n_encoding, 2);
2838        format = gen_int(n_format, 3);
2839
2840        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2841        call_tests++;
2842        des_xmlOutputBufferPtr(n_buf, buf, 0);
2843        des_xmlDocPtr(n_cur, cur, 1);
2844        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2845        des_int(n_format, format, 3);
2846        xmlResetLastError();
2847        if (mem_base != xmlMemBlocks()) {
2848            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2849	           xmlMemBlocks() - mem_base);
2850	    test_ret++;
2851            printf(" %d", n_buf);
2852            printf(" %d", n_cur);
2853            printf(" %d", n_encoding);
2854            printf(" %d", n_format);
2855            printf("\n");
2856        }
2857    }
2858    }
2859    }
2860    }
2861    function_tests++;
2862#endif
2863
2864    return(test_ret);
2865}
2866
2867
2868static int
2869test_htmlDocContentDumpOutput(void) {
2870    int test_ret = 0;
2871
2872#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2873    int mem_base;
2874    xmlOutputBufferPtr buf; /* the HTML buffer output */
2875    int n_buf;
2876    xmlDocPtr cur; /* the document */
2877    int n_cur;
2878    char * encoding; /* the encoding string */
2879    int n_encoding;
2880
2881    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2882    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2883    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2884        mem_base = xmlMemBlocks();
2885        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2886        cur = gen_xmlDocPtr(n_cur, 1);
2887        encoding = gen_const_char_ptr(n_encoding, 2);
2888
2889        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2890        call_tests++;
2891        des_xmlOutputBufferPtr(n_buf, buf, 0);
2892        des_xmlDocPtr(n_cur, cur, 1);
2893        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2894        xmlResetLastError();
2895        if (mem_base != xmlMemBlocks()) {
2896            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2897	           xmlMemBlocks() - mem_base);
2898	    test_ret++;
2899            printf(" %d", n_buf);
2900            printf(" %d", n_cur);
2901            printf(" %d", n_encoding);
2902            printf("\n");
2903        }
2904    }
2905    }
2906    }
2907    function_tests++;
2908#endif
2909
2910    return(test_ret);
2911}
2912
2913
2914static int
2915test_htmlDocDump(void) {
2916    int test_ret = 0;
2917
2918#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2919    int mem_base;
2920    int ret_val;
2921    FILE * f; /* the FILE* */
2922    int n_f;
2923    xmlDocPtr cur; /* the document */
2924    int n_cur;
2925
2926    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2927    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2928        mem_base = xmlMemBlocks();
2929        f = gen_FILE_ptr(n_f, 0);
2930        cur = gen_xmlDocPtr(n_cur, 1);
2931
2932        ret_val = htmlDocDump(f, cur);
2933        desret_int(ret_val);
2934        call_tests++;
2935        des_FILE_ptr(n_f, f, 0);
2936        des_xmlDocPtr(n_cur, cur, 1);
2937        xmlResetLastError();
2938        if (mem_base != xmlMemBlocks()) {
2939            printf("Leak of %d blocks found in htmlDocDump",
2940	           xmlMemBlocks() - mem_base);
2941	    test_ret++;
2942            printf(" %d", n_f);
2943            printf(" %d", n_cur);
2944            printf("\n");
2945        }
2946    }
2947    }
2948    function_tests++;
2949#endif
2950
2951    return(test_ret);
2952}
2953
2954
2955#define gen_nb_xmlChar_ptr_ptr 1
2956static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2957    return(NULL);
2958}
2959static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2960}
2961
2962static int
2963test_htmlDocDumpMemory(void) {
2964    int test_ret = 0;
2965
2966#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2967    int mem_base;
2968    xmlDocPtr cur; /* the document */
2969    int n_cur;
2970    xmlChar ** mem; /* OUT: the memory pointer */
2971    int n_mem;
2972    int * size; /* OUT: the memory length */
2973    int n_size;
2974
2975    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2976    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2977    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2978        mem_base = xmlMemBlocks();
2979        cur = gen_xmlDocPtr(n_cur, 0);
2980        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2981        size = gen_int_ptr(n_size, 2);
2982
2983        htmlDocDumpMemory(cur, mem, size);
2984        call_tests++;
2985        des_xmlDocPtr(n_cur, cur, 0);
2986        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2987        des_int_ptr(n_size, size, 2);
2988        xmlResetLastError();
2989        if (mem_base != xmlMemBlocks()) {
2990            printf("Leak of %d blocks found in htmlDocDumpMemory",
2991	           xmlMemBlocks() - mem_base);
2992	    test_ret++;
2993            printf(" %d", n_cur);
2994            printf(" %d", n_mem);
2995            printf(" %d", n_size);
2996            printf("\n");
2997        }
2998    }
2999    }
3000    }
3001    function_tests++;
3002#endif
3003
3004    return(test_ret);
3005}
3006
3007
3008static int
3009test_htmlDocDumpMemoryFormat(void) {
3010    int test_ret = 0;
3011
3012#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3013    int mem_base;
3014    xmlDocPtr cur; /* the document */
3015    int n_cur;
3016    xmlChar ** mem; /* OUT: the memory pointer */
3017    int n_mem;
3018    int * size; /* OUT: the memory length */
3019    int n_size;
3020    int format; /* should formatting spaces been added */
3021    int n_format;
3022
3023    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3024    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3025    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3026    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3027        mem_base = xmlMemBlocks();
3028        cur = gen_xmlDocPtr(n_cur, 0);
3029        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3030        size = gen_int_ptr(n_size, 2);
3031        format = gen_int(n_format, 3);
3032
3033        htmlDocDumpMemoryFormat(cur, mem, size, format);
3034        call_tests++;
3035        des_xmlDocPtr(n_cur, cur, 0);
3036        des_xmlChar_ptr_ptr(n_mem, mem, 1);
3037        des_int_ptr(n_size, size, 2);
3038        des_int(n_format, format, 3);
3039        xmlResetLastError();
3040        if (mem_base != xmlMemBlocks()) {
3041            printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3042	           xmlMemBlocks() - mem_base);
3043	    test_ret++;
3044            printf(" %d", n_cur);
3045            printf(" %d", n_mem);
3046            printf(" %d", n_size);
3047            printf(" %d", n_format);
3048            printf("\n");
3049        }
3050    }
3051    }
3052    }
3053    }
3054    function_tests++;
3055#endif
3056
3057    return(test_ret);
3058}
3059
3060
3061static int
3062test_htmlGetMetaEncoding(void) {
3063    int test_ret = 0;
3064
3065#if defined(LIBXML_HTML_ENABLED)
3066    int mem_base;
3067    const xmlChar * ret_val;
3068    htmlDocPtr doc; /* the document */
3069    int n_doc;
3070
3071    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3072        mem_base = xmlMemBlocks();
3073        doc = gen_htmlDocPtr(n_doc, 0);
3074
3075        ret_val = htmlGetMetaEncoding(doc);
3076        desret_const_xmlChar_ptr(ret_val);
3077        call_tests++;
3078        des_htmlDocPtr(n_doc, doc, 0);
3079        xmlResetLastError();
3080        if (mem_base != xmlMemBlocks()) {
3081            printf("Leak of %d blocks found in htmlGetMetaEncoding",
3082	           xmlMemBlocks() - mem_base);
3083	    test_ret++;
3084            printf(" %d", n_doc);
3085            printf("\n");
3086        }
3087    }
3088    function_tests++;
3089#endif
3090
3091    return(test_ret);
3092}
3093
3094
3095static int
3096test_htmlIsBooleanAttr(void) {
3097    int test_ret = 0;
3098
3099#if defined(LIBXML_HTML_ENABLED)
3100    int mem_base;
3101    int ret_val;
3102    xmlChar * name; /* the name of the attribute to check */
3103    int n_name;
3104
3105    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3106        mem_base = xmlMemBlocks();
3107        name = gen_const_xmlChar_ptr(n_name, 0);
3108
3109        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3110        desret_int(ret_val);
3111        call_tests++;
3112        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3113        xmlResetLastError();
3114        if (mem_base != xmlMemBlocks()) {
3115            printf("Leak of %d blocks found in htmlIsBooleanAttr",
3116	           xmlMemBlocks() - mem_base);
3117	    test_ret++;
3118            printf(" %d", n_name);
3119            printf("\n");
3120        }
3121    }
3122    function_tests++;
3123#endif
3124
3125    return(test_ret);
3126}
3127
3128
3129static int
3130test_htmlNewDoc(void) {
3131    int test_ret = 0;
3132
3133#if defined(LIBXML_HTML_ENABLED)
3134    int mem_base;
3135    htmlDocPtr ret_val;
3136    xmlChar * URI; /* URI for the dtd, or NULL */
3137    int n_URI;
3138    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3139    int n_ExternalID;
3140
3141    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3142    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3143        mem_base = xmlMemBlocks();
3144        URI = gen_const_xmlChar_ptr(n_URI, 0);
3145        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3146
3147        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3148        desret_htmlDocPtr(ret_val);
3149        call_tests++;
3150        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3151        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3152        xmlResetLastError();
3153        if (mem_base != xmlMemBlocks()) {
3154            printf("Leak of %d blocks found in htmlNewDoc",
3155	           xmlMemBlocks() - mem_base);
3156	    test_ret++;
3157            printf(" %d", n_URI);
3158            printf(" %d", n_ExternalID);
3159            printf("\n");
3160        }
3161    }
3162    }
3163    function_tests++;
3164#endif
3165
3166    return(test_ret);
3167}
3168
3169
3170static int
3171test_htmlNewDocNoDtD(void) {
3172    int test_ret = 0;
3173
3174#if defined(LIBXML_HTML_ENABLED)
3175    int mem_base;
3176    htmlDocPtr ret_val;
3177    xmlChar * URI; /* URI for the dtd, or NULL */
3178    int n_URI;
3179    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3180    int n_ExternalID;
3181
3182    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3183    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3184        mem_base = xmlMemBlocks();
3185        URI = gen_const_xmlChar_ptr(n_URI, 0);
3186        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3187
3188        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3189        desret_htmlDocPtr(ret_val);
3190        call_tests++;
3191        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3192        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3193        xmlResetLastError();
3194        if (mem_base != xmlMemBlocks()) {
3195            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3196	           xmlMemBlocks() - mem_base);
3197	    test_ret++;
3198            printf(" %d", n_URI);
3199            printf(" %d", n_ExternalID);
3200            printf("\n");
3201        }
3202    }
3203    }
3204    function_tests++;
3205#endif
3206
3207    return(test_ret);
3208}
3209
3210
3211static int
3212test_htmlNodeDump(void) {
3213    int test_ret = 0;
3214
3215#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3216    int mem_base;
3217    int ret_val;
3218    xmlBufferPtr buf; /* the HTML buffer output */
3219    int n_buf;
3220    xmlDocPtr doc; /* the document */
3221    int n_doc;
3222    xmlNodePtr cur; /* the current node */
3223    int n_cur;
3224
3225    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3226    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3227    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3228        mem_base = xmlMemBlocks();
3229        buf = gen_xmlBufferPtr(n_buf, 0);
3230        doc = gen_xmlDocPtr(n_doc, 1);
3231        cur = gen_xmlNodePtr(n_cur, 2);
3232
3233        ret_val = htmlNodeDump(buf, doc, cur);
3234        desret_int(ret_val);
3235        call_tests++;
3236        des_xmlBufferPtr(n_buf, buf, 0);
3237        des_xmlDocPtr(n_doc, doc, 1);
3238        des_xmlNodePtr(n_cur, cur, 2);
3239        xmlResetLastError();
3240        if (mem_base != xmlMemBlocks()) {
3241            printf("Leak of %d blocks found in htmlNodeDump",
3242	           xmlMemBlocks() - mem_base);
3243	    test_ret++;
3244            printf(" %d", n_buf);
3245            printf(" %d", n_doc);
3246            printf(" %d", n_cur);
3247            printf("\n");
3248        }
3249    }
3250    }
3251    }
3252    function_tests++;
3253#endif
3254
3255    return(test_ret);
3256}
3257
3258
3259static int
3260test_htmlNodeDumpFile(void) {
3261    int test_ret = 0;
3262
3263#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3264    int mem_base;
3265    FILE * out; /* the FILE pointer */
3266    int n_out;
3267    xmlDocPtr doc; /* the document */
3268    int n_doc;
3269    xmlNodePtr cur; /* the current node */
3270    int n_cur;
3271
3272    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3273    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3274    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3275        mem_base = xmlMemBlocks();
3276        out = gen_FILE_ptr(n_out, 0);
3277        doc = gen_xmlDocPtr(n_doc, 1);
3278        cur = gen_xmlNodePtr(n_cur, 2);
3279
3280        htmlNodeDumpFile(out, doc, cur);
3281        call_tests++;
3282        des_FILE_ptr(n_out, out, 0);
3283        des_xmlDocPtr(n_doc, doc, 1);
3284        des_xmlNodePtr(n_cur, cur, 2);
3285        xmlResetLastError();
3286        if (mem_base != xmlMemBlocks()) {
3287            printf("Leak of %d blocks found in htmlNodeDumpFile",
3288	           xmlMemBlocks() - mem_base);
3289	    test_ret++;
3290            printf(" %d", n_out);
3291            printf(" %d", n_doc);
3292            printf(" %d", n_cur);
3293            printf("\n");
3294        }
3295    }
3296    }
3297    }
3298    function_tests++;
3299#endif
3300
3301    return(test_ret);
3302}
3303
3304
3305static int
3306test_htmlNodeDumpFileFormat(void) {
3307    int test_ret = 0;
3308
3309#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3310    int mem_base;
3311    int ret_val;
3312    FILE * out; /* the FILE pointer */
3313    int n_out;
3314    xmlDocPtr doc; /* the document */
3315    int n_doc;
3316    xmlNodePtr cur; /* the current node */
3317    int n_cur;
3318    char * encoding; /* the document encoding */
3319    int n_encoding;
3320    int format; /* should formatting spaces been added */
3321    int n_format;
3322
3323    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3324    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3325    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3326    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3327    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3328        mem_base = xmlMemBlocks();
3329        out = gen_FILE_ptr(n_out, 0);
3330        doc = gen_xmlDocPtr(n_doc, 1);
3331        cur = gen_xmlNodePtr(n_cur, 2);
3332        encoding = gen_const_char_ptr(n_encoding, 3);
3333        format = gen_int(n_format, 4);
3334
3335        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3336        desret_int(ret_val);
3337        call_tests++;
3338        des_FILE_ptr(n_out, out, 0);
3339        des_xmlDocPtr(n_doc, doc, 1);
3340        des_xmlNodePtr(n_cur, cur, 2);
3341        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3342        des_int(n_format, format, 4);
3343        xmlResetLastError();
3344        if (mem_base != xmlMemBlocks()) {
3345            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3346	           xmlMemBlocks() - mem_base);
3347	    test_ret++;
3348            printf(" %d", n_out);
3349            printf(" %d", n_doc);
3350            printf(" %d", n_cur);
3351            printf(" %d", n_encoding);
3352            printf(" %d", n_format);
3353            printf("\n");
3354        }
3355    }
3356    }
3357    }
3358    }
3359    }
3360    function_tests++;
3361#endif
3362
3363    return(test_ret);
3364}
3365
3366
3367static int
3368test_htmlNodeDumpFormatOutput(void) {
3369    int test_ret = 0;
3370
3371#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3372    int mem_base;
3373    xmlOutputBufferPtr buf; /* the HTML buffer output */
3374    int n_buf;
3375    xmlDocPtr doc; /* the document */
3376    int n_doc;
3377    xmlNodePtr cur; /* the current node */
3378    int n_cur;
3379    char * encoding; /* the encoding string */
3380    int n_encoding;
3381    int format; /* should formatting spaces been added */
3382    int n_format;
3383
3384    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3385    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3386    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3387    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3388    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3389        mem_base = xmlMemBlocks();
3390        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3391        doc = gen_xmlDocPtr(n_doc, 1);
3392        cur = gen_xmlNodePtr(n_cur, 2);
3393        encoding = gen_const_char_ptr(n_encoding, 3);
3394        format = gen_int(n_format, 4);
3395
3396        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3397        call_tests++;
3398        des_xmlOutputBufferPtr(n_buf, buf, 0);
3399        des_xmlDocPtr(n_doc, doc, 1);
3400        des_xmlNodePtr(n_cur, cur, 2);
3401        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3402        des_int(n_format, format, 4);
3403        xmlResetLastError();
3404        if (mem_base != xmlMemBlocks()) {
3405            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3406	           xmlMemBlocks() - mem_base);
3407	    test_ret++;
3408            printf(" %d", n_buf);
3409            printf(" %d", n_doc);
3410            printf(" %d", n_cur);
3411            printf(" %d", n_encoding);
3412            printf(" %d", n_format);
3413            printf("\n");
3414        }
3415    }
3416    }
3417    }
3418    }
3419    }
3420    function_tests++;
3421#endif
3422
3423    return(test_ret);
3424}
3425
3426
3427static int
3428test_htmlNodeDumpOutput(void) {
3429    int test_ret = 0;
3430
3431#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3432    int mem_base;
3433    xmlOutputBufferPtr buf; /* the HTML buffer output */
3434    int n_buf;
3435    xmlDocPtr doc; /* the document */
3436    int n_doc;
3437    xmlNodePtr cur; /* the current node */
3438    int n_cur;
3439    char * encoding; /* the encoding string */
3440    int n_encoding;
3441
3442    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3443    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3444    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3445    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3446        mem_base = xmlMemBlocks();
3447        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3448        doc = gen_xmlDocPtr(n_doc, 1);
3449        cur = gen_xmlNodePtr(n_cur, 2);
3450        encoding = gen_const_char_ptr(n_encoding, 3);
3451
3452        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3453        call_tests++;
3454        des_xmlOutputBufferPtr(n_buf, buf, 0);
3455        des_xmlDocPtr(n_doc, doc, 1);
3456        des_xmlNodePtr(n_cur, cur, 2);
3457        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3458        xmlResetLastError();
3459        if (mem_base != xmlMemBlocks()) {
3460            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3461	           xmlMemBlocks() - mem_base);
3462	    test_ret++;
3463            printf(" %d", n_buf);
3464            printf(" %d", n_doc);
3465            printf(" %d", n_cur);
3466            printf(" %d", n_encoding);
3467            printf("\n");
3468        }
3469    }
3470    }
3471    }
3472    }
3473    function_tests++;
3474#endif
3475
3476    return(test_ret);
3477}
3478
3479
3480static int
3481test_htmlSaveFile(void) {
3482    int test_ret = 0;
3483
3484#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3485    int mem_base;
3486    int ret_val;
3487    const char * filename; /* the filename (or URL) */
3488    int n_filename;
3489    xmlDocPtr cur; /* the document */
3490    int n_cur;
3491
3492    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3493    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3494        mem_base = xmlMemBlocks();
3495        filename = gen_fileoutput(n_filename, 0);
3496        cur = gen_xmlDocPtr(n_cur, 1);
3497
3498        ret_val = htmlSaveFile(filename, cur);
3499        desret_int(ret_val);
3500        call_tests++;
3501        des_fileoutput(n_filename, filename, 0);
3502        des_xmlDocPtr(n_cur, cur, 1);
3503        xmlResetLastError();
3504        if (mem_base != xmlMemBlocks()) {
3505            printf("Leak of %d blocks found in htmlSaveFile",
3506	           xmlMemBlocks() - mem_base);
3507	    test_ret++;
3508            printf(" %d", n_filename);
3509            printf(" %d", n_cur);
3510            printf("\n");
3511        }
3512    }
3513    }
3514    function_tests++;
3515#endif
3516
3517    return(test_ret);
3518}
3519
3520
3521static int
3522test_htmlSaveFileEnc(void) {
3523    int test_ret = 0;
3524
3525#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3526    int mem_base;
3527    int ret_val;
3528    const char * filename; /* the filename */
3529    int n_filename;
3530    xmlDocPtr cur; /* the document */
3531    int n_cur;
3532    char * encoding; /* the document encoding */
3533    int n_encoding;
3534
3535    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3536    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3537    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3538        mem_base = xmlMemBlocks();
3539        filename = gen_fileoutput(n_filename, 0);
3540        cur = gen_xmlDocPtr(n_cur, 1);
3541        encoding = gen_const_char_ptr(n_encoding, 2);
3542
3543        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3544        desret_int(ret_val);
3545        call_tests++;
3546        des_fileoutput(n_filename, filename, 0);
3547        des_xmlDocPtr(n_cur, cur, 1);
3548        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3549        xmlResetLastError();
3550        if (mem_base != xmlMemBlocks()) {
3551            printf("Leak of %d blocks found in htmlSaveFileEnc",
3552	           xmlMemBlocks() - mem_base);
3553	    test_ret++;
3554            printf(" %d", n_filename);
3555            printf(" %d", n_cur);
3556            printf(" %d", n_encoding);
3557            printf("\n");
3558        }
3559    }
3560    }
3561    }
3562    function_tests++;
3563#endif
3564
3565    return(test_ret);
3566}
3567
3568
3569static int
3570test_htmlSaveFileFormat(void) {
3571    int test_ret = 0;
3572
3573#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3574    int mem_base;
3575    int ret_val;
3576    const char * filename; /* the filename */
3577    int n_filename;
3578    xmlDocPtr cur; /* the document */
3579    int n_cur;
3580    char * encoding; /* the document encoding */
3581    int n_encoding;
3582    int format; /* should formatting spaces been added */
3583    int n_format;
3584
3585    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3586    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3587    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3588    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3589        mem_base = xmlMemBlocks();
3590        filename = gen_fileoutput(n_filename, 0);
3591        cur = gen_xmlDocPtr(n_cur, 1);
3592        encoding = gen_const_char_ptr(n_encoding, 2);
3593        format = gen_int(n_format, 3);
3594
3595        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3596        desret_int(ret_val);
3597        call_tests++;
3598        des_fileoutput(n_filename, filename, 0);
3599        des_xmlDocPtr(n_cur, cur, 1);
3600        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3601        des_int(n_format, format, 3);
3602        xmlResetLastError();
3603        if (mem_base != xmlMemBlocks()) {
3604            printf("Leak of %d blocks found in htmlSaveFileFormat",
3605	           xmlMemBlocks() - mem_base);
3606	    test_ret++;
3607            printf(" %d", n_filename);
3608            printf(" %d", n_cur);
3609            printf(" %d", n_encoding);
3610            printf(" %d", n_format);
3611            printf("\n");
3612        }
3613    }
3614    }
3615    }
3616    }
3617    function_tests++;
3618#endif
3619
3620    return(test_ret);
3621}
3622
3623
3624static int
3625test_htmlSetMetaEncoding(void) {
3626    int test_ret = 0;
3627
3628#if defined(LIBXML_HTML_ENABLED)
3629    int mem_base;
3630    int ret_val;
3631    htmlDocPtr doc; /* the document */
3632    int n_doc;
3633    xmlChar * encoding; /* the encoding string */
3634    int n_encoding;
3635
3636    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3637    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3638        mem_base = xmlMemBlocks();
3639        doc = gen_htmlDocPtr(n_doc, 0);
3640        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3641
3642        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3643        desret_int(ret_val);
3644        call_tests++;
3645        des_htmlDocPtr(n_doc, doc, 0);
3646        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3647        xmlResetLastError();
3648        if (mem_base != xmlMemBlocks()) {
3649            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3650	           xmlMemBlocks() - mem_base);
3651	    test_ret++;
3652            printf(" %d", n_doc);
3653            printf(" %d", n_encoding);
3654            printf("\n");
3655        }
3656    }
3657    }
3658    function_tests++;
3659#endif
3660
3661    return(test_ret);
3662}
3663
3664static int
3665test_HTMLtree(void) {
3666    int test_ret = 0;
3667
3668    if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3669    test_ret += test_htmlDocContentDumpFormatOutput();
3670    test_ret += test_htmlDocContentDumpOutput();
3671    test_ret += test_htmlDocDump();
3672    test_ret += test_htmlDocDumpMemory();
3673    test_ret += test_htmlDocDumpMemoryFormat();
3674    test_ret += test_htmlGetMetaEncoding();
3675    test_ret += test_htmlIsBooleanAttr();
3676    test_ret += test_htmlNewDoc();
3677    test_ret += test_htmlNewDocNoDtD();
3678    test_ret += test_htmlNodeDump();
3679    test_ret += test_htmlNodeDumpFile();
3680    test_ret += test_htmlNodeDumpFileFormat();
3681    test_ret += test_htmlNodeDumpFormatOutput();
3682    test_ret += test_htmlNodeDumpOutput();
3683    test_ret += test_htmlSaveFile();
3684    test_ret += test_htmlSaveFileEnc();
3685    test_ret += test_htmlSaveFileFormat();
3686    test_ret += test_htmlSetMetaEncoding();
3687
3688    if (test_ret != 0)
3689	printf("Module HTMLtree: %d errors\n", test_ret);
3690    return(test_ret);
3691}
3692
3693static int
3694test_docbDefaultSAXHandlerInit(void) {
3695    int test_ret = 0;
3696
3697#if defined(LIBXML_DOCB_ENABLED)
3698#ifdef LIBXML_DOCB_ENABLED
3699    int mem_base;
3700
3701        mem_base = xmlMemBlocks();
3702
3703        docbDefaultSAXHandlerInit();
3704        call_tests++;
3705        xmlResetLastError();
3706        if (mem_base != xmlMemBlocks()) {
3707            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3708	           xmlMemBlocks() - mem_base);
3709	    test_ret++;
3710            printf("\n");
3711        }
3712    function_tests++;
3713#endif
3714#endif
3715
3716    return(test_ret);
3717}
3718
3719
3720static int
3721test_htmlDefaultSAXHandlerInit(void) {
3722    int test_ret = 0;
3723
3724#if defined(LIBXML_HTML_ENABLED)
3725#ifdef LIBXML_HTML_ENABLED
3726    int mem_base;
3727
3728        mem_base = xmlMemBlocks();
3729
3730        htmlDefaultSAXHandlerInit();
3731        call_tests++;
3732        xmlResetLastError();
3733        if (mem_base != xmlMemBlocks()) {
3734            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3735	           xmlMemBlocks() - mem_base);
3736	    test_ret++;
3737            printf("\n");
3738        }
3739    function_tests++;
3740#endif
3741#endif
3742
3743    return(test_ret);
3744}
3745
3746
3747static int
3748test_xmlDefaultSAXHandlerInit(void) {
3749    int test_ret = 0;
3750
3751    int mem_base;
3752
3753        mem_base = xmlMemBlocks();
3754
3755        xmlDefaultSAXHandlerInit();
3756        call_tests++;
3757        xmlResetLastError();
3758        if (mem_base != xmlMemBlocks()) {
3759            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3760	           xmlMemBlocks() - mem_base);
3761	    test_ret++;
3762            printf("\n");
3763        }
3764    function_tests++;
3765
3766    return(test_ret);
3767}
3768
3769
3770#define gen_nb_xmlEnumerationPtr 1
3771static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3772    return(NULL);
3773}
3774static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3775}
3776
3777static int
3778test_xmlSAX2AttributeDecl(void) {
3779    int test_ret = 0;
3780
3781    int mem_base;
3782    void * ctx; /* the user data (XML parser context) */
3783    int n_ctx;
3784    xmlChar * elem; /* the name of the element */
3785    int n_elem;
3786    xmlChar * fullname; /* the attribute name */
3787    int n_fullname;
3788    int type; /* the attribute type */
3789    int n_type;
3790    int def; /* the type of default value */
3791    int n_def;
3792    xmlChar * defaultValue; /* the attribute default value */
3793    int n_defaultValue;
3794    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3795    int n_tree;
3796
3797    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3798    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3799    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3800    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3801    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3802    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3803    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3804        mem_base = xmlMemBlocks();
3805        ctx = gen_void_ptr(n_ctx, 0);
3806        elem = gen_const_xmlChar_ptr(n_elem, 1);
3807        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3808        type = gen_int(n_type, 3);
3809        def = gen_int(n_def, 4);
3810        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3811        tree = gen_xmlEnumerationPtr(n_tree, 6);
3812
3813        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3814        call_tests++;
3815        des_void_ptr(n_ctx, ctx, 0);
3816        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3817        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3818        des_int(n_type, type, 3);
3819        des_int(n_def, def, 4);
3820        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3821        des_xmlEnumerationPtr(n_tree, tree, 6);
3822        xmlResetLastError();
3823        if (mem_base != xmlMemBlocks()) {
3824            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3825	           xmlMemBlocks() - mem_base);
3826	    test_ret++;
3827            printf(" %d", n_ctx);
3828            printf(" %d", n_elem);
3829            printf(" %d", n_fullname);
3830            printf(" %d", n_type);
3831            printf(" %d", n_def);
3832            printf(" %d", n_defaultValue);
3833            printf(" %d", n_tree);
3834            printf("\n");
3835        }
3836    }
3837    }
3838    }
3839    }
3840    }
3841    }
3842    }
3843    function_tests++;
3844
3845    return(test_ret);
3846}
3847
3848
3849static int
3850test_xmlSAX2CDataBlock(void) {
3851    int test_ret = 0;
3852
3853    int mem_base;
3854    void * ctx; /* the user data (XML parser context) */
3855    int n_ctx;
3856    xmlChar * value; /* The pcdata content */
3857    int n_value;
3858    int len; /* the block length */
3859    int n_len;
3860
3861    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3862    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3863    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3864        mem_base = xmlMemBlocks();
3865        ctx = gen_void_ptr(n_ctx, 0);
3866        value = gen_const_xmlChar_ptr(n_value, 1);
3867        len = gen_int(n_len, 2);
3868
3869        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3870        call_tests++;
3871        des_void_ptr(n_ctx, ctx, 0);
3872        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3873        des_int(n_len, len, 2);
3874        xmlResetLastError();
3875        if (mem_base != xmlMemBlocks()) {
3876            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3877	           xmlMemBlocks() - mem_base);
3878	    test_ret++;
3879            printf(" %d", n_ctx);
3880            printf(" %d", n_value);
3881            printf(" %d", n_len);
3882            printf("\n");
3883        }
3884    }
3885    }
3886    }
3887    function_tests++;
3888
3889    return(test_ret);
3890}
3891
3892
3893static int
3894test_xmlSAX2Characters(void) {
3895    int test_ret = 0;
3896
3897    int mem_base;
3898    void * ctx; /* the user data (XML parser context) */
3899    int n_ctx;
3900    xmlChar * ch; /* a xmlChar string */
3901    int n_ch;
3902    int len; /* the number of xmlChar */
3903    int n_len;
3904
3905    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3906    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3907    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3908        mem_base = xmlMemBlocks();
3909        ctx = gen_void_ptr(n_ctx, 0);
3910        ch = gen_const_xmlChar_ptr(n_ch, 1);
3911        len = gen_int(n_len, 2);
3912
3913        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3914        call_tests++;
3915        des_void_ptr(n_ctx, ctx, 0);
3916        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3917        des_int(n_len, len, 2);
3918        xmlResetLastError();
3919        if (mem_base != xmlMemBlocks()) {
3920            printf("Leak of %d blocks found in xmlSAX2Characters",
3921	           xmlMemBlocks() - mem_base);
3922	    test_ret++;
3923            printf(" %d", n_ctx);
3924            printf(" %d", n_ch);
3925            printf(" %d", n_len);
3926            printf("\n");
3927        }
3928    }
3929    }
3930    }
3931    function_tests++;
3932
3933    return(test_ret);
3934}
3935
3936
3937static int
3938test_xmlSAX2Comment(void) {
3939    int test_ret = 0;
3940
3941    int mem_base;
3942    void * ctx; /* the user data (XML parser context) */
3943    int n_ctx;
3944    xmlChar * value; /* the xmlSAX2Comment content */
3945    int n_value;
3946
3947    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3948    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3949        mem_base = xmlMemBlocks();
3950        ctx = gen_void_ptr(n_ctx, 0);
3951        value = gen_const_xmlChar_ptr(n_value, 1);
3952
3953        xmlSAX2Comment(ctx, (const xmlChar *)value);
3954        call_tests++;
3955        des_void_ptr(n_ctx, ctx, 0);
3956        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3957        xmlResetLastError();
3958        if (mem_base != xmlMemBlocks()) {
3959            printf("Leak of %d blocks found in xmlSAX2Comment",
3960	           xmlMemBlocks() - mem_base);
3961	    test_ret++;
3962            printf(" %d", n_ctx);
3963            printf(" %d", n_value);
3964            printf("\n");
3965        }
3966    }
3967    }
3968    function_tests++;
3969
3970    return(test_ret);
3971}
3972
3973
3974static int
3975test_xmlSAX2ElementDecl(void) {
3976    int test_ret = 0;
3977
3978    int mem_base;
3979    void * ctx; /* the user data (XML parser context) */
3980    int n_ctx;
3981    xmlChar * name; /* the element name */
3982    int n_name;
3983    int type; /* the element type */
3984    int n_type;
3985    xmlElementContentPtr content; /* the element value tree */
3986    int n_content;
3987
3988    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3989    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3990    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3991    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3992        mem_base = xmlMemBlocks();
3993        ctx = gen_void_ptr(n_ctx, 0);
3994        name = gen_const_xmlChar_ptr(n_name, 1);
3995        type = gen_int(n_type, 2);
3996        content = gen_xmlElementContentPtr(n_content, 3);
3997
3998        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
3999        call_tests++;
4000        des_void_ptr(n_ctx, ctx, 0);
4001        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4002        des_int(n_type, type, 2);
4003        des_xmlElementContentPtr(n_content, content, 3);
4004        xmlResetLastError();
4005        if (mem_base != xmlMemBlocks()) {
4006            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4007	           xmlMemBlocks() - mem_base);
4008	    test_ret++;
4009            printf(" %d", n_ctx);
4010            printf(" %d", n_name);
4011            printf(" %d", n_type);
4012            printf(" %d", n_content);
4013            printf("\n");
4014        }
4015    }
4016    }
4017    }
4018    }
4019    function_tests++;
4020
4021    return(test_ret);
4022}
4023
4024
4025static int
4026test_xmlSAX2EndDocument(void) {
4027    int test_ret = 0;
4028
4029    int mem_base;
4030    void * ctx; /* the user data (XML parser context) */
4031    int n_ctx;
4032
4033    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4034        mem_base = xmlMemBlocks();
4035        ctx = gen_void_ptr(n_ctx, 0);
4036
4037        xmlSAX2EndDocument(ctx);
4038        call_tests++;
4039        des_void_ptr(n_ctx, ctx, 0);
4040        xmlResetLastError();
4041        if (mem_base != xmlMemBlocks()) {
4042            printf("Leak of %d blocks found in xmlSAX2EndDocument",
4043	           xmlMemBlocks() - mem_base);
4044	    test_ret++;
4045            printf(" %d", n_ctx);
4046            printf("\n");
4047        }
4048    }
4049    function_tests++;
4050
4051    return(test_ret);
4052}
4053
4054
4055static int
4056test_xmlSAX2EndElement(void) {
4057    int test_ret = 0;
4058
4059#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4060#ifdef LIBXML_SAX1_ENABLED
4061    int mem_base;
4062    void * ctx; /* the user data (XML parser context) */
4063    int n_ctx;
4064    xmlChar * name; /* The element name */
4065    int n_name;
4066
4067    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4068    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4069        mem_base = xmlMemBlocks();
4070        ctx = gen_void_ptr(n_ctx, 0);
4071        name = gen_const_xmlChar_ptr(n_name, 1);
4072
4073        xmlSAX2EndElement(ctx, (const xmlChar *)name);
4074        call_tests++;
4075        des_void_ptr(n_ctx, ctx, 0);
4076        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4077        xmlResetLastError();
4078        if (mem_base != xmlMemBlocks()) {
4079            printf("Leak of %d blocks found in xmlSAX2EndElement",
4080	           xmlMemBlocks() - mem_base);
4081	    test_ret++;
4082            printf(" %d", n_ctx);
4083            printf(" %d", n_name);
4084            printf("\n");
4085        }
4086    }
4087    }
4088    function_tests++;
4089#endif
4090#endif
4091
4092    return(test_ret);
4093}
4094
4095
4096static int
4097test_xmlSAX2EndElementNs(void) {
4098    int test_ret = 0;
4099
4100    int mem_base;
4101    void * ctx; /* the user data (XML parser context) */
4102    int n_ctx;
4103    xmlChar * localname; /* the local name of the element */
4104    int n_localname;
4105    xmlChar * prefix; /* the element namespace prefix if available */
4106    int n_prefix;
4107    xmlChar * URI; /* the element namespace name if available */
4108    int n_URI;
4109
4110    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4111    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4112    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4113    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4114        mem_base = xmlMemBlocks();
4115        ctx = gen_void_ptr(n_ctx, 0);
4116        localname = gen_const_xmlChar_ptr(n_localname, 1);
4117        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4118        URI = gen_const_xmlChar_ptr(n_URI, 3);
4119
4120        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4121        call_tests++;
4122        des_void_ptr(n_ctx, ctx, 0);
4123        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4124        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4125        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4126        xmlResetLastError();
4127        if (mem_base != xmlMemBlocks()) {
4128            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4129	           xmlMemBlocks() - mem_base);
4130	    test_ret++;
4131            printf(" %d", n_ctx);
4132            printf(" %d", n_localname);
4133            printf(" %d", n_prefix);
4134            printf(" %d", n_URI);
4135            printf("\n");
4136        }
4137    }
4138    }
4139    }
4140    }
4141    function_tests++;
4142
4143    return(test_ret);
4144}
4145
4146
4147static int
4148test_xmlSAX2EntityDecl(void) {
4149    int test_ret = 0;
4150
4151    int mem_base;
4152    void * ctx; /* the user data (XML parser context) */
4153    int n_ctx;
4154    xmlChar * name; /* the entity name */
4155    int n_name;
4156    int type; /* the entity type */
4157    int n_type;
4158    xmlChar * publicId; /* The public ID of the entity */
4159    int n_publicId;
4160    xmlChar * systemId; /* The system ID of the entity */
4161    int n_systemId;
4162    xmlChar * content; /* the entity value (without processing). */
4163    int n_content;
4164
4165    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4166    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4167    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4168    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4169    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4170    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4171        mem_base = xmlMemBlocks();
4172        ctx = gen_void_ptr(n_ctx, 0);
4173        name = gen_const_xmlChar_ptr(n_name, 1);
4174        type = gen_int(n_type, 2);
4175        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4176        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4177        content = gen_xmlChar_ptr(n_content, 5);
4178
4179        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4180        call_tests++;
4181        des_void_ptr(n_ctx, ctx, 0);
4182        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4183        des_int(n_type, type, 2);
4184        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4185        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4186        des_xmlChar_ptr(n_content, content, 5);
4187        xmlResetLastError();
4188        if (mem_base != xmlMemBlocks()) {
4189            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4190	           xmlMemBlocks() - mem_base);
4191	    test_ret++;
4192            printf(" %d", n_ctx);
4193            printf(" %d", n_name);
4194            printf(" %d", n_type);
4195            printf(" %d", n_publicId);
4196            printf(" %d", n_systemId);
4197            printf(" %d", n_content);
4198            printf("\n");
4199        }
4200    }
4201    }
4202    }
4203    }
4204    }
4205    }
4206    function_tests++;
4207
4208    return(test_ret);
4209}
4210
4211
4212static int
4213test_xmlSAX2ExternalSubset(void) {
4214    int test_ret = 0;
4215
4216    int mem_base;
4217    void * ctx; /* the user data (XML parser context) */
4218    int n_ctx;
4219    xmlChar * name; /* the root element name */
4220    int n_name;
4221    xmlChar * ExternalID; /* the external ID */
4222    int n_ExternalID;
4223    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4224    int n_SystemID;
4225
4226    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4227    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4228    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4229    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4230        mem_base = xmlMemBlocks();
4231        ctx = gen_void_ptr(n_ctx, 0);
4232        name = gen_const_xmlChar_ptr(n_name, 1);
4233        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4234        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4235
4236        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4237        call_tests++;
4238        des_void_ptr(n_ctx, ctx, 0);
4239        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4240        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4241        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4242        xmlResetLastError();
4243        if (mem_base != xmlMemBlocks()) {
4244            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4245	           xmlMemBlocks() - mem_base);
4246	    test_ret++;
4247            printf(" %d", n_ctx);
4248            printf(" %d", n_name);
4249            printf(" %d", n_ExternalID);
4250            printf(" %d", n_SystemID);
4251            printf("\n");
4252        }
4253    }
4254    }
4255    }
4256    }
4257    function_tests++;
4258
4259    return(test_ret);
4260}
4261
4262
4263static int
4264test_xmlSAX2GetColumnNumber(void) {
4265    int test_ret = 0;
4266
4267    int mem_base;
4268    int ret_val;
4269    void * ctx; /* the user data (XML parser context) */
4270    int n_ctx;
4271
4272    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4273        mem_base = xmlMemBlocks();
4274        ctx = gen_void_ptr(n_ctx, 0);
4275
4276        ret_val = xmlSAX2GetColumnNumber(ctx);
4277        desret_int(ret_val);
4278        call_tests++;
4279        des_void_ptr(n_ctx, ctx, 0);
4280        xmlResetLastError();
4281        if (mem_base != xmlMemBlocks()) {
4282            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4283	           xmlMemBlocks() - mem_base);
4284	    test_ret++;
4285            printf(" %d", n_ctx);
4286            printf("\n");
4287        }
4288    }
4289    function_tests++;
4290
4291    return(test_ret);
4292}
4293
4294
4295static int
4296test_xmlSAX2GetEntity(void) {
4297    int test_ret = 0;
4298
4299    int mem_base;
4300    xmlEntityPtr ret_val;
4301    void * ctx; /* the user data (XML parser context) */
4302    int n_ctx;
4303    xmlChar * name; /* The entity name */
4304    int n_name;
4305
4306    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4307    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4308        mem_base = xmlMemBlocks();
4309        ctx = gen_void_ptr(n_ctx, 0);
4310        name = gen_const_xmlChar_ptr(n_name, 1);
4311
4312        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4313        desret_xmlEntityPtr(ret_val);
4314        call_tests++;
4315        des_void_ptr(n_ctx, ctx, 0);
4316        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4317        xmlResetLastError();
4318        if (mem_base != xmlMemBlocks()) {
4319            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4320	           xmlMemBlocks() - mem_base);
4321	    test_ret++;
4322            printf(" %d", n_ctx);
4323            printf(" %d", n_name);
4324            printf("\n");
4325        }
4326    }
4327    }
4328    function_tests++;
4329
4330    return(test_ret);
4331}
4332
4333
4334static int
4335test_xmlSAX2GetLineNumber(void) {
4336    int test_ret = 0;
4337
4338    int mem_base;
4339    int ret_val;
4340    void * ctx; /* the user data (XML parser context) */
4341    int n_ctx;
4342
4343    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4344        mem_base = xmlMemBlocks();
4345        ctx = gen_void_ptr(n_ctx, 0);
4346
4347        ret_val = xmlSAX2GetLineNumber(ctx);
4348        desret_int(ret_val);
4349        call_tests++;
4350        des_void_ptr(n_ctx, ctx, 0);
4351        xmlResetLastError();
4352        if (mem_base != xmlMemBlocks()) {
4353            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4354	           xmlMemBlocks() - mem_base);
4355	    test_ret++;
4356            printf(" %d", n_ctx);
4357            printf("\n");
4358        }
4359    }
4360    function_tests++;
4361
4362    return(test_ret);
4363}
4364
4365
4366static int
4367test_xmlSAX2GetParameterEntity(void) {
4368    int test_ret = 0;
4369
4370    int mem_base;
4371    xmlEntityPtr ret_val;
4372    void * ctx; /* the user data (XML parser context) */
4373    int n_ctx;
4374    xmlChar * name; /* The entity name */
4375    int n_name;
4376
4377    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4378    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4379        mem_base = xmlMemBlocks();
4380        ctx = gen_void_ptr(n_ctx, 0);
4381        name = gen_const_xmlChar_ptr(n_name, 1);
4382
4383        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4384        desret_xmlEntityPtr(ret_val);
4385        call_tests++;
4386        des_void_ptr(n_ctx, ctx, 0);
4387        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4388        xmlResetLastError();
4389        if (mem_base != xmlMemBlocks()) {
4390            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4391	           xmlMemBlocks() - mem_base);
4392	    test_ret++;
4393            printf(" %d", n_ctx);
4394            printf(" %d", n_name);
4395            printf("\n");
4396        }
4397    }
4398    }
4399    function_tests++;
4400
4401    return(test_ret);
4402}
4403
4404
4405static int
4406test_xmlSAX2GetPublicId(void) {
4407    int test_ret = 0;
4408
4409    int mem_base;
4410    const xmlChar * ret_val;
4411    void * ctx; /* the user data (XML parser context) */
4412    int n_ctx;
4413
4414    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4415        mem_base = xmlMemBlocks();
4416        ctx = gen_void_ptr(n_ctx, 0);
4417
4418        ret_val = xmlSAX2GetPublicId(ctx);
4419        desret_const_xmlChar_ptr(ret_val);
4420        call_tests++;
4421        des_void_ptr(n_ctx, ctx, 0);
4422        xmlResetLastError();
4423        if (mem_base != xmlMemBlocks()) {
4424            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4425	           xmlMemBlocks() - mem_base);
4426	    test_ret++;
4427            printf(" %d", n_ctx);
4428            printf("\n");
4429        }
4430    }
4431    function_tests++;
4432
4433    return(test_ret);
4434}
4435
4436
4437static int
4438test_xmlSAX2GetSystemId(void) {
4439    int test_ret = 0;
4440
4441    int mem_base;
4442    const xmlChar * ret_val;
4443    void * ctx; /* the user data (XML parser context) */
4444    int n_ctx;
4445
4446    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4447        mem_base = xmlMemBlocks();
4448        ctx = gen_void_ptr(n_ctx, 0);
4449
4450        ret_val = xmlSAX2GetSystemId(ctx);
4451        desret_const_xmlChar_ptr(ret_val);
4452        call_tests++;
4453        des_void_ptr(n_ctx, ctx, 0);
4454        xmlResetLastError();
4455        if (mem_base != xmlMemBlocks()) {
4456            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4457	           xmlMemBlocks() - mem_base);
4458	    test_ret++;
4459            printf(" %d", n_ctx);
4460            printf("\n");
4461        }
4462    }
4463    function_tests++;
4464
4465    return(test_ret);
4466}
4467
4468
4469static int
4470test_xmlSAX2HasExternalSubset(void) {
4471    int test_ret = 0;
4472
4473    int mem_base;
4474    int ret_val;
4475    void * ctx; /* the user data (XML parser context) */
4476    int n_ctx;
4477
4478    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4479        mem_base = xmlMemBlocks();
4480        ctx = gen_void_ptr(n_ctx, 0);
4481
4482        ret_val = xmlSAX2HasExternalSubset(ctx);
4483        desret_int(ret_val);
4484        call_tests++;
4485        des_void_ptr(n_ctx, ctx, 0);
4486        xmlResetLastError();
4487        if (mem_base != xmlMemBlocks()) {
4488            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4489	           xmlMemBlocks() - mem_base);
4490	    test_ret++;
4491            printf(" %d", n_ctx);
4492            printf("\n");
4493        }
4494    }
4495    function_tests++;
4496
4497    return(test_ret);
4498}
4499
4500
4501static int
4502test_xmlSAX2HasInternalSubset(void) {
4503    int test_ret = 0;
4504
4505    int mem_base;
4506    int ret_val;
4507    void * ctx; /* the user data (XML parser context) */
4508    int n_ctx;
4509
4510    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4511        mem_base = xmlMemBlocks();
4512        ctx = gen_void_ptr(n_ctx, 0);
4513
4514        ret_val = xmlSAX2HasInternalSubset(ctx);
4515        desret_int(ret_val);
4516        call_tests++;
4517        des_void_ptr(n_ctx, ctx, 0);
4518        xmlResetLastError();
4519        if (mem_base != xmlMemBlocks()) {
4520            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4521	           xmlMemBlocks() - mem_base);
4522	    test_ret++;
4523            printf(" %d", n_ctx);
4524            printf("\n");
4525        }
4526    }
4527    function_tests++;
4528
4529    return(test_ret);
4530}
4531
4532
4533static int
4534test_xmlSAX2IgnorableWhitespace(void) {
4535    int test_ret = 0;
4536
4537    int mem_base;
4538    void * ctx; /* the user data (XML parser context) */
4539    int n_ctx;
4540    xmlChar * ch; /* a xmlChar string */
4541    int n_ch;
4542    int len; /* the number of xmlChar */
4543    int n_len;
4544
4545    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4546    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4547    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4548        mem_base = xmlMemBlocks();
4549        ctx = gen_void_ptr(n_ctx, 0);
4550        ch = gen_const_xmlChar_ptr(n_ch, 1);
4551        len = gen_int(n_len, 2);
4552
4553        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4554        call_tests++;
4555        des_void_ptr(n_ctx, ctx, 0);
4556        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4557        des_int(n_len, len, 2);
4558        xmlResetLastError();
4559        if (mem_base != xmlMemBlocks()) {
4560            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4561	           xmlMemBlocks() - mem_base);
4562	    test_ret++;
4563            printf(" %d", n_ctx);
4564            printf(" %d", n_ch);
4565            printf(" %d", n_len);
4566            printf("\n");
4567        }
4568    }
4569    }
4570    }
4571    function_tests++;
4572
4573    return(test_ret);
4574}
4575
4576
4577#define gen_nb_xmlSAXHandler_ptr 1
4578static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4579    return(NULL);
4580}
4581static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4582}
4583
4584static int
4585test_xmlSAX2InitDefaultSAXHandler(void) {
4586    int test_ret = 0;
4587
4588    int mem_base;
4589    xmlSAXHandler * hdlr; /* the SAX handler */
4590    int n_hdlr;
4591    int warning; /* flag if non-zero sets the handler warning procedure */
4592    int n_warning;
4593
4594    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4595    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4596        mem_base = xmlMemBlocks();
4597        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4598        warning = gen_int(n_warning, 1);
4599
4600        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4601        call_tests++;
4602        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4603        des_int(n_warning, warning, 1);
4604        xmlResetLastError();
4605        if (mem_base != xmlMemBlocks()) {
4606            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4607	           xmlMemBlocks() - mem_base);
4608	    test_ret++;
4609            printf(" %d", n_hdlr);
4610            printf(" %d", n_warning);
4611            printf("\n");
4612        }
4613    }
4614    }
4615    function_tests++;
4616
4617    return(test_ret);
4618}
4619
4620
4621static int
4622test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4623    int test_ret = 0;
4624
4625#if defined(LIBXML_DOCB_ENABLED)
4626    int mem_base;
4627    xmlSAXHandler * hdlr; /* the SAX handler */
4628    int n_hdlr;
4629
4630    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4631        mem_base = xmlMemBlocks();
4632        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4633
4634        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4635        call_tests++;
4636        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4637        xmlResetLastError();
4638        if (mem_base != xmlMemBlocks()) {
4639            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4640	           xmlMemBlocks() - mem_base);
4641	    test_ret++;
4642            printf(" %d", n_hdlr);
4643            printf("\n");
4644        }
4645    }
4646    function_tests++;
4647#endif
4648
4649    return(test_ret);
4650}
4651
4652
4653static int
4654test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4655    int test_ret = 0;
4656
4657#if defined(LIBXML_HTML_ENABLED)
4658    int mem_base;
4659    xmlSAXHandler * hdlr; /* the SAX handler */
4660    int n_hdlr;
4661
4662    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4663        mem_base = xmlMemBlocks();
4664        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4665
4666        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4667        call_tests++;
4668        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4669        xmlResetLastError();
4670        if (mem_base != xmlMemBlocks()) {
4671            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4672	           xmlMemBlocks() - mem_base);
4673	    test_ret++;
4674            printf(" %d", n_hdlr);
4675            printf("\n");
4676        }
4677    }
4678    function_tests++;
4679#endif
4680
4681    return(test_ret);
4682}
4683
4684
4685static int
4686test_xmlSAX2InternalSubset(void) {
4687    int test_ret = 0;
4688
4689    int mem_base;
4690    void * ctx; /* the user data (XML parser context) */
4691    int n_ctx;
4692    xmlChar * name; /* the root element name */
4693    int n_name;
4694    xmlChar * ExternalID; /* the external ID */
4695    int n_ExternalID;
4696    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4697    int n_SystemID;
4698
4699    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4700    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4701    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4702    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4703        mem_base = xmlMemBlocks();
4704        ctx = gen_void_ptr(n_ctx, 0);
4705        name = gen_const_xmlChar_ptr(n_name, 1);
4706        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4707        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4708
4709        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4710        call_tests++;
4711        des_void_ptr(n_ctx, ctx, 0);
4712        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4713        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4714        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4715        xmlResetLastError();
4716        if (mem_base != xmlMemBlocks()) {
4717            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4718	           xmlMemBlocks() - mem_base);
4719	    test_ret++;
4720            printf(" %d", n_ctx);
4721            printf(" %d", n_name);
4722            printf(" %d", n_ExternalID);
4723            printf(" %d", n_SystemID);
4724            printf("\n");
4725        }
4726    }
4727    }
4728    }
4729    }
4730    function_tests++;
4731
4732    return(test_ret);
4733}
4734
4735
4736static int
4737test_xmlSAX2IsStandalone(void) {
4738    int test_ret = 0;
4739
4740    int mem_base;
4741    int ret_val;
4742    void * ctx; /* the user data (XML parser context) */
4743    int n_ctx;
4744
4745    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4746        mem_base = xmlMemBlocks();
4747        ctx = gen_void_ptr(n_ctx, 0);
4748
4749        ret_val = xmlSAX2IsStandalone(ctx);
4750        desret_int(ret_val);
4751        call_tests++;
4752        des_void_ptr(n_ctx, ctx, 0);
4753        xmlResetLastError();
4754        if (mem_base != xmlMemBlocks()) {
4755            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4756	           xmlMemBlocks() - mem_base);
4757	    test_ret++;
4758            printf(" %d", n_ctx);
4759            printf("\n");
4760        }
4761    }
4762    function_tests++;
4763
4764    return(test_ret);
4765}
4766
4767
4768static int
4769test_xmlSAX2NotationDecl(void) {
4770    int test_ret = 0;
4771
4772    int mem_base;
4773    void * ctx; /* the user data (XML parser context) */
4774    int n_ctx;
4775    xmlChar * name; /* The name of the notation */
4776    int n_name;
4777    xmlChar * publicId; /* The public ID of the entity */
4778    int n_publicId;
4779    xmlChar * systemId; /* The system ID of the entity */
4780    int n_systemId;
4781
4782    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4783    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4784    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4785    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4786        mem_base = xmlMemBlocks();
4787        ctx = gen_void_ptr(n_ctx, 0);
4788        name = gen_const_xmlChar_ptr(n_name, 1);
4789        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4790        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4791
4792        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4793        call_tests++;
4794        des_void_ptr(n_ctx, ctx, 0);
4795        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4796        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4797        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4798        xmlResetLastError();
4799        if (mem_base != xmlMemBlocks()) {
4800            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4801	           xmlMemBlocks() - mem_base);
4802	    test_ret++;
4803            printf(" %d", n_ctx);
4804            printf(" %d", n_name);
4805            printf(" %d", n_publicId);
4806            printf(" %d", n_systemId);
4807            printf("\n");
4808        }
4809    }
4810    }
4811    }
4812    }
4813    function_tests++;
4814
4815    return(test_ret);
4816}
4817
4818
4819static int
4820test_xmlSAX2ProcessingInstruction(void) {
4821    int test_ret = 0;
4822
4823    int mem_base;
4824    void * ctx; /* the user data (XML parser context) */
4825    int n_ctx;
4826    xmlChar * target; /* the target name */
4827    int n_target;
4828    xmlChar * data; /* the PI data's */
4829    int n_data;
4830
4831    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4832    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4833    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4834        mem_base = xmlMemBlocks();
4835        ctx = gen_void_ptr(n_ctx, 0);
4836        target = gen_const_xmlChar_ptr(n_target, 1);
4837        data = gen_const_xmlChar_ptr(n_data, 2);
4838
4839        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4840        call_tests++;
4841        des_void_ptr(n_ctx, ctx, 0);
4842        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4843        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4844        xmlResetLastError();
4845        if (mem_base != xmlMemBlocks()) {
4846            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4847	           xmlMemBlocks() - mem_base);
4848	    test_ret++;
4849            printf(" %d", n_ctx);
4850            printf(" %d", n_target);
4851            printf(" %d", n_data);
4852            printf("\n");
4853        }
4854    }
4855    }
4856    }
4857    function_tests++;
4858
4859    return(test_ret);
4860}
4861
4862
4863static int
4864test_xmlSAX2Reference(void) {
4865    int test_ret = 0;
4866
4867    int mem_base;
4868    void * ctx; /* the user data (XML parser context) */
4869    int n_ctx;
4870    xmlChar * name; /* The entity name */
4871    int n_name;
4872
4873    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4874    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4875        mem_base = xmlMemBlocks();
4876        ctx = gen_void_ptr(n_ctx, 0);
4877        name = gen_const_xmlChar_ptr(n_name, 1);
4878
4879        xmlSAX2Reference(ctx, (const xmlChar *)name);
4880        call_tests++;
4881        des_void_ptr(n_ctx, ctx, 0);
4882        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4883        xmlResetLastError();
4884        if (mem_base != xmlMemBlocks()) {
4885            printf("Leak of %d blocks found in xmlSAX2Reference",
4886	           xmlMemBlocks() - mem_base);
4887	    test_ret++;
4888            printf(" %d", n_ctx);
4889            printf(" %d", n_name);
4890            printf("\n");
4891        }
4892    }
4893    }
4894    function_tests++;
4895
4896    return(test_ret);
4897}
4898
4899
4900static int
4901test_xmlSAX2ResolveEntity(void) {
4902    int test_ret = 0;
4903
4904    int mem_base;
4905    xmlParserInputPtr ret_val;
4906    void * ctx; /* the user data (XML parser context) */
4907    int n_ctx;
4908    xmlChar * publicId; /* The public ID of the entity */
4909    int n_publicId;
4910    xmlChar * systemId; /* The system ID of the entity */
4911    int n_systemId;
4912
4913    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4914    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4915    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4916        mem_base = xmlMemBlocks();
4917        ctx = gen_void_ptr(n_ctx, 0);
4918        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4919        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4920
4921        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4922        desret_xmlParserInputPtr(ret_val);
4923        call_tests++;
4924        des_void_ptr(n_ctx, ctx, 0);
4925        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4926        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4927        xmlResetLastError();
4928        if (mem_base != xmlMemBlocks()) {
4929            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4930	           xmlMemBlocks() - mem_base);
4931	    test_ret++;
4932            printf(" %d", n_ctx);
4933            printf(" %d", n_publicId);
4934            printf(" %d", n_systemId);
4935            printf("\n");
4936        }
4937    }
4938    }
4939    }
4940    function_tests++;
4941
4942    return(test_ret);
4943}
4944
4945
4946#define gen_nb_xmlSAXLocatorPtr 1
4947static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4948    return(NULL);
4949}
4950static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4951}
4952
4953static int
4954test_xmlSAX2SetDocumentLocator(void) {
4955    int test_ret = 0;
4956
4957    int mem_base;
4958    void * ctx; /* the user data (XML parser context) */
4959    int n_ctx;
4960    xmlSAXLocatorPtr loc; /* A SAX Locator */
4961    int n_loc;
4962
4963    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4964    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4965        mem_base = xmlMemBlocks();
4966        ctx = gen_void_ptr(n_ctx, 0);
4967        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4968
4969        xmlSAX2SetDocumentLocator(ctx, loc);
4970        call_tests++;
4971        des_void_ptr(n_ctx, ctx, 0);
4972        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4973        xmlResetLastError();
4974        if (mem_base != xmlMemBlocks()) {
4975            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4976	           xmlMemBlocks() - mem_base);
4977	    test_ret++;
4978            printf(" %d", n_ctx);
4979            printf(" %d", n_loc);
4980            printf("\n");
4981        }
4982    }
4983    }
4984    function_tests++;
4985
4986    return(test_ret);
4987}
4988
4989
4990static int
4991test_xmlSAX2StartDocument(void) {
4992    int test_ret = 0;
4993
4994    int mem_base;
4995    void * ctx; /* the user data (XML parser context) */
4996    int n_ctx;
4997
4998    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4999        mem_base = xmlMemBlocks();
5000        ctx = gen_void_ptr(n_ctx, 0);
5001
5002        xmlSAX2StartDocument(ctx);
5003        call_tests++;
5004        des_void_ptr(n_ctx, ctx, 0);
5005        xmlResetLastError();
5006        if (mem_base != xmlMemBlocks()) {
5007            printf("Leak of %d blocks found in xmlSAX2StartDocument",
5008	           xmlMemBlocks() - mem_base);
5009	    test_ret++;
5010            printf(" %d", n_ctx);
5011            printf("\n");
5012        }
5013    }
5014    function_tests++;
5015
5016    return(test_ret);
5017}
5018
5019
5020static int
5021test_xmlSAX2StartElement(void) {
5022    int test_ret = 0;
5023
5024#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
5025#ifdef LIBXML_SAX1_ENABLED
5026    int mem_base;
5027    void * ctx; /* the user data (XML parser context) */
5028    int n_ctx;
5029    xmlChar * fullname; /* The element name, including namespace prefix */
5030    int n_fullname;
5031    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5032    int n_atts;
5033
5034    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5035    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5036    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5037        mem_base = xmlMemBlocks();
5038        ctx = gen_void_ptr(n_ctx, 0);
5039        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5040        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5041
5042        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5043        call_tests++;
5044        des_void_ptr(n_ctx, ctx, 0);
5045        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5046        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5047        xmlResetLastError();
5048        if (mem_base != xmlMemBlocks()) {
5049            printf("Leak of %d blocks found in xmlSAX2StartElement",
5050	           xmlMemBlocks() - mem_base);
5051	    test_ret++;
5052            printf(" %d", n_ctx);
5053            printf(" %d", n_fullname);
5054            printf(" %d", n_atts);
5055            printf("\n");
5056        }
5057    }
5058    }
5059    }
5060    function_tests++;
5061#endif
5062#endif
5063
5064    return(test_ret);
5065}
5066
5067
5068static int
5069test_xmlSAX2StartElementNs(void) {
5070    int test_ret = 0;
5071
5072    int mem_base;
5073    void * ctx; /* the user data (XML parser context) */
5074    int n_ctx;
5075    xmlChar * localname; /* the local name of the element */
5076    int n_localname;
5077    xmlChar * prefix; /* the element namespace prefix if available */
5078    int n_prefix;
5079    xmlChar * URI; /* the element namespace name if available */
5080    int n_URI;
5081    int nb_namespaces; /* number of namespace definitions on that node */
5082    int n_nb_namespaces;
5083    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5084    int n_namespaces;
5085    int nb_attributes; /* the number of attributes on that node */
5086    int n_nb_attributes;
5087    int nb_defaulted; /* the number of defaulted attributes. */
5088    int n_nb_defaulted;
5089    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5090    int n_attributes;
5091
5092    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5093    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5094    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5095    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5096    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5097    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5098    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5099    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5100    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5101        mem_base = xmlMemBlocks();
5102        ctx = gen_void_ptr(n_ctx, 0);
5103        localname = gen_const_xmlChar_ptr(n_localname, 1);
5104        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5105        URI = gen_const_xmlChar_ptr(n_URI, 3);
5106        nb_namespaces = gen_int(n_nb_namespaces, 4);
5107        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5108        nb_attributes = gen_int(n_nb_attributes, 6);
5109        nb_defaulted = gen_int(n_nb_defaulted, 7);
5110        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5111
5112        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5113        call_tests++;
5114        des_void_ptr(n_ctx, ctx, 0);
5115        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5116        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5117        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5118        des_int(n_nb_namespaces, nb_namespaces, 4);
5119        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5120        des_int(n_nb_attributes, nb_attributes, 6);
5121        des_int(n_nb_defaulted, nb_defaulted, 7);
5122        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5123        xmlResetLastError();
5124        if (mem_base != xmlMemBlocks()) {
5125            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5126	           xmlMemBlocks() - mem_base);
5127	    test_ret++;
5128            printf(" %d", n_ctx);
5129            printf(" %d", n_localname);
5130            printf(" %d", n_prefix);
5131            printf(" %d", n_URI);
5132            printf(" %d", n_nb_namespaces);
5133            printf(" %d", n_namespaces);
5134            printf(" %d", n_nb_attributes);
5135            printf(" %d", n_nb_defaulted);
5136            printf(" %d", n_attributes);
5137            printf("\n");
5138        }
5139    }
5140    }
5141    }
5142    }
5143    }
5144    }
5145    }
5146    }
5147    }
5148    function_tests++;
5149
5150    return(test_ret);
5151}
5152
5153
5154static int
5155test_xmlSAX2UnparsedEntityDecl(void) {
5156    int test_ret = 0;
5157
5158    int mem_base;
5159    void * ctx; /* the user data (XML parser context) */
5160    int n_ctx;
5161    xmlChar * name; /* The name of the entity */
5162    int n_name;
5163    xmlChar * publicId; /* The public ID of the entity */
5164    int n_publicId;
5165    xmlChar * systemId; /* The system ID of the entity */
5166    int n_systemId;
5167    xmlChar * notationName; /* the name of the notation */
5168    int n_notationName;
5169
5170    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5171    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5172    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5173    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5174    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5175        mem_base = xmlMemBlocks();
5176        ctx = gen_void_ptr(n_ctx, 0);
5177        name = gen_const_xmlChar_ptr(n_name, 1);
5178        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5179        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5180        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5181
5182        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5183        call_tests++;
5184        des_void_ptr(n_ctx, ctx, 0);
5185        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5186        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5187        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5188        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5189        xmlResetLastError();
5190        if (mem_base != xmlMemBlocks()) {
5191            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5192	           xmlMemBlocks() - mem_base);
5193	    test_ret++;
5194            printf(" %d", n_ctx);
5195            printf(" %d", n_name);
5196            printf(" %d", n_publicId);
5197            printf(" %d", n_systemId);
5198            printf(" %d", n_notationName);
5199            printf("\n");
5200        }
5201    }
5202    }
5203    }
5204    }
5205    }
5206    function_tests++;
5207
5208    return(test_ret);
5209}
5210
5211
5212static int
5213test_xmlSAXDefaultVersion(void) {
5214    int test_ret = 0;
5215
5216#if defined(LIBXML_SAX1_ENABLED)
5217#ifdef LIBXML_SAX1_ENABLED
5218    int mem_base;
5219    int ret_val;
5220    int version; /* the version, 1 or 2 */
5221    int n_version;
5222
5223    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5224        mem_base = xmlMemBlocks();
5225        version = gen_int(n_version, 0);
5226
5227        ret_val = xmlSAXDefaultVersion(version);
5228        desret_int(ret_val);
5229        call_tests++;
5230        des_int(n_version, version, 0);
5231        xmlResetLastError();
5232        if (mem_base != xmlMemBlocks()) {
5233            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5234	           xmlMemBlocks() - mem_base);
5235	    test_ret++;
5236            printf(" %d", n_version);
5237            printf("\n");
5238        }
5239    }
5240    function_tests++;
5241#endif
5242#endif
5243
5244    return(test_ret);
5245}
5246
5247
5248static int
5249test_xmlSAXVersion(void) {
5250    int test_ret = 0;
5251
5252    int mem_base;
5253    int ret_val;
5254    xmlSAXHandler * hdlr; /* the SAX handler */
5255    int n_hdlr;
5256    int version; /* the version, 1 or 2 */
5257    int n_version;
5258
5259    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5260    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5261        mem_base = xmlMemBlocks();
5262        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5263        version = gen_int(n_version, 1);
5264
5265        ret_val = xmlSAXVersion(hdlr, version);
5266        desret_int(ret_val);
5267        call_tests++;
5268        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5269        des_int(n_version, version, 1);
5270        xmlResetLastError();
5271        if (mem_base != xmlMemBlocks()) {
5272            printf("Leak of %d blocks found in xmlSAXVersion",
5273	           xmlMemBlocks() - mem_base);
5274	    test_ret++;
5275            printf(" %d", n_hdlr);
5276            printf(" %d", n_version);
5277            printf("\n");
5278        }
5279    }
5280    }
5281    function_tests++;
5282
5283    return(test_ret);
5284}
5285
5286static int
5287test_SAX2(void) {
5288    int test_ret = 0;
5289
5290    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5291    test_ret += test_docbDefaultSAXHandlerInit();
5292    test_ret += test_htmlDefaultSAXHandlerInit();
5293    test_ret += test_xmlDefaultSAXHandlerInit();
5294    test_ret += test_xmlSAX2AttributeDecl();
5295    test_ret += test_xmlSAX2CDataBlock();
5296    test_ret += test_xmlSAX2Characters();
5297    test_ret += test_xmlSAX2Comment();
5298    test_ret += test_xmlSAX2ElementDecl();
5299    test_ret += test_xmlSAX2EndDocument();
5300    test_ret += test_xmlSAX2EndElement();
5301    test_ret += test_xmlSAX2EndElementNs();
5302    test_ret += test_xmlSAX2EntityDecl();
5303    test_ret += test_xmlSAX2ExternalSubset();
5304    test_ret += test_xmlSAX2GetColumnNumber();
5305    test_ret += test_xmlSAX2GetEntity();
5306    test_ret += test_xmlSAX2GetLineNumber();
5307    test_ret += test_xmlSAX2GetParameterEntity();
5308    test_ret += test_xmlSAX2GetPublicId();
5309    test_ret += test_xmlSAX2GetSystemId();
5310    test_ret += test_xmlSAX2HasExternalSubset();
5311    test_ret += test_xmlSAX2HasInternalSubset();
5312    test_ret += test_xmlSAX2IgnorableWhitespace();
5313    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5314    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5315    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5316    test_ret += test_xmlSAX2InternalSubset();
5317    test_ret += test_xmlSAX2IsStandalone();
5318    test_ret += test_xmlSAX2NotationDecl();
5319    test_ret += test_xmlSAX2ProcessingInstruction();
5320    test_ret += test_xmlSAX2Reference();
5321    test_ret += test_xmlSAX2ResolveEntity();
5322    test_ret += test_xmlSAX2SetDocumentLocator();
5323    test_ret += test_xmlSAX2StartDocument();
5324    test_ret += test_xmlSAX2StartElement();
5325    test_ret += test_xmlSAX2StartElementNs();
5326    test_ret += test_xmlSAX2UnparsedEntityDecl();
5327    test_ret += test_xmlSAXDefaultVersion();
5328    test_ret += test_xmlSAXVersion();
5329
5330    if (test_ret != 0)
5331	printf("Module SAX2: %d errors\n", test_ret);
5332    return(test_ret);
5333}
5334
5335static int
5336test_xmlC14NDocDumpMemory(void) {
5337    int test_ret = 0;
5338
5339#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5340    int mem_base;
5341    int ret_val;
5342    xmlDocPtr doc; /* the XML document for canonization */
5343    int n_doc;
5344    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5345    int n_nodes;
5346    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5347    int n_exclusive;
5348    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) */
5349    int n_inclusive_ns_prefixes;
5350    int with_comments; /* include comments in the result (!=0) or not (==0) */
5351    int n_with_comments;
5352    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 */
5353    int n_doc_txt_ptr;
5354
5355    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5356    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5357    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5358    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5359    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5360    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5361        mem_base = xmlMemBlocks();
5362        doc = gen_xmlDocPtr(n_doc, 0);
5363        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5364        exclusive = gen_int(n_exclusive, 2);
5365        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5366        with_comments = gen_int(n_with_comments, 4);
5367        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5368
5369        ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5370        desret_int(ret_val);
5371        call_tests++;
5372        des_xmlDocPtr(n_doc, doc, 0);
5373        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5374        des_int(n_exclusive, exclusive, 2);
5375        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5376        des_int(n_with_comments, with_comments, 4);
5377        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5378        xmlResetLastError();
5379        if (mem_base != xmlMemBlocks()) {
5380            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5381	           xmlMemBlocks() - mem_base);
5382	    test_ret++;
5383            printf(" %d", n_doc);
5384            printf(" %d", n_nodes);
5385            printf(" %d", n_exclusive);
5386            printf(" %d", n_inclusive_ns_prefixes);
5387            printf(" %d", n_with_comments);
5388            printf(" %d", n_doc_txt_ptr);
5389            printf("\n");
5390        }
5391    }
5392    }
5393    }
5394    }
5395    }
5396    }
5397    function_tests++;
5398#endif
5399
5400    return(test_ret);
5401}
5402
5403
5404static int
5405test_xmlC14NDocSave(void) {
5406    int test_ret = 0;
5407
5408#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5409    int mem_base;
5410    int ret_val;
5411    xmlDocPtr doc; /* the XML document for canonization */
5412    int n_doc;
5413    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5414    int n_nodes;
5415    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5416    int n_exclusive;
5417    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) */
5418    int n_inclusive_ns_prefixes;
5419    int with_comments; /* include comments in the result (!=0) or not (==0) */
5420    int n_with_comments;
5421    const char * filename; /* the filename to store canonical XML image */
5422    int n_filename;
5423    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5424    int n_compression;
5425
5426    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5427    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5428    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5429    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5430    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5431    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5432    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5433        mem_base = xmlMemBlocks();
5434        doc = gen_xmlDocPtr(n_doc, 0);
5435        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5436        exclusive = gen_int(n_exclusive, 2);
5437        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5438        with_comments = gen_int(n_with_comments, 4);
5439        filename = gen_fileoutput(n_filename, 5);
5440        compression = gen_int(n_compression, 6);
5441
5442        ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5443        desret_int(ret_val);
5444        call_tests++;
5445        des_xmlDocPtr(n_doc, doc, 0);
5446        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5447        des_int(n_exclusive, exclusive, 2);
5448        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5449        des_int(n_with_comments, with_comments, 4);
5450        des_fileoutput(n_filename, filename, 5);
5451        des_int(n_compression, compression, 6);
5452        xmlResetLastError();
5453        if (mem_base != xmlMemBlocks()) {
5454            printf("Leak of %d blocks found in xmlC14NDocSave",
5455	           xmlMemBlocks() - mem_base);
5456	    test_ret++;
5457            printf(" %d", n_doc);
5458            printf(" %d", n_nodes);
5459            printf(" %d", n_exclusive);
5460            printf(" %d", n_inclusive_ns_prefixes);
5461            printf(" %d", n_with_comments);
5462            printf(" %d", n_filename);
5463            printf(" %d", n_compression);
5464            printf("\n");
5465        }
5466    }
5467    }
5468    }
5469    }
5470    }
5471    }
5472    }
5473    function_tests++;
5474#endif
5475
5476    return(test_ret);
5477}
5478
5479
5480static int
5481test_xmlC14NDocSaveTo(void) {
5482    int test_ret = 0;
5483
5484#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5485    int mem_base;
5486    int ret_val;
5487    xmlDocPtr doc; /* the XML document for canonization */
5488    int n_doc;
5489    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5490    int n_nodes;
5491    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5492    int n_exclusive;
5493    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) */
5494    int n_inclusive_ns_prefixes;
5495    int with_comments; /* include comments in the result (!=0) or not (==0) */
5496    int n_with_comments;
5497    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5498    int n_buf;
5499
5500    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5501    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5502    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5503    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5504    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5505    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5506        mem_base = xmlMemBlocks();
5507        doc = gen_xmlDocPtr(n_doc, 0);
5508        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5509        exclusive = gen_int(n_exclusive, 2);
5510        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5511        with_comments = gen_int(n_with_comments, 4);
5512        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5513
5514        ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5515        desret_int(ret_val);
5516        call_tests++;
5517        des_xmlDocPtr(n_doc, doc, 0);
5518        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5519        des_int(n_exclusive, exclusive, 2);
5520        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5521        des_int(n_with_comments, with_comments, 4);
5522        des_xmlOutputBufferPtr(n_buf, buf, 5);
5523        xmlResetLastError();
5524        if (mem_base != xmlMemBlocks()) {
5525            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5526	           xmlMemBlocks() - mem_base);
5527	    test_ret++;
5528            printf(" %d", n_doc);
5529            printf(" %d", n_nodes);
5530            printf(" %d", n_exclusive);
5531            printf(" %d", n_inclusive_ns_prefixes);
5532            printf(" %d", n_with_comments);
5533            printf(" %d", n_buf);
5534            printf("\n");
5535        }
5536    }
5537    }
5538    }
5539    }
5540    }
5541    }
5542    function_tests++;
5543#endif
5544
5545    return(test_ret);
5546}
5547
5548
5549static int
5550test_xmlC14NExecute(void) {
5551    int test_ret = 0;
5552
5553
5554    /* missing type support */
5555    return(test_ret);
5556}
5557
5558static int
5559test_c14n(void) {
5560    int test_ret = 0;
5561
5562    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5563    test_ret += test_xmlC14NDocDumpMemory();
5564    test_ret += test_xmlC14NDocSave();
5565    test_ret += test_xmlC14NDocSaveTo();
5566    test_ret += test_xmlC14NExecute();
5567
5568    if (test_ret != 0)
5569	printf("Module c14n: %d errors\n", test_ret);
5570    return(test_ret);
5571}
5572#ifdef LIBXML_CATALOG_ENABLED
5573
5574#define gen_nb_xmlCatalogPtr 1
5575static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5576    return(NULL);
5577}
5578static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5579}
5580#endif
5581
5582
5583static int
5584test_xmlACatalogAdd(void) {
5585    int test_ret = 0;
5586
5587#if defined(LIBXML_CATALOG_ENABLED)
5588    int mem_base;
5589    int ret_val;
5590    xmlCatalogPtr catal; /* a Catalog */
5591    int n_catal;
5592    xmlChar * type; /* the type of record to add to the catalog */
5593    int n_type;
5594    xmlChar * orig; /* the system, public or prefix to match */
5595    int n_orig;
5596    xmlChar * replace; /* the replacement value for the match */
5597    int n_replace;
5598
5599    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5600    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5601    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5602    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5603        mem_base = xmlMemBlocks();
5604        catal = gen_xmlCatalogPtr(n_catal, 0);
5605        type = gen_const_xmlChar_ptr(n_type, 1);
5606        orig = gen_const_xmlChar_ptr(n_orig, 2);
5607        replace = gen_const_xmlChar_ptr(n_replace, 3);
5608
5609        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5610        desret_int(ret_val);
5611        call_tests++;
5612        des_xmlCatalogPtr(n_catal, catal, 0);
5613        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5614        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5615        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5616        xmlResetLastError();
5617        if (mem_base != xmlMemBlocks()) {
5618            printf("Leak of %d blocks found in xmlACatalogAdd",
5619	           xmlMemBlocks() - mem_base);
5620	    test_ret++;
5621            printf(" %d", n_catal);
5622            printf(" %d", n_type);
5623            printf(" %d", n_orig);
5624            printf(" %d", n_replace);
5625            printf("\n");
5626        }
5627    }
5628    }
5629    }
5630    }
5631    function_tests++;
5632#endif
5633
5634    return(test_ret);
5635}
5636
5637
5638static int
5639test_xmlACatalogDump(void) {
5640    int test_ret = 0;
5641
5642#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5643    int mem_base;
5644    xmlCatalogPtr catal; /* a Catalog */
5645    int n_catal;
5646    FILE * out; /* the file. */
5647    int n_out;
5648
5649    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5650    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5651        mem_base = xmlMemBlocks();
5652        catal = gen_xmlCatalogPtr(n_catal, 0);
5653        out = gen_FILE_ptr(n_out, 1);
5654
5655        xmlACatalogDump(catal, out);
5656        call_tests++;
5657        des_xmlCatalogPtr(n_catal, catal, 0);
5658        des_FILE_ptr(n_out, out, 1);
5659        xmlResetLastError();
5660        if (mem_base != xmlMemBlocks()) {
5661            printf("Leak of %d blocks found in xmlACatalogDump",
5662	           xmlMemBlocks() - mem_base);
5663	    test_ret++;
5664            printf(" %d", n_catal);
5665            printf(" %d", n_out);
5666            printf("\n");
5667        }
5668    }
5669    }
5670    function_tests++;
5671#endif
5672
5673    return(test_ret);
5674}
5675
5676
5677static int
5678test_xmlACatalogRemove(void) {
5679    int test_ret = 0;
5680
5681#if defined(LIBXML_CATALOG_ENABLED)
5682    int mem_base;
5683    int ret_val;
5684    xmlCatalogPtr catal; /* a Catalog */
5685    int n_catal;
5686    xmlChar * value; /* the value to remove */
5687    int n_value;
5688
5689    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5690    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5691        mem_base = xmlMemBlocks();
5692        catal = gen_xmlCatalogPtr(n_catal, 0);
5693        value = gen_const_xmlChar_ptr(n_value, 1);
5694
5695        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5696        desret_int(ret_val);
5697        call_tests++;
5698        des_xmlCatalogPtr(n_catal, catal, 0);
5699        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5700        xmlResetLastError();
5701        if (mem_base != xmlMemBlocks()) {
5702            printf("Leak of %d blocks found in xmlACatalogRemove",
5703	           xmlMemBlocks() - mem_base);
5704	    test_ret++;
5705            printf(" %d", n_catal);
5706            printf(" %d", n_value);
5707            printf("\n");
5708        }
5709    }
5710    }
5711    function_tests++;
5712#endif
5713
5714    return(test_ret);
5715}
5716
5717
5718static int
5719test_xmlACatalogResolve(void) {
5720    int test_ret = 0;
5721
5722#if defined(LIBXML_CATALOG_ENABLED)
5723    int mem_base;
5724    xmlChar * ret_val;
5725    xmlCatalogPtr catal; /* a Catalog */
5726    int n_catal;
5727    xmlChar * pubID; /* the public ID string */
5728    int n_pubID;
5729    xmlChar * sysID; /* the system ID string */
5730    int n_sysID;
5731
5732    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5733    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5734    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5735        mem_base = xmlMemBlocks();
5736        catal = gen_xmlCatalogPtr(n_catal, 0);
5737        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5738        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5739
5740        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5741        desret_xmlChar_ptr(ret_val);
5742        call_tests++;
5743        des_xmlCatalogPtr(n_catal, catal, 0);
5744        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5745        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5746        xmlResetLastError();
5747        if (mem_base != xmlMemBlocks()) {
5748            printf("Leak of %d blocks found in xmlACatalogResolve",
5749	           xmlMemBlocks() - mem_base);
5750	    test_ret++;
5751            printf(" %d", n_catal);
5752            printf(" %d", n_pubID);
5753            printf(" %d", n_sysID);
5754            printf("\n");
5755        }
5756    }
5757    }
5758    }
5759    function_tests++;
5760#endif
5761
5762    return(test_ret);
5763}
5764
5765
5766static int
5767test_xmlACatalogResolvePublic(void) {
5768    int test_ret = 0;
5769
5770#if defined(LIBXML_CATALOG_ENABLED)
5771    int mem_base;
5772    xmlChar * ret_val;
5773    xmlCatalogPtr catal; /* a Catalog */
5774    int n_catal;
5775    xmlChar * pubID; /* the public ID string */
5776    int n_pubID;
5777
5778    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5779    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5780        mem_base = xmlMemBlocks();
5781        catal = gen_xmlCatalogPtr(n_catal, 0);
5782        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5783
5784        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5785        desret_xmlChar_ptr(ret_val);
5786        call_tests++;
5787        des_xmlCatalogPtr(n_catal, catal, 0);
5788        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5789        xmlResetLastError();
5790        if (mem_base != xmlMemBlocks()) {
5791            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5792	           xmlMemBlocks() - mem_base);
5793	    test_ret++;
5794            printf(" %d", n_catal);
5795            printf(" %d", n_pubID);
5796            printf("\n");
5797        }
5798    }
5799    }
5800    function_tests++;
5801#endif
5802
5803    return(test_ret);
5804}
5805
5806
5807static int
5808test_xmlACatalogResolveSystem(void) {
5809    int test_ret = 0;
5810
5811#if defined(LIBXML_CATALOG_ENABLED)
5812    int mem_base;
5813    xmlChar * ret_val;
5814    xmlCatalogPtr catal; /* a Catalog */
5815    int n_catal;
5816    xmlChar * sysID; /* the system ID string */
5817    int n_sysID;
5818
5819    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5820    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5821        mem_base = xmlMemBlocks();
5822        catal = gen_xmlCatalogPtr(n_catal, 0);
5823        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5824
5825        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5826        desret_xmlChar_ptr(ret_val);
5827        call_tests++;
5828        des_xmlCatalogPtr(n_catal, catal, 0);
5829        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5830        xmlResetLastError();
5831        if (mem_base != xmlMemBlocks()) {
5832            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5833	           xmlMemBlocks() - mem_base);
5834	    test_ret++;
5835            printf(" %d", n_catal);
5836            printf(" %d", n_sysID);
5837            printf("\n");
5838        }
5839    }
5840    }
5841    function_tests++;
5842#endif
5843
5844    return(test_ret);
5845}
5846
5847
5848static int
5849test_xmlACatalogResolveURI(void) {
5850    int test_ret = 0;
5851
5852#if defined(LIBXML_CATALOG_ENABLED)
5853    int mem_base;
5854    xmlChar * ret_val;
5855    xmlCatalogPtr catal; /* a Catalog */
5856    int n_catal;
5857    xmlChar * URI; /* the URI */
5858    int n_URI;
5859
5860    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5861    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5862        mem_base = xmlMemBlocks();
5863        catal = gen_xmlCatalogPtr(n_catal, 0);
5864        URI = gen_const_xmlChar_ptr(n_URI, 1);
5865
5866        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5867        desret_xmlChar_ptr(ret_val);
5868        call_tests++;
5869        des_xmlCatalogPtr(n_catal, catal, 0);
5870        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5871        xmlResetLastError();
5872        if (mem_base != xmlMemBlocks()) {
5873            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5874	           xmlMemBlocks() - mem_base);
5875	    test_ret++;
5876            printf(" %d", n_catal);
5877            printf(" %d", n_URI);
5878            printf("\n");
5879        }
5880    }
5881    }
5882    function_tests++;
5883#endif
5884
5885    return(test_ret);
5886}
5887
5888
5889static int
5890test_xmlCatalogAdd(void) {
5891    int test_ret = 0;
5892
5893#if defined(LIBXML_CATALOG_ENABLED)
5894    int mem_base;
5895    int ret_val;
5896    xmlChar * type; /* the type of record to add to the catalog */
5897    int n_type;
5898    xmlChar * orig; /* the system, public or prefix to match */
5899    int n_orig;
5900    xmlChar * replace; /* the replacement value for the match */
5901    int n_replace;
5902
5903    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5904    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5905    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5906        mem_base = xmlMemBlocks();
5907        type = gen_const_xmlChar_ptr(n_type, 0);
5908        orig = gen_const_xmlChar_ptr(n_orig, 1);
5909        replace = gen_const_xmlChar_ptr(n_replace, 2);
5910
5911        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5912        desret_int(ret_val);
5913        call_tests++;
5914        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5915        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5916        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5917        xmlResetLastError();
5918        if (mem_base != xmlMemBlocks()) {
5919            printf("Leak of %d blocks found in xmlCatalogAdd",
5920	           xmlMemBlocks() - mem_base);
5921	    test_ret++;
5922            printf(" %d", n_type);
5923            printf(" %d", n_orig);
5924            printf(" %d", n_replace);
5925            printf("\n");
5926        }
5927    }
5928    }
5929    }
5930    function_tests++;
5931#endif
5932
5933    return(test_ret);
5934}
5935
5936
5937static int
5938test_xmlCatalogCleanup(void) {
5939    int test_ret = 0;
5940
5941#if defined(LIBXML_CATALOG_ENABLED)
5942
5943
5944        xmlCatalogCleanup();
5945        call_tests++;
5946        xmlResetLastError();
5947    function_tests++;
5948#endif
5949
5950    return(test_ret);
5951}
5952
5953
5954static int
5955test_xmlCatalogConvert(void) {
5956    int test_ret = 0;
5957
5958#if defined(LIBXML_CATALOG_ENABLED)
5959    int ret_val;
5960
5961
5962        ret_val = xmlCatalogConvert();
5963        desret_int(ret_val);
5964        call_tests++;
5965        xmlResetLastError();
5966    function_tests++;
5967#endif
5968
5969    return(test_ret);
5970}
5971
5972
5973static int
5974test_xmlCatalogDump(void) {
5975    int test_ret = 0;
5976
5977#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5978    int mem_base;
5979    FILE * out; /* the file. */
5980    int n_out;
5981
5982    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5983        mem_base = xmlMemBlocks();
5984        out = gen_FILE_ptr(n_out, 0);
5985
5986        xmlCatalogDump(out);
5987        call_tests++;
5988        des_FILE_ptr(n_out, out, 0);
5989        xmlResetLastError();
5990        if (mem_base != xmlMemBlocks()) {
5991            printf("Leak of %d blocks found in xmlCatalogDump",
5992	           xmlMemBlocks() - mem_base);
5993	    test_ret++;
5994            printf(" %d", n_out);
5995            printf("\n");
5996        }
5997    }
5998    function_tests++;
5999#endif
6000
6001    return(test_ret);
6002}
6003
6004
6005static int
6006test_xmlCatalogGetDefaults(void) {
6007    int test_ret = 0;
6008
6009#if defined(LIBXML_CATALOG_ENABLED)
6010    int mem_base;
6011    xmlCatalogAllow ret_val;
6012
6013        mem_base = xmlMemBlocks();
6014
6015        ret_val = xmlCatalogGetDefaults();
6016        desret_xmlCatalogAllow(ret_val);
6017        call_tests++;
6018        xmlResetLastError();
6019        if (mem_base != xmlMemBlocks()) {
6020            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6021	           xmlMemBlocks() - mem_base);
6022	    test_ret++;
6023            printf("\n");
6024        }
6025    function_tests++;
6026#endif
6027
6028    return(test_ret);
6029}
6030
6031
6032static int
6033test_xmlCatalogIsEmpty(void) {
6034    int test_ret = 0;
6035
6036#if defined(LIBXML_CATALOG_ENABLED)
6037    int mem_base;
6038    int ret_val;
6039    xmlCatalogPtr catal; /* should this create an SGML catalog */
6040    int n_catal;
6041
6042    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6043        mem_base = xmlMemBlocks();
6044        catal = gen_xmlCatalogPtr(n_catal, 0);
6045
6046        ret_val = xmlCatalogIsEmpty(catal);
6047        desret_int(ret_val);
6048        call_tests++;
6049        des_xmlCatalogPtr(n_catal, catal, 0);
6050        xmlResetLastError();
6051        if (mem_base != xmlMemBlocks()) {
6052            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6053	           xmlMemBlocks() - mem_base);
6054	    test_ret++;
6055            printf(" %d", n_catal);
6056            printf("\n");
6057        }
6058    }
6059    function_tests++;
6060#endif
6061
6062    return(test_ret);
6063}
6064
6065
6066static int
6067test_xmlCatalogLocalResolve(void) {
6068    int test_ret = 0;
6069
6070#if defined(LIBXML_CATALOG_ENABLED)
6071    int mem_base;
6072    xmlChar * ret_val;
6073    void * catalogs; /* a document's list of catalogs */
6074    int n_catalogs;
6075    xmlChar * pubID; /* the public ID string */
6076    int n_pubID;
6077    xmlChar * sysID; /* the system ID string */
6078    int n_sysID;
6079
6080    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6081    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6082    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6083        mem_base = xmlMemBlocks();
6084        catalogs = gen_void_ptr(n_catalogs, 0);
6085        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6086        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6087
6088        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6089        desret_xmlChar_ptr(ret_val);
6090        call_tests++;
6091        des_void_ptr(n_catalogs, catalogs, 0);
6092        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6093        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6094        xmlResetLastError();
6095        if (mem_base != xmlMemBlocks()) {
6096            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6097	           xmlMemBlocks() - mem_base);
6098	    test_ret++;
6099            printf(" %d", n_catalogs);
6100            printf(" %d", n_pubID);
6101            printf(" %d", n_sysID);
6102            printf("\n");
6103        }
6104    }
6105    }
6106    }
6107    function_tests++;
6108#endif
6109
6110    return(test_ret);
6111}
6112
6113
6114static int
6115test_xmlCatalogLocalResolveURI(void) {
6116    int test_ret = 0;
6117
6118#if defined(LIBXML_CATALOG_ENABLED)
6119    int mem_base;
6120    xmlChar * ret_val;
6121    void * catalogs; /* a document's list of catalogs */
6122    int n_catalogs;
6123    xmlChar * URI; /* the URI */
6124    int n_URI;
6125
6126    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6127    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6128        mem_base = xmlMemBlocks();
6129        catalogs = gen_void_ptr(n_catalogs, 0);
6130        URI = gen_const_xmlChar_ptr(n_URI, 1);
6131
6132        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6133        desret_xmlChar_ptr(ret_val);
6134        call_tests++;
6135        des_void_ptr(n_catalogs, catalogs, 0);
6136        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6137        xmlResetLastError();
6138        if (mem_base != xmlMemBlocks()) {
6139            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6140	           xmlMemBlocks() - mem_base);
6141	    test_ret++;
6142            printf(" %d", n_catalogs);
6143            printf(" %d", n_URI);
6144            printf("\n");
6145        }
6146    }
6147    }
6148    function_tests++;
6149#endif
6150
6151    return(test_ret);
6152}
6153
6154
6155static int
6156test_xmlCatalogRemove(void) {
6157    int test_ret = 0;
6158
6159#if defined(LIBXML_CATALOG_ENABLED)
6160    int ret_val;
6161    xmlChar * value; /* the value to remove */
6162    int n_value;
6163
6164    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6165        value = gen_const_xmlChar_ptr(n_value, 0);
6166
6167        ret_val = xmlCatalogRemove((const xmlChar *)value);
6168        desret_int(ret_val);
6169        call_tests++;
6170        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6171        xmlResetLastError();
6172    }
6173    function_tests++;
6174#endif
6175
6176    return(test_ret);
6177}
6178
6179
6180static int
6181test_xmlCatalogResolve(void) {
6182    int test_ret = 0;
6183
6184#if defined(LIBXML_CATALOG_ENABLED)
6185    xmlChar * ret_val;
6186    xmlChar * pubID; /* the public ID string */
6187    int n_pubID;
6188    xmlChar * sysID; /* the system ID string */
6189    int n_sysID;
6190
6191    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6192    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6193        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6194        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6195
6196        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6197        desret_xmlChar_ptr(ret_val);
6198        call_tests++;
6199        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6200        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6201        xmlResetLastError();
6202    }
6203    }
6204    function_tests++;
6205#endif
6206
6207    return(test_ret);
6208}
6209
6210
6211static int
6212test_xmlCatalogResolvePublic(void) {
6213    int test_ret = 0;
6214
6215#if defined(LIBXML_CATALOG_ENABLED)
6216    int mem_base;
6217    xmlChar * ret_val;
6218    xmlChar * pubID; /* the public ID string */
6219    int n_pubID;
6220
6221    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6222        mem_base = xmlMemBlocks();
6223        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6224
6225        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6226        desret_xmlChar_ptr(ret_val);
6227        call_tests++;
6228        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6229        xmlResetLastError();
6230        if (mem_base != xmlMemBlocks()) {
6231            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6232	           xmlMemBlocks() - mem_base);
6233	    test_ret++;
6234            printf(" %d", n_pubID);
6235            printf("\n");
6236        }
6237    }
6238    function_tests++;
6239#endif
6240
6241    return(test_ret);
6242}
6243
6244
6245static int
6246test_xmlCatalogResolveSystem(void) {
6247    int test_ret = 0;
6248
6249#if defined(LIBXML_CATALOG_ENABLED)
6250    int mem_base;
6251    xmlChar * ret_val;
6252    xmlChar * sysID; /* the system ID string */
6253    int n_sysID;
6254
6255    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6256        mem_base = xmlMemBlocks();
6257        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6258
6259        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6260        desret_xmlChar_ptr(ret_val);
6261        call_tests++;
6262        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6263        xmlResetLastError();
6264        if (mem_base != xmlMemBlocks()) {
6265            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6266	           xmlMemBlocks() - mem_base);
6267	    test_ret++;
6268            printf(" %d", n_sysID);
6269            printf("\n");
6270        }
6271    }
6272    function_tests++;
6273#endif
6274
6275    return(test_ret);
6276}
6277
6278
6279static int
6280test_xmlCatalogResolveURI(void) {
6281    int test_ret = 0;
6282
6283#if defined(LIBXML_CATALOG_ENABLED)
6284    int mem_base;
6285    xmlChar * ret_val;
6286    xmlChar * URI; /* the URI */
6287    int n_URI;
6288
6289    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6290        mem_base = xmlMemBlocks();
6291        URI = gen_const_xmlChar_ptr(n_URI, 0);
6292
6293        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6294        desret_xmlChar_ptr(ret_val);
6295        call_tests++;
6296        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6297        xmlResetLastError();
6298        if (mem_base != xmlMemBlocks()) {
6299            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6300	           xmlMemBlocks() - mem_base);
6301	    test_ret++;
6302            printf(" %d", n_URI);
6303            printf("\n");
6304        }
6305    }
6306    function_tests++;
6307#endif
6308
6309    return(test_ret);
6310}
6311
6312
6313static int
6314test_xmlCatalogSetDefaultPrefer(void) {
6315    int test_ret = 0;
6316
6317#if defined(LIBXML_CATALOG_ENABLED)
6318    int mem_base;
6319    xmlCatalogPrefer ret_val;
6320    xmlCatalogPrefer prefer; /* the default preference for delegation */
6321    int n_prefer;
6322
6323    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6324        mem_base = xmlMemBlocks();
6325        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6326
6327        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6328        desret_xmlCatalogPrefer(ret_val);
6329        call_tests++;
6330        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6331        xmlResetLastError();
6332        if (mem_base != xmlMemBlocks()) {
6333            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6334	           xmlMemBlocks() - mem_base);
6335	    test_ret++;
6336            printf(" %d", n_prefer);
6337            printf("\n");
6338        }
6339    }
6340    function_tests++;
6341#endif
6342
6343    return(test_ret);
6344}
6345
6346
6347static int
6348test_xmlCatalogSetDefaults(void) {
6349    int test_ret = 0;
6350
6351#if defined(LIBXML_CATALOG_ENABLED)
6352    int mem_base;
6353    xmlCatalogAllow allow; /* what catalogs should be accepted */
6354    int n_allow;
6355
6356    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6357        mem_base = xmlMemBlocks();
6358        allow = gen_xmlCatalogAllow(n_allow, 0);
6359
6360        xmlCatalogSetDefaults(allow);
6361        call_tests++;
6362        des_xmlCatalogAllow(n_allow, allow, 0);
6363        xmlResetLastError();
6364        if (mem_base != xmlMemBlocks()) {
6365            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6366	           xmlMemBlocks() - mem_base);
6367	    test_ret++;
6368            printf(" %d", n_allow);
6369            printf("\n");
6370        }
6371    }
6372    function_tests++;
6373#endif
6374
6375    return(test_ret);
6376}
6377
6378
6379static int
6380test_xmlConvertSGMLCatalog(void) {
6381    int test_ret = 0;
6382
6383#if defined(LIBXML_CATALOG_ENABLED)
6384    int mem_base;
6385    int ret_val;
6386    xmlCatalogPtr catal; /* the catalog */
6387    int n_catal;
6388
6389    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6390        mem_base = xmlMemBlocks();
6391        catal = gen_xmlCatalogPtr(n_catal, 0);
6392
6393        ret_val = xmlConvertSGMLCatalog(catal);
6394        desret_int(ret_val);
6395        call_tests++;
6396        des_xmlCatalogPtr(n_catal, catal, 0);
6397        xmlResetLastError();
6398        if (mem_base != xmlMemBlocks()) {
6399            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6400	           xmlMemBlocks() - mem_base);
6401	    test_ret++;
6402            printf(" %d", n_catal);
6403            printf("\n");
6404        }
6405    }
6406    function_tests++;
6407#endif
6408
6409    return(test_ret);
6410}
6411
6412
6413static int
6414test_xmlInitializeCatalog(void) {
6415    int test_ret = 0;
6416
6417#if defined(LIBXML_CATALOG_ENABLED)
6418    int mem_base;
6419
6420        mem_base = xmlMemBlocks();
6421
6422        xmlInitializeCatalog();
6423        call_tests++;
6424        xmlResetLastError();
6425        if (mem_base != xmlMemBlocks()) {
6426            printf("Leak of %d blocks found in xmlInitializeCatalog",
6427	           xmlMemBlocks() - mem_base);
6428	    test_ret++;
6429            printf("\n");
6430        }
6431    function_tests++;
6432#endif
6433
6434    return(test_ret);
6435}
6436
6437
6438static int
6439test_xmlLoadACatalog(void) {
6440    int test_ret = 0;
6441
6442
6443    /* missing type support */
6444    return(test_ret);
6445}
6446
6447
6448static int
6449test_xmlLoadCatalog(void) {
6450    int test_ret = 0;
6451
6452#if defined(LIBXML_CATALOG_ENABLED)
6453    int ret_val;
6454    const char * filename; /* a file path */
6455    int n_filename;
6456
6457    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6458        filename = gen_filepath(n_filename, 0);
6459
6460        ret_val = xmlLoadCatalog(filename);
6461        desret_int(ret_val);
6462        call_tests++;
6463        des_filepath(n_filename, filename, 0);
6464        xmlResetLastError();
6465    }
6466    function_tests++;
6467#endif
6468
6469    return(test_ret);
6470}
6471
6472
6473static int
6474test_xmlLoadCatalogs(void) {
6475    int test_ret = 0;
6476
6477#if defined(LIBXML_CATALOG_ENABLED)
6478    char * pathss; /* a list of directories separated by a colon or a space. */
6479    int n_pathss;
6480
6481    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6482        pathss = gen_const_char_ptr(n_pathss, 0);
6483
6484        xmlLoadCatalogs((const char *)pathss);
6485        call_tests++;
6486        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6487        xmlResetLastError();
6488    }
6489    function_tests++;
6490#endif
6491
6492    return(test_ret);
6493}
6494
6495
6496static int
6497test_xmlLoadSGMLSuperCatalog(void) {
6498    int test_ret = 0;
6499
6500
6501    /* missing type support */
6502    return(test_ret);
6503}
6504
6505
6506static int
6507test_xmlNewCatalog(void) {
6508    int test_ret = 0;
6509
6510
6511    /* missing type support */
6512    return(test_ret);
6513}
6514
6515
6516static int
6517test_xmlParseCatalogFile(void) {
6518    int test_ret = 0;
6519
6520#if defined(LIBXML_CATALOG_ENABLED)
6521    int mem_base;
6522    xmlDocPtr ret_val;
6523    const char * filename; /* the filename */
6524    int n_filename;
6525
6526    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6527        mem_base = xmlMemBlocks();
6528        filename = gen_filepath(n_filename, 0);
6529
6530        ret_val = xmlParseCatalogFile(filename);
6531        desret_xmlDocPtr(ret_val);
6532        call_tests++;
6533        des_filepath(n_filename, filename, 0);
6534        xmlResetLastError();
6535        if (mem_base != xmlMemBlocks()) {
6536            printf("Leak of %d blocks found in xmlParseCatalogFile",
6537	           xmlMemBlocks() - mem_base);
6538	    test_ret++;
6539            printf(" %d", n_filename);
6540            printf("\n");
6541        }
6542    }
6543    function_tests++;
6544#endif
6545
6546    return(test_ret);
6547}
6548
6549static int
6550test_catalog(void) {
6551    int test_ret = 0;
6552
6553    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6554    test_ret += test_xmlACatalogAdd();
6555    test_ret += test_xmlACatalogDump();
6556    test_ret += test_xmlACatalogRemove();
6557    test_ret += test_xmlACatalogResolve();
6558    test_ret += test_xmlACatalogResolvePublic();
6559    test_ret += test_xmlACatalogResolveSystem();
6560    test_ret += test_xmlACatalogResolveURI();
6561    test_ret += test_xmlCatalogAdd();
6562    test_ret += test_xmlCatalogCleanup();
6563    test_ret += test_xmlCatalogConvert();
6564    test_ret += test_xmlCatalogDump();
6565    test_ret += test_xmlCatalogGetDefaults();
6566    test_ret += test_xmlCatalogIsEmpty();
6567    test_ret += test_xmlCatalogLocalResolve();
6568    test_ret += test_xmlCatalogLocalResolveURI();
6569    test_ret += test_xmlCatalogRemove();
6570    test_ret += test_xmlCatalogResolve();
6571    test_ret += test_xmlCatalogResolvePublic();
6572    test_ret += test_xmlCatalogResolveSystem();
6573    test_ret += test_xmlCatalogResolveURI();
6574    test_ret += test_xmlCatalogSetDefaultPrefer();
6575    test_ret += test_xmlCatalogSetDefaults();
6576    test_ret += test_xmlConvertSGMLCatalog();
6577    test_ret += test_xmlInitializeCatalog();
6578    test_ret += test_xmlLoadACatalog();
6579    test_ret += test_xmlLoadCatalog();
6580    test_ret += test_xmlLoadCatalogs();
6581    test_ret += test_xmlLoadSGMLSuperCatalog();
6582    test_ret += test_xmlNewCatalog();
6583    test_ret += test_xmlParseCatalogFile();
6584
6585    if (test_ret != 0)
6586	printf("Module catalog: %d errors\n", test_ret);
6587    return(test_ret);
6588}
6589
6590#define gen_nb_const_xmlChRangeGroup_ptr 1
6591static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6592    return(NULL);
6593}
6594static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6595}
6596
6597static int
6598test_xmlCharInRange(void) {
6599    int test_ret = 0;
6600
6601    int mem_base;
6602    int ret_val;
6603    unsigned int val; /* character to be validated */
6604    int n_val;
6605    xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6606    int n_rptr;
6607
6608    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6609    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6610        mem_base = xmlMemBlocks();
6611        val = gen_unsigned_int(n_val, 0);
6612        rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6613
6614        ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6615        desret_int(ret_val);
6616        call_tests++;
6617        des_unsigned_int(n_val, val, 0);
6618        des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6619        xmlResetLastError();
6620        if (mem_base != xmlMemBlocks()) {
6621            printf("Leak of %d blocks found in xmlCharInRange",
6622	           xmlMemBlocks() - mem_base);
6623	    test_ret++;
6624            printf(" %d", n_val);
6625            printf(" %d", n_rptr);
6626            printf("\n");
6627        }
6628    }
6629    }
6630    function_tests++;
6631
6632    return(test_ret);
6633}
6634
6635
6636static int
6637test_xmlIsBaseChar(void) {
6638    int test_ret = 0;
6639
6640    int mem_base;
6641    int ret_val;
6642    unsigned int ch; /* character to validate */
6643    int n_ch;
6644
6645    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6646        mem_base = xmlMemBlocks();
6647        ch = gen_unsigned_int(n_ch, 0);
6648
6649        ret_val = xmlIsBaseChar(ch);
6650        desret_int(ret_val);
6651        call_tests++;
6652        des_unsigned_int(n_ch, ch, 0);
6653        xmlResetLastError();
6654        if (mem_base != xmlMemBlocks()) {
6655            printf("Leak of %d blocks found in xmlIsBaseChar",
6656	           xmlMemBlocks() - mem_base);
6657	    test_ret++;
6658            printf(" %d", n_ch);
6659            printf("\n");
6660        }
6661    }
6662    function_tests++;
6663
6664    return(test_ret);
6665}
6666
6667
6668static int
6669test_xmlIsBlank(void) {
6670    int test_ret = 0;
6671
6672    int mem_base;
6673    int ret_val;
6674    unsigned int ch; /* character to validate */
6675    int n_ch;
6676
6677    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6678        mem_base = xmlMemBlocks();
6679        ch = gen_unsigned_int(n_ch, 0);
6680
6681        ret_val = xmlIsBlank(ch);
6682        desret_int(ret_val);
6683        call_tests++;
6684        des_unsigned_int(n_ch, ch, 0);
6685        xmlResetLastError();
6686        if (mem_base != xmlMemBlocks()) {
6687            printf("Leak of %d blocks found in xmlIsBlank",
6688	           xmlMemBlocks() - mem_base);
6689	    test_ret++;
6690            printf(" %d", n_ch);
6691            printf("\n");
6692        }
6693    }
6694    function_tests++;
6695
6696    return(test_ret);
6697}
6698
6699
6700static int
6701test_xmlIsChar(void) {
6702    int test_ret = 0;
6703
6704    int mem_base;
6705    int ret_val;
6706    unsigned int ch; /* character to validate */
6707    int n_ch;
6708
6709    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6710        mem_base = xmlMemBlocks();
6711        ch = gen_unsigned_int(n_ch, 0);
6712
6713        ret_val = xmlIsChar(ch);
6714        desret_int(ret_val);
6715        call_tests++;
6716        des_unsigned_int(n_ch, ch, 0);
6717        xmlResetLastError();
6718        if (mem_base != xmlMemBlocks()) {
6719            printf("Leak of %d blocks found in xmlIsChar",
6720	           xmlMemBlocks() - mem_base);
6721	    test_ret++;
6722            printf(" %d", n_ch);
6723            printf("\n");
6724        }
6725    }
6726    function_tests++;
6727
6728    return(test_ret);
6729}
6730
6731
6732static int
6733test_xmlIsCombining(void) {
6734    int test_ret = 0;
6735
6736    int mem_base;
6737    int ret_val;
6738    unsigned int ch; /* character to validate */
6739    int n_ch;
6740
6741    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6742        mem_base = xmlMemBlocks();
6743        ch = gen_unsigned_int(n_ch, 0);
6744
6745        ret_val = xmlIsCombining(ch);
6746        desret_int(ret_val);
6747        call_tests++;
6748        des_unsigned_int(n_ch, ch, 0);
6749        xmlResetLastError();
6750        if (mem_base != xmlMemBlocks()) {
6751            printf("Leak of %d blocks found in xmlIsCombining",
6752	           xmlMemBlocks() - mem_base);
6753	    test_ret++;
6754            printf(" %d", n_ch);
6755            printf("\n");
6756        }
6757    }
6758    function_tests++;
6759
6760    return(test_ret);
6761}
6762
6763
6764static int
6765test_xmlIsDigit(void) {
6766    int test_ret = 0;
6767
6768    int mem_base;
6769    int ret_val;
6770    unsigned int ch; /* character to validate */
6771    int n_ch;
6772
6773    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6774        mem_base = xmlMemBlocks();
6775        ch = gen_unsigned_int(n_ch, 0);
6776
6777        ret_val = xmlIsDigit(ch);
6778        desret_int(ret_val);
6779        call_tests++;
6780        des_unsigned_int(n_ch, ch, 0);
6781        xmlResetLastError();
6782        if (mem_base != xmlMemBlocks()) {
6783            printf("Leak of %d blocks found in xmlIsDigit",
6784	           xmlMemBlocks() - mem_base);
6785	    test_ret++;
6786            printf(" %d", n_ch);
6787            printf("\n");
6788        }
6789    }
6790    function_tests++;
6791
6792    return(test_ret);
6793}
6794
6795
6796static int
6797test_xmlIsExtender(void) {
6798    int test_ret = 0;
6799
6800    int mem_base;
6801    int ret_val;
6802    unsigned int ch; /* character to validate */
6803    int n_ch;
6804
6805    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6806        mem_base = xmlMemBlocks();
6807        ch = gen_unsigned_int(n_ch, 0);
6808
6809        ret_val = xmlIsExtender(ch);
6810        desret_int(ret_val);
6811        call_tests++;
6812        des_unsigned_int(n_ch, ch, 0);
6813        xmlResetLastError();
6814        if (mem_base != xmlMemBlocks()) {
6815            printf("Leak of %d blocks found in xmlIsExtender",
6816	           xmlMemBlocks() - mem_base);
6817	    test_ret++;
6818            printf(" %d", n_ch);
6819            printf("\n");
6820        }
6821    }
6822    function_tests++;
6823
6824    return(test_ret);
6825}
6826
6827
6828static int
6829test_xmlIsIdeographic(void) {
6830    int test_ret = 0;
6831
6832    int mem_base;
6833    int ret_val;
6834    unsigned int ch; /* character to validate */
6835    int n_ch;
6836
6837    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6838        mem_base = xmlMemBlocks();
6839        ch = gen_unsigned_int(n_ch, 0);
6840
6841        ret_val = xmlIsIdeographic(ch);
6842        desret_int(ret_val);
6843        call_tests++;
6844        des_unsigned_int(n_ch, ch, 0);
6845        xmlResetLastError();
6846        if (mem_base != xmlMemBlocks()) {
6847            printf("Leak of %d blocks found in xmlIsIdeographic",
6848	           xmlMemBlocks() - mem_base);
6849	    test_ret++;
6850            printf(" %d", n_ch);
6851            printf("\n");
6852        }
6853    }
6854    function_tests++;
6855
6856    return(test_ret);
6857}
6858
6859
6860static int
6861test_xmlIsPubidChar(void) {
6862    int test_ret = 0;
6863
6864    int mem_base;
6865    int ret_val;
6866    unsigned int ch; /* character to validate */
6867    int n_ch;
6868
6869    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6870        mem_base = xmlMemBlocks();
6871        ch = gen_unsigned_int(n_ch, 0);
6872
6873        ret_val = xmlIsPubidChar(ch);
6874        desret_int(ret_val);
6875        call_tests++;
6876        des_unsigned_int(n_ch, ch, 0);
6877        xmlResetLastError();
6878        if (mem_base != xmlMemBlocks()) {
6879            printf("Leak of %d blocks found in xmlIsPubidChar",
6880	           xmlMemBlocks() - mem_base);
6881	    test_ret++;
6882            printf(" %d", n_ch);
6883            printf("\n");
6884        }
6885    }
6886    function_tests++;
6887
6888    return(test_ret);
6889}
6890
6891static int
6892test_chvalid(void) {
6893    int test_ret = 0;
6894
6895    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6896    test_ret += test_xmlCharInRange();
6897    test_ret += test_xmlIsBaseChar();
6898    test_ret += test_xmlIsBlank();
6899    test_ret += test_xmlIsChar();
6900    test_ret += test_xmlIsCombining();
6901    test_ret += test_xmlIsDigit();
6902    test_ret += test_xmlIsExtender();
6903    test_ret += test_xmlIsIdeographic();
6904    test_ret += test_xmlIsPubidChar();
6905
6906    if (test_ret != 0)
6907	printf("Module chvalid: %d errors\n", test_ret);
6908    return(test_ret);
6909}
6910
6911static int
6912test_xmlBoolToText(void) {
6913    int test_ret = 0;
6914
6915#if defined(LIBXML_DEBUG_ENABLED)
6916    int mem_base;
6917    const char * ret_val;
6918    int boolval; /* a bool to turn into text */
6919    int n_boolval;
6920
6921    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6922        mem_base = xmlMemBlocks();
6923        boolval = gen_int(n_boolval, 0);
6924
6925        ret_val = xmlBoolToText(boolval);
6926        desret_const_char_ptr(ret_val);
6927        call_tests++;
6928        des_int(n_boolval, boolval, 0);
6929        xmlResetLastError();
6930        if (mem_base != xmlMemBlocks()) {
6931            printf("Leak of %d blocks found in xmlBoolToText",
6932	           xmlMemBlocks() - mem_base);
6933	    test_ret++;
6934            printf(" %d", n_boolval);
6935            printf("\n");
6936        }
6937    }
6938    function_tests++;
6939#endif
6940
6941    return(test_ret);
6942}
6943
6944
6945static int
6946test_xmlDebugCheckDocument(void) {
6947    int test_ret = 0;
6948
6949#if defined(LIBXML_DEBUG_ENABLED)
6950    int mem_base;
6951    int ret_val;
6952    FILE * output; /* the FILE * for the output */
6953    int n_output;
6954    xmlDocPtr doc; /* the document */
6955    int n_doc;
6956
6957    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6958    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6959        mem_base = xmlMemBlocks();
6960        output = gen_debug_FILE_ptr(n_output, 0);
6961        doc = gen_xmlDocPtr(n_doc, 1);
6962
6963        ret_val = xmlDebugCheckDocument(output, doc);
6964        desret_int(ret_val);
6965        call_tests++;
6966        des_debug_FILE_ptr(n_output, output, 0);
6967        des_xmlDocPtr(n_doc, doc, 1);
6968        xmlResetLastError();
6969        if (mem_base != xmlMemBlocks()) {
6970            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6971	           xmlMemBlocks() - mem_base);
6972	    test_ret++;
6973            printf(" %d", n_output);
6974            printf(" %d", n_doc);
6975            printf("\n");
6976        }
6977    }
6978    }
6979    function_tests++;
6980#endif
6981
6982    return(test_ret);
6983}
6984
6985
6986static int
6987test_xmlDebugDumpAttr(void) {
6988    int test_ret = 0;
6989
6990#if defined(LIBXML_DEBUG_ENABLED)
6991    int mem_base;
6992    FILE * output; /* the FILE * for the output */
6993    int n_output;
6994    xmlAttrPtr attr; /* the attribute */
6995    int n_attr;
6996    int depth; /* the indentation level. */
6997    int n_depth;
6998
6999    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7000    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7001    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7002        mem_base = xmlMemBlocks();
7003        output = gen_debug_FILE_ptr(n_output, 0);
7004        attr = gen_xmlAttrPtr(n_attr, 1);
7005        depth = gen_int(n_depth, 2);
7006
7007        xmlDebugDumpAttr(output, attr, depth);
7008        call_tests++;
7009        des_debug_FILE_ptr(n_output, output, 0);
7010        des_xmlAttrPtr(n_attr, attr, 1);
7011        des_int(n_depth, depth, 2);
7012        xmlResetLastError();
7013        if (mem_base != xmlMemBlocks()) {
7014            printf("Leak of %d blocks found in xmlDebugDumpAttr",
7015	           xmlMemBlocks() - mem_base);
7016	    test_ret++;
7017            printf(" %d", n_output);
7018            printf(" %d", n_attr);
7019            printf(" %d", n_depth);
7020            printf("\n");
7021        }
7022    }
7023    }
7024    }
7025    function_tests++;
7026#endif
7027
7028    return(test_ret);
7029}
7030
7031
7032static int
7033test_xmlDebugDumpAttrList(void) {
7034    int test_ret = 0;
7035
7036#if defined(LIBXML_DEBUG_ENABLED)
7037    int mem_base;
7038    FILE * output; /* the FILE * for the output */
7039    int n_output;
7040    xmlAttrPtr attr; /* the attribute list */
7041    int n_attr;
7042    int depth; /* the indentation level. */
7043    int n_depth;
7044
7045    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7046    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7047    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7048        mem_base = xmlMemBlocks();
7049        output = gen_debug_FILE_ptr(n_output, 0);
7050        attr = gen_xmlAttrPtr(n_attr, 1);
7051        depth = gen_int(n_depth, 2);
7052
7053        xmlDebugDumpAttrList(output, attr, depth);
7054        call_tests++;
7055        des_debug_FILE_ptr(n_output, output, 0);
7056        des_xmlAttrPtr(n_attr, attr, 1);
7057        des_int(n_depth, depth, 2);
7058        xmlResetLastError();
7059        if (mem_base != xmlMemBlocks()) {
7060            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7061	           xmlMemBlocks() - mem_base);
7062	    test_ret++;
7063            printf(" %d", n_output);
7064            printf(" %d", n_attr);
7065            printf(" %d", n_depth);
7066            printf("\n");
7067        }
7068    }
7069    }
7070    }
7071    function_tests++;
7072#endif
7073
7074    return(test_ret);
7075}
7076
7077
7078static int
7079test_xmlDebugDumpDTD(void) {
7080    int test_ret = 0;
7081
7082#if defined(LIBXML_DEBUG_ENABLED)
7083    int mem_base;
7084    FILE * output; /* the FILE * for the output */
7085    int n_output;
7086    xmlDtdPtr dtd; /* the DTD */
7087    int n_dtd;
7088
7089    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7090    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7091        mem_base = xmlMemBlocks();
7092        output = gen_debug_FILE_ptr(n_output, 0);
7093        dtd = gen_xmlDtdPtr(n_dtd, 1);
7094
7095        xmlDebugDumpDTD(output, dtd);
7096        call_tests++;
7097        des_debug_FILE_ptr(n_output, output, 0);
7098        des_xmlDtdPtr(n_dtd, dtd, 1);
7099        xmlResetLastError();
7100        if (mem_base != xmlMemBlocks()) {
7101            printf("Leak of %d blocks found in xmlDebugDumpDTD",
7102	           xmlMemBlocks() - mem_base);
7103	    test_ret++;
7104            printf(" %d", n_output);
7105            printf(" %d", n_dtd);
7106            printf("\n");
7107        }
7108    }
7109    }
7110    function_tests++;
7111#endif
7112
7113    return(test_ret);
7114}
7115
7116
7117static int
7118test_xmlDebugDumpDocument(void) {
7119    int test_ret = 0;
7120
7121#if defined(LIBXML_DEBUG_ENABLED)
7122    int mem_base;
7123    FILE * output; /* the FILE * for the output */
7124    int n_output;
7125    xmlDocPtr doc; /* the document */
7126    int n_doc;
7127
7128    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7129    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7130        mem_base = xmlMemBlocks();
7131        output = gen_debug_FILE_ptr(n_output, 0);
7132        doc = gen_xmlDocPtr(n_doc, 1);
7133
7134        xmlDebugDumpDocument(output, doc);
7135        call_tests++;
7136        des_debug_FILE_ptr(n_output, output, 0);
7137        des_xmlDocPtr(n_doc, doc, 1);
7138        xmlResetLastError();
7139        if (mem_base != xmlMemBlocks()) {
7140            printf("Leak of %d blocks found in xmlDebugDumpDocument",
7141	           xmlMemBlocks() - mem_base);
7142	    test_ret++;
7143            printf(" %d", n_output);
7144            printf(" %d", n_doc);
7145            printf("\n");
7146        }
7147    }
7148    }
7149    function_tests++;
7150#endif
7151
7152    return(test_ret);
7153}
7154
7155
7156static int
7157test_xmlDebugDumpDocumentHead(void) {
7158    int test_ret = 0;
7159
7160#if defined(LIBXML_DEBUG_ENABLED)
7161    int mem_base;
7162    FILE * output; /* the FILE * for the output */
7163    int n_output;
7164    xmlDocPtr doc; /* the document */
7165    int n_doc;
7166
7167    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7168    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7169        mem_base = xmlMemBlocks();
7170        output = gen_debug_FILE_ptr(n_output, 0);
7171        doc = gen_xmlDocPtr(n_doc, 1);
7172
7173        xmlDebugDumpDocumentHead(output, doc);
7174        call_tests++;
7175        des_debug_FILE_ptr(n_output, output, 0);
7176        des_xmlDocPtr(n_doc, doc, 1);
7177        xmlResetLastError();
7178        if (mem_base != xmlMemBlocks()) {
7179            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7180	           xmlMemBlocks() - mem_base);
7181	    test_ret++;
7182            printf(" %d", n_output);
7183            printf(" %d", n_doc);
7184            printf("\n");
7185        }
7186    }
7187    }
7188    function_tests++;
7189#endif
7190
7191    return(test_ret);
7192}
7193
7194
7195static int
7196test_xmlDebugDumpEntities(void) {
7197    int test_ret = 0;
7198
7199#if defined(LIBXML_DEBUG_ENABLED)
7200    int mem_base;
7201    FILE * output; /* the FILE * for the output */
7202    int n_output;
7203    xmlDocPtr doc; /* the document */
7204    int n_doc;
7205
7206    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7207    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7208        mem_base = xmlMemBlocks();
7209        output = gen_debug_FILE_ptr(n_output, 0);
7210        doc = gen_xmlDocPtr(n_doc, 1);
7211
7212        xmlDebugDumpEntities(output, doc);
7213        call_tests++;
7214        des_debug_FILE_ptr(n_output, output, 0);
7215        des_xmlDocPtr(n_doc, doc, 1);
7216        xmlResetLastError();
7217        if (mem_base != xmlMemBlocks()) {
7218            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7219	           xmlMemBlocks() - mem_base);
7220	    test_ret++;
7221            printf(" %d", n_output);
7222            printf(" %d", n_doc);
7223            printf("\n");
7224        }
7225    }
7226    }
7227    function_tests++;
7228#endif
7229
7230    return(test_ret);
7231}
7232
7233
7234static int
7235test_xmlDebugDumpNode(void) {
7236    int test_ret = 0;
7237
7238#if defined(LIBXML_DEBUG_ENABLED)
7239    int mem_base;
7240    FILE * output; /* the FILE * for the output */
7241    int n_output;
7242    xmlNodePtr node; /* the node */
7243    int n_node;
7244    int depth; /* the indentation level. */
7245    int n_depth;
7246
7247    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7248    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7249    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7250        mem_base = xmlMemBlocks();
7251        output = gen_debug_FILE_ptr(n_output, 0);
7252        node = gen_xmlNodePtr(n_node, 1);
7253        depth = gen_int(n_depth, 2);
7254
7255        xmlDebugDumpNode(output, node, depth);
7256        call_tests++;
7257        des_debug_FILE_ptr(n_output, output, 0);
7258        des_xmlNodePtr(n_node, node, 1);
7259        des_int(n_depth, depth, 2);
7260        xmlResetLastError();
7261        if (mem_base != xmlMemBlocks()) {
7262            printf("Leak of %d blocks found in xmlDebugDumpNode",
7263	           xmlMemBlocks() - mem_base);
7264	    test_ret++;
7265            printf(" %d", n_output);
7266            printf(" %d", n_node);
7267            printf(" %d", n_depth);
7268            printf("\n");
7269        }
7270    }
7271    }
7272    }
7273    function_tests++;
7274#endif
7275
7276    return(test_ret);
7277}
7278
7279
7280static int
7281test_xmlDebugDumpNodeList(void) {
7282    int test_ret = 0;
7283
7284#if defined(LIBXML_DEBUG_ENABLED)
7285    int mem_base;
7286    FILE * output; /* the FILE * for the output */
7287    int n_output;
7288    xmlNodePtr node; /* the node list */
7289    int n_node;
7290    int depth; /* the indentation level. */
7291    int n_depth;
7292
7293    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7294    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7295    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7296        mem_base = xmlMemBlocks();
7297        output = gen_debug_FILE_ptr(n_output, 0);
7298        node = gen_xmlNodePtr(n_node, 1);
7299        depth = gen_int(n_depth, 2);
7300
7301        xmlDebugDumpNodeList(output, node, depth);
7302        call_tests++;
7303        des_debug_FILE_ptr(n_output, output, 0);
7304        des_xmlNodePtr(n_node, node, 1);
7305        des_int(n_depth, depth, 2);
7306        xmlResetLastError();
7307        if (mem_base != xmlMemBlocks()) {
7308            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7309	           xmlMemBlocks() - mem_base);
7310	    test_ret++;
7311            printf(" %d", n_output);
7312            printf(" %d", n_node);
7313            printf(" %d", n_depth);
7314            printf("\n");
7315        }
7316    }
7317    }
7318    }
7319    function_tests++;
7320#endif
7321
7322    return(test_ret);
7323}
7324
7325
7326static int
7327test_xmlDebugDumpOneNode(void) {
7328    int test_ret = 0;
7329
7330#if defined(LIBXML_DEBUG_ENABLED)
7331    int mem_base;
7332    FILE * output; /* the FILE * for the output */
7333    int n_output;
7334    xmlNodePtr node; /* the node */
7335    int n_node;
7336    int depth; /* the indentation level. */
7337    int n_depth;
7338
7339    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7340    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7341    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7342        mem_base = xmlMemBlocks();
7343        output = gen_debug_FILE_ptr(n_output, 0);
7344        node = gen_xmlNodePtr(n_node, 1);
7345        depth = gen_int(n_depth, 2);
7346
7347        xmlDebugDumpOneNode(output, node, depth);
7348        call_tests++;
7349        des_debug_FILE_ptr(n_output, output, 0);
7350        des_xmlNodePtr(n_node, node, 1);
7351        des_int(n_depth, depth, 2);
7352        xmlResetLastError();
7353        if (mem_base != xmlMemBlocks()) {
7354            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7355	           xmlMemBlocks() - mem_base);
7356	    test_ret++;
7357            printf(" %d", n_output);
7358            printf(" %d", n_node);
7359            printf(" %d", n_depth);
7360            printf("\n");
7361        }
7362    }
7363    }
7364    }
7365    function_tests++;
7366#endif
7367
7368    return(test_ret);
7369}
7370
7371
7372static int
7373test_xmlDebugDumpString(void) {
7374    int test_ret = 0;
7375
7376#if defined(LIBXML_DEBUG_ENABLED)
7377    int mem_base;
7378    FILE * output; /* the FILE * for the output */
7379    int n_output;
7380    xmlChar * str; /* the string */
7381    int n_str;
7382
7383    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7384    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7385        mem_base = xmlMemBlocks();
7386        output = gen_debug_FILE_ptr(n_output, 0);
7387        str = gen_const_xmlChar_ptr(n_str, 1);
7388
7389        xmlDebugDumpString(output, (const xmlChar *)str);
7390        call_tests++;
7391        des_debug_FILE_ptr(n_output, output, 0);
7392        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7393        xmlResetLastError();
7394        if (mem_base != xmlMemBlocks()) {
7395            printf("Leak of %d blocks found in xmlDebugDumpString",
7396	           xmlMemBlocks() - mem_base);
7397	    test_ret++;
7398            printf(" %d", n_output);
7399            printf(" %d", n_str);
7400            printf("\n");
7401        }
7402    }
7403    }
7404    function_tests++;
7405#endif
7406
7407    return(test_ret);
7408}
7409
7410
7411static int
7412test_xmlLsCountNode(void) {
7413    int test_ret = 0;
7414
7415#if defined(LIBXML_DEBUG_ENABLED)
7416    int mem_base;
7417    int ret_val;
7418    xmlNodePtr node; /* the node to count */
7419    int n_node;
7420
7421    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7422        mem_base = xmlMemBlocks();
7423        node = gen_xmlNodePtr(n_node, 0);
7424
7425        ret_val = xmlLsCountNode(node);
7426        desret_int(ret_val);
7427        call_tests++;
7428        des_xmlNodePtr(n_node, node, 0);
7429        xmlResetLastError();
7430        if (mem_base != xmlMemBlocks()) {
7431            printf("Leak of %d blocks found in xmlLsCountNode",
7432	           xmlMemBlocks() - mem_base);
7433	    test_ret++;
7434            printf(" %d", n_node);
7435            printf("\n");
7436        }
7437    }
7438    function_tests++;
7439#endif
7440
7441    return(test_ret);
7442}
7443
7444
7445static int
7446test_xmlLsOneNode(void) {
7447    int test_ret = 0;
7448
7449#if defined(LIBXML_DEBUG_ENABLED)
7450    int mem_base;
7451    FILE * output; /* the FILE * for the output */
7452    int n_output;
7453    xmlNodePtr node; /* the node to dump */
7454    int n_node;
7455
7456    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7457    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7458        mem_base = xmlMemBlocks();
7459        output = gen_debug_FILE_ptr(n_output, 0);
7460        node = gen_xmlNodePtr(n_node, 1);
7461
7462        xmlLsOneNode(output, node);
7463        call_tests++;
7464        des_debug_FILE_ptr(n_output, output, 0);
7465        des_xmlNodePtr(n_node, node, 1);
7466        xmlResetLastError();
7467        if (mem_base != xmlMemBlocks()) {
7468            printf("Leak of %d blocks found in xmlLsOneNode",
7469	           xmlMemBlocks() - mem_base);
7470	    test_ret++;
7471            printf(" %d", n_output);
7472            printf(" %d", n_node);
7473            printf("\n");
7474        }
7475    }
7476    }
7477    function_tests++;
7478#endif
7479
7480    return(test_ret);
7481}
7482
7483
7484#define gen_nb_char_ptr 1
7485static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7486    return(NULL);
7487}
7488static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7489}
7490
7491static int
7492test_xmlShell(void) {
7493    int test_ret = 0;
7494
7495
7496    /* missing type support */
7497    return(test_ret);
7498}
7499
7500
7501static int
7502test_xmlShellBase(void) {
7503    int test_ret = 0;
7504
7505#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7506    int mem_base;
7507    int ret_val;
7508    xmlShellCtxtPtr ctxt; /* the shell context */
7509    int n_ctxt;
7510    char * arg; /* unused */
7511    int n_arg;
7512    xmlNodePtr node; /* a node */
7513    int n_node;
7514    xmlNodePtr node2; /* unused */
7515    int n_node2;
7516
7517    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7518    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7519    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7520    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7521        mem_base = xmlMemBlocks();
7522        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7523        arg = gen_char_ptr(n_arg, 1);
7524        node = gen_xmlNodePtr(n_node, 2);
7525        node2 = gen_xmlNodePtr(n_node2, 3);
7526
7527        ret_val = xmlShellBase(ctxt, arg, node, node2);
7528        desret_int(ret_val);
7529        call_tests++;
7530        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7531        des_char_ptr(n_arg, arg, 1);
7532        des_xmlNodePtr(n_node, node, 2);
7533        des_xmlNodePtr(n_node2, node2, 3);
7534        xmlResetLastError();
7535        if (mem_base != xmlMemBlocks()) {
7536            printf("Leak of %d blocks found in xmlShellBase",
7537	           xmlMemBlocks() - mem_base);
7538	    test_ret++;
7539            printf(" %d", n_ctxt);
7540            printf(" %d", n_arg);
7541            printf(" %d", n_node);
7542            printf(" %d", n_node2);
7543            printf("\n");
7544        }
7545    }
7546    }
7547    }
7548    }
7549    function_tests++;
7550#endif
7551
7552    return(test_ret);
7553}
7554
7555
7556static int
7557test_xmlShellCat(void) {
7558    int test_ret = 0;
7559
7560#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7561    int mem_base;
7562    int ret_val;
7563    xmlShellCtxtPtr ctxt; /* the shell context */
7564    int n_ctxt;
7565    char * arg; /* unused */
7566    int n_arg;
7567    xmlNodePtr node; /* a node */
7568    int n_node;
7569    xmlNodePtr node2; /* unused */
7570    int n_node2;
7571
7572    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7573    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7574    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7575    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7576        mem_base = xmlMemBlocks();
7577        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7578        arg = gen_char_ptr(n_arg, 1);
7579        node = gen_xmlNodePtr(n_node, 2);
7580        node2 = gen_xmlNodePtr(n_node2, 3);
7581
7582        ret_val = xmlShellCat(ctxt, arg, node, node2);
7583        desret_int(ret_val);
7584        call_tests++;
7585        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7586        des_char_ptr(n_arg, arg, 1);
7587        des_xmlNodePtr(n_node, node, 2);
7588        des_xmlNodePtr(n_node2, node2, 3);
7589        xmlResetLastError();
7590        if (mem_base != xmlMemBlocks()) {
7591            printf("Leak of %d blocks found in xmlShellCat",
7592	           xmlMemBlocks() - mem_base);
7593	    test_ret++;
7594            printf(" %d", n_ctxt);
7595            printf(" %d", n_arg);
7596            printf(" %d", n_node);
7597            printf(" %d", n_node2);
7598            printf("\n");
7599        }
7600    }
7601    }
7602    }
7603    }
7604    function_tests++;
7605#endif
7606
7607    return(test_ret);
7608}
7609
7610
7611static int
7612test_xmlShellDir(void) {
7613    int test_ret = 0;
7614
7615#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7616    int mem_base;
7617    int ret_val;
7618    xmlShellCtxtPtr ctxt; /* the shell context */
7619    int n_ctxt;
7620    char * arg; /* unused */
7621    int n_arg;
7622    xmlNodePtr node; /* a node */
7623    int n_node;
7624    xmlNodePtr node2; /* unused */
7625    int n_node2;
7626
7627    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7628    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7629    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7630    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7631        mem_base = xmlMemBlocks();
7632        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7633        arg = gen_char_ptr(n_arg, 1);
7634        node = gen_xmlNodePtr(n_node, 2);
7635        node2 = gen_xmlNodePtr(n_node2, 3);
7636
7637        ret_val = xmlShellDir(ctxt, arg, node, node2);
7638        desret_int(ret_val);
7639        call_tests++;
7640        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7641        des_char_ptr(n_arg, arg, 1);
7642        des_xmlNodePtr(n_node, node, 2);
7643        des_xmlNodePtr(n_node2, node2, 3);
7644        xmlResetLastError();
7645        if (mem_base != xmlMemBlocks()) {
7646            printf("Leak of %d blocks found in xmlShellDir",
7647	           xmlMemBlocks() - mem_base);
7648	    test_ret++;
7649            printf(" %d", n_ctxt);
7650            printf(" %d", n_arg);
7651            printf(" %d", n_node);
7652            printf(" %d", n_node2);
7653            printf("\n");
7654        }
7655    }
7656    }
7657    }
7658    }
7659    function_tests++;
7660#endif
7661
7662    return(test_ret);
7663}
7664
7665
7666static int
7667test_xmlShellDu(void) {
7668    int test_ret = 0;
7669
7670#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7671    int mem_base;
7672    int ret_val;
7673    xmlShellCtxtPtr ctxt; /* the shell context */
7674    int n_ctxt;
7675    char * arg; /* unused */
7676    int n_arg;
7677    xmlNodePtr tree; /* a node defining a subtree */
7678    int n_tree;
7679    xmlNodePtr node2; /* unused */
7680    int n_node2;
7681
7682    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7683    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7684    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7685    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7686        mem_base = xmlMemBlocks();
7687        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7688        arg = gen_char_ptr(n_arg, 1);
7689        tree = gen_xmlNodePtr(n_tree, 2);
7690        node2 = gen_xmlNodePtr(n_node2, 3);
7691
7692        ret_val = xmlShellDu(ctxt, arg, tree, node2);
7693        desret_int(ret_val);
7694        call_tests++;
7695        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7696        des_char_ptr(n_arg, arg, 1);
7697        des_xmlNodePtr(n_tree, tree, 2);
7698        des_xmlNodePtr(n_node2, node2, 3);
7699        xmlResetLastError();
7700        if (mem_base != xmlMemBlocks()) {
7701            printf("Leak of %d blocks found in xmlShellDu",
7702	           xmlMemBlocks() - mem_base);
7703	    test_ret++;
7704            printf(" %d", n_ctxt);
7705            printf(" %d", n_arg);
7706            printf(" %d", n_tree);
7707            printf(" %d", n_node2);
7708            printf("\n");
7709        }
7710    }
7711    }
7712    }
7713    }
7714    function_tests++;
7715#endif
7716
7717    return(test_ret);
7718}
7719
7720
7721static int
7722test_xmlShellList(void) {
7723    int test_ret = 0;
7724
7725#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7726    int mem_base;
7727    int ret_val;
7728    xmlShellCtxtPtr ctxt; /* the shell context */
7729    int n_ctxt;
7730    char * arg; /* unused */
7731    int n_arg;
7732    xmlNodePtr node; /* a node */
7733    int n_node;
7734    xmlNodePtr node2; /* unused */
7735    int n_node2;
7736
7737    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7738    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7739    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7740    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7741        mem_base = xmlMemBlocks();
7742        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7743        arg = gen_char_ptr(n_arg, 1);
7744        node = gen_xmlNodePtr(n_node, 2);
7745        node2 = gen_xmlNodePtr(n_node2, 3);
7746
7747        ret_val = xmlShellList(ctxt, arg, node, node2);
7748        desret_int(ret_val);
7749        call_tests++;
7750        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7751        des_char_ptr(n_arg, arg, 1);
7752        des_xmlNodePtr(n_node, node, 2);
7753        des_xmlNodePtr(n_node2, node2, 3);
7754        xmlResetLastError();
7755        if (mem_base != xmlMemBlocks()) {
7756            printf("Leak of %d blocks found in xmlShellList",
7757	           xmlMemBlocks() - mem_base);
7758	    test_ret++;
7759            printf(" %d", n_ctxt);
7760            printf(" %d", n_arg);
7761            printf(" %d", n_node);
7762            printf(" %d", n_node2);
7763            printf("\n");
7764        }
7765    }
7766    }
7767    }
7768    }
7769    function_tests++;
7770#endif
7771
7772    return(test_ret);
7773}
7774
7775
7776static int
7777test_xmlShellLoad(void) {
7778    int test_ret = 0;
7779
7780#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7781    int mem_base;
7782    int ret_val;
7783    xmlShellCtxtPtr ctxt; /* the shell context */
7784    int n_ctxt;
7785    char * filename; /* the file name */
7786    int n_filename;
7787    xmlNodePtr node; /* unused */
7788    int n_node;
7789    xmlNodePtr node2; /* unused */
7790    int n_node2;
7791
7792    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7793    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7794    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7795    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7796        mem_base = xmlMemBlocks();
7797        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7798        filename = gen_char_ptr(n_filename, 1);
7799        node = gen_xmlNodePtr(n_node, 2);
7800        node2 = gen_xmlNodePtr(n_node2, 3);
7801
7802        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7803        desret_int(ret_val);
7804        call_tests++;
7805        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7806        des_char_ptr(n_filename, filename, 1);
7807        des_xmlNodePtr(n_node, node, 2);
7808        des_xmlNodePtr(n_node2, node2, 3);
7809        xmlResetLastError();
7810        if (mem_base != xmlMemBlocks()) {
7811            printf("Leak of %d blocks found in xmlShellLoad",
7812	           xmlMemBlocks() - mem_base);
7813	    test_ret++;
7814            printf(" %d", n_ctxt);
7815            printf(" %d", n_filename);
7816            printf(" %d", n_node);
7817            printf(" %d", n_node2);
7818            printf("\n");
7819        }
7820    }
7821    }
7822    }
7823    }
7824    function_tests++;
7825#endif
7826
7827    return(test_ret);
7828}
7829
7830
7831static int
7832test_xmlShellPrintXPathResult(void) {
7833    int test_ret = 0;
7834
7835#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7836    int mem_base;
7837    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7838    int n_list;
7839
7840    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7841        mem_base = xmlMemBlocks();
7842        list = gen_xmlXPathObjectPtr(n_list, 0);
7843
7844        xmlShellPrintXPathResult(list);
7845        call_tests++;
7846        des_xmlXPathObjectPtr(n_list, list, 0);
7847        xmlResetLastError();
7848        if (mem_base != xmlMemBlocks()) {
7849            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7850	           xmlMemBlocks() - mem_base);
7851	    test_ret++;
7852            printf(" %d", n_list);
7853            printf("\n");
7854        }
7855    }
7856    function_tests++;
7857#endif
7858
7859    return(test_ret);
7860}
7861
7862
7863static int
7864test_xmlShellPwd(void) {
7865    int test_ret = 0;
7866
7867#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7868    int mem_base;
7869    int ret_val;
7870    xmlShellCtxtPtr ctxt; /* the shell context */
7871    int n_ctxt;
7872    char * buffer; /* the output buffer */
7873    int n_buffer;
7874    xmlNodePtr node; /* a node */
7875    int n_node;
7876    xmlNodePtr node2; /* unused */
7877    int n_node2;
7878
7879    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7880    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7881    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7882    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7883        mem_base = xmlMemBlocks();
7884        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7885        buffer = gen_char_ptr(n_buffer, 1);
7886        node = gen_xmlNodePtr(n_node, 2);
7887        node2 = gen_xmlNodePtr(n_node2, 3);
7888
7889        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7890        desret_int(ret_val);
7891        call_tests++;
7892        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7893        des_char_ptr(n_buffer, buffer, 1);
7894        des_xmlNodePtr(n_node, node, 2);
7895        des_xmlNodePtr(n_node2, node2, 3);
7896        xmlResetLastError();
7897        if (mem_base != xmlMemBlocks()) {
7898            printf("Leak of %d blocks found in xmlShellPwd",
7899	           xmlMemBlocks() - mem_base);
7900	    test_ret++;
7901            printf(" %d", n_ctxt);
7902            printf(" %d", n_buffer);
7903            printf(" %d", n_node);
7904            printf(" %d", n_node2);
7905            printf("\n");
7906        }
7907    }
7908    }
7909    }
7910    }
7911    function_tests++;
7912#endif
7913
7914    return(test_ret);
7915}
7916
7917
7918static int
7919test_xmlShellSave(void) {
7920    int test_ret = 0;
7921
7922#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7923    int mem_base;
7924    int ret_val;
7925    xmlShellCtxtPtr ctxt; /* the shell context */
7926    int n_ctxt;
7927    char * filename; /* the file name (optional) */
7928    int n_filename;
7929    xmlNodePtr node; /* unused */
7930    int n_node;
7931    xmlNodePtr node2; /* unused */
7932    int n_node2;
7933
7934    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7935    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7936    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7937    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7938        mem_base = xmlMemBlocks();
7939        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7940        filename = gen_char_ptr(n_filename, 1);
7941        node = gen_xmlNodePtr(n_node, 2);
7942        node2 = gen_xmlNodePtr(n_node2, 3);
7943
7944        ret_val = xmlShellSave(ctxt, filename, node, node2);
7945        desret_int(ret_val);
7946        call_tests++;
7947        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7948        des_char_ptr(n_filename, filename, 1);
7949        des_xmlNodePtr(n_node, node, 2);
7950        des_xmlNodePtr(n_node2, node2, 3);
7951        xmlResetLastError();
7952        if (mem_base != xmlMemBlocks()) {
7953            printf("Leak of %d blocks found in xmlShellSave",
7954	           xmlMemBlocks() - mem_base);
7955	    test_ret++;
7956            printf(" %d", n_ctxt);
7957            printf(" %d", n_filename);
7958            printf(" %d", n_node);
7959            printf(" %d", n_node2);
7960            printf("\n");
7961        }
7962    }
7963    }
7964    }
7965    }
7966    function_tests++;
7967#endif
7968
7969    return(test_ret);
7970}
7971
7972
7973static int
7974test_xmlShellValidate(void) {
7975    int test_ret = 0;
7976
7977#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7978    int mem_base;
7979    int ret_val;
7980    xmlShellCtxtPtr ctxt; /* the shell context */
7981    int n_ctxt;
7982    char * dtd; /* the DTD URI (optional) */
7983    int n_dtd;
7984    xmlNodePtr node; /* unused */
7985    int n_node;
7986    xmlNodePtr node2; /* unused */
7987    int n_node2;
7988
7989    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7990    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7991    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7992    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7993        mem_base = xmlMemBlocks();
7994        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7995        dtd = gen_char_ptr(n_dtd, 1);
7996        node = gen_xmlNodePtr(n_node, 2);
7997        node2 = gen_xmlNodePtr(n_node2, 3);
7998
7999        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8000        desret_int(ret_val);
8001        call_tests++;
8002        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8003        des_char_ptr(n_dtd, dtd, 1);
8004        des_xmlNodePtr(n_node, node, 2);
8005        des_xmlNodePtr(n_node2, node2, 3);
8006        xmlResetLastError();
8007        if (mem_base != xmlMemBlocks()) {
8008            printf("Leak of %d blocks found in xmlShellValidate",
8009	           xmlMemBlocks() - mem_base);
8010	    test_ret++;
8011            printf(" %d", n_ctxt);
8012            printf(" %d", n_dtd);
8013            printf(" %d", n_node);
8014            printf(" %d", n_node2);
8015            printf("\n");
8016        }
8017    }
8018    }
8019    }
8020    }
8021    function_tests++;
8022#endif
8023
8024    return(test_ret);
8025}
8026
8027
8028static int
8029test_xmlShellWrite(void) {
8030    int test_ret = 0;
8031
8032#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8033    int mem_base;
8034    int ret_val;
8035    xmlShellCtxtPtr ctxt; /* the shell context */
8036    int n_ctxt;
8037    char * filename; /* the file name */
8038    int n_filename;
8039    xmlNodePtr node; /* a node in the tree */
8040    int n_node;
8041    xmlNodePtr node2; /* unused */
8042    int n_node2;
8043
8044    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8045    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8046    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8047    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8048        mem_base = xmlMemBlocks();
8049        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8050        filename = gen_char_ptr(n_filename, 1);
8051        node = gen_xmlNodePtr(n_node, 2);
8052        node2 = gen_xmlNodePtr(n_node2, 3);
8053
8054        ret_val = xmlShellWrite(ctxt, filename, node, node2);
8055        desret_int(ret_val);
8056        call_tests++;
8057        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8058        des_char_ptr(n_filename, filename, 1);
8059        des_xmlNodePtr(n_node, node, 2);
8060        des_xmlNodePtr(n_node2, node2, 3);
8061        xmlResetLastError();
8062        if (mem_base != xmlMemBlocks()) {
8063            printf("Leak of %d blocks found in xmlShellWrite",
8064	           xmlMemBlocks() - mem_base);
8065	    test_ret++;
8066            printf(" %d", n_ctxt);
8067            printf(" %d", n_filename);
8068            printf(" %d", n_node);
8069            printf(" %d", n_node2);
8070            printf("\n");
8071        }
8072    }
8073    }
8074    }
8075    }
8076    function_tests++;
8077#endif
8078
8079    return(test_ret);
8080}
8081
8082static int
8083test_debugXML(void) {
8084    int test_ret = 0;
8085
8086    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8087    test_ret += test_xmlBoolToText();
8088    test_ret += test_xmlDebugCheckDocument();
8089    test_ret += test_xmlDebugDumpAttr();
8090    test_ret += test_xmlDebugDumpAttrList();
8091    test_ret += test_xmlDebugDumpDTD();
8092    test_ret += test_xmlDebugDumpDocument();
8093    test_ret += test_xmlDebugDumpDocumentHead();
8094    test_ret += test_xmlDebugDumpEntities();
8095    test_ret += test_xmlDebugDumpNode();
8096    test_ret += test_xmlDebugDumpNodeList();
8097    test_ret += test_xmlDebugDumpOneNode();
8098    test_ret += test_xmlDebugDumpString();
8099    test_ret += test_xmlLsCountNode();
8100    test_ret += test_xmlLsOneNode();
8101    test_ret += test_xmlShell();
8102    test_ret += test_xmlShellBase();
8103    test_ret += test_xmlShellCat();
8104    test_ret += test_xmlShellDir();
8105    test_ret += test_xmlShellDu();
8106    test_ret += test_xmlShellList();
8107    test_ret += test_xmlShellLoad();
8108    test_ret += test_xmlShellPrintXPathResult();
8109    test_ret += test_xmlShellPwd();
8110    test_ret += test_xmlShellSave();
8111    test_ret += test_xmlShellValidate();
8112    test_ret += test_xmlShellWrite();
8113
8114    if (test_ret != 0)
8115	printf("Module debugXML: %d errors\n", test_ret);
8116    return(test_ret);
8117}
8118
8119static int
8120test_xmlDictCleanup(void) {
8121    int test_ret = 0;
8122
8123    int mem_base;
8124
8125        mem_base = xmlMemBlocks();
8126
8127        xmlDictCleanup();
8128        call_tests++;
8129        xmlResetLastError();
8130        if (mem_base != xmlMemBlocks()) {
8131            printf("Leak of %d blocks found in xmlDictCleanup",
8132	           xmlMemBlocks() - mem_base);
8133	    test_ret++;
8134            printf("\n");
8135        }
8136    function_tests++;
8137
8138    return(test_ret);
8139}
8140
8141
8142static int
8143test_xmlDictCreate(void) {
8144    int test_ret = 0;
8145
8146    int mem_base;
8147    xmlDictPtr ret_val;
8148
8149        mem_base = xmlMemBlocks();
8150
8151        ret_val = xmlDictCreate();
8152        desret_xmlDictPtr(ret_val);
8153        call_tests++;
8154        xmlResetLastError();
8155        if (mem_base != xmlMemBlocks()) {
8156            printf("Leak of %d blocks found in xmlDictCreate",
8157	           xmlMemBlocks() - mem_base);
8158	    test_ret++;
8159            printf("\n");
8160        }
8161    function_tests++;
8162
8163    return(test_ret);
8164}
8165
8166
8167static int
8168test_xmlDictCreateSub(void) {
8169    int test_ret = 0;
8170
8171    int mem_base;
8172    xmlDictPtr ret_val;
8173    xmlDictPtr sub; /* an existing dictionnary */
8174    int n_sub;
8175
8176    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8177        mem_base = xmlMemBlocks();
8178        sub = gen_xmlDictPtr(n_sub, 0);
8179
8180        ret_val = xmlDictCreateSub(sub);
8181        desret_xmlDictPtr(ret_val);
8182        call_tests++;
8183        des_xmlDictPtr(n_sub, sub, 0);
8184        xmlResetLastError();
8185        if (mem_base != xmlMemBlocks()) {
8186            printf("Leak of %d blocks found in xmlDictCreateSub",
8187	           xmlMemBlocks() - mem_base);
8188	    test_ret++;
8189            printf(" %d", n_sub);
8190            printf("\n");
8191        }
8192    }
8193    function_tests++;
8194
8195    return(test_ret);
8196}
8197
8198
8199static int
8200test_xmlDictExists(void) {
8201    int test_ret = 0;
8202
8203    int mem_base;
8204    const xmlChar * ret_val;
8205    xmlDictPtr dict; /* the dictionnary */
8206    int n_dict;
8207    xmlChar * name; /* the name of the userdata */
8208    int n_name;
8209    int len; /* the length of the name, if -1 it is recomputed */
8210    int n_len;
8211
8212    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8213    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8214    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8215        mem_base = xmlMemBlocks();
8216        dict = gen_xmlDictPtr(n_dict, 0);
8217        name = gen_const_xmlChar_ptr(n_name, 1);
8218        len = gen_int(n_len, 2);
8219
8220        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8221        desret_const_xmlChar_ptr(ret_val);
8222        call_tests++;
8223        des_xmlDictPtr(n_dict, dict, 0);
8224        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8225        des_int(n_len, len, 2);
8226        xmlResetLastError();
8227        if (mem_base != xmlMemBlocks()) {
8228            printf("Leak of %d blocks found in xmlDictExists",
8229	           xmlMemBlocks() - mem_base);
8230	    test_ret++;
8231            printf(" %d", n_dict);
8232            printf(" %d", n_name);
8233            printf(" %d", n_len);
8234            printf("\n");
8235        }
8236    }
8237    }
8238    }
8239    function_tests++;
8240
8241    return(test_ret);
8242}
8243
8244
8245static int
8246test_xmlDictLookup(void) {
8247    int test_ret = 0;
8248
8249    int mem_base;
8250    const xmlChar * ret_val;
8251    xmlDictPtr dict; /* the dictionnary */
8252    int n_dict;
8253    xmlChar * name; /* the name of the userdata */
8254    int n_name;
8255    int len; /* the length of the name, if -1 it is recomputed */
8256    int n_len;
8257
8258    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8259    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8260    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8261        mem_base = xmlMemBlocks();
8262        dict = gen_xmlDictPtr(n_dict, 0);
8263        name = gen_const_xmlChar_ptr(n_name, 1);
8264        len = gen_int(n_len, 2);
8265
8266        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8267        desret_const_xmlChar_ptr(ret_val);
8268        call_tests++;
8269        des_xmlDictPtr(n_dict, dict, 0);
8270        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8271        des_int(n_len, len, 2);
8272        xmlResetLastError();
8273        if (mem_base != xmlMemBlocks()) {
8274            printf("Leak of %d blocks found in xmlDictLookup",
8275	           xmlMemBlocks() - mem_base);
8276	    test_ret++;
8277            printf(" %d", n_dict);
8278            printf(" %d", n_name);
8279            printf(" %d", n_len);
8280            printf("\n");
8281        }
8282    }
8283    }
8284    }
8285    function_tests++;
8286
8287    return(test_ret);
8288}
8289
8290
8291static int
8292test_xmlDictOwns(void) {
8293    int test_ret = 0;
8294
8295    int mem_base;
8296    int ret_val;
8297    xmlDictPtr dict; /* the dictionnary */
8298    int n_dict;
8299    xmlChar * str; /* the string */
8300    int n_str;
8301
8302    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8303    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8304        mem_base = xmlMemBlocks();
8305        dict = gen_xmlDictPtr(n_dict, 0);
8306        str = gen_const_xmlChar_ptr(n_str, 1);
8307
8308        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8309        desret_int(ret_val);
8310        call_tests++;
8311        des_xmlDictPtr(n_dict, dict, 0);
8312        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8313        xmlResetLastError();
8314        if (mem_base != xmlMemBlocks()) {
8315            printf("Leak of %d blocks found in xmlDictOwns",
8316	           xmlMemBlocks() - mem_base);
8317	    test_ret++;
8318            printf(" %d", n_dict);
8319            printf(" %d", n_str);
8320            printf("\n");
8321        }
8322    }
8323    }
8324    function_tests++;
8325
8326    return(test_ret);
8327}
8328
8329
8330static int
8331test_xmlDictQLookup(void) {
8332    int test_ret = 0;
8333
8334    int mem_base;
8335    const xmlChar * ret_val;
8336    xmlDictPtr dict; /* the dictionnary */
8337    int n_dict;
8338    xmlChar * prefix; /* the prefix */
8339    int n_prefix;
8340    xmlChar * name; /* the name */
8341    int n_name;
8342
8343    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8344    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8345    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8346        mem_base = xmlMemBlocks();
8347        dict = gen_xmlDictPtr(n_dict, 0);
8348        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8349        name = gen_const_xmlChar_ptr(n_name, 2);
8350
8351        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8352        desret_const_xmlChar_ptr(ret_val);
8353        call_tests++;
8354        des_xmlDictPtr(n_dict, dict, 0);
8355        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8356        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8357        xmlResetLastError();
8358        if (mem_base != xmlMemBlocks()) {
8359            printf("Leak of %d blocks found in xmlDictQLookup",
8360	           xmlMemBlocks() - mem_base);
8361	    test_ret++;
8362            printf(" %d", n_dict);
8363            printf(" %d", n_prefix);
8364            printf(" %d", n_name);
8365            printf("\n");
8366        }
8367    }
8368    }
8369    }
8370    function_tests++;
8371
8372    return(test_ret);
8373}
8374
8375
8376static int
8377test_xmlDictReference(void) {
8378    int test_ret = 0;
8379
8380    int mem_base;
8381    int ret_val;
8382    xmlDictPtr dict; /* the dictionnary */
8383    int n_dict;
8384
8385    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8386        mem_base = xmlMemBlocks();
8387        dict = gen_xmlDictPtr(n_dict, 0);
8388
8389        ret_val = xmlDictReference(dict);
8390        xmlDictFree(dict);
8391        desret_int(ret_val);
8392        call_tests++;
8393        des_xmlDictPtr(n_dict, dict, 0);
8394        xmlResetLastError();
8395        if (mem_base != xmlMemBlocks()) {
8396            printf("Leak of %d blocks found in xmlDictReference",
8397	           xmlMemBlocks() - mem_base);
8398	    test_ret++;
8399            printf(" %d", n_dict);
8400            printf("\n");
8401        }
8402    }
8403    function_tests++;
8404
8405    return(test_ret);
8406}
8407
8408
8409static int
8410test_xmlDictSize(void) {
8411    int test_ret = 0;
8412
8413    int mem_base;
8414    int ret_val;
8415    xmlDictPtr dict; /* the dictionnary */
8416    int n_dict;
8417
8418    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8419        mem_base = xmlMemBlocks();
8420        dict = gen_xmlDictPtr(n_dict, 0);
8421
8422        ret_val = xmlDictSize(dict);
8423        desret_int(ret_val);
8424        call_tests++;
8425        des_xmlDictPtr(n_dict, dict, 0);
8426        xmlResetLastError();
8427        if (mem_base != xmlMemBlocks()) {
8428            printf("Leak of %d blocks found in xmlDictSize",
8429	           xmlMemBlocks() - mem_base);
8430	    test_ret++;
8431            printf(" %d", n_dict);
8432            printf("\n");
8433        }
8434    }
8435    function_tests++;
8436
8437    return(test_ret);
8438}
8439
8440static int
8441test_dict(void) {
8442    int test_ret = 0;
8443
8444    if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8445    test_ret += test_xmlDictCleanup();
8446    test_ret += test_xmlDictCreate();
8447    test_ret += test_xmlDictCreateSub();
8448    test_ret += test_xmlDictExists();
8449    test_ret += test_xmlDictLookup();
8450    test_ret += test_xmlDictOwns();
8451    test_ret += test_xmlDictQLookup();
8452    test_ret += test_xmlDictReference();
8453    test_ret += test_xmlDictSize();
8454
8455    if (test_ret != 0)
8456	printf("Module dict: %d errors\n", test_ret);
8457    return(test_ret);
8458}
8459
8460static int
8461test_UTF8Toisolat1(void) {
8462    int test_ret = 0;
8463
8464#if defined(LIBXML_OUTPUT_ENABLED)
8465#ifdef LIBXML_OUTPUT_ENABLED
8466    int mem_base;
8467    int ret_val;
8468    unsigned char * out; /* a pointer to an array of bytes to store the result */
8469    int n_out;
8470    int * outlen; /* the length of @out */
8471    int n_outlen;
8472    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8473    int n_in;
8474    int * inlen; /* the length of @in */
8475    int n_inlen;
8476
8477    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8478    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8479    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8480    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8481        mem_base = xmlMemBlocks();
8482        out = gen_unsigned_char_ptr(n_out, 0);
8483        outlen = gen_int_ptr(n_outlen, 1);
8484        in = gen_const_unsigned_char_ptr(n_in, 2);
8485        inlen = gen_int_ptr(n_inlen, 3);
8486
8487        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8488        desret_int(ret_val);
8489        call_tests++;
8490        des_unsigned_char_ptr(n_out, out, 0);
8491        des_int_ptr(n_outlen, outlen, 1);
8492        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8493        des_int_ptr(n_inlen, inlen, 3);
8494        xmlResetLastError();
8495        if (mem_base != xmlMemBlocks()) {
8496            printf("Leak of %d blocks found in UTF8Toisolat1",
8497	           xmlMemBlocks() - mem_base);
8498	    test_ret++;
8499            printf(" %d", n_out);
8500            printf(" %d", n_outlen);
8501            printf(" %d", n_in);
8502            printf(" %d", n_inlen);
8503            printf("\n");
8504        }
8505    }
8506    }
8507    }
8508    }
8509    function_tests++;
8510#endif
8511#endif
8512
8513    return(test_ret);
8514}
8515
8516
8517static int
8518test_isolat1ToUTF8(void) {
8519    int test_ret = 0;
8520
8521    int mem_base;
8522    int ret_val;
8523    unsigned char * out; /* a pointer to an array of bytes to store the result */
8524    int n_out;
8525    int * outlen; /* the length of @out */
8526    int n_outlen;
8527    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8528    int n_in;
8529    int * inlen; /* the length of @in */
8530    int n_inlen;
8531
8532    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8533    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8534    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8535    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8536        mem_base = xmlMemBlocks();
8537        out = gen_unsigned_char_ptr(n_out, 0);
8538        outlen = gen_int_ptr(n_outlen, 1);
8539        in = gen_const_unsigned_char_ptr(n_in, 2);
8540        inlen = gen_int_ptr(n_inlen, 3);
8541
8542        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8543        desret_int(ret_val);
8544        call_tests++;
8545        des_unsigned_char_ptr(n_out, out, 0);
8546        des_int_ptr(n_outlen, outlen, 1);
8547        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8548        des_int_ptr(n_inlen, inlen, 3);
8549        xmlResetLastError();
8550        if (mem_base != xmlMemBlocks()) {
8551            printf("Leak of %d blocks found in isolat1ToUTF8",
8552	           xmlMemBlocks() - mem_base);
8553	    test_ret++;
8554            printf(" %d", n_out);
8555            printf(" %d", n_outlen);
8556            printf(" %d", n_in);
8557            printf(" %d", n_inlen);
8558            printf("\n");
8559        }
8560    }
8561    }
8562    }
8563    }
8564    function_tests++;
8565
8566    return(test_ret);
8567}
8568
8569
8570static int
8571test_xmlAddEncodingAlias(void) {
8572    int test_ret = 0;
8573
8574    int ret_val;
8575    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8576    int n_name;
8577    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8578    int n_alias;
8579
8580    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8581    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8582        name = gen_const_char_ptr(n_name, 0);
8583        alias = gen_const_char_ptr(n_alias, 1);
8584
8585        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8586        desret_int(ret_val);
8587        call_tests++;
8588        des_const_char_ptr(n_name, (const char *)name, 0);
8589        des_const_char_ptr(n_alias, (const char *)alias, 1);
8590        xmlResetLastError();
8591    }
8592    }
8593    function_tests++;
8594
8595    return(test_ret);
8596}
8597
8598
8599#define gen_nb_xmlCharEncodingHandler_ptr 1
8600static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8601    return(NULL);
8602}
8603static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8604}
8605
8606static int
8607test_xmlCharEncCloseFunc(void) {
8608    int test_ret = 0;
8609
8610    int mem_base;
8611    int ret_val;
8612    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8613    int n_handler;
8614
8615    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8616        mem_base = xmlMemBlocks();
8617        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8618
8619        ret_val = xmlCharEncCloseFunc(handler);
8620        desret_int(ret_val);
8621        call_tests++;
8622        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8623        xmlResetLastError();
8624        if (mem_base != xmlMemBlocks()) {
8625            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8626	           xmlMemBlocks() - mem_base);
8627	    test_ret++;
8628            printf(" %d", n_handler);
8629            printf("\n");
8630        }
8631    }
8632    function_tests++;
8633
8634    return(test_ret);
8635}
8636
8637
8638static int
8639test_xmlCharEncFirstLine(void) {
8640    int test_ret = 0;
8641
8642    int mem_base;
8643    int ret_val;
8644    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8645    int n_handler;
8646    xmlBufferPtr out; /* an xmlBuffer for the output. */
8647    int n_out;
8648    xmlBufferPtr in; /* an xmlBuffer for the input */
8649    int n_in;
8650
8651    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8652    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8653    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8654        mem_base = xmlMemBlocks();
8655        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8656        out = gen_xmlBufferPtr(n_out, 1);
8657        in = gen_xmlBufferPtr(n_in, 2);
8658
8659        ret_val = xmlCharEncFirstLine(handler, out, in);
8660        desret_int(ret_val);
8661        call_tests++;
8662        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8663        des_xmlBufferPtr(n_out, out, 1);
8664        des_xmlBufferPtr(n_in, in, 2);
8665        xmlResetLastError();
8666        if (mem_base != xmlMemBlocks()) {
8667            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8668	           xmlMemBlocks() - mem_base);
8669	    test_ret++;
8670            printf(" %d", n_handler);
8671            printf(" %d", n_out);
8672            printf(" %d", n_in);
8673            printf("\n");
8674        }
8675    }
8676    }
8677    }
8678    function_tests++;
8679
8680    return(test_ret);
8681}
8682
8683
8684static int
8685test_xmlCharEncInFunc(void) {
8686    int test_ret = 0;
8687
8688    int mem_base;
8689    int ret_val;
8690    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8691    int n_handler;
8692    xmlBufferPtr out; /* an xmlBuffer for the output. */
8693    int n_out;
8694    xmlBufferPtr in; /* an xmlBuffer for the input */
8695    int n_in;
8696
8697    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8698    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8699    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8700        mem_base = xmlMemBlocks();
8701        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8702        out = gen_xmlBufferPtr(n_out, 1);
8703        in = gen_xmlBufferPtr(n_in, 2);
8704
8705        ret_val = xmlCharEncInFunc(handler, out, in);
8706        desret_int(ret_val);
8707        call_tests++;
8708        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8709        des_xmlBufferPtr(n_out, out, 1);
8710        des_xmlBufferPtr(n_in, in, 2);
8711        xmlResetLastError();
8712        if (mem_base != xmlMemBlocks()) {
8713            printf("Leak of %d blocks found in xmlCharEncInFunc",
8714	           xmlMemBlocks() - mem_base);
8715	    test_ret++;
8716            printf(" %d", n_handler);
8717            printf(" %d", n_out);
8718            printf(" %d", n_in);
8719            printf("\n");
8720        }
8721    }
8722    }
8723    }
8724    function_tests++;
8725
8726    return(test_ret);
8727}
8728
8729
8730static int
8731test_xmlCharEncOutFunc(void) {
8732    int test_ret = 0;
8733
8734    int mem_base;
8735    int ret_val;
8736    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8737    int n_handler;
8738    xmlBufferPtr out; /* an xmlBuffer for the output. */
8739    int n_out;
8740    xmlBufferPtr in; /* an xmlBuffer for the input */
8741    int n_in;
8742
8743    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8744    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8745    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8746        mem_base = xmlMemBlocks();
8747        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8748        out = gen_xmlBufferPtr(n_out, 1);
8749        in = gen_xmlBufferPtr(n_in, 2);
8750
8751        ret_val = xmlCharEncOutFunc(handler, out, in);
8752        desret_int(ret_val);
8753        call_tests++;
8754        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8755        des_xmlBufferPtr(n_out, out, 1);
8756        des_xmlBufferPtr(n_in, in, 2);
8757        xmlResetLastError();
8758        if (mem_base != xmlMemBlocks()) {
8759            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8760	           xmlMemBlocks() - mem_base);
8761	    test_ret++;
8762            printf(" %d", n_handler);
8763            printf(" %d", n_out);
8764            printf(" %d", n_in);
8765            printf("\n");
8766        }
8767    }
8768    }
8769    }
8770    function_tests++;
8771
8772    return(test_ret);
8773}
8774
8775
8776static int
8777test_xmlCleanupCharEncodingHandlers(void) {
8778    int test_ret = 0;
8779
8780
8781
8782        xmlCleanupCharEncodingHandlers();
8783        call_tests++;
8784        xmlResetLastError();
8785    function_tests++;
8786
8787    return(test_ret);
8788}
8789
8790
8791static int
8792test_xmlCleanupEncodingAliases(void) {
8793    int test_ret = 0;
8794
8795    int mem_base;
8796
8797        mem_base = xmlMemBlocks();
8798
8799        xmlCleanupEncodingAliases();
8800        call_tests++;
8801        xmlResetLastError();
8802        if (mem_base != xmlMemBlocks()) {
8803            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8804	           xmlMemBlocks() - mem_base);
8805	    test_ret++;
8806            printf("\n");
8807        }
8808    function_tests++;
8809
8810    return(test_ret);
8811}
8812
8813
8814static int
8815test_xmlDelEncodingAlias(void) {
8816    int test_ret = 0;
8817
8818    int mem_base;
8819    int ret_val;
8820    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8821    int n_alias;
8822
8823    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8824        mem_base = xmlMemBlocks();
8825        alias = gen_const_char_ptr(n_alias, 0);
8826
8827        ret_val = xmlDelEncodingAlias((const char *)alias);
8828        desret_int(ret_val);
8829        call_tests++;
8830        des_const_char_ptr(n_alias, (const char *)alias, 0);
8831        xmlResetLastError();
8832        if (mem_base != xmlMemBlocks()) {
8833            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8834	           xmlMemBlocks() - mem_base);
8835	    test_ret++;
8836            printf(" %d", n_alias);
8837            printf("\n");
8838        }
8839    }
8840    function_tests++;
8841
8842    return(test_ret);
8843}
8844
8845
8846static int
8847test_xmlDetectCharEncoding(void) {
8848    int test_ret = 0;
8849
8850    int mem_base;
8851    xmlCharEncoding ret_val;
8852    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). */
8853    int n_in;
8854    int len; /* pointer to the length of the buffer */
8855    int n_len;
8856
8857    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8858    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8859        mem_base = xmlMemBlocks();
8860        in = gen_const_unsigned_char_ptr(n_in, 0);
8861        len = gen_int(n_len, 1);
8862
8863        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8864        desret_xmlCharEncoding(ret_val);
8865        call_tests++;
8866        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8867        des_int(n_len, len, 1);
8868        xmlResetLastError();
8869        if (mem_base != xmlMemBlocks()) {
8870            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8871	           xmlMemBlocks() - mem_base);
8872	    test_ret++;
8873            printf(" %d", n_in);
8874            printf(" %d", n_len);
8875            printf("\n");
8876        }
8877    }
8878    }
8879    function_tests++;
8880
8881    return(test_ret);
8882}
8883
8884
8885static int
8886test_xmlFindCharEncodingHandler(void) {
8887    int test_ret = 0;
8888
8889
8890    /* missing type support */
8891    return(test_ret);
8892}
8893
8894
8895static int
8896test_xmlGetCharEncodingHandler(void) {
8897    int test_ret = 0;
8898
8899
8900    /* missing type support */
8901    return(test_ret);
8902}
8903
8904
8905static int
8906test_xmlGetCharEncodingName(void) {
8907    int test_ret = 0;
8908
8909    int mem_base;
8910    const char * ret_val;
8911    xmlCharEncoding enc; /* the encoding */
8912    int n_enc;
8913
8914    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8915        mem_base = xmlMemBlocks();
8916        enc = gen_xmlCharEncoding(n_enc, 0);
8917
8918        ret_val = xmlGetCharEncodingName(enc);
8919        desret_const_char_ptr(ret_val);
8920        call_tests++;
8921        des_xmlCharEncoding(n_enc, enc, 0);
8922        xmlResetLastError();
8923        if (mem_base != xmlMemBlocks()) {
8924            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8925	           xmlMemBlocks() - mem_base);
8926	    test_ret++;
8927            printf(" %d", n_enc);
8928            printf("\n");
8929        }
8930    }
8931    function_tests++;
8932
8933    return(test_ret);
8934}
8935
8936
8937static int
8938test_xmlGetEncodingAlias(void) {
8939    int test_ret = 0;
8940
8941    int mem_base;
8942    const char * ret_val;
8943    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8944    int n_alias;
8945
8946    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8947        mem_base = xmlMemBlocks();
8948        alias = gen_const_char_ptr(n_alias, 0);
8949
8950        ret_val = xmlGetEncodingAlias((const char *)alias);
8951        desret_const_char_ptr(ret_val);
8952        call_tests++;
8953        des_const_char_ptr(n_alias, (const char *)alias, 0);
8954        xmlResetLastError();
8955        if (mem_base != xmlMemBlocks()) {
8956            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8957	           xmlMemBlocks() - mem_base);
8958	    test_ret++;
8959            printf(" %d", n_alias);
8960            printf("\n");
8961        }
8962    }
8963    function_tests++;
8964
8965    return(test_ret);
8966}
8967
8968
8969static int
8970test_xmlInitCharEncodingHandlers(void) {
8971    int test_ret = 0;
8972
8973
8974
8975        xmlInitCharEncodingHandlers();
8976        call_tests++;
8977        xmlResetLastError();
8978    function_tests++;
8979
8980    return(test_ret);
8981}
8982
8983
8984static int
8985test_xmlNewCharEncodingHandler(void) {
8986    int test_ret = 0;
8987
8988
8989    /* missing type support */
8990    return(test_ret);
8991}
8992
8993
8994static int
8995test_xmlParseCharEncoding(void) {
8996    int test_ret = 0;
8997
8998    int mem_base;
8999    xmlCharEncoding ret_val;
9000    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9001    int n_name;
9002
9003    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9004        mem_base = xmlMemBlocks();
9005        name = gen_const_char_ptr(n_name, 0);
9006
9007        ret_val = xmlParseCharEncoding((const char *)name);
9008        desret_xmlCharEncoding(ret_val);
9009        call_tests++;
9010        des_const_char_ptr(n_name, (const char *)name, 0);
9011        xmlResetLastError();
9012        if (mem_base != xmlMemBlocks()) {
9013            printf("Leak of %d blocks found in xmlParseCharEncoding",
9014	           xmlMemBlocks() - mem_base);
9015	    test_ret++;
9016            printf(" %d", n_name);
9017            printf("\n");
9018        }
9019    }
9020    function_tests++;
9021
9022    return(test_ret);
9023}
9024
9025
9026#define gen_nb_xmlCharEncodingHandlerPtr 1
9027static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9028    return(NULL);
9029}
9030static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9031}
9032
9033static int
9034test_xmlRegisterCharEncodingHandler(void) {
9035    int test_ret = 0;
9036
9037    int mem_base;
9038    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9039    int n_handler;
9040
9041    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9042        mem_base = xmlMemBlocks();
9043        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9044
9045        xmlRegisterCharEncodingHandler(handler);
9046        call_tests++;
9047        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9048        xmlResetLastError();
9049        if (mem_base != xmlMemBlocks()) {
9050            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9051	           xmlMemBlocks() - mem_base);
9052	    test_ret++;
9053            printf(" %d", n_handler);
9054            printf("\n");
9055        }
9056    }
9057    function_tests++;
9058
9059    return(test_ret);
9060}
9061
9062static int
9063test_encoding(void) {
9064    int test_ret = 0;
9065
9066    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9067    test_ret += test_UTF8Toisolat1();
9068    test_ret += test_isolat1ToUTF8();
9069    test_ret += test_xmlAddEncodingAlias();
9070    test_ret += test_xmlCharEncCloseFunc();
9071    test_ret += test_xmlCharEncFirstLine();
9072    test_ret += test_xmlCharEncInFunc();
9073    test_ret += test_xmlCharEncOutFunc();
9074    test_ret += test_xmlCleanupCharEncodingHandlers();
9075    test_ret += test_xmlCleanupEncodingAliases();
9076    test_ret += test_xmlDelEncodingAlias();
9077    test_ret += test_xmlDetectCharEncoding();
9078    test_ret += test_xmlFindCharEncodingHandler();
9079    test_ret += test_xmlGetCharEncodingHandler();
9080    test_ret += test_xmlGetCharEncodingName();
9081    test_ret += test_xmlGetEncodingAlias();
9082    test_ret += test_xmlInitCharEncodingHandlers();
9083    test_ret += test_xmlNewCharEncodingHandler();
9084    test_ret += test_xmlParseCharEncoding();
9085    test_ret += test_xmlRegisterCharEncodingHandler();
9086
9087    if (test_ret != 0)
9088	printf("Module encoding: %d errors\n", test_ret);
9089    return(test_ret);
9090}
9091
9092static int
9093test_xmlAddDocEntity(void) {
9094    int test_ret = 0;
9095
9096    int mem_base;
9097    xmlEntityPtr ret_val;
9098    xmlDocPtr doc; /* the document */
9099    int n_doc;
9100    xmlChar * name; /* the entity name */
9101    int n_name;
9102    int type; /* the entity type XML_xxx_yyy_ENTITY */
9103    int n_type;
9104    xmlChar * ExternalID; /* the entity external ID if available */
9105    int n_ExternalID;
9106    xmlChar * SystemID; /* the entity system ID if available */
9107    int n_SystemID;
9108    xmlChar * content; /* the entity content */
9109    int n_content;
9110
9111    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9112    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9113    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9114    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9115    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9116    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9117        mem_base = xmlMemBlocks();
9118        doc = gen_xmlDocPtr(n_doc, 0);
9119        name = gen_const_xmlChar_ptr(n_name, 1);
9120        type = gen_int(n_type, 2);
9121        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9122        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9123        content = gen_const_xmlChar_ptr(n_content, 5);
9124
9125        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9126        desret_xmlEntityPtr(ret_val);
9127        call_tests++;
9128        des_xmlDocPtr(n_doc, doc, 0);
9129        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9130        des_int(n_type, type, 2);
9131        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9132        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9133        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9134        xmlResetLastError();
9135        if (mem_base != xmlMemBlocks()) {
9136            printf("Leak of %d blocks found in xmlAddDocEntity",
9137	           xmlMemBlocks() - mem_base);
9138	    test_ret++;
9139            printf(" %d", n_doc);
9140            printf(" %d", n_name);
9141            printf(" %d", n_type);
9142            printf(" %d", n_ExternalID);
9143            printf(" %d", n_SystemID);
9144            printf(" %d", n_content);
9145            printf("\n");
9146        }
9147    }
9148    }
9149    }
9150    }
9151    }
9152    }
9153    function_tests++;
9154
9155    return(test_ret);
9156}
9157
9158
9159static int
9160test_xmlAddDtdEntity(void) {
9161    int test_ret = 0;
9162
9163    int mem_base;
9164    xmlEntityPtr ret_val;
9165    xmlDocPtr doc; /* the document */
9166    int n_doc;
9167    xmlChar * name; /* the entity name */
9168    int n_name;
9169    int type; /* the entity type XML_xxx_yyy_ENTITY */
9170    int n_type;
9171    xmlChar * ExternalID; /* the entity external ID if available */
9172    int n_ExternalID;
9173    xmlChar * SystemID; /* the entity system ID if available */
9174    int n_SystemID;
9175    xmlChar * content; /* the entity content */
9176    int n_content;
9177
9178    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9179    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9180    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9181    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9182    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9183    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9184        mem_base = xmlMemBlocks();
9185        doc = gen_xmlDocPtr(n_doc, 0);
9186        name = gen_const_xmlChar_ptr(n_name, 1);
9187        type = gen_int(n_type, 2);
9188        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9189        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9190        content = gen_const_xmlChar_ptr(n_content, 5);
9191
9192        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9193        desret_xmlEntityPtr(ret_val);
9194        call_tests++;
9195        des_xmlDocPtr(n_doc, doc, 0);
9196        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9197        des_int(n_type, type, 2);
9198        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9199        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9200        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9201        xmlResetLastError();
9202        if (mem_base != xmlMemBlocks()) {
9203            printf("Leak of %d blocks found in xmlAddDtdEntity",
9204	           xmlMemBlocks() - mem_base);
9205	    test_ret++;
9206            printf(" %d", n_doc);
9207            printf(" %d", n_name);
9208            printf(" %d", n_type);
9209            printf(" %d", n_ExternalID);
9210            printf(" %d", n_SystemID);
9211            printf(" %d", n_content);
9212            printf("\n");
9213        }
9214    }
9215    }
9216    }
9217    }
9218    }
9219    }
9220    function_tests++;
9221
9222    return(test_ret);
9223}
9224
9225
9226static int
9227test_xmlCleanupPredefinedEntities(void) {
9228    int test_ret = 0;
9229
9230#if defined(LIBXML_LEGACY_ENABLED)
9231#ifdef LIBXML_LEGACY_ENABLED
9232    int mem_base;
9233
9234        mem_base = xmlMemBlocks();
9235
9236        xmlCleanupPredefinedEntities();
9237        call_tests++;
9238        xmlResetLastError();
9239        if (mem_base != xmlMemBlocks()) {
9240            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9241	           xmlMemBlocks() - mem_base);
9242	    test_ret++;
9243            printf("\n");
9244        }
9245    function_tests++;
9246#endif
9247#endif
9248
9249    return(test_ret);
9250}
9251
9252
9253#define gen_nb_xmlEntitiesTablePtr 1
9254static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9255    return(NULL);
9256}
9257static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9258}
9259
9260static int
9261test_xmlCopyEntitiesTable(void) {
9262    int test_ret = 0;
9263
9264
9265    /* missing type support */
9266    return(test_ret);
9267}
9268
9269
9270static int
9271test_xmlCreateEntitiesTable(void) {
9272    int test_ret = 0;
9273
9274
9275    /* missing type support */
9276    return(test_ret);
9277}
9278
9279
9280static int
9281test_xmlDumpEntitiesTable(void) {
9282    int test_ret = 0;
9283
9284#if defined(LIBXML_OUTPUT_ENABLED)
9285    int mem_base;
9286    xmlBufferPtr buf; /* An XML buffer. */
9287    int n_buf;
9288    xmlEntitiesTablePtr table; /* An entity table */
9289    int n_table;
9290
9291    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9292    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9293        mem_base = xmlMemBlocks();
9294        buf = gen_xmlBufferPtr(n_buf, 0);
9295        table = gen_xmlEntitiesTablePtr(n_table, 1);
9296
9297        xmlDumpEntitiesTable(buf, table);
9298        call_tests++;
9299        des_xmlBufferPtr(n_buf, buf, 0);
9300        des_xmlEntitiesTablePtr(n_table, table, 1);
9301        xmlResetLastError();
9302        if (mem_base != xmlMemBlocks()) {
9303            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9304	           xmlMemBlocks() - mem_base);
9305	    test_ret++;
9306            printf(" %d", n_buf);
9307            printf(" %d", n_table);
9308            printf("\n");
9309        }
9310    }
9311    }
9312    function_tests++;
9313#endif
9314
9315    return(test_ret);
9316}
9317
9318
9319#define gen_nb_xmlEntityPtr 1
9320static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9321    return(NULL);
9322}
9323static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9324}
9325
9326static int
9327test_xmlDumpEntityDecl(void) {
9328    int test_ret = 0;
9329
9330#if defined(LIBXML_OUTPUT_ENABLED)
9331    int mem_base;
9332    xmlBufferPtr buf; /* An XML buffer. */
9333    int n_buf;
9334    xmlEntityPtr ent; /* An entity table */
9335    int n_ent;
9336
9337    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9338    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9339        mem_base = xmlMemBlocks();
9340        buf = gen_xmlBufferPtr(n_buf, 0);
9341        ent = gen_xmlEntityPtr(n_ent, 1);
9342
9343        xmlDumpEntityDecl(buf, ent);
9344        call_tests++;
9345        des_xmlBufferPtr(n_buf, buf, 0);
9346        des_xmlEntityPtr(n_ent, ent, 1);
9347        xmlResetLastError();
9348        if (mem_base != xmlMemBlocks()) {
9349            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9350	           xmlMemBlocks() - mem_base);
9351	    test_ret++;
9352            printf(" %d", n_buf);
9353            printf(" %d", n_ent);
9354            printf("\n");
9355        }
9356    }
9357    }
9358    function_tests++;
9359#endif
9360
9361    return(test_ret);
9362}
9363
9364
9365static int
9366test_xmlEncodeEntitiesReentrant(void) {
9367    int test_ret = 0;
9368
9369    int mem_base;
9370    xmlChar * ret_val;
9371    xmlDocPtr doc; /* the document containing the string */
9372    int n_doc;
9373    xmlChar * input; /* A string to convert to XML. */
9374    int n_input;
9375
9376    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9377    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9378        mem_base = xmlMemBlocks();
9379        doc = gen_xmlDocPtr(n_doc, 0);
9380        input = gen_const_xmlChar_ptr(n_input, 1);
9381
9382        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9383        desret_xmlChar_ptr(ret_val);
9384        call_tests++;
9385        des_xmlDocPtr(n_doc, doc, 0);
9386        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9387        xmlResetLastError();
9388        if (mem_base != xmlMemBlocks()) {
9389            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9390	           xmlMemBlocks() - mem_base);
9391	    test_ret++;
9392            printf(" %d", n_doc);
9393            printf(" %d", n_input);
9394            printf("\n");
9395        }
9396    }
9397    }
9398    function_tests++;
9399
9400    return(test_ret);
9401}
9402
9403
9404static int
9405test_xmlEncodeSpecialChars(void) {
9406    int test_ret = 0;
9407
9408    int mem_base;
9409    xmlChar * ret_val;
9410    xmlDocPtr doc; /* the document containing the string */
9411    int n_doc;
9412    xmlChar * input; /* A string to convert to XML. */
9413    int n_input;
9414
9415    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9416    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9417        mem_base = xmlMemBlocks();
9418        doc = gen_xmlDocPtr(n_doc, 0);
9419        input = gen_const_xmlChar_ptr(n_input, 1);
9420
9421        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9422        desret_xmlChar_ptr(ret_val);
9423        call_tests++;
9424        des_xmlDocPtr(n_doc, doc, 0);
9425        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9426        xmlResetLastError();
9427        if (mem_base != xmlMemBlocks()) {
9428            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9429	           xmlMemBlocks() - mem_base);
9430	    test_ret++;
9431            printf(" %d", n_doc);
9432            printf(" %d", n_input);
9433            printf("\n");
9434        }
9435    }
9436    }
9437    function_tests++;
9438
9439    return(test_ret);
9440}
9441
9442
9443static int
9444test_xmlGetDocEntity(void) {
9445    int test_ret = 0;
9446
9447    int mem_base;
9448    xmlEntityPtr ret_val;
9449    xmlDocPtr doc; /* the document referencing the entity */
9450    int n_doc;
9451    xmlChar * name; /* the entity name */
9452    int n_name;
9453
9454    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9455    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9456        mem_base = xmlMemBlocks();
9457        doc = gen_xmlDocPtr(n_doc, 0);
9458        name = gen_const_xmlChar_ptr(n_name, 1);
9459
9460        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9461        desret_xmlEntityPtr(ret_val);
9462        call_tests++;
9463        des_xmlDocPtr(n_doc, doc, 0);
9464        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9465        xmlResetLastError();
9466        if (mem_base != xmlMemBlocks()) {
9467            printf("Leak of %d blocks found in xmlGetDocEntity",
9468	           xmlMemBlocks() - mem_base);
9469	    test_ret++;
9470            printf(" %d", n_doc);
9471            printf(" %d", n_name);
9472            printf("\n");
9473        }
9474    }
9475    }
9476    function_tests++;
9477
9478    return(test_ret);
9479}
9480
9481
9482static int
9483test_xmlGetDtdEntity(void) {
9484    int test_ret = 0;
9485
9486    int mem_base;
9487    xmlEntityPtr ret_val;
9488    xmlDocPtr doc; /* the document referencing the entity */
9489    int n_doc;
9490    xmlChar * name; /* the entity name */
9491    int n_name;
9492
9493    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9494    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9495        mem_base = xmlMemBlocks();
9496        doc = gen_xmlDocPtr(n_doc, 0);
9497        name = gen_const_xmlChar_ptr(n_name, 1);
9498
9499        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9500        desret_xmlEntityPtr(ret_val);
9501        call_tests++;
9502        des_xmlDocPtr(n_doc, doc, 0);
9503        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9504        xmlResetLastError();
9505        if (mem_base != xmlMemBlocks()) {
9506            printf("Leak of %d blocks found in xmlGetDtdEntity",
9507	           xmlMemBlocks() - mem_base);
9508	    test_ret++;
9509            printf(" %d", n_doc);
9510            printf(" %d", n_name);
9511            printf("\n");
9512        }
9513    }
9514    }
9515    function_tests++;
9516
9517    return(test_ret);
9518}
9519
9520
9521static int
9522test_xmlGetParameterEntity(void) {
9523    int test_ret = 0;
9524
9525    int mem_base;
9526    xmlEntityPtr ret_val;
9527    xmlDocPtr doc; /* the document referencing the entity */
9528    int n_doc;
9529    xmlChar * name; /* the entity name */
9530    int n_name;
9531
9532    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9533    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9534        mem_base = xmlMemBlocks();
9535        doc = gen_xmlDocPtr(n_doc, 0);
9536        name = gen_const_xmlChar_ptr(n_name, 1);
9537
9538        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9539        desret_xmlEntityPtr(ret_val);
9540        call_tests++;
9541        des_xmlDocPtr(n_doc, doc, 0);
9542        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9543        xmlResetLastError();
9544        if (mem_base != xmlMemBlocks()) {
9545            printf("Leak of %d blocks found in xmlGetParameterEntity",
9546	           xmlMemBlocks() - mem_base);
9547	    test_ret++;
9548            printf(" %d", n_doc);
9549            printf(" %d", n_name);
9550            printf("\n");
9551        }
9552    }
9553    }
9554    function_tests++;
9555
9556    return(test_ret);
9557}
9558
9559
9560static int
9561test_xmlGetPredefinedEntity(void) {
9562    int test_ret = 0;
9563
9564    int mem_base;
9565    xmlEntityPtr ret_val;
9566    xmlChar * name; /* the entity name */
9567    int n_name;
9568
9569    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9570        mem_base = xmlMemBlocks();
9571        name = gen_const_xmlChar_ptr(n_name, 0);
9572
9573        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9574        desret_xmlEntityPtr(ret_val);
9575        call_tests++;
9576        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9577        xmlResetLastError();
9578        if (mem_base != xmlMemBlocks()) {
9579            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9580	           xmlMemBlocks() - mem_base);
9581	    test_ret++;
9582            printf(" %d", n_name);
9583            printf("\n");
9584        }
9585    }
9586    function_tests++;
9587
9588    return(test_ret);
9589}
9590
9591
9592static int
9593test_xmlInitializePredefinedEntities(void) {
9594    int test_ret = 0;
9595
9596#if defined(LIBXML_LEGACY_ENABLED)
9597#ifdef LIBXML_LEGACY_ENABLED
9598    int mem_base;
9599
9600        mem_base = xmlMemBlocks();
9601
9602        xmlInitializePredefinedEntities();
9603        call_tests++;
9604        xmlResetLastError();
9605        if (mem_base != xmlMemBlocks()) {
9606            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9607	           xmlMemBlocks() - mem_base);
9608	    test_ret++;
9609            printf("\n");
9610        }
9611    function_tests++;
9612#endif
9613#endif
9614
9615    return(test_ret);
9616}
9617
9618
9619static int
9620test_xmlNewEntity(void) {
9621    int test_ret = 0;
9622
9623    int mem_base;
9624    xmlEntityPtr ret_val;
9625    xmlDocPtr doc; /* the document */
9626    int n_doc;
9627    xmlChar * name; /* the entity name */
9628    int n_name;
9629    int type; /* the entity type XML_xxx_yyy_ENTITY */
9630    int n_type;
9631    xmlChar * ExternalID; /* the entity external ID if available */
9632    int n_ExternalID;
9633    xmlChar * SystemID; /* the entity system ID if available */
9634    int n_SystemID;
9635    xmlChar * content; /* the entity content */
9636    int n_content;
9637
9638    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9639    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9640    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9641    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9642    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9643    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9644        mem_base = xmlMemBlocks();
9645        doc = gen_xmlDocPtr(n_doc, 0);
9646        name = gen_const_xmlChar_ptr(n_name, 1);
9647        type = gen_int(n_type, 2);
9648        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9649        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9650        content = gen_const_xmlChar_ptr(n_content, 5);
9651
9652        ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9653        desret_xmlEntityPtr(ret_val);
9654        call_tests++;
9655        des_xmlDocPtr(n_doc, doc, 0);
9656        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9657        des_int(n_type, type, 2);
9658        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9659        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9660        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9661        xmlResetLastError();
9662        if (mem_base != xmlMemBlocks()) {
9663            printf("Leak of %d blocks found in xmlNewEntity",
9664	           xmlMemBlocks() - mem_base);
9665	    test_ret++;
9666            printf(" %d", n_doc);
9667            printf(" %d", n_name);
9668            printf(" %d", n_type);
9669            printf(" %d", n_ExternalID);
9670            printf(" %d", n_SystemID);
9671            printf(" %d", n_content);
9672            printf("\n");
9673        }
9674    }
9675    }
9676    }
9677    }
9678    }
9679    }
9680    function_tests++;
9681
9682    return(test_ret);
9683}
9684
9685static int
9686test_entities(void) {
9687    int test_ret = 0;
9688
9689    if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9690    test_ret += test_xmlAddDocEntity();
9691    test_ret += test_xmlAddDtdEntity();
9692    test_ret += test_xmlCleanupPredefinedEntities();
9693    test_ret += test_xmlCopyEntitiesTable();
9694    test_ret += test_xmlCreateEntitiesTable();
9695    test_ret += test_xmlDumpEntitiesTable();
9696    test_ret += test_xmlDumpEntityDecl();
9697    test_ret += test_xmlEncodeEntitiesReentrant();
9698    test_ret += test_xmlEncodeSpecialChars();
9699    test_ret += test_xmlGetDocEntity();
9700    test_ret += test_xmlGetDtdEntity();
9701    test_ret += test_xmlGetParameterEntity();
9702    test_ret += test_xmlGetPredefinedEntity();
9703    test_ret += test_xmlInitializePredefinedEntities();
9704    test_ret += test_xmlNewEntity();
9705
9706    if (test_ret != 0)
9707	printf("Module entities: %d errors\n", test_ret);
9708    return(test_ret);
9709}
9710
9711static int
9712test_xmlHashAddEntry(void) {
9713    int test_ret = 0;
9714
9715    int mem_base;
9716    int ret_val;
9717    xmlHashTablePtr table; /* the hash table */
9718    int n_table;
9719    xmlChar * name; /* the name of the userdata */
9720    int n_name;
9721    void * userdata; /* a pointer to the userdata */
9722    int n_userdata;
9723
9724    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9725    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9726    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9727        mem_base = xmlMemBlocks();
9728        table = gen_xmlHashTablePtr(n_table, 0);
9729        name = gen_const_xmlChar_ptr(n_name, 1);
9730        userdata = gen_userdata(n_userdata, 2);
9731
9732        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9733        desret_int(ret_val);
9734        call_tests++;
9735        des_xmlHashTablePtr(n_table, table, 0);
9736        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9737        des_userdata(n_userdata, userdata, 2);
9738        xmlResetLastError();
9739        if (mem_base != xmlMemBlocks()) {
9740            printf("Leak of %d blocks found in xmlHashAddEntry",
9741	           xmlMemBlocks() - mem_base);
9742	    test_ret++;
9743            printf(" %d", n_table);
9744            printf(" %d", n_name);
9745            printf(" %d", n_userdata);
9746            printf("\n");
9747        }
9748    }
9749    }
9750    }
9751    function_tests++;
9752
9753    return(test_ret);
9754}
9755
9756
9757static int
9758test_xmlHashAddEntry2(void) {
9759    int test_ret = 0;
9760
9761    int mem_base;
9762    int ret_val;
9763    xmlHashTablePtr table; /* the hash table */
9764    int n_table;
9765    xmlChar * name; /* the name of the userdata */
9766    int n_name;
9767    xmlChar * name2; /* a second name of the userdata */
9768    int n_name2;
9769    void * userdata; /* a pointer to the userdata */
9770    int n_userdata;
9771
9772    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9773    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9774    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9775    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9776        mem_base = xmlMemBlocks();
9777        table = gen_xmlHashTablePtr(n_table, 0);
9778        name = gen_const_xmlChar_ptr(n_name, 1);
9779        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9780        userdata = gen_userdata(n_userdata, 3);
9781
9782        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9783        desret_int(ret_val);
9784        call_tests++;
9785        des_xmlHashTablePtr(n_table, table, 0);
9786        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9787        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9788        des_userdata(n_userdata, userdata, 3);
9789        xmlResetLastError();
9790        if (mem_base != xmlMemBlocks()) {
9791            printf("Leak of %d blocks found in xmlHashAddEntry2",
9792	           xmlMemBlocks() - mem_base);
9793	    test_ret++;
9794            printf(" %d", n_table);
9795            printf(" %d", n_name);
9796            printf(" %d", n_name2);
9797            printf(" %d", n_userdata);
9798            printf("\n");
9799        }
9800    }
9801    }
9802    }
9803    }
9804    function_tests++;
9805
9806    return(test_ret);
9807}
9808
9809
9810static int
9811test_xmlHashAddEntry3(void) {
9812    int test_ret = 0;
9813
9814    int mem_base;
9815    int ret_val;
9816    xmlHashTablePtr table; /* the hash table */
9817    int n_table;
9818    xmlChar * name; /* the name of the userdata */
9819    int n_name;
9820    xmlChar * name2; /* a second name of the userdata */
9821    int n_name2;
9822    xmlChar * name3; /* a third name of the userdata */
9823    int n_name3;
9824    void * userdata; /* a pointer to the userdata */
9825    int n_userdata;
9826
9827    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9828    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9829    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9830    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9831    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9832        mem_base = xmlMemBlocks();
9833        table = gen_xmlHashTablePtr(n_table, 0);
9834        name = gen_const_xmlChar_ptr(n_name, 1);
9835        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9836        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9837        userdata = gen_userdata(n_userdata, 4);
9838
9839        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9840        desret_int(ret_val);
9841        call_tests++;
9842        des_xmlHashTablePtr(n_table, table, 0);
9843        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9844        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9845        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9846        des_userdata(n_userdata, userdata, 4);
9847        xmlResetLastError();
9848        if (mem_base != xmlMemBlocks()) {
9849            printf("Leak of %d blocks found in xmlHashAddEntry3",
9850	           xmlMemBlocks() - mem_base);
9851	    test_ret++;
9852            printf(" %d", n_table);
9853            printf(" %d", n_name);
9854            printf(" %d", n_name2);
9855            printf(" %d", n_name3);
9856            printf(" %d", n_userdata);
9857            printf("\n");
9858        }
9859    }
9860    }
9861    }
9862    }
9863    }
9864    function_tests++;
9865
9866    return(test_ret);
9867}
9868
9869
9870static int
9871test_xmlHashCopy(void) {
9872    int test_ret = 0;
9873
9874
9875    /* missing type support */
9876    return(test_ret);
9877}
9878
9879
9880static int
9881test_xmlHashCreate(void) {
9882    int test_ret = 0;
9883
9884
9885    /* missing type support */
9886    return(test_ret);
9887}
9888
9889
9890static int
9891test_xmlHashCreateDict(void) {
9892    int test_ret = 0;
9893
9894
9895    /* missing type support */
9896    return(test_ret);
9897}
9898
9899
9900static int
9901test_xmlHashLookup(void) {
9902    int test_ret = 0;
9903
9904    int mem_base;
9905    void * ret_val;
9906    xmlHashTablePtr table; /* the hash table */
9907    int n_table;
9908    xmlChar * name; /* the name of the userdata */
9909    int n_name;
9910
9911    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9912    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9913        mem_base = xmlMemBlocks();
9914        table = gen_xmlHashTablePtr(n_table, 0);
9915        name = gen_const_xmlChar_ptr(n_name, 1);
9916
9917        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9918        desret_void_ptr(ret_val);
9919        call_tests++;
9920        des_xmlHashTablePtr(n_table, table, 0);
9921        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9922        xmlResetLastError();
9923        if (mem_base != xmlMemBlocks()) {
9924            printf("Leak of %d blocks found in xmlHashLookup",
9925	           xmlMemBlocks() - mem_base);
9926	    test_ret++;
9927            printf(" %d", n_table);
9928            printf(" %d", n_name);
9929            printf("\n");
9930        }
9931    }
9932    }
9933    function_tests++;
9934
9935    return(test_ret);
9936}
9937
9938
9939static int
9940test_xmlHashLookup2(void) {
9941    int test_ret = 0;
9942
9943    int mem_base;
9944    void * ret_val;
9945    xmlHashTablePtr table; /* the hash table */
9946    int n_table;
9947    xmlChar * name; /* the name of the userdata */
9948    int n_name;
9949    xmlChar * name2; /* a second name of the userdata */
9950    int n_name2;
9951
9952    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9953    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9954    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9955        mem_base = xmlMemBlocks();
9956        table = gen_xmlHashTablePtr(n_table, 0);
9957        name = gen_const_xmlChar_ptr(n_name, 1);
9958        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9959
9960        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9961        desret_void_ptr(ret_val);
9962        call_tests++;
9963        des_xmlHashTablePtr(n_table, table, 0);
9964        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9965        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9966        xmlResetLastError();
9967        if (mem_base != xmlMemBlocks()) {
9968            printf("Leak of %d blocks found in xmlHashLookup2",
9969	           xmlMemBlocks() - mem_base);
9970	    test_ret++;
9971            printf(" %d", n_table);
9972            printf(" %d", n_name);
9973            printf(" %d", n_name2);
9974            printf("\n");
9975        }
9976    }
9977    }
9978    }
9979    function_tests++;
9980
9981    return(test_ret);
9982}
9983
9984
9985static int
9986test_xmlHashLookup3(void) {
9987    int test_ret = 0;
9988
9989    int mem_base;
9990    void * ret_val;
9991    xmlHashTablePtr table; /* the hash table */
9992    int n_table;
9993    xmlChar * name; /* the name of the userdata */
9994    int n_name;
9995    xmlChar * name2; /* a second name of the userdata */
9996    int n_name2;
9997    xmlChar * name3; /* a third name of the userdata */
9998    int n_name3;
9999
10000    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10001    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10002    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10003    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10004        mem_base = xmlMemBlocks();
10005        table = gen_xmlHashTablePtr(n_table, 0);
10006        name = gen_const_xmlChar_ptr(n_name, 1);
10007        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10008        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10009
10010        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10011        desret_void_ptr(ret_val);
10012        call_tests++;
10013        des_xmlHashTablePtr(n_table, table, 0);
10014        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10015        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10016        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10017        xmlResetLastError();
10018        if (mem_base != xmlMemBlocks()) {
10019            printf("Leak of %d blocks found in xmlHashLookup3",
10020	           xmlMemBlocks() - mem_base);
10021	    test_ret++;
10022            printf(" %d", n_table);
10023            printf(" %d", n_name);
10024            printf(" %d", n_name2);
10025            printf(" %d", n_name3);
10026            printf("\n");
10027        }
10028    }
10029    }
10030    }
10031    }
10032    function_tests++;
10033
10034    return(test_ret);
10035}
10036
10037
10038static int
10039test_xmlHashQLookup(void) {
10040    int test_ret = 0;
10041
10042    int mem_base;
10043    void * ret_val;
10044    xmlHashTablePtr table; /* the hash table */
10045    int n_table;
10046    xmlChar * prefix; /* the prefix of the userdata */
10047    int n_prefix;
10048    xmlChar * name; /* the name of the userdata */
10049    int n_name;
10050
10051    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10052    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10053    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10054        mem_base = xmlMemBlocks();
10055        table = gen_xmlHashTablePtr(n_table, 0);
10056        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10057        name = gen_const_xmlChar_ptr(n_name, 2);
10058
10059        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10060        desret_void_ptr(ret_val);
10061        call_tests++;
10062        des_xmlHashTablePtr(n_table, table, 0);
10063        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10064        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10065        xmlResetLastError();
10066        if (mem_base != xmlMemBlocks()) {
10067            printf("Leak of %d blocks found in xmlHashQLookup",
10068	           xmlMemBlocks() - mem_base);
10069	    test_ret++;
10070            printf(" %d", n_table);
10071            printf(" %d", n_prefix);
10072            printf(" %d", n_name);
10073            printf("\n");
10074        }
10075    }
10076    }
10077    }
10078    function_tests++;
10079
10080    return(test_ret);
10081}
10082
10083
10084static int
10085test_xmlHashQLookup2(void) {
10086    int test_ret = 0;
10087
10088    int mem_base;
10089    void * ret_val;
10090    xmlHashTablePtr table; /* the hash table */
10091    int n_table;
10092    xmlChar * prefix; /* the prefix of the userdata */
10093    int n_prefix;
10094    xmlChar * name; /* the name of the userdata */
10095    int n_name;
10096    xmlChar * prefix2; /* the second prefix of the userdata */
10097    int n_prefix2;
10098    xmlChar * name2; /* a second name of the userdata */
10099    int n_name2;
10100
10101    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10102    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10103    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10104    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10105    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10106        mem_base = xmlMemBlocks();
10107        table = gen_xmlHashTablePtr(n_table, 0);
10108        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10109        name = gen_const_xmlChar_ptr(n_name, 2);
10110        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10111        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10112
10113        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10114        desret_void_ptr(ret_val);
10115        call_tests++;
10116        des_xmlHashTablePtr(n_table, table, 0);
10117        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10118        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10119        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10120        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10121        xmlResetLastError();
10122        if (mem_base != xmlMemBlocks()) {
10123            printf("Leak of %d blocks found in xmlHashQLookup2",
10124	           xmlMemBlocks() - mem_base);
10125	    test_ret++;
10126            printf(" %d", n_table);
10127            printf(" %d", n_prefix);
10128            printf(" %d", n_name);
10129            printf(" %d", n_prefix2);
10130            printf(" %d", n_name2);
10131            printf("\n");
10132        }
10133    }
10134    }
10135    }
10136    }
10137    }
10138    function_tests++;
10139
10140    return(test_ret);
10141}
10142
10143
10144static int
10145test_xmlHashQLookup3(void) {
10146    int test_ret = 0;
10147
10148    int mem_base;
10149    void * ret_val;
10150    xmlHashTablePtr table; /* the hash table */
10151    int n_table;
10152    xmlChar * prefix; /* the prefix of the userdata */
10153    int n_prefix;
10154    xmlChar * name; /* the name of the userdata */
10155    int n_name;
10156    xmlChar * prefix2; /* the second prefix of the userdata */
10157    int n_prefix2;
10158    xmlChar * name2; /* a second name of the userdata */
10159    int n_name2;
10160    xmlChar * prefix3; /* the third prefix of the userdata */
10161    int n_prefix3;
10162    xmlChar * name3; /* a third name of the userdata */
10163    int n_name3;
10164
10165    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10166    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10167    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10168    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10169    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10170    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10171    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10172        mem_base = xmlMemBlocks();
10173        table = gen_xmlHashTablePtr(n_table, 0);
10174        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10175        name = gen_const_xmlChar_ptr(n_name, 2);
10176        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10177        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10178        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10179        name3 = gen_const_xmlChar_ptr(n_name3, 6);
10180
10181        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10182        desret_void_ptr(ret_val);
10183        call_tests++;
10184        des_xmlHashTablePtr(n_table, table, 0);
10185        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10186        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10187        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10188        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10189        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10190        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10191        xmlResetLastError();
10192        if (mem_base != xmlMemBlocks()) {
10193            printf("Leak of %d blocks found in xmlHashQLookup3",
10194	           xmlMemBlocks() - mem_base);
10195	    test_ret++;
10196            printf(" %d", n_table);
10197            printf(" %d", n_prefix);
10198            printf(" %d", n_name);
10199            printf(" %d", n_prefix2);
10200            printf(" %d", n_name2);
10201            printf(" %d", n_prefix3);
10202            printf(" %d", n_name3);
10203            printf("\n");
10204        }
10205    }
10206    }
10207    }
10208    }
10209    }
10210    }
10211    }
10212    function_tests++;
10213
10214    return(test_ret);
10215}
10216
10217
10218static int
10219test_xmlHashRemoveEntry(void) {
10220    int test_ret = 0;
10221
10222    int mem_base;
10223    int ret_val;
10224    xmlHashTablePtr table; /* the hash table */
10225    int n_table;
10226    xmlChar * name; /* the name of the userdata */
10227    int n_name;
10228    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10229    int n_f;
10230
10231    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10232    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10233    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10234        mem_base = xmlMemBlocks();
10235        table = gen_xmlHashTablePtr(n_table, 0);
10236        name = gen_const_xmlChar_ptr(n_name, 1);
10237        f = gen_xmlHashDeallocator(n_f, 2);
10238
10239        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10240        desret_int(ret_val);
10241        call_tests++;
10242        des_xmlHashTablePtr(n_table, table, 0);
10243        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10244        des_xmlHashDeallocator(n_f, f, 2);
10245        xmlResetLastError();
10246        if (mem_base != xmlMemBlocks()) {
10247            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10248	           xmlMemBlocks() - mem_base);
10249	    test_ret++;
10250            printf(" %d", n_table);
10251            printf(" %d", n_name);
10252            printf(" %d", n_f);
10253            printf("\n");
10254        }
10255    }
10256    }
10257    }
10258    function_tests++;
10259
10260    return(test_ret);
10261}
10262
10263
10264static int
10265test_xmlHashRemoveEntry2(void) {
10266    int test_ret = 0;
10267
10268    int mem_base;
10269    int ret_val;
10270    xmlHashTablePtr table; /* the hash table */
10271    int n_table;
10272    xmlChar * name; /* the name of the userdata */
10273    int n_name;
10274    xmlChar * name2; /* a second name of the userdata */
10275    int n_name2;
10276    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10277    int n_f;
10278
10279    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10280    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10281    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10282    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10283        mem_base = xmlMemBlocks();
10284        table = gen_xmlHashTablePtr(n_table, 0);
10285        name = gen_const_xmlChar_ptr(n_name, 1);
10286        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10287        f = gen_xmlHashDeallocator(n_f, 3);
10288
10289        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10290        desret_int(ret_val);
10291        call_tests++;
10292        des_xmlHashTablePtr(n_table, table, 0);
10293        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10294        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10295        des_xmlHashDeallocator(n_f, f, 3);
10296        xmlResetLastError();
10297        if (mem_base != xmlMemBlocks()) {
10298            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10299	           xmlMemBlocks() - mem_base);
10300	    test_ret++;
10301            printf(" %d", n_table);
10302            printf(" %d", n_name);
10303            printf(" %d", n_name2);
10304            printf(" %d", n_f);
10305            printf("\n");
10306        }
10307    }
10308    }
10309    }
10310    }
10311    function_tests++;
10312
10313    return(test_ret);
10314}
10315
10316
10317static int
10318test_xmlHashRemoveEntry3(void) {
10319    int test_ret = 0;
10320
10321    int mem_base;
10322    int ret_val;
10323    xmlHashTablePtr table; /* the hash table */
10324    int n_table;
10325    xmlChar * name; /* the name of the userdata */
10326    int n_name;
10327    xmlChar * name2; /* a second name of the userdata */
10328    int n_name2;
10329    xmlChar * name3; /* a third name of the userdata */
10330    int n_name3;
10331    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10332    int n_f;
10333
10334    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10335    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10336    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10337    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10338    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10339        mem_base = xmlMemBlocks();
10340        table = gen_xmlHashTablePtr(n_table, 0);
10341        name = gen_const_xmlChar_ptr(n_name, 1);
10342        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10343        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10344        f = gen_xmlHashDeallocator(n_f, 4);
10345
10346        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10347        desret_int(ret_val);
10348        call_tests++;
10349        des_xmlHashTablePtr(n_table, table, 0);
10350        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10351        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10352        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10353        des_xmlHashDeallocator(n_f, f, 4);
10354        xmlResetLastError();
10355        if (mem_base != xmlMemBlocks()) {
10356            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10357	           xmlMemBlocks() - mem_base);
10358	    test_ret++;
10359            printf(" %d", n_table);
10360            printf(" %d", n_name);
10361            printf(" %d", n_name2);
10362            printf(" %d", n_name3);
10363            printf(" %d", n_f);
10364            printf("\n");
10365        }
10366    }
10367    }
10368    }
10369    }
10370    }
10371    function_tests++;
10372
10373    return(test_ret);
10374}
10375
10376
10377static int
10378test_xmlHashScan(void) {
10379    int test_ret = 0;
10380
10381
10382    /* missing type support */
10383    return(test_ret);
10384}
10385
10386
10387static int
10388test_xmlHashScan3(void) {
10389    int test_ret = 0;
10390
10391
10392    /* missing type support */
10393    return(test_ret);
10394}
10395
10396
10397static int
10398test_xmlHashScanFull(void) {
10399    int test_ret = 0;
10400
10401
10402    /* missing type support */
10403    return(test_ret);
10404}
10405
10406
10407static int
10408test_xmlHashScanFull3(void) {
10409    int test_ret = 0;
10410
10411
10412    /* missing type support */
10413    return(test_ret);
10414}
10415
10416
10417static int
10418test_xmlHashSize(void) {
10419    int test_ret = 0;
10420
10421    int mem_base;
10422    int ret_val;
10423    xmlHashTablePtr table; /* the hash table */
10424    int n_table;
10425
10426    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10427        mem_base = xmlMemBlocks();
10428        table = gen_xmlHashTablePtr(n_table, 0);
10429
10430        ret_val = xmlHashSize(table);
10431        desret_int(ret_val);
10432        call_tests++;
10433        des_xmlHashTablePtr(n_table, table, 0);
10434        xmlResetLastError();
10435        if (mem_base != xmlMemBlocks()) {
10436            printf("Leak of %d blocks found in xmlHashSize",
10437	           xmlMemBlocks() - mem_base);
10438	    test_ret++;
10439            printf(" %d", n_table);
10440            printf("\n");
10441        }
10442    }
10443    function_tests++;
10444
10445    return(test_ret);
10446}
10447
10448
10449static int
10450test_xmlHashUpdateEntry(void) {
10451    int test_ret = 0;
10452
10453    int mem_base;
10454    int ret_val;
10455    xmlHashTablePtr table; /* the hash table */
10456    int n_table;
10457    xmlChar * name; /* the name of the userdata */
10458    int n_name;
10459    void * userdata; /* a pointer to the userdata */
10460    int n_userdata;
10461    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10462    int n_f;
10463
10464    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10465    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10466    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10467    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10468        mem_base = xmlMemBlocks();
10469        table = gen_xmlHashTablePtr(n_table, 0);
10470        name = gen_const_xmlChar_ptr(n_name, 1);
10471        userdata = gen_userdata(n_userdata, 2);
10472        f = gen_xmlHashDeallocator(n_f, 3);
10473
10474        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10475        desret_int(ret_val);
10476        call_tests++;
10477        des_xmlHashTablePtr(n_table, table, 0);
10478        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10479        des_userdata(n_userdata, userdata, 2);
10480        des_xmlHashDeallocator(n_f, f, 3);
10481        xmlResetLastError();
10482        if (mem_base != xmlMemBlocks()) {
10483            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10484	           xmlMemBlocks() - mem_base);
10485	    test_ret++;
10486            printf(" %d", n_table);
10487            printf(" %d", n_name);
10488            printf(" %d", n_userdata);
10489            printf(" %d", n_f);
10490            printf("\n");
10491        }
10492    }
10493    }
10494    }
10495    }
10496    function_tests++;
10497
10498    return(test_ret);
10499}
10500
10501
10502static int
10503test_xmlHashUpdateEntry2(void) {
10504    int test_ret = 0;
10505
10506    int mem_base;
10507    int ret_val;
10508    xmlHashTablePtr table; /* the hash table */
10509    int n_table;
10510    xmlChar * name; /* the name of the userdata */
10511    int n_name;
10512    xmlChar * name2; /* a second name of the userdata */
10513    int n_name2;
10514    void * userdata; /* a pointer to the userdata */
10515    int n_userdata;
10516    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10517    int n_f;
10518
10519    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10520    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10521    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10522    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10523    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10524        mem_base = xmlMemBlocks();
10525        table = gen_xmlHashTablePtr(n_table, 0);
10526        name = gen_const_xmlChar_ptr(n_name, 1);
10527        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10528        userdata = gen_userdata(n_userdata, 3);
10529        f = gen_xmlHashDeallocator(n_f, 4);
10530
10531        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10532        desret_int(ret_val);
10533        call_tests++;
10534        des_xmlHashTablePtr(n_table, table, 0);
10535        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10536        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10537        des_userdata(n_userdata, userdata, 3);
10538        des_xmlHashDeallocator(n_f, f, 4);
10539        xmlResetLastError();
10540        if (mem_base != xmlMemBlocks()) {
10541            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10542	           xmlMemBlocks() - mem_base);
10543	    test_ret++;
10544            printf(" %d", n_table);
10545            printf(" %d", n_name);
10546            printf(" %d", n_name2);
10547            printf(" %d", n_userdata);
10548            printf(" %d", n_f);
10549            printf("\n");
10550        }
10551    }
10552    }
10553    }
10554    }
10555    }
10556    function_tests++;
10557
10558    return(test_ret);
10559}
10560
10561
10562static int
10563test_xmlHashUpdateEntry3(void) {
10564    int test_ret = 0;
10565
10566    int mem_base;
10567    int ret_val;
10568    xmlHashTablePtr table; /* the hash table */
10569    int n_table;
10570    xmlChar * name; /* the name of the userdata */
10571    int n_name;
10572    xmlChar * name2; /* a second name of the userdata */
10573    int n_name2;
10574    xmlChar * name3; /* a third name of the userdata */
10575    int n_name3;
10576    void * userdata; /* a pointer to the userdata */
10577    int n_userdata;
10578    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10579    int n_f;
10580
10581    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10582    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10583    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10584    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10585    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10586    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10587        mem_base = xmlMemBlocks();
10588        table = gen_xmlHashTablePtr(n_table, 0);
10589        name = gen_const_xmlChar_ptr(n_name, 1);
10590        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10591        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10592        userdata = gen_userdata(n_userdata, 4);
10593        f = gen_xmlHashDeallocator(n_f, 5);
10594
10595        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10596        desret_int(ret_val);
10597        call_tests++;
10598        des_xmlHashTablePtr(n_table, table, 0);
10599        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10600        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10601        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10602        des_userdata(n_userdata, userdata, 4);
10603        des_xmlHashDeallocator(n_f, f, 5);
10604        xmlResetLastError();
10605        if (mem_base != xmlMemBlocks()) {
10606            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10607	           xmlMemBlocks() - mem_base);
10608	    test_ret++;
10609            printf(" %d", n_table);
10610            printf(" %d", n_name);
10611            printf(" %d", n_name2);
10612            printf(" %d", n_name3);
10613            printf(" %d", n_userdata);
10614            printf(" %d", n_f);
10615            printf("\n");
10616        }
10617    }
10618    }
10619    }
10620    }
10621    }
10622    }
10623    function_tests++;
10624
10625    return(test_ret);
10626}
10627
10628static int
10629test_hash(void) {
10630    int test_ret = 0;
10631
10632    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10633    test_ret += test_xmlHashAddEntry();
10634    test_ret += test_xmlHashAddEntry2();
10635    test_ret += test_xmlHashAddEntry3();
10636    test_ret += test_xmlHashCopy();
10637    test_ret += test_xmlHashCreate();
10638    test_ret += test_xmlHashCreateDict();
10639    test_ret += test_xmlHashLookup();
10640    test_ret += test_xmlHashLookup2();
10641    test_ret += test_xmlHashLookup3();
10642    test_ret += test_xmlHashQLookup();
10643    test_ret += test_xmlHashQLookup2();
10644    test_ret += test_xmlHashQLookup3();
10645    test_ret += test_xmlHashRemoveEntry();
10646    test_ret += test_xmlHashRemoveEntry2();
10647    test_ret += test_xmlHashRemoveEntry3();
10648    test_ret += test_xmlHashScan();
10649    test_ret += test_xmlHashScan3();
10650    test_ret += test_xmlHashScanFull();
10651    test_ret += test_xmlHashScanFull3();
10652    test_ret += test_xmlHashSize();
10653    test_ret += test_xmlHashUpdateEntry();
10654    test_ret += test_xmlHashUpdateEntry2();
10655    test_ret += test_xmlHashUpdateEntry3();
10656
10657    if (test_ret != 0)
10658	printf("Module hash: %d errors\n", test_ret);
10659    return(test_ret);
10660}
10661
10662#define gen_nb_xmlLinkPtr 1
10663static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10664    return(NULL);
10665}
10666static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10667}
10668
10669static int
10670test_xmlLinkGetData(void) {
10671    int test_ret = 0;
10672
10673    int mem_base;
10674    void * ret_val;
10675    xmlLinkPtr lk; /* a link */
10676    int n_lk;
10677
10678    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10679        mem_base = xmlMemBlocks();
10680        lk = gen_xmlLinkPtr(n_lk, 0);
10681
10682        ret_val = xmlLinkGetData(lk);
10683        desret_void_ptr(ret_val);
10684        call_tests++;
10685        des_xmlLinkPtr(n_lk, lk, 0);
10686        xmlResetLastError();
10687        if (mem_base != xmlMemBlocks()) {
10688            printf("Leak of %d blocks found in xmlLinkGetData",
10689	           xmlMemBlocks() - mem_base);
10690	    test_ret++;
10691            printf(" %d", n_lk);
10692            printf("\n");
10693        }
10694    }
10695    function_tests++;
10696
10697    return(test_ret);
10698}
10699
10700
10701static int
10702test_xmlListAppend(void) {
10703    int test_ret = 0;
10704
10705    int mem_base;
10706    int ret_val;
10707    xmlListPtr l; /* a list */
10708    int n_l;
10709    void * data; /* the data */
10710    int n_data;
10711
10712    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10713    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10714        mem_base = xmlMemBlocks();
10715        l = gen_xmlListPtr(n_l, 0);
10716        data = gen_userdata(n_data, 1);
10717
10718        ret_val = xmlListAppend(l, data);
10719        desret_int(ret_val);
10720        call_tests++;
10721        des_xmlListPtr(n_l, l, 0);
10722        des_userdata(n_data, data, 1);
10723        xmlResetLastError();
10724        if (mem_base != xmlMemBlocks()) {
10725            printf("Leak of %d blocks found in xmlListAppend",
10726	           xmlMemBlocks() - mem_base);
10727	    test_ret++;
10728            printf(" %d", n_l);
10729            printf(" %d", n_data);
10730            printf("\n");
10731        }
10732    }
10733    }
10734    function_tests++;
10735
10736    return(test_ret);
10737}
10738
10739
10740static int
10741test_xmlListClear(void) {
10742    int test_ret = 0;
10743
10744    int mem_base;
10745    xmlListPtr l; /* a list */
10746    int n_l;
10747
10748    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10749        mem_base = xmlMemBlocks();
10750        l = gen_xmlListPtr(n_l, 0);
10751
10752        xmlListClear(l);
10753        call_tests++;
10754        des_xmlListPtr(n_l, l, 0);
10755        xmlResetLastError();
10756        if (mem_base != xmlMemBlocks()) {
10757            printf("Leak of %d blocks found in xmlListClear",
10758	           xmlMemBlocks() - mem_base);
10759	    test_ret++;
10760            printf(" %d", n_l);
10761            printf("\n");
10762        }
10763    }
10764    function_tests++;
10765
10766    return(test_ret);
10767}
10768
10769
10770#define gen_nb_const_xmlListPtr 1
10771static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10772    return(NULL);
10773}
10774static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10775}
10776
10777static int
10778test_xmlListCopy(void) {
10779    int test_ret = 0;
10780
10781    int mem_base;
10782    int ret_val;
10783    xmlListPtr cur; /* the new list */
10784    int n_cur;
10785    xmlListPtr old; /* the old list */
10786    int n_old;
10787
10788    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10789    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10790        mem_base = xmlMemBlocks();
10791        cur = gen_xmlListPtr(n_cur, 0);
10792        old = gen_const_xmlListPtr(n_old, 1);
10793
10794        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10795        desret_int(ret_val);
10796        call_tests++;
10797        des_xmlListPtr(n_cur, cur, 0);
10798        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10799        xmlResetLastError();
10800        if (mem_base != xmlMemBlocks()) {
10801            printf("Leak of %d blocks found in xmlListCopy",
10802	           xmlMemBlocks() - mem_base);
10803	    test_ret++;
10804            printf(" %d", n_cur);
10805            printf(" %d", n_old);
10806            printf("\n");
10807        }
10808    }
10809    }
10810    function_tests++;
10811
10812    return(test_ret);
10813}
10814
10815
10816static int
10817test_xmlListCreate(void) {
10818    int test_ret = 0;
10819
10820
10821    /* missing type support */
10822    return(test_ret);
10823}
10824
10825
10826static int
10827test_xmlListDup(void) {
10828    int test_ret = 0;
10829
10830
10831    /* missing type support */
10832    return(test_ret);
10833}
10834
10835
10836static int
10837test_xmlListEmpty(void) {
10838    int test_ret = 0;
10839
10840    int mem_base;
10841    int ret_val;
10842    xmlListPtr l; /* a list */
10843    int n_l;
10844
10845    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10846        mem_base = xmlMemBlocks();
10847        l = gen_xmlListPtr(n_l, 0);
10848
10849        ret_val = xmlListEmpty(l);
10850        desret_int(ret_val);
10851        call_tests++;
10852        des_xmlListPtr(n_l, l, 0);
10853        xmlResetLastError();
10854        if (mem_base != xmlMemBlocks()) {
10855            printf("Leak of %d blocks found in xmlListEmpty",
10856	           xmlMemBlocks() - mem_base);
10857	    test_ret++;
10858            printf(" %d", n_l);
10859            printf("\n");
10860        }
10861    }
10862    function_tests++;
10863
10864    return(test_ret);
10865}
10866
10867
10868static int
10869test_xmlListEnd(void) {
10870    int test_ret = 0;
10871
10872
10873    /* missing type support */
10874    return(test_ret);
10875}
10876
10877
10878static int
10879test_xmlListFront(void) {
10880    int test_ret = 0;
10881
10882
10883    /* missing type support */
10884    return(test_ret);
10885}
10886
10887
10888static int
10889test_xmlListInsert(void) {
10890    int test_ret = 0;
10891
10892    int mem_base;
10893    int ret_val;
10894    xmlListPtr l; /* a list */
10895    int n_l;
10896    void * data; /* the data */
10897    int n_data;
10898
10899    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10900    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10901        mem_base = xmlMemBlocks();
10902        l = gen_xmlListPtr(n_l, 0);
10903        data = gen_userdata(n_data, 1);
10904
10905        ret_val = xmlListInsert(l, data);
10906        desret_int(ret_val);
10907        call_tests++;
10908        des_xmlListPtr(n_l, l, 0);
10909        des_userdata(n_data, data, 1);
10910        xmlResetLastError();
10911        if (mem_base != xmlMemBlocks()) {
10912            printf("Leak of %d blocks found in xmlListInsert",
10913	           xmlMemBlocks() - mem_base);
10914	    test_ret++;
10915            printf(" %d", n_l);
10916            printf(" %d", n_data);
10917            printf("\n");
10918        }
10919    }
10920    }
10921    function_tests++;
10922
10923    return(test_ret);
10924}
10925
10926
10927static int
10928test_xmlListMerge(void) {
10929    int test_ret = 0;
10930
10931    int mem_base;
10932    xmlListPtr l1; /* the original list */
10933    int n_l1;
10934    xmlListPtr l2; /* the new list */
10935    int n_l2;
10936
10937    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10938    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10939        mem_base = xmlMemBlocks();
10940        l1 = gen_xmlListPtr(n_l1, 0);
10941        l2 = gen_xmlListPtr(n_l2, 1);
10942
10943        xmlListMerge(l1, l2);
10944        call_tests++;
10945        des_xmlListPtr(n_l1, l1, 0);
10946        des_xmlListPtr(n_l2, l2, 1);
10947        xmlResetLastError();
10948        if (mem_base != xmlMemBlocks()) {
10949            printf("Leak of %d blocks found in xmlListMerge",
10950	           xmlMemBlocks() - mem_base);
10951	    test_ret++;
10952            printf(" %d", n_l1);
10953            printf(" %d", n_l2);
10954            printf("\n");
10955        }
10956    }
10957    }
10958    function_tests++;
10959
10960    return(test_ret);
10961}
10962
10963
10964static int
10965test_xmlListPopBack(void) {
10966    int test_ret = 0;
10967
10968    int mem_base;
10969    xmlListPtr l; /* a list */
10970    int n_l;
10971
10972    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10973        mem_base = xmlMemBlocks();
10974        l = gen_xmlListPtr(n_l, 0);
10975
10976        xmlListPopBack(l);
10977        call_tests++;
10978        des_xmlListPtr(n_l, l, 0);
10979        xmlResetLastError();
10980        if (mem_base != xmlMemBlocks()) {
10981            printf("Leak of %d blocks found in xmlListPopBack",
10982	           xmlMemBlocks() - mem_base);
10983	    test_ret++;
10984            printf(" %d", n_l);
10985            printf("\n");
10986        }
10987    }
10988    function_tests++;
10989
10990    return(test_ret);
10991}
10992
10993
10994static int
10995test_xmlListPopFront(void) {
10996    int test_ret = 0;
10997
10998    int mem_base;
10999    xmlListPtr l; /* a list */
11000    int n_l;
11001
11002    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11003        mem_base = xmlMemBlocks();
11004        l = gen_xmlListPtr(n_l, 0);
11005
11006        xmlListPopFront(l);
11007        call_tests++;
11008        des_xmlListPtr(n_l, l, 0);
11009        xmlResetLastError();
11010        if (mem_base != xmlMemBlocks()) {
11011            printf("Leak of %d blocks found in xmlListPopFront",
11012	           xmlMemBlocks() - mem_base);
11013	    test_ret++;
11014            printf(" %d", n_l);
11015            printf("\n");
11016        }
11017    }
11018    function_tests++;
11019
11020    return(test_ret);
11021}
11022
11023
11024static int
11025test_xmlListPushBack(void) {
11026    int test_ret = 0;
11027
11028    int mem_base;
11029    int ret_val;
11030    xmlListPtr l; /* a list */
11031    int n_l;
11032    void * data; /* new data */
11033    int n_data;
11034
11035    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11036    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11037        mem_base = xmlMemBlocks();
11038        l = gen_xmlListPtr(n_l, 0);
11039        data = gen_userdata(n_data, 1);
11040
11041        ret_val = xmlListPushBack(l, data);
11042        desret_int(ret_val);
11043        call_tests++;
11044        des_xmlListPtr(n_l, l, 0);
11045        des_userdata(n_data, data, 1);
11046        xmlResetLastError();
11047        if (mem_base != xmlMemBlocks()) {
11048            printf("Leak of %d blocks found in xmlListPushBack",
11049	           xmlMemBlocks() - mem_base);
11050	    test_ret++;
11051            printf(" %d", n_l);
11052            printf(" %d", n_data);
11053            printf("\n");
11054        }
11055    }
11056    }
11057    function_tests++;
11058
11059    return(test_ret);
11060}
11061
11062
11063static int
11064test_xmlListPushFront(void) {
11065    int test_ret = 0;
11066
11067    int mem_base;
11068    int ret_val;
11069    xmlListPtr l; /* a list */
11070    int n_l;
11071    void * data; /* new data */
11072    int n_data;
11073
11074    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11075    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11076        mem_base = xmlMemBlocks();
11077        l = gen_xmlListPtr(n_l, 0);
11078        data = gen_userdata(n_data, 1);
11079
11080        ret_val = xmlListPushFront(l, data);
11081        desret_int(ret_val);
11082        call_tests++;
11083        des_xmlListPtr(n_l, l, 0);
11084        des_userdata(n_data, data, 1);
11085        xmlResetLastError();
11086        if (mem_base != xmlMemBlocks()) {
11087            printf("Leak of %d blocks found in xmlListPushFront",
11088	           xmlMemBlocks() - mem_base);
11089	    test_ret++;
11090            printf(" %d", n_l);
11091            printf(" %d", n_data);
11092            printf("\n");
11093        }
11094    }
11095    }
11096    function_tests++;
11097
11098    return(test_ret);
11099}
11100
11101
11102static int
11103test_xmlListRemoveAll(void) {
11104    int test_ret = 0;
11105
11106    int mem_base;
11107    int ret_val;
11108    xmlListPtr l; /* a list */
11109    int n_l;
11110    void * data; /* list data */
11111    int n_data;
11112
11113    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11114    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11115        mem_base = xmlMemBlocks();
11116        l = gen_xmlListPtr(n_l, 0);
11117        data = gen_userdata(n_data, 1);
11118
11119        ret_val = xmlListRemoveAll(l, data);
11120        desret_int(ret_val);
11121        call_tests++;
11122        des_xmlListPtr(n_l, l, 0);
11123        des_userdata(n_data, data, 1);
11124        xmlResetLastError();
11125        if (mem_base != xmlMemBlocks()) {
11126            printf("Leak of %d blocks found in xmlListRemoveAll",
11127	           xmlMemBlocks() - mem_base);
11128	    test_ret++;
11129            printf(" %d", n_l);
11130            printf(" %d", n_data);
11131            printf("\n");
11132        }
11133    }
11134    }
11135    function_tests++;
11136
11137    return(test_ret);
11138}
11139
11140
11141static int
11142test_xmlListRemoveFirst(void) {
11143    int test_ret = 0;
11144
11145    int mem_base;
11146    int ret_val;
11147    xmlListPtr l; /* a list */
11148    int n_l;
11149    void * data; /* list data */
11150    int n_data;
11151
11152    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11153    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11154        mem_base = xmlMemBlocks();
11155        l = gen_xmlListPtr(n_l, 0);
11156        data = gen_userdata(n_data, 1);
11157
11158        ret_val = xmlListRemoveFirst(l, data);
11159        desret_int(ret_val);
11160        call_tests++;
11161        des_xmlListPtr(n_l, l, 0);
11162        des_userdata(n_data, data, 1);
11163        xmlResetLastError();
11164        if (mem_base != xmlMemBlocks()) {
11165            printf("Leak of %d blocks found in xmlListRemoveFirst",
11166	           xmlMemBlocks() - mem_base);
11167	    test_ret++;
11168            printf(" %d", n_l);
11169            printf(" %d", n_data);
11170            printf("\n");
11171        }
11172    }
11173    }
11174    function_tests++;
11175
11176    return(test_ret);
11177}
11178
11179
11180static int
11181test_xmlListRemoveLast(void) {
11182    int test_ret = 0;
11183
11184    int mem_base;
11185    int ret_val;
11186    xmlListPtr l; /* a list */
11187    int n_l;
11188    void * data; /* list data */
11189    int n_data;
11190
11191    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11192    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11193        mem_base = xmlMemBlocks();
11194        l = gen_xmlListPtr(n_l, 0);
11195        data = gen_userdata(n_data, 1);
11196
11197        ret_val = xmlListRemoveLast(l, data);
11198        desret_int(ret_val);
11199        call_tests++;
11200        des_xmlListPtr(n_l, l, 0);
11201        des_userdata(n_data, data, 1);
11202        xmlResetLastError();
11203        if (mem_base != xmlMemBlocks()) {
11204            printf("Leak of %d blocks found in xmlListRemoveLast",
11205	           xmlMemBlocks() - mem_base);
11206	    test_ret++;
11207            printf(" %d", n_l);
11208            printf(" %d", n_data);
11209            printf("\n");
11210        }
11211    }
11212    }
11213    function_tests++;
11214
11215    return(test_ret);
11216}
11217
11218
11219static int
11220test_xmlListReverse(void) {
11221    int test_ret = 0;
11222
11223    int mem_base;
11224    xmlListPtr l; /* a list */
11225    int n_l;
11226
11227    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11228        mem_base = xmlMemBlocks();
11229        l = gen_xmlListPtr(n_l, 0);
11230
11231        xmlListReverse(l);
11232        call_tests++;
11233        des_xmlListPtr(n_l, l, 0);
11234        xmlResetLastError();
11235        if (mem_base != xmlMemBlocks()) {
11236            printf("Leak of %d blocks found in xmlListReverse",
11237	           xmlMemBlocks() - mem_base);
11238	    test_ret++;
11239            printf(" %d", n_l);
11240            printf("\n");
11241        }
11242    }
11243    function_tests++;
11244
11245    return(test_ret);
11246}
11247
11248
11249static int
11250test_xmlListReverseSearch(void) {
11251    int test_ret = 0;
11252
11253    int mem_base;
11254    void * ret_val;
11255    xmlListPtr l; /* a list */
11256    int n_l;
11257    void * data; /* a search value */
11258    int n_data;
11259
11260    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11261    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11262        mem_base = xmlMemBlocks();
11263        l = gen_xmlListPtr(n_l, 0);
11264        data = gen_userdata(n_data, 1);
11265
11266        ret_val = xmlListReverseSearch(l, data);
11267        desret_void_ptr(ret_val);
11268        call_tests++;
11269        des_xmlListPtr(n_l, l, 0);
11270        des_userdata(n_data, data, 1);
11271        xmlResetLastError();
11272        if (mem_base != xmlMemBlocks()) {
11273            printf("Leak of %d blocks found in xmlListReverseSearch",
11274	           xmlMemBlocks() - mem_base);
11275	    test_ret++;
11276            printf(" %d", n_l);
11277            printf(" %d", n_data);
11278            printf("\n");
11279        }
11280    }
11281    }
11282    function_tests++;
11283
11284    return(test_ret);
11285}
11286
11287
11288static int
11289test_xmlListReverseWalk(void) {
11290    int test_ret = 0;
11291
11292
11293    /* missing type support */
11294    return(test_ret);
11295}
11296
11297
11298static int
11299test_xmlListSearch(void) {
11300    int test_ret = 0;
11301
11302    int mem_base;
11303    void * ret_val;
11304    xmlListPtr l; /* a list */
11305    int n_l;
11306    void * data; /* a search value */
11307    int n_data;
11308
11309    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11310    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11311        mem_base = xmlMemBlocks();
11312        l = gen_xmlListPtr(n_l, 0);
11313        data = gen_userdata(n_data, 1);
11314
11315        ret_val = xmlListSearch(l, data);
11316        desret_void_ptr(ret_val);
11317        call_tests++;
11318        des_xmlListPtr(n_l, l, 0);
11319        des_userdata(n_data, data, 1);
11320        xmlResetLastError();
11321        if (mem_base != xmlMemBlocks()) {
11322            printf("Leak of %d blocks found in xmlListSearch",
11323	           xmlMemBlocks() - mem_base);
11324	    test_ret++;
11325            printf(" %d", n_l);
11326            printf(" %d", n_data);
11327            printf("\n");
11328        }
11329    }
11330    }
11331    function_tests++;
11332
11333    return(test_ret);
11334}
11335
11336
11337static int
11338test_xmlListSize(void) {
11339    int test_ret = 0;
11340
11341    int mem_base;
11342    int ret_val;
11343    xmlListPtr l; /* a list */
11344    int n_l;
11345
11346    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11347        mem_base = xmlMemBlocks();
11348        l = gen_xmlListPtr(n_l, 0);
11349
11350        ret_val = xmlListSize(l);
11351        desret_int(ret_val);
11352        call_tests++;
11353        des_xmlListPtr(n_l, l, 0);
11354        xmlResetLastError();
11355        if (mem_base != xmlMemBlocks()) {
11356            printf("Leak of %d blocks found in xmlListSize",
11357	           xmlMemBlocks() - mem_base);
11358	    test_ret++;
11359            printf(" %d", n_l);
11360            printf("\n");
11361        }
11362    }
11363    function_tests++;
11364
11365    return(test_ret);
11366}
11367
11368
11369static int
11370test_xmlListSort(void) {
11371    int test_ret = 0;
11372
11373    int mem_base;
11374    xmlListPtr l; /* a list */
11375    int n_l;
11376
11377    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11378        mem_base = xmlMemBlocks();
11379        l = gen_xmlListPtr(n_l, 0);
11380
11381        xmlListSort(l);
11382        call_tests++;
11383        des_xmlListPtr(n_l, l, 0);
11384        xmlResetLastError();
11385        if (mem_base != xmlMemBlocks()) {
11386            printf("Leak of %d blocks found in xmlListSort",
11387	           xmlMemBlocks() - mem_base);
11388	    test_ret++;
11389            printf(" %d", n_l);
11390            printf("\n");
11391        }
11392    }
11393    function_tests++;
11394
11395    return(test_ret);
11396}
11397
11398
11399static int
11400test_xmlListWalk(void) {
11401    int test_ret = 0;
11402
11403
11404    /* missing type support */
11405    return(test_ret);
11406}
11407
11408static int
11409test_list(void) {
11410    int test_ret = 0;
11411
11412    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11413    test_ret += test_xmlLinkGetData();
11414    test_ret += test_xmlListAppend();
11415    test_ret += test_xmlListClear();
11416    test_ret += test_xmlListCopy();
11417    test_ret += test_xmlListCreate();
11418    test_ret += test_xmlListDup();
11419    test_ret += test_xmlListEmpty();
11420    test_ret += test_xmlListEnd();
11421    test_ret += test_xmlListFront();
11422    test_ret += test_xmlListInsert();
11423    test_ret += test_xmlListMerge();
11424    test_ret += test_xmlListPopBack();
11425    test_ret += test_xmlListPopFront();
11426    test_ret += test_xmlListPushBack();
11427    test_ret += test_xmlListPushFront();
11428    test_ret += test_xmlListRemoveAll();
11429    test_ret += test_xmlListRemoveFirst();
11430    test_ret += test_xmlListRemoveLast();
11431    test_ret += test_xmlListReverse();
11432    test_ret += test_xmlListReverseSearch();
11433    test_ret += test_xmlListReverseWalk();
11434    test_ret += test_xmlListSearch();
11435    test_ret += test_xmlListSize();
11436    test_ret += test_xmlListSort();
11437    test_ret += test_xmlListWalk();
11438
11439    if (test_ret != 0)
11440	printf("Module list: %d errors\n", test_ret);
11441    return(test_ret);
11442}
11443
11444static int
11445test_xmlNanoFTPCheckResponse(void) {
11446    int test_ret = 0;
11447
11448#if defined(LIBXML_FTP_ENABLED)
11449    int mem_base;
11450    int ret_val;
11451    void * ctx; /* an FTP context */
11452    int n_ctx;
11453
11454    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11455        mem_base = xmlMemBlocks();
11456        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11457
11458        ret_val = xmlNanoFTPCheckResponse(ctx);
11459        desret_int(ret_val);
11460        call_tests++;
11461        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11462        xmlResetLastError();
11463        if (mem_base != xmlMemBlocks()) {
11464            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11465	           xmlMemBlocks() - mem_base);
11466	    test_ret++;
11467            printf(" %d", n_ctx);
11468            printf("\n");
11469        }
11470    }
11471    function_tests++;
11472#endif
11473
11474    return(test_ret);
11475}
11476
11477
11478static int
11479test_xmlNanoFTPCleanup(void) {
11480    int test_ret = 0;
11481
11482#if defined(LIBXML_FTP_ENABLED)
11483    int mem_base;
11484
11485        mem_base = xmlMemBlocks();
11486
11487        xmlNanoFTPCleanup();
11488        call_tests++;
11489        xmlResetLastError();
11490        if (mem_base != xmlMemBlocks()) {
11491            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11492	           xmlMemBlocks() - mem_base);
11493	    test_ret++;
11494            printf("\n");
11495        }
11496    function_tests++;
11497#endif
11498
11499    return(test_ret);
11500}
11501
11502
11503static int
11504test_xmlNanoFTPCloseConnection(void) {
11505    int test_ret = 0;
11506
11507#if defined(LIBXML_FTP_ENABLED)
11508    int mem_base;
11509    int ret_val;
11510    void * ctx; /* an FTP context */
11511    int n_ctx;
11512
11513    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11514        mem_base = xmlMemBlocks();
11515        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11516
11517        ret_val = xmlNanoFTPCloseConnection(ctx);
11518        desret_int(ret_val);
11519        call_tests++;
11520        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11521        xmlResetLastError();
11522        if (mem_base != xmlMemBlocks()) {
11523            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11524	           xmlMemBlocks() - mem_base);
11525	    test_ret++;
11526            printf(" %d", n_ctx);
11527            printf("\n");
11528        }
11529    }
11530    function_tests++;
11531#endif
11532
11533    return(test_ret);
11534}
11535
11536
11537static int
11538test_xmlNanoFTPCwd(void) {
11539    int test_ret = 0;
11540
11541#if defined(LIBXML_FTP_ENABLED)
11542    int mem_base;
11543    int ret_val;
11544    void * ctx; /* an FTP context */
11545    int n_ctx;
11546    char * directory; /* a directory on the server */
11547    int n_directory;
11548
11549    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11550    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11551        mem_base = xmlMemBlocks();
11552        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11553        directory = gen_const_char_ptr(n_directory, 1);
11554
11555        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11556        desret_int(ret_val);
11557        call_tests++;
11558        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11559        des_const_char_ptr(n_directory, (const char *)directory, 1);
11560        xmlResetLastError();
11561        if (mem_base != xmlMemBlocks()) {
11562            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11563	           xmlMemBlocks() - mem_base);
11564	    test_ret++;
11565            printf(" %d", n_ctx);
11566            printf(" %d", n_directory);
11567            printf("\n");
11568        }
11569    }
11570    }
11571    function_tests++;
11572#endif
11573
11574    return(test_ret);
11575}
11576
11577
11578static int
11579test_xmlNanoFTPDele(void) {
11580    int test_ret = 0;
11581
11582#if defined(LIBXML_FTP_ENABLED)
11583    int mem_base;
11584    int ret_val;
11585    void * ctx; /* an FTP context */
11586    int n_ctx;
11587    const char * file; /* a file or directory on the server */
11588    int n_file;
11589
11590    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11591    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11592        mem_base = xmlMemBlocks();
11593        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11594        file = gen_filepath(n_file, 1);
11595
11596        ret_val = xmlNanoFTPDele(ctx, file);
11597        desret_int(ret_val);
11598        call_tests++;
11599        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11600        des_filepath(n_file, file, 1);
11601        xmlResetLastError();
11602        if (mem_base != xmlMemBlocks()) {
11603            printf("Leak of %d blocks found in xmlNanoFTPDele",
11604	           xmlMemBlocks() - mem_base);
11605	    test_ret++;
11606            printf(" %d", n_ctx);
11607            printf(" %d", n_file);
11608            printf("\n");
11609        }
11610    }
11611    }
11612    function_tests++;
11613#endif
11614
11615    return(test_ret);
11616}
11617
11618
11619static int
11620test_xmlNanoFTPGet(void) {
11621    int test_ret = 0;
11622
11623
11624    /* missing type support */
11625    return(test_ret);
11626}
11627
11628
11629static int
11630test_xmlNanoFTPGetConnection(void) {
11631    int test_ret = 0;
11632
11633#if defined(LIBXML_FTP_ENABLED)
11634    int mem_base;
11635    int ret_val;
11636    void * ctx; /* an FTP context */
11637    int n_ctx;
11638
11639    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11640        mem_base = xmlMemBlocks();
11641        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11642
11643        ret_val = xmlNanoFTPGetConnection(ctx);
11644        desret_int(ret_val);
11645        call_tests++;
11646        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11647        xmlResetLastError();
11648        if (mem_base != xmlMemBlocks()) {
11649            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11650	           xmlMemBlocks() - mem_base);
11651	    test_ret++;
11652            printf(" %d", n_ctx);
11653            printf("\n");
11654        }
11655    }
11656    function_tests++;
11657#endif
11658
11659    return(test_ret);
11660}
11661
11662
11663static int
11664test_xmlNanoFTPGetResponse(void) {
11665    int test_ret = 0;
11666
11667#if defined(LIBXML_FTP_ENABLED)
11668    int mem_base;
11669    int ret_val;
11670    void * ctx; /* an FTP context */
11671    int n_ctx;
11672
11673    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11674        mem_base = xmlMemBlocks();
11675        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11676
11677        ret_val = xmlNanoFTPGetResponse(ctx);
11678        desret_int(ret_val);
11679        call_tests++;
11680        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11681        xmlResetLastError();
11682        if (mem_base != xmlMemBlocks()) {
11683            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11684	           xmlMemBlocks() - mem_base);
11685	    test_ret++;
11686            printf(" %d", n_ctx);
11687            printf("\n");
11688        }
11689    }
11690    function_tests++;
11691#endif
11692
11693    return(test_ret);
11694}
11695
11696
11697static int
11698test_xmlNanoFTPGetSocket(void) {
11699    int test_ret = 0;
11700
11701#if defined(LIBXML_FTP_ENABLED)
11702    int mem_base;
11703    int ret_val;
11704    void * ctx; /* an FTP context */
11705    int n_ctx;
11706    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11707    int n_filename;
11708
11709    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11710    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11711        mem_base = xmlMemBlocks();
11712        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11713        filename = gen_filepath(n_filename, 1);
11714
11715        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11716        desret_int(ret_val);
11717        call_tests++;
11718        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11719        des_filepath(n_filename, filename, 1);
11720        xmlResetLastError();
11721        if (mem_base != xmlMemBlocks()) {
11722            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11723	           xmlMemBlocks() - mem_base);
11724	    test_ret++;
11725            printf(" %d", n_ctx);
11726            printf(" %d", n_filename);
11727            printf("\n");
11728        }
11729    }
11730    }
11731    function_tests++;
11732#endif
11733
11734    return(test_ret);
11735}
11736
11737
11738static int
11739test_xmlNanoFTPInit(void) {
11740    int test_ret = 0;
11741
11742#if defined(LIBXML_FTP_ENABLED)
11743    int mem_base;
11744
11745        mem_base = xmlMemBlocks();
11746
11747        xmlNanoFTPInit();
11748        call_tests++;
11749        xmlResetLastError();
11750        if (mem_base != xmlMemBlocks()) {
11751            printf("Leak of %d blocks found in xmlNanoFTPInit",
11752	           xmlMemBlocks() - mem_base);
11753	    test_ret++;
11754            printf("\n");
11755        }
11756    function_tests++;
11757#endif
11758
11759    return(test_ret);
11760}
11761
11762
11763static int
11764test_xmlNanoFTPList(void) {
11765    int test_ret = 0;
11766
11767
11768    /* missing type support */
11769    return(test_ret);
11770}
11771
11772
11773static int
11774test_xmlNanoFTPNewCtxt(void) {
11775    int test_ret = 0;
11776
11777#if defined(LIBXML_FTP_ENABLED)
11778    int mem_base;
11779    void * ret_val;
11780    const char * URL; /* The URL used to initialize the context */
11781    int n_URL;
11782
11783    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11784        mem_base = xmlMemBlocks();
11785        URL = gen_filepath(n_URL, 0);
11786
11787        ret_val = xmlNanoFTPNewCtxt(URL);
11788        desret_xmlNanoFTPCtxtPtr(ret_val);
11789        call_tests++;
11790        des_filepath(n_URL, URL, 0);
11791        xmlResetLastError();
11792        if (mem_base != xmlMemBlocks()) {
11793            printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11794	           xmlMemBlocks() - mem_base);
11795	    test_ret++;
11796            printf(" %d", n_URL);
11797            printf("\n");
11798        }
11799    }
11800    function_tests++;
11801#endif
11802
11803    return(test_ret);
11804}
11805
11806
11807static int
11808test_xmlNanoFTPOpen(void) {
11809    int test_ret = 0;
11810
11811#if defined(LIBXML_FTP_ENABLED)
11812    int mem_base;
11813    void * ret_val;
11814    const char * URL; /* the URL to the resource */
11815    int n_URL;
11816
11817    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11818        mem_base = xmlMemBlocks();
11819        URL = gen_filepath(n_URL, 0);
11820
11821        ret_val = xmlNanoFTPOpen(URL);
11822        desret_xmlNanoFTPCtxtPtr(ret_val);
11823        call_tests++;
11824        des_filepath(n_URL, URL, 0);
11825        xmlResetLastError();
11826        if (mem_base != xmlMemBlocks()) {
11827            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11828	           xmlMemBlocks() - mem_base);
11829	    test_ret++;
11830            printf(" %d", n_URL);
11831            printf("\n");
11832        }
11833    }
11834    function_tests++;
11835#endif
11836
11837    return(test_ret);
11838}
11839
11840
11841static int
11842test_xmlNanoFTPProxy(void) {
11843    int test_ret = 0;
11844
11845#if defined(LIBXML_FTP_ENABLED)
11846    char * host; /* the proxy host name */
11847    int n_host;
11848    int port; /* the proxy port */
11849    int n_port;
11850    char * user; /* the proxy user name */
11851    int n_user;
11852    char * passwd; /* the proxy password */
11853    int n_passwd;
11854    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11855    int n_type;
11856
11857    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11858    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11859    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11860    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11861    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11862        host = gen_const_char_ptr(n_host, 0);
11863        port = gen_int(n_port, 1);
11864        user = gen_const_char_ptr(n_user, 2);
11865        passwd = gen_const_char_ptr(n_passwd, 3);
11866        type = gen_int(n_type, 4);
11867
11868        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11869        call_tests++;
11870        des_const_char_ptr(n_host, (const char *)host, 0);
11871        des_int(n_port, port, 1);
11872        des_const_char_ptr(n_user, (const char *)user, 2);
11873        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11874        des_int(n_type, type, 4);
11875        xmlResetLastError();
11876    }
11877    }
11878    }
11879    }
11880    }
11881    function_tests++;
11882#endif
11883
11884    return(test_ret);
11885}
11886
11887
11888static int
11889test_xmlNanoFTPQuit(void) {
11890    int test_ret = 0;
11891
11892#if defined(LIBXML_FTP_ENABLED)
11893    int mem_base;
11894    int ret_val;
11895    void * ctx; /* an FTP context */
11896    int n_ctx;
11897
11898    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11899        mem_base = xmlMemBlocks();
11900        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11901
11902        ret_val = xmlNanoFTPQuit(ctx);
11903        desret_int(ret_val);
11904        call_tests++;
11905        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11906        xmlResetLastError();
11907        if (mem_base != xmlMemBlocks()) {
11908            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11909	           xmlMemBlocks() - mem_base);
11910	    test_ret++;
11911            printf(" %d", n_ctx);
11912            printf("\n");
11913        }
11914    }
11915    function_tests++;
11916#endif
11917
11918    return(test_ret);
11919}
11920
11921
11922static int
11923test_xmlNanoFTPRead(void) {
11924    int test_ret = 0;
11925
11926#if defined(LIBXML_FTP_ENABLED)
11927    int mem_base;
11928    int ret_val;
11929    void * ctx; /* the FTP context */
11930    int n_ctx;
11931    void * dest; /* a buffer */
11932    int n_dest;
11933    int len; /* the buffer length */
11934    int n_len;
11935
11936    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11937    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11938    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11939        mem_base = xmlMemBlocks();
11940        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11941        dest = gen_void_ptr(n_dest, 1);
11942        len = gen_int(n_len, 2);
11943
11944        ret_val = xmlNanoFTPRead(ctx, dest, len);
11945        desret_int(ret_val);
11946        call_tests++;
11947        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11948        des_void_ptr(n_dest, dest, 1);
11949        des_int(n_len, len, 2);
11950        xmlResetLastError();
11951        if (mem_base != xmlMemBlocks()) {
11952            printf("Leak of %d blocks found in xmlNanoFTPRead",
11953	           xmlMemBlocks() - mem_base);
11954	    test_ret++;
11955            printf(" %d", n_ctx);
11956            printf(" %d", n_dest);
11957            printf(" %d", n_len);
11958            printf("\n");
11959        }
11960    }
11961    }
11962    }
11963    function_tests++;
11964#endif
11965
11966    return(test_ret);
11967}
11968
11969
11970static int
11971test_xmlNanoFTPScanProxy(void) {
11972    int test_ret = 0;
11973
11974#if defined(LIBXML_FTP_ENABLED)
11975    const char * URL; /* The proxy URL used to initialize the proxy context */
11976    int n_URL;
11977
11978    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11979        URL = gen_filepath(n_URL, 0);
11980
11981        xmlNanoFTPScanProxy(URL);
11982        call_tests++;
11983        des_filepath(n_URL, URL, 0);
11984        xmlResetLastError();
11985    }
11986    function_tests++;
11987#endif
11988
11989    return(test_ret);
11990}
11991
11992
11993static int
11994test_xmlNanoFTPUpdateURL(void) {
11995    int test_ret = 0;
11996
11997#if defined(LIBXML_FTP_ENABLED)
11998    int mem_base;
11999    int ret_val;
12000    void * ctx; /* an FTP context */
12001    int n_ctx;
12002    const char * URL; /* The URL used to update the context */
12003    int n_URL;
12004
12005    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12006    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12007        mem_base = xmlMemBlocks();
12008        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12009        URL = gen_filepath(n_URL, 1);
12010
12011        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12012        desret_int(ret_val);
12013        call_tests++;
12014        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12015        des_filepath(n_URL, URL, 1);
12016        xmlResetLastError();
12017        if (mem_base != xmlMemBlocks()) {
12018            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12019	           xmlMemBlocks() - mem_base);
12020	    test_ret++;
12021            printf(" %d", n_ctx);
12022            printf(" %d", n_URL);
12023            printf("\n");
12024        }
12025    }
12026    }
12027    function_tests++;
12028#endif
12029
12030    return(test_ret);
12031}
12032
12033static int
12034test_nanoftp(void) {
12035    int test_ret = 0;
12036
12037    if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
12038    test_ret += test_xmlNanoFTPCheckResponse();
12039    test_ret += test_xmlNanoFTPCleanup();
12040    test_ret += test_xmlNanoFTPCloseConnection();
12041    test_ret += test_xmlNanoFTPCwd();
12042    test_ret += test_xmlNanoFTPDele();
12043    test_ret += test_xmlNanoFTPGet();
12044    test_ret += test_xmlNanoFTPGetConnection();
12045    test_ret += test_xmlNanoFTPGetResponse();
12046    test_ret += test_xmlNanoFTPGetSocket();
12047    test_ret += test_xmlNanoFTPInit();
12048    test_ret += test_xmlNanoFTPList();
12049    test_ret += test_xmlNanoFTPNewCtxt();
12050    test_ret += test_xmlNanoFTPOpen();
12051    test_ret += test_xmlNanoFTPProxy();
12052    test_ret += test_xmlNanoFTPQuit();
12053    test_ret += test_xmlNanoFTPRead();
12054    test_ret += test_xmlNanoFTPScanProxy();
12055    test_ret += test_xmlNanoFTPUpdateURL();
12056
12057    if (test_ret != 0)
12058	printf("Module nanoftp: %d errors\n", test_ret);
12059    return(test_ret);
12060}
12061
12062static int
12063test_xmlNanoHTTPAuthHeader(void) {
12064    int test_ret = 0;
12065
12066#if defined(LIBXML_HTTP_ENABLED)
12067    int mem_base;
12068    const char * ret_val;
12069    void * ctx; /* the HTTP context */
12070    int n_ctx;
12071
12072    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12073        mem_base = xmlMemBlocks();
12074        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12075
12076        ret_val = xmlNanoHTTPAuthHeader(ctx);
12077        desret_const_char_ptr(ret_val);
12078        call_tests++;
12079        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12080        xmlResetLastError();
12081        if (mem_base != xmlMemBlocks()) {
12082            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12083	           xmlMemBlocks() - mem_base);
12084	    test_ret++;
12085            printf(" %d", n_ctx);
12086            printf("\n");
12087        }
12088    }
12089    function_tests++;
12090#endif
12091
12092    return(test_ret);
12093}
12094
12095
12096static int
12097test_xmlNanoHTTPCleanup(void) {
12098    int test_ret = 0;
12099
12100#if defined(LIBXML_HTTP_ENABLED)
12101    int mem_base;
12102
12103        mem_base = xmlMemBlocks();
12104
12105        xmlNanoHTTPCleanup();
12106        call_tests++;
12107        xmlResetLastError();
12108        if (mem_base != xmlMemBlocks()) {
12109            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12110	           xmlMemBlocks() - mem_base);
12111	    test_ret++;
12112            printf("\n");
12113        }
12114    function_tests++;
12115#endif
12116
12117    return(test_ret);
12118}
12119
12120
12121static int
12122test_xmlNanoHTTPContentLength(void) {
12123    int test_ret = 0;
12124
12125#if defined(LIBXML_HTTP_ENABLED)
12126    int mem_base;
12127    int ret_val;
12128    void * ctx; /* the HTTP context */
12129    int n_ctx;
12130
12131    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12132        mem_base = xmlMemBlocks();
12133        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12134
12135        ret_val = xmlNanoHTTPContentLength(ctx);
12136        desret_int(ret_val);
12137        call_tests++;
12138        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12139        xmlResetLastError();
12140        if (mem_base != xmlMemBlocks()) {
12141            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12142	           xmlMemBlocks() - mem_base);
12143	    test_ret++;
12144            printf(" %d", n_ctx);
12145            printf("\n");
12146        }
12147    }
12148    function_tests++;
12149#endif
12150
12151    return(test_ret);
12152}
12153
12154
12155static int
12156test_xmlNanoHTTPEncoding(void) {
12157    int test_ret = 0;
12158
12159#if defined(LIBXML_HTTP_ENABLED)
12160    int mem_base;
12161    const char * ret_val;
12162    void * ctx; /* the HTTP context */
12163    int n_ctx;
12164
12165    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12166        mem_base = xmlMemBlocks();
12167        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12168
12169        ret_val = xmlNanoHTTPEncoding(ctx);
12170        desret_const_char_ptr(ret_val);
12171        call_tests++;
12172        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12173        xmlResetLastError();
12174        if (mem_base != xmlMemBlocks()) {
12175            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12176	           xmlMemBlocks() - mem_base);
12177	    test_ret++;
12178            printf(" %d", n_ctx);
12179            printf("\n");
12180        }
12181    }
12182    function_tests++;
12183#endif
12184
12185    return(test_ret);
12186}
12187
12188
12189#define gen_nb_char_ptr_ptr 1
12190static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12191    return(NULL);
12192}
12193static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12194}
12195
12196static int
12197test_xmlNanoHTTPFetch(void) {
12198    int test_ret = 0;
12199
12200#if defined(LIBXML_HTTP_ENABLED)
12201    int mem_base;
12202    int ret_val;
12203    const char * URL; /* The URL to load */
12204    int n_URL;
12205    const char * filename; /* the filename where the content should be saved */
12206    int n_filename;
12207    char ** contentType; /* if available the Content-Type information will be returned at that location */
12208    int n_contentType;
12209
12210    for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12211    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12212    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12213        mem_base = xmlMemBlocks();
12214        URL = gen_fileoutput(n_URL, 0);
12215        filename = gen_fileoutput(n_filename, 1);
12216        contentType = gen_char_ptr_ptr(n_contentType, 2);
12217
12218        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12219        desret_int(ret_val);
12220        call_tests++;
12221        des_fileoutput(n_URL, URL, 0);
12222        des_fileoutput(n_filename, filename, 1);
12223        des_char_ptr_ptr(n_contentType, contentType, 2);
12224        xmlResetLastError();
12225        if (mem_base != xmlMemBlocks()) {
12226            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12227	           xmlMemBlocks() - mem_base);
12228	    test_ret++;
12229            printf(" %d", n_URL);
12230            printf(" %d", n_filename);
12231            printf(" %d", n_contentType);
12232            printf("\n");
12233        }
12234    }
12235    }
12236    }
12237    function_tests++;
12238#endif
12239
12240    return(test_ret);
12241}
12242
12243
12244static int
12245test_xmlNanoHTTPInit(void) {
12246    int test_ret = 0;
12247
12248#if defined(LIBXML_HTTP_ENABLED)
12249    int mem_base;
12250
12251        mem_base = xmlMemBlocks();
12252
12253        xmlNanoHTTPInit();
12254        call_tests++;
12255        xmlResetLastError();
12256        if (mem_base != xmlMemBlocks()) {
12257            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12258	           xmlMemBlocks() - mem_base);
12259	    test_ret++;
12260            printf("\n");
12261        }
12262    function_tests++;
12263#endif
12264
12265    return(test_ret);
12266}
12267
12268
12269static int
12270test_xmlNanoHTTPMimeType(void) {
12271    int test_ret = 0;
12272
12273#if defined(LIBXML_HTTP_ENABLED)
12274    int mem_base;
12275    const char * ret_val;
12276    void * ctx; /* the HTTP context */
12277    int n_ctx;
12278
12279    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12280        mem_base = xmlMemBlocks();
12281        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12282
12283        ret_val = xmlNanoHTTPMimeType(ctx);
12284        desret_const_char_ptr(ret_val);
12285        call_tests++;
12286        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12287        xmlResetLastError();
12288        if (mem_base != xmlMemBlocks()) {
12289            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12290	           xmlMemBlocks() - mem_base);
12291	    test_ret++;
12292            printf(" %d", n_ctx);
12293            printf("\n");
12294        }
12295    }
12296    function_tests++;
12297#endif
12298
12299    return(test_ret);
12300}
12301
12302
12303static int
12304test_xmlNanoHTTPOpen(void) {
12305    int test_ret = 0;
12306
12307#if defined(LIBXML_HTTP_ENABLED)
12308    int mem_base;
12309    void * ret_val;
12310    const char * URL; /* The URL to load */
12311    int n_URL;
12312    char ** contentType; /* if available the Content-Type information will be returned at that location */
12313    int n_contentType;
12314
12315    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12316    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12317        mem_base = xmlMemBlocks();
12318        URL = gen_filepath(n_URL, 0);
12319        contentType = gen_char_ptr_ptr(n_contentType, 1);
12320
12321        ret_val = xmlNanoHTTPOpen(URL, contentType);
12322        desret_xmlNanoHTTPCtxtPtr(ret_val);
12323        call_tests++;
12324        des_filepath(n_URL, URL, 0);
12325        des_char_ptr_ptr(n_contentType, contentType, 1);
12326        xmlResetLastError();
12327        if (mem_base != xmlMemBlocks()) {
12328            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12329	           xmlMemBlocks() - mem_base);
12330	    test_ret++;
12331            printf(" %d", n_URL);
12332            printf(" %d", n_contentType);
12333            printf("\n");
12334        }
12335    }
12336    }
12337    function_tests++;
12338#endif
12339
12340    return(test_ret);
12341}
12342
12343
12344static int
12345test_xmlNanoHTTPOpenRedir(void) {
12346    int test_ret = 0;
12347
12348#if defined(LIBXML_HTTP_ENABLED)
12349    int mem_base;
12350    void * ret_val;
12351    const char * URL; /* The URL to load */
12352    int n_URL;
12353    char ** contentType; /* if available the Content-Type information will be returned at that location */
12354    int n_contentType;
12355    char ** redir; /* if available the redirected URL will be returned */
12356    int n_redir;
12357
12358    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12359    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12360    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12361        mem_base = xmlMemBlocks();
12362        URL = gen_filepath(n_URL, 0);
12363        contentType = gen_char_ptr_ptr(n_contentType, 1);
12364        redir = gen_char_ptr_ptr(n_redir, 2);
12365
12366        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12367        desret_xmlNanoHTTPCtxtPtr(ret_val);
12368        call_tests++;
12369        des_filepath(n_URL, URL, 0);
12370        des_char_ptr_ptr(n_contentType, contentType, 1);
12371        des_char_ptr_ptr(n_redir, redir, 2);
12372        xmlResetLastError();
12373        if (mem_base != xmlMemBlocks()) {
12374            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12375	           xmlMemBlocks() - mem_base);
12376	    test_ret++;
12377            printf(" %d", n_URL);
12378            printf(" %d", n_contentType);
12379            printf(" %d", n_redir);
12380            printf("\n");
12381        }
12382    }
12383    }
12384    }
12385    function_tests++;
12386#endif
12387
12388    return(test_ret);
12389}
12390
12391
12392static int
12393test_xmlNanoHTTPRead(void) {
12394    int test_ret = 0;
12395
12396#if defined(LIBXML_HTTP_ENABLED)
12397    int mem_base;
12398    int ret_val;
12399    void * ctx; /* the HTTP context */
12400    int n_ctx;
12401    void * dest; /* a buffer */
12402    int n_dest;
12403    int len; /* the buffer length */
12404    int n_len;
12405
12406    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12407    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12408    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12409        mem_base = xmlMemBlocks();
12410        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12411        dest = gen_void_ptr(n_dest, 1);
12412        len = gen_int(n_len, 2);
12413
12414        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12415        desret_int(ret_val);
12416        call_tests++;
12417        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12418        des_void_ptr(n_dest, dest, 1);
12419        des_int(n_len, len, 2);
12420        xmlResetLastError();
12421        if (mem_base != xmlMemBlocks()) {
12422            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12423	           xmlMemBlocks() - mem_base);
12424	    test_ret++;
12425            printf(" %d", n_ctx);
12426            printf(" %d", n_dest);
12427            printf(" %d", n_len);
12428            printf("\n");
12429        }
12430    }
12431    }
12432    }
12433    function_tests++;
12434#endif
12435
12436    return(test_ret);
12437}
12438
12439
12440static int
12441test_xmlNanoHTTPRedir(void) {
12442    int test_ret = 0;
12443
12444
12445    /* missing type support */
12446    return(test_ret);
12447}
12448
12449
12450static int
12451test_xmlNanoHTTPReturnCode(void) {
12452    int test_ret = 0;
12453
12454#if defined(LIBXML_HTTP_ENABLED)
12455    int mem_base;
12456    int ret_val;
12457    void * ctx; /* the HTTP context */
12458    int n_ctx;
12459
12460    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12461        mem_base = xmlMemBlocks();
12462        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12463
12464        ret_val = xmlNanoHTTPReturnCode(ctx);
12465        desret_int(ret_val);
12466        call_tests++;
12467        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12468        xmlResetLastError();
12469        if (mem_base != xmlMemBlocks()) {
12470            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12471	           xmlMemBlocks() - mem_base);
12472	    test_ret++;
12473            printf(" %d", n_ctx);
12474            printf("\n");
12475        }
12476    }
12477    function_tests++;
12478#endif
12479
12480    return(test_ret);
12481}
12482
12483
12484static int
12485test_xmlNanoHTTPSave(void) {
12486    int test_ret = 0;
12487
12488#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12489    int mem_base;
12490    int ret_val;
12491    void * ctxt; /* the HTTP context */
12492    int n_ctxt;
12493    const char * filename; /* the filename where the content should be saved */
12494    int n_filename;
12495
12496    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12497    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12498        mem_base = xmlMemBlocks();
12499        ctxt = gen_void_ptr(n_ctxt, 0);
12500        filename = gen_fileoutput(n_filename, 1);
12501
12502        ret_val = xmlNanoHTTPSave(ctxt, filename);
12503        desret_int(ret_val);
12504        call_tests++;
12505        des_void_ptr(n_ctxt, ctxt, 0);
12506        des_fileoutput(n_filename, filename, 1);
12507        xmlResetLastError();
12508        if (mem_base != xmlMemBlocks()) {
12509            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12510	           xmlMemBlocks() - mem_base);
12511	    test_ret++;
12512            printf(" %d", n_ctxt);
12513            printf(" %d", n_filename);
12514            printf("\n");
12515        }
12516    }
12517    }
12518    function_tests++;
12519#endif
12520
12521    return(test_ret);
12522}
12523
12524
12525static int
12526test_xmlNanoHTTPScanProxy(void) {
12527    int test_ret = 0;
12528
12529#if defined(LIBXML_HTTP_ENABLED)
12530    const char * URL; /* The proxy URL used to initialize the proxy context */
12531    int n_URL;
12532
12533    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12534        URL = gen_filepath(n_URL, 0);
12535
12536        xmlNanoHTTPScanProxy(URL);
12537        call_tests++;
12538        des_filepath(n_URL, URL, 0);
12539        xmlResetLastError();
12540    }
12541    function_tests++;
12542#endif
12543
12544    return(test_ret);
12545}
12546
12547static int
12548test_nanohttp(void) {
12549    int test_ret = 0;
12550
12551    if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12552    test_ret += test_xmlNanoHTTPAuthHeader();
12553    test_ret += test_xmlNanoHTTPCleanup();
12554    test_ret += test_xmlNanoHTTPContentLength();
12555    test_ret += test_xmlNanoHTTPEncoding();
12556    test_ret += test_xmlNanoHTTPFetch();
12557    test_ret += test_xmlNanoHTTPInit();
12558    test_ret += test_xmlNanoHTTPMimeType();
12559    test_ret += test_xmlNanoHTTPOpen();
12560    test_ret += test_xmlNanoHTTPOpenRedir();
12561    test_ret += test_xmlNanoHTTPRead();
12562    test_ret += test_xmlNanoHTTPRedir();
12563    test_ret += test_xmlNanoHTTPReturnCode();
12564    test_ret += test_xmlNanoHTTPSave();
12565    test_ret += test_xmlNanoHTTPScanProxy();
12566
12567    if (test_ret != 0)
12568	printf("Module nanohttp: %d errors\n", test_ret);
12569    return(test_ret);
12570}
12571
12572static int
12573test_xmlByteConsumed(void) {
12574    int test_ret = 0;
12575
12576    int mem_base;
12577    long ret_val;
12578    xmlParserCtxtPtr ctxt; /* an XML parser context */
12579    int n_ctxt;
12580
12581    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12582        mem_base = xmlMemBlocks();
12583        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12584
12585        ret_val = xmlByteConsumed(ctxt);
12586        desret_long(ret_val);
12587        call_tests++;
12588        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12589        xmlResetLastError();
12590        if (mem_base != xmlMemBlocks()) {
12591            printf("Leak of %d blocks found in xmlByteConsumed",
12592	           xmlMemBlocks() - mem_base);
12593	    test_ret++;
12594            printf(" %d", n_ctxt);
12595            printf("\n");
12596        }
12597    }
12598    function_tests++;
12599
12600    return(test_ret);
12601}
12602
12603
12604static int
12605test_xmlClearNodeInfoSeq(void) {
12606    int test_ret = 0;
12607
12608    int mem_base;
12609    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12610    int n_seq;
12611
12612    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12613        mem_base = xmlMemBlocks();
12614        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12615
12616        xmlClearNodeInfoSeq(seq);
12617        call_tests++;
12618        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12619        xmlResetLastError();
12620        if (mem_base != xmlMemBlocks()) {
12621            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12622	           xmlMemBlocks() - mem_base);
12623	    test_ret++;
12624            printf(" %d", n_seq);
12625            printf("\n");
12626        }
12627    }
12628    function_tests++;
12629
12630    return(test_ret);
12631}
12632
12633
12634static int
12635test_xmlClearParserCtxt(void) {
12636    int test_ret = 0;
12637
12638    int mem_base;
12639    xmlParserCtxtPtr ctxt; /* an XML parser context */
12640    int n_ctxt;
12641
12642    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12643        mem_base = xmlMemBlocks();
12644        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12645
12646        xmlClearParserCtxt(ctxt);
12647        call_tests++;
12648        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12649        xmlResetLastError();
12650        if (mem_base != xmlMemBlocks()) {
12651            printf("Leak of %d blocks found in xmlClearParserCtxt",
12652	           xmlMemBlocks() - mem_base);
12653	    test_ret++;
12654            printf(" %d", n_ctxt);
12655            printf("\n");
12656        }
12657    }
12658    function_tests++;
12659
12660    return(test_ret);
12661}
12662
12663
12664static int
12665test_xmlCreateDocParserCtxt(void) {
12666    int test_ret = 0;
12667
12668    int mem_base;
12669    xmlParserCtxtPtr ret_val;
12670    xmlChar * cur; /* a pointer to an array of xmlChar */
12671    int n_cur;
12672
12673    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12674        mem_base = xmlMemBlocks();
12675        cur = gen_const_xmlChar_ptr(n_cur, 0);
12676
12677        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12678        desret_xmlParserCtxtPtr(ret_val);
12679        call_tests++;
12680        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12681        xmlResetLastError();
12682        if (mem_base != xmlMemBlocks()) {
12683            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12684	           xmlMemBlocks() - mem_base);
12685	    test_ret++;
12686            printf(" %d", n_cur);
12687            printf("\n");
12688        }
12689    }
12690    function_tests++;
12691
12692    return(test_ret);
12693}
12694
12695
12696static int
12697test_xmlCreatePushParserCtxt(void) {
12698    int test_ret = 0;
12699
12700#if defined(LIBXML_PUSH_ENABLED)
12701    int mem_base;
12702    xmlParserCtxtPtr ret_val;
12703    xmlSAXHandlerPtr sax; /* a SAX handler */
12704    int n_sax;
12705    void * user_data; /* The user data returned on SAX callbacks */
12706    int n_user_data;
12707    char * chunk; /* a pointer to an array of chars */
12708    int n_chunk;
12709    int size; /* number of chars in the array */
12710    int n_size;
12711    const char * filename; /* an optional file name or URI */
12712    int n_filename;
12713
12714    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12715    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12716    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12717    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12718    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12719        mem_base = xmlMemBlocks();
12720        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12721        user_data = gen_userdata(n_user_data, 1);
12722        chunk = gen_const_char_ptr(n_chunk, 2);
12723        size = gen_int(n_size, 3);
12724        filename = gen_fileoutput(n_filename, 4);
12725
12726        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12727        desret_xmlParserCtxtPtr(ret_val);
12728        call_tests++;
12729        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12730        des_userdata(n_user_data, user_data, 1);
12731        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12732        des_int(n_size, size, 3);
12733        des_fileoutput(n_filename, filename, 4);
12734        xmlResetLastError();
12735        if (mem_base != xmlMemBlocks()) {
12736            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12737	           xmlMemBlocks() - mem_base);
12738	    test_ret++;
12739            printf(" %d", n_sax);
12740            printf(" %d", n_user_data);
12741            printf(" %d", n_chunk);
12742            printf(" %d", n_size);
12743            printf(" %d", n_filename);
12744            printf("\n");
12745        }
12746    }
12747    }
12748    }
12749    }
12750    }
12751    function_tests++;
12752#endif
12753
12754    return(test_ret);
12755}
12756
12757
12758static int
12759test_xmlCtxtReadDoc(void) {
12760    int test_ret = 0;
12761
12762    int mem_base;
12763    xmlDocPtr ret_val;
12764    xmlParserCtxtPtr ctxt; /* an XML parser context */
12765    int n_ctxt;
12766    xmlChar * cur; /* a pointer to a zero terminated string */
12767    int n_cur;
12768    const char * URL; /* the base URL to use for the document */
12769    int n_URL;
12770    char * encoding; /* the document encoding, or NULL */
12771    int n_encoding;
12772    int options; /* a combination of xmlParserOption */
12773    int n_options;
12774
12775    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12776    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12777    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12778    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12779    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12780        mem_base = xmlMemBlocks();
12781        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12782        cur = gen_const_xmlChar_ptr(n_cur, 1);
12783        URL = gen_filepath(n_URL, 2);
12784        encoding = gen_const_char_ptr(n_encoding, 3);
12785        options = gen_parseroptions(n_options, 4);
12786
12787        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12788        desret_xmlDocPtr(ret_val);
12789        call_tests++;
12790        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12791        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12792        des_filepath(n_URL, URL, 2);
12793        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12794        des_parseroptions(n_options, options, 4);
12795        xmlResetLastError();
12796        if (mem_base != xmlMemBlocks()) {
12797            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12798	           xmlMemBlocks() - mem_base);
12799	    test_ret++;
12800            printf(" %d", n_ctxt);
12801            printf(" %d", n_cur);
12802            printf(" %d", n_URL);
12803            printf(" %d", n_encoding);
12804            printf(" %d", n_options);
12805            printf("\n");
12806        }
12807    }
12808    }
12809    }
12810    }
12811    }
12812    function_tests++;
12813
12814    return(test_ret);
12815}
12816
12817
12818static int
12819test_xmlCtxtReadFile(void) {
12820    int test_ret = 0;
12821
12822    int mem_base;
12823    xmlDocPtr ret_val;
12824    xmlParserCtxtPtr ctxt; /* an XML parser context */
12825    int n_ctxt;
12826    const char * filename; /* a file or URL */
12827    int n_filename;
12828    char * encoding; /* the document encoding, or NULL */
12829    int n_encoding;
12830    int options; /* a combination of xmlParserOption */
12831    int n_options;
12832
12833    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12834    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12835    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12836    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12837        mem_base = xmlMemBlocks();
12838        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12839        filename = gen_filepath(n_filename, 1);
12840        encoding = gen_const_char_ptr(n_encoding, 2);
12841        options = gen_parseroptions(n_options, 3);
12842
12843        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12844        desret_xmlDocPtr(ret_val);
12845        call_tests++;
12846        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12847        des_filepath(n_filename, filename, 1);
12848        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12849        des_parseroptions(n_options, options, 3);
12850        xmlResetLastError();
12851        if (mem_base != xmlMemBlocks()) {
12852            printf("Leak of %d blocks found in xmlCtxtReadFile",
12853	           xmlMemBlocks() - mem_base);
12854	    test_ret++;
12855            printf(" %d", n_ctxt);
12856            printf(" %d", n_filename);
12857            printf(" %d", n_encoding);
12858            printf(" %d", n_options);
12859            printf("\n");
12860        }
12861    }
12862    }
12863    }
12864    }
12865    function_tests++;
12866
12867    return(test_ret);
12868}
12869
12870
12871static int
12872test_xmlCtxtReadMemory(void) {
12873    int test_ret = 0;
12874
12875    int mem_base;
12876    xmlDocPtr ret_val;
12877    xmlParserCtxtPtr ctxt; /* an XML parser context */
12878    int n_ctxt;
12879    char * buffer; /* a pointer to a char array */
12880    int n_buffer;
12881    int size; /* the size of the array */
12882    int n_size;
12883    const char * URL; /* the base URL to use for the document */
12884    int n_URL;
12885    char * encoding; /* the document encoding, or NULL */
12886    int n_encoding;
12887    int options; /* a combination of xmlParserOption */
12888    int n_options;
12889
12890    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12891    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12892    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12893    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12894    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12895    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12896        mem_base = xmlMemBlocks();
12897        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12898        buffer = gen_const_char_ptr(n_buffer, 1);
12899        size = gen_int(n_size, 2);
12900        URL = gen_filepath(n_URL, 3);
12901        encoding = gen_const_char_ptr(n_encoding, 4);
12902        options = gen_parseroptions(n_options, 5);
12903
12904        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12905        desret_xmlDocPtr(ret_val);
12906        call_tests++;
12907        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12908        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12909        des_int(n_size, size, 2);
12910        des_filepath(n_URL, URL, 3);
12911        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12912        des_parseroptions(n_options, options, 5);
12913        xmlResetLastError();
12914        if (mem_base != xmlMemBlocks()) {
12915            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12916	           xmlMemBlocks() - mem_base);
12917	    test_ret++;
12918            printf(" %d", n_ctxt);
12919            printf(" %d", n_buffer);
12920            printf(" %d", n_size);
12921            printf(" %d", n_URL);
12922            printf(" %d", n_encoding);
12923            printf(" %d", n_options);
12924            printf("\n");
12925        }
12926    }
12927    }
12928    }
12929    }
12930    }
12931    }
12932    function_tests++;
12933
12934    return(test_ret);
12935}
12936
12937
12938static int
12939test_xmlCtxtReset(void) {
12940    int test_ret = 0;
12941
12942    int mem_base;
12943    xmlParserCtxtPtr ctxt; /* an XML parser context */
12944    int n_ctxt;
12945
12946    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12947        mem_base = xmlMemBlocks();
12948        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12949
12950        xmlCtxtReset(ctxt);
12951        call_tests++;
12952        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12953        xmlResetLastError();
12954        if (mem_base != xmlMemBlocks()) {
12955            printf("Leak of %d blocks found in xmlCtxtReset",
12956	           xmlMemBlocks() - mem_base);
12957	    test_ret++;
12958            printf(" %d", n_ctxt);
12959            printf("\n");
12960        }
12961    }
12962    function_tests++;
12963
12964    return(test_ret);
12965}
12966
12967
12968static int
12969test_xmlCtxtResetPush(void) {
12970    int test_ret = 0;
12971
12972    int mem_base;
12973    int ret_val;
12974    xmlParserCtxtPtr ctxt; /* an XML parser context */
12975    int n_ctxt;
12976    char * chunk; /* a pointer to an array of chars */
12977    int n_chunk;
12978    int size; /* number of chars in the array */
12979    int n_size;
12980    const char * filename; /* an optional file name or URI */
12981    int n_filename;
12982    char * encoding; /* the document encoding, or NULL */
12983    int n_encoding;
12984
12985    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12986    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12987    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12988    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12989    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12990        mem_base = xmlMemBlocks();
12991        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12992        chunk = gen_const_char_ptr(n_chunk, 1);
12993        size = gen_int(n_size, 2);
12994        filename = gen_filepath(n_filename, 3);
12995        encoding = gen_const_char_ptr(n_encoding, 4);
12996
12997        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
12998        desret_int(ret_val);
12999        call_tests++;
13000        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13001        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13002        des_int(n_size, size, 2);
13003        des_filepath(n_filename, filename, 3);
13004        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13005        xmlResetLastError();
13006        if (mem_base != xmlMemBlocks()) {
13007            printf("Leak of %d blocks found in xmlCtxtResetPush",
13008	           xmlMemBlocks() - mem_base);
13009	    test_ret++;
13010            printf(" %d", n_ctxt);
13011            printf(" %d", n_chunk);
13012            printf(" %d", n_size);
13013            printf(" %d", n_filename);
13014            printf(" %d", n_encoding);
13015            printf("\n");
13016        }
13017    }
13018    }
13019    }
13020    }
13021    }
13022    function_tests++;
13023
13024    return(test_ret);
13025}
13026
13027
13028static int
13029test_xmlCtxtUseOptions(void) {
13030    int test_ret = 0;
13031
13032    int mem_base;
13033    int ret_val;
13034    xmlParserCtxtPtr ctxt; /* an XML parser context */
13035    int n_ctxt;
13036    int options; /* a combination of xmlParserOption */
13037    int n_options;
13038
13039    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13040    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13041        mem_base = xmlMemBlocks();
13042        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13043        options = gen_parseroptions(n_options, 1);
13044
13045        ret_val = xmlCtxtUseOptions(ctxt, options);
13046        desret_int(ret_val);
13047        call_tests++;
13048        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13049        des_parseroptions(n_options, options, 1);
13050        xmlResetLastError();
13051        if (mem_base != xmlMemBlocks()) {
13052            printf("Leak of %d blocks found in xmlCtxtUseOptions",
13053	           xmlMemBlocks() - mem_base);
13054	    test_ret++;
13055            printf(" %d", n_ctxt);
13056            printf(" %d", n_options);
13057            printf("\n");
13058        }
13059    }
13060    }
13061    function_tests++;
13062
13063    return(test_ret);
13064}
13065
13066
13067static int
13068test_xmlGetExternalEntityLoader(void) {
13069    int test_ret = 0;
13070
13071
13072    /* missing type support */
13073    return(test_ret);
13074}
13075
13076
13077static int
13078test_xmlGetFeature(void) {
13079    int test_ret = 0;
13080
13081#if defined(LIBXML_LEGACY_ENABLED)
13082#ifdef LIBXML_LEGACY_ENABLED
13083    int mem_base;
13084    int ret_val;
13085    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13086    int n_ctxt;
13087    char * name; /* the feature name */
13088    int n_name;
13089    void * result; /* location to store the result */
13090    int n_result;
13091
13092    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13093    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13094    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13095        mem_base = xmlMemBlocks();
13096        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13097        name = gen_const_char_ptr(n_name, 1);
13098        result = gen_void_ptr(n_result, 2);
13099
13100        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13101        desret_int(ret_val);
13102        call_tests++;
13103        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13104        des_const_char_ptr(n_name, (const char *)name, 1);
13105        des_void_ptr(n_result, result, 2);
13106        xmlResetLastError();
13107        if (mem_base != xmlMemBlocks()) {
13108            printf("Leak of %d blocks found in xmlGetFeature",
13109	           xmlMemBlocks() - mem_base);
13110	    test_ret++;
13111            printf(" %d", n_ctxt);
13112            printf(" %d", n_name);
13113            printf(" %d", n_result);
13114            printf("\n");
13115        }
13116    }
13117    }
13118    }
13119    function_tests++;
13120#endif
13121#endif
13122
13123    return(test_ret);
13124}
13125
13126
13127#define gen_nb_const_char_ptr_ptr 1
13128static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13129    return(NULL);
13130}
13131static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13132}
13133
13134static int
13135test_xmlGetFeaturesList(void) {
13136    int test_ret = 0;
13137
13138#if defined(LIBXML_LEGACY_ENABLED)
13139#ifdef LIBXML_LEGACY_ENABLED
13140    int mem_base;
13141    int ret_val;
13142    int * len; /* the length of the features name array (input/output) */
13143    int n_len;
13144    char ** result; /* an array of string to be filled with the features name. */
13145    int n_result;
13146
13147    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13148    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13149        mem_base = xmlMemBlocks();
13150        len = gen_int_ptr(n_len, 0);
13151        result = gen_const_char_ptr_ptr(n_result, 1);
13152
13153        ret_val = xmlGetFeaturesList(len, (const char **)result);
13154        desret_int(ret_val);
13155        call_tests++;
13156        des_int_ptr(n_len, len, 0);
13157        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13158        xmlResetLastError();
13159        if (mem_base != xmlMemBlocks()) {
13160            printf("Leak of %d blocks found in xmlGetFeaturesList",
13161	           xmlMemBlocks() - mem_base);
13162	    test_ret++;
13163            printf(" %d", n_len);
13164            printf(" %d", n_result);
13165            printf("\n");
13166        }
13167    }
13168    }
13169    function_tests++;
13170#endif
13171#endif
13172
13173    return(test_ret);
13174}
13175
13176
13177static int
13178test_xmlHasFeature(void) {
13179    int test_ret = 0;
13180
13181    int mem_base;
13182    int ret_val;
13183    xmlFeature feature; /* the feature to be examined */
13184    int n_feature;
13185
13186    for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13187        mem_base = xmlMemBlocks();
13188        feature = gen_xmlFeature(n_feature, 0);
13189
13190        ret_val = xmlHasFeature(feature);
13191        desret_int(ret_val);
13192        call_tests++;
13193        des_xmlFeature(n_feature, feature, 0);
13194        xmlResetLastError();
13195        if (mem_base != xmlMemBlocks()) {
13196            printf("Leak of %d blocks found in xmlHasFeature",
13197	           xmlMemBlocks() - mem_base);
13198	    test_ret++;
13199            printf(" %d", n_feature);
13200            printf("\n");
13201        }
13202    }
13203    function_tests++;
13204
13205    return(test_ret);
13206}
13207
13208
13209static int
13210test_xmlIOParseDTD(void) {
13211    int test_ret = 0;
13212
13213#if defined(LIBXML_VALID_ENABLED)
13214#ifdef LIBXML_VALID_ENABLED
13215    xmlDtdPtr ret_val;
13216    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13217    int n_sax;
13218    xmlParserInputBufferPtr input; /* an Input Buffer */
13219    int n_input;
13220    xmlCharEncoding enc; /* the charset encoding if known */
13221    int n_enc;
13222
13223    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13224    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13225    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13226        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13227        input = gen_xmlParserInputBufferPtr(n_input, 1);
13228        enc = gen_xmlCharEncoding(n_enc, 2);
13229
13230        ret_val = xmlIOParseDTD(sax, input, enc);
13231        input = NULL;
13232        desret_xmlDtdPtr(ret_val);
13233        call_tests++;
13234        des_xmlSAXHandlerPtr(n_sax, sax, 0);
13235        des_xmlParserInputBufferPtr(n_input, input, 1);
13236        des_xmlCharEncoding(n_enc, enc, 2);
13237        xmlResetLastError();
13238    }
13239    }
13240    }
13241    function_tests++;
13242#endif
13243#endif
13244
13245    return(test_ret);
13246}
13247
13248
13249static int
13250test_xmlInitNodeInfoSeq(void) {
13251    int test_ret = 0;
13252
13253    int mem_base;
13254    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13255    int n_seq;
13256
13257    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13258        mem_base = xmlMemBlocks();
13259        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13260
13261        xmlInitNodeInfoSeq(seq);
13262        call_tests++;
13263        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13264        xmlResetLastError();
13265        if (mem_base != xmlMemBlocks()) {
13266            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13267	           xmlMemBlocks() - mem_base);
13268	    test_ret++;
13269            printf(" %d", n_seq);
13270            printf("\n");
13271        }
13272    }
13273    function_tests++;
13274
13275    return(test_ret);
13276}
13277
13278
13279static int
13280test_xmlInitParser(void) {
13281    int test_ret = 0;
13282
13283    int mem_base;
13284
13285        mem_base = xmlMemBlocks();
13286
13287        xmlInitParser();
13288        call_tests++;
13289        xmlResetLastError();
13290        if (mem_base != xmlMemBlocks()) {
13291            printf("Leak of %d blocks found in xmlInitParser",
13292	           xmlMemBlocks() - mem_base);
13293	    test_ret++;
13294            printf("\n");
13295        }
13296    function_tests++;
13297
13298    return(test_ret);
13299}
13300
13301
13302static int
13303test_xmlInitParserCtxt(void) {
13304    int test_ret = 0;
13305
13306    int mem_base;
13307    int ret_val;
13308    xmlParserCtxtPtr ctxt; /* an XML parser context */
13309    int n_ctxt;
13310
13311    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13312        mem_base = xmlMemBlocks();
13313        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13314
13315        ret_val = xmlInitParserCtxt(ctxt);
13316        desret_int(ret_val);
13317        call_tests++;
13318        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13319        xmlResetLastError();
13320        if (mem_base != xmlMemBlocks()) {
13321            printf("Leak of %d blocks found in xmlInitParserCtxt",
13322	           xmlMemBlocks() - mem_base);
13323	    test_ret++;
13324            printf(" %d", n_ctxt);
13325            printf("\n");
13326        }
13327    }
13328    function_tests++;
13329
13330    return(test_ret);
13331}
13332
13333
13334static int
13335test_xmlKeepBlanksDefault(void) {
13336    int test_ret = 0;
13337
13338    int mem_base;
13339    int ret_val;
13340    int val; /* int 0 or 1 */
13341    int n_val;
13342
13343    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13344        mem_base = xmlMemBlocks();
13345        val = gen_int(n_val, 0);
13346
13347        ret_val = xmlKeepBlanksDefault(val);
13348        desret_int(ret_val);
13349        call_tests++;
13350        des_int(n_val, val, 0);
13351        xmlResetLastError();
13352        if (mem_base != xmlMemBlocks()) {
13353            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13354	           xmlMemBlocks() - mem_base);
13355	    test_ret++;
13356            printf(" %d", n_val);
13357            printf("\n");
13358        }
13359    }
13360    function_tests++;
13361
13362    return(test_ret);
13363}
13364
13365
13366static int
13367test_xmlLineNumbersDefault(void) {
13368    int test_ret = 0;
13369
13370    int mem_base;
13371    int ret_val;
13372    int val; /* int 0 or 1 */
13373    int n_val;
13374
13375    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13376        mem_base = xmlMemBlocks();
13377        val = gen_int(n_val, 0);
13378
13379        ret_val = xmlLineNumbersDefault(val);
13380        desret_int(ret_val);
13381        call_tests++;
13382        des_int(n_val, val, 0);
13383        xmlResetLastError();
13384        if (mem_base != xmlMemBlocks()) {
13385            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13386	           xmlMemBlocks() - mem_base);
13387	    test_ret++;
13388            printf(" %d", n_val);
13389            printf("\n");
13390        }
13391    }
13392    function_tests++;
13393
13394    return(test_ret);
13395}
13396
13397
13398static int
13399test_xmlLoadExternalEntity(void) {
13400    int test_ret = 0;
13401
13402    int mem_base;
13403    xmlParserInputPtr ret_val;
13404    const char * URL; /* the URL for the entity to load */
13405    int n_URL;
13406    char * ID; /* the Public ID for the entity to load */
13407    int n_ID;
13408    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13409    int n_ctxt;
13410
13411    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13412    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13413    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13414        mem_base = xmlMemBlocks();
13415        URL = gen_filepath(n_URL, 0);
13416        ID = gen_const_char_ptr(n_ID, 1);
13417        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13418
13419        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13420        desret_xmlParserInputPtr(ret_val);
13421        call_tests++;
13422        des_filepath(n_URL, URL, 0);
13423        des_const_char_ptr(n_ID, (const char *)ID, 1);
13424        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13425        xmlResetLastError();
13426        if (mem_base != xmlMemBlocks()) {
13427            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13428	           xmlMemBlocks() - mem_base);
13429	    test_ret++;
13430            printf(" %d", n_URL);
13431            printf(" %d", n_ID);
13432            printf(" %d", n_ctxt);
13433            printf("\n");
13434        }
13435    }
13436    }
13437    }
13438    function_tests++;
13439
13440    return(test_ret);
13441}
13442
13443
13444static int
13445test_xmlNewIOInputStream(void) {
13446    int test_ret = 0;
13447
13448    int mem_base;
13449    xmlParserInputPtr ret_val;
13450    xmlParserCtxtPtr ctxt; /* an XML parser context */
13451    int n_ctxt;
13452    xmlParserInputBufferPtr input; /* an I/O Input */
13453    int n_input;
13454    xmlCharEncoding enc; /* the charset encoding if known */
13455    int n_enc;
13456
13457    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13458    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13459    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13460        mem_base = xmlMemBlocks();
13461        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13462        input = gen_xmlParserInputBufferPtr(n_input, 1);
13463        enc = gen_xmlCharEncoding(n_enc, 2);
13464
13465        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13466        if (ret_val != NULL) input = NULL;
13467        desret_xmlParserInputPtr(ret_val);
13468        call_tests++;
13469        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13470        des_xmlParserInputBufferPtr(n_input, input, 1);
13471        des_xmlCharEncoding(n_enc, enc, 2);
13472        xmlResetLastError();
13473        if (mem_base != xmlMemBlocks()) {
13474            printf("Leak of %d blocks found in xmlNewIOInputStream",
13475	           xmlMemBlocks() - mem_base);
13476	    test_ret++;
13477            printf(" %d", n_ctxt);
13478            printf(" %d", n_input);
13479            printf(" %d", n_enc);
13480            printf("\n");
13481        }
13482    }
13483    }
13484    }
13485    function_tests++;
13486
13487    return(test_ret);
13488}
13489
13490
13491static int
13492test_xmlNewParserCtxt(void) {
13493    int test_ret = 0;
13494
13495    int mem_base;
13496    xmlParserCtxtPtr ret_val;
13497
13498        mem_base = xmlMemBlocks();
13499
13500        ret_val = xmlNewParserCtxt();
13501        desret_xmlParserCtxtPtr(ret_val);
13502        call_tests++;
13503        xmlResetLastError();
13504        if (mem_base != xmlMemBlocks()) {
13505            printf("Leak of %d blocks found in xmlNewParserCtxt",
13506	           xmlMemBlocks() - mem_base);
13507	    test_ret++;
13508            printf("\n");
13509        }
13510    function_tests++;
13511
13512    return(test_ret);
13513}
13514
13515
13516#define gen_nb_xmlNodePtr_ptr 1
13517static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13518    return(NULL);
13519}
13520static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13521}
13522
13523static int
13524test_xmlParseBalancedChunkMemory(void) {
13525    int test_ret = 0;
13526
13527#if defined(LIBXML_SAX1_ENABLED)
13528#ifdef LIBXML_SAX1_ENABLED
13529    int mem_base;
13530    int ret_val;
13531    xmlDocPtr doc; /* the document the chunk pertains to */
13532    int n_doc;
13533    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13534    int n_sax;
13535    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13536    int n_user_data;
13537    int depth; /* Used for loop detection, use 0 */
13538    int n_depth;
13539    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13540    int n_string;
13541    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13542    int n_lst;
13543
13544    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13545    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13546    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13547    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13548    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13549    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13550        mem_base = xmlMemBlocks();
13551        doc = gen_xmlDocPtr(n_doc, 0);
13552        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13553        user_data = gen_userdata(n_user_data, 2);
13554        depth = gen_int(n_depth, 3);
13555        string = gen_const_xmlChar_ptr(n_string, 4);
13556        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13557
13558#ifdef LIBXML_SAX1_ENABLED
13559        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13560#endif
13561
13562
13563        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13564        desret_int(ret_val);
13565        call_tests++;
13566        des_xmlDocPtr(n_doc, doc, 0);
13567        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13568        des_userdata(n_user_data, user_data, 2);
13569        des_int(n_depth, depth, 3);
13570        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13571        des_xmlNodePtr_ptr(n_lst, lst, 5);
13572        xmlResetLastError();
13573        if (mem_base != xmlMemBlocks()) {
13574            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13575	           xmlMemBlocks() - mem_base);
13576	    test_ret++;
13577            printf(" %d", n_doc);
13578            printf(" %d", n_sax);
13579            printf(" %d", n_user_data);
13580            printf(" %d", n_depth);
13581            printf(" %d", n_string);
13582            printf(" %d", n_lst);
13583            printf("\n");
13584        }
13585    }
13586    }
13587    }
13588    }
13589    }
13590    }
13591    function_tests++;
13592#endif
13593#endif
13594
13595    return(test_ret);
13596}
13597
13598
13599static int
13600test_xmlParseBalancedChunkMemoryRecover(void) {
13601    int test_ret = 0;
13602
13603#if defined(LIBXML_SAX1_ENABLED)
13604#ifdef LIBXML_SAX1_ENABLED
13605    int mem_base;
13606    int ret_val;
13607    xmlDocPtr doc; /* the document the chunk pertains to */
13608    int n_doc;
13609    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13610    int n_sax;
13611    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13612    int n_user_data;
13613    int depth; /* Used for loop detection, use 0 */
13614    int n_depth;
13615    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13616    int n_string;
13617    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13618    int n_lst;
13619    int recover; /* return nodes even if the data is broken (use 0) */
13620    int n_recover;
13621
13622    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13623    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13624    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13625    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13626    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13627    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13628    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13629        mem_base = xmlMemBlocks();
13630        doc = gen_xmlDocPtr(n_doc, 0);
13631        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13632        user_data = gen_userdata(n_user_data, 2);
13633        depth = gen_int(n_depth, 3);
13634        string = gen_const_xmlChar_ptr(n_string, 4);
13635        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13636        recover = gen_int(n_recover, 6);
13637
13638#ifdef LIBXML_SAX1_ENABLED
13639        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13640#endif
13641
13642
13643        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13644        desret_int(ret_val);
13645        call_tests++;
13646        des_xmlDocPtr(n_doc, doc, 0);
13647        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13648        des_userdata(n_user_data, user_data, 2);
13649        des_int(n_depth, depth, 3);
13650        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13651        des_xmlNodePtr_ptr(n_lst, lst, 5);
13652        des_int(n_recover, recover, 6);
13653        xmlResetLastError();
13654        if (mem_base != xmlMemBlocks()) {
13655            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13656	           xmlMemBlocks() - mem_base);
13657	    test_ret++;
13658            printf(" %d", n_doc);
13659            printf(" %d", n_sax);
13660            printf(" %d", n_user_data);
13661            printf(" %d", n_depth);
13662            printf(" %d", n_string);
13663            printf(" %d", n_lst);
13664            printf(" %d", n_recover);
13665            printf("\n");
13666        }
13667    }
13668    }
13669    }
13670    }
13671    }
13672    }
13673    }
13674    function_tests++;
13675#endif
13676#endif
13677
13678    return(test_ret);
13679}
13680
13681
13682static int
13683test_xmlParseChunk(void) {
13684    int test_ret = 0;
13685
13686#if defined(LIBXML_PUSH_ENABLED)
13687    int mem_base;
13688    int ret_val;
13689    xmlParserCtxtPtr ctxt; /* an XML parser context */
13690    int n_ctxt;
13691    char * chunk; /* an char array */
13692    int n_chunk;
13693    int size; /* the size in byte of the chunk */
13694    int n_size;
13695    int terminate; /* last chunk indicator */
13696    int n_terminate;
13697
13698    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13699    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13700    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13701    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13702        mem_base = xmlMemBlocks();
13703        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13704        chunk = gen_const_char_ptr(n_chunk, 1);
13705        size = gen_int(n_size, 2);
13706        terminate = gen_int(n_terminate, 3);
13707
13708        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13709        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13710        desret_int(ret_val);
13711        call_tests++;
13712        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13713        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13714        des_int(n_size, size, 2);
13715        des_int(n_terminate, terminate, 3);
13716        xmlResetLastError();
13717        if (mem_base != xmlMemBlocks()) {
13718            printf("Leak of %d blocks found in xmlParseChunk",
13719	           xmlMemBlocks() - mem_base);
13720	    test_ret++;
13721            printf(" %d", n_ctxt);
13722            printf(" %d", n_chunk);
13723            printf(" %d", n_size);
13724            printf(" %d", n_terminate);
13725            printf("\n");
13726        }
13727    }
13728    }
13729    }
13730    }
13731    function_tests++;
13732#endif
13733
13734    return(test_ret);
13735}
13736
13737
13738static int
13739test_xmlParseCtxtExternalEntity(void) {
13740    int test_ret = 0;
13741
13742    int mem_base;
13743    int ret_val;
13744    xmlParserCtxtPtr ctx; /* the existing parsing context */
13745    int n_ctx;
13746    xmlChar * URL; /* the URL for the entity to load */
13747    int n_URL;
13748    xmlChar * ID; /* the System ID for the entity to load */
13749    int n_ID;
13750    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13751    int n_lst;
13752
13753    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13754    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13755    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13756    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13757        mem_base = xmlMemBlocks();
13758        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13759        URL = gen_const_xmlChar_ptr(n_URL, 1);
13760        ID = gen_const_xmlChar_ptr(n_ID, 2);
13761        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13762
13763        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13764        desret_int(ret_val);
13765        call_tests++;
13766        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13767        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13768        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13769        des_xmlNodePtr_ptr(n_lst, lst, 3);
13770        xmlResetLastError();
13771        if (mem_base != xmlMemBlocks()) {
13772            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13773	           xmlMemBlocks() - mem_base);
13774	    test_ret++;
13775            printf(" %d", n_ctx);
13776            printf(" %d", n_URL);
13777            printf(" %d", n_ID);
13778            printf(" %d", n_lst);
13779            printf("\n");
13780        }
13781    }
13782    }
13783    }
13784    }
13785    function_tests++;
13786
13787    return(test_ret);
13788}
13789
13790
13791static int
13792test_xmlParseDTD(void) {
13793    int test_ret = 0;
13794
13795#if defined(LIBXML_VALID_ENABLED)
13796#ifdef LIBXML_VALID_ENABLED
13797    int mem_base;
13798    xmlDtdPtr ret_val;
13799    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13800    int n_ExternalID;
13801    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13802    int n_SystemID;
13803
13804    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13805    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13806        mem_base = xmlMemBlocks();
13807        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13808        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13809
13810        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13811        desret_xmlDtdPtr(ret_val);
13812        call_tests++;
13813        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13814        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13815        xmlResetLastError();
13816        if (mem_base != xmlMemBlocks()) {
13817            printf("Leak of %d blocks found in xmlParseDTD",
13818	           xmlMemBlocks() - mem_base);
13819	    test_ret++;
13820            printf(" %d", n_ExternalID);
13821            printf(" %d", n_SystemID);
13822            printf("\n");
13823        }
13824    }
13825    }
13826    function_tests++;
13827#endif
13828#endif
13829
13830    return(test_ret);
13831}
13832
13833
13834static int
13835test_xmlParseDoc(void) {
13836    int test_ret = 0;
13837
13838#if defined(LIBXML_SAX1_ENABLED)
13839#ifdef LIBXML_SAX1_ENABLED
13840    int mem_base;
13841    xmlDocPtr ret_val;
13842    xmlChar * cur; /* a pointer to an array of xmlChar */
13843    int n_cur;
13844
13845    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13846        mem_base = xmlMemBlocks();
13847        cur = gen_const_xmlChar_ptr(n_cur, 0);
13848
13849        ret_val = xmlParseDoc((const xmlChar *)cur);
13850        desret_xmlDocPtr(ret_val);
13851        call_tests++;
13852        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13853        xmlResetLastError();
13854        if (mem_base != xmlMemBlocks()) {
13855            printf("Leak of %d blocks found in xmlParseDoc",
13856	           xmlMemBlocks() - mem_base);
13857	    test_ret++;
13858            printf(" %d", n_cur);
13859            printf("\n");
13860        }
13861    }
13862    function_tests++;
13863#endif
13864#endif
13865
13866    return(test_ret);
13867}
13868
13869
13870static int
13871test_xmlParseDocument(void) {
13872    int test_ret = 0;
13873
13874    int mem_base;
13875    int ret_val;
13876    xmlParserCtxtPtr ctxt; /* an XML parser context */
13877    int n_ctxt;
13878
13879    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13880        mem_base = xmlMemBlocks();
13881        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13882
13883        ret_val = xmlParseDocument(ctxt);
13884        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13885        desret_int(ret_val);
13886        call_tests++;
13887        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13888        xmlResetLastError();
13889        if (mem_base != xmlMemBlocks()) {
13890            printf("Leak of %d blocks found in xmlParseDocument",
13891	           xmlMemBlocks() - mem_base);
13892	    test_ret++;
13893            printf(" %d", n_ctxt);
13894            printf("\n");
13895        }
13896    }
13897    function_tests++;
13898
13899    return(test_ret);
13900}
13901
13902
13903static int
13904test_xmlParseEntity(void) {
13905    int test_ret = 0;
13906
13907#if defined(LIBXML_SAX1_ENABLED)
13908#ifdef LIBXML_SAX1_ENABLED
13909    int mem_base;
13910    xmlDocPtr ret_val;
13911    const char * filename; /* the filename */
13912    int n_filename;
13913
13914    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13915        mem_base = xmlMemBlocks();
13916        filename = gen_filepath(n_filename, 0);
13917
13918        ret_val = xmlParseEntity(filename);
13919        desret_xmlDocPtr(ret_val);
13920        call_tests++;
13921        des_filepath(n_filename, filename, 0);
13922        xmlResetLastError();
13923        if (mem_base != xmlMemBlocks()) {
13924            printf("Leak of %d blocks found in xmlParseEntity",
13925	           xmlMemBlocks() - mem_base);
13926	    test_ret++;
13927            printf(" %d", n_filename);
13928            printf("\n");
13929        }
13930    }
13931    function_tests++;
13932#endif
13933#endif
13934
13935    return(test_ret);
13936}
13937
13938
13939static int
13940test_xmlParseExtParsedEnt(void) {
13941    int test_ret = 0;
13942
13943    int mem_base;
13944    int ret_val;
13945    xmlParserCtxtPtr ctxt; /* an XML parser context */
13946    int n_ctxt;
13947
13948    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13949        mem_base = xmlMemBlocks();
13950        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13951
13952        ret_val = xmlParseExtParsedEnt(ctxt);
13953        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13954        desret_int(ret_val);
13955        call_tests++;
13956        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13957        xmlResetLastError();
13958        if (mem_base != xmlMemBlocks()) {
13959            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13960	           xmlMemBlocks() - mem_base);
13961	    test_ret++;
13962            printf(" %d", n_ctxt);
13963            printf("\n");
13964        }
13965    }
13966    function_tests++;
13967
13968    return(test_ret);
13969}
13970
13971
13972static int
13973test_xmlParseExternalEntity(void) {
13974    int test_ret = 0;
13975
13976#if defined(LIBXML_SAX1_ENABLED)
13977#ifdef LIBXML_SAX1_ENABLED
13978    int mem_base;
13979    int ret_val;
13980    xmlDocPtr doc; /* the document the chunk pertains to */
13981    int n_doc;
13982    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13983    int n_sax;
13984    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13985    int n_user_data;
13986    int depth; /* Used for loop detection, use 0 */
13987    int n_depth;
13988    xmlChar * URL; /* the URL for the entity to load */
13989    int n_URL;
13990    xmlChar * ID; /* the System ID for the entity to load */
13991    int n_ID;
13992    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13993    int n_lst;
13994
13995    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13996    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13997    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13998    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13999    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14000    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14001    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14002        mem_base = xmlMemBlocks();
14003        doc = gen_xmlDocPtr(n_doc, 0);
14004        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14005        user_data = gen_userdata(n_user_data, 2);
14006        depth = gen_int(n_depth, 3);
14007        URL = gen_const_xmlChar_ptr(n_URL, 4);
14008        ID = gen_const_xmlChar_ptr(n_ID, 5);
14009        lst = gen_xmlNodePtr_ptr(n_lst, 6);
14010
14011        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14012        desret_int(ret_val);
14013        call_tests++;
14014        des_xmlDocPtr(n_doc, doc, 0);
14015        des_xmlSAXHandlerPtr(n_sax, sax, 1);
14016        des_userdata(n_user_data, user_data, 2);
14017        des_int(n_depth, depth, 3);
14018        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14019        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14020        des_xmlNodePtr_ptr(n_lst, lst, 6);
14021        xmlResetLastError();
14022        if (mem_base != xmlMemBlocks()) {
14023            printf("Leak of %d blocks found in xmlParseExternalEntity",
14024	           xmlMemBlocks() - mem_base);
14025	    test_ret++;
14026            printf(" %d", n_doc);
14027            printf(" %d", n_sax);
14028            printf(" %d", n_user_data);
14029            printf(" %d", n_depth);
14030            printf(" %d", n_URL);
14031            printf(" %d", n_ID);
14032            printf(" %d", n_lst);
14033            printf("\n");
14034        }
14035    }
14036    }
14037    }
14038    }
14039    }
14040    }
14041    }
14042    function_tests++;
14043#endif
14044#endif
14045
14046    return(test_ret);
14047}
14048
14049
14050static int
14051test_xmlParseFile(void) {
14052    int test_ret = 0;
14053
14054#if defined(LIBXML_SAX1_ENABLED)
14055#ifdef LIBXML_SAX1_ENABLED
14056    int mem_base;
14057    xmlDocPtr ret_val;
14058    const char * filename; /* the filename */
14059    int n_filename;
14060
14061    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14062        mem_base = xmlMemBlocks();
14063        filename = gen_filepath(n_filename, 0);
14064
14065        ret_val = xmlParseFile(filename);
14066        desret_xmlDocPtr(ret_val);
14067        call_tests++;
14068        des_filepath(n_filename, filename, 0);
14069        xmlResetLastError();
14070        if (mem_base != xmlMemBlocks()) {
14071            printf("Leak of %d blocks found in xmlParseFile",
14072	           xmlMemBlocks() - mem_base);
14073	    test_ret++;
14074            printf(" %d", n_filename);
14075            printf("\n");
14076        }
14077    }
14078    function_tests++;
14079#endif
14080#endif
14081
14082    return(test_ret);
14083}
14084
14085
14086static int
14087test_xmlParseInNodeContext(void) {
14088    int test_ret = 0;
14089
14090    int mem_base;
14091    xmlParserErrors ret_val;
14092    xmlNodePtr node; /* the context node */
14093    int n_node;
14094    char * data; /* the input string */
14095    int n_data;
14096    int datalen; /* the input string length in bytes */
14097    int n_datalen;
14098    int options; /* a combination of xmlParserOption */
14099    int n_options;
14100    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14101    int n_lst;
14102
14103    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14104    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14105    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14106    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14107    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14108        mem_base = xmlMemBlocks();
14109        node = gen_xmlNodePtr(n_node, 0);
14110        data = gen_const_char_ptr(n_data, 1);
14111        datalen = gen_int(n_datalen, 2);
14112        options = gen_parseroptions(n_options, 3);
14113        lst = gen_xmlNodePtr_ptr(n_lst, 4);
14114
14115        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14116        desret_xmlParserErrors(ret_val);
14117        call_tests++;
14118        des_xmlNodePtr(n_node, node, 0);
14119        des_const_char_ptr(n_data, (const char *)data, 1);
14120        des_int(n_datalen, datalen, 2);
14121        des_parseroptions(n_options, options, 3);
14122        des_xmlNodePtr_ptr(n_lst, lst, 4);
14123        xmlResetLastError();
14124        if (mem_base != xmlMemBlocks()) {
14125            printf("Leak of %d blocks found in xmlParseInNodeContext",
14126	           xmlMemBlocks() - mem_base);
14127	    test_ret++;
14128            printf(" %d", n_node);
14129            printf(" %d", n_data);
14130            printf(" %d", n_datalen);
14131            printf(" %d", n_options);
14132            printf(" %d", n_lst);
14133            printf("\n");
14134        }
14135    }
14136    }
14137    }
14138    }
14139    }
14140    function_tests++;
14141
14142    return(test_ret);
14143}
14144
14145
14146static int
14147test_xmlParseMemory(void) {
14148    int test_ret = 0;
14149
14150#if defined(LIBXML_SAX1_ENABLED)
14151#ifdef LIBXML_SAX1_ENABLED
14152    int mem_base;
14153    xmlDocPtr ret_val;
14154    char * buffer; /* an pointer to a char array */
14155    int n_buffer;
14156    int size; /* the size of the array */
14157    int n_size;
14158
14159    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14160    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14161        mem_base = xmlMemBlocks();
14162        buffer = gen_const_char_ptr(n_buffer, 0);
14163        size = gen_int(n_size, 1);
14164
14165        ret_val = xmlParseMemory((const char *)buffer, size);
14166        desret_xmlDocPtr(ret_val);
14167        call_tests++;
14168        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14169        des_int(n_size, size, 1);
14170        xmlResetLastError();
14171        if (mem_base != xmlMemBlocks()) {
14172            printf("Leak of %d blocks found in xmlParseMemory",
14173	           xmlMemBlocks() - mem_base);
14174	    test_ret++;
14175            printf(" %d", n_buffer);
14176            printf(" %d", n_size);
14177            printf("\n");
14178        }
14179    }
14180    }
14181    function_tests++;
14182#endif
14183#endif
14184
14185    return(test_ret);
14186}
14187
14188
14189#define gen_nb_const_xmlParserNodeInfoPtr 1
14190static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14191    return(NULL);
14192}
14193static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14194}
14195
14196static int
14197test_xmlParserAddNodeInfo(void) {
14198    int test_ret = 0;
14199
14200    int mem_base;
14201    xmlParserCtxtPtr ctxt; /* an XML parser context */
14202    int n_ctxt;
14203    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14204    int n_info;
14205
14206    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14207    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14208        mem_base = xmlMemBlocks();
14209        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14210        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14211
14212        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14213        call_tests++;
14214        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14215        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14216        xmlResetLastError();
14217        if (mem_base != xmlMemBlocks()) {
14218            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14219	           xmlMemBlocks() - mem_base);
14220	    test_ret++;
14221            printf(" %d", n_ctxt);
14222            printf(" %d", n_info);
14223            printf("\n");
14224        }
14225    }
14226    }
14227    function_tests++;
14228
14229    return(test_ret);
14230}
14231
14232
14233#define gen_nb_const_xmlParserCtxtPtr 1
14234static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14235    return(NULL);
14236}
14237static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14238}
14239
14240#define gen_nb_const_xmlNodePtr 1
14241static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14242    return(NULL);
14243}
14244static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14245}
14246
14247static int
14248test_xmlParserFindNodeInfo(void) {
14249    int test_ret = 0;
14250
14251    int mem_base;
14252    const xmlParserNodeInfo * ret_val;
14253    xmlParserCtxtPtr ctx; /* an XML parser context */
14254    int n_ctx;
14255    xmlNodePtr node; /* an XML node within the tree */
14256    int n_node;
14257
14258    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14259    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14260        mem_base = xmlMemBlocks();
14261        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14262        node = gen_const_xmlNodePtr(n_node, 1);
14263
14264        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14265        desret_const_xmlParserNodeInfo_ptr(ret_val);
14266        call_tests++;
14267        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14268        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14269        xmlResetLastError();
14270        if (mem_base != xmlMemBlocks()) {
14271            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14272	           xmlMemBlocks() - mem_base);
14273	    test_ret++;
14274            printf(" %d", n_ctx);
14275            printf(" %d", n_node);
14276            printf("\n");
14277        }
14278    }
14279    }
14280    function_tests++;
14281
14282    return(test_ret);
14283}
14284
14285
14286#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14287static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14288    return(NULL);
14289}
14290static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14291}
14292
14293static int
14294test_xmlParserFindNodeInfoIndex(void) {
14295    int test_ret = 0;
14296
14297    int mem_base;
14298    unsigned long ret_val;
14299    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14300    int n_seq;
14301    xmlNodePtr node; /* an XML node pointer */
14302    int n_node;
14303
14304    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14305    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14306        mem_base = xmlMemBlocks();
14307        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14308        node = gen_const_xmlNodePtr(n_node, 1);
14309
14310        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14311        desret_unsigned_long(ret_val);
14312        call_tests++;
14313        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14314        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14315        xmlResetLastError();
14316        if (mem_base != xmlMemBlocks()) {
14317            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14318	           xmlMemBlocks() - mem_base);
14319	    test_ret++;
14320            printf(" %d", n_seq);
14321            printf(" %d", n_node);
14322            printf("\n");
14323        }
14324    }
14325    }
14326    function_tests++;
14327
14328    return(test_ret);
14329}
14330
14331
14332#define gen_nb_xmlParserInputPtr 1
14333static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14334    return(NULL);
14335}
14336static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14337}
14338
14339static int
14340test_xmlParserInputGrow(void) {
14341    int test_ret = 0;
14342
14343    int mem_base;
14344    int ret_val;
14345    xmlParserInputPtr in; /* an XML parser input */
14346    int n_in;
14347    int len; /* an indicative size for the lookahead */
14348    int n_len;
14349
14350    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14351    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14352        mem_base = xmlMemBlocks();
14353        in = gen_xmlParserInputPtr(n_in, 0);
14354        len = gen_int(n_len, 1);
14355
14356        ret_val = xmlParserInputGrow(in, len);
14357        desret_int(ret_val);
14358        call_tests++;
14359        des_xmlParserInputPtr(n_in, in, 0);
14360        des_int(n_len, len, 1);
14361        xmlResetLastError();
14362        if (mem_base != xmlMemBlocks()) {
14363            printf("Leak of %d blocks found in xmlParserInputGrow",
14364	           xmlMemBlocks() - mem_base);
14365	    test_ret++;
14366            printf(" %d", n_in);
14367            printf(" %d", n_len);
14368            printf("\n");
14369        }
14370    }
14371    }
14372    function_tests++;
14373
14374    return(test_ret);
14375}
14376
14377
14378static int
14379test_xmlParserInputRead(void) {
14380    int test_ret = 0;
14381
14382    int mem_base;
14383    int ret_val;
14384    xmlParserInputPtr in; /* an XML parser input */
14385    int n_in;
14386    int len; /* an indicative size for the lookahead */
14387    int n_len;
14388
14389    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14390    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14391        mem_base = xmlMemBlocks();
14392        in = gen_xmlParserInputPtr(n_in, 0);
14393        len = gen_int(n_len, 1);
14394
14395        ret_val = xmlParserInputRead(in, len);
14396        desret_int(ret_val);
14397        call_tests++;
14398        des_xmlParserInputPtr(n_in, in, 0);
14399        des_int(n_len, len, 1);
14400        xmlResetLastError();
14401        if (mem_base != xmlMemBlocks()) {
14402            printf("Leak of %d blocks found in xmlParserInputRead",
14403	           xmlMemBlocks() - mem_base);
14404	    test_ret++;
14405            printf(" %d", n_in);
14406            printf(" %d", n_len);
14407            printf("\n");
14408        }
14409    }
14410    }
14411    function_tests++;
14412
14413    return(test_ret);
14414}
14415
14416
14417static int
14418test_xmlPedanticParserDefault(void) {
14419    int test_ret = 0;
14420
14421    int mem_base;
14422    int ret_val;
14423    int val; /* int 0 or 1 */
14424    int n_val;
14425
14426    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14427        mem_base = xmlMemBlocks();
14428        val = gen_int(n_val, 0);
14429
14430        ret_val = xmlPedanticParserDefault(val);
14431        desret_int(ret_val);
14432        call_tests++;
14433        des_int(n_val, val, 0);
14434        xmlResetLastError();
14435        if (mem_base != xmlMemBlocks()) {
14436            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14437	           xmlMemBlocks() - mem_base);
14438	    test_ret++;
14439            printf(" %d", n_val);
14440            printf("\n");
14441        }
14442    }
14443    function_tests++;
14444
14445    return(test_ret);
14446}
14447
14448
14449static int
14450test_xmlReadDoc(void) {
14451    int test_ret = 0;
14452
14453    int mem_base;
14454    xmlDocPtr ret_val;
14455    xmlChar * cur; /* a pointer to a zero terminated string */
14456    int n_cur;
14457    const char * URL; /* the base URL to use for the document */
14458    int n_URL;
14459    char * encoding; /* the document encoding, or NULL */
14460    int n_encoding;
14461    int options; /* a combination of xmlParserOption */
14462    int n_options;
14463
14464    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14465    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14466    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14467    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14468        mem_base = xmlMemBlocks();
14469        cur = gen_const_xmlChar_ptr(n_cur, 0);
14470        URL = gen_filepath(n_URL, 1);
14471        encoding = gen_const_char_ptr(n_encoding, 2);
14472        options = gen_parseroptions(n_options, 3);
14473
14474        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14475        desret_xmlDocPtr(ret_val);
14476        call_tests++;
14477        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14478        des_filepath(n_URL, URL, 1);
14479        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14480        des_parseroptions(n_options, options, 3);
14481        xmlResetLastError();
14482        if (mem_base != xmlMemBlocks()) {
14483            printf("Leak of %d blocks found in xmlReadDoc",
14484	           xmlMemBlocks() - mem_base);
14485	    test_ret++;
14486            printf(" %d", n_cur);
14487            printf(" %d", n_URL);
14488            printf(" %d", n_encoding);
14489            printf(" %d", n_options);
14490            printf("\n");
14491        }
14492    }
14493    }
14494    }
14495    }
14496    function_tests++;
14497
14498    return(test_ret);
14499}
14500
14501
14502static int
14503test_xmlReadFile(void) {
14504    int test_ret = 0;
14505
14506    int mem_base;
14507    xmlDocPtr ret_val;
14508    const char * filename; /* a file or URL */
14509    int n_filename;
14510    char * encoding; /* the document encoding, or NULL */
14511    int n_encoding;
14512    int options; /* a combination of xmlParserOption */
14513    int n_options;
14514
14515    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14516    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14517    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14518        mem_base = xmlMemBlocks();
14519        filename = gen_filepath(n_filename, 0);
14520        encoding = gen_const_char_ptr(n_encoding, 1);
14521        options = gen_parseroptions(n_options, 2);
14522
14523        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14524        desret_xmlDocPtr(ret_val);
14525        call_tests++;
14526        des_filepath(n_filename, filename, 0);
14527        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14528        des_parseroptions(n_options, options, 2);
14529        xmlResetLastError();
14530        if (mem_base != xmlMemBlocks()) {
14531            printf("Leak of %d blocks found in xmlReadFile",
14532	           xmlMemBlocks() - mem_base);
14533	    test_ret++;
14534            printf(" %d", n_filename);
14535            printf(" %d", n_encoding);
14536            printf(" %d", n_options);
14537            printf("\n");
14538        }
14539    }
14540    }
14541    }
14542    function_tests++;
14543
14544    return(test_ret);
14545}
14546
14547
14548static int
14549test_xmlReadMemory(void) {
14550    int test_ret = 0;
14551
14552    int mem_base;
14553    xmlDocPtr ret_val;
14554    char * buffer; /* a pointer to a char array */
14555    int n_buffer;
14556    int size; /* the size of the array */
14557    int n_size;
14558    const char * URL; /* the base URL to use for the document */
14559    int n_URL;
14560    char * encoding; /* the document encoding, or NULL */
14561    int n_encoding;
14562    int options; /* a combination of xmlParserOption */
14563    int n_options;
14564
14565    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14566    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14567    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14568    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14569    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14570        mem_base = xmlMemBlocks();
14571        buffer = gen_const_char_ptr(n_buffer, 0);
14572        size = gen_int(n_size, 1);
14573        URL = gen_filepath(n_URL, 2);
14574        encoding = gen_const_char_ptr(n_encoding, 3);
14575        options = gen_parseroptions(n_options, 4);
14576
14577        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14578        desret_xmlDocPtr(ret_val);
14579        call_tests++;
14580        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14581        des_int(n_size, size, 1);
14582        des_filepath(n_URL, URL, 2);
14583        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14584        des_parseroptions(n_options, options, 4);
14585        xmlResetLastError();
14586        if (mem_base != xmlMemBlocks()) {
14587            printf("Leak of %d blocks found in xmlReadMemory",
14588	           xmlMemBlocks() - mem_base);
14589	    test_ret++;
14590            printf(" %d", n_buffer);
14591            printf(" %d", n_size);
14592            printf(" %d", n_URL);
14593            printf(" %d", n_encoding);
14594            printf(" %d", n_options);
14595            printf("\n");
14596        }
14597    }
14598    }
14599    }
14600    }
14601    }
14602    function_tests++;
14603
14604    return(test_ret);
14605}
14606
14607
14608static int
14609test_xmlRecoverDoc(void) {
14610    int test_ret = 0;
14611
14612#if defined(LIBXML_SAX1_ENABLED)
14613#ifdef LIBXML_SAX1_ENABLED
14614    int mem_base;
14615    xmlDocPtr ret_val;
14616    xmlChar * cur; /* a pointer to an array of xmlChar */
14617    int n_cur;
14618
14619    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14620        mem_base = xmlMemBlocks();
14621        cur = gen_xmlChar_ptr(n_cur, 0);
14622
14623        ret_val = xmlRecoverDoc(cur);
14624        desret_xmlDocPtr(ret_val);
14625        call_tests++;
14626        des_xmlChar_ptr(n_cur, cur, 0);
14627        xmlResetLastError();
14628        if (mem_base != xmlMemBlocks()) {
14629            printf("Leak of %d blocks found in xmlRecoverDoc",
14630	           xmlMemBlocks() - mem_base);
14631	    test_ret++;
14632            printf(" %d", n_cur);
14633            printf("\n");
14634        }
14635    }
14636    function_tests++;
14637#endif
14638#endif
14639
14640    return(test_ret);
14641}
14642
14643
14644static int
14645test_xmlRecoverFile(void) {
14646    int test_ret = 0;
14647
14648#if defined(LIBXML_SAX1_ENABLED)
14649#ifdef LIBXML_SAX1_ENABLED
14650    int mem_base;
14651    xmlDocPtr ret_val;
14652    const char * filename; /* the filename */
14653    int n_filename;
14654
14655    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14656        mem_base = xmlMemBlocks();
14657        filename = gen_filepath(n_filename, 0);
14658
14659        ret_val = xmlRecoverFile(filename);
14660        desret_xmlDocPtr(ret_val);
14661        call_tests++;
14662        des_filepath(n_filename, filename, 0);
14663        xmlResetLastError();
14664        if (mem_base != xmlMemBlocks()) {
14665            printf("Leak of %d blocks found in xmlRecoverFile",
14666	           xmlMemBlocks() - mem_base);
14667	    test_ret++;
14668            printf(" %d", n_filename);
14669            printf("\n");
14670        }
14671    }
14672    function_tests++;
14673#endif
14674#endif
14675
14676    return(test_ret);
14677}
14678
14679
14680static int
14681test_xmlRecoverMemory(void) {
14682    int test_ret = 0;
14683
14684#if defined(LIBXML_SAX1_ENABLED)
14685#ifdef LIBXML_SAX1_ENABLED
14686    int mem_base;
14687    xmlDocPtr ret_val;
14688    char * buffer; /* an pointer to a char array */
14689    int n_buffer;
14690    int size; /* the size of the array */
14691    int n_size;
14692
14693    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14694    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14695        mem_base = xmlMemBlocks();
14696        buffer = gen_const_char_ptr(n_buffer, 0);
14697        size = gen_int(n_size, 1);
14698
14699        ret_val = xmlRecoverMemory((const char *)buffer, size);
14700        desret_xmlDocPtr(ret_val);
14701        call_tests++;
14702        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14703        des_int(n_size, size, 1);
14704        xmlResetLastError();
14705        if (mem_base != xmlMemBlocks()) {
14706            printf("Leak of %d blocks found in xmlRecoverMemory",
14707	           xmlMemBlocks() - mem_base);
14708	    test_ret++;
14709            printf(" %d", n_buffer);
14710            printf(" %d", n_size);
14711            printf("\n");
14712        }
14713    }
14714    }
14715    function_tests++;
14716#endif
14717#endif
14718
14719    return(test_ret);
14720}
14721
14722
14723static int
14724test_xmlSAXParseDTD(void) {
14725    int test_ret = 0;
14726
14727#if defined(LIBXML_VALID_ENABLED)
14728#ifdef LIBXML_SAX1_ENABLED
14729    int mem_base;
14730    xmlDtdPtr ret_val;
14731    xmlSAXHandlerPtr sax; /* the SAX handler block */
14732    int n_sax;
14733    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14734    int n_ExternalID;
14735    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14736    int n_SystemID;
14737
14738    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14739    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14740    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14741        mem_base = xmlMemBlocks();
14742        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14743        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14744        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14745
14746        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14747        desret_xmlDtdPtr(ret_val);
14748        call_tests++;
14749        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14750        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14751        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14752        xmlResetLastError();
14753        if (mem_base != xmlMemBlocks()) {
14754            printf("Leak of %d blocks found in xmlSAXParseDTD",
14755	           xmlMemBlocks() - mem_base);
14756	    test_ret++;
14757            printf(" %d", n_sax);
14758            printf(" %d", n_ExternalID);
14759            printf(" %d", n_SystemID);
14760            printf("\n");
14761        }
14762    }
14763    }
14764    }
14765    function_tests++;
14766#endif
14767#endif
14768
14769    return(test_ret);
14770}
14771
14772
14773static int
14774test_xmlSAXParseDoc(void) {
14775    int test_ret = 0;
14776
14777#if defined(LIBXML_SAX1_ENABLED)
14778#ifdef LIBXML_SAX1_ENABLED
14779    int mem_base;
14780    xmlDocPtr ret_val;
14781    xmlSAXHandlerPtr sax; /* the SAX handler block */
14782    int n_sax;
14783    xmlChar * cur; /* a pointer to an array of xmlChar */
14784    int n_cur;
14785    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14786    int n_recovery;
14787
14788    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14789    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14790    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14791        mem_base = xmlMemBlocks();
14792        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14793        cur = gen_const_xmlChar_ptr(n_cur, 1);
14794        recovery = gen_int(n_recovery, 2);
14795
14796        ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14797        desret_xmlDocPtr(ret_val);
14798        call_tests++;
14799        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14800        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14801        des_int(n_recovery, recovery, 2);
14802        xmlResetLastError();
14803        if (mem_base != xmlMemBlocks()) {
14804            printf("Leak of %d blocks found in xmlSAXParseDoc",
14805	           xmlMemBlocks() - mem_base);
14806	    test_ret++;
14807            printf(" %d", n_sax);
14808            printf(" %d", n_cur);
14809            printf(" %d", n_recovery);
14810            printf("\n");
14811        }
14812    }
14813    }
14814    }
14815    function_tests++;
14816#endif
14817#endif
14818
14819    return(test_ret);
14820}
14821
14822
14823static int
14824test_xmlSAXParseEntity(void) {
14825    int test_ret = 0;
14826
14827#if defined(LIBXML_SAX1_ENABLED)
14828#ifdef LIBXML_SAX1_ENABLED
14829    int mem_base;
14830    xmlDocPtr ret_val;
14831    xmlSAXHandlerPtr sax; /* the SAX handler block */
14832    int n_sax;
14833    const char * filename; /* the filename */
14834    int n_filename;
14835
14836    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14837    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14838        mem_base = xmlMemBlocks();
14839        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14840        filename = gen_filepath(n_filename, 1);
14841
14842        ret_val = xmlSAXParseEntity(sax, filename);
14843        desret_xmlDocPtr(ret_val);
14844        call_tests++;
14845        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14846        des_filepath(n_filename, filename, 1);
14847        xmlResetLastError();
14848        if (mem_base != xmlMemBlocks()) {
14849            printf("Leak of %d blocks found in xmlSAXParseEntity",
14850	           xmlMemBlocks() - mem_base);
14851	    test_ret++;
14852            printf(" %d", n_sax);
14853            printf(" %d", n_filename);
14854            printf("\n");
14855        }
14856    }
14857    }
14858    function_tests++;
14859#endif
14860#endif
14861
14862    return(test_ret);
14863}
14864
14865
14866static int
14867test_xmlSAXParseFile(void) {
14868    int test_ret = 0;
14869
14870#if defined(LIBXML_SAX1_ENABLED)
14871#ifdef LIBXML_SAX1_ENABLED
14872    int mem_base;
14873    xmlDocPtr ret_val;
14874    xmlSAXHandlerPtr sax; /* the SAX handler block */
14875    int n_sax;
14876    const char * filename; /* the filename */
14877    int n_filename;
14878    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14879    int n_recovery;
14880
14881    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14882    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14883    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14884        mem_base = xmlMemBlocks();
14885        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14886        filename = gen_filepath(n_filename, 1);
14887        recovery = gen_int(n_recovery, 2);
14888
14889        ret_val = xmlSAXParseFile(sax, filename, recovery);
14890        desret_xmlDocPtr(ret_val);
14891        call_tests++;
14892        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14893        des_filepath(n_filename, filename, 1);
14894        des_int(n_recovery, recovery, 2);
14895        xmlResetLastError();
14896        if (mem_base != xmlMemBlocks()) {
14897            printf("Leak of %d blocks found in xmlSAXParseFile",
14898	           xmlMemBlocks() - mem_base);
14899	    test_ret++;
14900            printf(" %d", n_sax);
14901            printf(" %d", n_filename);
14902            printf(" %d", n_recovery);
14903            printf("\n");
14904        }
14905    }
14906    }
14907    }
14908    function_tests++;
14909#endif
14910#endif
14911
14912    return(test_ret);
14913}
14914
14915
14916static int
14917test_xmlSAXParseFileWithData(void) {
14918    int test_ret = 0;
14919
14920#if defined(LIBXML_SAX1_ENABLED)
14921#ifdef LIBXML_SAX1_ENABLED
14922    int mem_base;
14923    xmlDocPtr ret_val;
14924    xmlSAXHandlerPtr sax; /* the SAX handler block */
14925    int n_sax;
14926    const char * filename; /* the filename */
14927    int n_filename;
14928    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14929    int n_recovery;
14930    void * data; /* the userdata */
14931    int n_data;
14932
14933    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14934    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14935    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14936    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14937        mem_base = xmlMemBlocks();
14938        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14939        filename = gen_filepath(n_filename, 1);
14940        recovery = gen_int(n_recovery, 2);
14941        data = gen_userdata(n_data, 3);
14942
14943        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14944        desret_xmlDocPtr(ret_val);
14945        call_tests++;
14946        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14947        des_filepath(n_filename, filename, 1);
14948        des_int(n_recovery, recovery, 2);
14949        des_userdata(n_data, data, 3);
14950        xmlResetLastError();
14951        if (mem_base != xmlMemBlocks()) {
14952            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14953	           xmlMemBlocks() - mem_base);
14954	    test_ret++;
14955            printf(" %d", n_sax);
14956            printf(" %d", n_filename);
14957            printf(" %d", n_recovery);
14958            printf(" %d", n_data);
14959            printf("\n");
14960        }
14961    }
14962    }
14963    }
14964    }
14965    function_tests++;
14966#endif
14967#endif
14968
14969    return(test_ret);
14970}
14971
14972
14973static int
14974test_xmlSAXParseMemory(void) {
14975    int test_ret = 0;
14976
14977#if defined(LIBXML_SAX1_ENABLED)
14978#ifdef LIBXML_SAX1_ENABLED
14979    int mem_base;
14980    xmlDocPtr ret_val;
14981    xmlSAXHandlerPtr sax; /* the SAX handler block */
14982    int n_sax;
14983    char * buffer; /* an pointer to a char array */
14984    int n_buffer;
14985    int size; /* the size of the array */
14986    int n_size;
14987    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14988    int n_recovery;
14989
14990    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14991    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14992    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14993    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14994        mem_base = xmlMemBlocks();
14995        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14996        buffer = gen_const_char_ptr(n_buffer, 1);
14997        size = gen_int(n_size, 2);
14998        recovery = gen_int(n_recovery, 3);
14999
15000        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15001        desret_xmlDocPtr(ret_val);
15002        call_tests++;
15003        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15004        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15005        des_int(n_size, size, 2);
15006        des_int(n_recovery, recovery, 3);
15007        xmlResetLastError();
15008        if (mem_base != xmlMemBlocks()) {
15009            printf("Leak of %d blocks found in xmlSAXParseMemory",
15010	           xmlMemBlocks() - mem_base);
15011	    test_ret++;
15012            printf(" %d", n_sax);
15013            printf(" %d", n_buffer);
15014            printf(" %d", n_size);
15015            printf(" %d", n_recovery);
15016            printf("\n");
15017        }
15018    }
15019    }
15020    }
15021    }
15022    function_tests++;
15023#endif
15024#endif
15025
15026    return(test_ret);
15027}
15028
15029
15030static int
15031test_xmlSAXParseMemoryWithData(void) {
15032    int test_ret = 0;
15033
15034#if defined(LIBXML_SAX1_ENABLED)
15035#ifdef LIBXML_SAX1_ENABLED
15036    int mem_base;
15037    xmlDocPtr ret_val;
15038    xmlSAXHandlerPtr sax; /* the SAX handler block */
15039    int n_sax;
15040    char * buffer; /* an pointer to a char array */
15041    int n_buffer;
15042    int size; /* the size of the array */
15043    int n_size;
15044    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15045    int n_recovery;
15046    void * data; /* the userdata */
15047    int n_data;
15048
15049    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15050    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15051    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15052    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15053    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15054        mem_base = xmlMemBlocks();
15055        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15056        buffer = gen_const_char_ptr(n_buffer, 1);
15057        size = gen_int(n_size, 2);
15058        recovery = gen_int(n_recovery, 3);
15059        data = gen_userdata(n_data, 4);
15060
15061        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15062        desret_xmlDocPtr(ret_val);
15063        call_tests++;
15064        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15065        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15066        des_int(n_size, size, 2);
15067        des_int(n_recovery, recovery, 3);
15068        des_userdata(n_data, data, 4);
15069        xmlResetLastError();
15070        if (mem_base != xmlMemBlocks()) {
15071            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15072	           xmlMemBlocks() - mem_base);
15073	    test_ret++;
15074            printf(" %d", n_sax);
15075            printf(" %d", n_buffer);
15076            printf(" %d", n_size);
15077            printf(" %d", n_recovery);
15078            printf(" %d", n_data);
15079            printf("\n");
15080        }
15081    }
15082    }
15083    }
15084    }
15085    }
15086    function_tests++;
15087#endif
15088#endif
15089
15090    return(test_ret);
15091}
15092
15093
15094static int
15095test_xmlSAXUserParseFile(void) {
15096    int test_ret = 0;
15097
15098#if defined(LIBXML_SAX1_ENABLED)
15099#ifdef LIBXML_SAX1_ENABLED
15100    int mem_base;
15101    int ret_val;
15102    xmlSAXHandlerPtr sax; /* a SAX handler */
15103    int n_sax;
15104    void * user_data; /* The user data returned on SAX callbacks */
15105    int n_user_data;
15106    const char * filename; /* a file name */
15107    int n_filename;
15108
15109    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15110    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15111    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15112        mem_base = xmlMemBlocks();
15113        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15114        user_data = gen_userdata(n_user_data, 1);
15115        filename = gen_filepath(n_filename, 2);
15116
15117#ifdef LIBXML_SAX1_ENABLED
15118        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15119#endif
15120
15121
15122        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15123        desret_int(ret_val);
15124        call_tests++;
15125        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15126        des_userdata(n_user_data, user_data, 1);
15127        des_filepath(n_filename, filename, 2);
15128        xmlResetLastError();
15129        if (mem_base != xmlMemBlocks()) {
15130            printf("Leak of %d blocks found in xmlSAXUserParseFile",
15131	           xmlMemBlocks() - mem_base);
15132	    test_ret++;
15133            printf(" %d", n_sax);
15134            printf(" %d", n_user_data);
15135            printf(" %d", n_filename);
15136            printf("\n");
15137        }
15138    }
15139    }
15140    }
15141    function_tests++;
15142#endif
15143#endif
15144
15145    return(test_ret);
15146}
15147
15148
15149static int
15150test_xmlSAXUserParseMemory(void) {
15151    int test_ret = 0;
15152
15153#if defined(LIBXML_SAX1_ENABLED)
15154#ifdef LIBXML_SAX1_ENABLED
15155    int mem_base;
15156    int ret_val;
15157    xmlSAXHandlerPtr sax; /* a SAX handler */
15158    int n_sax;
15159    void * user_data; /* The user data returned on SAX callbacks */
15160    int n_user_data;
15161    char * buffer; /* an in-memory XML document input */
15162    int n_buffer;
15163    int size; /* the length of the XML document in bytes */
15164    int n_size;
15165
15166    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15167    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15168    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15169    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15170        mem_base = xmlMemBlocks();
15171        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15172        user_data = gen_userdata(n_user_data, 1);
15173        buffer = gen_const_char_ptr(n_buffer, 2);
15174        size = gen_int(n_size, 3);
15175
15176#ifdef LIBXML_SAX1_ENABLED
15177        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15178#endif
15179
15180
15181        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15182        desret_int(ret_val);
15183        call_tests++;
15184        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15185        des_userdata(n_user_data, user_data, 1);
15186        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15187        des_int(n_size, size, 3);
15188        xmlResetLastError();
15189        if (mem_base != xmlMemBlocks()) {
15190            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15191	           xmlMemBlocks() - mem_base);
15192	    test_ret++;
15193            printf(" %d", n_sax);
15194            printf(" %d", n_user_data);
15195            printf(" %d", n_buffer);
15196            printf(" %d", n_size);
15197            printf("\n");
15198        }
15199    }
15200    }
15201    }
15202    }
15203    function_tests++;
15204#endif
15205#endif
15206
15207    return(test_ret);
15208}
15209
15210
15211static int
15212test_xmlSetExternalEntityLoader(void) {
15213    int test_ret = 0;
15214
15215
15216    /* missing type support */
15217    return(test_ret);
15218}
15219
15220
15221static int
15222test_xmlSetFeature(void) {
15223    int test_ret = 0;
15224
15225#if defined(LIBXML_LEGACY_ENABLED)
15226#ifdef LIBXML_LEGACY_ENABLED
15227    int mem_base;
15228    int ret_val;
15229    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15230    int n_ctxt;
15231    char * name; /* the feature name */
15232    int n_name;
15233    void * value; /* pointer to the location of the new value */
15234    int n_value;
15235
15236    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15237    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15238    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15239        mem_base = xmlMemBlocks();
15240        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15241        name = gen_const_char_ptr(n_name, 1);
15242        value = gen_void_ptr(n_value, 2);
15243
15244        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15245        desret_int(ret_val);
15246        call_tests++;
15247        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15248        des_const_char_ptr(n_name, (const char *)name, 1);
15249        des_void_ptr(n_value, value, 2);
15250        xmlResetLastError();
15251        if (mem_base != xmlMemBlocks()) {
15252            printf("Leak of %d blocks found in xmlSetFeature",
15253	           xmlMemBlocks() - mem_base);
15254	    test_ret++;
15255            printf(" %d", n_ctxt);
15256            printf(" %d", n_name);
15257            printf(" %d", n_value);
15258            printf("\n");
15259        }
15260    }
15261    }
15262    }
15263    function_tests++;
15264#endif
15265#endif
15266
15267    return(test_ret);
15268}
15269
15270
15271static int
15272test_xmlSetupParserForBuffer(void) {
15273    int test_ret = 0;
15274
15275#if defined(LIBXML_SAX1_ENABLED)
15276#ifdef LIBXML_SAX1_ENABLED
15277    int mem_base;
15278    xmlParserCtxtPtr ctxt; /* an XML parser context */
15279    int n_ctxt;
15280    xmlChar * buffer; /* a xmlChar * buffer */
15281    int n_buffer;
15282    const char * filename; /* a file name */
15283    int n_filename;
15284
15285    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15286    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15287    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15288        mem_base = xmlMemBlocks();
15289        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15290        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15291        filename = gen_filepath(n_filename, 2);
15292
15293        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15294        call_tests++;
15295        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15296        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15297        des_filepath(n_filename, filename, 2);
15298        xmlResetLastError();
15299        if (mem_base != xmlMemBlocks()) {
15300            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15301	           xmlMemBlocks() - mem_base);
15302	    test_ret++;
15303            printf(" %d", n_ctxt);
15304            printf(" %d", n_buffer);
15305            printf(" %d", n_filename);
15306            printf("\n");
15307        }
15308    }
15309    }
15310    }
15311    function_tests++;
15312#endif
15313#endif
15314
15315    return(test_ret);
15316}
15317
15318
15319static int
15320test_xmlStopParser(void) {
15321    int test_ret = 0;
15322
15323#ifdef LIBXML_PUSH_ENABLED
15324    int mem_base;
15325    xmlParserCtxtPtr ctxt; /* an XML parser context */
15326    int n_ctxt;
15327
15328    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15329        mem_base = xmlMemBlocks();
15330        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15331
15332        xmlStopParser(ctxt);
15333        call_tests++;
15334        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15335        xmlResetLastError();
15336        if (mem_base != xmlMemBlocks()) {
15337            printf("Leak of %d blocks found in xmlStopParser",
15338	           xmlMemBlocks() - mem_base);
15339	    test_ret++;
15340            printf(" %d", n_ctxt);
15341            printf("\n");
15342        }
15343    }
15344    function_tests++;
15345#endif
15346
15347    return(test_ret);
15348}
15349
15350
15351static int
15352test_xmlSubstituteEntitiesDefault(void) {
15353    int test_ret = 0;
15354
15355    int mem_base;
15356    int ret_val;
15357    int val; /* int 0 or 1 */
15358    int n_val;
15359
15360    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15361        mem_base = xmlMemBlocks();
15362        val = gen_int(n_val, 0);
15363
15364        ret_val = xmlSubstituteEntitiesDefault(val);
15365        desret_int(ret_val);
15366        call_tests++;
15367        des_int(n_val, val, 0);
15368        xmlResetLastError();
15369        if (mem_base != xmlMemBlocks()) {
15370            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15371	           xmlMemBlocks() - mem_base);
15372	    test_ret++;
15373            printf(" %d", n_val);
15374            printf("\n");
15375        }
15376    }
15377    function_tests++;
15378
15379    return(test_ret);
15380}
15381
15382static int
15383test_parser(void) {
15384    int test_ret = 0;
15385
15386    if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15387    test_ret += test_xmlByteConsumed();
15388    test_ret += test_xmlClearNodeInfoSeq();
15389    test_ret += test_xmlClearParserCtxt();
15390    test_ret += test_xmlCreateDocParserCtxt();
15391    test_ret += test_xmlCreatePushParserCtxt();
15392    test_ret += test_xmlCtxtReadDoc();
15393    test_ret += test_xmlCtxtReadFile();
15394    test_ret += test_xmlCtxtReadMemory();
15395    test_ret += test_xmlCtxtReset();
15396    test_ret += test_xmlCtxtResetPush();
15397    test_ret += test_xmlCtxtUseOptions();
15398    test_ret += test_xmlGetExternalEntityLoader();
15399    test_ret += test_xmlGetFeature();
15400    test_ret += test_xmlGetFeaturesList();
15401    test_ret += test_xmlHasFeature();
15402    test_ret += test_xmlIOParseDTD();
15403    test_ret += test_xmlInitNodeInfoSeq();
15404    test_ret += test_xmlInitParser();
15405    test_ret += test_xmlInitParserCtxt();
15406    test_ret += test_xmlKeepBlanksDefault();
15407    test_ret += test_xmlLineNumbersDefault();
15408    test_ret += test_xmlLoadExternalEntity();
15409    test_ret += test_xmlNewIOInputStream();
15410    test_ret += test_xmlNewParserCtxt();
15411    test_ret += test_xmlParseBalancedChunkMemory();
15412    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15413    test_ret += test_xmlParseChunk();
15414    test_ret += test_xmlParseCtxtExternalEntity();
15415    test_ret += test_xmlParseDTD();
15416    test_ret += test_xmlParseDoc();
15417    test_ret += test_xmlParseDocument();
15418    test_ret += test_xmlParseEntity();
15419    test_ret += test_xmlParseExtParsedEnt();
15420    test_ret += test_xmlParseExternalEntity();
15421    test_ret += test_xmlParseFile();
15422    test_ret += test_xmlParseInNodeContext();
15423    test_ret += test_xmlParseMemory();
15424    test_ret += test_xmlParserAddNodeInfo();
15425    test_ret += test_xmlParserFindNodeInfo();
15426    test_ret += test_xmlParserFindNodeInfoIndex();
15427    test_ret += test_xmlParserInputGrow();
15428    test_ret += test_xmlParserInputRead();
15429    test_ret += test_xmlPedanticParserDefault();
15430    test_ret += test_xmlReadDoc();
15431    test_ret += test_xmlReadFile();
15432    test_ret += test_xmlReadMemory();
15433    test_ret += test_xmlRecoverDoc();
15434    test_ret += test_xmlRecoverFile();
15435    test_ret += test_xmlRecoverMemory();
15436    test_ret += test_xmlSAXParseDTD();
15437    test_ret += test_xmlSAXParseDoc();
15438    test_ret += test_xmlSAXParseEntity();
15439    test_ret += test_xmlSAXParseFile();
15440    test_ret += test_xmlSAXParseFileWithData();
15441    test_ret += test_xmlSAXParseMemory();
15442    test_ret += test_xmlSAXParseMemoryWithData();
15443    test_ret += test_xmlSAXUserParseFile();
15444    test_ret += test_xmlSAXUserParseMemory();
15445    test_ret += test_xmlSetExternalEntityLoader();
15446    test_ret += test_xmlSetFeature();
15447    test_ret += test_xmlSetupParserForBuffer();
15448    test_ret += test_xmlStopParser();
15449    test_ret += test_xmlSubstituteEntitiesDefault();
15450
15451    if (test_ret != 0)
15452	printf("Module parser: %d errors\n", test_ret);
15453    return(test_ret);
15454}
15455
15456static int
15457test_htmlCreateFileParserCtxt(void) {
15458    int test_ret = 0;
15459
15460#if defined(LIBXML_HTML_ENABLED)
15461    int mem_base;
15462    htmlParserCtxtPtr ret_val;
15463    const char * filename; /* the filename */
15464    int n_filename;
15465    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15466    int n_encoding;
15467
15468    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15469    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15470        mem_base = xmlMemBlocks();
15471        filename = gen_fileoutput(n_filename, 0);
15472        encoding = gen_const_char_ptr(n_encoding, 1);
15473
15474        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15475        desret_htmlParserCtxtPtr(ret_val);
15476        call_tests++;
15477        des_fileoutput(n_filename, filename, 0);
15478        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15479        xmlResetLastError();
15480        if (mem_base != xmlMemBlocks()) {
15481            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15482	           xmlMemBlocks() - mem_base);
15483	    test_ret++;
15484            printf(" %d", n_filename);
15485            printf(" %d", n_encoding);
15486            printf("\n");
15487        }
15488    }
15489    }
15490    function_tests++;
15491#endif
15492
15493    return(test_ret);
15494}
15495
15496
15497static int
15498test_htmlInitAutoClose(void) {
15499    int test_ret = 0;
15500
15501#if defined(LIBXML_HTML_ENABLED)
15502    int mem_base;
15503
15504        mem_base = xmlMemBlocks();
15505
15506        htmlInitAutoClose();
15507        call_tests++;
15508        xmlResetLastError();
15509        if (mem_base != xmlMemBlocks()) {
15510            printf("Leak of %d blocks found in htmlInitAutoClose",
15511	           xmlMemBlocks() - mem_base);
15512	    test_ret++;
15513            printf("\n");
15514        }
15515    function_tests++;
15516#endif
15517
15518    return(test_ret);
15519}
15520
15521
15522static int
15523test_inputPop(void) {
15524    int test_ret = 0;
15525
15526    int mem_base;
15527    xmlParserInputPtr ret_val;
15528    xmlParserCtxtPtr ctxt; /* an XML parser context */
15529    int n_ctxt;
15530
15531    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15532        mem_base = xmlMemBlocks();
15533        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15534
15535        ret_val = inputPop(ctxt);
15536        desret_xmlParserInputPtr(ret_val);
15537        call_tests++;
15538        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15539        xmlResetLastError();
15540        if (mem_base != xmlMemBlocks()) {
15541            printf("Leak of %d blocks found in inputPop",
15542	           xmlMemBlocks() - mem_base);
15543	    test_ret++;
15544            printf(" %d", n_ctxt);
15545            printf("\n");
15546        }
15547    }
15548    function_tests++;
15549
15550    return(test_ret);
15551}
15552
15553
15554static int
15555test_inputPush(void) {
15556    int test_ret = 0;
15557
15558    int mem_base;
15559    int ret_val;
15560    xmlParserCtxtPtr ctxt; /* an XML parser context */
15561    int n_ctxt;
15562    xmlParserInputPtr value; /* the parser input */
15563    int n_value;
15564
15565    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15566    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15567        mem_base = xmlMemBlocks();
15568        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15569        value = gen_xmlParserInputPtr(n_value, 1);
15570
15571        ret_val = inputPush(ctxt, value);
15572        desret_int(ret_val);
15573        call_tests++;
15574        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15575        des_xmlParserInputPtr(n_value, value, 1);
15576        xmlResetLastError();
15577        if (mem_base != xmlMemBlocks()) {
15578            printf("Leak of %d blocks found in inputPush",
15579	           xmlMemBlocks() - mem_base);
15580	    test_ret++;
15581            printf(" %d", n_ctxt);
15582            printf(" %d", n_value);
15583            printf("\n");
15584        }
15585    }
15586    }
15587    function_tests++;
15588
15589    return(test_ret);
15590}
15591
15592
15593static int
15594test_namePop(void) {
15595    int test_ret = 0;
15596
15597    int mem_base;
15598    const xmlChar * ret_val;
15599    xmlParserCtxtPtr ctxt; /* an XML parser context */
15600    int n_ctxt;
15601
15602    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15603        mem_base = xmlMemBlocks();
15604        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15605
15606        ret_val = namePop(ctxt);
15607        desret_const_xmlChar_ptr(ret_val);
15608        call_tests++;
15609        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15610        xmlResetLastError();
15611        if (mem_base != xmlMemBlocks()) {
15612            printf("Leak of %d blocks found in namePop",
15613	           xmlMemBlocks() - mem_base);
15614	    test_ret++;
15615            printf(" %d", n_ctxt);
15616            printf("\n");
15617        }
15618    }
15619    function_tests++;
15620
15621    return(test_ret);
15622}
15623
15624
15625static int
15626test_namePush(void) {
15627    int test_ret = 0;
15628
15629    int mem_base;
15630    int ret_val;
15631    xmlParserCtxtPtr ctxt; /* an XML parser context */
15632    int n_ctxt;
15633    xmlChar * value; /* the element name */
15634    int n_value;
15635
15636    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15637    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15638        mem_base = xmlMemBlocks();
15639        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15640        value = gen_const_xmlChar_ptr(n_value, 1);
15641
15642        ret_val = namePush(ctxt, (const xmlChar *)value);
15643        desret_int(ret_val);
15644        call_tests++;
15645        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15646        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15647        xmlResetLastError();
15648        if (mem_base != xmlMemBlocks()) {
15649            printf("Leak of %d blocks found in namePush",
15650	           xmlMemBlocks() - mem_base);
15651	    test_ret++;
15652            printf(" %d", n_ctxt);
15653            printf(" %d", n_value);
15654            printf("\n");
15655        }
15656    }
15657    }
15658    function_tests++;
15659
15660    return(test_ret);
15661}
15662
15663
15664static int
15665test_nodePop(void) {
15666    int test_ret = 0;
15667
15668    int mem_base;
15669    xmlNodePtr ret_val;
15670    xmlParserCtxtPtr ctxt; /* an XML parser context */
15671    int n_ctxt;
15672
15673    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15674        mem_base = xmlMemBlocks();
15675        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15676
15677        ret_val = nodePop(ctxt);
15678        desret_xmlNodePtr(ret_val);
15679        call_tests++;
15680        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15681        xmlResetLastError();
15682        if (mem_base != xmlMemBlocks()) {
15683            printf("Leak of %d blocks found in nodePop",
15684	           xmlMemBlocks() - mem_base);
15685	    test_ret++;
15686            printf(" %d", n_ctxt);
15687            printf("\n");
15688        }
15689    }
15690    function_tests++;
15691
15692    return(test_ret);
15693}
15694
15695
15696static int
15697test_nodePush(void) {
15698    int test_ret = 0;
15699
15700    int mem_base;
15701    int ret_val;
15702    xmlParserCtxtPtr ctxt; /* an XML parser context */
15703    int n_ctxt;
15704    xmlNodePtr value; /* the element node */
15705    int n_value;
15706
15707    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15708    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15709        mem_base = xmlMemBlocks();
15710        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15711        value = gen_xmlNodePtr(n_value, 1);
15712
15713        ret_val = nodePush(ctxt, value);
15714        desret_int(ret_val);
15715        call_tests++;
15716        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15717        des_xmlNodePtr(n_value, value, 1);
15718        xmlResetLastError();
15719        if (mem_base != xmlMemBlocks()) {
15720            printf("Leak of %d blocks found in nodePush",
15721	           xmlMemBlocks() - mem_base);
15722	    test_ret++;
15723            printf(" %d", n_ctxt);
15724            printf(" %d", n_value);
15725            printf("\n");
15726        }
15727    }
15728    }
15729    function_tests++;
15730
15731    return(test_ret);
15732}
15733
15734
15735static int
15736test_xmlCheckLanguageID(void) {
15737    int test_ret = 0;
15738
15739    int mem_base;
15740    int ret_val;
15741    xmlChar * lang; /* pointer to the string value */
15742    int n_lang;
15743
15744    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15745        mem_base = xmlMemBlocks();
15746        lang = gen_const_xmlChar_ptr(n_lang, 0);
15747
15748        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15749        desret_int(ret_val);
15750        call_tests++;
15751        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15752        xmlResetLastError();
15753        if (mem_base != xmlMemBlocks()) {
15754            printf("Leak of %d blocks found in xmlCheckLanguageID",
15755	           xmlMemBlocks() - mem_base);
15756	    test_ret++;
15757            printf(" %d", n_lang);
15758            printf("\n");
15759        }
15760    }
15761    function_tests++;
15762
15763    return(test_ret);
15764}
15765
15766
15767static int
15768test_xmlCopyChar(void) {
15769    int test_ret = 0;
15770
15771    int mem_base;
15772    int ret_val;
15773    int len; /* Ignored, compatibility */
15774    int n_len;
15775    xmlChar * out; /* pointer to an array of xmlChar */
15776    int n_out;
15777    int val; /* the char value */
15778    int n_val;
15779
15780    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15781    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15782    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15783        mem_base = xmlMemBlocks();
15784        len = gen_int(n_len, 0);
15785        out = gen_xmlChar_ptr(n_out, 1);
15786        val = gen_int(n_val, 2);
15787
15788        ret_val = xmlCopyChar(len, out, val);
15789        desret_int(ret_val);
15790        call_tests++;
15791        des_int(n_len, len, 0);
15792        des_xmlChar_ptr(n_out, out, 1);
15793        des_int(n_val, val, 2);
15794        xmlResetLastError();
15795        if (mem_base != xmlMemBlocks()) {
15796            printf("Leak of %d blocks found in xmlCopyChar",
15797	           xmlMemBlocks() - mem_base);
15798	    test_ret++;
15799            printf(" %d", n_len);
15800            printf(" %d", n_out);
15801            printf(" %d", n_val);
15802            printf("\n");
15803        }
15804    }
15805    }
15806    }
15807    function_tests++;
15808
15809    return(test_ret);
15810}
15811
15812
15813static int
15814test_xmlCopyCharMultiByte(void) {
15815    int test_ret = 0;
15816
15817    int mem_base;
15818    int ret_val;
15819    xmlChar * out; /* pointer to an array of xmlChar */
15820    int n_out;
15821    int val; /* the char value */
15822    int n_val;
15823
15824    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15825    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15826        mem_base = xmlMemBlocks();
15827        out = gen_xmlChar_ptr(n_out, 0);
15828        val = gen_int(n_val, 1);
15829
15830        ret_val = xmlCopyCharMultiByte(out, val);
15831        desret_int(ret_val);
15832        call_tests++;
15833        des_xmlChar_ptr(n_out, out, 0);
15834        des_int(n_val, val, 1);
15835        xmlResetLastError();
15836        if (mem_base != xmlMemBlocks()) {
15837            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15838	           xmlMemBlocks() - mem_base);
15839	    test_ret++;
15840            printf(" %d", n_out);
15841            printf(" %d", n_val);
15842            printf("\n");
15843        }
15844    }
15845    }
15846    function_tests++;
15847
15848    return(test_ret);
15849}
15850
15851
15852static int
15853test_xmlCreateEntityParserCtxt(void) {
15854    int test_ret = 0;
15855
15856    int mem_base;
15857    xmlParserCtxtPtr ret_val;
15858    xmlChar * URL; /* the entity URL */
15859    int n_URL;
15860    xmlChar * ID; /* the entity PUBLIC ID */
15861    int n_ID;
15862    xmlChar * base; /* a possible base for the target URI */
15863    int n_base;
15864
15865    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15866    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15867    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15868        mem_base = xmlMemBlocks();
15869        URL = gen_const_xmlChar_ptr(n_URL, 0);
15870        ID = gen_const_xmlChar_ptr(n_ID, 1);
15871        base = gen_const_xmlChar_ptr(n_base, 2);
15872
15873        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15874        desret_xmlParserCtxtPtr(ret_val);
15875        call_tests++;
15876        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15877        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15878        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15879        xmlResetLastError();
15880        if (mem_base != xmlMemBlocks()) {
15881            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15882	           xmlMemBlocks() - mem_base);
15883	    test_ret++;
15884            printf(" %d", n_URL);
15885            printf(" %d", n_ID);
15886            printf(" %d", n_base);
15887            printf("\n");
15888        }
15889    }
15890    }
15891    }
15892    function_tests++;
15893
15894    return(test_ret);
15895}
15896
15897
15898static int
15899test_xmlCreateFileParserCtxt(void) {
15900    int test_ret = 0;
15901
15902    int mem_base;
15903    xmlParserCtxtPtr ret_val;
15904    const char * filename; /* the filename */
15905    int n_filename;
15906
15907    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15908        mem_base = xmlMemBlocks();
15909        filename = gen_fileoutput(n_filename, 0);
15910
15911        ret_val = xmlCreateFileParserCtxt(filename);
15912        desret_xmlParserCtxtPtr(ret_val);
15913        call_tests++;
15914        des_fileoutput(n_filename, filename, 0);
15915        xmlResetLastError();
15916        if (mem_base != xmlMemBlocks()) {
15917            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15918	           xmlMemBlocks() - mem_base);
15919	    test_ret++;
15920            printf(" %d", n_filename);
15921            printf("\n");
15922        }
15923    }
15924    function_tests++;
15925
15926    return(test_ret);
15927}
15928
15929
15930static int
15931test_xmlCreateMemoryParserCtxt(void) {
15932    int test_ret = 0;
15933
15934    int mem_base;
15935    xmlParserCtxtPtr ret_val;
15936    char * buffer; /* a pointer to a char array */
15937    int n_buffer;
15938    int size; /* the size of the array */
15939    int n_size;
15940
15941    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15942    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15943        mem_base = xmlMemBlocks();
15944        buffer = gen_const_char_ptr(n_buffer, 0);
15945        size = gen_int(n_size, 1);
15946
15947        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15948        desret_xmlParserCtxtPtr(ret_val);
15949        call_tests++;
15950        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15951        des_int(n_size, size, 1);
15952        xmlResetLastError();
15953        if (mem_base != xmlMemBlocks()) {
15954            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15955	           xmlMemBlocks() - mem_base);
15956	    test_ret++;
15957            printf(" %d", n_buffer);
15958            printf(" %d", n_size);
15959            printf("\n");
15960        }
15961    }
15962    }
15963    function_tests++;
15964
15965    return(test_ret);
15966}
15967
15968
15969static int
15970test_xmlCreateURLParserCtxt(void) {
15971    int test_ret = 0;
15972
15973    int mem_base;
15974    xmlParserCtxtPtr ret_val;
15975    const char * filename; /* the filename or URL */
15976    int n_filename;
15977    int options; /* a combination of xmlParserOption */
15978    int n_options;
15979
15980    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15981    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15982        mem_base = xmlMemBlocks();
15983        filename = gen_fileoutput(n_filename, 0);
15984        options = gen_int(n_options, 1);
15985
15986        ret_val = xmlCreateURLParserCtxt(filename, options);
15987        desret_xmlParserCtxtPtr(ret_val);
15988        call_tests++;
15989        des_fileoutput(n_filename, filename, 0);
15990        des_int(n_options, options, 1);
15991        xmlResetLastError();
15992        if (mem_base != xmlMemBlocks()) {
15993            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15994	           xmlMemBlocks() - mem_base);
15995	    test_ret++;
15996            printf(" %d", n_filename);
15997            printf(" %d", n_options);
15998            printf("\n");
15999        }
16000    }
16001    }
16002    function_tests++;
16003
16004    return(test_ret);
16005}
16006
16007
16008static int
16009test_xmlCurrentChar(void) {
16010    int test_ret = 0;
16011
16012    int mem_base;
16013    int ret_val;
16014    xmlParserCtxtPtr ctxt; /* the XML parser context */
16015    int n_ctxt;
16016    int * len; /* pointer to the length of the char read */
16017    int n_len;
16018
16019    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16020    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16021        mem_base = xmlMemBlocks();
16022        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16023        len = gen_int_ptr(n_len, 1);
16024
16025        ret_val = xmlCurrentChar(ctxt, len);
16026        desret_int(ret_val);
16027        call_tests++;
16028        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16029        des_int_ptr(n_len, len, 1);
16030        xmlResetLastError();
16031        if (mem_base != xmlMemBlocks()) {
16032            printf("Leak of %d blocks found in xmlCurrentChar",
16033	           xmlMemBlocks() - mem_base);
16034	    test_ret++;
16035            printf(" %d", n_ctxt);
16036            printf(" %d", n_len);
16037            printf("\n");
16038        }
16039    }
16040    }
16041    function_tests++;
16042
16043    return(test_ret);
16044}
16045
16046
16047static int
16048test_xmlErrMemory(void) {
16049    int test_ret = 0;
16050
16051    int mem_base;
16052    xmlParserCtxtPtr ctxt; /* an XML parser context */
16053    int n_ctxt;
16054    char * extra; /* extra informations */
16055    int n_extra;
16056
16057    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16058    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16059        mem_base = xmlMemBlocks();
16060        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16061        extra = gen_const_char_ptr(n_extra, 1);
16062
16063        xmlErrMemory(ctxt, (const char *)extra);
16064        call_tests++;
16065        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16066        des_const_char_ptr(n_extra, (const char *)extra, 1);
16067        xmlResetLastError();
16068        if (mem_base != xmlMemBlocks()) {
16069            printf("Leak of %d blocks found in xmlErrMemory",
16070	           xmlMemBlocks() - mem_base);
16071	    test_ret++;
16072            printf(" %d", n_ctxt);
16073            printf(" %d", n_extra);
16074            printf("\n");
16075        }
16076    }
16077    }
16078    function_tests++;
16079
16080    return(test_ret);
16081}
16082
16083
16084static int
16085test_xmlIsLetter(void) {
16086    int test_ret = 0;
16087
16088    int mem_base;
16089    int ret_val;
16090    int c; /* an unicode character (int) */
16091    int n_c;
16092
16093    for (n_c = 0;n_c < gen_nb_int;n_c++) {
16094        mem_base = xmlMemBlocks();
16095        c = gen_int(n_c, 0);
16096
16097        ret_val = xmlIsLetter(c);
16098        desret_int(ret_val);
16099        call_tests++;
16100        des_int(n_c, c, 0);
16101        xmlResetLastError();
16102        if (mem_base != xmlMemBlocks()) {
16103            printf("Leak of %d blocks found in xmlIsLetter",
16104	           xmlMemBlocks() - mem_base);
16105	    test_ret++;
16106            printf(" %d", n_c);
16107            printf("\n");
16108        }
16109    }
16110    function_tests++;
16111
16112    return(test_ret);
16113}
16114
16115
16116static int
16117test_xmlNewEntityInputStream(void) {
16118    int test_ret = 0;
16119
16120    int mem_base;
16121    xmlParserInputPtr ret_val;
16122    xmlParserCtxtPtr ctxt; /* an XML parser context */
16123    int n_ctxt;
16124    xmlEntityPtr entity; /* an Entity pointer */
16125    int n_entity;
16126
16127    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16128    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16129        mem_base = xmlMemBlocks();
16130        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16131        entity = gen_xmlEntityPtr(n_entity, 1);
16132
16133        ret_val = xmlNewEntityInputStream(ctxt, entity);
16134        desret_xmlParserInputPtr(ret_val);
16135        call_tests++;
16136        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16137        des_xmlEntityPtr(n_entity, entity, 1);
16138        xmlResetLastError();
16139        if (mem_base != xmlMemBlocks()) {
16140            printf("Leak of %d blocks found in xmlNewEntityInputStream",
16141	           xmlMemBlocks() - mem_base);
16142	    test_ret++;
16143            printf(" %d", n_ctxt);
16144            printf(" %d", n_entity);
16145            printf("\n");
16146        }
16147    }
16148    }
16149    function_tests++;
16150
16151    return(test_ret);
16152}
16153
16154
16155static int
16156test_xmlNewInputFromFile(void) {
16157    int test_ret = 0;
16158
16159    int mem_base;
16160    xmlParserInputPtr ret_val;
16161    xmlParserCtxtPtr ctxt; /* an XML parser context */
16162    int n_ctxt;
16163    const char * filename; /* the filename to use as entity */
16164    int n_filename;
16165
16166    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16167    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16168        mem_base = xmlMemBlocks();
16169        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16170        filename = gen_filepath(n_filename, 1);
16171
16172        ret_val = xmlNewInputFromFile(ctxt, filename);
16173        desret_xmlParserInputPtr(ret_val);
16174        call_tests++;
16175        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16176        des_filepath(n_filename, filename, 1);
16177        xmlResetLastError();
16178        if (mem_base != xmlMemBlocks()) {
16179            printf("Leak of %d blocks found in xmlNewInputFromFile",
16180	           xmlMemBlocks() - mem_base);
16181	    test_ret++;
16182            printf(" %d", n_ctxt);
16183            printf(" %d", n_filename);
16184            printf("\n");
16185        }
16186    }
16187    }
16188    function_tests++;
16189
16190    return(test_ret);
16191}
16192
16193
16194static int
16195test_xmlNewInputStream(void) {
16196    int test_ret = 0;
16197
16198    int mem_base;
16199    xmlParserInputPtr ret_val;
16200    xmlParserCtxtPtr ctxt; /* an XML parser context */
16201    int n_ctxt;
16202
16203    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16204        mem_base = xmlMemBlocks();
16205        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16206
16207        ret_val = xmlNewInputStream(ctxt);
16208        desret_xmlParserInputPtr(ret_val);
16209        call_tests++;
16210        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16211        xmlResetLastError();
16212        if (mem_base != xmlMemBlocks()) {
16213            printf("Leak of %d blocks found in xmlNewInputStream",
16214	           xmlMemBlocks() - mem_base);
16215	    test_ret++;
16216            printf(" %d", n_ctxt);
16217            printf("\n");
16218        }
16219    }
16220    function_tests++;
16221
16222    return(test_ret);
16223}
16224
16225
16226static int
16227test_xmlNewStringInputStream(void) {
16228    int test_ret = 0;
16229
16230    int mem_base;
16231    xmlParserInputPtr ret_val;
16232    xmlParserCtxtPtr ctxt; /* an XML parser context */
16233    int n_ctxt;
16234    xmlChar * buffer; /* an memory buffer */
16235    int n_buffer;
16236
16237    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16238    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16239        mem_base = xmlMemBlocks();
16240        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16241        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16242
16243        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16244        desret_xmlParserInputPtr(ret_val);
16245        call_tests++;
16246        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16247        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16248        xmlResetLastError();
16249        if (mem_base != xmlMemBlocks()) {
16250            printf("Leak of %d blocks found in xmlNewStringInputStream",
16251	           xmlMemBlocks() - mem_base);
16252	    test_ret++;
16253            printf(" %d", n_ctxt);
16254            printf(" %d", n_buffer);
16255            printf("\n");
16256        }
16257    }
16258    }
16259    function_tests++;
16260
16261    return(test_ret);
16262}
16263
16264
16265static int
16266test_xmlNextChar(void) {
16267    int test_ret = 0;
16268
16269    int mem_base;
16270    xmlParserCtxtPtr ctxt; /* the XML parser context */
16271    int n_ctxt;
16272
16273    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16274        mem_base = xmlMemBlocks();
16275        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16276
16277        xmlNextChar(ctxt);
16278        call_tests++;
16279        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16280        xmlResetLastError();
16281        if (mem_base != xmlMemBlocks()) {
16282            printf("Leak of %d blocks found in xmlNextChar",
16283	           xmlMemBlocks() - mem_base);
16284	    test_ret++;
16285            printf(" %d", n_ctxt);
16286            printf("\n");
16287        }
16288    }
16289    function_tests++;
16290
16291    return(test_ret);
16292}
16293
16294
16295static int
16296test_xmlParserInputShrink(void) {
16297    int test_ret = 0;
16298
16299    int mem_base;
16300    xmlParserInputPtr in; /* an XML parser input */
16301    int n_in;
16302
16303    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16304        mem_base = xmlMemBlocks();
16305        in = gen_xmlParserInputPtr(n_in, 0);
16306
16307        xmlParserInputShrink(in);
16308        call_tests++;
16309        des_xmlParserInputPtr(n_in, in, 0);
16310        xmlResetLastError();
16311        if (mem_base != xmlMemBlocks()) {
16312            printf("Leak of %d blocks found in xmlParserInputShrink",
16313	           xmlMemBlocks() - mem_base);
16314	    test_ret++;
16315            printf(" %d", n_in);
16316            printf("\n");
16317        }
16318    }
16319    function_tests++;
16320
16321    return(test_ret);
16322}
16323
16324
16325static int
16326test_xmlPopInput(void) {
16327    int test_ret = 0;
16328
16329    int mem_base;
16330    xmlChar ret_val;
16331    xmlParserCtxtPtr ctxt; /* an XML parser context */
16332    int n_ctxt;
16333
16334    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16335        mem_base = xmlMemBlocks();
16336        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16337
16338        ret_val = xmlPopInput(ctxt);
16339        desret_xmlChar(ret_val);
16340        call_tests++;
16341        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16342        xmlResetLastError();
16343        if (mem_base != xmlMemBlocks()) {
16344            printf("Leak of %d blocks found in xmlPopInput",
16345	           xmlMemBlocks() - mem_base);
16346	    test_ret++;
16347            printf(" %d", n_ctxt);
16348            printf("\n");
16349        }
16350    }
16351    function_tests++;
16352
16353    return(test_ret);
16354}
16355
16356
16357static int
16358test_xmlPushInput(void) {
16359    int test_ret = 0;
16360
16361    int mem_base;
16362    xmlParserCtxtPtr ctxt; /* an XML parser context */
16363    int n_ctxt;
16364    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16365    int n_input;
16366
16367    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16368    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16369        mem_base = xmlMemBlocks();
16370        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16371        input = gen_xmlParserInputPtr(n_input, 1);
16372
16373        xmlPushInput(ctxt, input);
16374        call_tests++;
16375        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16376        des_xmlParserInputPtr(n_input, input, 1);
16377        xmlResetLastError();
16378        if (mem_base != xmlMemBlocks()) {
16379            printf("Leak of %d blocks found in xmlPushInput",
16380	           xmlMemBlocks() - mem_base);
16381	    test_ret++;
16382            printf(" %d", n_ctxt);
16383            printf(" %d", n_input);
16384            printf("\n");
16385        }
16386    }
16387    }
16388    function_tests++;
16389
16390    return(test_ret);
16391}
16392
16393
16394static int
16395test_xmlSetEntityReferenceFunc(void) {
16396    int test_ret = 0;
16397
16398
16399    /* missing type support */
16400    return(test_ret);
16401}
16402
16403
16404static int
16405test_xmlSplitQName(void) {
16406    int test_ret = 0;
16407
16408    int mem_base;
16409    xmlChar * ret_val;
16410    xmlParserCtxtPtr ctxt; /* an XML parser context */
16411    int n_ctxt;
16412    xmlChar * name; /* an XML parser context */
16413    int n_name;
16414    xmlChar ** prefix; /* a xmlChar ** */
16415    int n_prefix;
16416
16417    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16418    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16419    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16420        mem_base = xmlMemBlocks();
16421        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16422        name = gen_const_xmlChar_ptr(n_name, 1);
16423        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16424
16425        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16426        desret_xmlChar_ptr(ret_val);
16427        call_tests++;
16428        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16429        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16430        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16431        xmlResetLastError();
16432        if (mem_base != xmlMemBlocks()) {
16433            printf("Leak of %d blocks found in xmlSplitQName",
16434	           xmlMemBlocks() - mem_base);
16435	    test_ret++;
16436            printf(" %d", n_ctxt);
16437            printf(" %d", n_name);
16438            printf(" %d", n_prefix);
16439            printf("\n");
16440        }
16441    }
16442    }
16443    }
16444    function_tests++;
16445
16446    return(test_ret);
16447}
16448
16449
16450static int
16451test_xmlStringCurrentChar(void) {
16452    int test_ret = 0;
16453
16454    int mem_base;
16455    int ret_val;
16456    xmlParserCtxtPtr ctxt; /* the XML parser context */
16457    int n_ctxt;
16458    xmlChar * cur; /* pointer to the beginning of the char */
16459    int n_cur;
16460    int * len; /* pointer to the length of the char read */
16461    int n_len;
16462
16463    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16464    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16465    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16466        mem_base = xmlMemBlocks();
16467        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16468        cur = gen_const_xmlChar_ptr(n_cur, 1);
16469        len = gen_int_ptr(n_len, 2);
16470
16471        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16472        desret_int(ret_val);
16473        call_tests++;
16474        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16475        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16476        des_int_ptr(n_len, len, 2);
16477        xmlResetLastError();
16478        if (mem_base != xmlMemBlocks()) {
16479            printf("Leak of %d blocks found in xmlStringCurrentChar",
16480	           xmlMemBlocks() - mem_base);
16481	    test_ret++;
16482            printf(" %d", n_ctxt);
16483            printf(" %d", n_cur);
16484            printf(" %d", n_len);
16485            printf("\n");
16486        }
16487    }
16488    }
16489    }
16490    function_tests++;
16491
16492    return(test_ret);
16493}
16494
16495
16496static int
16497test_xmlStringDecodeEntities(void) {
16498    int test_ret = 0;
16499
16500    int mem_base;
16501    xmlChar * ret_val;
16502    xmlParserCtxtPtr ctxt; /* the parser context */
16503    int n_ctxt;
16504    xmlChar * str; /* the input string */
16505    int n_str;
16506    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16507    int n_what;
16508    xmlChar end; /* an end marker xmlChar, 0 if none */
16509    int n_end;
16510    xmlChar end2; /* an end marker xmlChar, 0 if none */
16511    int n_end2;
16512    xmlChar end3; /* an end marker xmlChar, 0 if none */
16513    int n_end3;
16514
16515    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16516    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16517    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16518    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16519    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16520    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16521        mem_base = xmlMemBlocks();
16522        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16523        str = gen_const_xmlChar_ptr(n_str, 1);
16524        what = gen_int(n_what, 2);
16525        end = gen_xmlChar(n_end, 3);
16526        end2 = gen_xmlChar(n_end2, 4);
16527        end3 = gen_xmlChar(n_end3, 5);
16528
16529        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16530        desret_xmlChar_ptr(ret_val);
16531        call_tests++;
16532        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16533        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16534        des_int(n_what, what, 2);
16535        des_xmlChar(n_end, end, 3);
16536        des_xmlChar(n_end2, end2, 4);
16537        des_xmlChar(n_end3, end3, 5);
16538        xmlResetLastError();
16539        if (mem_base != xmlMemBlocks()) {
16540            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16541	           xmlMemBlocks() - mem_base);
16542	    test_ret++;
16543            printf(" %d", n_ctxt);
16544            printf(" %d", n_str);
16545            printf(" %d", n_what);
16546            printf(" %d", n_end);
16547            printf(" %d", n_end2);
16548            printf(" %d", n_end3);
16549            printf("\n");
16550        }
16551    }
16552    }
16553    }
16554    }
16555    }
16556    }
16557    function_tests++;
16558
16559    return(test_ret);
16560}
16561
16562
16563static int
16564test_xmlStringLenDecodeEntities(void) {
16565    int test_ret = 0;
16566
16567    int mem_base;
16568    xmlChar * ret_val;
16569    xmlParserCtxtPtr ctxt; /* the parser context */
16570    int n_ctxt;
16571    xmlChar * str; /* the input string */
16572    int n_str;
16573    int len; /* the string length */
16574    int n_len;
16575    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16576    int n_what;
16577    xmlChar end; /* an end marker xmlChar, 0 if none */
16578    int n_end;
16579    xmlChar end2; /* an end marker xmlChar, 0 if none */
16580    int n_end2;
16581    xmlChar end3; /* an end marker xmlChar, 0 if none */
16582    int n_end3;
16583
16584    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16585    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16586    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16587    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16588    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16589    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16590    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16591        mem_base = xmlMemBlocks();
16592        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16593        str = gen_const_xmlChar_ptr(n_str, 1);
16594        len = gen_int(n_len, 2);
16595        what = gen_int(n_what, 3);
16596        end = gen_xmlChar(n_end, 4);
16597        end2 = gen_xmlChar(n_end2, 5);
16598        end3 = gen_xmlChar(n_end3, 6);
16599
16600        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16601        desret_xmlChar_ptr(ret_val);
16602        call_tests++;
16603        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16604        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16605        des_int(n_len, len, 2);
16606        des_int(n_what, what, 3);
16607        des_xmlChar(n_end, end, 4);
16608        des_xmlChar(n_end2, end2, 5);
16609        des_xmlChar(n_end3, end3, 6);
16610        xmlResetLastError();
16611        if (mem_base != xmlMemBlocks()) {
16612            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16613	           xmlMemBlocks() - mem_base);
16614	    test_ret++;
16615            printf(" %d", n_ctxt);
16616            printf(" %d", n_str);
16617            printf(" %d", n_len);
16618            printf(" %d", n_what);
16619            printf(" %d", n_end);
16620            printf(" %d", n_end2);
16621            printf(" %d", n_end3);
16622            printf("\n");
16623        }
16624    }
16625    }
16626    }
16627    }
16628    }
16629    }
16630    }
16631    function_tests++;
16632
16633    return(test_ret);
16634}
16635
16636
16637static int
16638test_xmlSwitchEncoding(void) {
16639    int test_ret = 0;
16640
16641    int mem_base;
16642    int ret_val;
16643    xmlParserCtxtPtr ctxt; /* the parser context */
16644    int n_ctxt;
16645    xmlCharEncoding enc; /* the encoding value (number) */
16646    int n_enc;
16647
16648    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16649    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16650        mem_base = xmlMemBlocks();
16651        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16652        enc = gen_xmlCharEncoding(n_enc, 1);
16653
16654        ret_val = xmlSwitchEncoding(ctxt, enc);
16655        desret_int(ret_val);
16656        call_tests++;
16657        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16658        des_xmlCharEncoding(n_enc, enc, 1);
16659        xmlResetLastError();
16660        if (mem_base != xmlMemBlocks()) {
16661            printf("Leak of %d blocks found in xmlSwitchEncoding",
16662	           xmlMemBlocks() - mem_base);
16663	    test_ret++;
16664            printf(" %d", n_ctxt);
16665            printf(" %d", n_enc);
16666            printf("\n");
16667        }
16668    }
16669    }
16670    function_tests++;
16671
16672    return(test_ret);
16673}
16674
16675
16676static int
16677test_xmlSwitchInputEncoding(void) {
16678    int test_ret = 0;
16679
16680    int mem_base;
16681    int ret_val;
16682    xmlParserCtxtPtr ctxt; /* the parser context */
16683    int n_ctxt;
16684    xmlParserInputPtr input; /* the input stream */
16685    int n_input;
16686    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16687    int n_handler;
16688
16689    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16690    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16691    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16692        mem_base = xmlMemBlocks();
16693        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16694        input = gen_xmlParserInputPtr(n_input, 1);
16695        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16696
16697        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16698        desret_int(ret_val);
16699        call_tests++;
16700        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16701        des_xmlParserInputPtr(n_input, input, 1);
16702        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16703        xmlResetLastError();
16704        if (mem_base != xmlMemBlocks()) {
16705            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16706	           xmlMemBlocks() - mem_base);
16707	    test_ret++;
16708            printf(" %d", n_ctxt);
16709            printf(" %d", n_input);
16710            printf(" %d", n_handler);
16711            printf("\n");
16712        }
16713    }
16714    }
16715    }
16716    function_tests++;
16717
16718    return(test_ret);
16719}
16720
16721
16722static int
16723test_xmlSwitchToEncoding(void) {
16724    int test_ret = 0;
16725
16726    int mem_base;
16727    int ret_val;
16728    xmlParserCtxtPtr ctxt; /* the parser context */
16729    int n_ctxt;
16730    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16731    int n_handler;
16732
16733    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16734    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16735        mem_base = xmlMemBlocks();
16736        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16737        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16738
16739        ret_val = xmlSwitchToEncoding(ctxt, handler);
16740        desret_int(ret_val);
16741        call_tests++;
16742        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16743        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16744        xmlResetLastError();
16745        if (mem_base != xmlMemBlocks()) {
16746            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16747	           xmlMemBlocks() - mem_base);
16748	    test_ret++;
16749            printf(" %d", n_ctxt);
16750            printf(" %d", n_handler);
16751            printf("\n");
16752        }
16753    }
16754    }
16755    function_tests++;
16756
16757    return(test_ret);
16758}
16759
16760static int
16761test_parserInternals(void) {
16762    int test_ret = 0;
16763
16764    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16765    test_ret += test_htmlCreateFileParserCtxt();
16766    test_ret += test_htmlInitAutoClose();
16767    test_ret += test_inputPop();
16768    test_ret += test_inputPush();
16769    test_ret += test_namePop();
16770    test_ret += test_namePush();
16771    test_ret += test_nodePop();
16772    test_ret += test_nodePush();
16773    test_ret += test_xmlCheckLanguageID();
16774    test_ret += test_xmlCopyChar();
16775    test_ret += test_xmlCopyCharMultiByte();
16776    test_ret += test_xmlCreateEntityParserCtxt();
16777    test_ret += test_xmlCreateFileParserCtxt();
16778    test_ret += test_xmlCreateMemoryParserCtxt();
16779    test_ret += test_xmlCreateURLParserCtxt();
16780    test_ret += test_xmlCurrentChar();
16781    test_ret += test_xmlErrMemory();
16782    test_ret += test_xmlIsLetter();
16783    test_ret += test_xmlNewEntityInputStream();
16784    test_ret += test_xmlNewInputFromFile();
16785    test_ret += test_xmlNewInputStream();
16786    test_ret += test_xmlNewStringInputStream();
16787    test_ret += test_xmlNextChar();
16788    test_ret += test_xmlParserInputShrink();
16789    test_ret += test_xmlPopInput();
16790    test_ret += test_xmlPushInput();
16791    test_ret += test_xmlSetEntityReferenceFunc();
16792    test_ret += test_xmlSplitQName();
16793    test_ret += test_xmlStringCurrentChar();
16794    test_ret += test_xmlStringDecodeEntities();
16795    test_ret += test_xmlStringLenDecodeEntities();
16796    test_ret += test_xmlSwitchEncoding();
16797    test_ret += test_xmlSwitchInputEncoding();
16798    test_ret += test_xmlSwitchToEncoding();
16799
16800    if (test_ret != 0)
16801	printf("Module parserInternals: %d errors\n", test_ret);
16802    return(test_ret);
16803}
16804
16805static int
16806test_xmlPatternFromRoot(void) {
16807    int test_ret = 0;
16808
16809#if defined(LIBXML_PATTERN_ENABLED)
16810    int mem_base;
16811    int ret_val;
16812    xmlPatternPtr comp; /* the precompiled pattern */
16813    int n_comp;
16814
16815    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16816        mem_base = xmlMemBlocks();
16817        comp = gen_xmlPatternPtr(n_comp, 0);
16818
16819        ret_val = xmlPatternFromRoot(comp);
16820        desret_int(ret_val);
16821        call_tests++;
16822        des_xmlPatternPtr(n_comp, comp, 0);
16823        xmlResetLastError();
16824        if (mem_base != xmlMemBlocks()) {
16825            printf("Leak of %d blocks found in xmlPatternFromRoot",
16826	           xmlMemBlocks() - mem_base);
16827	    test_ret++;
16828            printf(" %d", n_comp);
16829            printf("\n");
16830        }
16831    }
16832    function_tests++;
16833#endif
16834
16835    return(test_ret);
16836}
16837
16838
16839static int
16840test_xmlPatternGetStreamCtxt(void) {
16841    int test_ret = 0;
16842
16843
16844    /* missing type support */
16845    return(test_ret);
16846}
16847
16848
16849static int
16850test_xmlPatternMatch(void) {
16851    int test_ret = 0;
16852
16853#if defined(LIBXML_PATTERN_ENABLED)
16854    int mem_base;
16855    int ret_val;
16856    xmlPatternPtr comp; /* the precompiled pattern */
16857    int n_comp;
16858    xmlNodePtr node; /* a node */
16859    int n_node;
16860
16861    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16862    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16863        mem_base = xmlMemBlocks();
16864        comp = gen_xmlPatternPtr(n_comp, 0);
16865        node = gen_xmlNodePtr(n_node, 1);
16866
16867        ret_val = xmlPatternMatch(comp, node);
16868        desret_int(ret_val);
16869        call_tests++;
16870        des_xmlPatternPtr(n_comp, comp, 0);
16871        des_xmlNodePtr(n_node, node, 1);
16872        xmlResetLastError();
16873        if (mem_base != xmlMemBlocks()) {
16874            printf("Leak of %d blocks found in xmlPatternMatch",
16875	           xmlMemBlocks() - mem_base);
16876	    test_ret++;
16877            printf(" %d", n_comp);
16878            printf(" %d", n_node);
16879            printf("\n");
16880        }
16881    }
16882    }
16883    function_tests++;
16884#endif
16885
16886    return(test_ret);
16887}
16888
16889
16890static int
16891test_xmlPatternMaxDepth(void) {
16892    int test_ret = 0;
16893
16894#if defined(LIBXML_PATTERN_ENABLED)
16895    int mem_base;
16896    int ret_val;
16897    xmlPatternPtr comp; /* the precompiled pattern */
16898    int n_comp;
16899
16900    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16901        mem_base = xmlMemBlocks();
16902        comp = gen_xmlPatternPtr(n_comp, 0);
16903
16904        ret_val = xmlPatternMaxDepth(comp);
16905        desret_int(ret_val);
16906        call_tests++;
16907        des_xmlPatternPtr(n_comp, comp, 0);
16908        xmlResetLastError();
16909        if (mem_base != xmlMemBlocks()) {
16910            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16911	           xmlMemBlocks() - mem_base);
16912	    test_ret++;
16913            printf(" %d", n_comp);
16914            printf("\n");
16915        }
16916    }
16917    function_tests++;
16918#endif
16919
16920    return(test_ret);
16921}
16922
16923
16924static int
16925test_xmlPatternMinDepth(void) {
16926    int test_ret = 0;
16927
16928#if defined(LIBXML_PATTERN_ENABLED)
16929    int mem_base;
16930    int ret_val;
16931    xmlPatternPtr comp; /* the precompiled pattern */
16932    int n_comp;
16933
16934    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16935        mem_base = xmlMemBlocks();
16936        comp = gen_xmlPatternPtr(n_comp, 0);
16937
16938        ret_val = xmlPatternMinDepth(comp);
16939        desret_int(ret_val);
16940        call_tests++;
16941        des_xmlPatternPtr(n_comp, comp, 0);
16942        xmlResetLastError();
16943        if (mem_base != xmlMemBlocks()) {
16944            printf("Leak of %d blocks found in xmlPatternMinDepth",
16945	           xmlMemBlocks() - mem_base);
16946	    test_ret++;
16947            printf(" %d", n_comp);
16948            printf("\n");
16949        }
16950    }
16951    function_tests++;
16952#endif
16953
16954    return(test_ret);
16955}
16956
16957
16958static int
16959test_xmlPatternStreamable(void) {
16960    int test_ret = 0;
16961
16962#if defined(LIBXML_PATTERN_ENABLED)
16963    int mem_base;
16964    int ret_val;
16965    xmlPatternPtr comp; /* the precompiled pattern */
16966    int n_comp;
16967
16968    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16969        mem_base = xmlMemBlocks();
16970        comp = gen_xmlPatternPtr(n_comp, 0);
16971
16972        ret_val = xmlPatternStreamable(comp);
16973        desret_int(ret_val);
16974        call_tests++;
16975        des_xmlPatternPtr(n_comp, comp, 0);
16976        xmlResetLastError();
16977        if (mem_base != xmlMemBlocks()) {
16978            printf("Leak of %d blocks found in xmlPatternStreamable",
16979	           xmlMemBlocks() - mem_base);
16980	    test_ret++;
16981            printf(" %d", n_comp);
16982            printf("\n");
16983        }
16984    }
16985    function_tests++;
16986#endif
16987
16988    return(test_ret);
16989}
16990
16991
16992static int
16993test_xmlPatterncompile(void) {
16994    int test_ret = 0;
16995
16996
16997    /* missing type support */
16998    return(test_ret);
16999}
17000
17001#ifdef LIBXML_PATTERN_ENABLED
17002
17003#define gen_nb_xmlStreamCtxtPtr 1
17004static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17005    return(NULL);
17006}
17007static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17008}
17009#endif
17010
17011
17012static int
17013test_xmlStreamPop(void) {
17014    int test_ret = 0;
17015
17016#if defined(LIBXML_PATTERN_ENABLED)
17017    int mem_base;
17018    int ret_val;
17019    xmlStreamCtxtPtr stream; /* the stream context */
17020    int n_stream;
17021
17022    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17023        mem_base = xmlMemBlocks();
17024        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17025
17026        ret_val = xmlStreamPop(stream);
17027        desret_int(ret_val);
17028        call_tests++;
17029        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17030        xmlResetLastError();
17031        if (mem_base != xmlMemBlocks()) {
17032            printf("Leak of %d blocks found in xmlStreamPop",
17033	           xmlMemBlocks() - mem_base);
17034	    test_ret++;
17035            printf(" %d", n_stream);
17036            printf("\n");
17037        }
17038    }
17039    function_tests++;
17040#endif
17041
17042    return(test_ret);
17043}
17044
17045
17046static int
17047test_xmlStreamPush(void) {
17048    int test_ret = 0;
17049
17050#if defined(LIBXML_PATTERN_ENABLED)
17051    int mem_base;
17052    int ret_val;
17053    xmlStreamCtxtPtr stream; /* the stream context */
17054    int n_stream;
17055    xmlChar * name; /* the current name */
17056    int n_name;
17057    xmlChar * ns; /* the namespace name */
17058    int n_ns;
17059
17060    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17061    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17062    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17063        mem_base = xmlMemBlocks();
17064        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17065        name = gen_const_xmlChar_ptr(n_name, 1);
17066        ns = gen_const_xmlChar_ptr(n_ns, 2);
17067
17068        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17069        desret_int(ret_val);
17070        call_tests++;
17071        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17072        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17073        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17074        xmlResetLastError();
17075        if (mem_base != xmlMemBlocks()) {
17076            printf("Leak of %d blocks found in xmlStreamPush",
17077	           xmlMemBlocks() - mem_base);
17078	    test_ret++;
17079            printf(" %d", n_stream);
17080            printf(" %d", n_name);
17081            printf(" %d", n_ns);
17082            printf("\n");
17083        }
17084    }
17085    }
17086    }
17087    function_tests++;
17088#endif
17089
17090    return(test_ret);
17091}
17092
17093
17094static int
17095test_xmlStreamPushAttr(void) {
17096    int test_ret = 0;
17097
17098#if defined(LIBXML_PATTERN_ENABLED)
17099    int mem_base;
17100    int ret_val;
17101    xmlStreamCtxtPtr stream; /* the stream context */
17102    int n_stream;
17103    xmlChar * name; /* the current name */
17104    int n_name;
17105    xmlChar * ns; /* the namespace name */
17106    int n_ns;
17107
17108    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17109    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17110    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17111        mem_base = xmlMemBlocks();
17112        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17113        name = gen_const_xmlChar_ptr(n_name, 1);
17114        ns = gen_const_xmlChar_ptr(n_ns, 2);
17115
17116        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17117        desret_int(ret_val);
17118        call_tests++;
17119        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17120        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17121        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17122        xmlResetLastError();
17123        if (mem_base != xmlMemBlocks()) {
17124            printf("Leak of %d blocks found in xmlStreamPushAttr",
17125	           xmlMemBlocks() - mem_base);
17126	    test_ret++;
17127            printf(" %d", n_stream);
17128            printf(" %d", n_name);
17129            printf(" %d", n_ns);
17130            printf("\n");
17131        }
17132    }
17133    }
17134    }
17135    function_tests++;
17136#endif
17137
17138    return(test_ret);
17139}
17140
17141
17142static int
17143test_xmlStreamPushNode(void) {
17144    int test_ret = 0;
17145
17146#if defined(LIBXML_PATTERN_ENABLED)
17147    int mem_base;
17148    int ret_val;
17149    xmlStreamCtxtPtr stream; /* the stream context */
17150    int n_stream;
17151    xmlChar * name; /* the current name */
17152    int n_name;
17153    xmlChar * ns; /* the namespace name */
17154    int n_ns;
17155    int nodeType; /* the type of the node being pushed */
17156    int n_nodeType;
17157
17158    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17159    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17160    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17161    for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17162        mem_base = xmlMemBlocks();
17163        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17164        name = gen_const_xmlChar_ptr(n_name, 1);
17165        ns = gen_const_xmlChar_ptr(n_ns, 2);
17166        nodeType = gen_int(n_nodeType, 3);
17167
17168        ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17169        desret_int(ret_val);
17170        call_tests++;
17171        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17172        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17173        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17174        des_int(n_nodeType, nodeType, 3);
17175        xmlResetLastError();
17176        if (mem_base != xmlMemBlocks()) {
17177            printf("Leak of %d blocks found in xmlStreamPushNode",
17178	           xmlMemBlocks() - mem_base);
17179	    test_ret++;
17180            printf(" %d", n_stream);
17181            printf(" %d", n_name);
17182            printf(" %d", n_ns);
17183            printf(" %d", n_nodeType);
17184            printf("\n");
17185        }
17186    }
17187    }
17188    }
17189    }
17190    function_tests++;
17191#endif
17192
17193    return(test_ret);
17194}
17195
17196
17197static int
17198test_xmlStreamWantsAnyNode(void) {
17199    int test_ret = 0;
17200
17201#if defined(LIBXML_PATTERN_ENABLED)
17202    int mem_base;
17203    int ret_val;
17204    xmlStreamCtxtPtr streamCtxt; /* the stream context */
17205    int n_streamCtxt;
17206
17207    for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17208        mem_base = xmlMemBlocks();
17209        streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17210
17211        ret_val = xmlStreamWantsAnyNode(streamCtxt);
17212        desret_int(ret_val);
17213        call_tests++;
17214        des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17215        xmlResetLastError();
17216        if (mem_base != xmlMemBlocks()) {
17217            printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17218	           xmlMemBlocks() - mem_base);
17219	    test_ret++;
17220            printf(" %d", n_streamCtxt);
17221            printf("\n");
17222        }
17223    }
17224    function_tests++;
17225#endif
17226
17227    return(test_ret);
17228}
17229
17230static int
17231test_pattern(void) {
17232    int test_ret = 0;
17233
17234    if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17235    test_ret += test_xmlPatternFromRoot();
17236    test_ret += test_xmlPatternGetStreamCtxt();
17237    test_ret += test_xmlPatternMatch();
17238    test_ret += test_xmlPatternMaxDepth();
17239    test_ret += test_xmlPatternMinDepth();
17240    test_ret += test_xmlPatternStreamable();
17241    test_ret += test_xmlPatterncompile();
17242    test_ret += test_xmlStreamPop();
17243    test_ret += test_xmlStreamPush();
17244    test_ret += test_xmlStreamPushAttr();
17245    test_ret += test_xmlStreamPushNode();
17246    test_ret += test_xmlStreamWantsAnyNode();
17247
17248    if (test_ret != 0)
17249	printf("Module pattern: %d errors\n", test_ret);
17250    return(test_ret);
17251}
17252#ifdef LIBXML_SCHEMAS_ENABLED
17253
17254#define gen_nb_xmlRelaxNGPtr 1
17255static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17256    return(NULL);
17257}
17258static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17259}
17260#endif
17261
17262
17263static int
17264test_xmlRelaxNGDump(void) {
17265    int test_ret = 0;
17266
17267#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17268    int mem_base;
17269    FILE * output; /* the file output */
17270    int n_output;
17271    xmlRelaxNGPtr schema; /* a schema structure */
17272    int n_schema;
17273
17274    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17275    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17276        mem_base = xmlMemBlocks();
17277        output = gen_FILE_ptr(n_output, 0);
17278        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17279
17280        xmlRelaxNGDump(output, schema);
17281        call_tests++;
17282        des_FILE_ptr(n_output, output, 0);
17283        des_xmlRelaxNGPtr(n_schema, schema, 1);
17284        xmlResetLastError();
17285        if (mem_base != xmlMemBlocks()) {
17286            printf("Leak of %d blocks found in xmlRelaxNGDump",
17287	           xmlMemBlocks() - mem_base);
17288	    test_ret++;
17289            printf(" %d", n_output);
17290            printf(" %d", n_schema);
17291            printf("\n");
17292        }
17293    }
17294    }
17295    function_tests++;
17296#endif
17297
17298    return(test_ret);
17299}
17300
17301
17302static int
17303test_xmlRelaxNGDumpTree(void) {
17304    int test_ret = 0;
17305
17306#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17307    int mem_base;
17308    FILE * output; /* the file output */
17309    int n_output;
17310    xmlRelaxNGPtr schema; /* a schema structure */
17311    int n_schema;
17312
17313    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17314    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17315        mem_base = xmlMemBlocks();
17316        output = gen_FILE_ptr(n_output, 0);
17317        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17318
17319        xmlRelaxNGDumpTree(output, schema);
17320        call_tests++;
17321        des_FILE_ptr(n_output, output, 0);
17322        des_xmlRelaxNGPtr(n_schema, schema, 1);
17323        xmlResetLastError();
17324        if (mem_base != xmlMemBlocks()) {
17325            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17326	           xmlMemBlocks() - mem_base);
17327	    test_ret++;
17328            printf(" %d", n_output);
17329            printf(" %d", n_schema);
17330            printf("\n");
17331        }
17332    }
17333    }
17334    function_tests++;
17335#endif
17336
17337    return(test_ret);
17338}
17339
17340#ifdef LIBXML_SCHEMAS_ENABLED
17341
17342#define gen_nb_xmlRelaxNGParserCtxtPtr 1
17343static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17344    return(NULL);
17345}
17346static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17347}
17348#endif
17349
17350#ifdef LIBXML_SCHEMAS_ENABLED
17351
17352#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17353static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17354    return(NULL);
17355}
17356static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17357}
17358#endif
17359
17360#ifdef LIBXML_SCHEMAS_ENABLED
17361
17362#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17363static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17364    return(NULL);
17365}
17366static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17367}
17368#endif
17369
17370#ifdef LIBXML_SCHEMAS_ENABLED
17371
17372#define gen_nb_void_ptr_ptr 1
17373static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17374    return(NULL);
17375}
17376static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17377}
17378#endif
17379
17380
17381static int
17382test_xmlRelaxNGGetParserErrors(void) {
17383    int test_ret = 0;
17384
17385#if defined(LIBXML_SCHEMAS_ENABLED)
17386    int mem_base;
17387    int ret_val;
17388    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17389    int n_ctxt;
17390    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17391    int n_err;
17392    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17393    int n_warn;
17394    void ** ctx; /* contextual data for the callbacks result */
17395    int n_ctx;
17396
17397    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17398    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17399    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17400    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17401        mem_base = xmlMemBlocks();
17402        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17403        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17404        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17405        ctx = gen_void_ptr_ptr(n_ctx, 3);
17406
17407        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17408        desret_int(ret_val);
17409        call_tests++;
17410        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17411        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17412        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17413        des_void_ptr_ptr(n_ctx, ctx, 3);
17414        xmlResetLastError();
17415        if (mem_base != xmlMemBlocks()) {
17416            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17417	           xmlMemBlocks() - mem_base);
17418	    test_ret++;
17419            printf(" %d", n_ctxt);
17420            printf(" %d", n_err);
17421            printf(" %d", n_warn);
17422            printf(" %d", n_ctx);
17423            printf("\n");
17424        }
17425    }
17426    }
17427    }
17428    }
17429    function_tests++;
17430#endif
17431
17432    return(test_ret);
17433}
17434
17435#ifdef LIBXML_SCHEMAS_ENABLED
17436
17437#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17438static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17439    return(NULL);
17440}
17441static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17442}
17443#endif
17444
17445
17446static int
17447test_xmlRelaxNGGetValidErrors(void) {
17448    int test_ret = 0;
17449
17450#if defined(LIBXML_SCHEMAS_ENABLED)
17451    int mem_base;
17452    int ret_val;
17453    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17454    int n_ctxt;
17455    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17456    int n_err;
17457    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17458    int n_warn;
17459    void ** ctx; /* the functions context result */
17460    int n_ctx;
17461
17462    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17463    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17464    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17465    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17466        mem_base = xmlMemBlocks();
17467        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17468        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17469        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17470        ctx = gen_void_ptr_ptr(n_ctx, 3);
17471
17472        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17473        desret_int(ret_val);
17474        call_tests++;
17475        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17476        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17477        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17478        des_void_ptr_ptr(n_ctx, ctx, 3);
17479        xmlResetLastError();
17480        if (mem_base != xmlMemBlocks()) {
17481            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17482	           xmlMemBlocks() - mem_base);
17483	    test_ret++;
17484            printf(" %d", n_ctxt);
17485            printf(" %d", n_err);
17486            printf(" %d", n_warn);
17487            printf(" %d", n_ctx);
17488            printf("\n");
17489        }
17490    }
17491    }
17492    }
17493    }
17494    function_tests++;
17495#endif
17496
17497    return(test_ret);
17498}
17499
17500
17501static int
17502test_xmlRelaxNGInitTypes(void) {
17503    int test_ret = 0;
17504
17505#if defined(LIBXML_SCHEMAS_ENABLED)
17506    int mem_base;
17507    int ret_val;
17508
17509        mem_base = xmlMemBlocks();
17510
17511        ret_val = xmlRelaxNGInitTypes();
17512        desret_int(ret_val);
17513        call_tests++;
17514        xmlResetLastError();
17515        if (mem_base != xmlMemBlocks()) {
17516            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17517	           xmlMemBlocks() - mem_base);
17518	    test_ret++;
17519            printf("\n");
17520        }
17521    function_tests++;
17522#endif
17523
17524    return(test_ret);
17525}
17526
17527
17528static int
17529test_xmlRelaxNGNewDocParserCtxt(void) {
17530    int test_ret = 0;
17531
17532#if defined(LIBXML_SCHEMAS_ENABLED)
17533    int mem_base;
17534    xmlRelaxNGParserCtxtPtr ret_val;
17535    xmlDocPtr doc; /* a preparsed document tree */
17536    int n_doc;
17537
17538    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17539        mem_base = xmlMemBlocks();
17540        doc = gen_xmlDocPtr(n_doc, 0);
17541
17542        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17543        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17544        call_tests++;
17545        des_xmlDocPtr(n_doc, doc, 0);
17546        xmlResetLastError();
17547        if (mem_base != xmlMemBlocks()) {
17548            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17549	           xmlMemBlocks() - mem_base);
17550	    test_ret++;
17551            printf(" %d", n_doc);
17552            printf("\n");
17553        }
17554    }
17555    function_tests++;
17556#endif
17557
17558    return(test_ret);
17559}
17560
17561
17562static int
17563test_xmlRelaxNGNewMemParserCtxt(void) {
17564    int test_ret = 0;
17565
17566#if defined(LIBXML_SCHEMAS_ENABLED)
17567    int mem_base;
17568    xmlRelaxNGParserCtxtPtr ret_val;
17569    char * buffer; /* a pointer to a char array containing the schemas */
17570    int n_buffer;
17571    int size; /* the size of the array */
17572    int n_size;
17573
17574    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17575    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17576        mem_base = xmlMemBlocks();
17577        buffer = gen_const_char_ptr(n_buffer, 0);
17578        size = gen_int(n_size, 1);
17579
17580        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17581        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17582        call_tests++;
17583        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17584        des_int(n_size, size, 1);
17585        xmlResetLastError();
17586        if (mem_base != xmlMemBlocks()) {
17587            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17588	           xmlMemBlocks() - mem_base);
17589	    test_ret++;
17590            printf(" %d", n_buffer);
17591            printf(" %d", n_size);
17592            printf("\n");
17593        }
17594    }
17595    }
17596    function_tests++;
17597#endif
17598
17599    return(test_ret);
17600}
17601
17602
17603static int
17604test_xmlRelaxNGNewParserCtxt(void) {
17605    int test_ret = 0;
17606
17607#if defined(LIBXML_SCHEMAS_ENABLED)
17608    int mem_base;
17609    xmlRelaxNGParserCtxtPtr ret_val;
17610    char * URL; /* the location of the schema */
17611    int n_URL;
17612
17613    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17614        mem_base = xmlMemBlocks();
17615        URL = gen_const_char_ptr(n_URL, 0);
17616
17617        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17618        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17619        call_tests++;
17620        des_const_char_ptr(n_URL, (const char *)URL, 0);
17621        xmlResetLastError();
17622        if (mem_base != xmlMemBlocks()) {
17623            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17624	           xmlMemBlocks() - mem_base);
17625	    test_ret++;
17626            printf(" %d", n_URL);
17627            printf("\n");
17628        }
17629    }
17630    function_tests++;
17631#endif
17632
17633    return(test_ret);
17634}
17635
17636
17637static int
17638test_xmlRelaxNGNewValidCtxt(void) {
17639    int test_ret = 0;
17640
17641
17642    /* missing type support */
17643    return(test_ret);
17644}
17645
17646
17647static int
17648test_xmlRelaxNGParse(void) {
17649    int test_ret = 0;
17650
17651
17652    /* missing type support */
17653    return(test_ret);
17654}
17655
17656
17657static int
17658test_xmlRelaxNGSetParserErrors(void) {
17659    int test_ret = 0;
17660
17661
17662    /* missing type support */
17663    return(test_ret);
17664}
17665
17666
17667static int
17668test_xmlRelaxNGSetParserStructuredErrors(void) {
17669    int test_ret = 0;
17670
17671
17672    /* missing type support */
17673    return(test_ret);
17674}
17675
17676
17677static int
17678test_xmlRelaxNGSetValidErrors(void) {
17679    int test_ret = 0;
17680
17681
17682    /* missing type support */
17683    return(test_ret);
17684}
17685
17686
17687static int
17688test_xmlRelaxNGSetValidStructuredErrors(void) {
17689    int test_ret = 0;
17690
17691
17692    /* missing type support */
17693    return(test_ret);
17694}
17695
17696
17697static int
17698test_xmlRelaxNGValidateDoc(void) {
17699    int test_ret = 0;
17700
17701#if defined(LIBXML_SCHEMAS_ENABLED)
17702    int mem_base;
17703    int ret_val;
17704    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17705    int n_ctxt;
17706    xmlDocPtr doc; /* a parsed document tree */
17707    int n_doc;
17708
17709    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17710    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17711        mem_base = xmlMemBlocks();
17712        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17713        doc = gen_xmlDocPtr(n_doc, 1);
17714
17715        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17716        desret_int(ret_val);
17717        call_tests++;
17718        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17719        des_xmlDocPtr(n_doc, doc, 1);
17720        xmlResetLastError();
17721        if (mem_base != xmlMemBlocks()) {
17722            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17723	           xmlMemBlocks() - mem_base);
17724	    test_ret++;
17725            printf(" %d", n_ctxt);
17726            printf(" %d", n_doc);
17727            printf("\n");
17728        }
17729    }
17730    }
17731    function_tests++;
17732#endif
17733
17734    return(test_ret);
17735}
17736
17737
17738static int
17739test_xmlRelaxNGValidateFullElement(void) {
17740    int test_ret = 0;
17741
17742#if defined(LIBXML_SCHEMAS_ENABLED)
17743    int mem_base;
17744    int ret_val;
17745    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17746    int n_ctxt;
17747    xmlDocPtr doc; /* a document instance */
17748    int n_doc;
17749    xmlNodePtr elem; /* an element instance */
17750    int n_elem;
17751
17752    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17753    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17754    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17755        mem_base = xmlMemBlocks();
17756        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17757        doc = gen_xmlDocPtr(n_doc, 1);
17758        elem = gen_xmlNodePtr(n_elem, 2);
17759
17760        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17761        desret_int(ret_val);
17762        call_tests++;
17763        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17764        des_xmlDocPtr(n_doc, doc, 1);
17765        des_xmlNodePtr(n_elem, elem, 2);
17766        xmlResetLastError();
17767        if (mem_base != xmlMemBlocks()) {
17768            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17769	           xmlMemBlocks() - mem_base);
17770	    test_ret++;
17771            printf(" %d", n_ctxt);
17772            printf(" %d", n_doc);
17773            printf(" %d", n_elem);
17774            printf("\n");
17775        }
17776    }
17777    }
17778    }
17779    function_tests++;
17780#endif
17781
17782    return(test_ret);
17783}
17784
17785
17786static int
17787test_xmlRelaxNGValidatePopElement(void) {
17788    int test_ret = 0;
17789
17790#if defined(LIBXML_SCHEMAS_ENABLED)
17791    int mem_base;
17792    int ret_val;
17793    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17794    int n_ctxt;
17795    xmlDocPtr doc; /* a document instance */
17796    int n_doc;
17797    xmlNodePtr elem; /* an element instance */
17798    int n_elem;
17799
17800    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17801    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17802    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17803        mem_base = xmlMemBlocks();
17804        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17805        doc = gen_xmlDocPtr(n_doc, 1);
17806        elem = gen_xmlNodePtr(n_elem, 2);
17807
17808        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17809        desret_int(ret_val);
17810        call_tests++;
17811        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17812        des_xmlDocPtr(n_doc, doc, 1);
17813        des_xmlNodePtr(n_elem, elem, 2);
17814        xmlResetLastError();
17815        if (mem_base != xmlMemBlocks()) {
17816            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17817	           xmlMemBlocks() - mem_base);
17818	    test_ret++;
17819            printf(" %d", n_ctxt);
17820            printf(" %d", n_doc);
17821            printf(" %d", n_elem);
17822            printf("\n");
17823        }
17824    }
17825    }
17826    }
17827    function_tests++;
17828#endif
17829
17830    return(test_ret);
17831}
17832
17833
17834static int
17835test_xmlRelaxNGValidatePushCData(void) {
17836    int test_ret = 0;
17837
17838#if defined(LIBXML_SCHEMAS_ENABLED)
17839    int mem_base;
17840    int ret_val;
17841    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17842    int n_ctxt;
17843    xmlChar * data; /* some character data read */
17844    int n_data;
17845    int len; /* the lenght of the data */
17846    int n_len;
17847
17848    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17849    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17850    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17851        mem_base = xmlMemBlocks();
17852        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17853        data = gen_const_xmlChar_ptr(n_data, 1);
17854        len = gen_int(n_len, 2);
17855
17856        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17857        desret_int(ret_val);
17858        call_tests++;
17859        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17860        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17861        des_int(n_len, len, 2);
17862        xmlResetLastError();
17863        if (mem_base != xmlMemBlocks()) {
17864            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17865	           xmlMemBlocks() - mem_base);
17866	    test_ret++;
17867            printf(" %d", n_ctxt);
17868            printf(" %d", n_data);
17869            printf(" %d", n_len);
17870            printf("\n");
17871        }
17872    }
17873    }
17874    }
17875    function_tests++;
17876#endif
17877
17878    return(test_ret);
17879}
17880
17881
17882static int
17883test_xmlRelaxNGValidatePushElement(void) {
17884    int test_ret = 0;
17885
17886#if defined(LIBXML_SCHEMAS_ENABLED)
17887    int mem_base;
17888    int ret_val;
17889    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17890    int n_ctxt;
17891    xmlDocPtr doc; /* a document instance */
17892    int n_doc;
17893    xmlNodePtr elem; /* an element instance */
17894    int n_elem;
17895
17896    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17897    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17898    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17899        mem_base = xmlMemBlocks();
17900        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17901        doc = gen_xmlDocPtr(n_doc, 1);
17902        elem = gen_xmlNodePtr(n_elem, 2);
17903
17904        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17905        desret_int(ret_val);
17906        call_tests++;
17907        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17908        des_xmlDocPtr(n_doc, doc, 1);
17909        des_xmlNodePtr(n_elem, elem, 2);
17910        xmlResetLastError();
17911        if (mem_base != xmlMemBlocks()) {
17912            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17913	           xmlMemBlocks() - mem_base);
17914	    test_ret++;
17915            printf(" %d", n_ctxt);
17916            printf(" %d", n_doc);
17917            printf(" %d", n_elem);
17918            printf("\n");
17919        }
17920    }
17921    }
17922    }
17923    function_tests++;
17924#endif
17925
17926    return(test_ret);
17927}
17928
17929
17930static int
17931test_xmlRelaxParserSetFlag(void) {
17932    int test_ret = 0;
17933
17934#if defined(LIBXML_SCHEMAS_ENABLED)
17935    int mem_base;
17936    int ret_val;
17937    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17938    int n_ctxt;
17939    int flags; /* a set of flags values */
17940    int n_flags;
17941
17942    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17943    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17944        mem_base = xmlMemBlocks();
17945        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17946        flags = gen_int(n_flags, 1);
17947
17948        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17949        desret_int(ret_val);
17950        call_tests++;
17951        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17952        des_int(n_flags, flags, 1);
17953        xmlResetLastError();
17954        if (mem_base != xmlMemBlocks()) {
17955            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17956	           xmlMemBlocks() - mem_base);
17957	    test_ret++;
17958            printf(" %d", n_ctxt);
17959            printf(" %d", n_flags);
17960            printf("\n");
17961        }
17962    }
17963    }
17964    function_tests++;
17965#endif
17966
17967    return(test_ret);
17968}
17969
17970static int
17971test_relaxng(void) {
17972    int test_ret = 0;
17973
17974    if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17975    test_ret += test_xmlRelaxNGDump();
17976    test_ret += test_xmlRelaxNGDumpTree();
17977    test_ret += test_xmlRelaxNGGetParserErrors();
17978    test_ret += test_xmlRelaxNGGetValidErrors();
17979    test_ret += test_xmlRelaxNGInitTypes();
17980    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17981    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17982    test_ret += test_xmlRelaxNGNewParserCtxt();
17983    test_ret += test_xmlRelaxNGNewValidCtxt();
17984    test_ret += test_xmlRelaxNGParse();
17985    test_ret += test_xmlRelaxNGSetParserErrors();
17986    test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17987    test_ret += test_xmlRelaxNGSetValidErrors();
17988    test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17989    test_ret += test_xmlRelaxNGValidateDoc();
17990    test_ret += test_xmlRelaxNGValidateFullElement();
17991    test_ret += test_xmlRelaxNGValidatePopElement();
17992    test_ret += test_xmlRelaxNGValidatePushCData();
17993    test_ret += test_xmlRelaxNGValidatePushElement();
17994    test_ret += test_xmlRelaxParserSetFlag();
17995
17996    if (test_ret != 0)
17997	printf("Module relaxng: %d errors\n", test_ret);
17998    return(test_ret);
17999}
18000static int
18001test_schemasInternals(void) {
18002    int test_ret = 0;
18003
18004    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18005
18006    if (test_ret != 0)
18007	printf("Module schemasInternals: %d errors\n", test_ret);
18008    return(test_ret);
18009}
18010
18011static int
18012test_xmlSchematronNewDocParserCtxt(void) {
18013    int test_ret = 0;
18014
18015
18016    /* missing type support */
18017    return(test_ret);
18018}
18019
18020
18021static int
18022test_xmlSchematronNewMemParserCtxt(void) {
18023    int test_ret = 0;
18024
18025
18026    /* missing type support */
18027    return(test_ret);
18028}
18029
18030
18031static int
18032test_xmlSchematronNewParserCtxt(void) {
18033    int test_ret = 0;
18034
18035
18036    /* missing type support */
18037    return(test_ret);
18038}
18039
18040#ifdef LIBXML_SCHEMATRON_ENABLED
18041
18042#define gen_nb_xmlSchematronPtr 1
18043static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18044    return(NULL);
18045}
18046static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18047}
18048#endif
18049
18050
18051static int
18052test_xmlSchematronNewValidCtxt(void) {
18053    int test_ret = 0;
18054
18055
18056    /* missing type support */
18057    return(test_ret);
18058}
18059
18060#ifdef LIBXML_SCHEMATRON_ENABLED
18061
18062#define gen_nb_xmlSchematronParserCtxtPtr 1
18063static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18064    return(NULL);
18065}
18066static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18067}
18068#endif
18069
18070
18071static int
18072test_xmlSchematronParse(void) {
18073    int test_ret = 0;
18074
18075
18076    /* missing type support */
18077    return(test_ret);
18078}
18079
18080#ifdef LIBXML_SCHEMATRON_ENABLED
18081
18082#define gen_nb_xmlSchematronValidCtxtPtr 1
18083static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18084    return(NULL);
18085}
18086static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18087}
18088#endif
18089
18090
18091static int
18092test_xmlSchematronSetValidStructuredErrors(void) {
18093    int test_ret = 0;
18094
18095
18096    /* missing type support */
18097    return(test_ret);
18098}
18099
18100
18101static int
18102test_xmlSchematronValidateDoc(void) {
18103    int test_ret = 0;
18104
18105#if defined(LIBXML_SCHEMATRON_ENABLED)
18106    int mem_base;
18107    int ret_val;
18108    xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18109    int n_ctxt;
18110    xmlDocPtr instance; /* the document instace tree */
18111    int n_instance;
18112
18113    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18114    for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18115        mem_base = xmlMemBlocks();
18116        ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18117        instance = gen_xmlDocPtr(n_instance, 1);
18118
18119        ret_val = xmlSchematronValidateDoc(ctxt, instance);
18120        desret_int(ret_val);
18121        call_tests++;
18122        des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18123        des_xmlDocPtr(n_instance, instance, 1);
18124        xmlResetLastError();
18125        if (mem_base != xmlMemBlocks()) {
18126            printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18127	           xmlMemBlocks() - mem_base);
18128	    test_ret++;
18129            printf(" %d", n_ctxt);
18130            printf(" %d", n_instance);
18131            printf("\n");
18132        }
18133    }
18134    }
18135    function_tests++;
18136#endif
18137
18138    return(test_ret);
18139}
18140
18141static int
18142test_schematron(void) {
18143    int test_ret = 0;
18144
18145    if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18146    test_ret += test_xmlSchematronNewDocParserCtxt();
18147    test_ret += test_xmlSchematronNewMemParserCtxt();
18148    test_ret += test_xmlSchematronNewParserCtxt();
18149    test_ret += test_xmlSchematronNewValidCtxt();
18150    test_ret += test_xmlSchematronParse();
18151    test_ret += test_xmlSchematronSetValidStructuredErrors();
18152    test_ret += test_xmlSchematronValidateDoc();
18153
18154    if (test_ret != 0)
18155	printf("Module schematron: %d errors\n", test_ret);
18156    return(test_ret);
18157}
18158
18159static int
18160test_xmlAddChild(void) {
18161    int test_ret = 0;
18162
18163    int mem_base;
18164    xmlNodePtr ret_val;
18165    xmlNodePtr parent; /* the parent node */
18166    int n_parent;
18167    xmlNodePtr cur; /* the child node */
18168    int n_cur;
18169
18170    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18171    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18172        mem_base = xmlMemBlocks();
18173        parent = gen_xmlNodePtr(n_parent, 0);
18174        cur = gen_xmlNodePtr_in(n_cur, 1);
18175
18176        ret_val = xmlAddChild(parent, cur);
18177        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18178        desret_xmlNodePtr(ret_val);
18179        call_tests++;
18180        des_xmlNodePtr(n_parent, parent, 0);
18181        des_xmlNodePtr_in(n_cur, cur, 1);
18182        xmlResetLastError();
18183        if (mem_base != xmlMemBlocks()) {
18184            printf("Leak of %d blocks found in xmlAddChild",
18185	           xmlMemBlocks() - mem_base);
18186	    test_ret++;
18187            printf(" %d", n_parent);
18188            printf(" %d", n_cur);
18189            printf("\n");
18190        }
18191    }
18192    }
18193    function_tests++;
18194
18195    return(test_ret);
18196}
18197
18198
18199static int
18200test_xmlAddChildList(void) {
18201    int test_ret = 0;
18202
18203    int mem_base;
18204    xmlNodePtr ret_val;
18205    xmlNodePtr parent; /* the parent node */
18206    int n_parent;
18207    xmlNodePtr cur; /* the first node in the list */
18208    int n_cur;
18209
18210    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18211    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18212        mem_base = xmlMemBlocks();
18213        parent = gen_xmlNodePtr(n_parent, 0);
18214        cur = gen_xmlNodePtr_in(n_cur, 1);
18215
18216        ret_val = xmlAddChildList(parent, cur);
18217        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18218        desret_xmlNodePtr(ret_val);
18219        call_tests++;
18220        des_xmlNodePtr(n_parent, parent, 0);
18221        des_xmlNodePtr_in(n_cur, cur, 1);
18222        xmlResetLastError();
18223        if (mem_base != xmlMemBlocks()) {
18224            printf("Leak of %d blocks found in xmlAddChildList",
18225	           xmlMemBlocks() - mem_base);
18226	    test_ret++;
18227            printf(" %d", n_parent);
18228            printf(" %d", n_cur);
18229            printf("\n");
18230        }
18231    }
18232    }
18233    function_tests++;
18234
18235    return(test_ret);
18236}
18237
18238
18239static int
18240test_xmlAddNextSibling(void) {
18241    int test_ret = 0;
18242
18243    int mem_base;
18244    xmlNodePtr ret_val;
18245    xmlNodePtr cur; /* the child node */
18246    int n_cur;
18247    xmlNodePtr elem; /* the new node */
18248    int n_elem;
18249
18250    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18251    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18252        mem_base = xmlMemBlocks();
18253        cur = gen_xmlNodePtr(n_cur, 0);
18254        elem = gen_xmlNodePtr_in(n_elem, 1);
18255
18256        ret_val = xmlAddNextSibling(cur, elem);
18257        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18258        desret_xmlNodePtr(ret_val);
18259        call_tests++;
18260        des_xmlNodePtr(n_cur, cur, 0);
18261        des_xmlNodePtr_in(n_elem, elem, 1);
18262        xmlResetLastError();
18263        if (mem_base != xmlMemBlocks()) {
18264            printf("Leak of %d blocks found in xmlAddNextSibling",
18265	           xmlMemBlocks() - mem_base);
18266	    test_ret++;
18267            printf(" %d", n_cur);
18268            printf(" %d", n_elem);
18269            printf("\n");
18270        }
18271    }
18272    }
18273    function_tests++;
18274
18275    return(test_ret);
18276}
18277
18278
18279static int
18280test_xmlAddPrevSibling(void) {
18281    int test_ret = 0;
18282
18283#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18284    int mem_base;
18285    xmlNodePtr ret_val;
18286    xmlNodePtr cur; /* the child node */
18287    int n_cur;
18288    xmlNodePtr elem; /* the new node */
18289    int n_elem;
18290
18291    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18292    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18293        mem_base = xmlMemBlocks();
18294        cur = gen_xmlNodePtr(n_cur, 0);
18295        elem = gen_xmlNodePtr_in(n_elem, 1);
18296
18297        ret_val = xmlAddPrevSibling(cur, elem);
18298        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18299        desret_xmlNodePtr(ret_val);
18300        call_tests++;
18301        des_xmlNodePtr(n_cur, cur, 0);
18302        des_xmlNodePtr_in(n_elem, elem, 1);
18303        xmlResetLastError();
18304        if (mem_base != xmlMemBlocks()) {
18305            printf("Leak of %d blocks found in xmlAddPrevSibling",
18306	           xmlMemBlocks() - mem_base);
18307	    test_ret++;
18308            printf(" %d", n_cur);
18309            printf(" %d", n_elem);
18310            printf("\n");
18311        }
18312    }
18313    }
18314    function_tests++;
18315#endif
18316
18317    return(test_ret);
18318}
18319
18320
18321static int
18322test_xmlAddSibling(void) {
18323    int test_ret = 0;
18324
18325    int mem_base;
18326    xmlNodePtr ret_val;
18327    xmlNodePtr cur; /* the child node */
18328    int n_cur;
18329    xmlNodePtr elem; /* the new node */
18330    int n_elem;
18331
18332    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18333    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18334        mem_base = xmlMemBlocks();
18335        cur = gen_xmlNodePtr(n_cur, 0);
18336        elem = gen_xmlNodePtr_in(n_elem, 1);
18337
18338        ret_val = xmlAddSibling(cur, elem);
18339        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18340        desret_xmlNodePtr(ret_val);
18341        call_tests++;
18342        des_xmlNodePtr(n_cur, cur, 0);
18343        des_xmlNodePtr_in(n_elem, elem, 1);
18344        xmlResetLastError();
18345        if (mem_base != xmlMemBlocks()) {
18346            printf("Leak of %d blocks found in xmlAddSibling",
18347	           xmlMemBlocks() - mem_base);
18348	    test_ret++;
18349            printf(" %d", n_cur);
18350            printf(" %d", n_elem);
18351            printf("\n");
18352        }
18353    }
18354    }
18355    function_tests++;
18356
18357    return(test_ret);
18358}
18359
18360
18361static int
18362test_xmlAttrSerializeTxtContent(void) {
18363    int test_ret = 0;
18364
18365#if defined(LIBXML_OUTPUT_ENABLED)
18366#ifdef LIBXML_OUTPUT_ENABLED
18367    int mem_base;
18368    xmlBufferPtr buf; /* the XML buffer output */
18369    int n_buf;
18370    xmlDocPtr doc; /* the document */
18371    int n_doc;
18372    xmlAttrPtr attr; /* the attribute node */
18373    int n_attr;
18374    xmlChar * string; /* the text content */
18375    int n_string;
18376
18377    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18378    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18379    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18380    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18381        mem_base = xmlMemBlocks();
18382        buf = gen_xmlBufferPtr(n_buf, 0);
18383        doc = gen_xmlDocPtr(n_doc, 1);
18384        attr = gen_xmlAttrPtr(n_attr, 2);
18385        string = gen_const_xmlChar_ptr(n_string, 3);
18386
18387        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18388        call_tests++;
18389        des_xmlBufferPtr(n_buf, buf, 0);
18390        des_xmlDocPtr(n_doc, doc, 1);
18391        des_xmlAttrPtr(n_attr, attr, 2);
18392        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18393        xmlResetLastError();
18394        if (mem_base != xmlMemBlocks()) {
18395            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18396	           xmlMemBlocks() - mem_base);
18397	    test_ret++;
18398            printf(" %d", n_buf);
18399            printf(" %d", n_doc);
18400            printf(" %d", n_attr);
18401            printf(" %d", n_string);
18402            printf("\n");
18403        }
18404    }
18405    }
18406    }
18407    }
18408    function_tests++;
18409#endif
18410#endif
18411
18412    return(test_ret);
18413}
18414
18415
18416static int
18417test_xmlBufferAdd(void) {
18418    int test_ret = 0;
18419
18420    int mem_base;
18421    int ret_val;
18422    xmlBufferPtr buf; /* the buffer to dump */
18423    int n_buf;
18424    xmlChar * str; /* the #xmlChar string */
18425    int n_str;
18426    int len; /* the number of #xmlChar to add */
18427    int n_len;
18428
18429    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18430    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18431    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18432        mem_base = xmlMemBlocks();
18433        buf = gen_xmlBufferPtr(n_buf, 0);
18434        str = gen_const_xmlChar_ptr(n_str, 1);
18435        len = gen_int(n_len, 2);
18436
18437        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18438        desret_int(ret_val);
18439        call_tests++;
18440        des_xmlBufferPtr(n_buf, buf, 0);
18441        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18442        des_int(n_len, len, 2);
18443        xmlResetLastError();
18444        if (mem_base != xmlMemBlocks()) {
18445            printf("Leak of %d blocks found in xmlBufferAdd",
18446	           xmlMemBlocks() - mem_base);
18447	    test_ret++;
18448            printf(" %d", n_buf);
18449            printf(" %d", n_str);
18450            printf(" %d", n_len);
18451            printf("\n");
18452        }
18453    }
18454    }
18455    }
18456    function_tests++;
18457
18458    return(test_ret);
18459}
18460
18461
18462static int
18463test_xmlBufferAddHead(void) {
18464    int test_ret = 0;
18465
18466    int mem_base;
18467    int ret_val;
18468    xmlBufferPtr buf; /* the buffer */
18469    int n_buf;
18470    xmlChar * str; /* the #xmlChar string */
18471    int n_str;
18472    int len; /* the number of #xmlChar to add */
18473    int n_len;
18474
18475    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18476    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18477    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18478        mem_base = xmlMemBlocks();
18479        buf = gen_xmlBufferPtr(n_buf, 0);
18480        str = gen_const_xmlChar_ptr(n_str, 1);
18481        len = gen_int(n_len, 2);
18482
18483        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18484        desret_int(ret_val);
18485        call_tests++;
18486        des_xmlBufferPtr(n_buf, buf, 0);
18487        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18488        des_int(n_len, len, 2);
18489        xmlResetLastError();
18490        if (mem_base != xmlMemBlocks()) {
18491            printf("Leak of %d blocks found in xmlBufferAddHead",
18492	           xmlMemBlocks() - mem_base);
18493	    test_ret++;
18494            printf(" %d", n_buf);
18495            printf(" %d", n_str);
18496            printf(" %d", n_len);
18497            printf("\n");
18498        }
18499    }
18500    }
18501    }
18502    function_tests++;
18503
18504    return(test_ret);
18505}
18506
18507
18508static int
18509test_xmlBufferCCat(void) {
18510    int test_ret = 0;
18511
18512    int mem_base;
18513    int ret_val;
18514    xmlBufferPtr buf; /* the buffer to dump */
18515    int n_buf;
18516    char * str; /* the C char string */
18517    int n_str;
18518
18519    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18520    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18521        mem_base = xmlMemBlocks();
18522        buf = gen_xmlBufferPtr(n_buf, 0);
18523        str = gen_const_char_ptr(n_str, 1);
18524
18525        ret_val = xmlBufferCCat(buf, (const char *)str);
18526        desret_int(ret_val);
18527        call_tests++;
18528        des_xmlBufferPtr(n_buf, buf, 0);
18529        des_const_char_ptr(n_str, (const char *)str, 1);
18530        xmlResetLastError();
18531        if (mem_base != xmlMemBlocks()) {
18532            printf("Leak of %d blocks found in xmlBufferCCat",
18533	           xmlMemBlocks() - mem_base);
18534	    test_ret++;
18535            printf(" %d", n_buf);
18536            printf(" %d", n_str);
18537            printf("\n");
18538        }
18539    }
18540    }
18541    function_tests++;
18542
18543    return(test_ret);
18544}
18545
18546
18547static int
18548test_xmlBufferCat(void) {
18549    int test_ret = 0;
18550
18551    int mem_base;
18552    int ret_val;
18553    xmlBufferPtr buf; /* the buffer to add to */
18554    int n_buf;
18555    xmlChar * str; /* the #xmlChar string */
18556    int n_str;
18557
18558    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18559    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18560        mem_base = xmlMemBlocks();
18561        buf = gen_xmlBufferPtr(n_buf, 0);
18562        str = gen_const_xmlChar_ptr(n_str, 1);
18563
18564        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18565        desret_int(ret_val);
18566        call_tests++;
18567        des_xmlBufferPtr(n_buf, buf, 0);
18568        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18569        xmlResetLastError();
18570        if (mem_base != xmlMemBlocks()) {
18571            printf("Leak of %d blocks found in xmlBufferCat",
18572	           xmlMemBlocks() - mem_base);
18573	    test_ret++;
18574            printf(" %d", n_buf);
18575            printf(" %d", n_str);
18576            printf("\n");
18577        }
18578    }
18579    }
18580    function_tests++;
18581
18582    return(test_ret);
18583}
18584
18585
18586#define gen_nb_const_xmlBufferPtr 1
18587static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18588    return(NULL);
18589}
18590static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18591}
18592
18593static int
18594test_xmlBufferContent(void) {
18595    int test_ret = 0;
18596
18597    int mem_base;
18598    const xmlChar * ret_val;
18599    xmlBufferPtr buf; /* the buffer */
18600    int n_buf;
18601
18602    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18603        mem_base = xmlMemBlocks();
18604        buf = gen_const_xmlBufferPtr(n_buf, 0);
18605
18606        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18607        desret_const_xmlChar_ptr(ret_val);
18608        call_tests++;
18609        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18610        xmlResetLastError();
18611        if (mem_base != xmlMemBlocks()) {
18612            printf("Leak of %d blocks found in xmlBufferContent",
18613	           xmlMemBlocks() - mem_base);
18614	    test_ret++;
18615            printf(" %d", n_buf);
18616            printf("\n");
18617        }
18618    }
18619    function_tests++;
18620
18621    return(test_ret);
18622}
18623
18624
18625static int
18626test_xmlBufferCreate(void) {
18627    int test_ret = 0;
18628
18629    int mem_base;
18630    xmlBufferPtr ret_val;
18631
18632        mem_base = xmlMemBlocks();
18633
18634        ret_val = xmlBufferCreate();
18635        desret_xmlBufferPtr(ret_val);
18636        call_tests++;
18637        xmlResetLastError();
18638        if (mem_base != xmlMemBlocks()) {
18639            printf("Leak of %d blocks found in xmlBufferCreate",
18640	           xmlMemBlocks() - mem_base);
18641	    test_ret++;
18642            printf("\n");
18643        }
18644    function_tests++;
18645
18646    return(test_ret);
18647}
18648
18649
18650static int
18651test_xmlBufferCreateSize(void) {
18652    int test_ret = 0;
18653
18654
18655    /* missing type support */
18656    return(test_ret);
18657}
18658
18659
18660static int
18661test_xmlBufferCreateStatic(void) {
18662    int test_ret = 0;
18663
18664
18665    /* missing type support */
18666    return(test_ret);
18667}
18668
18669
18670static int
18671test_xmlBufferEmpty(void) {
18672    int test_ret = 0;
18673
18674    int mem_base;
18675    xmlBufferPtr buf; /* the buffer */
18676    int n_buf;
18677
18678    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18679        mem_base = xmlMemBlocks();
18680        buf = gen_xmlBufferPtr(n_buf, 0);
18681
18682        xmlBufferEmpty(buf);
18683        call_tests++;
18684        des_xmlBufferPtr(n_buf, buf, 0);
18685        xmlResetLastError();
18686        if (mem_base != xmlMemBlocks()) {
18687            printf("Leak of %d blocks found in xmlBufferEmpty",
18688	           xmlMemBlocks() - mem_base);
18689	    test_ret++;
18690            printf(" %d", n_buf);
18691            printf("\n");
18692        }
18693    }
18694    function_tests++;
18695
18696    return(test_ret);
18697}
18698
18699
18700static int
18701test_xmlBufferGrow(void) {
18702    int test_ret = 0;
18703
18704    int mem_base;
18705    int ret_val;
18706    xmlBufferPtr buf; /* the buffer */
18707    int n_buf;
18708    unsigned int len; /* the minimum free size to allocate */
18709    int n_len;
18710
18711    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18712    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18713        mem_base = xmlMemBlocks();
18714        buf = gen_xmlBufferPtr(n_buf, 0);
18715        len = gen_unsigned_int(n_len, 1);
18716
18717        ret_val = xmlBufferGrow(buf, len);
18718        desret_int(ret_val);
18719        call_tests++;
18720        des_xmlBufferPtr(n_buf, buf, 0);
18721        des_unsigned_int(n_len, len, 1);
18722        xmlResetLastError();
18723        if (mem_base != xmlMemBlocks()) {
18724            printf("Leak of %d blocks found in xmlBufferGrow",
18725	           xmlMemBlocks() - mem_base);
18726	    test_ret++;
18727            printf(" %d", n_buf);
18728            printf(" %d", n_len);
18729            printf("\n");
18730        }
18731    }
18732    }
18733    function_tests++;
18734
18735    return(test_ret);
18736}
18737
18738
18739static int
18740test_xmlBufferLength(void) {
18741    int test_ret = 0;
18742
18743    int mem_base;
18744    int ret_val;
18745    xmlBufferPtr buf; /* the buffer */
18746    int n_buf;
18747
18748    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18749        mem_base = xmlMemBlocks();
18750        buf = gen_const_xmlBufferPtr(n_buf, 0);
18751
18752        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18753        desret_int(ret_val);
18754        call_tests++;
18755        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18756        xmlResetLastError();
18757        if (mem_base != xmlMemBlocks()) {
18758            printf("Leak of %d blocks found in xmlBufferLength",
18759	           xmlMemBlocks() - mem_base);
18760	    test_ret++;
18761            printf(" %d", n_buf);
18762            printf("\n");
18763        }
18764    }
18765    function_tests++;
18766
18767    return(test_ret);
18768}
18769
18770
18771static int
18772test_xmlBufferResize(void) {
18773    int test_ret = 0;
18774
18775    int mem_base;
18776    int ret_val;
18777    xmlBufferPtr buf; /* the buffer to resize */
18778    int n_buf;
18779    unsigned int size; /* the desired size */
18780    int n_size;
18781
18782    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18783    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18784        mem_base = xmlMemBlocks();
18785        buf = gen_xmlBufferPtr(n_buf, 0);
18786        size = gen_unsigned_int(n_size, 1);
18787
18788        ret_val = xmlBufferResize(buf, size);
18789        desret_int(ret_val);
18790        call_tests++;
18791        des_xmlBufferPtr(n_buf, buf, 0);
18792        des_unsigned_int(n_size, size, 1);
18793        xmlResetLastError();
18794        if (mem_base != xmlMemBlocks()) {
18795            printf("Leak of %d blocks found in xmlBufferResize",
18796	           xmlMemBlocks() - mem_base);
18797	    test_ret++;
18798            printf(" %d", n_buf);
18799            printf(" %d", n_size);
18800            printf("\n");
18801        }
18802    }
18803    }
18804    function_tests++;
18805
18806    return(test_ret);
18807}
18808
18809
18810static int
18811test_xmlBufferSetAllocationScheme(void) {
18812    int test_ret = 0;
18813
18814    int mem_base;
18815    xmlBufferPtr buf; /* the buffer to tune */
18816    int n_buf;
18817    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18818    int n_scheme;
18819
18820    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18821    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18822        mem_base = xmlMemBlocks();
18823        buf = gen_xmlBufferPtr(n_buf, 0);
18824        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18825
18826        xmlBufferSetAllocationScheme(buf, scheme);
18827        call_tests++;
18828        des_xmlBufferPtr(n_buf, buf, 0);
18829        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18830        xmlResetLastError();
18831        if (mem_base != xmlMemBlocks()) {
18832            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18833	           xmlMemBlocks() - mem_base);
18834	    test_ret++;
18835            printf(" %d", n_buf);
18836            printf(" %d", n_scheme);
18837            printf("\n");
18838        }
18839    }
18840    }
18841    function_tests++;
18842
18843    return(test_ret);
18844}
18845
18846
18847static int
18848test_xmlBufferShrink(void) {
18849    int test_ret = 0;
18850
18851    int mem_base;
18852    int ret_val;
18853    xmlBufferPtr buf; /* the buffer to dump */
18854    int n_buf;
18855    unsigned int len; /* the number of xmlChar to remove */
18856    int n_len;
18857
18858    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18859    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18860        mem_base = xmlMemBlocks();
18861        buf = gen_xmlBufferPtr(n_buf, 0);
18862        len = gen_unsigned_int(n_len, 1);
18863
18864        ret_val = xmlBufferShrink(buf, len);
18865        desret_int(ret_val);
18866        call_tests++;
18867        des_xmlBufferPtr(n_buf, buf, 0);
18868        des_unsigned_int(n_len, len, 1);
18869        xmlResetLastError();
18870        if (mem_base != xmlMemBlocks()) {
18871            printf("Leak of %d blocks found in xmlBufferShrink",
18872	           xmlMemBlocks() - mem_base);
18873	    test_ret++;
18874            printf(" %d", n_buf);
18875            printf(" %d", n_len);
18876            printf("\n");
18877        }
18878    }
18879    }
18880    function_tests++;
18881
18882    return(test_ret);
18883}
18884
18885
18886static int
18887test_xmlBufferWriteCHAR(void) {
18888    int test_ret = 0;
18889
18890    int mem_base;
18891    xmlBufferPtr buf; /* the XML buffer */
18892    int n_buf;
18893    xmlChar * string; /* the string to add */
18894    int n_string;
18895
18896    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18897    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18898        mem_base = xmlMemBlocks();
18899        buf = gen_xmlBufferPtr(n_buf, 0);
18900        string = gen_const_xmlChar_ptr(n_string, 1);
18901
18902        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18903        call_tests++;
18904        des_xmlBufferPtr(n_buf, buf, 0);
18905        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18906        xmlResetLastError();
18907        if (mem_base != xmlMemBlocks()) {
18908            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18909	           xmlMemBlocks() - mem_base);
18910	    test_ret++;
18911            printf(" %d", n_buf);
18912            printf(" %d", n_string);
18913            printf("\n");
18914        }
18915    }
18916    }
18917    function_tests++;
18918
18919    return(test_ret);
18920}
18921
18922
18923static int
18924test_xmlBufferWriteChar(void) {
18925    int test_ret = 0;
18926
18927    int mem_base;
18928    xmlBufferPtr buf; /* the XML buffer output */
18929    int n_buf;
18930    char * string; /* the string to add */
18931    int n_string;
18932
18933    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18934    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18935        mem_base = xmlMemBlocks();
18936        buf = gen_xmlBufferPtr(n_buf, 0);
18937        string = gen_const_char_ptr(n_string, 1);
18938
18939        xmlBufferWriteChar(buf, (const char *)string);
18940        call_tests++;
18941        des_xmlBufferPtr(n_buf, buf, 0);
18942        des_const_char_ptr(n_string, (const char *)string, 1);
18943        xmlResetLastError();
18944        if (mem_base != xmlMemBlocks()) {
18945            printf("Leak of %d blocks found in xmlBufferWriteChar",
18946	           xmlMemBlocks() - mem_base);
18947	    test_ret++;
18948            printf(" %d", n_buf);
18949            printf(" %d", n_string);
18950            printf("\n");
18951        }
18952    }
18953    }
18954    function_tests++;
18955
18956    return(test_ret);
18957}
18958
18959
18960static int
18961test_xmlBufferWriteQuotedString(void) {
18962    int test_ret = 0;
18963
18964    int mem_base;
18965    xmlBufferPtr buf; /* the XML buffer output */
18966    int n_buf;
18967    xmlChar * string; /* the string to add */
18968    int n_string;
18969
18970    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18971    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18972        mem_base = xmlMemBlocks();
18973        buf = gen_xmlBufferPtr(n_buf, 0);
18974        string = gen_const_xmlChar_ptr(n_string, 1);
18975
18976        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18977        call_tests++;
18978        des_xmlBufferPtr(n_buf, buf, 0);
18979        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18980        xmlResetLastError();
18981        if (mem_base != xmlMemBlocks()) {
18982            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18983	           xmlMemBlocks() - mem_base);
18984	    test_ret++;
18985            printf(" %d", n_buf);
18986            printf(" %d", n_string);
18987            printf("\n");
18988        }
18989    }
18990    }
18991    function_tests++;
18992
18993    return(test_ret);
18994}
18995
18996
18997static int
18998test_xmlBuildQName(void) {
18999    int test_ret = 0;
19000
19001    int mem_base;
19002    xmlChar * ret_val;
19003    xmlChar * ncname; /* the Name */
19004    int n_ncname;
19005    xmlChar * prefix; /* the prefix */
19006    int n_prefix;
19007    xmlChar * memory; /* preallocated memory */
19008    int n_memory;
19009    int len; /* preallocated memory length */
19010    int n_len;
19011
19012    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19013    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19014    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19015    for (n_len = 0;n_len < gen_nb_int;n_len++) {
19016        mem_base = xmlMemBlocks();
19017        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19018        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19019        memory = gen_xmlChar_ptr(n_memory, 2);
19020        len = gen_int(n_len, 3);
19021
19022        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19023        if ((ret_val != NULL) && (ret_val != ncname) &&
19024              (ret_val != prefix) && (ret_val != memory))
19025              xmlFree(ret_val);
19026	  ret_val = NULL;
19027        desret_xmlChar_ptr(ret_val);
19028        call_tests++;
19029        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19030        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19031        des_xmlChar_ptr(n_memory, memory, 2);
19032        des_int(n_len, len, 3);
19033        xmlResetLastError();
19034        if (mem_base != xmlMemBlocks()) {
19035            printf("Leak of %d blocks found in xmlBuildQName",
19036	           xmlMemBlocks() - mem_base);
19037	    test_ret++;
19038            printf(" %d", n_ncname);
19039            printf(" %d", n_prefix);
19040            printf(" %d", n_memory);
19041            printf(" %d", n_len);
19042            printf("\n");
19043        }
19044    }
19045    }
19046    }
19047    }
19048    function_tests++;
19049
19050    return(test_ret);
19051}
19052
19053
19054static int
19055test_xmlCopyDoc(void) {
19056    int test_ret = 0;
19057
19058#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19059    int mem_base;
19060    xmlDocPtr ret_val;
19061    xmlDocPtr doc; /* the document */
19062    int n_doc;
19063    int recursive; /* if not zero do a recursive copy. */
19064    int n_recursive;
19065
19066    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19067    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19068        mem_base = xmlMemBlocks();
19069        doc = gen_xmlDocPtr(n_doc, 0);
19070        recursive = gen_int(n_recursive, 1);
19071
19072        ret_val = xmlCopyDoc(doc, recursive);
19073        desret_xmlDocPtr(ret_val);
19074        call_tests++;
19075        des_xmlDocPtr(n_doc, doc, 0);
19076        des_int(n_recursive, recursive, 1);
19077        xmlResetLastError();
19078        if (mem_base != xmlMemBlocks()) {
19079            printf("Leak of %d blocks found in xmlCopyDoc",
19080	           xmlMemBlocks() - mem_base);
19081	    test_ret++;
19082            printf(" %d", n_doc);
19083            printf(" %d", n_recursive);
19084            printf("\n");
19085        }
19086    }
19087    }
19088    function_tests++;
19089#endif
19090
19091    return(test_ret);
19092}
19093
19094
19095static int
19096test_xmlCopyDtd(void) {
19097    int test_ret = 0;
19098
19099#if defined(LIBXML_TREE_ENABLED)
19100    int mem_base;
19101    xmlDtdPtr ret_val;
19102    xmlDtdPtr dtd; /* the dtd */
19103    int n_dtd;
19104
19105    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19106        mem_base = xmlMemBlocks();
19107        dtd = gen_xmlDtdPtr(n_dtd, 0);
19108
19109        ret_val = xmlCopyDtd(dtd);
19110        desret_xmlDtdPtr(ret_val);
19111        call_tests++;
19112        des_xmlDtdPtr(n_dtd, dtd, 0);
19113        xmlResetLastError();
19114        if (mem_base != xmlMemBlocks()) {
19115            printf("Leak of %d blocks found in xmlCopyDtd",
19116	           xmlMemBlocks() - mem_base);
19117	    test_ret++;
19118            printf(" %d", n_dtd);
19119            printf("\n");
19120        }
19121    }
19122    function_tests++;
19123#endif
19124
19125    return(test_ret);
19126}
19127
19128
19129static int
19130test_xmlCopyNamespace(void) {
19131    int test_ret = 0;
19132
19133    int mem_base;
19134    xmlNsPtr ret_val;
19135    xmlNsPtr cur; /* the namespace */
19136    int n_cur;
19137
19138    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19139        mem_base = xmlMemBlocks();
19140        cur = gen_xmlNsPtr(n_cur, 0);
19141
19142        ret_val = xmlCopyNamespace(cur);
19143        if (ret_val != NULL) xmlFreeNs(ret_val);
19144        desret_xmlNsPtr(ret_val);
19145        call_tests++;
19146        des_xmlNsPtr(n_cur, cur, 0);
19147        xmlResetLastError();
19148        if (mem_base != xmlMemBlocks()) {
19149            printf("Leak of %d blocks found in xmlCopyNamespace",
19150	           xmlMemBlocks() - mem_base);
19151	    test_ret++;
19152            printf(" %d", n_cur);
19153            printf("\n");
19154        }
19155    }
19156    function_tests++;
19157
19158    return(test_ret);
19159}
19160
19161
19162static int
19163test_xmlCopyNamespaceList(void) {
19164    int test_ret = 0;
19165
19166    int mem_base;
19167    xmlNsPtr ret_val;
19168    xmlNsPtr cur; /* the first namespace */
19169    int n_cur;
19170
19171    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19172        mem_base = xmlMemBlocks();
19173        cur = gen_xmlNsPtr(n_cur, 0);
19174
19175        ret_val = xmlCopyNamespaceList(cur);
19176        if (ret_val != NULL) xmlFreeNsList(ret_val);
19177        desret_xmlNsPtr(ret_val);
19178        call_tests++;
19179        des_xmlNsPtr(n_cur, cur, 0);
19180        xmlResetLastError();
19181        if (mem_base != xmlMemBlocks()) {
19182            printf("Leak of %d blocks found in xmlCopyNamespaceList",
19183	           xmlMemBlocks() - mem_base);
19184	    test_ret++;
19185            printf(" %d", n_cur);
19186            printf("\n");
19187        }
19188    }
19189    function_tests++;
19190
19191    return(test_ret);
19192}
19193
19194
19195static int
19196test_xmlCopyNode(void) {
19197    int test_ret = 0;
19198
19199    int mem_base;
19200    xmlNodePtr ret_val;
19201    xmlNodePtr node; /* the node */
19202    int n_node;
19203    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19204    int n_extended;
19205
19206    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19207    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19208        mem_base = xmlMemBlocks();
19209        node = gen_const_xmlNodePtr(n_node, 0);
19210        extended = gen_int(n_extended, 1);
19211
19212        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19213        desret_xmlNodePtr(ret_val);
19214        call_tests++;
19215        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19216        des_int(n_extended, extended, 1);
19217        xmlResetLastError();
19218        if (mem_base != xmlMemBlocks()) {
19219            printf("Leak of %d blocks found in xmlCopyNode",
19220	           xmlMemBlocks() - mem_base);
19221	    test_ret++;
19222            printf(" %d", n_node);
19223            printf(" %d", n_extended);
19224            printf("\n");
19225        }
19226    }
19227    }
19228    function_tests++;
19229
19230    return(test_ret);
19231}
19232
19233
19234static int
19235test_xmlCopyNodeList(void) {
19236    int test_ret = 0;
19237
19238    int mem_base;
19239    xmlNodePtr ret_val;
19240    xmlNodePtr node; /* the first node in the list. */
19241    int n_node;
19242
19243    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19244        mem_base = xmlMemBlocks();
19245        node = gen_const_xmlNodePtr(n_node, 0);
19246
19247        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19248        desret_xmlNodePtr(ret_val);
19249        call_tests++;
19250        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19251        xmlResetLastError();
19252        if (mem_base != xmlMemBlocks()) {
19253            printf("Leak of %d blocks found in xmlCopyNodeList",
19254	           xmlMemBlocks() - mem_base);
19255	    test_ret++;
19256            printf(" %d", n_node);
19257            printf("\n");
19258        }
19259    }
19260    function_tests++;
19261
19262    return(test_ret);
19263}
19264
19265
19266static int
19267test_xmlCopyProp(void) {
19268    int test_ret = 0;
19269
19270    int mem_base;
19271    xmlAttrPtr ret_val;
19272    xmlNodePtr target; /* the element where the attribute will be grafted */
19273    int n_target;
19274    xmlAttrPtr cur; /* the attribute */
19275    int n_cur;
19276
19277    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19278    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19279        mem_base = xmlMemBlocks();
19280        target = gen_xmlNodePtr(n_target, 0);
19281        cur = gen_xmlAttrPtr(n_cur, 1);
19282
19283        ret_val = xmlCopyProp(target, cur);
19284        desret_xmlAttrPtr(ret_val);
19285        call_tests++;
19286        des_xmlNodePtr(n_target, target, 0);
19287        des_xmlAttrPtr(n_cur, cur, 1);
19288        xmlResetLastError();
19289        if (mem_base != xmlMemBlocks()) {
19290            printf("Leak of %d blocks found in xmlCopyProp",
19291	           xmlMemBlocks() - mem_base);
19292	    test_ret++;
19293            printf(" %d", n_target);
19294            printf(" %d", n_cur);
19295            printf("\n");
19296        }
19297    }
19298    }
19299    function_tests++;
19300
19301    return(test_ret);
19302}
19303
19304
19305static int
19306test_xmlCopyPropList(void) {
19307    int test_ret = 0;
19308
19309    int mem_base;
19310    xmlAttrPtr ret_val;
19311    xmlNodePtr target; /* the element where the attributes will be grafted */
19312    int n_target;
19313    xmlAttrPtr cur; /* the first attribute */
19314    int n_cur;
19315
19316    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19317    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19318        mem_base = xmlMemBlocks();
19319        target = gen_xmlNodePtr(n_target, 0);
19320        cur = gen_xmlAttrPtr(n_cur, 1);
19321
19322        ret_val = xmlCopyPropList(target, cur);
19323        desret_xmlAttrPtr(ret_val);
19324        call_tests++;
19325        des_xmlNodePtr(n_target, target, 0);
19326        des_xmlAttrPtr(n_cur, cur, 1);
19327        xmlResetLastError();
19328        if (mem_base != xmlMemBlocks()) {
19329            printf("Leak of %d blocks found in xmlCopyPropList",
19330	           xmlMemBlocks() - mem_base);
19331	    test_ret++;
19332            printf(" %d", n_target);
19333            printf(" %d", n_cur);
19334            printf("\n");
19335        }
19336    }
19337    }
19338    function_tests++;
19339
19340    return(test_ret);
19341}
19342
19343
19344static int
19345test_xmlCreateIntSubset(void) {
19346    int test_ret = 0;
19347
19348    int mem_base;
19349    xmlDtdPtr ret_val;
19350    xmlDocPtr doc; /* the document pointer */
19351    int n_doc;
19352    xmlChar * name; /* the DTD name */
19353    int n_name;
19354    xmlChar * ExternalID; /* the external (PUBLIC) ID */
19355    int n_ExternalID;
19356    xmlChar * SystemID; /* the system ID */
19357    int n_SystemID;
19358
19359    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19360    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19361    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19362    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19363        mem_base = xmlMemBlocks();
19364        doc = gen_xmlDocPtr(n_doc, 0);
19365        name = gen_const_xmlChar_ptr(n_name, 1);
19366        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19367        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19368
19369        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19370        desret_xmlDtdPtr(ret_val);
19371        call_tests++;
19372        des_xmlDocPtr(n_doc, doc, 0);
19373        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19374        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19375        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19376        xmlResetLastError();
19377        if (mem_base != xmlMemBlocks()) {
19378            printf("Leak of %d blocks found in xmlCreateIntSubset",
19379	           xmlMemBlocks() - mem_base);
19380	    test_ret++;
19381            printf(" %d", n_doc);
19382            printf(" %d", n_name);
19383            printf(" %d", n_ExternalID);
19384            printf(" %d", n_SystemID);
19385            printf("\n");
19386        }
19387    }
19388    }
19389    }
19390    }
19391    function_tests++;
19392
19393    return(test_ret);
19394}
19395
19396
19397#define gen_nb_xmlDOMWrapCtxtPtr 1
19398static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19399    return(NULL);
19400}
19401static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19402}
19403
19404static int
19405test_xmlDOMWrapAdoptNode(void) {
19406    int test_ret = 0;
19407
19408    int mem_base;
19409    int ret_val;
19410    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19411    int n_ctxt;
19412    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19413    int n_sourceDoc;
19414    xmlNodePtr node; /* the node to start with */
19415    int n_node;
19416    xmlDocPtr destDoc; /* the destination doc */
19417    int n_destDoc;
19418    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19419    int n_destParent;
19420    int options; /* option flags */
19421    int n_options;
19422
19423    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19424    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19425    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19426    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19427    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19428    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19429        mem_base = xmlMemBlocks();
19430        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19431        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19432        node = gen_xmlNodePtr(n_node, 2);
19433        destDoc = gen_xmlDocPtr(n_destDoc, 3);
19434        destParent = gen_xmlNodePtr(n_destParent, 4);
19435        options = gen_int(n_options, 5);
19436
19437        ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19438        if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19439        desret_int(ret_val);
19440        call_tests++;
19441        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19442        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19443        des_xmlNodePtr(n_node, node, 2);
19444        des_xmlDocPtr(n_destDoc, destDoc, 3);
19445        des_xmlNodePtr(n_destParent, destParent, 4);
19446        des_int(n_options, options, 5);
19447        xmlResetLastError();
19448        if (mem_base != xmlMemBlocks()) {
19449            printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19450	           xmlMemBlocks() - mem_base);
19451	    test_ret++;
19452            printf(" %d", n_ctxt);
19453            printf(" %d", n_sourceDoc);
19454            printf(" %d", n_node);
19455            printf(" %d", n_destDoc);
19456            printf(" %d", n_destParent);
19457            printf(" %d", n_options);
19458            printf("\n");
19459        }
19460    }
19461    }
19462    }
19463    }
19464    }
19465    }
19466    function_tests++;
19467
19468    return(test_ret);
19469}
19470
19471
19472static int
19473test_xmlDOMWrapCloneNode(void) {
19474    int test_ret = 0;
19475
19476    int mem_base;
19477    int ret_val;
19478    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19479    int n_ctxt;
19480    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19481    int n_sourceDoc;
19482    xmlNodePtr node; /* the node to start with */
19483    int n_node;
19484    xmlNodePtr * resNode; /* the clone of the given @node */
19485    int n_resNode;
19486    xmlDocPtr destDoc; /* the destination doc */
19487    int n_destDoc;
19488    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19489    int n_destParent;
19490    int deep; /* descend into child if set */
19491    int n_deep;
19492    int options; /* option flags */
19493    int n_options;
19494
19495    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19496    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19497    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19498    for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19499    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19500    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19501    for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19502    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19503        mem_base = xmlMemBlocks();
19504        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19505        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19506        node = gen_xmlNodePtr(n_node, 2);
19507        resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19508        destDoc = gen_xmlDocPtr(n_destDoc, 4);
19509        destParent = gen_xmlNodePtr(n_destParent, 5);
19510        deep = gen_int(n_deep, 6);
19511        options = gen_int(n_options, 7);
19512
19513        ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19514        desret_int(ret_val);
19515        call_tests++;
19516        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19517        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19518        des_xmlNodePtr(n_node, node, 2);
19519        des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19520        des_xmlDocPtr(n_destDoc, destDoc, 4);
19521        des_xmlNodePtr(n_destParent, destParent, 5);
19522        des_int(n_deep, deep, 6);
19523        des_int(n_options, options, 7);
19524        xmlResetLastError();
19525        if (mem_base != xmlMemBlocks()) {
19526            printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19527	           xmlMemBlocks() - mem_base);
19528	    test_ret++;
19529            printf(" %d", n_ctxt);
19530            printf(" %d", n_sourceDoc);
19531            printf(" %d", n_node);
19532            printf(" %d", n_resNode);
19533            printf(" %d", n_destDoc);
19534            printf(" %d", n_destParent);
19535            printf(" %d", n_deep);
19536            printf(" %d", n_options);
19537            printf("\n");
19538        }
19539    }
19540    }
19541    }
19542    }
19543    }
19544    }
19545    }
19546    }
19547    function_tests++;
19548
19549    return(test_ret);
19550}
19551
19552
19553static int
19554test_xmlDOMWrapNewCtxt(void) {
19555    int test_ret = 0;
19556
19557
19558    /* missing type support */
19559    return(test_ret);
19560}
19561
19562
19563static int
19564test_xmlDOMWrapReconcileNamespaces(void) {
19565    int test_ret = 0;
19566
19567    int mem_base;
19568    int ret_val;
19569    xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19570    int n_ctxt;
19571    xmlNodePtr elem; /* the element-node */
19572    int n_elem;
19573    int options; /* option flags */
19574    int n_options;
19575
19576    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19577    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19578    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19579        mem_base = xmlMemBlocks();
19580        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19581        elem = gen_xmlNodePtr(n_elem, 1);
19582        options = gen_int(n_options, 2);
19583
19584        ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19585        desret_int(ret_val);
19586        call_tests++;
19587        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19588        des_xmlNodePtr(n_elem, elem, 1);
19589        des_int(n_options, options, 2);
19590        xmlResetLastError();
19591        if (mem_base != xmlMemBlocks()) {
19592            printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19593	           xmlMemBlocks() - mem_base);
19594	    test_ret++;
19595            printf(" %d", n_ctxt);
19596            printf(" %d", n_elem);
19597            printf(" %d", n_options);
19598            printf("\n");
19599        }
19600    }
19601    }
19602    }
19603    function_tests++;
19604
19605    return(test_ret);
19606}
19607
19608
19609static int
19610test_xmlDOMWrapRemoveNode(void) {
19611    int test_ret = 0;
19612
19613    int mem_base;
19614    int ret_val;
19615    xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19616    int n_ctxt;
19617    xmlDocPtr doc; /* the doc */
19618    int n_doc;
19619    xmlNodePtr node; /* the node to be removed. */
19620    int n_node;
19621    int options; /* set of options, unused at the moment */
19622    int n_options;
19623
19624    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19625    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19626    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19627    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19628        mem_base = xmlMemBlocks();
19629        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19630        doc = gen_xmlDocPtr(n_doc, 1);
19631        node = gen_xmlNodePtr(n_node, 2);
19632        options = gen_int(n_options, 3);
19633
19634        ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19635        desret_int(ret_val);
19636        call_tests++;
19637        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19638        des_xmlDocPtr(n_doc, doc, 1);
19639        des_xmlNodePtr(n_node, node, 2);
19640        des_int(n_options, options, 3);
19641        xmlResetLastError();
19642        if (mem_base != xmlMemBlocks()) {
19643            printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19644	           xmlMemBlocks() - mem_base);
19645	    test_ret++;
19646            printf(" %d", n_ctxt);
19647            printf(" %d", n_doc);
19648            printf(" %d", n_node);
19649            printf(" %d", n_options);
19650            printf("\n");
19651        }
19652    }
19653    }
19654    }
19655    }
19656    function_tests++;
19657
19658    return(test_ret);
19659}
19660
19661
19662static int
19663test_xmlDocCopyNode(void) {
19664    int test_ret = 0;
19665
19666    int mem_base;
19667    xmlNodePtr ret_val;
19668    xmlNodePtr node; /* the node */
19669    int n_node;
19670    xmlDocPtr doc; /* the document */
19671    int n_doc;
19672    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19673    int n_extended;
19674
19675    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19676    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19677    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19678        mem_base = xmlMemBlocks();
19679        node = gen_const_xmlNodePtr(n_node, 0);
19680        doc = gen_xmlDocPtr(n_doc, 1);
19681        extended = gen_int(n_extended, 2);
19682
19683        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19684        desret_xmlNodePtr(ret_val);
19685        call_tests++;
19686        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19687        des_xmlDocPtr(n_doc, doc, 1);
19688        des_int(n_extended, extended, 2);
19689        xmlResetLastError();
19690        if (mem_base != xmlMemBlocks()) {
19691            printf("Leak of %d blocks found in xmlDocCopyNode",
19692	           xmlMemBlocks() - mem_base);
19693	    test_ret++;
19694            printf(" %d", n_node);
19695            printf(" %d", n_doc);
19696            printf(" %d", n_extended);
19697            printf("\n");
19698        }
19699    }
19700    }
19701    }
19702    function_tests++;
19703
19704    return(test_ret);
19705}
19706
19707
19708static int
19709test_xmlDocCopyNodeList(void) {
19710    int test_ret = 0;
19711
19712    int mem_base;
19713    xmlNodePtr ret_val;
19714    xmlDocPtr doc; /* the target document */
19715    int n_doc;
19716    xmlNodePtr node; /* the first node in the list. */
19717    int n_node;
19718
19719    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19720    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19721        mem_base = xmlMemBlocks();
19722        doc = gen_xmlDocPtr(n_doc, 0);
19723        node = gen_const_xmlNodePtr(n_node, 1);
19724
19725        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19726        desret_xmlNodePtr(ret_val);
19727        call_tests++;
19728        des_xmlDocPtr(n_doc, doc, 0);
19729        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19730        xmlResetLastError();
19731        if (mem_base != xmlMemBlocks()) {
19732            printf("Leak of %d blocks found in xmlDocCopyNodeList",
19733	           xmlMemBlocks() - mem_base);
19734	    test_ret++;
19735            printf(" %d", n_doc);
19736            printf(" %d", n_node);
19737            printf("\n");
19738        }
19739    }
19740    }
19741    function_tests++;
19742
19743    return(test_ret);
19744}
19745
19746
19747static int
19748test_xmlDocDump(void) {
19749    int test_ret = 0;
19750
19751#if defined(LIBXML_OUTPUT_ENABLED)
19752    int mem_base;
19753    int ret_val;
19754    FILE * f; /* the FILE* */
19755    int n_f;
19756    xmlDocPtr cur; /* the document */
19757    int n_cur;
19758
19759    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19760    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19761        mem_base = xmlMemBlocks();
19762        f = gen_FILE_ptr(n_f, 0);
19763        cur = gen_xmlDocPtr(n_cur, 1);
19764
19765        ret_val = xmlDocDump(f, cur);
19766        desret_int(ret_val);
19767        call_tests++;
19768        des_FILE_ptr(n_f, f, 0);
19769        des_xmlDocPtr(n_cur, cur, 1);
19770        xmlResetLastError();
19771        if (mem_base != xmlMemBlocks()) {
19772            printf("Leak of %d blocks found in xmlDocDump",
19773	           xmlMemBlocks() - mem_base);
19774	    test_ret++;
19775            printf(" %d", n_f);
19776            printf(" %d", n_cur);
19777            printf("\n");
19778        }
19779    }
19780    }
19781    function_tests++;
19782#endif
19783
19784    return(test_ret);
19785}
19786
19787
19788static int
19789test_xmlDocDumpFormatMemory(void) {
19790    int test_ret = 0;
19791
19792#if defined(LIBXML_OUTPUT_ENABLED)
19793    int mem_base;
19794    xmlDocPtr cur; /* the document */
19795    int n_cur;
19796    xmlChar ** mem; /* OUT: the memory pointer */
19797    int n_mem;
19798    int * size; /* OUT: the memory length */
19799    int n_size;
19800    int format; /* should formatting spaces been added */
19801    int n_format;
19802
19803    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19804    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19805    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19806    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19807        mem_base = xmlMemBlocks();
19808        cur = gen_xmlDocPtr(n_cur, 0);
19809        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19810        size = gen_int_ptr(n_size, 2);
19811        format = gen_int(n_format, 3);
19812
19813        xmlDocDumpFormatMemory(cur, mem, size, format);
19814        call_tests++;
19815        des_xmlDocPtr(n_cur, cur, 0);
19816        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19817        des_int_ptr(n_size, size, 2);
19818        des_int(n_format, format, 3);
19819        xmlResetLastError();
19820        if (mem_base != xmlMemBlocks()) {
19821            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19822	           xmlMemBlocks() - mem_base);
19823	    test_ret++;
19824            printf(" %d", n_cur);
19825            printf(" %d", n_mem);
19826            printf(" %d", n_size);
19827            printf(" %d", n_format);
19828            printf("\n");
19829        }
19830    }
19831    }
19832    }
19833    }
19834    function_tests++;
19835#endif
19836
19837    return(test_ret);
19838}
19839
19840
19841static int
19842test_xmlDocDumpFormatMemoryEnc(void) {
19843    int test_ret = 0;
19844
19845#if defined(LIBXML_OUTPUT_ENABLED)
19846    int mem_base;
19847    xmlDocPtr out_doc; /* Document to generate XML text from */
19848    int n_out_doc;
19849    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19850    int n_doc_txt_ptr;
19851    int * doc_txt_len; /* Length of the generated XML text */
19852    int n_doc_txt_len;
19853    char * txt_encoding; /* Character encoding to use when generating XML text */
19854    int n_txt_encoding;
19855    int format; /* should formatting spaces been added */
19856    int n_format;
19857
19858    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19859    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19860    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19861    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19862    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19863        mem_base = xmlMemBlocks();
19864        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19865        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19866        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19867        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19868        format = gen_int(n_format, 4);
19869
19870        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19871        call_tests++;
19872        des_xmlDocPtr(n_out_doc, out_doc, 0);
19873        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19874        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19875        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19876        des_int(n_format, format, 4);
19877        xmlResetLastError();
19878        if (mem_base != xmlMemBlocks()) {
19879            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19880	           xmlMemBlocks() - mem_base);
19881	    test_ret++;
19882            printf(" %d", n_out_doc);
19883            printf(" %d", n_doc_txt_ptr);
19884            printf(" %d", n_doc_txt_len);
19885            printf(" %d", n_txt_encoding);
19886            printf(" %d", n_format);
19887            printf("\n");
19888        }
19889    }
19890    }
19891    }
19892    }
19893    }
19894    function_tests++;
19895#endif
19896
19897    return(test_ret);
19898}
19899
19900
19901static int
19902test_xmlDocDumpMemory(void) {
19903    int test_ret = 0;
19904
19905#if defined(LIBXML_OUTPUT_ENABLED)
19906    int mem_base;
19907    xmlDocPtr cur; /* the document */
19908    int n_cur;
19909    xmlChar ** mem; /* OUT: the memory pointer */
19910    int n_mem;
19911    int * size; /* OUT: the memory length */
19912    int n_size;
19913
19914    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19915    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19916    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19917        mem_base = xmlMemBlocks();
19918        cur = gen_xmlDocPtr(n_cur, 0);
19919        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19920        size = gen_int_ptr(n_size, 2);
19921
19922        xmlDocDumpMemory(cur, mem, size);
19923        call_tests++;
19924        des_xmlDocPtr(n_cur, cur, 0);
19925        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19926        des_int_ptr(n_size, size, 2);
19927        xmlResetLastError();
19928        if (mem_base != xmlMemBlocks()) {
19929            printf("Leak of %d blocks found in xmlDocDumpMemory",
19930	           xmlMemBlocks() - mem_base);
19931	    test_ret++;
19932            printf(" %d", n_cur);
19933            printf(" %d", n_mem);
19934            printf(" %d", n_size);
19935            printf("\n");
19936        }
19937    }
19938    }
19939    }
19940    function_tests++;
19941#endif
19942
19943    return(test_ret);
19944}
19945
19946
19947static int
19948test_xmlDocDumpMemoryEnc(void) {
19949    int test_ret = 0;
19950
19951#if defined(LIBXML_OUTPUT_ENABLED)
19952    int mem_base;
19953    xmlDocPtr out_doc; /* Document to generate XML text from */
19954    int n_out_doc;
19955    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19956    int n_doc_txt_ptr;
19957    int * doc_txt_len; /* Length of the generated XML text */
19958    int n_doc_txt_len;
19959    char * txt_encoding; /* Character encoding to use when generating XML text */
19960    int n_txt_encoding;
19961
19962    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19963    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19964    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19965    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19966        mem_base = xmlMemBlocks();
19967        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19968        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19969        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19970        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19971
19972        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19973        call_tests++;
19974        des_xmlDocPtr(n_out_doc, out_doc, 0);
19975        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19976        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19977        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19978        xmlResetLastError();
19979        if (mem_base != xmlMemBlocks()) {
19980            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19981	           xmlMemBlocks() - mem_base);
19982	    test_ret++;
19983            printf(" %d", n_out_doc);
19984            printf(" %d", n_doc_txt_ptr);
19985            printf(" %d", n_doc_txt_len);
19986            printf(" %d", n_txt_encoding);
19987            printf("\n");
19988        }
19989    }
19990    }
19991    }
19992    }
19993    function_tests++;
19994#endif
19995
19996    return(test_ret);
19997}
19998
19999
20000static int
20001test_xmlDocFormatDump(void) {
20002    int test_ret = 0;
20003
20004#if defined(LIBXML_OUTPUT_ENABLED)
20005    int mem_base;
20006    int ret_val;
20007    FILE * f; /* the FILE* */
20008    int n_f;
20009    xmlDocPtr cur; /* the document */
20010    int n_cur;
20011    int format; /* should formatting spaces been added */
20012    int n_format;
20013
20014    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20015    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20016    for (n_format = 0;n_format < gen_nb_int;n_format++) {
20017        mem_base = xmlMemBlocks();
20018        f = gen_FILE_ptr(n_f, 0);
20019        cur = gen_xmlDocPtr(n_cur, 1);
20020        format = gen_int(n_format, 2);
20021
20022        ret_val = xmlDocFormatDump(f, cur, format);
20023        desret_int(ret_val);
20024        call_tests++;
20025        des_FILE_ptr(n_f, f, 0);
20026        des_xmlDocPtr(n_cur, cur, 1);
20027        des_int(n_format, format, 2);
20028        xmlResetLastError();
20029        if (mem_base != xmlMemBlocks()) {
20030            printf("Leak of %d blocks found in xmlDocFormatDump",
20031	           xmlMemBlocks() - mem_base);
20032	    test_ret++;
20033            printf(" %d", n_f);
20034            printf(" %d", n_cur);
20035            printf(" %d", n_format);
20036            printf("\n");
20037        }
20038    }
20039    }
20040    }
20041    function_tests++;
20042#endif
20043
20044    return(test_ret);
20045}
20046
20047
20048static int
20049test_xmlDocGetRootElement(void) {
20050    int test_ret = 0;
20051
20052    int mem_base;
20053    xmlNodePtr ret_val;
20054    xmlDocPtr doc; /* the document */
20055    int n_doc;
20056
20057    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20058        mem_base = xmlMemBlocks();
20059        doc = gen_xmlDocPtr(n_doc, 0);
20060
20061        ret_val = xmlDocGetRootElement(doc);
20062        desret_xmlNodePtr(ret_val);
20063        call_tests++;
20064        des_xmlDocPtr(n_doc, doc, 0);
20065        xmlResetLastError();
20066        if (mem_base != xmlMemBlocks()) {
20067            printf("Leak of %d blocks found in xmlDocGetRootElement",
20068	           xmlMemBlocks() - mem_base);
20069	    test_ret++;
20070            printf(" %d", n_doc);
20071            printf("\n");
20072        }
20073    }
20074    function_tests++;
20075
20076    return(test_ret);
20077}
20078
20079
20080static int
20081test_xmlDocSetRootElement(void) {
20082    int test_ret = 0;
20083
20084#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20085    int mem_base;
20086    xmlNodePtr ret_val;
20087    xmlDocPtr doc; /* the document */
20088    int n_doc;
20089    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. */
20090    int n_root;
20091
20092    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20093    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20094        mem_base = xmlMemBlocks();
20095        doc = gen_xmlDocPtr(n_doc, 0);
20096        root = gen_xmlNodePtr_in(n_root, 1);
20097
20098        ret_val = xmlDocSetRootElement(doc, root);
20099        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20100        desret_xmlNodePtr(ret_val);
20101        call_tests++;
20102        des_xmlDocPtr(n_doc, doc, 0);
20103        des_xmlNodePtr_in(n_root, root, 1);
20104        xmlResetLastError();
20105        if (mem_base != xmlMemBlocks()) {
20106            printf("Leak of %d blocks found in xmlDocSetRootElement",
20107	           xmlMemBlocks() - mem_base);
20108	    test_ret++;
20109            printf(" %d", n_doc);
20110            printf(" %d", n_root);
20111            printf("\n");
20112        }
20113    }
20114    }
20115    function_tests++;
20116#endif
20117
20118    return(test_ret);
20119}
20120
20121
20122static int
20123test_xmlElemDump(void) {
20124    int test_ret = 0;
20125
20126#if defined(LIBXML_OUTPUT_ENABLED)
20127    int mem_base;
20128    FILE * f; /* the FILE * for the output */
20129    int n_f;
20130    xmlDocPtr doc; /* the document */
20131    int n_doc;
20132    xmlNodePtr cur; /* the current node */
20133    int n_cur;
20134
20135    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20136    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20137    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20138        mem_base = xmlMemBlocks();
20139        f = gen_FILE_ptr(n_f, 0);
20140        doc = gen_xmlDocPtr(n_doc, 1);
20141        cur = gen_xmlNodePtr(n_cur, 2);
20142
20143        xmlElemDump(f, doc, cur);
20144        call_tests++;
20145        des_FILE_ptr(n_f, f, 0);
20146        des_xmlDocPtr(n_doc, doc, 1);
20147        des_xmlNodePtr(n_cur, cur, 2);
20148        xmlResetLastError();
20149        if (mem_base != xmlMemBlocks()) {
20150            printf("Leak of %d blocks found in xmlElemDump",
20151	           xmlMemBlocks() - mem_base);
20152	    test_ret++;
20153            printf(" %d", n_f);
20154            printf(" %d", n_doc);
20155            printf(" %d", n_cur);
20156            printf("\n");
20157        }
20158    }
20159    }
20160    }
20161    function_tests++;
20162#endif
20163
20164    return(test_ret);
20165}
20166
20167
20168static int
20169test_xmlGetBufferAllocationScheme(void) {
20170    int test_ret = 0;
20171
20172    int mem_base;
20173    xmlBufferAllocationScheme ret_val;
20174
20175        mem_base = xmlMemBlocks();
20176
20177        ret_val = xmlGetBufferAllocationScheme();
20178        desret_xmlBufferAllocationScheme(ret_val);
20179        call_tests++;
20180        xmlResetLastError();
20181        if (mem_base != xmlMemBlocks()) {
20182            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20183	           xmlMemBlocks() - mem_base);
20184	    test_ret++;
20185            printf("\n");
20186        }
20187    function_tests++;
20188
20189    return(test_ret);
20190}
20191
20192
20193static int
20194test_xmlGetCompressMode(void) {
20195    int test_ret = 0;
20196
20197    int mem_base;
20198    int ret_val;
20199
20200        mem_base = xmlMemBlocks();
20201
20202        ret_val = xmlGetCompressMode();
20203        desret_int(ret_val);
20204        call_tests++;
20205        xmlResetLastError();
20206        if (mem_base != xmlMemBlocks()) {
20207            printf("Leak of %d blocks found in xmlGetCompressMode",
20208	           xmlMemBlocks() - mem_base);
20209	    test_ret++;
20210            printf("\n");
20211        }
20212    function_tests++;
20213
20214    return(test_ret);
20215}
20216
20217
20218static int
20219test_xmlGetDocCompressMode(void) {
20220    int test_ret = 0;
20221
20222    int mem_base;
20223    int ret_val;
20224    xmlDocPtr doc; /* the document */
20225    int n_doc;
20226
20227    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20228        mem_base = xmlMemBlocks();
20229        doc = gen_xmlDocPtr(n_doc, 0);
20230
20231        ret_val = xmlGetDocCompressMode(doc);
20232        desret_int(ret_val);
20233        call_tests++;
20234        des_xmlDocPtr(n_doc, doc, 0);
20235        xmlResetLastError();
20236        if (mem_base != xmlMemBlocks()) {
20237            printf("Leak of %d blocks found in xmlGetDocCompressMode",
20238	           xmlMemBlocks() - mem_base);
20239	    test_ret++;
20240            printf(" %d", n_doc);
20241            printf("\n");
20242        }
20243    }
20244    function_tests++;
20245
20246    return(test_ret);
20247}
20248
20249
20250static int
20251test_xmlGetIntSubset(void) {
20252    int test_ret = 0;
20253
20254    int mem_base;
20255    xmlDtdPtr ret_val;
20256    xmlDocPtr doc; /* the document pointer */
20257    int n_doc;
20258
20259    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20260        mem_base = xmlMemBlocks();
20261        doc = gen_xmlDocPtr(n_doc, 0);
20262
20263        ret_val = xmlGetIntSubset(doc);
20264        desret_xmlDtdPtr(ret_val);
20265        call_tests++;
20266        des_xmlDocPtr(n_doc, doc, 0);
20267        xmlResetLastError();
20268        if (mem_base != xmlMemBlocks()) {
20269            printf("Leak of %d blocks found in xmlGetIntSubset",
20270	           xmlMemBlocks() - mem_base);
20271	    test_ret++;
20272            printf(" %d", n_doc);
20273            printf("\n");
20274        }
20275    }
20276    function_tests++;
20277
20278    return(test_ret);
20279}
20280
20281
20282static int
20283test_xmlGetLastChild(void) {
20284    int test_ret = 0;
20285
20286    int mem_base;
20287    xmlNodePtr ret_val;
20288    xmlNodePtr parent; /* the parent node */
20289    int n_parent;
20290
20291    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20292        mem_base = xmlMemBlocks();
20293        parent = gen_xmlNodePtr(n_parent, 0);
20294
20295        ret_val = xmlGetLastChild(parent);
20296        desret_xmlNodePtr(ret_val);
20297        call_tests++;
20298        des_xmlNodePtr(n_parent, parent, 0);
20299        xmlResetLastError();
20300        if (mem_base != xmlMemBlocks()) {
20301            printf("Leak of %d blocks found in xmlGetLastChild",
20302	           xmlMemBlocks() - mem_base);
20303	    test_ret++;
20304            printf(" %d", n_parent);
20305            printf("\n");
20306        }
20307    }
20308    function_tests++;
20309
20310    return(test_ret);
20311}
20312
20313
20314static int
20315test_xmlGetLineNo(void) {
20316    int test_ret = 0;
20317
20318    int mem_base;
20319    long ret_val;
20320    xmlNodePtr node; /* valid node */
20321    int n_node;
20322
20323    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20324        mem_base = xmlMemBlocks();
20325        node = gen_xmlNodePtr(n_node, 0);
20326
20327        ret_val = xmlGetLineNo(node);
20328        desret_long(ret_val);
20329        call_tests++;
20330        des_xmlNodePtr(n_node, node, 0);
20331        xmlResetLastError();
20332        if (mem_base != xmlMemBlocks()) {
20333            printf("Leak of %d blocks found in xmlGetLineNo",
20334	           xmlMemBlocks() - mem_base);
20335	    test_ret++;
20336            printf(" %d", n_node);
20337            printf("\n");
20338        }
20339    }
20340    function_tests++;
20341
20342    return(test_ret);
20343}
20344
20345
20346static int
20347test_xmlGetNoNsProp(void) {
20348    int test_ret = 0;
20349
20350    int mem_base;
20351    xmlChar * ret_val;
20352    xmlNodePtr node; /* the node */
20353    int n_node;
20354    xmlChar * name; /* the attribute name */
20355    int n_name;
20356
20357    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20358    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20359        mem_base = xmlMemBlocks();
20360        node = gen_xmlNodePtr(n_node, 0);
20361        name = gen_const_xmlChar_ptr(n_name, 1);
20362
20363        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20364        desret_xmlChar_ptr(ret_val);
20365        call_tests++;
20366        des_xmlNodePtr(n_node, node, 0);
20367        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20368        xmlResetLastError();
20369        if (mem_base != xmlMemBlocks()) {
20370            printf("Leak of %d blocks found in xmlGetNoNsProp",
20371	           xmlMemBlocks() - mem_base);
20372	    test_ret++;
20373            printf(" %d", n_node);
20374            printf(" %d", n_name);
20375            printf("\n");
20376        }
20377    }
20378    }
20379    function_tests++;
20380
20381    return(test_ret);
20382}
20383
20384
20385static int
20386test_xmlGetNodePath(void) {
20387    int test_ret = 0;
20388
20389#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20390    int mem_base;
20391    xmlChar * ret_val;
20392    xmlNodePtr node; /* a node */
20393    int n_node;
20394
20395    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20396        mem_base = xmlMemBlocks();
20397        node = gen_xmlNodePtr(n_node, 0);
20398
20399        ret_val = xmlGetNodePath(node);
20400        desret_xmlChar_ptr(ret_val);
20401        call_tests++;
20402        des_xmlNodePtr(n_node, node, 0);
20403        xmlResetLastError();
20404        if (mem_base != xmlMemBlocks()) {
20405            printf("Leak of %d blocks found in xmlGetNodePath",
20406	           xmlMemBlocks() - mem_base);
20407	    test_ret++;
20408            printf(" %d", n_node);
20409            printf("\n");
20410        }
20411    }
20412    function_tests++;
20413#endif
20414
20415    return(test_ret);
20416}
20417
20418
20419static int
20420test_xmlGetNsList(void) {
20421    int test_ret = 0;
20422
20423
20424    /* missing type support */
20425    return(test_ret);
20426}
20427
20428
20429static int
20430test_xmlGetNsProp(void) {
20431    int test_ret = 0;
20432
20433    int mem_base;
20434    xmlChar * ret_val;
20435    xmlNodePtr node; /* the node */
20436    int n_node;
20437    xmlChar * name; /* the attribute name */
20438    int n_name;
20439    xmlChar * nameSpace; /* the URI of the namespace */
20440    int n_nameSpace;
20441
20442    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20443    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20444    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20445        mem_base = xmlMemBlocks();
20446        node = gen_xmlNodePtr(n_node, 0);
20447        name = gen_const_xmlChar_ptr(n_name, 1);
20448        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20449
20450        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20451        desret_xmlChar_ptr(ret_val);
20452        call_tests++;
20453        des_xmlNodePtr(n_node, node, 0);
20454        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20455        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20456        xmlResetLastError();
20457        if (mem_base != xmlMemBlocks()) {
20458            printf("Leak of %d blocks found in xmlGetNsProp",
20459	           xmlMemBlocks() - mem_base);
20460	    test_ret++;
20461            printf(" %d", n_node);
20462            printf(" %d", n_name);
20463            printf(" %d", n_nameSpace);
20464            printf("\n");
20465        }
20466    }
20467    }
20468    }
20469    function_tests++;
20470
20471    return(test_ret);
20472}
20473
20474
20475static int
20476test_xmlGetProp(void) {
20477    int test_ret = 0;
20478
20479    int mem_base;
20480    xmlChar * ret_val;
20481    xmlNodePtr node; /* the node */
20482    int n_node;
20483    xmlChar * name; /* the attribute name */
20484    int n_name;
20485
20486    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20487    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20488        mem_base = xmlMemBlocks();
20489        node = gen_xmlNodePtr(n_node, 0);
20490        name = gen_const_xmlChar_ptr(n_name, 1);
20491
20492        ret_val = xmlGetProp(node, (const xmlChar *)name);
20493        desret_xmlChar_ptr(ret_val);
20494        call_tests++;
20495        des_xmlNodePtr(n_node, node, 0);
20496        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20497        xmlResetLastError();
20498        if (mem_base != xmlMemBlocks()) {
20499            printf("Leak of %d blocks found in xmlGetProp",
20500	           xmlMemBlocks() - mem_base);
20501	    test_ret++;
20502            printf(" %d", n_node);
20503            printf(" %d", n_name);
20504            printf("\n");
20505        }
20506    }
20507    }
20508    function_tests++;
20509
20510    return(test_ret);
20511}
20512
20513
20514static int
20515test_xmlHasNsProp(void) {
20516    int test_ret = 0;
20517
20518    int mem_base;
20519    xmlAttrPtr ret_val;
20520    xmlNodePtr node; /* the node */
20521    int n_node;
20522    xmlChar * name; /* the attribute name */
20523    int n_name;
20524    xmlChar * nameSpace; /* the URI of the namespace */
20525    int n_nameSpace;
20526
20527    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20528    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20529    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20530        mem_base = xmlMemBlocks();
20531        node = gen_xmlNodePtr(n_node, 0);
20532        name = gen_const_xmlChar_ptr(n_name, 1);
20533        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20534
20535        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20536        desret_xmlAttrPtr(ret_val);
20537        call_tests++;
20538        des_xmlNodePtr(n_node, node, 0);
20539        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20540        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20541        xmlResetLastError();
20542        if (mem_base != xmlMemBlocks()) {
20543            printf("Leak of %d blocks found in xmlHasNsProp",
20544	           xmlMemBlocks() - mem_base);
20545	    test_ret++;
20546            printf(" %d", n_node);
20547            printf(" %d", n_name);
20548            printf(" %d", n_nameSpace);
20549            printf("\n");
20550        }
20551    }
20552    }
20553    }
20554    function_tests++;
20555
20556    return(test_ret);
20557}
20558
20559
20560static int
20561test_xmlHasProp(void) {
20562    int test_ret = 0;
20563
20564    int mem_base;
20565    xmlAttrPtr ret_val;
20566    xmlNodePtr node; /* the node */
20567    int n_node;
20568    xmlChar * name; /* the attribute name */
20569    int n_name;
20570
20571    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20572    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20573        mem_base = xmlMemBlocks();
20574        node = gen_xmlNodePtr(n_node, 0);
20575        name = gen_const_xmlChar_ptr(n_name, 1);
20576
20577        ret_val = xmlHasProp(node, (const xmlChar *)name);
20578        desret_xmlAttrPtr(ret_val);
20579        call_tests++;
20580        des_xmlNodePtr(n_node, node, 0);
20581        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20582        xmlResetLastError();
20583        if (mem_base != xmlMemBlocks()) {
20584            printf("Leak of %d blocks found in xmlHasProp",
20585	           xmlMemBlocks() - mem_base);
20586	    test_ret++;
20587            printf(" %d", n_node);
20588            printf(" %d", n_name);
20589            printf("\n");
20590        }
20591    }
20592    }
20593    function_tests++;
20594
20595    return(test_ret);
20596}
20597
20598
20599static int
20600test_xmlIsBlankNode(void) {
20601    int test_ret = 0;
20602
20603    int mem_base;
20604    int ret_val;
20605    xmlNodePtr node; /* the node */
20606    int n_node;
20607
20608    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20609        mem_base = xmlMemBlocks();
20610        node = gen_xmlNodePtr(n_node, 0);
20611
20612        ret_val = xmlIsBlankNode(node);
20613        desret_int(ret_val);
20614        call_tests++;
20615        des_xmlNodePtr(n_node, node, 0);
20616        xmlResetLastError();
20617        if (mem_base != xmlMemBlocks()) {
20618            printf("Leak of %d blocks found in xmlIsBlankNode",
20619	           xmlMemBlocks() - mem_base);
20620	    test_ret++;
20621            printf(" %d", n_node);
20622            printf("\n");
20623        }
20624    }
20625    function_tests++;
20626
20627    return(test_ret);
20628}
20629
20630
20631static int
20632test_xmlIsXHTML(void) {
20633    int test_ret = 0;
20634
20635    int mem_base;
20636    int ret_val;
20637    xmlChar * systemID; /* the system identifier */
20638    int n_systemID;
20639    xmlChar * publicID; /* the public identifier */
20640    int n_publicID;
20641
20642    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20643    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20644        mem_base = xmlMemBlocks();
20645        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20646        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20647
20648        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20649        desret_int(ret_val);
20650        call_tests++;
20651        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20652        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20653        xmlResetLastError();
20654        if (mem_base != xmlMemBlocks()) {
20655            printf("Leak of %d blocks found in xmlIsXHTML",
20656	           xmlMemBlocks() - mem_base);
20657	    test_ret++;
20658            printf(" %d", n_systemID);
20659            printf(" %d", n_publicID);
20660            printf("\n");
20661        }
20662    }
20663    }
20664    function_tests++;
20665
20666    return(test_ret);
20667}
20668
20669
20670static int
20671test_xmlNewCDataBlock(void) {
20672    int test_ret = 0;
20673
20674    int mem_base;
20675    xmlNodePtr ret_val;
20676    xmlDocPtr doc; /* the document */
20677    int n_doc;
20678    xmlChar * content; /* the CDATA block content content */
20679    int n_content;
20680    int len; /* the length of the block */
20681    int n_len;
20682
20683    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20684    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20685    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20686        mem_base = xmlMemBlocks();
20687        doc = gen_xmlDocPtr(n_doc, 0);
20688        content = gen_const_xmlChar_ptr(n_content, 1);
20689        len = gen_int(n_len, 2);
20690
20691        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20692        desret_xmlNodePtr(ret_val);
20693        call_tests++;
20694        des_xmlDocPtr(n_doc, doc, 0);
20695        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20696        des_int(n_len, len, 2);
20697        xmlResetLastError();
20698        if (mem_base != xmlMemBlocks()) {
20699            printf("Leak of %d blocks found in xmlNewCDataBlock",
20700	           xmlMemBlocks() - mem_base);
20701	    test_ret++;
20702            printf(" %d", n_doc);
20703            printf(" %d", n_content);
20704            printf(" %d", n_len);
20705            printf("\n");
20706        }
20707    }
20708    }
20709    }
20710    function_tests++;
20711
20712    return(test_ret);
20713}
20714
20715
20716static int
20717test_xmlNewCharRef(void) {
20718    int test_ret = 0;
20719
20720    int mem_base;
20721    xmlNodePtr ret_val;
20722    xmlDocPtr doc; /* the document */
20723    int n_doc;
20724    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20725    int n_name;
20726
20727    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20728    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20729        mem_base = xmlMemBlocks();
20730        doc = gen_xmlDocPtr(n_doc, 0);
20731        name = gen_const_xmlChar_ptr(n_name, 1);
20732
20733        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20734        desret_xmlNodePtr(ret_val);
20735        call_tests++;
20736        des_xmlDocPtr(n_doc, doc, 0);
20737        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20738        xmlResetLastError();
20739        if (mem_base != xmlMemBlocks()) {
20740            printf("Leak of %d blocks found in xmlNewCharRef",
20741	           xmlMemBlocks() - mem_base);
20742	    test_ret++;
20743            printf(" %d", n_doc);
20744            printf(" %d", n_name);
20745            printf("\n");
20746        }
20747    }
20748    }
20749    function_tests++;
20750
20751    return(test_ret);
20752}
20753
20754
20755static int
20756test_xmlNewChild(void) {
20757    int test_ret = 0;
20758
20759#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20760#ifdef LIBXML_TREE_ENABLED
20761    int mem_base;
20762    xmlNodePtr ret_val;
20763    xmlNodePtr parent; /* the parent node */
20764    int n_parent;
20765    xmlNsPtr ns; /* a namespace if any */
20766    int n_ns;
20767    xmlChar * name; /* the name of the child */
20768    int n_name;
20769    xmlChar * content; /* the XML content of the child if any. */
20770    int n_content;
20771
20772    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20773    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20774    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20775    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20776        mem_base = xmlMemBlocks();
20777        parent = gen_xmlNodePtr(n_parent, 0);
20778        ns = gen_xmlNsPtr(n_ns, 1);
20779        name = gen_const_xmlChar_ptr(n_name, 2);
20780        content = gen_const_xmlChar_ptr(n_content, 3);
20781
20782        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20783        desret_xmlNodePtr(ret_val);
20784        call_tests++;
20785        des_xmlNodePtr(n_parent, parent, 0);
20786        des_xmlNsPtr(n_ns, ns, 1);
20787        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20788        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20789        xmlResetLastError();
20790        if (mem_base != xmlMemBlocks()) {
20791            printf("Leak of %d blocks found in xmlNewChild",
20792	           xmlMemBlocks() - mem_base);
20793	    test_ret++;
20794            printf(" %d", n_parent);
20795            printf(" %d", n_ns);
20796            printf(" %d", n_name);
20797            printf(" %d", n_content);
20798            printf("\n");
20799        }
20800    }
20801    }
20802    }
20803    }
20804    function_tests++;
20805#endif
20806#endif
20807
20808    return(test_ret);
20809}
20810
20811
20812static int
20813test_xmlNewComment(void) {
20814    int test_ret = 0;
20815
20816    int mem_base;
20817    xmlNodePtr ret_val;
20818    xmlChar * content; /* the comment content */
20819    int n_content;
20820
20821    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20822        mem_base = xmlMemBlocks();
20823        content = gen_const_xmlChar_ptr(n_content, 0);
20824
20825        ret_val = xmlNewComment((const xmlChar *)content);
20826        desret_xmlNodePtr(ret_val);
20827        call_tests++;
20828        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20829        xmlResetLastError();
20830        if (mem_base != xmlMemBlocks()) {
20831            printf("Leak of %d blocks found in xmlNewComment",
20832	           xmlMemBlocks() - mem_base);
20833	    test_ret++;
20834            printf(" %d", n_content);
20835            printf("\n");
20836        }
20837    }
20838    function_tests++;
20839
20840    return(test_ret);
20841}
20842
20843
20844static int
20845test_xmlNewDoc(void) {
20846    int test_ret = 0;
20847
20848    int mem_base;
20849    xmlDocPtr ret_val;
20850    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20851    int n_version;
20852
20853    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20854        mem_base = xmlMemBlocks();
20855        version = gen_const_xmlChar_ptr(n_version, 0);
20856
20857        ret_val = xmlNewDoc((const xmlChar *)version);
20858        desret_xmlDocPtr(ret_val);
20859        call_tests++;
20860        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20861        xmlResetLastError();
20862        if (mem_base != xmlMemBlocks()) {
20863            printf("Leak of %d blocks found in xmlNewDoc",
20864	           xmlMemBlocks() - mem_base);
20865	    test_ret++;
20866            printf(" %d", n_version);
20867            printf("\n");
20868        }
20869    }
20870    function_tests++;
20871
20872    return(test_ret);
20873}
20874
20875
20876static int
20877test_xmlNewDocComment(void) {
20878    int test_ret = 0;
20879
20880    int mem_base;
20881    xmlNodePtr ret_val;
20882    xmlDocPtr doc; /* the document */
20883    int n_doc;
20884    xmlChar * content; /* the comment content */
20885    int n_content;
20886
20887    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20888    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20889        mem_base = xmlMemBlocks();
20890        doc = gen_xmlDocPtr(n_doc, 0);
20891        content = gen_const_xmlChar_ptr(n_content, 1);
20892
20893        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20894        desret_xmlNodePtr(ret_val);
20895        call_tests++;
20896        des_xmlDocPtr(n_doc, doc, 0);
20897        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20898        xmlResetLastError();
20899        if (mem_base != xmlMemBlocks()) {
20900            printf("Leak of %d blocks found in xmlNewDocComment",
20901	           xmlMemBlocks() - mem_base);
20902	    test_ret++;
20903            printf(" %d", n_doc);
20904            printf(" %d", n_content);
20905            printf("\n");
20906        }
20907    }
20908    }
20909    function_tests++;
20910
20911    return(test_ret);
20912}
20913
20914
20915static int
20916test_xmlNewDocFragment(void) {
20917    int test_ret = 0;
20918
20919#if defined(LIBXML_TREE_ENABLED)
20920    int mem_base;
20921    xmlNodePtr ret_val;
20922    xmlDocPtr doc; /* the document owning the fragment */
20923    int n_doc;
20924
20925    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20926        mem_base = xmlMemBlocks();
20927        doc = gen_xmlDocPtr(n_doc, 0);
20928
20929        ret_val = xmlNewDocFragment(doc);
20930        desret_xmlNodePtr(ret_val);
20931        call_tests++;
20932        des_xmlDocPtr(n_doc, doc, 0);
20933        xmlResetLastError();
20934        if (mem_base != xmlMemBlocks()) {
20935            printf("Leak of %d blocks found in xmlNewDocFragment",
20936	           xmlMemBlocks() - mem_base);
20937	    test_ret++;
20938            printf(" %d", n_doc);
20939            printf("\n");
20940        }
20941    }
20942    function_tests++;
20943#endif
20944
20945    return(test_ret);
20946}
20947
20948
20949static int
20950test_xmlNewDocNode(void) {
20951    int test_ret = 0;
20952
20953    int mem_base;
20954    xmlNodePtr ret_val;
20955    xmlDocPtr doc; /* the document */
20956    int n_doc;
20957    xmlNsPtr ns; /* namespace if any */
20958    int n_ns;
20959    xmlChar * name; /* the node name */
20960    int n_name;
20961    xmlChar * content; /* the XML text content if any */
20962    int n_content;
20963
20964    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20965    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20966    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20967    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20968        mem_base = xmlMemBlocks();
20969        doc = gen_xmlDocPtr(n_doc, 0);
20970        ns = gen_xmlNsPtr(n_ns, 1);
20971        name = gen_const_xmlChar_ptr(n_name, 2);
20972        content = gen_const_xmlChar_ptr(n_content, 3);
20973
20974        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20975        desret_xmlNodePtr(ret_val);
20976        call_tests++;
20977        des_xmlDocPtr(n_doc, doc, 0);
20978        des_xmlNsPtr(n_ns, ns, 1);
20979        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20980        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20981        xmlResetLastError();
20982        if (mem_base != xmlMemBlocks()) {
20983            printf("Leak of %d blocks found in xmlNewDocNode",
20984	           xmlMemBlocks() - mem_base);
20985	    test_ret++;
20986            printf(" %d", n_doc);
20987            printf(" %d", n_ns);
20988            printf(" %d", n_name);
20989            printf(" %d", n_content);
20990            printf("\n");
20991        }
20992    }
20993    }
20994    }
20995    }
20996    function_tests++;
20997
20998    return(test_ret);
20999}
21000
21001
21002static int
21003test_xmlNewDocNodeEatName(void) {
21004    int test_ret = 0;
21005
21006    int mem_base;
21007    xmlNodePtr ret_val;
21008    xmlDocPtr doc; /* the document */
21009    int n_doc;
21010    xmlNsPtr ns; /* namespace if any */
21011    int n_ns;
21012    xmlChar * name; /* the node name */
21013    int n_name;
21014    xmlChar * content; /* the XML text content if any */
21015    int n_content;
21016
21017    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21018    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21019    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21020    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21021        mem_base = xmlMemBlocks();
21022        doc = gen_xmlDocPtr(n_doc, 0);
21023        ns = gen_xmlNsPtr(n_ns, 1);
21024        name = gen_eaten_name(n_name, 2);
21025        content = gen_const_xmlChar_ptr(n_content, 3);
21026
21027        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21028        desret_xmlNodePtr(ret_val);
21029        call_tests++;
21030        des_xmlDocPtr(n_doc, doc, 0);
21031        des_xmlNsPtr(n_ns, ns, 1);
21032        des_eaten_name(n_name, name, 2);
21033        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21034        xmlResetLastError();
21035        if (mem_base != xmlMemBlocks()) {
21036            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21037	           xmlMemBlocks() - mem_base);
21038	    test_ret++;
21039            printf(" %d", n_doc);
21040            printf(" %d", n_ns);
21041            printf(" %d", n_name);
21042            printf(" %d", n_content);
21043            printf("\n");
21044        }
21045    }
21046    }
21047    }
21048    }
21049    function_tests++;
21050
21051    return(test_ret);
21052}
21053
21054
21055static int
21056test_xmlNewDocPI(void) {
21057    int test_ret = 0;
21058
21059    int mem_base;
21060    xmlNodePtr ret_val;
21061    xmlDocPtr doc; /* the target document */
21062    int n_doc;
21063    xmlChar * name; /* the processing instruction name */
21064    int n_name;
21065    xmlChar * content; /* the PI content */
21066    int n_content;
21067
21068    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21069    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21070    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21071        mem_base = xmlMemBlocks();
21072        doc = gen_xmlDocPtr(n_doc, 0);
21073        name = gen_const_xmlChar_ptr(n_name, 1);
21074        content = gen_const_xmlChar_ptr(n_content, 2);
21075
21076        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21077        desret_xmlNodePtr(ret_val);
21078        call_tests++;
21079        des_xmlDocPtr(n_doc, doc, 0);
21080        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21081        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21082        xmlResetLastError();
21083        if (mem_base != xmlMemBlocks()) {
21084            printf("Leak of %d blocks found in xmlNewDocPI",
21085	           xmlMemBlocks() - mem_base);
21086	    test_ret++;
21087            printf(" %d", n_doc);
21088            printf(" %d", n_name);
21089            printf(" %d", n_content);
21090            printf("\n");
21091        }
21092    }
21093    }
21094    }
21095    function_tests++;
21096
21097    return(test_ret);
21098}
21099
21100
21101static int
21102test_xmlNewDocProp(void) {
21103    int test_ret = 0;
21104
21105    int mem_base;
21106    xmlAttrPtr ret_val;
21107    xmlDocPtr doc; /* the document */
21108    int n_doc;
21109    xmlChar * name; /* the name of the attribute */
21110    int n_name;
21111    xmlChar * value; /* the value of the attribute */
21112    int n_value;
21113
21114    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21115    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21116    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21117        mem_base = xmlMemBlocks();
21118        doc = gen_xmlDocPtr(n_doc, 0);
21119        name = gen_const_xmlChar_ptr(n_name, 1);
21120        value = gen_const_xmlChar_ptr(n_value, 2);
21121
21122        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21123        desret_xmlAttrPtr(ret_val);
21124        call_tests++;
21125        des_xmlDocPtr(n_doc, doc, 0);
21126        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21127        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21128        xmlResetLastError();
21129        if (mem_base != xmlMemBlocks()) {
21130            printf("Leak of %d blocks found in xmlNewDocProp",
21131	           xmlMemBlocks() - mem_base);
21132	    test_ret++;
21133            printf(" %d", n_doc);
21134            printf(" %d", n_name);
21135            printf(" %d", n_value);
21136            printf("\n");
21137        }
21138    }
21139    }
21140    }
21141    function_tests++;
21142
21143    return(test_ret);
21144}
21145
21146
21147static int
21148test_xmlNewDocRawNode(void) {
21149    int test_ret = 0;
21150
21151#if defined(LIBXML_TREE_ENABLED)
21152#ifdef LIBXML_TREE_ENABLED
21153    int mem_base;
21154    xmlNodePtr ret_val;
21155    xmlDocPtr doc; /* the document */
21156    int n_doc;
21157    xmlNsPtr ns; /* namespace if any */
21158    int n_ns;
21159    xmlChar * name; /* the node name */
21160    int n_name;
21161    xmlChar * content; /* the text content if any */
21162    int n_content;
21163
21164    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21165    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21166    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21167    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21168        mem_base = xmlMemBlocks();
21169        doc = gen_xmlDocPtr(n_doc, 0);
21170        ns = gen_xmlNsPtr(n_ns, 1);
21171        name = gen_const_xmlChar_ptr(n_name, 2);
21172        content = gen_const_xmlChar_ptr(n_content, 3);
21173
21174        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21175        desret_xmlNodePtr(ret_val);
21176        call_tests++;
21177        des_xmlDocPtr(n_doc, doc, 0);
21178        des_xmlNsPtr(n_ns, ns, 1);
21179        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21180        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21181        xmlResetLastError();
21182        if (mem_base != xmlMemBlocks()) {
21183            printf("Leak of %d blocks found in xmlNewDocRawNode",
21184	           xmlMemBlocks() - mem_base);
21185	    test_ret++;
21186            printf(" %d", n_doc);
21187            printf(" %d", n_ns);
21188            printf(" %d", n_name);
21189            printf(" %d", n_content);
21190            printf("\n");
21191        }
21192    }
21193    }
21194    }
21195    }
21196    function_tests++;
21197#endif
21198#endif
21199
21200    return(test_ret);
21201}
21202
21203
21204static int
21205test_xmlNewDocText(void) {
21206    int test_ret = 0;
21207
21208    int mem_base;
21209    xmlNodePtr ret_val;
21210    xmlDocPtr doc; /* the document */
21211    int n_doc;
21212    xmlChar * content; /* the text content */
21213    int n_content;
21214
21215    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21216    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21217        mem_base = xmlMemBlocks();
21218        doc = gen_xmlDocPtr(n_doc, 0);
21219        content = gen_const_xmlChar_ptr(n_content, 1);
21220
21221        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21222        desret_xmlNodePtr(ret_val);
21223        call_tests++;
21224        des_xmlDocPtr(n_doc, doc, 0);
21225        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21226        xmlResetLastError();
21227        if (mem_base != xmlMemBlocks()) {
21228            printf("Leak of %d blocks found in xmlNewDocText",
21229	           xmlMemBlocks() - mem_base);
21230	    test_ret++;
21231            printf(" %d", n_doc);
21232            printf(" %d", n_content);
21233            printf("\n");
21234        }
21235    }
21236    }
21237    function_tests++;
21238
21239    return(test_ret);
21240}
21241
21242
21243static int
21244test_xmlNewDocTextLen(void) {
21245    int test_ret = 0;
21246
21247    int mem_base;
21248    xmlNodePtr ret_val;
21249    xmlDocPtr doc; /* the document */
21250    int n_doc;
21251    xmlChar * content; /* the text content */
21252    int n_content;
21253    int len; /* the text len. */
21254    int n_len;
21255
21256    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21257    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21258    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21259        mem_base = xmlMemBlocks();
21260        doc = gen_xmlDocPtr(n_doc, 0);
21261        content = gen_const_xmlChar_ptr(n_content, 1);
21262        len = gen_int(n_len, 2);
21263
21264        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21265        desret_xmlNodePtr(ret_val);
21266        call_tests++;
21267        des_xmlDocPtr(n_doc, doc, 0);
21268        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21269        des_int(n_len, len, 2);
21270        xmlResetLastError();
21271        if (mem_base != xmlMemBlocks()) {
21272            printf("Leak of %d blocks found in xmlNewDocTextLen",
21273	           xmlMemBlocks() - mem_base);
21274	    test_ret++;
21275            printf(" %d", n_doc);
21276            printf(" %d", n_content);
21277            printf(" %d", n_len);
21278            printf("\n");
21279        }
21280    }
21281    }
21282    }
21283    function_tests++;
21284
21285    return(test_ret);
21286}
21287
21288
21289static int
21290test_xmlNewDtd(void) {
21291    int test_ret = 0;
21292
21293    int mem_base;
21294    xmlDtdPtr ret_val;
21295    xmlDocPtr doc; /* the document pointer */
21296    int n_doc;
21297    xmlChar * name; /* the DTD name */
21298    int n_name;
21299    xmlChar * ExternalID; /* the external ID */
21300    int n_ExternalID;
21301    xmlChar * SystemID; /* the system ID */
21302    int n_SystemID;
21303
21304    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21305    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21306    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21307    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21308        mem_base = xmlMemBlocks();
21309        doc = gen_xmlDocPtr(n_doc, 0);
21310        name = gen_const_xmlChar_ptr(n_name, 1);
21311        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21312        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21313
21314        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21315        desret_xmlDtdPtr(ret_val);
21316        call_tests++;
21317        des_xmlDocPtr(n_doc, doc, 0);
21318        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21319        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21320        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21321        xmlResetLastError();
21322        if (mem_base != xmlMemBlocks()) {
21323            printf("Leak of %d blocks found in xmlNewDtd",
21324	           xmlMemBlocks() - mem_base);
21325	    test_ret++;
21326            printf(" %d", n_doc);
21327            printf(" %d", n_name);
21328            printf(" %d", n_ExternalID);
21329            printf(" %d", n_SystemID);
21330            printf("\n");
21331        }
21332    }
21333    }
21334    }
21335    }
21336    function_tests++;
21337
21338    return(test_ret);
21339}
21340
21341
21342static int
21343test_xmlNewNode(void) {
21344    int test_ret = 0;
21345
21346    int mem_base;
21347    xmlNodePtr ret_val;
21348    xmlNsPtr ns; /* namespace if any */
21349    int n_ns;
21350    xmlChar * name; /* the node name */
21351    int n_name;
21352
21353    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21354    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21355        mem_base = xmlMemBlocks();
21356        ns = gen_xmlNsPtr(n_ns, 0);
21357        name = gen_const_xmlChar_ptr(n_name, 1);
21358
21359        ret_val = xmlNewNode(ns, (const xmlChar *)name);
21360        desret_xmlNodePtr(ret_val);
21361        call_tests++;
21362        des_xmlNsPtr(n_ns, ns, 0);
21363        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21364        xmlResetLastError();
21365        if (mem_base != xmlMemBlocks()) {
21366            printf("Leak of %d blocks found in xmlNewNode",
21367	           xmlMemBlocks() - mem_base);
21368	    test_ret++;
21369            printf(" %d", n_ns);
21370            printf(" %d", n_name);
21371            printf("\n");
21372        }
21373    }
21374    }
21375    function_tests++;
21376
21377    return(test_ret);
21378}
21379
21380
21381static int
21382test_xmlNewNodeEatName(void) {
21383    int test_ret = 0;
21384
21385    int mem_base;
21386    xmlNodePtr ret_val;
21387    xmlNsPtr ns; /* namespace if any */
21388    int n_ns;
21389    xmlChar * name; /* the node name */
21390    int n_name;
21391
21392    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21393    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21394        mem_base = xmlMemBlocks();
21395        ns = gen_xmlNsPtr(n_ns, 0);
21396        name = gen_eaten_name(n_name, 1);
21397
21398        ret_val = xmlNewNodeEatName(ns, name);
21399        desret_xmlNodePtr(ret_val);
21400        call_tests++;
21401        des_xmlNsPtr(n_ns, ns, 0);
21402        des_eaten_name(n_name, name, 1);
21403        xmlResetLastError();
21404        if (mem_base != xmlMemBlocks()) {
21405            printf("Leak of %d blocks found in xmlNewNodeEatName",
21406	           xmlMemBlocks() - mem_base);
21407	    test_ret++;
21408            printf(" %d", n_ns);
21409            printf(" %d", n_name);
21410            printf("\n");
21411        }
21412    }
21413    }
21414    function_tests++;
21415
21416    return(test_ret);
21417}
21418
21419
21420static int
21421test_xmlNewNs(void) {
21422    int test_ret = 0;
21423
21424    int mem_base;
21425    xmlNsPtr ret_val;
21426    xmlNodePtr node; /* the element carrying the namespace */
21427    int n_node;
21428    xmlChar * href; /* the URI associated */
21429    int n_href;
21430    xmlChar * prefix; /* the prefix for the namespace */
21431    int n_prefix;
21432
21433    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21434    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21435    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21436        mem_base = xmlMemBlocks();
21437        node = gen_xmlNodePtr(n_node, 0);
21438        href = gen_const_xmlChar_ptr(n_href, 1);
21439        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21440
21441        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21442        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21443        desret_xmlNsPtr(ret_val);
21444        call_tests++;
21445        des_xmlNodePtr(n_node, node, 0);
21446        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21447        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21448        xmlResetLastError();
21449        if (mem_base != xmlMemBlocks()) {
21450            printf("Leak of %d blocks found in xmlNewNs",
21451	           xmlMemBlocks() - mem_base);
21452	    test_ret++;
21453            printf(" %d", n_node);
21454            printf(" %d", n_href);
21455            printf(" %d", n_prefix);
21456            printf("\n");
21457        }
21458    }
21459    }
21460    }
21461    function_tests++;
21462
21463    return(test_ret);
21464}
21465
21466
21467static int
21468test_xmlNewNsProp(void) {
21469    int test_ret = 0;
21470
21471    int mem_base;
21472    xmlAttrPtr ret_val;
21473    xmlNodePtr node; /* the holding node */
21474    int n_node;
21475    xmlNsPtr ns; /* the namespace */
21476    int n_ns;
21477    xmlChar * name; /* the name of the attribute */
21478    int n_name;
21479    xmlChar * value; /* the value of the attribute */
21480    int n_value;
21481
21482    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21483    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21484    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21485    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21486        mem_base = xmlMemBlocks();
21487        node = gen_xmlNodePtr(n_node, 0);
21488        ns = gen_xmlNsPtr(n_ns, 1);
21489        name = gen_const_xmlChar_ptr(n_name, 2);
21490        value = gen_const_xmlChar_ptr(n_value, 3);
21491
21492        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21493        desret_xmlAttrPtr(ret_val);
21494        call_tests++;
21495        des_xmlNodePtr(n_node, node, 0);
21496        des_xmlNsPtr(n_ns, ns, 1);
21497        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21498        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21499        xmlResetLastError();
21500        if (mem_base != xmlMemBlocks()) {
21501            printf("Leak of %d blocks found in xmlNewNsProp",
21502	           xmlMemBlocks() - mem_base);
21503	    test_ret++;
21504            printf(" %d", n_node);
21505            printf(" %d", n_ns);
21506            printf(" %d", n_name);
21507            printf(" %d", n_value);
21508            printf("\n");
21509        }
21510    }
21511    }
21512    }
21513    }
21514    function_tests++;
21515
21516    return(test_ret);
21517}
21518
21519
21520static int
21521test_xmlNewNsPropEatName(void) {
21522    int test_ret = 0;
21523
21524    int mem_base;
21525    xmlAttrPtr ret_val;
21526    xmlNodePtr node; /* the holding node */
21527    int n_node;
21528    xmlNsPtr ns; /* the namespace */
21529    int n_ns;
21530    xmlChar * name; /* the name of the attribute */
21531    int n_name;
21532    xmlChar * value; /* the value of the attribute */
21533    int n_value;
21534
21535    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21536    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21537    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21538    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21539        mem_base = xmlMemBlocks();
21540        node = gen_xmlNodePtr(n_node, 0);
21541        ns = gen_xmlNsPtr(n_ns, 1);
21542        name = gen_eaten_name(n_name, 2);
21543        value = gen_const_xmlChar_ptr(n_value, 3);
21544
21545        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21546        desret_xmlAttrPtr(ret_val);
21547        call_tests++;
21548        des_xmlNodePtr(n_node, node, 0);
21549        des_xmlNsPtr(n_ns, ns, 1);
21550        des_eaten_name(n_name, name, 2);
21551        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21552        xmlResetLastError();
21553        if (mem_base != xmlMemBlocks()) {
21554            printf("Leak of %d blocks found in xmlNewNsPropEatName",
21555	           xmlMemBlocks() - mem_base);
21556	    test_ret++;
21557            printf(" %d", n_node);
21558            printf(" %d", n_ns);
21559            printf(" %d", n_name);
21560            printf(" %d", n_value);
21561            printf("\n");
21562        }
21563    }
21564    }
21565    }
21566    }
21567    function_tests++;
21568
21569    return(test_ret);
21570}
21571
21572
21573static int
21574test_xmlNewPI(void) {
21575    int test_ret = 0;
21576
21577    int mem_base;
21578    xmlNodePtr ret_val;
21579    xmlChar * name; /* the processing instruction name */
21580    int n_name;
21581    xmlChar * content; /* the PI content */
21582    int n_content;
21583
21584    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21585    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21586        mem_base = xmlMemBlocks();
21587        name = gen_const_xmlChar_ptr(n_name, 0);
21588        content = gen_const_xmlChar_ptr(n_content, 1);
21589
21590        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21591        desret_xmlNodePtr(ret_val);
21592        call_tests++;
21593        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21594        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21595        xmlResetLastError();
21596        if (mem_base != xmlMemBlocks()) {
21597            printf("Leak of %d blocks found in xmlNewPI",
21598	           xmlMemBlocks() - mem_base);
21599	    test_ret++;
21600            printf(" %d", n_name);
21601            printf(" %d", n_content);
21602            printf("\n");
21603        }
21604    }
21605    }
21606    function_tests++;
21607
21608    return(test_ret);
21609}
21610
21611
21612static int
21613test_xmlNewProp(void) {
21614    int test_ret = 0;
21615
21616#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21617#ifdef LIBXML_TREE_ENABLED
21618    int mem_base;
21619    xmlAttrPtr ret_val;
21620    xmlNodePtr node; /* the holding node */
21621    int n_node;
21622    xmlChar * name; /* the name of the attribute */
21623    int n_name;
21624    xmlChar * value; /* the value of the attribute */
21625    int n_value;
21626
21627    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21628    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21629    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21630        mem_base = xmlMemBlocks();
21631        node = gen_xmlNodePtr(n_node, 0);
21632        name = gen_const_xmlChar_ptr(n_name, 1);
21633        value = gen_const_xmlChar_ptr(n_value, 2);
21634
21635        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21636        desret_xmlAttrPtr(ret_val);
21637        call_tests++;
21638        des_xmlNodePtr(n_node, node, 0);
21639        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21640        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21641        xmlResetLastError();
21642        if (mem_base != xmlMemBlocks()) {
21643            printf("Leak of %d blocks found in xmlNewProp",
21644	           xmlMemBlocks() - mem_base);
21645	    test_ret++;
21646            printf(" %d", n_node);
21647            printf(" %d", n_name);
21648            printf(" %d", n_value);
21649            printf("\n");
21650        }
21651    }
21652    }
21653    }
21654    function_tests++;
21655#endif
21656#endif
21657
21658    return(test_ret);
21659}
21660
21661
21662static int
21663test_xmlNewReference(void) {
21664    int test_ret = 0;
21665
21666    int mem_base;
21667    xmlNodePtr ret_val;
21668    xmlDocPtr doc; /* the document */
21669    int n_doc;
21670    xmlChar * name; /* the reference name, or the reference string with & and ; */
21671    int n_name;
21672
21673    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21674    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21675        mem_base = xmlMemBlocks();
21676        doc = gen_xmlDocPtr(n_doc, 0);
21677        name = gen_const_xmlChar_ptr(n_name, 1);
21678
21679        ret_val = xmlNewReference(doc, (const xmlChar *)name);
21680        desret_xmlNodePtr(ret_val);
21681        call_tests++;
21682        des_xmlDocPtr(n_doc, doc, 0);
21683        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21684        xmlResetLastError();
21685        if (mem_base != xmlMemBlocks()) {
21686            printf("Leak of %d blocks found in xmlNewReference",
21687	           xmlMemBlocks() - mem_base);
21688	    test_ret++;
21689            printf(" %d", n_doc);
21690            printf(" %d", n_name);
21691            printf("\n");
21692        }
21693    }
21694    }
21695    function_tests++;
21696
21697    return(test_ret);
21698}
21699
21700
21701static int
21702test_xmlNewText(void) {
21703    int test_ret = 0;
21704
21705    int mem_base;
21706    xmlNodePtr ret_val;
21707    xmlChar * content; /* the text content */
21708    int n_content;
21709
21710    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21711        mem_base = xmlMemBlocks();
21712        content = gen_const_xmlChar_ptr(n_content, 0);
21713
21714        ret_val = xmlNewText((const xmlChar *)content);
21715        desret_xmlNodePtr(ret_val);
21716        call_tests++;
21717        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21718        xmlResetLastError();
21719        if (mem_base != xmlMemBlocks()) {
21720            printf("Leak of %d blocks found in xmlNewText",
21721	           xmlMemBlocks() - mem_base);
21722	    test_ret++;
21723            printf(" %d", n_content);
21724            printf("\n");
21725        }
21726    }
21727    function_tests++;
21728
21729    return(test_ret);
21730}
21731
21732
21733static int
21734test_xmlNewTextChild(void) {
21735    int test_ret = 0;
21736
21737#if defined(LIBXML_TREE_ENABLED)
21738#ifdef LIBXML_TREE_ENABLED
21739    int mem_base;
21740    xmlNodePtr ret_val;
21741    xmlNodePtr parent; /* the parent node */
21742    int n_parent;
21743    xmlNsPtr ns; /* a namespace if any */
21744    int n_ns;
21745    xmlChar * name; /* the name of the child */
21746    int n_name;
21747    xmlChar * content; /* the text content of the child if any. */
21748    int n_content;
21749
21750    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21751    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21752    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21753    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21754        mem_base = xmlMemBlocks();
21755        parent = gen_xmlNodePtr(n_parent, 0);
21756        ns = gen_xmlNsPtr(n_ns, 1);
21757        name = gen_const_xmlChar_ptr(n_name, 2);
21758        content = gen_const_xmlChar_ptr(n_content, 3);
21759
21760        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21761        desret_xmlNodePtr(ret_val);
21762        call_tests++;
21763        des_xmlNodePtr(n_parent, parent, 0);
21764        des_xmlNsPtr(n_ns, ns, 1);
21765        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21766        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21767        xmlResetLastError();
21768        if (mem_base != xmlMemBlocks()) {
21769            printf("Leak of %d blocks found in xmlNewTextChild",
21770	           xmlMemBlocks() - mem_base);
21771	    test_ret++;
21772            printf(" %d", n_parent);
21773            printf(" %d", n_ns);
21774            printf(" %d", n_name);
21775            printf(" %d", n_content);
21776            printf("\n");
21777        }
21778    }
21779    }
21780    }
21781    }
21782    function_tests++;
21783#endif
21784#endif
21785
21786    return(test_ret);
21787}
21788
21789
21790static int
21791test_xmlNewTextLen(void) {
21792    int test_ret = 0;
21793
21794    int mem_base;
21795    xmlNodePtr ret_val;
21796    xmlChar * content; /* the text content */
21797    int n_content;
21798    int len; /* the text len. */
21799    int n_len;
21800
21801    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21802    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21803        mem_base = xmlMemBlocks();
21804        content = gen_const_xmlChar_ptr(n_content, 0);
21805        len = gen_int(n_len, 1);
21806
21807        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21808        desret_xmlNodePtr(ret_val);
21809        call_tests++;
21810        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21811        des_int(n_len, len, 1);
21812        xmlResetLastError();
21813        if (mem_base != xmlMemBlocks()) {
21814            printf("Leak of %d blocks found in xmlNewTextLen",
21815	           xmlMemBlocks() - mem_base);
21816	    test_ret++;
21817            printf(" %d", n_content);
21818            printf(" %d", n_len);
21819            printf("\n");
21820        }
21821    }
21822    }
21823    function_tests++;
21824
21825    return(test_ret);
21826}
21827
21828
21829static int
21830test_xmlNodeAddContent(void) {
21831    int test_ret = 0;
21832
21833    int mem_base;
21834    xmlNodePtr cur; /* the node being modified */
21835    int n_cur;
21836    xmlChar * content; /* extra content */
21837    int n_content;
21838
21839    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21840    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21841        mem_base = xmlMemBlocks();
21842        cur = gen_xmlNodePtr(n_cur, 0);
21843        content = gen_const_xmlChar_ptr(n_content, 1);
21844
21845        xmlNodeAddContent(cur, (const xmlChar *)content);
21846        call_tests++;
21847        des_xmlNodePtr(n_cur, cur, 0);
21848        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21849        xmlResetLastError();
21850        if (mem_base != xmlMemBlocks()) {
21851            printf("Leak of %d blocks found in xmlNodeAddContent",
21852	           xmlMemBlocks() - mem_base);
21853	    test_ret++;
21854            printf(" %d", n_cur);
21855            printf(" %d", n_content);
21856            printf("\n");
21857        }
21858    }
21859    }
21860    function_tests++;
21861
21862    return(test_ret);
21863}
21864
21865
21866static int
21867test_xmlNodeAddContentLen(void) {
21868    int test_ret = 0;
21869
21870    int mem_base;
21871    xmlNodePtr cur; /* the node being modified */
21872    int n_cur;
21873    xmlChar * content; /* extra content */
21874    int n_content;
21875    int len; /* the size of @content */
21876    int n_len;
21877
21878    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21879    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21880    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21881        mem_base = xmlMemBlocks();
21882        cur = gen_xmlNodePtr(n_cur, 0);
21883        content = gen_const_xmlChar_ptr(n_content, 1);
21884        len = gen_int(n_len, 2);
21885
21886        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21887        call_tests++;
21888        des_xmlNodePtr(n_cur, cur, 0);
21889        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21890        des_int(n_len, len, 2);
21891        xmlResetLastError();
21892        if (mem_base != xmlMemBlocks()) {
21893            printf("Leak of %d blocks found in xmlNodeAddContentLen",
21894	           xmlMemBlocks() - mem_base);
21895	    test_ret++;
21896            printf(" %d", n_cur);
21897            printf(" %d", n_content);
21898            printf(" %d", n_len);
21899            printf("\n");
21900        }
21901    }
21902    }
21903    }
21904    function_tests++;
21905
21906    return(test_ret);
21907}
21908
21909
21910static int
21911test_xmlNodeBufGetContent(void) {
21912    int test_ret = 0;
21913
21914    int mem_base;
21915    int ret_val;
21916    xmlBufferPtr buffer; /* a buffer */
21917    int n_buffer;
21918    xmlNodePtr cur; /* the node being read */
21919    int n_cur;
21920
21921    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21922    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21923        mem_base = xmlMemBlocks();
21924        buffer = gen_xmlBufferPtr(n_buffer, 0);
21925        cur = gen_xmlNodePtr(n_cur, 1);
21926
21927        ret_val = xmlNodeBufGetContent(buffer, cur);
21928        desret_int(ret_val);
21929        call_tests++;
21930        des_xmlBufferPtr(n_buffer, buffer, 0);
21931        des_xmlNodePtr(n_cur, cur, 1);
21932        xmlResetLastError();
21933        if (mem_base != xmlMemBlocks()) {
21934            printf("Leak of %d blocks found in xmlNodeBufGetContent",
21935	           xmlMemBlocks() - mem_base);
21936	    test_ret++;
21937            printf(" %d", n_buffer);
21938            printf(" %d", n_cur);
21939            printf("\n");
21940        }
21941    }
21942    }
21943    function_tests++;
21944
21945    return(test_ret);
21946}
21947
21948
21949static int
21950test_xmlNodeDump(void) {
21951    int test_ret = 0;
21952
21953#if defined(LIBXML_OUTPUT_ENABLED)
21954    int mem_base;
21955    int ret_val;
21956    xmlBufferPtr buf; /* the XML buffer output */
21957    int n_buf;
21958    xmlDocPtr doc; /* the document */
21959    int n_doc;
21960    xmlNodePtr cur; /* the current node */
21961    int n_cur;
21962    int level; /* the imbrication level for indenting */
21963    int n_level;
21964    int format; /* is formatting allowed */
21965    int n_format;
21966
21967    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21968    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21969    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21970    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21971    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21972        mem_base = xmlMemBlocks();
21973        buf = gen_xmlBufferPtr(n_buf, 0);
21974        doc = gen_xmlDocPtr(n_doc, 1);
21975        cur = gen_xmlNodePtr(n_cur, 2);
21976        level = gen_int(n_level, 3);
21977        format = gen_int(n_format, 4);
21978
21979        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21980        desret_int(ret_val);
21981        call_tests++;
21982        des_xmlBufferPtr(n_buf, buf, 0);
21983        des_xmlDocPtr(n_doc, doc, 1);
21984        des_xmlNodePtr(n_cur, cur, 2);
21985        des_int(n_level, level, 3);
21986        des_int(n_format, format, 4);
21987        xmlResetLastError();
21988        if (mem_base != xmlMemBlocks()) {
21989            printf("Leak of %d blocks found in xmlNodeDump",
21990	           xmlMemBlocks() - mem_base);
21991	    test_ret++;
21992            printf(" %d", n_buf);
21993            printf(" %d", n_doc);
21994            printf(" %d", n_cur);
21995            printf(" %d", n_level);
21996            printf(" %d", n_format);
21997            printf("\n");
21998        }
21999    }
22000    }
22001    }
22002    }
22003    }
22004    function_tests++;
22005#endif
22006
22007    return(test_ret);
22008}
22009
22010
22011static int
22012test_xmlNodeDumpOutput(void) {
22013    int test_ret = 0;
22014
22015#if defined(LIBXML_OUTPUT_ENABLED)
22016    int mem_base;
22017    xmlOutputBufferPtr buf; /* the XML buffer output */
22018    int n_buf;
22019    xmlDocPtr doc; /* the document */
22020    int n_doc;
22021    xmlNodePtr cur; /* the current node */
22022    int n_cur;
22023    int level; /* the imbrication level for indenting */
22024    int n_level;
22025    int format; /* is formatting allowed */
22026    int n_format;
22027    char * encoding; /* an optional encoding string */
22028    int n_encoding;
22029
22030    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22031    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22032    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22033    for (n_level = 0;n_level < gen_nb_int;n_level++) {
22034    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22035    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22036        mem_base = xmlMemBlocks();
22037        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22038        doc = gen_xmlDocPtr(n_doc, 1);
22039        cur = gen_xmlNodePtr(n_cur, 2);
22040        level = gen_int(n_level, 3);
22041        format = gen_int(n_format, 4);
22042        encoding = gen_const_char_ptr(n_encoding, 5);
22043
22044        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22045        call_tests++;
22046        des_xmlOutputBufferPtr(n_buf, buf, 0);
22047        des_xmlDocPtr(n_doc, doc, 1);
22048        des_xmlNodePtr(n_cur, cur, 2);
22049        des_int(n_level, level, 3);
22050        des_int(n_format, format, 4);
22051        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22052        xmlResetLastError();
22053        if (mem_base != xmlMemBlocks()) {
22054            printf("Leak of %d blocks found in xmlNodeDumpOutput",
22055	           xmlMemBlocks() - mem_base);
22056	    test_ret++;
22057            printf(" %d", n_buf);
22058            printf(" %d", n_doc);
22059            printf(" %d", n_cur);
22060            printf(" %d", n_level);
22061            printf(" %d", n_format);
22062            printf(" %d", n_encoding);
22063            printf("\n");
22064        }
22065    }
22066    }
22067    }
22068    }
22069    }
22070    }
22071    function_tests++;
22072#endif
22073
22074    return(test_ret);
22075}
22076
22077
22078static int
22079test_xmlNodeGetBase(void) {
22080    int test_ret = 0;
22081
22082    int mem_base;
22083    xmlChar * ret_val;
22084    xmlDocPtr doc; /* the document the node pertains to */
22085    int n_doc;
22086    xmlNodePtr cur; /* the node being checked */
22087    int n_cur;
22088
22089    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22090    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22091        mem_base = xmlMemBlocks();
22092        doc = gen_xmlDocPtr(n_doc, 0);
22093        cur = gen_xmlNodePtr(n_cur, 1);
22094
22095        ret_val = xmlNodeGetBase(doc, cur);
22096        desret_xmlChar_ptr(ret_val);
22097        call_tests++;
22098        des_xmlDocPtr(n_doc, doc, 0);
22099        des_xmlNodePtr(n_cur, cur, 1);
22100        xmlResetLastError();
22101        if (mem_base != xmlMemBlocks()) {
22102            printf("Leak of %d blocks found in xmlNodeGetBase",
22103	           xmlMemBlocks() - mem_base);
22104	    test_ret++;
22105            printf(" %d", n_doc);
22106            printf(" %d", n_cur);
22107            printf("\n");
22108        }
22109    }
22110    }
22111    function_tests++;
22112
22113    return(test_ret);
22114}
22115
22116
22117static int
22118test_xmlNodeGetContent(void) {
22119    int test_ret = 0;
22120
22121    int mem_base;
22122    xmlChar * ret_val;
22123    xmlNodePtr cur; /* the node being read */
22124    int n_cur;
22125
22126    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22127        mem_base = xmlMemBlocks();
22128        cur = gen_xmlNodePtr(n_cur, 0);
22129
22130        ret_val = xmlNodeGetContent(cur);
22131        desret_xmlChar_ptr(ret_val);
22132        call_tests++;
22133        des_xmlNodePtr(n_cur, cur, 0);
22134        xmlResetLastError();
22135        if (mem_base != xmlMemBlocks()) {
22136            printf("Leak of %d blocks found in xmlNodeGetContent",
22137	           xmlMemBlocks() - mem_base);
22138	    test_ret++;
22139            printf(" %d", n_cur);
22140            printf("\n");
22141        }
22142    }
22143    function_tests++;
22144
22145    return(test_ret);
22146}
22147
22148
22149static int
22150test_xmlNodeGetLang(void) {
22151    int test_ret = 0;
22152
22153    int mem_base;
22154    xmlChar * ret_val;
22155    xmlNodePtr cur; /* the node being checked */
22156    int n_cur;
22157
22158    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22159        mem_base = xmlMemBlocks();
22160        cur = gen_xmlNodePtr(n_cur, 0);
22161
22162        ret_val = xmlNodeGetLang(cur);
22163        desret_xmlChar_ptr(ret_val);
22164        call_tests++;
22165        des_xmlNodePtr(n_cur, cur, 0);
22166        xmlResetLastError();
22167        if (mem_base != xmlMemBlocks()) {
22168            printf("Leak of %d blocks found in xmlNodeGetLang",
22169	           xmlMemBlocks() - mem_base);
22170	    test_ret++;
22171            printf(" %d", n_cur);
22172            printf("\n");
22173        }
22174    }
22175    function_tests++;
22176
22177    return(test_ret);
22178}
22179
22180
22181static int
22182test_xmlNodeGetSpacePreserve(void) {
22183    int test_ret = 0;
22184
22185    int mem_base;
22186    int ret_val;
22187    xmlNodePtr cur; /* the node being checked */
22188    int n_cur;
22189
22190    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22191        mem_base = xmlMemBlocks();
22192        cur = gen_xmlNodePtr(n_cur, 0);
22193
22194        ret_val = xmlNodeGetSpacePreserve(cur);
22195        desret_int(ret_val);
22196        call_tests++;
22197        des_xmlNodePtr(n_cur, cur, 0);
22198        xmlResetLastError();
22199        if (mem_base != xmlMemBlocks()) {
22200            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22201	           xmlMemBlocks() - mem_base);
22202	    test_ret++;
22203            printf(" %d", n_cur);
22204            printf("\n");
22205        }
22206    }
22207    function_tests++;
22208
22209    return(test_ret);
22210}
22211
22212
22213static int
22214test_xmlNodeIsText(void) {
22215    int test_ret = 0;
22216
22217    int mem_base;
22218    int ret_val;
22219    xmlNodePtr node; /* the node */
22220    int n_node;
22221
22222    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22223        mem_base = xmlMemBlocks();
22224        node = gen_xmlNodePtr(n_node, 0);
22225
22226        ret_val = xmlNodeIsText(node);
22227        desret_int(ret_val);
22228        call_tests++;
22229        des_xmlNodePtr(n_node, node, 0);
22230        xmlResetLastError();
22231        if (mem_base != xmlMemBlocks()) {
22232            printf("Leak of %d blocks found in xmlNodeIsText",
22233	           xmlMemBlocks() - mem_base);
22234	    test_ret++;
22235            printf(" %d", n_node);
22236            printf("\n");
22237        }
22238    }
22239    function_tests++;
22240
22241    return(test_ret);
22242}
22243
22244
22245static int
22246test_xmlNodeListGetRawString(void) {
22247    int test_ret = 0;
22248
22249#if defined(LIBXML_TREE_ENABLED)
22250    int mem_base;
22251    xmlChar * ret_val;
22252    xmlDocPtr doc; /* the document */
22253    int n_doc;
22254    xmlNodePtr list; /* a Node list */
22255    int n_list;
22256    int inLine; /* should we replace entity contents or show their external form */
22257    int n_inLine;
22258
22259    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22260    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22261    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22262        mem_base = xmlMemBlocks();
22263        doc = gen_xmlDocPtr(n_doc, 0);
22264        list = gen_xmlNodePtr(n_list, 1);
22265        inLine = gen_int(n_inLine, 2);
22266
22267        ret_val = xmlNodeListGetRawString(doc, list, inLine);
22268        desret_xmlChar_ptr(ret_val);
22269        call_tests++;
22270        des_xmlDocPtr(n_doc, doc, 0);
22271        des_xmlNodePtr(n_list, list, 1);
22272        des_int(n_inLine, inLine, 2);
22273        xmlResetLastError();
22274        if (mem_base != xmlMemBlocks()) {
22275            printf("Leak of %d blocks found in xmlNodeListGetRawString",
22276	           xmlMemBlocks() - mem_base);
22277	    test_ret++;
22278            printf(" %d", n_doc);
22279            printf(" %d", n_list);
22280            printf(" %d", n_inLine);
22281            printf("\n");
22282        }
22283    }
22284    }
22285    }
22286    function_tests++;
22287#endif
22288
22289    return(test_ret);
22290}
22291
22292
22293static int
22294test_xmlNodeListGetString(void) {
22295    int test_ret = 0;
22296
22297    int mem_base;
22298    xmlChar * ret_val;
22299    xmlDocPtr doc; /* the document */
22300    int n_doc;
22301    xmlNodePtr list; /* a Node list */
22302    int n_list;
22303    int inLine; /* should we replace entity contents or show their external form */
22304    int n_inLine;
22305
22306    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22307    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22308    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22309        mem_base = xmlMemBlocks();
22310        doc = gen_xmlDocPtr(n_doc, 0);
22311        list = gen_xmlNodePtr(n_list, 1);
22312        inLine = gen_int(n_inLine, 2);
22313
22314        ret_val = xmlNodeListGetString(doc, list, inLine);
22315        desret_xmlChar_ptr(ret_val);
22316        call_tests++;
22317        des_xmlDocPtr(n_doc, doc, 0);
22318        des_xmlNodePtr(n_list, list, 1);
22319        des_int(n_inLine, inLine, 2);
22320        xmlResetLastError();
22321        if (mem_base != xmlMemBlocks()) {
22322            printf("Leak of %d blocks found in xmlNodeListGetString",
22323	           xmlMemBlocks() - mem_base);
22324	    test_ret++;
22325            printf(" %d", n_doc);
22326            printf(" %d", n_list);
22327            printf(" %d", n_inLine);
22328            printf("\n");
22329        }
22330    }
22331    }
22332    }
22333    function_tests++;
22334
22335    return(test_ret);
22336}
22337
22338
22339static int
22340test_xmlNodeSetBase(void) {
22341    int test_ret = 0;
22342
22343#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22344    int mem_base;
22345    xmlNodePtr cur; /* the node being changed */
22346    int n_cur;
22347    xmlChar * uri; /* the new base URI */
22348    int n_uri;
22349
22350    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22351    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22352        mem_base = xmlMemBlocks();
22353        cur = gen_xmlNodePtr(n_cur, 0);
22354        uri = gen_const_xmlChar_ptr(n_uri, 1);
22355
22356        xmlNodeSetBase(cur, (const xmlChar *)uri);
22357        call_tests++;
22358        des_xmlNodePtr(n_cur, cur, 0);
22359        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22360        xmlResetLastError();
22361        if (mem_base != xmlMemBlocks()) {
22362            printf("Leak of %d blocks found in xmlNodeSetBase",
22363	           xmlMemBlocks() - mem_base);
22364	    test_ret++;
22365            printf(" %d", n_cur);
22366            printf(" %d", n_uri);
22367            printf("\n");
22368        }
22369    }
22370    }
22371    function_tests++;
22372#endif
22373
22374    return(test_ret);
22375}
22376
22377
22378static int
22379test_xmlNodeSetContent(void) {
22380    int test_ret = 0;
22381
22382    int mem_base;
22383    xmlNodePtr cur; /* the node being modified */
22384    int n_cur;
22385    xmlChar * content; /* the new value of the content */
22386    int n_content;
22387
22388    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22389    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22390        mem_base = xmlMemBlocks();
22391        cur = gen_xmlNodePtr(n_cur, 0);
22392        content = gen_const_xmlChar_ptr(n_content, 1);
22393
22394        xmlNodeSetContent(cur, (const xmlChar *)content);
22395        call_tests++;
22396        des_xmlNodePtr(n_cur, cur, 0);
22397        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22398        xmlResetLastError();
22399        if (mem_base != xmlMemBlocks()) {
22400            printf("Leak of %d blocks found in xmlNodeSetContent",
22401	           xmlMemBlocks() - mem_base);
22402	    test_ret++;
22403            printf(" %d", n_cur);
22404            printf(" %d", n_content);
22405            printf("\n");
22406        }
22407    }
22408    }
22409    function_tests++;
22410
22411    return(test_ret);
22412}
22413
22414
22415static int
22416test_xmlNodeSetContentLen(void) {
22417    int test_ret = 0;
22418
22419#if defined(LIBXML_TREE_ENABLED)
22420    int mem_base;
22421    xmlNodePtr cur; /* the node being modified */
22422    int n_cur;
22423    xmlChar * content; /* the new value of the content */
22424    int n_content;
22425    int len; /* the size of @content */
22426    int n_len;
22427
22428    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22429    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22430    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22431        mem_base = xmlMemBlocks();
22432        cur = gen_xmlNodePtr(n_cur, 0);
22433        content = gen_const_xmlChar_ptr(n_content, 1);
22434        len = gen_int(n_len, 2);
22435
22436        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22437        call_tests++;
22438        des_xmlNodePtr(n_cur, cur, 0);
22439        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22440        des_int(n_len, len, 2);
22441        xmlResetLastError();
22442        if (mem_base != xmlMemBlocks()) {
22443            printf("Leak of %d blocks found in xmlNodeSetContentLen",
22444	           xmlMemBlocks() - mem_base);
22445	    test_ret++;
22446            printf(" %d", n_cur);
22447            printf(" %d", n_content);
22448            printf(" %d", n_len);
22449            printf("\n");
22450        }
22451    }
22452    }
22453    }
22454    function_tests++;
22455#endif
22456
22457    return(test_ret);
22458}
22459
22460
22461static int
22462test_xmlNodeSetLang(void) {
22463    int test_ret = 0;
22464
22465#if defined(LIBXML_TREE_ENABLED)
22466    int mem_base;
22467    xmlNodePtr cur; /* the node being changed */
22468    int n_cur;
22469    xmlChar * lang; /* the language description */
22470    int n_lang;
22471
22472    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22473    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22474        mem_base = xmlMemBlocks();
22475        cur = gen_xmlNodePtr(n_cur, 0);
22476        lang = gen_const_xmlChar_ptr(n_lang, 1);
22477
22478        xmlNodeSetLang(cur, (const xmlChar *)lang);
22479        call_tests++;
22480        des_xmlNodePtr(n_cur, cur, 0);
22481        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22482        xmlResetLastError();
22483        if (mem_base != xmlMemBlocks()) {
22484            printf("Leak of %d blocks found in xmlNodeSetLang",
22485	           xmlMemBlocks() - mem_base);
22486	    test_ret++;
22487            printf(" %d", n_cur);
22488            printf(" %d", n_lang);
22489            printf("\n");
22490        }
22491    }
22492    }
22493    function_tests++;
22494#endif
22495
22496    return(test_ret);
22497}
22498
22499
22500static int
22501test_xmlNodeSetName(void) {
22502    int test_ret = 0;
22503
22504#if defined(LIBXML_TREE_ENABLED)
22505    int mem_base;
22506    xmlNodePtr cur; /* the node being changed */
22507    int n_cur;
22508    xmlChar * name; /* the new tag name */
22509    int n_name;
22510
22511    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22512    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22513        mem_base = xmlMemBlocks();
22514        cur = gen_xmlNodePtr(n_cur, 0);
22515        name = gen_const_xmlChar_ptr(n_name, 1);
22516
22517        xmlNodeSetName(cur, (const xmlChar *)name);
22518        call_tests++;
22519        des_xmlNodePtr(n_cur, cur, 0);
22520        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22521        xmlResetLastError();
22522        if (mem_base != xmlMemBlocks()) {
22523            printf("Leak of %d blocks found in xmlNodeSetName",
22524	           xmlMemBlocks() - mem_base);
22525	    test_ret++;
22526            printf(" %d", n_cur);
22527            printf(" %d", n_name);
22528            printf("\n");
22529        }
22530    }
22531    }
22532    function_tests++;
22533#endif
22534
22535    return(test_ret);
22536}
22537
22538
22539static int
22540test_xmlNodeSetSpacePreserve(void) {
22541    int test_ret = 0;
22542
22543#if defined(LIBXML_TREE_ENABLED)
22544    int mem_base;
22545    xmlNodePtr cur; /* the node being changed */
22546    int n_cur;
22547    int val; /* the xml:space value ("0": default, 1: "preserve") */
22548    int n_val;
22549
22550    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22551    for (n_val = 0;n_val < gen_nb_int;n_val++) {
22552        mem_base = xmlMemBlocks();
22553        cur = gen_xmlNodePtr(n_cur, 0);
22554        val = gen_int(n_val, 1);
22555
22556        xmlNodeSetSpacePreserve(cur, val);
22557        call_tests++;
22558        des_xmlNodePtr(n_cur, cur, 0);
22559        des_int(n_val, val, 1);
22560        xmlResetLastError();
22561        if (mem_base != xmlMemBlocks()) {
22562            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22563	           xmlMemBlocks() - mem_base);
22564	    test_ret++;
22565            printf(" %d", n_cur);
22566            printf(" %d", n_val);
22567            printf("\n");
22568        }
22569    }
22570    }
22571    function_tests++;
22572#endif
22573
22574    return(test_ret);
22575}
22576
22577
22578static int
22579test_xmlReconciliateNs(void) {
22580    int test_ret = 0;
22581
22582#if defined(LIBXML_TREE_ENABLED)
22583#ifdef LIBXML_TREE_ENABLED
22584    int mem_base;
22585    int ret_val;
22586    xmlDocPtr doc; /* the document */
22587    int n_doc;
22588    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22589    int n_tree;
22590
22591    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22592    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22593        mem_base = xmlMemBlocks();
22594        doc = gen_xmlDocPtr(n_doc, 0);
22595        tree = gen_xmlNodePtr(n_tree, 1);
22596
22597        ret_val = xmlReconciliateNs(doc, tree);
22598        desret_int(ret_val);
22599        call_tests++;
22600        des_xmlDocPtr(n_doc, doc, 0);
22601        des_xmlNodePtr(n_tree, tree, 1);
22602        xmlResetLastError();
22603        if (mem_base != xmlMemBlocks()) {
22604            printf("Leak of %d blocks found in xmlReconciliateNs",
22605	           xmlMemBlocks() - mem_base);
22606	    test_ret++;
22607            printf(" %d", n_doc);
22608            printf(" %d", n_tree);
22609            printf("\n");
22610        }
22611    }
22612    }
22613    function_tests++;
22614#endif
22615#endif
22616
22617    return(test_ret);
22618}
22619
22620
22621static int
22622test_xmlRemoveProp(void) {
22623    int test_ret = 0;
22624
22625    int mem_base;
22626    int ret_val;
22627    xmlAttrPtr cur; /* an attribute */
22628    int n_cur;
22629
22630    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22631        mem_base = xmlMemBlocks();
22632        cur = gen_xmlAttrPtr(n_cur, 0);
22633
22634        ret_val = xmlRemoveProp(cur);
22635        cur = NULL;
22636        desret_int(ret_val);
22637        call_tests++;
22638        des_xmlAttrPtr(n_cur, cur, 0);
22639        xmlResetLastError();
22640        if (mem_base != xmlMemBlocks()) {
22641            printf("Leak of %d blocks found in xmlRemoveProp",
22642	           xmlMemBlocks() - mem_base);
22643	    test_ret++;
22644            printf(" %d", n_cur);
22645            printf("\n");
22646        }
22647    }
22648    function_tests++;
22649
22650    return(test_ret);
22651}
22652
22653
22654static int
22655test_xmlReplaceNode(void) {
22656    int test_ret = 0;
22657
22658#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22659    int mem_base;
22660    xmlNodePtr ret_val;
22661    xmlNodePtr old; /* the old node */
22662    int n_old;
22663    xmlNodePtr cur; /* the node */
22664    int n_cur;
22665
22666    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22667    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22668        mem_base = xmlMemBlocks();
22669        old = gen_xmlNodePtr(n_old, 0);
22670        cur = gen_xmlNodePtr_in(n_cur, 1);
22671
22672        ret_val = xmlReplaceNode(old, cur);
22673        if (cur != NULL) {
22674              xmlUnlinkNode(cur);
22675              xmlFreeNode(cur) ; cur = NULL ; }
22676          if (old != NULL) {
22677              xmlUnlinkNode(old);
22678              xmlFreeNode(old) ; old = NULL ; }
22679	  ret_val = NULL;
22680        desret_xmlNodePtr(ret_val);
22681        call_tests++;
22682        des_xmlNodePtr(n_old, old, 0);
22683        des_xmlNodePtr_in(n_cur, cur, 1);
22684        xmlResetLastError();
22685        if (mem_base != xmlMemBlocks()) {
22686            printf("Leak of %d blocks found in xmlReplaceNode",
22687	           xmlMemBlocks() - mem_base);
22688	    test_ret++;
22689            printf(" %d", n_old);
22690            printf(" %d", n_cur);
22691            printf("\n");
22692        }
22693    }
22694    }
22695    function_tests++;
22696#endif
22697
22698    return(test_ret);
22699}
22700
22701
22702static int
22703test_xmlSaveFile(void) {
22704    int test_ret = 0;
22705
22706#if defined(LIBXML_OUTPUT_ENABLED)
22707    int mem_base;
22708    int ret_val;
22709    const char * filename; /* the filename (or URL) */
22710    int n_filename;
22711    xmlDocPtr cur; /* the document */
22712    int n_cur;
22713
22714    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22715    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22716        mem_base = xmlMemBlocks();
22717        filename = gen_fileoutput(n_filename, 0);
22718        cur = gen_xmlDocPtr(n_cur, 1);
22719
22720        ret_val = xmlSaveFile(filename, cur);
22721        desret_int(ret_val);
22722        call_tests++;
22723        des_fileoutput(n_filename, filename, 0);
22724        des_xmlDocPtr(n_cur, cur, 1);
22725        xmlResetLastError();
22726        if (mem_base != xmlMemBlocks()) {
22727            printf("Leak of %d blocks found in xmlSaveFile",
22728	           xmlMemBlocks() - mem_base);
22729	    test_ret++;
22730            printf(" %d", n_filename);
22731            printf(" %d", n_cur);
22732            printf("\n");
22733        }
22734    }
22735    }
22736    function_tests++;
22737#endif
22738
22739    return(test_ret);
22740}
22741
22742
22743static int
22744test_xmlSaveFileEnc(void) {
22745    int test_ret = 0;
22746
22747#if defined(LIBXML_OUTPUT_ENABLED)
22748    int mem_base;
22749    int ret_val;
22750    const char * filename; /* the filename (or URL) */
22751    int n_filename;
22752    xmlDocPtr cur; /* the document */
22753    int n_cur;
22754    char * encoding; /* the name of an encoding (or NULL) */
22755    int n_encoding;
22756
22757    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22758    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22759    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22760        mem_base = xmlMemBlocks();
22761        filename = gen_fileoutput(n_filename, 0);
22762        cur = gen_xmlDocPtr(n_cur, 1);
22763        encoding = gen_const_char_ptr(n_encoding, 2);
22764
22765        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22766        desret_int(ret_val);
22767        call_tests++;
22768        des_fileoutput(n_filename, filename, 0);
22769        des_xmlDocPtr(n_cur, cur, 1);
22770        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22771        xmlResetLastError();
22772        if (mem_base != xmlMemBlocks()) {
22773            printf("Leak of %d blocks found in xmlSaveFileEnc",
22774	           xmlMemBlocks() - mem_base);
22775	    test_ret++;
22776            printf(" %d", n_filename);
22777            printf(" %d", n_cur);
22778            printf(" %d", n_encoding);
22779            printf("\n");
22780        }
22781    }
22782    }
22783    }
22784    function_tests++;
22785#endif
22786
22787    return(test_ret);
22788}
22789
22790
22791static int
22792test_xmlSaveFileTo(void) {
22793    int test_ret = 0;
22794
22795#if defined(LIBXML_OUTPUT_ENABLED)
22796    int mem_base;
22797    int ret_val;
22798    xmlOutputBufferPtr buf; /* an output I/O buffer */
22799    int n_buf;
22800    xmlDocPtr cur; /* the document */
22801    int n_cur;
22802    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22803    int n_encoding;
22804
22805    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22806    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22807    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22808        mem_base = xmlMemBlocks();
22809        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22810        cur = gen_xmlDocPtr(n_cur, 1);
22811        encoding = gen_const_char_ptr(n_encoding, 2);
22812
22813        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22814        buf = NULL;
22815        desret_int(ret_val);
22816        call_tests++;
22817        des_xmlOutputBufferPtr(n_buf, buf, 0);
22818        des_xmlDocPtr(n_cur, cur, 1);
22819        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22820        xmlResetLastError();
22821        if (mem_base != xmlMemBlocks()) {
22822            printf("Leak of %d blocks found in xmlSaveFileTo",
22823	           xmlMemBlocks() - mem_base);
22824	    test_ret++;
22825            printf(" %d", n_buf);
22826            printf(" %d", n_cur);
22827            printf(" %d", n_encoding);
22828            printf("\n");
22829        }
22830    }
22831    }
22832    }
22833    function_tests++;
22834#endif
22835
22836    return(test_ret);
22837}
22838
22839
22840static int
22841test_xmlSaveFormatFile(void) {
22842    int test_ret = 0;
22843
22844#if defined(LIBXML_OUTPUT_ENABLED)
22845    int mem_base;
22846    int ret_val;
22847    const char * filename; /* the filename (or URL) */
22848    int n_filename;
22849    xmlDocPtr cur; /* the document */
22850    int n_cur;
22851    int format; /* should formatting spaces been added */
22852    int n_format;
22853
22854    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22855    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22856    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22857        mem_base = xmlMemBlocks();
22858        filename = gen_fileoutput(n_filename, 0);
22859        cur = gen_xmlDocPtr(n_cur, 1);
22860        format = gen_int(n_format, 2);
22861
22862        ret_val = xmlSaveFormatFile(filename, cur, format);
22863        desret_int(ret_val);
22864        call_tests++;
22865        des_fileoutput(n_filename, filename, 0);
22866        des_xmlDocPtr(n_cur, cur, 1);
22867        des_int(n_format, format, 2);
22868        xmlResetLastError();
22869        if (mem_base != xmlMemBlocks()) {
22870            printf("Leak of %d blocks found in xmlSaveFormatFile",
22871	           xmlMemBlocks() - mem_base);
22872	    test_ret++;
22873            printf(" %d", n_filename);
22874            printf(" %d", n_cur);
22875            printf(" %d", n_format);
22876            printf("\n");
22877        }
22878    }
22879    }
22880    }
22881    function_tests++;
22882#endif
22883
22884    return(test_ret);
22885}
22886
22887
22888static int
22889test_xmlSaveFormatFileEnc(void) {
22890    int test_ret = 0;
22891
22892#if defined(LIBXML_OUTPUT_ENABLED)
22893    int mem_base;
22894    int ret_val;
22895    const char * filename; /* the filename or URL to output */
22896    int n_filename;
22897    xmlDocPtr cur; /* the document being saved */
22898    int n_cur;
22899    char * encoding; /* the name of the encoding to use or NULL. */
22900    int n_encoding;
22901    int format; /* should formatting spaces be added. */
22902    int n_format;
22903
22904    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22905    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22906    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22907    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22908        mem_base = xmlMemBlocks();
22909        filename = gen_fileoutput(n_filename, 0);
22910        cur = gen_xmlDocPtr(n_cur, 1);
22911        encoding = gen_const_char_ptr(n_encoding, 2);
22912        format = gen_int(n_format, 3);
22913
22914        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22915        desret_int(ret_val);
22916        call_tests++;
22917        des_fileoutput(n_filename, filename, 0);
22918        des_xmlDocPtr(n_cur, cur, 1);
22919        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22920        des_int(n_format, format, 3);
22921        xmlResetLastError();
22922        if (mem_base != xmlMemBlocks()) {
22923            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22924	           xmlMemBlocks() - mem_base);
22925	    test_ret++;
22926            printf(" %d", n_filename);
22927            printf(" %d", n_cur);
22928            printf(" %d", n_encoding);
22929            printf(" %d", n_format);
22930            printf("\n");
22931        }
22932    }
22933    }
22934    }
22935    }
22936    function_tests++;
22937#endif
22938
22939    return(test_ret);
22940}
22941
22942
22943static int
22944test_xmlSaveFormatFileTo(void) {
22945    int test_ret = 0;
22946
22947#if defined(LIBXML_OUTPUT_ENABLED)
22948    int mem_base;
22949    int ret_val;
22950    xmlOutputBufferPtr buf; /* an output I/O buffer */
22951    int n_buf;
22952    xmlDocPtr cur; /* the document */
22953    int n_cur;
22954    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22955    int n_encoding;
22956    int format; /* should formatting spaces been added */
22957    int n_format;
22958
22959    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22960    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22961    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22962    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22963        mem_base = xmlMemBlocks();
22964        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22965        cur = gen_xmlDocPtr(n_cur, 1);
22966        encoding = gen_const_char_ptr(n_encoding, 2);
22967        format = gen_int(n_format, 3);
22968
22969        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22970        buf = NULL;
22971        desret_int(ret_val);
22972        call_tests++;
22973        des_xmlOutputBufferPtr(n_buf, buf, 0);
22974        des_xmlDocPtr(n_cur, cur, 1);
22975        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22976        des_int(n_format, format, 3);
22977        xmlResetLastError();
22978        if (mem_base != xmlMemBlocks()) {
22979            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22980	           xmlMemBlocks() - mem_base);
22981	    test_ret++;
22982            printf(" %d", n_buf);
22983            printf(" %d", n_cur);
22984            printf(" %d", n_encoding);
22985            printf(" %d", n_format);
22986            printf("\n");
22987        }
22988    }
22989    }
22990    }
22991    }
22992    function_tests++;
22993#endif
22994
22995    return(test_ret);
22996}
22997
22998
22999static int
23000test_xmlSearchNs(void) {
23001    int test_ret = 0;
23002
23003    int mem_base;
23004    xmlNsPtr ret_val;
23005    xmlDocPtr doc; /* the document */
23006    int n_doc;
23007    xmlNodePtr node; /* the current node */
23008    int n_node;
23009    xmlChar * nameSpace; /* the namespace prefix */
23010    int n_nameSpace;
23011
23012    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23013    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23014    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23015        mem_base = xmlMemBlocks();
23016        doc = gen_xmlDocPtr(n_doc, 0);
23017        node = gen_xmlNodePtr(n_node, 1);
23018        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23019
23020        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23021        desret_xmlNsPtr(ret_val);
23022        call_tests++;
23023        des_xmlDocPtr(n_doc, doc, 0);
23024        des_xmlNodePtr(n_node, node, 1);
23025        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23026        xmlResetLastError();
23027        if (mem_base != xmlMemBlocks()) {
23028            printf("Leak of %d blocks found in xmlSearchNs",
23029	           xmlMemBlocks() - mem_base);
23030	    test_ret++;
23031            printf(" %d", n_doc);
23032            printf(" %d", n_node);
23033            printf(" %d", n_nameSpace);
23034            printf("\n");
23035        }
23036    }
23037    }
23038    }
23039    function_tests++;
23040
23041    return(test_ret);
23042}
23043
23044
23045static int
23046test_xmlSearchNsByHref(void) {
23047    int test_ret = 0;
23048
23049    int mem_base;
23050    xmlNsPtr ret_val;
23051    xmlDocPtr doc; /* the document */
23052    int n_doc;
23053    xmlNodePtr node; /* the current node */
23054    int n_node;
23055    xmlChar * href; /* the namespace value */
23056    int n_href;
23057
23058    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23059    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23060    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23061        mem_base = xmlMemBlocks();
23062        doc = gen_xmlDocPtr(n_doc, 0);
23063        node = gen_xmlNodePtr(n_node, 1);
23064        href = gen_const_xmlChar_ptr(n_href, 2);
23065
23066        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23067        desret_xmlNsPtr(ret_val);
23068        call_tests++;
23069        des_xmlDocPtr(n_doc, doc, 0);
23070        des_xmlNodePtr(n_node, node, 1);
23071        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23072        xmlResetLastError();
23073        if (mem_base != xmlMemBlocks()) {
23074            printf("Leak of %d blocks found in xmlSearchNsByHref",
23075	           xmlMemBlocks() - mem_base);
23076	    test_ret++;
23077            printf(" %d", n_doc);
23078            printf(" %d", n_node);
23079            printf(" %d", n_href);
23080            printf("\n");
23081        }
23082    }
23083    }
23084    }
23085    function_tests++;
23086
23087    return(test_ret);
23088}
23089
23090
23091static int
23092test_xmlSetBufferAllocationScheme(void) {
23093    int test_ret = 0;
23094
23095    int mem_base;
23096    xmlBufferAllocationScheme scheme; /* allocation method to use */
23097    int n_scheme;
23098
23099    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23100        mem_base = xmlMemBlocks();
23101        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23102
23103        xmlSetBufferAllocationScheme(scheme);
23104        call_tests++;
23105        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23106        xmlResetLastError();
23107        if (mem_base != xmlMemBlocks()) {
23108            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23109	           xmlMemBlocks() - mem_base);
23110	    test_ret++;
23111            printf(" %d", n_scheme);
23112            printf("\n");
23113        }
23114    }
23115    function_tests++;
23116
23117    return(test_ret);
23118}
23119
23120
23121static int
23122test_xmlSetCompressMode(void) {
23123    int test_ret = 0;
23124
23125    int mem_base;
23126    int mode; /* the compression ratio */
23127    int n_mode;
23128
23129    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23130        mem_base = xmlMemBlocks();
23131        mode = gen_int(n_mode, 0);
23132
23133        xmlSetCompressMode(mode);
23134        call_tests++;
23135        des_int(n_mode, mode, 0);
23136        xmlResetLastError();
23137        if (mem_base != xmlMemBlocks()) {
23138            printf("Leak of %d blocks found in xmlSetCompressMode",
23139	           xmlMemBlocks() - mem_base);
23140	    test_ret++;
23141            printf(" %d", n_mode);
23142            printf("\n");
23143        }
23144    }
23145    function_tests++;
23146
23147    return(test_ret);
23148}
23149
23150
23151static int
23152test_xmlSetDocCompressMode(void) {
23153    int test_ret = 0;
23154
23155    int mem_base;
23156    xmlDocPtr doc; /* the document */
23157    int n_doc;
23158    int mode; /* the compression ratio */
23159    int n_mode;
23160
23161    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23162    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23163        mem_base = xmlMemBlocks();
23164        doc = gen_xmlDocPtr(n_doc, 0);
23165        mode = gen_int(n_mode, 1);
23166
23167        xmlSetDocCompressMode(doc, mode);
23168        call_tests++;
23169        des_xmlDocPtr(n_doc, doc, 0);
23170        des_int(n_mode, mode, 1);
23171        xmlResetLastError();
23172        if (mem_base != xmlMemBlocks()) {
23173            printf("Leak of %d blocks found in xmlSetDocCompressMode",
23174	           xmlMemBlocks() - mem_base);
23175	    test_ret++;
23176            printf(" %d", n_doc);
23177            printf(" %d", n_mode);
23178            printf("\n");
23179        }
23180    }
23181    }
23182    function_tests++;
23183
23184    return(test_ret);
23185}
23186
23187
23188static int
23189test_xmlSetNs(void) {
23190    int test_ret = 0;
23191
23192    int mem_base;
23193    xmlNodePtr node; /* a node in the document */
23194    int n_node;
23195    xmlNsPtr ns; /* a namespace pointer */
23196    int n_ns;
23197
23198    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23199    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23200        mem_base = xmlMemBlocks();
23201        node = gen_xmlNodePtr(n_node, 0);
23202        ns = gen_xmlNsPtr(n_ns, 1);
23203
23204        xmlSetNs(node, ns);
23205        call_tests++;
23206        des_xmlNodePtr(n_node, node, 0);
23207        des_xmlNsPtr(n_ns, ns, 1);
23208        xmlResetLastError();
23209        if (mem_base != xmlMemBlocks()) {
23210            printf("Leak of %d blocks found in xmlSetNs",
23211	           xmlMemBlocks() - mem_base);
23212	    test_ret++;
23213            printf(" %d", n_node);
23214            printf(" %d", n_ns);
23215            printf("\n");
23216        }
23217    }
23218    }
23219    function_tests++;
23220
23221    return(test_ret);
23222}
23223
23224
23225static int
23226test_xmlSetNsProp(void) {
23227    int test_ret = 0;
23228
23229#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23230    int mem_base;
23231    xmlAttrPtr ret_val;
23232    xmlNodePtr node; /* the node */
23233    int n_node;
23234    xmlNsPtr ns; /* the namespace definition */
23235    int n_ns;
23236    xmlChar * name; /* the attribute name */
23237    int n_name;
23238    xmlChar * value; /* the attribute value */
23239    int n_value;
23240
23241    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23242    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23243    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23244    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23245        mem_base = xmlMemBlocks();
23246        node = gen_xmlNodePtr(n_node, 0);
23247        ns = gen_xmlNsPtr(n_ns, 1);
23248        name = gen_const_xmlChar_ptr(n_name, 2);
23249        value = gen_const_xmlChar_ptr(n_value, 3);
23250
23251        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23252        desret_xmlAttrPtr(ret_val);
23253        call_tests++;
23254        des_xmlNodePtr(n_node, node, 0);
23255        des_xmlNsPtr(n_ns, ns, 1);
23256        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23257        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23258        xmlResetLastError();
23259        if (mem_base != xmlMemBlocks()) {
23260            printf("Leak of %d blocks found in xmlSetNsProp",
23261	           xmlMemBlocks() - mem_base);
23262	    test_ret++;
23263            printf(" %d", n_node);
23264            printf(" %d", n_ns);
23265            printf(" %d", n_name);
23266            printf(" %d", n_value);
23267            printf("\n");
23268        }
23269    }
23270    }
23271    }
23272    }
23273    function_tests++;
23274#endif
23275
23276    return(test_ret);
23277}
23278
23279
23280static int
23281test_xmlSetProp(void) {
23282    int test_ret = 0;
23283
23284#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23285    int mem_base;
23286    xmlAttrPtr ret_val;
23287    xmlNodePtr node; /* the node */
23288    int n_node;
23289    xmlChar * name; /* the attribute name (a QName) */
23290    int n_name;
23291    xmlChar * value; /* the attribute value */
23292    int n_value;
23293
23294    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23295    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23296    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23297        mem_base = xmlMemBlocks();
23298        node = gen_xmlNodePtr(n_node, 0);
23299        name = gen_const_xmlChar_ptr(n_name, 1);
23300        value = gen_const_xmlChar_ptr(n_value, 2);
23301
23302        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23303        desret_xmlAttrPtr(ret_val);
23304        call_tests++;
23305        des_xmlNodePtr(n_node, node, 0);
23306        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23307        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23308        xmlResetLastError();
23309        if (mem_base != xmlMemBlocks()) {
23310            printf("Leak of %d blocks found in xmlSetProp",
23311	           xmlMemBlocks() - mem_base);
23312	    test_ret++;
23313            printf(" %d", n_node);
23314            printf(" %d", n_name);
23315            printf(" %d", n_value);
23316            printf("\n");
23317        }
23318    }
23319    }
23320    }
23321    function_tests++;
23322#endif
23323
23324    return(test_ret);
23325}
23326
23327
23328static int
23329test_xmlSplitQName2(void) {
23330    int test_ret = 0;
23331
23332    int mem_base;
23333    xmlChar * ret_val;
23334    xmlChar * name; /* the full QName */
23335    int n_name;
23336    xmlChar ** prefix; /* a xmlChar ** */
23337    int n_prefix;
23338
23339    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23340    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23341        mem_base = xmlMemBlocks();
23342        name = gen_const_xmlChar_ptr(n_name, 0);
23343        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23344
23345        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23346        desret_xmlChar_ptr(ret_val);
23347        call_tests++;
23348        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23349        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23350        xmlResetLastError();
23351        if (mem_base != xmlMemBlocks()) {
23352            printf("Leak of %d blocks found in xmlSplitQName2",
23353	           xmlMemBlocks() - mem_base);
23354	    test_ret++;
23355            printf(" %d", n_name);
23356            printf(" %d", n_prefix);
23357            printf("\n");
23358        }
23359    }
23360    }
23361    function_tests++;
23362
23363    return(test_ret);
23364}
23365
23366
23367static int
23368test_xmlSplitQName3(void) {
23369    int test_ret = 0;
23370
23371    int mem_base;
23372    const xmlChar * ret_val;
23373    xmlChar * name; /* the full QName */
23374    int n_name;
23375    int * len; /* an int * */
23376    int n_len;
23377
23378    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23379    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23380        mem_base = xmlMemBlocks();
23381        name = gen_const_xmlChar_ptr(n_name, 0);
23382        len = gen_int_ptr(n_len, 1);
23383
23384        ret_val = xmlSplitQName3((const xmlChar *)name, len);
23385        desret_const_xmlChar_ptr(ret_val);
23386        call_tests++;
23387        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23388        des_int_ptr(n_len, len, 1);
23389        xmlResetLastError();
23390        if (mem_base != xmlMemBlocks()) {
23391            printf("Leak of %d blocks found in xmlSplitQName3",
23392	           xmlMemBlocks() - mem_base);
23393	    test_ret++;
23394            printf(" %d", n_name);
23395            printf(" %d", n_len);
23396            printf("\n");
23397        }
23398    }
23399    }
23400    function_tests++;
23401
23402    return(test_ret);
23403}
23404
23405
23406static int
23407test_xmlStringGetNodeList(void) {
23408    int test_ret = 0;
23409
23410    int mem_base;
23411    xmlNodePtr ret_val;
23412    xmlDocPtr doc; /* the document */
23413    int n_doc;
23414    xmlChar * value; /* the value of the attribute */
23415    int n_value;
23416
23417    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23418    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23419        mem_base = xmlMemBlocks();
23420        doc = gen_xmlDocPtr(n_doc, 0);
23421        value = gen_const_xmlChar_ptr(n_value, 1);
23422
23423        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23424        desret_xmlNodePtr(ret_val);
23425        call_tests++;
23426        des_xmlDocPtr(n_doc, doc, 0);
23427        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23428        xmlResetLastError();
23429        if (mem_base != xmlMemBlocks()) {
23430            printf("Leak of %d blocks found in xmlStringGetNodeList",
23431	           xmlMemBlocks() - mem_base);
23432	    test_ret++;
23433            printf(" %d", n_doc);
23434            printf(" %d", n_value);
23435            printf("\n");
23436        }
23437    }
23438    }
23439    function_tests++;
23440
23441    return(test_ret);
23442}
23443
23444
23445static int
23446test_xmlStringLenGetNodeList(void) {
23447    int test_ret = 0;
23448
23449    int mem_base;
23450    xmlNodePtr ret_val;
23451    xmlDocPtr doc; /* the document */
23452    int n_doc;
23453    xmlChar * value; /* the value of the text */
23454    int n_value;
23455    int len; /* the length of the string value */
23456    int n_len;
23457
23458    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23459    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23460    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23461        mem_base = xmlMemBlocks();
23462        doc = gen_xmlDocPtr(n_doc, 0);
23463        value = gen_const_xmlChar_ptr(n_value, 1);
23464        len = gen_int(n_len, 2);
23465
23466        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23467        desret_xmlNodePtr(ret_val);
23468        call_tests++;
23469        des_xmlDocPtr(n_doc, doc, 0);
23470        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23471        des_int(n_len, len, 2);
23472        xmlResetLastError();
23473        if (mem_base != xmlMemBlocks()) {
23474            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23475	           xmlMemBlocks() - mem_base);
23476	    test_ret++;
23477            printf(" %d", n_doc);
23478            printf(" %d", n_value);
23479            printf(" %d", n_len);
23480            printf("\n");
23481        }
23482    }
23483    }
23484    }
23485    function_tests++;
23486
23487    return(test_ret);
23488}
23489
23490
23491static int
23492test_xmlTextConcat(void) {
23493    int test_ret = 0;
23494
23495    int mem_base;
23496    int ret_val;
23497    xmlNodePtr node; /* the node */
23498    int n_node;
23499    xmlChar * content; /* the content */
23500    int n_content;
23501    int len; /* @content length */
23502    int n_len;
23503
23504    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23505    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23506    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23507        mem_base = xmlMemBlocks();
23508        node = gen_xmlNodePtr(n_node, 0);
23509        content = gen_const_xmlChar_ptr(n_content, 1);
23510        len = gen_int(n_len, 2);
23511
23512        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23513        desret_int(ret_val);
23514        call_tests++;
23515        des_xmlNodePtr(n_node, node, 0);
23516        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23517        des_int(n_len, len, 2);
23518        xmlResetLastError();
23519        if (mem_base != xmlMemBlocks()) {
23520            printf("Leak of %d blocks found in xmlTextConcat",
23521	           xmlMemBlocks() - mem_base);
23522	    test_ret++;
23523            printf(" %d", n_node);
23524            printf(" %d", n_content);
23525            printf(" %d", n_len);
23526            printf("\n");
23527        }
23528    }
23529    }
23530    }
23531    function_tests++;
23532
23533    return(test_ret);
23534}
23535
23536
23537static int
23538test_xmlTextMerge(void) {
23539    int test_ret = 0;
23540
23541    int mem_base;
23542    xmlNodePtr ret_val;
23543    xmlNodePtr first; /* the first text node */
23544    int n_first;
23545    xmlNodePtr second; /* the second text node being merged */
23546    int n_second;
23547
23548    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23549    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23550        mem_base = xmlMemBlocks();
23551        first = gen_xmlNodePtr_in(n_first, 0);
23552        second = gen_xmlNodePtr_in(n_second, 1);
23553
23554        ret_val = xmlTextMerge(first, second);
23555        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23556              xmlUnlinkNode(second);
23557              xmlFreeNode(second) ; second = NULL ; }
23558        desret_xmlNodePtr(ret_val);
23559        call_tests++;
23560        des_xmlNodePtr_in(n_first, first, 0);
23561        des_xmlNodePtr_in(n_second, second, 1);
23562        xmlResetLastError();
23563        if (mem_base != xmlMemBlocks()) {
23564            printf("Leak of %d blocks found in xmlTextMerge",
23565	           xmlMemBlocks() - mem_base);
23566	    test_ret++;
23567            printf(" %d", n_first);
23568            printf(" %d", n_second);
23569            printf("\n");
23570        }
23571    }
23572    }
23573    function_tests++;
23574
23575    return(test_ret);
23576}
23577
23578
23579static int
23580test_xmlUnsetNsProp(void) {
23581    int test_ret = 0;
23582
23583#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23584    int mem_base;
23585    int ret_val;
23586    xmlNodePtr node; /* the node */
23587    int n_node;
23588    xmlNsPtr ns; /* the namespace definition */
23589    int n_ns;
23590    xmlChar * name; /* the attribute name */
23591    int n_name;
23592
23593    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23594    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23595    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23596        mem_base = xmlMemBlocks();
23597        node = gen_xmlNodePtr(n_node, 0);
23598        ns = gen_xmlNsPtr(n_ns, 1);
23599        name = gen_const_xmlChar_ptr(n_name, 2);
23600
23601        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23602        desret_int(ret_val);
23603        call_tests++;
23604        des_xmlNodePtr(n_node, node, 0);
23605        des_xmlNsPtr(n_ns, ns, 1);
23606        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23607        xmlResetLastError();
23608        if (mem_base != xmlMemBlocks()) {
23609            printf("Leak of %d blocks found in xmlUnsetNsProp",
23610	           xmlMemBlocks() - mem_base);
23611	    test_ret++;
23612            printf(" %d", n_node);
23613            printf(" %d", n_ns);
23614            printf(" %d", n_name);
23615            printf("\n");
23616        }
23617    }
23618    }
23619    }
23620    function_tests++;
23621#endif
23622
23623    return(test_ret);
23624}
23625
23626
23627static int
23628test_xmlUnsetProp(void) {
23629    int test_ret = 0;
23630
23631#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23632    int mem_base;
23633    int ret_val;
23634    xmlNodePtr node; /* the node */
23635    int n_node;
23636    xmlChar * name; /* the attribute name */
23637    int n_name;
23638
23639    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23640    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23641        mem_base = xmlMemBlocks();
23642        node = gen_xmlNodePtr(n_node, 0);
23643        name = gen_const_xmlChar_ptr(n_name, 1);
23644
23645        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23646        desret_int(ret_val);
23647        call_tests++;
23648        des_xmlNodePtr(n_node, node, 0);
23649        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23650        xmlResetLastError();
23651        if (mem_base != xmlMemBlocks()) {
23652            printf("Leak of %d blocks found in xmlUnsetProp",
23653	           xmlMemBlocks() - mem_base);
23654	    test_ret++;
23655            printf(" %d", n_node);
23656            printf(" %d", n_name);
23657            printf("\n");
23658        }
23659    }
23660    }
23661    function_tests++;
23662#endif
23663
23664    return(test_ret);
23665}
23666
23667
23668static int
23669test_xmlValidateNCName(void) {
23670    int test_ret = 0;
23671
23672#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)
23673#ifdef LIBXML_TREE_ENABLED
23674    int mem_base;
23675    int ret_val;
23676    xmlChar * value; /* the value to check */
23677    int n_value;
23678    int space; /* allow spaces in front and end of the string */
23679    int n_space;
23680
23681    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23682    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23683        mem_base = xmlMemBlocks();
23684        value = gen_const_xmlChar_ptr(n_value, 0);
23685        space = gen_int(n_space, 1);
23686
23687        ret_val = xmlValidateNCName((const xmlChar *)value, space);
23688        desret_int(ret_val);
23689        call_tests++;
23690        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23691        des_int(n_space, space, 1);
23692        xmlResetLastError();
23693        if (mem_base != xmlMemBlocks()) {
23694            printf("Leak of %d blocks found in xmlValidateNCName",
23695	           xmlMemBlocks() - mem_base);
23696	    test_ret++;
23697            printf(" %d", n_value);
23698            printf(" %d", n_space);
23699            printf("\n");
23700        }
23701    }
23702    }
23703    function_tests++;
23704#endif
23705#endif
23706
23707    return(test_ret);
23708}
23709
23710
23711static int
23712test_xmlValidateNMToken(void) {
23713    int test_ret = 0;
23714
23715#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23716#ifdef LIBXML_TREE_ENABLED
23717    int mem_base;
23718    int ret_val;
23719    xmlChar * value; /* the value to check */
23720    int n_value;
23721    int space; /* allow spaces in front and end of the string */
23722    int n_space;
23723
23724    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23725    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23726        mem_base = xmlMemBlocks();
23727        value = gen_const_xmlChar_ptr(n_value, 0);
23728        space = gen_int(n_space, 1);
23729
23730        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23731        desret_int(ret_val);
23732        call_tests++;
23733        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23734        des_int(n_space, space, 1);
23735        xmlResetLastError();
23736        if (mem_base != xmlMemBlocks()) {
23737            printf("Leak of %d blocks found in xmlValidateNMToken",
23738	           xmlMemBlocks() - mem_base);
23739	    test_ret++;
23740            printf(" %d", n_value);
23741            printf(" %d", n_space);
23742            printf("\n");
23743        }
23744    }
23745    }
23746    function_tests++;
23747#endif
23748#endif
23749
23750    return(test_ret);
23751}
23752
23753
23754static int
23755test_xmlValidateName(void) {
23756    int test_ret = 0;
23757
23758#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23759#ifdef LIBXML_TREE_ENABLED
23760    int mem_base;
23761    int ret_val;
23762    xmlChar * value; /* the value to check */
23763    int n_value;
23764    int space; /* allow spaces in front and end of the string */
23765    int n_space;
23766
23767    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23768    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23769        mem_base = xmlMemBlocks();
23770        value = gen_const_xmlChar_ptr(n_value, 0);
23771        space = gen_int(n_space, 1);
23772
23773        ret_val = xmlValidateName((const xmlChar *)value, space);
23774        desret_int(ret_val);
23775        call_tests++;
23776        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23777        des_int(n_space, space, 1);
23778        xmlResetLastError();
23779        if (mem_base != xmlMemBlocks()) {
23780            printf("Leak of %d blocks found in xmlValidateName",
23781	           xmlMemBlocks() - mem_base);
23782	    test_ret++;
23783            printf(" %d", n_value);
23784            printf(" %d", n_space);
23785            printf("\n");
23786        }
23787    }
23788    }
23789    function_tests++;
23790#endif
23791#endif
23792
23793    return(test_ret);
23794}
23795
23796
23797static int
23798test_xmlValidateQName(void) {
23799    int test_ret = 0;
23800
23801#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23802#ifdef LIBXML_TREE_ENABLED
23803    int mem_base;
23804    int ret_val;
23805    xmlChar * value; /* the value to check */
23806    int n_value;
23807    int space; /* allow spaces in front and end of the string */
23808    int n_space;
23809
23810    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23811    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23812        mem_base = xmlMemBlocks();
23813        value = gen_const_xmlChar_ptr(n_value, 0);
23814        space = gen_int(n_space, 1);
23815
23816        ret_val = xmlValidateQName((const xmlChar *)value, space);
23817        desret_int(ret_val);
23818        call_tests++;
23819        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23820        des_int(n_space, space, 1);
23821        xmlResetLastError();
23822        if (mem_base != xmlMemBlocks()) {
23823            printf("Leak of %d blocks found in xmlValidateQName",
23824	           xmlMemBlocks() - mem_base);
23825	    test_ret++;
23826            printf(" %d", n_value);
23827            printf(" %d", n_space);
23828            printf("\n");
23829        }
23830    }
23831    }
23832    function_tests++;
23833#endif
23834#endif
23835
23836    return(test_ret);
23837}
23838
23839static int
23840test_tree(void) {
23841    int test_ret = 0;
23842
23843    if (quiet == 0) printf("Testing tree : 133 of 152 functions ...\n");
23844    test_ret += test_xmlAddChild();
23845    test_ret += test_xmlAddChildList();
23846    test_ret += test_xmlAddNextSibling();
23847    test_ret += test_xmlAddPrevSibling();
23848    test_ret += test_xmlAddSibling();
23849    test_ret += test_xmlAttrSerializeTxtContent();
23850    test_ret += test_xmlBufferAdd();
23851    test_ret += test_xmlBufferAddHead();
23852    test_ret += test_xmlBufferCCat();
23853    test_ret += test_xmlBufferCat();
23854    test_ret += test_xmlBufferContent();
23855    test_ret += test_xmlBufferCreate();
23856    test_ret += test_xmlBufferCreateSize();
23857    test_ret += test_xmlBufferCreateStatic();
23858    test_ret += test_xmlBufferEmpty();
23859    test_ret += test_xmlBufferGrow();
23860    test_ret += test_xmlBufferLength();
23861    test_ret += test_xmlBufferResize();
23862    test_ret += test_xmlBufferSetAllocationScheme();
23863    test_ret += test_xmlBufferShrink();
23864    test_ret += test_xmlBufferWriteCHAR();
23865    test_ret += test_xmlBufferWriteChar();
23866    test_ret += test_xmlBufferWriteQuotedString();
23867    test_ret += test_xmlBuildQName();
23868    test_ret += test_xmlCopyDoc();
23869    test_ret += test_xmlCopyDtd();
23870    test_ret += test_xmlCopyNamespace();
23871    test_ret += test_xmlCopyNamespaceList();
23872    test_ret += test_xmlCopyNode();
23873    test_ret += test_xmlCopyNodeList();
23874    test_ret += test_xmlCopyProp();
23875    test_ret += test_xmlCopyPropList();
23876    test_ret += test_xmlCreateIntSubset();
23877    test_ret += test_xmlDOMWrapAdoptNode();
23878    test_ret += test_xmlDOMWrapCloneNode();
23879    test_ret += test_xmlDOMWrapNewCtxt();
23880    test_ret += test_xmlDOMWrapReconcileNamespaces();
23881    test_ret += test_xmlDOMWrapRemoveNode();
23882    test_ret += test_xmlDocCopyNode();
23883    test_ret += test_xmlDocCopyNodeList();
23884    test_ret += test_xmlDocDump();
23885    test_ret += test_xmlDocDumpFormatMemory();
23886    test_ret += test_xmlDocDumpFormatMemoryEnc();
23887    test_ret += test_xmlDocDumpMemory();
23888    test_ret += test_xmlDocDumpMemoryEnc();
23889    test_ret += test_xmlDocFormatDump();
23890    test_ret += test_xmlDocGetRootElement();
23891    test_ret += test_xmlDocSetRootElement();
23892    test_ret += test_xmlElemDump();
23893    test_ret += test_xmlGetBufferAllocationScheme();
23894    test_ret += test_xmlGetCompressMode();
23895    test_ret += test_xmlGetDocCompressMode();
23896    test_ret += test_xmlGetIntSubset();
23897    test_ret += test_xmlGetLastChild();
23898    test_ret += test_xmlGetLineNo();
23899    test_ret += test_xmlGetNoNsProp();
23900    test_ret += test_xmlGetNodePath();
23901    test_ret += test_xmlGetNsList();
23902    test_ret += test_xmlGetNsProp();
23903    test_ret += test_xmlGetProp();
23904    test_ret += test_xmlHasNsProp();
23905    test_ret += test_xmlHasProp();
23906    test_ret += test_xmlIsBlankNode();
23907    test_ret += test_xmlIsXHTML();
23908    test_ret += test_xmlNewCDataBlock();
23909    test_ret += test_xmlNewCharRef();
23910    test_ret += test_xmlNewChild();
23911    test_ret += test_xmlNewComment();
23912    test_ret += test_xmlNewDoc();
23913    test_ret += test_xmlNewDocComment();
23914    test_ret += test_xmlNewDocFragment();
23915    test_ret += test_xmlNewDocNode();
23916    test_ret += test_xmlNewDocNodeEatName();
23917    test_ret += test_xmlNewDocPI();
23918    test_ret += test_xmlNewDocProp();
23919    test_ret += test_xmlNewDocRawNode();
23920    test_ret += test_xmlNewDocText();
23921    test_ret += test_xmlNewDocTextLen();
23922    test_ret += test_xmlNewDtd();
23923    test_ret += test_xmlNewNode();
23924    test_ret += test_xmlNewNodeEatName();
23925    test_ret += test_xmlNewNs();
23926    test_ret += test_xmlNewNsProp();
23927    test_ret += test_xmlNewNsPropEatName();
23928    test_ret += test_xmlNewPI();
23929    test_ret += test_xmlNewProp();
23930    test_ret += test_xmlNewReference();
23931    test_ret += test_xmlNewText();
23932    test_ret += test_xmlNewTextChild();
23933    test_ret += test_xmlNewTextLen();
23934    test_ret += test_xmlNodeAddContent();
23935    test_ret += test_xmlNodeAddContentLen();
23936    test_ret += test_xmlNodeBufGetContent();
23937    test_ret += test_xmlNodeDump();
23938    test_ret += test_xmlNodeDumpOutput();
23939    test_ret += test_xmlNodeGetBase();
23940    test_ret += test_xmlNodeGetContent();
23941    test_ret += test_xmlNodeGetLang();
23942    test_ret += test_xmlNodeGetSpacePreserve();
23943    test_ret += test_xmlNodeIsText();
23944    test_ret += test_xmlNodeListGetRawString();
23945    test_ret += test_xmlNodeListGetString();
23946    test_ret += test_xmlNodeSetBase();
23947    test_ret += test_xmlNodeSetContent();
23948    test_ret += test_xmlNodeSetContentLen();
23949    test_ret += test_xmlNodeSetLang();
23950    test_ret += test_xmlNodeSetName();
23951    test_ret += test_xmlNodeSetSpacePreserve();
23952    test_ret += test_xmlReconciliateNs();
23953    test_ret += test_xmlRemoveProp();
23954    test_ret += test_xmlReplaceNode();
23955    test_ret += test_xmlSaveFile();
23956    test_ret += test_xmlSaveFileEnc();
23957    test_ret += test_xmlSaveFileTo();
23958    test_ret += test_xmlSaveFormatFile();
23959    test_ret += test_xmlSaveFormatFileEnc();
23960    test_ret += test_xmlSaveFormatFileTo();
23961    test_ret += test_xmlSearchNs();
23962    test_ret += test_xmlSearchNsByHref();
23963    test_ret += test_xmlSetBufferAllocationScheme();
23964    test_ret += test_xmlSetCompressMode();
23965    test_ret += test_xmlSetDocCompressMode();
23966    test_ret += test_xmlSetNs();
23967    test_ret += test_xmlSetNsProp();
23968    test_ret += test_xmlSetProp();
23969    test_ret += test_xmlSplitQName2();
23970    test_ret += test_xmlSplitQName3();
23971    test_ret += test_xmlStringGetNodeList();
23972    test_ret += test_xmlStringLenGetNodeList();
23973    test_ret += test_xmlTextConcat();
23974    test_ret += test_xmlTextMerge();
23975    test_ret += test_xmlUnsetNsProp();
23976    test_ret += test_xmlUnsetProp();
23977    test_ret += test_xmlValidateNCName();
23978    test_ret += test_xmlValidateNMToken();
23979    test_ret += test_xmlValidateName();
23980    test_ret += test_xmlValidateQName();
23981
23982    if (test_ret != 0)
23983	printf("Module tree: %d errors\n", test_ret);
23984    return(test_ret);
23985}
23986
23987static int
23988test_xmlBuildRelativeURI(void) {
23989    int test_ret = 0;
23990
23991    int mem_base;
23992    xmlChar * ret_val;
23993    xmlChar * URI; /* the URI reference under consideration */
23994    int n_URI;
23995    xmlChar * base; /* the base value */
23996    int n_base;
23997
23998    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
23999    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24000        mem_base = xmlMemBlocks();
24001        URI = gen_const_xmlChar_ptr(n_URI, 0);
24002        base = gen_const_xmlChar_ptr(n_base, 1);
24003
24004        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24005        desret_xmlChar_ptr(ret_val);
24006        call_tests++;
24007        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24008        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24009        xmlResetLastError();
24010        if (mem_base != xmlMemBlocks()) {
24011            printf("Leak of %d blocks found in xmlBuildRelativeURI",
24012	           xmlMemBlocks() - mem_base);
24013	    test_ret++;
24014            printf(" %d", n_URI);
24015            printf(" %d", n_base);
24016            printf("\n");
24017        }
24018    }
24019    }
24020    function_tests++;
24021
24022    return(test_ret);
24023}
24024
24025
24026static int
24027test_xmlBuildURI(void) {
24028    int test_ret = 0;
24029
24030    int mem_base;
24031    xmlChar * ret_val;
24032    xmlChar * URI; /* the URI instance found in the document */
24033    int n_URI;
24034    xmlChar * base; /* the base value */
24035    int n_base;
24036
24037    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24038    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24039        mem_base = xmlMemBlocks();
24040        URI = gen_const_xmlChar_ptr(n_URI, 0);
24041        base = gen_const_xmlChar_ptr(n_base, 1);
24042
24043        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24044        desret_xmlChar_ptr(ret_val);
24045        call_tests++;
24046        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24047        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24048        xmlResetLastError();
24049        if (mem_base != xmlMemBlocks()) {
24050            printf("Leak of %d blocks found in xmlBuildURI",
24051	           xmlMemBlocks() - mem_base);
24052	    test_ret++;
24053            printf(" %d", n_URI);
24054            printf(" %d", n_base);
24055            printf("\n");
24056        }
24057    }
24058    }
24059    function_tests++;
24060
24061    return(test_ret);
24062}
24063
24064
24065static int
24066test_xmlCanonicPath(void) {
24067    int test_ret = 0;
24068
24069    int mem_base;
24070    xmlChar * ret_val;
24071    xmlChar * path; /* the resource locator in a filesystem notation */
24072    int n_path;
24073
24074    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24075        mem_base = xmlMemBlocks();
24076        path = gen_const_xmlChar_ptr(n_path, 0);
24077
24078        ret_val = xmlCanonicPath((const xmlChar *)path);
24079        desret_xmlChar_ptr(ret_val);
24080        call_tests++;
24081        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24082        xmlResetLastError();
24083        if (mem_base != xmlMemBlocks()) {
24084            printf("Leak of %d blocks found in xmlCanonicPath",
24085	           xmlMemBlocks() - mem_base);
24086	    test_ret++;
24087            printf(" %d", n_path);
24088            printf("\n");
24089        }
24090    }
24091    function_tests++;
24092
24093    return(test_ret);
24094}
24095
24096
24097static int
24098test_xmlCreateURI(void) {
24099    int test_ret = 0;
24100
24101
24102    /* missing type support */
24103    return(test_ret);
24104}
24105
24106
24107static int
24108test_xmlNormalizeURIPath(void) {
24109    int test_ret = 0;
24110
24111    int mem_base;
24112    int ret_val;
24113    char * path; /* pointer to the path string */
24114    int n_path;
24115
24116    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24117        mem_base = xmlMemBlocks();
24118        path = gen_char_ptr(n_path, 0);
24119
24120        ret_val = xmlNormalizeURIPath(path);
24121        desret_int(ret_val);
24122        call_tests++;
24123        des_char_ptr(n_path, path, 0);
24124        xmlResetLastError();
24125        if (mem_base != xmlMemBlocks()) {
24126            printf("Leak of %d blocks found in xmlNormalizeURIPath",
24127	           xmlMemBlocks() - mem_base);
24128	    test_ret++;
24129            printf(" %d", n_path);
24130            printf("\n");
24131        }
24132    }
24133    function_tests++;
24134
24135    return(test_ret);
24136}
24137
24138
24139static int
24140test_xmlParseURI(void) {
24141    int test_ret = 0;
24142
24143
24144    /* missing type support */
24145    return(test_ret);
24146}
24147
24148
24149static int
24150test_xmlParseURIRaw(void) {
24151    int test_ret = 0;
24152
24153
24154    /* missing type support */
24155    return(test_ret);
24156}
24157
24158
24159#define gen_nb_xmlURIPtr 1
24160static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24161    return(NULL);
24162}
24163static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24164}
24165
24166static int
24167test_xmlParseURIReference(void) {
24168    int test_ret = 0;
24169
24170    int mem_base;
24171    int ret_val;
24172    xmlURIPtr uri; /* pointer to an URI structure */
24173    int n_uri;
24174    char * str; /* the string to analyze */
24175    int n_str;
24176
24177    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24178    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24179        mem_base = xmlMemBlocks();
24180        uri = gen_xmlURIPtr(n_uri, 0);
24181        str = gen_const_char_ptr(n_str, 1);
24182
24183        ret_val = xmlParseURIReference(uri, (const char *)str);
24184        desret_int(ret_val);
24185        call_tests++;
24186        des_xmlURIPtr(n_uri, uri, 0);
24187        des_const_char_ptr(n_str, (const char *)str, 1);
24188        xmlResetLastError();
24189        if (mem_base != xmlMemBlocks()) {
24190            printf("Leak of %d blocks found in xmlParseURIReference",
24191	           xmlMemBlocks() - mem_base);
24192	    test_ret++;
24193            printf(" %d", n_uri);
24194            printf(" %d", n_str);
24195            printf("\n");
24196        }
24197    }
24198    }
24199    function_tests++;
24200
24201    return(test_ret);
24202}
24203
24204
24205static int
24206test_xmlPathToURI(void) {
24207    int test_ret = 0;
24208
24209    int mem_base;
24210    xmlChar * ret_val;
24211    xmlChar * path; /* the resource locator in a filesystem notation */
24212    int n_path;
24213
24214    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24215        mem_base = xmlMemBlocks();
24216        path = gen_const_xmlChar_ptr(n_path, 0);
24217
24218        ret_val = xmlPathToURI((const xmlChar *)path);
24219        desret_xmlChar_ptr(ret_val);
24220        call_tests++;
24221        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24222        xmlResetLastError();
24223        if (mem_base != xmlMemBlocks()) {
24224            printf("Leak of %d blocks found in xmlPathToURI",
24225	           xmlMemBlocks() - mem_base);
24226	    test_ret++;
24227            printf(" %d", n_path);
24228            printf("\n");
24229        }
24230    }
24231    function_tests++;
24232
24233    return(test_ret);
24234}
24235
24236
24237static int
24238test_xmlPrintURI(void) {
24239    int test_ret = 0;
24240
24241    int mem_base;
24242    FILE * stream; /* a FILE* for the output */
24243    int n_stream;
24244    xmlURIPtr uri; /* pointer to an xmlURI */
24245    int n_uri;
24246
24247    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24248    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24249        mem_base = xmlMemBlocks();
24250        stream = gen_FILE_ptr(n_stream, 0);
24251        uri = gen_xmlURIPtr(n_uri, 1);
24252
24253        xmlPrintURI(stream, uri);
24254        call_tests++;
24255        des_FILE_ptr(n_stream, stream, 0);
24256        des_xmlURIPtr(n_uri, uri, 1);
24257        xmlResetLastError();
24258        if (mem_base != xmlMemBlocks()) {
24259            printf("Leak of %d blocks found in xmlPrintURI",
24260	           xmlMemBlocks() - mem_base);
24261	    test_ret++;
24262            printf(" %d", n_stream);
24263            printf(" %d", n_uri);
24264            printf("\n");
24265        }
24266    }
24267    }
24268    function_tests++;
24269
24270    return(test_ret);
24271}
24272
24273
24274static int
24275test_xmlSaveUri(void) {
24276    int test_ret = 0;
24277
24278    int mem_base;
24279    xmlChar * ret_val;
24280    xmlURIPtr uri; /* pointer to an xmlURI */
24281    int n_uri;
24282
24283    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24284        mem_base = xmlMemBlocks();
24285        uri = gen_xmlURIPtr(n_uri, 0);
24286
24287        ret_val = xmlSaveUri(uri);
24288        desret_xmlChar_ptr(ret_val);
24289        call_tests++;
24290        des_xmlURIPtr(n_uri, uri, 0);
24291        xmlResetLastError();
24292        if (mem_base != xmlMemBlocks()) {
24293            printf("Leak of %d blocks found in xmlSaveUri",
24294	           xmlMemBlocks() - mem_base);
24295	    test_ret++;
24296            printf(" %d", n_uri);
24297            printf("\n");
24298        }
24299    }
24300    function_tests++;
24301
24302    return(test_ret);
24303}
24304
24305
24306static int
24307test_xmlURIEscape(void) {
24308    int test_ret = 0;
24309
24310    int mem_base;
24311    xmlChar * ret_val;
24312    xmlChar * str; /* the string of the URI to escape */
24313    int n_str;
24314
24315    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24316        mem_base = xmlMemBlocks();
24317        str = gen_const_xmlChar_ptr(n_str, 0);
24318
24319        ret_val = xmlURIEscape((const xmlChar *)str);
24320        desret_xmlChar_ptr(ret_val);
24321        call_tests++;
24322        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24323        xmlResetLastError();
24324        if (mem_base != xmlMemBlocks()) {
24325            printf("Leak of %d blocks found in xmlURIEscape",
24326	           xmlMemBlocks() - mem_base);
24327	    test_ret++;
24328            printf(" %d", n_str);
24329            printf("\n");
24330        }
24331    }
24332    function_tests++;
24333
24334    return(test_ret);
24335}
24336
24337
24338static int
24339test_xmlURIEscapeStr(void) {
24340    int test_ret = 0;
24341
24342    int mem_base;
24343    xmlChar * ret_val;
24344    xmlChar * str; /* string to escape */
24345    int n_str;
24346    xmlChar * list; /* exception list string of chars not to escape */
24347    int n_list;
24348
24349    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24350    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24351        mem_base = xmlMemBlocks();
24352        str = gen_const_xmlChar_ptr(n_str, 0);
24353        list = gen_const_xmlChar_ptr(n_list, 1);
24354
24355        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24356        desret_xmlChar_ptr(ret_val);
24357        call_tests++;
24358        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24359        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24360        xmlResetLastError();
24361        if (mem_base != xmlMemBlocks()) {
24362            printf("Leak of %d blocks found in xmlURIEscapeStr",
24363	           xmlMemBlocks() - mem_base);
24364	    test_ret++;
24365            printf(" %d", n_str);
24366            printf(" %d", n_list);
24367            printf("\n");
24368        }
24369    }
24370    }
24371    function_tests++;
24372
24373    return(test_ret);
24374}
24375
24376
24377static int
24378test_xmlURIUnescapeString(void) {
24379    int test_ret = 0;
24380
24381
24382    /* missing type support */
24383    return(test_ret);
24384}
24385
24386static int
24387test_uri(void) {
24388    int test_ret = 0;
24389
24390    if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24391    test_ret += test_xmlBuildRelativeURI();
24392    test_ret += test_xmlBuildURI();
24393    test_ret += test_xmlCanonicPath();
24394    test_ret += test_xmlCreateURI();
24395    test_ret += test_xmlNormalizeURIPath();
24396    test_ret += test_xmlParseURI();
24397    test_ret += test_xmlParseURIRaw();
24398    test_ret += test_xmlParseURIReference();
24399    test_ret += test_xmlPathToURI();
24400    test_ret += test_xmlPrintURI();
24401    test_ret += test_xmlSaveUri();
24402    test_ret += test_xmlURIEscape();
24403    test_ret += test_xmlURIEscapeStr();
24404    test_ret += test_xmlURIUnescapeString();
24405
24406    if (test_ret != 0)
24407	printf("Module uri: %d errors\n", test_ret);
24408    return(test_ret);
24409}
24410
24411static int
24412test_xmlAddAttributeDecl(void) {
24413    int test_ret = 0;
24414
24415    int mem_base;
24416    xmlAttributePtr ret_val;
24417    xmlValidCtxtPtr ctxt; /* the validation context */
24418    int n_ctxt;
24419    xmlDtdPtr dtd; /* pointer to the DTD */
24420    int n_dtd;
24421    xmlChar * elem; /* the element name */
24422    int n_elem;
24423    xmlChar * name; /* the attribute name */
24424    int n_name;
24425    xmlChar * ns; /* the attribute namespace prefix */
24426    int n_ns;
24427    xmlAttributeType type; /* the attribute type */
24428    int n_type;
24429    xmlAttributeDefault def; /* the attribute default type */
24430    int n_def;
24431    xmlChar * defaultValue; /* the attribute default value */
24432    int n_defaultValue;
24433    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24434    int n_tree;
24435
24436    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24437    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24438    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24439    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24440    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24441    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24442    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24443    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24444    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24445        mem_base = xmlMemBlocks();
24446        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24447        dtd = gen_xmlDtdPtr(n_dtd, 1);
24448        elem = gen_const_xmlChar_ptr(n_elem, 2);
24449        name = gen_const_xmlChar_ptr(n_name, 3);
24450        ns = gen_const_xmlChar_ptr(n_ns, 4);
24451        type = gen_xmlAttributeType(n_type, 5);
24452        def = gen_xmlAttributeDefault(n_def, 6);
24453        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24454        tree = gen_xmlEnumerationPtr(n_tree, 8);
24455
24456        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24457        desret_xmlAttributePtr(ret_val);
24458        call_tests++;
24459        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24460        des_xmlDtdPtr(n_dtd, dtd, 1);
24461        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24462        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24463        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24464        des_xmlAttributeType(n_type, type, 5);
24465        des_xmlAttributeDefault(n_def, def, 6);
24466        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24467        des_xmlEnumerationPtr(n_tree, tree, 8);
24468        xmlResetLastError();
24469        if (mem_base != xmlMemBlocks()) {
24470            printf("Leak of %d blocks found in xmlAddAttributeDecl",
24471	           xmlMemBlocks() - mem_base);
24472	    test_ret++;
24473            printf(" %d", n_ctxt);
24474            printf(" %d", n_dtd);
24475            printf(" %d", n_elem);
24476            printf(" %d", n_name);
24477            printf(" %d", n_ns);
24478            printf(" %d", n_type);
24479            printf(" %d", n_def);
24480            printf(" %d", n_defaultValue);
24481            printf(" %d", n_tree);
24482            printf("\n");
24483        }
24484    }
24485    }
24486    }
24487    }
24488    }
24489    }
24490    }
24491    }
24492    }
24493    function_tests++;
24494
24495    return(test_ret);
24496}
24497
24498
24499static int
24500test_xmlAddElementDecl(void) {
24501    int test_ret = 0;
24502
24503    int mem_base;
24504    xmlElementPtr ret_val;
24505    xmlValidCtxtPtr ctxt; /* the validation context */
24506    int n_ctxt;
24507    xmlDtdPtr dtd; /* pointer to the DTD */
24508    int n_dtd;
24509    xmlChar * name; /* the entity name */
24510    int n_name;
24511    xmlElementTypeVal type; /* the element type */
24512    int n_type;
24513    xmlElementContentPtr content; /* the element content tree or NULL */
24514    int n_content;
24515
24516    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24517    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24518    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24519    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24520    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24521        mem_base = xmlMemBlocks();
24522        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24523        dtd = gen_xmlDtdPtr(n_dtd, 1);
24524        name = gen_const_xmlChar_ptr(n_name, 2);
24525        type = gen_xmlElementTypeVal(n_type, 3);
24526        content = gen_xmlElementContentPtr(n_content, 4);
24527
24528        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24529        desret_xmlElementPtr(ret_val);
24530        call_tests++;
24531        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24532        des_xmlDtdPtr(n_dtd, dtd, 1);
24533        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24534        des_xmlElementTypeVal(n_type, type, 3);
24535        des_xmlElementContentPtr(n_content, content, 4);
24536        xmlResetLastError();
24537        if (mem_base != xmlMemBlocks()) {
24538            printf("Leak of %d blocks found in xmlAddElementDecl",
24539	           xmlMemBlocks() - mem_base);
24540	    test_ret++;
24541            printf(" %d", n_ctxt);
24542            printf(" %d", n_dtd);
24543            printf(" %d", n_name);
24544            printf(" %d", n_type);
24545            printf(" %d", n_content);
24546            printf("\n");
24547        }
24548    }
24549    }
24550    }
24551    }
24552    }
24553    function_tests++;
24554
24555    return(test_ret);
24556}
24557
24558
24559static int
24560test_xmlAddID(void) {
24561    int test_ret = 0;
24562
24563
24564    /* missing type support */
24565    return(test_ret);
24566}
24567
24568
24569static int
24570test_xmlAddNotationDecl(void) {
24571    int test_ret = 0;
24572
24573
24574    /* missing type support */
24575    return(test_ret);
24576}
24577
24578
24579static int
24580test_xmlAddRef(void) {
24581    int test_ret = 0;
24582
24583
24584    /* missing type support */
24585    return(test_ret);
24586}
24587
24588
24589#define gen_nb_xmlAttributeTablePtr 1
24590static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24591    return(NULL);
24592}
24593static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24594}
24595
24596static int
24597test_xmlCopyAttributeTable(void) {
24598    int test_ret = 0;
24599
24600
24601    /* missing type support */
24602    return(test_ret);
24603}
24604
24605
24606static int
24607test_xmlCopyDocElementContent(void) {
24608    int test_ret = 0;
24609
24610    int mem_base;
24611    xmlElementContentPtr ret_val;
24612    xmlDocPtr doc; /* the document owning the element declaration */
24613    int n_doc;
24614    xmlElementContentPtr cur; /* An element content pointer. */
24615    int n_cur;
24616
24617    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24618    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24619        mem_base = xmlMemBlocks();
24620        doc = gen_xmlDocPtr(n_doc, 0);
24621        cur = gen_xmlElementContentPtr(n_cur, 1);
24622
24623        ret_val = xmlCopyDocElementContent(doc, cur);
24624        desret_xmlElementContentPtr(ret_val);
24625        call_tests++;
24626        des_xmlDocPtr(n_doc, doc, 0);
24627        des_xmlElementContentPtr(n_cur, cur, 1);
24628        xmlResetLastError();
24629        if (mem_base != xmlMemBlocks()) {
24630            printf("Leak of %d blocks found in xmlCopyDocElementContent",
24631	           xmlMemBlocks() - mem_base);
24632	    test_ret++;
24633            printf(" %d", n_doc);
24634            printf(" %d", n_cur);
24635            printf("\n");
24636        }
24637    }
24638    }
24639    function_tests++;
24640
24641    return(test_ret);
24642}
24643
24644
24645static int
24646test_xmlCopyElementContent(void) {
24647    int test_ret = 0;
24648
24649    int mem_base;
24650    xmlElementContentPtr ret_val;
24651    xmlElementContentPtr cur; /* An element content pointer. */
24652    int n_cur;
24653
24654    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24655        mem_base = xmlMemBlocks();
24656        cur = gen_xmlElementContentPtr(n_cur, 0);
24657
24658        ret_val = xmlCopyElementContent(cur);
24659        desret_xmlElementContentPtr(ret_val);
24660        call_tests++;
24661        des_xmlElementContentPtr(n_cur, cur, 0);
24662        xmlResetLastError();
24663        if (mem_base != xmlMemBlocks()) {
24664            printf("Leak of %d blocks found in xmlCopyElementContent",
24665	           xmlMemBlocks() - mem_base);
24666	    test_ret++;
24667            printf(" %d", n_cur);
24668            printf("\n");
24669        }
24670    }
24671    function_tests++;
24672
24673    return(test_ret);
24674}
24675
24676
24677#define gen_nb_xmlElementTablePtr 1
24678static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24679    return(NULL);
24680}
24681static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24682}
24683
24684static int
24685test_xmlCopyElementTable(void) {
24686    int test_ret = 0;
24687
24688
24689    /* missing type support */
24690    return(test_ret);
24691}
24692
24693
24694static int
24695test_xmlCopyEnumeration(void) {
24696    int test_ret = 0;
24697
24698
24699    /* missing type support */
24700    return(test_ret);
24701}
24702
24703
24704#define gen_nb_xmlNotationTablePtr 1
24705static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24706    return(NULL);
24707}
24708static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24709}
24710
24711static int
24712test_xmlCopyNotationTable(void) {
24713    int test_ret = 0;
24714
24715
24716    /* missing type support */
24717    return(test_ret);
24718}
24719
24720
24721static int
24722test_xmlCreateEnumeration(void) {
24723    int test_ret = 0;
24724
24725
24726    /* missing type support */
24727    return(test_ret);
24728}
24729
24730
24731#define gen_nb_xmlAttributePtr 1
24732static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24733    return(NULL);
24734}
24735static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24736}
24737
24738static int
24739test_xmlDumpAttributeDecl(void) {
24740    int test_ret = 0;
24741
24742#if defined(LIBXML_OUTPUT_ENABLED)
24743    int mem_base;
24744    xmlBufferPtr buf; /* the XML buffer output */
24745    int n_buf;
24746    xmlAttributePtr attr; /* An attribute declaration */
24747    int n_attr;
24748
24749    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24750    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24751        mem_base = xmlMemBlocks();
24752        buf = gen_xmlBufferPtr(n_buf, 0);
24753        attr = gen_xmlAttributePtr(n_attr, 1);
24754
24755        xmlDumpAttributeDecl(buf, attr);
24756        call_tests++;
24757        des_xmlBufferPtr(n_buf, buf, 0);
24758        des_xmlAttributePtr(n_attr, attr, 1);
24759        xmlResetLastError();
24760        if (mem_base != xmlMemBlocks()) {
24761            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24762	           xmlMemBlocks() - mem_base);
24763	    test_ret++;
24764            printf(" %d", n_buf);
24765            printf(" %d", n_attr);
24766            printf("\n");
24767        }
24768    }
24769    }
24770    function_tests++;
24771#endif
24772
24773    return(test_ret);
24774}
24775
24776
24777static int
24778test_xmlDumpAttributeTable(void) {
24779    int test_ret = 0;
24780
24781#if defined(LIBXML_OUTPUT_ENABLED)
24782    int mem_base;
24783    xmlBufferPtr buf; /* the XML buffer output */
24784    int n_buf;
24785    xmlAttributeTablePtr table; /* An attribute table */
24786    int n_table;
24787
24788    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24789    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24790        mem_base = xmlMemBlocks();
24791        buf = gen_xmlBufferPtr(n_buf, 0);
24792        table = gen_xmlAttributeTablePtr(n_table, 1);
24793
24794        xmlDumpAttributeTable(buf, table);
24795        call_tests++;
24796        des_xmlBufferPtr(n_buf, buf, 0);
24797        des_xmlAttributeTablePtr(n_table, table, 1);
24798        xmlResetLastError();
24799        if (mem_base != xmlMemBlocks()) {
24800            printf("Leak of %d blocks found in xmlDumpAttributeTable",
24801	           xmlMemBlocks() - mem_base);
24802	    test_ret++;
24803            printf(" %d", n_buf);
24804            printf(" %d", n_table);
24805            printf("\n");
24806        }
24807    }
24808    }
24809    function_tests++;
24810#endif
24811
24812    return(test_ret);
24813}
24814
24815
24816#define gen_nb_xmlElementPtr 1
24817static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24818    return(NULL);
24819}
24820static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24821}
24822
24823static int
24824test_xmlDumpElementDecl(void) {
24825    int test_ret = 0;
24826
24827#if defined(LIBXML_OUTPUT_ENABLED)
24828    int mem_base;
24829    xmlBufferPtr buf; /* the XML buffer output */
24830    int n_buf;
24831    xmlElementPtr elem; /* An element table */
24832    int n_elem;
24833
24834    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24835    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24836        mem_base = xmlMemBlocks();
24837        buf = gen_xmlBufferPtr(n_buf, 0);
24838        elem = gen_xmlElementPtr(n_elem, 1);
24839
24840        xmlDumpElementDecl(buf, elem);
24841        call_tests++;
24842        des_xmlBufferPtr(n_buf, buf, 0);
24843        des_xmlElementPtr(n_elem, elem, 1);
24844        xmlResetLastError();
24845        if (mem_base != xmlMemBlocks()) {
24846            printf("Leak of %d blocks found in xmlDumpElementDecl",
24847	           xmlMemBlocks() - mem_base);
24848	    test_ret++;
24849            printf(" %d", n_buf);
24850            printf(" %d", n_elem);
24851            printf("\n");
24852        }
24853    }
24854    }
24855    function_tests++;
24856#endif
24857
24858    return(test_ret);
24859}
24860
24861
24862static int
24863test_xmlDumpElementTable(void) {
24864    int test_ret = 0;
24865
24866#if defined(LIBXML_OUTPUT_ENABLED)
24867    int mem_base;
24868    xmlBufferPtr buf; /* the XML buffer output */
24869    int n_buf;
24870    xmlElementTablePtr table; /* An element table */
24871    int n_table;
24872
24873    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24874    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24875        mem_base = xmlMemBlocks();
24876        buf = gen_xmlBufferPtr(n_buf, 0);
24877        table = gen_xmlElementTablePtr(n_table, 1);
24878
24879        xmlDumpElementTable(buf, table);
24880        call_tests++;
24881        des_xmlBufferPtr(n_buf, buf, 0);
24882        des_xmlElementTablePtr(n_table, table, 1);
24883        xmlResetLastError();
24884        if (mem_base != xmlMemBlocks()) {
24885            printf("Leak of %d blocks found in xmlDumpElementTable",
24886	           xmlMemBlocks() - mem_base);
24887	    test_ret++;
24888            printf(" %d", n_buf);
24889            printf(" %d", n_table);
24890            printf("\n");
24891        }
24892    }
24893    }
24894    function_tests++;
24895#endif
24896
24897    return(test_ret);
24898}
24899
24900
24901#define gen_nb_xmlNotationPtr 1
24902static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24903    return(NULL);
24904}
24905static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24906}
24907
24908static int
24909test_xmlDumpNotationDecl(void) {
24910    int test_ret = 0;
24911
24912#if defined(LIBXML_OUTPUT_ENABLED)
24913    int mem_base;
24914    xmlBufferPtr buf; /* the XML buffer output */
24915    int n_buf;
24916    xmlNotationPtr nota; /* A notation declaration */
24917    int n_nota;
24918
24919    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24920    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24921        mem_base = xmlMemBlocks();
24922        buf = gen_xmlBufferPtr(n_buf, 0);
24923        nota = gen_xmlNotationPtr(n_nota, 1);
24924
24925        xmlDumpNotationDecl(buf, nota);
24926        call_tests++;
24927        des_xmlBufferPtr(n_buf, buf, 0);
24928        des_xmlNotationPtr(n_nota, nota, 1);
24929        xmlResetLastError();
24930        if (mem_base != xmlMemBlocks()) {
24931            printf("Leak of %d blocks found in xmlDumpNotationDecl",
24932	           xmlMemBlocks() - mem_base);
24933	    test_ret++;
24934            printf(" %d", n_buf);
24935            printf(" %d", n_nota);
24936            printf("\n");
24937        }
24938    }
24939    }
24940    function_tests++;
24941#endif
24942
24943    return(test_ret);
24944}
24945
24946
24947static int
24948test_xmlDumpNotationTable(void) {
24949    int test_ret = 0;
24950
24951#if defined(LIBXML_OUTPUT_ENABLED)
24952    int mem_base;
24953    xmlBufferPtr buf; /* the XML buffer output */
24954    int n_buf;
24955    xmlNotationTablePtr table; /* A notation table */
24956    int n_table;
24957
24958    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24959    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24960        mem_base = xmlMemBlocks();
24961        buf = gen_xmlBufferPtr(n_buf, 0);
24962        table = gen_xmlNotationTablePtr(n_table, 1);
24963
24964        xmlDumpNotationTable(buf, table);
24965        call_tests++;
24966        des_xmlBufferPtr(n_buf, buf, 0);
24967        des_xmlNotationTablePtr(n_table, table, 1);
24968        xmlResetLastError();
24969        if (mem_base != xmlMemBlocks()) {
24970            printf("Leak of %d blocks found in xmlDumpNotationTable",
24971	           xmlMemBlocks() - mem_base);
24972	    test_ret++;
24973            printf(" %d", n_buf);
24974            printf(" %d", n_table);
24975            printf("\n");
24976        }
24977    }
24978    }
24979    function_tests++;
24980#endif
24981
24982    return(test_ret);
24983}
24984
24985
24986static int
24987test_xmlGetDtdAttrDesc(void) {
24988    int test_ret = 0;
24989
24990    int mem_base;
24991    xmlAttributePtr ret_val;
24992    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24993    int n_dtd;
24994    xmlChar * elem; /* the element name */
24995    int n_elem;
24996    xmlChar * name; /* the attribute name */
24997    int n_name;
24998
24999    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25000    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25001    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25002        mem_base = xmlMemBlocks();
25003        dtd = gen_xmlDtdPtr(n_dtd, 0);
25004        elem = gen_const_xmlChar_ptr(n_elem, 1);
25005        name = gen_const_xmlChar_ptr(n_name, 2);
25006
25007        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25008        desret_xmlAttributePtr(ret_val);
25009        call_tests++;
25010        des_xmlDtdPtr(n_dtd, dtd, 0);
25011        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25012        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25013        xmlResetLastError();
25014        if (mem_base != xmlMemBlocks()) {
25015            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25016	           xmlMemBlocks() - mem_base);
25017	    test_ret++;
25018            printf(" %d", n_dtd);
25019            printf(" %d", n_elem);
25020            printf(" %d", n_name);
25021            printf("\n");
25022        }
25023    }
25024    }
25025    }
25026    function_tests++;
25027
25028    return(test_ret);
25029}
25030
25031
25032static int
25033test_xmlGetDtdElementDesc(void) {
25034    int test_ret = 0;
25035
25036    int mem_base;
25037    xmlElementPtr ret_val;
25038    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25039    int n_dtd;
25040    xmlChar * name; /* the element name */
25041    int n_name;
25042
25043    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25044    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25045        mem_base = xmlMemBlocks();
25046        dtd = gen_xmlDtdPtr(n_dtd, 0);
25047        name = gen_const_xmlChar_ptr(n_name, 1);
25048
25049        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25050        desret_xmlElementPtr(ret_val);
25051        call_tests++;
25052        des_xmlDtdPtr(n_dtd, dtd, 0);
25053        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25054        xmlResetLastError();
25055        if (mem_base != xmlMemBlocks()) {
25056            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25057	           xmlMemBlocks() - mem_base);
25058	    test_ret++;
25059            printf(" %d", n_dtd);
25060            printf(" %d", n_name);
25061            printf("\n");
25062        }
25063    }
25064    }
25065    function_tests++;
25066
25067    return(test_ret);
25068}
25069
25070
25071static int
25072test_xmlGetDtdNotationDesc(void) {
25073    int test_ret = 0;
25074
25075
25076    /* missing type support */
25077    return(test_ret);
25078}
25079
25080
25081static int
25082test_xmlGetDtdQAttrDesc(void) {
25083    int test_ret = 0;
25084
25085    int mem_base;
25086    xmlAttributePtr ret_val;
25087    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25088    int n_dtd;
25089    xmlChar * elem; /* the element name */
25090    int n_elem;
25091    xmlChar * name; /* the attribute name */
25092    int n_name;
25093    xmlChar * prefix; /* the attribute namespace prefix */
25094    int n_prefix;
25095
25096    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25097    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25098    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25099    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25100        mem_base = xmlMemBlocks();
25101        dtd = gen_xmlDtdPtr(n_dtd, 0);
25102        elem = gen_const_xmlChar_ptr(n_elem, 1);
25103        name = gen_const_xmlChar_ptr(n_name, 2);
25104        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25105
25106        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25107        desret_xmlAttributePtr(ret_val);
25108        call_tests++;
25109        des_xmlDtdPtr(n_dtd, dtd, 0);
25110        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25111        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25112        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25113        xmlResetLastError();
25114        if (mem_base != xmlMemBlocks()) {
25115            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25116	           xmlMemBlocks() - mem_base);
25117	    test_ret++;
25118            printf(" %d", n_dtd);
25119            printf(" %d", n_elem);
25120            printf(" %d", n_name);
25121            printf(" %d", n_prefix);
25122            printf("\n");
25123        }
25124    }
25125    }
25126    }
25127    }
25128    function_tests++;
25129
25130    return(test_ret);
25131}
25132
25133
25134static int
25135test_xmlGetDtdQElementDesc(void) {
25136    int test_ret = 0;
25137
25138    int mem_base;
25139    xmlElementPtr ret_val;
25140    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25141    int n_dtd;
25142    xmlChar * name; /* the element name */
25143    int n_name;
25144    xmlChar * prefix; /* the element namespace prefix */
25145    int n_prefix;
25146
25147    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25148    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25149    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25150        mem_base = xmlMemBlocks();
25151        dtd = gen_xmlDtdPtr(n_dtd, 0);
25152        name = gen_const_xmlChar_ptr(n_name, 1);
25153        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25154
25155        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25156        desret_xmlElementPtr(ret_val);
25157        call_tests++;
25158        des_xmlDtdPtr(n_dtd, dtd, 0);
25159        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25160        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25161        xmlResetLastError();
25162        if (mem_base != xmlMemBlocks()) {
25163            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25164	           xmlMemBlocks() - mem_base);
25165	    test_ret++;
25166            printf(" %d", n_dtd);
25167            printf(" %d", n_name);
25168            printf(" %d", n_prefix);
25169            printf("\n");
25170        }
25171    }
25172    }
25173    }
25174    function_tests++;
25175
25176    return(test_ret);
25177}
25178
25179
25180static int
25181test_xmlGetID(void) {
25182    int test_ret = 0;
25183
25184    int mem_base;
25185    xmlAttrPtr ret_val;
25186    xmlDocPtr doc; /* pointer to the document */
25187    int n_doc;
25188    xmlChar * ID; /* the ID value */
25189    int n_ID;
25190
25191    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25192    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25193        mem_base = xmlMemBlocks();
25194        doc = gen_xmlDocPtr(n_doc, 0);
25195        ID = gen_const_xmlChar_ptr(n_ID, 1);
25196
25197        ret_val = xmlGetID(doc, (const xmlChar *)ID);
25198        desret_xmlAttrPtr(ret_val);
25199        call_tests++;
25200        des_xmlDocPtr(n_doc, doc, 0);
25201        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25202        xmlResetLastError();
25203        if (mem_base != xmlMemBlocks()) {
25204            printf("Leak of %d blocks found in xmlGetID",
25205	           xmlMemBlocks() - mem_base);
25206	    test_ret++;
25207            printf(" %d", n_doc);
25208            printf(" %d", n_ID);
25209            printf("\n");
25210        }
25211    }
25212    }
25213    function_tests++;
25214
25215    return(test_ret);
25216}
25217
25218
25219static int
25220test_xmlGetRefs(void) {
25221    int test_ret = 0;
25222
25223
25224    /* missing type support */
25225    return(test_ret);
25226}
25227
25228
25229static int
25230test_xmlIsID(void) {
25231    int test_ret = 0;
25232
25233    int mem_base;
25234    int ret_val;
25235    xmlDocPtr doc; /* the document */
25236    int n_doc;
25237    xmlNodePtr elem; /* the element carrying the attribute */
25238    int n_elem;
25239    xmlAttrPtr attr; /* the attribute */
25240    int n_attr;
25241
25242    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25243    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25244    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25245        mem_base = xmlMemBlocks();
25246        doc = gen_xmlDocPtr(n_doc, 0);
25247        elem = gen_xmlNodePtr(n_elem, 1);
25248        attr = gen_xmlAttrPtr(n_attr, 2);
25249
25250        ret_val = xmlIsID(doc, elem, attr);
25251        desret_int(ret_val);
25252        call_tests++;
25253        des_xmlDocPtr(n_doc, doc, 0);
25254        des_xmlNodePtr(n_elem, elem, 1);
25255        des_xmlAttrPtr(n_attr, attr, 2);
25256        xmlResetLastError();
25257        if (mem_base != xmlMemBlocks()) {
25258            printf("Leak of %d blocks found in xmlIsID",
25259	           xmlMemBlocks() - mem_base);
25260	    test_ret++;
25261            printf(" %d", n_doc);
25262            printf(" %d", n_elem);
25263            printf(" %d", n_attr);
25264            printf("\n");
25265        }
25266    }
25267    }
25268    }
25269    function_tests++;
25270
25271    return(test_ret);
25272}
25273
25274
25275static int
25276test_xmlIsMixedElement(void) {
25277    int test_ret = 0;
25278
25279    int mem_base;
25280    int ret_val;
25281    xmlDocPtr doc; /* the document */
25282    int n_doc;
25283    xmlChar * name; /* the element name */
25284    int n_name;
25285
25286    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25287    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25288        mem_base = xmlMemBlocks();
25289        doc = gen_xmlDocPtr(n_doc, 0);
25290        name = gen_const_xmlChar_ptr(n_name, 1);
25291
25292        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25293        desret_int(ret_val);
25294        call_tests++;
25295        des_xmlDocPtr(n_doc, doc, 0);
25296        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25297        xmlResetLastError();
25298        if (mem_base != xmlMemBlocks()) {
25299            printf("Leak of %d blocks found in xmlIsMixedElement",
25300	           xmlMemBlocks() - mem_base);
25301	    test_ret++;
25302            printf(" %d", n_doc);
25303            printf(" %d", n_name);
25304            printf("\n");
25305        }
25306    }
25307    }
25308    function_tests++;
25309
25310    return(test_ret);
25311}
25312
25313
25314static int
25315test_xmlIsRef(void) {
25316    int test_ret = 0;
25317
25318    int mem_base;
25319    int ret_val;
25320    xmlDocPtr doc; /* the document */
25321    int n_doc;
25322    xmlNodePtr elem; /* the element carrying the attribute */
25323    int n_elem;
25324    xmlAttrPtr attr; /* the attribute */
25325    int n_attr;
25326
25327    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25328    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25329    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25330        mem_base = xmlMemBlocks();
25331        doc = gen_xmlDocPtr(n_doc, 0);
25332        elem = gen_xmlNodePtr(n_elem, 1);
25333        attr = gen_xmlAttrPtr(n_attr, 2);
25334
25335        ret_val = xmlIsRef(doc, elem, attr);
25336        desret_int(ret_val);
25337        call_tests++;
25338        des_xmlDocPtr(n_doc, doc, 0);
25339        des_xmlNodePtr(n_elem, elem, 1);
25340        des_xmlAttrPtr(n_attr, attr, 2);
25341        xmlResetLastError();
25342        if (mem_base != xmlMemBlocks()) {
25343            printf("Leak of %d blocks found in xmlIsRef",
25344	           xmlMemBlocks() - mem_base);
25345	    test_ret++;
25346            printf(" %d", n_doc);
25347            printf(" %d", n_elem);
25348            printf(" %d", n_attr);
25349            printf("\n");
25350        }
25351    }
25352    }
25353    }
25354    function_tests++;
25355
25356    return(test_ret);
25357}
25358
25359
25360static int
25361test_xmlNewDocElementContent(void) {
25362    int test_ret = 0;
25363
25364    int mem_base;
25365    xmlElementContentPtr ret_val;
25366    xmlDocPtr doc; /* the document */
25367    int n_doc;
25368    xmlChar * name; /* the subelement name or NULL */
25369    int n_name;
25370    xmlElementContentType type; /* the type of element content decl */
25371    int n_type;
25372
25373    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25374    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25375    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25376        mem_base = xmlMemBlocks();
25377        doc = gen_xmlDocPtr(n_doc, 0);
25378        name = gen_const_xmlChar_ptr(n_name, 1);
25379        type = gen_xmlElementContentType(n_type, 2);
25380
25381        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25382        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25383        desret_xmlElementContentPtr(ret_val);
25384        call_tests++;
25385        des_xmlDocPtr(n_doc, doc, 0);
25386        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25387        des_xmlElementContentType(n_type, type, 2);
25388        xmlResetLastError();
25389        if (mem_base != xmlMemBlocks()) {
25390            printf("Leak of %d blocks found in xmlNewDocElementContent",
25391	           xmlMemBlocks() - mem_base);
25392	    test_ret++;
25393            printf(" %d", n_doc);
25394            printf(" %d", n_name);
25395            printf(" %d", n_type);
25396            printf("\n");
25397        }
25398    }
25399    }
25400    }
25401    function_tests++;
25402
25403    return(test_ret);
25404}
25405
25406
25407static int
25408test_xmlNewElementContent(void) {
25409    int test_ret = 0;
25410
25411    int mem_base;
25412    xmlElementContentPtr ret_val;
25413    xmlChar * name; /* the subelement name or NULL */
25414    int n_name;
25415    xmlElementContentType type; /* the type of element content decl */
25416    int n_type;
25417
25418    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25419    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25420        mem_base = xmlMemBlocks();
25421        name = gen_const_xmlChar_ptr(n_name, 0);
25422        type = gen_xmlElementContentType(n_type, 1);
25423
25424        ret_val = xmlNewElementContent((const xmlChar *)name, type);
25425        desret_xmlElementContentPtr(ret_val);
25426        call_tests++;
25427        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25428        des_xmlElementContentType(n_type, type, 1);
25429        xmlResetLastError();
25430        if (mem_base != xmlMemBlocks()) {
25431            printf("Leak of %d blocks found in xmlNewElementContent",
25432	           xmlMemBlocks() - mem_base);
25433	    test_ret++;
25434            printf(" %d", n_name);
25435            printf(" %d", n_type);
25436            printf("\n");
25437        }
25438    }
25439    }
25440    function_tests++;
25441
25442    return(test_ret);
25443}
25444
25445
25446static int
25447test_xmlNewValidCtxt(void) {
25448    int test_ret = 0;
25449
25450
25451    /* missing type support */
25452    return(test_ret);
25453}
25454
25455
25456static int
25457test_xmlRemoveID(void) {
25458    int test_ret = 0;
25459
25460    int mem_base;
25461    int ret_val;
25462    xmlDocPtr doc; /* the document */
25463    int n_doc;
25464    xmlAttrPtr attr; /* the attribute */
25465    int n_attr;
25466
25467    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25468    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25469        mem_base = xmlMemBlocks();
25470        doc = gen_xmlDocPtr(n_doc, 0);
25471        attr = gen_xmlAttrPtr(n_attr, 1);
25472
25473        ret_val = xmlRemoveID(doc, attr);
25474        desret_int(ret_val);
25475        call_tests++;
25476        des_xmlDocPtr(n_doc, doc, 0);
25477        des_xmlAttrPtr(n_attr, attr, 1);
25478        xmlResetLastError();
25479        if (mem_base != xmlMemBlocks()) {
25480            printf("Leak of %d blocks found in xmlRemoveID",
25481	           xmlMemBlocks() - mem_base);
25482	    test_ret++;
25483            printf(" %d", n_doc);
25484            printf(" %d", n_attr);
25485            printf("\n");
25486        }
25487    }
25488    }
25489    function_tests++;
25490
25491    return(test_ret);
25492}
25493
25494
25495static int
25496test_xmlRemoveRef(void) {
25497    int test_ret = 0;
25498
25499    int mem_base;
25500    int ret_val;
25501    xmlDocPtr doc; /* the document */
25502    int n_doc;
25503    xmlAttrPtr attr; /* the attribute */
25504    int n_attr;
25505
25506    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25507    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25508        mem_base = xmlMemBlocks();
25509        doc = gen_xmlDocPtr(n_doc, 0);
25510        attr = gen_xmlAttrPtr(n_attr, 1);
25511
25512        ret_val = xmlRemoveRef(doc, attr);
25513        desret_int(ret_val);
25514        call_tests++;
25515        des_xmlDocPtr(n_doc, doc, 0);
25516        des_xmlAttrPtr(n_attr, attr, 1);
25517        xmlResetLastError();
25518        if (mem_base != xmlMemBlocks()) {
25519            printf("Leak of %d blocks found in xmlRemoveRef",
25520	           xmlMemBlocks() - mem_base);
25521	    test_ret++;
25522            printf(" %d", n_doc);
25523            printf(" %d", n_attr);
25524            printf("\n");
25525        }
25526    }
25527    }
25528    function_tests++;
25529
25530    return(test_ret);
25531}
25532
25533
25534static int
25535test_xmlSnprintfElementContent(void) {
25536    int test_ret = 0;
25537
25538    int mem_base;
25539    char * buf; /* an output buffer */
25540    int n_buf;
25541    int size; /* the buffer size */
25542    int n_size;
25543    xmlElementContentPtr content; /* An element table */
25544    int n_content;
25545    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25546    int n_englob;
25547
25548    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25549    for (n_size = 0;n_size < gen_nb_int;n_size++) {
25550    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25551    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25552        mem_base = xmlMemBlocks();
25553        buf = gen_char_ptr(n_buf, 0);
25554        size = gen_int(n_size, 1);
25555        content = gen_xmlElementContentPtr(n_content, 2);
25556        englob = gen_int(n_englob, 3);
25557
25558        xmlSnprintfElementContent(buf, size, content, englob);
25559        call_tests++;
25560        des_char_ptr(n_buf, buf, 0);
25561        des_int(n_size, size, 1);
25562        des_xmlElementContentPtr(n_content, content, 2);
25563        des_int(n_englob, englob, 3);
25564        xmlResetLastError();
25565        if (mem_base != xmlMemBlocks()) {
25566            printf("Leak of %d blocks found in xmlSnprintfElementContent",
25567	           xmlMemBlocks() - mem_base);
25568	    test_ret++;
25569            printf(" %d", n_buf);
25570            printf(" %d", n_size);
25571            printf(" %d", n_content);
25572            printf(" %d", n_englob);
25573            printf("\n");
25574        }
25575    }
25576    }
25577    }
25578    }
25579    function_tests++;
25580
25581    return(test_ret);
25582}
25583
25584
25585static int
25586test_xmlSprintfElementContent(void) {
25587    int test_ret = 0;
25588
25589#if defined(LIBXML_OUTPUT_ENABLED)
25590#ifdef LIBXML_OUTPUT_ENABLED
25591    int mem_base;
25592    char * buf; /* an output buffer */
25593    int n_buf;
25594    xmlElementContentPtr content; /* An element table */
25595    int n_content;
25596    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25597    int n_englob;
25598
25599    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25600    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25601    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25602        mem_base = xmlMemBlocks();
25603        buf = gen_char_ptr(n_buf, 0);
25604        content = gen_xmlElementContentPtr(n_content, 1);
25605        englob = gen_int(n_englob, 2);
25606
25607        xmlSprintfElementContent(buf, content, englob);
25608        call_tests++;
25609        des_char_ptr(n_buf, buf, 0);
25610        des_xmlElementContentPtr(n_content, content, 1);
25611        des_int(n_englob, englob, 2);
25612        xmlResetLastError();
25613        if (mem_base != xmlMemBlocks()) {
25614            printf("Leak of %d blocks found in xmlSprintfElementContent",
25615	           xmlMemBlocks() - mem_base);
25616	    test_ret++;
25617            printf(" %d", n_buf);
25618            printf(" %d", n_content);
25619            printf(" %d", n_englob);
25620            printf("\n");
25621        }
25622    }
25623    }
25624    }
25625    function_tests++;
25626#endif
25627#endif
25628
25629    return(test_ret);
25630}
25631
25632
25633static int
25634test_xmlValidBuildContentModel(void) {
25635    int test_ret = 0;
25636
25637#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25638    int mem_base;
25639    int ret_val;
25640    xmlValidCtxtPtr ctxt; /* a validation context */
25641    int n_ctxt;
25642    xmlElementPtr elem; /* an element declaration node */
25643    int n_elem;
25644
25645    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25646    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25647        mem_base = xmlMemBlocks();
25648        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25649        elem = gen_xmlElementPtr(n_elem, 1);
25650
25651        ret_val = xmlValidBuildContentModel(ctxt, elem);
25652        desret_int(ret_val);
25653        call_tests++;
25654        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25655        des_xmlElementPtr(n_elem, elem, 1);
25656        xmlResetLastError();
25657        if (mem_base != xmlMemBlocks()) {
25658            printf("Leak of %d blocks found in xmlValidBuildContentModel",
25659	           xmlMemBlocks() - mem_base);
25660	    test_ret++;
25661            printf(" %d", n_ctxt);
25662            printf(" %d", n_elem);
25663            printf("\n");
25664        }
25665    }
25666    }
25667    function_tests++;
25668#endif
25669
25670    return(test_ret);
25671}
25672
25673
25674static int
25675test_xmlValidCtxtNormalizeAttributeValue(void) {
25676    int test_ret = 0;
25677
25678#if defined(LIBXML_VALID_ENABLED)
25679    int mem_base;
25680    xmlChar * ret_val;
25681    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25682    int n_ctxt;
25683    xmlDocPtr doc; /* the document */
25684    int n_doc;
25685    xmlNodePtr elem; /* the parent */
25686    int n_elem;
25687    xmlChar * name; /* the attribute name */
25688    int n_name;
25689    xmlChar * value; /* the attribute value */
25690    int n_value;
25691
25692    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25693    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25694    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25695    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25696    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25697        mem_base = xmlMemBlocks();
25698        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25699        doc = gen_xmlDocPtr(n_doc, 1);
25700        elem = gen_xmlNodePtr(n_elem, 2);
25701        name = gen_const_xmlChar_ptr(n_name, 3);
25702        value = gen_const_xmlChar_ptr(n_value, 4);
25703
25704        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25705        desret_xmlChar_ptr(ret_val);
25706        call_tests++;
25707        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25708        des_xmlDocPtr(n_doc, doc, 1);
25709        des_xmlNodePtr(n_elem, elem, 2);
25710        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25711        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25712        xmlResetLastError();
25713        if (mem_base != xmlMemBlocks()) {
25714            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25715	           xmlMemBlocks() - mem_base);
25716	    test_ret++;
25717            printf(" %d", n_ctxt);
25718            printf(" %d", n_doc);
25719            printf(" %d", n_elem);
25720            printf(" %d", n_name);
25721            printf(" %d", n_value);
25722            printf("\n");
25723        }
25724    }
25725    }
25726    }
25727    }
25728    }
25729    function_tests++;
25730#endif
25731
25732    return(test_ret);
25733}
25734
25735
25736#define gen_nb_xmlElementContent_ptr 1
25737static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25738    return(NULL);
25739}
25740static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25741}
25742
25743static int
25744test_xmlValidGetPotentialChildren(void) {
25745    int test_ret = 0;
25746
25747#if defined(LIBXML_VALID_ENABLED)
25748#ifdef LIBXML_VALID_ENABLED
25749    int mem_base;
25750    int ret_val;
25751    xmlElementContent * ctree; /* an element content tree */
25752    int n_ctree;
25753    xmlChar ** names; /* an array to store the list of child names */
25754    int n_names;
25755    int * len; /* a pointer to the number of element in the list */
25756    int n_len;
25757    int max; /* the size of the array */
25758    int n_max;
25759
25760    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25761    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25762    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25763    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25764        mem_base = xmlMemBlocks();
25765        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25766        names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25767        len = gen_int_ptr(n_len, 2);
25768        max = gen_int(n_max, 3);
25769
25770        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25771        desret_int(ret_val);
25772        call_tests++;
25773        des_xmlElementContent_ptr(n_ctree, ctree, 0);
25774        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25775        des_int_ptr(n_len, len, 2);
25776        des_int(n_max, max, 3);
25777        xmlResetLastError();
25778        if (mem_base != xmlMemBlocks()) {
25779            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25780	           xmlMemBlocks() - mem_base);
25781	    test_ret++;
25782            printf(" %d", n_ctree);
25783            printf(" %d", n_names);
25784            printf(" %d", n_len);
25785            printf(" %d", n_max);
25786            printf("\n");
25787        }
25788    }
25789    }
25790    }
25791    }
25792    function_tests++;
25793#endif
25794#endif
25795
25796    return(test_ret);
25797}
25798
25799
25800static int
25801test_xmlValidGetValidElements(void) {
25802    int test_ret = 0;
25803
25804#if defined(LIBXML_VALID_ENABLED)
25805#ifdef LIBXML_VALID_ENABLED
25806    int mem_base;
25807    int ret_val;
25808    xmlNode * prev; /* an element to insert after */
25809    int n_prev;
25810    xmlNode * next; /* an element to insert next */
25811    int n_next;
25812    xmlChar ** names; /* an array to store the list of child names */
25813    int n_names;
25814    int max; /* the size of the array */
25815    int n_max;
25816
25817    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25818    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25819    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25820    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25821        mem_base = xmlMemBlocks();
25822        prev = gen_xmlNodePtr(n_prev, 0);
25823        next = gen_xmlNodePtr(n_next, 1);
25824        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25825        max = gen_int(n_max, 3);
25826
25827        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25828        desret_int(ret_val);
25829        call_tests++;
25830        des_xmlNodePtr(n_prev, prev, 0);
25831        des_xmlNodePtr(n_next, next, 1);
25832        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25833        des_int(n_max, max, 3);
25834        xmlResetLastError();
25835        if (mem_base != xmlMemBlocks()) {
25836            printf("Leak of %d blocks found in xmlValidGetValidElements",
25837	           xmlMemBlocks() - mem_base);
25838	    test_ret++;
25839            printf(" %d", n_prev);
25840            printf(" %d", n_next);
25841            printf(" %d", n_names);
25842            printf(" %d", n_max);
25843            printf("\n");
25844        }
25845    }
25846    }
25847    }
25848    }
25849    function_tests++;
25850#endif
25851#endif
25852
25853    return(test_ret);
25854}
25855
25856
25857static int
25858test_xmlValidNormalizeAttributeValue(void) {
25859    int test_ret = 0;
25860
25861#if defined(LIBXML_VALID_ENABLED)
25862    int mem_base;
25863    xmlChar * ret_val;
25864    xmlDocPtr doc; /* the document */
25865    int n_doc;
25866    xmlNodePtr elem; /* the parent */
25867    int n_elem;
25868    xmlChar * name; /* the attribute name */
25869    int n_name;
25870    xmlChar * value; /* the attribute value */
25871    int n_value;
25872
25873    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25874    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25875    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25876    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25877        mem_base = xmlMemBlocks();
25878        doc = gen_xmlDocPtr(n_doc, 0);
25879        elem = gen_xmlNodePtr(n_elem, 1);
25880        name = gen_const_xmlChar_ptr(n_name, 2);
25881        value = gen_const_xmlChar_ptr(n_value, 3);
25882
25883        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25884        desret_xmlChar_ptr(ret_val);
25885        call_tests++;
25886        des_xmlDocPtr(n_doc, doc, 0);
25887        des_xmlNodePtr(n_elem, elem, 1);
25888        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25889        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25890        xmlResetLastError();
25891        if (mem_base != xmlMemBlocks()) {
25892            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25893	           xmlMemBlocks() - mem_base);
25894	    test_ret++;
25895            printf(" %d", n_doc);
25896            printf(" %d", n_elem);
25897            printf(" %d", n_name);
25898            printf(" %d", n_value);
25899            printf("\n");
25900        }
25901    }
25902    }
25903    }
25904    }
25905    function_tests++;
25906#endif
25907
25908    return(test_ret);
25909}
25910
25911
25912static int
25913test_xmlValidateAttributeDecl(void) {
25914    int test_ret = 0;
25915
25916#if defined(LIBXML_VALID_ENABLED)
25917    int mem_base;
25918    int ret_val;
25919    xmlValidCtxtPtr ctxt; /* the validation context */
25920    int n_ctxt;
25921    xmlDocPtr doc; /* a document instance */
25922    int n_doc;
25923    xmlAttributePtr attr; /* an attribute definition */
25924    int n_attr;
25925
25926    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25927    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25928    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25929        mem_base = xmlMemBlocks();
25930        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25931        doc = gen_xmlDocPtr(n_doc, 1);
25932        attr = gen_xmlAttributePtr(n_attr, 2);
25933
25934        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25935        desret_int(ret_val);
25936        call_tests++;
25937        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25938        des_xmlDocPtr(n_doc, doc, 1);
25939        des_xmlAttributePtr(n_attr, attr, 2);
25940        xmlResetLastError();
25941        if (mem_base != xmlMemBlocks()) {
25942            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25943	           xmlMemBlocks() - mem_base);
25944	    test_ret++;
25945            printf(" %d", n_ctxt);
25946            printf(" %d", n_doc);
25947            printf(" %d", n_attr);
25948            printf("\n");
25949        }
25950    }
25951    }
25952    }
25953    function_tests++;
25954#endif
25955
25956    return(test_ret);
25957}
25958
25959
25960static int
25961test_xmlValidateAttributeValue(void) {
25962    int test_ret = 0;
25963
25964#if defined(LIBXML_VALID_ENABLED)
25965    int mem_base;
25966    int ret_val;
25967    xmlAttributeType type; /*  */
25968    int n_type;
25969    xmlChar * value; /*  */
25970    int n_value;
25971
25972    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25973    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25974        mem_base = xmlMemBlocks();
25975        type = gen_xmlAttributeType(n_type, 0);
25976        value = gen_const_xmlChar_ptr(n_value, 1);
25977
25978        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25979        desret_int(ret_val);
25980        call_tests++;
25981        des_xmlAttributeType(n_type, type, 0);
25982        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25983        xmlResetLastError();
25984        if (mem_base != xmlMemBlocks()) {
25985            printf("Leak of %d blocks found in xmlValidateAttributeValue",
25986	           xmlMemBlocks() - mem_base);
25987	    test_ret++;
25988            printf(" %d", n_type);
25989            printf(" %d", n_value);
25990            printf("\n");
25991        }
25992    }
25993    }
25994    function_tests++;
25995#endif
25996
25997    return(test_ret);
25998}
25999
26000
26001static int
26002test_xmlValidateDocument(void) {
26003    int test_ret = 0;
26004
26005#if defined(LIBXML_VALID_ENABLED)
26006    int mem_base;
26007    int ret_val;
26008    xmlValidCtxtPtr ctxt; /* the validation context */
26009    int n_ctxt;
26010    xmlDocPtr doc; /* a document instance */
26011    int n_doc;
26012
26013    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26014    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26015        mem_base = xmlMemBlocks();
26016        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26017        doc = gen_xmlDocPtr(n_doc, 1);
26018
26019        ret_val = xmlValidateDocument(ctxt, doc);
26020        desret_int(ret_val);
26021        call_tests++;
26022        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26023        des_xmlDocPtr(n_doc, doc, 1);
26024        xmlResetLastError();
26025        if (mem_base != xmlMemBlocks()) {
26026            printf("Leak of %d blocks found in xmlValidateDocument",
26027	           xmlMemBlocks() - mem_base);
26028	    test_ret++;
26029            printf(" %d", n_ctxt);
26030            printf(" %d", n_doc);
26031            printf("\n");
26032        }
26033    }
26034    }
26035    function_tests++;
26036#endif
26037
26038    return(test_ret);
26039}
26040
26041
26042static int
26043test_xmlValidateDocumentFinal(void) {
26044    int test_ret = 0;
26045
26046#if defined(LIBXML_VALID_ENABLED)
26047    int mem_base;
26048    int ret_val;
26049    xmlValidCtxtPtr ctxt; /* the validation context */
26050    int n_ctxt;
26051    xmlDocPtr doc; /* a document instance */
26052    int n_doc;
26053
26054    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26055    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26056        mem_base = xmlMemBlocks();
26057        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26058        doc = gen_xmlDocPtr(n_doc, 1);
26059
26060        ret_val = xmlValidateDocumentFinal(ctxt, doc);
26061        desret_int(ret_val);
26062        call_tests++;
26063        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26064        des_xmlDocPtr(n_doc, doc, 1);
26065        xmlResetLastError();
26066        if (mem_base != xmlMemBlocks()) {
26067            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26068	           xmlMemBlocks() - mem_base);
26069	    test_ret++;
26070            printf(" %d", n_ctxt);
26071            printf(" %d", n_doc);
26072            printf("\n");
26073        }
26074    }
26075    }
26076    function_tests++;
26077#endif
26078
26079    return(test_ret);
26080}
26081
26082
26083static int
26084test_xmlValidateDtd(void) {
26085    int test_ret = 0;
26086
26087#if defined(LIBXML_VALID_ENABLED)
26088    int mem_base;
26089    int ret_val;
26090    xmlValidCtxtPtr ctxt; /* the validation context */
26091    int n_ctxt;
26092    xmlDocPtr doc; /* a document instance */
26093    int n_doc;
26094    xmlDtdPtr dtd; /* a dtd instance */
26095    int n_dtd;
26096
26097    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26098    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26099    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26100        mem_base = xmlMemBlocks();
26101        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26102        doc = gen_xmlDocPtr(n_doc, 1);
26103        dtd = gen_xmlDtdPtr(n_dtd, 2);
26104
26105        ret_val = xmlValidateDtd(ctxt, doc, dtd);
26106        desret_int(ret_val);
26107        call_tests++;
26108        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26109        des_xmlDocPtr(n_doc, doc, 1);
26110        des_xmlDtdPtr(n_dtd, dtd, 2);
26111        xmlResetLastError();
26112        if (mem_base != xmlMemBlocks()) {
26113            printf("Leak of %d blocks found in xmlValidateDtd",
26114	           xmlMemBlocks() - mem_base);
26115	    test_ret++;
26116            printf(" %d", n_ctxt);
26117            printf(" %d", n_doc);
26118            printf(" %d", n_dtd);
26119            printf("\n");
26120        }
26121    }
26122    }
26123    }
26124    function_tests++;
26125#endif
26126
26127    return(test_ret);
26128}
26129
26130
26131static int
26132test_xmlValidateDtdFinal(void) {
26133    int test_ret = 0;
26134
26135#if defined(LIBXML_VALID_ENABLED)
26136    int mem_base;
26137    int ret_val;
26138    xmlValidCtxtPtr ctxt; /* the validation context */
26139    int n_ctxt;
26140    xmlDocPtr doc; /* a document instance */
26141    int n_doc;
26142
26143    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26144    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26145        mem_base = xmlMemBlocks();
26146        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26147        doc = gen_xmlDocPtr(n_doc, 1);
26148
26149        ret_val = xmlValidateDtdFinal(ctxt, doc);
26150        desret_int(ret_val);
26151        call_tests++;
26152        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26153        des_xmlDocPtr(n_doc, doc, 1);
26154        xmlResetLastError();
26155        if (mem_base != xmlMemBlocks()) {
26156            printf("Leak of %d blocks found in xmlValidateDtdFinal",
26157	           xmlMemBlocks() - mem_base);
26158	    test_ret++;
26159            printf(" %d", n_ctxt);
26160            printf(" %d", n_doc);
26161            printf("\n");
26162        }
26163    }
26164    }
26165    function_tests++;
26166#endif
26167
26168    return(test_ret);
26169}
26170
26171
26172static int
26173test_xmlValidateElement(void) {
26174    int test_ret = 0;
26175
26176#if defined(LIBXML_VALID_ENABLED)
26177    int mem_base;
26178    int ret_val;
26179    xmlValidCtxtPtr ctxt; /* the validation context */
26180    int n_ctxt;
26181    xmlDocPtr doc; /* a document instance */
26182    int n_doc;
26183    xmlNodePtr elem; /* an element instance */
26184    int n_elem;
26185
26186    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26187    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26188    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26189        mem_base = xmlMemBlocks();
26190        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26191        doc = gen_xmlDocPtr(n_doc, 1);
26192        elem = gen_xmlNodePtr(n_elem, 2);
26193
26194        ret_val = xmlValidateElement(ctxt, doc, elem);
26195        desret_int(ret_val);
26196        call_tests++;
26197        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26198        des_xmlDocPtr(n_doc, doc, 1);
26199        des_xmlNodePtr(n_elem, elem, 2);
26200        xmlResetLastError();
26201        if (mem_base != xmlMemBlocks()) {
26202            printf("Leak of %d blocks found in xmlValidateElement",
26203	           xmlMemBlocks() - mem_base);
26204	    test_ret++;
26205            printf(" %d", n_ctxt);
26206            printf(" %d", n_doc);
26207            printf(" %d", n_elem);
26208            printf("\n");
26209        }
26210    }
26211    }
26212    }
26213    function_tests++;
26214#endif
26215
26216    return(test_ret);
26217}
26218
26219
26220static int
26221test_xmlValidateElementDecl(void) {
26222    int test_ret = 0;
26223
26224#if defined(LIBXML_VALID_ENABLED)
26225    int mem_base;
26226    int ret_val;
26227    xmlValidCtxtPtr ctxt; /* the validation context */
26228    int n_ctxt;
26229    xmlDocPtr doc; /* a document instance */
26230    int n_doc;
26231    xmlElementPtr elem; /* an element definition */
26232    int n_elem;
26233
26234    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26235    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26236    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26237        mem_base = xmlMemBlocks();
26238        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26239        doc = gen_xmlDocPtr(n_doc, 1);
26240        elem = gen_xmlElementPtr(n_elem, 2);
26241
26242        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26243        desret_int(ret_val);
26244        call_tests++;
26245        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26246        des_xmlDocPtr(n_doc, doc, 1);
26247        des_xmlElementPtr(n_elem, elem, 2);
26248        xmlResetLastError();
26249        if (mem_base != xmlMemBlocks()) {
26250            printf("Leak of %d blocks found in xmlValidateElementDecl",
26251	           xmlMemBlocks() - mem_base);
26252	    test_ret++;
26253            printf(" %d", n_ctxt);
26254            printf(" %d", n_doc);
26255            printf(" %d", n_elem);
26256            printf("\n");
26257        }
26258    }
26259    }
26260    }
26261    function_tests++;
26262#endif
26263
26264    return(test_ret);
26265}
26266
26267
26268static int
26269test_xmlValidateNameValue(void) {
26270    int test_ret = 0;
26271
26272#if defined(LIBXML_VALID_ENABLED)
26273    int mem_base;
26274    int ret_val;
26275    xmlChar * value; /* an Name value */
26276    int n_value;
26277
26278    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26279        mem_base = xmlMemBlocks();
26280        value = gen_const_xmlChar_ptr(n_value, 0);
26281
26282        ret_val = xmlValidateNameValue((const xmlChar *)value);
26283        desret_int(ret_val);
26284        call_tests++;
26285        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26286        xmlResetLastError();
26287        if (mem_base != xmlMemBlocks()) {
26288            printf("Leak of %d blocks found in xmlValidateNameValue",
26289	           xmlMemBlocks() - mem_base);
26290	    test_ret++;
26291            printf(" %d", n_value);
26292            printf("\n");
26293        }
26294    }
26295    function_tests++;
26296#endif
26297
26298    return(test_ret);
26299}
26300
26301
26302static int
26303test_xmlValidateNamesValue(void) {
26304    int test_ret = 0;
26305
26306#if defined(LIBXML_VALID_ENABLED)
26307    int mem_base;
26308    int ret_val;
26309    xmlChar * value; /* an Names value */
26310    int n_value;
26311
26312    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26313        mem_base = xmlMemBlocks();
26314        value = gen_const_xmlChar_ptr(n_value, 0);
26315
26316        ret_val = xmlValidateNamesValue((const xmlChar *)value);
26317        desret_int(ret_val);
26318        call_tests++;
26319        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26320        xmlResetLastError();
26321        if (mem_base != xmlMemBlocks()) {
26322            printf("Leak of %d blocks found in xmlValidateNamesValue",
26323	           xmlMemBlocks() - mem_base);
26324	    test_ret++;
26325            printf(" %d", n_value);
26326            printf("\n");
26327        }
26328    }
26329    function_tests++;
26330#endif
26331
26332    return(test_ret);
26333}
26334
26335
26336static int
26337test_xmlValidateNmtokenValue(void) {
26338    int test_ret = 0;
26339
26340#if defined(LIBXML_VALID_ENABLED)
26341    int mem_base;
26342    int ret_val;
26343    xmlChar * value; /* an Nmtoken value */
26344    int n_value;
26345
26346    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26347        mem_base = xmlMemBlocks();
26348        value = gen_const_xmlChar_ptr(n_value, 0);
26349
26350        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26351        desret_int(ret_val);
26352        call_tests++;
26353        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26354        xmlResetLastError();
26355        if (mem_base != xmlMemBlocks()) {
26356            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26357	           xmlMemBlocks() - mem_base);
26358	    test_ret++;
26359            printf(" %d", n_value);
26360            printf("\n");
26361        }
26362    }
26363    function_tests++;
26364#endif
26365
26366    return(test_ret);
26367}
26368
26369
26370static int
26371test_xmlValidateNmtokensValue(void) {
26372    int test_ret = 0;
26373
26374#if defined(LIBXML_VALID_ENABLED)
26375    int mem_base;
26376    int ret_val;
26377    xmlChar * value; /* an Nmtokens value */
26378    int n_value;
26379
26380    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26381        mem_base = xmlMemBlocks();
26382        value = gen_const_xmlChar_ptr(n_value, 0);
26383
26384        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26385        desret_int(ret_val);
26386        call_tests++;
26387        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26388        xmlResetLastError();
26389        if (mem_base != xmlMemBlocks()) {
26390            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26391	           xmlMemBlocks() - mem_base);
26392	    test_ret++;
26393            printf(" %d", n_value);
26394            printf("\n");
26395        }
26396    }
26397    function_tests++;
26398#endif
26399
26400    return(test_ret);
26401}
26402
26403
26404static int
26405test_xmlValidateNotationDecl(void) {
26406    int test_ret = 0;
26407
26408#if defined(LIBXML_VALID_ENABLED)
26409    int mem_base;
26410    int ret_val;
26411    xmlValidCtxtPtr ctxt; /* the validation context */
26412    int n_ctxt;
26413    xmlDocPtr doc; /* a document instance */
26414    int n_doc;
26415    xmlNotationPtr nota; /* a notation definition */
26416    int n_nota;
26417
26418    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26419    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26420    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26421        mem_base = xmlMemBlocks();
26422        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26423        doc = gen_xmlDocPtr(n_doc, 1);
26424        nota = gen_xmlNotationPtr(n_nota, 2);
26425
26426        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26427        desret_int(ret_val);
26428        call_tests++;
26429        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26430        des_xmlDocPtr(n_doc, doc, 1);
26431        des_xmlNotationPtr(n_nota, nota, 2);
26432        xmlResetLastError();
26433        if (mem_base != xmlMemBlocks()) {
26434            printf("Leak of %d blocks found in xmlValidateNotationDecl",
26435	           xmlMemBlocks() - mem_base);
26436	    test_ret++;
26437            printf(" %d", n_ctxt);
26438            printf(" %d", n_doc);
26439            printf(" %d", n_nota);
26440            printf("\n");
26441        }
26442    }
26443    }
26444    }
26445    function_tests++;
26446#endif
26447
26448    return(test_ret);
26449}
26450
26451
26452static int
26453test_xmlValidateNotationUse(void) {
26454    int test_ret = 0;
26455
26456#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26457    int mem_base;
26458    int ret_val;
26459    xmlValidCtxtPtr ctxt; /* the validation context */
26460    int n_ctxt;
26461    xmlDocPtr doc; /* the document */
26462    int n_doc;
26463    xmlChar * notationName; /* the notation name to check */
26464    int n_notationName;
26465
26466    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26467    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26468    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26469        mem_base = xmlMemBlocks();
26470        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26471        doc = gen_xmlDocPtr(n_doc, 1);
26472        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26473
26474        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26475        desret_int(ret_val);
26476        call_tests++;
26477        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26478        des_xmlDocPtr(n_doc, doc, 1);
26479        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26480        xmlResetLastError();
26481        if (mem_base != xmlMemBlocks()) {
26482            printf("Leak of %d blocks found in xmlValidateNotationUse",
26483	           xmlMemBlocks() - mem_base);
26484	    test_ret++;
26485            printf(" %d", n_ctxt);
26486            printf(" %d", n_doc);
26487            printf(" %d", n_notationName);
26488            printf("\n");
26489        }
26490    }
26491    }
26492    }
26493    function_tests++;
26494#endif
26495
26496    return(test_ret);
26497}
26498
26499
26500static int
26501test_xmlValidateOneAttribute(void) {
26502    int test_ret = 0;
26503
26504#if defined(LIBXML_VALID_ENABLED)
26505    int mem_base;
26506    int ret_val;
26507    xmlValidCtxtPtr ctxt; /* the validation context */
26508    int n_ctxt;
26509    xmlDocPtr doc; /* a document instance */
26510    int n_doc;
26511    xmlNodePtr elem; /* an element instance */
26512    int n_elem;
26513    xmlAttrPtr attr; /* an attribute instance */
26514    int n_attr;
26515    xmlChar * value; /* the attribute value (without entities processing) */
26516    int n_value;
26517
26518    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26519    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26520    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26521    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26522    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26523        mem_base = xmlMemBlocks();
26524        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26525        doc = gen_xmlDocPtr(n_doc, 1);
26526        elem = gen_xmlNodePtr(n_elem, 2);
26527        attr = gen_xmlAttrPtr(n_attr, 3);
26528        value = gen_const_xmlChar_ptr(n_value, 4);
26529
26530        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26531        desret_int(ret_val);
26532        call_tests++;
26533        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26534        des_xmlDocPtr(n_doc, doc, 1);
26535        des_xmlNodePtr(n_elem, elem, 2);
26536        des_xmlAttrPtr(n_attr, attr, 3);
26537        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26538        xmlResetLastError();
26539        if (mem_base != xmlMemBlocks()) {
26540            printf("Leak of %d blocks found in xmlValidateOneAttribute",
26541	           xmlMemBlocks() - mem_base);
26542	    test_ret++;
26543            printf(" %d", n_ctxt);
26544            printf(" %d", n_doc);
26545            printf(" %d", n_elem);
26546            printf(" %d", n_attr);
26547            printf(" %d", n_value);
26548            printf("\n");
26549        }
26550    }
26551    }
26552    }
26553    }
26554    }
26555    function_tests++;
26556#endif
26557
26558    return(test_ret);
26559}
26560
26561
26562static int
26563test_xmlValidateOneElement(void) {
26564    int test_ret = 0;
26565
26566#if defined(LIBXML_VALID_ENABLED)
26567    int mem_base;
26568    int ret_val;
26569    xmlValidCtxtPtr ctxt; /* the validation context */
26570    int n_ctxt;
26571    xmlDocPtr doc; /* a document instance */
26572    int n_doc;
26573    xmlNodePtr elem; /* an element instance */
26574    int n_elem;
26575
26576    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26577    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26578    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26579        mem_base = xmlMemBlocks();
26580        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26581        doc = gen_xmlDocPtr(n_doc, 1);
26582        elem = gen_xmlNodePtr(n_elem, 2);
26583
26584        ret_val = xmlValidateOneElement(ctxt, doc, elem);
26585        desret_int(ret_val);
26586        call_tests++;
26587        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26588        des_xmlDocPtr(n_doc, doc, 1);
26589        des_xmlNodePtr(n_elem, elem, 2);
26590        xmlResetLastError();
26591        if (mem_base != xmlMemBlocks()) {
26592            printf("Leak of %d blocks found in xmlValidateOneElement",
26593	           xmlMemBlocks() - mem_base);
26594	    test_ret++;
26595            printf(" %d", n_ctxt);
26596            printf(" %d", n_doc);
26597            printf(" %d", n_elem);
26598            printf("\n");
26599        }
26600    }
26601    }
26602    }
26603    function_tests++;
26604#endif
26605
26606    return(test_ret);
26607}
26608
26609
26610static int
26611test_xmlValidateOneNamespace(void) {
26612    int test_ret = 0;
26613
26614#if defined(LIBXML_VALID_ENABLED)
26615    int mem_base;
26616    int ret_val;
26617    xmlValidCtxtPtr ctxt; /* the validation context */
26618    int n_ctxt;
26619    xmlDocPtr doc; /* a document instance */
26620    int n_doc;
26621    xmlNodePtr elem; /* an element instance */
26622    int n_elem;
26623    xmlChar * prefix; /* the namespace prefix */
26624    int n_prefix;
26625    xmlNsPtr ns; /* an namespace declaration instance */
26626    int n_ns;
26627    xmlChar * value; /* the attribute value (without entities processing) */
26628    int n_value;
26629
26630    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26631    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26632    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26633    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26634    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26635    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26636        mem_base = xmlMemBlocks();
26637        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26638        doc = gen_xmlDocPtr(n_doc, 1);
26639        elem = gen_xmlNodePtr(n_elem, 2);
26640        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26641        ns = gen_xmlNsPtr(n_ns, 4);
26642        value = gen_const_xmlChar_ptr(n_value, 5);
26643
26644        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26645        desret_int(ret_val);
26646        call_tests++;
26647        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26648        des_xmlDocPtr(n_doc, doc, 1);
26649        des_xmlNodePtr(n_elem, elem, 2);
26650        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26651        des_xmlNsPtr(n_ns, ns, 4);
26652        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26653        xmlResetLastError();
26654        if (mem_base != xmlMemBlocks()) {
26655            printf("Leak of %d blocks found in xmlValidateOneNamespace",
26656	           xmlMemBlocks() - mem_base);
26657	    test_ret++;
26658            printf(" %d", n_ctxt);
26659            printf(" %d", n_doc);
26660            printf(" %d", n_elem);
26661            printf(" %d", n_prefix);
26662            printf(" %d", n_ns);
26663            printf(" %d", n_value);
26664            printf("\n");
26665        }
26666    }
26667    }
26668    }
26669    }
26670    }
26671    }
26672    function_tests++;
26673#endif
26674
26675    return(test_ret);
26676}
26677
26678
26679static int
26680test_xmlValidatePopElement(void) {
26681    int test_ret = 0;
26682
26683#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26684    int mem_base;
26685    int ret_val;
26686    xmlValidCtxtPtr ctxt; /* the validation context */
26687    int n_ctxt;
26688    xmlDocPtr doc; /* a document instance */
26689    int n_doc;
26690    xmlNodePtr elem; /* an element instance */
26691    int n_elem;
26692    xmlChar * qname; /* the qualified name as appearing in the serialization */
26693    int n_qname;
26694
26695    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26696    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26697    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26698    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26699        mem_base = xmlMemBlocks();
26700        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26701        doc = gen_xmlDocPtr(n_doc, 1);
26702        elem = gen_xmlNodePtr(n_elem, 2);
26703        qname = gen_const_xmlChar_ptr(n_qname, 3);
26704
26705        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26706        desret_int(ret_val);
26707        call_tests++;
26708        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26709        des_xmlDocPtr(n_doc, doc, 1);
26710        des_xmlNodePtr(n_elem, elem, 2);
26711        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26712        xmlResetLastError();
26713        if (mem_base != xmlMemBlocks()) {
26714            printf("Leak of %d blocks found in xmlValidatePopElement",
26715	           xmlMemBlocks() - mem_base);
26716	    test_ret++;
26717            printf(" %d", n_ctxt);
26718            printf(" %d", n_doc);
26719            printf(" %d", n_elem);
26720            printf(" %d", n_qname);
26721            printf("\n");
26722        }
26723    }
26724    }
26725    }
26726    }
26727    function_tests++;
26728#endif
26729
26730    return(test_ret);
26731}
26732
26733
26734static int
26735test_xmlValidatePushCData(void) {
26736    int test_ret = 0;
26737
26738#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26739    int mem_base;
26740    int ret_val;
26741    xmlValidCtxtPtr ctxt; /* the validation context */
26742    int n_ctxt;
26743    xmlChar * data; /* some character data read */
26744    int n_data;
26745    int len; /* the lenght of the data */
26746    int n_len;
26747
26748    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26749    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26750    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26751        mem_base = xmlMemBlocks();
26752        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26753        data = gen_const_xmlChar_ptr(n_data, 1);
26754        len = gen_int(n_len, 2);
26755
26756        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26757        desret_int(ret_val);
26758        call_tests++;
26759        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26760        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26761        des_int(n_len, len, 2);
26762        xmlResetLastError();
26763        if (mem_base != xmlMemBlocks()) {
26764            printf("Leak of %d blocks found in xmlValidatePushCData",
26765	           xmlMemBlocks() - mem_base);
26766	    test_ret++;
26767            printf(" %d", n_ctxt);
26768            printf(" %d", n_data);
26769            printf(" %d", n_len);
26770            printf("\n");
26771        }
26772    }
26773    }
26774    }
26775    function_tests++;
26776#endif
26777
26778    return(test_ret);
26779}
26780
26781
26782static int
26783test_xmlValidatePushElement(void) {
26784    int test_ret = 0;
26785
26786#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26787    int mem_base;
26788    int ret_val;
26789    xmlValidCtxtPtr ctxt; /* the validation context */
26790    int n_ctxt;
26791    xmlDocPtr doc; /* a document instance */
26792    int n_doc;
26793    xmlNodePtr elem; /* an element instance */
26794    int n_elem;
26795    xmlChar * qname; /* the qualified name as appearing in the serialization */
26796    int n_qname;
26797
26798    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26799    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26800    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26801    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26802        mem_base = xmlMemBlocks();
26803        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26804        doc = gen_xmlDocPtr(n_doc, 1);
26805        elem = gen_xmlNodePtr(n_elem, 2);
26806        qname = gen_const_xmlChar_ptr(n_qname, 3);
26807
26808        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26809        desret_int(ret_val);
26810        call_tests++;
26811        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26812        des_xmlDocPtr(n_doc, doc, 1);
26813        des_xmlNodePtr(n_elem, elem, 2);
26814        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26815        xmlResetLastError();
26816        if (mem_base != xmlMemBlocks()) {
26817            printf("Leak of %d blocks found in xmlValidatePushElement",
26818	           xmlMemBlocks() - mem_base);
26819	    test_ret++;
26820            printf(" %d", n_ctxt);
26821            printf(" %d", n_doc);
26822            printf(" %d", n_elem);
26823            printf(" %d", n_qname);
26824            printf("\n");
26825        }
26826    }
26827    }
26828    }
26829    }
26830    function_tests++;
26831#endif
26832
26833    return(test_ret);
26834}
26835
26836
26837static int
26838test_xmlValidateRoot(void) {
26839    int test_ret = 0;
26840
26841#if defined(LIBXML_VALID_ENABLED)
26842    int mem_base;
26843    int ret_val;
26844    xmlValidCtxtPtr ctxt; /* the validation context */
26845    int n_ctxt;
26846    xmlDocPtr doc; /* a document instance */
26847    int n_doc;
26848
26849    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26850    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26851        mem_base = xmlMemBlocks();
26852        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26853        doc = gen_xmlDocPtr(n_doc, 1);
26854
26855        ret_val = xmlValidateRoot(ctxt, doc);
26856        desret_int(ret_val);
26857        call_tests++;
26858        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26859        des_xmlDocPtr(n_doc, doc, 1);
26860        xmlResetLastError();
26861        if (mem_base != xmlMemBlocks()) {
26862            printf("Leak of %d blocks found in xmlValidateRoot",
26863	           xmlMemBlocks() - mem_base);
26864	    test_ret++;
26865            printf(" %d", n_ctxt);
26866            printf(" %d", n_doc);
26867            printf("\n");
26868        }
26869    }
26870    }
26871    function_tests++;
26872#endif
26873
26874    return(test_ret);
26875}
26876
26877static int
26878test_valid(void) {
26879    int test_ret = 0;
26880
26881    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26882    test_ret += test_xmlAddAttributeDecl();
26883    test_ret += test_xmlAddElementDecl();
26884    test_ret += test_xmlAddID();
26885    test_ret += test_xmlAddNotationDecl();
26886    test_ret += test_xmlAddRef();
26887    test_ret += test_xmlCopyAttributeTable();
26888    test_ret += test_xmlCopyDocElementContent();
26889    test_ret += test_xmlCopyElementContent();
26890    test_ret += test_xmlCopyElementTable();
26891    test_ret += test_xmlCopyEnumeration();
26892    test_ret += test_xmlCopyNotationTable();
26893    test_ret += test_xmlCreateEnumeration();
26894    test_ret += test_xmlDumpAttributeDecl();
26895    test_ret += test_xmlDumpAttributeTable();
26896    test_ret += test_xmlDumpElementDecl();
26897    test_ret += test_xmlDumpElementTable();
26898    test_ret += test_xmlDumpNotationDecl();
26899    test_ret += test_xmlDumpNotationTable();
26900    test_ret += test_xmlGetDtdAttrDesc();
26901    test_ret += test_xmlGetDtdElementDesc();
26902    test_ret += test_xmlGetDtdNotationDesc();
26903    test_ret += test_xmlGetDtdQAttrDesc();
26904    test_ret += test_xmlGetDtdQElementDesc();
26905    test_ret += test_xmlGetID();
26906    test_ret += test_xmlGetRefs();
26907    test_ret += test_xmlIsID();
26908    test_ret += test_xmlIsMixedElement();
26909    test_ret += test_xmlIsRef();
26910    test_ret += test_xmlNewDocElementContent();
26911    test_ret += test_xmlNewElementContent();
26912    test_ret += test_xmlNewValidCtxt();
26913    test_ret += test_xmlRemoveID();
26914    test_ret += test_xmlRemoveRef();
26915    test_ret += test_xmlSnprintfElementContent();
26916    test_ret += test_xmlSprintfElementContent();
26917    test_ret += test_xmlValidBuildContentModel();
26918    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26919    test_ret += test_xmlValidGetPotentialChildren();
26920    test_ret += test_xmlValidGetValidElements();
26921    test_ret += test_xmlValidNormalizeAttributeValue();
26922    test_ret += test_xmlValidateAttributeDecl();
26923    test_ret += test_xmlValidateAttributeValue();
26924    test_ret += test_xmlValidateDocument();
26925    test_ret += test_xmlValidateDocumentFinal();
26926    test_ret += test_xmlValidateDtd();
26927    test_ret += test_xmlValidateDtdFinal();
26928    test_ret += test_xmlValidateElement();
26929    test_ret += test_xmlValidateElementDecl();
26930    test_ret += test_xmlValidateNameValue();
26931    test_ret += test_xmlValidateNamesValue();
26932    test_ret += test_xmlValidateNmtokenValue();
26933    test_ret += test_xmlValidateNmtokensValue();
26934    test_ret += test_xmlValidateNotationDecl();
26935    test_ret += test_xmlValidateNotationUse();
26936    test_ret += test_xmlValidateOneAttribute();
26937    test_ret += test_xmlValidateOneElement();
26938    test_ret += test_xmlValidateOneNamespace();
26939    test_ret += test_xmlValidatePopElement();
26940    test_ret += test_xmlValidatePushCData();
26941    test_ret += test_xmlValidatePushElement();
26942    test_ret += test_xmlValidateRoot();
26943
26944    if (test_ret != 0)
26945	printf("Module valid: %d errors\n", test_ret);
26946    return(test_ret);
26947}
26948
26949static int
26950test_xmlXIncludeNewContext(void) {
26951    int test_ret = 0;
26952
26953
26954    /* missing type support */
26955    return(test_ret);
26956}
26957
26958
26959static int
26960test_xmlXIncludeProcess(void) {
26961    int test_ret = 0;
26962
26963#if defined(LIBXML_XINCLUDE_ENABLED)
26964    int mem_base;
26965    int ret_val;
26966    xmlDocPtr doc; /* an XML document */
26967    int n_doc;
26968
26969    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26970        mem_base = xmlMemBlocks();
26971        doc = gen_xmlDocPtr(n_doc, 0);
26972
26973        ret_val = xmlXIncludeProcess(doc);
26974        desret_int(ret_val);
26975        call_tests++;
26976        des_xmlDocPtr(n_doc, doc, 0);
26977        xmlResetLastError();
26978        if (mem_base != xmlMemBlocks()) {
26979            printf("Leak of %d blocks found in xmlXIncludeProcess",
26980	           xmlMemBlocks() - mem_base);
26981	    test_ret++;
26982            printf(" %d", n_doc);
26983            printf("\n");
26984        }
26985    }
26986    function_tests++;
26987#endif
26988
26989    return(test_ret);
26990}
26991
26992
26993static int
26994test_xmlXIncludeProcessFlags(void) {
26995    int test_ret = 0;
26996
26997#if defined(LIBXML_XINCLUDE_ENABLED)
26998    int mem_base;
26999    int ret_val;
27000    xmlDocPtr doc; /* an XML document */
27001    int n_doc;
27002    int flags; /* a set of xmlParserOption used for parsing XML includes */
27003    int n_flags;
27004
27005    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27006    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27007        mem_base = xmlMemBlocks();
27008        doc = gen_xmlDocPtr(n_doc, 0);
27009        flags = gen_int(n_flags, 1);
27010
27011        ret_val = xmlXIncludeProcessFlags(doc, flags);
27012        desret_int(ret_val);
27013        call_tests++;
27014        des_xmlDocPtr(n_doc, doc, 0);
27015        des_int(n_flags, flags, 1);
27016        xmlResetLastError();
27017        if (mem_base != xmlMemBlocks()) {
27018            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27019	           xmlMemBlocks() - mem_base);
27020	    test_ret++;
27021            printf(" %d", n_doc);
27022            printf(" %d", n_flags);
27023            printf("\n");
27024        }
27025    }
27026    }
27027    function_tests++;
27028#endif
27029
27030    return(test_ret);
27031}
27032
27033
27034static int
27035test_xmlXIncludeProcessFlagsData(void) {
27036    int test_ret = 0;
27037
27038#if defined(LIBXML_XINCLUDE_ENABLED)
27039    int mem_base;
27040    int ret_val;
27041    xmlDocPtr doc; /* an XML document */
27042    int n_doc;
27043    int flags; /* a set of xmlParserOption used for parsing XML includes */
27044    int n_flags;
27045    void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27046    int n_data;
27047
27048    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27049    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27050    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27051        mem_base = xmlMemBlocks();
27052        doc = gen_xmlDocPtr(n_doc, 0);
27053        flags = gen_int(n_flags, 1);
27054        data = gen_userdata(n_data, 2);
27055
27056        ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27057        desret_int(ret_val);
27058        call_tests++;
27059        des_xmlDocPtr(n_doc, doc, 0);
27060        des_int(n_flags, flags, 1);
27061        des_userdata(n_data, data, 2);
27062        xmlResetLastError();
27063        if (mem_base != xmlMemBlocks()) {
27064            printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27065	           xmlMemBlocks() - mem_base);
27066	    test_ret++;
27067            printf(" %d", n_doc);
27068            printf(" %d", n_flags);
27069            printf(" %d", n_data);
27070            printf("\n");
27071        }
27072    }
27073    }
27074    }
27075    function_tests++;
27076#endif
27077
27078    return(test_ret);
27079}
27080
27081#ifdef LIBXML_XINCLUDE_ENABLED
27082
27083#define gen_nb_xmlXIncludeCtxtPtr 1
27084static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27085    return(NULL);
27086}
27087static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27088}
27089#endif
27090
27091
27092static int
27093test_xmlXIncludeProcessNode(void) {
27094    int test_ret = 0;
27095
27096#if defined(LIBXML_XINCLUDE_ENABLED)
27097    int mem_base;
27098    int ret_val;
27099    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27100    int n_ctxt;
27101    xmlNodePtr node; /* a node in an XML document */
27102    int n_node;
27103
27104    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27105    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27106        mem_base = xmlMemBlocks();
27107        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27108        node = gen_xmlNodePtr(n_node, 1);
27109
27110        ret_val = xmlXIncludeProcessNode(ctxt, node);
27111        desret_int(ret_val);
27112        call_tests++;
27113        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27114        des_xmlNodePtr(n_node, node, 1);
27115        xmlResetLastError();
27116        if (mem_base != xmlMemBlocks()) {
27117            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27118	           xmlMemBlocks() - mem_base);
27119	    test_ret++;
27120            printf(" %d", n_ctxt);
27121            printf(" %d", n_node);
27122            printf("\n");
27123        }
27124    }
27125    }
27126    function_tests++;
27127#endif
27128
27129    return(test_ret);
27130}
27131
27132
27133static int
27134test_xmlXIncludeProcessTree(void) {
27135    int test_ret = 0;
27136
27137#if defined(LIBXML_XINCLUDE_ENABLED)
27138    int mem_base;
27139    int ret_val;
27140    xmlNodePtr tree; /* a node in an XML document */
27141    int n_tree;
27142
27143    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27144        mem_base = xmlMemBlocks();
27145        tree = gen_xmlNodePtr(n_tree, 0);
27146
27147        ret_val = xmlXIncludeProcessTree(tree);
27148        desret_int(ret_val);
27149        call_tests++;
27150        des_xmlNodePtr(n_tree, tree, 0);
27151        xmlResetLastError();
27152        if (mem_base != xmlMemBlocks()) {
27153            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27154	           xmlMemBlocks() - mem_base);
27155	    test_ret++;
27156            printf(" %d", n_tree);
27157            printf("\n");
27158        }
27159    }
27160    function_tests++;
27161#endif
27162
27163    return(test_ret);
27164}
27165
27166
27167static int
27168test_xmlXIncludeProcessTreeFlags(void) {
27169    int test_ret = 0;
27170
27171#if defined(LIBXML_XINCLUDE_ENABLED)
27172    int mem_base;
27173    int ret_val;
27174    xmlNodePtr tree; /* a node in an XML document */
27175    int n_tree;
27176    int flags; /* a set of xmlParserOption used for parsing XML includes */
27177    int n_flags;
27178
27179    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27180    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27181        mem_base = xmlMemBlocks();
27182        tree = gen_xmlNodePtr(n_tree, 0);
27183        flags = gen_int(n_flags, 1);
27184
27185        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27186        desret_int(ret_val);
27187        call_tests++;
27188        des_xmlNodePtr(n_tree, tree, 0);
27189        des_int(n_flags, flags, 1);
27190        xmlResetLastError();
27191        if (mem_base != xmlMemBlocks()) {
27192            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27193	           xmlMemBlocks() - mem_base);
27194	    test_ret++;
27195            printf(" %d", n_tree);
27196            printf(" %d", n_flags);
27197            printf("\n");
27198        }
27199    }
27200    }
27201    function_tests++;
27202#endif
27203
27204    return(test_ret);
27205}
27206
27207
27208static int
27209test_xmlXIncludeSetFlags(void) {
27210    int test_ret = 0;
27211
27212#if defined(LIBXML_XINCLUDE_ENABLED)
27213    int mem_base;
27214    int ret_val;
27215    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27216    int n_ctxt;
27217    int flags; /* a set of xmlParserOption used for parsing XML includes */
27218    int n_flags;
27219
27220    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27221    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27222        mem_base = xmlMemBlocks();
27223        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27224        flags = gen_int(n_flags, 1);
27225
27226        ret_val = xmlXIncludeSetFlags(ctxt, flags);
27227        desret_int(ret_val);
27228        call_tests++;
27229        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27230        des_int(n_flags, flags, 1);
27231        xmlResetLastError();
27232        if (mem_base != xmlMemBlocks()) {
27233            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27234	           xmlMemBlocks() - mem_base);
27235	    test_ret++;
27236            printf(" %d", n_ctxt);
27237            printf(" %d", n_flags);
27238            printf("\n");
27239        }
27240    }
27241    }
27242    function_tests++;
27243#endif
27244
27245    return(test_ret);
27246}
27247
27248static int
27249test_xinclude(void) {
27250    int test_ret = 0;
27251
27252    if (quiet == 0) printf("Testing xinclude : 7 of 9 functions ...\n");
27253    test_ret += test_xmlXIncludeNewContext();
27254    test_ret += test_xmlXIncludeProcess();
27255    test_ret += test_xmlXIncludeProcessFlags();
27256    test_ret += test_xmlXIncludeProcessFlagsData();
27257    test_ret += test_xmlXIncludeProcessNode();
27258    test_ret += test_xmlXIncludeProcessTree();
27259    test_ret += test_xmlXIncludeProcessTreeFlags();
27260    test_ret += test_xmlXIncludeSetFlags();
27261
27262    if (test_ret != 0)
27263	printf("Module xinclude: %d errors\n", test_ret);
27264    return(test_ret);
27265}
27266
27267static int
27268test_xmlAllocOutputBuffer(void) {
27269    int test_ret = 0;
27270
27271#if defined(LIBXML_OUTPUT_ENABLED)
27272    int mem_base;
27273    xmlOutputBufferPtr ret_val;
27274    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27275    int n_encoder;
27276
27277    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27278        mem_base = xmlMemBlocks();
27279        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27280
27281        ret_val = xmlAllocOutputBuffer(encoder);
27282        desret_xmlOutputBufferPtr(ret_val);
27283        call_tests++;
27284        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27285        xmlResetLastError();
27286        if (mem_base != xmlMemBlocks()) {
27287            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27288	           xmlMemBlocks() - mem_base);
27289	    test_ret++;
27290            printf(" %d", n_encoder);
27291            printf("\n");
27292        }
27293    }
27294    function_tests++;
27295#endif
27296
27297    return(test_ret);
27298}
27299
27300
27301static int
27302test_xmlAllocParserInputBuffer(void) {
27303    int test_ret = 0;
27304
27305    int mem_base;
27306    xmlParserInputBufferPtr ret_val;
27307    xmlCharEncoding enc; /* the charset encoding if known */
27308    int n_enc;
27309
27310    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27311        mem_base = xmlMemBlocks();
27312        enc = gen_xmlCharEncoding(n_enc, 0);
27313
27314        ret_val = xmlAllocParserInputBuffer(enc);
27315        desret_xmlParserInputBufferPtr(ret_val);
27316        call_tests++;
27317        des_xmlCharEncoding(n_enc, enc, 0);
27318        xmlResetLastError();
27319        if (mem_base != xmlMemBlocks()) {
27320            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27321	           xmlMemBlocks() - mem_base);
27322	    test_ret++;
27323            printf(" %d", n_enc);
27324            printf("\n");
27325        }
27326    }
27327    function_tests++;
27328
27329    return(test_ret);
27330}
27331
27332
27333static int
27334test_xmlCheckFilename(void) {
27335    int test_ret = 0;
27336
27337    int mem_base;
27338    int ret_val;
27339    char * path; /* the path to check */
27340    int n_path;
27341
27342    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27343        mem_base = xmlMemBlocks();
27344        path = gen_const_char_ptr(n_path, 0);
27345
27346        ret_val = xmlCheckFilename((const char *)path);
27347        desret_int(ret_val);
27348        call_tests++;
27349        des_const_char_ptr(n_path, (const char *)path, 0);
27350        xmlResetLastError();
27351        if (mem_base != xmlMemBlocks()) {
27352            printf("Leak of %d blocks found in xmlCheckFilename",
27353	           xmlMemBlocks() - mem_base);
27354	    test_ret++;
27355            printf(" %d", n_path);
27356            printf("\n");
27357        }
27358    }
27359    function_tests++;
27360
27361    return(test_ret);
27362}
27363
27364
27365static int
27366test_xmlCheckHTTPInput(void) {
27367    int test_ret = 0;
27368
27369    int mem_base;
27370    xmlParserInputPtr ret_val;
27371    xmlParserCtxtPtr ctxt; /* an XML parser context */
27372    int n_ctxt;
27373    xmlParserInputPtr ret; /* an XML parser input */
27374    int n_ret;
27375
27376    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27377    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27378        mem_base = xmlMemBlocks();
27379        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27380        ret = gen_xmlParserInputPtr(n_ret, 1);
27381
27382        ret_val = xmlCheckHTTPInput(ctxt, ret);
27383        desret_xmlParserInputPtr(ret_val);
27384        call_tests++;
27385        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27386        des_xmlParserInputPtr(n_ret, ret, 1);
27387        xmlResetLastError();
27388        if (mem_base != xmlMemBlocks()) {
27389            printf("Leak of %d blocks found in xmlCheckHTTPInput",
27390	           xmlMemBlocks() - mem_base);
27391	    test_ret++;
27392            printf(" %d", n_ctxt);
27393            printf(" %d", n_ret);
27394            printf("\n");
27395        }
27396    }
27397    }
27398    function_tests++;
27399
27400    return(test_ret);
27401}
27402
27403
27404static int
27405test_xmlCleanupInputCallbacks(void) {
27406    int test_ret = 0;
27407
27408    int mem_base;
27409
27410        mem_base = xmlMemBlocks();
27411
27412        xmlCleanupInputCallbacks();
27413        call_tests++;
27414        xmlResetLastError();
27415        if (mem_base != xmlMemBlocks()) {
27416            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27417	           xmlMemBlocks() - mem_base);
27418	    test_ret++;
27419            printf("\n");
27420        }
27421    function_tests++;
27422
27423    return(test_ret);
27424}
27425
27426
27427static int
27428test_xmlCleanupOutputCallbacks(void) {
27429    int test_ret = 0;
27430
27431#if defined(LIBXML_OUTPUT_ENABLED)
27432    int mem_base;
27433
27434        mem_base = xmlMemBlocks();
27435
27436        xmlCleanupOutputCallbacks();
27437        call_tests++;
27438        xmlResetLastError();
27439        if (mem_base != xmlMemBlocks()) {
27440            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27441	           xmlMemBlocks() - mem_base);
27442	    test_ret++;
27443            printf("\n");
27444        }
27445    function_tests++;
27446#endif
27447
27448    return(test_ret);
27449}
27450
27451
27452static int
27453test_xmlFileClose(void) {
27454    int test_ret = 0;
27455
27456    int mem_base;
27457    int ret_val;
27458    void * context; /* the I/O context */
27459    int n_context;
27460
27461    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27462        mem_base = xmlMemBlocks();
27463        context = gen_void_ptr(n_context, 0);
27464
27465        ret_val = xmlFileClose(context);
27466        desret_int(ret_val);
27467        call_tests++;
27468        des_void_ptr(n_context, context, 0);
27469        xmlResetLastError();
27470        if (mem_base != xmlMemBlocks()) {
27471            printf("Leak of %d blocks found in xmlFileClose",
27472	           xmlMemBlocks() - mem_base);
27473	    test_ret++;
27474            printf(" %d", n_context);
27475            printf("\n");
27476        }
27477    }
27478    function_tests++;
27479
27480    return(test_ret);
27481}
27482
27483
27484static int
27485test_xmlFileMatch(void) {
27486    int test_ret = 0;
27487
27488    int mem_base;
27489    int ret_val;
27490    const char * filename; /* the URI for matching */
27491    int n_filename;
27492
27493    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27494        mem_base = xmlMemBlocks();
27495        filename = gen_filepath(n_filename, 0);
27496
27497        ret_val = xmlFileMatch(filename);
27498        desret_int(ret_val);
27499        call_tests++;
27500        des_filepath(n_filename, filename, 0);
27501        xmlResetLastError();
27502        if (mem_base != xmlMemBlocks()) {
27503            printf("Leak of %d blocks found in xmlFileMatch",
27504	           xmlMemBlocks() - mem_base);
27505	    test_ret++;
27506            printf(" %d", n_filename);
27507            printf("\n");
27508        }
27509    }
27510    function_tests++;
27511
27512    return(test_ret);
27513}
27514
27515
27516static int
27517test_xmlFileOpen(void) {
27518    int test_ret = 0;
27519
27520    int mem_base;
27521    void * ret_val;
27522    const char * filename; /* the URI for matching */
27523    int n_filename;
27524
27525    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27526        mem_base = xmlMemBlocks();
27527        filename = gen_filepath(n_filename, 0);
27528
27529        ret_val = xmlFileOpen(filename);
27530        desret_void_ptr(ret_val);
27531        call_tests++;
27532        des_filepath(n_filename, filename, 0);
27533        xmlResetLastError();
27534        if (mem_base != xmlMemBlocks()) {
27535            printf("Leak of %d blocks found in xmlFileOpen",
27536	           xmlMemBlocks() - mem_base);
27537	    test_ret++;
27538            printf(" %d", n_filename);
27539            printf("\n");
27540        }
27541    }
27542    function_tests++;
27543
27544    return(test_ret);
27545}
27546
27547
27548static int
27549test_xmlFileRead(void) {
27550    int test_ret = 0;
27551
27552    int mem_base;
27553    int ret_val;
27554    void * context; /* the I/O context */
27555    int n_context;
27556    char * buffer; /* where to drop data */
27557    int n_buffer;
27558    int len; /* number of bytes to write */
27559    int n_len;
27560
27561    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27562    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27563    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27564        mem_base = xmlMemBlocks();
27565        context = gen_void_ptr(n_context, 0);
27566        buffer = gen_char_ptr(n_buffer, 1);
27567        len = gen_int(n_len, 2);
27568
27569        ret_val = xmlFileRead(context, buffer, len);
27570        desret_int(ret_val);
27571        call_tests++;
27572        des_void_ptr(n_context, context, 0);
27573        des_char_ptr(n_buffer, buffer, 1);
27574        des_int(n_len, len, 2);
27575        xmlResetLastError();
27576        if (mem_base != xmlMemBlocks()) {
27577            printf("Leak of %d blocks found in xmlFileRead",
27578	           xmlMemBlocks() - mem_base);
27579	    test_ret++;
27580            printf(" %d", n_context);
27581            printf(" %d", n_buffer);
27582            printf(" %d", n_len);
27583            printf("\n");
27584        }
27585    }
27586    }
27587    }
27588    function_tests++;
27589
27590    return(test_ret);
27591}
27592
27593
27594static int
27595test_xmlIOFTPClose(void) {
27596    int test_ret = 0;
27597
27598#if defined(LIBXML_FTP_ENABLED)
27599    int mem_base;
27600    int ret_val;
27601    void * context; /* the I/O context */
27602    int n_context;
27603
27604    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27605        mem_base = xmlMemBlocks();
27606        context = gen_void_ptr(n_context, 0);
27607
27608        ret_val = xmlIOFTPClose(context);
27609        desret_int(ret_val);
27610        call_tests++;
27611        des_void_ptr(n_context, context, 0);
27612        xmlResetLastError();
27613        if (mem_base != xmlMemBlocks()) {
27614            printf("Leak of %d blocks found in xmlIOFTPClose",
27615	           xmlMemBlocks() - mem_base);
27616	    test_ret++;
27617            printf(" %d", n_context);
27618            printf("\n");
27619        }
27620    }
27621    function_tests++;
27622#endif
27623
27624    return(test_ret);
27625}
27626
27627
27628static int
27629test_xmlIOFTPMatch(void) {
27630    int test_ret = 0;
27631
27632#if defined(LIBXML_FTP_ENABLED)
27633    int mem_base;
27634    int ret_val;
27635    const char * filename; /* the URI for matching */
27636    int n_filename;
27637
27638    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27639        mem_base = xmlMemBlocks();
27640        filename = gen_filepath(n_filename, 0);
27641
27642        ret_val = xmlIOFTPMatch(filename);
27643        desret_int(ret_val);
27644        call_tests++;
27645        des_filepath(n_filename, filename, 0);
27646        xmlResetLastError();
27647        if (mem_base != xmlMemBlocks()) {
27648            printf("Leak of %d blocks found in xmlIOFTPMatch",
27649	           xmlMemBlocks() - mem_base);
27650	    test_ret++;
27651            printf(" %d", n_filename);
27652            printf("\n");
27653        }
27654    }
27655    function_tests++;
27656#endif
27657
27658    return(test_ret);
27659}
27660
27661
27662static int
27663test_xmlIOFTPOpen(void) {
27664    int test_ret = 0;
27665
27666#if defined(LIBXML_FTP_ENABLED)
27667    int mem_base;
27668    void * ret_val;
27669    const char * filename; /* the URI for matching */
27670    int n_filename;
27671
27672    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27673        mem_base = xmlMemBlocks();
27674        filename = gen_filepath(n_filename, 0);
27675
27676        ret_val = xmlIOFTPOpen(filename);
27677        desret_void_ptr(ret_val);
27678        call_tests++;
27679        des_filepath(n_filename, filename, 0);
27680        xmlResetLastError();
27681        if (mem_base != xmlMemBlocks()) {
27682            printf("Leak of %d blocks found in xmlIOFTPOpen",
27683	           xmlMemBlocks() - mem_base);
27684	    test_ret++;
27685            printf(" %d", n_filename);
27686            printf("\n");
27687        }
27688    }
27689    function_tests++;
27690#endif
27691
27692    return(test_ret);
27693}
27694
27695
27696static int
27697test_xmlIOFTPRead(void) {
27698    int test_ret = 0;
27699
27700#if defined(LIBXML_FTP_ENABLED)
27701    int mem_base;
27702    int ret_val;
27703    void * context; /* the I/O context */
27704    int n_context;
27705    char * buffer; /* where to drop data */
27706    int n_buffer;
27707    int len; /* number of bytes to write */
27708    int n_len;
27709
27710    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27711    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27712    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27713        mem_base = xmlMemBlocks();
27714        context = gen_void_ptr(n_context, 0);
27715        buffer = gen_char_ptr(n_buffer, 1);
27716        len = gen_int(n_len, 2);
27717
27718        ret_val = xmlIOFTPRead(context, buffer, len);
27719        desret_int(ret_val);
27720        call_tests++;
27721        des_void_ptr(n_context, context, 0);
27722        des_char_ptr(n_buffer, buffer, 1);
27723        des_int(n_len, len, 2);
27724        xmlResetLastError();
27725        if (mem_base != xmlMemBlocks()) {
27726            printf("Leak of %d blocks found in xmlIOFTPRead",
27727	           xmlMemBlocks() - mem_base);
27728	    test_ret++;
27729            printf(" %d", n_context);
27730            printf(" %d", n_buffer);
27731            printf(" %d", n_len);
27732            printf("\n");
27733        }
27734    }
27735    }
27736    }
27737    function_tests++;
27738#endif
27739
27740    return(test_ret);
27741}
27742
27743
27744static int
27745test_xmlIOHTTPClose(void) {
27746    int test_ret = 0;
27747
27748#if defined(LIBXML_HTTP_ENABLED)
27749    int mem_base;
27750    int ret_val;
27751    void * context; /* the I/O context */
27752    int n_context;
27753
27754    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27755        mem_base = xmlMemBlocks();
27756        context = gen_void_ptr(n_context, 0);
27757
27758        ret_val = xmlIOHTTPClose(context);
27759        desret_int(ret_val);
27760        call_tests++;
27761        des_void_ptr(n_context, context, 0);
27762        xmlResetLastError();
27763        if (mem_base != xmlMemBlocks()) {
27764            printf("Leak of %d blocks found in xmlIOHTTPClose",
27765	           xmlMemBlocks() - mem_base);
27766	    test_ret++;
27767            printf(" %d", n_context);
27768            printf("\n");
27769        }
27770    }
27771    function_tests++;
27772#endif
27773
27774    return(test_ret);
27775}
27776
27777
27778static int
27779test_xmlIOHTTPMatch(void) {
27780    int test_ret = 0;
27781
27782#if defined(LIBXML_HTTP_ENABLED)
27783    int mem_base;
27784    int ret_val;
27785    const char * filename; /* the URI for matching */
27786    int n_filename;
27787
27788    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27789        mem_base = xmlMemBlocks();
27790        filename = gen_filepath(n_filename, 0);
27791
27792        ret_val = xmlIOHTTPMatch(filename);
27793        desret_int(ret_val);
27794        call_tests++;
27795        des_filepath(n_filename, filename, 0);
27796        xmlResetLastError();
27797        if (mem_base != xmlMemBlocks()) {
27798            printf("Leak of %d blocks found in xmlIOHTTPMatch",
27799	           xmlMemBlocks() - mem_base);
27800	    test_ret++;
27801            printf(" %d", n_filename);
27802            printf("\n");
27803        }
27804    }
27805    function_tests++;
27806#endif
27807
27808    return(test_ret);
27809}
27810
27811
27812static int
27813test_xmlIOHTTPOpen(void) {
27814    int test_ret = 0;
27815
27816#if defined(LIBXML_HTTP_ENABLED)
27817    int mem_base;
27818    void * ret_val;
27819    const char * filename; /* the URI for matching */
27820    int n_filename;
27821
27822    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27823        mem_base = xmlMemBlocks();
27824        filename = gen_filepath(n_filename, 0);
27825
27826        ret_val = xmlIOHTTPOpen(filename);
27827        desret_xmlNanoHTTPCtxtPtr(ret_val);
27828        call_tests++;
27829        des_filepath(n_filename, filename, 0);
27830        xmlResetLastError();
27831        if (mem_base != xmlMemBlocks()) {
27832            printf("Leak of %d blocks found in xmlIOHTTPOpen",
27833	           xmlMemBlocks() - mem_base);
27834	    test_ret++;
27835            printf(" %d", n_filename);
27836            printf("\n");
27837        }
27838    }
27839    function_tests++;
27840#endif
27841
27842    return(test_ret);
27843}
27844
27845
27846static int
27847test_xmlIOHTTPRead(void) {
27848    int test_ret = 0;
27849
27850#if defined(LIBXML_HTTP_ENABLED)
27851    int mem_base;
27852    int ret_val;
27853    void * context; /* the I/O context */
27854    int n_context;
27855    char * buffer; /* where to drop data */
27856    int n_buffer;
27857    int len; /* number of bytes to write */
27858    int n_len;
27859
27860    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27861    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27862    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27863        mem_base = xmlMemBlocks();
27864        context = gen_void_ptr(n_context, 0);
27865        buffer = gen_char_ptr(n_buffer, 1);
27866        len = gen_int(n_len, 2);
27867
27868        ret_val = xmlIOHTTPRead(context, buffer, len);
27869        desret_int(ret_val);
27870        call_tests++;
27871        des_void_ptr(n_context, context, 0);
27872        des_char_ptr(n_buffer, buffer, 1);
27873        des_int(n_len, len, 2);
27874        xmlResetLastError();
27875        if (mem_base != xmlMemBlocks()) {
27876            printf("Leak of %d blocks found in xmlIOHTTPRead",
27877	           xmlMemBlocks() - mem_base);
27878	    test_ret++;
27879            printf(" %d", n_context);
27880            printf(" %d", n_buffer);
27881            printf(" %d", n_len);
27882            printf("\n");
27883        }
27884    }
27885    }
27886    }
27887    function_tests++;
27888#endif
27889
27890    return(test_ret);
27891}
27892
27893
27894static int
27895test_xmlNoNetExternalEntityLoader(void) {
27896    int test_ret = 0;
27897
27898    int mem_base;
27899    xmlParserInputPtr ret_val;
27900    const char * URL; /* the URL for the entity to load */
27901    int n_URL;
27902    char * ID; /* the System ID for the entity to load */
27903    int n_ID;
27904    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27905    int n_ctxt;
27906
27907    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27908    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27909    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27910        mem_base = xmlMemBlocks();
27911        URL = gen_filepath(n_URL, 0);
27912        ID = gen_const_char_ptr(n_ID, 1);
27913        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27914
27915        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27916        desret_xmlParserInputPtr(ret_val);
27917        call_tests++;
27918        des_filepath(n_URL, URL, 0);
27919        des_const_char_ptr(n_ID, (const char *)ID, 1);
27920        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27921        xmlResetLastError();
27922        if (mem_base != xmlMemBlocks()) {
27923            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27924	           xmlMemBlocks() - mem_base);
27925	    test_ret++;
27926            printf(" %d", n_URL);
27927            printf(" %d", n_ID);
27928            printf(" %d", n_ctxt);
27929            printf("\n");
27930        }
27931    }
27932    }
27933    }
27934    function_tests++;
27935
27936    return(test_ret);
27937}
27938
27939
27940static int
27941test_xmlNormalizeWindowsPath(void) {
27942    int test_ret = 0;
27943
27944    int mem_base;
27945    xmlChar * ret_val;
27946    xmlChar * path; /* the input file path */
27947    int n_path;
27948
27949    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27950        mem_base = xmlMemBlocks();
27951        path = gen_const_xmlChar_ptr(n_path, 0);
27952
27953        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27954        desret_xmlChar_ptr(ret_val);
27955        call_tests++;
27956        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27957        xmlResetLastError();
27958        if (mem_base != xmlMemBlocks()) {
27959            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27960	           xmlMemBlocks() - mem_base);
27961	    test_ret++;
27962            printf(" %d", n_path);
27963            printf("\n");
27964        }
27965    }
27966    function_tests++;
27967
27968    return(test_ret);
27969}
27970
27971
27972static int
27973test_xmlOutputBufferCreateBuffer(void) {
27974    int test_ret = 0;
27975
27976#if defined(LIBXML_OUTPUT_ENABLED)
27977    int mem_base;
27978    xmlOutputBufferPtr ret_val;
27979    xmlBufferPtr buffer; /* a xmlBufferPtr */
27980    int n_buffer;
27981    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27982    int n_encoder;
27983
27984    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
27985    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27986        mem_base = xmlMemBlocks();
27987        buffer = gen_xmlBufferPtr(n_buffer, 0);
27988        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27989
27990        ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
27991        desret_xmlOutputBufferPtr(ret_val);
27992        call_tests++;
27993        des_xmlBufferPtr(n_buffer, buffer, 0);
27994        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27995        xmlResetLastError();
27996        if (mem_base != xmlMemBlocks()) {
27997            printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
27998	           xmlMemBlocks() - mem_base);
27999	    test_ret++;
28000            printf(" %d", n_buffer);
28001            printf(" %d", n_encoder);
28002            printf("\n");
28003        }
28004    }
28005    }
28006    function_tests++;
28007#endif
28008
28009    return(test_ret);
28010}
28011
28012
28013static int
28014test_xmlOutputBufferCreateFd(void) {
28015    int test_ret = 0;
28016
28017#if defined(LIBXML_OUTPUT_ENABLED)
28018    int mem_base;
28019    xmlOutputBufferPtr ret_val;
28020    int fd; /* a file descriptor number */
28021    int n_fd;
28022    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28023    int n_encoder;
28024
28025    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28026    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28027        mem_base = xmlMemBlocks();
28028        fd = gen_int(n_fd, 0);
28029        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28030
28031        ret_val = xmlOutputBufferCreateFd(fd, encoder);
28032        desret_xmlOutputBufferPtr(ret_val);
28033        call_tests++;
28034        des_int(n_fd, fd, 0);
28035        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28036        xmlResetLastError();
28037        if (mem_base != xmlMemBlocks()) {
28038            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28039	           xmlMemBlocks() - mem_base);
28040	    test_ret++;
28041            printf(" %d", n_fd);
28042            printf(" %d", n_encoder);
28043            printf("\n");
28044        }
28045    }
28046    }
28047    function_tests++;
28048#endif
28049
28050    return(test_ret);
28051}
28052
28053
28054static int
28055test_xmlOutputBufferCreateFile(void) {
28056    int test_ret = 0;
28057
28058#if defined(LIBXML_OUTPUT_ENABLED)
28059    int mem_base;
28060    xmlOutputBufferPtr ret_val;
28061    FILE * file; /* a FILE* */
28062    int n_file;
28063    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28064    int n_encoder;
28065
28066    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28067    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28068        mem_base = xmlMemBlocks();
28069        file = gen_FILE_ptr(n_file, 0);
28070        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28071
28072        ret_val = xmlOutputBufferCreateFile(file, encoder);
28073        desret_xmlOutputBufferPtr(ret_val);
28074        call_tests++;
28075        des_FILE_ptr(n_file, file, 0);
28076        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28077        xmlResetLastError();
28078        if (mem_base != xmlMemBlocks()) {
28079            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28080	           xmlMemBlocks() - mem_base);
28081	    test_ret++;
28082            printf(" %d", n_file);
28083            printf(" %d", n_encoder);
28084            printf("\n");
28085        }
28086    }
28087    }
28088    function_tests++;
28089#endif
28090
28091    return(test_ret);
28092}
28093
28094
28095static int
28096test_xmlOutputBufferCreateFilename(void) {
28097    int test_ret = 0;
28098
28099#if defined(LIBXML_OUTPUT_ENABLED)
28100    int mem_base;
28101    xmlOutputBufferPtr ret_val;
28102    const char * URI; /* a C string containing the URI or filename */
28103    int n_URI;
28104    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28105    int n_encoder;
28106    int compression; /* the compression ration (0 none, 9 max). */
28107    int n_compression;
28108
28109    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28110    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28111    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28112        mem_base = xmlMemBlocks();
28113        URI = gen_fileoutput(n_URI, 0);
28114        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28115        compression = gen_int(n_compression, 2);
28116
28117        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28118        desret_xmlOutputBufferPtr(ret_val);
28119        call_tests++;
28120        des_fileoutput(n_URI, URI, 0);
28121        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28122        des_int(n_compression, compression, 2);
28123        xmlResetLastError();
28124        if (mem_base != xmlMemBlocks()) {
28125            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28126	           xmlMemBlocks() - mem_base);
28127	    test_ret++;
28128            printf(" %d", n_URI);
28129            printf(" %d", n_encoder);
28130            printf(" %d", n_compression);
28131            printf("\n");
28132        }
28133    }
28134    }
28135    }
28136    function_tests++;
28137#endif
28138
28139    return(test_ret);
28140}
28141
28142
28143static int
28144test_xmlOutputBufferFlush(void) {
28145    int test_ret = 0;
28146
28147#if defined(LIBXML_OUTPUT_ENABLED)
28148    int mem_base;
28149    int ret_val;
28150    xmlOutputBufferPtr out; /* a buffered output */
28151    int n_out;
28152
28153    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28154        mem_base = xmlMemBlocks();
28155        out = gen_xmlOutputBufferPtr(n_out, 0);
28156
28157        ret_val = xmlOutputBufferFlush(out);
28158        desret_int(ret_val);
28159        call_tests++;
28160        des_xmlOutputBufferPtr(n_out, out, 0);
28161        xmlResetLastError();
28162        if (mem_base != xmlMemBlocks()) {
28163            printf("Leak of %d blocks found in xmlOutputBufferFlush",
28164	           xmlMemBlocks() - mem_base);
28165	    test_ret++;
28166            printf(" %d", n_out);
28167            printf("\n");
28168        }
28169    }
28170    function_tests++;
28171#endif
28172
28173    return(test_ret);
28174}
28175
28176
28177static int
28178test_xmlOutputBufferWrite(void) {
28179    int test_ret = 0;
28180
28181#if defined(LIBXML_OUTPUT_ENABLED)
28182    int mem_base;
28183    int ret_val;
28184    xmlOutputBufferPtr out; /* a buffered parser output */
28185    int n_out;
28186    int len; /* the size in bytes of the array. */
28187    int n_len;
28188    char * buf; /* an char array */
28189    int n_buf;
28190
28191    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28192    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28193    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28194        mem_base = xmlMemBlocks();
28195        out = gen_xmlOutputBufferPtr(n_out, 0);
28196        len = gen_int(n_len, 1);
28197        buf = gen_const_char_ptr(n_buf, 2);
28198
28199        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28200        desret_int(ret_val);
28201        call_tests++;
28202        des_xmlOutputBufferPtr(n_out, out, 0);
28203        des_int(n_len, len, 1);
28204        des_const_char_ptr(n_buf, (const char *)buf, 2);
28205        xmlResetLastError();
28206        if (mem_base != xmlMemBlocks()) {
28207            printf("Leak of %d blocks found in xmlOutputBufferWrite",
28208	           xmlMemBlocks() - mem_base);
28209	    test_ret++;
28210            printf(" %d", n_out);
28211            printf(" %d", n_len);
28212            printf(" %d", n_buf);
28213            printf("\n");
28214        }
28215    }
28216    }
28217    }
28218    function_tests++;
28219#endif
28220
28221    return(test_ret);
28222}
28223
28224
28225static int
28226test_xmlOutputBufferWriteEscape(void) {
28227    int test_ret = 0;
28228
28229
28230    /* missing type support */
28231    return(test_ret);
28232}
28233
28234
28235static int
28236test_xmlOutputBufferWriteString(void) {
28237    int test_ret = 0;
28238
28239#if defined(LIBXML_OUTPUT_ENABLED)
28240    int mem_base;
28241    int ret_val;
28242    xmlOutputBufferPtr out; /* a buffered parser output */
28243    int n_out;
28244    char * str; /* a zero terminated C string */
28245    int n_str;
28246
28247    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28248    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28249        mem_base = xmlMemBlocks();
28250        out = gen_xmlOutputBufferPtr(n_out, 0);
28251        str = gen_const_char_ptr(n_str, 1);
28252
28253        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28254        desret_int(ret_val);
28255        call_tests++;
28256        des_xmlOutputBufferPtr(n_out, out, 0);
28257        des_const_char_ptr(n_str, (const char *)str, 1);
28258        xmlResetLastError();
28259        if (mem_base != xmlMemBlocks()) {
28260            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28261	           xmlMemBlocks() - mem_base);
28262	    test_ret++;
28263            printf(" %d", n_out);
28264            printf(" %d", n_str);
28265            printf("\n");
28266        }
28267    }
28268    }
28269    function_tests++;
28270#endif
28271
28272    return(test_ret);
28273}
28274
28275
28276static int
28277test_xmlParserGetDirectory(void) {
28278    int test_ret = 0;
28279
28280
28281    /* missing type support */
28282    return(test_ret);
28283}
28284
28285
28286static int
28287test_xmlParserInputBufferCreateFd(void) {
28288    int test_ret = 0;
28289
28290    int mem_base;
28291    xmlParserInputBufferPtr ret_val;
28292    int fd; /* a file descriptor number */
28293    int n_fd;
28294    xmlCharEncoding enc; /* the charset encoding if known */
28295    int n_enc;
28296
28297    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28298    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28299        mem_base = xmlMemBlocks();
28300        fd = gen_int(n_fd, 0);
28301        enc = gen_xmlCharEncoding(n_enc, 1);
28302        if (fd >= 0) fd = -1;
28303
28304        ret_val = xmlParserInputBufferCreateFd(fd, enc);
28305        desret_xmlParserInputBufferPtr(ret_val);
28306        call_tests++;
28307        des_int(n_fd, fd, 0);
28308        des_xmlCharEncoding(n_enc, enc, 1);
28309        xmlResetLastError();
28310        if (mem_base != xmlMemBlocks()) {
28311            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28312	           xmlMemBlocks() - mem_base);
28313	    test_ret++;
28314            printf(" %d", n_fd);
28315            printf(" %d", n_enc);
28316            printf("\n");
28317        }
28318    }
28319    }
28320    function_tests++;
28321
28322    return(test_ret);
28323}
28324
28325
28326static int
28327test_xmlParserInputBufferCreateFile(void) {
28328    int test_ret = 0;
28329
28330    int mem_base;
28331    xmlParserInputBufferPtr ret_val;
28332    FILE * file; /* a FILE* */
28333    int n_file;
28334    xmlCharEncoding enc; /* the charset encoding if known */
28335    int n_enc;
28336
28337    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28338    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28339        mem_base = xmlMemBlocks();
28340        file = gen_FILE_ptr(n_file, 0);
28341        enc = gen_xmlCharEncoding(n_enc, 1);
28342
28343        ret_val = xmlParserInputBufferCreateFile(file, enc);
28344        desret_xmlParserInputBufferPtr(ret_val);
28345        call_tests++;
28346        des_FILE_ptr(n_file, file, 0);
28347        des_xmlCharEncoding(n_enc, enc, 1);
28348        xmlResetLastError();
28349        if (mem_base != xmlMemBlocks()) {
28350            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28351	           xmlMemBlocks() - mem_base);
28352	    test_ret++;
28353            printf(" %d", n_file);
28354            printf(" %d", n_enc);
28355            printf("\n");
28356        }
28357    }
28358    }
28359    function_tests++;
28360
28361    return(test_ret);
28362}
28363
28364
28365static int
28366test_xmlParserInputBufferCreateFilename(void) {
28367    int test_ret = 0;
28368
28369    int mem_base;
28370    xmlParserInputBufferPtr ret_val;
28371    const char * URI; /* a C string containing the URI or filename */
28372    int n_URI;
28373    xmlCharEncoding enc; /* the charset encoding if known */
28374    int n_enc;
28375
28376    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28377    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28378        mem_base = xmlMemBlocks();
28379        URI = gen_fileoutput(n_URI, 0);
28380        enc = gen_xmlCharEncoding(n_enc, 1);
28381
28382        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28383        desret_xmlParserInputBufferPtr(ret_val);
28384        call_tests++;
28385        des_fileoutput(n_URI, URI, 0);
28386        des_xmlCharEncoding(n_enc, enc, 1);
28387        xmlResetLastError();
28388        if (mem_base != xmlMemBlocks()) {
28389            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28390	           xmlMemBlocks() - mem_base);
28391	    test_ret++;
28392            printf(" %d", n_URI);
28393            printf(" %d", n_enc);
28394            printf("\n");
28395        }
28396    }
28397    }
28398    function_tests++;
28399
28400    return(test_ret);
28401}
28402
28403
28404static int
28405test_xmlParserInputBufferCreateMem(void) {
28406    int test_ret = 0;
28407
28408    int mem_base;
28409    xmlParserInputBufferPtr ret_val;
28410    char * mem; /* the memory input */
28411    int n_mem;
28412    int size; /* the length of the memory block */
28413    int n_size;
28414    xmlCharEncoding enc; /* the charset encoding if known */
28415    int n_enc;
28416
28417    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28418    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28419    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28420        mem_base = xmlMemBlocks();
28421        mem = gen_const_char_ptr(n_mem, 0);
28422        size = gen_int(n_size, 1);
28423        enc = gen_xmlCharEncoding(n_enc, 2);
28424
28425        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28426        desret_xmlParserInputBufferPtr(ret_val);
28427        call_tests++;
28428        des_const_char_ptr(n_mem, (const char *)mem, 0);
28429        des_int(n_size, size, 1);
28430        des_xmlCharEncoding(n_enc, enc, 2);
28431        xmlResetLastError();
28432        if (mem_base != xmlMemBlocks()) {
28433            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28434	           xmlMemBlocks() - mem_base);
28435	    test_ret++;
28436            printf(" %d", n_mem);
28437            printf(" %d", n_size);
28438            printf(" %d", n_enc);
28439            printf("\n");
28440        }
28441    }
28442    }
28443    }
28444    function_tests++;
28445
28446    return(test_ret);
28447}
28448
28449
28450static int
28451test_xmlParserInputBufferCreateStatic(void) {
28452    int test_ret = 0;
28453
28454    int mem_base;
28455    xmlParserInputBufferPtr ret_val;
28456    char * mem; /* the memory input */
28457    int n_mem;
28458    int size; /* the length of the memory block */
28459    int n_size;
28460    xmlCharEncoding enc; /* the charset encoding if known */
28461    int n_enc;
28462
28463    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28464    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28465    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28466        mem_base = xmlMemBlocks();
28467        mem = gen_const_char_ptr(n_mem, 0);
28468        size = gen_int(n_size, 1);
28469        enc = gen_xmlCharEncoding(n_enc, 2);
28470
28471        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28472        desret_xmlParserInputBufferPtr(ret_val);
28473        call_tests++;
28474        des_const_char_ptr(n_mem, (const char *)mem, 0);
28475        des_int(n_size, size, 1);
28476        des_xmlCharEncoding(n_enc, enc, 2);
28477        xmlResetLastError();
28478        if (mem_base != xmlMemBlocks()) {
28479            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28480	           xmlMemBlocks() - mem_base);
28481	    test_ret++;
28482            printf(" %d", n_mem);
28483            printf(" %d", n_size);
28484            printf(" %d", n_enc);
28485            printf("\n");
28486        }
28487    }
28488    }
28489    }
28490    function_tests++;
28491
28492    return(test_ret);
28493}
28494
28495
28496static int
28497test_xmlParserInputBufferGrow(void) {
28498    int test_ret = 0;
28499
28500    int mem_base;
28501    int ret_val;
28502    xmlParserInputBufferPtr in; /* a buffered parser input */
28503    int n_in;
28504    int len; /* indicative value of the amount of chars to read */
28505    int n_len;
28506
28507    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28508    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28509        mem_base = xmlMemBlocks();
28510        in = gen_xmlParserInputBufferPtr(n_in, 0);
28511        len = gen_int(n_len, 1);
28512
28513        ret_val = xmlParserInputBufferGrow(in, len);
28514        desret_int(ret_val);
28515        call_tests++;
28516        des_xmlParserInputBufferPtr(n_in, in, 0);
28517        des_int(n_len, len, 1);
28518        xmlResetLastError();
28519        if (mem_base != xmlMemBlocks()) {
28520            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28521	           xmlMemBlocks() - mem_base);
28522	    test_ret++;
28523            printf(" %d", n_in);
28524            printf(" %d", n_len);
28525            printf("\n");
28526        }
28527    }
28528    }
28529    function_tests++;
28530
28531    return(test_ret);
28532}
28533
28534
28535static int
28536test_xmlParserInputBufferPush(void) {
28537    int test_ret = 0;
28538
28539    int mem_base;
28540    int ret_val;
28541    xmlParserInputBufferPtr in; /* a buffered parser input */
28542    int n_in;
28543    int len; /* the size in bytes of the array. */
28544    int n_len;
28545    char * buf; /* an char array */
28546    int n_buf;
28547
28548    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28549    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28550    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28551        mem_base = xmlMemBlocks();
28552        in = gen_xmlParserInputBufferPtr(n_in, 0);
28553        len = gen_int(n_len, 1);
28554        buf = gen_const_char_ptr(n_buf, 2);
28555
28556        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28557        desret_int(ret_val);
28558        call_tests++;
28559        des_xmlParserInputBufferPtr(n_in, in, 0);
28560        des_int(n_len, len, 1);
28561        des_const_char_ptr(n_buf, (const char *)buf, 2);
28562        xmlResetLastError();
28563        if (mem_base != xmlMemBlocks()) {
28564            printf("Leak of %d blocks found in xmlParserInputBufferPush",
28565	           xmlMemBlocks() - mem_base);
28566	    test_ret++;
28567            printf(" %d", n_in);
28568            printf(" %d", n_len);
28569            printf(" %d", n_buf);
28570            printf("\n");
28571        }
28572    }
28573    }
28574    }
28575    function_tests++;
28576
28577    return(test_ret);
28578}
28579
28580
28581static int
28582test_xmlParserInputBufferRead(void) {
28583    int test_ret = 0;
28584
28585    int mem_base;
28586    int ret_val;
28587    xmlParserInputBufferPtr in; /* a buffered parser input */
28588    int n_in;
28589    int len; /* indicative value of the amount of chars to read */
28590    int n_len;
28591
28592    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28593    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28594        mem_base = xmlMemBlocks();
28595        in = gen_xmlParserInputBufferPtr(n_in, 0);
28596        len = gen_int(n_len, 1);
28597
28598        ret_val = xmlParserInputBufferRead(in, len);
28599        desret_int(ret_val);
28600        call_tests++;
28601        des_xmlParserInputBufferPtr(n_in, in, 0);
28602        des_int(n_len, len, 1);
28603        xmlResetLastError();
28604        if (mem_base != xmlMemBlocks()) {
28605            printf("Leak of %d blocks found in xmlParserInputBufferRead",
28606	           xmlMemBlocks() - mem_base);
28607	    test_ret++;
28608            printf(" %d", n_in);
28609            printf(" %d", n_len);
28610            printf("\n");
28611        }
28612    }
28613    }
28614    function_tests++;
28615
28616    return(test_ret);
28617}
28618
28619
28620static int
28621test_xmlPopInputCallbacks(void) {
28622    int test_ret = 0;
28623
28624    int mem_base;
28625    int ret_val;
28626
28627        mem_base = xmlMemBlocks();
28628
28629        ret_val = xmlPopInputCallbacks();
28630        desret_int(ret_val);
28631        call_tests++;
28632        xmlResetLastError();
28633        if (mem_base != xmlMemBlocks()) {
28634            printf("Leak of %d blocks found in xmlPopInputCallbacks",
28635	           xmlMemBlocks() - mem_base);
28636	    test_ret++;
28637            printf("\n");
28638        }
28639    function_tests++;
28640
28641    return(test_ret);
28642}
28643
28644
28645static int
28646test_xmlRegisterDefaultInputCallbacks(void) {
28647    int test_ret = 0;
28648
28649    int mem_base;
28650
28651        mem_base = xmlMemBlocks();
28652
28653        xmlRegisterDefaultInputCallbacks();
28654        call_tests++;
28655        xmlResetLastError();
28656        if (mem_base != xmlMemBlocks()) {
28657            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28658	           xmlMemBlocks() - mem_base);
28659	    test_ret++;
28660            printf("\n");
28661        }
28662    function_tests++;
28663
28664    return(test_ret);
28665}
28666
28667
28668static int
28669test_xmlRegisterDefaultOutputCallbacks(void) {
28670    int test_ret = 0;
28671
28672#if defined(LIBXML_OUTPUT_ENABLED)
28673    int mem_base;
28674
28675        mem_base = xmlMemBlocks();
28676
28677        xmlRegisterDefaultOutputCallbacks();
28678        call_tests++;
28679        xmlResetLastError();
28680        if (mem_base != xmlMemBlocks()) {
28681            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28682	           xmlMemBlocks() - mem_base);
28683	    test_ret++;
28684            printf("\n");
28685        }
28686    function_tests++;
28687#endif
28688
28689    return(test_ret);
28690}
28691
28692
28693static int
28694test_xmlRegisterHTTPPostCallbacks(void) {
28695    int test_ret = 0;
28696
28697#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28698    int mem_base;
28699
28700        mem_base = xmlMemBlocks();
28701
28702        xmlRegisterHTTPPostCallbacks();
28703        call_tests++;
28704        xmlResetLastError();
28705        if (mem_base != xmlMemBlocks()) {
28706            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28707	           xmlMemBlocks() - mem_base);
28708	    test_ret++;
28709            printf("\n");
28710        }
28711    function_tests++;
28712#endif
28713
28714    return(test_ret);
28715}
28716
28717static int
28718test_xmlIO(void) {
28719    int test_ret = 0;
28720
28721    if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28722    test_ret += test_xmlAllocOutputBuffer();
28723    test_ret += test_xmlAllocParserInputBuffer();
28724    test_ret += test_xmlCheckFilename();
28725    test_ret += test_xmlCheckHTTPInput();
28726    test_ret += test_xmlCleanupInputCallbacks();
28727    test_ret += test_xmlCleanupOutputCallbacks();
28728    test_ret += test_xmlFileClose();
28729    test_ret += test_xmlFileMatch();
28730    test_ret += test_xmlFileOpen();
28731    test_ret += test_xmlFileRead();
28732    test_ret += test_xmlIOFTPClose();
28733    test_ret += test_xmlIOFTPMatch();
28734    test_ret += test_xmlIOFTPOpen();
28735    test_ret += test_xmlIOFTPRead();
28736    test_ret += test_xmlIOHTTPClose();
28737    test_ret += test_xmlIOHTTPMatch();
28738    test_ret += test_xmlIOHTTPOpen();
28739    test_ret += test_xmlIOHTTPRead();
28740    test_ret += test_xmlNoNetExternalEntityLoader();
28741    test_ret += test_xmlNormalizeWindowsPath();
28742    test_ret += test_xmlOutputBufferCreateBuffer();
28743    test_ret += test_xmlOutputBufferCreateFd();
28744    test_ret += test_xmlOutputBufferCreateFile();
28745    test_ret += test_xmlOutputBufferCreateFilename();
28746    test_ret += test_xmlOutputBufferFlush();
28747    test_ret += test_xmlOutputBufferWrite();
28748    test_ret += test_xmlOutputBufferWriteEscape();
28749    test_ret += test_xmlOutputBufferWriteString();
28750    test_ret += test_xmlParserGetDirectory();
28751    test_ret += test_xmlParserInputBufferCreateFd();
28752    test_ret += test_xmlParserInputBufferCreateFile();
28753    test_ret += test_xmlParserInputBufferCreateFilename();
28754    test_ret += test_xmlParserInputBufferCreateMem();
28755    test_ret += test_xmlParserInputBufferCreateStatic();
28756    test_ret += test_xmlParserInputBufferGrow();
28757    test_ret += test_xmlParserInputBufferPush();
28758    test_ret += test_xmlParserInputBufferRead();
28759    test_ret += test_xmlPopInputCallbacks();
28760    test_ret += test_xmlRegisterDefaultInputCallbacks();
28761    test_ret += test_xmlRegisterDefaultOutputCallbacks();
28762    test_ret += test_xmlRegisterHTTPPostCallbacks();
28763
28764    if (test_ret != 0)
28765	printf("Module xmlIO: %d errors\n", test_ret);
28766    return(test_ret);
28767}
28768#ifdef LIBXML_AUTOMATA_ENABLED
28769
28770#define gen_nb_xmlAutomataPtr 1
28771static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28772    return(NULL);
28773}
28774static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28775}
28776#endif
28777
28778
28779static int
28780test_xmlAutomataCompile(void) {
28781    int test_ret = 0;
28782
28783
28784    /* missing type support */
28785    return(test_ret);
28786}
28787
28788
28789static int
28790test_xmlAutomataGetInitState(void) {
28791    int test_ret = 0;
28792
28793
28794    /* missing type support */
28795    return(test_ret);
28796}
28797
28798
28799static int
28800test_xmlAutomataIsDeterminist(void) {
28801    int test_ret = 0;
28802
28803#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28804    int mem_base;
28805    int ret_val;
28806    xmlAutomataPtr am; /* an automata */
28807    int n_am;
28808
28809    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28810        mem_base = xmlMemBlocks();
28811        am = gen_xmlAutomataPtr(n_am, 0);
28812
28813        ret_val = xmlAutomataIsDeterminist(am);
28814        desret_int(ret_val);
28815        call_tests++;
28816        des_xmlAutomataPtr(n_am, am, 0);
28817        xmlResetLastError();
28818        if (mem_base != xmlMemBlocks()) {
28819            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28820	           xmlMemBlocks() - mem_base);
28821	    test_ret++;
28822            printf(" %d", n_am);
28823            printf("\n");
28824        }
28825    }
28826    function_tests++;
28827#endif
28828
28829    return(test_ret);
28830}
28831
28832#ifdef LIBXML_AUTOMATA_ENABLED
28833
28834#define gen_nb_xmlAutomataStatePtr 1
28835static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28836    return(NULL);
28837}
28838static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28839}
28840#endif
28841
28842
28843static int
28844test_xmlAutomataNewAllTrans(void) {
28845    int test_ret = 0;
28846
28847
28848    /* missing type support */
28849    return(test_ret);
28850}
28851
28852
28853static int
28854test_xmlAutomataNewCountTrans(void) {
28855    int test_ret = 0;
28856
28857
28858    /* missing type support */
28859    return(test_ret);
28860}
28861
28862
28863static int
28864test_xmlAutomataNewCountTrans2(void) {
28865    int test_ret = 0;
28866
28867
28868    /* missing type support */
28869    return(test_ret);
28870}
28871
28872
28873static int
28874test_xmlAutomataNewCountedTrans(void) {
28875    int test_ret = 0;
28876
28877
28878    /* missing type support */
28879    return(test_ret);
28880}
28881
28882
28883static int
28884test_xmlAutomataNewCounter(void) {
28885    int test_ret = 0;
28886
28887#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28888    int mem_base;
28889    int ret_val;
28890    xmlAutomataPtr am; /* an automata */
28891    int n_am;
28892    int min; /* the minimal value on the counter */
28893    int n_min;
28894    int max; /* the maximal value on the counter */
28895    int n_max;
28896
28897    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28898    for (n_min = 0;n_min < gen_nb_int;n_min++) {
28899    for (n_max = 0;n_max < gen_nb_int;n_max++) {
28900        mem_base = xmlMemBlocks();
28901        am = gen_xmlAutomataPtr(n_am, 0);
28902        min = gen_int(n_min, 1);
28903        max = gen_int(n_max, 2);
28904
28905        ret_val = xmlAutomataNewCounter(am, min, max);
28906        desret_int(ret_val);
28907        call_tests++;
28908        des_xmlAutomataPtr(n_am, am, 0);
28909        des_int(n_min, min, 1);
28910        des_int(n_max, max, 2);
28911        xmlResetLastError();
28912        if (mem_base != xmlMemBlocks()) {
28913            printf("Leak of %d blocks found in xmlAutomataNewCounter",
28914	           xmlMemBlocks() - mem_base);
28915	    test_ret++;
28916            printf(" %d", n_am);
28917            printf(" %d", n_min);
28918            printf(" %d", n_max);
28919            printf("\n");
28920        }
28921    }
28922    }
28923    }
28924    function_tests++;
28925#endif
28926
28927    return(test_ret);
28928}
28929
28930
28931static int
28932test_xmlAutomataNewCounterTrans(void) {
28933    int test_ret = 0;
28934
28935
28936    /* missing type support */
28937    return(test_ret);
28938}
28939
28940
28941static int
28942test_xmlAutomataNewEpsilon(void) {
28943    int test_ret = 0;
28944
28945
28946    /* missing type support */
28947    return(test_ret);
28948}
28949
28950
28951static int
28952test_xmlAutomataNewNegTrans(void) {
28953    int test_ret = 0;
28954
28955
28956    /* missing type support */
28957    return(test_ret);
28958}
28959
28960
28961static int
28962test_xmlAutomataNewOnceTrans(void) {
28963    int test_ret = 0;
28964
28965
28966    /* missing type support */
28967    return(test_ret);
28968}
28969
28970
28971static int
28972test_xmlAutomataNewOnceTrans2(void) {
28973    int test_ret = 0;
28974
28975
28976    /* missing type support */
28977    return(test_ret);
28978}
28979
28980
28981static int
28982test_xmlAutomataNewState(void) {
28983    int test_ret = 0;
28984
28985
28986    /* missing type support */
28987    return(test_ret);
28988}
28989
28990
28991static int
28992test_xmlAutomataNewTransition(void) {
28993    int test_ret = 0;
28994
28995
28996    /* missing type support */
28997    return(test_ret);
28998}
28999
29000
29001static int
29002test_xmlAutomataNewTransition2(void) {
29003    int test_ret = 0;
29004
29005
29006    /* missing type support */
29007    return(test_ret);
29008}
29009
29010
29011static int
29012test_xmlAutomataSetFinalState(void) {
29013    int test_ret = 0;
29014
29015#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29016    int mem_base;
29017    int ret_val;
29018    xmlAutomataPtr am; /* an automata */
29019    int n_am;
29020    xmlAutomataStatePtr state; /* a state in this automata */
29021    int n_state;
29022
29023    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29024    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29025        mem_base = xmlMemBlocks();
29026        am = gen_xmlAutomataPtr(n_am, 0);
29027        state = gen_xmlAutomataStatePtr(n_state, 1);
29028
29029        ret_val = xmlAutomataSetFinalState(am, state);
29030        desret_int(ret_val);
29031        call_tests++;
29032        des_xmlAutomataPtr(n_am, am, 0);
29033        des_xmlAutomataStatePtr(n_state, state, 1);
29034        xmlResetLastError();
29035        if (mem_base != xmlMemBlocks()) {
29036            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29037	           xmlMemBlocks() - mem_base);
29038	    test_ret++;
29039            printf(" %d", n_am);
29040            printf(" %d", n_state);
29041            printf("\n");
29042        }
29043    }
29044    }
29045    function_tests++;
29046#endif
29047
29048    return(test_ret);
29049}
29050
29051
29052static int
29053test_xmlNewAutomata(void) {
29054    int test_ret = 0;
29055
29056
29057    /* missing type support */
29058    return(test_ret);
29059}
29060
29061static int
29062test_xmlautomata(void) {
29063    int test_ret = 0;
29064
29065    if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29066    test_ret += test_xmlAutomataCompile();
29067    test_ret += test_xmlAutomataGetInitState();
29068    test_ret += test_xmlAutomataIsDeterminist();
29069    test_ret += test_xmlAutomataNewAllTrans();
29070    test_ret += test_xmlAutomataNewCountTrans();
29071    test_ret += test_xmlAutomataNewCountTrans2();
29072    test_ret += test_xmlAutomataNewCountedTrans();
29073    test_ret += test_xmlAutomataNewCounter();
29074    test_ret += test_xmlAutomataNewCounterTrans();
29075    test_ret += test_xmlAutomataNewEpsilon();
29076    test_ret += test_xmlAutomataNewNegTrans();
29077    test_ret += test_xmlAutomataNewOnceTrans();
29078    test_ret += test_xmlAutomataNewOnceTrans2();
29079    test_ret += test_xmlAutomataNewState();
29080    test_ret += test_xmlAutomataNewTransition();
29081    test_ret += test_xmlAutomataNewTransition2();
29082    test_ret += test_xmlAutomataSetFinalState();
29083    test_ret += test_xmlNewAutomata();
29084
29085    if (test_ret != 0)
29086	printf("Module xmlautomata: %d errors\n", test_ret);
29087    return(test_ret);
29088}
29089
29090#define gen_nb_xmlGenericErrorFunc_ptr 1
29091static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29092    return(NULL);
29093}
29094static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29095}
29096
29097static int
29098test_initGenericErrorDefaultFunc(void) {
29099    int test_ret = 0;
29100
29101    int mem_base;
29102    xmlGenericErrorFunc * handler; /* the handler */
29103    int n_handler;
29104
29105    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29106        mem_base = xmlMemBlocks();
29107        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29108
29109        initGenericErrorDefaultFunc(handler);
29110        call_tests++;
29111        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29112        xmlResetLastError();
29113        if (mem_base != xmlMemBlocks()) {
29114            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29115	           xmlMemBlocks() - mem_base);
29116	    test_ret++;
29117            printf(" %d", n_handler);
29118            printf("\n");
29119        }
29120    }
29121    function_tests++;
29122
29123    return(test_ret);
29124}
29125
29126
29127#define gen_nb_xmlErrorPtr 1
29128static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29129    return(NULL);
29130}
29131static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29132}
29133
29134static int
29135test_xmlCopyError(void) {
29136    int test_ret = 0;
29137
29138    int mem_base;
29139    int ret_val;
29140    xmlErrorPtr from; /* a source error */
29141    int n_from;
29142    xmlErrorPtr to; /* a target error */
29143    int n_to;
29144
29145    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29146    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29147        mem_base = xmlMemBlocks();
29148        from = gen_xmlErrorPtr(n_from, 0);
29149        to = gen_xmlErrorPtr(n_to, 1);
29150
29151        ret_val = xmlCopyError(from, to);
29152        desret_int(ret_val);
29153        call_tests++;
29154        des_xmlErrorPtr(n_from, from, 0);
29155        des_xmlErrorPtr(n_to, to, 1);
29156        xmlResetLastError();
29157        if (mem_base != xmlMemBlocks()) {
29158            printf("Leak of %d blocks found in xmlCopyError",
29159	           xmlMemBlocks() - mem_base);
29160	    test_ret++;
29161            printf(" %d", n_from);
29162            printf(" %d", n_to);
29163            printf("\n");
29164        }
29165    }
29166    }
29167    function_tests++;
29168
29169    return(test_ret);
29170}
29171
29172
29173static int
29174test_xmlCtxtGetLastError(void) {
29175    int test_ret = 0;
29176
29177
29178    /* missing type support */
29179    return(test_ret);
29180}
29181
29182
29183static int
29184test_xmlCtxtResetLastError(void) {
29185    int test_ret = 0;
29186
29187    int mem_base;
29188    void * ctx; /* an XML parser context */
29189    int n_ctx;
29190
29191    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29192        mem_base = xmlMemBlocks();
29193        ctx = gen_void_ptr(n_ctx, 0);
29194
29195        xmlCtxtResetLastError(ctx);
29196        call_tests++;
29197        des_void_ptr(n_ctx, ctx, 0);
29198        xmlResetLastError();
29199        if (mem_base != xmlMemBlocks()) {
29200            printf("Leak of %d blocks found in xmlCtxtResetLastError",
29201	           xmlMemBlocks() - mem_base);
29202	    test_ret++;
29203            printf(" %d", n_ctx);
29204            printf("\n");
29205        }
29206    }
29207    function_tests++;
29208
29209    return(test_ret);
29210}
29211
29212
29213static int
29214test_xmlGetLastError(void) {
29215    int test_ret = 0;
29216
29217
29218    /* missing type support */
29219    return(test_ret);
29220}
29221
29222
29223static int
29224test_xmlParserError(void) {
29225    int test_ret = 0;
29226
29227
29228    /* missing type support */
29229    return(test_ret);
29230}
29231
29232
29233static int
29234test_xmlParserPrintFileContext(void) {
29235    int test_ret = 0;
29236
29237    int mem_base;
29238    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29239    int n_input;
29240
29241    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29242        mem_base = xmlMemBlocks();
29243        input = gen_xmlParserInputPtr(n_input, 0);
29244
29245        xmlParserPrintFileContext(input);
29246        call_tests++;
29247        des_xmlParserInputPtr(n_input, input, 0);
29248        xmlResetLastError();
29249        if (mem_base != xmlMemBlocks()) {
29250            printf("Leak of %d blocks found in xmlParserPrintFileContext",
29251	           xmlMemBlocks() - mem_base);
29252	    test_ret++;
29253            printf(" %d", n_input);
29254            printf("\n");
29255        }
29256    }
29257    function_tests++;
29258
29259    return(test_ret);
29260}
29261
29262
29263static int
29264test_xmlParserPrintFileInfo(void) {
29265    int test_ret = 0;
29266
29267    int mem_base;
29268    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29269    int n_input;
29270
29271    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29272        mem_base = xmlMemBlocks();
29273        input = gen_xmlParserInputPtr(n_input, 0);
29274
29275        xmlParserPrintFileInfo(input);
29276        call_tests++;
29277        des_xmlParserInputPtr(n_input, input, 0);
29278        xmlResetLastError();
29279        if (mem_base != xmlMemBlocks()) {
29280            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29281	           xmlMemBlocks() - mem_base);
29282	    test_ret++;
29283            printf(" %d", n_input);
29284            printf("\n");
29285        }
29286    }
29287    function_tests++;
29288
29289    return(test_ret);
29290}
29291
29292
29293static int
29294test_xmlParserValidityError(void) {
29295    int test_ret = 0;
29296
29297
29298    /* missing type support */
29299    return(test_ret);
29300}
29301
29302
29303static int
29304test_xmlParserValidityWarning(void) {
29305    int test_ret = 0;
29306
29307
29308    /* missing type support */
29309    return(test_ret);
29310}
29311
29312
29313static int
29314test_xmlParserWarning(void) {
29315    int test_ret = 0;
29316
29317
29318    /* missing type support */
29319    return(test_ret);
29320}
29321
29322
29323static int
29324test_xmlResetError(void) {
29325    int test_ret = 0;
29326
29327    int mem_base;
29328    xmlErrorPtr err; /* pointer to the error. */
29329    int n_err;
29330
29331    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29332        mem_base = xmlMemBlocks();
29333        err = gen_xmlErrorPtr(n_err, 0);
29334
29335        xmlResetError(err);
29336        call_tests++;
29337        des_xmlErrorPtr(n_err, err, 0);
29338        xmlResetLastError();
29339        if (mem_base != xmlMemBlocks()) {
29340            printf("Leak of %d blocks found in xmlResetError",
29341	           xmlMemBlocks() - mem_base);
29342	    test_ret++;
29343            printf(" %d", n_err);
29344            printf("\n");
29345        }
29346    }
29347    function_tests++;
29348
29349    return(test_ret);
29350}
29351
29352
29353static int
29354test_xmlResetLastError(void) {
29355    int test_ret = 0;
29356
29357
29358
29359        xmlResetLastError();
29360        call_tests++;
29361        xmlResetLastError();
29362    function_tests++;
29363
29364    return(test_ret);
29365}
29366
29367
29368static int
29369test_xmlSetGenericErrorFunc(void) {
29370    int test_ret = 0;
29371
29372
29373    /* missing type support */
29374    return(test_ret);
29375}
29376
29377
29378static int
29379test_xmlSetStructuredErrorFunc(void) {
29380    int test_ret = 0;
29381
29382
29383    /* missing type support */
29384    return(test_ret);
29385}
29386
29387static int
29388test_xmlerror(void) {
29389    int test_ret = 0;
29390
29391    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29392    test_ret += test_initGenericErrorDefaultFunc();
29393    test_ret += test_xmlCopyError();
29394    test_ret += test_xmlCtxtGetLastError();
29395    test_ret += test_xmlCtxtResetLastError();
29396    test_ret += test_xmlGetLastError();
29397    test_ret += test_xmlParserError();
29398    test_ret += test_xmlParserPrintFileContext();
29399    test_ret += test_xmlParserPrintFileInfo();
29400    test_ret += test_xmlParserValidityError();
29401    test_ret += test_xmlParserValidityWarning();
29402    test_ret += test_xmlParserWarning();
29403    test_ret += test_xmlResetError();
29404    test_ret += test_xmlResetLastError();
29405    test_ret += test_xmlSetGenericErrorFunc();
29406    test_ret += test_xmlSetStructuredErrorFunc();
29407
29408    if (test_ret != 0)
29409	printf("Module xmlerror: %d errors\n", test_ret);
29410    return(test_ret);
29411}
29412#ifdef LIBXML_MODULES_ENABLED
29413
29414#define gen_nb_xmlModulePtr 1
29415static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29416    return(NULL);
29417}
29418static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29419}
29420#endif
29421
29422
29423static int
29424test_xmlModuleClose(void) {
29425    int test_ret = 0;
29426
29427#if defined(LIBXML_MODULES_ENABLED)
29428    int mem_base;
29429    int ret_val;
29430    xmlModulePtr module; /* the module handle */
29431    int n_module;
29432
29433    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29434        mem_base = xmlMemBlocks();
29435        module = gen_xmlModulePtr(n_module, 0);
29436
29437        ret_val = xmlModuleClose(module);
29438        desret_int(ret_val);
29439        call_tests++;
29440        des_xmlModulePtr(n_module, module, 0);
29441        xmlResetLastError();
29442        if (mem_base != xmlMemBlocks()) {
29443            printf("Leak of %d blocks found in xmlModuleClose",
29444	           xmlMemBlocks() - mem_base);
29445	    test_ret++;
29446            printf(" %d", n_module);
29447            printf("\n");
29448        }
29449    }
29450    function_tests++;
29451#endif
29452
29453    return(test_ret);
29454}
29455
29456
29457static int
29458test_xmlModuleOpen(void) {
29459    int test_ret = 0;
29460
29461
29462    /* missing type support */
29463    return(test_ret);
29464}
29465
29466
29467static int
29468test_xmlModuleSymbol(void) {
29469    int test_ret = 0;
29470
29471#if defined(LIBXML_MODULES_ENABLED)
29472    int mem_base;
29473    int ret_val;
29474    xmlModulePtr module; /* the module */
29475    int n_module;
29476    char * name; /* the name of the symbol */
29477    int n_name;
29478    void ** symbol; /* the resulting symbol address */
29479    int n_symbol;
29480
29481    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29482    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29483    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29484        mem_base = xmlMemBlocks();
29485        module = gen_xmlModulePtr(n_module, 0);
29486        name = gen_const_char_ptr(n_name, 1);
29487        symbol = gen_void_ptr_ptr(n_symbol, 2);
29488
29489        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29490        desret_int(ret_val);
29491        call_tests++;
29492        des_xmlModulePtr(n_module, module, 0);
29493        des_const_char_ptr(n_name, (const char *)name, 1);
29494        des_void_ptr_ptr(n_symbol, symbol, 2);
29495        xmlResetLastError();
29496        if (mem_base != xmlMemBlocks()) {
29497            printf("Leak of %d blocks found in xmlModuleSymbol",
29498	           xmlMemBlocks() - mem_base);
29499	    test_ret++;
29500            printf(" %d", n_module);
29501            printf(" %d", n_name);
29502            printf(" %d", n_symbol);
29503            printf("\n");
29504        }
29505    }
29506    }
29507    }
29508    function_tests++;
29509#endif
29510
29511    return(test_ret);
29512}
29513
29514static int
29515test_xmlmodule(void) {
29516    int test_ret = 0;
29517
29518    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29519    test_ret += test_xmlModuleClose();
29520    test_ret += test_xmlModuleOpen();
29521    test_ret += test_xmlModuleSymbol();
29522
29523    if (test_ret != 0)
29524	printf("Module xmlmodule: %d errors\n", test_ret);
29525    return(test_ret);
29526}
29527
29528static int
29529test_xmlNewTextReader(void) {
29530    int test_ret = 0;
29531
29532#if defined(LIBXML_READER_ENABLED)
29533    int mem_base;
29534    xmlTextReaderPtr ret_val;
29535    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29536    int n_input;
29537    const char * URI; /* the URI information for the source if available */
29538    int n_URI;
29539
29540    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29541    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29542        mem_base = xmlMemBlocks();
29543        input = gen_xmlParserInputBufferPtr(n_input, 0);
29544        URI = gen_filepath(n_URI, 1);
29545
29546        ret_val = xmlNewTextReader(input, URI);
29547        desret_xmlTextReaderPtr(ret_val);
29548        call_tests++;
29549        des_xmlParserInputBufferPtr(n_input, input, 0);
29550        des_filepath(n_URI, URI, 1);
29551        xmlResetLastError();
29552        if (mem_base != xmlMemBlocks()) {
29553            printf("Leak of %d blocks found in xmlNewTextReader",
29554	           xmlMemBlocks() - mem_base);
29555	    test_ret++;
29556            printf(" %d", n_input);
29557            printf(" %d", n_URI);
29558            printf("\n");
29559        }
29560    }
29561    }
29562    function_tests++;
29563#endif
29564
29565    return(test_ret);
29566}
29567
29568
29569static int
29570test_xmlNewTextReaderFilename(void) {
29571    int test_ret = 0;
29572
29573#if defined(LIBXML_READER_ENABLED)
29574    int mem_base;
29575    xmlTextReaderPtr ret_val;
29576    const char * URI; /* the URI of the resource to process */
29577    int n_URI;
29578
29579    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29580        mem_base = xmlMemBlocks();
29581        URI = gen_filepath(n_URI, 0);
29582
29583        ret_val = xmlNewTextReaderFilename(URI);
29584        desret_xmlTextReaderPtr(ret_val);
29585        call_tests++;
29586        des_filepath(n_URI, URI, 0);
29587        xmlResetLastError();
29588        if (mem_base != xmlMemBlocks()) {
29589            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29590	           xmlMemBlocks() - mem_base);
29591	    test_ret++;
29592            printf(" %d", n_URI);
29593            printf("\n");
29594        }
29595    }
29596    function_tests++;
29597#endif
29598
29599    return(test_ret);
29600}
29601
29602
29603static int
29604test_xmlReaderForDoc(void) {
29605    int test_ret = 0;
29606
29607#if defined(LIBXML_READER_ENABLED)
29608    int mem_base;
29609    xmlTextReaderPtr ret_val;
29610    xmlChar * cur; /* a pointer to a zero terminated string */
29611    int n_cur;
29612    const char * URL; /* the base URL to use for the document */
29613    int n_URL;
29614    char * encoding; /* the document encoding, or NULL */
29615    int n_encoding;
29616    int options; /* a combination of xmlParserOption */
29617    int n_options;
29618
29619    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29620    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29621    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29622    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29623        mem_base = xmlMemBlocks();
29624        cur = gen_const_xmlChar_ptr(n_cur, 0);
29625        URL = gen_filepath(n_URL, 1);
29626        encoding = gen_const_char_ptr(n_encoding, 2);
29627        options = gen_parseroptions(n_options, 3);
29628
29629        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29630        desret_xmlTextReaderPtr(ret_val);
29631        call_tests++;
29632        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29633        des_filepath(n_URL, URL, 1);
29634        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29635        des_parseroptions(n_options, options, 3);
29636        xmlResetLastError();
29637        if (mem_base != xmlMemBlocks()) {
29638            printf("Leak of %d blocks found in xmlReaderForDoc",
29639	           xmlMemBlocks() - mem_base);
29640	    test_ret++;
29641            printf(" %d", n_cur);
29642            printf(" %d", n_URL);
29643            printf(" %d", n_encoding);
29644            printf(" %d", n_options);
29645            printf("\n");
29646        }
29647    }
29648    }
29649    }
29650    }
29651    function_tests++;
29652#endif
29653
29654    return(test_ret);
29655}
29656
29657
29658static int
29659test_xmlReaderForFile(void) {
29660    int test_ret = 0;
29661
29662#if defined(LIBXML_READER_ENABLED)
29663    int mem_base;
29664    xmlTextReaderPtr ret_val;
29665    const char * filename; /* a file or URL */
29666    int n_filename;
29667    char * encoding; /* the document encoding, or NULL */
29668    int n_encoding;
29669    int options; /* a combination of xmlParserOption */
29670    int n_options;
29671
29672    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29673    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29674    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29675        mem_base = xmlMemBlocks();
29676        filename = gen_filepath(n_filename, 0);
29677        encoding = gen_const_char_ptr(n_encoding, 1);
29678        options = gen_parseroptions(n_options, 2);
29679
29680        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29681        desret_xmlTextReaderPtr(ret_val);
29682        call_tests++;
29683        des_filepath(n_filename, filename, 0);
29684        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29685        des_parseroptions(n_options, options, 2);
29686        xmlResetLastError();
29687        if (mem_base != xmlMemBlocks()) {
29688            printf("Leak of %d blocks found in xmlReaderForFile",
29689	           xmlMemBlocks() - mem_base);
29690	    test_ret++;
29691            printf(" %d", n_filename);
29692            printf(" %d", n_encoding);
29693            printf(" %d", n_options);
29694            printf("\n");
29695        }
29696    }
29697    }
29698    }
29699    function_tests++;
29700#endif
29701
29702    return(test_ret);
29703}
29704
29705
29706static int
29707test_xmlReaderForMemory(void) {
29708    int test_ret = 0;
29709
29710#if defined(LIBXML_READER_ENABLED)
29711    int mem_base;
29712    xmlTextReaderPtr ret_val;
29713    char * buffer; /* a pointer to a char array */
29714    int n_buffer;
29715    int size; /* the size of the array */
29716    int n_size;
29717    const char * URL; /* the base URL to use for the document */
29718    int n_URL;
29719    char * encoding; /* the document encoding, or NULL */
29720    int n_encoding;
29721    int options; /* a combination of xmlParserOption */
29722    int n_options;
29723
29724    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29725    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29726    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29727    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29728    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29729        mem_base = xmlMemBlocks();
29730        buffer = gen_const_char_ptr(n_buffer, 0);
29731        size = gen_int(n_size, 1);
29732        URL = gen_filepath(n_URL, 2);
29733        encoding = gen_const_char_ptr(n_encoding, 3);
29734        options = gen_parseroptions(n_options, 4);
29735
29736        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29737        desret_xmlTextReaderPtr(ret_val);
29738        call_tests++;
29739        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29740        des_int(n_size, size, 1);
29741        des_filepath(n_URL, URL, 2);
29742        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29743        des_parseroptions(n_options, options, 4);
29744        xmlResetLastError();
29745        if (mem_base != xmlMemBlocks()) {
29746            printf("Leak of %d blocks found in xmlReaderForMemory",
29747	           xmlMemBlocks() - mem_base);
29748	    test_ret++;
29749            printf(" %d", n_buffer);
29750            printf(" %d", n_size);
29751            printf(" %d", n_URL);
29752            printf(" %d", n_encoding);
29753            printf(" %d", n_options);
29754            printf("\n");
29755        }
29756    }
29757    }
29758    }
29759    }
29760    }
29761    function_tests++;
29762#endif
29763
29764    return(test_ret);
29765}
29766
29767
29768static int
29769test_xmlReaderNewDoc(void) {
29770    int test_ret = 0;
29771
29772#if defined(LIBXML_READER_ENABLED)
29773    int mem_base;
29774    int ret_val;
29775    xmlTextReaderPtr reader; /* an XML reader */
29776    int n_reader;
29777    xmlChar * cur; /* a pointer to a zero terminated string */
29778    int n_cur;
29779    const char * URL; /* the base URL to use for the document */
29780    int n_URL;
29781    char * encoding; /* the document encoding, or NULL */
29782    int n_encoding;
29783    int options; /* a combination of xmlParserOption */
29784    int n_options;
29785
29786    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29787    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29788    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29789    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29790    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29791        mem_base = xmlMemBlocks();
29792        reader = gen_xmlTextReaderPtr(n_reader, 0);
29793        cur = gen_const_xmlChar_ptr(n_cur, 1);
29794        URL = gen_filepath(n_URL, 2);
29795        encoding = gen_const_char_ptr(n_encoding, 3);
29796        options = gen_parseroptions(n_options, 4);
29797
29798        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29799        desret_int(ret_val);
29800        call_tests++;
29801        des_xmlTextReaderPtr(n_reader, reader, 0);
29802        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29803        des_filepath(n_URL, URL, 2);
29804        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29805        des_parseroptions(n_options, options, 4);
29806        xmlResetLastError();
29807        if (mem_base != xmlMemBlocks()) {
29808            printf("Leak of %d blocks found in xmlReaderNewDoc",
29809	           xmlMemBlocks() - mem_base);
29810	    test_ret++;
29811            printf(" %d", n_reader);
29812            printf(" %d", n_cur);
29813            printf(" %d", n_URL);
29814            printf(" %d", n_encoding);
29815            printf(" %d", n_options);
29816            printf("\n");
29817        }
29818    }
29819    }
29820    }
29821    }
29822    }
29823    function_tests++;
29824#endif
29825
29826    return(test_ret);
29827}
29828
29829
29830static int
29831test_xmlReaderNewFile(void) {
29832    int test_ret = 0;
29833
29834#if defined(LIBXML_READER_ENABLED)
29835    int mem_base;
29836    int ret_val;
29837    xmlTextReaderPtr reader; /* an XML reader */
29838    int n_reader;
29839    const char * filename; /* a file or URL */
29840    int n_filename;
29841    char * encoding; /* the document encoding, or NULL */
29842    int n_encoding;
29843    int options; /* a combination of xmlParserOption */
29844    int n_options;
29845
29846    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29847    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29848    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29849    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29850        mem_base = xmlMemBlocks();
29851        reader = gen_xmlTextReaderPtr(n_reader, 0);
29852        filename = gen_filepath(n_filename, 1);
29853        encoding = gen_const_char_ptr(n_encoding, 2);
29854        options = gen_parseroptions(n_options, 3);
29855
29856        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
29857        desret_int(ret_val);
29858        call_tests++;
29859        des_xmlTextReaderPtr(n_reader, reader, 0);
29860        des_filepath(n_filename, filename, 1);
29861        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29862        des_parseroptions(n_options, options, 3);
29863        xmlResetLastError();
29864        if (mem_base != xmlMemBlocks()) {
29865            printf("Leak of %d blocks found in xmlReaderNewFile",
29866	           xmlMemBlocks() - mem_base);
29867	    test_ret++;
29868            printf(" %d", n_reader);
29869            printf(" %d", n_filename);
29870            printf(" %d", n_encoding);
29871            printf(" %d", n_options);
29872            printf("\n");
29873        }
29874    }
29875    }
29876    }
29877    }
29878    function_tests++;
29879#endif
29880
29881    return(test_ret);
29882}
29883
29884
29885static int
29886test_xmlReaderNewMemory(void) {
29887    int test_ret = 0;
29888
29889#if defined(LIBXML_READER_ENABLED)
29890    int mem_base;
29891    int ret_val;
29892    xmlTextReaderPtr reader; /* an XML reader */
29893    int n_reader;
29894    char * buffer; /* a pointer to a char array */
29895    int n_buffer;
29896    int size; /* the size of the array */
29897    int n_size;
29898    const char * URL; /* the base URL to use for the document */
29899    int n_URL;
29900    char * encoding; /* the document encoding, or NULL */
29901    int n_encoding;
29902    int options; /* a combination of xmlParserOption */
29903    int n_options;
29904
29905    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29906    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29907    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29908    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29909    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29910    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29911        mem_base = xmlMemBlocks();
29912        reader = gen_xmlTextReaderPtr(n_reader, 0);
29913        buffer = gen_const_char_ptr(n_buffer, 1);
29914        size = gen_int(n_size, 2);
29915        URL = gen_filepath(n_URL, 3);
29916        encoding = gen_const_char_ptr(n_encoding, 4);
29917        options = gen_parseroptions(n_options, 5);
29918
29919        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
29920        desret_int(ret_val);
29921        call_tests++;
29922        des_xmlTextReaderPtr(n_reader, reader, 0);
29923        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
29924        des_int(n_size, size, 2);
29925        des_filepath(n_URL, URL, 3);
29926        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
29927        des_parseroptions(n_options, options, 5);
29928        xmlResetLastError();
29929        if (mem_base != xmlMemBlocks()) {
29930            printf("Leak of %d blocks found in xmlReaderNewMemory",
29931	           xmlMemBlocks() - mem_base);
29932	    test_ret++;
29933            printf(" %d", n_reader);
29934            printf(" %d", n_buffer);
29935            printf(" %d", n_size);
29936            printf(" %d", n_URL);
29937            printf(" %d", n_encoding);
29938            printf(" %d", n_options);
29939            printf("\n");
29940        }
29941    }
29942    }
29943    }
29944    }
29945    }
29946    }
29947    function_tests++;
29948#endif
29949
29950    return(test_ret);
29951}
29952
29953
29954static int
29955test_xmlReaderNewWalker(void) {
29956    int test_ret = 0;
29957
29958#if defined(LIBXML_READER_ENABLED)
29959    int mem_base;
29960    int ret_val;
29961    xmlTextReaderPtr reader; /* an XML reader */
29962    int n_reader;
29963    xmlDocPtr doc; /* a preparsed document */
29964    int n_doc;
29965
29966    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29967    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29968        mem_base = xmlMemBlocks();
29969        reader = gen_xmlTextReaderPtr(n_reader, 0);
29970        doc = gen_xmlDocPtr(n_doc, 1);
29971
29972        ret_val = xmlReaderNewWalker(reader, doc);
29973        desret_int(ret_val);
29974        call_tests++;
29975        des_xmlTextReaderPtr(n_reader, reader, 0);
29976        des_xmlDocPtr(n_doc, doc, 1);
29977        xmlResetLastError();
29978        if (mem_base != xmlMemBlocks()) {
29979            printf("Leak of %d blocks found in xmlReaderNewWalker",
29980	           xmlMemBlocks() - mem_base);
29981	    test_ret++;
29982            printf(" %d", n_reader);
29983            printf(" %d", n_doc);
29984            printf("\n");
29985        }
29986    }
29987    }
29988    function_tests++;
29989#endif
29990
29991    return(test_ret);
29992}
29993
29994
29995static int
29996test_xmlReaderWalker(void) {
29997    int test_ret = 0;
29998
29999#if defined(LIBXML_READER_ENABLED)
30000    int mem_base;
30001    xmlTextReaderPtr ret_val;
30002    xmlDocPtr doc; /* a preparsed document */
30003    int n_doc;
30004
30005    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30006        mem_base = xmlMemBlocks();
30007        doc = gen_xmlDocPtr(n_doc, 0);
30008
30009        ret_val = xmlReaderWalker(doc);
30010        desret_xmlTextReaderPtr(ret_val);
30011        call_tests++;
30012        des_xmlDocPtr(n_doc, doc, 0);
30013        xmlResetLastError();
30014        if (mem_base != xmlMemBlocks()) {
30015            printf("Leak of %d blocks found in xmlReaderWalker",
30016	           xmlMemBlocks() - mem_base);
30017	    test_ret++;
30018            printf(" %d", n_doc);
30019            printf("\n");
30020        }
30021    }
30022    function_tests++;
30023#endif
30024
30025    return(test_ret);
30026}
30027
30028
30029static int
30030test_xmlTextReaderAttributeCount(void) {
30031    int test_ret = 0;
30032
30033#if defined(LIBXML_READER_ENABLED)
30034    int mem_base;
30035    int ret_val;
30036    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30037    int n_reader;
30038
30039    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30040        mem_base = xmlMemBlocks();
30041        reader = gen_xmlTextReaderPtr(n_reader, 0);
30042
30043        ret_val = xmlTextReaderAttributeCount(reader);
30044        desret_int(ret_val);
30045        call_tests++;
30046        des_xmlTextReaderPtr(n_reader, reader, 0);
30047        xmlResetLastError();
30048        if (mem_base != xmlMemBlocks()) {
30049            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30050	           xmlMemBlocks() - mem_base);
30051	    test_ret++;
30052            printf(" %d", n_reader);
30053            printf("\n");
30054        }
30055    }
30056    function_tests++;
30057#endif
30058
30059    return(test_ret);
30060}
30061
30062
30063static int
30064test_xmlTextReaderBaseUri(void) {
30065    int test_ret = 0;
30066
30067#if defined(LIBXML_READER_ENABLED)
30068    int mem_base;
30069    xmlChar * ret_val;
30070    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30071    int n_reader;
30072
30073    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30074        mem_base = xmlMemBlocks();
30075        reader = gen_xmlTextReaderPtr(n_reader, 0);
30076
30077        ret_val = xmlTextReaderBaseUri(reader);
30078        desret_xmlChar_ptr(ret_val);
30079        call_tests++;
30080        des_xmlTextReaderPtr(n_reader, reader, 0);
30081        xmlResetLastError();
30082        if (mem_base != xmlMemBlocks()) {
30083            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30084	           xmlMemBlocks() - mem_base);
30085	    test_ret++;
30086            printf(" %d", n_reader);
30087            printf("\n");
30088        }
30089    }
30090    function_tests++;
30091#endif
30092
30093    return(test_ret);
30094}
30095
30096
30097static int
30098test_xmlTextReaderByteConsumed(void) {
30099    int test_ret = 0;
30100
30101#if defined(LIBXML_READER_ENABLED)
30102    int mem_base;
30103    long ret_val;
30104    xmlTextReaderPtr reader; /* an XML reader */
30105    int n_reader;
30106
30107    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30108        mem_base = xmlMemBlocks();
30109        reader = gen_xmlTextReaderPtr(n_reader, 0);
30110
30111        ret_val = xmlTextReaderByteConsumed(reader);
30112        desret_long(ret_val);
30113        call_tests++;
30114        des_xmlTextReaderPtr(n_reader, reader, 0);
30115        xmlResetLastError();
30116        if (mem_base != xmlMemBlocks()) {
30117            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30118	           xmlMemBlocks() - mem_base);
30119	    test_ret++;
30120            printf(" %d", n_reader);
30121            printf("\n");
30122        }
30123    }
30124    function_tests++;
30125#endif
30126
30127    return(test_ret);
30128}
30129
30130
30131static int
30132test_xmlTextReaderClose(void) {
30133    int test_ret = 0;
30134
30135#if defined(LIBXML_READER_ENABLED)
30136    int mem_base;
30137    int ret_val;
30138    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30139    int n_reader;
30140
30141    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30142        mem_base = xmlMemBlocks();
30143        reader = gen_xmlTextReaderPtr(n_reader, 0);
30144
30145        ret_val = xmlTextReaderClose(reader);
30146        desret_int(ret_val);
30147        call_tests++;
30148        des_xmlTextReaderPtr(n_reader, reader, 0);
30149        xmlResetLastError();
30150        if (mem_base != xmlMemBlocks()) {
30151            printf("Leak of %d blocks found in xmlTextReaderClose",
30152	           xmlMemBlocks() - mem_base);
30153	    test_ret++;
30154            printf(" %d", n_reader);
30155            printf("\n");
30156        }
30157    }
30158    function_tests++;
30159#endif
30160
30161    return(test_ret);
30162}
30163
30164
30165static int
30166test_xmlTextReaderConstBaseUri(void) {
30167    int test_ret = 0;
30168
30169#if defined(LIBXML_READER_ENABLED)
30170    int mem_base;
30171    const xmlChar * ret_val;
30172    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30173    int n_reader;
30174
30175    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30176        mem_base = xmlMemBlocks();
30177        reader = gen_xmlTextReaderPtr(n_reader, 0);
30178
30179        ret_val = xmlTextReaderConstBaseUri(reader);
30180        desret_const_xmlChar_ptr(ret_val);
30181        call_tests++;
30182        des_xmlTextReaderPtr(n_reader, reader, 0);
30183        xmlResetLastError();
30184        if (mem_base != xmlMemBlocks()) {
30185            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30186	           xmlMemBlocks() - mem_base);
30187	    test_ret++;
30188            printf(" %d", n_reader);
30189            printf("\n");
30190        }
30191    }
30192    function_tests++;
30193#endif
30194
30195    return(test_ret);
30196}
30197
30198
30199static int
30200test_xmlTextReaderConstEncoding(void) {
30201    int test_ret = 0;
30202
30203#if defined(LIBXML_READER_ENABLED)
30204    int mem_base;
30205    const xmlChar * ret_val;
30206    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30207    int n_reader;
30208
30209    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30210        mem_base = xmlMemBlocks();
30211        reader = gen_xmlTextReaderPtr(n_reader, 0);
30212
30213        ret_val = xmlTextReaderConstEncoding(reader);
30214        desret_const_xmlChar_ptr(ret_val);
30215        call_tests++;
30216        des_xmlTextReaderPtr(n_reader, reader, 0);
30217        xmlResetLastError();
30218        if (mem_base != xmlMemBlocks()) {
30219            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30220	           xmlMemBlocks() - mem_base);
30221	    test_ret++;
30222            printf(" %d", n_reader);
30223            printf("\n");
30224        }
30225    }
30226    function_tests++;
30227#endif
30228
30229    return(test_ret);
30230}
30231
30232
30233static int
30234test_xmlTextReaderConstLocalName(void) {
30235    int test_ret = 0;
30236
30237#if defined(LIBXML_READER_ENABLED)
30238    int mem_base;
30239    const xmlChar * ret_val;
30240    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30241    int n_reader;
30242
30243    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30244        mem_base = xmlMemBlocks();
30245        reader = gen_xmlTextReaderPtr(n_reader, 0);
30246
30247        ret_val = xmlTextReaderConstLocalName(reader);
30248        desret_const_xmlChar_ptr(ret_val);
30249        call_tests++;
30250        des_xmlTextReaderPtr(n_reader, reader, 0);
30251        xmlResetLastError();
30252        if (mem_base != xmlMemBlocks()) {
30253            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30254	           xmlMemBlocks() - mem_base);
30255	    test_ret++;
30256            printf(" %d", n_reader);
30257            printf("\n");
30258        }
30259    }
30260    function_tests++;
30261#endif
30262
30263    return(test_ret);
30264}
30265
30266
30267static int
30268test_xmlTextReaderConstName(void) {
30269    int test_ret = 0;
30270
30271#if defined(LIBXML_READER_ENABLED)
30272    int mem_base;
30273    const xmlChar * ret_val;
30274    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30275    int n_reader;
30276
30277    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30278        mem_base = xmlMemBlocks();
30279        reader = gen_xmlTextReaderPtr(n_reader, 0);
30280
30281        ret_val = xmlTextReaderConstName(reader);
30282        desret_const_xmlChar_ptr(ret_val);
30283        call_tests++;
30284        des_xmlTextReaderPtr(n_reader, reader, 0);
30285        xmlResetLastError();
30286        if (mem_base != xmlMemBlocks()) {
30287            printf("Leak of %d blocks found in xmlTextReaderConstName",
30288	           xmlMemBlocks() - mem_base);
30289	    test_ret++;
30290            printf(" %d", n_reader);
30291            printf("\n");
30292        }
30293    }
30294    function_tests++;
30295#endif
30296
30297    return(test_ret);
30298}
30299
30300
30301static int
30302test_xmlTextReaderConstNamespaceUri(void) {
30303    int test_ret = 0;
30304
30305#if defined(LIBXML_READER_ENABLED)
30306    int mem_base;
30307    const xmlChar * ret_val;
30308    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30309    int n_reader;
30310
30311    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30312        mem_base = xmlMemBlocks();
30313        reader = gen_xmlTextReaderPtr(n_reader, 0);
30314
30315        ret_val = xmlTextReaderConstNamespaceUri(reader);
30316        desret_const_xmlChar_ptr(ret_val);
30317        call_tests++;
30318        des_xmlTextReaderPtr(n_reader, reader, 0);
30319        xmlResetLastError();
30320        if (mem_base != xmlMemBlocks()) {
30321            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30322	           xmlMemBlocks() - mem_base);
30323	    test_ret++;
30324            printf(" %d", n_reader);
30325            printf("\n");
30326        }
30327    }
30328    function_tests++;
30329#endif
30330
30331    return(test_ret);
30332}
30333
30334
30335static int
30336test_xmlTextReaderConstPrefix(void) {
30337    int test_ret = 0;
30338
30339#if defined(LIBXML_READER_ENABLED)
30340    int mem_base;
30341    const xmlChar * ret_val;
30342    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30343    int n_reader;
30344
30345    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30346        mem_base = xmlMemBlocks();
30347        reader = gen_xmlTextReaderPtr(n_reader, 0);
30348
30349        ret_val = xmlTextReaderConstPrefix(reader);
30350        desret_const_xmlChar_ptr(ret_val);
30351        call_tests++;
30352        des_xmlTextReaderPtr(n_reader, reader, 0);
30353        xmlResetLastError();
30354        if (mem_base != xmlMemBlocks()) {
30355            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30356	           xmlMemBlocks() - mem_base);
30357	    test_ret++;
30358            printf(" %d", n_reader);
30359            printf("\n");
30360        }
30361    }
30362    function_tests++;
30363#endif
30364
30365    return(test_ret);
30366}
30367
30368
30369static int
30370test_xmlTextReaderConstString(void) {
30371    int test_ret = 0;
30372
30373#if defined(LIBXML_READER_ENABLED)
30374    int mem_base;
30375    const xmlChar * ret_val;
30376    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30377    int n_reader;
30378    xmlChar * str; /* the string to intern. */
30379    int n_str;
30380
30381    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30382    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30383        mem_base = xmlMemBlocks();
30384        reader = gen_xmlTextReaderPtr(n_reader, 0);
30385        str = gen_const_xmlChar_ptr(n_str, 1);
30386
30387        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30388        desret_const_xmlChar_ptr(ret_val);
30389        call_tests++;
30390        des_xmlTextReaderPtr(n_reader, reader, 0);
30391        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30392        xmlResetLastError();
30393        if (mem_base != xmlMemBlocks()) {
30394            printf("Leak of %d blocks found in xmlTextReaderConstString",
30395	           xmlMemBlocks() - mem_base);
30396	    test_ret++;
30397            printf(" %d", n_reader);
30398            printf(" %d", n_str);
30399            printf("\n");
30400        }
30401    }
30402    }
30403    function_tests++;
30404#endif
30405
30406    return(test_ret);
30407}
30408
30409
30410static int
30411test_xmlTextReaderConstValue(void) {
30412    int test_ret = 0;
30413
30414#if defined(LIBXML_READER_ENABLED)
30415    int mem_base;
30416    const xmlChar * ret_val;
30417    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30418    int n_reader;
30419
30420    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30421        mem_base = xmlMemBlocks();
30422        reader = gen_xmlTextReaderPtr(n_reader, 0);
30423
30424        ret_val = xmlTextReaderConstValue(reader);
30425        desret_const_xmlChar_ptr(ret_val);
30426        call_tests++;
30427        des_xmlTextReaderPtr(n_reader, reader, 0);
30428        xmlResetLastError();
30429        if (mem_base != xmlMemBlocks()) {
30430            printf("Leak of %d blocks found in xmlTextReaderConstValue",
30431	           xmlMemBlocks() - mem_base);
30432	    test_ret++;
30433            printf(" %d", n_reader);
30434            printf("\n");
30435        }
30436    }
30437    function_tests++;
30438#endif
30439
30440    return(test_ret);
30441}
30442
30443
30444static int
30445test_xmlTextReaderConstXmlLang(void) {
30446    int test_ret = 0;
30447
30448#if defined(LIBXML_READER_ENABLED)
30449    int mem_base;
30450    const xmlChar * ret_val;
30451    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30452    int n_reader;
30453
30454    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30455        mem_base = xmlMemBlocks();
30456        reader = gen_xmlTextReaderPtr(n_reader, 0);
30457
30458        ret_val = xmlTextReaderConstXmlLang(reader);
30459        desret_const_xmlChar_ptr(ret_val);
30460        call_tests++;
30461        des_xmlTextReaderPtr(n_reader, reader, 0);
30462        xmlResetLastError();
30463        if (mem_base != xmlMemBlocks()) {
30464            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30465	           xmlMemBlocks() - mem_base);
30466	    test_ret++;
30467            printf(" %d", n_reader);
30468            printf("\n");
30469        }
30470    }
30471    function_tests++;
30472#endif
30473
30474    return(test_ret);
30475}
30476
30477
30478static int
30479test_xmlTextReaderConstXmlVersion(void) {
30480    int test_ret = 0;
30481
30482#if defined(LIBXML_READER_ENABLED)
30483    int mem_base;
30484    const xmlChar * ret_val;
30485    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30486    int n_reader;
30487
30488    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30489        mem_base = xmlMemBlocks();
30490        reader = gen_xmlTextReaderPtr(n_reader, 0);
30491
30492        ret_val = xmlTextReaderConstXmlVersion(reader);
30493        desret_const_xmlChar_ptr(ret_val);
30494        call_tests++;
30495        des_xmlTextReaderPtr(n_reader, reader, 0);
30496        xmlResetLastError();
30497        if (mem_base != xmlMemBlocks()) {
30498            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30499	           xmlMemBlocks() - mem_base);
30500	    test_ret++;
30501            printf(" %d", n_reader);
30502            printf("\n");
30503        }
30504    }
30505    function_tests++;
30506#endif
30507
30508    return(test_ret);
30509}
30510
30511
30512static int
30513test_xmlTextReaderCurrentDoc(void) {
30514    int test_ret = 0;
30515
30516#if defined(LIBXML_READER_ENABLED)
30517    int mem_base;
30518    xmlDocPtr ret_val;
30519    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30520    int n_reader;
30521
30522    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30523        mem_base = xmlMemBlocks();
30524        reader = gen_xmlTextReaderPtr(n_reader, 0);
30525
30526        ret_val = xmlTextReaderCurrentDoc(reader);
30527        desret_xmlDocPtr(ret_val);
30528        call_tests++;
30529        des_xmlTextReaderPtr(n_reader, reader, 0);
30530        xmlResetLastError();
30531        if (mem_base != xmlMemBlocks()) {
30532            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30533	           xmlMemBlocks() - mem_base);
30534	    test_ret++;
30535            printf(" %d", n_reader);
30536            printf("\n");
30537        }
30538    }
30539    function_tests++;
30540#endif
30541
30542    return(test_ret);
30543}
30544
30545
30546static int
30547test_xmlTextReaderCurrentNode(void) {
30548    int test_ret = 0;
30549
30550#if defined(LIBXML_READER_ENABLED)
30551    int mem_base;
30552    xmlNodePtr ret_val;
30553    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30554    int n_reader;
30555
30556    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30557        mem_base = xmlMemBlocks();
30558        reader = gen_xmlTextReaderPtr(n_reader, 0);
30559
30560        ret_val = xmlTextReaderCurrentNode(reader);
30561        desret_xmlNodePtr(ret_val);
30562        call_tests++;
30563        des_xmlTextReaderPtr(n_reader, reader, 0);
30564        xmlResetLastError();
30565        if (mem_base != xmlMemBlocks()) {
30566            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30567	           xmlMemBlocks() - mem_base);
30568	    test_ret++;
30569            printf(" %d", n_reader);
30570            printf("\n");
30571        }
30572    }
30573    function_tests++;
30574#endif
30575
30576    return(test_ret);
30577}
30578
30579
30580static int
30581test_xmlTextReaderDepth(void) {
30582    int test_ret = 0;
30583
30584#if defined(LIBXML_READER_ENABLED)
30585    int mem_base;
30586    int ret_val;
30587    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30588    int n_reader;
30589
30590    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30591        mem_base = xmlMemBlocks();
30592        reader = gen_xmlTextReaderPtr(n_reader, 0);
30593
30594        ret_val = xmlTextReaderDepth(reader);
30595        desret_int(ret_val);
30596        call_tests++;
30597        des_xmlTextReaderPtr(n_reader, reader, 0);
30598        xmlResetLastError();
30599        if (mem_base != xmlMemBlocks()) {
30600            printf("Leak of %d blocks found in xmlTextReaderDepth",
30601	           xmlMemBlocks() - mem_base);
30602	    test_ret++;
30603            printf(" %d", n_reader);
30604            printf("\n");
30605        }
30606    }
30607    function_tests++;
30608#endif
30609
30610    return(test_ret);
30611}
30612
30613
30614static int
30615test_xmlTextReaderExpand(void) {
30616    int test_ret = 0;
30617
30618#if defined(LIBXML_READER_ENABLED)
30619    int mem_base;
30620    xmlNodePtr ret_val;
30621    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30622    int n_reader;
30623
30624    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30625        mem_base = xmlMemBlocks();
30626        reader = gen_xmlTextReaderPtr(n_reader, 0);
30627
30628        ret_val = xmlTextReaderExpand(reader);
30629        desret_xmlNodePtr(ret_val);
30630        call_tests++;
30631        des_xmlTextReaderPtr(n_reader, reader, 0);
30632        xmlResetLastError();
30633        if (mem_base != xmlMemBlocks()) {
30634            printf("Leak of %d blocks found in xmlTextReaderExpand",
30635	           xmlMemBlocks() - mem_base);
30636	    test_ret++;
30637            printf(" %d", n_reader);
30638            printf("\n");
30639        }
30640    }
30641    function_tests++;
30642#endif
30643
30644    return(test_ret);
30645}
30646
30647
30648static int
30649test_xmlTextReaderGetAttribute(void) {
30650    int test_ret = 0;
30651
30652#if defined(LIBXML_READER_ENABLED)
30653    int mem_base;
30654    xmlChar * ret_val;
30655    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30656    int n_reader;
30657    xmlChar * name; /* the qualified name of the attribute. */
30658    int n_name;
30659
30660    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30661    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30662        mem_base = xmlMemBlocks();
30663        reader = gen_xmlTextReaderPtr(n_reader, 0);
30664        name = gen_const_xmlChar_ptr(n_name, 1);
30665
30666        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30667        desret_xmlChar_ptr(ret_val);
30668        call_tests++;
30669        des_xmlTextReaderPtr(n_reader, reader, 0);
30670        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30671        xmlResetLastError();
30672        if (mem_base != xmlMemBlocks()) {
30673            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30674	           xmlMemBlocks() - mem_base);
30675	    test_ret++;
30676            printf(" %d", n_reader);
30677            printf(" %d", n_name);
30678            printf("\n");
30679        }
30680    }
30681    }
30682    function_tests++;
30683#endif
30684
30685    return(test_ret);
30686}
30687
30688
30689static int
30690test_xmlTextReaderGetAttributeNo(void) {
30691    int test_ret = 0;
30692
30693#if defined(LIBXML_READER_ENABLED)
30694    int mem_base;
30695    xmlChar * ret_val;
30696    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30697    int n_reader;
30698    int no; /* the zero-based index of the attribute relative to the containing element */
30699    int n_no;
30700
30701    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30702    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30703        mem_base = xmlMemBlocks();
30704        reader = gen_xmlTextReaderPtr(n_reader, 0);
30705        no = gen_int(n_no, 1);
30706
30707        ret_val = xmlTextReaderGetAttributeNo(reader, no);
30708        desret_xmlChar_ptr(ret_val);
30709        call_tests++;
30710        des_xmlTextReaderPtr(n_reader, reader, 0);
30711        des_int(n_no, no, 1);
30712        xmlResetLastError();
30713        if (mem_base != xmlMemBlocks()) {
30714            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30715	           xmlMemBlocks() - mem_base);
30716	    test_ret++;
30717            printf(" %d", n_reader);
30718            printf(" %d", n_no);
30719            printf("\n");
30720        }
30721    }
30722    }
30723    function_tests++;
30724#endif
30725
30726    return(test_ret);
30727}
30728
30729
30730static int
30731test_xmlTextReaderGetAttributeNs(void) {
30732    int test_ret = 0;
30733
30734#if defined(LIBXML_READER_ENABLED)
30735    int mem_base;
30736    xmlChar * ret_val;
30737    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30738    int n_reader;
30739    xmlChar * localName; /* the local name of the attribute. */
30740    int n_localName;
30741    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30742    int n_namespaceURI;
30743
30744    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30745    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30746    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30747        mem_base = xmlMemBlocks();
30748        reader = gen_xmlTextReaderPtr(n_reader, 0);
30749        localName = gen_const_xmlChar_ptr(n_localName, 1);
30750        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30751
30752        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30753        desret_xmlChar_ptr(ret_val);
30754        call_tests++;
30755        des_xmlTextReaderPtr(n_reader, reader, 0);
30756        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30757        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30758        xmlResetLastError();
30759        if (mem_base != xmlMemBlocks()) {
30760            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30761	           xmlMemBlocks() - mem_base);
30762	    test_ret++;
30763            printf(" %d", n_reader);
30764            printf(" %d", n_localName);
30765            printf(" %d", n_namespaceURI);
30766            printf("\n");
30767        }
30768    }
30769    }
30770    }
30771    function_tests++;
30772#endif
30773
30774    return(test_ret);
30775}
30776
30777#ifdef LIBXML_READER_ENABLED
30778
30779#define gen_nb_xmlTextReaderErrorFunc_ptr 1
30780static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30781    return(NULL);
30782}
30783static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30784}
30785#endif
30786
30787
30788static int
30789test_xmlTextReaderGetErrorHandler(void) {
30790    int test_ret = 0;
30791
30792#if defined(LIBXML_READER_ENABLED)
30793    int mem_base;
30794    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30795    int n_reader;
30796    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30797    int n_f;
30798    void ** arg; /* a user argument */
30799    int n_arg;
30800
30801    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30802    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30803    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30804        mem_base = xmlMemBlocks();
30805        reader = gen_xmlTextReaderPtr(n_reader, 0);
30806        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30807        arg = gen_void_ptr_ptr(n_arg, 2);
30808
30809        xmlTextReaderGetErrorHandler(reader, f, arg);
30810        call_tests++;
30811        des_xmlTextReaderPtr(n_reader, reader, 0);
30812        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30813        des_void_ptr_ptr(n_arg, arg, 2);
30814        xmlResetLastError();
30815        if (mem_base != xmlMemBlocks()) {
30816            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30817	           xmlMemBlocks() - mem_base);
30818	    test_ret++;
30819            printf(" %d", n_reader);
30820            printf(" %d", n_f);
30821            printf(" %d", n_arg);
30822            printf("\n");
30823        }
30824    }
30825    }
30826    }
30827    function_tests++;
30828#endif
30829
30830    return(test_ret);
30831}
30832
30833
30834static int
30835test_xmlTextReaderGetParserColumnNumber(void) {
30836    int test_ret = 0;
30837
30838#if defined(LIBXML_READER_ENABLED)
30839    int mem_base;
30840    int ret_val;
30841    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30842    int n_reader;
30843
30844    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30845        mem_base = xmlMemBlocks();
30846        reader = gen_xmlTextReaderPtr(n_reader, 0);
30847
30848        ret_val = xmlTextReaderGetParserColumnNumber(reader);
30849        desret_int(ret_val);
30850        call_tests++;
30851        des_xmlTextReaderPtr(n_reader, reader, 0);
30852        xmlResetLastError();
30853        if (mem_base != xmlMemBlocks()) {
30854            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
30855	           xmlMemBlocks() - mem_base);
30856	    test_ret++;
30857            printf(" %d", n_reader);
30858            printf("\n");
30859        }
30860    }
30861    function_tests++;
30862#endif
30863
30864    return(test_ret);
30865}
30866
30867
30868static int
30869test_xmlTextReaderGetParserLineNumber(void) {
30870    int test_ret = 0;
30871
30872#if defined(LIBXML_READER_ENABLED)
30873    int mem_base;
30874    int ret_val;
30875    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30876    int n_reader;
30877
30878    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30879        mem_base = xmlMemBlocks();
30880        reader = gen_xmlTextReaderPtr(n_reader, 0);
30881
30882        ret_val = xmlTextReaderGetParserLineNumber(reader);
30883        desret_int(ret_val);
30884        call_tests++;
30885        des_xmlTextReaderPtr(n_reader, reader, 0);
30886        xmlResetLastError();
30887        if (mem_base != xmlMemBlocks()) {
30888            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
30889	           xmlMemBlocks() - mem_base);
30890	    test_ret++;
30891            printf(" %d", n_reader);
30892            printf("\n");
30893        }
30894    }
30895    function_tests++;
30896#endif
30897
30898    return(test_ret);
30899}
30900
30901
30902static int
30903test_xmlTextReaderGetParserProp(void) {
30904    int test_ret = 0;
30905
30906#if defined(LIBXML_READER_ENABLED)
30907    int mem_base;
30908    int ret_val;
30909    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30910    int n_reader;
30911    int prop; /* the xmlParserProperties to get */
30912    int n_prop;
30913
30914    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30915    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30916        mem_base = xmlMemBlocks();
30917        reader = gen_xmlTextReaderPtr(n_reader, 0);
30918        prop = gen_int(n_prop, 1);
30919
30920        ret_val = xmlTextReaderGetParserProp(reader, prop);
30921        desret_int(ret_val);
30922        call_tests++;
30923        des_xmlTextReaderPtr(n_reader, reader, 0);
30924        des_int(n_prop, prop, 1);
30925        xmlResetLastError();
30926        if (mem_base != xmlMemBlocks()) {
30927            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
30928	           xmlMemBlocks() - mem_base);
30929	    test_ret++;
30930            printf(" %d", n_reader);
30931            printf(" %d", n_prop);
30932            printf("\n");
30933        }
30934    }
30935    }
30936    function_tests++;
30937#endif
30938
30939    return(test_ret);
30940}
30941
30942
30943static int
30944test_xmlTextReaderGetRemainder(void) {
30945    int test_ret = 0;
30946
30947#if defined(LIBXML_READER_ENABLED)
30948    int mem_base;
30949    xmlParserInputBufferPtr ret_val;
30950    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30951    int n_reader;
30952
30953    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30954        mem_base = xmlMemBlocks();
30955        reader = gen_xmlTextReaderPtr(n_reader, 0);
30956
30957        ret_val = xmlTextReaderGetRemainder(reader);
30958        desret_xmlParserInputBufferPtr(ret_val);
30959        call_tests++;
30960        des_xmlTextReaderPtr(n_reader, reader, 0);
30961        xmlResetLastError();
30962        if (mem_base != xmlMemBlocks()) {
30963            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30964	           xmlMemBlocks() - mem_base);
30965	    test_ret++;
30966            printf(" %d", n_reader);
30967            printf("\n");
30968        }
30969    }
30970    function_tests++;
30971#endif
30972
30973    return(test_ret);
30974}
30975
30976
30977static int
30978test_xmlTextReaderHasAttributes(void) {
30979    int test_ret = 0;
30980
30981#if defined(LIBXML_READER_ENABLED)
30982    int mem_base;
30983    int ret_val;
30984    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30985    int n_reader;
30986
30987    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30988        mem_base = xmlMemBlocks();
30989        reader = gen_xmlTextReaderPtr(n_reader, 0);
30990
30991        ret_val = xmlTextReaderHasAttributes(reader);
30992        desret_int(ret_val);
30993        call_tests++;
30994        des_xmlTextReaderPtr(n_reader, reader, 0);
30995        xmlResetLastError();
30996        if (mem_base != xmlMemBlocks()) {
30997            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
30998	           xmlMemBlocks() - mem_base);
30999	    test_ret++;
31000            printf(" %d", n_reader);
31001            printf("\n");
31002        }
31003    }
31004    function_tests++;
31005#endif
31006
31007    return(test_ret);
31008}
31009
31010
31011static int
31012test_xmlTextReaderHasValue(void) {
31013    int test_ret = 0;
31014
31015#if defined(LIBXML_READER_ENABLED)
31016    int mem_base;
31017    int ret_val;
31018    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31019    int n_reader;
31020
31021    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31022        mem_base = xmlMemBlocks();
31023        reader = gen_xmlTextReaderPtr(n_reader, 0);
31024
31025        ret_val = xmlTextReaderHasValue(reader);
31026        desret_int(ret_val);
31027        call_tests++;
31028        des_xmlTextReaderPtr(n_reader, reader, 0);
31029        xmlResetLastError();
31030        if (mem_base != xmlMemBlocks()) {
31031            printf("Leak of %d blocks found in xmlTextReaderHasValue",
31032	           xmlMemBlocks() - mem_base);
31033	    test_ret++;
31034            printf(" %d", n_reader);
31035            printf("\n");
31036        }
31037    }
31038    function_tests++;
31039#endif
31040
31041    return(test_ret);
31042}
31043
31044
31045static int
31046test_xmlTextReaderIsDefault(void) {
31047    int test_ret = 0;
31048
31049#if defined(LIBXML_READER_ENABLED)
31050    int mem_base;
31051    int ret_val;
31052    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31053    int n_reader;
31054
31055    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31056        mem_base = xmlMemBlocks();
31057        reader = gen_xmlTextReaderPtr(n_reader, 0);
31058
31059        ret_val = xmlTextReaderIsDefault(reader);
31060        desret_int(ret_val);
31061        call_tests++;
31062        des_xmlTextReaderPtr(n_reader, reader, 0);
31063        xmlResetLastError();
31064        if (mem_base != xmlMemBlocks()) {
31065            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31066	           xmlMemBlocks() - mem_base);
31067	    test_ret++;
31068            printf(" %d", n_reader);
31069            printf("\n");
31070        }
31071    }
31072    function_tests++;
31073#endif
31074
31075    return(test_ret);
31076}
31077
31078
31079static int
31080test_xmlTextReaderIsEmptyElement(void) {
31081    int test_ret = 0;
31082
31083#if defined(LIBXML_READER_ENABLED)
31084    int mem_base;
31085    int ret_val;
31086    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31087    int n_reader;
31088
31089    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31090        mem_base = xmlMemBlocks();
31091        reader = gen_xmlTextReaderPtr(n_reader, 0);
31092
31093        ret_val = xmlTextReaderIsEmptyElement(reader);
31094        desret_int(ret_val);
31095        call_tests++;
31096        des_xmlTextReaderPtr(n_reader, reader, 0);
31097        xmlResetLastError();
31098        if (mem_base != xmlMemBlocks()) {
31099            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31100	           xmlMemBlocks() - mem_base);
31101	    test_ret++;
31102            printf(" %d", n_reader);
31103            printf("\n");
31104        }
31105    }
31106    function_tests++;
31107#endif
31108
31109    return(test_ret);
31110}
31111
31112
31113static int
31114test_xmlTextReaderIsNamespaceDecl(void) {
31115    int test_ret = 0;
31116
31117#if defined(LIBXML_READER_ENABLED)
31118    int mem_base;
31119    int ret_val;
31120    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31121    int n_reader;
31122
31123    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31124        mem_base = xmlMemBlocks();
31125        reader = gen_xmlTextReaderPtr(n_reader, 0);
31126
31127        ret_val = xmlTextReaderIsNamespaceDecl(reader);
31128        desret_int(ret_val);
31129        call_tests++;
31130        des_xmlTextReaderPtr(n_reader, reader, 0);
31131        xmlResetLastError();
31132        if (mem_base != xmlMemBlocks()) {
31133            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31134	           xmlMemBlocks() - mem_base);
31135	    test_ret++;
31136            printf(" %d", n_reader);
31137            printf("\n");
31138        }
31139    }
31140    function_tests++;
31141#endif
31142
31143    return(test_ret);
31144}
31145
31146
31147static int
31148test_xmlTextReaderIsValid(void) {
31149    int test_ret = 0;
31150
31151#if defined(LIBXML_READER_ENABLED)
31152    int mem_base;
31153    int ret_val;
31154    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31155    int n_reader;
31156
31157    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31158        mem_base = xmlMemBlocks();
31159        reader = gen_xmlTextReaderPtr(n_reader, 0);
31160
31161        ret_val = xmlTextReaderIsValid(reader);
31162        desret_int(ret_val);
31163        call_tests++;
31164        des_xmlTextReaderPtr(n_reader, reader, 0);
31165        xmlResetLastError();
31166        if (mem_base != xmlMemBlocks()) {
31167            printf("Leak of %d blocks found in xmlTextReaderIsValid",
31168	           xmlMemBlocks() - mem_base);
31169	    test_ret++;
31170            printf(" %d", n_reader);
31171            printf("\n");
31172        }
31173    }
31174    function_tests++;
31175#endif
31176
31177    return(test_ret);
31178}
31179
31180
31181static int
31182test_xmlTextReaderLocalName(void) {
31183    int test_ret = 0;
31184
31185#if defined(LIBXML_READER_ENABLED)
31186    int mem_base;
31187    xmlChar * ret_val;
31188    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31189    int n_reader;
31190
31191    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31192        mem_base = xmlMemBlocks();
31193        reader = gen_xmlTextReaderPtr(n_reader, 0);
31194
31195        ret_val = xmlTextReaderLocalName(reader);
31196        desret_xmlChar_ptr(ret_val);
31197        call_tests++;
31198        des_xmlTextReaderPtr(n_reader, reader, 0);
31199        xmlResetLastError();
31200        if (mem_base != xmlMemBlocks()) {
31201            printf("Leak of %d blocks found in xmlTextReaderLocalName",
31202	           xmlMemBlocks() - mem_base);
31203	    test_ret++;
31204            printf(" %d", n_reader);
31205            printf("\n");
31206        }
31207    }
31208    function_tests++;
31209#endif
31210
31211    return(test_ret);
31212}
31213
31214#ifdef LIBXML_READER_ENABLED
31215
31216#define gen_nb_xmlTextReaderLocatorPtr 1
31217static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31218    return(NULL);
31219}
31220static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31221}
31222#endif
31223
31224
31225static int
31226test_xmlTextReaderLocatorBaseURI(void) {
31227    int test_ret = 0;
31228
31229#if defined(LIBXML_READER_ENABLED)
31230    int mem_base;
31231    xmlChar * ret_val;
31232    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31233    int n_locator;
31234
31235    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31236        mem_base = xmlMemBlocks();
31237        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31238
31239        ret_val = xmlTextReaderLocatorBaseURI(locator);
31240        desret_xmlChar_ptr(ret_val);
31241        call_tests++;
31242        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31243        xmlResetLastError();
31244        if (mem_base != xmlMemBlocks()) {
31245            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31246	           xmlMemBlocks() - mem_base);
31247	    test_ret++;
31248            printf(" %d", n_locator);
31249            printf("\n");
31250        }
31251    }
31252    function_tests++;
31253#endif
31254
31255    return(test_ret);
31256}
31257
31258
31259static int
31260test_xmlTextReaderLocatorLineNumber(void) {
31261    int test_ret = 0;
31262
31263#if defined(LIBXML_READER_ENABLED)
31264    int mem_base;
31265    int ret_val;
31266    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31267    int n_locator;
31268
31269    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31270        mem_base = xmlMemBlocks();
31271        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31272
31273        ret_val = xmlTextReaderLocatorLineNumber(locator);
31274        desret_int(ret_val);
31275        call_tests++;
31276        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31277        xmlResetLastError();
31278        if (mem_base != xmlMemBlocks()) {
31279            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31280	           xmlMemBlocks() - mem_base);
31281	    test_ret++;
31282            printf(" %d", n_locator);
31283            printf("\n");
31284        }
31285    }
31286    function_tests++;
31287#endif
31288
31289    return(test_ret);
31290}
31291
31292
31293static int
31294test_xmlTextReaderLookupNamespace(void) {
31295    int test_ret = 0;
31296
31297#if defined(LIBXML_READER_ENABLED)
31298    int mem_base;
31299    xmlChar * ret_val;
31300    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31301    int n_reader;
31302    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31303    int n_prefix;
31304
31305    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31306    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31307        mem_base = xmlMemBlocks();
31308        reader = gen_xmlTextReaderPtr(n_reader, 0);
31309        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31310
31311        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31312        desret_xmlChar_ptr(ret_val);
31313        call_tests++;
31314        des_xmlTextReaderPtr(n_reader, reader, 0);
31315        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31316        xmlResetLastError();
31317        if (mem_base != xmlMemBlocks()) {
31318            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31319	           xmlMemBlocks() - mem_base);
31320	    test_ret++;
31321            printf(" %d", n_reader);
31322            printf(" %d", n_prefix);
31323            printf("\n");
31324        }
31325    }
31326    }
31327    function_tests++;
31328#endif
31329
31330    return(test_ret);
31331}
31332
31333
31334static int
31335test_xmlTextReaderMoveToAttribute(void) {
31336    int test_ret = 0;
31337
31338#if defined(LIBXML_READER_ENABLED)
31339    int mem_base;
31340    int ret_val;
31341    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31342    int n_reader;
31343    xmlChar * name; /* the qualified name of the attribute. */
31344    int n_name;
31345
31346    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31347    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31348        mem_base = xmlMemBlocks();
31349        reader = gen_xmlTextReaderPtr(n_reader, 0);
31350        name = gen_const_xmlChar_ptr(n_name, 1);
31351
31352        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31353        desret_int(ret_val);
31354        call_tests++;
31355        des_xmlTextReaderPtr(n_reader, reader, 0);
31356        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31357        xmlResetLastError();
31358        if (mem_base != xmlMemBlocks()) {
31359            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31360	           xmlMemBlocks() - mem_base);
31361	    test_ret++;
31362            printf(" %d", n_reader);
31363            printf(" %d", n_name);
31364            printf("\n");
31365        }
31366    }
31367    }
31368    function_tests++;
31369#endif
31370
31371    return(test_ret);
31372}
31373
31374
31375static int
31376test_xmlTextReaderMoveToAttributeNo(void) {
31377    int test_ret = 0;
31378
31379#if defined(LIBXML_READER_ENABLED)
31380    int mem_base;
31381    int ret_val;
31382    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31383    int n_reader;
31384    int no; /* the zero-based index of the attribute relative to the containing element. */
31385    int n_no;
31386
31387    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31388    for (n_no = 0;n_no < gen_nb_int;n_no++) {
31389        mem_base = xmlMemBlocks();
31390        reader = gen_xmlTextReaderPtr(n_reader, 0);
31391        no = gen_int(n_no, 1);
31392
31393        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31394        desret_int(ret_val);
31395        call_tests++;
31396        des_xmlTextReaderPtr(n_reader, reader, 0);
31397        des_int(n_no, no, 1);
31398        xmlResetLastError();
31399        if (mem_base != xmlMemBlocks()) {
31400            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31401	           xmlMemBlocks() - mem_base);
31402	    test_ret++;
31403            printf(" %d", n_reader);
31404            printf(" %d", n_no);
31405            printf("\n");
31406        }
31407    }
31408    }
31409    function_tests++;
31410#endif
31411
31412    return(test_ret);
31413}
31414
31415
31416static int
31417test_xmlTextReaderMoveToAttributeNs(void) {
31418    int test_ret = 0;
31419
31420#if defined(LIBXML_READER_ENABLED)
31421    int mem_base;
31422    int ret_val;
31423    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31424    int n_reader;
31425    xmlChar * localName; /* the local name of the attribute. */
31426    int n_localName;
31427    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31428    int n_namespaceURI;
31429
31430    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31431    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31432    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31433        mem_base = xmlMemBlocks();
31434        reader = gen_xmlTextReaderPtr(n_reader, 0);
31435        localName = gen_const_xmlChar_ptr(n_localName, 1);
31436        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31437
31438        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31439        desret_int(ret_val);
31440        call_tests++;
31441        des_xmlTextReaderPtr(n_reader, reader, 0);
31442        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31443        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31444        xmlResetLastError();
31445        if (mem_base != xmlMemBlocks()) {
31446            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31447	           xmlMemBlocks() - mem_base);
31448	    test_ret++;
31449            printf(" %d", n_reader);
31450            printf(" %d", n_localName);
31451            printf(" %d", n_namespaceURI);
31452            printf("\n");
31453        }
31454    }
31455    }
31456    }
31457    function_tests++;
31458#endif
31459
31460    return(test_ret);
31461}
31462
31463
31464static int
31465test_xmlTextReaderMoveToElement(void) {
31466    int test_ret = 0;
31467
31468#if defined(LIBXML_READER_ENABLED)
31469    int mem_base;
31470    int ret_val;
31471    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31472    int n_reader;
31473
31474    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31475        mem_base = xmlMemBlocks();
31476        reader = gen_xmlTextReaderPtr(n_reader, 0);
31477
31478        ret_val = xmlTextReaderMoveToElement(reader);
31479        desret_int(ret_val);
31480        call_tests++;
31481        des_xmlTextReaderPtr(n_reader, reader, 0);
31482        xmlResetLastError();
31483        if (mem_base != xmlMemBlocks()) {
31484            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31485	           xmlMemBlocks() - mem_base);
31486	    test_ret++;
31487            printf(" %d", n_reader);
31488            printf("\n");
31489        }
31490    }
31491    function_tests++;
31492#endif
31493
31494    return(test_ret);
31495}
31496
31497
31498static int
31499test_xmlTextReaderMoveToFirstAttribute(void) {
31500    int test_ret = 0;
31501
31502#if defined(LIBXML_READER_ENABLED)
31503    int mem_base;
31504    int ret_val;
31505    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31506    int n_reader;
31507
31508    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31509        mem_base = xmlMemBlocks();
31510        reader = gen_xmlTextReaderPtr(n_reader, 0);
31511
31512        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31513        desret_int(ret_val);
31514        call_tests++;
31515        des_xmlTextReaderPtr(n_reader, reader, 0);
31516        xmlResetLastError();
31517        if (mem_base != xmlMemBlocks()) {
31518            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31519	           xmlMemBlocks() - mem_base);
31520	    test_ret++;
31521            printf(" %d", n_reader);
31522            printf("\n");
31523        }
31524    }
31525    function_tests++;
31526#endif
31527
31528    return(test_ret);
31529}
31530
31531
31532static int
31533test_xmlTextReaderMoveToNextAttribute(void) {
31534    int test_ret = 0;
31535
31536#if defined(LIBXML_READER_ENABLED)
31537    int mem_base;
31538    int ret_val;
31539    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31540    int n_reader;
31541
31542    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31543        mem_base = xmlMemBlocks();
31544        reader = gen_xmlTextReaderPtr(n_reader, 0);
31545
31546        ret_val = xmlTextReaderMoveToNextAttribute(reader);
31547        desret_int(ret_val);
31548        call_tests++;
31549        des_xmlTextReaderPtr(n_reader, reader, 0);
31550        xmlResetLastError();
31551        if (mem_base != xmlMemBlocks()) {
31552            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31553	           xmlMemBlocks() - mem_base);
31554	    test_ret++;
31555            printf(" %d", n_reader);
31556            printf("\n");
31557        }
31558    }
31559    function_tests++;
31560#endif
31561
31562    return(test_ret);
31563}
31564
31565
31566static int
31567test_xmlTextReaderName(void) {
31568    int test_ret = 0;
31569
31570#if defined(LIBXML_READER_ENABLED)
31571    int mem_base;
31572    xmlChar * ret_val;
31573    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31574    int n_reader;
31575
31576    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31577        mem_base = xmlMemBlocks();
31578        reader = gen_xmlTextReaderPtr(n_reader, 0);
31579
31580        ret_val = xmlTextReaderName(reader);
31581        desret_xmlChar_ptr(ret_val);
31582        call_tests++;
31583        des_xmlTextReaderPtr(n_reader, reader, 0);
31584        xmlResetLastError();
31585        if (mem_base != xmlMemBlocks()) {
31586            printf("Leak of %d blocks found in xmlTextReaderName",
31587	           xmlMemBlocks() - mem_base);
31588	    test_ret++;
31589            printf(" %d", n_reader);
31590            printf("\n");
31591        }
31592    }
31593    function_tests++;
31594#endif
31595
31596    return(test_ret);
31597}
31598
31599
31600static int
31601test_xmlTextReaderNamespaceUri(void) {
31602    int test_ret = 0;
31603
31604#if defined(LIBXML_READER_ENABLED)
31605    int mem_base;
31606    xmlChar * ret_val;
31607    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31608    int n_reader;
31609
31610    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31611        mem_base = xmlMemBlocks();
31612        reader = gen_xmlTextReaderPtr(n_reader, 0);
31613
31614        ret_val = xmlTextReaderNamespaceUri(reader);
31615        desret_xmlChar_ptr(ret_val);
31616        call_tests++;
31617        des_xmlTextReaderPtr(n_reader, reader, 0);
31618        xmlResetLastError();
31619        if (mem_base != xmlMemBlocks()) {
31620            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31621	           xmlMemBlocks() - mem_base);
31622	    test_ret++;
31623            printf(" %d", n_reader);
31624            printf("\n");
31625        }
31626    }
31627    function_tests++;
31628#endif
31629
31630    return(test_ret);
31631}
31632
31633
31634static int
31635test_xmlTextReaderNext(void) {
31636    int test_ret = 0;
31637
31638#if defined(LIBXML_READER_ENABLED)
31639    int mem_base;
31640    int ret_val;
31641    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31642    int n_reader;
31643
31644    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31645        mem_base = xmlMemBlocks();
31646        reader = gen_xmlTextReaderPtr(n_reader, 0);
31647
31648        ret_val = xmlTextReaderNext(reader);
31649        desret_int(ret_val);
31650        call_tests++;
31651        des_xmlTextReaderPtr(n_reader, reader, 0);
31652        xmlResetLastError();
31653        if (mem_base != xmlMemBlocks()) {
31654            printf("Leak of %d blocks found in xmlTextReaderNext",
31655	           xmlMemBlocks() - mem_base);
31656	    test_ret++;
31657            printf(" %d", n_reader);
31658            printf("\n");
31659        }
31660    }
31661    function_tests++;
31662#endif
31663
31664    return(test_ret);
31665}
31666
31667
31668static int
31669test_xmlTextReaderNextSibling(void) {
31670    int test_ret = 0;
31671
31672#if defined(LIBXML_READER_ENABLED)
31673    int mem_base;
31674    int ret_val;
31675    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31676    int n_reader;
31677
31678    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31679        mem_base = xmlMemBlocks();
31680        reader = gen_xmlTextReaderPtr(n_reader, 0);
31681
31682        ret_val = xmlTextReaderNextSibling(reader);
31683        desret_int(ret_val);
31684        call_tests++;
31685        des_xmlTextReaderPtr(n_reader, reader, 0);
31686        xmlResetLastError();
31687        if (mem_base != xmlMemBlocks()) {
31688            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31689	           xmlMemBlocks() - mem_base);
31690	    test_ret++;
31691            printf(" %d", n_reader);
31692            printf("\n");
31693        }
31694    }
31695    function_tests++;
31696#endif
31697
31698    return(test_ret);
31699}
31700
31701
31702static int
31703test_xmlTextReaderNodeType(void) {
31704    int test_ret = 0;
31705
31706#if defined(LIBXML_READER_ENABLED)
31707    int mem_base;
31708    int ret_val;
31709    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31710    int n_reader;
31711
31712    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31713        mem_base = xmlMemBlocks();
31714        reader = gen_xmlTextReaderPtr(n_reader, 0);
31715
31716        ret_val = xmlTextReaderNodeType(reader);
31717        desret_int(ret_val);
31718        call_tests++;
31719        des_xmlTextReaderPtr(n_reader, reader, 0);
31720        xmlResetLastError();
31721        if (mem_base != xmlMemBlocks()) {
31722            printf("Leak of %d blocks found in xmlTextReaderNodeType",
31723	           xmlMemBlocks() - mem_base);
31724	    test_ret++;
31725            printf(" %d", n_reader);
31726            printf("\n");
31727        }
31728    }
31729    function_tests++;
31730#endif
31731
31732    return(test_ret);
31733}
31734
31735
31736static int
31737test_xmlTextReaderNormalization(void) {
31738    int test_ret = 0;
31739
31740#if defined(LIBXML_READER_ENABLED)
31741    int mem_base;
31742    int ret_val;
31743    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31744    int n_reader;
31745
31746    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31747        mem_base = xmlMemBlocks();
31748        reader = gen_xmlTextReaderPtr(n_reader, 0);
31749
31750        ret_val = xmlTextReaderNormalization(reader);
31751        desret_int(ret_val);
31752        call_tests++;
31753        des_xmlTextReaderPtr(n_reader, reader, 0);
31754        xmlResetLastError();
31755        if (mem_base != xmlMemBlocks()) {
31756            printf("Leak of %d blocks found in xmlTextReaderNormalization",
31757	           xmlMemBlocks() - mem_base);
31758	    test_ret++;
31759            printf(" %d", n_reader);
31760            printf("\n");
31761        }
31762    }
31763    function_tests++;
31764#endif
31765
31766    return(test_ret);
31767}
31768
31769
31770static int
31771test_xmlTextReaderPrefix(void) {
31772    int test_ret = 0;
31773
31774#if defined(LIBXML_READER_ENABLED)
31775    int mem_base;
31776    xmlChar * ret_val;
31777    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31778    int n_reader;
31779
31780    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31781        mem_base = xmlMemBlocks();
31782        reader = gen_xmlTextReaderPtr(n_reader, 0);
31783
31784        ret_val = xmlTextReaderPrefix(reader);
31785        desret_xmlChar_ptr(ret_val);
31786        call_tests++;
31787        des_xmlTextReaderPtr(n_reader, reader, 0);
31788        xmlResetLastError();
31789        if (mem_base != xmlMemBlocks()) {
31790            printf("Leak of %d blocks found in xmlTextReaderPrefix",
31791	           xmlMemBlocks() - mem_base);
31792	    test_ret++;
31793            printf(" %d", n_reader);
31794            printf("\n");
31795        }
31796    }
31797    function_tests++;
31798#endif
31799
31800    return(test_ret);
31801}
31802
31803
31804static int
31805test_xmlTextReaderPreserve(void) {
31806    int test_ret = 0;
31807
31808#if defined(LIBXML_READER_ENABLED)
31809    int mem_base;
31810    xmlNodePtr ret_val;
31811    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31812    int n_reader;
31813
31814    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31815        mem_base = xmlMemBlocks();
31816        reader = gen_xmlTextReaderPtr(n_reader, 0);
31817
31818        ret_val = xmlTextReaderPreserve(reader);
31819        desret_xmlNodePtr(ret_val);
31820        call_tests++;
31821        des_xmlTextReaderPtr(n_reader, reader, 0);
31822        xmlResetLastError();
31823        if (mem_base != xmlMemBlocks()) {
31824            printf("Leak of %d blocks found in xmlTextReaderPreserve",
31825	           xmlMemBlocks() - mem_base);
31826	    test_ret++;
31827            printf(" %d", n_reader);
31828            printf("\n");
31829        }
31830    }
31831    function_tests++;
31832#endif
31833
31834    return(test_ret);
31835}
31836
31837
31838static int
31839test_xmlTextReaderPreservePattern(void) {
31840    int test_ret = 0;
31841
31842#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
31843#ifdef LIBXML_PATTERN_ENABLED
31844    int mem_base;
31845    int ret_val;
31846    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31847    int n_reader;
31848    xmlChar * pattern; /* an XPath subset pattern */
31849    int n_pattern;
31850    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
31851    int n_namespaces;
31852
31853    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31854    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
31855    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
31856        mem_base = xmlMemBlocks();
31857        reader = gen_xmlTextReaderPtr(n_reader, 0);
31858        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
31859        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
31860
31861        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
31862        desret_int(ret_val);
31863        call_tests++;
31864        des_xmlTextReaderPtr(n_reader, reader, 0);
31865        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
31866        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
31867        xmlResetLastError();
31868        if (mem_base != xmlMemBlocks()) {
31869            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
31870	           xmlMemBlocks() - mem_base);
31871	    test_ret++;
31872            printf(" %d", n_reader);
31873            printf(" %d", n_pattern);
31874            printf(" %d", n_namespaces);
31875            printf("\n");
31876        }
31877    }
31878    }
31879    }
31880    function_tests++;
31881#endif
31882#endif
31883
31884    return(test_ret);
31885}
31886
31887
31888static int
31889test_xmlTextReaderQuoteChar(void) {
31890    int test_ret = 0;
31891
31892#if defined(LIBXML_READER_ENABLED)
31893    int mem_base;
31894    int ret_val;
31895    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31896    int n_reader;
31897
31898    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31899        mem_base = xmlMemBlocks();
31900        reader = gen_xmlTextReaderPtr(n_reader, 0);
31901
31902        ret_val = xmlTextReaderQuoteChar(reader);
31903        desret_int(ret_val);
31904        call_tests++;
31905        des_xmlTextReaderPtr(n_reader, reader, 0);
31906        xmlResetLastError();
31907        if (mem_base != xmlMemBlocks()) {
31908            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
31909	           xmlMemBlocks() - mem_base);
31910	    test_ret++;
31911            printf(" %d", n_reader);
31912            printf("\n");
31913        }
31914    }
31915    function_tests++;
31916#endif
31917
31918    return(test_ret);
31919}
31920
31921
31922static int
31923test_xmlTextReaderRead(void) {
31924    int test_ret = 0;
31925
31926#if defined(LIBXML_READER_ENABLED)
31927    int mem_base;
31928    int ret_val;
31929    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31930    int n_reader;
31931
31932    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31933        mem_base = xmlMemBlocks();
31934        reader = gen_xmlTextReaderPtr(n_reader, 0);
31935
31936        ret_val = xmlTextReaderRead(reader);
31937        desret_int(ret_val);
31938        call_tests++;
31939        des_xmlTextReaderPtr(n_reader, reader, 0);
31940        xmlResetLastError();
31941        if (mem_base != xmlMemBlocks()) {
31942            printf("Leak of %d blocks found in xmlTextReaderRead",
31943	           xmlMemBlocks() - mem_base);
31944	    test_ret++;
31945            printf(" %d", n_reader);
31946            printf("\n");
31947        }
31948    }
31949    function_tests++;
31950#endif
31951
31952    return(test_ret);
31953}
31954
31955
31956static int
31957test_xmlTextReaderReadAttributeValue(void) {
31958    int test_ret = 0;
31959
31960#if defined(LIBXML_READER_ENABLED)
31961    int mem_base;
31962    int ret_val;
31963    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31964    int n_reader;
31965
31966    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31967        mem_base = xmlMemBlocks();
31968        reader = gen_xmlTextReaderPtr(n_reader, 0);
31969
31970        ret_val = xmlTextReaderReadAttributeValue(reader);
31971        desret_int(ret_val);
31972        call_tests++;
31973        des_xmlTextReaderPtr(n_reader, reader, 0);
31974        xmlResetLastError();
31975        if (mem_base != xmlMemBlocks()) {
31976            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31977	           xmlMemBlocks() - mem_base);
31978	    test_ret++;
31979            printf(" %d", n_reader);
31980            printf("\n");
31981        }
31982    }
31983    function_tests++;
31984#endif
31985
31986    return(test_ret);
31987}
31988
31989
31990static int
31991test_xmlTextReaderReadState(void) {
31992    int test_ret = 0;
31993
31994#if defined(LIBXML_READER_ENABLED)
31995    int mem_base;
31996    int ret_val;
31997    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31998    int n_reader;
31999
32000    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32001        mem_base = xmlMemBlocks();
32002        reader = gen_xmlTextReaderPtr(n_reader, 0);
32003
32004        ret_val = xmlTextReaderReadState(reader);
32005        desret_int(ret_val);
32006        call_tests++;
32007        des_xmlTextReaderPtr(n_reader, reader, 0);
32008        xmlResetLastError();
32009        if (mem_base != xmlMemBlocks()) {
32010            printf("Leak of %d blocks found in xmlTextReaderReadState",
32011	           xmlMemBlocks() - mem_base);
32012	    test_ret++;
32013            printf(" %d", n_reader);
32014            printf("\n");
32015        }
32016    }
32017    function_tests++;
32018#endif
32019
32020    return(test_ret);
32021}
32022
32023
32024static int
32025test_xmlTextReaderRelaxNGSetSchema(void) {
32026    int test_ret = 0;
32027
32028#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32029    int mem_base;
32030    int ret_val;
32031    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32032    int n_reader;
32033    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32034    int n_schema;
32035
32036    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32037    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32038        mem_base = xmlMemBlocks();
32039        reader = gen_xmlTextReaderPtr(n_reader, 0);
32040        schema = gen_xmlRelaxNGPtr(n_schema, 1);
32041
32042        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32043        desret_int(ret_val);
32044        call_tests++;
32045        des_xmlTextReaderPtr(n_reader, reader, 0);
32046        des_xmlRelaxNGPtr(n_schema, schema, 1);
32047        xmlResetLastError();
32048        if (mem_base != xmlMemBlocks()) {
32049            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32050	           xmlMemBlocks() - mem_base);
32051	    test_ret++;
32052            printf(" %d", n_reader);
32053            printf(" %d", n_schema);
32054            printf("\n");
32055        }
32056    }
32057    }
32058    function_tests++;
32059#endif
32060
32061    return(test_ret);
32062}
32063
32064
32065static int
32066test_xmlTextReaderRelaxNGValidate(void) {
32067    int test_ret = 0;
32068
32069#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32070    int mem_base;
32071    int ret_val;
32072    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32073    int n_reader;
32074    char * rng; /* the path to a RelaxNG schema or NULL */
32075    int n_rng;
32076
32077    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32078    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32079        mem_base = xmlMemBlocks();
32080        reader = gen_xmlTextReaderPtr(n_reader, 0);
32081        rng = gen_const_char_ptr(n_rng, 1);
32082
32083        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32084        desret_int(ret_val);
32085        call_tests++;
32086        des_xmlTextReaderPtr(n_reader, reader, 0);
32087        des_const_char_ptr(n_rng, (const char *)rng, 1);
32088        xmlResetLastError();
32089        if (mem_base != xmlMemBlocks()) {
32090            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32091	           xmlMemBlocks() - mem_base);
32092	    test_ret++;
32093            printf(" %d", n_reader);
32094            printf(" %d", n_rng);
32095            printf("\n");
32096        }
32097    }
32098    }
32099    function_tests++;
32100#endif
32101
32102    return(test_ret);
32103}
32104
32105
32106static int
32107test_xmlTextReaderSchemaValidate(void) {
32108    int test_ret = 0;
32109
32110#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32111    int ret_val;
32112    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32113    int n_reader;
32114    char * xsd; /* the path to a W3C XSD schema or NULL */
32115    int n_xsd;
32116
32117    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32118    for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32119        reader = gen_xmlTextReaderPtr(n_reader, 0);
32120        xsd = gen_const_char_ptr(n_xsd, 1);
32121
32122        ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32123        desret_int(ret_val);
32124        call_tests++;
32125        des_xmlTextReaderPtr(n_reader, reader, 0);
32126        des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32127        xmlResetLastError();
32128    }
32129    }
32130    function_tests++;
32131#endif
32132
32133    return(test_ret);
32134}
32135
32136
32137static int
32138test_xmlTextReaderSchemaValidateCtxt(void) {
32139    int test_ret = 0;
32140
32141#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32142    int mem_base;
32143    int ret_val;
32144    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32145    int n_reader;
32146    xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32147    int n_ctxt;
32148    int options; /* options (not used yet) */
32149    int n_options;
32150
32151    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32152    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32153    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32154        mem_base = xmlMemBlocks();
32155        reader = gen_xmlTextReaderPtr(n_reader, 0);
32156        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32157        options = gen_parseroptions(n_options, 2);
32158
32159        ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32160        desret_int(ret_val);
32161        call_tests++;
32162        des_xmlTextReaderPtr(n_reader, reader, 0);
32163        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32164        des_parseroptions(n_options, options, 2);
32165        xmlResetLastError();
32166        if (mem_base != xmlMemBlocks()) {
32167            printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32168	           xmlMemBlocks() - mem_base);
32169	    test_ret++;
32170            printf(" %d", n_reader);
32171            printf(" %d", n_ctxt);
32172            printf(" %d", n_options);
32173            printf("\n");
32174        }
32175    }
32176    }
32177    }
32178    function_tests++;
32179#endif
32180
32181    return(test_ret);
32182}
32183
32184
32185static int
32186test_xmlTextReaderSetErrorHandler(void) {
32187    int test_ret = 0;
32188
32189
32190    /* missing type support */
32191    return(test_ret);
32192}
32193
32194
32195static int
32196test_xmlTextReaderSetParserProp(void) {
32197    int test_ret = 0;
32198
32199#if defined(LIBXML_READER_ENABLED)
32200    int mem_base;
32201    int ret_val;
32202    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32203    int n_reader;
32204    int prop; /* the xmlParserProperties to set */
32205    int n_prop;
32206    int value; /* usually 0 or 1 to (de)activate it */
32207    int n_value;
32208
32209    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32210    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32211    for (n_value = 0;n_value < gen_nb_int;n_value++) {
32212        mem_base = xmlMemBlocks();
32213        reader = gen_xmlTextReaderPtr(n_reader, 0);
32214        prop = gen_int(n_prop, 1);
32215        value = gen_int(n_value, 2);
32216
32217        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32218        desret_int(ret_val);
32219        call_tests++;
32220        des_xmlTextReaderPtr(n_reader, reader, 0);
32221        des_int(n_prop, prop, 1);
32222        des_int(n_value, value, 2);
32223        xmlResetLastError();
32224        if (mem_base != xmlMemBlocks()) {
32225            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32226	           xmlMemBlocks() - mem_base);
32227	    test_ret++;
32228            printf(" %d", n_reader);
32229            printf(" %d", n_prop);
32230            printf(" %d", n_value);
32231            printf("\n");
32232        }
32233    }
32234    }
32235    }
32236    function_tests++;
32237#endif
32238
32239    return(test_ret);
32240}
32241
32242
32243static int
32244test_xmlTextReaderSetSchema(void) {
32245    int test_ret = 0;
32246
32247#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32248    int mem_base;
32249    int ret_val;
32250    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32251    int n_reader;
32252    xmlSchemaPtr schema; /* a precompiled Schema schema */
32253    int n_schema;
32254
32255    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32256    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32257        mem_base = xmlMemBlocks();
32258        reader = gen_xmlTextReaderPtr(n_reader, 0);
32259        schema = gen_xmlSchemaPtr(n_schema, 1);
32260
32261        ret_val = xmlTextReaderSetSchema(reader, schema);
32262        desret_int(ret_val);
32263        call_tests++;
32264        des_xmlTextReaderPtr(n_reader, reader, 0);
32265        des_xmlSchemaPtr(n_schema, schema, 1);
32266        xmlResetLastError();
32267        if (mem_base != xmlMemBlocks()) {
32268            printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32269	           xmlMemBlocks() - mem_base);
32270	    test_ret++;
32271            printf(" %d", n_reader);
32272            printf(" %d", n_schema);
32273            printf("\n");
32274        }
32275    }
32276    }
32277    function_tests++;
32278#endif
32279
32280    return(test_ret);
32281}
32282
32283
32284static int
32285test_xmlTextReaderSetStructuredErrorHandler(void) {
32286    int test_ret = 0;
32287
32288
32289    /* missing type support */
32290    return(test_ret);
32291}
32292
32293
32294static int
32295test_xmlTextReaderSetup(void) {
32296    int test_ret = 0;
32297
32298#if defined(LIBXML_READER_ENABLED)
32299    int mem_base;
32300    int ret_val;
32301    xmlTextReaderPtr reader; /* an XML reader */
32302    int n_reader;
32303    xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32304    int n_input;
32305    const char * URL; /* the base URL to use for the document */
32306    int n_URL;
32307    char * encoding; /* the document encoding, or NULL */
32308    int n_encoding;
32309    int options; /* a combination of xmlParserOption */
32310    int n_options;
32311
32312    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32313    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32314    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32315    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32316    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32317        mem_base = xmlMemBlocks();
32318        reader = gen_xmlTextReaderPtr(n_reader, 0);
32319        input = gen_xmlParserInputBufferPtr(n_input, 1);
32320        URL = gen_filepath(n_URL, 2);
32321        encoding = gen_const_char_ptr(n_encoding, 3);
32322        options = gen_parseroptions(n_options, 4);
32323
32324        ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32325        desret_int(ret_val);
32326        call_tests++;
32327        des_xmlTextReaderPtr(n_reader, reader, 0);
32328        des_filepath(n_URL, URL, 2);
32329        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32330        des_parseroptions(n_options, options, 4);
32331        xmlResetLastError();
32332        if (mem_base != xmlMemBlocks()) {
32333            printf("Leak of %d blocks found in xmlTextReaderSetup",
32334	           xmlMemBlocks() - mem_base);
32335	    test_ret++;
32336            printf(" %d", n_reader);
32337            printf(" %d", n_input);
32338            printf(" %d", n_URL);
32339            printf(" %d", n_encoding);
32340            printf(" %d", n_options);
32341            printf("\n");
32342        }
32343    }
32344    }
32345    }
32346    }
32347    }
32348    function_tests++;
32349#endif
32350
32351    return(test_ret);
32352}
32353
32354
32355static int
32356test_xmlTextReaderStandalone(void) {
32357    int test_ret = 0;
32358
32359#if defined(LIBXML_READER_ENABLED)
32360    int mem_base;
32361    int ret_val;
32362    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32363    int n_reader;
32364
32365    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32366        mem_base = xmlMemBlocks();
32367        reader = gen_xmlTextReaderPtr(n_reader, 0);
32368
32369        ret_val = xmlTextReaderStandalone(reader);
32370        desret_int(ret_val);
32371        call_tests++;
32372        des_xmlTextReaderPtr(n_reader, reader, 0);
32373        xmlResetLastError();
32374        if (mem_base != xmlMemBlocks()) {
32375            printf("Leak of %d blocks found in xmlTextReaderStandalone",
32376	           xmlMemBlocks() - mem_base);
32377	    test_ret++;
32378            printf(" %d", n_reader);
32379            printf("\n");
32380        }
32381    }
32382    function_tests++;
32383#endif
32384
32385    return(test_ret);
32386}
32387
32388
32389static int
32390test_xmlTextReaderValue(void) {
32391    int test_ret = 0;
32392
32393#if defined(LIBXML_READER_ENABLED)
32394    int mem_base;
32395    xmlChar * ret_val;
32396    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32397    int n_reader;
32398
32399    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32400        mem_base = xmlMemBlocks();
32401        reader = gen_xmlTextReaderPtr(n_reader, 0);
32402
32403        ret_val = xmlTextReaderValue(reader);
32404        desret_xmlChar_ptr(ret_val);
32405        call_tests++;
32406        des_xmlTextReaderPtr(n_reader, reader, 0);
32407        xmlResetLastError();
32408        if (mem_base != xmlMemBlocks()) {
32409            printf("Leak of %d blocks found in xmlTextReaderValue",
32410	           xmlMemBlocks() - mem_base);
32411	    test_ret++;
32412            printf(" %d", n_reader);
32413            printf("\n");
32414        }
32415    }
32416    function_tests++;
32417#endif
32418
32419    return(test_ret);
32420}
32421
32422
32423static int
32424test_xmlTextReaderXmlLang(void) {
32425    int test_ret = 0;
32426
32427#if defined(LIBXML_READER_ENABLED)
32428    int mem_base;
32429    xmlChar * ret_val;
32430    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32431    int n_reader;
32432
32433    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32434        mem_base = xmlMemBlocks();
32435        reader = gen_xmlTextReaderPtr(n_reader, 0);
32436
32437        ret_val = xmlTextReaderXmlLang(reader);
32438        desret_xmlChar_ptr(ret_val);
32439        call_tests++;
32440        des_xmlTextReaderPtr(n_reader, reader, 0);
32441        xmlResetLastError();
32442        if (mem_base != xmlMemBlocks()) {
32443            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32444	           xmlMemBlocks() - mem_base);
32445	    test_ret++;
32446            printf(" %d", n_reader);
32447            printf("\n");
32448        }
32449    }
32450    function_tests++;
32451#endif
32452
32453    return(test_ret);
32454}
32455
32456static int
32457test_xmlreader(void) {
32458    int test_ret = 0;
32459
32460    if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n");
32461    test_ret += test_xmlNewTextReader();
32462    test_ret += test_xmlNewTextReaderFilename();
32463    test_ret += test_xmlReaderForDoc();
32464    test_ret += test_xmlReaderForFile();
32465    test_ret += test_xmlReaderForMemory();
32466    test_ret += test_xmlReaderNewDoc();
32467    test_ret += test_xmlReaderNewFile();
32468    test_ret += test_xmlReaderNewMemory();
32469    test_ret += test_xmlReaderNewWalker();
32470    test_ret += test_xmlReaderWalker();
32471    test_ret += test_xmlTextReaderAttributeCount();
32472    test_ret += test_xmlTextReaderBaseUri();
32473    test_ret += test_xmlTextReaderByteConsumed();
32474    test_ret += test_xmlTextReaderClose();
32475    test_ret += test_xmlTextReaderConstBaseUri();
32476    test_ret += test_xmlTextReaderConstEncoding();
32477    test_ret += test_xmlTextReaderConstLocalName();
32478    test_ret += test_xmlTextReaderConstName();
32479    test_ret += test_xmlTextReaderConstNamespaceUri();
32480    test_ret += test_xmlTextReaderConstPrefix();
32481    test_ret += test_xmlTextReaderConstString();
32482    test_ret += test_xmlTextReaderConstValue();
32483    test_ret += test_xmlTextReaderConstXmlLang();
32484    test_ret += test_xmlTextReaderConstXmlVersion();
32485    test_ret += test_xmlTextReaderCurrentDoc();
32486    test_ret += test_xmlTextReaderCurrentNode();
32487    test_ret += test_xmlTextReaderDepth();
32488    test_ret += test_xmlTextReaderExpand();
32489    test_ret += test_xmlTextReaderGetAttribute();
32490    test_ret += test_xmlTextReaderGetAttributeNo();
32491    test_ret += test_xmlTextReaderGetAttributeNs();
32492    test_ret += test_xmlTextReaderGetErrorHandler();
32493    test_ret += test_xmlTextReaderGetParserColumnNumber();
32494    test_ret += test_xmlTextReaderGetParserLineNumber();
32495    test_ret += test_xmlTextReaderGetParserProp();
32496    test_ret += test_xmlTextReaderGetRemainder();
32497    test_ret += test_xmlTextReaderHasAttributes();
32498    test_ret += test_xmlTextReaderHasValue();
32499    test_ret += test_xmlTextReaderIsDefault();
32500    test_ret += test_xmlTextReaderIsEmptyElement();
32501    test_ret += test_xmlTextReaderIsNamespaceDecl();
32502    test_ret += test_xmlTextReaderIsValid();
32503    test_ret += test_xmlTextReaderLocalName();
32504    test_ret += test_xmlTextReaderLocatorBaseURI();
32505    test_ret += test_xmlTextReaderLocatorLineNumber();
32506    test_ret += test_xmlTextReaderLookupNamespace();
32507    test_ret += test_xmlTextReaderMoveToAttribute();
32508    test_ret += test_xmlTextReaderMoveToAttributeNo();
32509    test_ret += test_xmlTextReaderMoveToAttributeNs();
32510    test_ret += test_xmlTextReaderMoveToElement();
32511    test_ret += test_xmlTextReaderMoveToFirstAttribute();
32512    test_ret += test_xmlTextReaderMoveToNextAttribute();
32513    test_ret += test_xmlTextReaderName();
32514    test_ret += test_xmlTextReaderNamespaceUri();
32515    test_ret += test_xmlTextReaderNext();
32516    test_ret += test_xmlTextReaderNextSibling();
32517    test_ret += test_xmlTextReaderNodeType();
32518    test_ret += test_xmlTextReaderNormalization();
32519    test_ret += test_xmlTextReaderPrefix();
32520    test_ret += test_xmlTextReaderPreserve();
32521    test_ret += test_xmlTextReaderPreservePattern();
32522    test_ret += test_xmlTextReaderQuoteChar();
32523    test_ret += test_xmlTextReaderRead();
32524    test_ret += test_xmlTextReaderReadAttributeValue();
32525    test_ret += test_xmlTextReaderReadState();
32526    test_ret += test_xmlTextReaderRelaxNGSetSchema();
32527    test_ret += test_xmlTextReaderRelaxNGValidate();
32528    test_ret += test_xmlTextReaderSchemaValidate();
32529    test_ret += test_xmlTextReaderSchemaValidateCtxt();
32530    test_ret += test_xmlTextReaderSetErrorHandler();
32531    test_ret += test_xmlTextReaderSetParserProp();
32532    test_ret += test_xmlTextReaderSetSchema();
32533    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32534    test_ret += test_xmlTextReaderSetup();
32535    test_ret += test_xmlTextReaderStandalone();
32536    test_ret += test_xmlTextReaderValue();
32537    test_ret += test_xmlTextReaderXmlLang();
32538
32539    if (test_ret != 0)
32540	printf("Module xmlreader: %d errors\n", test_ret);
32541    return(test_ret);
32542}
32543
32544static int
32545test_xmlExpCtxtNbCons(void) {
32546    int test_ret = 0;
32547
32548#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32549    int mem_base;
32550    int ret_val;
32551    xmlExpCtxtPtr ctxt; /* an expression context */
32552    int n_ctxt;
32553
32554    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32555        mem_base = xmlMemBlocks();
32556        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32557
32558        ret_val = xmlExpCtxtNbCons(ctxt);
32559        desret_int(ret_val);
32560        call_tests++;
32561        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32562        xmlResetLastError();
32563        if (mem_base != xmlMemBlocks()) {
32564            printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32565	           xmlMemBlocks() - mem_base);
32566	    test_ret++;
32567            printf(" %d", n_ctxt);
32568            printf("\n");
32569        }
32570    }
32571    function_tests++;
32572#endif
32573
32574    return(test_ret);
32575}
32576
32577
32578static int
32579test_xmlExpCtxtNbNodes(void) {
32580    int test_ret = 0;
32581
32582#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32583    int mem_base;
32584    int ret_val;
32585    xmlExpCtxtPtr ctxt; /* an expression context */
32586    int n_ctxt;
32587
32588    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32589        mem_base = xmlMemBlocks();
32590        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32591
32592        ret_val = xmlExpCtxtNbNodes(ctxt);
32593        desret_int(ret_val);
32594        call_tests++;
32595        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32596        xmlResetLastError();
32597        if (mem_base != xmlMemBlocks()) {
32598            printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32599	           xmlMemBlocks() - mem_base);
32600	    test_ret++;
32601            printf(" %d", n_ctxt);
32602            printf("\n");
32603        }
32604    }
32605    function_tests++;
32606#endif
32607
32608    return(test_ret);
32609}
32610
32611
32612static int
32613test_xmlExpDump(void) {
32614    int test_ret = 0;
32615
32616#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32617    int mem_base;
32618    xmlBufferPtr buf; /* a buffer to receive the output */
32619    int n_buf;
32620    xmlExpNodePtr expr; /* the compiled expression */
32621    int n_expr;
32622
32623    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32624    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32625        mem_base = xmlMemBlocks();
32626        buf = gen_xmlBufferPtr(n_buf, 0);
32627        expr = gen_xmlExpNodePtr(n_expr, 1);
32628
32629        xmlExpDump(buf, expr);
32630        call_tests++;
32631        des_xmlBufferPtr(n_buf, buf, 0);
32632        des_xmlExpNodePtr(n_expr, expr, 1);
32633        xmlResetLastError();
32634        if (mem_base != xmlMemBlocks()) {
32635            printf("Leak of %d blocks found in xmlExpDump",
32636	           xmlMemBlocks() - mem_base);
32637	    test_ret++;
32638            printf(" %d", n_buf);
32639            printf(" %d", n_expr);
32640            printf("\n");
32641        }
32642    }
32643    }
32644    function_tests++;
32645#endif
32646
32647    return(test_ret);
32648}
32649
32650
32651static int
32652test_xmlExpExpDerive(void) {
32653    int test_ret = 0;
32654
32655
32656    /* missing type support */
32657    return(test_ret);
32658}
32659
32660
32661static int
32662test_xmlExpGetLanguage(void) {
32663    int test_ret = 0;
32664
32665#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32666    int mem_base;
32667    int ret_val;
32668    xmlExpCtxtPtr ctxt; /* the expression context */
32669    int n_ctxt;
32670    xmlExpNodePtr exp; /* the expression */
32671    int n_exp;
32672    xmlChar ** langList; /* where to store the tokens */
32673    int n_langList;
32674    int len; /* the allocated lenght of @list */
32675    int n_len;
32676
32677    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32678    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32679    for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32680    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32681        mem_base = xmlMemBlocks();
32682        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32683        exp = gen_xmlExpNodePtr(n_exp, 1);
32684        langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32685        len = gen_int(n_len, 3);
32686
32687        ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32688        desret_int(ret_val);
32689        call_tests++;
32690        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32691        des_xmlExpNodePtr(n_exp, exp, 1);
32692        des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32693        des_int(n_len, len, 3);
32694        xmlResetLastError();
32695        if (mem_base != xmlMemBlocks()) {
32696            printf("Leak of %d blocks found in xmlExpGetLanguage",
32697	           xmlMemBlocks() - mem_base);
32698	    test_ret++;
32699            printf(" %d", n_ctxt);
32700            printf(" %d", n_exp);
32701            printf(" %d", n_langList);
32702            printf(" %d", n_len);
32703            printf("\n");
32704        }
32705    }
32706    }
32707    }
32708    }
32709    function_tests++;
32710#endif
32711
32712    return(test_ret);
32713}
32714
32715
32716static int
32717test_xmlExpGetStart(void) {
32718    int test_ret = 0;
32719
32720#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32721    int mem_base;
32722    int ret_val;
32723    xmlExpCtxtPtr ctxt; /* the expression context */
32724    int n_ctxt;
32725    xmlExpNodePtr exp; /* the expression */
32726    int n_exp;
32727    xmlChar ** tokList; /* where to store the tokens */
32728    int n_tokList;
32729    int len; /* the allocated lenght of @list */
32730    int n_len;
32731
32732    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32733    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32734    for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32735    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32736        mem_base = xmlMemBlocks();
32737        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32738        exp = gen_xmlExpNodePtr(n_exp, 1);
32739        tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32740        len = gen_int(n_len, 3);
32741
32742        ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32743        desret_int(ret_val);
32744        call_tests++;
32745        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32746        des_xmlExpNodePtr(n_exp, exp, 1);
32747        des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32748        des_int(n_len, len, 3);
32749        xmlResetLastError();
32750        if (mem_base != xmlMemBlocks()) {
32751            printf("Leak of %d blocks found in xmlExpGetStart",
32752	           xmlMemBlocks() - mem_base);
32753	    test_ret++;
32754            printf(" %d", n_ctxt);
32755            printf(" %d", n_exp);
32756            printf(" %d", n_tokList);
32757            printf(" %d", n_len);
32758            printf("\n");
32759        }
32760    }
32761    }
32762    }
32763    }
32764    function_tests++;
32765#endif
32766
32767    return(test_ret);
32768}
32769
32770
32771static int
32772test_xmlExpIsNillable(void) {
32773    int test_ret = 0;
32774
32775#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32776    int mem_base;
32777    int ret_val;
32778    xmlExpNodePtr exp; /* the expression */
32779    int n_exp;
32780
32781    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32782        mem_base = xmlMemBlocks();
32783        exp = gen_xmlExpNodePtr(n_exp, 0);
32784
32785        ret_val = xmlExpIsNillable(exp);
32786        desret_int(ret_val);
32787        call_tests++;
32788        des_xmlExpNodePtr(n_exp, exp, 0);
32789        xmlResetLastError();
32790        if (mem_base != xmlMemBlocks()) {
32791            printf("Leak of %d blocks found in xmlExpIsNillable",
32792	           xmlMemBlocks() - mem_base);
32793	    test_ret++;
32794            printf(" %d", n_exp);
32795            printf("\n");
32796        }
32797    }
32798    function_tests++;
32799#endif
32800
32801    return(test_ret);
32802}
32803
32804
32805static int
32806test_xmlExpMaxToken(void) {
32807    int test_ret = 0;
32808
32809#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32810    int mem_base;
32811    int ret_val;
32812    xmlExpNodePtr expr; /* a compiled expression */
32813    int n_expr;
32814
32815    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32816        mem_base = xmlMemBlocks();
32817        expr = gen_xmlExpNodePtr(n_expr, 0);
32818
32819        ret_val = xmlExpMaxToken(expr);
32820        desret_int(ret_val);
32821        call_tests++;
32822        des_xmlExpNodePtr(n_expr, expr, 0);
32823        xmlResetLastError();
32824        if (mem_base != xmlMemBlocks()) {
32825            printf("Leak of %d blocks found in xmlExpMaxToken",
32826	           xmlMemBlocks() - mem_base);
32827	    test_ret++;
32828            printf(" %d", n_expr);
32829            printf("\n");
32830        }
32831    }
32832    function_tests++;
32833#endif
32834
32835    return(test_ret);
32836}
32837
32838
32839static int
32840test_xmlExpNewAtom(void) {
32841    int test_ret = 0;
32842
32843
32844    /* missing type support */
32845    return(test_ret);
32846}
32847
32848
32849static int
32850test_xmlExpNewCtxt(void) {
32851    int test_ret = 0;
32852
32853
32854    /* missing type support */
32855    return(test_ret);
32856}
32857
32858
32859static int
32860test_xmlExpNewOr(void) {
32861    int test_ret = 0;
32862
32863
32864    /* missing type support */
32865    return(test_ret);
32866}
32867
32868
32869static int
32870test_xmlExpNewRange(void) {
32871    int test_ret = 0;
32872
32873
32874    /* missing type support */
32875    return(test_ret);
32876}
32877
32878
32879static int
32880test_xmlExpNewSeq(void) {
32881    int test_ret = 0;
32882
32883
32884    /* missing type support */
32885    return(test_ret);
32886}
32887
32888
32889static int
32890test_xmlExpParse(void) {
32891    int test_ret = 0;
32892
32893
32894    /* missing type support */
32895    return(test_ret);
32896}
32897
32898
32899static int
32900test_xmlExpRef(void) {
32901    int test_ret = 0;
32902
32903#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32904    int mem_base;
32905    xmlExpNodePtr exp; /* the expression */
32906    int n_exp;
32907
32908    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32909        mem_base = xmlMemBlocks();
32910        exp = gen_xmlExpNodePtr(n_exp, 0);
32911
32912        xmlExpRef(exp);
32913        call_tests++;
32914        des_xmlExpNodePtr(n_exp, exp, 0);
32915        xmlResetLastError();
32916        if (mem_base != xmlMemBlocks()) {
32917            printf("Leak of %d blocks found in xmlExpRef",
32918	           xmlMemBlocks() - mem_base);
32919	    test_ret++;
32920            printf(" %d", n_exp);
32921            printf("\n");
32922        }
32923    }
32924    function_tests++;
32925#endif
32926
32927    return(test_ret);
32928}
32929
32930
32931static int
32932test_xmlExpStringDerive(void) {
32933    int test_ret = 0;
32934
32935
32936    /* missing type support */
32937    return(test_ret);
32938}
32939
32940
32941static int
32942test_xmlExpSubsume(void) {
32943    int test_ret = 0;
32944
32945#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32946    int mem_base;
32947    int ret_val;
32948    xmlExpCtxtPtr ctxt; /* the expressions context */
32949    int n_ctxt;
32950    xmlExpNodePtr exp; /* the englobing expression */
32951    int n_exp;
32952    xmlExpNodePtr sub; /* the subexpression */
32953    int n_sub;
32954
32955    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32956    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32957    for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
32958        mem_base = xmlMemBlocks();
32959        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32960        exp = gen_xmlExpNodePtr(n_exp, 1);
32961        sub = gen_xmlExpNodePtr(n_sub, 2);
32962
32963        ret_val = xmlExpSubsume(ctxt, exp, sub);
32964        desret_int(ret_val);
32965        call_tests++;
32966        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32967        des_xmlExpNodePtr(n_exp, exp, 1);
32968        des_xmlExpNodePtr(n_sub, sub, 2);
32969        xmlResetLastError();
32970        if (mem_base != xmlMemBlocks()) {
32971            printf("Leak of %d blocks found in xmlExpSubsume",
32972	           xmlMemBlocks() - mem_base);
32973	    test_ret++;
32974            printf(" %d", n_ctxt);
32975            printf(" %d", n_exp);
32976            printf(" %d", n_sub);
32977            printf("\n");
32978        }
32979    }
32980    }
32981    }
32982    function_tests++;
32983#endif
32984
32985    return(test_ret);
32986}
32987
32988#ifdef LIBXML_REGEXP_ENABLED
32989
32990#define gen_nb_xmlRegExecCtxtPtr 1
32991static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32992    return(NULL);
32993}
32994static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32995}
32996#endif
32997
32998
32999static int
33000test_xmlRegExecErrInfo(void) {
33001    int test_ret = 0;
33002
33003#if defined(LIBXML_REGEXP_ENABLED)
33004    int mem_base;
33005    int ret_val;
33006    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33007    int n_exec;
33008    xmlChar ** string; /* return value for the error string */
33009    int n_string;
33010    int * nbval; /* pointer to the number of accepted values IN/OUT */
33011    int n_nbval;
33012    int * nbneg; /* return number of negative transitions */
33013    int n_nbneg;
33014    xmlChar ** values; /* pointer to the array of acceptable values */
33015    int n_values;
33016    int * terminal; /* return value if this was a terminal state */
33017    int n_terminal;
33018
33019    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33020    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33021    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33022    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33023    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33024    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33025        mem_base = xmlMemBlocks();
33026        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33027        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33028        nbval = gen_int_ptr(n_nbval, 2);
33029        nbneg = gen_int_ptr(n_nbneg, 3);
33030        values = gen_xmlChar_ptr_ptr(n_values, 4);
33031        terminal = gen_int_ptr(n_terminal, 5);
33032
33033        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33034        desret_int(ret_val);
33035        call_tests++;
33036        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33037        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33038        des_int_ptr(n_nbval, nbval, 2);
33039        des_int_ptr(n_nbneg, nbneg, 3);
33040        des_xmlChar_ptr_ptr(n_values, values, 4);
33041        des_int_ptr(n_terminal, terminal, 5);
33042        xmlResetLastError();
33043        if (mem_base != xmlMemBlocks()) {
33044            printf("Leak of %d blocks found in xmlRegExecErrInfo",
33045	           xmlMemBlocks() - mem_base);
33046	    test_ret++;
33047            printf(" %d", n_exec);
33048            printf(" %d", n_string);
33049            printf(" %d", n_nbval);
33050            printf(" %d", n_nbneg);
33051            printf(" %d", n_values);
33052            printf(" %d", n_terminal);
33053            printf("\n");
33054        }
33055    }
33056    }
33057    }
33058    }
33059    }
33060    }
33061    function_tests++;
33062#endif
33063
33064    return(test_ret);
33065}
33066
33067
33068static int
33069test_xmlRegExecNextValues(void) {
33070    int test_ret = 0;
33071
33072#if defined(LIBXML_REGEXP_ENABLED)
33073    int mem_base;
33074    int ret_val;
33075    xmlRegExecCtxtPtr exec; /* a regexp execution context */
33076    int n_exec;
33077    int * nbval; /* pointer to the number of accepted values IN/OUT */
33078    int n_nbval;
33079    int * nbneg; /* return number of negative transitions */
33080    int n_nbneg;
33081    xmlChar ** values; /* pointer to the array of acceptable values */
33082    int n_values;
33083    int * terminal; /* return value if this was a terminal state */
33084    int n_terminal;
33085
33086    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33087    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33088    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33089    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33090    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33091        mem_base = xmlMemBlocks();
33092        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33093        nbval = gen_int_ptr(n_nbval, 1);
33094        nbneg = gen_int_ptr(n_nbneg, 2);
33095        values = gen_xmlChar_ptr_ptr(n_values, 3);
33096        terminal = gen_int_ptr(n_terminal, 4);
33097
33098        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33099        desret_int(ret_val);
33100        call_tests++;
33101        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33102        des_int_ptr(n_nbval, nbval, 1);
33103        des_int_ptr(n_nbneg, nbneg, 2);
33104        des_xmlChar_ptr_ptr(n_values, values, 3);
33105        des_int_ptr(n_terminal, terminal, 4);
33106        xmlResetLastError();
33107        if (mem_base != xmlMemBlocks()) {
33108            printf("Leak of %d blocks found in xmlRegExecNextValues",
33109	           xmlMemBlocks() - mem_base);
33110	    test_ret++;
33111            printf(" %d", n_exec);
33112            printf(" %d", n_nbval);
33113            printf(" %d", n_nbneg);
33114            printf(" %d", n_values);
33115            printf(" %d", n_terminal);
33116            printf("\n");
33117        }
33118    }
33119    }
33120    }
33121    }
33122    }
33123    function_tests++;
33124#endif
33125
33126    return(test_ret);
33127}
33128
33129
33130static int
33131test_xmlRegExecPushString(void) {
33132    int test_ret = 0;
33133
33134#if defined(LIBXML_REGEXP_ENABLED)
33135    int mem_base;
33136    int ret_val;
33137    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33138    int n_exec;
33139    xmlChar * value; /* a string token input */
33140    int n_value;
33141    void * data; /* data associated to the token to reuse in callbacks */
33142    int n_data;
33143
33144    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33145    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33146    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33147        mem_base = xmlMemBlocks();
33148        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33149        value = gen_const_xmlChar_ptr(n_value, 1);
33150        data = gen_userdata(n_data, 2);
33151
33152        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33153        desret_int(ret_val);
33154        call_tests++;
33155        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33156        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33157        des_userdata(n_data, data, 2);
33158        xmlResetLastError();
33159        if (mem_base != xmlMemBlocks()) {
33160            printf("Leak of %d blocks found in xmlRegExecPushString",
33161	           xmlMemBlocks() - mem_base);
33162	    test_ret++;
33163            printf(" %d", n_exec);
33164            printf(" %d", n_value);
33165            printf(" %d", n_data);
33166            printf("\n");
33167        }
33168    }
33169    }
33170    }
33171    function_tests++;
33172#endif
33173
33174    return(test_ret);
33175}
33176
33177
33178static int
33179test_xmlRegExecPushString2(void) {
33180    int test_ret = 0;
33181
33182#if defined(LIBXML_REGEXP_ENABLED)
33183    int mem_base;
33184    int ret_val;
33185    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33186    int n_exec;
33187    xmlChar * value; /* the first string token input */
33188    int n_value;
33189    xmlChar * value2; /* the second string token input */
33190    int n_value2;
33191    void * data; /* data associated to the token to reuse in callbacks */
33192    int n_data;
33193
33194    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33195    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33196    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33197    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33198        mem_base = xmlMemBlocks();
33199        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33200        value = gen_const_xmlChar_ptr(n_value, 1);
33201        value2 = gen_const_xmlChar_ptr(n_value2, 2);
33202        data = gen_userdata(n_data, 3);
33203
33204        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33205        desret_int(ret_val);
33206        call_tests++;
33207        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33208        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33209        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33210        des_userdata(n_data, data, 3);
33211        xmlResetLastError();
33212        if (mem_base != xmlMemBlocks()) {
33213            printf("Leak of %d blocks found in xmlRegExecPushString2",
33214	           xmlMemBlocks() - mem_base);
33215	    test_ret++;
33216            printf(" %d", n_exec);
33217            printf(" %d", n_value);
33218            printf(" %d", n_value2);
33219            printf(" %d", n_data);
33220            printf("\n");
33221        }
33222    }
33223    }
33224    }
33225    }
33226    function_tests++;
33227#endif
33228
33229    return(test_ret);
33230}
33231
33232#ifdef LIBXML_REGEXP_ENABLED
33233
33234#define gen_nb_xmlRegexpPtr 1
33235static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33236    return(NULL);
33237}
33238static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33239}
33240#endif
33241
33242
33243static int
33244test_xmlRegNewExecCtxt(void) {
33245    int test_ret = 0;
33246
33247
33248    /* missing type support */
33249    return(test_ret);
33250}
33251
33252
33253static int
33254test_xmlRegexpCompile(void) {
33255    int test_ret = 0;
33256
33257
33258    /* missing type support */
33259    return(test_ret);
33260}
33261
33262
33263static int
33264test_xmlRegexpExec(void) {
33265    int test_ret = 0;
33266
33267#if defined(LIBXML_REGEXP_ENABLED)
33268    int mem_base;
33269    int ret_val;
33270    xmlRegexpPtr comp; /* the compiled regular expression */
33271    int n_comp;
33272    xmlChar * content; /* the value to check against the regular expression */
33273    int n_content;
33274
33275    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33276    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33277        mem_base = xmlMemBlocks();
33278        comp = gen_xmlRegexpPtr(n_comp, 0);
33279        content = gen_const_xmlChar_ptr(n_content, 1);
33280
33281        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33282        desret_int(ret_val);
33283        call_tests++;
33284        des_xmlRegexpPtr(n_comp, comp, 0);
33285        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33286        xmlResetLastError();
33287        if (mem_base != xmlMemBlocks()) {
33288            printf("Leak of %d blocks found in xmlRegexpExec",
33289	           xmlMemBlocks() - mem_base);
33290	    test_ret++;
33291            printf(" %d", n_comp);
33292            printf(" %d", n_content);
33293            printf("\n");
33294        }
33295    }
33296    }
33297    function_tests++;
33298#endif
33299
33300    return(test_ret);
33301}
33302
33303
33304static int
33305test_xmlRegexpIsDeterminist(void) {
33306    int test_ret = 0;
33307
33308#if defined(LIBXML_REGEXP_ENABLED)
33309    int mem_base;
33310    int ret_val;
33311    xmlRegexpPtr comp; /* the compiled regular expression */
33312    int n_comp;
33313
33314    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33315        mem_base = xmlMemBlocks();
33316        comp = gen_xmlRegexpPtr(n_comp, 0);
33317
33318        ret_val = xmlRegexpIsDeterminist(comp);
33319        desret_int(ret_val);
33320        call_tests++;
33321        des_xmlRegexpPtr(n_comp, comp, 0);
33322        xmlResetLastError();
33323        if (mem_base != xmlMemBlocks()) {
33324            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33325	           xmlMemBlocks() - mem_base);
33326	    test_ret++;
33327            printf(" %d", n_comp);
33328            printf("\n");
33329        }
33330    }
33331    function_tests++;
33332#endif
33333
33334    return(test_ret);
33335}
33336
33337
33338static int
33339test_xmlRegexpPrint(void) {
33340    int test_ret = 0;
33341
33342#if defined(LIBXML_REGEXP_ENABLED)
33343    int mem_base;
33344    FILE * output; /* the file for the output debug */
33345    int n_output;
33346    xmlRegexpPtr regexp; /* the compiled regexp */
33347    int n_regexp;
33348
33349    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33350    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33351        mem_base = xmlMemBlocks();
33352        output = gen_FILE_ptr(n_output, 0);
33353        regexp = gen_xmlRegexpPtr(n_regexp, 1);
33354
33355        xmlRegexpPrint(output, regexp);
33356        call_tests++;
33357        des_FILE_ptr(n_output, output, 0);
33358        des_xmlRegexpPtr(n_regexp, regexp, 1);
33359        xmlResetLastError();
33360        if (mem_base != xmlMemBlocks()) {
33361            printf("Leak of %d blocks found in xmlRegexpPrint",
33362	           xmlMemBlocks() - mem_base);
33363	    test_ret++;
33364            printf(" %d", n_output);
33365            printf(" %d", n_regexp);
33366            printf("\n");
33367        }
33368    }
33369    }
33370    function_tests++;
33371#endif
33372
33373    return(test_ret);
33374}
33375
33376static int
33377test_xmlregexp(void) {
33378    int test_ret = 0;
33379
33380    if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33381    test_ret += test_xmlExpCtxtNbCons();
33382    test_ret += test_xmlExpCtxtNbNodes();
33383    test_ret += test_xmlExpDump();
33384    test_ret += test_xmlExpExpDerive();
33385    test_ret += test_xmlExpGetLanguage();
33386    test_ret += test_xmlExpGetStart();
33387    test_ret += test_xmlExpIsNillable();
33388    test_ret += test_xmlExpMaxToken();
33389    test_ret += test_xmlExpNewAtom();
33390    test_ret += test_xmlExpNewCtxt();
33391    test_ret += test_xmlExpNewOr();
33392    test_ret += test_xmlExpNewRange();
33393    test_ret += test_xmlExpNewSeq();
33394    test_ret += test_xmlExpParse();
33395    test_ret += test_xmlExpRef();
33396    test_ret += test_xmlExpStringDerive();
33397    test_ret += test_xmlExpSubsume();
33398    test_ret += test_xmlRegExecErrInfo();
33399    test_ret += test_xmlRegExecNextValues();
33400    test_ret += test_xmlRegExecPushString();
33401    test_ret += test_xmlRegExecPushString2();
33402    test_ret += test_xmlRegNewExecCtxt();
33403    test_ret += test_xmlRegexpCompile();
33404    test_ret += test_xmlRegexpExec();
33405    test_ret += test_xmlRegexpIsDeterminist();
33406    test_ret += test_xmlRegexpPrint();
33407
33408    if (test_ret != 0)
33409	printf("Module xmlregexp: %d errors\n", test_ret);
33410    return(test_ret);
33411}
33412#ifdef LIBXML_OUTPUT_ENABLED
33413
33414#define gen_nb_xmlSaveCtxtPtr 1
33415static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33416    return(NULL);
33417}
33418static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33419}
33420#endif
33421
33422
33423static int
33424test_xmlSaveClose(void) {
33425    int test_ret = 0;
33426
33427#if defined(LIBXML_OUTPUT_ENABLED)
33428    int mem_base;
33429    int ret_val;
33430    xmlSaveCtxtPtr ctxt; /* a document saving context */
33431    int n_ctxt;
33432
33433    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33434        mem_base = xmlMemBlocks();
33435        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33436
33437        ret_val = xmlSaveClose(ctxt);
33438        desret_int(ret_val);
33439        call_tests++;
33440        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33441        xmlResetLastError();
33442        if (mem_base != xmlMemBlocks()) {
33443            printf("Leak of %d blocks found in xmlSaveClose",
33444	           xmlMemBlocks() - mem_base);
33445	    test_ret++;
33446            printf(" %d", n_ctxt);
33447            printf("\n");
33448        }
33449    }
33450    function_tests++;
33451#endif
33452
33453    return(test_ret);
33454}
33455
33456
33457static int
33458test_xmlSaveDoc(void) {
33459    int test_ret = 0;
33460
33461#if defined(LIBXML_OUTPUT_ENABLED)
33462    int mem_base;
33463    long ret_val;
33464    xmlSaveCtxtPtr ctxt; /* a document saving context */
33465    int n_ctxt;
33466    xmlDocPtr doc; /* a document */
33467    int n_doc;
33468
33469    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33470    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33471        mem_base = xmlMemBlocks();
33472        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33473        doc = gen_xmlDocPtr(n_doc, 1);
33474
33475        ret_val = xmlSaveDoc(ctxt, doc);
33476        desret_long(ret_val);
33477        call_tests++;
33478        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33479        des_xmlDocPtr(n_doc, doc, 1);
33480        xmlResetLastError();
33481        if (mem_base != xmlMemBlocks()) {
33482            printf("Leak of %d blocks found in xmlSaveDoc",
33483	           xmlMemBlocks() - mem_base);
33484	    test_ret++;
33485            printf(" %d", n_ctxt);
33486            printf(" %d", n_doc);
33487            printf("\n");
33488        }
33489    }
33490    }
33491    function_tests++;
33492#endif
33493
33494    return(test_ret);
33495}
33496
33497
33498static int
33499test_xmlSaveFlush(void) {
33500    int test_ret = 0;
33501
33502#if defined(LIBXML_OUTPUT_ENABLED)
33503    int mem_base;
33504    int ret_val;
33505    xmlSaveCtxtPtr ctxt; /* a document saving context */
33506    int n_ctxt;
33507
33508    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33509        mem_base = xmlMemBlocks();
33510        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33511
33512        ret_val = xmlSaveFlush(ctxt);
33513        desret_int(ret_val);
33514        call_tests++;
33515        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33516        xmlResetLastError();
33517        if (mem_base != xmlMemBlocks()) {
33518            printf("Leak of %d blocks found in xmlSaveFlush",
33519	           xmlMemBlocks() - mem_base);
33520	    test_ret++;
33521            printf(" %d", n_ctxt);
33522            printf("\n");
33523        }
33524    }
33525    function_tests++;
33526#endif
33527
33528    return(test_ret);
33529}
33530
33531
33532static int
33533test_xmlSaveSetAttrEscape(void) {
33534    int test_ret = 0;
33535
33536
33537    /* missing type support */
33538    return(test_ret);
33539}
33540
33541
33542static int
33543test_xmlSaveSetEscape(void) {
33544    int test_ret = 0;
33545
33546
33547    /* missing type support */
33548    return(test_ret);
33549}
33550
33551
33552static int
33553test_xmlSaveToBuffer(void) {
33554    int test_ret = 0;
33555
33556
33557    /* missing type support */
33558    return(test_ret);
33559}
33560
33561
33562static int
33563test_xmlSaveToFd(void) {
33564    int test_ret = 0;
33565
33566
33567    /* missing type support */
33568    return(test_ret);
33569}
33570
33571
33572static int
33573test_xmlSaveToFilename(void) {
33574    int test_ret = 0;
33575
33576
33577    /* missing type support */
33578    return(test_ret);
33579}
33580
33581
33582static int
33583test_xmlSaveTree(void) {
33584    int test_ret = 0;
33585
33586#if defined(LIBXML_OUTPUT_ENABLED)
33587    int mem_base;
33588    long ret_val;
33589    xmlSaveCtxtPtr ctxt; /* a document saving context */
33590    int n_ctxt;
33591    xmlNodePtr node; /* the top node of the subtree to save */
33592    int n_node;
33593
33594    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33595    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33596        mem_base = xmlMemBlocks();
33597        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33598        node = gen_xmlNodePtr(n_node, 1);
33599
33600        ret_val = xmlSaveTree(ctxt, node);
33601        desret_long(ret_val);
33602        call_tests++;
33603        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33604        des_xmlNodePtr(n_node, node, 1);
33605        xmlResetLastError();
33606        if (mem_base != xmlMemBlocks()) {
33607            printf("Leak of %d blocks found in xmlSaveTree",
33608	           xmlMemBlocks() - mem_base);
33609	    test_ret++;
33610            printf(" %d", n_ctxt);
33611            printf(" %d", n_node);
33612            printf("\n");
33613        }
33614    }
33615    }
33616    function_tests++;
33617#endif
33618
33619    return(test_ret);
33620}
33621
33622static int
33623test_xmlsave(void) {
33624    int test_ret = 0;
33625
33626    if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33627    test_ret += test_xmlSaveClose();
33628    test_ret += test_xmlSaveDoc();
33629    test_ret += test_xmlSaveFlush();
33630    test_ret += test_xmlSaveSetAttrEscape();
33631    test_ret += test_xmlSaveSetEscape();
33632    test_ret += test_xmlSaveToBuffer();
33633    test_ret += test_xmlSaveToFd();
33634    test_ret += test_xmlSaveToFilename();
33635    test_ret += test_xmlSaveTree();
33636
33637    if (test_ret != 0)
33638	printf("Module xmlsave: %d errors\n", test_ret);
33639    return(test_ret);
33640}
33641
33642static int
33643test_xmlSchemaDump(void) {
33644    int test_ret = 0;
33645
33646#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33647    int mem_base;
33648    FILE * output; /* the file output */
33649    int n_output;
33650    xmlSchemaPtr schema; /* a schema structure */
33651    int n_schema;
33652
33653    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33654    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33655        mem_base = xmlMemBlocks();
33656        output = gen_FILE_ptr(n_output, 0);
33657        schema = gen_xmlSchemaPtr(n_schema, 1);
33658
33659        xmlSchemaDump(output, schema);
33660        call_tests++;
33661        des_FILE_ptr(n_output, output, 0);
33662        des_xmlSchemaPtr(n_schema, schema, 1);
33663        xmlResetLastError();
33664        if (mem_base != xmlMemBlocks()) {
33665            printf("Leak of %d blocks found in xmlSchemaDump",
33666	           xmlMemBlocks() - mem_base);
33667	    test_ret++;
33668            printf(" %d", n_output);
33669            printf(" %d", n_schema);
33670            printf("\n");
33671        }
33672    }
33673    }
33674    function_tests++;
33675#endif
33676
33677    return(test_ret);
33678}
33679
33680#ifdef LIBXML_SCHEMAS_ENABLED
33681
33682#define gen_nb_xmlSchemaParserCtxtPtr 1
33683static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33684    return(NULL);
33685}
33686static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33687}
33688#endif
33689
33690#ifdef LIBXML_SCHEMAS_ENABLED
33691
33692#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33693static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33694    return(NULL);
33695}
33696static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33697}
33698#endif
33699
33700#ifdef LIBXML_SCHEMAS_ENABLED
33701
33702#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33703static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33704    return(NULL);
33705}
33706static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33707}
33708#endif
33709
33710
33711static int
33712test_xmlSchemaGetParserErrors(void) {
33713    int test_ret = 0;
33714
33715#if defined(LIBXML_SCHEMAS_ENABLED)
33716    int mem_base;
33717    int ret_val;
33718    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33719    int n_ctxt;
33720    xmlSchemaValidityErrorFunc * err; /* the error callback result */
33721    int n_err;
33722    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33723    int n_warn;
33724    void ** ctx; /* contextual data for the callbacks result */
33725    int n_ctx;
33726
33727    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33728    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33729    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33730    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33731        mem_base = xmlMemBlocks();
33732        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33733        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33734        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33735        ctx = gen_void_ptr_ptr(n_ctx, 3);
33736
33737        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33738        desret_int(ret_val);
33739        call_tests++;
33740        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33741        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33742        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33743        des_void_ptr_ptr(n_ctx, ctx, 3);
33744        xmlResetLastError();
33745        if (mem_base != xmlMemBlocks()) {
33746            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33747	           xmlMemBlocks() - mem_base);
33748	    test_ret++;
33749            printf(" %d", n_ctxt);
33750            printf(" %d", n_err);
33751            printf(" %d", n_warn);
33752            printf(" %d", n_ctx);
33753            printf("\n");
33754        }
33755    }
33756    }
33757    }
33758    }
33759    function_tests++;
33760#endif
33761
33762    return(test_ret);
33763}
33764
33765
33766static int
33767test_xmlSchemaGetValidErrors(void) {
33768    int test_ret = 0;
33769
33770#if defined(LIBXML_SCHEMAS_ENABLED)
33771    int mem_base;
33772    int ret_val;
33773    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
33774    int n_ctxt;
33775    xmlSchemaValidityErrorFunc * err; /* the error function result */
33776    int n_err;
33777    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
33778    int n_warn;
33779    void ** ctx; /* the functions context result */
33780    int n_ctx;
33781
33782    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33783    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33784    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33785    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33786        mem_base = xmlMemBlocks();
33787        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33788        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33789        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33790        ctx = gen_void_ptr_ptr(n_ctx, 3);
33791
33792        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33793        desret_int(ret_val);
33794        call_tests++;
33795        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33796        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33797        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33798        des_void_ptr_ptr(n_ctx, ctx, 3);
33799        xmlResetLastError();
33800        if (mem_base != xmlMemBlocks()) {
33801            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33802	           xmlMemBlocks() - mem_base);
33803	    test_ret++;
33804            printf(" %d", n_ctxt);
33805            printf(" %d", n_err);
33806            printf(" %d", n_warn);
33807            printf(" %d", n_ctx);
33808            printf("\n");
33809        }
33810    }
33811    }
33812    }
33813    }
33814    function_tests++;
33815#endif
33816
33817    return(test_ret);
33818}
33819
33820
33821static int
33822test_xmlSchemaIsValid(void) {
33823    int test_ret = 0;
33824
33825#if defined(LIBXML_SCHEMAS_ENABLED)
33826    int mem_base;
33827    int ret_val;
33828    xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
33829    int n_ctxt;
33830
33831    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33832        mem_base = xmlMemBlocks();
33833        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33834
33835        ret_val = xmlSchemaIsValid(ctxt);
33836        desret_int(ret_val);
33837        call_tests++;
33838        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33839        xmlResetLastError();
33840        if (mem_base != xmlMemBlocks()) {
33841            printf("Leak of %d blocks found in xmlSchemaIsValid",
33842	           xmlMemBlocks() - mem_base);
33843	    test_ret++;
33844            printf(" %d", n_ctxt);
33845            printf("\n");
33846        }
33847    }
33848    function_tests++;
33849#endif
33850
33851    return(test_ret);
33852}
33853
33854
33855static int
33856test_xmlSchemaNewDocParserCtxt(void) {
33857    int test_ret = 0;
33858
33859#if defined(LIBXML_SCHEMAS_ENABLED)
33860    int mem_base;
33861    xmlSchemaParserCtxtPtr ret_val;
33862    xmlDocPtr doc; /* a preparsed document tree */
33863    int n_doc;
33864
33865    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33866        mem_base = xmlMemBlocks();
33867        doc = gen_xmlDocPtr(n_doc, 0);
33868
33869        ret_val = xmlSchemaNewDocParserCtxt(doc);
33870        desret_xmlSchemaParserCtxtPtr(ret_val);
33871        call_tests++;
33872        des_xmlDocPtr(n_doc, doc, 0);
33873        xmlResetLastError();
33874        if (mem_base != xmlMemBlocks()) {
33875            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
33876	           xmlMemBlocks() - mem_base);
33877	    test_ret++;
33878            printf(" %d", n_doc);
33879            printf("\n");
33880        }
33881    }
33882    function_tests++;
33883#endif
33884
33885    return(test_ret);
33886}
33887
33888
33889static int
33890test_xmlSchemaNewMemParserCtxt(void) {
33891    int test_ret = 0;
33892
33893#if defined(LIBXML_SCHEMAS_ENABLED)
33894    int mem_base;
33895    xmlSchemaParserCtxtPtr ret_val;
33896    char * buffer; /* a pointer to a char array containing the schemas */
33897    int n_buffer;
33898    int size; /* the size of the array */
33899    int n_size;
33900
33901    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
33902    for (n_size = 0;n_size < gen_nb_int;n_size++) {
33903        mem_base = xmlMemBlocks();
33904        buffer = gen_const_char_ptr(n_buffer, 0);
33905        size = gen_int(n_size, 1);
33906
33907        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
33908        desret_xmlSchemaParserCtxtPtr(ret_val);
33909        call_tests++;
33910        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
33911        des_int(n_size, size, 1);
33912        xmlResetLastError();
33913        if (mem_base != xmlMemBlocks()) {
33914            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
33915	           xmlMemBlocks() - mem_base);
33916	    test_ret++;
33917            printf(" %d", n_buffer);
33918            printf(" %d", n_size);
33919            printf("\n");
33920        }
33921    }
33922    }
33923    function_tests++;
33924#endif
33925
33926    return(test_ret);
33927}
33928
33929
33930static int
33931test_xmlSchemaNewParserCtxt(void) {
33932    int test_ret = 0;
33933
33934#if defined(LIBXML_SCHEMAS_ENABLED)
33935    int mem_base;
33936    xmlSchemaParserCtxtPtr ret_val;
33937    char * URL; /* the location of the schema */
33938    int n_URL;
33939
33940    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
33941        mem_base = xmlMemBlocks();
33942        URL = gen_const_char_ptr(n_URL, 0);
33943
33944        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
33945        desret_xmlSchemaParserCtxtPtr(ret_val);
33946        call_tests++;
33947        des_const_char_ptr(n_URL, (const char *)URL, 0);
33948        xmlResetLastError();
33949        if (mem_base != xmlMemBlocks()) {
33950            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
33951	           xmlMemBlocks() - mem_base);
33952	    test_ret++;
33953            printf(" %d", n_URL);
33954            printf("\n");
33955        }
33956    }
33957    function_tests++;
33958#endif
33959
33960    return(test_ret);
33961}
33962
33963
33964static int
33965test_xmlSchemaNewValidCtxt(void) {
33966    int test_ret = 0;
33967
33968
33969    /* missing type support */
33970    return(test_ret);
33971}
33972
33973
33974static int
33975test_xmlSchemaParse(void) {
33976    int test_ret = 0;
33977
33978
33979    /* missing type support */
33980    return(test_ret);
33981}
33982
33983#ifdef LIBXML_SCHEMAS_ENABLED
33984
33985#define gen_nb_xmlSAXHandlerPtr_ptr 1
33986static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33987    return(NULL);
33988}
33989static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33990}
33991#endif
33992
33993
33994static int
33995test_xmlSchemaSAXPlug(void) {
33996    int test_ret = 0;
33997
33998
33999    /* missing type support */
34000    return(test_ret);
34001}
34002
34003#ifdef LIBXML_SCHEMAS_ENABLED
34004
34005#define gen_nb_xmlSchemaSAXPlugPtr 1
34006static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34007    return(NULL);
34008}
34009static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34010}
34011#endif
34012
34013
34014static int
34015test_xmlSchemaSAXUnplug(void) {
34016    int test_ret = 0;
34017
34018#if defined(LIBXML_SCHEMAS_ENABLED)
34019    int mem_base;
34020    int ret_val;
34021    xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34022    int n_plug;
34023
34024    for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34025        mem_base = xmlMemBlocks();
34026        plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34027
34028        ret_val = xmlSchemaSAXUnplug(plug);
34029        desret_int(ret_val);
34030        call_tests++;
34031        des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34032        xmlResetLastError();
34033        if (mem_base != xmlMemBlocks()) {
34034            printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34035	           xmlMemBlocks() - mem_base);
34036	    test_ret++;
34037            printf(" %d", n_plug);
34038            printf("\n");
34039        }
34040    }
34041    function_tests++;
34042#endif
34043
34044    return(test_ret);
34045}
34046
34047
34048static int
34049test_xmlSchemaSetParserErrors(void) {
34050    int test_ret = 0;
34051
34052
34053    /* missing type support */
34054    return(test_ret);
34055}
34056
34057
34058static int
34059test_xmlSchemaSetParserStructuredErrors(void) {
34060    int test_ret = 0;
34061
34062
34063    /* missing type support */
34064    return(test_ret);
34065}
34066
34067
34068static int
34069test_xmlSchemaSetValidErrors(void) {
34070    int test_ret = 0;
34071
34072
34073    /* missing type support */
34074    return(test_ret);
34075}
34076
34077
34078static int
34079test_xmlSchemaSetValidOptions(void) {
34080    int test_ret = 0;
34081
34082#if defined(LIBXML_SCHEMAS_ENABLED)
34083    int mem_base;
34084    int ret_val;
34085    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34086    int n_ctxt;
34087    int options; /* a combination of xmlSchemaValidOption */
34088    int n_options;
34089
34090    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34091    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34092        mem_base = xmlMemBlocks();
34093        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34094        options = gen_int(n_options, 1);
34095
34096        ret_val = xmlSchemaSetValidOptions(ctxt, options);
34097        desret_int(ret_val);
34098        call_tests++;
34099        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34100        des_int(n_options, options, 1);
34101        xmlResetLastError();
34102        if (mem_base != xmlMemBlocks()) {
34103            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34104	           xmlMemBlocks() - mem_base);
34105	    test_ret++;
34106            printf(" %d", n_ctxt);
34107            printf(" %d", n_options);
34108            printf("\n");
34109        }
34110    }
34111    }
34112    function_tests++;
34113#endif
34114
34115    return(test_ret);
34116}
34117
34118
34119static int
34120test_xmlSchemaSetValidStructuredErrors(void) {
34121    int test_ret = 0;
34122
34123
34124    /* missing type support */
34125    return(test_ret);
34126}
34127
34128
34129static int
34130test_xmlSchemaValidCtxtGetOptions(void) {
34131    int test_ret = 0;
34132
34133#if defined(LIBXML_SCHEMAS_ENABLED)
34134    int mem_base;
34135    int ret_val;
34136    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34137    int n_ctxt;
34138
34139    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34140        mem_base = xmlMemBlocks();
34141        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34142
34143        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34144        desret_int(ret_val);
34145        call_tests++;
34146        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34147        xmlResetLastError();
34148        if (mem_base != xmlMemBlocks()) {
34149            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34150	           xmlMemBlocks() - mem_base);
34151	    test_ret++;
34152            printf(" %d", n_ctxt);
34153            printf("\n");
34154        }
34155    }
34156    function_tests++;
34157#endif
34158
34159    return(test_ret);
34160}
34161
34162
34163static int
34164test_xmlSchemaValidCtxtGetParserCtxt(void) {
34165    int test_ret = 0;
34166
34167#if defined(LIBXML_SCHEMAS_ENABLED)
34168    int mem_base;
34169    xmlParserCtxtPtr ret_val;
34170    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34171    int n_ctxt;
34172
34173    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34174        mem_base = xmlMemBlocks();
34175        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34176
34177        ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34178        desret_xmlParserCtxtPtr(ret_val);
34179        call_tests++;
34180        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34181        xmlResetLastError();
34182        if (mem_base != xmlMemBlocks()) {
34183            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34184	           xmlMemBlocks() - mem_base);
34185	    test_ret++;
34186            printf(" %d", n_ctxt);
34187            printf("\n");
34188        }
34189    }
34190    function_tests++;
34191#endif
34192
34193    return(test_ret);
34194}
34195
34196
34197static int
34198test_xmlSchemaValidateDoc(void) {
34199    int test_ret = 0;
34200
34201#if defined(LIBXML_SCHEMAS_ENABLED)
34202    int mem_base;
34203    int ret_val;
34204    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34205    int n_ctxt;
34206    xmlDocPtr doc; /* a parsed document tree */
34207    int n_doc;
34208
34209    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34210    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34211        mem_base = xmlMemBlocks();
34212        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34213        doc = gen_xmlDocPtr(n_doc, 1);
34214
34215        ret_val = xmlSchemaValidateDoc(ctxt, doc);
34216        desret_int(ret_val);
34217        call_tests++;
34218        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34219        des_xmlDocPtr(n_doc, doc, 1);
34220        xmlResetLastError();
34221        if (mem_base != xmlMemBlocks()) {
34222            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34223	           xmlMemBlocks() - mem_base);
34224	    test_ret++;
34225            printf(" %d", n_ctxt);
34226            printf(" %d", n_doc);
34227            printf("\n");
34228        }
34229    }
34230    }
34231    function_tests++;
34232#endif
34233
34234    return(test_ret);
34235}
34236
34237
34238static int
34239test_xmlSchemaValidateFile(void) {
34240    int test_ret = 0;
34241
34242#if defined(LIBXML_SCHEMAS_ENABLED)
34243    int mem_base;
34244    int ret_val;
34245    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34246    int n_ctxt;
34247    const char * filename; /* the URI of the instance */
34248    int n_filename;
34249    int options; /* a future set of options, currently unused */
34250    int n_options;
34251
34252    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34253    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34254    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34255        mem_base = xmlMemBlocks();
34256        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34257        filename = gen_filepath(n_filename, 1);
34258        options = gen_int(n_options, 2);
34259
34260        ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34261        desret_int(ret_val);
34262        call_tests++;
34263        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34264        des_filepath(n_filename, filename, 1);
34265        des_int(n_options, options, 2);
34266        xmlResetLastError();
34267        if (mem_base != xmlMemBlocks()) {
34268            printf("Leak of %d blocks found in xmlSchemaValidateFile",
34269	           xmlMemBlocks() - mem_base);
34270	    test_ret++;
34271            printf(" %d", n_ctxt);
34272            printf(" %d", n_filename);
34273            printf(" %d", n_options);
34274            printf("\n");
34275        }
34276    }
34277    }
34278    }
34279    function_tests++;
34280#endif
34281
34282    return(test_ret);
34283}
34284
34285
34286static int
34287test_xmlSchemaValidateOneElement(void) {
34288    int test_ret = 0;
34289
34290#if defined(LIBXML_SCHEMAS_ENABLED)
34291    int mem_base;
34292    int ret_val;
34293    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34294    int n_ctxt;
34295    xmlNodePtr elem; /* an element node */
34296    int n_elem;
34297
34298    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34299    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34300        mem_base = xmlMemBlocks();
34301        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34302        elem = gen_xmlNodePtr(n_elem, 1);
34303
34304        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34305        desret_int(ret_val);
34306        call_tests++;
34307        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34308        des_xmlNodePtr(n_elem, elem, 1);
34309        xmlResetLastError();
34310        if (mem_base != xmlMemBlocks()) {
34311            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34312	           xmlMemBlocks() - mem_base);
34313	    test_ret++;
34314            printf(" %d", n_ctxt);
34315            printf(" %d", n_elem);
34316            printf("\n");
34317        }
34318    }
34319    }
34320    function_tests++;
34321#endif
34322
34323    return(test_ret);
34324}
34325
34326
34327static int
34328test_xmlSchemaValidateStream(void) {
34329    int test_ret = 0;
34330
34331#if defined(LIBXML_SCHEMAS_ENABLED)
34332    int mem_base;
34333    int ret_val;
34334    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34335    int n_ctxt;
34336    xmlParserInputBufferPtr input; /* the input to use for reading the data */
34337    int n_input;
34338    xmlCharEncoding enc; /* an optional encoding information */
34339    int n_enc;
34340    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34341    int n_sax;
34342    void * user_data; /* the context to provide to the SAX handler. */
34343    int n_user_data;
34344
34345    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34346    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34347    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34348    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34349    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34350        mem_base = xmlMemBlocks();
34351        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34352        input = gen_xmlParserInputBufferPtr(n_input, 1);
34353        enc = gen_xmlCharEncoding(n_enc, 2);
34354        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34355        user_data = gen_userdata(n_user_data, 4);
34356
34357        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34358        desret_int(ret_val);
34359        call_tests++;
34360        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34361        des_xmlParserInputBufferPtr(n_input, input, 1);
34362        des_xmlCharEncoding(n_enc, enc, 2);
34363        des_xmlSAXHandlerPtr(n_sax, sax, 3);
34364        des_userdata(n_user_data, user_data, 4);
34365        xmlResetLastError();
34366        if (mem_base != xmlMemBlocks()) {
34367            printf("Leak of %d blocks found in xmlSchemaValidateStream",
34368	           xmlMemBlocks() - mem_base);
34369	    test_ret++;
34370            printf(" %d", n_ctxt);
34371            printf(" %d", n_input);
34372            printf(" %d", n_enc);
34373            printf(" %d", n_sax);
34374            printf(" %d", n_user_data);
34375            printf("\n");
34376        }
34377    }
34378    }
34379    }
34380    }
34381    }
34382    function_tests++;
34383#endif
34384
34385    return(test_ret);
34386}
34387
34388static int
34389test_xmlschemas(void) {
34390    int test_ret = 0;
34391
34392    if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34393    test_ret += test_xmlSchemaDump();
34394    test_ret += test_xmlSchemaGetParserErrors();
34395    test_ret += test_xmlSchemaGetValidErrors();
34396    test_ret += test_xmlSchemaIsValid();
34397    test_ret += test_xmlSchemaNewDocParserCtxt();
34398    test_ret += test_xmlSchemaNewMemParserCtxt();
34399    test_ret += test_xmlSchemaNewParserCtxt();
34400    test_ret += test_xmlSchemaNewValidCtxt();
34401    test_ret += test_xmlSchemaParse();
34402    test_ret += test_xmlSchemaSAXPlug();
34403    test_ret += test_xmlSchemaSAXUnplug();
34404    test_ret += test_xmlSchemaSetParserErrors();
34405    test_ret += test_xmlSchemaSetParserStructuredErrors();
34406    test_ret += test_xmlSchemaSetValidErrors();
34407    test_ret += test_xmlSchemaSetValidOptions();
34408    test_ret += test_xmlSchemaSetValidStructuredErrors();
34409    test_ret += test_xmlSchemaValidCtxtGetOptions();
34410    test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34411    test_ret += test_xmlSchemaValidateDoc();
34412    test_ret += test_xmlSchemaValidateFile();
34413    test_ret += test_xmlSchemaValidateOneElement();
34414    test_ret += test_xmlSchemaValidateStream();
34415
34416    if (test_ret != 0)
34417	printf("Module xmlschemas: %d errors\n", test_ret);
34418    return(test_ret);
34419}
34420#ifdef LIBXML_SCHEMAS_ENABLED
34421
34422#define gen_nb_xmlSchemaFacetPtr 1
34423static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34424    return(NULL);
34425}
34426static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34427}
34428#endif
34429
34430#ifdef LIBXML_SCHEMAS_ENABLED
34431
34432#define gen_nb_xmlSchemaTypePtr 1
34433static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34434    return(NULL);
34435}
34436static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34437}
34438#endif
34439
34440
34441static int
34442test_xmlSchemaCheckFacet(void) {
34443    int test_ret = 0;
34444
34445#if defined(LIBXML_SCHEMAS_ENABLED)
34446    int mem_base;
34447    int ret_val;
34448    xmlSchemaFacetPtr facet; /* the facet */
34449    int n_facet;
34450    xmlSchemaTypePtr typeDecl; /* the schema type definition */
34451    int n_typeDecl;
34452    xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34453    int n_pctxt;
34454    xmlChar * name; /* the optional name of the type */
34455    int n_name;
34456
34457    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34458    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34459    for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34460    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34461        mem_base = xmlMemBlocks();
34462        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34463        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34464        pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34465        name = gen_const_xmlChar_ptr(n_name, 3);
34466
34467        ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34468        desret_int(ret_val);
34469        call_tests++;
34470        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34471        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34472        des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34473        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34474        xmlResetLastError();
34475        if (mem_base != xmlMemBlocks()) {
34476            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34477	           xmlMemBlocks() - mem_base);
34478	    test_ret++;
34479            printf(" %d", n_facet);
34480            printf(" %d", n_typeDecl);
34481            printf(" %d", n_pctxt);
34482            printf(" %d", n_name);
34483            printf("\n");
34484        }
34485    }
34486    }
34487    }
34488    }
34489    function_tests++;
34490#endif
34491
34492    return(test_ret);
34493}
34494
34495
34496static int
34497test_xmlSchemaCleanupTypes(void) {
34498    int test_ret = 0;
34499
34500#if defined(LIBXML_SCHEMAS_ENABLED)
34501
34502
34503        xmlSchemaCleanupTypes();
34504        call_tests++;
34505        xmlResetLastError();
34506    function_tests++;
34507#endif
34508
34509    return(test_ret);
34510}
34511
34512
34513static int
34514test_xmlSchemaCollapseString(void) {
34515    int test_ret = 0;
34516
34517#if defined(LIBXML_SCHEMAS_ENABLED)
34518    int mem_base;
34519    xmlChar * ret_val;
34520    xmlChar * value; /* a value */
34521    int n_value;
34522
34523    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34524        mem_base = xmlMemBlocks();
34525        value = gen_const_xmlChar_ptr(n_value, 0);
34526
34527        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34528        desret_xmlChar_ptr(ret_val);
34529        call_tests++;
34530        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34531        xmlResetLastError();
34532        if (mem_base != xmlMemBlocks()) {
34533            printf("Leak of %d blocks found in xmlSchemaCollapseString",
34534	           xmlMemBlocks() - mem_base);
34535	    test_ret++;
34536            printf(" %d", n_value);
34537            printf("\n");
34538        }
34539    }
34540    function_tests++;
34541#endif
34542
34543    return(test_ret);
34544}
34545
34546#ifdef LIBXML_SCHEMAS_ENABLED
34547
34548#define gen_nb_xmlSchemaValPtr 1
34549static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34550    return(NULL);
34551}
34552static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34553}
34554#endif
34555
34556
34557static int
34558test_xmlSchemaCompareValues(void) {
34559    int test_ret = 0;
34560
34561#if defined(LIBXML_SCHEMAS_ENABLED)
34562    int mem_base;
34563    int ret_val;
34564    xmlSchemaValPtr x; /* a first value */
34565    int n_x;
34566    xmlSchemaValPtr y; /* a second value */
34567    int n_y;
34568
34569    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34570    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34571        mem_base = xmlMemBlocks();
34572        x = gen_xmlSchemaValPtr(n_x, 0);
34573        y = gen_xmlSchemaValPtr(n_y, 1);
34574
34575        ret_val = xmlSchemaCompareValues(x, y);
34576        desret_int(ret_val);
34577        call_tests++;
34578        des_xmlSchemaValPtr(n_x, x, 0);
34579        des_xmlSchemaValPtr(n_y, y, 1);
34580        xmlResetLastError();
34581        if (mem_base != xmlMemBlocks()) {
34582            printf("Leak of %d blocks found in xmlSchemaCompareValues",
34583	           xmlMemBlocks() - mem_base);
34584	    test_ret++;
34585            printf(" %d", n_x);
34586            printf(" %d", n_y);
34587            printf("\n");
34588        }
34589    }
34590    }
34591    function_tests++;
34592#endif
34593
34594    return(test_ret);
34595}
34596
34597
34598static int
34599test_xmlSchemaCompareValuesWhtsp(void) {
34600    int test_ret = 0;
34601
34602#if defined(LIBXML_SCHEMAS_ENABLED)
34603    int mem_base;
34604    int ret_val;
34605    xmlSchemaValPtr x; /* a first value */
34606    int n_x;
34607    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34608    int n_xws;
34609    xmlSchemaValPtr y; /* a second value */
34610    int n_y;
34611    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34612    int n_yws;
34613
34614    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34615    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34616    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34617    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34618        mem_base = xmlMemBlocks();
34619        x = gen_xmlSchemaValPtr(n_x, 0);
34620        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34621        y = gen_xmlSchemaValPtr(n_y, 2);
34622        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34623
34624        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34625        desret_int(ret_val);
34626        call_tests++;
34627        des_xmlSchemaValPtr(n_x, x, 0);
34628        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34629        des_xmlSchemaValPtr(n_y, y, 2);
34630        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34631        xmlResetLastError();
34632        if (mem_base != xmlMemBlocks()) {
34633            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34634	           xmlMemBlocks() - mem_base);
34635	    test_ret++;
34636            printf(" %d", n_x);
34637            printf(" %d", n_xws);
34638            printf(" %d", n_y);
34639            printf(" %d", n_yws);
34640            printf("\n");
34641        }
34642    }
34643    }
34644    }
34645    }
34646    function_tests++;
34647#endif
34648
34649    return(test_ret);
34650}
34651
34652
34653static int
34654test_xmlSchemaCopyValue(void) {
34655    int test_ret = 0;
34656
34657
34658    /* missing type support */
34659    return(test_ret);
34660}
34661
34662
34663static int
34664test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34665    int test_ret = 0;
34666
34667#if defined(LIBXML_SCHEMAS_ENABLED)
34668    int mem_base;
34669    xmlSchemaTypePtr ret_val;
34670    xmlSchemaTypePtr type; /* the built-in simple type. */
34671    int n_type;
34672
34673    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34674        mem_base = xmlMemBlocks();
34675        type = gen_xmlSchemaTypePtr(n_type, 0);
34676
34677        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34678        desret_xmlSchemaTypePtr(ret_val);
34679        call_tests++;
34680        des_xmlSchemaTypePtr(n_type, type, 0);
34681        xmlResetLastError();
34682        if (mem_base != xmlMemBlocks()) {
34683            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34684	           xmlMemBlocks() - mem_base);
34685	    test_ret++;
34686            printf(" %d", n_type);
34687            printf("\n");
34688        }
34689    }
34690    function_tests++;
34691#endif
34692
34693    return(test_ret);
34694}
34695
34696
34697static int
34698test_xmlSchemaGetBuiltInType(void) {
34699    int test_ret = 0;
34700
34701#if defined(LIBXML_SCHEMAS_ENABLED)
34702    xmlSchemaTypePtr ret_val;
34703    xmlSchemaValType type; /* the type of the built in type */
34704    int n_type;
34705
34706    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34707        type = gen_xmlSchemaValType(n_type, 0);
34708
34709        ret_val = xmlSchemaGetBuiltInType(type);
34710        desret_xmlSchemaTypePtr(ret_val);
34711        call_tests++;
34712        des_xmlSchemaValType(n_type, type, 0);
34713        xmlResetLastError();
34714    }
34715    function_tests++;
34716#endif
34717
34718    return(test_ret);
34719}
34720
34721
34722static int
34723test_xmlSchemaGetCanonValue(void) {
34724    int test_ret = 0;
34725
34726#if defined(LIBXML_SCHEMAS_ENABLED)
34727    int mem_base;
34728    int ret_val;
34729    xmlSchemaValPtr val; /* the precomputed value */
34730    int n_val;
34731    xmlChar ** retValue; /* the returned value */
34732    int n_retValue;
34733
34734    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34735    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34736        mem_base = xmlMemBlocks();
34737        val = gen_xmlSchemaValPtr(n_val, 0);
34738        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34739
34740        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34741        desret_int(ret_val);
34742        call_tests++;
34743        des_xmlSchemaValPtr(n_val, val, 0);
34744        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34745        xmlResetLastError();
34746        if (mem_base != xmlMemBlocks()) {
34747            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34748	           xmlMemBlocks() - mem_base);
34749	    test_ret++;
34750            printf(" %d", n_val);
34751            printf(" %d", n_retValue);
34752            printf("\n");
34753        }
34754    }
34755    }
34756    function_tests++;
34757#endif
34758
34759    return(test_ret);
34760}
34761
34762
34763static int
34764test_xmlSchemaGetCanonValueWhtsp(void) {
34765    int test_ret = 0;
34766
34767#if defined(LIBXML_SCHEMAS_ENABLED)
34768    int mem_base;
34769    int ret_val;
34770    xmlSchemaValPtr val; /* the precomputed value */
34771    int n_val;
34772    xmlChar ** retValue; /* the returned value */
34773    int n_retValue;
34774    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34775    int n_ws;
34776
34777    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34778    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34779    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34780        mem_base = xmlMemBlocks();
34781        val = gen_xmlSchemaValPtr(n_val, 0);
34782        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34783        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34784
34785        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34786        desret_int(ret_val);
34787        call_tests++;
34788        des_xmlSchemaValPtr(n_val, val, 0);
34789        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34790        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34791        xmlResetLastError();
34792        if (mem_base != xmlMemBlocks()) {
34793            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34794	           xmlMemBlocks() - mem_base);
34795	    test_ret++;
34796            printf(" %d", n_val);
34797            printf(" %d", n_retValue);
34798            printf(" %d", n_ws);
34799            printf("\n");
34800        }
34801    }
34802    }
34803    }
34804    function_tests++;
34805#endif
34806
34807    return(test_ret);
34808}
34809
34810
34811static int
34812test_xmlSchemaGetFacetValueAsULong(void) {
34813    int test_ret = 0;
34814
34815#if defined(LIBXML_SCHEMAS_ENABLED)
34816    int mem_base;
34817    unsigned long ret_val;
34818    xmlSchemaFacetPtr facet; /* an schemas type facet */
34819    int n_facet;
34820
34821    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34822        mem_base = xmlMemBlocks();
34823        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34824
34825        ret_val = xmlSchemaGetFacetValueAsULong(facet);
34826        desret_unsigned_long(ret_val);
34827        call_tests++;
34828        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34829        xmlResetLastError();
34830        if (mem_base != xmlMemBlocks()) {
34831            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
34832	           xmlMemBlocks() - mem_base);
34833	    test_ret++;
34834            printf(" %d", n_facet);
34835            printf("\n");
34836        }
34837    }
34838    function_tests++;
34839#endif
34840
34841    return(test_ret);
34842}
34843
34844
34845static int
34846test_xmlSchemaGetPredefinedType(void) {
34847    int test_ret = 0;
34848
34849#if defined(LIBXML_SCHEMAS_ENABLED)
34850    int mem_base;
34851    xmlSchemaTypePtr ret_val;
34852    xmlChar * name; /* the type name */
34853    int n_name;
34854    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
34855    int n_ns;
34856
34857    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34858    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
34859        mem_base = xmlMemBlocks();
34860        name = gen_const_xmlChar_ptr(n_name, 0);
34861        ns = gen_const_xmlChar_ptr(n_ns, 1);
34862
34863        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
34864        desret_xmlSchemaTypePtr(ret_val);
34865        call_tests++;
34866        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
34867        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
34868        xmlResetLastError();
34869        if (mem_base != xmlMemBlocks()) {
34870            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
34871	           xmlMemBlocks() - mem_base);
34872	    test_ret++;
34873            printf(" %d", n_name);
34874            printf(" %d", n_ns);
34875            printf("\n");
34876        }
34877    }
34878    }
34879    function_tests++;
34880#endif
34881
34882    return(test_ret);
34883}
34884
34885
34886static int
34887test_xmlSchemaGetValType(void) {
34888    int test_ret = 0;
34889
34890#if defined(LIBXML_SCHEMAS_ENABLED)
34891    int mem_base;
34892    xmlSchemaValType ret_val;
34893    xmlSchemaValPtr val; /* a schemas value */
34894    int n_val;
34895
34896    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34897        mem_base = xmlMemBlocks();
34898        val = gen_xmlSchemaValPtr(n_val, 0);
34899
34900        ret_val = xmlSchemaGetValType(val);
34901        desret_xmlSchemaValType(ret_val);
34902        call_tests++;
34903        des_xmlSchemaValPtr(n_val, val, 0);
34904        xmlResetLastError();
34905        if (mem_base != xmlMemBlocks()) {
34906            printf("Leak of %d blocks found in xmlSchemaGetValType",
34907	           xmlMemBlocks() - mem_base);
34908	    test_ret++;
34909            printf(" %d", n_val);
34910            printf("\n");
34911        }
34912    }
34913    function_tests++;
34914#endif
34915
34916    return(test_ret);
34917}
34918
34919
34920static int
34921test_xmlSchemaInitTypes(void) {
34922    int test_ret = 0;
34923
34924#if defined(LIBXML_SCHEMAS_ENABLED)
34925
34926
34927        xmlSchemaInitTypes();
34928        call_tests++;
34929        xmlResetLastError();
34930    function_tests++;
34931#endif
34932
34933    return(test_ret);
34934}
34935
34936
34937static int
34938test_xmlSchemaIsBuiltInTypeFacet(void) {
34939    int test_ret = 0;
34940
34941#if defined(LIBXML_SCHEMAS_ENABLED)
34942    int mem_base;
34943    int ret_val;
34944    xmlSchemaTypePtr type; /* the built-in type */
34945    int n_type;
34946    int facetType; /* the facet type */
34947    int n_facetType;
34948
34949    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34950    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
34951        mem_base = xmlMemBlocks();
34952        type = gen_xmlSchemaTypePtr(n_type, 0);
34953        facetType = gen_int(n_facetType, 1);
34954
34955        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
34956        desret_int(ret_val);
34957        call_tests++;
34958        des_xmlSchemaTypePtr(n_type, type, 0);
34959        des_int(n_facetType, facetType, 1);
34960        xmlResetLastError();
34961        if (mem_base != xmlMemBlocks()) {
34962            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
34963	           xmlMemBlocks() - mem_base);
34964	    test_ret++;
34965            printf(" %d", n_type);
34966            printf(" %d", n_facetType);
34967            printf("\n");
34968        }
34969    }
34970    }
34971    function_tests++;
34972#endif
34973
34974    return(test_ret);
34975}
34976
34977
34978static int
34979test_xmlSchemaNewFacet(void) {
34980    int test_ret = 0;
34981
34982
34983    /* missing type support */
34984    return(test_ret);
34985}
34986
34987
34988static int
34989test_xmlSchemaNewNOTATIONValue(void) {
34990    int test_ret = 0;
34991
34992
34993    /* missing type support */
34994    return(test_ret);
34995}
34996
34997
34998static int
34999test_xmlSchemaNewQNameValue(void) {
35000    int test_ret = 0;
35001
35002
35003    /* missing type support */
35004    return(test_ret);
35005}
35006
35007
35008static int
35009test_xmlSchemaNewStringValue(void) {
35010    int test_ret = 0;
35011
35012
35013    /* missing type support */
35014    return(test_ret);
35015}
35016
35017#ifdef LIBXML_SCHEMAS_ENABLED
35018
35019#define gen_nb_xmlSchemaValPtr_ptr 1
35020static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35021    return(NULL);
35022}
35023static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35024}
35025#endif
35026
35027
35028static int
35029test_xmlSchemaValPredefTypeNode(void) {
35030    int test_ret = 0;
35031
35032#if defined(LIBXML_SCHEMAS_ENABLED)
35033    int mem_base;
35034    int ret_val;
35035    xmlSchemaTypePtr type; /* the predefined type */
35036    int n_type;
35037    xmlChar * value; /* the value to check */
35038    int n_value;
35039    xmlSchemaValPtr * val; /* the return computed value */
35040    int n_val;
35041    xmlNodePtr node; /* the node containing the value */
35042    int n_node;
35043
35044    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35045    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35046    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35047    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35048        mem_base = xmlMemBlocks();
35049        type = gen_xmlSchemaTypePtr(n_type, 0);
35050        value = gen_const_xmlChar_ptr(n_value, 1);
35051        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35052        node = gen_xmlNodePtr(n_node, 3);
35053
35054        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35055        desret_int(ret_val);
35056        call_tests++;
35057        des_xmlSchemaTypePtr(n_type, type, 0);
35058        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35059        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35060        des_xmlNodePtr(n_node, node, 3);
35061        xmlResetLastError();
35062        if (mem_base != xmlMemBlocks()) {
35063            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35064	           xmlMemBlocks() - mem_base);
35065	    test_ret++;
35066            printf(" %d", n_type);
35067            printf(" %d", n_value);
35068            printf(" %d", n_val);
35069            printf(" %d", n_node);
35070            printf("\n");
35071        }
35072    }
35073    }
35074    }
35075    }
35076    function_tests++;
35077#endif
35078
35079    return(test_ret);
35080}
35081
35082
35083static int
35084test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35085    int test_ret = 0;
35086
35087#if defined(LIBXML_SCHEMAS_ENABLED)
35088    int mem_base;
35089    int ret_val;
35090    xmlSchemaTypePtr type; /* the predefined type */
35091    int n_type;
35092    xmlChar * value; /* the value to check */
35093    int n_value;
35094    xmlSchemaValPtr * val; /* the return computed value */
35095    int n_val;
35096    xmlNodePtr node; /* the node containing the value */
35097    int n_node;
35098
35099    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35100    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35101    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35102    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35103        mem_base = xmlMemBlocks();
35104        type = gen_xmlSchemaTypePtr(n_type, 0);
35105        value = gen_const_xmlChar_ptr(n_value, 1);
35106        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35107        node = gen_xmlNodePtr(n_node, 3);
35108
35109        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35110        desret_int(ret_val);
35111        call_tests++;
35112        des_xmlSchemaTypePtr(n_type, type, 0);
35113        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35114        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35115        des_xmlNodePtr(n_node, node, 3);
35116        xmlResetLastError();
35117        if (mem_base != xmlMemBlocks()) {
35118            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35119	           xmlMemBlocks() - mem_base);
35120	    test_ret++;
35121            printf(" %d", n_type);
35122            printf(" %d", n_value);
35123            printf(" %d", n_val);
35124            printf(" %d", n_node);
35125            printf("\n");
35126        }
35127    }
35128    }
35129    }
35130    }
35131    function_tests++;
35132#endif
35133
35134    return(test_ret);
35135}
35136
35137
35138static int
35139test_xmlSchemaValidateFacet(void) {
35140    int test_ret = 0;
35141
35142#if defined(LIBXML_SCHEMAS_ENABLED)
35143    int mem_base;
35144    int ret_val;
35145    xmlSchemaTypePtr base; /* the base type */
35146    int n_base;
35147    xmlSchemaFacetPtr facet; /* the facet to check */
35148    int n_facet;
35149    xmlChar * value; /* the lexical repr of the value to validate */
35150    int n_value;
35151    xmlSchemaValPtr val; /* the precomputed value */
35152    int n_val;
35153
35154    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35155    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35156    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35157    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35158        mem_base = xmlMemBlocks();
35159        base = gen_xmlSchemaTypePtr(n_base, 0);
35160        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35161        value = gen_const_xmlChar_ptr(n_value, 2);
35162        val = gen_xmlSchemaValPtr(n_val, 3);
35163
35164        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35165        desret_int(ret_val);
35166        call_tests++;
35167        des_xmlSchemaTypePtr(n_base, base, 0);
35168        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35169        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35170        des_xmlSchemaValPtr(n_val, val, 3);
35171        xmlResetLastError();
35172        if (mem_base != xmlMemBlocks()) {
35173            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35174	           xmlMemBlocks() - mem_base);
35175	    test_ret++;
35176            printf(" %d", n_base);
35177            printf(" %d", n_facet);
35178            printf(" %d", n_value);
35179            printf(" %d", n_val);
35180            printf("\n");
35181        }
35182    }
35183    }
35184    }
35185    }
35186    function_tests++;
35187#endif
35188
35189    return(test_ret);
35190}
35191
35192
35193static int
35194test_xmlSchemaValidateFacetWhtsp(void) {
35195    int test_ret = 0;
35196
35197#if defined(LIBXML_SCHEMAS_ENABLED)
35198    int mem_base;
35199    int ret_val;
35200    xmlSchemaFacetPtr facet; /* the facet to check */
35201    int n_facet;
35202    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35203    int n_fws;
35204    xmlSchemaValType valType; /* the built-in type of the value */
35205    int n_valType;
35206    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35207    int n_value;
35208    xmlSchemaValPtr val; /* the precomputed value */
35209    int n_val;
35210    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35211    int n_ws;
35212
35213    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35214    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35215    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35216    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35217    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35218    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35219        mem_base = xmlMemBlocks();
35220        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35221        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35222        valType = gen_xmlSchemaValType(n_valType, 2);
35223        value = gen_const_xmlChar_ptr(n_value, 3);
35224        val = gen_xmlSchemaValPtr(n_val, 4);
35225        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35226
35227        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35228        desret_int(ret_val);
35229        call_tests++;
35230        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35231        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35232        des_xmlSchemaValType(n_valType, valType, 2);
35233        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35234        des_xmlSchemaValPtr(n_val, val, 4);
35235        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35236        xmlResetLastError();
35237        if (mem_base != xmlMemBlocks()) {
35238            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35239	           xmlMemBlocks() - mem_base);
35240	    test_ret++;
35241            printf(" %d", n_facet);
35242            printf(" %d", n_fws);
35243            printf(" %d", n_valType);
35244            printf(" %d", n_value);
35245            printf(" %d", n_val);
35246            printf(" %d", n_ws);
35247            printf("\n");
35248        }
35249    }
35250    }
35251    }
35252    }
35253    }
35254    }
35255    function_tests++;
35256#endif
35257
35258    return(test_ret);
35259}
35260
35261
35262static int
35263test_xmlSchemaValidateLengthFacet(void) {
35264    int test_ret = 0;
35265
35266#if defined(LIBXML_SCHEMAS_ENABLED)
35267    int mem_base;
35268    int ret_val;
35269    xmlSchemaTypePtr type; /* the built-in type */
35270    int n_type;
35271    xmlSchemaFacetPtr facet; /* the facet to check */
35272    int n_facet;
35273    xmlChar * value; /* the lexical repr. of the value to be validated */
35274    int n_value;
35275    xmlSchemaValPtr val; /* the precomputed value */
35276    int n_val;
35277    unsigned long * length; /* the actual length of the value */
35278    int n_length;
35279
35280    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35281    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35282    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35283    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35284    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35285        mem_base = xmlMemBlocks();
35286        type = gen_xmlSchemaTypePtr(n_type, 0);
35287        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35288        value = gen_const_xmlChar_ptr(n_value, 2);
35289        val = gen_xmlSchemaValPtr(n_val, 3);
35290        length = gen_unsigned_long_ptr(n_length, 4);
35291
35292        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35293        desret_int(ret_val);
35294        call_tests++;
35295        des_xmlSchemaTypePtr(n_type, type, 0);
35296        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35297        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35298        des_xmlSchemaValPtr(n_val, val, 3);
35299        des_unsigned_long_ptr(n_length, length, 4);
35300        xmlResetLastError();
35301        if (mem_base != xmlMemBlocks()) {
35302            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35303	           xmlMemBlocks() - mem_base);
35304	    test_ret++;
35305            printf(" %d", n_type);
35306            printf(" %d", n_facet);
35307            printf(" %d", n_value);
35308            printf(" %d", n_val);
35309            printf(" %d", n_length);
35310            printf("\n");
35311        }
35312    }
35313    }
35314    }
35315    }
35316    }
35317    function_tests++;
35318#endif
35319
35320    return(test_ret);
35321}
35322
35323
35324static int
35325test_xmlSchemaValidateLengthFacetWhtsp(void) {
35326    int test_ret = 0;
35327
35328#if defined(LIBXML_SCHEMAS_ENABLED)
35329    int mem_base;
35330    int ret_val;
35331    xmlSchemaFacetPtr facet; /* the facet to check */
35332    int n_facet;
35333    xmlSchemaValType valType; /* the built-in type */
35334    int n_valType;
35335    xmlChar * value; /* the lexical repr. of the value to be validated */
35336    int n_value;
35337    xmlSchemaValPtr val; /* the precomputed value */
35338    int n_val;
35339    unsigned long * length; /* the actual length of the value */
35340    int n_length;
35341    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35342    int n_ws;
35343
35344    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35345    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35346    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35347    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35348    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35349    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35350        mem_base = xmlMemBlocks();
35351        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35352        valType = gen_xmlSchemaValType(n_valType, 1);
35353        value = gen_const_xmlChar_ptr(n_value, 2);
35354        val = gen_xmlSchemaValPtr(n_val, 3);
35355        length = gen_unsigned_long_ptr(n_length, 4);
35356        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35357
35358        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35359        desret_int(ret_val);
35360        call_tests++;
35361        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35362        des_xmlSchemaValType(n_valType, valType, 1);
35363        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35364        des_xmlSchemaValPtr(n_val, val, 3);
35365        des_unsigned_long_ptr(n_length, length, 4);
35366        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35367        xmlResetLastError();
35368        if (mem_base != xmlMemBlocks()) {
35369            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35370	           xmlMemBlocks() - mem_base);
35371	    test_ret++;
35372            printf(" %d", n_facet);
35373            printf(" %d", n_valType);
35374            printf(" %d", n_value);
35375            printf(" %d", n_val);
35376            printf(" %d", n_length);
35377            printf(" %d", n_ws);
35378            printf("\n");
35379        }
35380    }
35381    }
35382    }
35383    }
35384    }
35385    }
35386    function_tests++;
35387#endif
35388
35389    return(test_ret);
35390}
35391
35392
35393static int
35394test_xmlSchemaValidateListSimpleTypeFacet(void) {
35395    int test_ret = 0;
35396
35397#if defined(LIBXML_SCHEMAS_ENABLED)
35398    int mem_base;
35399    int ret_val;
35400    xmlSchemaFacetPtr facet; /* the facet to check */
35401    int n_facet;
35402    xmlChar * value; /* the lexical repr of the value to validate */
35403    int n_value;
35404    unsigned long actualLen; /* the number of list items */
35405    int n_actualLen;
35406    unsigned long * expectedLen; /* the resulting expected number of list items */
35407    int n_expectedLen;
35408
35409    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35410    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35411    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35412    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35413        mem_base = xmlMemBlocks();
35414        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35415        value = gen_const_xmlChar_ptr(n_value, 1);
35416        actualLen = gen_unsigned_long(n_actualLen, 2);
35417        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35418
35419        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35420        desret_int(ret_val);
35421        call_tests++;
35422        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35423        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35424        des_unsigned_long(n_actualLen, actualLen, 2);
35425        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35426        xmlResetLastError();
35427        if (mem_base != xmlMemBlocks()) {
35428            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35429	           xmlMemBlocks() - mem_base);
35430	    test_ret++;
35431            printf(" %d", n_facet);
35432            printf(" %d", n_value);
35433            printf(" %d", n_actualLen);
35434            printf(" %d", n_expectedLen);
35435            printf("\n");
35436        }
35437    }
35438    }
35439    }
35440    }
35441    function_tests++;
35442#endif
35443
35444    return(test_ret);
35445}
35446
35447
35448static int
35449test_xmlSchemaValidatePredefinedType(void) {
35450    int test_ret = 0;
35451
35452#if defined(LIBXML_SCHEMAS_ENABLED)
35453    int mem_base;
35454    int ret_val;
35455    xmlSchemaTypePtr type; /* the predefined type */
35456    int n_type;
35457    xmlChar * value; /* the value to check */
35458    int n_value;
35459    xmlSchemaValPtr * val; /* the return computed value */
35460    int n_val;
35461
35462    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35463    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35464    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35465        mem_base = xmlMemBlocks();
35466        type = gen_xmlSchemaTypePtr(n_type, 0);
35467        value = gen_const_xmlChar_ptr(n_value, 1);
35468        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35469
35470        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35471        desret_int(ret_val);
35472        call_tests++;
35473        des_xmlSchemaTypePtr(n_type, type, 0);
35474        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35475        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35476        xmlResetLastError();
35477        if (mem_base != xmlMemBlocks()) {
35478            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35479	           xmlMemBlocks() - mem_base);
35480	    test_ret++;
35481            printf(" %d", n_type);
35482            printf(" %d", n_value);
35483            printf(" %d", n_val);
35484            printf("\n");
35485        }
35486    }
35487    }
35488    }
35489    function_tests++;
35490#endif
35491
35492    return(test_ret);
35493}
35494
35495
35496static int
35497test_xmlSchemaValueAppend(void) {
35498    int test_ret = 0;
35499
35500#if defined(LIBXML_SCHEMAS_ENABLED)
35501    int mem_base;
35502    int ret_val;
35503    xmlSchemaValPtr prev; /* the value */
35504    int n_prev;
35505    xmlSchemaValPtr cur; /* the value to be appended */
35506    int n_cur;
35507
35508    for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35509    for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35510        mem_base = xmlMemBlocks();
35511        prev = gen_xmlSchemaValPtr(n_prev, 0);
35512        cur = gen_xmlSchemaValPtr(n_cur, 1);
35513
35514        ret_val = xmlSchemaValueAppend(prev, cur);
35515        desret_int(ret_val);
35516        call_tests++;
35517        des_xmlSchemaValPtr(n_prev, prev, 0);
35518        des_xmlSchemaValPtr(n_cur, cur, 1);
35519        xmlResetLastError();
35520        if (mem_base != xmlMemBlocks()) {
35521            printf("Leak of %d blocks found in xmlSchemaValueAppend",
35522	           xmlMemBlocks() - mem_base);
35523	    test_ret++;
35524            printf(" %d", n_prev);
35525            printf(" %d", n_cur);
35526            printf("\n");
35527        }
35528    }
35529    }
35530    function_tests++;
35531#endif
35532
35533    return(test_ret);
35534}
35535
35536
35537static int
35538test_xmlSchemaValueGetAsBoolean(void) {
35539    int test_ret = 0;
35540
35541#if defined(LIBXML_SCHEMAS_ENABLED)
35542    int mem_base;
35543    int ret_val;
35544    xmlSchemaValPtr val; /* the value */
35545    int n_val;
35546
35547    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35548        mem_base = xmlMemBlocks();
35549        val = gen_xmlSchemaValPtr(n_val, 0);
35550
35551        ret_val = xmlSchemaValueGetAsBoolean(val);
35552        desret_int(ret_val);
35553        call_tests++;
35554        des_xmlSchemaValPtr(n_val, val, 0);
35555        xmlResetLastError();
35556        if (mem_base != xmlMemBlocks()) {
35557            printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35558	           xmlMemBlocks() - mem_base);
35559	    test_ret++;
35560            printf(" %d", n_val);
35561            printf("\n");
35562        }
35563    }
35564    function_tests++;
35565#endif
35566
35567    return(test_ret);
35568}
35569
35570
35571static int
35572test_xmlSchemaValueGetAsString(void) {
35573    int test_ret = 0;
35574
35575#if defined(LIBXML_SCHEMAS_ENABLED)
35576    int mem_base;
35577    const xmlChar * ret_val;
35578    xmlSchemaValPtr val; /* the value */
35579    int n_val;
35580
35581    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35582        mem_base = xmlMemBlocks();
35583        val = gen_xmlSchemaValPtr(n_val, 0);
35584
35585        ret_val = xmlSchemaValueGetAsString(val);
35586        desret_const_xmlChar_ptr(ret_val);
35587        call_tests++;
35588        des_xmlSchemaValPtr(n_val, val, 0);
35589        xmlResetLastError();
35590        if (mem_base != xmlMemBlocks()) {
35591            printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35592	           xmlMemBlocks() - mem_base);
35593	    test_ret++;
35594            printf(" %d", n_val);
35595            printf("\n");
35596        }
35597    }
35598    function_tests++;
35599#endif
35600
35601    return(test_ret);
35602}
35603
35604
35605static int
35606test_xmlSchemaValueGetNext(void) {
35607    int test_ret = 0;
35608
35609
35610    /* missing type support */
35611    return(test_ret);
35612}
35613
35614
35615static int
35616test_xmlSchemaWhiteSpaceReplace(void) {
35617    int test_ret = 0;
35618
35619#if defined(LIBXML_SCHEMAS_ENABLED)
35620    int mem_base;
35621    xmlChar * ret_val;
35622    xmlChar * value; /* a value */
35623    int n_value;
35624
35625    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35626        mem_base = xmlMemBlocks();
35627        value = gen_const_xmlChar_ptr(n_value, 0);
35628
35629        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35630        desret_xmlChar_ptr(ret_val);
35631        call_tests++;
35632        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35633        xmlResetLastError();
35634        if (mem_base != xmlMemBlocks()) {
35635            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35636	           xmlMemBlocks() - mem_base);
35637	    test_ret++;
35638            printf(" %d", n_value);
35639            printf("\n");
35640        }
35641    }
35642    function_tests++;
35643#endif
35644
35645    return(test_ret);
35646}
35647
35648static int
35649test_xmlschemastypes(void) {
35650    int test_ret = 0;
35651
35652    if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35653    test_ret += test_xmlSchemaCheckFacet();
35654    test_ret += test_xmlSchemaCleanupTypes();
35655    test_ret += test_xmlSchemaCollapseString();
35656    test_ret += test_xmlSchemaCompareValues();
35657    test_ret += test_xmlSchemaCompareValuesWhtsp();
35658    test_ret += test_xmlSchemaCopyValue();
35659    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35660    test_ret += test_xmlSchemaGetBuiltInType();
35661    test_ret += test_xmlSchemaGetCanonValue();
35662    test_ret += test_xmlSchemaGetCanonValueWhtsp();
35663    test_ret += test_xmlSchemaGetFacetValueAsULong();
35664    test_ret += test_xmlSchemaGetPredefinedType();
35665    test_ret += test_xmlSchemaGetValType();
35666    test_ret += test_xmlSchemaInitTypes();
35667    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35668    test_ret += test_xmlSchemaNewFacet();
35669    test_ret += test_xmlSchemaNewNOTATIONValue();
35670    test_ret += test_xmlSchemaNewQNameValue();
35671    test_ret += test_xmlSchemaNewStringValue();
35672    test_ret += test_xmlSchemaValPredefTypeNode();
35673    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35674    test_ret += test_xmlSchemaValidateFacet();
35675    test_ret += test_xmlSchemaValidateFacetWhtsp();
35676    test_ret += test_xmlSchemaValidateLengthFacet();
35677    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35678    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35679    test_ret += test_xmlSchemaValidatePredefinedType();
35680    test_ret += test_xmlSchemaValueAppend();
35681    test_ret += test_xmlSchemaValueGetAsBoolean();
35682    test_ret += test_xmlSchemaValueGetAsString();
35683    test_ret += test_xmlSchemaValueGetNext();
35684    test_ret += test_xmlSchemaWhiteSpaceReplace();
35685
35686    if (test_ret != 0)
35687	printf("Module xmlschemastypes: %d errors\n", test_ret);
35688    return(test_ret);
35689}
35690
35691static int
35692test_xmlCharStrdup(void) {
35693    int test_ret = 0;
35694
35695    int mem_base;
35696    xmlChar * ret_val;
35697    char * cur; /* the input char * */
35698    int n_cur;
35699
35700    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35701        mem_base = xmlMemBlocks();
35702        cur = gen_const_char_ptr(n_cur, 0);
35703
35704        ret_val = xmlCharStrdup((const char *)cur);
35705        desret_xmlChar_ptr(ret_val);
35706        call_tests++;
35707        des_const_char_ptr(n_cur, (const char *)cur, 0);
35708        xmlResetLastError();
35709        if (mem_base != xmlMemBlocks()) {
35710            printf("Leak of %d blocks found in xmlCharStrdup",
35711	           xmlMemBlocks() - mem_base);
35712	    test_ret++;
35713            printf(" %d", n_cur);
35714            printf("\n");
35715        }
35716    }
35717    function_tests++;
35718
35719    return(test_ret);
35720}
35721
35722
35723static int
35724test_xmlCharStrndup(void) {
35725    int test_ret = 0;
35726
35727    int mem_base;
35728    xmlChar * ret_val;
35729    char * cur; /* the input char * */
35730    int n_cur;
35731    int len; /* the len of @cur */
35732    int n_len;
35733
35734    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35735    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35736        mem_base = xmlMemBlocks();
35737        cur = gen_const_char_ptr(n_cur, 0);
35738        len = gen_int(n_len, 1);
35739
35740        ret_val = xmlCharStrndup((const char *)cur, len);
35741        desret_xmlChar_ptr(ret_val);
35742        call_tests++;
35743        des_const_char_ptr(n_cur, (const char *)cur, 0);
35744        des_int(n_len, len, 1);
35745        xmlResetLastError();
35746        if (mem_base != xmlMemBlocks()) {
35747            printf("Leak of %d blocks found in xmlCharStrndup",
35748	           xmlMemBlocks() - mem_base);
35749	    test_ret++;
35750            printf(" %d", n_cur);
35751            printf(" %d", n_len);
35752            printf("\n");
35753        }
35754    }
35755    }
35756    function_tests++;
35757
35758    return(test_ret);
35759}
35760
35761
35762static int
35763test_xmlCheckUTF8(void) {
35764    int test_ret = 0;
35765
35766    int mem_base;
35767    int ret_val;
35768    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35769    int n_utf;
35770
35771    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35772        mem_base = xmlMemBlocks();
35773        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35774
35775        ret_val = xmlCheckUTF8((const unsigned char *)utf);
35776        desret_int(ret_val);
35777        call_tests++;
35778        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35779        xmlResetLastError();
35780        if (mem_base != xmlMemBlocks()) {
35781            printf("Leak of %d blocks found in xmlCheckUTF8",
35782	           xmlMemBlocks() - mem_base);
35783	    test_ret++;
35784            printf(" %d", n_utf);
35785            printf("\n");
35786        }
35787    }
35788    function_tests++;
35789
35790    return(test_ret);
35791}
35792
35793
35794static int
35795test_xmlGetUTF8Char(void) {
35796    int test_ret = 0;
35797
35798    int mem_base;
35799    int ret_val;
35800    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35801    int n_utf;
35802    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. */
35803    int n_len;
35804
35805    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35806    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35807        mem_base = xmlMemBlocks();
35808        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35809        len = gen_int_ptr(n_len, 1);
35810
35811        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35812        desret_int(ret_val);
35813        call_tests++;
35814        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35815        des_int_ptr(n_len, len, 1);
35816        xmlResetLastError();
35817        if (mem_base != xmlMemBlocks()) {
35818            printf("Leak of %d blocks found in xmlGetUTF8Char",
35819	           xmlMemBlocks() - mem_base);
35820	    test_ret++;
35821            printf(" %d", n_utf);
35822            printf(" %d", n_len);
35823            printf("\n");
35824        }
35825    }
35826    }
35827    function_tests++;
35828
35829    return(test_ret);
35830}
35831
35832
35833static int
35834test_xmlStrEqual(void) {
35835    int test_ret = 0;
35836
35837    int mem_base;
35838    int ret_val;
35839    xmlChar * str1; /* the first xmlChar * */
35840    int n_str1;
35841    xmlChar * str2; /* the second xmlChar * */
35842    int n_str2;
35843
35844    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35845    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35846        mem_base = xmlMemBlocks();
35847        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35848        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35849
35850        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
35851        desret_int(ret_val);
35852        call_tests++;
35853        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35854        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35855        xmlResetLastError();
35856        if (mem_base != xmlMemBlocks()) {
35857            printf("Leak of %d blocks found in xmlStrEqual",
35858	           xmlMemBlocks() - mem_base);
35859	    test_ret++;
35860            printf(" %d", n_str1);
35861            printf(" %d", n_str2);
35862            printf("\n");
35863        }
35864    }
35865    }
35866    function_tests++;
35867
35868    return(test_ret);
35869}
35870
35871
35872static int
35873test_xmlStrPrintf(void) {
35874    int test_ret = 0;
35875
35876
35877    /* missing type support */
35878    return(test_ret);
35879}
35880
35881
35882static int
35883test_xmlStrQEqual(void) {
35884    int test_ret = 0;
35885
35886    int mem_base;
35887    int ret_val;
35888    xmlChar * pref; /* the prefix of the QName */
35889    int n_pref;
35890    xmlChar * name; /* the localname of the QName */
35891    int n_name;
35892    xmlChar * str; /* the second xmlChar * */
35893    int n_str;
35894
35895    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
35896    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35897    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35898        mem_base = xmlMemBlocks();
35899        pref = gen_const_xmlChar_ptr(n_pref, 0);
35900        name = gen_const_xmlChar_ptr(n_name, 1);
35901        str = gen_const_xmlChar_ptr(n_str, 2);
35902
35903        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
35904        desret_int(ret_val);
35905        call_tests++;
35906        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
35907        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
35908        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
35909        xmlResetLastError();
35910        if (mem_base != xmlMemBlocks()) {
35911            printf("Leak of %d blocks found in xmlStrQEqual",
35912	           xmlMemBlocks() - mem_base);
35913	    test_ret++;
35914            printf(" %d", n_pref);
35915            printf(" %d", n_name);
35916            printf(" %d", n_str);
35917            printf("\n");
35918        }
35919    }
35920    }
35921    }
35922    function_tests++;
35923
35924    return(test_ret);
35925}
35926
35927
35928static int
35929test_xmlStrVPrintf(void) {
35930    int test_ret = 0;
35931
35932
35933    /* missing type support */
35934    return(test_ret);
35935}
35936
35937
35938static int
35939test_xmlStrcasecmp(void) {
35940    int test_ret = 0;
35941
35942    int mem_base;
35943    int ret_val;
35944    xmlChar * str1; /* the first xmlChar * */
35945    int n_str1;
35946    xmlChar * str2; /* the second xmlChar * */
35947    int n_str2;
35948
35949    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35950    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35951        mem_base = xmlMemBlocks();
35952        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35953        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35954
35955        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
35956        desret_int(ret_val);
35957        call_tests++;
35958        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35959        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35960        xmlResetLastError();
35961        if (mem_base != xmlMemBlocks()) {
35962            printf("Leak of %d blocks found in xmlStrcasecmp",
35963	           xmlMemBlocks() - mem_base);
35964	    test_ret++;
35965            printf(" %d", n_str1);
35966            printf(" %d", n_str2);
35967            printf("\n");
35968        }
35969    }
35970    }
35971    function_tests++;
35972
35973    return(test_ret);
35974}
35975
35976
35977static int
35978test_xmlStrcasestr(void) {
35979    int test_ret = 0;
35980
35981    int mem_base;
35982    const xmlChar * ret_val;
35983    xmlChar * str; /* the xmlChar * array (haystack) */
35984    int n_str;
35985    xmlChar * val; /* the xmlChar to search (needle) */
35986    int n_val;
35987
35988    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35989    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
35990        mem_base = xmlMemBlocks();
35991        str = gen_const_xmlChar_ptr(n_str, 0);
35992        val = gen_xmlChar_ptr(n_val, 1);
35993
35994        ret_val = xmlStrcasestr((const xmlChar *)str, val);
35995        desret_const_xmlChar_ptr(ret_val);
35996        call_tests++;
35997        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
35998        des_xmlChar_ptr(n_val, val, 1);
35999        xmlResetLastError();
36000        if (mem_base != xmlMemBlocks()) {
36001            printf("Leak of %d blocks found in xmlStrcasestr",
36002	           xmlMemBlocks() - mem_base);
36003	    test_ret++;
36004            printf(" %d", n_str);
36005            printf(" %d", n_val);
36006            printf("\n");
36007        }
36008    }
36009    }
36010    function_tests++;
36011
36012    return(test_ret);
36013}
36014
36015
36016static int
36017test_xmlStrchr(void) {
36018    int test_ret = 0;
36019
36020    int mem_base;
36021    const xmlChar * ret_val;
36022    xmlChar * str; /* the xmlChar * array */
36023    int n_str;
36024    xmlChar val; /* the xmlChar to search */
36025    int n_val;
36026
36027    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36028    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36029        mem_base = xmlMemBlocks();
36030        str = gen_const_xmlChar_ptr(n_str, 0);
36031        val = gen_xmlChar(n_val, 1);
36032
36033        ret_val = xmlStrchr((const xmlChar *)str, val);
36034        desret_const_xmlChar_ptr(ret_val);
36035        call_tests++;
36036        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36037        des_xmlChar(n_val, val, 1);
36038        xmlResetLastError();
36039        if (mem_base != xmlMemBlocks()) {
36040            printf("Leak of %d blocks found in xmlStrchr",
36041	           xmlMemBlocks() - mem_base);
36042	    test_ret++;
36043            printf(" %d", n_str);
36044            printf(" %d", n_val);
36045            printf("\n");
36046        }
36047    }
36048    }
36049    function_tests++;
36050
36051    return(test_ret);
36052}
36053
36054
36055static int
36056test_xmlStrcmp(void) {
36057    int test_ret = 0;
36058
36059    int mem_base;
36060    int ret_val;
36061    xmlChar * str1; /* the first xmlChar * */
36062    int n_str1;
36063    xmlChar * str2; /* the second xmlChar * */
36064    int n_str2;
36065
36066    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36067    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36068        mem_base = xmlMemBlocks();
36069        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36070        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36071
36072        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36073        desret_int(ret_val);
36074        call_tests++;
36075        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36076        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36077        xmlResetLastError();
36078        if (mem_base != xmlMemBlocks()) {
36079            printf("Leak of %d blocks found in xmlStrcmp",
36080	           xmlMemBlocks() - mem_base);
36081	    test_ret++;
36082            printf(" %d", n_str1);
36083            printf(" %d", n_str2);
36084            printf("\n");
36085        }
36086    }
36087    }
36088    function_tests++;
36089
36090    return(test_ret);
36091}
36092
36093
36094static int
36095test_xmlStrdup(void) {
36096    int test_ret = 0;
36097
36098    int mem_base;
36099    xmlChar * ret_val;
36100    xmlChar * cur; /* the input xmlChar * */
36101    int n_cur;
36102
36103    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36104        mem_base = xmlMemBlocks();
36105        cur = gen_const_xmlChar_ptr(n_cur, 0);
36106
36107        ret_val = xmlStrdup((const xmlChar *)cur);
36108        desret_xmlChar_ptr(ret_val);
36109        call_tests++;
36110        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36111        xmlResetLastError();
36112        if (mem_base != xmlMemBlocks()) {
36113            printf("Leak of %d blocks found in xmlStrdup",
36114	           xmlMemBlocks() - mem_base);
36115	    test_ret++;
36116            printf(" %d", n_cur);
36117            printf("\n");
36118        }
36119    }
36120    function_tests++;
36121
36122    return(test_ret);
36123}
36124
36125
36126static int
36127test_xmlStrlen(void) {
36128    int test_ret = 0;
36129
36130    int mem_base;
36131    int ret_val;
36132    xmlChar * str; /* the xmlChar * array */
36133    int n_str;
36134
36135    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36136        mem_base = xmlMemBlocks();
36137        str = gen_const_xmlChar_ptr(n_str, 0);
36138
36139        ret_val = xmlStrlen((const xmlChar *)str);
36140        desret_int(ret_val);
36141        call_tests++;
36142        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36143        xmlResetLastError();
36144        if (mem_base != xmlMemBlocks()) {
36145            printf("Leak of %d blocks found in xmlStrlen",
36146	           xmlMemBlocks() - mem_base);
36147	    test_ret++;
36148            printf(" %d", n_str);
36149            printf("\n");
36150        }
36151    }
36152    function_tests++;
36153
36154    return(test_ret);
36155}
36156
36157
36158static int
36159test_xmlStrncasecmp(void) {
36160    int test_ret = 0;
36161
36162    int mem_base;
36163    int ret_val;
36164    xmlChar * str1; /* the first xmlChar * */
36165    int n_str1;
36166    xmlChar * str2; /* the second xmlChar * */
36167    int n_str2;
36168    int len; /* the max comparison length */
36169    int n_len;
36170
36171    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36172    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36173    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36174        mem_base = xmlMemBlocks();
36175        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36176        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36177        len = gen_int(n_len, 2);
36178
36179        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36180        desret_int(ret_val);
36181        call_tests++;
36182        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36183        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36184        des_int(n_len, len, 2);
36185        xmlResetLastError();
36186        if (mem_base != xmlMemBlocks()) {
36187            printf("Leak of %d blocks found in xmlStrncasecmp",
36188	           xmlMemBlocks() - mem_base);
36189	    test_ret++;
36190            printf(" %d", n_str1);
36191            printf(" %d", n_str2);
36192            printf(" %d", n_len);
36193            printf("\n");
36194        }
36195    }
36196    }
36197    }
36198    function_tests++;
36199
36200    return(test_ret);
36201}
36202
36203
36204static int
36205test_xmlStrncatNew(void) {
36206    int test_ret = 0;
36207
36208    int mem_base;
36209    xmlChar * ret_val;
36210    xmlChar * str1; /* first xmlChar string */
36211    int n_str1;
36212    xmlChar * str2; /* second xmlChar string */
36213    int n_str2;
36214    int len; /* the len of @str2 or < 0 */
36215    int n_len;
36216
36217    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36218    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36219    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36220        mem_base = xmlMemBlocks();
36221        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36222        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36223        len = gen_int(n_len, 2);
36224
36225        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36226        desret_xmlChar_ptr(ret_val);
36227        call_tests++;
36228        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36229        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36230        des_int(n_len, len, 2);
36231        xmlResetLastError();
36232        if (mem_base != xmlMemBlocks()) {
36233            printf("Leak of %d blocks found in xmlStrncatNew",
36234	           xmlMemBlocks() - mem_base);
36235	    test_ret++;
36236            printf(" %d", n_str1);
36237            printf(" %d", n_str2);
36238            printf(" %d", n_len);
36239            printf("\n");
36240        }
36241    }
36242    }
36243    }
36244    function_tests++;
36245
36246    return(test_ret);
36247}
36248
36249
36250static int
36251test_xmlStrncmp(void) {
36252    int test_ret = 0;
36253
36254    int mem_base;
36255    int ret_val;
36256    xmlChar * str1; /* the first xmlChar * */
36257    int n_str1;
36258    xmlChar * str2; /* the second xmlChar * */
36259    int n_str2;
36260    int len; /* the max comparison length */
36261    int n_len;
36262
36263    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36264    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36265    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36266        mem_base = xmlMemBlocks();
36267        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36268        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36269        len = gen_int(n_len, 2);
36270
36271        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36272        desret_int(ret_val);
36273        call_tests++;
36274        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36275        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36276        des_int(n_len, len, 2);
36277        xmlResetLastError();
36278        if (mem_base != xmlMemBlocks()) {
36279            printf("Leak of %d blocks found in xmlStrncmp",
36280	           xmlMemBlocks() - mem_base);
36281	    test_ret++;
36282            printf(" %d", n_str1);
36283            printf(" %d", n_str2);
36284            printf(" %d", n_len);
36285            printf("\n");
36286        }
36287    }
36288    }
36289    }
36290    function_tests++;
36291
36292    return(test_ret);
36293}
36294
36295
36296static int
36297test_xmlStrndup(void) {
36298    int test_ret = 0;
36299
36300    int mem_base;
36301    xmlChar * ret_val;
36302    xmlChar * cur; /* the input xmlChar * */
36303    int n_cur;
36304    int len; /* the len of @cur */
36305    int n_len;
36306
36307    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36308    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36309        mem_base = xmlMemBlocks();
36310        cur = gen_const_xmlChar_ptr(n_cur, 0);
36311        len = gen_int(n_len, 1);
36312
36313        ret_val = xmlStrndup((const xmlChar *)cur, len);
36314        desret_xmlChar_ptr(ret_val);
36315        call_tests++;
36316        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36317        des_int(n_len, len, 1);
36318        xmlResetLastError();
36319        if (mem_base != xmlMemBlocks()) {
36320            printf("Leak of %d blocks found in xmlStrndup",
36321	           xmlMemBlocks() - mem_base);
36322	    test_ret++;
36323            printf(" %d", n_cur);
36324            printf(" %d", n_len);
36325            printf("\n");
36326        }
36327    }
36328    }
36329    function_tests++;
36330
36331    return(test_ret);
36332}
36333
36334
36335static int
36336test_xmlStrstr(void) {
36337    int test_ret = 0;
36338
36339    int mem_base;
36340    const xmlChar * ret_val;
36341    xmlChar * str; /* the xmlChar * array (haystack) */
36342    int n_str;
36343    xmlChar * val; /* the xmlChar to search (needle) */
36344    int n_val;
36345
36346    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36347    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36348        mem_base = xmlMemBlocks();
36349        str = gen_const_xmlChar_ptr(n_str, 0);
36350        val = gen_const_xmlChar_ptr(n_val, 1);
36351
36352        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36353        desret_const_xmlChar_ptr(ret_val);
36354        call_tests++;
36355        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36356        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36357        xmlResetLastError();
36358        if (mem_base != xmlMemBlocks()) {
36359            printf("Leak of %d blocks found in xmlStrstr",
36360	           xmlMemBlocks() - mem_base);
36361	    test_ret++;
36362            printf(" %d", n_str);
36363            printf(" %d", n_val);
36364            printf("\n");
36365        }
36366    }
36367    }
36368    function_tests++;
36369
36370    return(test_ret);
36371}
36372
36373
36374static int
36375test_xmlStrsub(void) {
36376    int test_ret = 0;
36377
36378    int mem_base;
36379    xmlChar * ret_val;
36380    xmlChar * str; /* the xmlChar * array (haystack) */
36381    int n_str;
36382    int start; /* the index of the first char (zero based) */
36383    int n_start;
36384    int len; /* the length of the substring */
36385    int n_len;
36386
36387    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36388    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36389    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36390        mem_base = xmlMemBlocks();
36391        str = gen_const_xmlChar_ptr(n_str, 0);
36392        start = gen_int(n_start, 1);
36393        len = gen_int(n_len, 2);
36394
36395        ret_val = xmlStrsub((const xmlChar *)str, start, len);
36396        desret_xmlChar_ptr(ret_val);
36397        call_tests++;
36398        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36399        des_int(n_start, start, 1);
36400        des_int(n_len, len, 2);
36401        xmlResetLastError();
36402        if (mem_base != xmlMemBlocks()) {
36403            printf("Leak of %d blocks found in xmlStrsub",
36404	           xmlMemBlocks() - mem_base);
36405	    test_ret++;
36406            printf(" %d", n_str);
36407            printf(" %d", n_start);
36408            printf(" %d", n_len);
36409            printf("\n");
36410        }
36411    }
36412    }
36413    }
36414    function_tests++;
36415
36416    return(test_ret);
36417}
36418
36419
36420static int
36421test_xmlUTF8Charcmp(void) {
36422    int test_ret = 0;
36423
36424    int mem_base;
36425    int ret_val;
36426    xmlChar * utf1; /* pointer to first UTF8 char */
36427    int n_utf1;
36428    xmlChar * utf2; /* pointer to second UTF8 char */
36429    int n_utf2;
36430
36431    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36432    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36433        mem_base = xmlMemBlocks();
36434        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36435        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36436
36437        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36438        desret_int(ret_val);
36439        call_tests++;
36440        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36441        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36442        xmlResetLastError();
36443        if (mem_base != xmlMemBlocks()) {
36444            printf("Leak of %d blocks found in xmlUTF8Charcmp",
36445	           xmlMemBlocks() - mem_base);
36446	    test_ret++;
36447            printf(" %d", n_utf1);
36448            printf(" %d", n_utf2);
36449            printf("\n");
36450        }
36451    }
36452    }
36453    function_tests++;
36454
36455    return(test_ret);
36456}
36457
36458
36459static int
36460test_xmlUTF8Size(void) {
36461    int test_ret = 0;
36462
36463    int mem_base;
36464    int ret_val;
36465    xmlChar * utf; /* pointer to the UTF8 character */
36466    int n_utf;
36467
36468    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36469        mem_base = xmlMemBlocks();
36470        utf = gen_const_xmlChar_ptr(n_utf, 0);
36471
36472        ret_val = xmlUTF8Size((const xmlChar *)utf);
36473        desret_int(ret_val);
36474        call_tests++;
36475        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36476        xmlResetLastError();
36477        if (mem_base != xmlMemBlocks()) {
36478            printf("Leak of %d blocks found in xmlUTF8Size",
36479	           xmlMemBlocks() - mem_base);
36480	    test_ret++;
36481            printf(" %d", n_utf);
36482            printf("\n");
36483        }
36484    }
36485    function_tests++;
36486
36487    return(test_ret);
36488}
36489
36490
36491static int
36492test_xmlUTF8Strlen(void) {
36493    int test_ret = 0;
36494
36495    int mem_base;
36496    int ret_val;
36497    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36498    int n_utf;
36499
36500    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36501        mem_base = xmlMemBlocks();
36502        utf = gen_const_xmlChar_ptr(n_utf, 0);
36503
36504        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36505        desret_int(ret_val);
36506        call_tests++;
36507        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36508        xmlResetLastError();
36509        if (mem_base != xmlMemBlocks()) {
36510            printf("Leak of %d blocks found in xmlUTF8Strlen",
36511	           xmlMemBlocks() - mem_base);
36512	    test_ret++;
36513            printf(" %d", n_utf);
36514            printf("\n");
36515        }
36516    }
36517    function_tests++;
36518
36519    return(test_ret);
36520}
36521
36522
36523static int
36524test_xmlUTF8Strloc(void) {
36525    int test_ret = 0;
36526
36527    int mem_base;
36528    int ret_val;
36529    xmlChar * utf; /* the input UTF8 * */
36530    int n_utf;
36531    xmlChar * utfchar; /* the UTF8 character to be found */
36532    int n_utfchar;
36533
36534    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36535    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36536        mem_base = xmlMemBlocks();
36537        utf = gen_const_xmlChar_ptr(n_utf, 0);
36538        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36539
36540        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36541        desret_int(ret_val);
36542        call_tests++;
36543        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36544        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36545        xmlResetLastError();
36546        if (mem_base != xmlMemBlocks()) {
36547            printf("Leak of %d blocks found in xmlUTF8Strloc",
36548	           xmlMemBlocks() - mem_base);
36549	    test_ret++;
36550            printf(" %d", n_utf);
36551            printf(" %d", n_utfchar);
36552            printf("\n");
36553        }
36554    }
36555    }
36556    function_tests++;
36557
36558    return(test_ret);
36559}
36560
36561
36562static int
36563test_xmlUTF8Strndup(void) {
36564    int test_ret = 0;
36565
36566    int mem_base;
36567    xmlChar * ret_val;
36568    xmlChar * utf; /* the input UTF8 * */
36569    int n_utf;
36570    int len; /* the len of @utf (in chars) */
36571    int n_len;
36572
36573    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36574    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36575        mem_base = xmlMemBlocks();
36576        utf = gen_const_xmlChar_ptr(n_utf, 0);
36577        len = gen_int(n_len, 1);
36578
36579        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36580        desret_xmlChar_ptr(ret_val);
36581        call_tests++;
36582        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36583        des_int(n_len, len, 1);
36584        xmlResetLastError();
36585        if (mem_base != xmlMemBlocks()) {
36586            printf("Leak of %d blocks found in xmlUTF8Strndup",
36587	           xmlMemBlocks() - mem_base);
36588	    test_ret++;
36589            printf(" %d", n_utf);
36590            printf(" %d", n_len);
36591            printf("\n");
36592        }
36593    }
36594    }
36595    function_tests++;
36596
36597    return(test_ret);
36598}
36599
36600
36601static int
36602test_xmlUTF8Strpos(void) {
36603    int test_ret = 0;
36604
36605    int mem_base;
36606    const xmlChar * ret_val;
36607    xmlChar * utf; /* the input UTF8 * */
36608    int n_utf;
36609    int pos; /* the position of the desired UTF8 char (in chars) */
36610    int n_pos;
36611
36612    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36613    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36614        mem_base = xmlMemBlocks();
36615        utf = gen_const_xmlChar_ptr(n_utf, 0);
36616        pos = gen_int(n_pos, 1);
36617
36618        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36619        desret_const_xmlChar_ptr(ret_val);
36620        call_tests++;
36621        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36622        des_int(n_pos, pos, 1);
36623        xmlResetLastError();
36624        if (mem_base != xmlMemBlocks()) {
36625            printf("Leak of %d blocks found in xmlUTF8Strpos",
36626	           xmlMemBlocks() - mem_base);
36627	    test_ret++;
36628            printf(" %d", n_utf);
36629            printf(" %d", n_pos);
36630            printf("\n");
36631        }
36632    }
36633    }
36634    function_tests++;
36635
36636    return(test_ret);
36637}
36638
36639
36640static int
36641test_xmlUTF8Strsize(void) {
36642    int test_ret = 0;
36643
36644    int mem_base;
36645    int ret_val;
36646    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36647    int n_utf;
36648    int len; /* the number of characters in the array */
36649    int n_len;
36650
36651    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36652    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36653        mem_base = xmlMemBlocks();
36654        utf = gen_const_xmlChar_ptr(n_utf, 0);
36655        len = gen_int(n_len, 1);
36656
36657        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36658        desret_int(ret_val);
36659        call_tests++;
36660        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36661        des_int(n_len, len, 1);
36662        xmlResetLastError();
36663        if (mem_base != xmlMemBlocks()) {
36664            printf("Leak of %d blocks found in xmlUTF8Strsize",
36665	           xmlMemBlocks() - mem_base);
36666	    test_ret++;
36667            printf(" %d", n_utf);
36668            printf(" %d", n_len);
36669            printf("\n");
36670        }
36671    }
36672    }
36673    function_tests++;
36674
36675    return(test_ret);
36676}
36677
36678
36679static int
36680test_xmlUTF8Strsub(void) {
36681    int test_ret = 0;
36682
36683    int mem_base;
36684    xmlChar * ret_val;
36685    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36686    int n_utf;
36687    int start; /* relative pos of first char */
36688    int n_start;
36689    int len; /* total number to copy */
36690    int n_len;
36691
36692    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36693    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36694    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36695        mem_base = xmlMemBlocks();
36696        utf = gen_const_xmlChar_ptr(n_utf, 0);
36697        start = gen_int(n_start, 1);
36698        len = gen_int(n_len, 2);
36699
36700        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36701        desret_xmlChar_ptr(ret_val);
36702        call_tests++;
36703        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36704        des_int(n_start, start, 1);
36705        des_int(n_len, len, 2);
36706        xmlResetLastError();
36707        if (mem_base != xmlMemBlocks()) {
36708            printf("Leak of %d blocks found in xmlUTF8Strsub",
36709	           xmlMemBlocks() - mem_base);
36710	    test_ret++;
36711            printf(" %d", n_utf);
36712            printf(" %d", n_start);
36713            printf(" %d", n_len);
36714            printf("\n");
36715        }
36716    }
36717    }
36718    }
36719    function_tests++;
36720
36721    return(test_ret);
36722}
36723
36724static int
36725test_xmlstring(void) {
36726    int test_ret = 0;
36727
36728    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36729    test_ret += test_xmlCharStrdup();
36730    test_ret += test_xmlCharStrndup();
36731    test_ret += test_xmlCheckUTF8();
36732    test_ret += test_xmlGetUTF8Char();
36733    test_ret += test_xmlStrEqual();
36734    test_ret += test_xmlStrPrintf();
36735    test_ret += test_xmlStrQEqual();
36736    test_ret += test_xmlStrVPrintf();
36737    test_ret += test_xmlStrcasecmp();
36738    test_ret += test_xmlStrcasestr();
36739    test_ret += test_xmlStrchr();
36740    test_ret += test_xmlStrcmp();
36741    test_ret += test_xmlStrdup();
36742    test_ret += test_xmlStrlen();
36743    test_ret += test_xmlStrncasecmp();
36744    test_ret += test_xmlStrncatNew();
36745    test_ret += test_xmlStrncmp();
36746    test_ret += test_xmlStrndup();
36747    test_ret += test_xmlStrstr();
36748    test_ret += test_xmlStrsub();
36749    test_ret += test_xmlUTF8Charcmp();
36750    test_ret += test_xmlUTF8Size();
36751    test_ret += test_xmlUTF8Strlen();
36752    test_ret += test_xmlUTF8Strloc();
36753    test_ret += test_xmlUTF8Strndup();
36754    test_ret += test_xmlUTF8Strpos();
36755    test_ret += test_xmlUTF8Strsize();
36756    test_ret += test_xmlUTF8Strsub();
36757
36758    if (test_ret != 0)
36759	printf("Module xmlstring: %d errors\n", test_ret);
36760    return(test_ret);
36761}
36762
36763static int
36764test_xmlUCSIsAegeanNumbers(void) {
36765    int test_ret = 0;
36766
36767#if defined(LIBXML_UNICODE_ENABLED)
36768    int mem_base;
36769    int ret_val;
36770    int code; /* UCS code point */
36771    int n_code;
36772
36773    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36774        mem_base = xmlMemBlocks();
36775        code = gen_int(n_code, 0);
36776
36777        ret_val = xmlUCSIsAegeanNumbers(code);
36778        desret_int(ret_val);
36779        call_tests++;
36780        des_int(n_code, code, 0);
36781        xmlResetLastError();
36782        if (mem_base != xmlMemBlocks()) {
36783            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36784	           xmlMemBlocks() - mem_base);
36785	    test_ret++;
36786            printf(" %d", n_code);
36787            printf("\n");
36788        }
36789    }
36790    function_tests++;
36791#endif
36792
36793    return(test_ret);
36794}
36795
36796
36797static int
36798test_xmlUCSIsAlphabeticPresentationForms(void) {
36799    int test_ret = 0;
36800
36801#if defined(LIBXML_UNICODE_ENABLED)
36802    int mem_base;
36803    int ret_val;
36804    int code; /* UCS code point */
36805    int n_code;
36806
36807    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36808        mem_base = xmlMemBlocks();
36809        code = gen_int(n_code, 0);
36810
36811        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36812        desret_int(ret_val);
36813        call_tests++;
36814        des_int(n_code, code, 0);
36815        xmlResetLastError();
36816        if (mem_base != xmlMemBlocks()) {
36817            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36818	           xmlMemBlocks() - mem_base);
36819	    test_ret++;
36820            printf(" %d", n_code);
36821            printf("\n");
36822        }
36823    }
36824    function_tests++;
36825#endif
36826
36827    return(test_ret);
36828}
36829
36830
36831static int
36832test_xmlUCSIsArabic(void) {
36833    int test_ret = 0;
36834
36835#if defined(LIBXML_UNICODE_ENABLED)
36836    int mem_base;
36837    int ret_val;
36838    int code; /* UCS code point */
36839    int n_code;
36840
36841    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36842        mem_base = xmlMemBlocks();
36843        code = gen_int(n_code, 0);
36844
36845        ret_val = xmlUCSIsArabic(code);
36846        desret_int(ret_val);
36847        call_tests++;
36848        des_int(n_code, code, 0);
36849        xmlResetLastError();
36850        if (mem_base != xmlMemBlocks()) {
36851            printf("Leak of %d blocks found in xmlUCSIsArabic",
36852	           xmlMemBlocks() - mem_base);
36853	    test_ret++;
36854            printf(" %d", n_code);
36855            printf("\n");
36856        }
36857    }
36858    function_tests++;
36859#endif
36860
36861    return(test_ret);
36862}
36863
36864
36865static int
36866test_xmlUCSIsArabicPresentationFormsA(void) {
36867    int test_ret = 0;
36868
36869#if defined(LIBXML_UNICODE_ENABLED)
36870    int mem_base;
36871    int ret_val;
36872    int code; /* UCS code point */
36873    int n_code;
36874
36875    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36876        mem_base = xmlMemBlocks();
36877        code = gen_int(n_code, 0);
36878
36879        ret_val = xmlUCSIsArabicPresentationFormsA(code);
36880        desret_int(ret_val);
36881        call_tests++;
36882        des_int(n_code, code, 0);
36883        xmlResetLastError();
36884        if (mem_base != xmlMemBlocks()) {
36885            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
36886	           xmlMemBlocks() - mem_base);
36887	    test_ret++;
36888            printf(" %d", n_code);
36889            printf("\n");
36890        }
36891    }
36892    function_tests++;
36893#endif
36894
36895    return(test_ret);
36896}
36897
36898
36899static int
36900test_xmlUCSIsArabicPresentationFormsB(void) {
36901    int test_ret = 0;
36902
36903#if defined(LIBXML_UNICODE_ENABLED)
36904    int mem_base;
36905    int ret_val;
36906    int code; /* UCS code point */
36907    int n_code;
36908
36909    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36910        mem_base = xmlMemBlocks();
36911        code = gen_int(n_code, 0);
36912
36913        ret_val = xmlUCSIsArabicPresentationFormsB(code);
36914        desret_int(ret_val);
36915        call_tests++;
36916        des_int(n_code, code, 0);
36917        xmlResetLastError();
36918        if (mem_base != xmlMemBlocks()) {
36919            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
36920	           xmlMemBlocks() - mem_base);
36921	    test_ret++;
36922            printf(" %d", n_code);
36923            printf("\n");
36924        }
36925    }
36926    function_tests++;
36927#endif
36928
36929    return(test_ret);
36930}
36931
36932
36933static int
36934test_xmlUCSIsArmenian(void) {
36935    int test_ret = 0;
36936
36937#if defined(LIBXML_UNICODE_ENABLED)
36938    int mem_base;
36939    int ret_val;
36940    int code; /* UCS code point */
36941    int n_code;
36942
36943    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36944        mem_base = xmlMemBlocks();
36945        code = gen_int(n_code, 0);
36946
36947        ret_val = xmlUCSIsArmenian(code);
36948        desret_int(ret_val);
36949        call_tests++;
36950        des_int(n_code, code, 0);
36951        xmlResetLastError();
36952        if (mem_base != xmlMemBlocks()) {
36953            printf("Leak of %d blocks found in xmlUCSIsArmenian",
36954	           xmlMemBlocks() - mem_base);
36955	    test_ret++;
36956            printf(" %d", n_code);
36957            printf("\n");
36958        }
36959    }
36960    function_tests++;
36961#endif
36962
36963    return(test_ret);
36964}
36965
36966
36967static int
36968test_xmlUCSIsArrows(void) {
36969    int test_ret = 0;
36970
36971#if defined(LIBXML_UNICODE_ENABLED)
36972    int mem_base;
36973    int ret_val;
36974    int code; /* UCS code point */
36975    int n_code;
36976
36977    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36978        mem_base = xmlMemBlocks();
36979        code = gen_int(n_code, 0);
36980
36981        ret_val = xmlUCSIsArrows(code);
36982        desret_int(ret_val);
36983        call_tests++;
36984        des_int(n_code, code, 0);
36985        xmlResetLastError();
36986        if (mem_base != xmlMemBlocks()) {
36987            printf("Leak of %d blocks found in xmlUCSIsArrows",
36988	           xmlMemBlocks() - mem_base);
36989	    test_ret++;
36990            printf(" %d", n_code);
36991            printf("\n");
36992        }
36993    }
36994    function_tests++;
36995#endif
36996
36997    return(test_ret);
36998}
36999
37000
37001static int
37002test_xmlUCSIsBasicLatin(void) {
37003    int test_ret = 0;
37004
37005#if defined(LIBXML_UNICODE_ENABLED)
37006    int mem_base;
37007    int ret_val;
37008    int code; /* UCS code point */
37009    int n_code;
37010
37011    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37012        mem_base = xmlMemBlocks();
37013        code = gen_int(n_code, 0);
37014
37015        ret_val = xmlUCSIsBasicLatin(code);
37016        desret_int(ret_val);
37017        call_tests++;
37018        des_int(n_code, code, 0);
37019        xmlResetLastError();
37020        if (mem_base != xmlMemBlocks()) {
37021            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37022	           xmlMemBlocks() - mem_base);
37023	    test_ret++;
37024            printf(" %d", n_code);
37025            printf("\n");
37026        }
37027    }
37028    function_tests++;
37029#endif
37030
37031    return(test_ret);
37032}
37033
37034
37035static int
37036test_xmlUCSIsBengali(void) {
37037    int test_ret = 0;
37038
37039#if defined(LIBXML_UNICODE_ENABLED)
37040    int mem_base;
37041    int ret_val;
37042    int code; /* UCS code point */
37043    int n_code;
37044
37045    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37046        mem_base = xmlMemBlocks();
37047        code = gen_int(n_code, 0);
37048
37049        ret_val = xmlUCSIsBengali(code);
37050        desret_int(ret_val);
37051        call_tests++;
37052        des_int(n_code, code, 0);
37053        xmlResetLastError();
37054        if (mem_base != xmlMemBlocks()) {
37055            printf("Leak of %d blocks found in xmlUCSIsBengali",
37056	           xmlMemBlocks() - mem_base);
37057	    test_ret++;
37058            printf(" %d", n_code);
37059            printf("\n");
37060        }
37061    }
37062    function_tests++;
37063#endif
37064
37065    return(test_ret);
37066}
37067
37068
37069static int
37070test_xmlUCSIsBlock(void) {
37071    int test_ret = 0;
37072
37073#if defined(LIBXML_UNICODE_ENABLED)
37074    int mem_base;
37075    int ret_val;
37076    int code; /* UCS code point */
37077    int n_code;
37078    char * block; /* UCS block name */
37079    int n_block;
37080
37081    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37082    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37083        mem_base = xmlMemBlocks();
37084        code = gen_int(n_code, 0);
37085        block = gen_const_char_ptr(n_block, 1);
37086
37087        ret_val = xmlUCSIsBlock(code, (const char *)block);
37088        desret_int(ret_val);
37089        call_tests++;
37090        des_int(n_code, code, 0);
37091        des_const_char_ptr(n_block, (const char *)block, 1);
37092        xmlResetLastError();
37093        if (mem_base != xmlMemBlocks()) {
37094            printf("Leak of %d blocks found in xmlUCSIsBlock",
37095	           xmlMemBlocks() - mem_base);
37096	    test_ret++;
37097            printf(" %d", n_code);
37098            printf(" %d", n_block);
37099            printf("\n");
37100        }
37101    }
37102    }
37103    function_tests++;
37104#endif
37105
37106    return(test_ret);
37107}
37108
37109
37110static int
37111test_xmlUCSIsBlockElements(void) {
37112    int test_ret = 0;
37113
37114#if defined(LIBXML_UNICODE_ENABLED)
37115    int mem_base;
37116    int ret_val;
37117    int code; /* UCS code point */
37118    int n_code;
37119
37120    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37121        mem_base = xmlMemBlocks();
37122        code = gen_int(n_code, 0);
37123
37124        ret_val = xmlUCSIsBlockElements(code);
37125        desret_int(ret_val);
37126        call_tests++;
37127        des_int(n_code, code, 0);
37128        xmlResetLastError();
37129        if (mem_base != xmlMemBlocks()) {
37130            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37131	           xmlMemBlocks() - mem_base);
37132	    test_ret++;
37133            printf(" %d", n_code);
37134            printf("\n");
37135        }
37136    }
37137    function_tests++;
37138#endif
37139
37140    return(test_ret);
37141}
37142
37143
37144static int
37145test_xmlUCSIsBopomofo(void) {
37146    int test_ret = 0;
37147
37148#if defined(LIBXML_UNICODE_ENABLED)
37149    int mem_base;
37150    int ret_val;
37151    int code; /* UCS code point */
37152    int n_code;
37153
37154    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37155        mem_base = xmlMemBlocks();
37156        code = gen_int(n_code, 0);
37157
37158        ret_val = xmlUCSIsBopomofo(code);
37159        desret_int(ret_val);
37160        call_tests++;
37161        des_int(n_code, code, 0);
37162        xmlResetLastError();
37163        if (mem_base != xmlMemBlocks()) {
37164            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37165	           xmlMemBlocks() - mem_base);
37166	    test_ret++;
37167            printf(" %d", n_code);
37168            printf("\n");
37169        }
37170    }
37171    function_tests++;
37172#endif
37173
37174    return(test_ret);
37175}
37176
37177
37178static int
37179test_xmlUCSIsBopomofoExtended(void) {
37180    int test_ret = 0;
37181
37182#if defined(LIBXML_UNICODE_ENABLED)
37183    int mem_base;
37184    int ret_val;
37185    int code; /* UCS code point */
37186    int n_code;
37187
37188    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37189        mem_base = xmlMemBlocks();
37190        code = gen_int(n_code, 0);
37191
37192        ret_val = xmlUCSIsBopomofoExtended(code);
37193        desret_int(ret_val);
37194        call_tests++;
37195        des_int(n_code, code, 0);
37196        xmlResetLastError();
37197        if (mem_base != xmlMemBlocks()) {
37198            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37199	           xmlMemBlocks() - mem_base);
37200	    test_ret++;
37201            printf(" %d", n_code);
37202            printf("\n");
37203        }
37204    }
37205    function_tests++;
37206#endif
37207
37208    return(test_ret);
37209}
37210
37211
37212static int
37213test_xmlUCSIsBoxDrawing(void) {
37214    int test_ret = 0;
37215
37216#if defined(LIBXML_UNICODE_ENABLED)
37217    int mem_base;
37218    int ret_val;
37219    int code; /* UCS code point */
37220    int n_code;
37221
37222    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37223        mem_base = xmlMemBlocks();
37224        code = gen_int(n_code, 0);
37225
37226        ret_val = xmlUCSIsBoxDrawing(code);
37227        desret_int(ret_val);
37228        call_tests++;
37229        des_int(n_code, code, 0);
37230        xmlResetLastError();
37231        if (mem_base != xmlMemBlocks()) {
37232            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37233	           xmlMemBlocks() - mem_base);
37234	    test_ret++;
37235            printf(" %d", n_code);
37236            printf("\n");
37237        }
37238    }
37239    function_tests++;
37240#endif
37241
37242    return(test_ret);
37243}
37244
37245
37246static int
37247test_xmlUCSIsBraillePatterns(void) {
37248    int test_ret = 0;
37249
37250#if defined(LIBXML_UNICODE_ENABLED)
37251    int mem_base;
37252    int ret_val;
37253    int code; /* UCS code point */
37254    int n_code;
37255
37256    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37257        mem_base = xmlMemBlocks();
37258        code = gen_int(n_code, 0);
37259
37260        ret_val = xmlUCSIsBraillePatterns(code);
37261        desret_int(ret_val);
37262        call_tests++;
37263        des_int(n_code, code, 0);
37264        xmlResetLastError();
37265        if (mem_base != xmlMemBlocks()) {
37266            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37267	           xmlMemBlocks() - mem_base);
37268	    test_ret++;
37269            printf(" %d", n_code);
37270            printf("\n");
37271        }
37272    }
37273    function_tests++;
37274#endif
37275
37276    return(test_ret);
37277}
37278
37279
37280static int
37281test_xmlUCSIsBuhid(void) {
37282    int test_ret = 0;
37283
37284#if defined(LIBXML_UNICODE_ENABLED)
37285    int mem_base;
37286    int ret_val;
37287    int code; /* UCS code point */
37288    int n_code;
37289
37290    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37291        mem_base = xmlMemBlocks();
37292        code = gen_int(n_code, 0);
37293
37294        ret_val = xmlUCSIsBuhid(code);
37295        desret_int(ret_val);
37296        call_tests++;
37297        des_int(n_code, code, 0);
37298        xmlResetLastError();
37299        if (mem_base != xmlMemBlocks()) {
37300            printf("Leak of %d blocks found in xmlUCSIsBuhid",
37301	           xmlMemBlocks() - mem_base);
37302	    test_ret++;
37303            printf(" %d", n_code);
37304            printf("\n");
37305        }
37306    }
37307    function_tests++;
37308#endif
37309
37310    return(test_ret);
37311}
37312
37313
37314static int
37315test_xmlUCSIsByzantineMusicalSymbols(void) {
37316    int test_ret = 0;
37317
37318#if defined(LIBXML_UNICODE_ENABLED)
37319    int mem_base;
37320    int ret_val;
37321    int code; /* UCS code point */
37322    int n_code;
37323
37324    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37325        mem_base = xmlMemBlocks();
37326        code = gen_int(n_code, 0);
37327
37328        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37329        desret_int(ret_val);
37330        call_tests++;
37331        des_int(n_code, code, 0);
37332        xmlResetLastError();
37333        if (mem_base != xmlMemBlocks()) {
37334            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37335	           xmlMemBlocks() - mem_base);
37336	    test_ret++;
37337            printf(" %d", n_code);
37338            printf("\n");
37339        }
37340    }
37341    function_tests++;
37342#endif
37343
37344    return(test_ret);
37345}
37346
37347
37348static int
37349test_xmlUCSIsCJKCompatibility(void) {
37350    int test_ret = 0;
37351
37352#if defined(LIBXML_UNICODE_ENABLED)
37353    int mem_base;
37354    int ret_val;
37355    int code; /* UCS code point */
37356    int n_code;
37357
37358    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37359        mem_base = xmlMemBlocks();
37360        code = gen_int(n_code, 0);
37361
37362        ret_val = xmlUCSIsCJKCompatibility(code);
37363        desret_int(ret_val);
37364        call_tests++;
37365        des_int(n_code, code, 0);
37366        xmlResetLastError();
37367        if (mem_base != xmlMemBlocks()) {
37368            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37369	           xmlMemBlocks() - mem_base);
37370	    test_ret++;
37371            printf(" %d", n_code);
37372            printf("\n");
37373        }
37374    }
37375    function_tests++;
37376#endif
37377
37378    return(test_ret);
37379}
37380
37381
37382static int
37383test_xmlUCSIsCJKCompatibilityForms(void) {
37384    int test_ret = 0;
37385
37386#if defined(LIBXML_UNICODE_ENABLED)
37387    int mem_base;
37388    int ret_val;
37389    int code; /* UCS code point */
37390    int n_code;
37391
37392    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37393        mem_base = xmlMemBlocks();
37394        code = gen_int(n_code, 0);
37395
37396        ret_val = xmlUCSIsCJKCompatibilityForms(code);
37397        desret_int(ret_val);
37398        call_tests++;
37399        des_int(n_code, code, 0);
37400        xmlResetLastError();
37401        if (mem_base != xmlMemBlocks()) {
37402            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37403	           xmlMemBlocks() - mem_base);
37404	    test_ret++;
37405            printf(" %d", n_code);
37406            printf("\n");
37407        }
37408    }
37409    function_tests++;
37410#endif
37411
37412    return(test_ret);
37413}
37414
37415
37416static int
37417test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37418    int test_ret = 0;
37419
37420#if defined(LIBXML_UNICODE_ENABLED)
37421    int mem_base;
37422    int ret_val;
37423    int code; /* UCS code point */
37424    int n_code;
37425
37426    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37427        mem_base = xmlMemBlocks();
37428        code = gen_int(n_code, 0);
37429
37430        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37431        desret_int(ret_val);
37432        call_tests++;
37433        des_int(n_code, code, 0);
37434        xmlResetLastError();
37435        if (mem_base != xmlMemBlocks()) {
37436            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37437	           xmlMemBlocks() - mem_base);
37438	    test_ret++;
37439            printf(" %d", n_code);
37440            printf("\n");
37441        }
37442    }
37443    function_tests++;
37444#endif
37445
37446    return(test_ret);
37447}
37448
37449
37450static int
37451test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37452    int test_ret = 0;
37453
37454#if defined(LIBXML_UNICODE_ENABLED)
37455    int mem_base;
37456    int ret_val;
37457    int code; /* UCS code point */
37458    int n_code;
37459
37460    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37461        mem_base = xmlMemBlocks();
37462        code = gen_int(n_code, 0);
37463
37464        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37465        desret_int(ret_val);
37466        call_tests++;
37467        des_int(n_code, code, 0);
37468        xmlResetLastError();
37469        if (mem_base != xmlMemBlocks()) {
37470            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37471	           xmlMemBlocks() - mem_base);
37472	    test_ret++;
37473            printf(" %d", n_code);
37474            printf("\n");
37475        }
37476    }
37477    function_tests++;
37478#endif
37479
37480    return(test_ret);
37481}
37482
37483
37484static int
37485test_xmlUCSIsCJKRadicalsSupplement(void) {
37486    int test_ret = 0;
37487
37488#if defined(LIBXML_UNICODE_ENABLED)
37489    int mem_base;
37490    int ret_val;
37491    int code; /* UCS code point */
37492    int n_code;
37493
37494    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37495        mem_base = xmlMemBlocks();
37496        code = gen_int(n_code, 0);
37497
37498        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37499        desret_int(ret_val);
37500        call_tests++;
37501        des_int(n_code, code, 0);
37502        xmlResetLastError();
37503        if (mem_base != xmlMemBlocks()) {
37504            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37505	           xmlMemBlocks() - mem_base);
37506	    test_ret++;
37507            printf(" %d", n_code);
37508            printf("\n");
37509        }
37510    }
37511    function_tests++;
37512#endif
37513
37514    return(test_ret);
37515}
37516
37517
37518static int
37519test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37520    int test_ret = 0;
37521
37522#if defined(LIBXML_UNICODE_ENABLED)
37523    int mem_base;
37524    int ret_val;
37525    int code; /* UCS code point */
37526    int n_code;
37527
37528    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37529        mem_base = xmlMemBlocks();
37530        code = gen_int(n_code, 0);
37531
37532        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37533        desret_int(ret_val);
37534        call_tests++;
37535        des_int(n_code, code, 0);
37536        xmlResetLastError();
37537        if (mem_base != xmlMemBlocks()) {
37538            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37539	           xmlMemBlocks() - mem_base);
37540	    test_ret++;
37541            printf(" %d", n_code);
37542            printf("\n");
37543        }
37544    }
37545    function_tests++;
37546#endif
37547
37548    return(test_ret);
37549}
37550
37551
37552static int
37553test_xmlUCSIsCJKUnifiedIdeographs(void) {
37554    int test_ret = 0;
37555
37556#if defined(LIBXML_UNICODE_ENABLED)
37557    int mem_base;
37558    int ret_val;
37559    int code; /* UCS code point */
37560    int n_code;
37561
37562    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37563        mem_base = xmlMemBlocks();
37564        code = gen_int(n_code, 0);
37565
37566        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37567        desret_int(ret_val);
37568        call_tests++;
37569        des_int(n_code, code, 0);
37570        xmlResetLastError();
37571        if (mem_base != xmlMemBlocks()) {
37572            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37573	           xmlMemBlocks() - mem_base);
37574	    test_ret++;
37575            printf(" %d", n_code);
37576            printf("\n");
37577        }
37578    }
37579    function_tests++;
37580#endif
37581
37582    return(test_ret);
37583}
37584
37585
37586static int
37587test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37588    int test_ret = 0;
37589
37590#if defined(LIBXML_UNICODE_ENABLED)
37591    int mem_base;
37592    int ret_val;
37593    int code; /* UCS code point */
37594    int n_code;
37595
37596    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37597        mem_base = xmlMemBlocks();
37598        code = gen_int(n_code, 0);
37599
37600        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37601        desret_int(ret_val);
37602        call_tests++;
37603        des_int(n_code, code, 0);
37604        xmlResetLastError();
37605        if (mem_base != xmlMemBlocks()) {
37606            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37607	           xmlMemBlocks() - mem_base);
37608	    test_ret++;
37609            printf(" %d", n_code);
37610            printf("\n");
37611        }
37612    }
37613    function_tests++;
37614#endif
37615
37616    return(test_ret);
37617}
37618
37619
37620static int
37621test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37622    int test_ret = 0;
37623
37624#if defined(LIBXML_UNICODE_ENABLED)
37625    int mem_base;
37626    int ret_val;
37627    int code; /* UCS code point */
37628    int n_code;
37629
37630    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37631        mem_base = xmlMemBlocks();
37632        code = gen_int(n_code, 0);
37633
37634        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37635        desret_int(ret_val);
37636        call_tests++;
37637        des_int(n_code, code, 0);
37638        xmlResetLastError();
37639        if (mem_base != xmlMemBlocks()) {
37640            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37641	           xmlMemBlocks() - mem_base);
37642	    test_ret++;
37643            printf(" %d", n_code);
37644            printf("\n");
37645        }
37646    }
37647    function_tests++;
37648#endif
37649
37650    return(test_ret);
37651}
37652
37653
37654static int
37655test_xmlUCSIsCat(void) {
37656    int test_ret = 0;
37657
37658#if defined(LIBXML_UNICODE_ENABLED)
37659    int mem_base;
37660    int ret_val;
37661    int code; /* UCS code point */
37662    int n_code;
37663    char * cat; /* UCS Category name */
37664    int n_cat;
37665
37666    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37667    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37668        mem_base = xmlMemBlocks();
37669        code = gen_int(n_code, 0);
37670        cat = gen_const_char_ptr(n_cat, 1);
37671
37672        ret_val = xmlUCSIsCat(code, (const char *)cat);
37673        desret_int(ret_val);
37674        call_tests++;
37675        des_int(n_code, code, 0);
37676        des_const_char_ptr(n_cat, (const char *)cat, 1);
37677        xmlResetLastError();
37678        if (mem_base != xmlMemBlocks()) {
37679            printf("Leak of %d blocks found in xmlUCSIsCat",
37680	           xmlMemBlocks() - mem_base);
37681	    test_ret++;
37682            printf(" %d", n_code);
37683            printf(" %d", n_cat);
37684            printf("\n");
37685        }
37686    }
37687    }
37688    function_tests++;
37689#endif
37690
37691    return(test_ret);
37692}
37693
37694
37695static int
37696test_xmlUCSIsCatC(void) {
37697    int test_ret = 0;
37698
37699#if defined(LIBXML_UNICODE_ENABLED)
37700    int mem_base;
37701    int ret_val;
37702    int code; /* UCS code point */
37703    int n_code;
37704
37705    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37706        mem_base = xmlMemBlocks();
37707        code = gen_int(n_code, 0);
37708
37709        ret_val = xmlUCSIsCatC(code);
37710        desret_int(ret_val);
37711        call_tests++;
37712        des_int(n_code, code, 0);
37713        xmlResetLastError();
37714        if (mem_base != xmlMemBlocks()) {
37715            printf("Leak of %d blocks found in xmlUCSIsCatC",
37716	           xmlMemBlocks() - mem_base);
37717	    test_ret++;
37718            printf(" %d", n_code);
37719            printf("\n");
37720        }
37721    }
37722    function_tests++;
37723#endif
37724
37725    return(test_ret);
37726}
37727
37728
37729static int
37730test_xmlUCSIsCatCc(void) {
37731    int test_ret = 0;
37732
37733#if defined(LIBXML_UNICODE_ENABLED)
37734    int mem_base;
37735    int ret_val;
37736    int code; /* UCS code point */
37737    int n_code;
37738
37739    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37740        mem_base = xmlMemBlocks();
37741        code = gen_int(n_code, 0);
37742
37743        ret_val = xmlUCSIsCatCc(code);
37744        desret_int(ret_val);
37745        call_tests++;
37746        des_int(n_code, code, 0);
37747        xmlResetLastError();
37748        if (mem_base != xmlMemBlocks()) {
37749            printf("Leak of %d blocks found in xmlUCSIsCatCc",
37750	           xmlMemBlocks() - mem_base);
37751	    test_ret++;
37752            printf(" %d", n_code);
37753            printf("\n");
37754        }
37755    }
37756    function_tests++;
37757#endif
37758
37759    return(test_ret);
37760}
37761
37762
37763static int
37764test_xmlUCSIsCatCf(void) {
37765    int test_ret = 0;
37766
37767#if defined(LIBXML_UNICODE_ENABLED)
37768    int mem_base;
37769    int ret_val;
37770    int code; /* UCS code point */
37771    int n_code;
37772
37773    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37774        mem_base = xmlMemBlocks();
37775        code = gen_int(n_code, 0);
37776
37777        ret_val = xmlUCSIsCatCf(code);
37778        desret_int(ret_val);
37779        call_tests++;
37780        des_int(n_code, code, 0);
37781        xmlResetLastError();
37782        if (mem_base != xmlMemBlocks()) {
37783            printf("Leak of %d blocks found in xmlUCSIsCatCf",
37784	           xmlMemBlocks() - mem_base);
37785	    test_ret++;
37786            printf(" %d", n_code);
37787            printf("\n");
37788        }
37789    }
37790    function_tests++;
37791#endif
37792
37793    return(test_ret);
37794}
37795
37796
37797static int
37798test_xmlUCSIsCatCo(void) {
37799    int test_ret = 0;
37800
37801#if defined(LIBXML_UNICODE_ENABLED)
37802    int mem_base;
37803    int ret_val;
37804    int code; /* UCS code point */
37805    int n_code;
37806
37807    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37808        mem_base = xmlMemBlocks();
37809        code = gen_int(n_code, 0);
37810
37811        ret_val = xmlUCSIsCatCo(code);
37812        desret_int(ret_val);
37813        call_tests++;
37814        des_int(n_code, code, 0);
37815        xmlResetLastError();
37816        if (mem_base != xmlMemBlocks()) {
37817            printf("Leak of %d blocks found in xmlUCSIsCatCo",
37818	           xmlMemBlocks() - mem_base);
37819	    test_ret++;
37820            printf(" %d", n_code);
37821            printf("\n");
37822        }
37823    }
37824    function_tests++;
37825#endif
37826
37827    return(test_ret);
37828}
37829
37830
37831static int
37832test_xmlUCSIsCatCs(void) {
37833    int test_ret = 0;
37834
37835#if defined(LIBXML_UNICODE_ENABLED)
37836    int mem_base;
37837    int ret_val;
37838    int code; /* UCS code point */
37839    int n_code;
37840
37841    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37842        mem_base = xmlMemBlocks();
37843        code = gen_int(n_code, 0);
37844
37845        ret_val = xmlUCSIsCatCs(code);
37846        desret_int(ret_val);
37847        call_tests++;
37848        des_int(n_code, code, 0);
37849        xmlResetLastError();
37850        if (mem_base != xmlMemBlocks()) {
37851            printf("Leak of %d blocks found in xmlUCSIsCatCs",
37852	           xmlMemBlocks() - mem_base);
37853	    test_ret++;
37854            printf(" %d", n_code);
37855            printf("\n");
37856        }
37857    }
37858    function_tests++;
37859#endif
37860
37861    return(test_ret);
37862}
37863
37864
37865static int
37866test_xmlUCSIsCatL(void) {
37867    int test_ret = 0;
37868
37869#if defined(LIBXML_UNICODE_ENABLED)
37870    int mem_base;
37871    int ret_val;
37872    int code; /* UCS code point */
37873    int n_code;
37874
37875    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37876        mem_base = xmlMemBlocks();
37877        code = gen_int(n_code, 0);
37878
37879        ret_val = xmlUCSIsCatL(code);
37880        desret_int(ret_val);
37881        call_tests++;
37882        des_int(n_code, code, 0);
37883        xmlResetLastError();
37884        if (mem_base != xmlMemBlocks()) {
37885            printf("Leak of %d blocks found in xmlUCSIsCatL",
37886	           xmlMemBlocks() - mem_base);
37887	    test_ret++;
37888            printf(" %d", n_code);
37889            printf("\n");
37890        }
37891    }
37892    function_tests++;
37893#endif
37894
37895    return(test_ret);
37896}
37897
37898
37899static int
37900test_xmlUCSIsCatLl(void) {
37901    int test_ret = 0;
37902
37903#if defined(LIBXML_UNICODE_ENABLED)
37904    int mem_base;
37905    int ret_val;
37906    int code; /* UCS code point */
37907    int n_code;
37908
37909    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37910        mem_base = xmlMemBlocks();
37911        code = gen_int(n_code, 0);
37912
37913        ret_val = xmlUCSIsCatLl(code);
37914        desret_int(ret_val);
37915        call_tests++;
37916        des_int(n_code, code, 0);
37917        xmlResetLastError();
37918        if (mem_base != xmlMemBlocks()) {
37919            printf("Leak of %d blocks found in xmlUCSIsCatLl",
37920	           xmlMemBlocks() - mem_base);
37921	    test_ret++;
37922            printf(" %d", n_code);
37923            printf("\n");
37924        }
37925    }
37926    function_tests++;
37927#endif
37928
37929    return(test_ret);
37930}
37931
37932
37933static int
37934test_xmlUCSIsCatLm(void) {
37935    int test_ret = 0;
37936
37937#if defined(LIBXML_UNICODE_ENABLED)
37938    int mem_base;
37939    int ret_val;
37940    int code; /* UCS code point */
37941    int n_code;
37942
37943    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37944        mem_base = xmlMemBlocks();
37945        code = gen_int(n_code, 0);
37946
37947        ret_val = xmlUCSIsCatLm(code);
37948        desret_int(ret_val);
37949        call_tests++;
37950        des_int(n_code, code, 0);
37951        xmlResetLastError();
37952        if (mem_base != xmlMemBlocks()) {
37953            printf("Leak of %d blocks found in xmlUCSIsCatLm",
37954	           xmlMemBlocks() - mem_base);
37955	    test_ret++;
37956            printf(" %d", n_code);
37957            printf("\n");
37958        }
37959    }
37960    function_tests++;
37961#endif
37962
37963    return(test_ret);
37964}
37965
37966
37967static int
37968test_xmlUCSIsCatLo(void) {
37969    int test_ret = 0;
37970
37971#if defined(LIBXML_UNICODE_ENABLED)
37972    int mem_base;
37973    int ret_val;
37974    int code; /* UCS code point */
37975    int n_code;
37976
37977    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37978        mem_base = xmlMemBlocks();
37979        code = gen_int(n_code, 0);
37980
37981        ret_val = xmlUCSIsCatLo(code);
37982        desret_int(ret_val);
37983        call_tests++;
37984        des_int(n_code, code, 0);
37985        xmlResetLastError();
37986        if (mem_base != xmlMemBlocks()) {
37987            printf("Leak of %d blocks found in xmlUCSIsCatLo",
37988	           xmlMemBlocks() - mem_base);
37989	    test_ret++;
37990            printf(" %d", n_code);
37991            printf("\n");
37992        }
37993    }
37994    function_tests++;
37995#endif
37996
37997    return(test_ret);
37998}
37999
38000
38001static int
38002test_xmlUCSIsCatLt(void) {
38003    int test_ret = 0;
38004
38005#if defined(LIBXML_UNICODE_ENABLED)
38006    int mem_base;
38007    int ret_val;
38008    int code; /* UCS code point */
38009    int n_code;
38010
38011    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38012        mem_base = xmlMemBlocks();
38013        code = gen_int(n_code, 0);
38014
38015        ret_val = xmlUCSIsCatLt(code);
38016        desret_int(ret_val);
38017        call_tests++;
38018        des_int(n_code, code, 0);
38019        xmlResetLastError();
38020        if (mem_base != xmlMemBlocks()) {
38021            printf("Leak of %d blocks found in xmlUCSIsCatLt",
38022	           xmlMemBlocks() - mem_base);
38023	    test_ret++;
38024            printf(" %d", n_code);
38025            printf("\n");
38026        }
38027    }
38028    function_tests++;
38029#endif
38030
38031    return(test_ret);
38032}
38033
38034
38035static int
38036test_xmlUCSIsCatLu(void) {
38037    int test_ret = 0;
38038
38039#if defined(LIBXML_UNICODE_ENABLED)
38040    int mem_base;
38041    int ret_val;
38042    int code; /* UCS code point */
38043    int n_code;
38044
38045    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38046        mem_base = xmlMemBlocks();
38047        code = gen_int(n_code, 0);
38048
38049        ret_val = xmlUCSIsCatLu(code);
38050        desret_int(ret_val);
38051        call_tests++;
38052        des_int(n_code, code, 0);
38053        xmlResetLastError();
38054        if (mem_base != xmlMemBlocks()) {
38055            printf("Leak of %d blocks found in xmlUCSIsCatLu",
38056	           xmlMemBlocks() - mem_base);
38057	    test_ret++;
38058            printf(" %d", n_code);
38059            printf("\n");
38060        }
38061    }
38062    function_tests++;
38063#endif
38064
38065    return(test_ret);
38066}
38067
38068
38069static int
38070test_xmlUCSIsCatM(void) {
38071    int test_ret = 0;
38072
38073#if defined(LIBXML_UNICODE_ENABLED)
38074    int mem_base;
38075    int ret_val;
38076    int code; /* UCS code point */
38077    int n_code;
38078
38079    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38080        mem_base = xmlMemBlocks();
38081        code = gen_int(n_code, 0);
38082
38083        ret_val = xmlUCSIsCatM(code);
38084        desret_int(ret_val);
38085        call_tests++;
38086        des_int(n_code, code, 0);
38087        xmlResetLastError();
38088        if (mem_base != xmlMemBlocks()) {
38089            printf("Leak of %d blocks found in xmlUCSIsCatM",
38090	           xmlMemBlocks() - mem_base);
38091	    test_ret++;
38092            printf(" %d", n_code);
38093            printf("\n");
38094        }
38095    }
38096    function_tests++;
38097#endif
38098
38099    return(test_ret);
38100}
38101
38102
38103static int
38104test_xmlUCSIsCatMc(void) {
38105    int test_ret = 0;
38106
38107#if defined(LIBXML_UNICODE_ENABLED)
38108    int mem_base;
38109    int ret_val;
38110    int code; /* UCS code point */
38111    int n_code;
38112
38113    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38114        mem_base = xmlMemBlocks();
38115        code = gen_int(n_code, 0);
38116
38117        ret_val = xmlUCSIsCatMc(code);
38118        desret_int(ret_val);
38119        call_tests++;
38120        des_int(n_code, code, 0);
38121        xmlResetLastError();
38122        if (mem_base != xmlMemBlocks()) {
38123            printf("Leak of %d blocks found in xmlUCSIsCatMc",
38124	           xmlMemBlocks() - mem_base);
38125	    test_ret++;
38126            printf(" %d", n_code);
38127            printf("\n");
38128        }
38129    }
38130    function_tests++;
38131#endif
38132
38133    return(test_ret);
38134}
38135
38136
38137static int
38138test_xmlUCSIsCatMe(void) {
38139    int test_ret = 0;
38140
38141#if defined(LIBXML_UNICODE_ENABLED)
38142    int mem_base;
38143    int ret_val;
38144    int code; /* UCS code point */
38145    int n_code;
38146
38147    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38148        mem_base = xmlMemBlocks();
38149        code = gen_int(n_code, 0);
38150
38151        ret_val = xmlUCSIsCatMe(code);
38152        desret_int(ret_val);
38153        call_tests++;
38154        des_int(n_code, code, 0);
38155        xmlResetLastError();
38156        if (mem_base != xmlMemBlocks()) {
38157            printf("Leak of %d blocks found in xmlUCSIsCatMe",
38158	           xmlMemBlocks() - mem_base);
38159	    test_ret++;
38160            printf(" %d", n_code);
38161            printf("\n");
38162        }
38163    }
38164    function_tests++;
38165#endif
38166
38167    return(test_ret);
38168}
38169
38170
38171static int
38172test_xmlUCSIsCatMn(void) {
38173    int test_ret = 0;
38174
38175#if defined(LIBXML_UNICODE_ENABLED)
38176    int mem_base;
38177    int ret_val;
38178    int code; /* UCS code point */
38179    int n_code;
38180
38181    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38182        mem_base = xmlMemBlocks();
38183        code = gen_int(n_code, 0);
38184
38185        ret_val = xmlUCSIsCatMn(code);
38186        desret_int(ret_val);
38187        call_tests++;
38188        des_int(n_code, code, 0);
38189        xmlResetLastError();
38190        if (mem_base != xmlMemBlocks()) {
38191            printf("Leak of %d blocks found in xmlUCSIsCatMn",
38192	           xmlMemBlocks() - mem_base);
38193	    test_ret++;
38194            printf(" %d", n_code);
38195            printf("\n");
38196        }
38197    }
38198    function_tests++;
38199#endif
38200
38201    return(test_ret);
38202}
38203
38204
38205static int
38206test_xmlUCSIsCatN(void) {
38207    int test_ret = 0;
38208
38209#if defined(LIBXML_UNICODE_ENABLED)
38210    int mem_base;
38211    int ret_val;
38212    int code; /* UCS code point */
38213    int n_code;
38214
38215    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38216        mem_base = xmlMemBlocks();
38217        code = gen_int(n_code, 0);
38218
38219        ret_val = xmlUCSIsCatN(code);
38220        desret_int(ret_val);
38221        call_tests++;
38222        des_int(n_code, code, 0);
38223        xmlResetLastError();
38224        if (mem_base != xmlMemBlocks()) {
38225            printf("Leak of %d blocks found in xmlUCSIsCatN",
38226	           xmlMemBlocks() - mem_base);
38227	    test_ret++;
38228            printf(" %d", n_code);
38229            printf("\n");
38230        }
38231    }
38232    function_tests++;
38233#endif
38234
38235    return(test_ret);
38236}
38237
38238
38239static int
38240test_xmlUCSIsCatNd(void) {
38241    int test_ret = 0;
38242
38243#if defined(LIBXML_UNICODE_ENABLED)
38244    int mem_base;
38245    int ret_val;
38246    int code; /* UCS code point */
38247    int n_code;
38248
38249    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38250        mem_base = xmlMemBlocks();
38251        code = gen_int(n_code, 0);
38252
38253        ret_val = xmlUCSIsCatNd(code);
38254        desret_int(ret_val);
38255        call_tests++;
38256        des_int(n_code, code, 0);
38257        xmlResetLastError();
38258        if (mem_base != xmlMemBlocks()) {
38259            printf("Leak of %d blocks found in xmlUCSIsCatNd",
38260	           xmlMemBlocks() - mem_base);
38261	    test_ret++;
38262            printf(" %d", n_code);
38263            printf("\n");
38264        }
38265    }
38266    function_tests++;
38267#endif
38268
38269    return(test_ret);
38270}
38271
38272
38273static int
38274test_xmlUCSIsCatNl(void) {
38275    int test_ret = 0;
38276
38277#if defined(LIBXML_UNICODE_ENABLED)
38278    int mem_base;
38279    int ret_val;
38280    int code; /* UCS code point */
38281    int n_code;
38282
38283    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38284        mem_base = xmlMemBlocks();
38285        code = gen_int(n_code, 0);
38286
38287        ret_val = xmlUCSIsCatNl(code);
38288        desret_int(ret_val);
38289        call_tests++;
38290        des_int(n_code, code, 0);
38291        xmlResetLastError();
38292        if (mem_base != xmlMemBlocks()) {
38293            printf("Leak of %d blocks found in xmlUCSIsCatNl",
38294	           xmlMemBlocks() - mem_base);
38295	    test_ret++;
38296            printf(" %d", n_code);
38297            printf("\n");
38298        }
38299    }
38300    function_tests++;
38301#endif
38302
38303    return(test_ret);
38304}
38305
38306
38307static int
38308test_xmlUCSIsCatNo(void) {
38309    int test_ret = 0;
38310
38311#if defined(LIBXML_UNICODE_ENABLED)
38312    int mem_base;
38313    int ret_val;
38314    int code; /* UCS code point */
38315    int n_code;
38316
38317    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38318        mem_base = xmlMemBlocks();
38319        code = gen_int(n_code, 0);
38320
38321        ret_val = xmlUCSIsCatNo(code);
38322        desret_int(ret_val);
38323        call_tests++;
38324        des_int(n_code, code, 0);
38325        xmlResetLastError();
38326        if (mem_base != xmlMemBlocks()) {
38327            printf("Leak of %d blocks found in xmlUCSIsCatNo",
38328	           xmlMemBlocks() - mem_base);
38329	    test_ret++;
38330            printf(" %d", n_code);
38331            printf("\n");
38332        }
38333    }
38334    function_tests++;
38335#endif
38336
38337    return(test_ret);
38338}
38339
38340
38341static int
38342test_xmlUCSIsCatP(void) {
38343    int test_ret = 0;
38344
38345#if defined(LIBXML_UNICODE_ENABLED)
38346    int mem_base;
38347    int ret_val;
38348    int code; /* UCS code point */
38349    int n_code;
38350
38351    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38352        mem_base = xmlMemBlocks();
38353        code = gen_int(n_code, 0);
38354
38355        ret_val = xmlUCSIsCatP(code);
38356        desret_int(ret_val);
38357        call_tests++;
38358        des_int(n_code, code, 0);
38359        xmlResetLastError();
38360        if (mem_base != xmlMemBlocks()) {
38361            printf("Leak of %d blocks found in xmlUCSIsCatP",
38362	           xmlMemBlocks() - mem_base);
38363	    test_ret++;
38364            printf(" %d", n_code);
38365            printf("\n");
38366        }
38367    }
38368    function_tests++;
38369#endif
38370
38371    return(test_ret);
38372}
38373
38374
38375static int
38376test_xmlUCSIsCatPc(void) {
38377    int test_ret = 0;
38378
38379#if defined(LIBXML_UNICODE_ENABLED)
38380    int mem_base;
38381    int ret_val;
38382    int code; /* UCS code point */
38383    int n_code;
38384
38385    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38386        mem_base = xmlMemBlocks();
38387        code = gen_int(n_code, 0);
38388
38389        ret_val = xmlUCSIsCatPc(code);
38390        desret_int(ret_val);
38391        call_tests++;
38392        des_int(n_code, code, 0);
38393        xmlResetLastError();
38394        if (mem_base != xmlMemBlocks()) {
38395            printf("Leak of %d blocks found in xmlUCSIsCatPc",
38396	           xmlMemBlocks() - mem_base);
38397	    test_ret++;
38398            printf(" %d", n_code);
38399            printf("\n");
38400        }
38401    }
38402    function_tests++;
38403#endif
38404
38405    return(test_ret);
38406}
38407
38408
38409static int
38410test_xmlUCSIsCatPd(void) {
38411    int test_ret = 0;
38412
38413#if defined(LIBXML_UNICODE_ENABLED)
38414    int mem_base;
38415    int ret_val;
38416    int code; /* UCS code point */
38417    int n_code;
38418
38419    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38420        mem_base = xmlMemBlocks();
38421        code = gen_int(n_code, 0);
38422
38423        ret_val = xmlUCSIsCatPd(code);
38424        desret_int(ret_val);
38425        call_tests++;
38426        des_int(n_code, code, 0);
38427        xmlResetLastError();
38428        if (mem_base != xmlMemBlocks()) {
38429            printf("Leak of %d blocks found in xmlUCSIsCatPd",
38430	           xmlMemBlocks() - mem_base);
38431	    test_ret++;
38432            printf(" %d", n_code);
38433            printf("\n");
38434        }
38435    }
38436    function_tests++;
38437#endif
38438
38439    return(test_ret);
38440}
38441
38442
38443static int
38444test_xmlUCSIsCatPe(void) {
38445    int test_ret = 0;
38446
38447#if defined(LIBXML_UNICODE_ENABLED)
38448    int mem_base;
38449    int ret_val;
38450    int code; /* UCS code point */
38451    int n_code;
38452
38453    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38454        mem_base = xmlMemBlocks();
38455        code = gen_int(n_code, 0);
38456
38457        ret_val = xmlUCSIsCatPe(code);
38458        desret_int(ret_val);
38459        call_tests++;
38460        des_int(n_code, code, 0);
38461        xmlResetLastError();
38462        if (mem_base != xmlMemBlocks()) {
38463            printf("Leak of %d blocks found in xmlUCSIsCatPe",
38464	           xmlMemBlocks() - mem_base);
38465	    test_ret++;
38466            printf(" %d", n_code);
38467            printf("\n");
38468        }
38469    }
38470    function_tests++;
38471#endif
38472
38473    return(test_ret);
38474}
38475
38476
38477static int
38478test_xmlUCSIsCatPf(void) {
38479    int test_ret = 0;
38480
38481#if defined(LIBXML_UNICODE_ENABLED)
38482    int mem_base;
38483    int ret_val;
38484    int code; /* UCS code point */
38485    int n_code;
38486
38487    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38488        mem_base = xmlMemBlocks();
38489        code = gen_int(n_code, 0);
38490
38491        ret_val = xmlUCSIsCatPf(code);
38492        desret_int(ret_val);
38493        call_tests++;
38494        des_int(n_code, code, 0);
38495        xmlResetLastError();
38496        if (mem_base != xmlMemBlocks()) {
38497            printf("Leak of %d blocks found in xmlUCSIsCatPf",
38498	           xmlMemBlocks() - mem_base);
38499	    test_ret++;
38500            printf(" %d", n_code);
38501            printf("\n");
38502        }
38503    }
38504    function_tests++;
38505#endif
38506
38507    return(test_ret);
38508}
38509
38510
38511static int
38512test_xmlUCSIsCatPi(void) {
38513    int test_ret = 0;
38514
38515#if defined(LIBXML_UNICODE_ENABLED)
38516    int mem_base;
38517    int ret_val;
38518    int code; /* UCS code point */
38519    int n_code;
38520
38521    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38522        mem_base = xmlMemBlocks();
38523        code = gen_int(n_code, 0);
38524
38525        ret_val = xmlUCSIsCatPi(code);
38526        desret_int(ret_val);
38527        call_tests++;
38528        des_int(n_code, code, 0);
38529        xmlResetLastError();
38530        if (mem_base != xmlMemBlocks()) {
38531            printf("Leak of %d blocks found in xmlUCSIsCatPi",
38532	           xmlMemBlocks() - mem_base);
38533	    test_ret++;
38534            printf(" %d", n_code);
38535            printf("\n");
38536        }
38537    }
38538    function_tests++;
38539#endif
38540
38541    return(test_ret);
38542}
38543
38544
38545static int
38546test_xmlUCSIsCatPo(void) {
38547    int test_ret = 0;
38548
38549#if defined(LIBXML_UNICODE_ENABLED)
38550    int mem_base;
38551    int ret_val;
38552    int code; /* UCS code point */
38553    int n_code;
38554
38555    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38556        mem_base = xmlMemBlocks();
38557        code = gen_int(n_code, 0);
38558
38559        ret_val = xmlUCSIsCatPo(code);
38560        desret_int(ret_val);
38561        call_tests++;
38562        des_int(n_code, code, 0);
38563        xmlResetLastError();
38564        if (mem_base != xmlMemBlocks()) {
38565            printf("Leak of %d blocks found in xmlUCSIsCatPo",
38566	           xmlMemBlocks() - mem_base);
38567	    test_ret++;
38568            printf(" %d", n_code);
38569            printf("\n");
38570        }
38571    }
38572    function_tests++;
38573#endif
38574
38575    return(test_ret);
38576}
38577
38578
38579static int
38580test_xmlUCSIsCatPs(void) {
38581    int test_ret = 0;
38582
38583#if defined(LIBXML_UNICODE_ENABLED)
38584    int mem_base;
38585    int ret_val;
38586    int code; /* UCS code point */
38587    int n_code;
38588
38589    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38590        mem_base = xmlMemBlocks();
38591        code = gen_int(n_code, 0);
38592
38593        ret_val = xmlUCSIsCatPs(code);
38594        desret_int(ret_val);
38595        call_tests++;
38596        des_int(n_code, code, 0);
38597        xmlResetLastError();
38598        if (mem_base != xmlMemBlocks()) {
38599            printf("Leak of %d blocks found in xmlUCSIsCatPs",
38600	           xmlMemBlocks() - mem_base);
38601	    test_ret++;
38602            printf(" %d", n_code);
38603            printf("\n");
38604        }
38605    }
38606    function_tests++;
38607#endif
38608
38609    return(test_ret);
38610}
38611
38612
38613static int
38614test_xmlUCSIsCatS(void) {
38615    int test_ret = 0;
38616
38617#if defined(LIBXML_UNICODE_ENABLED)
38618    int mem_base;
38619    int ret_val;
38620    int code; /* UCS code point */
38621    int n_code;
38622
38623    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38624        mem_base = xmlMemBlocks();
38625        code = gen_int(n_code, 0);
38626
38627        ret_val = xmlUCSIsCatS(code);
38628        desret_int(ret_val);
38629        call_tests++;
38630        des_int(n_code, code, 0);
38631        xmlResetLastError();
38632        if (mem_base != xmlMemBlocks()) {
38633            printf("Leak of %d blocks found in xmlUCSIsCatS",
38634	           xmlMemBlocks() - mem_base);
38635	    test_ret++;
38636            printf(" %d", n_code);
38637            printf("\n");
38638        }
38639    }
38640    function_tests++;
38641#endif
38642
38643    return(test_ret);
38644}
38645
38646
38647static int
38648test_xmlUCSIsCatSc(void) {
38649    int test_ret = 0;
38650
38651#if defined(LIBXML_UNICODE_ENABLED)
38652    int mem_base;
38653    int ret_val;
38654    int code; /* UCS code point */
38655    int n_code;
38656
38657    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38658        mem_base = xmlMemBlocks();
38659        code = gen_int(n_code, 0);
38660
38661        ret_val = xmlUCSIsCatSc(code);
38662        desret_int(ret_val);
38663        call_tests++;
38664        des_int(n_code, code, 0);
38665        xmlResetLastError();
38666        if (mem_base != xmlMemBlocks()) {
38667            printf("Leak of %d blocks found in xmlUCSIsCatSc",
38668	           xmlMemBlocks() - mem_base);
38669	    test_ret++;
38670            printf(" %d", n_code);
38671            printf("\n");
38672        }
38673    }
38674    function_tests++;
38675#endif
38676
38677    return(test_ret);
38678}
38679
38680
38681static int
38682test_xmlUCSIsCatSk(void) {
38683    int test_ret = 0;
38684
38685#if defined(LIBXML_UNICODE_ENABLED)
38686    int mem_base;
38687    int ret_val;
38688    int code; /* UCS code point */
38689    int n_code;
38690
38691    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38692        mem_base = xmlMemBlocks();
38693        code = gen_int(n_code, 0);
38694
38695        ret_val = xmlUCSIsCatSk(code);
38696        desret_int(ret_val);
38697        call_tests++;
38698        des_int(n_code, code, 0);
38699        xmlResetLastError();
38700        if (mem_base != xmlMemBlocks()) {
38701            printf("Leak of %d blocks found in xmlUCSIsCatSk",
38702	           xmlMemBlocks() - mem_base);
38703	    test_ret++;
38704            printf(" %d", n_code);
38705            printf("\n");
38706        }
38707    }
38708    function_tests++;
38709#endif
38710
38711    return(test_ret);
38712}
38713
38714
38715static int
38716test_xmlUCSIsCatSm(void) {
38717    int test_ret = 0;
38718
38719#if defined(LIBXML_UNICODE_ENABLED)
38720    int mem_base;
38721    int ret_val;
38722    int code; /* UCS code point */
38723    int n_code;
38724
38725    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38726        mem_base = xmlMemBlocks();
38727        code = gen_int(n_code, 0);
38728
38729        ret_val = xmlUCSIsCatSm(code);
38730        desret_int(ret_val);
38731        call_tests++;
38732        des_int(n_code, code, 0);
38733        xmlResetLastError();
38734        if (mem_base != xmlMemBlocks()) {
38735            printf("Leak of %d blocks found in xmlUCSIsCatSm",
38736	           xmlMemBlocks() - mem_base);
38737	    test_ret++;
38738            printf(" %d", n_code);
38739            printf("\n");
38740        }
38741    }
38742    function_tests++;
38743#endif
38744
38745    return(test_ret);
38746}
38747
38748
38749static int
38750test_xmlUCSIsCatSo(void) {
38751    int test_ret = 0;
38752
38753#if defined(LIBXML_UNICODE_ENABLED)
38754    int mem_base;
38755    int ret_val;
38756    int code; /* UCS code point */
38757    int n_code;
38758
38759    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38760        mem_base = xmlMemBlocks();
38761        code = gen_int(n_code, 0);
38762
38763        ret_val = xmlUCSIsCatSo(code);
38764        desret_int(ret_val);
38765        call_tests++;
38766        des_int(n_code, code, 0);
38767        xmlResetLastError();
38768        if (mem_base != xmlMemBlocks()) {
38769            printf("Leak of %d blocks found in xmlUCSIsCatSo",
38770	           xmlMemBlocks() - mem_base);
38771	    test_ret++;
38772            printf(" %d", n_code);
38773            printf("\n");
38774        }
38775    }
38776    function_tests++;
38777#endif
38778
38779    return(test_ret);
38780}
38781
38782
38783static int
38784test_xmlUCSIsCatZ(void) {
38785    int test_ret = 0;
38786
38787#if defined(LIBXML_UNICODE_ENABLED)
38788    int mem_base;
38789    int ret_val;
38790    int code; /* UCS code point */
38791    int n_code;
38792
38793    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38794        mem_base = xmlMemBlocks();
38795        code = gen_int(n_code, 0);
38796
38797        ret_val = xmlUCSIsCatZ(code);
38798        desret_int(ret_val);
38799        call_tests++;
38800        des_int(n_code, code, 0);
38801        xmlResetLastError();
38802        if (mem_base != xmlMemBlocks()) {
38803            printf("Leak of %d blocks found in xmlUCSIsCatZ",
38804	           xmlMemBlocks() - mem_base);
38805	    test_ret++;
38806            printf(" %d", n_code);
38807            printf("\n");
38808        }
38809    }
38810    function_tests++;
38811#endif
38812
38813    return(test_ret);
38814}
38815
38816
38817static int
38818test_xmlUCSIsCatZl(void) {
38819    int test_ret = 0;
38820
38821#if defined(LIBXML_UNICODE_ENABLED)
38822    int mem_base;
38823    int ret_val;
38824    int code; /* UCS code point */
38825    int n_code;
38826
38827    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38828        mem_base = xmlMemBlocks();
38829        code = gen_int(n_code, 0);
38830
38831        ret_val = xmlUCSIsCatZl(code);
38832        desret_int(ret_val);
38833        call_tests++;
38834        des_int(n_code, code, 0);
38835        xmlResetLastError();
38836        if (mem_base != xmlMemBlocks()) {
38837            printf("Leak of %d blocks found in xmlUCSIsCatZl",
38838	           xmlMemBlocks() - mem_base);
38839	    test_ret++;
38840            printf(" %d", n_code);
38841            printf("\n");
38842        }
38843    }
38844    function_tests++;
38845#endif
38846
38847    return(test_ret);
38848}
38849
38850
38851static int
38852test_xmlUCSIsCatZp(void) {
38853    int test_ret = 0;
38854
38855#if defined(LIBXML_UNICODE_ENABLED)
38856    int mem_base;
38857    int ret_val;
38858    int code; /* UCS code point */
38859    int n_code;
38860
38861    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38862        mem_base = xmlMemBlocks();
38863        code = gen_int(n_code, 0);
38864
38865        ret_val = xmlUCSIsCatZp(code);
38866        desret_int(ret_val);
38867        call_tests++;
38868        des_int(n_code, code, 0);
38869        xmlResetLastError();
38870        if (mem_base != xmlMemBlocks()) {
38871            printf("Leak of %d blocks found in xmlUCSIsCatZp",
38872	           xmlMemBlocks() - mem_base);
38873	    test_ret++;
38874            printf(" %d", n_code);
38875            printf("\n");
38876        }
38877    }
38878    function_tests++;
38879#endif
38880
38881    return(test_ret);
38882}
38883
38884
38885static int
38886test_xmlUCSIsCatZs(void) {
38887    int test_ret = 0;
38888
38889#if defined(LIBXML_UNICODE_ENABLED)
38890    int mem_base;
38891    int ret_val;
38892    int code; /* UCS code point */
38893    int n_code;
38894
38895    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38896        mem_base = xmlMemBlocks();
38897        code = gen_int(n_code, 0);
38898
38899        ret_val = xmlUCSIsCatZs(code);
38900        desret_int(ret_val);
38901        call_tests++;
38902        des_int(n_code, code, 0);
38903        xmlResetLastError();
38904        if (mem_base != xmlMemBlocks()) {
38905            printf("Leak of %d blocks found in xmlUCSIsCatZs",
38906	           xmlMemBlocks() - mem_base);
38907	    test_ret++;
38908            printf(" %d", n_code);
38909            printf("\n");
38910        }
38911    }
38912    function_tests++;
38913#endif
38914
38915    return(test_ret);
38916}
38917
38918
38919static int
38920test_xmlUCSIsCherokee(void) {
38921    int test_ret = 0;
38922
38923#if defined(LIBXML_UNICODE_ENABLED)
38924    int mem_base;
38925    int ret_val;
38926    int code; /* UCS code point */
38927    int n_code;
38928
38929    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38930        mem_base = xmlMemBlocks();
38931        code = gen_int(n_code, 0);
38932
38933        ret_val = xmlUCSIsCherokee(code);
38934        desret_int(ret_val);
38935        call_tests++;
38936        des_int(n_code, code, 0);
38937        xmlResetLastError();
38938        if (mem_base != xmlMemBlocks()) {
38939            printf("Leak of %d blocks found in xmlUCSIsCherokee",
38940	           xmlMemBlocks() - mem_base);
38941	    test_ret++;
38942            printf(" %d", n_code);
38943            printf("\n");
38944        }
38945    }
38946    function_tests++;
38947#endif
38948
38949    return(test_ret);
38950}
38951
38952
38953static int
38954test_xmlUCSIsCombiningDiacriticalMarks(void) {
38955    int test_ret = 0;
38956
38957#if defined(LIBXML_UNICODE_ENABLED)
38958    int mem_base;
38959    int ret_val;
38960    int code; /* UCS code point */
38961    int n_code;
38962
38963    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38964        mem_base = xmlMemBlocks();
38965        code = gen_int(n_code, 0);
38966
38967        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
38968        desret_int(ret_val);
38969        call_tests++;
38970        des_int(n_code, code, 0);
38971        xmlResetLastError();
38972        if (mem_base != xmlMemBlocks()) {
38973            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
38974	           xmlMemBlocks() - mem_base);
38975	    test_ret++;
38976            printf(" %d", n_code);
38977            printf("\n");
38978        }
38979    }
38980    function_tests++;
38981#endif
38982
38983    return(test_ret);
38984}
38985
38986
38987static int
38988test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
38989    int test_ret = 0;
38990
38991#if defined(LIBXML_UNICODE_ENABLED)
38992    int mem_base;
38993    int ret_val;
38994    int code; /* UCS code point */
38995    int n_code;
38996
38997    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38998        mem_base = xmlMemBlocks();
38999        code = gen_int(n_code, 0);
39000
39001        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39002        desret_int(ret_val);
39003        call_tests++;
39004        des_int(n_code, code, 0);
39005        xmlResetLastError();
39006        if (mem_base != xmlMemBlocks()) {
39007            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39008	           xmlMemBlocks() - mem_base);
39009	    test_ret++;
39010            printf(" %d", n_code);
39011            printf("\n");
39012        }
39013    }
39014    function_tests++;
39015#endif
39016
39017    return(test_ret);
39018}
39019
39020
39021static int
39022test_xmlUCSIsCombiningHalfMarks(void) {
39023    int test_ret = 0;
39024
39025#if defined(LIBXML_UNICODE_ENABLED)
39026    int mem_base;
39027    int ret_val;
39028    int code; /* UCS code point */
39029    int n_code;
39030
39031    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39032        mem_base = xmlMemBlocks();
39033        code = gen_int(n_code, 0);
39034
39035        ret_val = xmlUCSIsCombiningHalfMarks(code);
39036        desret_int(ret_val);
39037        call_tests++;
39038        des_int(n_code, code, 0);
39039        xmlResetLastError();
39040        if (mem_base != xmlMemBlocks()) {
39041            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39042	           xmlMemBlocks() - mem_base);
39043	    test_ret++;
39044            printf(" %d", n_code);
39045            printf("\n");
39046        }
39047    }
39048    function_tests++;
39049#endif
39050
39051    return(test_ret);
39052}
39053
39054
39055static int
39056test_xmlUCSIsCombiningMarksforSymbols(void) {
39057    int test_ret = 0;
39058
39059#if defined(LIBXML_UNICODE_ENABLED)
39060    int mem_base;
39061    int ret_val;
39062    int code; /* UCS code point */
39063    int n_code;
39064
39065    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39066        mem_base = xmlMemBlocks();
39067        code = gen_int(n_code, 0);
39068
39069        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39070        desret_int(ret_val);
39071        call_tests++;
39072        des_int(n_code, code, 0);
39073        xmlResetLastError();
39074        if (mem_base != xmlMemBlocks()) {
39075            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39076	           xmlMemBlocks() - mem_base);
39077	    test_ret++;
39078            printf(" %d", n_code);
39079            printf("\n");
39080        }
39081    }
39082    function_tests++;
39083#endif
39084
39085    return(test_ret);
39086}
39087
39088
39089static int
39090test_xmlUCSIsControlPictures(void) {
39091    int test_ret = 0;
39092
39093#if defined(LIBXML_UNICODE_ENABLED)
39094    int mem_base;
39095    int ret_val;
39096    int code; /* UCS code point */
39097    int n_code;
39098
39099    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39100        mem_base = xmlMemBlocks();
39101        code = gen_int(n_code, 0);
39102
39103        ret_val = xmlUCSIsControlPictures(code);
39104        desret_int(ret_val);
39105        call_tests++;
39106        des_int(n_code, code, 0);
39107        xmlResetLastError();
39108        if (mem_base != xmlMemBlocks()) {
39109            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39110	           xmlMemBlocks() - mem_base);
39111	    test_ret++;
39112            printf(" %d", n_code);
39113            printf("\n");
39114        }
39115    }
39116    function_tests++;
39117#endif
39118
39119    return(test_ret);
39120}
39121
39122
39123static int
39124test_xmlUCSIsCurrencySymbols(void) {
39125    int test_ret = 0;
39126
39127#if defined(LIBXML_UNICODE_ENABLED)
39128    int mem_base;
39129    int ret_val;
39130    int code; /* UCS code point */
39131    int n_code;
39132
39133    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39134        mem_base = xmlMemBlocks();
39135        code = gen_int(n_code, 0);
39136
39137        ret_val = xmlUCSIsCurrencySymbols(code);
39138        desret_int(ret_val);
39139        call_tests++;
39140        des_int(n_code, code, 0);
39141        xmlResetLastError();
39142        if (mem_base != xmlMemBlocks()) {
39143            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39144	           xmlMemBlocks() - mem_base);
39145	    test_ret++;
39146            printf(" %d", n_code);
39147            printf("\n");
39148        }
39149    }
39150    function_tests++;
39151#endif
39152
39153    return(test_ret);
39154}
39155
39156
39157static int
39158test_xmlUCSIsCypriotSyllabary(void) {
39159    int test_ret = 0;
39160
39161#if defined(LIBXML_UNICODE_ENABLED)
39162    int mem_base;
39163    int ret_val;
39164    int code; /* UCS code point */
39165    int n_code;
39166
39167    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39168        mem_base = xmlMemBlocks();
39169        code = gen_int(n_code, 0);
39170
39171        ret_val = xmlUCSIsCypriotSyllabary(code);
39172        desret_int(ret_val);
39173        call_tests++;
39174        des_int(n_code, code, 0);
39175        xmlResetLastError();
39176        if (mem_base != xmlMemBlocks()) {
39177            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39178	           xmlMemBlocks() - mem_base);
39179	    test_ret++;
39180            printf(" %d", n_code);
39181            printf("\n");
39182        }
39183    }
39184    function_tests++;
39185#endif
39186
39187    return(test_ret);
39188}
39189
39190
39191static int
39192test_xmlUCSIsCyrillic(void) {
39193    int test_ret = 0;
39194
39195#if defined(LIBXML_UNICODE_ENABLED)
39196    int mem_base;
39197    int ret_val;
39198    int code; /* UCS code point */
39199    int n_code;
39200
39201    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39202        mem_base = xmlMemBlocks();
39203        code = gen_int(n_code, 0);
39204
39205        ret_val = xmlUCSIsCyrillic(code);
39206        desret_int(ret_val);
39207        call_tests++;
39208        des_int(n_code, code, 0);
39209        xmlResetLastError();
39210        if (mem_base != xmlMemBlocks()) {
39211            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39212	           xmlMemBlocks() - mem_base);
39213	    test_ret++;
39214            printf(" %d", n_code);
39215            printf("\n");
39216        }
39217    }
39218    function_tests++;
39219#endif
39220
39221    return(test_ret);
39222}
39223
39224
39225static int
39226test_xmlUCSIsCyrillicSupplement(void) {
39227    int test_ret = 0;
39228
39229#if defined(LIBXML_UNICODE_ENABLED)
39230    int mem_base;
39231    int ret_val;
39232    int code; /* UCS code point */
39233    int n_code;
39234
39235    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39236        mem_base = xmlMemBlocks();
39237        code = gen_int(n_code, 0);
39238
39239        ret_val = xmlUCSIsCyrillicSupplement(code);
39240        desret_int(ret_val);
39241        call_tests++;
39242        des_int(n_code, code, 0);
39243        xmlResetLastError();
39244        if (mem_base != xmlMemBlocks()) {
39245            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39246	           xmlMemBlocks() - mem_base);
39247	    test_ret++;
39248            printf(" %d", n_code);
39249            printf("\n");
39250        }
39251    }
39252    function_tests++;
39253#endif
39254
39255    return(test_ret);
39256}
39257
39258
39259static int
39260test_xmlUCSIsDeseret(void) {
39261    int test_ret = 0;
39262
39263#if defined(LIBXML_UNICODE_ENABLED)
39264    int mem_base;
39265    int ret_val;
39266    int code; /* UCS code point */
39267    int n_code;
39268
39269    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39270        mem_base = xmlMemBlocks();
39271        code = gen_int(n_code, 0);
39272
39273        ret_val = xmlUCSIsDeseret(code);
39274        desret_int(ret_val);
39275        call_tests++;
39276        des_int(n_code, code, 0);
39277        xmlResetLastError();
39278        if (mem_base != xmlMemBlocks()) {
39279            printf("Leak of %d blocks found in xmlUCSIsDeseret",
39280	           xmlMemBlocks() - mem_base);
39281	    test_ret++;
39282            printf(" %d", n_code);
39283            printf("\n");
39284        }
39285    }
39286    function_tests++;
39287#endif
39288
39289    return(test_ret);
39290}
39291
39292
39293static int
39294test_xmlUCSIsDevanagari(void) {
39295    int test_ret = 0;
39296
39297#if defined(LIBXML_UNICODE_ENABLED)
39298    int mem_base;
39299    int ret_val;
39300    int code; /* UCS code point */
39301    int n_code;
39302
39303    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39304        mem_base = xmlMemBlocks();
39305        code = gen_int(n_code, 0);
39306
39307        ret_val = xmlUCSIsDevanagari(code);
39308        desret_int(ret_val);
39309        call_tests++;
39310        des_int(n_code, code, 0);
39311        xmlResetLastError();
39312        if (mem_base != xmlMemBlocks()) {
39313            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39314	           xmlMemBlocks() - mem_base);
39315	    test_ret++;
39316            printf(" %d", n_code);
39317            printf("\n");
39318        }
39319    }
39320    function_tests++;
39321#endif
39322
39323    return(test_ret);
39324}
39325
39326
39327static int
39328test_xmlUCSIsDingbats(void) {
39329    int test_ret = 0;
39330
39331#if defined(LIBXML_UNICODE_ENABLED)
39332    int mem_base;
39333    int ret_val;
39334    int code; /* UCS code point */
39335    int n_code;
39336
39337    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39338        mem_base = xmlMemBlocks();
39339        code = gen_int(n_code, 0);
39340
39341        ret_val = xmlUCSIsDingbats(code);
39342        desret_int(ret_val);
39343        call_tests++;
39344        des_int(n_code, code, 0);
39345        xmlResetLastError();
39346        if (mem_base != xmlMemBlocks()) {
39347            printf("Leak of %d blocks found in xmlUCSIsDingbats",
39348	           xmlMemBlocks() - mem_base);
39349	    test_ret++;
39350            printf(" %d", n_code);
39351            printf("\n");
39352        }
39353    }
39354    function_tests++;
39355#endif
39356
39357    return(test_ret);
39358}
39359
39360
39361static int
39362test_xmlUCSIsEnclosedAlphanumerics(void) {
39363    int test_ret = 0;
39364
39365#if defined(LIBXML_UNICODE_ENABLED)
39366    int mem_base;
39367    int ret_val;
39368    int code; /* UCS code point */
39369    int n_code;
39370
39371    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39372        mem_base = xmlMemBlocks();
39373        code = gen_int(n_code, 0);
39374
39375        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39376        desret_int(ret_val);
39377        call_tests++;
39378        des_int(n_code, code, 0);
39379        xmlResetLastError();
39380        if (mem_base != xmlMemBlocks()) {
39381            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39382	           xmlMemBlocks() - mem_base);
39383	    test_ret++;
39384            printf(" %d", n_code);
39385            printf("\n");
39386        }
39387    }
39388    function_tests++;
39389#endif
39390
39391    return(test_ret);
39392}
39393
39394
39395static int
39396test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39397    int test_ret = 0;
39398
39399#if defined(LIBXML_UNICODE_ENABLED)
39400    int mem_base;
39401    int ret_val;
39402    int code; /* UCS code point */
39403    int n_code;
39404
39405    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39406        mem_base = xmlMemBlocks();
39407        code = gen_int(n_code, 0);
39408
39409        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39410        desret_int(ret_val);
39411        call_tests++;
39412        des_int(n_code, code, 0);
39413        xmlResetLastError();
39414        if (mem_base != xmlMemBlocks()) {
39415            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39416	           xmlMemBlocks() - mem_base);
39417	    test_ret++;
39418            printf(" %d", n_code);
39419            printf("\n");
39420        }
39421    }
39422    function_tests++;
39423#endif
39424
39425    return(test_ret);
39426}
39427
39428
39429static int
39430test_xmlUCSIsEthiopic(void) {
39431    int test_ret = 0;
39432
39433#if defined(LIBXML_UNICODE_ENABLED)
39434    int mem_base;
39435    int ret_val;
39436    int code; /* UCS code point */
39437    int n_code;
39438
39439    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39440        mem_base = xmlMemBlocks();
39441        code = gen_int(n_code, 0);
39442
39443        ret_val = xmlUCSIsEthiopic(code);
39444        desret_int(ret_val);
39445        call_tests++;
39446        des_int(n_code, code, 0);
39447        xmlResetLastError();
39448        if (mem_base != xmlMemBlocks()) {
39449            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39450	           xmlMemBlocks() - mem_base);
39451	    test_ret++;
39452            printf(" %d", n_code);
39453            printf("\n");
39454        }
39455    }
39456    function_tests++;
39457#endif
39458
39459    return(test_ret);
39460}
39461
39462
39463static int
39464test_xmlUCSIsGeneralPunctuation(void) {
39465    int test_ret = 0;
39466
39467#if defined(LIBXML_UNICODE_ENABLED)
39468    int mem_base;
39469    int ret_val;
39470    int code; /* UCS code point */
39471    int n_code;
39472
39473    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39474        mem_base = xmlMemBlocks();
39475        code = gen_int(n_code, 0);
39476
39477        ret_val = xmlUCSIsGeneralPunctuation(code);
39478        desret_int(ret_val);
39479        call_tests++;
39480        des_int(n_code, code, 0);
39481        xmlResetLastError();
39482        if (mem_base != xmlMemBlocks()) {
39483            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39484	           xmlMemBlocks() - mem_base);
39485	    test_ret++;
39486            printf(" %d", n_code);
39487            printf("\n");
39488        }
39489    }
39490    function_tests++;
39491#endif
39492
39493    return(test_ret);
39494}
39495
39496
39497static int
39498test_xmlUCSIsGeometricShapes(void) {
39499    int test_ret = 0;
39500
39501#if defined(LIBXML_UNICODE_ENABLED)
39502    int mem_base;
39503    int ret_val;
39504    int code; /* UCS code point */
39505    int n_code;
39506
39507    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39508        mem_base = xmlMemBlocks();
39509        code = gen_int(n_code, 0);
39510
39511        ret_val = xmlUCSIsGeometricShapes(code);
39512        desret_int(ret_val);
39513        call_tests++;
39514        des_int(n_code, code, 0);
39515        xmlResetLastError();
39516        if (mem_base != xmlMemBlocks()) {
39517            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39518	           xmlMemBlocks() - mem_base);
39519	    test_ret++;
39520            printf(" %d", n_code);
39521            printf("\n");
39522        }
39523    }
39524    function_tests++;
39525#endif
39526
39527    return(test_ret);
39528}
39529
39530
39531static int
39532test_xmlUCSIsGeorgian(void) {
39533    int test_ret = 0;
39534
39535#if defined(LIBXML_UNICODE_ENABLED)
39536    int mem_base;
39537    int ret_val;
39538    int code; /* UCS code point */
39539    int n_code;
39540
39541    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39542        mem_base = xmlMemBlocks();
39543        code = gen_int(n_code, 0);
39544
39545        ret_val = xmlUCSIsGeorgian(code);
39546        desret_int(ret_val);
39547        call_tests++;
39548        des_int(n_code, code, 0);
39549        xmlResetLastError();
39550        if (mem_base != xmlMemBlocks()) {
39551            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39552	           xmlMemBlocks() - mem_base);
39553	    test_ret++;
39554            printf(" %d", n_code);
39555            printf("\n");
39556        }
39557    }
39558    function_tests++;
39559#endif
39560
39561    return(test_ret);
39562}
39563
39564
39565static int
39566test_xmlUCSIsGothic(void) {
39567    int test_ret = 0;
39568
39569#if defined(LIBXML_UNICODE_ENABLED)
39570    int mem_base;
39571    int ret_val;
39572    int code; /* UCS code point */
39573    int n_code;
39574
39575    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39576        mem_base = xmlMemBlocks();
39577        code = gen_int(n_code, 0);
39578
39579        ret_val = xmlUCSIsGothic(code);
39580        desret_int(ret_val);
39581        call_tests++;
39582        des_int(n_code, code, 0);
39583        xmlResetLastError();
39584        if (mem_base != xmlMemBlocks()) {
39585            printf("Leak of %d blocks found in xmlUCSIsGothic",
39586	           xmlMemBlocks() - mem_base);
39587	    test_ret++;
39588            printf(" %d", n_code);
39589            printf("\n");
39590        }
39591    }
39592    function_tests++;
39593#endif
39594
39595    return(test_ret);
39596}
39597
39598
39599static int
39600test_xmlUCSIsGreek(void) {
39601    int test_ret = 0;
39602
39603#if defined(LIBXML_UNICODE_ENABLED)
39604    int mem_base;
39605    int ret_val;
39606    int code; /* UCS code point */
39607    int n_code;
39608
39609    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39610        mem_base = xmlMemBlocks();
39611        code = gen_int(n_code, 0);
39612
39613        ret_val = xmlUCSIsGreek(code);
39614        desret_int(ret_val);
39615        call_tests++;
39616        des_int(n_code, code, 0);
39617        xmlResetLastError();
39618        if (mem_base != xmlMemBlocks()) {
39619            printf("Leak of %d blocks found in xmlUCSIsGreek",
39620	           xmlMemBlocks() - mem_base);
39621	    test_ret++;
39622            printf(" %d", n_code);
39623            printf("\n");
39624        }
39625    }
39626    function_tests++;
39627#endif
39628
39629    return(test_ret);
39630}
39631
39632
39633static int
39634test_xmlUCSIsGreekExtended(void) {
39635    int test_ret = 0;
39636
39637#if defined(LIBXML_UNICODE_ENABLED)
39638    int mem_base;
39639    int ret_val;
39640    int code; /* UCS code point */
39641    int n_code;
39642
39643    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39644        mem_base = xmlMemBlocks();
39645        code = gen_int(n_code, 0);
39646
39647        ret_val = xmlUCSIsGreekExtended(code);
39648        desret_int(ret_val);
39649        call_tests++;
39650        des_int(n_code, code, 0);
39651        xmlResetLastError();
39652        if (mem_base != xmlMemBlocks()) {
39653            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39654	           xmlMemBlocks() - mem_base);
39655	    test_ret++;
39656            printf(" %d", n_code);
39657            printf("\n");
39658        }
39659    }
39660    function_tests++;
39661#endif
39662
39663    return(test_ret);
39664}
39665
39666
39667static int
39668test_xmlUCSIsGreekandCoptic(void) {
39669    int test_ret = 0;
39670
39671#if defined(LIBXML_UNICODE_ENABLED)
39672    int mem_base;
39673    int ret_val;
39674    int code; /* UCS code point */
39675    int n_code;
39676
39677    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39678        mem_base = xmlMemBlocks();
39679        code = gen_int(n_code, 0);
39680
39681        ret_val = xmlUCSIsGreekandCoptic(code);
39682        desret_int(ret_val);
39683        call_tests++;
39684        des_int(n_code, code, 0);
39685        xmlResetLastError();
39686        if (mem_base != xmlMemBlocks()) {
39687            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39688	           xmlMemBlocks() - mem_base);
39689	    test_ret++;
39690            printf(" %d", n_code);
39691            printf("\n");
39692        }
39693    }
39694    function_tests++;
39695#endif
39696
39697    return(test_ret);
39698}
39699
39700
39701static int
39702test_xmlUCSIsGujarati(void) {
39703    int test_ret = 0;
39704
39705#if defined(LIBXML_UNICODE_ENABLED)
39706    int mem_base;
39707    int ret_val;
39708    int code; /* UCS code point */
39709    int n_code;
39710
39711    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39712        mem_base = xmlMemBlocks();
39713        code = gen_int(n_code, 0);
39714
39715        ret_val = xmlUCSIsGujarati(code);
39716        desret_int(ret_val);
39717        call_tests++;
39718        des_int(n_code, code, 0);
39719        xmlResetLastError();
39720        if (mem_base != xmlMemBlocks()) {
39721            printf("Leak of %d blocks found in xmlUCSIsGujarati",
39722	           xmlMemBlocks() - mem_base);
39723	    test_ret++;
39724            printf(" %d", n_code);
39725            printf("\n");
39726        }
39727    }
39728    function_tests++;
39729#endif
39730
39731    return(test_ret);
39732}
39733
39734
39735static int
39736test_xmlUCSIsGurmukhi(void) {
39737    int test_ret = 0;
39738
39739#if defined(LIBXML_UNICODE_ENABLED)
39740    int mem_base;
39741    int ret_val;
39742    int code; /* UCS code point */
39743    int n_code;
39744
39745    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39746        mem_base = xmlMemBlocks();
39747        code = gen_int(n_code, 0);
39748
39749        ret_val = xmlUCSIsGurmukhi(code);
39750        desret_int(ret_val);
39751        call_tests++;
39752        des_int(n_code, code, 0);
39753        xmlResetLastError();
39754        if (mem_base != xmlMemBlocks()) {
39755            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39756	           xmlMemBlocks() - mem_base);
39757	    test_ret++;
39758            printf(" %d", n_code);
39759            printf("\n");
39760        }
39761    }
39762    function_tests++;
39763#endif
39764
39765    return(test_ret);
39766}
39767
39768
39769static int
39770test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39771    int test_ret = 0;
39772
39773#if defined(LIBXML_UNICODE_ENABLED)
39774    int mem_base;
39775    int ret_val;
39776    int code; /* UCS code point */
39777    int n_code;
39778
39779    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39780        mem_base = xmlMemBlocks();
39781        code = gen_int(n_code, 0);
39782
39783        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
39784        desret_int(ret_val);
39785        call_tests++;
39786        des_int(n_code, code, 0);
39787        xmlResetLastError();
39788        if (mem_base != xmlMemBlocks()) {
39789            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
39790	           xmlMemBlocks() - mem_base);
39791	    test_ret++;
39792            printf(" %d", n_code);
39793            printf("\n");
39794        }
39795    }
39796    function_tests++;
39797#endif
39798
39799    return(test_ret);
39800}
39801
39802
39803static int
39804test_xmlUCSIsHangulCompatibilityJamo(void) {
39805    int test_ret = 0;
39806
39807#if defined(LIBXML_UNICODE_ENABLED)
39808    int mem_base;
39809    int ret_val;
39810    int code; /* UCS code point */
39811    int n_code;
39812
39813    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39814        mem_base = xmlMemBlocks();
39815        code = gen_int(n_code, 0);
39816
39817        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
39818        desret_int(ret_val);
39819        call_tests++;
39820        des_int(n_code, code, 0);
39821        xmlResetLastError();
39822        if (mem_base != xmlMemBlocks()) {
39823            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
39824	           xmlMemBlocks() - mem_base);
39825	    test_ret++;
39826            printf(" %d", n_code);
39827            printf("\n");
39828        }
39829    }
39830    function_tests++;
39831#endif
39832
39833    return(test_ret);
39834}
39835
39836
39837static int
39838test_xmlUCSIsHangulJamo(void) {
39839    int test_ret = 0;
39840
39841#if defined(LIBXML_UNICODE_ENABLED)
39842    int mem_base;
39843    int ret_val;
39844    int code; /* UCS code point */
39845    int n_code;
39846
39847    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39848        mem_base = xmlMemBlocks();
39849        code = gen_int(n_code, 0);
39850
39851        ret_val = xmlUCSIsHangulJamo(code);
39852        desret_int(ret_val);
39853        call_tests++;
39854        des_int(n_code, code, 0);
39855        xmlResetLastError();
39856        if (mem_base != xmlMemBlocks()) {
39857            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
39858	           xmlMemBlocks() - mem_base);
39859	    test_ret++;
39860            printf(" %d", n_code);
39861            printf("\n");
39862        }
39863    }
39864    function_tests++;
39865#endif
39866
39867    return(test_ret);
39868}
39869
39870
39871static int
39872test_xmlUCSIsHangulSyllables(void) {
39873    int test_ret = 0;
39874
39875#if defined(LIBXML_UNICODE_ENABLED)
39876    int mem_base;
39877    int ret_val;
39878    int code; /* UCS code point */
39879    int n_code;
39880
39881    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39882        mem_base = xmlMemBlocks();
39883        code = gen_int(n_code, 0);
39884
39885        ret_val = xmlUCSIsHangulSyllables(code);
39886        desret_int(ret_val);
39887        call_tests++;
39888        des_int(n_code, code, 0);
39889        xmlResetLastError();
39890        if (mem_base != xmlMemBlocks()) {
39891            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
39892	           xmlMemBlocks() - mem_base);
39893	    test_ret++;
39894            printf(" %d", n_code);
39895            printf("\n");
39896        }
39897    }
39898    function_tests++;
39899#endif
39900
39901    return(test_ret);
39902}
39903
39904
39905static int
39906test_xmlUCSIsHanunoo(void) {
39907    int test_ret = 0;
39908
39909#if defined(LIBXML_UNICODE_ENABLED)
39910    int mem_base;
39911    int ret_val;
39912    int code; /* UCS code point */
39913    int n_code;
39914
39915    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39916        mem_base = xmlMemBlocks();
39917        code = gen_int(n_code, 0);
39918
39919        ret_val = xmlUCSIsHanunoo(code);
39920        desret_int(ret_val);
39921        call_tests++;
39922        des_int(n_code, code, 0);
39923        xmlResetLastError();
39924        if (mem_base != xmlMemBlocks()) {
39925            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
39926	           xmlMemBlocks() - mem_base);
39927	    test_ret++;
39928            printf(" %d", n_code);
39929            printf("\n");
39930        }
39931    }
39932    function_tests++;
39933#endif
39934
39935    return(test_ret);
39936}
39937
39938
39939static int
39940test_xmlUCSIsHebrew(void) {
39941    int test_ret = 0;
39942
39943#if defined(LIBXML_UNICODE_ENABLED)
39944    int mem_base;
39945    int ret_val;
39946    int code; /* UCS code point */
39947    int n_code;
39948
39949    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39950        mem_base = xmlMemBlocks();
39951        code = gen_int(n_code, 0);
39952
39953        ret_val = xmlUCSIsHebrew(code);
39954        desret_int(ret_val);
39955        call_tests++;
39956        des_int(n_code, code, 0);
39957        xmlResetLastError();
39958        if (mem_base != xmlMemBlocks()) {
39959            printf("Leak of %d blocks found in xmlUCSIsHebrew",
39960	           xmlMemBlocks() - mem_base);
39961	    test_ret++;
39962            printf(" %d", n_code);
39963            printf("\n");
39964        }
39965    }
39966    function_tests++;
39967#endif
39968
39969    return(test_ret);
39970}
39971
39972
39973static int
39974test_xmlUCSIsHighPrivateUseSurrogates(void) {
39975    int test_ret = 0;
39976
39977#if defined(LIBXML_UNICODE_ENABLED)
39978    int mem_base;
39979    int ret_val;
39980    int code; /* UCS code point */
39981    int n_code;
39982
39983    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39984        mem_base = xmlMemBlocks();
39985        code = gen_int(n_code, 0);
39986
39987        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
39988        desret_int(ret_val);
39989        call_tests++;
39990        des_int(n_code, code, 0);
39991        xmlResetLastError();
39992        if (mem_base != xmlMemBlocks()) {
39993            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
39994	           xmlMemBlocks() - mem_base);
39995	    test_ret++;
39996            printf(" %d", n_code);
39997            printf("\n");
39998        }
39999    }
40000    function_tests++;
40001#endif
40002
40003    return(test_ret);
40004}
40005
40006
40007static int
40008test_xmlUCSIsHighSurrogates(void) {
40009    int test_ret = 0;
40010
40011#if defined(LIBXML_UNICODE_ENABLED)
40012    int mem_base;
40013    int ret_val;
40014    int code; /* UCS code point */
40015    int n_code;
40016
40017    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40018        mem_base = xmlMemBlocks();
40019        code = gen_int(n_code, 0);
40020
40021        ret_val = xmlUCSIsHighSurrogates(code);
40022        desret_int(ret_val);
40023        call_tests++;
40024        des_int(n_code, code, 0);
40025        xmlResetLastError();
40026        if (mem_base != xmlMemBlocks()) {
40027            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40028	           xmlMemBlocks() - mem_base);
40029	    test_ret++;
40030            printf(" %d", n_code);
40031            printf("\n");
40032        }
40033    }
40034    function_tests++;
40035#endif
40036
40037    return(test_ret);
40038}
40039
40040
40041static int
40042test_xmlUCSIsHiragana(void) {
40043    int test_ret = 0;
40044
40045#if defined(LIBXML_UNICODE_ENABLED)
40046    int mem_base;
40047    int ret_val;
40048    int code; /* UCS code point */
40049    int n_code;
40050
40051    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40052        mem_base = xmlMemBlocks();
40053        code = gen_int(n_code, 0);
40054
40055        ret_val = xmlUCSIsHiragana(code);
40056        desret_int(ret_val);
40057        call_tests++;
40058        des_int(n_code, code, 0);
40059        xmlResetLastError();
40060        if (mem_base != xmlMemBlocks()) {
40061            printf("Leak of %d blocks found in xmlUCSIsHiragana",
40062	           xmlMemBlocks() - mem_base);
40063	    test_ret++;
40064            printf(" %d", n_code);
40065            printf("\n");
40066        }
40067    }
40068    function_tests++;
40069#endif
40070
40071    return(test_ret);
40072}
40073
40074
40075static int
40076test_xmlUCSIsIPAExtensions(void) {
40077    int test_ret = 0;
40078
40079#if defined(LIBXML_UNICODE_ENABLED)
40080    int mem_base;
40081    int ret_val;
40082    int code; /* UCS code point */
40083    int n_code;
40084
40085    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40086        mem_base = xmlMemBlocks();
40087        code = gen_int(n_code, 0);
40088
40089        ret_val = xmlUCSIsIPAExtensions(code);
40090        desret_int(ret_val);
40091        call_tests++;
40092        des_int(n_code, code, 0);
40093        xmlResetLastError();
40094        if (mem_base != xmlMemBlocks()) {
40095            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40096	           xmlMemBlocks() - mem_base);
40097	    test_ret++;
40098            printf(" %d", n_code);
40099            printf("\n");
40100        }
40101    }
40102    function_tests++;
40103#endif
40104
40105    return(test_ret);
40106}
40107
40108
40109static int
40110test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40111    int test_ret = 0;
40112
40113#if defined(LIBXML_UNICODE_ENABLED)
40114    int mem_base;
40115    int ret_val;
40116    int code; /* UCS code point */
40117    int n_code;
40118
40119    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40120        mem_base = xmlMemBlocks();
40121        code = gen_int(n_code, 0);
40122
40123        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40124        desret_int(ret_val);
40125        call_tests++;
40126        des_int(n_code, code, 0);
40127        xmlResetLastError();
40128        if (mem_base != xmlMemBlocks()) {
40129            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40130	           xmlMemBlocks() - mem_base);
40131	    test_ret++;
40132            printf(" %d", n_code);
40133            printf("\n");
40134        }
40135    }
40136    function_tests++;
40137#endif
40138
40139    return(test_ret);
40140}
40141
40142
40143static int
40144test_xmlUCSIsKanbun(void) {
40145    int test_ret = 0;
40146
40147#if defined(LIBXML_UNICODE_ENABLED)
40148    int mem_base;
40149    int ret_val;
40150    int code; /* UCS code point */
40151    int n_code;
40152
40153    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40154        mem_base = xmlMemBlocks();
40155        code = gen_int(n_code, 0);
40156
40157        ret_val = xmlUCSIsKanbun(code);
40158        desret_int(ret_val);
40159        call_tests++;
40160        des_int(n_code, code, 0);
40161        xmlResetLastError();
40162        if (mem_base != xmlMemBlocks()) {
40163            printf("Leak of %d blocks found in xmlUCSIsKanbun",
40164	           xmlMemBlocks() - mem_base);
40165	    test_ret++;
40166            printf(" %d", n_code);
40167            printf("\n");
40168        }
40169    }
40170    function_tests++;
40171#endif
40172
40173    return(test_ret);
40174}
40175
40176
40177static int
40178test_xmlUCSIsKangxiRadicals(void) {
40179    int test_ret = 0;
40180
40181#if defined(LIBXML_UNICODE_ENABLED)
40182    int mem_base;
40183    int ret_val;
40184    int code; /* UCS code point */
40185    int n_code;
40186
40187    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40188        mem_base = xmlMemBlocks();
40189        code = gen_int(n_code, 0);
40190
40191        ret_val = xmlUCSIsKangxiRadicals(code);
40192        desret_int(ret_val);
40193        call_tests++;
40194        des_int(n_code, code, 0);
40195        xmlResetLastError();
40196        if (mem_base != xmlMemBlocks()) {
40197            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40198	           xmlMemBlocks() - mem_base);
40199	    test_ret++;
40200            printf(" %d", n_code);
40201            printf("\n");
40202        }
40203    }
40204    function_tests++;
40205#endif
40206
40207    return(test_ret);
40208}
40209
40210
40211static int
40212test_xmlUCSIsKannada(void) {
40213    int test_ret = 0;
40214
40215#if defined(LIBXML_UNICODE_ENABLED)
40216    int mem_base;
40217    int ret_val;
40218    int code; /* UCS code point */
40219    int n_code;
40220
40221    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40222        mem_base = xmlMemBlocks();
40223        code = gen_int(n_code, 0);
40224
40225        ret_val = xmlUCSIsKannada(code);
40226        desret_int(ret_val);
40227        call_tests++;
40228        des_int(n_code, code, 0);
40229        xmlResetLastError();
40230        if (mem_base != xmlMemBlocks()) {
40231            printf("Leak of %d blocks found in xmlUCSIsKannada",
40232	           xmlMemBlocks() - mem_base);
40233	    test_ret++;
40234            printf(" %d", n_code);
40235            printf("\n");
40236        }
40237    }
40238    function_tests++;
40239#endif
40240
40241    return(test_ret);
40242}
40243
40244
40245static int
40246test_xmlUCSIsKatakana(void) {
40247    int test_ret = 0;
40248
40249#if defined(LIBXML_UNICODE_ENABLED)
40250    int mem_base;
40251    int ret_val;
40252    int code; /* UCS code point */
40253    int n_code;
40254
40255    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40256        mem_base = xmlMemBlocks();
40257        code = gen_int(n_code, 0);
40258
40259        ret_val = xmlUCSIsKatakana(code);
40260        desret_int(ret_val);
40261        call_tests++;
40262        des_int(n_code, code, 0);
40263        xmlResetLastError();
40264        if (mem_base != xmlMemBlocks()) {
40265            printf("Leak of %d blocks found in xmlUCSIsKatakana",
40266	           xmlMemBlocks() - mem_base);
40267	    test_ret++;
40268            printf(" %d", n_code);
40269            printf("\n");
40270        }
40271    }
40272    function_tests++;
40273#endif
40274
40275    return(test_ret);
40276}
40277
40278
40279static int
40280test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40281    int test_ret = 0;
40282
40283#if defined(LIBXML_UNICODE_ENABLED)
40284    int mem_base;
40285    int ret_val;
40286    int code; /* UCS code point */
40287    int n_code;
40288
40289    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40290        mem_base = xmlMemBlocks();
40291        code = gen_int(n_code, 0);
40292
40293        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40294        desret_int(ret_val);
40295        call_tests++;
40296        des_int(n_code, code, 0);
40297        xmlResetLastError();
40298        if (mem_base != xmlMemBlocks()) {
40299            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40300	           xmlMemBlocks() - mem_base);
40301	    test_ret++;
40302            printf(" %d", n_code);
40303            printf("\n");
40304        }
40305    }
40306    function_tests++;
40307#endif
40308
40309    return(test_ret);
40310}
40311
40312
40313static int
40314test_xmlUCSIsKhmer(void) {
40315    int test_ret = 0;
40316
40317#if defined(LIBXML_UNICODE_ENABLED)
40318    int mem_base;
40319    int ret_val;
40320    int code; /* UCS code point */
40321    int n_code;
40322
40323    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40324        mem_base = xmlMemBlocks();
40325        code = gen_int(n_code, 0);
40326
40327        ret_val = xmlUCSIsKhmer(code);
40328        desret_int(ret_val);
40329        call_tests++;
40330        des_int(n_code, code, 0);
40331        xmlResetLastError();
40332        if (mem_base != xmlMemBlocks()) {
40333            printf("Leak of %d blocks found in xmlUCSIsKhmer",
40334	           xmlMemBlocks() - mem_base);
40335	    test_ret++;
40336            printf(" %d", n_code);
40337            printf("\n");
40338        }
40339    }
40340    function_tests++;
40341#endif
40342
40343    return(test_ret);
40344}
40345
40346
40347static int
40348test_xmlUCSIsKhmerSymbols(void) {
40349    int test_ret = 0;
40350
40351#if defined(LIBXML_UNICODE_ENABLED)
40352    int mem_base;
40353    int ret_val;
40354    int code; /* UCS code point */
40355    int n_code;
40356
40357    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40358        mem_base = xmlMemBlocks();
40359        code = gen_int(n_code, 0);
40360
40361        ret_val = xmlUCSIsKhmerSymbols(code);
40362        desret_int(ret_val);
40363        call_tests++;
40364        des_int(n_code, code, 0);
40365        xmlResetLastError();
40366        if (mem_base != xmlMemBlocks()) {
40367            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40368	           xmlMemBlocks() - mem_base);
40369	    test_ret++;
40370            printf(" %d", n_code);
40371            printf("\n");
40372        }
40373    }
40374    function_tests++;
40375#endif
40376
40377    return(test_ret);
40378}
40379
40380
40381static int
40382test_xmlUCSIsLao(void) {
40383    int test_ret = 0;
40384
40385#if defined(LIBXML_UNICODE_ENABLED)
40386    int mem_base;
40387    int ret_val;
40388    int code; /* UCS code point */
40389    int n_code;
40390
40391    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40392        mem_base = xmlMemBlocks();
40393        code = gen_int(n_code, 0);
40394
40395        ret_val = xmlUCSIsLao(code);
40396        desret_int(ret_val);
40397        call_tests++;
40398        des_int(n_code, code, 0);
40399        xmlResetLastError();
40400        if (mem_base != xmlMemBlocks()) {
40401            printf("Leak of %d blocks found in xmlUCSIsLao",
40402	           xmlMemBlocks() - mem_base);
40403	    test_ret++;
40404            printf(" %d", n_code);
40405            printf("\n");
40406        }
40407    }
40408    function_tests++;
40409#endif
40410
40411    return(test_ret);
40412}
40413
40414
40415static int
40416test_xmlUCSIsLatin1Supplement(void) {
40417    int test_ret = 0;
40418
40419#if defined(LIBXML_UNICODE_ENABLED)
40420    int mem_base;
40421    int ret_val;
40422    int code; /* UCS code point */
40423    int n_code;
40424
40425    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40426        mem_base = xmlMemBlocks();
40427        code = gen_int(n_code, 0);
40428
40429        ret_val = xmlUCSIsLatin1Supplement(code);
40430        desret_int(ret_val);
40431        call_tests++;
40432        des_int(n_code, code, 0);
40433        xmlResetLastError();
40434        if (mem_base != xmlMemBlocks()) {
40435            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40436	           xmlMemBlocks() - mem_base);
40437	    test_ret++;
40438            printf(" %d", n_code);
40439            printf("\n");
40440        }
40441    }
40442    function_tests++;
40443#endif
40444
40445    return(test_ret);
40446}
40447
40448
40449static int
40450test_xmlUCSIsLatinExtendedA(void) {
40451    int test_ret = 0;
40452
40453#if defined(LIBXML_UNICODE_ENABLED)
40454    int mem_base;
40455    int ret_val;
40456    int code; /* UCS code point */
40457    int n_code;
40458
40459    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40460        mem_base = xmlMemBlocks();
40461        code = gen_int(n_code, 0);
40462
40463        ret_val = xmlUCSIsLatinExtendedA(code);
40464        desret_int(ret_val);
40465        call_tests++;
40466        des_int(n_code, code, 0);
40467        xmlResetLastError();
40468        if (mem_base != xmlMemBlocks()) {
40469            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40470	           xmlMemBlocks() - mem_base);
40471	    test_ret++;
40472            printf(" %d", n_code);
40473            printf("\n");
40474        }
40475    }
40476    function_tests++;
40477#endif
40478
40479    return(test_ret);
40480}
40481
40482
40483static int
40484test_xmlUCSIsLatinExtendedAdditional(void) {
40485    int test_ret = 0;
40486
40487#if defined(LIBXML_UNICODE_ENABLED)
40488    int mem_base;
40489    int ret_val;
40490    int code; /* UCS code point */
40491    int n_code;
40492
40493    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40494        mem_base = xmlMemBlocks();
40495        code = gen_int(n_code, 0);
40496
40497        ret_val = xmlUCSIsLatinExtendedAdditional(code);
40498        desret_int(ret_val);
40499        call_tests++;
40500        des_int(n_code, code, 0);
40501        xmlResetLastError();
40502        if (mem_base != xmlMemBlocks()) {
40503            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40504	           xmlMemBlocks() - mem_base);
40505	    test_ret++;
40506            printf(" %d", n_code);
40507            printf("\n");
40508        }
40509    }
40510    function_tests++;
40511#endif
40512
40513    return(test_ret);
40514}
40515
40516
40517static int
40518test_xmlUCSIsLatinExtendedB(void) {
40519    int test_ret = 0;
40520
40521#if defined(LIBXML_UNICODE_ENABLED)
40522    int mem_base;
40523    int ret_val;
40524    int code; /* UCS code point */
40525    int n_code;
40526
40527    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40528        mem_base = xmlMemBlocks();
40529        code = gen_int(n_code, 0);
40530
40531        ret_val = xmlUCSIsLatinExtendedB(code);
40532        desret_int(ret_val);
40533        call_tests++;
40534        des_int(n_code, code, 0);
40535        xmlResetLastError();
40536        if (mem_base != xmlMemBlocks()) {
40537            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40538	           xmlMemBlocks() - mem_base);
40539	    test_ret++;
40540            printf(" %d", n_code);
40541            printf("\n");
40542        }
40543    }
40544    function_tests++;
40545#endif
40546
40547    return(test_ret);
40548}
40549
40550
40551static int
40552test_xmlUCSIsLetterlikeSymbols(void) {
40553    int test_ret = 0;
40554
40555#if defined(LIBXML_UNICODE_ENABLED)
40556    int mem_base;
40557    int ret_val;
40558    int code; /* UCS code point */
40559    int n_code;
40560
40561    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40562        mem_base = xmlMemBlocks();
40563        code = gen_int(n_code, 0);
40564
40565        ret_val = xmlUCSIsLetterlikeSymbols(code);
40566        desret_int(ret_val);
40567        call_tests++;
40568        des_int(n_code, code, 0);
40569        xmlResetLastError();
40570        if (mem_base != xmlMemBlocks()) {
40571            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40572	           xmlMemBlocks() - mem_base);
40573	    test_ret++;
40574            printf(" %d", n_code);
40575            printf("\n");
40576        }
40577    }
40578    function_tests++;
40579#endif
40580
40581    return(test_ret);
40582}
40583
40584
40585static int
40586test_xmlUCSIsLimbu(void) {
40587    int test_ret = 0;
40588
40589#if defined(LIBXML_UNICODE_ENABLED)
40590    int mem_base;
40591    int ret_val;
40592    int code; /* UCS code point */
40593    int n_code;
40594
40595    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40596        mem_base = xmlMemBlocks();
40597        code = gen_int(n_code, 0);
40598
40599        ret_val = xmlUCSIsLimbu(code);
40600        desret_int(ret_val);
40601        call_tests++;
40602        des_int(n_code, code, 0);
40603        xmlResetLastError();
40604        if (mem_base != xmlMemBlocks()) {
40605            printf("Leak of %d blocks found in xmlUCSIsLimbu",
40606	           xmlMemBlocks() - mem_base);
40607	    test_ret++;
40608            printf(" %d", n_code);
40609            printf("\n");
40610        }
40611    }
40612    function_tests++;
40613#endif
40614
40615    return(test_ret);
40616}
40617
40618
40619static int
40620test_xmlUCSIsLinearBIdeograms(void) {
40621    int test_ret = 0;
40622
40623#if defined(LIBXML_UNICODE_ENABLED)
40624    int mem_base;
40625    int ret_val;
40626    int code; /* UCS code point */
40627    int n_code;
40628
40629    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40630        mem_base = xmlMemBlocks();
40631        code = gen_int(n_code, 0);
40632
40633        ret_val = xmlUCSIsLinearBIdeograms(code);
40634        desret_int(ret_val);
40635        call_tests++;
40636        des_int(n_code, code, 0);
40637        xmlResetLastError();
40638        if (mem_base != xmlMemBlocks()) {
40639            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40640	           xmlMemBlocks() - mem_base);
40641	    test_ret++;
40642            printf(" %d", n_code);
40643            printf("\n");
40644        }
40645    }
40646    function_tests++;
40647#endif
40648
40649    return(test_ret);
40650}
40651
40652
40653static int
40654test_xmlUCSIsLinearBSyllabary(void) {
40655    int test_ret = 0;
40656
40657#if defined(LIBXML_UNICODE_ENABLED)
40658    int mem_base;
40659    int ret_val;
40660    int code; /* UCS code point */
40661    int n_code;
40662
40663    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40664        mem_base = xmlMemBlocks();
40665        code = gen_int(n_code, 0);
40666
40667        ret_val = xmlUCSIsLinearBSyllabary(code);
40668        desret_int(ret_val);
40669        call_tests++;
40670        des_int(n_code, code, 0);
40671        xmlResetLastError();
40672        if (mem_base != xmlMemBlocks()) {
40673            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40674	           xmlMemBlocks() - mem_base);
40675	    test_ret++;
40676            printf(" %d", n_code);
40677            printf("\n");
40678        }
40679    }
40680    function_tests++;
40681#endif
40682
40683    return(test_ret);
40684}
40685
40686
40687static int
40688test_xmlUCSIsLowSurrogates(void) {
40689    int test_ret = 0;
40690
40691#if defined(LIBXML_UNICODE_ENABLED)
40692    int mem_base;
40693    int ret_val;
40694    int code; /* UCS code point */
40695    int n_code;
40696
40697    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40698        mem_base = xmlMemBlocks();
40699        code = gen_int(n_code, 0);
40700
40701        ret_val = xmlUCSIsLowSurrogates(code);
40702        desret_int(ret_val);
40703        call_tests++;
40704        des_int(n_code, code, 0);
40705        xmlResetLastError();
40706        if (mem_base != xmlMemBlocks()) {
40707            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40708	           xmlMemBlocks() - mem_base);
40709	    test_ret++;
40710            printf(" %d", n_code);
40711            printf("\n");
40712        }
40713    }
40714    function_tests++;
40715#endif
40716
40717    return(test_ret);
40718}
40719
40720
40721static int
40722test_xmlUCSIsMalayalam(void) {
40723    int test_ret = 0;
40724
40725#if defined(LIBXML_UNICODE_ENABLED)
40726    int mem_base;
40727    int ret_val;
40728    int code; /* UCS code point */
40729    int n_code;
40730
40731    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40732        mem_base = xmlMemBlocks();
40733        code = gen_int(n_code, 0);
40734
40735        ret_val = xmlUCSIsMalayalam(code);
40736        desret_int(ret_val);
40737        call_tests++;
40738        des_int(n_code, code, 0);
40739        xmlResetLastError();
40740        if (mem_base != xmlMemBlocks()) {
40741            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40742	           xmlMemBlocks() - mem_base);
40743	    test_ret++;
40744            printf(" %d", n_code);
40745            printf("\n");
40746        }
40747    }
40748    function_tests++;
40749#endif
40750
40751    return(test_ret);
40752}
40753
40754
40755static int
40756test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40757    int test_ret = 0;
40758
40759#if defined(LIBXML_UNICODE_ENABLED)
40760    int mem_base;
40761    int ret_val;
40762    int code; /* UCS code point */
40763    int n_code;
40764
40765    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40766        mem_base = xmlMemBlocks();
40767        code = gen_int(n_code, 0);
40768
40769        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40770        desret_int(ret_val);
40771        call_tests++;
40772        des_int(n_code, code, 0);
40773        xmlResetLastError();
40774        if (mem_base != xmlMemBlocks()) {
40775            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
40776	           xmlMemBlocks() - mem_base);
40777	    test_ret++;
40778            printf(" %d", n_code);
40779            printf("\n");
40780        }
40781    }
40782    function_tests++;
40783#endif
40784
40785    return(test_ret);
40786}
40787
40788
40789static int
40790test_xmlUCSIsMathematicalOperators(void) {
40791    int test_ret = 0;
40792
40793#if defined(LIBXML_UNICODE_ENABLED)
40794    int mem_base;
40795    int ret_val;
40796    int code; /* UCS code point */
40797    int n_code;
40798
40799    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40800        mem_base = xmlMemBlocks();
40801        code = gen_int(n_code, 0);
40802
40803        ret_val = xmlUCSIsMathematicalOperators(code);
40804        desret_int(ret_val);
40805        call_tests++;
40806        des_int(n_code, code, 0);
40807        xmlResetLastError();
40808        if (mem_base != xmlMemBlocks()) {
40809            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
40810	           xmlMemBlocks() - mem_base);
40811	    test_ret++;
40812            printf(" %d", n_code);
40813            printf("\n");
40814        }
40815    }
40816    function_tests++;
40817#endif
40818
40819    return(test_ret);
40820}
40821
40822
40823static int
40824test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
40825    int test_ret = 0;
40826
40827#if defined(LIBXML_UNICODE_ENABLED)
40828    int mem_base;
40829    int ret_val;
40830    int code; /* UCS code point */
40831    int n_code;
40832
40833    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40834        mem_base = xmlMemBlocks();
40835        code = gen_int(n_code, 0);
40836
40837        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
40838        desret_int(ret_val);
40839        call_tests++;
40840        des_int(n_code, code, 0);
40841        xmlResetLastError();
40842        if (mem_base != xmlMemBlocks()) {
40843            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
40844	           xmlMemBlocks() - mem_base);
40845	    test_ret++;
40846            printf(" %d", n_code);
40847            printf("\n");
40848        }
40849    }
40850    function_tests++;
40851#endif
40852
40853    return(test_ret);
40854}
40855
40856
40857static int
40858test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
40859    int test_ret = 0;
40860
40861#if defined(LIBXML_UNICODE_ENABLED)
40862    int mem_base;
40863    int ret_val;
40864    int code; /* UCS code point */
40865    int n_code;
40866
40867    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40868        mem_base = xmlMemBlocks();
40869        code = gen_int(n_code, 0);
40870
40871        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
40872        desret_int(ret_val);
40873        call_tests++;
40874        des_int(n_code, code, 0);
40875        xmlResetLastError();
40876        if (mem_base != xmlMemBlocks()) {
40877            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
40878	           xmlMemBlocks() - mem_base);
40879	    test_ret++;
40880            printf(" %d", n_code);
40881            printf("\n");
40882        }
40883    }
40884    function_tests++;
40885#endif
40886
40887    return(test_ret);
40888}
40889
40890
40891static int
40892test_xmlUCSIsMiscellaneousSymbols(void) {
40893    int test_ret = 0;
40894
40895#if defined(LIBXML_UNICODE_ENABLED)
40896    int mem_base;
40897    int ret_val;
40898    int code; /* UCS code point */
40899    int n_code;
40900
40901    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40902        mem_base = xmlMemBlocks();
40903        code = gen_int(n_code, 0);
40904
40905        ret_val = xmlUCSIsMiscellaneousSymbols(code);
40906        desret_int(ret_val);
40907        call_tests++;
40908        des_int(n_code, code, 0);
40909        xmlResetLastError();
40910        if (mem_base != xmlMemBlocks()) {
40911            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
40912	           xmlMemBlocks() - mem_base);
40913	    test_ret++;
40914            printf(" %d", n_code);
40915            printf("\n");
40916        }
40917    }
40918    function_tests++;
40919#endif
40920
40921    return(test_ret);
40922}
40923
40924
40925static int
40926test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
40927    int test_ret = 0;
40928
40929#if defined(LIBXML_UNICODE_ENABLED)
40930    int mem_base;
40931    int ret_val;
40932    int code; /* UCS code point */
40933    int n_code;
40934
40935    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40936        mem_base = xmlMemBlocks();
40937        code = gen_int(n_code, 0);
40938
40939        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
40940        desret_int(ret_val);
40941        call_tests++;
40942        des_int(n_code, code, 0);
40943        xmlResetLastError();
40944        if (mem_base != xmlMemBlocks()) {
40945            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
40946	           xmlMemBlocks() - mem_base);
40947	    test_ret++;
40948            printf(" %d", n_code);
40949            printf("\n");
40950        }
40951    }
40952    function_tests++;
40953#endif
40954
40955    return(test_ret);
40956}
40957
40958
40959static int
40960test_xmlUCSIsMiscellaneousTechnical(void) {
40961    int test_ret = 0;
40962
40963#if defined(LIBXML_UNICODE_ENABLED)
40964    int mem_base;
40965    int ret_val;
40966    int code; /* UCS code point */
40967    int n_code;
40968
40969    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40970        mem_base = xmlMemBlocks();
40971        code = gen_int(n_code, 0);
40972
40973        ret_val = xmlUCSIsMiscellaneousTechnical(code);
40974        desret_int(ret_val);
40975        call_tests++;
40976        des_int(n_code, code, 0);
40977        xmlResetLastError();
40978        if (mem_base != xmlMemBlocks()) {
40979            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
40980	           xmlMemBlocks() - mem_base);
40981	    test_ret++;
40982            printf(" %d", n_code);
40983            printf("\n");
40984        }
40985    }
40986    function_tests++;
40987#endif
40988
40989    return(test_ret);
40990}
40991
40992
40993static int
40994test_xmlUCSIsMongolian(void) {
40995    int test_ret = 0;
40996
40997#if defined(LIBXML_UNICODE_ENABLED)
40998    int mem_base;
40999    int ret_val;
41000    int code; /* UCS code point */
41001    int n_code;
41002
41003    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41004        mem_base = xmlMemBlocks();
41005        code = gen_int(n_code, 0);
41006
41007        ret_val = xmlUCSIsMongolian(code);
41008        desret_int(ret_val);
41009        call_tests++;
41010        des_int(n_code, code, 0);
41011        xmlResetLastError();
41012        if (mem_base != xmlMemBlocks()) {
41013            printf("Leak of %d blocks found in xmlUCSIsMongolian",
41014	           xmlMemBlocks() - mem_base);
41015	    test_ret++;
41016            printf(" %d", n_code);
41017            printf("\n");
41018        }
41019    }
41020    function_tests++;
41021#endif
41022
41023    return(test_ret);
41024}
41025
41026
41027static int
41028test_xmlUCSIsMusicalSymbols(void) {
41029    int test_ret = 0;
41030
41031#if defined(LIBXML_UNICODE_ENABLED)
41032    int mem_base;
41033    int ret_val;
41034    int code; /* UCS code point */
41035    int n_code;
41036
41037    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41038        mem_base = xmlMemBlocks();
41039        code = gen_int(n_code, 0);
41040
41041        ret_val = xmlUCSIsMusicalSymbols(code);
41042        desret_int(ret_val);
41043        call_tests++;
41044        des_int(n_code, code, 0);
41045        xmlResetLastError();
41046        if (mem_base != xmlMemBlocks()) {
41047            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41048	           xmlMemBlocks() - mem_base);
41049	    test_ret++;
41050            printf(" %d", n_code);
41051            printf("\n");
41052        }
41053    }
41054    function_tests++;
41055#endif
41056
41057    return(test_ret);
41058}
41059
41060
41061static int
41062test_xmlUCSIsMyanmar(void) {
41063    int test_ret = 0;
41064
41065#if defined(LIBXML_UNICODE_ENABLED)
41066    int mem_base;
41067    int ret_val;
41068    int code; /* UCS code point */
41069    int n_code;
41070
41071    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41072        mem_base = xmlMemBlocks();
41073        code = gen_int(n_code, 0);
41074
41075        ret_val = xmlUCSIsMyanmar(code);
41076        desret_int(ret_val);
41077        call_tests++;
41078        des_int(n_code, code, 0);
41079        xmlResetLastError();
41080        if (mem_base != xmlMemBlocks()) {
41081            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41082	           xmlMemBlocks() - mem_base);
41083	    test_ret++;
41084            printf(" %d", n_code);
41085            printf("\n");
41086        }
41087    }
41088    function_tests++;
41089#endif
41090
41091    return(test_ret);
41092}
41093
41094
41095static int
41096test_xmlUCSIsNumberForms(void) {
41097    int test_ret = 0;
41098
41099#if defined(LIBXML_UNICODE_ENABLED)
41100    int mem_base;
41101    int ret_val;
41102    int code; /* UCS code point */
41103    int n_code;
41104
41105    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41106        mem_base = xmlMemBlocks();
41107        code = gen_int(n_code, 0);
41108
41109        ret_val = xmlUCSIsNumberForms(code);
41110        desret_int(ret_val);
41111        call_tests++;
41112        des_int(n_code, code, 0);
41113        xmlResetLastError();
41114        if (mem_base != xmlMemBlocks()) {
41115            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41116	           xmlMemBlocks() - mem_base);
41117	    test_ret++;
41118            printf(" %d", n_code);
41119            printf("\n");
41120        }
41121    }
41122    function_tests++;
41123#endif
41124
41125    return(test_ret);
41126}
41127
41128
41129static int
41130test_xmlUCSIsOgham(void) {
41131    int test_ret = 0;
41132
41133#if defined(LIBXML_UNICODE_ENABLED)
41134    int mem_base;
41135    int ret_val;
41136    int code; /* UCS code point */
41137    int n_code;
41138
41139    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41140        mem_base = xmlMemBlocks();
41141        code = gen_int(n_code, 0);
41142
41143        ret_val = xmlUCSIsOgham(code);
41144        desret_int(ret_val);
41145        call_tests++;
41146        des_int(n_code, code, 0);
41147        xmlResetLastError();
41148        if (mem_base != xmlMemBlocks()) {
41149            printf("Leak of %d blocks found in xmlUCSIsOgham",
41150	           xmlMemBlocks() - mem_base);
41151	    test_ret++;
41152            printf(" %d", n_code);
41153            printf("\n");
41154        }
41155    }
41156    function_tests++;
41157#endif
41158
41159    return(test_ret);
41160}
41161
41162
41163static int
41164test_xmlUCSIsOldItalic(void) {
41165    int test_ret = 0;
41166
41167#if defined(LIBXML_UNICODE_ENABLED)
41168    int mem_base;
41169    int ret_val;
41170    int code; /* UCS code point */
41171    int n_code;
41172
41173    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41174        mem_base = xmlMemBlocks();
41175        code = gen_int(n_code, 0);
41176
41177        ret_val = xmlUCSIsOldItalic(code);
41178        desret_int(ret_val);
41179        call_tests++;
41180        des_int(n_code, code, 0);
41181        xmlResetLastError();
41182        if (mem_base != xmlMemBlocks()) {
41183            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41184	           xmlMemBlocks() - mem_base);
41185	    test_ret++;
41186            printf(" %d", n_code);
41187            printf("\n");
41188        }
41189    }
41190    function_tests++;
41191#endif
41192
41193    return(test_ret);
41194}
41195
41196
41197static int
41198test_xmlUCSIsOpticalCharacterRecognition(void) {
41199    int test_ret = 0;
41200
41201#if defined(LIBXML_UNICODE_ENABLED)
41202    int mem_base;
41203    int ret_val;
41204    int code; /* UCS code point */
41205    int n_code;
41206
41207    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41208        mem_base = xmlMemBlocks();
41209        code = gen_int(n_code, 0);
41210
41211        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41212        desret_int(ret_val);
41213        call_tests++;
41214        des_int(n_code, code, 0);
41215        xmlResetLastError();
41216        if (mem_base != xmlMemBlocks()) {
41217            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41218	           xmlMemBlocks() - mem_base);
41219	    test_ret++;
41220            printf(" %d", n_code);
41221            printf("\n");
41222        }
41223    }
41224    function_tests++;
41225#endif
41226
41227    return(test_ret);
41228}
41229
41230
41231static int
41232test_xmlUCSIsOriya(void) {
41233    int test_ret = 0;
41234
41235#if defined(LIBXML_UNICODE_ENABLED)
41236    int mem_base;
41237    int ret_val;
41238    int code; /* UCS code point */
41239    int n_code;
41240
41241    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41242        mem_base = xmlMemBlocks();
41243        code = gen_int(n_code, 0);
41244
41245        ret_val = xmlUCSIsOriya(code);
41246        desret_int(ret_val);
41247        call_tests++;
41248        des_int(n_code, code, 0);
41249        xmlResetLastError();
41250        if (mem_base != xmlMemBlocks()) {
41251            printf("Leak of %d blocks found in xmlUCSIsOriya",
41252	           xmlMemBlocks() - mem_base);
41253	    test_ret++;
41254            printf(" %d", n_code);
41255            printf("\n");
41256        }
41257    }
41258    function_tests++;
41259#endif
41260
41261    return(test_ret);
41262}
41263
41264
41265static int
41266test_xmlUCSIsOsmanya(void) {
41267    int test_ret = 0;
41268
41269#if defined(LIBXML_UNICODE_ENABLED)
41270    int mem_base;
41271    int ret_val;
41272    int code; /* UCS code point */
41273    int n_code;
41274
41275    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41276        mem_base = xmlMemBlocks();
41277        code = gen_int(n_code, 0);
41278
41279        ret_val = xmlUCSIsOsmanya(code);
41280        desret_int(ret_val);
41281        call_tests++;
41282        des_int(n_code, code, 0);
41283        xmlResetLastError();
41284        if (mem_base != xmlMemBlocks()) {
41285            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41286	           xmlMemBlocks() - mem_base);
41287	    test_ret++;
41288            printf(" %d", n_code);
41289            printf("\n");
41290        }
41291    }
41292    function_tests++;
41293#endif
41294
41295    return(test_ret);
41296}
41297
41298
41299static int
41300test_xmlUCSIsPhoneticExtensions(void) {
41301    int test_ret = 0;
41302
41303#if defined(LIBXML_UNICODE_ENABLED)
41304    int mem_base;
41305    int ret_val;
41306    int code; /* UCS code point */
41307    int n_code;
41308
41309    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41310        mem_base = xmlMemBlocks();
41311        code = gen_int(n_code, 0);
41312
41313        ret_val = xmlUCSIsPhoneticExtensions(code);
41314        desret_int(ret_val);
41315        call_tests++;
41316        des_int(n_code, code, 0);
41317        xmlResetLastError();
41318        if (mem_base != xmlMemBlocks()) {
41319            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41320	           xmlMemBlocks() - mem_base);
41321	    test_ret++;
41322            printf(" %d", n_code);
41323            printf("\n");
41324        }
41325    }
41326    function_tests++;
41327#endif
41328
41329    return(test_ret);
41330}
41331
41332
41333static int
41334test_xmlUCSIsPrivateUse(void) {
41335    int test_ret = 0;
41336
41337#if defined(LIBXML_UNICODE_ENABLED)
41338    int mem_base;
41339    int ret_val;
41340    int code; /* UCS code point */
41341    int n_code;
41342
41343    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41344        mem_base = xmlMemBlocks();
41345        code = gen_int(n_code, 0);
41346
41347        ret_val = xmlUCSIsPrivateUse(code);
41348        desret_int(ret_val);
41349        call_tests++;
41350        des_int(n_code, code, 0);
41351        xmlResetLastError();
41352        if (mem_base != xmlMemBlocks()) {
41353            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41354	           xmlMemBlocks() - mem_base);
41355	    test_ret++;
41356            printf(" %d", n_code);
41357            printf("\n");
41358        }
41359    }
41360    function_tests++;
41361#endif
41362
41363    return(test_ret);
41364}
41365
41366
41367static int
41368test_xmlUCSIsPrivateUseArea(void) {
41369    int test_ret = 0;
41370
41371#if defined(LIBXML_UNICODE_ENABLED)
41372    int mem_base;
41373    int ret_val;
41374    int code; /* UCS code point */
41375    int n_code;
41376
41377    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41378        mem_base = xmlMemBlocks();
41379        code = gen_int(n_code, 0);
41380
41381        ret_val = xmlUCSIsPrivateUseArea(code);
41382        desret_int(ret_val);
41383        call_tests++;
41384        des_int(n_code, code, 0);
41385        xmlResetLastError();
41386        if (mem_base != xmlMemBlocks()) {
41387            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41388	           xmlMemBlocks() - mem_base);
41389	    test_ret++;
41390            printf(" %d", n_code);
41391            printf("\n");
41392        }
41393    }
41394    function_tests++;
41395#endif
41396
41397    return(test_ret);
41398}
41399
41400
41401static int
41402test_xmlUCSIsRunic(void) {
41403    int test_ret = 0;
41404
41405#if defined(LIBXML_UNICODE_ENABLED)
41406    int mem_base;
41407    int ret_val;
41408    int code; /* UCS code point */
41409    int n_code;
41410
41411    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41412        mem_base = xmlMemBlocks();
41413        code = gen_int(n_code, 0);
41414
41415        ret_val = xmlUCSIsRunic(code);
41416        desret_int(ret_val);
41417        call_tests++;
41418        des_int(n_code, code, 0);
41419        xmlResetLastError();
41420        if (mem_base != xmlMemBlocks()) {
41421            printf("Leak of %d blocks found in xmlUCSIsRunic",
41422	           xmlMemBlocks() - mem_base);
41423	    test_ret++;
41424            printf(" %d", n_code);
41425            printf("\n");
41426        }
41427    }
41428    function_tests++;
41429#endif
41430
41431    return(test_ret);
41432}
41433
41434
41435static int
41436test_xmlUCSIsShavian(void) {
41437    int test_ret = 0;
41438
41439#if defined(LIBXML_UNICODE_ENABLED)
41440    int mem_base;
41441    int ret_val;
41442    int code; /* UCS code point */
41443    int n_code;
41444
41445    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41446        mem_base = xmlMemBlocks();
41447        code = gen_int(n_code, 0);
41448
41449        ret_val = xmlUCSIsShavian(code);
41450        desret_int(ret_val);
41451        call_tests++;
41452        des_int(n_code, code, 0);
41453        xmlResetLastError();
41454        if (mem_base != xmlMemBlocks()) {
41455            printf("Leak of %d blocks found in xmlUCSIsShavian",
41456	           xmlMemBlocks() - mem_base);
41457	    test_ret++;
41458            printf(" %d", n_code);
41459            printf("\n");
41460        }
41461    }
41462    function_tests++;
41463#endif
41464
41465    return(test_ret);
41466}
41467
41468
41469static int
41470test_xmlUCSIsSinhala(void) {
41471    int test_ret = 0;
41472
41473#if defined(LIBXML_UNICODE_ENABLED)
41474    int mem_base;
41475    int ret_val;
41476    int code; /* UCS code point */
41477    int n_code;
41478
41479    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41480        mem_base = xmlMemBlocks();
41481        code = gen_int(n_code, 0);
41482
41483        ret_val = xmlUCSIsSinhala(code);
41484        desret_int(ret_val);
41485        call_tests++;
41486        des_int(n_code, code, 0);
41487        xmlResetLastError();
41488        if (mem_base != xmlMemBlocks()) {
41489            printf("Leak of %d blocks found in xmlUCSIsSinhala",
41490	           xmlMemBlocks() - mem_base);
41491	    test_ret++;
41492            printf(" %d", n_code);
41493            printf("\n");
41494        }
41495    }
41496    function_tests++;
41497#endif
41498
41499    return(test_ret);
41500}
41501
41502
41503static int
41504test_xmlUCSIsSmallFormVariants(void) {
41505    int test_ret = 0;
41506
41507#if defined(LIBXML_UNICODE_ENABLED)
41508    int mem_base;
41509    int ret_val;
41510    int code; /* UCS code point */
41511    int n_code;
41512
41513    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41514        mem_base = xmlMemBlocks();
41515        code = gen_int(n_code, 0);
41516
41517        ret_val = xmlUCSIsSmallFormVariants(code);
41518        desret_int(ret_val);
41519        call_tests++;
41520        des_int(n_code, code, 0);
41521        xmlResetLastError();
41522        if (mem_base != xmlMemBlocks()) {
41523            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41524	           xmlMemBlocks() - mem_base);
41525	    test_ret++;
41526            printf(" %d", n_code);
41527            printf("\n");
41528        }
41529    }
41530    function_tests++;
41531#endif
41532
41533    return(test_ret);
41534}
41535
41536
41537static int
41538test_xmlUCSIsSpacingModifierLetters(void) {
41539    int test_ret = 0;
41540
41541#if defined(LIBXML_UNICODE_ENABLED)
41542    int mem_base;
41543    int ret_val;
41544    int code; /* UCS code point */
41545    int n_code;
41546
41547    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41548        mem_base = xmlMemBlocks();
41549        code = gen_int(n_code, 0);
41550
41551        ret_val = xmlUCSIsSpacingModifierLetters(code);
41552        desret_int(ret_val);
41553        call_tests++;
41554        des_int(n_code, code, 0);
41555        xmlResetLastError();
41556        if (mem_base != xmlMemBlocks()) {
41557            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41558	           xmlMemBlocks() - mem_base);
41559	    test_ret++;
41560            printf(" %d", n_code);
41561            printf("\n");
41562        }
41563    }
41564    function_tests++;
41565#endif
41566
41567    return(test_ret);
41568}
41569
41570
41571static int
41572test_xmlUCSIsSpecials(void) {
41573    int test_ret = 0;
41574
41575#if defined(LIBXML_UNICODE_ENABLED)
41576    int mem_base;
41577    int ret_val;
41578    int code; /* UCS code point */
41579    int n_code;
41580
41581    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41582        mem_base = xmlMemBlocks();
41583        code = gen_int(n_code, 0);
41584
41585        ret_val = xmlUCSIsSpecials(code);
41586        desret_int(ret_val);
41587        call_tests++;
41588        des_int(n_code, code, 0);
41589        xmlResetLastError();
41590        if (mem_base != xmlMemBlocks()) {
41591            printf("Leak of %d blocks found in xmlUCSIsSpecials",
41592	           xmlMemBlocks() - mem_base);
41593	    test_ret++;
41594            printf(" %d", n_code);
41595            printf("\n");
41596        }
41597    }
41598    function_tests++;
41599#endif
41600
41601    return(test_ret);
41602}
41603
41604
41605static int
41606test_xmlUCSIsSuperscriptsandSubscripts(void) {
41607    int test_ret = 0;
41608
41609#if defined(LIBXML_UNICODE_ENABLED)
41610    int mem_base;
41611    int ret_val;
41612    int code; /* UCS code point */
41613    int n_code;
41614
41615    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41616        mem_base = xmlMemBlocks();
41617        code = gen_int(n_code, 0);
41618
41619        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41620        desret_int(ret_val);
41621        call_tests++;
41622        des_int(n_code, code, 0);
41623        xmlResetLastError();
41624        if (mem_base != xmlMemBlocks()) {
41625            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41626	           xmlMemBlocks() - mem_base);
41627	    test_ret++;
41628            printf(" %d", n_code);
41629            printf("\n");
41630        }
41631    }
41632    function_tests++;
41633#endif
41634
41635    return(test_ret);
41636}
41637
41638
41639static int
41640test_xmlUCSIsSupplementalArrowsA(void) {
41641    int test_ret = 0;
41642
41643#if defined(LIBXML_UNICODE_ENABLED)
41644    int mem_base;
41645    int ret_val;
41646    int code; /* UCS code point */
41647    int n_code;
41648
41649    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41650        mem_base = xmlMemBlocks();
41651        code = gen_int(n_code, 0);
41652
41653        ret_val = xmlUCSIsSupplementalArrowsA(code);
41654        desret_int(ret_val);
41655        call_tests++;
41656        des_int(n_code, code, 0);
41657        xmlResetLastError();
41658        if (mem_base != xmlMemBlocks()) {
41659            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41660	           xmlMemBlocks() - mem_base);
41661	    test_ret++;
41662            printf(" %d", n_code);
41663            printf("\n");
41664        }
41665    }
41666    function_tests++;
41667#endif
41668
41669    return(test_ret);
41670}
41671
41672
41673static int
41674test_xmlUCSIsSupplementalArrowsB(void) {
41675    int test_ret = 0;
41676
41677#if defined(LIBXML_UNICODE_ENABLED)
41678    int mem_base;
41679    int ret_val;
41680    int code; /* UCS code point */
41681    int n_code;
41682
41683    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41684        mem_base = xmlMemBlocks();
41685        code = gen_int(n_code, 0);
41686
41687        ret_val = xmlUCSIsSupplementalArrowsB(code);
41688        desret_int(ret_val);
41689        call_tests++;
41690        des_int(n_code, code, 0);
41691        xmlResetLastError();
41692        if (mem_base != xmlMemBlocks()) {
41693            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41694	           xmlMemBlocks() - mem_base);
41695	    test_ret++;
41696            printf(" %d", n_code);
41697            printf("\n");
41698        }
41699    }
41700    function_tests++;
41701#endif
41702
41703    return(test_ret);
41704}
41705
41706
41707static int
41708test_xmlUCSIsSupplementalMathematicalOperators(void) {
41709    int test_ret = 0;
41710
41711#if defined(LIBXML_UNICODE_ENABLED)
41712    int mem_base;
41713    int ret_val;
41714    int code; /* UCS code point */
41715    int n_code;
41716
41717    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41718        mem_base = xmlMemBlocks();
41719        code = gen_int(n_code, 0);
41720
41721        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41722        desret_int(ret_val);
41723        call_tests++;
41724        des_int(n_code, code, 0);
41725        xmlResetLastError();
41726        if (mem_base != xmlMemBlocks()) {
41727            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41728	           xmlMemBlocks() - mem_base);
41729	    test_ret++;
41730            printf(" %d", n_code);
41731            printf("\n");
41732        }
41733    }
41734    function_tests++;
41735#endif
41736
41737    return(test_ret);
41738}
41739
41740
41741static int
41742test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41743    int test_ret = 0;
41744
41745#if defined(LIBXML_UNICODE_ENABLED)
41746    int mem_base;
41747    int ret_val;
41748    int code; /* UCS code point */
41749    int n_code;
41750
41751    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41752        mem_base = xmlMemBlocks();
41753        code = gen_int(n_code, 0);
41754
41755        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41756        desret_int(ret_val);
41757        call_tests++;
41758        des_int(n_code, code, 0);
41759        xmlResetLastError();
41760        if (mem_base != xmlMemBlocks()) {
41761            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41762	           xmlMemBlocks() - mem_base);
41763	    test_ret++;
41764            printf(" %d", n_code);
41765            printf("\n");
41766        }
41767    }
41768    function_tests++;
41769#endif
41770
41771    return(test_ret);
41772}
41773
41774
41775static int
41776test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
41777    int test_ret = 0;
41778
41779#if defined(LIBXML_UNICODE_ENABLED)
41780    int mem_base;
41781    int ret_val;
41782    int code; /* UCS code point */
41783    int n_code;
41784
41785    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41786        mem_base = xmlMemBlocks();
41787        code = gen_int(n_code, 0);
41788
41789        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
41790        desret_int(ret_val);
41791        call_tests++;
41792        des_int(n_code, code, 0);
41793        xmlResetLastError();
41794        if (mem_base != xmlMemBlocks()) {
41795            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
41796	           xmlMemBlocks() - mem_base);
41797	    test_ret++;
41798            printf(" %d", n_code);
41799            printf("\n");
41800        }
41801    }
41802    function_tests++;
41803#endif
41804
41805    return(test_ret);
41806}
41807
41808
41809static int
41810test_xmlUCSIsSyriac(void) {
41811    int test_ret = 0;
41812
41813#if defined(LIBXML_UNICODE_ENABLED)
41814    int mem_base;
41815    int ret_val;
41816    int code; /* UCS code point */
41817    int n_code;
41818
41819    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41820        mem_base = xmlMemBlocks();
41821        code = gen_int(n_code, 0);
41822
41823        ret_val = xmlUCSIsSyriac(code);
41824        desret_int(ret_val);
41825        call_tests++;
41826        des_int(n_code, code, 0);
41827        xmlResetLastError();
41828        if (mem_base != xmlMemBlocks()) {
41829            printf("Leak of %d blocks found in xmlUCSIsSyriac",
41830	           xmlMemBlocks() - mem_base);
41831	    test_ret++;
41832            printf(" %d", n_code);
41833            printf("\n");
41834        }
41835    }
41836    function_tests++;
41837#endif
41838
41839    return(test_ret);
41840}
41841
41842
41843static int
41844test_xmlUCSIsTagalog(void) {
41845    int test_ret = 0;
41846
41847#if defined(LIBXML_UNICODE_ENABLED)
41848    int mem_base;
41849    int ret_val;
41850    int code; /* UCS code point */
41851    int n_code;
41852
41853    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41854        mem_base = xmlMemBlocks();
41855        code = gen_int(n_code, 0);
41856
41857        ret_val = xmlUCSIsTagalog(code);
41858        desret_int(ret_val);
41859        call_tests++;
41860        des_int(n_code, code, 0);
41861        xmlResetLastError();
41862        if (mem_base != xmlMemBlocks()) {
41863            printf("Leak of %d blocks found in xmlUCSIsTagalog",
41864	           xmlMemBlocks() - mem_base);
41865	    test_ret++;
41866            printf(" %d", n_code);
41867            printf("\n");
41868        }
41869    }
41870    function_tests++;
41871#endif
41872
41873    return(test_ret);
41874}
41875
41876
41877static int
41878test_xmlUCSIsTagbanwa(void) {
41879    int test_ret = 0;
41880
41881#if defined(LIBXML_UNICODE_ENABLED)
41882    int mem_base;
41883    int ret_val;
41884    int code; /* UCS code point */
41885    int n_code;
41886
41887    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41888        mem_base = xmlMemBlocks();
41889        code = gen_int(n_code, 0);
41890
41891        ret_val = xmlUCSIsTagbanwa(code);
41892        desret_int(ret_val);
41893        call_tests++;
41894        des_int(n_code, code, 0);
41895        xmlResetLastError();
41896        if (mem_base != xmlMemBlocks()) {
41897            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
41898	           xmlMemBlocks() - mem_base);
41899	    test_ret++;
41900            printf(" %d", n_code);
41901            printf("\n");
41902        }
41903    }
41904    function_tests++;
41905#endif
41906
41907    return(test_ret);
41908}
41909
41910
41911static int
41912test_xmlUCSIsTags(void) {
41913    int test_ret = 0;
41914
41915#if defined(LIBXML_UNICODE_ENABLED)
41916    int mem_base;
41917    int ret_val;
41918    int code; /* UCS code point */
41919    int n_code;
41920
41921    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41922        mem_base = xmlMemBlocks();
41923        code = gen_int(n_code, 0);
41924
41925        ret_val = xmlUCSIsTags(code);
41926        desret_int(ret_val);
41927        call_tests++;
41928        des_int(n_code, code, 0);
41929        xmlResetLastError();
41930        if (mem_base != xmlMemBlocks()) {
41931            printf("Leak of %d blocks found in xmlUCSIsTags",
41932	           xmlMemBlocks() - mem_base);
41933	    test_ret++;
41934            printf(" %d", n_code);
41935            printf("\n");
41936        }
41937    }
41938    function_tests++;
41939#endif
41940
41941    return(test_ret);
41942}
41943
41944
41945static int
41946test_xmlUCSIsTaiLe(void) {
41947    int test_ret = 0;
41948
41949#if defined(LIBXML_UNICODE_ENABLED)
41950    int mem_base;
41951    int ret_val;
41952    int code; /* UCS code point */
41953    int n_code;
41954
41955    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41956        mem_base = xmlMemBlocks();
41957        code = gen_int(n_code, 0);
41958
41959        ret_val = xmlUCSIsTaiLe(code);
41960        desret_int(ret_val);
41961        call_tests++;
41962        des_int(n_code, code, 0);
41963        xmlResetLastError();
41964        if (mem_base != xmlMemBlocks()) {
41965            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
41966	           xmlMemBlocks() - mem_base);
41967	    test_ret++;
41968            printf(" %d", n_code);
41969            printf("\n");
41970        }
41971    }
41972    function_tests++;
41973#endif
41974
41975    return(test_ret);
41976}
41977
41978
41979static int
41980test_xmlUCSIsTaiXuanJingSymbols(void) {
41981    int test_ret = 0;
41982
41983#if defined(LIBXML_UNICODE_ENABLED)
41984    int mem_base;
41985    int ret_val;
41986    int code; /* UCS code point */
41987    int n_code;
41988
41989    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41990        mem_base = xmlMemBlocks();
41991        code = gen_int(n_code, 0);
41992
41993        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
41994        desret_int(ret_val);
41995        call_tests++;
41996        des_int(n_code, code, 0);
41997        xmlResetLastError();
41998        if (mem_base != xmlMemBlocks()) {
41999            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42000	           xmlMemBlocks() - mem_base);
42001	    test_ret++;
42002            printf(" %d", n_code);
42003            printf("\n");
42004        }
42005    }
42006    function_tests++;
42007#endif
42008
42009    return(test_ret);
42010}
42011
42012
42013static int
42014test_xmlUCSIsTamil(void) {
42015    int test_ret = 0;
42016
42017#if defined(LIBXML_UNICODE_ENABLED)
42018    int mem_base;
42019    int ret_val;
42020    int code; /* UCS code point */
42021    int n_code;
42022
42023    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42024        mem_base = xmlMemBlocks();
42025        code = gen_int(n_code, 0);
42026
42027        ret_val = xmlUCSIsTamil(code);
42028        desret_int(ret_val);
42029        call_tests++;
42030        des_int(n_code, code, 0);
42031        xmlResetLastError();
42032        if (mem_base != xmlMemBlocks()) {
42033            printf("Leak of %d blocks found in xmlUCSIsTamil",
42034	           xmlMemBlocks() - mem_base);
42035	    test_ret++;
42036            printf(" %d", n_code);
42037            printf("\n");
42038        }
42039    }
42040    function_tests++;
42041#endif
42042
42043    return(test_ret);
42044}
42045
42046
42047static int
42048test_xmlUCSIsTelugu(void) {
42049    int test_ret = 0;
42050
42051#if defined(LIBXML_UNICODE_ENABLED)
42052    int mem_base;
42053    int ret_val;
42054    int code; /* UCS code point */
42055    int n_code;
42056
42057    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42058        mem_base = xmlMemBlocks();
42059        code = gen_int(n_code, 0);
42060
42061        ret_val = xmlUCSIsTelugu(code);
42062        desret_int(ret_val);
42063        call_tests++;
42064        des_int(n_code, code, 0);
42065        xmlResetLastError();
42066        if (mem_base != xmlMemBlocks()) {
42067            printf("Leak of %d blocks found in xmlUCSIsTelugu",
42068	           xmlMemBlocks() - mem_base);
42069	    test_ret++;
42070            printf(" %d", n_code);
42071            printf("\n");
42072        }
42073    }
42074    function_tests++;
42075#endif
42076
42077    return(test_ret);
42078}
42079
42080
42081static int
42082test_xmlUCSIsThaana(void) {
42083    int test_ret = 0;
42084
42085#if defined(LIBXML_UNICODE_ENABLED)
42086    int mem_base;
42087    int ret_val;
42088    int code; /* UCS code point */
42089    int n_code;
42090
42091    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42092        mem_base = xmlMemBlocks();
42093        code = gen_int(n_code, 0);
42094
42095        ret_val = xmlUCSIsThaana(code);
42096        desret_int(ret_val);
42097        call_tests++;
42098        des_int(n_code, code, 0);
42099        xmlResetLastError();
42100        if (mem_base != xmlMemBlocks()) {
42101            printf("Leak of %d blocks found in xmlUCSIsThaana",
42102	           xmlMemBlocks() - mem_base);
42103	    test_ret++;
42104            printf(" %d", n_code);
42105            printf("\n");
42106        }
42107    }
42108    function_tests++;
42109#endif
42110
42111    return(test_ret);
42112}
42113
42114
42115static int
42116test_xmlUCSIsThai(void) {
42117    int test_ret = 0;
42118
42119#if defined(LIBXML_UNICODE_ENABLED)
42120    int mem_base;
42121    int ret_val;
42122    int code; /* UCS code point */
42123    int n_code;
42124
42125    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42126        mem_base = xmlMemBlocks();
42127        code = gen_int(n_code, 0);
42128
42129        ret_val = xmlUCSIsThai(code);
42130        desret_int(ret_val);
42131        call_tests++;
42132        des_int(n_code, code, 0);
42133        xmlResetLastError();
42134        if (mem_base != xmlMemBlocks()) {
42135            printf("Leak of %d blocks found in xmlUCSIsThai",
42136	           xmlMemBlocks() - mem_base);
42137	    test_ret++;
42138            printf(" %d", n_code);
42139            printf("\n");
42140        }
42141    }
42142    function_tests++;
42143#endif
42144
42145    return(test_ret);
42146}
42147
42148
42149static int
42150test_xmlUCSIsTibetan(void) {
42151    int test_ret = 0;
42152
42153#if defined(LIBXML_UNICODE_ENABLED)
42154    int mem_base;
42155    int ret_val;
42156    int code; /* UCS code point */
42157    int n_code;
42158
42159    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42160        mem_base = xmlMemBlocks();
42161        code = gen_int(n_code, 0);
42162
42163        ret_val = xmlUCSIsTibetan(code);
42164        desret_int(ret_val);
42165        call_tests++;
42166        des_int(n_code, code, 0);
42167        xmlResetLastError();
42168        if (mem_base != xmlMemBlocks()) {
42169            printf("Leak of %d blocks found in xmlUCSIsTibetan",
42170	           xmlMemBlocks() - mem_base);
42171	    test_ret++;
42172            printf(" %d", n_code);
42173            printf("\n");
42174        }
42175    }
42176    function_tests++;
42177#endif
42178
42179    return(test_ret);
42180}
42181
42182
42183static int
42184test_xmlUCSIsUgaritic(void) {
42185    int test_ret = 0;
42186
42187#if defined(LIBXML_UNICODE_ENABLED)
42188    int mem_base;
42189    int ret_val;
42190    int code; /* UCS code point */
42191    int n_code;
42192
42193    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42194        mem_base = xmlMemBlocks();
42195        code = gen_int(n_code, 0);
42196
42197        ret_val = xmlUCSIsUgaritic(code);
42198        desret_int(ret_val);
42199        call_tests++;
42200        des_int(n_code, code, 0);
42201        xmlResetLastError();
42202        if (mem_base != xmlMemBlocks()) {
42203            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42204	           xmlMemBlocks() - mem_base);
42205	    test_ret++;
42206            printf(" %d", n_code);
42207            printf("\n");
42208        }
42209    }
42210    function_tests++;
42211#endif
42212
42213    return(test_ret);
42214}
42215
42216
42217static int
42218test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42219    int test_ret = 0;
42220
42221#if defined(LIBXML_UNICODE_ENABLED)
42222    int mem_base;
42223    int ret_val;
42224    int code; /* UCS code point */
42225    int n_code;
42226
42227    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42228        mem_base = xmlMemBlocks();
42229        code = gen_int(n_code, 0);
42230
42231        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42232        desret_int(ret_val);
42233        call_tests++;
42234        des_int(n_code, code, 0);
42235        xmlResetLastError();
42236        if (mem_base != xmlMemBlocks()) {
42237            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42238	           xmlMemBlocks() - mem_base);
42239	    test_ret++;
42240            printf(" %d", n_code);
42241            printf("\n");
42242        }
42243    }
42244    function_tests++;
42245#endif
42246
42247    return(test_ret);
42248}
42249
42250
42251static int
42252test_xmlUCSIsVariationSelectors(void) {
42253    int test_ret = 0;
42254
42255#if defined(LIBXML_UNICODE_ENABLED)
42256    int mem_base;
42257    int ret_val;
42258    int code; /* UCS code point */
42259    int n_code;
42260
42261    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42262        mem_base = xmlMemBlocks();
42263        code = gen_int(n_code, 0);
42264
42265        ret_val = xmlUCSIsVariationSelectors(code);
42266        desret_int(ret_val);
42267        call_tests++;
42268        des_int(n_code, code, 0);
42269        xmlResetLastError();
42270        if (mem_base != xmlMemBlocks()) {
42271            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42272	           xmlMemBlocks() - mem_base);
42273	    test_ret++;
42274            printf(" %d", n_code);
42275            printf("\n");
42276        }
42277    }
42278    function_tests++;
42279#endif
42280
42281    return(test_ret);
42282}
42283
42284
42285static int
42286test_xmlUCSIsVariationSelectorsSupplement(void) {
42287    int test_ret = 0;
42288
42289#if defined(LIBXML_UNICODE_ENABLED)
42290    int mem_base;
42291    int ret_val;
42292    int code; /* UCS code point */
42293    int n_code;
42294
42295    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42296        mem_base = xmlMemBlocks();
42297        code = gen_int(n_code, 0);
42298
42299        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42300        desret_int(ret_val);
42301        call_tests++;
42302        des_int(n_code, code, 0);
42303        xmlResetLastError();
42304        if (mem_base != xmlMemBlocks()) {
42305            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42306	           xmlMemBlocks() - mem_base);
42307	    test_ret++;
42308            printf(" %d", n_code);
42309            printf("\n");
42310        }
42311    }
42312    function_tests++;
42313#endif
42314
42315    return(test_ret);
42316}
42317
42318
42319static int
42320test_xmlUCSIsYiRadicals(void) {
42321    int test_ret = 0;
42322
42323#if defined(LIBXML_UNICODE_ENABLED)
42324    int mem_base;
42325    int ret_val;
42326    int code; /* UCS code point */
42327    int n_code;
42328
42329    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42330        mem_base = xmlMemBlocks();
42331        code = gen_int(n_code, 0);
42332
42333        ret_val = xmlUCSIsYiRadicals(code);
42334        desret_int(ret_val);
42335        call_tests++;
42336        des_int(n_code, code, 0);
42337        xmlResetLastError();
42338        if (mem_base != xmlMemBlocks()) {
42339            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42340	           xmlMemBlocks() - mem_base);
42341	    test_ret++;
42342            printf(" %d", n_code);
42343            printf("\n");
42344        }
42345    }
42346    function_tests++;
42347#endif
42348
42349    return(test_ret);
42350}
42351
42352
42353static int
42354test_xmlUCSIsYiSyllables(void) {
42355    int test_ret = 0;
42356
42357#if defined(LIBXML_UNICODE_ENABLED)
42358    int mem_base;
42359    int ret_val;
42360    int code; /* UCS code point */
42361    int n_code;
42362
42363    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42364        mem_base = xmlMemBlocks();
42365        code = gen_int(n_code, 0);
42366
42367        ret_val = xmlUCSIsYiSyllables(code);
42368        desret_int(ret_val);
42369        call_tests++;
42370        des_int(n_code, code, 0);
42371        xmlResetLastError();
42372        if (mem_base != xmlMemBlocks()) {
42373            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42374	           xmlMemBlocks() - mem_base);
42375	    test_ret++;
42376            printf(" %d", n_code);
42377            printf("\n");
42378        }
42379    }
42380    function_tests++;
42381#endif
42382
42383    return(test_ret);
42384}
42385
42386
42387static int
42388test_xmlUCSIsYijingHexagramSymbols(void) {
42389    int test_ret = 0;
42390
42391#if defined(LIBXML_UNICODE_ENABLED)
42392    int mem_base;
42393    int ret_val;
42394    int code; /* UCS code point */
42395    int n_code;
42396
42397    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42398        mem_base = xmlMemBlocks();
42399        code = gen_int(n_code, 0);
42400
42401        ret_val = xmlUCSIsYijingHexagramSymbols(code);
42402        desret_int(ret_val);
42403        call_tests++;
42404        des_int(n_code, code, 0);
42405        xmlResetLastError();
42406        if (mem_base != xmlMemBlocks()) {
42407            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42408	           xmlMemBlocks() - mem_base);
42409	    test_ret++;
42410            printf(" %d", n_code);
42411            printf("\n");
42412        }
42413    }
42414    function_tests++;
42415#endif
42416
42417    return(test_ret);
42418}
42419
42420static int
42421test_xmlunicode(void) {
42422    int test_ret = 0;
42423
42424    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42425    test_ret += test_xmlUCSIsAegeanNumbers();
42426    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42427    test_ret += test_xmlUCSIsArabic();
42428    test_ret += test_xmlUCSIsArabicPresentationFormsA();
42429    test_ret += test_xmlUCSIsArabicPresentationFormsB();
42430    test_ret += test_xmlUCSIsArmenian();
42431    test_ret += test_xmlUCSIsArrows();
42432    test_ret += test_xmlUCSIsBasicLatin();
42433    test_ret += test_xmlUCSIsBengali();
42434    test_ret += test_xmlUCSIsBlock();
42435    test_ret += test_xmlUCSIsBlockElements();
42436    test_ret += test_xmlUCSIsBopomofo();
42437    test_ret += test_xmlUCSIsBopomofoExtended();
42438    test_ret += test_xmlUCSIsBoxDrawing();
42439    test_ret += test_xmlUCSIsBraillePatterns();
42440    test_ret += test_xmlUCSIsBuhid();
42441    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42442    test_ret += test_xmlUCSIsCJKCompatibility();
42443    test_ret += test_xmlUCSIsCJKCompatibilityForms();
42444    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42445    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42446    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42447    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42448    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42449    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42450    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42451    test_ret += test_xmlUCSIsCat();
42452    test_ret += test_xmlUCSIsCatC();
42453    test_ret += test_xmlUCSIsCatCc();
42454    test_ret += test_xmlUCSIsCatCf();
42455    test_ret += test_xmlUCSIsCatCo();
42456    test_ret += test_xmlUCSIsCatCs();
42457    test_ret += test_xmlUCSIsCatL();
42458    test_ret += test_xmlUCSIsCatLl();
42459    test_ret += test_xmlUCSIsCatLm();
42460    test_ret += test_xmlUCSIsCatLo();
42461    test_ret += test_xmlUCSIsCatLt();
42462    test_ret += test_xmlUCSIsCatLu();
42463    test_ret += test_xmlUCSIsCatM();
42464    test_ret += test_xmlUCSIsCatMc();
42465    test_ret += test_xmlUCSIsCatMe();
42466    test_ret += test_xmlUCSIsCatMn();
42467    test_ret += test_xmlUCSIsCatN();
42468    test_ret += test_xmlUCSIsCatNd();
42469    test_ret += test_xmlUCSIsCatNl();
42470    test_ret += test_xmlUCSIsCatNo();
42471    test_ret += test_xmlUCSIsCatP();
42472    test_ret += test_xmlUCSIsCatPc();
42473    test_ret += test_xmlUCSIsCatPd();
42474    test_ret += test_xmlUCSIsCatPe();
42475    test_ret += test_xmlUCSIsCatPf();
42476    test_ret += test_xmlUCSIsCatPi();
42477    test_ret += test_xmlUCSIsCatPo();
42478    test_ret += test_xmlUCSIsCatPs();
42479    test_ret += test_xmlUCSIsCatS();
42480    test_ret += test_xmlUCSIsCatSc();
42481    test_ret += test_xmlUCSIsCatSk();
42482    test_ret += test_xmlUCSIsCatSm();
42483    test_ret += test_xmlUCSIsCatSo();
42484    test_ret += test_xmlUCSIsCatZ();
42485    test_ret += test_xmlUCSIsCatZl();
42486    test_ret += test_xmlUCSIsCatZp();
42487    test_ret += test_xmlUCSIsCatZs();
42488    test_ret += test_xmlUCSIsCherokee();
42489    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42490    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42491    test_ret += test_xmlUCSIsCombiningHalfMarks();
42492    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42493    test_ret += test_xmlUCSIsControlPictures();
42494    test_ret += test_xmlUCSIsCurrencySymbols();
42495    test_ret += test_xmlUCSIsCypriotSyllabary();
42496    test_ret += test_xmlUCSIsCyrillic();
42497    test_ret += test_xmlUCSIsCyrillicSupplement();
42498    test_ret += test_xmlUCSIsDeseret();
42499    test_ret += test_xmlUCSIsDevanagari();
42500    test_ret += test_xmlUCSIsDingbats();
42501    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42502    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42503    test_ret += test_xmlUCSIsEthiopic();
42504    test_ret += test_xmlUCSIsGeneralPunctuation();
42505    test_ret += test_xmlUCSIsGeometricShapes();
42506    test_ret += test_xmlUCSIsGeorgian();
42507    test_ret += test_xmlUCSIsGothic();
42508    test_ret += test_xmlUCSIsGreek();
42509    test_ret += test_xmlUCSIsGreekExtended();
42510    test_ret += test_xmlUCSIsGreekandCoptic();
42511    test_ret += test_xmlUCSIsGujarati();
42512    test_ret += test_xmlUCSIsGurmukhi();
42513    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42514    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42515    test_ret += test_xmlUCSIsHangulJamo();
42516    test_ret += test_xmlUCSIsHangulSyllables();
42517    test_ret += test_xmlUCSIsHanunoo();
42518    test_ret += test_xmlUCSIsHebrew();
42519    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42520    test_ret += test_xmlUCSIsHighSurrogates();
42521    test_ret += test_xmlUCSIsHiragana();
42522    test_ret += test_xmlUCSIsIPAExtensions();
42523    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42524    test_ret += test_xmlUCSIsKanbun();
42525    test_ret += test_xmlUCSIsKangxiRadicals();
42526    test_ret += test_xmlUCSIsKannada();
42527    test_ret += test_xmlUCSIsKatakana();
42528    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42529    test_ret += test_xmlUCSIsKhmer();
42530    test_ret += test_xmlUCSIsKhmerSymbols();
42531    test_ret += test_xmlUCSIsLao();
42532    test_ret += test_xmlUCSIsLatin1Supplement();
42533    test_ret += test_xmlUCSIsLatinExtendedA();
42534    test_ret += test_xmlUCSIsLatinExtendedAdditional();
42535    test_ret += test_xmlUCSIsLatinExtendedB();
42536    test_ret += test_xmlUCSIsLetterlikeSymbols();
42537    test_ret += test_xmlUCSIsLimbu();
42538    test_ret += test_xmlUCSIsLinearBIdeograms();
42539    test_ret += test_xmlUCSIsLinearBSyllabary();
42540    test_ret += test_xmlUCSIsLowSurrogates();
42541    test_ret += test_xmlUCSIsMalayalam();
42542    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42543    test_ret += test_xmlUCSIsMathematicalOperators();
42544    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42545    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42546    test_ret += test_xmlUCSIsMiscellaneousSymbols();
42547    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42548    test_ret += test_xmlUCSIsMiscellaneousTechnical();
42549    test_ret += test_xmlUCSIsMongolian();
42550    test_ret += test_xmlUCSIsMusicalSymbols();
42551    test_ret += test_xmlUCSIsMyanmar();
42552    test_ret += test_xmlUCSIsNumberForms();
42553    test_ret += test_xmlUCSIsOgham();
42554    test_ret += test_xmlUCSIsOldItalic();
42555    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42556    test_ret += test_xmlUCSIsOriya();
42557    test_ret += test_xmlUCSIsOsmanya();
42558    test_ret += test_xmlUCSIsPhoneticExtensions();
42559    test_ret += test_xmlUCSIsPrivateUse();
42560    test_ret += test_xmlUCSIsPrivateUseArea();
42561    test_ret += test_xmlUCSIsRunic();
42562    test_ret += test_xmlUCSIsShavian();
42563    test_ret += test_xmlUCSIsSinhala();
42564    test_ret += test_xmlUCSIsSmallFormVariants();
42565    test_ret += test_xmlUCSIsSpacingModifierLetters();
42566    test_ret += test_xmlUCSIsSpecials();
42567    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42568    test_ret += test_xmlUCSIsSupplementalArrowsA();
42569    test_ret += test_xmlUCSIsSupplementalArrowsB();
42570    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42571    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42572    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42573    test_ret += test_xmlUCSIsSyriac();
42574    test_ret += test_xmlUCSIsTagalog();
42575    test_ret += test_xmlUCSIsTagbanwa();
42576    test_ret += test_xmlUCSIsTags();
42577    test_ret += test_xmlUCSIsTaiLe();
42578    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42579    test_ret += test_xmlUCSIsTamil();
42580    test_ret += test_xmlUCSIsTelugu();
42581    test_ret += test_xmlUCSIsThaana();
42582    test_ret += test_xmlUCSIsThai();
42583    test_ret += test_xmlUCSIsTibetan();
42584    test_ret += test_xmlUCSIsUgaritic();
42585    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42586    test_ret += test_xmlUCSIsVariationSelectors();
42587    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42588    test_ret += test_xmlUCSIsYiRadicals();
42589    test_ret += test_xmlUCSIsYiSyllables();
42590    test_ret += test_xmlUCSIsYijingHexagramSymbols();
42591
42592    if (test_ret != 0)
42593	printf("Module xmlunicode: %d errors\n", test_ret);
42594    return(test_ret);
42595}
42596
42597static int
42598test_xmlNewTextWriter(void) {
42599    int test_ret = 0;
42600
42601#if defined(LIBXML_WRITER_ENABLED)
42602    int mem_base;
42603    xmlTextWriterPtr ret_val;
42604    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42605    int n_out;
42606
42607    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42608        mem_base = xmlMemBlocks();
42609        out = gen_xmlOutputBufferPtr(n_out, 0);
42610
42611        ret_val = xmlNewTextWriter(out);
42612        if (ret_val != NULL) out = NULL;
42613        desret_xmlTextWriterPtr(ret_val);
42614        call_tests++;
42615        des_xmlOutputBufferPtr(n_out, out, 0);
42616        xmlResetLastError();
42617        if (mem_base != xmlMemBlocks()) {
42618            printf("Leak of %d blocks found in xmlNewTextWriter",
42619	           xmlMemBlocks() - mem_base);
42620	    test_ret++;
42621            printf(" %d", n_out);
42622            printf("\n");
42623        }
42624    }
42625    function_tests++;
42626#endif
42627
42628    return(test_ret);
42629}
42630
42631
42632static int
42633test_xmlNewTextWriterFilename(void) {
42634    int test_ret = 0;
42635
42636#if defined(LIBXML_WRITER_ENABLED)
42637    int mem_base;
42638    xmlTextWriterPtr ret_val;
42639    const char * uri; /* the URI of the resource for the output */
42640    int n_uri;
42641    int compression; /* compress the output? */
42642    int n_compression;
42643
42644    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42645    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42646        mem_base = xmlMemBlocks();
42647        uri = gen_fileoutput(n_uri, 0);
42648        compression = gen_int(n_compression, 1);
42649
42650        ret_val = xmlNewTextWriterFilename(uri, compression);
42651        desret_xmlTextWriterPtr(ret_val);
42652        call_tests++;
42653        des_fileoutput(n_uri, uri, 0);
42654        des_int(n_compression, compression, 1);
42655        xmlResetLastError();
42656        if (mem_base != xmlMemBlocks()) {
42657            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42658	           xmlMemBlocks() - mem_base);
42659	    test_ret++;
42660            printf(" %d", n_uri);
42661            printf(" %d", n_compression);
42662            printf("\n");
42663        }
42664    }
42665    }
42666    function_tests++;
42667#endif
42668
42669    return(test_ret);
42670}
42671
42672
42673static int
42674test_xmlNewTextWriterMemory(void) {
42675    int test_ret = 0;
42676
42677#if defined(LIBXML_WRITER_ENABLED)
42678    int mem_base;
42679    xmlTextWriterPtr ret_val;
42680    xmlBufferPtr buf; /* xmlBufferPtr */
42681    int n_buf;
42682    int compression; /* compress the output? */
42683    int n_compression;
42684
42685    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42686    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42687        mem_base = xmlMemBlocks();
42688        buf = gen_xmlBufferPtr(n_buf, 0);
42689        compression = gen_int(n_compression, 1);
42690
42691        ret_val = xmlNewTextWriterMemory(buf, compression);
42692        desret_xmlTextWriterPtr(ret_val);
42693        call_tests++;
42694        des_xmlBufferPtr(n_buf, buf, 0);
42695        des_int(n_compression, compression, 1);
42696        xmlResetLastError();
42697        if (mem_base != xmlMemBlocks()) {
42698            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42699	           xmlMemBlocks() - mem_base);
42700	    test_ret++;
42701            printf(" %d", n_buf);
42702            printf(" %d", n_compression);
42703            printf("\n");
42704        }
42705    }
42706    }
42707    function_tests++;
42708#endif
42709
42710    return(test_ret);
42711}
42712
42713
42714static int
42715test_xmlNewTextWriterPushParser(void) {
42716    int test_ret = 0;
42717
42718#if defined(LIBXML_WRITER_ENABLED)
42719    int mem_base;
42720    xmlTextWriterPtr ret_val;
42721    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42722    int n_ctxt;
42723    int compression; /* compress the output? */
42724    int n_compression;
42725
42726    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42727    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42728        mem_base = xmlMemBlocks();
42729        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42730        compression = gen_int(n_compression, 1);
42731
42732        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42733        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42734        desret_xmlTextWriterPtr(ret_val);
42735        call_tests++;
42736        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42737        des_int(n_compression, compression, 1);
42738        xmlResetLastError();
42739        if (mem_base != xmlMemBlocks()) {
42740            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42741	           xmlMemBlocks() - mem_base);
42742	    test_ret++;
42743            printf(" %d", n_ctxt);
42744            printf(" %d", n_compression);
42745            printf("\n");
42746        }
42747    }
42748    }
42749    function_tests++;
42750#endif
42751
42752    return(test_ret);
42753}
42754
42755
42756static int
42757test_xmlNewTextWriterTree(void) {
42758    int test_ret = 0;
42759
42760#if defined(LIBXML_WRITER_ENABLED)
42761    int mem_base;
42762    xmlTextWriterPtr ret_val;
42763    xmlDocPtr doc; /* xmlDocPtr */
42764    int n_doc;
42765    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42766    int n_node;
42767    int compression; /* compress the output? */
42768    int n_compression;
42769
42770    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42771    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42772    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42773        mem_base = xmlMemBlocks();
42774        doc = gen_xmlDocPtr(n_doc, 0);
42775        node = gen_xmlNodePtr(n_node, 1);
42776        compression = gen_int(n_compression, 2);
42777
42778        ret_val = xmlNewTextWriterTree(doc, node, compression);
42779        desret_xmlTextWriterPtr(ret_val);
42780        call_tests++;
42781        des_xmlDocPtr(n_doc, doc, 0);
42782        des_xmlNodePtr(n_node, node, 1);
42783        des_int(n_compression, compression, 2);
42784        xmlResetLastError();
42785        if (mem_base != xmlMemBlocks()) {
42786            printf("Leak of %d blocks found in xmlNewTextWriterTree",
42787	           xmlMemBlocks() - mem_base);
42788	    test_ret++;
42789            printf(" %d", n_doc);
42790            printf(" %d", n_node);
42791            printf(" %d", n_compression);
42792            printf("\n");
42793        }
42794    }
42795    }
42796    }
42797    function_tests++;
42798#endif
42799
42800    return(test_ret);
42801}
42802
42803
42804static int
42805test_xmlTextWriterEndAttribute(void) {
42806    int test_ret = 0;
42807
42808#if defined(LIBXML_WRITER_ENABLED)
42809    int mem_base;
42810    int ret_val;
42811    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42812    int n_writer;
42813
42814    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42815        mem_base = xmlMemBlocks();
42816        writer = gen_xmlTextWriterPtr(n_writer, 0);
42817
42818        ret_val = xmlTextWriterEndAttribute(writer);
42819        desret_int(ret_val);
42820        call_tests++;
42821        des_xmlTextWriterPtr(n_writer, writer, 0);
42822        xmlResetLastError();
42823        if (mem_base != xmlMemBlocks()) {
42824            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42825	           xmlMemBlocks() - mem_base);
42826	    test_ret++;
42827            printf(" %d", n_writer);
42828            printf("\n");
42829        }
42830    }
42831    function_tests++;
42832#endif
42833
42834    return(test_ret);
42835}
42836
42837
42838static int
42839test_xmlTextWriterEndCDATA(void) {
42840    int test_ret = 0;
42841
42842#if defined(LIBXML_WRITER_ENABLED)
42843    int mem_base;
42844    int ret_val;
42845    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42846    int n_writer;
42847
42848    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42849        mem_base = xmlMemBlocks();
42850        writer = gen_xmlTextWriterPtr(n_writer, 0);
42851
42852        ret_val = xmlTextWriterEndCDATA(writer);
42853        desret_int(ret_val);
42854        call_tests++;
42855        des_xmlTextWriterPtr(n_writer, writer, 0);
42856        xmlResetLastError();
42857        if (mem_base != xmlMemBlocks()) {
42858            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
42859	           xmlMemBlocks() - mem_base);
42860	    test_ret++;
42861            printf(" %d", n_writer);
42862            printf("\n");
42863        }
42864    }
42865    function_tests++;
42866#endif
42867
42868    return(test_ret);
42869}
42870
42871
42872static int
42873test_xmlTextWriterEndComment(void) {
42874    int test_ret = 0;
42875
42876#if defined(LIBXML_WRITER_ENABLED)
42877    int mem_base;
42878    int ret_val;
42879    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42880    int n_writer;
42881
42882    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42883        mem_base = xmlMemBlocks();
42884        writer = gen_xmlTextWriterPtr(n_writer, 0);
42885
42886        ret_val = xmlTextWriterEndComment(writer);
42887        desret_int(ret_val);
42888        call_tests++;
42889        des_xmlTextWriterPtr(n_writer, writer, 0);
42890        xmlResetLastError();
42891        if (mem_base != xmlMemBlocks()) {
42892            printf("Leak of %d blocks found in xmlTextWriterEndComment",
42893	           xmlMemBlocks() - mem_base);
42894	    test_ret++;
42895            printf(" %d", n_writer);
42896            printf("\n");
42897        }
42898    }
42899    function_tests++;
42900#endif
42901
42902    return(test_ret);
42903}
42904
42905
42906static int
42907test_xmlTextWriterEndDTD(void) {
42908    int test_ret = 0;
42909
42910#if defined(LIBXML_WRITER_ENABLED)
42911    int mem_base;
42912    int ret_val;
42913    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42914    int n_writer;
42915
42916    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42917        mem_base = xmlMemBlocks();
42918        writer = gen_xmlTextWriterPtr(n_writer, 0);
42919
42920        ret_val = xmlTextWriterEndDTD(writer);
42921        desret_int(ret_val);
42922        call_tests++;
42923        des_xmlTextWriterPtr(n_writer, writer, 0);
42924        xmlResetLastError();
42925        if (mem_base != xmlMemBlocks()) {
42926            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
42927	           xmlMemBlocks() - mem_base);
42928	    test_ret++;
42929            printf(" %d", n_writer);
42930            printf("\n");
42931        }
42932    }
42933    function_tests++;
42934#endif
42935
42936    return(test_ret);
42937}
42938
42939
42940static int
42941test_xmlTextWriterEndDTDAttlist(void) {
42942    int test_ret = 0;
42943
42944#if defined(LIBXML_WRITER_ENABLED)
42945    int mem_base;
42946    int ret_val;
42947    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42948    int n_writer;
42949
42950    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42951        mem_base = xmlMemBlocks();
42952        writer = gen_xmlTextWriterPtr(n_writer, 0);
42953
42954        ret_val = xmlTextWriterEndDTDAttlist(writer);
42955        desret_int(ret_val);
42956        call_tests++;
42957        des_xmlTextWriterPtr(n_writer, writer, 0);
42958        xmlResetLastError();
42959        if (mem_base != xmlMemBlocks()) {
42960            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
42961	           xmlMemBlocks() - mem_base);
42962	    test_ret++;
42963            printf(" %d", n_writer);
42964            printf("\n");
42965        }
42966    }
42967    function_tests++;
42968#endif
42969
42970    return(test_ret);
42971}
42972
42973
42974static int
42975test_xmlTextWriterEndDTDElement(void) {
42976    int test_ret = 0;
42977
42978#if defined(LIBXML_WRITER_ENABLED)
42979    int mem_base;
42980    int ret_val;
42981    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42982    int n_writer;
42983
42984    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42985        mem_base = xmlMemBlocks();
42986        writer = gen_xmlTextWriterPtr(n_writer, 0);
42987
42988        ret_val = xmlTextWriterEndDTDElement(writer);
42989        desret_int(ret_val);
42990        call_tests++;
42991        des_xmlTextWriterPtr(n_writer, writer, 0);
42992        xmlResetLastError();
42993        if (mem_base != xmlMemBlocks()) {
42994            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
42995	           xmlMemBlocks() - mem_base);
42996	    test_ret++;
42997            printf(" %d", n_writer);
42998            printf("\n");
42999        }
43000    }
43001    function_tests++;
43002#endif
43003
43004    return(test_ret);
43005}
43006
43007
43008static int
43009test_xmlTextWriterEndDTDEntity(void) {
43010    int test_ret = 0;
43011
43012#if defined(LIBXML_WRITER_ENABLED)
43013    int mem_base;
43014    int ret_val;
43015    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43016    int n_writer;
43017
43018    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43019        mem_base = xmlMemBlocks();
43020        writer = gen_xmlTextWriterPtr(n_writer, 0);
43021
43022        ret_val = xmlTextWriterEndDTDEntity(writer);
43023        desret_int(ret_val);
43024        call_tests++;
43025        des_xmlTextWriterPtr(n_writer, writer, 0);
43026        xmlResetLastError();
43027        if (mem_base != xmlMemBlocks()) {
43028            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43029	           xmlMemBlocks() - mem_base);
43030	    test_ret++;
43031            printf(" %d", n_writer);
43032            printf("\n");
43033        }
43034    }
43035    function_tests++;
43036#endif
43037
43038    return(test_ret);
43039}
43040
43041
43042static int
43043test_xmlTextWriterEndDocument(void) {
43044    int test_ret = 0;
43045
43046#if defined(LIBXML_WRITER_ENABLED)
43047    int mem_base;
43048    int ret_val;
43049    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43050    int n_writer;
43051
43052    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43053        mem_base = xmlMemBlocks();
43054        writer = gen_xmlTextWriterPtr(n_writer, 0);
43055
43056        ret_val = xmlTextWriterEndDocument(writer);
43057        desret_int(ret_val);
43058        call_tests++;
43059        des_xmlTextWriterPtr(n_writer, writer, 0);
43060        xmlResetLastError();
43061        if (mem_base != xmlMemBlocks()) {
43062            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43063	           xmlMemBlocks() - mem_base);
43064	    test_ret++;
43065            printf(" %d", n_writer);
43066            printf("\n");
43067        }
43068    }
43069    function_tests++;
43070#endif
43071
43072    return(test_ret);
43073}
43074
43075
43076static int
43077test_xmlTextWriterEndElement(void) {
43078    int test_ret = 0;
43079
43080#if defined(LIBXML_WRITER_ENABLED)
43081    int mem_base;
43082    int ret_val;
43083    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43084    int n_writer;
43085
43086    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43087        mem_base = xmlMemBlocks();
43088        writer = gen_xmlTextWriterPtr(n_writer, 0);
43089
43090        ret_val = xmlTextWriterEndElement(writer);
43091        desret_int(ret_val);
43092        call_tests++;
43093        des_xmlTextWriterPtr(n_writer, writer, 0);
43094        xmlResetLastError();
43095        if (mem_base != xmlMemBlocks()) {
43096            printf("Leak of %d blocks found in xmlTextWriterEndElement",
43097	           xmlMemBlocks() - mem_base);
43098	    test_ret++;
43099            printf(" %d", n_writer);
43100            printf("\n");
43101        }
43102    }
43103    function_tests++;
43104#endif
43105
43106    return(test_ret);
43107}
43108
43109
43110static int
43111test_xmlTextWriterEndPI(void) {
43112    int test_ret = 0;
43113
43114#if defined(LIBXML_WRITER_ENABLED)
43115    int mem_base;
43116    int ret_val;
43117    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43118    int n_writer;
43119
43120    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43121        mem_base = xmlMemBlocks();
43122        writer = gen_xmlTextWriterPtr(n_writer, 0);
43123
43124        ret_val = xmlTextWriterEndPI(writer);
43125        desret_int(ret_val);
43126        call_tests++;
43127        des_xmlTextWriterPtr(n_writer, writer, 0);
43128        xmlResetLastError();
43129        if (mem_base != xmlMemBlocks()) {
43130            printf("Leak of %d blocks found in xmlTextWriterEndPI",
43131	           xmlMemBlocks() - mem_base);
43132	    test_ret++;
43133            printf(" %d", n_writer);
43134            printf("\n");
43135        }
43136    }
43137    function_tests++;
43138#endif
43139
43140    return(test_ret);
43141}
43142
43143
43144static int
43145test_xmlTextWriterFlush(void) {
43146    int test_ret = 0;
43147
43148#if defined(LIBXML_WRITER_ENABLED)
43149    int mem_base;
43150    int ret_val;
43151    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43152    int n_writer;
43153
43154    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43155        mem_base = xmlMemBlocks();
43156        writer = gen_xmlTextWriterPtr(n_writer, 0);
43157
43158        ret_val = xmlTextWriterFlush(writer);
43159        desret_int(ret_val);
43160        call_tests++;
43161        des_xmlTextWriterPtr(n_writer, writer, 0);
43162        xmlResetLastError();
43163        if (mem_base != xmlMemBlocks()) {
43164            printf("Leak of %d blocks found in xmlTextWriterFlush",
43165	           xmlMemBlocks() - mem_base);
43166	    test_ret++;
43167            printf(" %d", n_writer);
43168            printf("\n");
43169        }
43170    }
43171    function_tests++;
43172#endif
43173
43174    return(test_ret);
43175}
43176
43177
43178static int
43179test_xmlTextWriterFullEndElement(void) {
43180    int test_ret = 0;
43181
43182#if defined(LIBXML_WRITER_ENABLED)
43183    int mem_base;
43184    int ret_val;
43185    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43186    int n_writer;
43187
43188    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43189        mem_base = xmlMemBlocks();
43190        writer = gen_xmlTextWriterPtr(n_writer, 0);
43191
43192        ret_val = xmlTextWriterFullEndElement(writer);
43193        desret_int(ret_val);
43194        call_tests++;
43195        des_xmlTextWriterPtr(n_writer, writer, 0);
43196        xmlResetLastError();
43197        if (mem_base != xmlMemBlocks()) {
43198            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43199	           xmlMemBlocks() - mem_base);
43200	    test_ret++;
43201            printf(" %d", n_writer);
43202            printf("\n");
43203        }
43204    }
43205    function_tests++;
43206#endif
43207
43208    return(test_ret);
43209}
43210
43211
43212static int
43213test_xmlTextWriterSetIndent(void) {
43214    int test_ret = 0;
43215
43216#if defined(LIBXML_WRITER_ENABLED)
43217    int mem_base;
43218    int ret_val;
43219    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43220    int n_writer;
43221    int indent; /* do indentation? */
43222    int n_indent;
43223
43224    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43225    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43226        mem_base = xmlMemBlocks();
43227        writer = gen_xmlTextWriterPtr(n_writer, 0);
43228        indent = gen_int(n_indent, 1);
43229
43230        ret_val = xmlTextWriterSetIndent(writer, indent);
43231        desret_int(ret_val);
43232        call_tests++;
43233        des_xmlTextWriterPtr(n_writer, writer, 0);
43234        des_int(n_indent, indent, 1);
43235        xmlResetLastError();
43236        if (mem_base != xmlMemBlocks()) {
43237            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43238	           xmlMemBlocks() - mem_base);
43239	    test_ret++;
43240            printf(" %d", n_writer);
43241            printf(" %d", n_indent);
43242            printf("\n");
43243        }
43244    }
43245    }
43246    function_tests++;
43247#endif
43248
43249    return(test_ret);
43250}
43251
43252
43253static int
43254test_xmlTextWriterSetIndentString(void) {
43255    int test_ret = 0;
43256
43257#if defined(LIBXML_WRITER_ENABLED)
43258    int mem_base;
43259    int ret_val;
43260    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43261    int n_writer;
43262    xmlChar * str; /* the xmlChar string */
43263    int n_str;
43264
43265    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43266    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43267        mem_base = xmlMemBlocks();
43268        writer = gen_xmlTextWriterPtr(n_writer, 0);
43269        str = gen_const_xmlChar_ptr(n_str, 1);
43270
43271        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43272        desret_int(ret_val);
43273        call_tests++;
43274        des_xmlTextWriterPtr(n_writer, writer, 0);
43275        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43276        xmlResetLastError();
43277        if (mem_base != xmlMemBlocks()) {
43278            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43279	           xmlMemBlocks() - mem_base);
43280	    test_ret++;
43281            printf(" %d", n_writer);
43282            printf(" %d", n_str);
43283            printf("\n");
43284        }
43285    }
43286    }
43287    function_tests++;
43288#endif
43289
43290    return(test_ret);
43291}
43292
43293
43294static int
43295test_xmlTextWriterStartAttribute(void) {
43296    int test_ret = 0;
43297
43298#if defined(LIBXML_WRITER_ENABLED)
43299    int mem_base;
43300    int ret_val;
43301    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43302    int n_writer;
43303    xmlChar * name; /* element name */
43304    int n_name;
43305
43306    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43307    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43308        mem_base = xmlMemBlocks();
43309        writer = gen_xmlTextWriterPtr(n_writer, 0);
43310        name = gen_const_xmlChar_ptr(n_name, 1);
43311
43312        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43313        desret_int(ret_val);
43314        call_tests++;
43315        des_xmlTextWriterPtr(n_writer, writer, 0);
43316        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43317        xmlResetLastError();
43318        if (mem_base != xmlMemBlocks()) {
43319            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43320	           xmlMemBlocks() - mem_base);
43321	    test_ret++;
43322            printf(" %d", n_writer);
43323            printf(" %d", n_name);
43324            printf("\n");
43325        }
43326    }
43327    }
43328    function_tests++;
43329#endif
43330
43331    return(test_ret);
43332}
43333
43334
43335static int
43336test_xmlTextWriterStartAttributeNS(void) {
43337    int test_ret = 0;
43338
43339#if defined(LIBXML_WRITER_ENABLED)
43340    int mem_base;
43341    int ret_val;
43342    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43343    int n_writer;
43344    xmlChar * prefix; /* namespace prefix or NULL */
43345    int n_prefix;
43346    xmlChar * name; /* element local name */
43347    int n_name;
43348    xmlChar * namespaceURI; /* namespace URI or NULL */
43349    int n_namespaceURI;
43350
43351    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43352    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43353    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43354    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43355        mem_base = xmlMemBlocks();
43356        writer = gen_xmlTextWriterPtr(n_writer, 0);
43357        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43358        name = gen_const_xmlChar_ptr(n_name, 2);
43359        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43360
43361        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43362        desret_int(ret_val);
43363        call_tests++;
43364        des_xmlTextWriterPtr(n_writer, writer, 0);
43365        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43366        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43367        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43368        xmlResetLastError();
43369        if (mem_base != xmlMemBlocks()) {
43370            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43371	           xmlMemBlocks() - mem_base);
43372	    test_ret++;
43373            printf(" %d", n_writer);
43374            printf(" %d", n_prefix);
43375            printf(" %d", n_name);
43376            printf(" %d", n_namespaceURI);
43377            printf("\n");
43378        }
43379    }
43380    }
43381    }
43382    }
43383    function_tests++;
43384#endif
43385
43386    return(test_ret);
43387}
43388
43389
43390static int
43391test_xmlTextWriterStartCDATA(void) {
43392    int test_ret = 0;
43393
43394#if defined(LIBXML_WRITER_ENABLED)
43395    int mem_base;
43396    int ret_val;
43397    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43398    int n_writer;
43399
43400    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43401        mem_base = xmlMemBlocks();
43402        writer = gen_xmlTextWriterPtr(n_writer, 0);
43403
43404        ret_val = xmlTextWriterStartCDATA(writer);
43405        desret_int(ret_val);
43406        call_tests++;
43407        des_xmlTextWriterPtr(n_writer, writer, 0);
43408        xmlResetLastError();
43409        if (mem_base != xmlMemBlocks()) {
43410            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43411	           xmlMemBlocks() - mem_base);
43412	    test_ret++;
43413            printf(" %d", n_writer);
43414            printf("\n");
43415        }
43416    }
43417    function_tests++;
43418#endif
43419
43420    return(test_ret);
43421}
43422
43423
43424static int
43425test_xmlTextWriterStartComment(void) {
43426    int test_ret = 0;
43427
43428#if defined(LIBXML_WRITER_ENABLED)
43429    int mem_base;
43430    int ret_val;
43431    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43432    int n_writer;
43433
43434    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43435        mem_base = xmlMemBlocks();
43436        writer = gen_xmlTextWriterPtr(n_writer, 0);
43437
43438        ret_val = xmlTextWriterStartComment(writer);
43439        desret_int(ret_val);
43440        call_tests++;
43441        des_xmlTextWriterPtr(n_writer, writer, 0);
43442        xmlResetLastError();
43443        if (mem_base != xmlMemBlocks()) {
43444            printf("Leak of %d blocks found in xmlTextWriterStartComment",
43445	           xmlMemBlocks() - mem_base);
43446	    test_ret++;
43447            printf(" %d", n_writer);
43448            printf("\n");
43449        }
43450    }
43451    function_tests++;
43452#endif
43453
43454    return(test_ret);
43455}
43456
43457
43458static int
43459test_xmlTextWriterStartDTD(void) {
43460    int test_ret = 0;
43461
43462#if defined(LIBXML_WRITER_ENABLED)
43463    int mem_base;
43464    int ret_val;
43465    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43466    int n_writer;
43467    xmlChar * name; /* the name of the DTD */
43468    int n_name;
43469    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43470    int n_pubid;
43471    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43472    int n_sysid;
43473
43474    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43475    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43476    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43477    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43478        mem_base = xmlMemBlocks();
43479        writer = gen_xmlTextWriterPtr(n_writer, 0);
43480        name = gen_const_xmlChar_ptr(n_name, 1);
43481        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43482        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43483
43484        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43485        desret_int(ret_val);
43486        call_tests++;
43487        des_xmlTextWriterPtr(n_writer, writer, 0);
43488        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43489        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43490        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43491        xmlResetLastError();
43492        if (mem_base != xmlMemBlocks()) {
43493            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43494	           xmlMemBlocks() - mem_base);
43495	    test_ret++;
43496            printf(" %d", n_writer);
43497            printf(" %d", n_name);
43498            printf(" %d", n_pubid);
43499            printf(" %d", n_sysid);
43500            printf("\n");
43501        }
43502    }
43503    }
43504    }
43505    }
43506    function_tests++;
43507#endif
43508
43509    return(test_ret);
43510}
43511
43512
43513static int
43514test_xmlTextWriterStartDTDAttlist(void) {
43515    int test_ret = 0;
43516
43517#if defined(LIBXML_WRITER_ENABLED)
43518    int mem_base;
43519    int ret_val;
43520    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43521    int n_writer;
43522    xmlChar * name; /* the name of the DTD ATTLIST */
43523    int n_name;
43524
43525    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43526    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43527        mem_base = xmlMemBlocks();
43528        writer = gen_xmlTextWriterPtr(n_writer, 0);
43529        name = gen_const_xmlChar_ptr(n_name, 1);
43530
43531        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43532        desret_int(ret_val);
43533        call_tests++;
43534        des_xmlTextWriterPtr(n_writer, writer, 0);
43535        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43536        xmlResetLastError();
43537        if (mem_base != xmlMemBlocks()) {
43538            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43539	           xmlMemBlocks() - mem_base);
43540	    test_ret++;
43541            printf(" %d", n_writer);
43542            printf(" %d", n_name);
43543            printf("\n");
43544        }
43545    }
43546    }
43547    function_tests++;
43548#endif
43549
43550    return(test_ret);
43551}
43552
43553
43554static int
43555test_xmlTextWriterStartDTDElement(void) {
43556    int test_ret = 0;
43557
43558#if defined(LIBXML_WRITER_ENABLED)
43559    int mem_base;
43560    int ret_val;
43561    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43562    int n_writer;
43563    xmlChar * name; /* the name of the DTD element */
43564    int n_name;
43565
43566    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43567    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43568        mem_base = xmlMemBlocks();
43569        writer = gen_xmlTextWriterPtr(n_writer, 0);
43570        name = gen_const_xmlChar_ptr(n_name, 1);
43571
43572        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43573        desret_int(ret_val);
43574        call_tests++;
43575        des_xmlTextWriterPtr(n_writer, writer, 0);
43576        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43577        xmlResetLastError();
43578        if (mem_base != xmlMemBlocks()) {
43579            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43580	           xmlMemBlocks() - mem_base);
43581	    test_ret++;
43582            printf(" %d", n_writer);
43583            printf(" %d", n_name);
43584            printf("\n");
43585        }
43586    }
43587    }
43588    function_tests++;
43589#endif
43590
43591    return(test_ret);
43592}
43593
43594
43595static int
43596test_xmlTextWriterStartDTDEntity(void) {
43597    int test_ret = 0;
43598
43599#if defined(LIBXML_WRITER_ENABLED)
43600    int mem_base;
43601    int ret_val;
43602    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43603    int n_writer;
43604    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43605    int n_pe;
43606    xmlChar * name; /* the name of the DTD ATTLIST */
43607    int n_name;
43608
43609    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43610    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43611    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43612        mem_base = xmlMemBlocks();
43613        writer = gen_xmlTextWriterPtr(n_writer, 0);
43614        pe = gen_int(n_pe, 1);
43615        name = gen_const_xmlChar_ptr(n_name, 2);
43616
43617        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43618        desret_int(ret_val);
43619        call_tests++;
43620        des_xmlTextWriterPtr(n_writer, writer, 0);
43621        des_int(n_pe, pe, 1);
43622        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43623        xmlResetLastError();
43624        if (mem_base != xmlMemBlocks()) {
43625            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43626	           xmlMemBlocks() - mem_base);
43627	    test_ret++;
43628            printf(" %d", n_writer);
43629            printf(" %d", n_pe);
43630            printf(" %d", n_name);
43631            printf("\n");
43632        }
43633    }
43634    }
43635    }
43636    function_tests++;
43637#endif
43638
43639    return(test_ret);
43640}
43641
43642
43643static int
43644test_xmlTextWriterStartDocument(void) {
43645    int test_ret = 0;
43646
43647#if defined(LIBXML_WRITER_ENABLED)
43648    int mem_base;
43649    int ret_val;
43650    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43651    int n_writer;
43652    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43653    int n_version;
43654    char * encoding; /* the encoding or NULL for default */
43655    int n_encoding;
43656    char * standalone; /* "yes" or "no" or NULL for default */
43657    int n_standalone;
43658
43659    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43660    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43661    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43662    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43663        mem_base = xmlMemBlocks();
43664        writer = gen_xmlTextWriterPtr(n_writer, 0);
43665        version = gen_const_char_ptr(n_version, 1);
43666        encoding = gen_const_char_ptr(n_encoding, 2);
43667        standalone = gen_const_char_ptr(n_standalone, 3);
43668
43669        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43670        desret_int(ret_val);
43671        call_tests++;
43672        des_xmlTextWriterPtr(n_writer, writer, 0);
43673        des_const_char_ptr(n_version, (const char *)version, 1);
43674        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43675        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43676        xmlResetLastError();
43677        if (mem_base != xmlMemBlocks()) {
43678            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43679	           xmlMemBlocks() - mem_base);
43680	    test_ret++;
43681            printf(" %d", n_writer);
43682            printf(" %d", n_version);
43683            printf(" %d", n_encoding);
43684            printf(" %d", n_standalone);
43685            printf("\n");
43686        }
43687    }
43688    }
43689    }
43690    }
43691    function_tests++;
43692#endif
43693
43694    return(test_ret);
43695}
43696
43697
43698static int
43699test_xmlTextWriterStartElement(void) {
43700    int test_ret = 0;
43701
43702#if defined(LIBXML_WRITER_ENABLED)
43703    int mem_base;
43704    int ret_val;
43705    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43706    int n_writer;
43707    xmlChar * name; /* element name */
43708    int n_name;
43709
43710    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43711    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43712        mem_base = xmlMemBlocks();
43713        writer = gen_xmlTextWriterPtr(n_writer, 0);
43714        name = gen_const_xmlChar_ptr(n_name, 1);
43715
43716        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43717        desret_int(ret_val);
43718        call_tests++;
43719        des_xmlTextWriterPtr(n_writer, writer, 0);
43720        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43721        xmlResetLastError();
43722        if (mem_base != xmlMemBlocks()) {
43723            printf("Leak of %d blocks found in xmlTextWriterStartElement",
43724	           xmlMemBlocks() - mem_base);
43725	    test_ret++;
43726            printf(" %d", n_writer);
43727            printf(" %d", n_name);
43728            printf("\n");
43729        }
43730    }
43731    }
43732    function_tests++;
43733#endif
43734
43735    return(test_ret);
43736}
43737
43738
43739static int
43740test_xmlTextWriterStartElementNS(void) {
43741    int test_ret = 0;
43742
43743#if defined(LIBXML_WRITER_ENABLED)
43744    int mem_base;
43745    int ret_val;
43746    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43747    int n_writer;
43748    xmlChar * prefix; /* namespace prefix or NULL */
43749    int n_prefix;
43750    xmlChar * name; /* element local name */
43751    int n_name;
43752    xmlChar * namespaceURI; /* namespace URI or NULL */
43753    int n_namespaceURI;
43754
43755    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43756    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43757    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43758    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43759        mem_base = xmlMemBlocks();
43760        writer = gen_xmlTextWriterPtr(n_writer, 0);
43761        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43762        name = gen_const_xmlChar_ptr(n_name, 2);
43763        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43764
43765        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43766        desret_int(ret_val);
43767        call_tests++;
43768        des_xmlTextWriterPtr(n_writer, writer, 0);
43769        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43770        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43771        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43772        xmlResetLastError();
43773        if (mem_base != xmlMemBlocks()) {
43774            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43775	           xmlMemBlocks() - mem_base);
43776	    test_ret++;
43777            printf(" %d", n_writer);
43778            printf(" %d", n_prefix);
43779            printf(" %d", n_name);
43780            printf(" %d", n_namespaceURI);
43781            printf("\n");
43782        }
43783    }
43784    }
43785    }
43786    }
43787    function_tests++;
43788#endif
43789
43790    return(test_ret);
43791}
43792
43793
43794static int
43795test_xmlTextWriterStartPI(void) {
43796    int test_ret = 0;
43797
43798#if defined(LIBXML_WRITER_ENABLED)
43799    int mem_base;
43800    int ret_val;
43801    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43802    int n_writer;
43803    xmlChar * target; /* PI target */
43804    int n_target;
43805
43806    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43807    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43808        mem_base = xmlMemBlocks();
43809        writer = gen_xmlTextWriterPtr(n_writer, 0);
43810        target = gen_const_xmlChar_ptr(n_target, 1);
43811
43812        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43813        desret_int(ret_val);
43814        call_tests++;
43815        des_xmlTextWriterPtr(n_writer, writer, 0);
43816        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43817        xmlResetLastError();
43818        if (mem_base != xmlMemBlocks()) {
43819            printf("Leak of %d blocks found in xmlTextWriterStartPI",
43820	           xmlMemBlocks() - mem_base);
43821	    test_ret++;
43822            printf(" %d", n_writer);
43823            printf(" %d", n_target);
43824            printf("\n");
43825        }
43826    }
43827    }
43828    function_tests++;
43829#endif
43830
43831    return(test_ret);
43832}
43833
43834
43835static int
43836test_xmlTextWriterWriteAttribute(void) {
43837    int test_ret = 0;
43838
43839#if defined(LIBXML_WRITER_ENABLED)
43840    int mem_base;
43841    int ret_val;
43842    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43843    int n_writer;
43844    xmlChar * name; /* attribute name */
43845    int n_name;
43846    xmlChar * content; /* attribute content */
43847    int n_content;
43848
43849    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43850    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43851    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43852        mem_base = xmlMemBlocks();
43853        writer = gen_xmlTextWriterPtr(n_writer, 0);
43854        name = gen_const_xmlChar_ptr(n_name, 1);
43855        content = gen_const_xmlChar_ptr(n_content, 2);
43856
43857        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
43858        desret_int(ret_val);
43859        call_tests++;
43860        des_xmlTextWriterPtr(n_writer, writer, 0);
43861        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43862        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43863        xmlResetLastError();
43864        if (mem_base != xmlMemBlocks()) {
43865            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
43866	           xmlMemBlocks() - mem_base);
43867	    test_ret++;
43868            printf(" %d", n_writer);
43869            printf(" %d", n_name);
43870            printf(" %d", n_content);
43871            printf("\n");
43872        }
43873    }
43874    }
43875    }
43876    function_tests++;
43877#endif
43878
43879    return(test_ret);
43880}
43881
43882
43883static int
43884test_xmlTextWriterWriteAttributeNS(void) {
43885    int test_ret = 0;
43886
43887#if defined(LIBXML_WRITER_ENABLED)
43888    int mem_base;
43889    int ret_val;
43890    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43891    int n_writer;
43892    xmlChar * prefix; /* namespace prefix */
43893    int n_prefix;
43894    xmlChar * name; /* attribute local name */
43895    int n_name;
43896    xmlChar * namespaceURI; /* namespace URI */
43897    int n_namespaceURI;
43898    xmlChar * content; /* attribute content */
43899    int n_content;
43900
43901    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43902    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43903    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43904    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43905    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43906        mem_base = xmlMemBlocks();
43907        writer = gen_xmlTextWriterPtr(n_writer, 0);
43908        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43909        name = gen_const_xmlChar_ptr(n_name, 2);
43910        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43911        content = gen_const_xmlChar_ptr(n_content, 4);
43912
43913        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
43914        desret_int(ret_val);
43915        call_tests++;
43916        des_xmlTextWriterPtr(n_writer, writer, 0);
43917        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43918        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43919        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43920        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
43921        xmlResetLastError();
43922        if (mem_base != xmlMemBlocks()) {
43923            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
43924	           xmlMemBlocks() - mem_base);
43925	    test_ret++;
43926            printf(" %d", n_writer);
43927            printf(" %d", n_prefix);
43928            printf(" %d", n_name);
43929            printf(" %d", n_namespaceURI);
43930            printf(" %d", n_content);
43931            printf("\n");
43932        }
43933    }
43934    }
43935    }
43936    }
43937    }
43938    function_tests++;
43939#endif
43940
43941    return(test_ret);
43942}
43943
43944
43945static int
43946test_xmlTextWriterWriteBase64(void) {
43947    int test_ret = 0;
43948
43949#if defined(LIBXML_WRITER_ENABLED)
43950    int mem_base;
43951    int ret_val;
43952    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43953    int n_writer;
43954    char * data; /* binary data */
43955    int n_data;
43956    int start; /* the position within the data of the first byte to encode */
43957    int n_start;
43958    int len; /* the number of bytes to encode */
43959    int n_len;
43960
43961    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43962    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43963    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43964    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43965        mem_base = xmlMemBlocks();
43966        writer = gen_xmlTextWriterPtr(n_writer, 0);
43967        data = gen_const_char_ptr(n_data, 1);
43968        start = gen_int(n_start, 2);
43969        len = gen_int(n_len, 3);
43970
43971        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
43972        desret_int(ret_val);
43973        call_tests++;
43974        des_xmlTextWriterPtr(n_writer, writer, 0);
43975        des_const_char_ptr(n_data, (const char *)data, 1);
43976        des_int(n_start, start, 2);
43977        des_int(n_len, len, 3);
43978        xmlResetLastError();
43979        if (mem_base != xmlMemBlocks()) {
43980            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
43981	           xmlMemBlocks() - mem_base);
43982	    test_ret++;
43983            printf(" %d", n_writer);
43984            printf(" %d", n_data);
43985            printf(" %d", n_start);
43986            printf(" %d", n_len);
43987            printf("\n");
43988        }
43989    }
43990    }
43991    }
43992    }
43993    function_tests++;
43994#endif
43995
43996    return(test_ret);
43997}
43998
43999
44000static int
44001test_xmlTextWriterWriteBinHex(void) {
44002    int test_ret = 0;
44003
44004#if defined(LIBXML_WRITER_ENABLED)
44005    int mem_base;
44006    int ret_val;
44007    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44008    int n_writer;
44009    char * data; /* binary data */
44010    int n_data;
44011    int start; /* the position within the data of the first byte to encode */
44012    int n_start;
44013    int len; /* the number of bytes to encode */
44014    int n_len;
44015
44016    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44017    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44018    for (n_start = 0;n_start < gen_nb_int;n_start++) {
44019    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44020        mem_base = xmlMemBlocks();
44021        writer = gen_xmlTextWriterPtr(n_writer, 0);
44022        data = gen_const_char_ptr(n_data, 1);
44023        start = gen_int(n_start, 2);
44024        len = gen_int(n_len, 3);
44025
44026        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44027        desret_int(ret_val);
44028        call_tests++;
44029        des_xmlTextWriterPtr(n_writer, writer, 0);
44030        des_const_char_ptr(n_data, (const char *)data, 1);
44031        des_int(n_start, start, 2);
44032        des_int(n_len, len, 3);
44033        xmlResetLastError();
44034        if (mem_base != xmlMemBlocks()) {
44035            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44036	           xmlMemBlocks() - mem_base);
44037	    test_ret++;
44038            printf(" %d", n_writer);
44039            printf(" %d", n_data);
44040            printf(" %d", n_start);
44041            printf(" %d", n_len);
44042            printf("\n");
44043        }
44044    }
44045    }
44046    }
44047    }
44048    function_tests++;
44049#endif
44050
44051    return(test_ret);
44052}
44053
44054
44055static int
44056test_xmlTextWriterWriteCDATA(void) {
44057    int test_ret = 0;
44058
44059#if defined(LIBXML_WRITER_ENABLED)
44060    int mem_base;
44061    int ret_val;
44062    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44063    int n_writer;
44064    xmlChar * content; /* CDATA content */
44065    int n_content;
44066
44067    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44068    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44069        mem_base = xmlMemBlocks();
44070        writer = gen_xmlTextWriterPtr(n_writer, 0);
44071        content = gen_const_xmlChar_ptr(n_content, 1);
44072
44073        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44074        desret_int(ret_val);
44075        call_tests++;
44076        des_xmlTextWriterPtr(n_writer, writer, 0);
44077        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44078        xmlResetLastError();
44079        if (mem_base != xmlMemBlocks()) {
44080            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44081	           xmlMemBlocks() - mem_base);
44082	    test_ret++;
44083            printf(" %d", n_writer);
44084            printf(" %d", n_content);
44085            printf("\n");
44086        }
44087    }
44088    }
44089    function_tests++;
44090#endif
44091
44092    return(test_ret);
44093}
44094
44095
44096static int
44097test_xmlTextWriterWriteComment(void) {
44098    int test_ret = 0;
44099
44100#if defined(LIBXML_WRITER_ENABLED)
44101    int mem_base;
44102    int ret_val;
44103    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44104    int n_writer;
44105    xmlChar * content; /* comment string */
44106    int n_content;
44107
44108    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44109    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44110        mem_base = xmlMemBlocks();
44111        writer = gen_xmlTextWriterPtr(n_writer, 0);
44112        content = gen_const_xmlChar_ptr(n_content, 1);
44113
44114        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44115        desret_int(ret_val);
44116        call_tests++;
44117        des_xmlTextWriterPtr(n_writer, writer, 0);
44118        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44119        xmlResetLastError();
44120        if (mem_base != xmlMemBlocks()) {
44121            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44122	           xmlMemBlocks() - mem_base);
44123	    test_ret++;
44124            printf(" %d", n_writer);
44125            printf(" %d", n_content);
44126            printf("\n");
44127        }
44128    }
44129    }
44130    function_tests++;
44131#endif
44132
44133    return(test_ret);
44134}
44135
44136
44137static int
44138test_xmlTextWriterWriteDTD(void) {
44139    int test_ret = 0;
44140
44141#if defined(LIBXML_WRITER_ENABLED)
44142    int mem_base;
44143    int ret_val;
44144    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44145    int n_writer;
44146    xmlChar * name; /* the name of the DTD */
44147    int n_name;
44148    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44149    int n_pubid;
44150    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44151    int n_sysid;
44152    xmlChar * subset; /* string content of the DTD */
44153    int n_subset;
44154
44155    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44156    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44157    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44158    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44159    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44160        mem_base = xmlMemBlocks();
44161        writer = gen_xmlTextWriterPtr(n_writer, 0);
44162        name = gen_const_xmlChar_ptr(n_name, 1);
44163        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44164        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44165        subset = gen_const_xmlChar_ptr(n_subset, 4);
44166
44167        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44168        desret_int(ret_val);
44169        call_tests++;
44170        des_xmlTextWriterPtr(n_writer, writer, 0);
44171        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44172        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44173        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44174        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44175        xmlResetLastError();
44176        if (mem_base != xmlMemBlocks()) {
44177            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44178	           xmlMemBlocks() - mem_base);
44179	    test_ret++;
44180            printf(" %d", n_writer);
44181            printf(" %d", n_name);
44182            printf(" %d", n_pubid);
44183            printf(" %d", n_sysid);
44184            printf(" %d", n_subset);
44185            printf("\n");
44186        }
44187    }
44188    }
44189    }
44190    }
44191    }
44192    function_tests++;
44193#endif
44194
44195    return(test_ret);
44196}
44197
44198
44199static int
44200test_xmlTextWriterWriteDTDAttlist(void) {
44201    int test_ret = 0;
44202
44203#if defined(LIBXML_WRITER_ENABLED)
44204    int mem_base;
44205    int ret_val;
44206    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44207    int n_writer;
44208    xmlChar * name; /* the name of the DTD ATTLIST */
44209    int n_name;
44210    xmlChar * content; /* content of the ATTLIST */
44211    int n_content;
44212
44213    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44214    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44215    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44216        mem_base = xmlMemBlocks();
44217        writer = gen_xmlTextWriterPtr(n_writer, 0);
44218        name = gen_const_xmlChar_ptr(n_name, 1);
44219        content = gen_const_xmlChar_ptr(n_content, 2);
44220
44221        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44222        desret_int(ret_val);
44223        call_tests++;
44224        des_xmlTextWriterPtr(n_writer, writer, 0);
44225        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44226        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44227        xmlResetLastError();
44228        if (mem_base != xmlMemBlocks()) {
44229            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44230	           xmlMemBlocks() - mem_base);
44231	    test_ret++;
44232            printf(" %d", n_writer);
44233            printf(" %d", n_name);
44234            printf(" %d", n_content);
44235            printf("\n");
44236        }
44237    }
44238    }
44239    }
44240    function_tests++;
44241#endif
44242
44243    return(test_ret);
44244}
44245
44246
44247static int
44248test_xmlTextWriterWriteDTDElement(void) {
44249    int test_ret = 0;
44250
44251#if defined(LIBXML_WRITER_ENABLED)
44252    int mem_base;
44253    int ret_val;
44254    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44255    int n_writer;
44256    xmlChar * name; /* the name of the DTD element */
44257    int n_name;
44258    xmlChar * content; /* content of the element */
44259    int n_content;
44260
44261    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44262    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44263    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44264        mem_base = xmlMemBlocks();
44265        writer = gen_xmlTextWriterPtr(n_writer, 0);
44266        name = gen_const_xmlChar_ptr(n_name, 1);
44267        content = gen_const_xmlChar_ptr(n_content, 2);
44268
44269        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44270        desret_int(ret_val);
44271        call_tests++;
44272        des_xmlTextWriterPtr(n_writer, writer, 0);
44273        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44274        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44275        xmlResetLastError();
44276        if (mem_base != xmlMemBlocks()) {
44277            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44278	           xmlMemBlocks() - mem_base);
44279	    test_ret++;
44280            printf(" %d", n_writer);
44281            printf(" %d", n_name);
44282            printf(" %d", n_content);
44283            printf("\n");
44284        }
44285    }
44286    }
44287    }
44288    function_tests++;
44289#endif
44290
44291    return(test_ret);
44292}
44293
44294
44295static int
44296test_xmlTextWriterWriteDTDEntity(void) {
44297    int test_ret = 0;
44298
44299#if defined(LIBXML_WRITER_ENABLED)
44300    int mem_base;
44301    int ret_val;
44302    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44303    int n_writer;
44304    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44305    int n_pe;
44306    xmlChar * name; /* the name of the DTD entity */
44307    int n_name;
44308    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44309    int n_pubid;
44310    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44311    int n_sysid;
44312    xmlChar * ndataid; /* the xml notation name. */
44313    int n_ndataid;
44314    xmlChar * content; /* content of the entity */
44315    int n_content;
44316
44317    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44318    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44319    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44320    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44321    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44322    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44323    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44324        mem_base = xmlMemBlocks();
44325        writer = gen_xmlTextWriterPtr(n_writer, 0);
44326        pe = gen_int(n_pe, 1);
44327        name = gen_const_xmlChar_ptr(n_name, 2);
44328        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44329        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44330        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44331        content = gen_const_xmlChar_ptr(n_content, 6);
44332
44333        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44334        desret_int(ret_val);
44335        call_tests++;
44336        des_xmlTextWriterPtr(n_writer, writer, 0);
44337        des_int(n_pe, pe, 1);
44338        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44339        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44340        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44341        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44342        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44343        xmlResetLastError();
44344        if (mem_base != xmlMemBlocks()) {
44345            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44346	           xmlMemBlocks() - mem_base);
44347	    test_ret++;
44348            printf(" %d", n_writer);
44349            printf(" %d", n_pe);
44350            printf(" %d", n_name);
44351            printf(" %d", n_pubid);
44352            printf(" %d", n_sysid);
44353            printf(" %d", n_ndataid);
44354            printf(" %d", n_content);
44355            printf("\n");
44356        }
44357    }
44358    }
44359    }
44360    }
44361    }
44362    }
44363    }
44364    function_tests++;
44365#endif
44366
44367    return(test_ret);
44368}
44369
44370
44371static int
44372test_xmlTextWriterWriteDTDExternalEntity(void) {
44373    int test_ret = 0;
44374
44375#if defined(LIBXML_WRITER_ENABLED)
44376    int mem_base;
44377    int ret_val;
44378    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44379    int n_writer;
44380    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44381    int n_pe;
44382    xmlChar * name; /* the name of the DTD entity */
44383    int n_name;
44384    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44385    int n_pubid;
44386    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44387    int n_sysid;
44388    xmlChar * ndataid; /* the xml notation name. */
44389    int n_ndataid;
44390
44391    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44392    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44393    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44394    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44395    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44396    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44397        mem_base = xmlMemBlocks();
44398        writer = gen_xmlTextWriterPtr(n_writer, 0);
44399        pe = gen_int(n_pe, 1);
44400        name = gen_const_xmlChar_ptr(n_name, 2);
44401        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44402        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44403        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44404
44405        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44406        desret_int(ret_val);
44407        call_tests++;
44408        des_xmlTextWriterPtr(n_writer, writer, 0);
44409        des_int(n_pe, pe, 1);
44410        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44411        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44412        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44413        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44414        xmlResetLastError();
44415        if (mem_base != xmlMemBlocks()) {
44416            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44417	           xmlMemBlocks() - mem_base);
44418	    test_ret++;
44419            printf(" %d", n_writer);
44420            printf(" %d", n_pe);
44421            printf(" %d", n_name);
44422            printf(" %d", n_pubid);
44423            printf(" %d", n_sysid);
44424            printf(" %d", n_ndataid);
44425            printf("\n");
44426        }
44427    }
44428    }
44429    }
44430    }
44431    }
44432    }
44433    function_tests++;
44434#endif
44435
44436    return(test_ret);
44437}
44438
44439
44440static int
44441test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44442    int test_ret = 0;
44443
44444#if defined(LIBXML_WRITER_ENABLED)
44445    int mem_base;
44446    int ret_val;
44447    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44448    int n_writer;
44449    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44450    int n_pubid;
44451    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44452    int n_sysid;
44453    xmlChar * ndataid; /* the xml notation name. */
44454    int n_ndataid;
44455
44456    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44457    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44458    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44459    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44460        mem_base = xmlMemBlocks();
44461        writer = gen_xmlTextWriterPtr(n_writer, 0);
44462        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44463        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44464        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44465
44466        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44467        desret_int(ret_val);
44468        call_tests++;
44469        des_xmlTextWriterPtr(n_writer, writer, 0);
44470        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44471        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44472        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44473        xmlResetLastError();
44474        if (mem_base != xmlMemBlocks()) {
44475            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44476	           xmlMemBlocks() - mem_base);
44477	    test_ret++;
44478            printf(" %d", n_writer);
44479            printf(" %d", n_pubid);
44480            printf(" %d", n_sysid);
44481            printf(" %d", n_ndataid);
44482            printf("\n");
44483        }
44484    }
44485    }
44486    }
44487    }
44488    function_tests++;
44489#endif
44490
44491    return(test_ret);
44492}
44493
44494
44495static int
44496test_xmlTextWriterWriteDTDInternalEntity(void) {
44497    int test_ret = 0;
44498
44499#if defined(LIBXML_WRITER_ENABLED)
44500    int mem_base;
44501    int ret_val;
44502    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44503    int n_writer;
44504    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44505    int n_pe;
44506    xmlChar * name; /* the name of the DTD entity */
44507    int n_name;
44508    xmlChar * content; /* content of the entity */
44509    int n_content;
44510
44511    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44512    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44513    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44514    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44515        mem_base = xmlMemBlocks();
44516        writer = gen_xmlTextWriterPtr(n_writer, 0);
44517        pe = gen_int(n_pe, 1);
44518        name = gen_const_xmlChar_ptr(n_name, 2);
44519        content = gen_const_xmlChar_ptr(n_content, 3);
44520
44521        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44522        desret_int(ret_val);
44523        call_tests++;
44524        des_xmlTextWriterPtr(n_writer, writer, 0);
44525        des_int(n_pe, pe, 1);
44526        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44527        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44528        xmlResetLastError();
44529        if (mem_base != xmlMemBlocks()) {
44530            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44531	           xmlMemBlocks() - mem_base);
44532	    test_ret++;
44533            printf(" %d", n_writer);
44534            printf(" %d", n_pe);
44535            printf(" %d", n_name);
44536            printf(" %d", n_content);
44537            printf("\n");
44538        }
44539    }
44540    }
44541    }
44542    }
44543    function_tests++;
44544#endif
44545
44546    return(test_ret);
44547}
44548
44549
44550static int
44551test_xmlTextWriterWriteDTDNotation(void) {
44552    int test_ret = 0;
44553
44554#if defined(LIBXML_WRITER_ENABLED)
44555    int mem_base;
44556    int ret_val;
44557    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44558    int n_writer;
44559    xmlChar * name; /* the name of the xml notation */
44560    int n_name;
44561    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44562    int n_pubid;
44563    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44564    int n_sysid;
44565
44566    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44567    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44568    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44569    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44570        mem_base = xmlMemBlocks();
44571        writer = gen_xmlTextWriterPtr(n_writer, 0);
44572        name = gen_const_xmlChar_ptr(n_name, 1);
44573        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44574        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44575
44576        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44577        desret_int(ret_val);
44578        call_tests++;
44579        des_xmlTextWriterPtr(n_writer, writer, 0);
44580        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44581        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44582        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44583        xmlResetLastError();
44584        if (mem_base != xmlMemBlocks()) {
44585            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44586	           xmlMemBlocks() - mem_base);
44587	    test_ret++;
44588            printf(" %d", n_writer);
44589            printf(" %d", n_name);
44590            printf(" %d", n_pubid);
44591            printf(" %d", n_sysid);
44592            printf("\n");
44593        }
44594    }
44595    }
44596    }
44597    }
44598    function_tests++;
44599#endif
44600
44601    return(test_ret);
44602}
44603
44604
44605static int
44606test_xmlTextWriterWriteElement(void) {
44607    int test_ret = 0;
44608
44609#if defined(LIBXML_WRITER_ENABLED)
44610    int mem_base;
44611    int ret_val;
44612    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44613    int n_writer;
44614    xmlChar * name; /* element name */
44615    int n_name;
44616    xmlChar * content; /* element content */
44617    int n_content;
44618
44619    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44620    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44621    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44622        mem_base = xmlMemBlocks();
44623        writer = gen_xmlTextWriterPtr(n_writer, 0);
44624        name = gen_const_xmlChar_ptr(n_name, 1);
44625        content = gen_const_xmlChar_ptr(n_content, 2);
44626
44627        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44628        desret_int(ret_val);
44629        call_tests++;
44630        des_xmlTextWriterPtr(n_writer, writer, 0);
44631        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44632        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44633        xmlResetLastError();
44634        if (mem_base != xmlMemBlocks()) {
44635            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44636	           xmlMemBlocks() - mem_base);
44637	    test_ret++;
44638            printf(" %d", n_writer);
44639            printf(" %d", n_name);
44640            printf(" %d", n_content);
44641            printf("\n");
44642        }
44643    }
44644    }
44645    }
44646    function_tests++;
44647#endif
44648
44649    return(test_ret);
44650}
44651
44652
44653static int
44654test_xmlTextWriterWriteElementNS(void) {
44655    int test_ret = 0;
44656
44657#if defined(LIBXML_WRITER_ENABLED)
44658    int mem_base;
44659    int ret_val;
44660    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44661    int n_writer;
44662    xmlChar * prefix; /* namespace prefix */
44663    int n_prefix;
44664    xmlChar * name; /* element local name */
44665    int n_name;
44666    xmlChar * namespaceURI; /* namespace URI */
44667    int n_namespaceURI;
44668    xmlChar * content; /* element content */
44669    int n_content;
44670
44671    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44672    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44673    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44674    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44675    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44676        mem_base = xmlMemBlocks();
44677        writer = gen_xmlTextWriterPtr(n_writer, 0);
44678        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44679        name = gen_const_xmlChar_ptr(n_name, 2);
44680        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44681        content = gen_const_xmlChar_ptr(n_content, 4);
44682
44683        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44684        desret_int(ret_val);
44685        call_tests++;
44686        des_xmlTextWriterPtr(n_writer, writer, 0);
44687        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44688        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44689        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44690        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44691        xmlResetLastError();
44692        if (mem_base != xmlMemBlocks()) {
44693            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44694	           xmlMemBlocks() - mem_base);
44695	    test_ret++;
44696            printf(" %d", n_writer);
44697            printf(" %d", n_prefix);
44698            printf(" %d", n_name);
44699            printf(" %d", n_namespaceURI);
44700            printf(" %d", n_content);
44701            printf("\n");
44702        }
44703    }
44704    }
44705    }
44706    }
44707    }
44708    function_tests++;
44709#endif
44710
44711    return(test_ret);
44712}
44713
44714
44715static int
44716test_xmlTextWriterWriteFormatAttribute(void) {
44717    int test_ret = 0;
44718
44719
44720    /* missing type support */
44721    return(test_ret);
44722}
44723
44724
44725static int
44726test_xmlTextWriterWriteFormatAttributeNS(void) {
44727    int test_ret = 0;
44728
44729
44730    /* missing type support */
44731    return(test_ret);
44732}
44733
44734
44735static int
44736test_xmlTextWriterWriteFormatCDATA(void) {
44737    int test_ret = 0;
44738
44739
44740    /* missing type support */
44741    return(test_ret);
44742}
44743
44744
44745static int
44746test_xmlTextWriterWriteFormatComment(void) {
44747    int test_ret = 0;
44748
44749
44750    /* missing type support */
44751    return(test_ret);
44752}
44753
44754
44755static int
44756test_xmlTextWriterWriteFormatDTD(void) {
44757    int test_ret = 0;
44758
44759
44760    /* missing type support */
44761    return(test_ret);
44762}
44763
44764
44765static int
44766test_xmlTextWriterWriteFormatDTDAttlist(void) {
44767    int test_ret = 0;
44768
44769
44770    /* missing type support */
44771    return(test_ret);
44772}
44773
44774
44775static int
44776test_xmlTextWriterWriteFormatDTDElement(void) {
44777    int test_ret = 0;
44778
44779
44780    /* missing type support */
44781    return(test_ret);
44782}
44783
44784
44785static int
44786test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44787    int test_ret = 0;
44788
44789
44790    /* missing type support */
44791    return(test_ret);
44792}
44793
44794
44795static int
44796test_xmlTextWriterWriteFormatElement(void) {
44797    int test_ret = 0;
44798
44799
44800    /* missing type support */
44801    return(test_ret);
44802}
44803
44804
44805static int
44806test_xmlTextWriterWriteFormatElementNS(void) {
44807    int test_ret = 0;
44808
44809
44810    /* missing type support */
44811    return(test_ret);
44812}
44813
44814
44815static int
44816test_xmlTextWriterWriteFormatPI(void) {
44817    int test_ret = 0;
44818
44819
44820    /* missing type support */
44821    return(test_ret);
44822}
44823
44824
44825static int
44826test_xmlTextWriterWriteFormatRaw(void) {
44827    int test_ret = 0;
44828
44829
44830    /* missing type support */
44831    return(test_ret);
44832}
44833
44834
44835static int
44836test_xmlTextWriterWriteFormatString(void) {
44837    int test_ret = 0;
44838
44839
44840    /* missing type support */
44841    return(test_ret);
44842}
44843
44844
44845static int
44846test_xmlTextWriterWritePI(void) {
44847    int test_ret = 0;
44848
44849#if defined(LIBXML_WRITER_ENABLED)
44850    int mem_base;
44851    int ret_val;
44852    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44853    int n_writer;
44854    xmlChar * target; /* PI target */
44855    int n_target;
44856    xmlChar * content; /* PI content */
44857    int n_content;
44858
44859    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44860    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44861    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44862        mem_base = xmlMemBlocks();
44863        writer = gen_xmlTextWriterPtr(n_writer, 0);
44864        target = gen_const_xmlChar_ptr(n_target, 1);
44865        content = gen_const_xmlChar_ptr(n_content, 2);
44866
44867        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
44868        desret_int(ret_val);
44869        call_tests++;
44870        des_xmlTextWriterPtr(n_writer, writer, 0);
44871        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44872        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44873        xmlResetLastError();
44874        if (mem_base != xmlMemBlocks()) {
44875            printf("Leak of %d blocks found in xmlTextWriterWritePI",
44876	           xmlMemBlocks() - mem_base);
44877	    test_ret++;
44878            printf(" %d", n_writer);
44879            printf(" %d", n_target);
44880            printf(" %d", n_content);
44881            printf("\n");
44882        }
44883    }
44884    }
44885    }
44886    function_tests++;
44887#endif
44888
44889    return(test_ret);
44890}
44891
44892
44893static int
44894test_xmlTextWriterWriteRaw(void) {
44895    int test_ret = 0;
44896
44897#if defined(LIBXML_WRITER_ENABLED)
44898    int mem_base;
44899    int ret_val;
44900    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44901    int n_writer;
44902    xmlChar * content; /* text string */
44903    int n_content;
44904
44905    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44906    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44907        mem_base = xmlMemBlocks();
44908        writer = gen_xmlTextWriterPtr(n_writer, 0);
44909        content = gen_const_xmlChar_ptr(n_content, 1);
44910
44911        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
44912        desret_int(ret_val);
44913        call_tests++;
44914        des_xmlTextWriterPtr(n_writer, writer, 0);
44915        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44916        xmlResetLastError();
44917        if (mem_base != xmlMemBlocks()) {
44918            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
44919	           xmlMemBlocks() - mem_base);
44920	    test_ret++;
44921            printf(" %d", n_writer);
44922            printf(" %d", n_content);
44923            printf("\n");
44924        }
44925    }
44926    }
44927    function_tests++;
44928#endif
44929
44930    return(test_ret);
44931}
44932
44933
44934static int
44935test_xmlTextWriterWriteRawLen(void) {
44936    int test_ret = 0;
44937
44938#if defined(LIBXML_WRITER_ENABLED)
44939    int mem_base;
44940    int ret_val;
44941    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44942    int n_writer;
44943    xmlChar * content; /* text string */
44944    int n_content;
44945    int len; /* length of the text string */
44946    int n_len;
44947
44948    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44949    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44950    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44951        mem_base = xmlMemBlocks();
44952        writer = gen_xmlTextWriterPtr(n_writer, 0);
44953        content = gen_const_xmlChar_ptr(n_content, 1);
44954        len = gen_int(n_len, 2);
44955
44956        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
44957        desret_int(ret_val);
44958        call_tests++;
44959        des_xmlTextWriterPtr(n_writer, writer, 0);
44960        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44961        des_int(n_len, len, 2);
44962        xmlResetLastError();
44963        if (mem_base != xmlMemBlocks()) {
44964            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
44965	           xmlMemBlocks() - mem_base);
44966	    test_ret++;
44967            printf(" %d", n_writer);
44968            printf(" %d", n_content);
44969            printf(" %d", n_len);
44970            printf("\n");
44971        }
44972    }
44973    }
44974    }
44975    function_tests++;
44976#endif
44977
44978    return(test_ret);
44979}
44980
44981
44982static int
44983test_xmlTextWriterWriteString(void) {
44984    int test_ret = 0;
44985
44986#if defined(LIBXML_WRITER_ENABLED)
44987    int mem_base;
44988    int ret_val;
44989    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44990    int n_writer;
44991    xmlChar * content; /* text string */
44992    int n_content;
44993
44994    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44995    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44996        mem_base = xmlMemBlocks();
44997        writer = gen_xmlTextWriterPtr(n_writer, 0);
44998        content = gen_const_xmlChar_ptr(n_content, 1);
44999
45000        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45001        desret_int(ret_val);
45002        call_tests++;
45003        des_xmlTextWriterPtr(n_writer, writer, 0);
45004        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45005        xmlResetLastError();
45006        if (mem_base != xmlMemBlocks()) {
45007            printf("Leak of %d blocks found in xmlTextWriterWriteString",
45008	           xmlMemBlocks() - mem_base);
45009	    test_ret++;
45010            printf(" %d", n_writer);
45011            printf(" %d", n_content);
45012            printf("\n");
45013        }
45014    }
45015    }
45016    function_tests++;
45017#endif
45018
45019    return(test_ret);
45020}
45021
45022
45023static int
45024test_xmlTextWriterWriteVFormatAttribute(void) {
45025    int test_ret = 0;
45026
45027
45028    /* missing type support */
45029    return(test_ret);
45030}
45031
45032
45033static int
45034test_xmlTextWriterWriteVFormatAttributeNS(void) {
45035    int test_ret = 0;
45036
45037
45038    /* missing type support */
45039    return(test_ret);
45040}
45041
45042
45043static int
45044test_xmlTextWriterWriteVFormatCDATA(void) {
45045    int test_ret = 0;
45046
45047
45048    /* missing type support */
45049    return(test_ret);
45050}
45051
45052
45053static int
45054test_xmlTextWriterWriteVFormatComment(void) {
45055    int test_ret = 0;
45056
45057
45058    /* missing type support */
45059    return(test_ret);
45060}
45061
45062
45063static int
45064test_xmlTextWriterWriteVFormatDTD(void) {
45065    int test_ret = 0;
45066
45067
45068    /* missing type support */
45069    return(test_ret);
45070}
45071
45072
45073static int
45074test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45075    int test_ret = 0;
45076
45077
45078    /* missing type support */
45079    return(test_ret);
45080}
45081
45082
45083static int
45084test_xmlTextWriterWriteVFormatDTDElement(void) {
45085    int test_ret = 0;
45086
45087
45088    /* missing type support */
45089    return(test_ret);
45090}
45091
45092
45093static int
45094test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45095    int test_ret = 0;
45096
45097
45098    /* missing type support */
45099    return(test_ret);
45100}
45101
45102
45103static int
45104test_xmlTextWriterWriteVFormatElement(void) {
45105    int test_ret = 0;
45106
45107
45108    /* missing type support */
45109    return(test_ret);
45110}
45111
45112
45113static int
45114test_xmlTextWriterWriteVFormatElementNS(void) {
45115    int test_ret = 0;
45116
45117
45118    /* missing type support */
45119    return(test_ret);
45120}
45121
45122
45123static int
45124test_xmlTextWriterWriteVFormatPI(void) {
45125    int test_ret = 0;
45126
45127
45128    /* missing type support */
45129    return(test_ret);
45130}
45131
45132
45133static int
45134test_xmlTextWriterWriteVFormatRaw(void) {
45135    int test_ret = 0;
45136
45137
45138    /* missing type support */
45139    return(test_ret);
45140}
45141
45142
45143static int
45144test_xmlTextWriterWriteVFormatString(void) {
45145    int test_ret = 0;
45146
45147
45148    /* missing type support */
45149    return(test_ret);
45150}
45151
45152static int
45153test_xmlwriter(void) {
45154    int test_ret = 0;
45155
45156    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45157    test_ret += test_xmlNewTextWriter();
45158    test_ret += test_xmlNewTextWriterFilename();
45159    test_ret += test_xmlNewTextWriterMemory();
45160    test_ret += test_xmlNewTextWriterPushParser();
45161    test_ret += test_xmlNewTextWriterTree();
45162    test_ret += test_xmlTextWriterEndAttribute();
45163    test_ret += test_xmlTextWriterEndCDATA();
45164    test_ret += test_xmlTextWriterEndComment();
45165    test_ret += test_xmlTextWriterEndDTD();
45166    test_ret += test_xmlTextWriterEndDTDAttlist();
45167    test_ret += test_xmlTextWriterEndDTDElement();
45168    test_ret += test_xmlTextWriterEndDTDEntity();
45169    test_ret += test_xmlTextWriterEndDocument();
45170    test_ret += test_xmlTextWriterEndElement();
45171    test_ret += test_xmlTextWriterEndPI();
45172    test_ret += test_xmlTextWriterFlush();
45173    test_ret += test_xmlTextWriterFullEndElement();
45174    test_ret += test_xmlTextWriterSetIndent();
45175    test_ret += test_xmlTextWriterSetIndentString();
45176    test_ret += test_xmlTextWriterStartAttribute();
45177    test_ret += test_xmlTextWriterStartAttributeNS();
45178    test_ret += test_xmlTextWriterStartCDATA();
45179    test_ret += test_xmlTextWriterStartComment();
45180    test_ret += test_xmlTextWriterStartDTD();
45181    test_ret += test_xmlTextWriterStartDTDAttlist();
45182    test_ret += test_xmlTextWriterStartDTDElement();
45183    test_ret += test_xmlTextWriterStartDTDEntity();
45184    test_ret += test_xmlTextWriterStartDocument();
45185    test_ret += test_xmlTextWriterStartElement();
45186    test_ret += test_xmlTextWriterStartElementNS();
45187    test_ret += test_xmlTextWriterStartPI();
45188    test_ret += test_xmlTextWriterWriteAttribute();
45189    test_ret += test_xmlTextWriterWriteAttributeNS();
45190    test_ret += test_xmlTextWriterWriteBase64();
45191    test_ret += test_xmlTextWriterWriteBinHex();
45192    test_ret += test_xmlTextWriterWriteCDATA();
45193    test_ret += test_xmlTextWriterWriteComment();
45194    test_ret += test_xmlTextWriterWriteDTD();
45195    test_ret += test_xmlTextWriterWriteDTDAttlist();
45196    test_ret += test_xmlTextWriterWriteDTDElement();
45197    test_ret += test_xmlTextWriterWriteDTDEntity();
45198    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45199    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45200    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45201    test_ret += test_xmlTextWriterWriteDTDNotation();
45202    test_ret += test_xmlTextWriterWriteElement();
45203    test_ret += test_xmlTextWriterWriteElementNS();
45204    test_ret += test_xmlTextWriterWriteFormatAttribute();
45205    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45206    test_ret += test_xmlTextWriterWriteFormatCDATA();
45207    test_ret += test_xmlTextWriterWriteFormatComment();
45208    test_ret += test_xmlTextWriterWriteFormatDTD();
45209    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45210    test_ret += test_xmlTextWriterWriteFormatDTDElement();
45211    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45212    test_ret += test_xmlTextWriterWriteFormatElement();
45213    test_ret += test_xmlTextWriterWriteFormatElementNS();
45214    test_ret += test_xmlTextWriterWriteFormatPI();
45215    test_ret += test_xmlTextWriterWriteFormatRaw();
45216    test_ret += test_xmlTextWriterWriteFormatString();
45217    test_ret += test_xmlTextWriterWritePI();
45218    test_ret += test_xmlTextWriterWriteRaw();
45219    test_ret += test_xmlTextWriterWriteRawLen();
45220    test_ret += test_xmlTextWriterWriteString();
45221    test_ret += test_xmlTextWriterWriteVFormatAttribute();
45222    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45223    test_ret += test_xmlTextWriterWriteVFormatCDATA();
45224    test_ret += test_xmlTextWriterWriteVFormatComment();
45225    test_ret += test_xmlTextWriterWriteVFormatDTD();
45226    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45227    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45228    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45229    test_ret += test_xmlTextWriterWriteVFormatElement();
45230    test_ret += test_xmlTextWriterWriteVFormatElementNS();
45231    test_ret += test_xmlTextWriterWriteVFormatPI();
45232    test_ret += test_xmlTextWriterWriteVFormatRaw();
45233    test_ret += test_xmlTextWriterWriteVFormatString();
45234
45235    if (test_ret != 0)
45236	printf("Module xmlwriter: %d errors\n", test_ret);
45237    return(test_ret);
45238}
45239
45240static int
45241test_xmlXPathCastBooleanToNumber(void) {
45242    int test_ret = 0;
45243
45244#if defined(LIBXML_XPATH_ENABLED)
45245    int mem_base;
45246    double ret_val;
45247    int val; /* a boolean */
45248    int n_val;
45249
45250    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45251        mem_base = xmlMemBlocks();
45252        val = gen_int(n_val, 0);
45253
45254        ret_val = xmlXPathCastBooleanToNumber(val);
45255        desret_double(ret_val);
45256        call_tests++;
45257        des_int(n_val, val, 0);
45258        xmlResetLastError();
45259        if (mem_base != xmlMemBlocks()) {
45260            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45261	           xmlMemBlocks() - mem_base);
45262	    test_ret++;
45263            printf(" %d", n_val);
45264            printf("\n");
45265        }
45266    }
45267    function_tests++;
45268#endif
45269
45270    return(test_ret);
45271}
45272
45273
45274static int
45275test_xmlXPathCastBooleanToString(void) {
45276    int test_ret = 0;
45277
45278#if defined(LIBXML_XPATH_ENABLED)
45279    int mem_base;
45280    xmlChar * ret_val;
45281    int val; /* a boolean */
45282    int n_val;
45283
45284    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45285        mem_base = xmlMemBlocks();
45286        val = gen_int(n_val, 0);
45287
45288        ret_val = xmlXPathCastBooleanToString(val);
45289        desret_xmlChar_ptr(ret_val);
45290        call_tests++;
45291        des_int(n_val, val, 0);
45292        xmlResetLastError();
45293        if (mem_base != xmlMemBlocks()) {
45294            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45295	           xmlMemBlocks() - mem_base);
45296	    test_ret++;
45297            printf(" %d", n_val);
45298            printf("\n");
45299        }
45300    }
45301    function_tests++;
45302#endif
45303
45304    return(test_ret);
45305}
45306
45307
45308static int
45309test_xmlXPathCastNodeSetToBoolean(void) {
45310    int test_ret = 0;
45311
45312#if defined(LIBXML_XPATH_ENABLED)
45313    int mem_base;
45314    int ret_val;
45315    xmlNodeSetPtr ns; /* a node-set */
45316    int n_ns;
45317
45318    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45319        mem_base = xmlMemBlocks();
45320        ns = gen_xmlNodeSetPtr(n_ns, 0);
45321
45322        ret_val = xmlXPathCastNodeSetToBoolean(ns);
45323        desret_int(ret_val);
45324        call_tests++;
45325        des_xmlNodeSetPtr(n_ns, ns, 0);
45326        xmlResetLastError();
45327        if (mem_base != xmlMemBlocks()) {
45328            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45329	           xmlMemBlocks() - mem_base);
45330	    test_ret++;
45331            printf(" %d", n_ns);
45332            printf("\n");
45333        }
45334    }
45335    function_tests++;
45336#endif
45337
45338    return(test_ret);
45339}
45340
45341
45342static int
45343test_xmlXPathCastNodeSetToNumber(void) {
45344    int test_ret = 0;
45345
45346#if defined(LIBXML_XPATH_ENABLED)
45347    int mem_base;
45348    double ret_val;
45349    xmlNodeSetPtr ns; /* a node-set */
45350    int n_ns;
45351
45352    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45353        mem_base = xmlMemBlocks();
45354        ns = gen_xmlNodeSetPtr(n_ns, 0);
45355
45356        ret_val = xmlXPathCastNodeSetToNumber(ns);
45357        desret_double(ret_val);
45358        call_tests++;
45359        des_xmlNodeSetPtr(n_ns, ns, 0);
45360        xmlResetLastError();
45361        if (mem_base != xmlMemBlocks()) {
45362            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45363	           xmlMemBlocks() - mem_base);
45364	    test_ret++;
45365            printf(" %d", n_ns);
45366            printf("\n");
45367        }
45368    }
45369    function_tests++;
45370#endif
45371
45372    return(test_ret);
45373}
45374
45375
45376static int
45377test_xmlXPathCastNodeSetToString(void) {
45378    int test_ret = 0;
45379
45380#if defined(LIBXML_XPATH_ENABLED)
45381    int mem_base;
45382    xmlChar * ret_val;
45383    xmlNodeSetPtr ns; /* a node-set */
45384    int n_ns;
45385
45386    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45387        mem_base = xmlMemBlocks();
45388        ns = gen_xmlNodeSetPtr(n_ns, 0);
45389
45390        ret_val = xmlXPathCastNodeSetToString(ns);
45391        desret_xmlChar_ptr(ret_val);
45392        call_tests++;
45393        des_xmlNodeSetPtr(n_ns, ns, 0);
45394        xmlResetLastError();
45395        if (mem_base != xmlMemBlocks()) {
45396            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45397	           xmlMemBlocks() - mem_base);
45398	    test_ret++;
45399            printf(" %d", n_ns);
45400            printf("\n");
45401        }
45402    }
45403    function_tests++;
45404#endif
45405
45406    return(test_ret);
45407}
45408
45409
45410static int
45411test_xmlXPathCastNodeToNumber(void) {
45412    int test_ret = 0;
45413
45414#if defined(LIBXML_XPATH_ENABLED)
45415    int mem_base;
45416    double ret_val;
45417    xmlNodePtr node; /* a node */
45418    int n_node;
45419
45420    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45421        mem_base = xmlMemBlocks();
45422        node = gen_xmlNodePtr(n_node, 0);
45423
45424        ret_val = xmlXPathCastNodeToNumber(node);
45425        desret_double(ret_val);
45426        call_tests++;
45427        des_xmlNodePtr(n_node, node, 0);
45428        xmlResetLastError();
45429        if (mem_base != xmlMemBlocks()) {
45430            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45431	           xmlMemBlocks() - mem_base);
45432	    test_ret++;
45433            printf(" %d", n_node);
45434            printf("\n");
45435        }
45436    }
45437    function_tests++;
45438#endif
45439
45440    return(test_ret);
45441}
45442
45443
45444static int
45445test_xmlXPathCastNodeToString(void) {
45446    int test_ret = 0;
45447
45448#if defined(LIBXML_XPATH_ENABLED)
45449    int mem_base;
45450    xmlChar * ret_val;
45451    xmlNodePtr node; /* a node */
45452    int n_node;
45453
45454    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45455        mem_base = xmlMemBlocks();
45456        node = gen_xmlNodePtr(n_node, 0);
45457
45458        ret_val = xmlXPathCastNodeToString(node);
45459        desret_xmlChar_ptr(ret_val);
45460        call_tests++;
45461        des_xmlNodePtr(n_node, node, 0);
45462        xmlResetLastError();
45463        if (mem_base != xmlMemBlocks()) {
45464            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45465	           xmlMemBlocks() - mem_base);
45466	    test_ret++;
45467            printf(" %d", n_node);
45468            printf("\n");
45469        }
45470    }
45471    function_tests++;
45472#endif
45473
45474    return(test_ret);
45475}
45476
45477
45478static int
45479test_xmlXPathCastNumberToBoolean(void) {
45480    int test_ret = 0;
45481
45482#if defined(LIBXML_XPATH_ENABLED)
45483    int mem_base;
45484    int ret_val;
45485    double val; /* a number */
45486    int n_val;
45487
45488    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45489        mem_base = xmlMemBlocks();
45490        val = gen_double(n_val, 0);
45491
45492        ret_val = xmlXPathCastNumberToBoolean(val);
45493        desret_int(ret_val);
45494        call_tests++;
45495        des_double(n_val, val, 0);
45496        xmlResetLastError();
45497        if (mem_base != xmlMemBlocks()) {
45498            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45499	           xmlMemBlocks() - mem_base);
45500	    test_ret++;
45501            printf(" %d", n_val);
45502            printf("\n");
45503        }
45504    }
45505    function_tests++;
45506#endif
45507
45508    return(test_ret);
45509}
45510
45511
45512static int
45513test_xmlXPathCastNumberToString(void) {
45514    int test_ret = 0;
45515
45516#if defined(LIBXML_XPATH_ENABLED)
45517    int mem_base;
45518    xmlChar * ret_val;
45519    double val; /* a number */
45520    int n_val;
45521
45522    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45523        mem_base = xmlMemBlocks();
45524        val = gen_double(n_val, 0);
45525
45526        ret_val = xmlXPathCastNumberToString(val);
45527        desret_xmlChar_ptr(ret_val);
45528        call_tests++;
45529        des_double(n_val, val, 0);
45530        xmlResetLastError();
45531        if (mem_base != xmlMemBlocks()) {
45532            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45533	           xmlMemBlocks() - mem_base);
45534	    test_ret++;
45535            printf(" %d", n_val);
45536            printf("\n");
45537        }
45538    }
45539    function_tests++;
45540#endif
45541
45542    return(test_ret);
45543}
45544
45545
45546static int
45547test_xmlXPathCastStringToBoolean(void) {
45548    int test_ret = 0;
45549
45550#if defined(LIBXML_XPATH_ENABLED)
45551    int mem_base;
45552    int ret_val;
45553    xmlChar * val; /* a string */
45554    int n_val;
45555
45556    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45557        mem_base = xmlMemBlocks();
45558        val = gen_const_xmlChar_ptr(n_val, 0);
45559
45560        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45561        desret_int(ret_val);
45562        call_tests++;
45563        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45564        xmlResetLastError();
45565        if (mem_base != xmlMemBlocks()) {
45566            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45567	           xmlMemBlocks() - mem_base);
45568	    test_ret++;
45569            printf(" %d", n_val);
45570            printf("\n");
45571        }
45572    }
45573    function_tests++;
45574#endif
45575
45576    return(test_ret);
45577}
45578
45579
45580static int
45581test_xmlXPathCastStringToNumber(void) {
45582    int test_ret = 0;
45583
45584#if defined(LIBXML_XPATH_ENABLED)
45585    int mem_base;
45586    double ret_val;
45587    xmlChar * val; /* a string */
45588    int n_val;
45589
45590    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45591        mem_base = xmlMemBlocks();
45592        val = gen_const_xmlChar_ptr(n_val, 0);
45593
45594        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45595        desret_double(ret_val);
45596        call_tests++;
45597        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45598        xmlResetLastError();
45599        if (mem_base != xmlMemBlocks()) {
45600            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45601	           xmlMemBlocks() - mem_base);
45602	    test_ret++;
45603            printf(" %d", n_val);
45604            printf("\n");
45605        }
45606    }
45607    function_tests++;
45608#endif
45609
45610    return(test_ret);
45611}
45612
45613
45614static int
45615test_xmlXPathCastToBoolean(void) {
45616    int test_ret = 0;
45617
45618#if defined(LIBXML_XPATH_ENABLED)
45619    int mem_base;
45620    int ret_val;
45621    xmlXPathObjectPtr val; /* an XPath object */
45622    int n_val;
45623
45624    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45625        mem_base = xmlMemBlocks();
45626        val = gen_xmlXPathObjectPtr(n_val, 0);
45627
45628        ret_val = xmlXPathCastToBoolean(val);
45629        desret_int(ret_val);
45630        call_tests++;
45631        des_xmlXPathObjectPtr(n_val, val, 0);
45632        xmlResetLastError();
45633        if (mem_base != xmlMemBlocks()) {
45634            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45635	           xmlMemBlocks() - mem_base);
45636	    test_ret++;
45637            printf(" %d", n_val);
45638            printf("\n");
45639        }
45640    }
45641    function_tests++;
45642#endif
45643
45644    return(test_ret);
45645}
45646
45647
45648static int
45649test_xmlXPathCastToNumber(void) {
45650    int test_ret = 0;
45651
45652#if defined(LIBXML_XPATH_ENABLED)
45653    int mem_base;
45654    double ret_val;
45655    xmlXPathObjectPtr val; /* an XPath object */
45656    int n_val;
45657
45658    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45659        mem_base = xmlMemBlocks();
45660        val = gen_xmlXPathObjectPtr(n_val, 0);
45661
45662        ret_val = xmlXPathCastToNumber(val);
45663        desret_double(ret_val);
45664        call_tests++;
45665        des_xmlXPathObjectPtr(n_val, val, 0);
45666        xmlResetLastError();
45667        if (mem_base != xmlMemBlocks()) {
45668            printf("Leak of %d blocks found in xmlXPathCastToNumber",
45669	           xmlMemBlocks() - mem_base);
45670	    test_ret++;
45671            printf(" %d", n_val);
45672            printf("\n");
45673        }
45674    }
45675    function_tests++;
45676#endif
45677
45678    return(test_ret);
45679}
45680
45681
45682static int
45683test_xmlXPathCastToString(void) {
45684    int test_ret = 0;
45685
45686#if defined(LIBXML_XPATH_ENABLED)
45687    int mem_base;
45688    xmlChar * ret_val;
45689    xmlXPathObjectPtr val; /* an XPath object */
45690    int n_val;
45691
45692    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45693        mem_base = xmlMemBlocks();
45694        val = gen_xmlXPathObjectPtr(n_val, 0);
45695
45696        ret_val = xmlXPathCastToString(val);
45697        desret_xmlChar_ptr(ret_val);
45698        call_tests++;
45699        des_xmlXPathObjectPtr(n_val, val, 0);
45700        xmlResetLastError();
45701        if (mem_base != xmlMemBlocks()) {
45702            printf("Leak of %d blocks found in xmlXPathCastToString",
45703	           xmlMemBlocks() - mem_base);
45704	    test_ret++;
45705            printf(" %d", n_val);
45706            printf("\n");
45707        }
45708    }
45709    function_tests++;
45710#endif
45711
45712    return(test_ret);
45713}
45714
45715
45716static int
45717test_xmlXPathCmpNodes(void) {
45718    int test_ret = 0;
45719
45720#if defined(LIBXML_XPATH_ENABLED)
45721    int mem_base;
45722    int ret_val;
45723    xmlNodePtr node1; /* the first node */
45724    int n_node1;
45725    xmlNodePtr node2; /* the second node */
45726    int n_node2;
45727
45728    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45729    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45730        mem_base = xmlMemBlocks();
45731        node1 = gen_xmlNodePtr(n_node1, 0);
45732        node2 = gen_xmlNodePtr(n_node2, 1);
45733
45734        ret_val = xmlXPathCmpNodes(node1, node2);
45735        desret_int(ret_val);
45736        call_tests++;
45737        des_xmlNodePtr(n_node1, node1, 0);
45738        des_xmlNodePtr(n_node2, node2, 1);
45739        xmlResetLastError();
45740        if (mem_base != xmlMemBlocks()) {
45741            printf("Leak of %d blocks found in xmlXPathCmpNodes",
45742	           xmlMemBlocks() - mem_base);
45743	    test_ret++;
45744            printf(" %d", n_node1);
45745            printf(" %d", n_node2);
45746            printf("\n");
45747        }
45748    }
45749    }
45750    function_tests++;
45751#endif
45752
45753    return(test_ret);
45754}
45755
45756
45757static int
45758test_xmlXPathCompile(void) {
45759    int test_ret = 0;
45760
45761
45762    /* missing type support */
45763    return(test_ret);
45764}
45765
45766#ifdef LIBXML_XPATH_ENABLED
45767
45768#define gen_nb_xmlXPathCompExprPtr 1
45769static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45770    return(NULL);
45771}
45772static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45773}
45774#endif
45775
45776#ifdef LIBXML_XPATH_ENABLED
45777
45778#define gen_nb_xmlXPathContextPtr 1
45779static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45780    return(NULL);
45781}
45782static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45783}
45784#endif
45785
45786
45787static int
45788test_xmlXPathCompiledEval(void) {
45789    int test_ret = 0;
45790
45791#if defined(LIBXML_XPATH_ENABLED)
45792    int mem_base;
45793    xmlXPathObjectPtr ret_val;
45794    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45795    int n_comp;
45796    xmlXPathContextPtr ctx; /* the XPath context */
45797    int n_ctx;
45798
45799    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45800    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45801        mem_base = xmlMemBlocks();
45802        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45803        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45804
45805        ret_val = xmlXPathCompiledEval(comp, ctx);
45806        desret_xmlXPathObjectPtr(ret_val);
45807        call_tests++;
45808        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45809        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45810        xmlResetLastError();
45811        if (mem_base != xmlMemBlocks()) {
45812            printf("Leak of %d blocks found in xmlXPathCompiledEval",
45813	           xmlMemBlocks() - mem_base);
45814	    test_ret++;
45815            printf(" %d", n_comp);
45816            printf(" %d", n_ctx);
45817            printf("\n");
45818        }
45819    }
45820    }
45821    function_tests++;
45822#endif
45823
45824    return(test_ret);
45825}
45826
45827
45828static int
45829test_xmlXPathCompiledEvalToBoolean(void) {
45830    int test_ret = 0;
45831
45832#if defined(LIBXML_XPATH_ENABLED)
45833    int mem_base;
45834    int ret_val;
45835    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45836    int n_comp;
45837    xmlXPathContextPtr ctxt; /* the XPath context */
45838    int n_ctxt;
45839
45840    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45841    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45842        mem_base = xmlMemBlocks();
45843        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45844        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
45845
45846        ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
45847        desret_int(ret_val);
45848        call_tests++;
45849        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45850        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
45851        xmlResetLastError();
45852        if (mem_base != xmlMemBlocks()) {
45853            printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
45854	           xmlMemBlocks() - mem_base);
45855	    test_ret++;
45856            printf(" %d", n_comp);
45857            printf(" %d", n_ctxt);
45858            printf("\n");
45859        }
45860    }
45861    }
45862    function_tests++;
45863#endif
45864
45865    return(test_ret);
45866}
45867
45868
45869static int
45870test_xmlXPathContextSetCache(void) {
45871    int test_ret = 0;
45872
45873#if defined(LIBXML_XPATH_ENABLED)
45874    int mem_base;
45875    int ret_val;
45876    xmlXPathContextPtr ctxt; /* the XPath context */
45877    int n_ctxt;
45878    int active; /* enables/disables (creates/frees) the cache */
45879    int n_active;
45880    int value; /* a value with semantics dependant on @options */
45881    int n_value;
45882    int options; /* options (currently only the value 0 is used) */
45883    int n_options;
45884
45885    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45886    for (n_active = 0;n_active < gen_nb_int;n_active++) {
45887    for (n_value = 0;n_value < gen_nb_int;n_value++) {
45888    for (n_options = 0;n_options < gen_nb_int;n_options++) {
45889        mem_base = xmlMemBlocks();
45890        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45891        active = gen_int(n_active, 1);
45892        value = gen_int(n_value, 2);
45893        options = gen_int(n_options, 3);
45894
45895        ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
45896        desret_int(ret_val);
45897        call_tests++;
45898        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45899        des_int(n_active, active, 1);
45900        des_int(n_value, value, 2);
45901        des_int(n_options, options, 3);
45902        xmlResetLastError();
45903        if (mem_base != xmlMemBlocks()) {
45904            printf("Leak of %d blocks found in xmlXPathContextSetCache",
45905	           xmlMemBlocks() - mem_base);
45906	    test_ret++;
45907            printf(" %d", n_ctxt);
45908            printf(" %d", n_active);
45909            printf(" %d", n_value);
45910            printf(" %d", n_options);
45911            printf("\n");
45912        }
45913    }
45914    }
45915    }
45916    }
45917    function_tests++;
45918#endif
45919
45920    return(test_ret);
45921}
45922
45923
45924static int
45925test_xmlXPathConvertBoolean(void) {
45926    int test_ret = 0;
45927
45928#if defined(LIBXML_XPATH_ENABLED)
45929    int mem_base;
45930    xmlXPathObjectPtr ret_val;
45931    xmlXPathObjectPtr val; /* an XPath object */
45932    int n_val;
45933
45934    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45935        mem_base = xmlMemBlocks();
45936        val = gen_xmlXPathObjectPtr(n_val, 0);
45937
45938        ret_val = xmlXPathConvertBoolean(val);
45939        val = NULL;
45940        desret_xmlXPathObjectPtr(ret_val);
45941        call_tests++;
45942        des_xmlXPathObjectPtr(n_val, val, 0);
45943        xmlResetLastError();
45944        if (mem_base != xmlMemBlocks()) {
45945            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
45946	           xmlMemBlocks() - mem_base);
45947	    test_ret++;
45948            printf(" %d", n_val);
45949            printf("\n");
45950        }
45951    }
45952    function_tests++;
45953#endif
45954
45955    return(test_ret);
45956}
45957
45958
45959static int
45960test_xmlXPathConvertNumber(void) {
45961    int test_ret = 0;
45962
45963#if defined(LIBXML_XPATH_ENABLED)
45964    int mem_base;
45965    xmlXPathObjectPtr ret_val;
45966    xmlXPathObjectPtr val; /* an XPath object */
45967    int n_val;
45968
45969    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45970        mem_base = xmlMemBlocks();
45971        val = gen_xmlXPathObjectPtr(n_val, 0);
45972
45973        ret_val = xmlXPathConvertNumber(val);
45974        val = NULL;
45975        desret_xmlXPathObjectPtr(ret_val);
45976        call_tests++;
45977        des_xmlXPathObjectPtr(n_val, val, 0);
45978        xmlResetLastError();
45979        if (mem_base != xmlMemBlocks()) {
45980            printf("Leak of %d blocks found in xmlXPathConvertNumber",
45981	           xmlMemBlocks() - mem_base);
45982	    test_ret++;
45983            printf(" %d", n_val);
45984            printf("\n");
45985        }
45986    }
45987    function_tests++;
45988#endif
45989
45990    return(test_ret);
45991}
45992
45993
45994static int
45995test_xmlXPathConvertString(void) {
45996    int test_ret = 0;
45997
45998#if defined(LIBXML_XPATH_ENABLED)
45999    int mem_base;
46000    xmlXPathObjectPtr ret_val;
46001    xmlXPathObjectPtr val; /* an XPath object */
46002    int n_val;
46003
46004    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46005        mem_base = xmlMemBlocks();
46006        val = gen_xmlXPathObjectPtr(n_val, 0);
46007
46008        ret_val = xmlXPathConvertString(val);
46009        val = NULL;
46010        desret_xmlXPathObjectPtr(ret_val);
46011        call_tests++;
46012        des_xmlXPathObjectPtr(n_val, val, 0);
46013        xmlResetLastError();
46014        if (mem_base != xmlMemBlocks()) {
46015            printf("Leak of %d blocks found in xmlXPathConvertString",
46016	           xmlMemBlocks() - mem_base);
46017	    test_ret++;
46018            printf(" %d", n_val);
46019            printf("\n");
46020        }
46021    }
46022    function_tests++;
46023#endif
46024
46025    return(test_ret);
46026}
46027
46028
46029static int
46030test_xmlXPathCtxtCompile(void) {
46031    int test_ret = 0;
46032
46033
46034    /* missing type support */
46035    return(test_ret);
46036}
46037
46038
46039static int
46040test_xmlXPathEval(void) {
46041    int test_ret = 0;
46042
46043#if defined(LIBXML_XPATH_ENABLED)
46044    int mem_base;
46045    xmlXPathObjectPtr ret_val;
46046    xmlChar * str; /* the XPath expression */
46047    int n_str;
46048    xmlXPathContextPtr ctx; /* the XPath context */
46049    int n_ctx;
46050
46051    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46052    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46053        mem_base = xmlMemBlocks();
46054        str = gen_const_xmlChar_ptr(n_str, 0);
46055        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46056
46057        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46058        desret_xmlXPathObjectPtr(ret_val);
46059        call_tests++;
46060        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46061        des_xmlXPathContextPtr(n_ctx, ctx, 1);
46062        xmlResetLastError();
46063        if (mem_base != xmlMemBlocks()) {
46064            printf("Leak of %d blocks found in xmlXPathEval",
46065	           xmlMemBlocks() - mem_base);
46066	    test_ret++;
46067            printf(" %d", n_str);
46068            printf(" %d", n_ctx);
46069            printf("\n");
46070        }
46071    }
46072    }
46073    function_tests++;
46074#endif
46075
46076    return(test_ret);
46077}
46078
46079
46080static int
46081test_xmlXPathEvalExpression(void) {
46082    int test_ret = 0;
46083
46084#if defined(LIBXML_XPATH_ENABLED)
46085    int mem_base;
46086    xmlXPathObjectPtr ret_val;
46087    xmlChar * str; /* the XPath expression */
46088    int n_str;
46089    xmlXPathContextPtr ctxt; /* the XPath context */
46090    int n_ctxt;
46091
46092    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46093    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46094        mem_base = xmlMemBlocks();
46095        str = gen_const_xmlChar_ptr(n_str, 0);
46096        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46097
46098        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46099        desret_xmlXPathObjectPtr(ret_val);
46100        call_tests++;
46101        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46102        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46103        xmlResetLastError();
46104        if (mem_base != xmlMemBlocks()) {
46105            printf("Leak of %d blocks found in xmlXPathEvalExpression",
46106	           xmlMemBlocks() - mem_base);
46107	    test_ret++;
46108            printf(" %d", n_str);
46109            printf(" %d", n_ctxt);
46110            printf("\n");
46111        }
46112    }
46113    }
46114    function_tests++;
46115#endif
46116
46117    return(test_ret);
46118}
46119
46120
46121static int
46122test_xmlXPathEvalPredicate(void) {
46123    int test_ret = 0;
46124
46125#if defined(LIBXML_XPATH_ENABLED)
46126    int mem_base;
46127    int ret_val;
46128    xmlXPathContextPtr ctxt; /* the XPath context */
46129    int n_ctxt;
46130    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46131    int n_res;
46132
46133    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46134    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46135        mem_base = xmlMemBlocks();
46136        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46137        res = gen_xmlXPathObjectPtr(n_res, 1);
46138
46139        ret_val = xmlXPathEvalPredicate(ctxt, res);
46140        desret_int(ret_val);
46141        call_tests++;
46142        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46143        des_xmlXPathObjectPtr(n_res, res, 1);
46144        xmlResetLastError();
46145        if (mem_base != xmlMemBlocks()) {
46146            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46147	           xmlMemBlocks() - mem_base);
46148	    test_ret++;
46149            printf(" %d", n_ctxt);
46150            printf(" %d", n_res);
46151            printf("\n");
46152        }
46153    }
46154    }
46155    function_tests++;
46156#endif
46157
46158    return(test_ret);
46159}
46160
46161
46162static int
46163test_xmlXPathInit(void) {
46164    int test_ret = 0;
46165
46166#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46167    int mem_base;
46168
46169        mem_base = xmlMemBlocks();
46170
46171        xmlXPathInit();
46172        call_tests++;
46173        xmlResetLastError();
46174        if (mem_base != xmlMemBlocks()) {
46175            printf("Leak of %d blocks found in xmlXPathInit",
46176	           xmlMemBlocks() - mem_base);
46177	    test_ret++;
46178            printf("\n");
46179        }
46180    function_tests++;
46181#endif
46182
46183    return(test_ret);
46184}
46185
46186
46187static int
46188test_xmlXPathIsInf(void) {
46189    int test_ret = 0;
46190
46191#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46192    int mem_base;
46193    int ret_val;
46194    double val; /* a double value */
46195    int n_val;
46196
46197    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46198        mem_base = xmlMemBlocks();
46199        val = gen_double(n_val, 0);
46200
46201        ret_val = xmlXPathIsInf(val);
46202        desret_int(ret_val);
46203        call_tests++;
46204        des_double(n_val, val, 0);
46205        xmlResetLastError();
46206        if (mem_base != xmlMemBlocks()) {
46207            printf("Leak of %d blocks found in xmlXPathIsInf",
46208	           xmlMemBlocks() - mem_base);
46209	    test_ret++;
46210            printf(" %d", n_val);
46211            printf("\n");
46212        }
46213    }
46214    function_tests++;
46215#endif
46216
46217    return(test_ret);
46218}
46219
46220
46221static int
46222test_xmlXPathIsNaN(void) {
46223    int test_ret = 0;
46224
46225#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46226    int mem_base;
46227    int ret_val;
46228    double val; /* a double value */
46229    int n_val;
46230
46231    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46232        mem_base = xmlMemBlocks();
46233        val = gen_double(n_val, 0);
46234
46235        ret_val = xmlXPathIsNaN(val);
46236        desret_int(ret_val);
46237        call_tests++;
46238        des_double(n_val, val, 0);
46239        xmlResetLastError();
46240        if (mem_base != xmlMemBlocks()) {
46241            printf("Leak of %d blocks found in xmlXPathIsNaN",
46242	           xmlMemBlocks() - mem_base);
46243	    test_ret++;
46244            printf(" %d", n_val);
46245            printf("\n");
46246        }
46247    }
46248    function_tests++;
46249#endif
46250
46251    return(test_ret);
46252}
46253
46254
46255static int
46256test_xmlXPathNewContext(void) {
46257    int test_ret = 0;
46258
46259
46260    /* missing type support */
46261    return(test_ret);
46262}
46263
46264
46265static int
46266test_xmlXPathNodeSetCreate(void) {
46267    int test_ret = 0;
46268
46269#if defined(LIBXML_XPATH_ENABLED)
46270    int mem_base;
46271    xmlNodeSetPtr ret_val;
46272    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46273    int n_val;
46274
46275    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46276        mem_base = xmlMemBlocks();
46277        val = gen_xmlNodePtr(n_val, 0);
46278
46279        ret_val = xmlXPathNodeSetCreate(val);
46280        desret_xmlNodeSetPtr(ret_val);
46281        call_tests++;
46282        des_xmlNodePtr(n_val, val, 0);
46283        xmlResetLastError();
46284        if (mem_base != xmlMemBlocks()) {
46285            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46286	           xmlMemBlocks() - mem_base);
46287	    test_ret++;
46288            printf(" %d", n_val);
46289            printf("\n");
46290        }
46291    }
46292    function_tests++;
46293#endif
46294
46295    return(test_ret);
46296}
46297
46298
46299static int
46300test_xmlXPathObjectCopy(void) {
46301    int test_ret = 0;
46302
46303#if defined(LIBXML_XPATH_ENABLED)
46304    int mem_base;
46305    xmlXPathObjectPtr ret_val;
46306    xmlXPathObjectPtr val; /* the original object */
46307    int n_val;
46308
46309    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46310        mem_base = xmlMemBlocks();
46311        val = gen_xmlXPathObjectPtr(n_val, 0);
46312
46313        ret_val = xmlXPathObjectCopy(val);
46314        desret_xmlXPathObjectPtr(ret_val);
46315        call_tests++;
46316        des_xmlXPathObjectPtr(n_val, val, 0);
46317        xmlResetLastError();
46318        if (mem_base != xmlMemBlocks()) {
46319            printf("Leak of %d blocks found in xmlXPathObjectCopy",
46320	           xmlMemBlocks() - mem_base);
46321	    test_ret++;
46322            printf(" %d", n_val);
46323            printf("\n");
46324        }
46325    }
46326    function_tests++;
46327#endif
46328
46329    return(test_ret);
46330}
46331
46332
46333static int
46334test_xmlXPathOrderDocElems(void) {
46335    int test_ret = 0;
46336
46337#if defined(LIBXML_XPATH_ENABLED)
46338    int mem_base;
46339    long ret_val;
46340    xmlDocPtr doc; /* an input document */
46341    int n_doc;
46342
46343    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46344        mem_base = xmlMemBlocks();
46345        doc = gen_xmlDocPtr(n_doc, 0);
46346
46347        ret_val = xmlXPathOrderDocElems(doc);
46348        desret_long(ret_val);
46349        call_tests++;
46350        des_xmlDocPtr(n_doc, doc, 0);
46351        xmlResetLastError();
46352        if (mem_base != xmlMemBlocks()) {
46353            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46354	           xmlMemBlocks() - mem_base);
46355	    test_ret++;
46356            printf(" %d", n_doc);
46357            printf("\n");
46358        }
46359    }
46360    function_tests++;
46361#endif
46362
46363    return(test_ret);
46364}
46365
46366static int
46367test_xpath(void) {
46368    int test_ret = 0;
46369
46370    if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46371    test_ret += test_xmlXPathCastBooleanToNumber();
46372    test_ret += test_xmlXPathCastBooleanToString();
46373    test_ret += test_xmlXPathCastNodeSetToBoolean();
46374    test_ret += test_xmlXPathCastNodeSetToNumber();
46375    test_ret += test_xmlXPathCastNodeSetToString();
46376    test_ret += test_xmlXPathCastNodeToNumber();
46377    test_ret += test_xmlXPathCastNodeToString();
46378    test_ret += test_xmlXPathCastNumberToBoolean();
46379    test_ret += test_xmlXPathCastNumberToString();
46380    test_ret += test_xmlXPathCastStringToBoolean();
46381    test_ret += test_xmlXPathCastStringToNumber();
46382    test_ret += test_xmlXPathCastToBoolean();
46383    test_ret += test_xmlXPathCastToNumber();
46384    test_ret += test_xmlXPathCastToString();
46385    test_ret += test_xmlXPathCmpNodes();
46386    test_ret += test_xmlXPathCompile();
46387    test_ret += test_xmlXPathCompiledEval();
46388    test_ret += test_xmlXPathCompiledEvalToBoolean();
46389    test_ret += test_xmlXPathContextSetCache();
46390    test_ret += test_xmlXPathConvertBoolean();
46391    test_ret += test_xmlXPathConvertNumber();
46392    test_ret += test_xmlXPathConvertString();
46393    test_ret += test_xmlXPathCtxtCompile();
46394    test_ret += test_xmlXPathEval();
46395    test_ret += test_xmlXPathEvalExpression();
46396    test_ret += test_xmlXPathEvalPredicate();
46397    test_ret += test_xmlXPathInit();
46398    test_ret += test_xmlXPathIsInf();
46399    test_ret += test_xmlXPathIsNaN();
46400    test_ret += test_xmlXPathNewContext();
46401    test_ret += test_xmlXPathNodeSetCreate();
46402    test_ret += test_xmlXPathObjectCopy();
46403    test_ret += test_xmlXPathOrderDocElems();
46404
46405    if (test_ret != 0)
46406	printf("Module xpath: %d errors\n", test_ret);
46407    return(test_ret);
46408}
46409#ifdef LIBXML_XPATH_ENABLED
46410
46411#define gen_nb_xmlXPathParserContextPtr 1
46412static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46413    return(NULL);
46414}
46415static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46416}
46417#endif
46418
46419
46420static int
46421test_valuePop(void) {
46422    int test_ret = 0;
46423
46424#if defined(LIBXML_XPATH_ENABLED)
46425    int mem_base;
46426    xmlXPathObjectPtr ret_val;
46427    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46428    int n_ctxt;
46429
46430    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46431        mem_base = xmlMemBlocks();
46432        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46433
46434        ret_val = valuePop(ctxt);
46435        desret_xmlXPathObjectPtr(ret_val);
46436        call_tests++;
46437        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46438        xmlResetLastError();
46439        if (mem_base != xmlMemBlocks()) {
46440            printf("Leak of %d blocks found in valuePop",
46441	           xmlMemBlocks() - mem_base);
46442	    test_ret++;
46443            printf(" %d", n_ctxt);
46444            printf("\n");
46445        }
46446    }
46447    function_tests++;
46448#endif
46449
46450    return(test_ret);
46451}
46452
46453
46454static int
46455test_valuePush(void) {
46456    int test_ret = 0;
46457
46458#if defined(LIBXML_XPATH_ENABLED)
46459    int mem_base;
46460    int ret_val;
46461    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46462    int n_ctxt;
46463    xmlXPathObjectPtr value; /* the XPath object */
46464    int n_value;
46465
46466    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46467    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46468        mem_base = xmlMemBlocks();
46469        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46470        value = gen_xmlXPathObjectPtr(n_value, 1);
46471
46472        ret_val = valuePush(ctxt, value);
46473        desret_int(ret_val);
46474        call_tests++;
46475        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46476        des_xmlXPathObjectPtr(n_value, value, 1);
46477        xmlResetLastError();
46478        if (mem_base != xmlMemBlocks()) {
46479            printf("Leak of %d blocks found in valuePush",
46480	           xmlMemBlocks() - mem_base);
46481	    test_ret++;
46482            printf(" %d", n_ctxt);
46483            printf(" %d", n_value);
46484            printf("\n");
46485        }
46486    }
46487    }
46488    function_tests++;
46489#endif
46490
46491    return(test_ret);
46492}
46493
46494
46495static int
46496test_xmlXPathAddValues(void) {
46497    int test_ret = 0;
46498
46499#if defined(LIBXML_XPATH_ENABLED)
46500    int mem_base;
46501    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46502    int n_ctxt;
46503
46504    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46505        mem_base = xmlMemBlocks();
46506        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46507
46508        xmlXPathAddValues(ctxt);
46509        call_tests++;
46510        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46511        xmlResetLastError();
46512        if (mem_base != xmlMemBlocks()) {
46513            printf("Leak of %d blocks found in xmlXPathAddValues",
46514	           xmlMemBlocks() - mem_base);
46515	    test_ret++;
46516            printf(" %d", n_ctxt);
46517            printf("\n");
46518        }
46519    }
46520    function_tests++;
46521#endif
46522
46523    return(test_ret);
46524}
46525
46526
46527static int
46528test_xmlXPathBooleanFunction(void) {
46529    int test_ret = 0;
46530
46531#if defined(LIBXML_XPATH_ENABLED)
46532    int mem_base;
46533    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46534    int n_ctxt;
46535    int nargs; /* the number of arguments */
46536    int n_nargs;
46537
46538    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46539    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46540        mem_base = xmlMemBlocks();
46541        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46542        nargs = gen_int(n_nargs, 1);
46543
46544        xmlXPathBooleanFunction(ctxt, nargs);
46545        call_tests++;
46546        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46547        des_int(n_nargs, nargs, 1);
46548        xmlResetLastError();
46549        if (mem_base != xmlMemBlocks()) {
46550            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46551	           xmlMemBlocks() - mem_base);
46552	    test_ret++;
46553            printf(" %d", n_ctxt);
46554            printf(" %d", n_nargs);
46555            printf("\n");
46556        }
46557    }
46558    }
46559    function_tests++;
46560#endif
46561
46562    return(test_ret);
46563}
46564
46565
46566static int
46567test_xmlXPathCeilingFunction(void) {
46568    int test_ret = 0;
46569
46570#if defined(LIBXML_XPATH_ENABLED)
46571    int mem_base;
46572    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46573    int n_ctxt;
46574    int nargs; /* the number of arguments */
46575    int n_nargs;
46576
46577    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46578    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46579        mem_base = xmlMemBlocks();
46580        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46581        nargs = gen_int(n_nargs, 1);
46582
46583        xmlXPathCeilingFunction(ctxt, nargs);
46584        call_tests++;
46585        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46586        des_int(n_nargs, nargs, 1);
46587        xmlResetLastError();
46588        if (mem_base != xmlMemBlocks()) {
46589            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46590	           xmlMemBlocks() - mem_base);
46591	    test_ret++;
46592            printf(" %d", n_ctxt);
46593            printf(" %d", n_nargs);
46594            printf("\n");
46595        }
46596    }
46597    }
46598    function_tests++;
46599#endif
46600
46601    return(test_ret);
46602}
46603
46604
46605static int
46606test_xmlXPathCompareValues(void) {
46607    int test_ret = 0;
46608
46609#if defined(LIBXML_XPATH_ENABLED)
46610    int mem_base;
46611    int ret_val;
46612    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46613    int n_ctxt;
46614    int inf; /* less than (1) or greater than (0) */
46615    int n_inf;
46616    int strict; /* is the comparison strict */
46617    int n_strict;
46618
46619    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46620    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46621    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46622        mem_base = xmlMemBlocks();
46623        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46624        inf = gen_int(n_inf, 1);
46625        strict = gen_int(n_strict, 2);
46626
46627        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46628        desret_int(ret_val);
46629        call_tests++;
46630        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46631        des_int(n_inf, inf, 1);
46632        des_int(n_strict, strict, 2);
46633        xmlResetLastError();
46634        if (mem_base != xmlMemBlocks()) {
46635            printf("Leak of %d blocks found in xmlXPathCompareValues",
46636	           xmlMemBlocks() - mem_base);
46637	    test_ret++;
46638            printf(" %d", n_ctxt);
46639            printf(" %d", n_inf);
46640            printf(" %d", n_strict);
46641            printf("\n");
46642        }
46643    }
46644    }
46645    }
46646    function_tests++;
46647#endif
46648
46649    return(test_ret);
46650}
46651
46652
46653static int
46654test_xmlXPathConcatFunction(void) {
46655    int test_ret = 0;
46656
46657#if defined(LIBXML_XPATH_ENABLED)
46658    int mem_base;
46659    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46660    int n_ctxt;
46661    int nargs; /* the number of arguments */
46662    int n_nargs;
46663
46664    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46665    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46666        mem_base = xmlMemBlocks();
46667        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46668        nargs = gen_int(n_nargs, 1);
46669
46670        xmlXPathConcatFunction(ctxt, nargs);
46671        call_tests++;
46672        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46673        des_int(n_nargs, nargs, 1);
46674        xmlResetLastError();
46675        if (mem_base != xmlMemBlocks()) {
46676            printf("Leak of %d blocks found in xmlXPathConcatFunction",
46677	           xmlMemBlocks() - mem_base);
46678	    test_ret++;
46679            printf(" %d", n_ctxt);
46680            printf(" %d", n_nargs);
46681            printf("\n");
46682        }
46683    }
46684    }
46685    function_tests++;
46686#endif
46687
46688    return(test_ret);
46689}
46690
46691
46692static int
46693test_xmlXPathContainsFunction(void) {
46694    int test_ret = 0;
46695
46696#if defined(LIBXML_XPATH_ENABLED)
46697    int mem_base;
46698    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46699    int n_ctxt;
46700    int nargs; /* the number of arguments */
46701    int n_nargs;
46702
46703    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46704    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46705        mem_base = xmlMemBlocks();
46706        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46707        nargs = gen_int(n_nargs, 1);
46708
46709        xmlXPathContainsFunction(ctxt, nargs);
46710        call_tests++;
46711        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46712        des_int(n_nargs, nargs, 1);
46713        xmlResetLastError();
46714        if (mem_base != xmlMemBlocks()) {
46715            printf("Leak of %d blocks found in xmlXPathContainsFunction",
46716	           xmlMemBlocks() - mem_base);
46717	    test_ret++;
46718            printf(" %d", n_ctxt);
46719            printf(" %d", n_nargs);
46720            printf("\n");
46721        }
46722    }
46723    }
46724    function_tests++;
46725#endif
46726
46727    return(test_ret);
46728}
46729
46730
46731static int
46732test_xmlXPathCountFunction(void) {
46733    int test_ret = 0;
46734
46735#if defined(LIBXML_XPATH_ENABLED)
46736    int mem_base;
46737    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46738    int n_ctxt;
46739    int nargs; /* the number of arguments */
46740    int n_nargs;
46741
46742    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46743    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46744        mem_base = xmlMemBlocks();
46745        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46746        nargs = gen_int(n_nargs, 1);
46747
46748        xmlXPathCountFunction(ctxt, nargs);
46749        call_tests++;
46750        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46751        des_int(n_nargs, nargs, 1);
46752        xmlResetLastError();
46753        if (mem_base != xmlMemBlocks()) {
46754            printf("Leak of %d blocks found in xmlXPathCountFunction",
46755	           xmlMemBlocks() - mem_base);
46756	    test_ret++;
46757            printf(" %d", n_ctxt);
46758            printf(" %d", n_nargs);
46759            printf("\n");
46760        }
46761    }
46762    }
46763    function_tests++;
46764#endif
46765
46766    return(test_ret);
46767}
46768
46769
46770static int
46771test_xmlXPathDebugDumpCompExpr(void) {
46772    int test_ret = 0;
46773
46774#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46775    int mem_base;
46776    FILE * output; /* the FILE * for the output */
46777    int n_output;
46778    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46779    int n_comp;
46780    int depth; /* the indentation level. */
46781    int n_depth;
46782
46783    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46784    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46785    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46786        mem_base = xmlMemBlocks();
46787        output = gen_FILE_ptr(n_output, 0);
46788        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46789        depth = gen_int(n_depth, 2);
46790
46791        xmlXPathDebugDumpCompExpr(output, comp, depth);
46792        call_tests++;
46793        des_FILE_ptr(n_output, output, 0);
46794        des_xmlXPathCompExprPtr(n_comp, comp, 1);
46795        des_int(n_depth, depth, 2);
46796        xmlResetLastError();
46797        if (mem_base != xmlMemBlocks()) {
46798            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46799	           xmlMemBlocks() - mem_base);
46800	    test_ret++;
46801            printf(" %d", n_output);
46802            printf(" %d", n_comp);
46803            printf(" %d", n_depth);
46804            printf("\n");
46805        }
46806    }
46807    }
46808    }
46809    function_tests++;
46810#endif
46811
46812    return(test_ret);
46813}
46814
46815
46816static int
46817test_xmlXPathDebugDumpObject(void) {
46818    int test_ret = 0;
46819
46820#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46821    int mem_base;
46822    FILE * output; /* the FILE * to dump the output */
46823    int n_output;
46824    xmlXPathObjectPtr cur; /* the object to inspect */
46825    int n_cur;
46826    int depth; /* indentation level */
46827    int n_depth;
46828
46829    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46830    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
46831    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46832        mem_base = xmlMemBlocks();
46833        output = gen_FILE_ptr(n_output, 0);
46834        cur = gen_xmlXPathObjectPtr(n_cur, 1);
46835        depth = gen_int(n_depth, 2);
46836
46837        xmlXPathDebugDumpObject(output, cur, depth);
46838        call_tests++;
46839        des_FILE_ptr(n_output, output, 0);
46840        des_xmlXPathObjectPtr(n_cur, cur, 1);
46841        des_int(n_depth, depth, 2);
46842        xmlResetLastError();
46843        if (mem_base != xmlMemBlocks()) {
46844            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
46845	           xmlMemBlocks() - mem_base);
46846	    test_ret++;
46847            printf(" %d", n_output);
46848            printf(" %d", n_cur);
46849            printf(" %d", n_depth);
46850            printf("\n");
46851        }
46852    }
46853    }
46854    }
46855    function_tests++;
46856#endif
46857
46858    return(test_ret);
46859}
46860
46861
46862static int
46863test_xmlXPathDifference(void) {
46864    int test_ret = 0;
46865
46866#if defined(LIBXML_XPATH_ENABLED)
46867    int mem_base;
46868    xmlNodeSetPtr ret_val;
46869    xmlNodeSetPtr nodes1; /* a node-set */
46870    int n_nodes1;
46871    xmlNodeSetPtr nodes2; /* a node-set */
46872    int n_nodes2;
46873
46874    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46875    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46876        mem_base = xmlMemBlocks();
46877        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46878        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46879
46880        ret_val = xmlXPathDifference(nodes1, nodes2);
46881        desret_xmlNodeSetPtr(ret_val);
46882        call_tests++;
46883        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46884        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46885        xmlResetLastError();
46886        if (mem_base != xmlMemBlocks()) {
46887            printf("Leak of %d blocks found in xmlXPathDifference",
46888	           xmlMemBlocks() - mem_base);
46889	    test_ret++;
46890            printf(" %d", n_nodes1);
46891            printf(" %d", n_nodes2);
46892            printf("\n");
46893        }
46894    }
46895    }
46896    function_tests++;
46897#endif
46898
46899    return(test_ret);
46900}
46901
46902
46903static int
46904test_xmlXPathDistinct(void) {
46905    int test_ret = 0;
46906
46907#if defined(LIBXML_XPATH_ENABLED)
46908    int mem_base;
46909    xmlNodeSetPtr ret_val;
46910    xmlNodeSetPtr nodes; /* a node-set */
46911    int n_nodes;
46912
46913    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46914        mem_base = xmlMemBlocks();
46915        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46916
46917        ret_val = xmlXPathDistinct(nodes);
46918        desret_xmlNodeSetPtr(ret_val);
46919        call_tests++;
46920        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46921        xmlResetLastError();
46922        if (mem_base != xmlMemBlocks()) {
46923            printf("Leak of %d blocks found in xmlXPathDistinct",
46924	           xmlMemBlocks() - mem_base);
46925	    test_ret++;
46926            printf(" %d", n_nodes);
46927            printf("\n");
46928        }
46929    }
46930    function_tests++;
46931#endif
46932
46933    return(test_ret);
46934}
46935
46936
46937static int
46938test_xmlXPathDistinctSorted(void) {
46939    int test_ret = 0;
46940
46941#if defined(LIBXML_XPATH_ENABLED)
46942    int mem_base;
46943    xmlNodeSetPtr ret_val;
46944    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46945    int n_nodes;
46946
46947    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46948        mem_base = xmlMemBlocks();
46949        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46950
46951        ret_val = xmlXPathDistinctSorted(nodes);
46952        desret_xmlNodeSetPtr(ret_val);
46953        call_tests++;
46954        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46955        xmlResetLastError();
46956        if (mem_base != xmlMemBlocks()) {
46957            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
46958	           xmlMemBlocks() - mem_base);
46959	    test_ret++;
46960            printf(" %d", n_nodes);
46961            printf("\n");
46962        }
46963    }
46964    function_tests++;
46965#endif
46966
46967    return(test_ret);
46968}
46969
46970
46971static int
46972test_xmlXPathDivValues(void) {
46973    int test_ret = 0;
46974
46975#if defined(LIBXML_XPATH_ENABLED)
46976    int mem_base;
46977    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46978    int n_ctxt;
46979
46980    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46981        mem_base = xmlMemBlocks();
46982        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46983
46984        xmlXPathDivValues(ctxt);
46985        call_tests++;
46986        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46987        xmlResetLastError();
46988        if (mem_base != xmlMemBlocks()) {
46989            printf("Leak of %d blocks found in xmlXPathDivValues",
46990	           xmlMemBlocks() - mem_base);
46991	    test_ret++;
46992            printf(" %d", n_ctxt);
46993            printf("\n");
46994        }
46995    }
46996    function_tests++;
46997#endif
46998
46999    return(test_ret);
47000}
47001
47002
47003static int
47004test_xmlXPathEqualValues(void) {
47005    int test_ret = 0;
47006
47007#if defined(LIBXML_XPATH_ENABLED)
47008    int mem_base;
47009    int ret_val;
47010    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47011    int n_ctxt;
47012
47013    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47014        mem_base = xmlMemBlocks();
47015        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47016
47017        ret_val = xmlXPathEqualValues(ctxt);
47018        desret_int(ret_val);
47019        call_tests++;
47020        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47021        xmlResetLastError();
47022        if (mem_base != xmlMemBlocks()) {
47023            printf("Leak of %d blocks found in xmlXPathEqualValues",
47024	           xmlMemBlocks() - mem_base);
47025	    test_ret++;
47026            printf(" %d", n_ctxt);
47027            printf("\n");
47028        }
47029    }
47030    function_tests++;
47031#endif
47032
47033    return(test_ret);
47034}
47035
47036
47037static int
47038test_xmlXPathErr(void) {
47039    int test_ret = 0;
47040
47041#if defined(LIBXML_XPATH_ENABLED)
47042    int mem_base;
47043    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47044    int n_ctxt;
47045    int error; /* the error code */
47046    int n_error;
47047
47048    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47049    for (n_error = 0;n_error < gen_nb_int;n_error++) {
47050        mem_base = xmlMemBlocks();
47051        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47052        error = gen_int(n_error, 1);
47053
47054        xmlXPathErr(ctxt, error);
47055        call_tests++;
47056        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47057        des_int(n_error, error, 1);
47058        xmlResetLastError();
47059        if (mem_base != xmlMemBlocks()) {
47060            printf("Leak of %d blocks found in xmlXPathErr",
47061	           xmlMemBlocks() - mem_base);
47062	    test_ret++;
47063            printf(" %d", n_ctxt);
47064            printf(" %d", n_error);
47065            printf("\n");
47066        }
47067    }
47068    }
47069    function_tests++;
47070#endif
47071
47072    return(test_ret);
47073}
47074
47075
47076static int
47077test_xmlXPathEvalExpr(void) {
47078    int test_ret = 0;
47079
47080#if defined(LIBXML_XPATH_ENABLED)
47081    int mem_base;
47082    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47083    int n_ctxt;
47084
47085    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47086        mem_base = xmlMemBlocks();
47087        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47088
47089        xmlXPathEvalExpr(ctxt);
47090        call_tests++;
47091        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47092        xmlResetLastError();
47093        if (mem_base != xmlMemBlocks()) {
47094            printf("Leak of %d blocks found in xmlXPathEvalExpr",
47095	           xmlMemBlocks() - mem_base);
47096	    test_ret++;
47097            printf(" %d", n_ctxt);
47098            printf("\n");
47099        }
47100    }
47101    function_tests++;
47102#endif
47103
47104    return(test_ret);
47105}
47106
47107
47108static int
47109test_xmlXPathEvaluatePredicateResult(void) {
47110    int test_ret = 0;
47111
47112#if defined(LIBXML_XPATH_ENABLED)
47113    int mem_base;
47114    int ret_val;
47115    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47116    int n_ctxt;
47117    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47118    int n_res;
47119
47120    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47121    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47122        mem_base = xmlMemBlocks();
47123        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47124        res = gen_xmlXPathObjectPtr(n_res, 1);
47125
47126        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47127        desret_int(ret_val);
47128        call_tests++;
47129        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47130        des_xmlXPathObjectPtr(n_res, res, 1);
47131        xmlResetLastError();
47132        if (mem_base != xmlMemBlocks()) {
47133            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47134	           xmlMemBlocks() - mem_base);
47135	    test_ret++;
47136            printf(" %d", n_ctxt);
47137            printf(" %d", n_res);
47138            printf("\n");
47139        }
47140    }
47141    }
47142    function_tests++;
47143#endif
47144
47145    return(test_ret);
47146}
47147
47148
47149static int
47150test_xmlXPathFalseFunction(void) {
47151    int test_ret = 0;
47152
47153#if defined(LIBXML_XPATH_ENABLED)
47154    int mem_base;
47155    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47156    int n_ctxt;
47157    int nargs; /* the number of arguments */
47158    int n_nargs;
47159
47160    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47161    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47162        mem_base = xmlMemBlocks();
47163        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47164        nargs = gen_int(n_nargs, 1);
47165
47166        xmlXPathFalseFunction(ctxt, nargs);
47167        call_tests++;
47168        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47169        des_int(n_nargs, nargs, 1);
47170        xmlResetLastError();
47171        if (mem_base != xmlMemBlocks()) {
47172            printf("Leak of %d blocks found in xmlXPathFalseFunction",
47173	           xmlMemBlocks() - mem_base);
47174	    test_ret++;
47175            printf(" %d", n_ctxt);
47176            printf(" %d", n_nargs);
47177            printf("\n");
47178        }
47179    }
47180    }
47181    function_tests++;
47182#endif
47183
47184    return(test_ret);
47185}
47186
47187
47188static int
47189test_xmlXPathFloorFunction(void) {
47190    int test_ret = 0;
47191
47192#if defined(LIBXML_XPATH_ENABLED)
47193    int mem_base;
47194    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47195    int n_ctxt;
47196    int nargs; /* the number of arguments */
47197    int n_nargs;
47198
47199    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47200    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47201        mem_base = xmlMemBlocks();
47202        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47203        nargs = gen_int(n_nargs, 1);
47204
47205        xmlXPathFloorFunction(ctxt, nargs);
47206        call_tests++;
47207        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47208        des_int(n_nargs, nargs, 1);
47209        xmlResetLastError();
47210        if (mem_base != xmlMemBlocks()) {
47211            printf("Leak of %d blocks found in xmlXPathFloorFunction",
47212	           xmlMemBlocks() - mem_base);
47213	    test_ret++;
47214            printf(" %d", n_ctxt);
47215            printf(" %d", n_nargs);
47216            printf("\n");
47217        }
47218    }
47219    }
47220    function_tests++;
47221#endif
47222
47223    return(test_ret);
47224}
47225
47226
47227static int
47228test_xmlXPathFunctionLookup(void) {
47229    int test_ret = 0;
47230
47231
47232    /* missing type support */
47233    return(test_ret);
47234}
47235
47236
47237static int
47238test_xmlXPathFunctionLookupNS(void) {
47239    int test_ret = 0;
47240
47241
47242    /* missing type support */
47243    return(test_ret);
47244}
47245
47246
47247static int
47248test_xmlXPathHasSameNodes(void) {
47249    int test_ret = 0;
47250
47251#if defined(LIBXML_XPATH_ENABLED)
47252    int mem_base;
47253    int ret_val;
47254    xmlNodeSetPtr nodes1; /* a node-set */
47255    int n_nodes1;
47256    xmlNodeSetPtr nodes2; /* a node-set */
47257    int n_nodes2;
47258
47259    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47260    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47261        mem_base = xmlMemBlocks();
47262        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47263        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47264
47265        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47266        desret_int(ret_val);
47267        call_tests++;
47268        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47269        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47270        xmlResetLastError();
47271        if (mem_base != xmlMemBlocks()) {
47272            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47273	           xmlMemBlocks() - mem_base);
47274	    test_ret++;
47275            printf(" %d", n_nodes1);
47276            printf(" %d", n_nodes2);
47277            printf("\n");
47278        }
47279    }
47280    }
47281    function_tests++;
47282#endif
47283
47284    return(test_ret);
47285}
47286
47287
47288static int
47289test_xmlXPathIdFunction(void) {
47290    int test_ret = 0;
47291
47292#if defined(LIBXML_XPATH_ENABLED)
47293    int mem_base;
47294    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47295    int n_ctxt;
47296    int nargs; /* the number of arguments */
47297    int n_nargs;
47298
47299    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47300    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47301        mem_base = xmlMemBlocks();
47302        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47303        nargs = gen_int(n_nargs, 1);
47304
47305        xmlXPathIdFunction(ctxt, nargs);
47306        call_tests++;
47307        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47308        des_int(n_nargs, nargs, 1);
47309        xmlResetLastError();
47310        if (mem_base != xmlMemBlocks()) {
47311            printf("Leak of %d blocks found in xmlXPathIdFunction",
47312	           xmlMemBlocks() - mem_base);
47313	    test_ret++;
47314            printf(" %d", n_ctxt);
47315            printf(" %d", n_nargs);
47316            printf("\n");
47317        }
47318    }
47319    }
47320    function_tests++;
47321#endif
47322
47323    return(test_ret);
47324}
47325
47326
47327static int
47328test_xmlXPathIntersection(void) {
47329    int test_ret = 0;
47330
47331#if defined(LIBXML_XPATH_ENABLED)
47332    int mem_base;
47333    xmlNodeSetPtr ret_val;
47334    xmlNodeSetPtr nodes1; /* a node-set */
47335    int n_nodes1;
47336    xmlNodeSetPtr nodes2; /* a node-set */
47337    int n_nodes2;
47338
47339    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47340    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47341        mem_base = xmlMemBlocks();
47342        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47343        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47344
47345        ret_val = xmlXPathIntersection(nodes1, nodes2);
47346        desret_xmlNodeSetPtr(ret_val);
47347        call_tests++;
47348        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47349        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47350        xmlResetLastError();
47351        if (mem_base != xmlMemBlocks()) {
47352            printf("Leak of %d blocks found in xmlXPathIntersection",
47353	           xmlMemBlocks() - mem_base);
47354	    test_ret++;
47355            printf(" %d", n_nodes1);
47356            printf(" %d", n_nodes2);
47357            printf("\n");
47358        }
47359    }
47360    }
47361    function_tests++;
47362#endif
47363
47364    return(test_ret);
47365}
47366
47367
47368static int
47369test_xmlXPathIsNodeType(void) {
47370    int test_ret = 0;
47371
47372#if defined(LIBXML_XPATH_ENABLED)
47373    int mem_base;
47374    int ret_val;
47375    xmlChar * name; /* a name string */
47376    int n_name;
47377
47378    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47379        mem_base = xmlMemBlocks();
47380        name = gen_const_xmlChar_ptr(n_name, 0);
47381
47382        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47383        desret_int(ret_val);
47384        call_tests++;
47385        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47386        xmlResetLastError();
47387        if (mem_base != xmlMemBlocks()) {
47388            printf("Leak of %d blocks found in xmlXPathIsNodeType",
47389	           xmlMemBlocks() - mem_base);
47390	    test_ret++;
47391            printf(" %d", n_name);
47392            printf("\n");
47393        }
47394    }
47395    function_tests++;
47396#endif
47397
47398    return(test_ret);
47399}
47400
47401
47402static int
47403test_xmlXPathLangFunction(void) {
47404    int test_ret = 0;
47405
47406#if defined(LIBXML_XPATH_ENABLED)
47407    int mem_base;
47408    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47409    int n_ctxt;
47410    int nargs; /* the number of arguments */
47411    int n_nargs;
47412
47413    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47414    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47415        mem_base = xmlMemBlocks();
47416        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47417        nargs = gen_int(n_nargs, 1);
47418
47419        xmlXPathLangFunction(ctxt, nargs);
47420        call_tests++;
47421        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47422        des_int(n_nargs, nargs, 1);
47423        xmlResetLastError();
47424        if (mem_base != xmlMemBlocks()) {
47425            printf("Leak of %d blocks found in xmlXPathLangFunction",
47426	           xmlMemBlocks() - mem_base);
47427	    test_ret++;
47428            printf(" %d", n_ctxt);
47429            printf(" %d", n_nargs);
47430            printf("\n");
47431        }
47432    }
47433    }
47434    function_tests++;
47435#endif
47436
47437    return(test_ret);
47438}
47439
47440
47441static int
47442test_xmlXPathLastFunction(void) {
47443    int test_ret = 0;
47444
47445#if defined(LIBXML_XPATH_ENABLED)
47446    int mem_base;
47447    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47448    int n_ctxt;
47449    int nargs; /* the number of arguments */
47450    int n_nargs;
47451
47452    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47453    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47454        mem_base = xmlMemBlocks();
47455        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47456        nargs = gen_int(n_nargs, 1);
47457
47458        xmlXPathLastFunction(ctxt, nargs);
47459        call_tests++;
47460        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47461        des_int(n_nargs, nargs, 1);
47462        xmlResetLastError();
47463        if (mem_base != xmlMemBlocks()) {
47464            printf("Leak of %d blocks found in xmlXPathLastFunction",
47465	           xmlMemBlocks() - mem_base);
47466	    test_ret++;
47467            printf(" %d", n_ctxt);
47468            printf(" %d", n_nargs);
47469            printf("\n");
47470        }
47471    }
47472    }
47473    function_tests++;
47474#endif
47475
47476    return(test_ret);
47477}
47478
47479
47480static int
47481test_xmlXPathLeading(void) {
47482    int test_ret = 0;
47483
47484#if defined(LIBXML_XPATH_ENABLED)
47485    int mem_base;
47486    xmlNodeSetPtr ret_val;
47487    xmlNodeSetPtr nodes1; /* a node-set */
47488    int n_nodes1;
47489    xmlNodeSetPtr nodes2; /* a node-set */
47490    int n_nodes2;
47491
47492    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47493    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47494        mem_base = xmlMemBlocks();
47495        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47496        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47497
47498        ret_val = xmlXPathLeading(nodes1, nodes2);
47499        desret_xmlNodeSetPtr(ret_val);
47500        call_tests++;
47501        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47502        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47503        xmlResetLastError();
47504        if (mem_base != xmlMemBlocks()) {
47505            printf("Leak of %d blocks found in xmlXPathLeading",
47506	           xmlMemBlocks() - mem_base);
47507	    test_ret++;
47508            printf(" %d", n_nodes1);
47509            printf(" %d", n_nodes2);
47510            printf("\n");
47511        }
47512    }
47513    }
47514    function_tests++;
47515#endif
47516
47517    return(test_ret);
47518}
47519
47520
47521static int
47522test_xmlXPathLeadingSorted(void) {
47523    int test_ret = 0;
47524
47525#if defined(LIBXML_XPATH_ENABLED)
47526    int mem_base;
47527    xmlNodeSetPtr ret_val;
47528    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47529    int n_nodes1;
47530    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47531    int n_nodes2;
47532
47533    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47534    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47535        mem_base = xmlMemBlocks();
47536        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47537        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47538
47539        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47540        desret_xmlNodeSetPtr(ret_val);
47541        call_tests++;
47542        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47543        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47544        xmlResetLastError();
47545        if (mem_base != xmlMemBlocks()) {
47546            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47547	           xmlMemBlocks() - mem_base);
47548	    test_ret++;
47549            printf(" %d", n_nodes1);
47550            printf(" %d", n_nodes2);
47551            printf("\n");
47552        }
47553    }
47554    }
47555    function_tests++;
47556#endif
47557
47558    return(test_ret);
47559}
47560
47561
47562static int
47563test_xmlXPathLocalNameFunction(void) {
47564    int test_ret = 0;
47565
47566#if defined(LIBXML_XPATH_ENABLED)
47567    int mem_base;
47568    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47569    int n_ctxt;
47570    int nargs; /* the number of arguments */
47571    int n_nargs;
47572
47573    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47574    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47575        mem_base = xmlMemBlocks();
47576        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47577        nargs = gen_int(n_nargs, 1);
47578
47579        xmlXPathLocalNameFunction(ctxt, nargs);
47580        call_tests++;
47581        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47582        des_int(n_nargs, nargs, 1);
47583        xmlResetLastError();
47584        if (mem_base != xmlMemBlocks()) {
47585            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47586	           xmlMemBlocks() - mem_base);
47587	    test_ret++;
47588            printf(" %d", n_ctxt);
47589            printf(" %d", n_nargs);
47590            printf("\n");
47591        }
47592    }
47593    }
47594    function_tests++;
47595#endif
47596
47597    return(test_ret);
47598}
47599
47600
47601static int
47602test_xmlXPathModValues(void) {
47603    int test_ret = 0;
47604
47605#if defined(LIBXML_XPATH_ENABLED)
47606    int mem_base;
47607    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47608    int n_ctxt;
47609
47610    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47611        mem_base = xmlMemBlocks();
47612        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47613
47614        xmlXPathModValues(ctxt);
47615        call_tests++;
47616        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47617        xmlResetLastError();
47618        if (mem_base != xmlMemBlocks()) {
47619            printf("Leak of %d blocks found in xmlXPathModValues",
47620	           xmlMemBlocks() - mem_base);
47621	    test_ret++;
47622            printf(" %d", n_ctxt);
47623            printf("\n");
47624        }
47625    }
47626    function_tests++;
47627#endif
47628
47629    return(test_ret);
47630}
47631
47632
47633static int
47634test_xmlXPathMultValues(void) {
47635    int test_ret = 0;
47636
47637#if defined(LIBXML_XPATH_ENABLED)
47638    int mem_base;
47639    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47640    int n_ctxt;
47641
47642    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47643        mem_base = xmlMemBlocks();
47644        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47645
47646        xmlXPathMultValues(ctxt);
47647        call_tests++;
47648        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47649        xmlResetLastError();
47650        if (mem_base != xmlMemBlocks()) {
47651            printf("Leak of %d blocks found in xmlXPathMultValues",
47652	           xmlMemBlocks() - mem_base);
47653	    test_ret++;
47654            printf(" %d", n_ctxt);
47655            printf("\n");
47656        }
47657    }
47658    function_tests++;
47659#endif
47660
47661    return(test_ret);
47662}
47663
47664
47665static int
47666test_xmlXPathNamespaceURIFunction(void) {
47667    int test_ret = 0;
47668
47669#if defined(LIBXML_XPATH_ENABLED)
47670    int mem_base;
47671    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47672    int n_ctxt;
47673    int nargs; /* the number of arguments */
47674    int n_nargs;
47675
47676    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47677    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47678        mem_base = xmlMemBlocks();
47679        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47680        nargs = gen_int(n_nargs, 1);
47681
47682        xmlXPathNamespaceURIFunction(ctxt, nargs);
47683        call_tests++;
47684        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47685        des_int(n_nargs, nargs, 1);
47686        xmlResetLastError();
47687        if (mem_base != xmlMemBlocks()) {
47688            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47689	           xmlMemBlocks() - mem_base);
47690	    test_ret++;
47691            printf(" %d", n_ctxt);
47692            printf(" %d", n_nargs);
47693            printf("\n");
47694        }
47695    }
47696    }
47697    function_tests++;
47698#endif
47699
47700    return(test_ret);
47701}
47702
47703
47704static int
47705test_xmlXPathNewBoolean(void) {
47706    int test_ret = 0;
47707
47708#if defined(LIBXML_XPATH_ENABLED)
47709    int mem_base;
47710    xmlXPathObjectPtr ret_val;
47711    int val; /* the boolean value */
47712    int n_val;
47713
47714    for (n_val = 0;n_val < gen_nb_int;n_val++) {
47715        mem_base = xmlMemBlocks();
47716        val = gen_int(n_val, 0);
47717
47718        ret_val = xmlXPathNewBoolean(val);
47719        desret_xmlXPathObjectPtr(ret_val);
47720        call_tests++;
47721        des_int(n_val, val, 0);
47722        xmlResetLastError();
47723        if (mem_base != xmlMemBlocks()) {
47724            printf("Leak of %d blocks found in xmlXPathNewBoolean",
47725	           xmlMemBlocks() - mem_base);
47726	    test_ret++;
47727            printf(" %d", n_val);
47728            printf("\n");
47729        }
47730    }
47731    function_tests++;
47732#endif
47733
47734    return(test_ret);
47735}
47736
47737
47738static int
47739test_xmlXPathNewCString(void) {
47740    int test_ret = 0;
47741
47742#if defined(LIBXML_XPATH_ENABLED)
47743    int mem_base;
47744    xmlXPathObjectPtr ret_val;
47745    char * val; /* the char * value */
47746    int n_val;
47747
47748    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47749        mem_base = xmlMemBlocks();
47750        val = gen_const_char_ptr(n_val, 0);
47751
47752        ret_val = xmlXPathNewCString((const char *)val);
47753        desret_xmlXPathObjectPtr(ret_val);
47754        call_tests++;
47755        des_const_char_ptr(n_val, (const char *)val, 0);
47756        xmlResetLastError();
47757        if (mem_base != xmlMemBlocks()) {
47758            printf("Leak of %d blocks found in xmlXPathNewCString",
47759	           xmlMemBlocks() - mem_base);
47760	    test_ret++;
47761            printf(" %d", n_val);
47762            printf("\n");
47763        }
47764    }
47765    function_tests++;
47766#endif
47767
47768    return(test_ret);
47769}
47770
47771
47772static int
47773test_xmlXPathNewFloat(void) {
47774    int test_ret = 0;
47775
47776#if defined(LIBXML_XPATH_ENABLED)
47777    int mem_base;
47778    xmlXPathObjectPtr ret_val;
47779    double val; /* the double value */
47780    int n_val;
47781
47782    for (n_val = 0;n_val < gen_nb_double;n_val++) {
47783        mem_base = xmlMemBlocks();
47784        val = gen_double(n_val, 0);
47785
47786        ret_val = xmlXPathNewFloat(val);
47787        desret_xmlXPathObjectPtr(ret_val);
47788        call_tests++;
47789        des_double(n_val, val, 0);
47790        xmlResetLastError();
47791        if (mem_base != xmlMemBlocks()) {
47792            printf("Leak of %d blocks found in xmlXPathNewFloat",
47793	           xmlMemBlocks() - mem_base);
47794	    test_ret++;
47795            printf(" %d", n_val);
47796            printf("\n");
47797        }
47798    }
47799    function_tests++;
47800#endif
47801
47802    return(test_ret);
47803}
47804
47805
47806static int
47807test_xmlXPathNewNodeSet(void) {
47808    int test_ret = 0;
47809
47810#if defined(LIBXML_XPATH_ENABLED)
47811    int mem_base;
47812    xmlXPathObjectPtr ret_val;
47813    xmlNodePtr val; /* the NodePtr value */
47814    int n_val;
47815
47816    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47817        mem_base = xmlMemBlocks();
47818        val = gen_xmlNodePtr(n_val, 0);
47819
47820        ret_val = xmlXPathNewNodeSet(val);
47821        desret_xmlXPathObjectPtr(ret_val);
47822        call_tests++;
47823        des_xmlNodePtr(n_val, val, 0);
47824        xmlResetLastError();
47825        if (mem_base != xmlMemBlocks()) {
47826            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47827	           xmlMemBlocks() - mem_base);
47828	    test_ret++;
47829            printf(" %d", n_val);
47830            printf("\n");
47831        }
47832    }
47833    function_tests++;
47834#endif
47835
47836    return(test_ret);
47837}
47838
47839
47840static int
47841test_xmlXPathNewNodeSetList(void) {
47842    int test_ret = 0;
47843
47844#if defined(LIBXML_XPATH_ENABLED)
47845    int mem_base;
47846    xmlXPathObjectPtr ret_val;
47847    xmlNodeSetPtr val; /* an existing NodeSet */
47848    int n_val;
47849
47850    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
47851        mem_base = xmlMemBlocks();
47852        val = gen_xmlNodeSetPtr(n_val, 0);
47853
47854        ret_val = xmlXPathNewNodeSetList(val);
47855        desret_xmlXPathObjectPtr(ret_val);
47856        call_tests++;
47857        des_xmlNodeSetPtr(n_val, val, 0);
47858        xmlResetLastError();
47859        if (mem_base != xmlMemBlocks()) {
47860            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
47861	           xmlMemBlocks() - mem_base);
47862	    test_ret++;
47863            printf(" %d", n_val);
47864            printf("\n");
47865        }
47866    }
47867    function_tests++;
47868#endif
47869
47870    return(test_ret);
47871}
47872
47873
47874static int
47875test_xmlXPathNewParserContext(void) {
47876    int test_ret = 0;
47877
47878
47879    /* missing type support */
47880    return(test_ret);
47881}
47882
47883
47884static int
47885test_xmlXPathNewString(void) {
47886    int test_ret = 0;
47887
47888#if defined(LIBXML_XPATH_ENABLED)
47889    int mem_base;
47890    xmlXPathObjectPtr ret_val;
47891    xmlChar * val; /* the xmlChar * value */
47892    int n_val;
47893
47894    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47895        mem_base = xmlMemBlocks();
47896        val = gen_const_xmlChar_ptr(n_val, 0);
47897
47898        ret_val = xmlXPathNewString((const xmlChar *)val);
47899        desret_xmlXPathObjectPtr(ret_val);
47900        call_tests++;
47901        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47902        xmlResetLastError();
47903        if (mem_base != xmlMemBlocks()) {
47904            printf("Leak of %d blocks found in xmlXPathNewString",
47905	           xmlMemBlocks() - mem_base);
47906	    test_ret++;
47907            printf(" %d", n_val);
47908            printf("\n");
47909        }
47910    }
47911    function_tests++;
47912#endif
47913
47914    return(test_ret);
47915}
47916
47917
47918static int
47919test_xmlXPathNextAncestor(void) {
47920    int test_ret = 0;
47921
47922#if defined(LIBXML_XPATH_ENABLED)
47923    int mem_base;
47924    xmlNodePtr ret_val;
47925    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47926    int n_ctxt;
47927    xmlNodePtr cur; /* the current node in the traversal */
47928    int n_cur;
47929
47930    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47931    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47932        mem_base = xmlMemBlocks();
47933        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47934        cur = gen_xmlNodePtr(n_cur, 1);
47935
47936        ret_val = xmlXPathNextAncestor(ctxt, cur);
47937        desret_xmlNodePtr(ret_val);
47938        call_tests++;
47939        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47940        des_xmlNodePtr(n_cur, cur, 1);
47941        xmlResetLastError();
47942        if (mem_base != xmlMemBlocks()) {
47943            printf("Leak of %d blocks found in xmlXPathNextAncestor",
47944	           xmlMemBlocks() - mem_base);
47945	    test_ret++;
47946            printf(" %d", n_ctxt);
47947            printf(" %d", n_cur);
47948            printf("\n");
47949        }
47950    }
47951    }
47952    function_tests++;
47953#endif
47954
47955    return(test_ret);
47956}
47957
47958
47959static int
47960test_xmlXPathNextAncestorOrSelf(void) {
47961    int test_ret = 0;
47962
47963#if defined(LIBXML_XPATH_ENABLED)
47964    int mem_base;
47965    xmlNodePtr ret_val;
47966    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47967    int n_ctxt;
47968    xmlNodePtr cur; /* the current node in the traversal */
47969    int n_cur;
47970
47971    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47972    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47973        mem_base = xmlMemBlocks();
47974        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47975        cur = gen_xmlNodePtr(n_cur, 1);
47976
47977        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
47978        desret_xmlNodePtr(ret_val);
47979        call_tests++;
47980        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47981        des_xmlNodePtr(n_cur, cur, 1);
47982        xmlResetLastError();
47983        if (mem_base != xmlMemBlocks()) {
47984            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
47985	           xmlMemBlocks() - mem_base);
47986	    test_ret++;
47987            printf(" %d", n_ctxt);
47988            printf(" %d", n_cur);
47989            printf("\n");
47990        }
47991    }
47992    }
47993    function_tests++;
47994#endif
47995
47996    return(test_ret);
47997}
47998
47999
48000static int
48001test_xmlXPathNextAttribute(void) {
48002    int test_ret = 0;
48003
48004#if defined(LIBXML_XPATH_ENABLED)
48005    int mem_base;
48006    xmlNodePtr ret_val;
48007    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48008    int n_ctxt;
48009    xmlNodePtr cur; /* the current attribute in the traversal */
48010    int n_cur;
48011
48012    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48013    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48014        mem_base = xmlMemBlocks();
48015        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48016        cur = gen_xmlNodePtr(n_cur, 1);
48017
48018        ret_val = xmlXPathNextAttribute(ctxt, cur);
48019        desret_xmlNodePtr(ret_val);
48020        call_tests++;
48021        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48022        des_xmlNodePtr(n_cur, cur, 1);
48023        xmlResetLastError();
48024        if (mem_base != xmlMemBlocks()) {
48025            printf("Leak of %d blocks found in xmlXPathNextAttribute",
48026	           xmlMemBlocks() - mem_base);
48027	    test_ret++;
48028            printf(" %d", n_ctxt);
48029            printf(" %d", n_cur);
48030            printf("\n");
48031        }
48032    }
48033    }
48034    function_tests++;
48035#endif
48036
48037    return(test_ret);
48038}
48039
48040
48041static int
48042test_xmlXPathNextChild(void) {
48043    int test_ret = 0;
48044
48045#if defined(LIBXML_XPATH_ENABLED)
48046    int mem_base;
48047    xmlNodePtr ret_val;
48048    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48049    int n_ctxt;
48050    xmlNodePtr cur; /* the current node in the traversal */
48051    int n_cur;
48052
48053    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48054    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48055        mem_base = xmlMemBlocks();
48056        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48057        cur = gen_xmlNodePtr(n_cur, 1);
48058
48059        ret_val = xmlXPathNextChild(ctxt, cur);
48060        desret_xmlNodePtr(ret_val);
48061        call_tests++;
48062        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48063        des_xmlNodePtr(n_cur, cur, 1);
48064        xmlResetLastError();
48065        if (mem_base != xmlMemBlocks()) {
48066            printf("Leak of %d blocks found in xmlXPathNextChild",
48067	           xmlMemBlocks() - mem_base);
48068	    test_ret++;
48069            printf(" %d", n_ctxt);
48070            printf(" %d", n_cur);
48071            printf("\n");
48072        }
48073    }
48074    }
48075    function_tests++;
48076#endif
48077
48078    return(test_ret);
48079}
48080
48081
48082static int
48083test_xmlXPathNextDescendant(void) {
48084    int test_ret = 0;
48085
48086#if defined(LIBXML_XPATH_ENABLED)
48087    int mem_base;
48088    xmlNodePtr ret_val;
48089    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48090    int n_ctxt;
48091    xmlNodePtr cur; /* the current node in the traversal */
48092    int n_cur;
48093
48094    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48095    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48096        mem_base = xmlMemBlocks();
48097        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48098        cur = gen_xmlNodePtr(n_cur, 1);
48099
48100        ret_val = xmlXPathNextDescendant(ctxt, cur);
48101        desret_xmlNodePtr(ret_val);
48102        call_tests++;
48103        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48104        des_xmlNodePtr(n_cur, cur, 1);
48105        xmlResetLastError();
48106        if (mem_base != xmlMemBlocks()) {
48107            printf("Leak of %d blocks found in xmlXPathNextDescendant",
48108	           xmlMemBlocks() - mem_base);
48109	    test_ret++;
48110            printf(" %d", n_ctxt);
48111            printf(" %d", n_cur);
48112            printf("\n");
48113        }
48114    }
48115    }
48116    function_tests++;
48117#endif
48118
48119    return(test_ret);
48120}
48121
48122
48123static int
48124test_xmlXPathNextDescendantOrSelf(void) {
48125    int test_ret = 0;
48126
48127#if defined(LIBXML_XPATH_ENABLED)
48128    int mem_base;
48129    xmlNodePtr ret_val;
48130    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48131    int n_ctxt;
48132    xmlNodePtr cur; /* the current node in the traversal */
48133    int n_cur;
48134
48135    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48136    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48137        mem_base = xmlMemBlocks();
48138        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48139        cur = gen_xmlNodePtr(n_cur, 1);
48140
48141        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48142        desret_xmlNodePtr(ret_val);
48143        call_tests++;
48144        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48145        des_xmlNodePtr(n_cur, cur, 1);
48146        xmlResetLastError();
48147        if (mem_base != xmlMemBlocks()) {
48148            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48149	           xmlMemBlocks() - mem_base);
48150	    test_ret++;
48151            printf(" %d", n_ctxt);
48152            printf(" %d", n_cur);
48153            printf("\n");
48154        }
48155    }
48156    }
48157    function_tests++;
48158#endif
48159
48160    return(test_ret);
48161}
48162
48163
48164static int
48165test_xmlXPathNextFollowing(void) {
48166    int test_ret = 0;
48167
48168#if defined(LIBXML_XPATH_ENABLED)
48169    int mem_base;
48170    xmlNodePtr ret_val;
48171    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48172    int n_ctxt;
48173    xmlNodePtr cur; /* the current node in the traversal */
48174    int n_cur;
48175
48176    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48177    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48178        mem_base = xmlMemBlocks();
48179        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48180        cur = gen_xmlNodePtr(n_cur, 1);
48181
48182        ret_val = xmlXPathNextFollowing(ctxt, cur);
48183        desret_xmlNodePtr(ret_val);
48184        call_tests++;
48185        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48186        des_xmlNodePtr(n_cur, cur, 1);
48187        xmlResetLastError();
48188        if (mem_base != xmlMemBlocks()) {
48189            printf("Leak of %d blocks found in xmlXPathNextFollowing",
48190	           xmlMemBlocks() - mem_base);
48191	    test_ret++;
48192            printf(" %d", n_ctxt);
48193            printf(" %d", n_cur);
48194            printf("\n");
48195        }
48196    }
48197    }
48198    function_tests++;
48199#endif
48200
48201    return(test_ret);
48202}
48203
48204
48205static int
48206test_xmlXPathNextFollowingSibling(void) {
48207    int test_ret = 0;
48208
48209#if defined(LIBXML_XPATH_ENABLED)
48210    int mem_base;
48211    xmlNodePtr ret_val;
48212    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48213    int n_ctxt;
48214    xmlNodePtr cur; /* the current node in the traversal */
48215    int n_cur;
48216
48217    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48218    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48219        mem_base = xmlMemBlocks();
48220        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48221        cur = gen_xmlNodePtr(n_cur, 1);
48222
48223        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48224        desret_xmlNodePtr(ret_val);
48225        call_tests++;
48226        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48227        des_xmlNodePtr(n_cur, cur, 1);
48228        xmlResetLastError();
48229        if (mem_base != xmlMemBlocks()) {
48230            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48231	           xmlMemBlocks() - mem_base);
48232	    test_ret++;
48233            printf(" %d", n_ctxt);
48234            printf(" %d", n_cur);
48235            printf("\n");
48236        }
48237    }
48238    }
48239    function_tests++;
48240#endif
48241
48242    return(test_ret);
48243}
48244
48245
48246static int
48247test_xmlXPathNextNamespace(void) {
48248    int test_ret = 0;
48249
48250#if defined(LIBXML_XPATH_ENABLED)
48251    int mem_base;
48252    xmlNodePtr ret_val;
48253    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48254    int n_ctxt;
48255    xmlNodePtr cur; /* the current attribute in the traversal */
48256    int n_cur;
48257
48258    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48259    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48260        mem_base = xmlMemBlocks();
48261        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48262        cur = gen_xmlNodePtr(n_cur, 1);
48263
48264        ret_val = xmlXPathNextNamespace(ctxt, cur);
48265        desret_xmlNodePtr(ret_val);
48266        call_tests++;
48267        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48268        des_xmlNodePtr(n_cur, cur, 1);
48269        xmlResetLastError();
48270        if (mem_base != xmlMemBlocks()) {
48271            printf("Leak of %d blocks found in xmlXPathNextNamespace",
48272	           xmlMemBlocks() - mem_base);
48273	    test_ret++;
48274            printf(" %d", n_ctxt);
48275            printf(" %d", n_cur);
48276            printf("\n");
48277        }
48278    }
48279    }
48280    function_tests++;
48281#endif
48282
48283    return(test_ret);
48284}
48285
48286
48287static int
48288test_xmlXPathNextParent(void) {
48289    int test_ret = 0;
48290
48291#if defined(LIBXML_XPATH_ENABLED)
48292    int mem_base;
48293    xmlNodePtr ret_val;
48294    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48295    int n_ctxt;
48296    xmlNodePtr cur; /* the current node in the traversal */
48297    int n_cur;
48298
48299    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48300    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48301        mem_base = xmlMemBlocks();
48302        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48303        cur = gen_xmlNodePtr(n_cur, 1);
48304
48305        ret_val = xmlXPathNextParent(ctxt, cur);
48306        desret_xmlNodePtr(ret_val);
48307        call_tests++;
48308        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48309        des_xmlNodePtr(n_cur, cur, 1);
48310        xmlResetLastError();
48311        if (mem_base != xmlMemBlocks()) {
48312            printf("Leak of %d blocks found in xmlXPathNextParent",
48313	           xmlMemBlocks() - mem_base);
48314	    test_ret++;
48315            printf(" %d", n_ctxt);
48316            printf(" %d", n_cur);
48317            printf("\n");
48318        }
48319    }
48320    }
48321    function_tests++;
48322#endif
48323
48324    return(test_ret);
48325}
48326
48327
48328static int
48329test_xmlXPathNextPreceding(void) {
48330    int test_ret = 0;
48331
48332#if defined(LIBXML_XPATH_ENABLED)
48333    int mem_base;
48334    xmlNodePtr ret_val;
48335    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48336    int n_ctxt;
48337    xmlNodePtr cur; /* the current node in the traversal */
48338    int n_cur;
48339
48340    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48341    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48342        mem_base = xmlMemBlocks();
48343        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48344        cur = gen_xmlNodePtr(n_cur, 1);
48345
48346        ret_val = xmlXPathNextPreceding(ctxt, cur);
48347        desret_xmlNodePtr(ret_val);
48348        call_tests++;
48349        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48350        des_xmlNodePtr(n_cur, cur, 1);
48351        xmlResetLastError();
48352        if (mem_base != xmlMemBlocks()) {
48353            printf("Leak of %d blocks found in xmlXPathNextPreceding",
48354	           xmlMemBlocks() - mem_base);
48355	    test_ret++;
48356            printf(" %d", n_ctxt);
48357            printf(" %d", n_cur);
48358            printf("\n");
48359        }
48360    }
48361    }
48362    function_tests++;
48363#endif
48364
48365    return(test_ret);
48366}
48367
48368
48369static int
48370test_xmlXPathNextPrecedingSibling(void) {
48371    int test_ret = 0;
48372
48373#if defined(LIBXML_XPATH_ENABLED)
48374    int mem_base;
48375    xmlNodePtr ret_val;
48376    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48377    int n_ctxt;
48378    xmlNodePtr cur; /* the current node in the traversal */
48379    int n_cur;
48380
48381    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48382    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48383        mem_base = xmlMemBlocks();
48384        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48385        cur = gen_xmlNodePtr(n_cur, 1);
48386
48387        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48388        desret_xmlNodePtr(ret_val);
48389        call_tests++;
48390        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48391        des_xmlNodePtr(n_cur, cur, 1);
48392        xmlResetLastError();
48393        if (mem_base != xmlMemBlocks()) {
48394            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48395	           xmlMemBlocks() - mem_base);
48396	    test_ret++;
48397            printf(" %d", n_ctxt);
48398            printf(" %d", n_cur);
48399            printf("\n");
48400        }
48401    }
48402    }
48403    function_tests++;
48404#endif
48405
48406    return(test_ret);
48407}
48408
48409
48410static int
48411test_xmlXPathNextSelf(void) {
48412    int test_ret = 0;
48413
48414#if defined(LIBXML_XPATH_ENABLED)
48415    int mem_base;
48416    xmlNodePtr ret_val;
48417    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48418    int n_ctxt;
48419    xmlNodePtr cur; /* the current node in the traversal */
48420    int n_cur;
48421
48422    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48423    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48424        mem_base = xmlMemBlocks();
48425        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48426        cur = gen_xmlNodePtr(n_cur, 1);
48427
48428        ret_val = xmlXPathNextSelf(ctxt, cur);
48429        desret_xmlNodePtr(ret_val);
48430        call_tests++;
48431        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48432        des_xmlNodePtr(n_cur, cur, 1);
48433        xmlResetLastError();
48434        if (mem_base != xmlMemBlocks()) {
48435            printf("Leak of %d blocks found in xmlXPathNextSelf",
48436	           xmlMemBlocks() - mem_base);
48437	    test_ret++;
48438            printf(" %d", n_ctxt);
48439            printf(" %d", n_cur);
48440            printf("\n");
48441        }
48442    }
48443    }
48444    function_tests++;
48445#endif
48446
48447    return(test_ret);
48448}
48449
48450
48451static int
48452test_xmlXPathNodeLeading(void) {
48453    int test_ret = 0;
48454
48455#if defined(LIBXML_XPATH_ENABLED)
48456    int mem_base;
48457    xmlNodeSetPtr ret_val;
48458    xmlNodeSetPtr nodes; /* a node-set */
48459    int n_nodes;
48460    xmlNodePtr node; /* a node */
48461    int n_node;
48462
48463    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48464    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48465        mem_base = xmlMemBlocks();
48466        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48467        node = gen_xmlNodePtr(n_node, 1);
48468
48469        ret_val = xmlXPathNodeLeading(nodes, node);
48470        desret_xmlNodeSetPtr(ret_val);
48471        call_tests++;
48472        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48473        des_xmlNodePtr(n_node, node, 1);
48474        xmlResetLastError();
48475        if (mem_base != xmlMemBlocks()) {
48476            printf("Leak of %d blocks found in xmlXPathNodeLeading",
48477	           xmlMemBlocks() - mem_base);
48478	    test_ret++;
48479            printf(" %d", n_nodes);
48480            printf(" %d", n_node);
48481            printf("\n");
48482        }
48483    }
48484    }
48485    function_tests++;
48486#endif
48487
48488    return(test_ret);
48489}
48490
48491
48492static int
48493test_xmlXPathNodeLeadingSorted(void) {
48494    int test_ret = 0;
48495
48496#if defined(LIBXML_XPATH_ENABLED)
48497    int mem_base;
48498    xmlNodeSetPtr ret_val;
48499    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48500    int n_nodes;
48501    xmlNodePtr node; /* a node */
48502    int n_node;
48503
48504    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48505    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48506        mem_base = xmlMemBlocks();
48507        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48508        node = gen_xmlNodePtr(n_node, 1);
48509
48510        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48511        desret_xmlNodeSetPtr(ret_val);
48512        call_tests++;
48513        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48514        des_xmlNodePtr(n_node, node, 1);
48515        xmlResetLastError();
48516        if (mem_base != xmlMemBlocks()) {
48517            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48518	           xmlMemBlocks() - mem_base);
48519	    test_ret++;
48520            printf(" %d", n_nodes);
48521            printf(" %d", n_node);
48522            printf("\n");
48523        }
48524    }
48525    }
48526    function_tests++;
48527#endif
48528
48529    return(test_ret);
48530}
48531
48532
48533static int
48534test_xmlXPathNodeSetAdd(void) {
48535    int test_ret = 0;
48536
48537#if defined(LIBXML_XPATH_ENABLED)
48538    int mem_base;
48539    xmlNodeSetPtr cur; /* the initial node set */
48540    int n_cur;
48541    xmlNodePtr val; /* a new xmlNodePtr */
48542    int n_val;
48543
48544    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48545    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48546        mem_base = xmlMemBlocks();
48547        cur = gen_xmlNodeSetPtr(n_cur, 0);
48548        val = gen_xmlNodePtr(n_val, 1);
48549
48550        xmlXPathNodeSetAdd(cur, val);
48551        call_tests++;
48552        des_xmlNodeSetPtr(n_cur, cur, 0);
48553        des_xmlNodePtr(n_val, val, 1);
48554        xmlResetLastError();
48555        if (mem_base != xmlMemBlocks()) {
48556            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48557	           xmlMemBlocks() - mem_base);
48558	    test_ret++;
48559            printf(" %d", n_cur);
48560            printf(" %d", n_val);
48561            printf("\n");
48562        }
48563    }
48564    }
48565    function_tests++;
48566#endif
48567
48568    return(test_ret);
48569}
48570
48571
48572static int
48573test_xmlXPathNodeSetAddNs(void) {
48574    int test_ret = 0;
48575
48576#if defined(LIBXML_XPATH_ENABLED)
48577    int mem_base;
48578    xmlNodeSetPtr cur; /* the initial node set */
48579    int n_cur;
48580    xmlNodePtr node; /* the hosting node */
48581    int n_node;
48582    xmlNsPtr ns; /* a the namespace node */
48583    int n_ns;
48584
48585    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48586    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48587    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48588        mem_base = xmlMemBlocks();
48589        cur = gen_xmlNodeSetPtr(n_cur, 0);
48590        node = gen_xmlNodePtr(n_node, 1);
48591        ns = gen_xmlNsPtr(n_ns, 2);
48592
48593        xmlXPathNodeSetAddNs(cur, node, ns);
48594        call_tests++;
48595        des_xmlNodeSetPtr(n_cur, cur, 0);
48596        des_xmlNodePtr(n_node, node, 1);
48597        des_xmlNsPtr(n_ns, ns, 2);
48598        xmlResetLastError();
48599        if (mem_base != xmlMemBlocks()) {
48600            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48601	           xmlMemBlocks() - mem_base);
48602	    test_ret++;
48603            printf(" %d", n_cur);
48604            printf(" %d", n_node);
48605            printf(" %d", n_ns);
48606            printf("\n");
48607        }
48608    }
48609    }
48610    }
48611    function_tests++;
48612#endif
48613
48614    return(test_ret);
48615}
48616
48617
48618static int
48619test_xmlXPathNodeSetAddUnique(void) {
48620    int test_ret = 0;
48621
48622#if defined(LIBXML_XPATH_ENABLED)
48623    int mem_base;
48624    xmlNodeSetPtr cur; /* the initial node set */
48625    int n_cur;
48626    xmlNodePtr val; /* a new xmlNodePtr */
48627    int n_val;
48628
48629    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48630    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48631        mem_base = xmlMemBlocks();
48632        cur = gen_xmlNodeSetPtr(n_cur, 0);
48633        val = gen_xmlNodePtr(n_val, 1);
48634
48635        xmlXPathNodeSetAddUnique(cur, val);
48636        call_tests++;
48637        des_xmlNodeSetPtr(n_cur, cur, 0);
48638        des_xmlNodePtr(n_val, val, 1);
48639        xmlResetLastError();
48640        if (mem_base != xmlMemBlocks()) {
48641            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48642	           xmlMemBlocks() - mem_base);
48643	    test_ret++;
48644            printf(" %d", n_cur);
48645            printf(" %d", n_val);
48646            printf("\n");
48647        }
48648    }
48649    }
48650    function_tests++;
48651#endif
48652
48653    return(test_ret);
48654}
48655
48656
48657static int
48658test_xmlXPathNodeSetContains(void) {
48659    int test_ret = 0;
48660
48661#if defined(LIBXML_XPATH_ENABLED)
48662    int mem_base;
48663    int ret_val;
48664    xmlNodeSetPtr cur; /* the node-set */
48665    int n_cur;
48666    xmlNodePtr val; /* the node */
48667    int n_val;
48668
48669    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48670    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48671        mem_base = xmlMemBlocks();
48672        cur = gen_xmlNodeSetPtr(n_cur, 0);
48673        val = gen_xmlNodePtr(n_val, 1);
48674
48675        ret_val = xmlXPathNodeSetContains(cur, val);
48676        desret_int(ret_val);
48677        call_tests++;
48678        des_xmlNodeSetPtr(n_cur, cur, 0);
48679        des_xmlNodePtr(n_val, val, 1);
48680        xmlResetLastError();
48681        if (mem_base != xmlMemBlocks()) {
48682            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48683	           xmlMemBlocks() - mem_base);
48684	    test_ret++;
48685            printf(" %d", n_cur);
48686            printf(" %d", n_val);
48687            printf("\n");
48688        }
48689    }
48690    }
48691    function_tests++;
48692#endif
48693
48694    return(test_ret);
48695}
48696
48697
48698static int
48699test_xmlXPathNodeSetDel(void) {
48700    int test_ret = 0;
48701
48702#if defined(LIBXML_XPATH_ENABLED)
48703    int mem_base;
48704    xmlNodeSetPtr cur; /* the initial node set */
48705    int n_cur;
48706    xmlNodePtr val; /* an xmlNodePtr */
48707    int n_val;
48708
48709    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48710    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48711        mem_base = xmlMemBlocks();
48712        cur = gen_xmlNodeSetPtr(n_cur, 0);
48713        val = gen_xmlNodePtr(n_val, 1);
48714
48715        xmlXPathNodeSetDel(cur, val);
48716        call_tests++;
48717        des_xmlNodeSetPtr(n_cur, cur, 0);
48718        des_xmlNodePtr(n_val, val, 1);
48719        xmlResetLastError();
48720        if (mem_base != xmlMemBlocks()) {
48721            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48722	           xmlMemBlocks() - mem_base);
48723	    test_ret++;
48724            printf(" %d", n_cur);
48725            printf(" %d", n_val);
48726            printf("\n");
48727        }
48728    }
48729    }
48730    function_tests++;
48731#endif
48732
48733    return(test_ret);
48734}
48735
48736
48737static int
48738test_xmlXPathNodeSetMerge(void) {
48739    int test_ret = 0;
48740
48741#if defined(LIBXML_XPATH_ENABLED)
48742    int mem_base;
48743    xmlNodeSetPtr ret_val;
48744    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48745    int n_val1;
48746    xmlNodeSetPtr val2; /* the second NodeSet */
48747    int n_val2;
48748
48749    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48750    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48751        mem_base = xmlMemBlocks();
48752        val1 = gen_xmlNodeSetPtr(n_val1, 0);
48753        val2 = gen_xmlNodeSetPtr(n_val2, 1);
48754
48755        ret_val = xmlXPathNodeSetMerge(val1, val2);
48756        desret_xmlNodeSetPtr(ret_val);
48757        call_tests++;
48758        des_xmlNodeSetPtr(n_val1, val1, 0);
48759        des_xmlNodeSetPtr(n_val2, val2, 1);
48760        xmlResetLastError();
48761        if (mem_base != xmlMemBlocks()) {
48762            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48763	           xmlMemBlocks() - mem_base);
48764	    test_ret++;
48765            printf(" %d", n_val1);
48766            printf(" %d", n_val2);
48767            printf("\n");
48768        }
48769    }
48770    }
48771    function_tests++;
48772#endif
48773
48774    return(test_ret);
48775}
48776
48777
48778static int
48779test_xmlXPathNodeSetRemove(void) {
48780    int test_ret = 0;
48781
48782#if defined(LIBXML_XPATH_ENABLED)
48783    int mem_base;
48784    xmlNodeSetPtr cur; /* the initial node set */
48785    int n_cur;
48786    int val; /* the index to remove */
48787    int n_val;
48788
48789    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48790    for (n_val = 0;n_val < gen_nb_int;n_val++) {
48791        mem_base = xmlMemBlocks();
48792        cur = gen_xmlNodeSetPtr(n_cur, 0);
48793        val = gen_int(n_val, 1);
48794
48795        xmlXPathNodeSetRemove(cur, val);
48796        call_tests++;
48797        des_xmlNodeSetPtr(n_cur, cur, 0);
48798        des_int(n_val, val, 1);
48799        xmlResetLastError();
48800        if (mem_base != xmlMemBlocks()) {
48801            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48802	           xmlMemBlocks() - mem_base);
48803	    test_ret++;
48804            printf(" %d", n_cur);
48805            printf(" %d", n_val);
48806            printf("\n");
48807        }
48808    }
48809    }
48810    function_tests++;
48811#endif
48812
48813    return(test_ret);
48814}
48815
48816
48817static int
48818test_xmlXPathNodeSetSort(void) {
48819    int test_ret = 0;
48820
48821#if defined(LIBXML_XPATH_ENABLED)
48822    int mem_base;
48823    xmlNodeSetPtr set; /* the node set */
48824    int n_set;
48825
48826    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48827        mem_base = xmlMemBlocks();
48828        set = gen_xmlNodeSetPtr(n_set, 0);
48829
48830        xmlXPathNodeSetSort(set);
48831        call_tests++;
48832        des_xmlNodeSetPtr(n_set, set, 0);
48833        xmlResetLastError();
48834        if (mem_base != xmlMemBlocks()) {
48835            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
48836	           xmlMemBlocks() - mem_base);
48837	    test_ret++;
48838            printf(" %d", n_set);
48839            printf("\n");
48840        }
48841    }
48842    function_tests++;
48843#endif
48844
48845    return(test_ret);
48846}
48847
48848
48849static int
48850test_xmlXPathNodeTrailing(void) {
48851    int test_ret = 0;
48852
48853#if defined(LIBXML_XPATH_ENABLED)
48854    int mem_base;
48855    xmlNodeSetPtr ret_val;
48856    xmlNodeSetPtr nodes; /* a node-set */
48857    int n_nodes;
48858    xmlNodePtr node; /* a node */
48859    int n_node;
48860
48861    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48862    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48863        mem_base = xmlMemBlocks();
48864        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48865        node = gen_xmlNodePtr(n_node, 1);
48866
48867        ret_val = xmlXPathNodeTrailing(nodes, node);
48868        desret_xmlNodeSetPtr(ret_val);
48869        call_tests++;
48870        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48871        des_xmlNodePtr(n_node, node, 1);
48872        xmlResetLastError();
48873        if (mem_base != xmlMemBlocks()) {
48874            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
48875	           xmlMemBlocks() - mem_base);
48876	    test_ret++;
48877            printf(" %d", n_nodes);
48878            printf(" %d", n_node);
48879            printf("\n");
48880        }
48881    }
48882    }
48883    function_tests++;
48884#endif
48885
48886    return(test_ret);
48887}
48888
48889
48890static int
48891test_xmlXPathNodeTrailingSorted(void) {
48892    int test_ret = 0;
48893
48894#if defined(LIBXML_XPATH_ENABLED)
48895    int mem_base;
48896    xmlNodeSetPtr ret_val;
48897    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48898    int n_nodes;
48899    xmlNodePtr node; /* a node */
48900    int n_node;
48901
48902    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48903    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48904        mem_base = xmlMemBlocks();
48905        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48906        node = gen_xmlNodePtr(n_node, 1);
48907
48908        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
48909        desret_xmlNodeSetPtr(ret_val);
48910        call_tests++;
48911        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48912        des_xmlNodePtr(n_node, node, 1);
48913        xmlResetLastError();
48914        if (mem_base != xmlMemBlocks()) {
48915            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
48916	           xmlMemBlocks() - mem_base);
48917	    test_ret++;
48918            printf(" %d", n_nodes);
48919            printf(" %d", n_node);
48920            printf("\n");
48921        }
48922    }
48923    }
48924    function_tests++;
48925#endif
48926
48927    return(test_ret);
48928}
48929
48930
48931static int
48932test_xmlXPathNormalizeFunction(void) {
48933    int test_ret = 0;
48934
48935#if defined(LIBXML_XPATH_ENABLED)
48936    int mem_base;
48937    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48938    int n_ctxt;
48939    int nargs; /* the number of arguments */
48940    int n_nargs;
48941
48942    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48943    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48944        mem_base = xmlMemBlocks();
48945        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48946        nargs = gen_int(n_nargs, 1);
48947
48948        xmlXPathNormalizeFunction(ctxt, nargs);
48949        call_tests++;
48950        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48951        des_int(n_nargs, nargs, 1);
48952        xmlResetLastError();
48953        if (mem_base != xmlMemBlocks()) {
48954            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
48955	           xmlMemBlocks() - mem_base);
48956	    test_ret++;
48957            printf(" %d", n_ctxt);
48958            printf(" %d", n_nargs);
48959            printf("\n");
48960        }
48961    }
48962    }
48963    function_tests++;
48964#endif
48965
48966    return(test_ret);
48967}
48968
48969
48970static int
48971test_xmlXPathNotEqualValues(void) {
48972    int test_ret = 0;
48973
48974#if defined(LIBXML_XPATH_ENABLED)
48975    int mem_base;
48976    int ret_val;
48977    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48978    int n_ctxt;
48979
48980    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48981        mem_base = xmlMemBlocks();
48982        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48983
48984        ret_val = xmlXPathNotEqualValues(ctxt);
48985        desret_int(ret_val);
48986        call_tests++;
48987        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48988        xmlResetLastError();
48989        if (mem_base != xmlMemBlocks()) {
48990            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
48991	           xmlMemBlocks() - mem_base);
48992	    test_ret++;
48993            printf(" %d", n_ctxt);
48994            printf("\n");
48995        }
48996    }
48997    function_tests++;
48998#endif
48999
49000    return(test_ret);
49001}
49002
49003
49004static int
49005test_xmlXPathNotFunction(void) {
49006    int test_ret = 0;
49007
49008#if defined(LIBXML_XPATH_ENABLED)
49009    int mem_base;
49010    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49011    int n_ctxt;
49012    int nargs; /* the number of arguments */
49013    int n_nargs;
49014
49015    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49016    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49017        mem_base = xmlMemBlocks();
49018        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49019        nargs = gen_int(n_nargs, 1);
49020
49021        xmlXPathNotFunction(ctxt, nargs);
49022        call_tests++;
49023        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49024        des_int(n_nargs, nargs, 1);
49025        xmlResetLastError();
49026        if (mem_base != xmlMemBlocks()) {
49027            printf("Leak of %d blocks found in xmlXPathNotFunction",
49028	           xmlMemBlocks() - mem_base);
49029	    test_ret++;
49030            printf(" %d", n_ctxt);
49031            printf(" %d", n_nargs);
49032            printf("\n");
49033        }
49034    }
49035    }
49036    function_tests++;
49037#endif
49038
49039    return(test_ret);
49040}
49041
49042
49043static int
49044test_xmlXPathNsLookup(void) {
49045    int test_ret = 0;
49046
49047#if defined(LIBXML_XPATH_ENABLED)
49048    int mem_base;
49049    const xmlChar * ret_val;
49050    xmlXPathContextPtr ctxt; /* the XPath context */
49051    int n_ctxt;
49052    xmlChar * prefix; /* the namespace prefix value */
49053    int n_prefix;
49054
49055    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49056    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49057        mem_base = xmlMemBlocks();
49058        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49059        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49060
49061        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49062        desret_const_xmlChar_ptr(ret_val);
49063        call_tests++;
49064        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49065        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49066        xmlResetLastError();
49067        if (mem_base != xmlMemBlocks()) {
49068            printf("Leak of %d blocks found in xmlXPathNsLookup",
49069	           xmlMemBlocks() - mem_base);
49070	    test_ret++;
49071            printf(" %d", n_ctxt);
49072            printf(" %d", n_prefix);
49073            printf("\n");
49074        }
49075    }
49076    }
49077    function_tests++;
49078#endif
49079
49080    return(test_ret);
49081}
49082
49083
49084static int
49085test_xmlXPathNumberFunction(void) {
49086    int test_ret = 0;
49087
49088#if defined(LIBXML_XPATH_ENABLED)
49089    int mem_base;
49090    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49091    int n_ctxt;
49092    int nargs; /* the number of arguments */
49093    int n_nargs;
49094
49095    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49096    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49097        mem_base = xmlMemBlocks();
49098        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49099        nargs = gen_int(n_nargs, 1);
49100
49101        xmlXPathNumberFunction(ctxt, nargs);
49102        call_tests++;
49103        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49104        des_int(n_nargs, nargs, 1);
49105        xmlResetLastError();
49106        if (mem_base != xmlMemBlocks()) {
49107            printf("Leak of %d blocks found in xmlXPathNumberFunction",
49108	           xmlMemBlocks() - mem_base);
49109	    test_ret++;
49110            printf(" %d", n_ctxt);
49111            printf(" %d", n_nargs);
49112            printf("\n");
49113        }
49114    }
49115    }
49116    function_tests++;
49117#endif
49118
49119    return(test_ret);
49120}
49121
49122
49123static int
49124test_xmlXPathParseNCName(void) {
49125    int test_ret = 0;
49126
49127#if defined(LIBXML_XPATH_ENABLED)
49128    int mem_base;
49129    xmlChar * ret_val;
49130    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49131    int n_ctxt;
49132
49133    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49134        mem_base = xmlMemBlocks();
49135        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49136
49137        ret_val = xmlXPathParseNCName(ctxt);
49138        desret_xmlChar_ptr(ret_val);
49139        call_tests++;
49140        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49141        xmlResetLastError();
49142        if (mem_base != xmlMemBlocks()) {
49143            printf("Leak of %d blocks found in xmlXPathParseNCName",
49144	           xmlMemBlocks() - mem_base);
49145	    test_ret++;
49146            printf(" %d", n_ctxt);
49147            printf("\n");
49148        }
49149    }
49150    function_tests++;
49151#endif
49152
49153    return(test_ret);
49154}
49155
49156
49157static int
49158test_xmlXPathParseName(void) {
49159    int test_ret = 0;
49160
49161#if defined(LIBXML_XPATH_ENABLED)
49162    int mem_base;
49163    xmlChar * ret_val;
49164    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49165    int n_ctxt;
49166
49167    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49168        mem_base = xmlMemBlocks();
49169        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49170
49171        ret_val = xmlXPathParseName(ctxt);
49172        desret_xmlChar_ptr(ret_val);
49173        call_tests++;
49174        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49175        xmlResetLastError();
49176        if (mem_base != xmlMemBlocks()) {
49177            printf("Leak of %d blocks found in xmlXPathParseName",
49178	           xmlMemBlocks() - mem_base);
49179	    test_ret++;
49180            printf(" %d", n_ctxt);
49181            printf("\n");
49182        }
49183    }
49184    function_tests++;
49185#endif
49186
49187    return(test_ret);
49188}
49189
49190
49191static int
49192test_xmlXPathPopBoolean(void) {
49193    int test_ret = 0;
49194
49195#if defined(LIBXML_XPATH_ENABLED)
49196    int mem_base;
49197    int ret_val;
49198    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49199    int n_ctxt;
49200
49201    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49202        mem_base = xmlMemBlocks();
49203        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49204
49205        ret_val = xmlXPathPopBoolean(ctxt);
49206        desret_int(ret_val);
49207        call_tests++;
49208        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49209        xmlResetLastError();
49210        if (mem_base != xmlMemBlocks()) {
49211            printf("Leak of %d blocks found in xmlXPathPopBoolean",
49212	           xmlMemBlocks() - mem_base);
49213	    test_ret++;
49214            printf(" %d", n_ctxt);
49215            printf("\n");
49216        }
49217    }
49218    function_tests++;
49219#endif
49220
49221    return(test_ret);
49222}
49223
49224
49225static int
49226test_xmlXPathPopExternal(void) {
49227    int test_ret = 0;
49228
49229#if defined(LIBXML_XPATH_ENABLED)
49230    int mem_base;
49231    void * ret_val;
49232    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49233    int n_ctxt;
49234
49235    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49236        mem_base = xmlMemBlocks();
49237        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49238
49239        ret_val = xmlXPathPopExternal(ctxt);
49240        desret_void_ptr(ret_val);
49241        call_tests++;
49242        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49243        xmlResetLastError();
49244        if (mem_base != xmlMemBlocks()) {
49245            printf("Leak of %d blocks found in xmlXPathPopExternal",
49246	           xmlMemBlocks() - mem_base);
49247	    test_ret++;
49248            printf(" %d", n_ctxt);
49249            printf("\n");
49250        }
49251    }
49252    function_tests++;
49253#endif
49254
49255    return(test_ret);
49256}
49257
49258
49259static int
49260test_xmlXPathPopNodeSet(void) {
49261    int test_ret = 0;
49262
49263#if defined(LIBXML_XPATH_ENABLED)
49264    int mem_base;
49265    xmlNodeSetPtr ret_val;
49266    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49267    int n_ctxt;
49268
49269    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49270        mem_base = xmlMemBlocks();
49271        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49272
49273        ret_val = xmlXPathPopNodeSet(ctxt);
49274        desret_xmlNodeSetPtr(ret_val);
49275        call_tests++;
49276        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49277        xmlResetLastError();
49278        if (mem_base != xmlMemBlocks()) {
49279            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49280	           xmlMemBlocks() - mem_base);
49281	    test_ret++;
49282            printf(" %d", n_ctxt);
49283            printf("\n");
49284        }
49285    }
49286    function_tests++;
49287#endif
49288
49289    return(test_ret);
49290}
49291
49292
49293static int
49294test_xmlXPathPopNumber(void) {
49295    int test_ret = 0;
49296
49297#if defined(LIBXML_XPATH_ENABLED)
49298    int mem_base;
49299    double ret_val;
49300    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49301    int n_ctxt;
49302
49303    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49304        mem_base = xmlMemBlocks();
49305        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49306
49307        ret_val = xmlXPathPopNumber(ctxt);
49308        desret_double(ret_val);
49309        call_tests++;
49310        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49311        xmlResetLastError();
49312        if (mem_base != xmlMemBlocks()) {
49313            printf("Leak of %d blocks found in xmlXPathPopNumber",
49314	           xmlMemBlocks() - mem_base);
49315	    test_ret++;
49316            printf(" %d", n_ctxt);
49317            printf("\n");
49318        }
49319    }
49320    function_tests++;
49321#endif
49322
49323    return(test_ret);
49324}
49325
49326
49327static int
49328test_xmlXPathPopString(void) {
49329    int test_ret = 0;
49330
49331#if defined(LIBXML_XPATH_ENABLED)
49332    int mem_base;
49333    xmlChar * ret_val;
49334    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49335    int n_ctxt;
49336
49337    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49338        mem_base = xmlMemBlocks();
49339        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49340
49341        ret_val = xmlXPathPopString(ctxt);
49342        desret_xmlChar_ptr(ret_val);
49343        call_tests++;
49344        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49345        xmlResetLastError();
49346        if (mem_base != xmlMemBlocks()) {
49347            printf("Leak of %d blocks found in xmlXPathPopString",
49348	           xmlMemBlocks() - mem_base);
49349	    test_ret++;
49350            printf(" %d", n_ctxt);
49351            printf("\n");
49352        }
49353    }
49354    function_tests++;
49355#endif
49356
49357    return(test_ret);
49358}
49359
49360
49361static int
49362test_xmlXPathPositionFunction(void) {
49363    int test_ret = 0;
49364
49365#if defined(LIBXML_XPATH_ENABLED)
49366    int mem_base;
49367    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49368    int n_ctxt;
49369    int nargs; /* the number of arguments */
49370    int n_nargs;
49371
49372    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49373    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49374        mem_base = xmlMemBlocks();
49375        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49376        nargs = gen_int(n_nargs, 1);
49377
49378        xmlXPathPositionFunction(ctxt, nargs);
49379        call_tests++;
49380        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49381        des_int(n_nargs, nargs, 1);
49382        xmlResetLastError();
49383        if (mem_base != xmlMemBlocks()) {
49384            printf("Leak of %d blocks found in xmlXPathPositionFunction",
49385	           xmlMemBlocks() - mem_base);
49386	    test_ret++;
49387            printf(" %d", n_ctxt);
49388            printf(" %d", n_nargs);
49389            printf("\n");
49390        }
49391    }
49392    }
49393    function_tests++;
49394#endif
49395
49396    return(test_ret);
49397}
49398
49399
49400static int
49401test_xmlXPathRegisterAllFunctions(void) {
49402    int test_ret = 0;
49403
49404#if defined(LIBXML_XPATH_ENABLED)
49405    int mem_base;
49406    xmlXPathContextPtr ctxt; /* the XPath context */
49407    int n_ctxt;
49408
49409    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49410        mem_base = xmlMemBlocks();
49411        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49412
49413        xmlXPathRegisterAllFunctions(ctxt);
49414        call_tests++;
49415        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49416        xmlResetLastError();
49417        if (mem_base != xmlMemBlocks()) {
49418            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49419	           xmlMemBlocks() - mem_base);
49420	    test_ret++;
49421            printf(" %d", n_ctxt);
49422            printf("\n");
49423        }
49424    }
49425    function_tests++;
49426#endif
49427
49428    return(test_ret);
49429}
49430
49431
49432static int
49433test_xmlXPathRegisterFunc(void) {
49434    int test_ret = 0;
49435
49436
49437    /* missing type support */
49438    return(test_ret);
49439}
49440
49441
49442static int
49443test_xmlXPathRegisterFuncLookup(void) {
49444    int test_ret = 0;
49445
49446
49447    /* missing type support */
49448    return(test_ret);
49449}
49450
49451
49452static int
49453test_xmlXPathRegisterFuncNS(void) {
49454    int test_ret = 0;
49455
49456
49457    /* missing type support */
49458    return(test_ret);
49459}
49460
49461
49462static int
49463test_xmlXPathRegisterNs(void) {
49464    int test_ret = 0;
49465
49466#if defined(LIBXML_XPATH_ENABLED)
49467    int mem_base;
49468    int ret_val;
49469    xmlXPathContextPtr ctxt; /* the XPath context */
49470    int n_ctxt;
49471    xmlChar * prefix; /* the namespace prefix */
49472    int n_prefix;
49473    xmlChar * ns_uri; /* the namespace name */
49474    int n_ns_uri;
49475
49476    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49477    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49478    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49479        mem_base = xmlMemBlocks();
49480        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49481        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49482        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49483
49484        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49485        desret_int(ret_val);
49486        call_tests++;
49487        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49488        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49489        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49490        xmlResetLastError();
49491        if (mem_base != xmlMemBlocks()) {
49492            printf("Leak of %d blocks found in xmlXPathRegisterNs",
49493	           xmlMemBlocks() - mem_base);
49494	    test_ret++;
49495            printf(" %d", n_ctxt);
49496            printf(" %d", n_prefix);
49497            printf(" %d", n_ns_uri);
49498            printf("\n");
49499        }
49500    }
49501    }
49502    }
49503    function_tests++;
49504#endif
49505
49506    return(test_ret);
49507}
49508
49509
49510static int
49511test_xmlXPathRegisterVariable(void) {
49512    int test_ret = 0;
49513
49514#if defined(LIBXML_XPATH_ENABLED)
49515    int mem_base;
49516    int ret_val;
49517    xmlXPathContextPtr ctxt; /* the XPath context */
49518    int n_ctxt;
49519    xmlChar * name; /* the variable name */
49520    int n_name;
49521    xmlXPathObjectPtr value; /* the variable value or NULL */
49522    int n_value;
49523
49524    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49525    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49526    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49527        mem_base = xmlMemBlocks();
49528        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49529        name = gen_const_xmlChar_ptr(n_name, 1);
49530        value = gen_xmlXPathObjectPtr(n_value, 2);
49531
49532        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49533        desret_int(ret_val);
49534        call_tests++;
49535        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49536        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49537        des_xmlXPathObjectPtr(n_value, value, 2);
49538        xmlResetLastError();
49539        if (mem_base != xmlMemBlocks()) {
49540            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49541	           xmlMemBlocks() - mem_base);
49542	    test_ret++;
49543            printf(" %d", n_ctxt);
49544            printf(" %d", n_name);
49545            printf(" %d", n_value);
49546            printf("\n");
49547        }
49548    }
49549    }
49550    }
49551    function_tests++;
49552#endif
49553
49554    return(test_ret);
49555}
49556
49557
49558static int
49559test_xmlXPathRegisterVariableLookup(void) {
49560    int test_ret = 0;
49561
49562
49563    /* missing type support */
49564    return(test_ret);
49565}
49566
49567
49568static int
49569test_xmlXPathRegisterVariableNS(void) {
49570    int test_ret = 0;
49571
49572#if defined(LIBXML_XPATH_ENABLED)
49573    int mem_base;
49574    int ret_val;
49575    xmlXPathContextPtr ctxt; /* the XPath context */
49576    int n_ctxt;
49577    xmlChar * name; /* the variable name */
49578    int n_name;
49579    xmlChar * ns_uri; /* the variable namespace URI */
49580    int n_ns_uri;
49581    xmlXPathObjectPtr value; /* the variable value or NULL */
49582    int n_value;
49583
49584    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49585    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49586    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49587    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49588        mem_base = xmlMemBlocks();
49589        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49590        name = gen_const_xmlChar_ptr(n_name, 1);
49591        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49592        value = gen_xmlXPathObjectPtr(n_value, 3);
49593
49594        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49595        desret_int(ret_val);
49596        call_tests++;
49597        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49598        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49599        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49600        des_xmlXPathObjectPtr(n_value, value, 3);
49601        xmlResetLastError();
49602        if (mem_base != xmlMemBlocks()) {
49603            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49604	           xmlMemBlocks() - mem_base);
49605	    test_ret++;
49606            printf(" %d", n_ctxt);
49607            printf(" %d", n_name);
49608            printf(" %d", n_ns_uri);
49609            printf(" %d", n_value);
49610            printf("\n");
49611        }
49612    }
49613    }
49614    }
49615    }
49616    function_tests++;
49617#endif
49618
49619    return(test_ret);
49620}
49621
49622
49623static int
49624test_xmlXPathRegisteredFuncsCleanup(void) {
49625    int test_ret = 0;
49626
49627#if defined(LIBXML_XPATH_ENABLED)
49628    int mem_base;
49629    xmlXPathContextPtr ctxt; /* the XPath context */
49630    int n_ctxt;
49631
49632    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49633        mem_base = xmlMemBlocks();
49634        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49635
49636        xmlXPathRegisteredFuncsCleanup(ctxt);
49637        call_tests++;
49638        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49639        xmlResetLastError();
49640        if (mem_base != xmlMemBlocks()) {
49641            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49642	           xmlMemBlocks() - mem_base);
49643	    test_ret++;
49644            printf(" %d", n_ctxt);
49645            printf("\n");
49646        }
49647    }
49648    function_tests++;
49649#endif
49650
49651    return(test_ret);
49652}
49653
49654
49655static int
49656test_xmlXPathRegisteredNsCleanup(void) {
49657    int test_ret = 0;
49658
49659#if defined(LIBXML_XPATH_ENABLED)
49660    int mem_base;
49661    xmlXPathContextPtr ctxt; /* the XPath context */
49662    int n_ctxt;
49663
49664    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49665        mem_base = xmlMemBlocks();
49666        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49667
49668        xmlXPathRegisteredNsCleanup(ctxt);
49669        call_tests++;
49670        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49671        xmlResetLastError();
49672        if (mem_base != xmlMemBlocks()) {
49673            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49674	           xmlMemBlocks() - mem_base);
49675	    test_ret++;
49676            printf(" %d", n_ctxt);
49677            printf("\n");
49678        }
49679    }
49680    function_tests++;
49681#endif
49682
49683    return(test_ret);
49684}
49685
49686
49687static int
49688test_xmlXPathRegisteredVariablesCleanup(void) {
49689    int test_ret = 0;
49690
49691#if defined(LIBXML_XPATH_ENABLED)
49692    int mem_base;
49693    xmlXPathContextPtr ctxt; /* the XPath context */
49694    int n_ctxt;
49695
49696    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49697        mem_base = xmlMemBlocks();
49698        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49699
49700        xmlXPathRegisteredVariablesCleanup(ctxt);
49701        call_tests++;
49702        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49703        xmlResetLastError();
49704        if (mem_base != xmlMemBlocks()) {
49705            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49706	           xmlMemBlocks() - mem_base);
49707	    test_ret++;
49708            printf(" %d", n_ctxt);
49709            printf("\n");
49710        }
49711    }
49712    function_tests++;
49713#endif
49714
49715    return(test_ret);
49716}
49717
49718
49719static int
49720test_xmlXPathRoot(void) {
49721    int test_ret = 0;
49722
49723#if defined(LIBXML_XPATH_ENABLED)
49724    int mem_base;
49725    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49726    int n_ctxt;
49727
49728    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49729        mem_base = xmlMemBlocks();
49730        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49731
49732        xmlXPathRoot(ctxt);
49733        call_tests++;
49734        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49735        xmlResetLastError();
49736        if (mem_base != xmlMemBlocks()) {
49737            printf("Leak of %d blocks found in xmlXPathRoot",
49738	           xmlMemBlocks() - mem_base);
49739	    test_ret++;
49740            printf(" %d", n_ctxt);
49741            printf("\n");
49742        }
49743    }
49744    function_tests++;
49745#endif
49746
49747    return(test_ret);
49748}
49749
49750
49751static int
49752test_xmlXPathRoundFunction(void) {
49753    int test_ret = 0;
49754
49755#if defined(LIBXML_XPATH_ENABLED)
49756    int mem_base;
49757    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49758    int n_ctxt;
49759    int nargs; /* the number of arguments */
49760    int n_nargs;
49761
49762    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49763    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49764        mem_base = xmlMemBlocks();
49765        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49766        nargs = gen_int(n_nargs, 1);
49767
49768        xmlXPathRoundFunction(ctxt, nargs);
49769        call_tests++;
49770        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49771        des_int(n_nargs, nargs, 1);
49772        xmlResetLastError();
49773        if (mem_base != xmlMemBlocks()) {
49774            printf("Leak of %d blocks found in xmlXPathRoundFunction",
49775	           xmlMemBlocks() - mem_base);
49776	    test_ret++;
49777            printf(" %d", n_ctxt);
49778            printf(" %d", n_nargs);
49779            printf("\n");
49780        }
49781    }
49782    }
49783    function_tests++;
49784#endif
49785
49786    return(test_ret);
49787}
49788
49789
49790static int
49791test_xmlXPathStartsWithFunction(void) {
49792    int test_ret = 0;
49793
49794#if defined(LIBXML_XPATH_ENABLED)
49795    int mem_base;
49796    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49797    int n_ctxt;
49798    int nargs; /* the number of arguments */
49799    int n_nargs;
49800
49801    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49802    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49803        mem_base = xmlMemBlocks();
49804        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49805        nargs = gen_int(n_nargs, 1);
49806
49807        xmlXPathStartsWithFunction(ctxt, nargs);
49808        call_tests++;
49809        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49810        des_int(n_nargs, nargs, 1);
49811        xmlResetLastError();
49812        if (mem_base != xmlMemBlocks()) {
49813            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49814	           xmlMemBlocks() - mem_base);
49815	    test_ret++;
49816            printf(" %d", n_ctxt);
49817            printf(" %d", n_nargs);
49818            printf("\n");
49819        }
49820    }
49821    }
49822    function_tests++;
49823#endif
49824
49825    return(test_ret);
49826}
49827
49828
49829static int
49830test_xmlXPathStringEvalNumber(void) {
49831    int test_ret = 0;
49832
49833#if defined(LIBXML_XPATH_ENABLED)
49834    int mem_base;
49835    double ret_val;
49836    xmlChar * str; /* A string to scan */
49837    int n_str;
49838
49839    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
49840        mem_base = xmlMemBlocks();
49841        str = gen_const_xmlChar_ptr(n_str, 0);
49842
49843        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
49844        desret_double(ret_val);
49845        call_tests++;
49846        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
49847        xmlResetLastError();
49848        if (mem_base != xmlMemBlocks()) {
49849            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
49850	           xmlMemBlocks() - mem_base);
49851	    test_ret++;
49852            printf(" %d", n_str);
49853            printf("\n");
49854        }
49855    }
49856    function_tests++;
49857#endif
49858
49859    return(test_ret);
49860}
49861
49862
49863static int
49864test_xmlXPathStringFunction(void) {
49865    int test_ret = 0;
49866
49867#if defined(LIBXML_XPATH_ENABLED)
49868    int mem_base;
49869    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49870    int n_ctxt;
49871    int nargs; /* the number of arguments */
49872    int n_nargs;
49873
49874    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49875    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49876        mem_base = xmlMemBlocks();
49877        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49878        nargs = gen_int(n_nargs, 1);
49879
49880        xmlXPathStringFunction(ctxt, nargs);
49881        call_tests++;
49882        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49883        des_int(n_nargs, nargs, 1);
49884        xmlResetLastError();
49885        if (mem_base != xmlMemBlocks()) {
49886            printf("Leak of %d blocks found in xmlXPathStringFunction",
49887	           xmlMemBlocks() - mem_base);
49888	    test_ret++;
49889            printf(" %d", n_ctxt);
49890            printf(" %d", n_nargs);
49891            printf("\n");
49892        }
49893    }
49894    }
49895    function_tests++;
49896#endif
49897
49898    return(test_ret);
49899}
49900
49901
49902static int
49903test_xmlXPathStringLengthFunction(void) {
49904    int test_ret = 0;
49905
49906#if defined(LIBXML_XPATH_ENABLED)
49907    int mem_base;
49908    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49909    int n_ctxt;
49910    int nargs; /* the number of arguments */
49911    int n_nargs;
49912
49913    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49914    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49915        mem_base = xmlMemBlocks();
49916        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49917        nargs = gen_int(n_nargs, 1);
49918
49919        xmlXPathStringLengthFunction(ctxt, nargs);
49920        call_tests++;
49921        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49922        des_int(n_nargs, nargs, 1);
49923        xmlResetLastError();
49924        if (mem_base != xmlMemBlocks()) {
49925            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
49926	           xmlMemBlocks() - mem_base);
49927	    test_ret++;
49928            printf(" %d", n_ctxt);
49929            printf(" %d", n_nargs);
49930            printf("\n");
49931        }
49932    }
49933    }
49934    function_tests++;
49935#endif
49936
49937    return(test_ret);
49938}
49939
49940
49941static int
49942test_xmlXPathSubValues(void) {
49943    int test_ret = 0;
49944
49945#if defined(LIBXML_XPATH_ENABLED)
49946    int mem_base;
49947    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49948    int n_ctxt;
49949
49950    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49951        mem_base = xmlMemBlocks();
49952        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49953
49954        xmlXPathSubValues(ctxt);
49955        call_tests++;
49956        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49957        xmlResetLastError();
49958        if (mem_base != xmlMemBlocks()) {
49959            printf("Leak of %d blocks found in xmlXPathSubValues",
49960	           xmlMemBlocks() - mem_base);
49961	    test_ret++;
49962            printf(" %d", n_ctxt);
49963            printf("\n");
49964        }
49965    }
49966    function_tests++;
49967#endif
49968
49969    return(test_ret);
49970}
49971
49972
49973static int
49974test_xmlXPathSubstringAfterFunction(void) {
49975    int test_ret = 0;
49976
49977#if defined(LIBXML_XPATH_ENABLED)
49978    int mem_base;
49979    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49980    int n_ctxt;
49981    int nargs; /* the number of arguments */
49982    int n_nargs;
49983
49984    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49985    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49986        mem_base = xmlMemBlocks();
49987        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49988        nargs = gen_int(n_nargs, 1);
49989
49990        xmlXPathSubstringAfterFunction(ctxt, nargs);
49991        call_tests++;
49992        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49993        des_int(n_nargs, nargs, 1);
49994        xmlResetLastError();
49995        if (mem_base != xmlMemBlocks()) {
49996            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
49997	           xmlMemBlocks() - mem_base);
49998	    test_ret++;
49999            printf(" %d", n_ctxt);
50000            printf(" %d", n_nargs);
50001            printf("\n");
50002        }
50003    }
50004    }
50005    function_tests++;
50006#endif
50007
50008    return(test_ret);
50009}
50010
50011
50012static int
50013test_xmlXPathSubstringBeforeFunction(void) {
50014    int test_ret = 0;
50015
50016#if defined(LIBXML_XPATH_ENABLED)
50017    int mem_base;
50018    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50019    int n_ctxt;
50020    int nargs; /* the number of arguments */
50021    int n_nargs;
50022
50023    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50024    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50025        mem_base = xmlMemBlocks();
50026        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50027        nargs = gen_int(n_nargs, 1);
50028
50029        xmlXPathSubstringBeforeFunction(ctxt, nargs);
50030        call_tests++;
50031        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50032        des_int(n_nargs, nargs, 1);
50033        xmlResetLastError();
50034        if (mem_base != xmlMemBlocks()) {
50035            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50036	           xmlMemBlocks() - mem_base);
50037	    test_ret++;
50038            printf(" %d", n_ctxt);
50039            printf(" %d", n_nargs);
50040            printf("\n");
50041        }
50042    }
50043    }
50044    function_tests++;
50045#endif
50046
50047    return(test_ret);
50048}
50049
50050
50051static int
50052test_xmlXPathSubstringFunction(void) {
50053    int test_ret = 0;
50054
50055#if defined(LIBXML_XPATH_ENABLED)
50056    int mem_base;
50057    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50058    int n_ctxt;
50059    int nargs; /* the number of arguments */
50060    int n_nargs;
50061
50062    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50063    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50064        mem_base = xmlMemBlocks();
50065        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50066        nargs = gen_int(n_nargs, 1);
50067
50068        xmlXPathSubstringFunction(ctxt, nargs);
50069        call_tests++;
50070        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50071        des_int(n_nargs, nargs, 1);
50072        xmlResetLastError();
50073        if (mem_base != xmlMemBlocks()) {
50074            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50075	           xmlMemBlocks() - mem_base);
50076	    test_ret++;
50077            printf(" %d", n_ctxt);
50078            printf(" %d", n_nargs);
50079            printf("\n");
50080        }
50081    }
50082    }
50083    function_tests++;
50084#endif
50085
50086    return(test_ret);
50087}
50088
50089
50090static int
50091test_xmlXPathSumFunction(void) {
50092    int test_ret = 0;
50093
50094#if defined(LIBXML_XPATH_ENABLED)
50095    int mem_base;
50096    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50097    int n_ctxt;
50098    int nargs; /* the number of arguments */
50099    int n_nargs;
50100
50101    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50102    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50103        mem_base = xmlMemBlocks();
50104        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50105        nargs = gen_int(n_nargs, 1);
50106
50107        xmlXPathSumFunction(ctxt, nargs);
50108        call_tests++;
50109        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50110        des_int(n_nargs, nargs, 1);
50111        xmlResetLastError();
50112        if (mem_base != xmlMemBlocks()) {
50113            printf("Leak of %d blocks found in xmlXPathSumFunction",
50114	           xmlMemBlocks() - mem_base);
50115	    test_ret++;
50116            printf(" %d", n_ctxt);
50117            printf(" %d", n_nargs);
50118            printf("\n");
50119        }
50120    }
50121    }
50122    function_tests++;
50123#endif
50124
50125    return(test_ret);
50126}
50127
50128
50129static int
50130test_xmlXPathTrailing(void) {
50131    int test_ret = 0;
50132
50133#if defined(LIBXML_XPATH_ENABLED)
50134    int mem_base;
50135    xmlNodeSetPtr ret_val;
50136    xmlNodeSetPtr nodes1; /* a node-set */
50137    int n_nodes1;
50138    xmlNodeSetPtr nodes2; /* a node-set */
50139    int n_nodes2;
50140
50141    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50142    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50143        mem_base = xmlMemBlocks();
50144        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50145        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50146
50147        ret_val = xmlXPathTrailing(nodes1, nodes2);
50148        desret_xmlNodeSetPtr(ret_val);
50149        call_tests++;
50150        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50151        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50152        xmlResetLastError();
50153        if (mem_base != xmlMemBlocks()) {
50154            printf("Leak of %d blocks found in xmlXPathTrailing",
50155	           xmlMemBlocks() - mem_base);
50156	    test_ret++;
50157            printf(" %d", n_nodes1);
50158            printf(" %d", n_nodes2);
50159            printf("\n");
50160        }
50161    }
50162    }
50163    function_tests++;
50164#endif
50165
50166    return(test_ret);
50167}
50168
50169
50170static int
50171test_xmlXPathTrailingSorted(void) {
50172    int test_ret = 0;
50173
50174#if defined(LIBXML_XPATH_ENABLED)
50175    int mem_base;
50176    xmlNodeSetPtr ret_val;
50177    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50178    int n_nodes1;
50179    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50180    int n_nodes2;
50181
50182    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50183    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50184        mem_base = xmlMemBlocks();
50185        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50186        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50187
50188        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50189        desret_xmlNodeSetPtr(ret_val);
50190        call_tests++;
50191        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50192        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50193        xmlResetLastError();
50194        if (mem_base != xmlMemBlocks()) {
50195            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50196	           xmlMemBlocks() - mem_base);
50197	    test_ret++;
50198            printf(" %d", n_nodes1);
50199            printf(" %d", n_nodes2);
50200            printf("\n");
50201        }
50202    }
50203    }
50204    function_tests++;
50205#endif
50206
50207    return(test_ret);
50208}
50209
50210
50211static int
50212test_xmlXPathTranslateFunction(void) {
50213    int test_ret = 0;
50214
50215#if defined(LIBXML_XPATH_ENABLED)
50216    int mem_base;
50217    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50218    int n_ctxt;
50219    int nargs; /* the number of arguments */
50220    int n_nargs;
50221
50222    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50223    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50224        mem_base = xmlMemBlocks();
50225        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50226        nargs = gen_int(n_nargs, 1);
50227
50228        xmlXPathTranslateFunction(ctxt, nargs);
50229        call_tests++;
50230        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50231        des_int(n_nargs, nargs, 1);
50232        xmlResetLastError();
50233        if (mem_base != xmlMemBlocks()) {
50234            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50235	           xmlMemBlocks() - mem_base);
50236	    test_ret++;
50237            printf(" %d", n_ctxt);
50238            printf(" %d", n_nargs);
50239            printf("\n");
50240        }
50241    }
50242    }
50243    function_tests++;
50244#endif
50245
50246    return(test_ret);
50247}
50248
50249
50250static int
50251test_xmlXPathTrueFunction(void) {
50252    int test_ret = 0;
50253
50254#if defined(LIBXML_XPATH_ENABLED)
50255    int mem_base;
50256    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50257    int n_ctxt;
50258    int nargs; /* the number of arguments */
50259    int n_nargs;
50260
50261    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50262    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50263        mem_base = xmlMemBlocks();
50264        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50265        nargs = gen_int(n_nargs, 1);
50266
50267        xmlXPathTrueFunction(ctxt, nargs);
50268        call_tests++;
50269        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50270        des_int(n_nargs, nargs, 1);
50271        xmlResetLastError();
50272        if (mem_base != xmlMemBlocks()) {
50273            printf("Leak of %d blocks found in xmlXPathTrueFunction",
50274	           xmlMemBlocks() - mem_base);
50275	    test_ret++;
50276            printf(" %d", n_ctxt);
50277            printf(" %d", n_nargs);
50278            printf("\n");
50279        }
50280    }
50281    }
50282    function_tests++;
50283#endif
50284
50285    return(test_ret);
50286}
50287
50288
50289static int
50290test_xmlXPathValueFlipSign(void) {
50291    int test_ret = 0;
50292
50293#if defined(LIBXML_XPATH_ENABLED)
50294    int mem_base;
50295    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50296    int n_ctxt;
50297
50298    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50299        mem_base = xmlMemBlocks();
50300        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50301
50302        xmlXPathValueFlipSign(ctxt);
50303        call_tests++;
50304        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50305        xmlResetLastError();
50306        if (mem_base != xmlMemBlocks()) {
50307            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50308	           xmlMemBlocks() - mem_base);
50309	    test_ret++;
50310            printf(" %d", n_ctxt);
50311            printf("\n");
50312        }
50313    }
50314    function_tests++;
50315#endif
50316
50317    return(test_ret);
50318}
50319
50320
50321static int
50322test_xmlXPathVariableLookup(void) {
50323    int test_ret = 0;
50324
50325#if defined(LIBXML_XPATH_ENABLED)
50326    int mem_base;
50327    xmlXPathObjectPtr ret_val;
50328    xmlXPathContextPtr ctxt; /* the XPath context */
50329    int n_ctxt;
50330    xmlChar * name; /* the variable name */
50331    int n_name;
50332
50333    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50334    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50335        mem_base = xmlMemBlocks();
50336        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50337        name = gen_const_xmlChar_ptr(n_name, 1);
50338
50339        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50340        desret_xmlXPathObjectPtr(ret_val);
50341        call_tests++;
50342        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50343        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50344        xmlResetLastError();
50345        if (mem_base != xmlMemBlocks()) {
50346            printf("Leak of %d blocks found in xmlXPathVariableLookup",
50347	           xmlMemBlocks() - mem_base);
50348	    test_ret++;
50349            printf(" %d", n_ctxt);
50350            printf(" %d", n_name);
50351            printf("\n");
50352        }
50353    }
50354    }
50355    function_tests++;
50356#endif
50357
50358    return(test_ret);
50359}
50360
50361
50362static int
50363test_xmlXPathVariableLookupNS(void) {
50364    int test_ret = 0;
50365
50366#if defined(LIBXML_XPATH_ENABLED)
50367    int mem_base;
50368    xmlXPathObjectPtr ret_val;
50369    xmlXPathContextPtr ctxt; /* the XPath context */
50370    int n_ctxt;
50371    xmlChar * name; /* the variable name */
50372    int n_name;
50373    xmlChar * ns_uri; /* the variable namespace URI */
50374    int n_ns_uri;
50375
50376    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50377    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50378    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50379        mem_base = xmlMemBlocks();
50380        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50381        name = gen_const_xmlChar_ptr(n_name, 1);
50382        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50383
50384        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50385        desret_xmlXPathObjectPtr(ret_val);
50386        call_tests++;
50387        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50388        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50389        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50390        xmlResetLastError();
50391        if (mem_base != xmlMemBlocks()) {
50392            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50393	           xmlMemBlocks() - mem_base);
50394	    test_ret++;
50395            printf(" %d", n_ctxt);
50396            printf(" %d", n_name);
50397            printf(" %d", n_ns_uri);
50398            printf("\n");
50399        }
50400    }
50401    }
50402    }
50403    function_tests++;
50404#endif
50405
50406    return(test_ret);
50407}
50408
50409
50410static int
50411test_xmlXPathWrapCString(void) {
50412    int test_ret = 0;
50413
50414#if defined(LIBXML_XPATH_ENABLED)
50415    int mem_base;
50416    xmlXPathObjectPtr ret_val;
50417    char * val; /* the char * value */
50418    int n_val;
50419
50420    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50421        mem_base = xmlMemBlocks();
50422        val = gen_char_ptr(n_val, 0);
50423
50424        ret_val = xmlXPathWrapCString(val);
50425        desret_xmlXPathObjectPtr(ret_val);
50426        call_tests++;
50427        des_char_ptr(n_val, val, 0);
50428        xmlResetLastError();
50429        if (mem_base != xmlMemBlocks()) {
50430            printf("Leak of %d blocks found in xmlXPathWrapCString",
50431	           xmlMemBlocks() - mem_base);
50432	    test_ret++;
50433            printf(" %d", n_val);
50434            printf("\n");
50435        }
50436    }
50437    function_tests++;
50438#endif
50439
50440    return(test_ret);
50441}
50442
50443
50444static int
50445test_xmlXPathWrapExternal(void) {
50446    int test_ret = 0;
50447
50448#if defined(LIBXML_XPATH_ENABLED)
50449    int mem_base;
50450    xmlXPathObjectPtr ret_val;
50451    void * val; /* the user data */
50452    int n_val;
50453
50454    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50455        mem_base = xmlMemBlocks();
50456        val = gen_void_ptr(n_val, 0);
50457
50458        ret_val = xmlXPathWrapExternal(val);
50459        desret_xmlXPathObjectPtr(ret_val);
50460        call_tests++;
50461        des_void_ptr(n_val, val, 0);
50462        xmlResetLastError();
50463        if (mem_base != xmlMemBlocks()) {
50464            printf("Leak of %d blocks found in xmlXPathWrapExternal",
50465	           xmlMemBlocks() - mem_base);
50466	    test_ret++;
50467            printf(" %d", n_val);
50468            printf("\n");
50469        }
50470    }
50471    function_tests++;
50472#endif
50473
50474    return(test_ret);
50475}
50476
50477
50478static int
50479test_xmlXPathWrapNodeSet(void) {
50480    int test_ret = 0;
50481
50482#if defined(LIBXML_XPATH_ENABLED)
50483    int mem_base;
50484    xmlXPathObjectPtr ret_val;
50485    xmlNodeSetPtr val; /* the NodePtr value */
50486    int n_val;
50487
50488    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50489        mem_base = xmlMemBlocks();
50490        val = gen_xmlNodeSetPtr(n_val, 0);
50491
50492        ret_val = xmlXPathWrapNodeSet(val);
50493        desret_xmlXPathObjectPtr(ret_val);
50494        call_tests++;
50495        des_xmlNodeSetPtr(n_val, val, 0);
50496        xmlResetLastError();
50497        if (mem_base != xmlMemBlocks()) {
50498            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50499	           xmlMemBlocks() - mem_base);
50500	    test_ret++;
50501            printf(" %d", n_val);
50502            printf("\n");
50503        }
50504    }
50505    function_tests++;
50506#endif
50507
50508    return(test_ret);
50509}
50510
50511
50512static int
50513test_xmlXPatherror(void) {
50514    int test_ret = 0;
50515
50516#if defined(LIBXML_XPATH_ENABLED)
50517    int mem_base;
50518    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50519    int n_ctxt;
50520    const char * file; /* the file name */
50521    int n_file;
50522    int line; /* the line number */
50523    int n_line;
50524    int no; /* the error number */
50525    int n_no;
50526
50527    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50528    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50529    for (n_line = 0;n_line < gen_nb_int;n_line++) {
50530    for (n_no = 0;n_no < gen_nb_int;n_no++) {
50531        mem_base = xmlMemBlocks();
50532        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50533        file = gen_filepath(n_file, 1);
50534        line = gen_int(n_line, 2);
50535        no = gen_int(n_no, 3);
50536
50537        xmlXPatherror(ctxt, file, line, no);
50538        call_tests++;
50539        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50540        des_filepath(n_file, file, 1);
50541        des_int(n_line, line, 2);
50542        des_int(n_no, no, 3);
50543        xmlResetLastError();
50544        if (mem_base != xmlMemBlocks()) {
50545            printf("Leak of %d blocks found in xmlXPatherror",
50546	           xmlMemBlocks() - mem_base);
50547	    test_ret++;
50548            printf(" %d", n_ctxt);
50549            printf(" %d", n_file);
50550            printf(" %d", n_line);
50551            printf(" %d", n_no);
50552            printf("\n");
50553        }
50554    }
50555    }
50556    }
50557    }
50558    function_tests++;
50559#endif
50560
50561    return(test_ret);
50562}
50563
50564static int
50565test_xpathInternals(void) {
50566    int test_ret = 0;
50567
50568    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50569    test_ret += test_valuePop();
50570    test_ret += test_valuePush();
50571    test_ret += test_xmlXPathAddValues();
50572    test_ret += test_xmlXPathBooleanFunction();
50573    test_ret += test_xmlXPathCeilingFunction();
50574    test_ret += test_xmlXPathCompareValues();
50575    test_ret += test_xmlXPathConcatFunction();
50576    test_ret += test_xmlXPathContainsFunction();
50577    test_ret += test_xmlXPathCountFunction();
50578    test_ret += test_xmlXPathDebugDumpCompExpr();
50579    test_ret += test_xmlXPathDebugDumpObject();
50580    test_ret += test_xmlXPathDifference();
50581    test_ret += test_xmlXPathDistinct();
50582    test_ret += test_xmlXPathDistinctSorted();
50583    test_ret += test_xmlXPathDivValues();
50584    test_ret += test_xmlXPathEqualValues();
50585    test_ret += test_xmlXPathErr();
50586    test_ret += test_xmlXPathEvalExpr();
50587    test_ret += test_xmlXPathEvaluatePredicateResult();
50588    test_ret += test_xmlXPathFalseFunction();
50589    test_ret += test_xmlXPathFloorFunction();
50590    test_ret += test_xmlXPathFunctionLookup();
50591    test_ret += test_xmlXPathFunctionLookupNS();
50592    test_ret += test_xmlXPathHasSameNodes();
50593    test_ret += test_xmlXPathIdFunction();
50594    test_ret += test_xmlXPathIntersection();
50595    test_ret += test_xmlXPathIsNodeType();
50596    test_ret += test_xmlXPathLangFunction();
50597    test_ret += test_xmlXPathLastFunction();
50598    test_ret += test_xmlXPathLeading();
50599    test_ret += test_xmlXPathLeadingSorted();
50600    test_ret += test_xmlXPathLocalNameFunction();
50601    test_ret += test_xmlXPathModValues();
50602    test_ret += test_xmlXPathMultValues();
50603    test_ret += test_xmlXPathNamespaceURIFunction();
50604    test_ret += test_xmlXPathNewBoolean();
50605    test_ret += test_xmlXPathNewCString();
50606    test_ret += test_xmlXPathNewFloat();
50607    test_ret += test_xmlXPathNewNodeSet();
50608    test_ret += test_xmlXPathNewNodeSetList();
50609    test_ret += test_xmlXPathNewParserContext();
50610    test_ret += test_xmlXPathNewString();
50611    test_ret += test_xmlXPathNextAncestor();
50612    test_ret += test_xmlXPathNextAncestorOrSelf();
50613    test_ret += test_xmlXPathNextAttribute();
50614    test_ret += test_xmlXPathNextChild();
50615    test_ret += test_xmlXPathNextDescendant();
50616    test_ret += test_xmlXPathNextDescendantOrSelf();
50617    test_ret += test_xmlXPathNextFollowing();
50618    test_ret += test_xmlXPathNextFollowingSibling();
50619    test_ret += test_xmlXPathNextNamespace();
50620    test_ret += test_xmlXPathNextParent();
50621    test_ret += test_xmlXPathNextPreceding();
50622    test_ret += test_xmlXPathNextPrecedingSibling();
50623    test_ret += test_xmlXPathNextSelf();
50624    test_ret += test_xmlXPathNodeLeading();
50625    test_ret += test_xmlXPathNodeLeadingSorted();
50626    test_ret += test_xmlXPathNodeSetAdd();
50627    test_ret += test_xmlXPathNodeSetAddNs();
50628    test_ret += test_xmlXPathNodeSetAddUnique();
50629    test_ret += test_xmlXPathNodeSetContains();
50630    test_ret += test_xmlXPathNodeSetDel();
50631    test_ret += test_xmlXPathNodeSetMerge();
50632    test_ret += test_xmlXPathNodeSetRemove();
50633    test_ret += test_xmlXPathNodeSetSort();
50634    test_ret += test_xmlXPathNodeTrailing();
50635    test_ret += test_xmlXPathNodeTrailingSorted();
50636    test_ret += test_xmlXPathNormalizeFunction();
50637    test_ret += test_xmlXPathNotEqualValues();
50638    test_ret += test_xmlXPathNotFunction();
50639    test_ret += test_xmlXPathNsLookup();
50640    test_ret += test_xmlXPathNumberFunction();
50641    test_ret += test_xmlXPathParseNCName();
50642    test_ret += test_xmlXPathParseName();
50643    test_ret += test_xmlXPathPopBoolean();
50644    test_ret += test_xmlXPathPopExternal();
50645    test_ret += test_xmlXPathPopNodeSet();
50646    test_ret += test_xmlXPathPopNumber();
50647    test_ret += test_xmlXPathPopString();
50648    test_ret += test_xmlXPathPositionFunction();
50649    test_ret += test_xmlXPathRegisterAllFunctions();
50650    test_ret += test_xmlXPathRegisterFunc();
50651    test_ret += test_xmlXPathRegisterFuncLookup();
50652    test_ret += test_xmlXPathRegisterFuncNS();
50653    test_ret += test_xmlXPathRegisterNs();
50654    test_ret += test_xmlXPathRegisterVariable();
50655    test_ret += test_xmlXPathRegisterVariableLookup();
50656    test_ret += test_xmlXPathRegisterVariableNS();
50657    test_ret += test_xmlXPathRegisteredFuncsCleanup();
50658    test_ret += test_xmlXPathRegisteredNsCleanup();
50659    test_ret += test_xmlXPathRegisteredVariablesCleanup();
50660    test_ret += test_xmlXPathRoot();
50661    test_ret += test_xmlXPathRoundFunction();
50662    test_ret += test_xmlXPathStartsWithFunction();
50663    test_ret += test_xmlXPathStringEvalNumber();
50664    test_ret += test_xmlXPathStringFunction();
50665    test_ret += test_xmlXPathStringLengthFunction();
50666    test_ret += test_xmlXPathSubValues();
50667    test_ret += test_xmlXPathSubstringAfterFunction();
50668    test_ret += test_xmlXPathSubstringBeforeFunction();
50669    test_ret += test_xmlXPathSubstringFunction();
50670    test_ret += test_xmlXPathSumFunction();
50671    test_ret += test_xmlXPathTrailing();
50672    test_ret += test_xmlXPathTrailingSorted();
50673    test_ret += test_xmlXPathTranslateFunction();
50674    test_ret += test_xmlXPathTrueFunction();
50675    test_ret += test_xmlXPathValueFlipSign();
50676    test_ret += test_xmlXPathVariableLookup();
50677    test_ret += test_xmlXPathVariableLookupNS();
50678    test_ret += test_xmlXPathWrapCString();
50679    test_ret += test_xmlXPathWrapExternal();
50680    test_ret += test_xmlXPathWrapNodeSet();
50681    test_ret += test_xmlXPatherror();
50682
50683    if (test_ret != 0)
50684	printf("Module xpathInternals: %d errors\n", test_ret);
50685    return(test_ret);
50686}
50687
50688static int
50689test_xmlXPtrBuildNodeList(void) {
50690    int test_ret = 0;
50691
50692#if defined(LIBXML_XPTR_ENABLED)
50693    int mem_base;
50694    xmlNodePtr ret_val;
50695    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50696    int n_obj;
50697
50698    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50699        mem_base = xmlMemBlocks();
50700        obj = gen_xmlXPathObjectPtr(n_obj, 0);
50701
50702        ret_val = xmlXPtrBuildNodeList(obj);
50703        desret_xmlNodePtr(ret_val);
50704        call_tests++;
50705        des_xmlXPathObjectPtr(n_obj, obj, 0);
50706        xmlResetLastError();
50707        if (mem_base != xmlMemBlocks()) {
50708            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50709	           xmlMemBlocks() - mem_base);
50710	    test_ret++;
50711            printf(" %d", n_obj);
50712            printf("\n");
50713        }
50714    }
50715    function_tests++;
50716#endif
50717
50718    return(test_ret);
50719}
50720
50721
50722static int
50723test_xmlXPtrEval(void) {
50724    int test_ret = 0;
50725
50726#if defined(LIBXML_XPTR_ENABLED)
50727    int mem_base;
50728    xmlXPathObjectPtr ret_val;
50729    xmlChar * str; /* the XPointer expression */
50730    int n_str;
50731    xmlXPathContextPtr ctx; /* the XPointer context */
50732    int n_ctx;
50733
50734    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50735    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50736        mem_base = xmlMemBlocks();
50737        str = gen_const_xmlChar_ptr(n_str, 0);
50738        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50739
50740        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50741        desret_xmlXPathObjectPtr(ret_val);
50742        call_tests++;
50743        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50744        des_xmlXPathContextPtr(n_ctx, ctx, 1);
50745        xmlResetLastError();
50746        if (mem_base != xmlMemBlocks()) {
50747            printf("Leak of %d blocks found in xmlXPtrEval",
50748	           xmlMemBlocks() - mem_base);
50749	    test_ret++;
50750            printf(" %d", n_str);
50751            printf(" %d", n_ctx);
50752            printf("\n");
50753        }
50754    }
50755    }
50756    function_tests++;
50757#endif
50758
50759    return(test_ret);
50760}
50761
50762
50763static int
50764test_xmlXPtrEvalRangePredicate(void) {
50765    int test_ret = 0;
50766
50767#if defined(LIBXML_XPTR_ENABLED)
50768    int mem_base;
50769    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50770    int n_ctxt;
50771
50772    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50773        mem_base = xmlMemBlocks();
50774        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50775
50776        xmlXPtrEvalRangePredicate(ctxt);
50777        call_tests++;
50778        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50779        xmlResetLastError();
50780        if (mem_base != xmlMemBlocks()) {
50781            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50782	           xmlMemBlocks() - mem_base);
50783	    test_ret++;
50784            printf(" %d", n_ctxt);
50785            printf("\n");
50786        }
50787    }
50788    function_tests++;
50789#endif
50790
50791    return(test_ret);
50792}
50793
50794#ifdef LIBXML_XPTR_ENABLED
50795
50796#define gen_nb_xmlLocationSetPtr 1
50797static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50798    return(NULL);
50799}
50800static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50801}
50802#endif
50803
50804
50805static int
50806test_xmlXPtrLocationSetAdd(void) {
50807    int test_ret = 0;
50808
50809#if defined(LIBXML_XPTR_ENABLED)
50810    int mem_base;
50811    xmlLocationSetPtr cur; /* the initial range set */
50812    int n_cur;
50813    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50814    int n_val;
50815
50816    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50817    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50818        mem_base = xmlMemBlocks();
50819        cur = gen_xmlLocationSetPtr(n_cur, 0);
50820        val = gen_xmlXPathObjectPtr(n_val, 1);
50821
50822        xmlXPtrLocationSetAdd(cur, val);
50823        call_tests++;
50824        des_xmlLocationSetPtr(n_cur, cur, 0);
50825        des_xmlXPathObjectPtr(n_val, val, 1);
50826        xmlResetLastError();
50827        if (mem_base != xmlMemBlocks()) {
50828            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
50829	           xmlMemBlocks() - mem_base);
50830	    test_ret++;
50831            printf(" %d", n_cur);
50832            printf(" %d", n_val);
50833            printf("\n");
50834        }
50835    }
50836    }
50837    function_tests++;
50838#endif
50839
50840    return(test_ret);
50841}
50842
50843
50844static int
50845test_xmlXPtrLocationSetCreate(void) {
50846    int test_ret = 0;
50847
50848
50849    /* missing type support */
50850    return(test_ret);
50851}
50852
50853
50854static int
50855test_xmlXPtrLocationSetDel(void) {
50856    int test_ret = 0;
50857
50858#if defined(LIBXML_XPTR_ENABLED)
50859    int mem_base;
50860    xmlLocationSetPtr cur; /* the initial range set */
50861    int n_cur;
50862    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
50863    int n_val;
50864
50865    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50866    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50867        mem_base = xmlMemBlocks();
50868        cur = gen_xmlLocationSetPtr(n_cur, 0);
50869        val = gen_xmlXPathObjectPtr(n_val, 1);
50870
50871        xmlXPtrLocationSetDel(cur, val);
50872        call_tests++;
50873        des_xmlLocationSetPtr(n_cur, cur, 0);
50874        des_xmlXPathObjectPtr(n_val, val, 1);
50875        xmlResetLastError();
50876        if (mem_base != xmlMemBlocks()) {
50877            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
50878	           xmlMemBlocks() - mem_base);
50879	    test_ret++;
50880            printf(" %d", n_cur);
50881            printf(" %d", n_val);
50882            printf("\n");
50883        }
50884    }
50885    }
50886    function_tests++;
50887#endif
50888
50889    return(test_ret);
50890}
50891
50892
50893static int
50894test_xmlXPtrLocationSetMerge(void) {
50895    int test_ret = 0;
50896
50897
50898    /* missing type support */
50899    return(test_ret);
50900}
50901
50902
50903static int
50904test_xmlXPtrLocationSetRemove(void) {
50905    int test_ret = 0;
50906
50907#if defined(LIBXML_XPTR_ENABLED)
50908    int mem_base;
50909    xmlLocationSetPtr cur; /* the initial range set */
50910    int n_cur;
50911    int val; /* the index to remove */
50912    int n_val;
50913
50914    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50915    for (n_val = 0;n_val < gen_nb_int;n_val++) {
50916        mem_base = xmlMemBlocks();
50917        cur = gen_xmlLocationSetPtr(n_cur, 0);
50918        val = gen_int(n_val, 1);
50919
50920        xmlXPtrLocationSetRemove(cur, val);
50921        call_tests++;
50922        des_xmlLocationSetPtr(n_cur, cur, 0);
50923        des_int(n_val, val, 1);
50924        xmlResetLastError();
50925        if (mem_base != xmlMemBlocks()) {
50926            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
50927	           xmlMemBlocks() - mem_base);
50928	    test_ret++;
50929            printf(" %d", n_cur);
50930            printf(" %d", n_val);
50931            printf("\n");
50932        }
50933    }
50934    }
50935    function_tests++;
50936#endif
50937
50938    return(test_ret);
50939}
50940
50941
50942static int
50943test_xmlXPtrNewCollapsedRange(void) {
50944    int test_ret = 0;
50945
50946#if defined(LIBXML_XPTR_ENABLED)
50947    int mem_base;
50948    xmlXPathObjectPtr ret_val;
50949    xmlNodePtr start; /* the starting and ending node */
50950    int n_start;
50951
50952    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50953        mem_base = xmlMemBlocks();
50954        start = gen_xmlNodePtr(n_start, 0);
50955
50956        ret_val = xmlXPtrNewCollapsedRange(start);
50957        desret_xmlXPathObjectPtr(ret_val);
50958        call_tests++;
50959        des_xmlNodePtr(n_start, start, 0);
50960        xmlResetLastError();
50961        if (mem_base != xmlMemBlocks()) {
50962            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
50963	           xmlMemBlocks() - mem_base);
50964	    test_ret++;
50965            printf(" %d", n_start);
50966            printf("\n");
50967        }
50968    }
50969    function_tests++;
50970#endif
50971
50972    return(test_ret);
50973}
50974
50975
50976static int
50977test_xmlXPtrNewContext(void) {
50978    int test_ret = 0;
50979
50980
50981    /* missing type support */
50982    return(test_ret);
50983}
50984
50985
50986static int
50987test_xmlXPtrNewLocationSetNodeSet(void) {
50988    int test_ret = 0;
50989
50990#if defined(LIBXML_XPTR_ENABLED)
50991    int mem_base;
50992    xmlXPathObjectPtr ret_val;
50993    xmlNodeSetPtr set; /* a node set */
50994    int n_set;
50995
50996    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
50997        mem_base = xmlMemBlocks();
50998        set = gen_xmlNodeSetPtr(n_set, 0);
50999
51000        ret_val = xmlXPtrNewLocationSetNodeSet(set);
51001        desret_xmlXPathObjectPtr(ret_val);
51002        call_tests++;
51003        des_xmlNodeSetPtr(n_set, set, 0);
51004        xmlResetLastError();
51005        if (mem_base != xmlMemBlocks()) {
51006            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51007	           xmlMemBlocks() - mem_base);
51008	    test_ret++;
51009            printf(" %d", n_set);
51010            printf("\n");
51011        }
51012    }
51013    function_tests++;
51014#endif
51015
51016    return(test_ret);
51017}
51018
51019
51020static int
51021test_xmlXPtrNewLocationSetNodes(void) {
51022    int test_ret = 0;
51023
51024#if defined(LIBXML_XPTR_ENABLED)
51025    int mem_base;
51026    xmlXPathObjectPtr ret_val;
51027    xmlNodePtr start; /* the start NodePtr value */
51028    int n_start;
51029    xmlNodePtr end; /* the end NodePtr value or NULL */
51030    int n_end;
51031
51032    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51033    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51034        mem_base = xmlMemBlocks();
51035        start = gen_xmlNodePtr(n_start, 0);
51036        end = gen_xmlNodePtr(n_end, 1);
51037
51038        ret_val = xmlXPtrNewLocationSetNodes(start, end);
51039        desret_xmlXPathObjectPtr(ret_val);
51040        call_tests++;
51041        des_xmlNodePtr(n_start, start, 0);
51042        des_xmlNodePtr(n_end, end, 1);
51043        xmlResetLastError();
51044        if (mem_base != xmlMemBlocks()) {
51045            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51046	           xmlMemBlocks() - mem_base);
51047	    test_ret++;
51048            printf(" %d", n_start);
51049            printf(" %d", n_end);
51050            printf("\n");
51051        }
51052    }
51053    }
51054    function_tests++;
51055#endif
51056
51057    return(test_ret);
51058}
51059
51060
51061static int
51062test_xmlXPtrNewRange(void) {
51063    int test_ret = 0;
51064
51065#if defined(LIBXML_XPTR_ENABLED)
51066    int mem_base;
51067    xmlXPathObjectPtr ret_val;
51068    xmlNodePtr start; /* the starting node */
51069    int n_start;
51070    int startindex; /* the start index */
51071    int n_startindex;
51072    xmlNodePtr end; /* the ending point */
51073    int n_end;
51074    int endindex; /* the ending index */
51075    int n_endindex;
51076
51077    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51078    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51079    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51080    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51081        mem_base = xmlMemBlocks();
51082        start = gen_xmlNodePtr(n_start, 0);
51083        startindex = gen_int(n_startindex, 1);
51084        end = gen_xmlNodePtr(n_end, 2);
51085        endindex = gen_int(n_endindex, 3);
51086
51087        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51088        desret_xmlXPathObjectPtr(ret_val);
51089        call_tests++;
51090        des_xmlNodePtr(n_start, start, 0);
51091        des_int(n_startindex, startindex, 1);
51092        des_xmlNodePtr(n_end, end, 2);
51093        des_int(n_endindex, endindex, 3);
51094        xmlResetLastError();
51095        if (mem_base != xmlMemBlocks()) {
51096            printf("Leak of %d blocks found in xmlXPtrNewRange",
51097	           xmlMemBlocks() - mem_base);
51098	    test_ret++;
51099            printf(" %d", n_start);
51100            printf(" %d", n_startindex);
51101            printf(" %d", n_end);
51102            printf(" %d", n_endindex);
51103            printf("\n");
51104        }
51105    }
51106    }
51107    }
51108    }
51109    function_tests++;
51110#endif
51111
51112    return(test_ret);
51113}
51114
51115
51116static int
51117test_xmlXPtrNewRangeNodeObject(void) {
51118    int test_ret = 0;
51119
51120#if defined(LIBXML_XPTR_ENABLED)
51121    int mem_base;
51122    xmlXPathObjectPtr ret_val;
51123    xmlNodePtr start; /* the starting node */
51124    int n_start;
51125    xmlXPathObjectPtr end; /* the ending object */
51126    int n_end;
51127
51128    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51129    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51130        mem_base = xmlMemBlocks();
51131        start = gen_xmlNodePtr(n_start, 0);
51132        end = gen_xmlXPathObjectPtr(n_end, 1);
51133
51134        ret_val = xmlXPtrNewRangeNodeObject(start, end);
51135        desret_xmlXPathObjectPtr(ret_val);
51136        call_tests++;
51137        des_xmlNodePtr(n_start, start, 0);
51138        des_xmlXPathObjectPtr(n_end, end, 1);
51139        xmlResetLastError();
51140        if (mem_base != xmlMemBlocks()) {
51141            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51142	           xmlMemBlocks() - mem_base);
51143	    test_ret++;
51144            printf(" %d", n_start);
51145            printf(" %d", n_end);
51146            printf("\n");
51147        }
51148    }
51149    }
51150    function_tests++;
51151#endif
51152
51153    return(test_ret);
51154}
51155
51156
51157static int
51158test_xmlXPtrNewRangeNodePoint(void) {
51159    int test_ret = 0;
51160
51161#if defined(LIBXML_XPTR_ENABLED)
51162    int mem_base;
51163    xmlXPathObjectPtr ret_val;
51164    xmlNodePtr start; /* the starting node */
51165    int n_start;
51166    xmlXPathObjectPtr end; /* the ending point */
51167    int n_end;
51168
51169    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51170    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51171        mem_base = xmlMemBlocks();
51172        start = gen_xmlNodePtr(n_start, 0);
51173        end = gen_xmlXPathObjectPtr(n_end, 1);
51174
51175        ret_val = xmlXPtrNewRangeNodePoint(start, end);
51176        desret_xmlXPathObjectPtr(ret_val);
51177        call_tests++;
51178        des_xmlNodePtr(n_start, start, 0);
51179        des_xmlXPathObjectPtr(n_end, end, 1);
51180        xmlResetLastError();
51181        if (mem_base != xmlMemBlocks()) {
51182            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51183	           xmlMemBlocks() - mem_base);
51184	    test_ret++;
51185            printf(" %d", n_start);
51186            printf(" %d", n_end);
51187            printf("\n");
51188        }
51189    }
51190    }
51191    function_tests++;
51192#endif
51193
51194    return(test_ret);
51195}
51196
51197
51198static int
51199test_xmlXPtrNewRangeNodes(void) {
51200    int test_ret = 0;
51201
51202#if defined(LIBXML_XPTR_ENABLED)
51203    int mem_base;
51204    xmlXPathObjectPtr ret_val;
51205    xmlNodePtr start; /* the starting node */
51206    int n_start;
51207    xmlNodePtr end; /* the ending node */
51208    int n_end;
51209
51210    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51211    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51212        mem_base = xmlMemBlocks();
51213        start = gen_xmlNodePtr(n_start, 0);
51214        end = gen_xmlNodePtr(n_end, 1);
51215
51216        ret_val = xmlXPtrNewRangeNodes(start, end);
51217        desret_xmlXPathObjectPtr(ret_val);
51218        call_tests++;
51219        des_xmlNodePtr(n_start, start, 0);
51220        des_xmlNodePtr(n_end, end, 1);
51221        xmlResetLastError();
51222        if (mem_base != xmlMemBlocks()) {
51223            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51224	           xmlMemBlocks() - mem_base);
51225	    test_ret++;
51226            printf(" %d", n_start);
51227            printf(" %d", n_end);
51228            printf("\n");
51229        }
51230    }
51231    }
51232    function_tests++;
51233#endif
51234
51235    return(test_ret);
51236}
51237
51238
51239static int
51240test_xmlXPtrNewRangePointNode(void) {
51241    int test_ret = 0;
51242
51243#if defined(LIBXML_XPTR_ENABLED)
51244    int mem_base;
51245    xmlXPathObjectPtr ret_val;
51246    xmlXPathObjectPtr start; /* the starting point */
51247    int n_start;
51248    xmlNodePtr end; /* the ending node */
51249    int n_end;
51250
51251    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51252    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51253        mem_base = xmlMemBlocks();
51254        start = gen_xmlXPathObjectPtr(n_start, 0);
51255        end = gen_xmlNodePtr(n_end, 1);
51256
51257        ret_val = xmlXPtrNewRangePointNode(start, end);
51258        desret_xmlXPathObjectPtr(ret_val);
51259        call_tests++;
51260        des_xmlXPathObjectPtr(n_start, start, 0);
51261        des_xmlNodePtr(n_end, end, 1);
51262        xmlResetLastError();
51263        if (mem_base != xmlMemBlocks()) {
51264            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51265	           xmlMemBlocks() - mem_base);
51266	    test_ret++;
51267            printf(" %d", n_start);
51268            printf(" %d", n_end);
51269            printf("\n");
51270        }
51271    }
51272    }
51273    function_tests++;
51274#endif
51275
51276    return(test_ret);
51277}
51278
51279
51280static int
51281test_xmlXPtrNewRangePoints(void) {
51282    int test_ret = 0;
51283
51284#if defined(LIBXML_XPTR_ENABLED)
51285    int mem_base;
51286    xmlXPathObjectPtr ret_val;
51287    xmlXPathObjectPtr start; /* the starting point */
51288    int n_start;
51289    xmlXPathObjectPtr end; /* the ending point */
51290    int n_end;
51291
51292    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51293    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51294        mem_base = xmlMemBlocks();
51295        start = gen_xmlXPathObjectPtr(n_start, 0);
51296        end = gen_xmlXPathObjectPtr(n_end, 1);
51297
51298        ret_val = xmlXPtrNewRangePoints(start, end);
51299        desret_xmlXPathObjectPtr(ret_val);
51300        call_tests++;
51301        des_xmlXPathObjectPtr(n_start, start, 0);
51302        des_xmlXPathObjectPtr(n_end, end, 1);
51303        xmlResetLastError();
51304        if (mem_base != xmlMemBlocks()) {
51305            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51306	           xmlMemBlocks() - mem_base);
51307	    test_ret++;
51308            printf(" %d", n_start);
51309            printf(" %d", n_end);
51310            printf("\n");
51311        }
51312    }
51313    }
51314    function_tests++;
51315#endif
51316
51317    return(test_ret);
51318}
51319
51320
51321static int
51322test_xmlXPtrRangeToFunction(void) {
51323    int test_ret = 0;
51324
51325#if defined(LIBXML_XPTR_ENABLED)
51326    int mem_base;
51327    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51328    int n_ctxt;
51329    int nargs; /* the number of args */
51330    int n_nargs;
51331
51332    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51333    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51334        mem_base = xmlMemBlocks();
51335        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51336        nargs = gen_int(n_nargs, 1);
51337
51338        xmlXPtrRangeToFunction(ctxt, nargs);
51339        call_tests++;
51340        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51341        des_int(n_nargs, nargs, 1);
51342        xmlResetLastError();
51343        if (mem_base != xmlMemBlocks()) {
51344            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51345	           xmlMemBlocks() - mem_base);
51346	    test_ret++;
51347            printf(" %d", n_ctxt);
51348            printf(" %d", n_nargs);
51349            printf("\n");
51350        }
51351    }
51352    }
51353    function_tests++;
51354#endif
51355
51356    return(test_ret);
51357}
51358
51359
51360static int
51361test_xmlXPtrWrapLocationSet(void) {
51362    int test_ret = 0;
51363
51364#if defined(LIBXML_XPTR_ENABLED)
51365    int mem_base;
51366    xmlXPathObjectPtr ret_val;
51367    xmlLocationSetPtr val; /* the LocationSet value */
51368    int n_val;
51369
51370    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51371        mem_base = xmlMemBlocks();
51372        val = gen_xmlLocationSetPtr(n_val, 0);
51373
51374        ret_val = xmlXPtrWrapLocationSet(val);
51375        desret_xmlXPathObjectPtr(ret_val);
51376        call_tests++;
51377        des_xmlLocationSetPtr(n_val, val, 0);
51378        xmlResetLastError();
51379        if (mem_base != xmlMemBlocks()) {
51380            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51381	           xmlMemBlocks() - mem_base);
51382	    test_ret++;
51383            printf(" %d", n_val);
51384            printf("\n");
51385        }
51386    }
51387    function_tests++;
51388#endif
51389
51390    return(test_ret);
51391}
51392
51393static int
51394test_xpointer(void) {
51395    int test_ret = 0;
51396
51397    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51398    test_ret += test_xmlXPtrBuildNodeList();
51399    test_ret += test_xmlXPtrEval();
51400    test_ret += test_xmlXPtrEvalRangePredicate();
51401    test_ret += test_xmlXPtrLocationSetAdd();
51402    test_ret += test_xmlXPtrLocationSetCreate();
51403    test_ret += test_xmlXPtrLocationSetDel();
51404    test_ret += test_xmlXPtrLocationSetMerge();
51405    test_ret += test_xmlXPtrLocationSetRemove();
51406    test_ret += test_xmlXPtrNewCollapsedRange();
51407    test_ret += test_xmlXPtrNewContext();
51408    test_ret += test_xmlXPtrNewLocationSetNodeSet();
51409    test_ret += test_xmlXPtrNewLocationSetNodes();
51410    test_ret += test_xmlXPtrNewRange();
51411    test_ret += test_xmlXPtrNewRangeNodeObject();
51412    test_ret += test_xmlXPtrNewRangeNodePoint();
51413    test_ret += test_xmlXPtrNewRangeNodes();
51414    test_ret += test_xmlXPtrNewRangePointNode();
51415    test_ret += test_xmlXPtrNewRangePoints();
51416    test_ret += test_xmlXPtrRangeToFunction();
51417    test_ret += test_xmlXPtrWrapLocationSet();
51418
51419    if (test_ret != 0)
51420	printf("Module xpointer: %d errors\n", test_ret);
51421    return(test_ret);
51422}
51423static int
51424test_module(const char *module) {
51425    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51426    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51427    if (!strcmp(module, "SAX2")) return(test_SAX2());
51428    if (!strcmp(module, "c14n")) return(test_c14n());
51429    if (!strcmp(module, "catalog")) return(test_catalog());
51430    if (!strcmp(module, "chvalid")) return(test_chvalid());
51431    if (!strcmp(module, "debugXML")) return(test_debugXML());
51432    if (!strcmp(module, "dict")) return(test_dict());
51433    if (!strcmp(module, "encoding")) return(test_encoding());
51434    if (!strcmp(module, "entities")) return(test_entities());
51435    if (!strcmp(module, "hash")) return(test_hash());
51436    if (!strcmp(module, "list")) return(test_list());
51437    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51438    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51439    if (!strcmp(module, "parser")) return(test_parser());
51440    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51441    if (!strcmp(module, "pattern")) return(test_pattern());
51442    if (!strcmp(module, "relaxng")) return(test_relaxng());
51443    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51444    if (!strcmp(module, "schematron")) return(test_schematron());
51445    if (!strcmp(module, "tree")) return(test_tree());
51446    if (!strcmp(module, "uri")) return(test_uri());
51447    if (!strcmp(module, "valid")) return(test_valid());
51448    if (!strcmp(module, "xinclude")) return(test_xinclude());
51449    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51450    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51451    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51452    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51453    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51454    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51455    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51456    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51457    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51458    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51459    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51460    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51461    if (!strcmp(module, "xpath")) return(test_xpath());
51462    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51463    if (!strcmp(module, "xpointer")) return(test_xpointer());
51464    return(0);
51465}
51466