testapi.c revision 28b7b4bd80e0c4b9b04e0f68f0cff563c6560cc3
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    int ret_val;
16363    xmlParserCtxtPtr ctxt; /* an XML parser context */
16364    int n_ctxt;
16365    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16366    int n_input;
16367
16368    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16369    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16370        mem_base = xmlMemBlocks();
16371        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16372        input = gen_xmlParserInputPtr(n_input, 1);
16373
16374        ret_val = xmlPushInput(ctxt, input);
16375        desret_int(ret_val);
16376        call_tests++;
16377        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16378        des_xmlParserInputPtr(n_input, input, 1);
16379        xmlResetLastError();
16380        if (mem_base != xmlMemBlocks()) {
16381            printf("Leak of %d blocks found in xmlPushInput",
16382	           xmlMemBlocks() - mem_base);
16383	    test_ret++;
16384            printf(" %d", n_ctxt);
16385            printf(" %d", n_input);
16386            printf("\n");
16387        }
16388    }
16389    }
16390    function_tests++;
16391
16392    return(test_ret);
16393}
16394
16395
16396static int
16397test_xmlSetEntityReferenceFunc(void) {
16398    int test_ret = 0;
16399
16400
16401    /* missing type support */
16402    return(test_ret);
16403}
16404
16405
16406static int
16407test_xmlSplitQName(void) {
16408    int test_ret = 0;
16409
16410    int mem_base;
16411    xmlChar * ret_val;
16412    xmlParserCtxtPtr ctxt; /* an XML parser context */
16413    int n_ctxt;
16414    xmlChar * name; /* an XML parser context */
16415    int n_name;
16416    xmlChar ** prefix; /* a xmlChar ** */
16417    int n_prefix;
16418
16419    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16420    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16421    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16422        mem_base = xmlMemBlocks();
16423        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16424        name = gen_const_xmlChar_ptr(n_name, 1);
16425        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16426
16427        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16428        desret_xmlChar_ptr(ret_val);
16429        call_tests++;
16430        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16431        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16432        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16433        xmlResetLastError();
16434        if (mem_base != xmlMemBlocks()) {
16435            printf("Leak of %d blocks found in xmlSplitQName",
16436	           xmlMemBlocks() - mem_base);
16437	    test_ret++;
16438            printf(" %d", n_ctxt);
16439            printf(" %d", n_name);
16440            printf(" %d", n_prefix);
16441            printf("\n");
16442        }
16443    }
16444    }
16445    }
16446    function_tests++;
16447
16448    return(test_ret);
16449}
16450
16451
16452static int
16453test_xmlStringCurrentChar(void) {
16454    int test_ret = 0;
16455
16456    int mem_base;
16457    int ret_val;
16458    xmlParserCtxtPtr ctxt; /* the XML parser context */
16459    int n_ctxt;
16460    xmlChar * cur; /* pointer to the beginning of the char */
16461    int n_cur;
16462    int * len; /* pointer to the length of the char read */
16463    int n_len;
16464
16465    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16466    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16467    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16468        mem_base = xmlMemBlocks();
16469        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16470        cur = gen_const_xmlChar_ptr(n_cur, 1);
16471        len = gen_int_ptr(n_len, 2);
16472
16473        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16474        desret_int(ret_val);
16475        call_tests++;
16476        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16477        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16478        des_int_ptr(n_len, len, 2);
16479        xmlResetLastError();
16480        if (mem_base != xmlMemBlocks()) {
16481            printf("Leak of %d blocks found in xmlStringCurrentChar",
16482	           xmlMemBlocks() - mem_base);
16483	    test_ret++;
16484            printf(" %d", n_ctxt);
16485            printf(" %d", n_cur);
16486            printf(" %d", n_len);
16487            printf("\n");
16488        }
16489    }
16490    }
16491    }
16492    function_tests++;
16493
16494    return(test_ret);
16495}
16496
16497
16498static int
16499test_xmlStringDecodeEntities(void) {
16500    int test_ret = 0;
16501
16502    int mem_base;
16503    xmlChar * ret_val;
16504    xmlParserCtxtPtr ctxt; /* the parser context */
16505    int n_ctxt;
16506    xmlChar * str; /* the input string */
16507    int n_str;
16508    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16509    int n_what;
16510    xmlChar end; /* an end marker xmlChar, 0 if none */
16511    int n_end;
16512    xmlChar end2; /* an end marker xmlChar, 0 if none */
16513    int n_end2;
16514    xmlChar end3; /* an end marker xmlChar, 0 if none */
16515    int n_end3;
16516
16517    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16518    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16519    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16520    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16521    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16522    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16523        mem_base = xmlMemBlocks();
16524        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16525        str = gen_const_xmlChar_ptr(n_str, 1);
16526        what = gen_int(n_what, 2);
16527        end = gen_xmlChar(n_end, 3);
16528        end2 = gen_xmlChar(n_end2, 4);
16529        end3 = gen_xmlChar(n_end3, 5);
16530
16531        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16532        desret_xmlChar_ptr(ret_val);
16533        call_tests++;
16534        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16535        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16536        des_int(n_what, what, 2);
16537        des_xmlChar(n_end, end, 3);
16538        des_xmlChar(n_end2, end2, 4);
16539        des_xmlChar(n_end3, end3, 5);
16540        xmlResetLastError();
16541        if (mem_base != xmlMemBlocks()) {
16542            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16543	           xmlMemBlocks() - mem_base);
16544	    test_ret++;
16545            printf(" %d", n_ctxt);
16546            printf(" %d", n_str);
16547            printf(" %d", n_what);
16548            printf(" %d", n_end);
16549            printf(" %d", n_end2);
16550            printf(" %d", n_end3);
16551            printf("\n");
16552        }
16553    }
16554    }
16555    }
16556    }
16557    }
16558    }
16559    function_tests++;
16560
16561    return(test_ret);
16562}
16563
16564
16565static int
16566test_xmlStringLenDecodeEntities(void) {
16567    int test_ret = 0;
16568
16569    int mem_base;
16570    xmlChar * ret_val;
16571    xmlParserCtxtPtr ctxt; /* the parser context */
16572    int n_ctxt;
16573    xmlChar * str; /* the input string */
16574    int n_str;
16575    int len; /* the string length */
16576    int n_len;
16577    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16578    int n_what;
16579    xmlChar end; /* an end marker xmlChar, 0 if none */
16580    int n_end;
16581    xmlChar end2; /* an end marker xmlChar, 0 if none */
16582    int n_end2;
16583    xmlChar end3; /* an end marker xmlChar, 0 if none */
16584    int n_end3;
16585
16586    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16587    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16588    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16589    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16590    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16591    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16592    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16593        mem_base = xmlMemBlocks();
16594        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16595        str = gen_const_xmlChar_ptr(n_str, 1);
16596        len = gen_int(n_len, 2);
16597        what = gen_int(n_what, 3);
16598        end = gen_xmlChar(n_end, 4);
16599        end2 = gen_xmlChar(n_end2, 5);
16600        end3 = gen_xmlChar(n_end3, 6);
16601
16602        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16603        desret_xmlChar_ptr(ret_val);
16604        call_tests++;
16605        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16606        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16607        des_int(n_len, len, 2);
16608        des_int(n_what, what, 3);
16609        des_xmlChar(n_end, end, 4);
16610        des_xmlChar(n_end2, end2, 5);
16611        des_xmlChar(n_end3, end3, 6);
16612        xmlResetLastError();
16613        if (mem_base != xmlMemBlocks()) {
16614            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16615	           xmlMemBlocks() - mem_base);
16616	    test_ret++;
16617            printf(" %d", n_ctxt);
16618            printf(" %d", n_str);
16619            printf(" %d", n_len);
16620            printf(" %d", n_what);
16621            printf(" %d", n_end);
16622            printf(" %d", n_end2);
16623            printf(" %d", n_end3);
16624            printf("\n");
16625        }
16626    }
16627    }
16628    }
16629    }
16630    }
16631    }
16632    }
16633    function_tests++;
16634
16635    return(test_ret);
16636}
16637
16638
16639static int
16640test_xmlSwitchEncoding(void) {
16641    int test_ret = 0;
16642
16643    int mem_base;
16644    int ret_val;
16645    xmlParserCtxtPtr ctxt; /* the parser context */
16646    int n_ctxt;
16647    xmlCharEncoding enc; /* the encoding value (number) */
16648    int n_enc;
16649
16650    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16651    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16652        mem_base = xmlMemBlocks();
16653        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16654        enc = gen_xmlCharEncoding(n_enc, 1);
16655
16656        ret_val = xmlSwitchEncoding(ctxt, enc);
16657        desret_int(ret_val);
16658        call_tests++;
16659        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16660        des_xmlCharEncoding(n_enc, enc, 1);
16661        xmlResetLastError();
16662        if (mem_base != xmlMemBlocks()) {
16663            printf("Leak of %d blocks found in xmlSwitchEncoding",
16664	           xmlMemBlocks() - mem_base);
16665	    test_ret++;
16666            printf(" %d", n_ctxt);
16667            printf(" %d", n_enc);
16668            printf("\n");
16669        }
16670    }
16671    }
16672    function_tests++;
16673
16674    return(test_ret);
16675}
16676
16677
16678static int
16679test_xmlSwitchInputEncoding(void) {
16680    int test_ret = 0;
16681
16682    int mem_base;
16683    int ret_val;
16684    xmlParserCtxtPtr ctxt; /* the parser context */
16685    int n_ctxt;
16686    xmlParserInputPtr input; /* the input stream */
16687    int n_input;
16688    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16689    int n_handler;
16690
16691    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16692    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16693    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16694        mem_base = xmlMemBlocks();
16695        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16696        input = gen_xmlParserInputPtr(n_input, 1);
16697        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16698
16699        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16700        desret_int(ret_val);
16701        call_tests++;
16702        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16703        des_xmlParserInputPtr(n_input, input, 1);
16704        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16705        xmlResetLastError();
16706        if (mem_base != xmlMemBlocks()) {
16707            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16708	           xmlMemBlocks() - mem_base);
16709	    test_ret++;
16710            printf(" %d", n_ctxt);
16711            printf(" %d", n_input);
16712            printf(" %d", n_handler);
16713            printf("\n");
16714        }
16715    }
16716    }
16717    }
16718    function_tests++;
16719
16720    return(test_ret);
16721}
16722
16723
16724static int
16725test_xmlSwitchToEncoding(void) {
16726    int test_ret = 0;
16727
16728    int mem_base;
16729    int ret_val;
16730    xmlParserCtxtPtr ctxt; /* the parser context */
16731    int n_ctxt;
16732    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16733    int n_handler;
16734
16735    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16736    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16737        mem_base = xmlMemBlocks();
16738        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16739        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16740
16741        ret_val = xmlSwitchToEncoding(ctxt, handler);
16742        desret_int(ret_val);
16743        call_tests++;
16744        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16745        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16746        xmlResetLastError();
16747        if (mem_base != xmlMemBlocks()) {
16748            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16749	           xmlMemBlocks() - mem_base);
16750	    test_ret++;
16751            printf(" %d", n_ctxt);
16752            printf(" %d", n_handler);
16753            printf("\n");
16754        }
16755    }
16756    }
16757    function_tests++;
16758
16759    return(test_ret);
16760}
16761
16762static int
16763test_parserInternals(void) {
16764    int test_ret = 0;
16765
16766    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16767    test_ret += test_htmlCreateFileParserCtxt();
16768    test_ret += test_htmlInitAutoClose();
16769    test_ret += test_inputPop();
16770    test_ret += test_inputPush();
16771    test_ret += test_namePop();
16772    test_ret += test_namePush();
16773    test_ret += test_nodePop();
16774    test_ret += test_nodePush();
16775    test_ret += test_xmlCheckLanguageID();
16776    test_ret += test_xmlCopyChar();
16777    test_ret += test_xmlCopyCharMultiByte();
16778    test_ret += test_xmlCreateEntityParserCtxt();
16779    test_ret += test_xmlCreateFileParserCtxt();
16780    test_ret += test_xmlCreateMemoryParserCtxt();
16781    test_ret += test_xmlCreateURLParserCtxt();
16782    test_ret += test_xmlCurrentChar();
16783    test_ret += test_xmlErrMemory();
16784    test_ret += test_xmlIsLetter();
16785    test_ret += test_xmlNewEntityInputStream();
16786    test_ret += test_xmlNewInputFromFile();
16787    test_ret += test_xmlNewInputStream();
16788    test_ret += test_xmlNewStringInputStream();
16789    test_ret += test_xmlNextChar();
16790    test_ret += test_xmlParserInputShrink();
16791    test_ret += test_xmlPopInput();
16792    test_ret += test_xmlPushInput();
16793    test_ret += test_xmlSetEntityReferenceFunc();
16794    test_ret += test_xmlSplitQName();
16795    test_ret += test_xmlStringCurrentChar();
16796    test_ret += test_xmlStringDecodeEntities();
16797    test_ret += test_xmlStringLenDecodeEntities();
16798    test_ret += test_xmlSwitchEncoding();
16799    test_ret += test_xmlSwitchInputEncoding();
16800    test_ret += test_xmlSwitchToEncoding();
16801
16802    if (test_ret != 0)
16803	printf("Module parserInternals: %d errors\n", test_ret);
16804    return(test_ret);
16805}
16806
16807static int
16808test_xmlPatternFromRoot(void) {
16809    int test_ret = 0;
16810
16811#if defined(LIBXML_PATTERN_ENABLED)
16812    int mem_base;
16813    int ret_val;
16814    xmlPatternPtr comp; /* the precompiled pattern */
16815    int n_comp;
16816
16817    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16818        mem_base = xmlMemBlocks();
16819        comp = gen_xmlPatternPtr(n_comp, 0);
16820
16821        ret_val = xmlPatternFromRoot(comp);
16822        desret_int(ret_val);
16823        call_tests++;
16824        des_xmlPatternPtr(n_comp, comp, 0);
16825        xmlResetLastError();
16826        if (mem_base != xmlMemBlocks()) {
16827            printf("Leak of %d blocks found in xmlPatternFromRoot",
16828	           xmlMemBlocks() - mem_base);
16829	    test_ret++;
16830            printf(" %d", n_comp);
16831            printf("\n");
16832        }
16833    }
16834    function_tests++;
16835#endif
16836
16837    return(test_ret);
16838}
16839
16840
16841static int
16842test_xmlPatternGetStreamCtxt(void) {
16843    int test_ret = 0;
16844
16845
16846    /* missing type support */
16847    return(test_ret);
16848}
16849
16850
16851static int
16852test_xmlPatternMatch(void) {
16853    int test_ret = 0;
16854
16855#if defined(LIBXML_PATTERN_ENABLED)
16856    int mem_base;
16857    int ret_val;
16858    xmlPatternPtr comp; /* the precompiled pattern */
16859    int n_comp;
16860    xmlNodePtr node; /* a node */
16861    int n_node;
16862
16863    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16864    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16865        mem_base = xmlMemBlocks();
16866        comp = gen_xmlPatternPtr(n_comp, 0);
16867        node = gen_xmlNodePtr(n_node, 1);
16868
16869        ret_val = xmlPatternMatch(comp, node);
16870        desret_int(ret_val);
16871        call_tests++;
16872        des_xmlPatternPtr(n_comp, comp, 0);
16873        des_xmlNodePtr(n_node, node, 1);
16874        xmlResetLastError();
16875        if (mem_base != xmlMemBlocks()) {
16876            printf("Leak of %d blocks found in xmlPatternMatch",
16877	           xmlMemBlocks() - mem_base);
16878	    test_ret++;
16879            printf(" %d", n_comp);
16880            printf(" %d", n_node);
16881            printf("\n");
16882        }
16883    }
16884    }
16885    function_tests++;
16886#endif
16887
16888    return(test_ret);
16889}
16890
16891
16892static int
16893test_xmlPatternMaxDepth(void) {
16894    int test_ret = 0;
16895
16896#if defined(LIBXML_PATTERN_ENABLED)
16897    int mem_base;
16898    int ret_val;
16899    xmlPatternPtr comp; /* the precompiled pattern */
16900    int n_comp;
16901
16902    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16903        mem_base = xmlMemBlocks();
16904        comp = gen_xmlPatternPtr(n_comp, 0);
16905
16906        ret_val = xmlPatternMaxDepth(comp);
16907        desret_int(ret_val);
16908        call_tests++;
16909        des_xmlPatternPtr(n_comp, comp, 0);
16910        xmlResetLastError();
16911        if (mem_base != xmlMemBlocks()) {
16912            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16913	           xmlMemBlocks() - mem_base);
16914	    test_ret++;
16915            printf(" %d", n_comp);
16916            printf("\n");
16917        }
16918    }
16919    function_tests++;
16920#endif
16921
16922    return(test_ret);
16923}
16924
16925
16926static int
16927test_xmlPatternMinDepth(void) {
16928    int test_ret = 0;
16929
16930#if defined(LIBXML_PATTERN_ENABLED)
16931    int mem_base;
16932    int ret_val;
16933    xmlPatternPtr comp; /* the precompiled pattern */
16934    int n_comp;
16935
16936    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16937        mem_base = xmlMemBlocks();
16938        comp = gen_xmlPatternPtr(n_comp, 0);
16939
16940        ret_val = xmlPatternMinDepth(comp);
16941        desret_int(ret_val);
16942        call_tests++;
16943        des_xmlPatternPtr(n_comp, comp, 0);
16944        xmlResetLastError();
16945        if (mem_base != xmlMemBlocks()) {
16946            printf("Leak of %d blocks found in xmlPatternMinDepth",
16947	           xmlMemBlocks() - mem_base);
16948	    test_ret++;
16949            printf(" %d", n_comp);
16950            printf("\n");
16951        }
16952    }
16953    function_tests++;
16954#endif
16955
16956    return(test_ret);
16957}
16958
16959
16960static int
16961test_xmlPatternStreamable(void) {
16962    int test_ret = 0;
16963
16964#if defined(LIBXML_PATTERN_ENABLED)
16965    int mem_base;
16966    int ret_val;
16967    xmlPatternPtr comp; /* the precompiled pattern */
16968    int n_comp;
16969
16970    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16971        mem_base = xmlMemBlocks();
16972        comp = gen_xmlPatternPtr(n_comp, 0);
16973
16974        ret_val = xmlPatternStreamable(comp);
16975        desret_int(ret_val);
16976        call_tests++;
16977        des_xmlPatternPtr(n_comp, comp, 0);
16978        xmlResetLastError();
16979        if (mem_base != xmlMemBlocks()) {
16980            printf("Leak of %d blocks found in xmlPatternStreamable",
16981	           xmlMemBlocks() - mem_base);
16982	    test_ret++;
16983            printf(" %d", n_comp);
16984            printf("\n");
16985        }
16986    }
16987    function_tests++;
16988#endif
16989
16990    return(test_ret);
16991}
16992
16993
16994static int
16995test_xmlPatterncompile(void) {
16996    int test_ret = 0;
16997
16998
16999    /* missing type support */
17000    return(test_ret);
17001}
17002
17003#ifdef LIBXML_PATTERN_ENABLED
17004
17005#define gen_nb_xmlStreamCtxtPtr 1
17006static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17007    return(NULL);
17008}
17009static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17010}
17011#endif
17012
17013
17014static int
17015test_xmlStreamPop(void) {
17016    int test_ret = 0;
17017
17018#if defined(LIBXML_PATTERN_ENABLED)
17019    int mem_base;
17020    int ret_val;
17021    xmlStreamCtxtPtr stream; /* the stream context */
17022    int n_stream;
17023
17024    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17025        mem_base = xmlMemBlocks();
17026        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17027
17028        ret_val = xmlStreamPop(stream);
17029        desret_int(ret_val);
17030        call_tests++;
17031        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17032        xmlResetLastError();
17033        if (mem_base != xmlMemBlocks()) {
17034            printf("Leak of %d blocks found in xmlStreamPop",
17035	           xmlMemBlocks() - mem_base);
17036	    test_ret++;
17037            printf(" %d", n_stream);
17038            printf("\n");
17039        }
17040    }
17041    function_tests++;
17042#endif
17043
17044    return(test_ret);
17045}
17046
17047
17048static int
17049test_xmlStreamPush(void) {
17050    int test_ret = 0;
17051
17052#if defined(LIBXML_PATTERN_ENABLED)
17053    int mem_base;
17054    int ret_val;
17055    xmlStreamCtxtPtr stream; /* the stream context */
17056    int n_stream;
17057    xmlChar * name; /* the current name */
17058    int n_name;
17059    xmlChar * ns; /* the namespace name */
17060    int n_ns;
17061
17062    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17063    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17064    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17065        mem_base = xmlMemBlocks();
17066        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17067        name = gen_const_xmlChar_ptr(n_name, 1);
17068        ns = gen_const_xmlChar_ptr(n_ns, 2);
17069
17070        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17071        desret_int(ret_val);
17072        call_tests++;
17073        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17074        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17075        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17076        xmlResetLastError();
17077        if (mem_base != xmlMemBlocks()) {
17078            printf("Leak of %d blocks found in xmlStreamPush",
17079	           xmlMemBlocks() - mem_base);
17080	    test_ret++;
17081            printf(" %d", n_stream);
17082            printf(" %d", n_name);
17083            printf(" %d", n_ns);
17084            printf("\n");
17085        }
17086    }
17087    }
17088    }
17089    function_tests++;
17090#endif
17091
17092    return(test_ret);
17093}
17094
17095
17096static int
17097test_xmlStreamPushAttr(void) {
17098    int test_ret = 0;
17099
17100#if defined(LIBXML_PATTERN_ENABLED)
17101    int mem_base;
17102    int ret_val;
17103    xmlStreamCtxtPtr stream; /* the stream context */
17104    int n_stream;
17105    xmlChar * name; /* the current name */
17106    int n_name;
17107    xmlChar * ns; /* the namespace name */
17108    int n_ns;
17109
17110    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17111    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17112    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17113        mem_base = xmlMemBlocks();
17114        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17115        name = gen_const_xmlChar_ptr(n_name, 1);
17116        ns = gen_const_xmlChar_ptr(n_ns, 2);
17117
17118        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17119        desret_int(ret_val);
17120        call_tests++;
17121        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17122        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17123        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17124        xmlResetLastError();
17125        if (mem_base != xmlMemBlocks()) {
17126            printf("Leak of %d blocks found in xmlStreamPushAttr",
17127	           xmlMemBlocks() - mem_base);
17128	    test_ret++;
17129            printf(" %d", n_stream);
17130            printf(" %d", n_name);
17131            printf(" %d", n_ns);
17132            printf("\n");
17133        }
17134    }
17135    }
17136    }
17137    function_tests++;
17138#endif
17139
17140    return(test_ret);
17141}
17142
17143
17144static int
17145test_xmlStreamPushNode(void) {
17146    int test_ret = 0;
17147
17148#if defined(LIBXML_PATTERN_ENABLED)
17149    int mem_base;
17150    int ret_val;
17151    xmlStreamCtxtPtr stream; /* the stream context */
17152    int n_stream;
17153    xmlChar * name; /* the current name */
17154    int n_name;
17155    xmlChar * ns; /* the namespace name */
17156    int n_ns;
17157    int nodeType; /* the type of the node being pushed */
17158    int n_nodeType;
17159
17160    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17161    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17162    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17163    for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17164        mem_base = xmlMemBlocks();
17165        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17166        name = gen_const_xmlChar_ptr(n_name, 1);
17167        ns = gen_const_xmlChar_ptr(n_ns, 2);
17168        nodeType = gen_int(n_nodeType, 3);
17169
17170        ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17171        desret_int(ret_val);
17172        call_tests++;
17173        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17174        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17175        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17176        des_int(n_nodeType, nodeType, 3);
17177        xmlResetLastError();
17178        if (mem_base != xmlMemBlocks()) {
17179            printf("Leak of %d blocks found in xmlStreamPushNode",
17180	           xmlMemBlocks() - mem_base);
17181	    test_ret++;
17182            printf(" %d", n_stream);
17183            printf(" %d", n_name);
17184            printf(" %d", n_ns);
17185            printf(" %d", n_nodeType);
17186            printf("\n");
17187        }
17188    }
17189    }
17190    }
17191    }
17192    function_tests++;
17193#endif
17194
17195    return(test_ret);
17196}
17197
17198
17199static int
17200test_xmlStreamWantsAnyNode(void) {
17201    int test_ret = 0;
17202
17203#if defined(LIBXML_PATTERN_ENABLED)
17204    int mem_base;
17205    int ret_val;
17206    xmlStreamCtxtPtr streamCtxt; /* the stream context */
17207    int n_streamCtxt;
17208
17209    for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17210        mem_base = xmlMemBlocks();
17211        streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17212
17213        ret_val = xmlStreamWantsAnyNode(streamCtxt);
17214        desret_int(ret_val);
17215        call_tests++;
17216        des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17217        xmlResetLastError();
17218        if (mem_base != xmlMemBlocks()) {
17219            printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17220	           xmlMemBlocks() - mem_base);
17221	    test_ret++;
17222            printf(" %d", n_streamCtxt);
17223            printf("\n");
17224        }
17225    }
17226    function_tests++;
17227#endif
17228
17229    return(test_ret);
17230}
17231
17232static int
17233test_pattern(void) {
17234    int test_ret = 0;
17235
17236    if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17237    test_ret += test_xmlPatternFromRoot();
17238    test_ret += test_xmlPatternGetStreamCtxt();
17239    test_ret += test_xmlPatternMatch();
17240    test_ret += test_xmlPatternMaxDepth();
17241    test_ret += test_xmlPatternMinDepth();
17242    test_ret += test_xmlPatternStreamable();
17243    test_ret += test_xmlPatterncompile();
17244    test_ret += test_xmlStreamPop();
17245    test_ret += test_xmlStreamPush();
17246    test_ret += test_xmlStreamPushAttr();
17247    test_ret += test_xmlStreamPushNode();
17248    test_ret += test_xmlStreamWantsAnyNode();
17249
17250    if (test_ret != 0)
17251	printf("Module pattern: %d errors\n", test_ret);
17252    return(test_ret);
17253}
17254#ifdef LIBXML_SCHEMAS_ENABLED
17255
17256#define gen_nb_xmlRelaxNGPtr 1
17257static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17258    return(NULL);
17259}
17260static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17261}
17262#endif
17263
17264
17265static int
17266test_xmlRelaxNGDump(void) {
17267    int test_ret = 0;
17268
17269#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17270    int mem_base;
17271    FILE * output; /* the file output */
17272    int n_output;
17273    xmlRelaxNGPtr schema; /* a schema structure */
17274    int n_schema;
17275
17276    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17277    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17278        mem_base = xmlMemBlocks();
17279        output = gen_FILE_ptr(n_output, 0);
17280        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17281
17282        xmlRelaxNGDump(output, schema);
17283        call_tests++;
17284        des_FILE_ptr(n_output, output, 0);
17285        des_xmlRelaxNGPtr(n_schema, schema, 1);
17286        xmlResetLastError();
17287        if (mem_base != xmlMemBlocks()) {
17288            printf("Leak of %d blocks found in xmlRelaxNGDump",
17289	           xmlMemBlocks() - mem_base);
17290	    test_ret++;
17291            printf(" %d", n_output);
17292            printf(" %d", n_schema);
17293            printf("\n");
17294        }
17295    }
17296    }
17297    function_tests++;
17298#endif
17299
17300    return(test_ret);
17301}
17302
17303
17304static int
17305test_xmlRelaxNGDumpTree(void) {
17306    int test_ret = 0;
17307
17308#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17309    int mem_base;
17310    FILE * output; /* the file output */
17311    int n_output;
17312    xmlRelaxNGPtr schema; /* a schema structure */
17313    int n_schema;
17314
17315    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17316    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17317        mem_base = xmlMemBlocks();
17318        output = gen_FILE_ptr(n_output, 0);
17319        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17320
17321        xmlRelaxNGDumpTree(output, schema);
17322        call_tests++;
17323        des_FILE_ptr(n_output, output, 0);
17324        des_xmlRelaxNGPtr(n_schema, schema, 1);
17325        xmlResetLastError();
17326        if (mem_base != xmlMemBlocks()) {
17327            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17328	           xmlMemBlocks() - mem_base);
17329	    test_ret++;
17330            printf(" %d", n_output);
17331            printf(" %d", n_schema);
17332            printf("\n");
17333        }
17334    }
17335    }
17336    function_tests++;
17337#endif
17338
17339    return(test_ret);
17340}
17341
17342#ifdef LIBXML_SCHEMAS_ENABLED
17343
17344#define gen_nb_xmlRelaxNGParserCtxtPtr 1
17345static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17346    return(NULL);
17347}
17348static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17349}
17350#endif
17351
17352#ifdef LIBXML_SCHEMAS_ENABLED
17353
17354#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17355static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17356    return(NULL);
17357}
17358static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17359}
17360#endif
17361
17362#ifdef LIBXML_SCHEMAS_ENABLED
17363
17364#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17365static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17366    return(NULL);
17367}
17368static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17369}
17370#endif
17371
17372#ifdef LIBXML_SCHEMAS_ENABLED
17373
17374#define gen_nb_void_ptr_ptr 1
17375static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17376    return(NULL);
17377}
17378static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17379}
17380#endif
17381
17382
17383static int
17384test_xmlRelaxNGGetParserErrors(void) {
17385    int test_ret = 0;
17386
17387#if defined(LIBXML_SCHEMAS_ENABLED)
17388    int mem_base;
17389    int ret_val;
17390    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17391    int n_ctxt;
17392    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17393    int n_err;
17394    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17395    int n_warn;
17396    void ** ctx; /* contextual data for the callbacks result */
17397    int n_ctx;
17398
17399    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17400    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17401    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17402    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17403        mem_base = xmlMemBlocks();
17404        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17405        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17406        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17407        ctx = gen_void_ptr_ptr(n_ctx, 3);
17408
17409        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17410        desret_int(ret_val);
17411        call_tests++;
17412        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17413        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17414        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17415        des_void_ptr_ptr(n_ctx, ctx, 3);
17416        xmlResetLastError();
17417        if (mem_base != xmlMemBlocks()) {
17418            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17419	           xmlMemBlocks() - mem_base);
17420	    test_ret++;
17421            printf(" %d", n_ctxt);
17422            printf(" %d", n_err);
17423            printf(" %d", n_warn);
17424            printf(" %d", n_ctx);
17425            printf("\n");
17426        }
17427    }
17428    }
17429    }
17430    }
17431    function_tests++;
17432#endif
17433
17434    return(test_ret);
17435}
17436
17437#ifdef LIBXML_SCHEMAS_ENABLED
17438
17439#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17440static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17441    return(NULL);
17442}
17443static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17444}
17445#endif
17446
17447
17448static int
17449test_xmlRelaxNGGetValidErrors(void) {
17450    int test_ret = 0;
17451
17452#if defined(LIBXML_SCHEMAS_ENABLED)
17453    int mem_base;
17454    int ret_val;
17455    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17456    int n_ctxt;
17457    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17458    int n_err;
17459    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17460    int n_warn;
17461    void ** ctx; /* the functions context result */
17462    int n_ctx;
17463
17464    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17465    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17466    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17467    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17468        mem_base = xmlMemBlocks();
17469        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17470        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17471        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17472        ctx = gen_void_ptr_ptr(n_ctx, 3);
17473
17474        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17475        desret_int(ret_val);
17476        call_tests++;
17477        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17478        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17479        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17480        des_void_ptr_ptr(n_ctx, ctx, 3);
17481        xmlResetLastError();
17482        if (mem_base != xmlMemBlocks()) {
17483            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17484	           xmlMemBlocks() - mem_base);
17485	    test_ret++;
17486            printf(" %d", n_ctxt);
17487            printf(" %d", n_err);
17488            printf(" %d", n_warn);
17489            printf(" %d", n_ctx);
17490            printf("\n");
17491        }
17492    }
17493    }
17494    }
17495    }
17496    function_tests++;
17497#endif
17498
17499    return(test_ret);
17500}
17501
17502
17503static int
17504test_xmlRelaxNGInitTypes(void) {
17505    int test_ret = 0;
17506
17507#if defined(LIBXML_SCHEMAS_ENABLED)
17508    int mem_base;
17509    int ret_val;
17510
17511        mem_base = xmlMemBlocks();
17512
17513        ret_val = xmlRelaxNGInitTypes();
17514        desret_int(ret_val);
17515        call_tests++;
17516        xmlResetLastError();
17517        if (mem_base != xmlMemBlocks()) {
17518            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17519	           xmlMemBlocks() - mem_base);
17520	    test_ret++;
17521            printf("\n");
17522        }
17523    function_tests++;
17524#endif
17525
17526    return(test_ret);
17527}
17528
17529
17530static int
17531test_xmlRelaxNGNewDocParserCtxt(void) {
17532    int test_ret = 0;
17533
17534#if defined(LIBXML_SCHEMAS_ENABLED)
17535    int mem_base;
17536    xmlRelaxNGParserCtxtPtr ret_val;
17537    xmlDocPtr doc; /* a preparsed document tree */
17538    int n_doc;
17539
17540    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17541        mem_base = xmlMemBlocks();
17542        doc = gen_xmlDocPtr(n_doc, 0);
17543
17544        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17545        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17546        call_tests++;
17547        des_xmlDocPtr(n_doc, doc, 0);
17548        xmlResetLastError();
17549        if (mem_base != xmlMemBlocks()) {
17550            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17551	           xmlMemBlocks() - mem_base);
17552	    test_ret++;
17553            printf(" %d", n_doc);
17554            printf("\n");
17555        }
17556    }
17557    function_tests++;
17558#endif
17559
17560    return(test_ret);
17561}
17562
17563
17564static int
17565test_xmlRelaxNGNewMemParserCtxt(void) {
17566    int test_ret = 0;
17567
17568#if defined(LIBXML_SCHEMAS_ENABLED)
17569    int mem_base;
17570    xmlRelaxNGParserCtxtPtr ret_val;
17571    char * buffer; /* a pointer to a char array containing the schemas */
17572    int n_buffer;
17573    int size; /* the size of the array */
17574    int n_size;
17575
17576    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17577    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17578        mem_base = xmlMemBlocks();
17579        buffer = gen_const_char_ptr(n_buffer, 0);
17580        size = gen_int(n_size, 1);
17581
17582        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17583        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17584        call_tests++;
17585        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17586        des_int(n_size, size, 1);
17587        xmlResetLastError();
17588        if (mem_base != xmlMemBlocks()) {
17589            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17590	           xmlMemBlocks() - mem_base);
17591	    test_ret++;
17592            printf(" %d", n_buffer);
17593            printf(" %d", n_size);
17594            printf("\n");
17595        }
17596    }
17597    }
17598    function_tests++;
17599#endif
17600
17601    return(test_ret);
17602}
17603
17604
17605static int
17606test_xmlRelaxNGNewParserCtxt(void) {
17607    int test_ret = 0;
17608
17609#if defined(LIBXML_SCHEMAS_ENABLED)
17610    int mem_base;
17611    xmlRelaxNGParserCtxtPtr ret_val;
17612    char * URL; /* the location of the schema */
17613    int n_URL;
17614
17615    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17616        mem_base = xmlMemBlocks();
17617        URL = gen_const_char_ptr(n_URL, 0);
17618
17619        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17620        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17621        call_tests++;
17622        des_const_char_ptr(n_URL, (const char *)URL, 0);
17623        xmlResetLastError();
17624        if (mem_base != xmlMemBlocks()) {
17625            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17626	           xmlMemBlocks() - mem_base);
17627	    test_ret++;
17628            printf(" %d", n_URL);
17629            printf("\n");
17630        }
17631    }
17632    function_tests++;
17633#endif
17634
17635    return(test_ret);
17636}
17637
17638
17639static int
17640test_xmlRelaxNGNewValidCtxt(void) {
17641    int test_ret = 0;
17642
17643
17644    /* missing type support */
17645    return(test_ret);
17646}
17647
17648
17649static int
17650test_xmlRelaxNGParse(void) {
17651    int test_ret = 0;
17652
17653
17654    /* missing type support */
17655    return(test_ret);
17656}
17657
17658
17659static int
17660test_xmlRelaxNGSetParserErrors(void) {
17661    int test_ret = 0;
17662
17663
17664    /* missing type support */
17665    return(test_ret);
17666}
17667
17668
17669static int
17670test_xmlRelaxNGSetParserStructuredErrors(void) {
17671    int test_ret = 0;
17672
17673
17674    /* missing type support */
17675    return(test_ret);
17676}
17677
17678
17679static int
17680test_xmlRelaxNGSetValidErrors(void) {
17681    int test_ret = 0;
17682
17683
17684    /* missing type support */
17685    return(test_ret);
17686}
17687
17688
17689static int
17690test_xmlRelaxNGSetValidStructuredErrors(void) {
17691    int test_ret = 0;
17692
17693
17694    /* missing type support */
17695    return(test_ret);
17696}
17697
17698
17699static int
17700test_xmlRelaxNGValidateDoc(void) {
17701    int test_ret = 0;
17702
17703#if defined(LIBXML_SCHEMAS_ENABLED)
17704    int mem_base;
17705    int ret_val;
17706    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17707    int n_ctxt;
17708    xmlDocPtr doc; /* a parsed document tree */
17709    int n_doc;
17710
17711    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17712    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17713        mem_base = xmlMemBlocks();
17714        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17715        doc = gen_xmlDocPtr(n_doc, 1);
17716
17717        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17718        desret_int(ret_val);
17719        call_tests++;
17720        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17721        des_xmlDocPtr(n_doc, doc, 1);
17722        xmlResetLastError();
17723        if (mem_base != xmlMemBlocks()) {
17724            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17725	           xmlMemBlocks() - mem_base);
17726	    test_ret++;
17727            printf(" %d", n_ctxt);
17728            printf(" %d", n_doc);
17729            printf("\n");
17730        }
17731    }
17732    }
17733    function_tests++;
17734#endif
17735
17736    return(test_ret);
17737}
17738
17739
17740static int
17741test_xmlRelaxNGValidateFullElement(void) {
17742    int test_ret = 0;
17743
17744#if defined(LIBXML_SCHEMAS_ENABLED)
17745    int mem_base;
17746    int ret_val;
17747    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17748    int n_ctxt;
17749    xmlDocPtr doc; /* a document instance */
17750    int n_doc;
17751    xmlNodePtr elem; /* an element instance */
17752    int n_elem;
17753
17754    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17755    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17756    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17757        mem_base = xmlMemBlocks();
17758        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17759        doc = gen_xmlDocPtr(n_doc, 1);
17760        elem = gen_xmlNodePtr(n_elem, 2);
17761
17762        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17763        desret_int(ret_val);
17764        call_tests++;
17765        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17766        des_xmlDocPtr(n_doc, doc, 1);
17767        des_xmlNodePtr(n_elem, elem, 2);
17768        xmlResetLastError();
17769        if (mem_base != xmlMemBlocks()) {
17770            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17771	           xmlMemBlocks() - mem_base);
17772	    test_ret++;
17773            printf(" %d", n_ctxt);
17774            printf(" %d", n_doc);
17775            printf(" %d", n_elem);
17776            printf("\n");
17777        }
17778    }
17779    }
17780    }
17781    function_tests++;
17782#endif
17783
17784    return(test_ret);
17785}
17786
17787
17788static int
17789test_xmlRelaxNGValidatePopElement(void) {
17790    int test_ret = 0;
17791
17792#if defined(LIBXML_SCHEMAS_ENABLED)
17793    int mem_base;
17794    int ret_val;
17795    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17796    int n_ctxt;
17797    xmlDocPtr doc; /* a document instance */
17798    int n_doc;
17799    xmlNodePtr elem; /* an element instance */
17800    int n_elem;
17801
17802    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17803    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17804    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17805        mem_base = xmlMemBlocks();
17806        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17807        doc = gen_xmlDocPtr(n_doc, 1);
17808        elem = gen_xmlNodePtr(n_elem, 2);
17809
17810        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17811        desret_int(ret_val);
17812        call_tests++;
17813        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17814        des_xmlDocPtr(n_doc, doc, 1);
17815        des_xmlNodePtr(n_elem, elem, 2);
17816        xmlResetLastError();
17817        if (mem_base != xmlMemBlocks()) {
17818            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17819	           xmlMemBlocks() - mem_base);
17820	    test_ret++;
17821            printf(" %d", n_ctxt);
17822            printf(" %d", n_doc);
17823            printf(" %d", n_elem);
17824            printf("\n");
17825        }
17826    }
17827    }
17828    }
17829    function_tests++;
17830#endif
17831
17832    return(test_ret);
17833}
17834
17835
17836static int
17837test_xmlRelaxNGValidatePushCData(void) {
17838    int test_ret = 0;
17839
17840#if defined(LIBXML_SCHEMAS_ENABLED)
17841    int mem_base;
17842    int ret_val;
17843    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17844    int n_ctxt;
17845    xmlChar * data; /* some character data read */
17846    int n_data;
17847    int len; /* the lenght of the data */
17848    int n_len;
17849
17850    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17851    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17852    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17853        mem_base = xmlMemBlocks();
17854        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17855        data = gen_const_xmlChar_ptr(n_data, 1);
17856        len = gen_int(n_len, 2);
17857
17858        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17859        desret_int(ret_val);
17860        call_tests++;
17861        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17862        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17863        des_int(n_len, len, 2);
17864        xmlResetLastError();
17865        if (mem_base != xmlMemBlocks()) {
17866            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17867	           xmlMemBlocks() - mem_base);
17868	    test_ret++;
17869            printf(" %d", n_ctxt);
17870            printf(" %d", n_data);
17871            printf(" %d", n_len);
17872            printf("\n");
17873        }
17874    }
17875    }
17876    }
17877    function_tests++;
17878#endif
17879
17880    return(test_ret);
17881}
17882
17883
17884static int
17885test_xmlRelaxNGValidatePushElement(void) {
17886    int test_ret = 0;
17887
17888#if defined(LIBXML_SCHEMAS_ENABLED)
17889    int mem_base;
17890    int ret_val;
17891    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17892    int n_ctxt;
17893    xmlDocPtr doc; /* a document instance */
17894    int n_doc;
17895    xmlNodePtr elem; /* an element instance */
17896    int n_elem;
17897
17898    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17899    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17900    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17901        mem_base = xmlMemBlocks();
17902        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17903        doc = gen_xmlDocPtr(n_doc, 1);
17904        elem = gen_xmlNodePtr(n_elem, 2);
17905
17906        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17907        desret_int(ret_val);
17908        call_tests++;
17909        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17910        des_xmlDocPtr(n_doc, doc, 1);
17911        des_xmlNodePtr(n_elem, elem, 2);
17912        xmlResetLastError();
17913        if (mem_base != xmlMemBlocks()) {
17914            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17915	           xmlMemBlocks() - mem_base);
17916	    test_ret++;
17917            printf(" %d", n_ctxt);
17918            printf(" %d", n_doc);
17919            printf(" %d", n_elem);
17920            printf("\n");
17921        }
17922    }
17923    }
17924    }
17925    function_tests++;
17926#endif
17927
17928    return(test_ret);
17929}
17930
17931
17932static int
17933test_xmlRelaxParserSetFlag(void) {
17934    int test_ret = 0;
17935
17936#if defined(LIBXML_SCHEMAS_ENABLED)
17937    int mem_base;
17938    int ret_val;
17939    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17940    int n_ctxt;
17941    int flags; /* a set of flags values */
17942    int n_flags;
17943
17944    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17945    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17946        mem_base = xmlMemBlocks();
17947        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17948        flags = gen_int(n_flags, 1);
17949
17950        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17951        desret_int(ret_val);
17952        call_tests++;
17953        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17954        des_int(n_flags, flags, 1);
17955        xmlResetLastError();
17956        if (mem_base != xmlMemBlocks()) {
17957            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17958	           xmlMemBlocks() - mem_base);
17959	    test_ret++;
17960            printf(" %d", n_ctxt);
17961            printf(" %d", n_flags);
17962            printf("\n");
17963        }
17964    }
17965    }
17966    function_tests++;
17967#endif
17968
17969    return(test_ret);
17970}
17971
17972static int
17973test_relaxng(void) {
17974    int test_ret = 0;
17975
17976    if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17977    test_ret += test_xmlRelaxNGDump();
17978    test_ret += test_xmlRelaxNGDumpTree();
17979    test_ret += test_xmlRelaxNGGetParserErrors();
17980    test_ret += test_xmlRelaxNGGetValidErrors();
17981    test_ret += test_xmlRelaxNGInitTypes();
17982    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17983    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17984    test_ret += test_xmlRelaxNGNewParserCtxt();
17985    test_ret += test_xmlRelaxNGNewValidCtxt();
17986    test_ret += test_xmlRelaxNGParse();
17987    test_ret += test_xmlRelaxNGSetParserErrors();
17988    test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17989    test_ret += test_xmlRelaxNGSetValidErrors();
17990    test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17991    test_ret += test_xmlRelaxNGValidateDoc();
17992    test_ret += test_xmlRelaxNGValidateFullElement();
17993    test_ret += test_xmlRelaxNGValidatePopElement();
17994    test_ret += test_xmlRelaxNGValidatePushCData();
17995    test_ret += test_xmlRelaxNGValidatePushElement();
17996    test_ret += test_xmlRelaxParserSetFlag();
17997
17998    if (test_ret != 0)
17999	printf("Module relaxng: %d errors\n", test_ret);
18000    return(test_ret);
18001}
18002static int
18003test_schemasInternals(void) {
18004    int test_ret = 0;
18005
18006    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18007
18008    if (test_ret != 0)
18009	printf("Module schemasInternals: %d errors\n", test_ret);
18010    return(test_ret);
18011}
18012
18013static int
18014test_xmlSchematronNewDocParserCtxt(void) {
18015    int test_ret = 0;
18016
18017
18018    /* missing type support */
18019    return(test_ret);
18020}
18021
18022
18023static int
18024test_xmlSchematronNewMemParserCtxt(void) {
18025    int test_ret = 0;
18026
18027
18028    /* missing type support */
18029    return(test_ret);
18030}
18031
18032
18033static int
18034test_xmlSchematronNewParserCtxt(void) {
18035    int test_ret = 0;
18036
18037
18038    /* missing type support */
18039    return(test_ret);
18040}
18041
18042#ifdef LIBXML_SCHEMATRON_ENABLED
18043
18044#define gen_nb_xmlSchematronPtr 1
18045static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18046    return(NULL);
18047}
18048static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18049}
18050#endif
18051
18052
18053static int
18054test_xmlSchematronNewValidCtxt(void) {
18055    int test_ret = 0;
18056
18057
18058    /* missing type support */
18059    return(test_ret);
18060}
18061
18062#ifdef LIBXML_SCHEMATRON_ENABLED
18063
18064#define gen_nb_xmlSchematronParserCtxtPtr 1
18065static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18066    return(NULL);
18067}
18068static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18069}
18070#endif
18071
18072
18073static int
18074test_xmlSchematronParse(void) {
18075    int test_ret = 0;
18076
18077
18078    /* missing type support */
18079    return(test_ret);
18080}
18081
18082#ifdef LIBXML_SCHEMATRON_ENABLED
18083
18084#define gen_nb_xmlSchematronValidCtxtPtr 1
18085static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18086    return(NULL);
18087}
18088static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18089}
18090#endif
18091
18092
18093static int
18094test_xmlSchematronSetValidStructuredErrors(void) {
18095    int test_ret = 0;
18096
18097
18098    /* missing type support */
18099    return(test_ret);
18100}
18101
18102
18103static int
18104test_xmlSchematronValidateDoc(void) {
18105    int test_ret = 0;
18106
18107#if defined(LIBXML_SCHEMATRON_ENABLED)
18108    int mem_base;
18109    int ret_val;
18110    xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18111    int n_ctxt;
18112    xmlDocPtr instance; /* the document instace tree */
18113    int n_instance;
18114
18115    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18116    for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18117        mem_base = xmlMemBlocks();
18118        ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18119        instance = gen_xmlDocPtr(n_instance, 1);
18120
18121        ret_val = xmlSchematronValidateDoc(ctxt, instance);
18122        desret_int(ret_val);
18123        call_tests++;
18124        des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18125        des_xmlDocPtr(n_instance, instance, 1);
18126        xmlResetLastError();
18127        if (mem_base != xmlMemBlocks()) {
18128            printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18129	           xmlMemBlocks() - mem_base);
18130	    test_ret++;
18131            printf(" %d", n_ctxt);
18132            printf(" %d", n_instance);
18133            printf("\n");
18134        }
18135    }
18136    }
18137    function_tests++;
18138#endif
18139
18140    return(test_ret);
18141}
18142
18143static int
18144test_schematron(void) {
18145    int test_ret = 0;
18146
18147    if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18148    test_ret += test_xmlSchematronNewDocParserCtxt();
18149    test_ret += test_xmlSchematronNewMemParserCtxt();
18150    test_ret += test_xmlSchematronNewParserCtxt();
18151    test_ret += test_xmlSchematronNewValidCtxt();
18152    test_ret += test_xmlSchematronParse();
18153    test_ret += test_xmlSchematronSetValidStructuredErrors();
18154    test_ret += test_xmlSchematronValidateDoc();
18155
18156    if (test_ret != 0)
18157	printf("Module schematron: %d errors\n", test_ret);
18158    return(test_ret);
18159}
18160
18161static int
18162test_xmlAddChild(void) {
18163    int test_ret = 0;
18164
18165    int mem_base;
18166    xmlNodePtr ret_val;
18167    xmlNodePtr parent; /* the parent node */
18168    int n_parent;
18169    xmlNodePtr cur; /* the child node */
18170    int n_cur;
18171
18172    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18173    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18174        mem_base = xmlMemBlocks();
18175        parent = gen_xmlNodePtr(n_parent, 0);
18176        cur = gen_xmlNodePtr_in(n_cur, 1);
18177
18178        ret_val = xmlAddChild(parent, cur);
18179        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18180        desret_xmlNodePtr(ret_val);
18181        call_tests++;
18182        des_xmlNodePtr(n_parent, parent, 0);
18183        des_xmlNodePtr_in(n_cur, cur, 1);
18184        xmlResetLastError();
18185        if (mem_base != xmlMemBlocks()) {
18186            printf("Leak of %d blocks found in xmlAddChild",
18187	           xmlMemBlocks() - mem_base);
18188	    test_ret++;
18189            printf(" %d", n_parent);
18190            printf(" %d", n_cur);
18191            printf("\n");
18192        }
18193    }
18194    }
18195    function_tests++;
18196
18197    return(test_ret);
18198}
18199
18200
18201static int
18202test_xmlAddChildList(void) {
18203    int test_ret = 0;
18204
18205    int mem_base;
18206    xmlNodePtr ret_val;
18207    xmlNodePtr parent; /* the parent node */
18208    int n_parent;
18209    xmlNodePtr cur; /* the first node in the list */
18210    int n_cur;
18211
18212    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18213    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18214        mem_base = xmlMemBlocks();
18215        parent = gen_xmlNodePtr(n_parent, 0);
18216        cur = gen_xmlNodePtr_in(n_cur, 1);
18217
18218        ret_val = xmlAddChildList(parent, cur);
18219        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18220        desret_xmlNodePtr(ret_val);
18221        call_tests++;
18222        des_xmlNodePtr(n_parent, parent, 0);
18223        des_xmlNodePtr_in(n_cur, cur, 1);
18224        xmlResetLastError();
18225        if (mem_base != xmlMemBlocks()) {
18226            printf("Leak of %d blocks found in xmlAddChildList",
18227	           xmlMemBlocks() - mem_base);
18228	    test_ret++;
18229            printf(" %d", n_parent);
18230            printf(" %d", n_cur);
18231            printf("\n");
18232        }
18233    }
18234    }
18235    function_tests++;
18236
18237    return(test_ret);
18238}
18239
18240
18241static int
18242test_xmlAddNextSibling(void) {
18243    int test_ret = 0;
18244
18245    int mem_base;
18246    xmlNodePtr ret_val;
18247    xmlNodePtr cur; /* the child node */
18248    int n_cur;
18249    xmlNodePtr elem; /* the new node */
18250    int n_elem;
18251
18252    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18253    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18254        mem_base = xmlMemBlocks();
18255        cur = gen_xmlNodePtr(n_cur, 0);
18256        elem = gen_xmlNodePtr_in(n_elem, 1);
18257
18258        ret_val = xmlAddNextSibling(cur, elem);
18259        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18260        desret_xmlNodePtr(ret_val);
18261        call_tests++;
18262        des_xmlNodePtr(n_cur, cur, 0);
18263        des_xmlNodePtr_in(n_elem, elem, 1);
18264        xmlResetLastError();
18265        if (mem_base != xmlMemBlocks()) {
18266            printf("Leak of %d blocks found in xmlAddNextSibling",
18267	           xmlMemBlocks() - mem_base);
18268	    test_ret++;
18269            printf(" %d", n_cur);
18270            printf(" %d", n_elem);
18271            printf("\n");
18272        }
18273    }
18274    }
18275    function_tests++;
18276
18277    return(test_ret);
18278}
18279
18280
18281static int
18282test_xmlAddPrevSibling(void) {
18283    int test_ret = 0;
18284
18285#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18286    int mem_base;
18287    xmlNodePtr ret_val;
18288    xmlNodePtr cur; /* the child node */
18289    int n_cur;
18290    xmlNodePtr elem; /* the new node */
18291    int n_elem;
18292
18293    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18294    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18295        mem_base = xmlMemBlocks();
18296        cur = gen_xmlNodePtr(n_cur, 0);
18297        elem = gen_xmlNodePtr_in(n_elem, 1);
18298
18299        ret_val = xmlAddPrevSibling(cur, elem);
18300        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18301        desret_xmlNodePtr(ret_val);
18302        call_tests++;
18303        des_xmlNodePtr(n_cur, cur, 0);
18304        des_xmlNodePtr_in(n_elem, elem, 1);
18305        xmlResetLastError();
18306        if (mem_base != xmlMemBlocks()) {
18307            printf("Leak of %d blocks found in xmlAddPrevSibling",
18308	           xmlMemBlocks() - mem_base);
18309	    test_ret++;
18310            printf(" %d", n_cur);
18311            printf(" %d", n_elem);
18312            printf("\n");
18313        }
18314    }
18315    }
18316    function_tests++;
18317#endif
18318
18319    return(test_ret);
18320}
18321
18322
18323static int
18324test_xmlAddSibling(void) {
18325    int test_ret = 0;
18326
18327    int mem_base;
18328    xmlNodePtr ret_val;
18329    xmlNodePtr cur; /* the child node */
18330    int n_cur;
18331    xmlNodePtr elem; /* the new node */
18332    int n_elem;
18333
18334    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18335    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18336        mem_base = xmlMemBlocks();
18337        cur = gen_xmlNodePtr(n_cur, 0);
18338        elem = gen_xmlNodePtr_in(n_elem, 1);
18339
18340        ret_val = xmlAddSibling(cur, elem);
18341        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18342        desret_xmlNodePtr(ret_val);
18343        call_tests++;
18344        des_xmlNodePtr(n_cur, cur, 0);
18345        des_xmlNodePtr_in(n_elem, elem, 1);
18346        xmlResetLastError();
18347        if (mem_base != xmlMemBlocks()) {
18348            printf("Leak of %d blocks found in xmlAddSibling",
18349	           xmlMemBlocks() - mem_base);
18350	    test_ret++;
18351            printf(" %d", n_cur);
18352            printf(" %d", n_elem);
18353            printf("\n");
18354        }
18355    }
18356    }
18357    function_tests++;
18358
18359    return(test_ret);
18360}
18361
18362
18363static int
18364test_xmlAttrSerializeTxtContent(void) {
18365    int test_ret = 0;
18366
18367#if defined(LIBXML_OUTPUT_ENABLED)
18368#ifdef LIBXML_OUTPUT_ENABLED
18369    int mem_base;
18370    xmlBufferPtr buf; /* the XML buffer output */
18371    int n_buf;
18372    xmlDocPtr doc; /* the document */
18373    int n_doc;
18374    xmlAttrPtr attr; /* the attribute node */
18375    int n_attr;
18376    xmlChar * string; /* the text content */
18377    int n_string;
18378
18379    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18380    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18381    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18382    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18383        mem_base = xmlMemBlocks();
18384        buf = gen_xmlBufferPtr(n_buf, 0);
18385        doc = gen_xmlDocPtr(n_doc, 1);
18386        attr = gen_xmlAttrPtr(n_attr, 2);
18387        string = gen_const_xmlChar_ptr(n_string, 3);
18388
18389        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18390        call_tests++;
18391        des_xmlBufferPtr(n_buf, buf, 0);
18392        des_xmlDocPtr(n_doc, doc, 1);
18393        des_xmlAttrPtr(n_attr, attr, 2);
18394        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18395        xmlResetLastError();
18396        if (mem_base != xmlMemBlocks()) {
18397            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18398	           xmlMemBlocks() - mem_base);
18399	    test_ret++;
18400            printf(" %d", n_buf);
18401            printf(" %d", n_doc);
18402            printf(" %d", n_attr);
18403            printf(" %d", n_string);
18404            printf("\n");
18405        }
18406    }
18407    }
18408    }
18409    }
18410    function_tests++;
18411#endif
18412#endif
18413
18414    return(test_ret);
18415}
18416
18417
18418static int
18419test_xmlBufferAdd(void) {
18420    int test_ret = 0;
18421
18422    int mem_base;
18423    int ret_val;
18424    xmlBufferPtr buf; /* the buffer to dump */
18425    int n_buf;
18426    xmlChar * str; /* the #xmlChar string */
18427    int n_str;
18428    int len; /* the number of #xmlChar to add */
18429    int n_len;
18430
18431    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18432    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18433    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18434        mem_base = xmlMemBlocks();
18435        buf = gen_xmlBufferPtr(n_buf, 0);
18436        str = gen_const_xmlChar_ptr(n_str, 1);
18437        len = gen_int(n_len, 2);
18438
18439        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18440        desret_int(ret_val);
18441        call_tests++;
18442        des_xmlBufferPtr(n_buf, buf, 0);
18443        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18444        des_int(n_len, len, 2);
18445        xmlResetLastError();
18446        if (mem_base != xmlMemBlocks()) {
18447            printf("Leak of %d blocks found in xmlBufferAdd",
18448	           xmlMemBlocks() - mem_base);
18449	    test_ret++;
18450            printf(" %d", n_buf);
18451            printf(" %d", n_str);
18452            printf(" %d", n_len);
18453            printf("\n");
18454        }
18455    }
18456    }
18457    }
18458    function_tests++;
18459
18460    return(test_ret);
18461}
18462
18463
18464static int
18465test_xmlBufferAddHead(void) {
18466    int test_ret = 0;
18467
18468    int mem_base;
18469    int ret_val;
18470    xmlBufferPtr buf; /* the buffer */
18471    int n_buf;
18472    xmlChar * str; /* the #xmlChar string */
18473    int n_str;
18474    int len; /* the number of #xmlChar to add */
18475    int n_len;
18476
18477    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18478    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18479    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18480        mem_base = xmlMemBlocks();
18481        buf = gen_xmlBufferPtr(n_buf, 0);
18482        str = gen_const_xmlChar_ptr(n_str, 1);
18483        len = gen_int(n_len, 2);
18484
18485        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18486        desret_int(ret_val);
18487        call_tests++;
18488        des_xmlBufferPtr(n_buf, buf, 0);
18489        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18490        des_int(n_len, len, 2);
18491        xmlResetLastError();
18492        if (mem_base != xmlMemBlocks()) {
18493            printf("Leak of %d blocks found in xmlBufferAddHead",
18494	           xmlMemBlocks() - mem_base);
18495	    test_ret++;
18496            printf(" %d", n_buf);
18497            printf(" %d", n_str);
18498            printf(" %d", n_len);
18499            printf("\n");
18500        }
18501    }
18502    }
18503    }
18504    function_tests++;
18505
18506    return(test_ret);
18507}
18508
18509
18510static int
18511test_xmlBufferCCat(void) {
18512    int test_ret = 0;
18513
18514    int mem_base;
18515    int ret_val;
18516    xmlBufferPtr buf; /* the buffer to dump */
18517    int n_buf;
18518    char * str; /* the C char string */
18519    int n_str;
18520
18521    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18522    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18523        mem_base = xmlMemBlocks();
18524        buf = gen_xmlBufferPtr(n_buf, 0);
18525        str = gen_const_char_ptr(n_str, 1);
18526
18527        ret_val = xmlBufferCCat(buf, (const char *)str);
18528        desret_int(ret_val);
18529        call_tests++;
18530        des_xmlBufferPtr(n_buf, buf, 0);
18531        des_const_char_ptr(n_str, (const char *)str, 1);
18532        xmlResetLastError();
18533        if (mem_base != xmlMemBlocks()) {
18534            printf("Leak of %d blocks found in xmlBufferCCat",
18535	           xmlMemBlocks() - mem_base);
18536	    test_ret++;
18537            printf(" %d", n_buf);
18538            printf(" %d", n_str);
18539            printf("\n");
18540        }
18541    }
18542    }
18543    function_tests++;
18544
18545    return(test_ret);
18546}
18547
18548
18549static int
18550test_xmlBufferCat(void) {
18551    int test_ret = 0;
18552
18553    int mem_base;
18554    int ret_val;
18555    xmlBufferPtr buf; /* the buffer to add to */
18556    int n_buf;
18557    xmlChar * str; /* the #xmlChar string */
18558    int n_str;
18559
18560    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18561    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18562        mem_base = xmlMemBlocks();
18563        buf = gen_xmlBufferPtr(n_buf, 0);
18564        str = gen_const_xmlChar_ptr(n_str, 1);
18565
18566        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18567        desret_int(ret_val);
18568        call_tests++;
18569        des_xmlBufferPtr(n_buf, buf, 0);
18570        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18571        xmlResetLastError();
18572        if (mem_base != xmlMemBlocks()) {
18573            printf("Leak of %d blocks found in xmlBufferCat",
18574	           xmlMemBlocks() - mem_base);
18575	    test_ret++;
18576            printf(" %d", n_buf);
18577            printf(" %d", n_str);
18578            printf("\n");
18579        }
18580    }
18581    }
18582    function_tests++;
18583
18584    return(test_ret);
18585}
18586
18587
18588#define gen_nb_const_xmlBufferPtr 1
18589static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18590    return(NULL);
18591}
18592static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18593}
18594
18595static int
18596test_xmlBufferContent(void) {
18597    int test_ret = 0;
18598
18599    int mem_base;
18600    const xmlChar * ret_val;
18601    xmlBufferPtr buf; /* the buffer */
18602    int n_buf;
18603
18604    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18605        mem_base = xmlMemBlocks();
18606        buf = gen_const_xmlBufferPtr(n_buf, 0);
18607
18608        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18609        desret_const_xmlChar_ptr(ret_val);
18610        call_tests++;
18611        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18612        xmlResetLastError();
18613        if (mem_base != xmlMemBlocks()) {
18614            printf("Leak of %d blocks found in xmlBufferContent",
18615	           xmlMemBlocks() - mem_base);
18616	    test_ret++;
18617            printf(" %d", n_buf);
18618            printf("\n");
18619        }
18620    }
18621    function_tests++;
18622
18623    return(test_ret);
18624}
18625
18626
18627static int
18628test_xmlBufferCreate(void) {
18629    int test_ret = 0;
18630
18631    int mem_base;
18632    xmlBufferPtr ret_val;
18633
18634        mem_base = xmlMemBlocks();
18635
18636        ret_val = xmlBufferCreate();
18637        desret_xmlBufferPtr(ret_val);
18638        call_tests++;
18639        xmlResetLastError();
18640        if (mem_base != xmlMemBlocks()) {
18641            printf("Leak of %d blocks found in xmlBufferCreate",
18642	           xmlMemBlocks() - mem_base);
18643	    test_ret++;
18644            printf("\n");
18645        }
18646    function_tests++;
18647
18648    return(test_ret);
18649}
18650
18651
18652static int
18653test_xmlBufferCreateSize(void) {
18654    int test_ret = 0;
18655
18656
18657    /* missing type support */
18658    return(test_ret);
18659}
18660
18661
18662static int
18663test_xmlBufferCreateStatic(void) {
18664    int test_ret = 0;
18665
18666
18667    /* missing type support */
18668    return(test_ret);
18669}
18670
18671
18672static int
18673test_xmlBufferEmpty(void) {
18674    int test_ret = 0;
18675
18676    int mem_base;
18677    xmlBufferPtr buf; /* the buffer */
18678    int n_buf;
18679
18680    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18681        mem_base = xmlMemBlocks();
18682        buf = gen_xmlBufferPtr(n_buf, 0);
18683
18684        xmlBufferEmpty(buf);
18685        call_tests++;
18686        des_xmlBufferPtr(n_buf, buf, 0);
18687        xmlResetLastError();
18688        if (mem_base != xmlMemBlocks()) {
18689            printf("Leak of %d blocks found in xmlBufferEmpty",
18690	           xmlMemBlocks() - mem_base);
18691	    test_ret++;
18692            printf(" %d", n_buf);
18693            printf("\n");
18694        }
18695    }
18696    function_tests++;
18697
18698    return(test_ret);
18699}
18700
18701
18702static int
18703test_xmlBufferGrow(void) {
18704    int test_ret = 0;
18705
18706    int mem_base;
18707    int ret_val;
18708    xmlBufferPtr buf; /* the buffer */
18709    int n_buf;
18710    unsigned int len; /* the minimum free size to allocate */
18711    int n_len;
18712
18713    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18714    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18715        mem_base = xmlMemBlocks();
18716        buf = gen_xmlBufferPtr(n_buf, 0);
18717        len = gen_unsigned_int(n_len, 1);
18718
18719        ret_val = xmlBufferGrow(buf, len);
18720        desret_int(ret_val);
18721        call_tests++;
18722        des_xmlBufferPtr(n_buf, buf, 0);
18723        des_unsigned_int(n_len, len, 1);
18724        xmlResetLastError();
18725        if (mem_base != xmlMemBlocks()) {
18726            printf("Leak of %d blocks found in xmlBufferGrow",
18727	           xmlMemBlocks() - mem_base);
18728	    test_ret++;
18729            printf(" %d", n_buf);
18730            printf(" %d", n_len);
18731            printf("\n");
18732        }
18733    }
18734    }
18735    function_tests++;
18736
18737    return(test_ret);
18738}
18739
18740
18741static int
18742test_xmlBufferLength(void) {
18743    int test_ret = 0;
18744
18745    int mem_base;
18746    int ret_val;
18747    xmlBufferPtr buf; /* the buffer */
18748    int n_buf;
18749
18750    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18751        mem_base = xmlMemBlocks();
18752        buf = gen_const_xmlBufferPtr(n_buf, 0);
18753
18754        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18755        desret_int(ret_val);
18756        call_tests++;
18757        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18758        xmlResetLastError();
18759        if (mem_base != xmlMemBlocks()) {
18760            printf("Leak of %d blocks found in xmlBufferLength",
18761	           xmlMemBlocks() - mem_base);
18762	    test_ret++;
18763            printf(" %d", n_buf);
18764            printf("\n");
18765        }
18766    }
18767    function_tests++;
18768
18769    return(test_ret);
18770}
18771
18772
18773static int
18774test_xmlBufferResize(void) {
18775    int test_ret = 0;
18776
18777    int mem_base;
18778    int ret_val;
18779    xmlBufferPtr buf; /* the buffer to resize */
18780    int n_buf;
18781    unsigned int size; /* the desired size */
18782    int n_size;
18783
18784    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18785    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18786        mem_base = xmlMemBlocks();
18787        buf = gen_xmlBufferPtr(n_buf, 0);
18788        size = gen_unsigned_int(n_size, 1);
18789
18790        ret_val = xmlBufferResize(buf, size);
18791        desret_int(ret_val);
18792        call_tests++;
18793        des_xmlBufferPtr(n_buf, buf, 0);
18794        des_unsigned_int(n_size, size, 1);
18795        xmlResetLastError();
18796        if (mem_base != xmlMemBlocks()) {
18797            printf("Leak of %d blocks found in xmlBufferResize",
18798	           xmlMemBlocks() - mem_base);
18799	    test_ret++;
18800            printf(" %d", n_buf);
18801            printf(" %d", n_size);
18802            printf("\n");
18803        }
18804    }
18805    }
18806    function_tests++;
18807
18808    return(test_ret);
18809}
18810
18811
18812static int
18813test_xmlBufferSetAllocationScheme(void) {
18814    int test_ret = 0;
18815
18816    int mem_base;
18817    xmlBufferPtr buf; /* the buffer to tune */
18818    int n_buf;
18819    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18820    int n_scheme;
18821
18822    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18823    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18824        mem_base = xmlMemBlocks();
18825        buf = gen_xmlBufferPtr(n_buf, 0);
18826        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18827
18828        xmlBufferSetAllocationScheme(buf, scheme);
18829        call_tests++;
18830        des_xmlBufferPtr(n_buf, buf, 0);
18831        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18832        xmlResetLastError();
18833        if (mem_base != xmlMemBlocks()) {
18834            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18835	           xmlMemBlocks() - mem_base);
18836	    test_ret++;
18837            printf(" %d", n_buf);
18838            printf(" %d", n_scheme);
18839            printf("\n");
18840        }
18841    }
18842    }
18843    function_tests++;
18844
18845    return(test_ret);
18846}
18847
18848
18849static int
18850test_xmlBufferShrink(void) {
18851    int test_ret = 0;
18852
18853    int mem_base;
18854    int ret_val;
18855    xmlBufferPtr buf; /* the buffer to dump */
18856    int n_buf;
18857    unsigned int len; /* the number of xmlChar to remove */
18858    int n_len;
18859
18860    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18861    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18862        mem_base = xmlMemBlocks();
18863        buf = gen_xmlBufferPtr(n_buf, 0);
18864        len = gen_unsigned_int(n_len, 1);
18865
18866        ret_val = xmlBufferShrink(buf, len);
18867        desret_int(ret_val);
18868        call_tests++;
18869        des_xmlBufferPtr(n_buf, buf, 0);
18870        des_unsigned_int(n_len, len, 1);
18871        xmlResetLastError();
18872        if (mem_base != xmlMemBlocks()) {
18873            printf("Leak of %d blocks found in xmlBufferShrink",
18874	           xmlMemBlocks() - mem_base);
18875	    test_ret++;
18876            printf(" %d", n_buf);
18877            printf(" %d", n_len);
18878            printf("\n");
18879        }
18880    }
18881    }
18882    function_tests++;
18883
18884    return(test_ret);
18885}
18886
18887
18888static int
18889test_xmlBufferWriteCHAR(void) {
18890    int test_ret = 0;
18891
18892    int mem_base;
18893    xmlBufferPtr buf; /* the XML buffer */
18894    int n_buf;
18895    xmlChar * string; /* the string to add */
18896    int n_string;
18897
18898    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18899    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18900        mem_base = xmlMemBlocks();
18901        buf = gen_xmlBufferPtr(n_buf, 0);
18902        string = gen_const_xmlChar_ptr(n_string, 1);
18903
18904        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18905        call_tests++;
18906        des_xmlBufferPtr(n_buf, buf, 0);
18907        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18908        xmlResetLastError();
18909        if (mem_base != xmlMemBlocks()) {
18910            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18911	           xmlMemBlocks() - mem_base);
18912	    test_ret++;
18913            printf(" %d", n_buf);
18914            printf(" %d", n_string);
18915            printf("\n");
18916        }
18917    }
18918    }
18919    function_tests++;
18920
18921    return(test_ret);
18922}
18923
18924
18925static int
18926test_xmlBufferWriteChar(void) {
18927    int test_ret = 0;
18928
18929    int mem_base;
18930    xmlBufferPtr buf; /* the XML buffer output */
18931    int n_buf;
18932    char * string; /* the string to add */
18933    int n_string;
18934
18935    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18936    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18937        mem_base = xmlMemBlocks();
18938        buf = gen_xmlBufferPtr(n_buf, 0);
18939        string = gen_const_char_ptr(n_string, 1);
18940
18941        xmlBufferWriteChar(buf, (const char *)string);
18942        call_tests++;
18943        des_xmlBufferPtr(n_buf, buf, 0);
18944        des_const_char_ptr(n_string, (const char *)string, 1);
18945        xmlResetLastError();
18946        if (mem_base != xmlMemBlocks()) {
18947            printf("Leak of %d blocks found in xmlBufferWriteChar",
18948	           xmlMemBlocks() - mem_base);
18949	    test_ret++;
18950            printf(" %d", n_buf);
18951            printf(" %d", n_string);
18952            printf("\n");
18953        }
18954    }
18955    }
18956    function_tests++;
18957
18958    return(test_ret);
18959}
18960
18961
18962static int
18963test_xmlBufferWriteQuotedString(void) {
18964    int test_ret = 0;
18965
18966    int mem_base;
18967    xmlBufferPtr buf; /* the XML buffer output */
18968    int n_buf;
18969    xmlChar * string; /* the string to add */
18970    int n_string;
18971
18972    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18973    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18974        mem_base = xmlMemBlocks();
18975        buf = gen_xmlBufferPtr(n_buf, 0);
18976        string = gen_const_xmlChar_ptr(n_string, 1);
18977
18978        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18979        call_tests++;
18980        des_xmlBufferPtr(n_buf, buf, 0);
18981        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18982        xmlResetLastError();
18983        if (mem_base != xmlMemBlocks()) {
18984            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18985	           xmlMemBlocks() - mem_base);
18986	    test_ret++;
18987            printf(" %d", n_buf);
18988            printf(" %d", n_string);
18989            printf("\n");
18990        }
18991    }
18992    }
18993    function_tests++;
18994
18995    return(test_ret);
18996}
18997
18998
18999static int
19000test_xmlBuildQName(void) {
19001    int test_ret = 0;
19002
19003    int mem_base;
19004    xmlChar * ret_val;
19005    xmlChar * ncname; /* the Name */
19006    int n_ncname;
19007    xmlChar * prefix; /* the prefix */
19008    int n_prefix;
19009    xmlChar * memory; /* preallocated memory */
19010    int n_memory;
19011    int len; /* preallocated memory length */
19012    int n_len;
19013
19014    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19015    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19016    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19017    for (n_len = 0;n_len < gen_nb_int;n_len++) {
19018        mem_base = xmlMemBlocks();
19019        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19020        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19021        memory = gen_xmlChar_ptr(n_memory, 2);
19022        len = gen_int(n_len, 3);
19023
19024        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19025        if ((ret_val != NULL) && (ret_val != ncname) &&
19026              (ret_val != prefix) && (ret_val != memory))
19027              xmlFree(ret_val);
19028	  ret_val = NULL;
19029        desret_xmlChar_ptr(ret_val);
19030        call_tests++;
19031        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19032        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19033        des_xmlChar_ptr(n_memory, memory, 2);
19034        des_int(n_len, len, 3);
19035        xmlResetLastError();
19036        if (mem_base != xmlMemBlocks()) {
19037            printf("Leak of %d blocks found in xmlBuildQName",
19038	           xmlMemBlocks() - mem_base);
19039	    test_ret++;
19040            printf(" %d", n_ncname);
19041            printf(" %d", n_prefix);
19042            printf(" %d", n_memory);
19043            printf(" %d", n_len);
19044            printf("\n");
19045        }
19046    }
19047    }
19048    }
19049    }
19050    function_tests++;
19051
19052    return(test_ret);
19053}
19054
19055
19056static int
19057test_xmlCopyDoc(void) {
19058    int test_ret = 0;
19059
19060#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19061    int mem_base;
19062    xmlDocPtr ret_val;
19063    xmlDocPtr doc; /* the document */
19064    int n_doc;
19065    int recursive; /* if not zero do a recursive copy. */
19066    int n_recursive;
19067
19068    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19069    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19070        mem_base = xmlMemBlocks();
19071        doc = gen_xmlDocPtr(n_doc, 0);
19072        recursive = gen_int(n_recursive, 1);
19073
19074        ret_val = xmlCopyDoc(doc, recursive);
19075        desret_xmlDocPtr(ret_val);
19076        call_tests++;
19077        des_xmlDocPtr(n_doc, doc, 0);
19078        des_int(n_recursive, recursive, 1);
19079        xmlResetLastError();
19080        if (mem_base != xmlMemBlocks()) {
19081            printf("Leak of %d blocks found in xmlCopyDoc",
19082	           xmlMemBlocks() - mem_base);
19083	    test_ret++;
19084            printf(" %d", n_doc);
19085            printf(" %d", n_recursive);
19086            printf("\n");
19087        }
19088    }
19089    }
19090    function_tests++;
19091#endif
19092
19093    return(test_ret);
19094}
19095
19096
19097static int
19098test_xmlCopyDtd(void) {
19099    int test_ret = 0;
19100
19101#if defined(LIBXML_TREE_ENABLED)
19102    int mem_base;
19103    xmlDtdPtr ret_val;
19104    xmlDtdPtr dtd; /* the dtd */
19105    int n_dtd;
19106
19107    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19108        mem_base = xmlMemBlocks();
19109        dtd = gen_xmlDtdPtr(n_dtd, 0);
19110
19111        ret_val = xmlCopyDtd(dtd);
19112        desret_xmlDtdPtr(ret_val);
19113        call_tests++;
19114        des_xmlDtdPtr(n_dtd, dtd, 0);
19115        xmlResetLastError();
19116        if (mem_base != xmlMemBlocks()) {
19117            printf("Leak of %d blocks found in xmlCopyDtd",
19118	           xmlMemBlocks() - mem_base);
19119	    test_ret++;
19120            printf(" %d", n_dtd);
19121            printf("\n");
19122        }
19123    }
19124    function_tests++;
19125#endif
19126
19127    return(test_ret);
19128}
19129
19130
19131static int
19132test_xmlCopyNamespace(void) {
19133    int test_ret = 0;
19134
19135    int mem_base;
19136    xmlNsPtr ret_val;
19137    xmlNsPtr cur; /* the namespace */
19138    int n_cur;
19139
19140    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19141        mem_base = xmlMemBlocks();
19142        cur = gen_xmlNsPtr(n_cur, 0);
19143
19144        ret_val = xmlCopyNamespace(cur);
19145        if (ret_val != NULL) xmlFreeNs(ret_val);
19146        desret_xmlNsPtr(ret_val);
19147        call_tests++;
19148        des_xmlNsPtr(n_cur, cur, 0);
19149        xmlResetLastError();
19150        if (mem_base != xmlMemBlocks()) {
19151            printf("Leak of %d blocks found in xmlCopyNamespace",
19152	           xmlMemBlocks() - mem_base);
19153	    test_ret++;
19154            printf(" %d", n_cur);
19155            printf("\n");
19156        }
19157    }
19158    function_tests++;
19159
19160    return(test_ret);
19161}
19162
19163
19164static int
19165test_xmlCopyNamespaceList(void) {
19166    int test_ret = 0;
19167
19168    int mem_base;
19169    xmlNsPtr ret_val;
19170    xmlNsPtr cur; /* the first namespace */
19171    int n_cur;
19172
19173    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19174        mem_base = xmlMemBlocks();
19175        cur = gen_xmlNsPtr(n_cur, 0);
19176
19177        ret_val = xmlCopyNamespaceList(cur);
19178        if (ret_val != NULL) xmlFreeNsList(ret_val);
19179        desret_xmlNsPtr(ret_val);
19180        call_tests++;
19181        des_xmlNsPtr(n_cur, cur, 0);
19182        xmlResetLastError();
19183        if (mem_base != xmlMemBlocks()) {
19184            printf("Leak of %d blocks found in xmlCopyNamespaceList",
19185	           xmlMemBlocks() - mem_base);
19186	    test_ret++;
19187            printf(" %d", n_cur);
19188            printf("\n");
19189        }
19190    }
19191    function_tests++;
19192
19193    return(test_ret);
19194}
19195
19196
19197static int
19198test_xmlCopyNode(void) {
19199    int test_ret = 0;
19200
19201    int mem_base;
19202    xmlNodePtr ret_val;
19203    xmlNodePtr node; /* the node */
19204    int n_node;
19205    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19206    int n_extended;
19207
19208    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19209    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19210        mem_base = xmlMemBlocks();
19211        node = gen_const_xmlNodePtr(n_node, 0);
19212        extended = gen_int(n_extended, 1);
19213
19214        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19215        desret_xmlNodePtr(ret_val);
19216        call_tests++;
19217        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19218        des_int(n_extended, extended, 1);
19219        xmlResetLastError();
19220        if (mem_base != xmlMemBlocks()) {
19221            printf("Leak of %d blocks found in xmlCopyNode",
19222	           xmlMemBlocks() - mem_base);
19223	    test_ret++;
19224            printf(" %d", n_node);
19225            printf(" %d", n_extended);
19226            printf("\n");
19227        }
19228    }
19229    }
19230    function_tests++;
19231
19232    return(test_ret);
19233}
19234
19235
19236static int
19237test_xmlCopyNodeList(void) {
19238    int test_ret = 0;
19239
19240    int mem_base;
19241    xmlNodePtr ret_val;
19242    xmlNodePtr node; /* the first node in the list. */
19243    int n_node;
19244
19245    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19246        mem_base = xmlMemBlocks();
19247        node = gen_const_xmlNodePtr(n_node, 0);
19248
19249        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19250        desret_xmlNodePtr(ret_val);
19251        call_tests++;
19252        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19253        xmlResetLastError();
19254        if (mem_base != xmlMemBlocks()) {
19255            printf("Leak of %d blocks found in xmlCopyNodeList",
19256	           xmlMemBlocks() - mem_base);
19257	    test_ret++;
19258            printf(" %d", n_node);
19259            printf("\n");
19260        }
19261    }
19262    function_tests++;
19263
19264    return(test_ret);
19265}
19266
19267
19268static int
19269test_xmlCopyProp(void) {
19270    int test_ret = 0;
19271
19272    int mem_base;
19273    xmlAttrPtr ret_val;
19274    xmlNodePtr target; /* the element where the attribute will be grafted */
19275    int n_target;
19276    xmlAttrPtr cur; /* the attribute */
19277    int n_cur;
19278
19279    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19280    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19281        mem_base = xmlMemBlocks();
19282        target = gen_xmlNodePtr(n_target, 0);
19283        cur = gen_xmlAttrPtr(n_cur, 1);
19284
19285        ret_val = xmlCopyProp(target, cur);
19286        desret_xmlAttrPtr(ret_val);
19287        call_tests++;
19288        des_xmlNodePtr(n_target, target, 0);
19289        des_xmlAttrPtr(n_cur, cur, 1);
19290        xmlResetLastError();
19291        if (mem_base != xmlMemBlocks()) {
19292            printf("Leak of %d blocks found in xmlCopyProp",
19293	           xmlMemBlocks() - mem_base);
19294	    test_ret++;
19295            printf(" %d", n_target);
19296            printf(" %d", n_cur);
19297            printf("\n");
19298        }
19299    }
19300    }
19301    function_tests++;
19302
19303    return(test_ret);
19304}
19305
19306
19307static int
19308test_xmlCopyPropList(void) {
19309    int test_ret = 0;
19310
19311    int mem_base;
19312    xmlAttrPtr ret_val;
19313    xmlNodePtr target; /* the element where the attributes will be grafted */
19314    int n_target;
19315    xmlAttrPtr cur; /* the first attribute */
19316    int n_cur;
19317
19318    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19319    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19320        mem_base = xmlMemBlocks();
19321        target = gen_xmlNodePtr(n_target, 0);
19322        cur = gen_xmlAttrPtr(n_cur, 1);
19323
19324        ret_val = xmlCopyPropList(target, cur);
19325        desret_xmlAttrPtr(ret_val);
19326        call_tests++;
19327        des_xmlNodePtr(n_target, target, 0);
19328        des_xmlAttrPtr(n_cur, cur, 1);
19329        xmlResetLastError();
19330        if (mem_base != xmlMemBlocks()) {
19331            printf("Leak of %d blocks found in xmlCopyPropList",
19332	           xmlMemBlocks() - mem_base);
19333	    test_ret++;
19334            printf(" %d", n_target);
19335            printf(" %d", n_cur);
19336            printf("\n");
19337        }
19338    }
19339    }
19340    function_tests++;
19341
19342    return(test_ret);
19343}
19344
19345
19346static int
19347test_xmlCreateIntSubset(void) {
19348    int test_ret = 0;
19349
19350    int mem_base;
19351    xmlDtdPtr ret_val;
19352    xmlDocPtr doc; /* the document pointer */
19353    int n_doc;
19354    xmlChar * name; /* the DTD name */
19355    int n_name;
19356    xmlChar * ExternalID; /* the external (PUBLIC) ID */
19357    int n_ExternalID;
19358    xmlChar * SystemID; /* the system ID */
19359    int n_SystemID;
19360
19361    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19362    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19363    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19364    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19365        mem_base = xmlMemBlocks();
19366        doc = gen_xmlDocPtr(n_doc, 0);
19367        name = gen_const_xmlChar_ptr(n_name, 1);
19368        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19369        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19370
19371        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19372        desret_xmlDtdPtr(ret_val);
19373        call_tests++;
19374        des_xmlDocPtr(n_doc, doc, 0);
19375        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19376        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19377        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19378        xmlResetLastError();
19379        if (mem_base != xmlMemBlocks()) {
19380            printf("Leak of %d blocks found in xmlCreateIntSubset",
19381	           xmlMemBlocks() - mem_base);
19382	    test_ret++;
19383            printf(" %d", n_doc);
19384            printf(" %d", n_name);
19385            printf(" %d", n_ExternalID);
19386            printf(" %d", n_SystemID);
19387            printf("\n");
19388        }
19389    }
19390    }
19391    }
19392    }
19393    function_tests++;
19394
19395    return(test_ret);
19396}
19397
19398
19399#define gen_nb_xmlDOMWrapCtxtPtr 1
19400static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19401    return(NULL);
19402}
19403static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19404}
19405
19406static int
19407test_xmlDOMWrapAdoptNode(void) {
19408    int test_ret = 0;
19409
19410    int mem_base;
19411    int ret_val;
19412    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19413    int n_ctxt;
19414    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19415    int n_sourceDoc;
19416    xmlNodePtr node; /* the node to start with */
19417    int n_node;
19418    xmlDocPtr destDoc; /* the destination doc */
19419    int n_destDoc;
19420    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19421    int n_destParent;
19422    int options; /* option flags */
19423    int n_options;
19424
19425    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19426    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19427    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19428    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19429    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19430    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19431        mem_base = xmlMemBlocks();
19432        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19433        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19434        node = gen_xmlNodePtr(n_node, 2);
19435        destDoc = gen_xmlDocPtr(n_destDoc, 3);
19436        destParent = gen_xmlNodePtr(n_destParent, 4);
19437        options = gen_int(n_options, 5);
19438
19439        ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19440        if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19441        desret_int(ret_val);
19442        call_tests++;
19443        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19444        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19445        des_xmlNodePtr(n_node, node, 2);
19446        des_xmlDocPtr(n_destDoc, destDoc, 3);
19447        des_xmlNodePtr(n_destParent, destParent, 4);
19448        des_int(n_options, options, 5);
19449        xmlResetLastError();
19450        if (mem_base != xmlMemBlocks()) {
19451            printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19452	           xmlMemBlocks() - mem_base);
19453	    test_ret++;
19454            printf(" %d", n_ctxt);
19455            printf(" %d", n_sourceDoc);
19456            printf(" %d", n_node);
19457            printf(" %d", n_destDoc);
19458            printf(" %d", n_destParent);
19459            printf(" %d", n_options);
19460            printf("\n");
19461        }
19462    }
19463    }
19464    }
19465    }
19466    }
19467    }
19468    function_tests++;
19469
19470    return(test_ret);
19471}
19472
19473
19474static int
19475test_xmlDOMWrapCloneNode(void) {
19476    int test_ret = 0;
19477
19478    int mem_base;
19479    int ret_val;
19480    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19481    int n_ctxt;
19482    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19483    int n_sourceDoc;
19484    xmlNodePtr node; /* the node to start with */
19485    int n_node;
19486    xmlNodePtr * resNode; /* the clone of the given @node */
19487    int n_resNode;
19488    xmlDocPtr destDoc; /* the destination doc */
19489    int n_destDoc;
19490    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19491    int n_destParent;
19492    int deep; /* descend into child if set */
19493    int n_deep;
19494    int options; /* option flags */
19495    int n_options;
19496
19497    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19498    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19499    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19500    for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19501    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19502    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19503    for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19504    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19505        mem_base = xmlMemBlocks();
19506        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19507        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19508        node = gen_xmlNodePtr(n_node, 2);
19509        resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19510        destDoc = gen_xmlDocPtr(n_destDoc, 4);
19511        destParent = gen_xmlNodePtr(n_destParent, 5);
19512        deep = gen_int(n_deep, 6);
19513        options = gen_int(n_options, 7);
19514
19515        ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19516        desret_int(ret_val);
19517        call_tests++;
19518        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19519        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19520        des_xmlNodePtr(n_node, node, 2);
19521        des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19522        des_xmlDocPtr(n_destDoc, destDoc, 4);
19523        des_xmlNodePtr(n_destParent, destParent, 5);
19524        des_int(n_deep, deep, 6);
19525        des_int(n_options, options, 7);
19526        xmlResetLastError();
19527        if (mem_base != xmlMemBlocks()) {
19528            printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19529	           xmlMemBlocks() - mem_base);
19530	    test_ret++;
19531            printf(" %d", n_ctxt);
19532            printf(" %d", n_sourceDoc);
19533            printf(" %d", n_node);
19534            printf(" %d", n_resNode);
19535            printf(" %d", n_destDoc);
19536            printf(" %d", n_destParent);
19537            printf(" %d", n_deep);
19538            printf(" %d", n_options);
19539            printf("\n");
19540        }
19541    }
19542    }
19543    }
19544    }
19545    }
19546    }
19547    }
19548    }
19549    function_tests++;
19550
19551    return(test_ret);
19552}
19553
19554
19555static int
19556test_xmlDOMWrapNewCtxt(void) {
19557    int test_ret = 0;
19558
19559
19560    /* missing type support */
19561    return(test_ret);
19562}
19563
19564
19565static int
19566test_xmlDOMWrapReconcileNamespaces(void) {
19567    int test_ret = 0;
19568
19569    int mem_base;
19570    int ret_val;
19571    xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19572    int n_ctxt;
19573    xmlNodePtr elem; /* the element-node */
19574    int n_elem;
19575    int options; /* option flags */
19576    int n_options;
19577
19578    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19579    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19580    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19581        mem_base = xmlMemBlocks();
19582        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19583        elem = gen_xmlNodePtr(n_elem, 1);
19584        options = gen_int(n_options, 2);
19585
19586        ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19587        desret_int(ret_val);
19588        call_tests++;
19589        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19590        des_xmlNodePtr(n_elem, elem, 1);
19591        des_int(n_options, options, 2);
19592        xmlResetLastError();
19593        if (mem_base != xmlMemBlocks()) {
19594            printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19595	           xmlMemBlocks() - mem_base);
19596	    test_ret++;
19597            printf(" %d", n_ctxt);
19598            printf(" %d", n_elem);
19599            printf(" %d", n_options);
19600            printf("\n");
19601        }
19602    }
19603    }
19604    }
19605    function_tests++;
19606
19607    return(test_ret);
19608}
19609
19610
19611static int
19612test_xmlDOMWrapRemoveNode(void) {
19613    int test_ret = 0;
19614
19615    int mem_base;
19616    int ret_val;
19617    xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19618    int n_ctxt;
19619    xmlDocPtr doc; /* the doc */
19620    int n_doc;
19621    xmlNodePtr node; /* the node to be removed. */
19622    int n_node;
19623    int options; /* set of options, unused at the moment */
19624    int n_options;
19625
19626    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19627    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19628    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19629    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19630        mem_base = xmlMemBlocks();
19631        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19632        doc = gen_xmlDocPtr(n_doc, 1);
19633        node = gen_xmlNodePtr(n_node, 2);
19634        options = gen_int(n_options, 3);
19635
19636        ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19637        desret_int(ret_val);
19638        call_tests++;
19639        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19640        des_xmlDocPtr(n_doc, doc, 1);
19641        des_xmlNodePtr(n_node, node, 2);
19642        des_int(n_options, options, 3);
19643        xmlResetLastError();
19644        if (mem_base != xmlMemBlocks()) {
19645            printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19646	           xmlMemBlocks() - mem_base);
19647	    test_ret++;
19648            printf(" %d", n_ctxt);
19649            printf(" %d", n_doc);
19650            printf(" %d", n_node);
19651            printf(" %d", n_options);
19652            printf("\n");
19653        }
19654    }
19655    }
19656    }
19657    }
19658    function_tests++;
19659
19660    return(test_ret);
19661}
19662
19663
19664static int
19665test_xmlDocCopyNode(void) {
19666    int test_ret = 0;
19667
19668    int mem_base;
19669    xmlNodePtr ret_val;
19670    xmlNodePtr node; /* the node */
19671    int n_node;
19672    xmlDocPtr doc; /* the document */
19673    int n_doc;
19674    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19675    int n_extended;
19676
19677    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19678    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19679    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19680        mem_base = xmlMemBlocks();
19681        node = gen_const_xmlNodePtr(n_node, 0);
19682        doc = gen_xmlDocPtr(n_doc, 1);
19683        extended = gen_int(n_extended, 2);
19684
19685        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19686        desret_xmlNodePtr(ret_val);
19687        call_tests++;
19688        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19689        des_xmlDocPtr(n_doc, doc, 1);
19690        des_int(n_extended, extended, 2);
19691        xmlResetLastError();
19692        if (mem_base != xmlMemBlocks()) {
19693            printf("Leak of %d blocks found in xmlDocCopyNode",
19694	           xmlMemBlocks() - mem_base);
19695	    test_ret++;
19696            printf(" %d", n_node);
19697            printf(" %d", n_doc);
19698            printf(" %d", n_extended);
19699            printf("\n");
19700        }
19701    }
19702    }
19703    }
19704    function_tests++;
19705
19706    return(test_ret);
19707}
19708
19709
19710static int
19711test_xmlDocCopyNodeList(void) {
19712    int test_ret = 0;
19713
19714    int mem_base;
19715    xmlNodePtr ret_val;
19716    xmlDocPtr doc; /* the target document */
19717    int n_doc;
19718    xmlNodePtr node; /* the first node in the list. */
19719    int n_node;
19720
19721    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19722    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19723        mem_base = xmlMemBlocks();
19724        doc = gen_xmlDocPtr(n_doc, 0);
19725        node = gen_const_xmlNodePtr(n_node, 1);
19726
19727        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19728        desret_xmlNodePtr(ret_val);
19729        call_tests++;
19730        des_xmlDocPtr(n_doc, doc, 0);
19731        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19732        xmlResetLastError();
19733        if (mem_base != xmlMemBlocks()) {
19734            printf("Leak of %d blocks found in xmlDocCopyNodeList",
19735	           xmlMemBlocks() - mem_base);
19736	    test_ret++;
19737            printf(" %d", n_doc);
19738            printf(" %d", n_node);
19739            printf("\n");
19740        }
19741    }
19742    }
19743    function_tests++;
19744
19745    return(test_ret);
19746}
19747
19748
19749static int
19750test_xmlDocDump(void) {
19751    int test_ret = 0;
19752
19753#if defined(LIBXML_OUTPUT_ENABLED)
19754    int mem_base;
19755    int ret_val;
19756    FILE * f; /* the FILE* */
19757    int n_f;
19758    xmlDocPtr cur; /* the document */
19759    int n_cur;
19760
19761    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19762    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19763        mem_base = xmlMemBlocks();
19764        f = gen_FILE_ptr(n_f, 0);
19765        cur = gen_xmlDocPtr(n_cur, 1);
19766
19767        ret_val = xmlDocDump(f, cur);
19768        desret_int(ret_val);
19769        call_tests++;
19770        des_FILE_ptr(n_f, f, 0);
19771        des_xmlDocPtr(n_cur, cur, 1);
19772        xmlResetLastError();
19773        if (mem_base != xmlMemBlocks()) {
19774            printf("Leak of %d blocks found in xmlDocDump",
19775	           xmlMemBlocks() - mem_base);
19776	    test_ret++;
19777            printf(" %d", n_f);
19778            printf(" %d", n_cur);
19779            printf("\n");
19780        }
19781    }
19782    }
19783    function_tests++;
19784#endif
19785
19786    return(test_ret);
19787}
19788
19789
19790static int
19791test_xmlDocDumpFormatMemory(void) {
19792    int test_ret = 0;
19793
19794#if defined(LIBXML_OUTPUT_ENABLED)
19795    int mem_base;
19796    xmlDocPtr cur; /* the document */
19797    int n_cur;
19798    xmlChar ** mem; /* OUT: the memory pointer */
19799    int n_mem;
19800    int * size; /* OUT: the memory length */
19801    int n_size;
19802    int format; /* should formatting spaces been added */
19803    int n_format;
19804
19805    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19806    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19807    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19808    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19809        mem_base = xmlMemBlocks();
19810        cur = gen_xmlDocPtr(n_cur, 0);
19811        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19812        size = gen_int_ptr(n_size, 2);
19813        format = gen_int(n_format, 3);
19814
19815        xmlDocDumpFormatMemory(cur, mem, size, format);
19816        call_tests++;
19817        des_xmlDocPtr(n_cur, cur, 0);
19818        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19819        des_int_ptr(n_size, size, 2);
19820        des_int(n_format, format, 3);
19821        xmlResetLastError();
19822        if (mem_base != xmlMemBlocks()) {
19823            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19824	           xmlMemBlocks() - mem_base);
19825	    test_ret++;
19826            printf(" %d", n_cur);
19827            printf(" %d", n_mem);
19828            printf(" %d", n_size);
19829            printf(" %d", n_format);
19830            printf("\n");
19831        }
19832    }
19833    }
19834    }
19835    }
19836    function_tests++;
19837#endif
19838
19839    return(test_ret);
19840}
19841
19842
19843static int
19844test_xmlDocDumpFormatMemoryEnc(void) {
19845    int test_ret = 0;
19846
19847#if defined(LIBXML_OUTPUT_ENABLED)
19848    int mem_base;
19849    xmlDocPtr out_doc; /* Document to generate XML text from */
19850    int n_out_doc;
19851    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19852    int n_doc_txt_ptr;
19853    int * doc_txt_len; /* Length of the generated XML text */
19854    int n_doc_txt_len;
19855    char * txt_encoding; /* Character encoding to use when generating XML text */
19856    int n_txt_encoding;
19857    int format; /* should formatting spaces been added */
19858    int n_format;
19859
19860    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19861    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19862    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19863    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19864    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19865        mem_base = xmlMemBlocks();
19866        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19867        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19868        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19869        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19870        format = gen_int(n_format, 4);
19871
19872        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19873        call_tests++;
19874        des_xmlDocPtr(n_out_doc, out_doc, 0);
19875        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19876        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19877        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19878        des_int(n_format, format, 4);
19879        xmlResetLastError();
19880        if (mem_base != xmlMemBlocks()) {
19881            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19882	           xmlMemBlocks() - mem_base);
19883	    test_ret++;
19884            printf(" %d", n_out_doc);
19885            printf(" %d", n_doc_txt_ptr);
19886            printf(" %d", n_doc_txt_len);
19887            printf(" %d", n_txt_encoding);
19888            printf(" %d", n_format);
19889            printf("\n");
19890        }
19891    }
19892    }
19893    }
19894    }
19895    }
19896    function_tests++;
19897#endif
19898
19899    return(test_ret);
19900}
19901
19902
19903static int
19904test_xmlDocDumpMemory(void) {
19905    int test_ret = 0;
19906
19907#if defined(LIBXML_OUTPUT_ENABLED)
19908    int mem_base;
19909    xmlDocPtr cur; /* the document */
19910    int n_cur;
19911    xmlChar ** mem; /* OUT: the memory pointer */
19912    int n_mem;
19913    int * size; /* OUT: the memory length */
19914    int n_size;
19915
19916    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19917    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19918    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19919        mem_base = xmlMemBlocks();
19920        cur = gen_xmlDocPtr(n_cur, 0);
19921        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19922        size = gen_int_ptr(n_size, 2);
19923
19924        xmlDocDumpMemory(cur, mem, size);
19925        call_tests++;
19926        des_xmlDocPtr(n_cur, cur, 0);
19927        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19928        des_int_ptr(n_size, size, 2);
19929        xmlResetLastError();
19930        if (mem_base != xmlMemBlocks()) {
19931            printf("Leak of %d blocks found in xmlDocDumpMemory",
19932	           xmlMemBlocks() - mem_base);
19933	    test_ret++;
19934            printf(" %d", n_cur);
19935            printf(" %d", n_mem);
19936            printf(" %d", n_size);
19937            printf("\n");
19938        }
19939    }
19940    }
19941    }
19942    function_tests++;
19943#endif
19944
19945    return(test_ret);
19946}
19947
19948
19949static int
19950test_xmlDocDumpMemoryEnc(void) {
19951    int test_ret = 0;
19952
19953#if defined(LIBXML_OUTPUT_ENABLED)
19954    int mem_base;
19955    xmlDocPtr out_doc; /* Document to generate XML text from */
19956    int n_out_doc;
19957    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19958    int n_doc_txt_ptr;
19959    int * doc_txt_len; /* Length of the generated XML text */
19960    int n_doc_txt_len;
19961    char * txt_encoding; /* Character encoding to use when generating XML text */
19962    int n_txt_encoding;
19963
19964    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19965    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19966    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19967    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19968        mem_base = xmlMemBlocks();
19969        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19970        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19971        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19972        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19973
19974        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19975        call_tests++;
19976        des_xmlDocPtr(n_out_doc, out_doc, 0);
19977        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19978        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19979        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19980        xmlResetLastError();
19981        if (mem_base != xmlMemBlocks()) {
19982            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19983	           xmlMemBlocks() - mem_base);
19984	    test_ret++;
19985            printf(" %d", n_out_doc);
19986            printf(" %d", n_doc_txt_ptr);
19987            printf(" %d", n_doc_txt_len);
19988            printf(" %d", n_txt_encoding);
19989            printf("\n");
19990        }
19991    }
19992    }
19993    }
19994    }
19995    function_tests++;
19996#endif
19997
19998    return(test_ret);
19999}
20000
20001
20002static int
20003test_xmlDocFormatDump(void) {
20004    int test_ret = 0;
20005
20006#if defined(LIBXML_OUTPUT_ENABLED)
20007    int mem_base;
20008    int ret_val;
20009    FILE * f; /* the FILE* */
20010    int n_f;
20011    xmlDocPtr cur; /* the document */
20012    int n_cur;
20013    int format; /* should formatting spaces been added */
20014    int n_format;
20015
20016    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20017    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20018    for (n_format = 0;n_format < gen_nb_int;n_format++) {
20019        mem_base = xmlMemBlocks();
20020        f = gen_FILE_ptr(n_f, 0);
20021        cur = gen_xmlDocPtr(n_cur, 1);
20022        format = gen_int(n_format, 2);
20023
20024        ret_val = xmlDocFormatDump(f, cur, format);
20025        desret_int(ret_val);
20026        call_tests++;
20027        des_FILE_ptr(n_f, f, 0);
20028        des_xmlDocPtr(n_cur, cur, 1);
20029        des_int(n_format, format, 2);
20030        xmlResetLastError();
20031        if (mem_base != xmlMemBlocks()) {
20032            printf("Leak of %d blocks found in xmlDocFormatDump",
20033	           xmlMemBlocks() - mem_base);
20034	    test_ret++;
20035            printf(" %d", n_f);
20036            printf(" %d", n_cur);
20037            printf(" %d", n_format);
20038            printf("\n");
20039        }
20040    }
20041    }
20042    }
20043    function_tests++;
20044#endif
20045
20046    return(test_ret);
20047}
20048
20049
20050static int
20051test_xmlDocGetRootElement(void) {
20052    int test_ret = 0;
20053
20054    int mem_base;
20055    xmlNodePtr ret_val;
20056    xmlDocPtr doc; /* the document */
20057    int n_doc;
20058
20059    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20060        mem_base = xmlMemBlocks();
20061        doc = gen_xmlDocPtr(n_doc, 0);
20062
20063        ret_val = xmlDocGetRootElement(doc);
20064        desret_xmlNodePtr(ret_val);
20065        call_tests++;
20066        des_xmlDocPtr(n_doc, doc, 0);
20067        xmlResetLastError();
20068        if (mem_base != xmlMemBlocks()) {
20069            printf("Leak of %d blocks found in xmlDocGetRootElement",
20070	           xmlMemBlocks() - mem_base);
20071	    test_ret++;
20072            printf(" %d", n_doc);
20073            printf("\n");
20074        }
20075    }
20076    function_tests++;
20077
20078    return(test_ret);
20079}
20080
20081
20082static int
20083test_xmlDocSetRootElement(void) {
20084    int test_ret = 0;
20085
20086#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20087    int mem_base;
20088    xmlNodePtr ret_val;
20089    xmlDocPtr doc; /* the document */
20090    int n_doc;
20091    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. */
20092    int n_root;
20093
20094    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20095    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20096        mem_base = xmlMemBlocks();
20097        doc = gen_xmlDocPtr(n_doc, 0);
20098        root = gen_xmlNodePtr_in(n_root, 1);
20099
20100        ret_val = xmlDocSetRootElement(doc, root);
20101        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20102        desret_xmlNodePtr(ret_val);
20103        call_tests++;
20104        des_xmlDocPtr(n_doc, doc, 0);
20105        des_xmlNodePtr_in(n_root, root, 1);
20106        xmlResetLastError();
20107        if (mem_base != xmlMemBlocks()) {
20108            printf("Leak of %d blocks found in xmlDocSetRootElement",
20109	           xmlMemBlocks() - mem_base);
20110	    test_ret++;
20111            printf(" %d", n_doc);
20112            printf(" %d", n_root);
20113            printf("\n");
20114        }
20115    }
20116    }
20117    function_tests++;
20118#endif
20119
20120    return(test_ret);
20121}
20122
20123
20124static int
20125test_xmlElemDump(void) {
20126    int test_ret = 0;
20127
20128#if defined(LIBXML_OUTPUT_ENABLED)
20129    int mem_base;
20130    FILE * f; /* the FILE * for the output */
20131    int n_f;
20132    xmlDocPtr doc; /* the document */
20133    int n_doc;
20134    xmlNodePtr cur; /* the current node */
20135    int n_cur;
20136
20137    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20138    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20139    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20140        mem_base = xmlMemBlocks();
20141        f = gen_FILE_ptr(n_f, 0);
20142        doc = gen_xmlDocPtr(n_doc, 1);
20143        cur = gen_xmlNodePtr(n_cur, 2);
20144
20145        xmlElemDump(f, doc, cur);
20146        call_tests++;
20147        des_FILE_ptr(n_f, f, 0);
20148        des_xmlDocPtr(n_doc, doc, 1);
20149        des_xmlNodePtr(n_cur, cur, 2);
20150        xmlResetLastError();
20151        if (mem_base != xmlMemBlocks()) {
20152            printf("Leak of %d blocks found in xmlElemDump",
20153	           xmlMemBlocks() - mem_base);
20154	    test_ret++;
20155            printf(" %d", n_f);
20156            printf(" %d", n_doc);
20157            printf(" %d", n_cur);
20158            printf("\n");
20159        }
20160    }
20161    }
20162    }
20163    function_tests++;
20164#endif
20165
20166    return(test_ret);
20167}
20168
20169
20170static int
20171test_xmlGetBufferAllocationScheme(void) {
20172    int test_ret = 0;
20173
20174    int mem_base;
20175    xmlBufferAllocationScheme ret_val;
20176
20177        mem_base = xmlMemBlocks();
20178
20179        ret_val = xmlGetBufferAllocationScheme();
20180        desret_xmlBufferAllocationScheme(ret_val);
20181        call_tests++;
20182        xmlResetLastError();
20183        if (mem_base != xmlMemBlocks()) {
20184            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20185	           xmlMemBlocks() - mem_base);
20186	    test_ret++;
20187            printf("\n");
20188        }
20189    function_tests++;
20190
20191    return(test_ret);
20192}
20193
20194
20195static int
20196test_xmlGetCompressMode(void) {
20197    int test_ret = 0;
20198
20199    int mem_base;
20200    int ret_val;
20201
20202        mem_base = xmlMemBlocks();
20203
20204        ret_val = xmlGetCompressMode();
20205        desret_int(ret_val);
20206        call_tests++;
20207        xmlResetLastError();
20208        if (mem_base != xmlMemBlocks()) {
20209            printf("Leak of %d blocks found in xmlGetCompressMode",
20210	           xmlMemBlocks() - mem_base);
20211	    test_ret++;
20212            printf("\n");
20213        }
20214    function_tests++;
20215
20216    return(test_ret);
20217}
20218
20219
20220static int
20221test_xmlGetDocCompressMode(void) {
20222    int test_ret = 0;
20223
20224    int mem_base;
20225    int ret_val;
20226    xmlDocPtr doc; /* the document */
20227    int n_doc;
20228
20229    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20230        mem_base = xmlMemBlocks();
20231        doc = gen_xmlDocPtr(n_doc, 0);
20232
20233        ret_val = xmlGetDocCompressMode(doc);
20234        desret_int(ret_val);
20235        call_tests++;
20236        des_xmlDocPtr(n_doc, doc, 0);
20237        xmlResetLastError();
20238        if (mem_base != xmlMemBlocks()) {
20239            printf("Leak of %d blocks found in xmlGetDocCompressMode",
20240	           xmlMemBlocks() - mem_base);
20241	    test_ret++;
20242            printf(" %d", n_doc);
20243            printf("\n");
20244        }
20245    }
20246    function_tests++;
20247
20248    return(test_ret);
20249}
20250
20251
20252static int
20253test_xmlGetIntSubset(void) {
20254    int test_ret = 0;
20255
20256    int mem_base;
20257    xmlDtdPtr ret_val;
20258    xmlDocPtr doc; /* the document pointer */
20259    int n_doc;
20260
20261    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20262        mem_base = xmlMemBlocks();
20263        doc = gen_xmlDocPtr(n_doc, 0);
20264
20265        ret_val = xmlGetIntSubset(doc);
20266        desret_xmlDtdPtr(ret_val);
20267        call_tests++;
20268        des_xmlDocPtr(n_doc, doc, 0);
20269        xmlResetLastError();
20270        if (mem_base != xmlMemBlocks()) {
20271            printf("Leak of %d blocks found in xmlGetIntSubset",
20272	           xmlMemBlocks() - mem_base);
20273	    test_ret++;
20274            printf(" %d", n_doc);
20275            printf("\n");
20276        }
20277    }
20278    function_tests++;
20279
20280    return(test_ret);
20281}
20282
20283
20284static int
20285test_xmlGetLastChild(void) {
20286    int test_ret = 0;
20287
20288    int mem_base;
20289    xmlNodePtr ret_val;
20290    xmlNodePtr parent; /* the parent node */
20291    int n_parent;
20292
20293    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20294        mem_base = xmlMemBlocks();
20295        parent = gen_xmlNodePtr(n_parent, 0);
20296
20297        ret_val = xmlGetLastChild(parent);
20298        desret_xmlNodePtr(ret_val);
20299        call_tests++;
20300        des_xmlNodePtr(n_parent, parent, 0);
20301        xmlResetLastError();
20302        if (mem_base != xmlMemBlocks()) {
20303            printf("Leak of %d blocks found in xmlGetLastChild",
20304	           xmlMemBlocks() - mem_base);
20305	    test_ret++;
20306            printf(" %d", n_parent);
20307            printf("\n");
20308        }
20309    }
20310    function_tests++;
20311
20312    return(test_ret);
20313}
20314
20315
20316static int
20317test_xmlGetLineNo(void) {
20318    int test_ret = 0;
20319
20320    int mem_base;
20321    long ret_val;
20322    xmlNodePtr node; /* valid node */
20323    int n_node;
20324
20325    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20326        mem_base = xmlMemBlocks();
20327        node = gen_xmlNodePtr(n_node, 0);
20328
20329        ret_val = xmlGetLineNo(node);
20330        desret_long(ret_val);
20331        call_tests++;
20332        des_xmlNodePtr(n_node, node, 0);
20333        xmlResetLastError();
20334        if (mem_base != xmlMemBlocks()) {
20335            printf("Leak of %d blocks found in xmlGetLineNo",
20336	           xmlMemBlocks() - mem_base);
20337	    test_ret++;
20338            printf(" %d", n_node);
20339            printf("\n");
20340        }
20341    }
20342    function_tests++;
20343
20344    return(test_ret);
20345}
20346
20347
20348static int
20349test_xmlGetNoNsProp(void) {
20350    int test_ret = 0;
20351
20352    int mem_base;
20353    xmlChar * ret_val;
20354    xmlNodePtr node; /* the node */
20355    int n_node;
20356    xmlChar * name; /* the attribute name */
20357    int n_name;
20358
20359    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20360    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20361        mem_base = xmlMemBlocks();
20362        node = gen_xmlNodePtr(n_node, 0);
20363        name = gen_const_xmlChar_ptr(n_name, 1);
20364
20365        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20366        desret_xmlChar_ptr(ret_val);
20367        call_tests++;
20368        des_xmlNodePtr(n_node, node, 0);
20369        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20370        xmlResetLastError();
20371        if (mem_base != xmlMemBlocks()) {
20372            printf("Leak of %d blocks found in xmlGetNoNsProp",
20373	           xmlMemBlocks() - mem_base);
20374	    test_ret++;
20375            printf(" %d", n_node);
20376            printf(" %d", n_name);
20377            printf("\n");
20378        }
20379    }
20380    }
20381    function_tests++;
20382
20383    return(test_ret);
20384}
20385
20386
20387static int
20388test_xmlGetNodePath(void) {
20389    int test_ret = 0;
20390
20391#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20392    int mem_base;
20393    xmlChar * ret_val;
20394    xmlNodePtr node; /* a node */
20395    int n_node;
20396
20397    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20398        mem_base = xmlMemBlocks();
20399        node = gen_xmlNodePtr(n_node, 0);
20400
20401        ret_val = xmlGetNodePath(node);
20402        desret_xmlChar_ptr(ret_val);
20403        call_tests++;
20404        des_xmlNodePtr(n_node, node, 0);
20405        xmlResetLastError();
20406        if (mem_base != xmlMemBlocks()) {
20407            printf("Leak of %d blocks found in xmlGetNodePath",
20408	           xmlMemBlocks() - mem_base);
20409	    test_ret++;
20410            printf(" %d", n_node);
20411            printf("\n");
20412        }
20413    }
20414    function_tests++;
20415#endif
20416
20417    return(test_ret);
20418}
20419
20420
20421static int
20422test_xmlGetNsList(void) {
20423    int test_ret = 0;
20424
20425
20426    /* missing type support */
20427    return(test_ret);
20428}
20429
20430
20431static int
20432test_xmlGetNsProp(void) {
20433    int test_ret = 0;
20434
20435    int mem_base;
20436    xmlChar * ret_val;
20437    xmlNodePtr node; /* the node */
20438    int n_node;
20439    xmlChar * name; /* the attribute name */
20440    int n_name;
20441    xmlChar * nameSpace; /* the URI of the namespace */
20442    int n_nameSpace;
20443
20444    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20445    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20446    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20447        mem_base = xmlMemBlocks();
20448        node = gen_xmlNodePtr(n_node, 0);
20449        name = gen_const_xmlChar_ptr(n_name, 1);
20450        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20451
20452        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20453        desret_xmlChar_ptr(ret_val);
20454        call_tests++;
20455        des_xmlNodePtr(n_node, node, 0);
20456        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20457        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20458        xmlResetLastError();
20459        if (mem_base != xmlMemBlocks()) {
20460            printf("Leak of %d blocks found in xmlGetNsProp",
20461	           xmlMemBlocks() - mem_base);
20462	    test_ret++;
20463            printf(" %d", n_node);
20464            printf(" %d", n_name);
20465            printf(" %d", n_nameSpace);
20466            printf("\n");
20467        }
20468    }
20469    }
20470    }
20471    function_tests++;
20472
20473    return(test_ret);
20474}
20475
20476
20477static int
20478test_xmlGetProp(void) {
20479    int test_ret = 0;
20480
20481    int mem_base;
20482    xmlChar * ret_val;
20483    xmlNodePtr node; /* the node */
20484    int n_node;
20485    xmlChar * name; /* the attribute name */
20486    int n_name;
20487
20488    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20489    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20490        mem_base = xmlMemBlocks();
20491        node = gen_xmlNodePtr(n_node, 0);
20492        name = gen_const_xmlChar_ptr(n_name, 1);
20493
20494        ret_val = xmlGetProp(node, (const xmlChar *)name);
20495        desret_xmlChar_ptr(ret_val);
20496        call_tests++;
20497        des_xmlNodePtr(n_node, node, 0);
20498        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20499        xmlResetLastError();
20500        if (mem_base != xmlMemBlocks()) {
20501            printf("Leak of %d blocks found in xmlGetProp",
20502	           xmlMemBlocks() - mem_base);
20503	    test_ret++;
20504            printf(" %d", n_node);
20505            printf(" %d", n_name);
20506            printf("\n");
20507        }
20508    }
20509    }
20510    function_tests++;
20511
20512    return(test_ret);
20513}
20514
20515
20516static int
20517test_xmlHasNsProp(void) {
20518    int test_ret = 0;
20519
20520    int mem_base;
20521    xmlAttrPtr ret_val;
20522    xmlNodePtr node; /* the node */
20523    int n_node;
20524    xmlChar * name; /* the attribute name */
20525    int n_name;
20526    xmlChar * nameSpace; /* the URI of the namespace */
20527    int n_nameSpace;
20528
20529    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20530    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20531    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20532        mem_base = xmlMemBlocks();
20533        node = gen_xmlNodePtr(n_node, 0);
20534        name = gen_const_xmlChar_ptr(n_name, 1);
20535        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20536
20537        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20538        desret_xmlAttrPtr(ret_val);
20539        call_tests++;
20540        des_xmlNodePtr(n_node, node, 0);
20541        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20542        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20543        xmlResetLastError();
20544        if (mem_base != xmlMemBlocks()) {
20545            printf("Leak of %d blocks found in xmlHasNsProp",
20546	           xmlMemBlocks() - mem_base);
20547	    test_ret++;
20548            printf(" %d", n_node);
20549            printf(" %d", n_name);
20550            printf(" %d", n_nameSpace);
20551            printf("\n");
20552        }
20553    }
20554    }
20555    }
20556    function_tests++;
20557
20558    return(test_ret);
20559}
20560
20561
20562static int
20563test_xmlHasProp(void) {
20564    int test_ret = 0;
20565
20566    int mem_base;
20567    xmlAttrPtr ret_val;
20568    xmlNodePtr node; /* the node */
20569    int n_node;
20570    xmlChar * name; /* the attribute name */
20571    int n_name;
20572
20573    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20574    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20575        mem_base = xmlMemBlocks();
20576        node = gen_xmlNodePtr(n_node, 0);
20577        name = gen_const_xmlChar_ptr(n_name, 1);
20578
20579        ret_val = xmlHasProp(node, (const xmlChar *)name);
20580        desret_xmlAttrPtr(ret_val);
20581        call_tests++;
20582        des_xmlNodePtr(n_node, node, 0);
20583        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20584        xmlResetLastError();
20585        if (mem_base != xmlMemBlocks()) {
20586            printf("Leak of %d blocks found in xmlHasProp",
20587	           xmlMemBlocks() - mem_base);
20588	    test_ret++;
20589            printf(" %d", n_node);
20590            printf(" %d", n_name);
20591            printf("\n");
20592        }
20593    }
20594    }
20595    function_tests++;
20596
20597    return(test_ret);
20598}
20599
20600
20601static int
20602test_xmlIsBlankNode(void) {
20603    int test_ret = 0;
20604
20605    int mem_base;
20606    int ret_val;
20607    xmlNodePtr node; /* the node */
20608    int n_node;
20609
20610    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20611        mem_base = xmlMemBlocks();
20612        node = gen_xmlNodePtr(n_node, 0);
20613
20614        ret_val = xmlIsBlankNode(node);
20615        desret_int(ret_val);
20616        call_tests++;
20617        des_xmlNodePtr(n_node, node, 0);
20618        xmlResetLastError();
20619        if (mem_base != xmlMemBlocks()) {
20620            printf("Leak of %d blocks found in xmlIsBlankNode",
20621	           xmlMemBlocks() - mem_base);
20622	    test_ret++;
20623            printf(" %d", n_node);
20624            printf("\n");
20625        }
20626    }
20627    function_tests++;
20628
20629    return(test_ret);
20630}
20631
20632
20633static int
20634test_xmlIsXHTML(void) {
20635    int test_ret = 0;
20636
20637    int mem_base;
20638    int ret_val;
20639    xmlChar * systemID; /* the system identifier */
20640    int n_systemID;
20641    xmlChar * publicID; /* the public identifier */
20642    int n_publicID;
20643
20644    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20645    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20646        mem_base = xmlMemBlocks();
20647        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20648        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20649
20650        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20651        desret_int(ret_val);
20652        call_tests++;
20653        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20654        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20655        xmlResetLastError();
20656        if (mem_base != xmlMemBlocks()) {
20657            printf("Leak of %d blocks found in xmlIsXHTML",
20658	           xmlMemBlocks() - mem_base);
20659	    test_ret++;
20660            printf(" %d", n_systemID);
20661            printf(" %d", n_publicID);
20662            printf("\n");
20663        }
20664    }
20665    }
20666    function_tests++;
20667
20668    return(test_ret);
20669}
20670
20671
20672static int
20673test_xmlNewCDataBlock(void) {
20674    int test_ret = 0;
20675
20676    int mem_base;
20677    xmlNodePtr ret_val;
20678    xmlDocPtr doc; /* the document */
20679    int n_doc;
20680    xmlChar * content; /* the CDATA block content content */
20681    int n_content;
20682    int len; /* the length of the block */
20683    int n_len;
20684
20685    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20686    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20687    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20688        mem_base = xmlMemBlocks();
20689        doc = gen_xmlDocPtr(n_doc, 0);
20690        content = gen_const_xmlChar_ptr(n_content, 1);
20691        len = gen_int(n_len, 2);
20692
20693        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20694        desret_xmlNodePtr(ret_val);
20695        call_tests++;
20696        des_xmlDocPtr(n_doc, doc, 0);
20697        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20698        des_int(n_len, len, 2);
20699        xmlResetLastError();
20700        if (mem_base != xmlMemBlocks()) {
20701            printf("Leak of %d blocks found in xmlNewCDataBlock",
20702	           xmlMemBlocks() - mem_base);
20703	    test_ret++;
20704            printf(" %d", n_doc);
20705            printf(" %d", n_content);
20706            printf(" %d", n_len);
20707            printf("\n");
20708        }
20709    }
20710    }
20711    }
20712    function_tests++;
20713
20714    return(test_ret);
20715}
20716
20717
20718static int
20719test_xmlNewCharRef(void) {
20720    int test_ret = 0;
20721
20722    int mem_base;
20723    xmlNodePtr ret_val;
20724    xmlDocPtr doc; /* the document */
20725    int n_doc;
20726    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20727    int n_name;
20728
20729    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20730    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20731        mem_base = xmlMemBlocks();
20732        doc = gen_xmlDocPtr(n_doc, 0);
20733        name = gen_const_xmlChar_ptr(n_name, 1);
20734
20735        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20736        desret_xmlNodePtr(ret_val);
20737        call_tests++;
20738        des_xmlDocPtr(n_doc, doc, 0);
20739        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20740        xmlResetLastError();
20741        if (mem_base != xmlMemBlocks()) {
20742            printf("Leak of %d blocks found in xmlNewCharRef",
20743	           xmlMemBlocks() - mem_base);
20744	    test_ret++;
20745            printf(" %d", n_doc);
20746            printf(" %d", n_name);
20747            printf("\n");
20748        }
20749    }
20750    }
20751    function_tests++;
20752
20753    return(test_ret);
20754}
20755
20756
20757static int
20758test_xmlNewChild(void) {
20759    int test_ret = 0;
20760
20761#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20762#ifdef LIBXML_TREE_ENABLED
20763    int mem_base;
20764    xmlNodePtr ret_val;
20765    xmlNodePtr parent; /* the parent node */
20766    int n_parent;
20767    xmlNsPtr ns; /* a namespace if any */
20768    int n_ns;
20769    xmlChar * name; /* the name of the child */
20770    int n_name;
20771    xmlChar * content; /* the XML content of the child if any. */
20772    int n_content;
20773
20774    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20775    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20776    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20777    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20778        mem_base = xmlMemBlocks();
20779        parent = gen_xmlNodePtr(n_parent, 0);
20780        ns = gen_xmlNsPtr(n_ns, 1);
20781        name = gen_const_xmlChar_ptr(n_name, 2);
20782        content = gen_const_xmlChar_ptr(n_content, 3);
20783
20784        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20785        desret_xmlNodePtr(ret_val);
20786        call_tests++;
20787        des_xmlNodePtr(n_parent, parent, 0);
20788        des_xmlNsPtr(n_ns, ns, 1);
20789        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20790        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20791        xmlResetLastError();
20792        if (mem_base != xmlMemBlocks()) {
20793            printf("Leak of %d blocks found in xmlNewChild",
20794	           xmlMemBlocks() - mem_base);
20795	    test_ret++;
20796            printf(" %d", n_parent);
20797            printf(" %d", n_ns);
20798            printf(" %d", n_name);
20799            printf(" %d", n_content);
20800            printf("\n");
20801        }
20802    }
20803    }
20804    }
20805    }
20806    function_tests++;
20807#endif
20808#endif
20809
20810    return(test_ret);
20811}
20812
20813
20814static int
20815test_xmlNewComment(void) {
20816    int test_ret = 0;
20817
20818    int mem_base;
20819    xmlNodePtr ret_val;
20820    xmlChar * content; /* the comment content */
20821    int n_content;
20822
20823    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20824        mem_base = xmlMemBlocks();
20825        content = gen_const_xmlChar_ptr(n_content, 0);
20826
20827        ret_val = xmlNewComment((const xmlChar *)content);
20828        desret_xmlNodePtr(ret_val);
20829        call_tests++;
20830        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20831        xmlResetLastError();
20832        if (mem_base != xmlMemBlocks()) {
20833            printf("Leak of %d blocks found in xmlNewComment",
20834	           xmlMemBlocks() - mem_base);
20835	    test_ret++;
20836            printf(" %d", n_content);
20837            printf("\n");
20838        }
20839    }
20840    function_tests++;
20841
20842    return(test_ret);
20843}
20844
20845
20846static int
20847test_xmlNewDoc(void) {
20848    int test_ret = 0;
20849
20850    int mem_base;
20851    xmlDocPtr ret_val;
20852    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20853    int n_version;
20854
20855    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20856        mem_base = xmlMemBlocks();
20857        version = gen_const_xmlChar_ptr(n_version, 0);
20858
20859        ret_val = xmlNewDoc((const xmlChar *)version);
20860        desret_xmlDocPtr(ret_val);
20861        call_tests++;
20862        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20863        xmlResetLastError();
20864        if (mem_base != xmlMemBlocks()) {
20865            printf("Leak of %d blocks found in xmlNewDoc",
20866	           xmlMemBlocks() - mem_base);
20867	    test_ret++;
20868            printf(" %d", n_version);
20869            printf("\n");
20870        }
20871    }
20872    function_tests++;
20873
20874    return(test_ret);
20875}
20876
20877
20878static int
20879test_xmlNewDocComment(void) {
20880    int test_ret = 0;
20881
20882    int mem_base;
20883    xmlNodePtr ret_val;
20884    xmlDocPtr doc; /* the document */
20885    int n_doc;
20886    xmlChar * content; /* the comment content */
20887    int n_content;
20888
20889    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20890    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20891        mem_base = xmlMemBlocks();
20892        doc = gen_xmlDocPtr(n_doc, 0);
20893        content = gen_const_xmlChar_ptr(n_content, 1);
20894
20895        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20896        desret_xmlNodePtr(ret_val);
20897        call_tests++;
20898        des_xmlDocPtr(n_doc, doc, 0);
20899        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20900        xmlResetLastError();
20901        if (mem_base != xmlMemBlocks()) {
20902            printf("Leak of %d blocks found in xmlNewDocComment",
20903	           xmlMemBlocks() - mem_base);
20904	    test_ret++;
20905            printf(" %d", n_doc);
20906            printf(" %d", n_content);
20907            printf("\n");
20908        }
20909    }
20910    }
20911    function_tests++;
20912
20913    return(test_ret);
20914}
20915
20916
20917static int
20918test_xmlNewDocFragment(void) {
20919    int test_ret = 0;
20920
20921#if defined(LIBXML_TREE_ENABLED)
20922    int mem_base;
20923    xmlNodePtr ret_val;
20924    xmlDocPtr doc; /* the document owning the fragment */
20925    int n_doc;
20926
20927    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20928        mem_base = xmlMemBlocks();
20929        doc = gen_xmlDocPtr(n_doc, 0);
20930
20931        ret_val = xmlNewDocFragment(doc);
20932        desret_xmlNodePtr(ret_val);
20933        call_tests++;
20934        des_xmlDocPtr(n_doc, doc, 0);
20935        xmlResetLastError();
20936        if (mem_base != xmlMemBlocks()) {
20937            printf("Leak of %d blocks found in xmlNewDocFragment",
20938	           xmlMemBlocks() - mem_base);
20939	    test_ret++;
20940            printf(" %d", n_doc);
20941            printf("\n");
20942        }
20943    }
20944    function_tests++;
20945#endif
20946
20947    return(test_ret);
20948}
20949
20950
20951static int
20952test_xmlNewDocNode(void) {
20953    int test_ret = 0;
20954
20955    int mem_base;
20956    xmlNodePtr ret_val;
20957    xmlDocPtr doc; /* the document */
20958    int n_doc;
20959    xmlNsPtr ns; /* namespace if any */
20960    int n_ns;
20961    xmlChar * name; /* the node name */
20962    int n_name;
20963    xmlChar * content; /* the XML text content if any */
20964    int n_content;
20965
20966    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20967    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20968    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20969    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20970        mem_base = xmlMemBlocks();
20971        doc = gen_xmlDocPtr(n_doc, 0);
20972        ns = gen_xmlNsPtr(n_ns, 1);
20973        name = gen_const_xmlChar_ptr(n_name, 2);
20974        content = gen_const_xmlChar_ptr(n_content, 3);
20975
20976        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20977        desret_xmlNodePtr(ret_val);
20978        call_tests++;
20979        des_xmlDocPtr(n_doc, doc, 0);
20980        des_xmlNsPtr(n_ns, ns, 1);
20981        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20982        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20983        xmlResetLastError();
20984        if (mem_base != xmlMemBlocks()) {
20985            printf("Leak of %d blocks found in xmlNewDocNode",
20986	           xmlMemBlocks() - mem_base);
20987	    test_ret++;
20988            printf(" %d", n_doc);
20989            printf(" %d", n_ns);
20990            printf(" %d", n_name);
20991            printf(" %d", n_content);
20992            printf("\n");
20993        }
20994    }
20995    }
20996    }
20997    }
20998    function_tests++;
20999
21000    return(test_ret);
21001}
21002
21003
21004static int
21005test_xmlNewDocNodeEatName(void) {
21006    int test_ret = 0;
21007
21008    int mem_base;
21009    xmlNodePtr ret_val;
21010    xmlDocPtr doc; /* the document */
21011    int n_doc;
21012    xmlNsPtr ns; /* namespace if any */
21013    int n_ns;
21014    xmlChar * name; /* the node name */
21015    int n_name;
21016    xmlChar * content; /* the XML text content if any */
21017    int n_content;
21018
21019    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21020    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21021    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21022    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21023        mem_base = xmlMemBlocks();
21024        doc = gen_xmlDocPtr(n_doc, 0);
21025        ns = gen_xmlNsPtr(n_ns, 1);
21026        name = gen_eaten_name(n_name, 2);
21027        content = gen_const_xmlChar_ptr(n_content, 3);
21028
21029        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21030        desret_xmlNodePtr(ret_val);
21031        call_tests++;
21032        des_xmlDocPtr(n_doc, doc, 0);
21033        des_xmlNsPtr(n_ns, ns, 1);
21034        des_eaten_name(n_name, name, 2);
21035        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21036        xmlResetLastError();
21037        if (mem_base != xmlMemBlocks()) {
21038            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21039	           xmlMemBlocks() - mem_base);
21040	    test_ret++;
21041            printf(" %d", n_doc);
21042            printf(" %d", n_ns);
21043            printf(" %d", n_name);
21044            printf(" %d", n_content);
21045            printf("\n");
21046        }
21047    }
21048    }
21049    }
21050    }
21051    function_tests++;
21052
21053    return(test_ret);
21054}
21055
21056
21057static int
21058test_xmlNewDocPI(void) {
21059    int test_ret = 0;
21060
21061    int mem_base;
21062    xmlNodePtr ret_val;
21063    xmlDocPtr doc; /* the target document */
21064    int n_doc;
21065    xmlChar * name; /* the processing instruction name */
21066    int n_name;
21067    xmlChar * content; /* the PI content */
21068    int n_content;
21069
21070    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21071    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21072    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21073        mem_base = xmlMemBlocks();
21074        doc = gen_xmlDocPtr(n_doc, 0);
21075        name = gen_const_xmlChar_ptr(n_name, 1);
21076        content = gen_const_xmlChar_ptr(n_content, 2);
21077
21078        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21079        desret_xmlNodePtr(ret_val);
21080        call_tests++;
21081        des_xmlDocPtr(n_doc, doc, 0);
21082        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21083        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21084        xmlResetLastError();
21085        if (mem_base != xmlMemBlocks()) {
21086            printf("Leak of %d blocks found in xmlNewDocPI",
21087	           xmlMemBlocks() - mem_base);
21088	    test_ret++;
21089            printf(" %d", n_doc);
21090            printf(" %d", n_name);
21091            printf(" %d", n_content);
21092            printf("\n");
21093        }
21094    }
21095    }
21096    }
21097    function_tests++;
21098
21099    return(test_ret);
21100}
21101
21102
21103static int
21104test_xmlNewDocProp(void) {
21105    int test_ret = 0;
21106
21107    int mem_base;
21108    xmlAttrPtr ret_val;
21109    xmlDocPtr doc; /* the document */
21110    int n_doc;
21111    xmlChar * name; /* the name of the attribute */
21112    int n_name;
21113    xmlChar * value; /* the value of the attribute */
21114    int n_value;
21115
21116    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21117    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21118    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21119        mem_base = xmlMemBlocks();
21120        doc = gen_xmlDocPtr(n_doc, 0);
21121        name = gen_const_xmlChar_ptr(n_name, 1);
21122        value = gen_const_xmlChar_ptr(n_value, 2);
21123
21124        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21125        desret_xmlAttrPtr(ret_val);
21126        call_tests++;
21127        des_xmlDocPtr(n_doc, doc, 0);
21128        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21129        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21130        xmlResetLastError();
21131        if (mem_base != xmlMemBlocks()) {
21132            printf("Leak of %d blocks found in xmlNewDocProp",
21133	           xmlMemBlocks() - mem_base);
21134	    test_ret++;
21135            printf(" %d", n_doc);
21136            printf(" %d", n_name);
21137            printf(" %d", n_value);
21138            printf("\n");
21139        }
21140    }
21141    }
21142    }
21143    function_tests++;
21144
21145    return(test_ret);
21146}
21147
21148
21149static int
21150test_xmlNewDocRawNode(void) {
21151    int test_ret = 0;
21152
21153#if defined(LIBXML_TREE_ENABLED)
21154#ifdef LIBXML_TREE_ENABLED
21155    int mem_base;
21156    xmlNodePtr ret_val;
21157    xmlDocPtr doc; /* the document */
21158    int n_doc;
21159    xmlNsPtr ns; /* namespace if any */
21160    int n_ns;
21161    xmlChar * name; /* the node name */
21162    int n_name;
21163    xmlChar * content; /* the text content if any */
21164    int n_content;
21165
21166    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21167    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21168    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21169    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21170        mem_base = xmlMemBlocks();
21171        doc = gen_xmlDocPtr(n_doc, 0);
21172        ns = gen_xmlNsPtr(n_ns, 1);
21173        name = gen_const_xmlChar_ptr(n_name, 2);
21174        content = gen_const_xmlChar_ptr(n_content, 3);
21175
21176        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21177        desret_xmlNodePtr(ret_val);
21178        call_tests++;
21179        des_xmlDocPtr(n_doc, doc, 0);
21180        des_xmlNsPtr(n_ns, ns, 1);
21181        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21182        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21183        xmlResetLastError();
21184        if (mem_base != xmlMemBlocks()) {
21185            printf("Leak of %d blocks found in xmlNewDocRawNode",
21186	           xmlMemBlocks() - mem_base);
21187	    test_ret++;
21188            printf(" %d", n_doc);
21189            printf(" %d", n_ns);
21190            printf(" %d", n_name);
21191            printf(" %d", n_content);
21192            printf("\n");
21193        }
21194    }
21195    }
21196    }
21197    }
21198    function_tests++;
21199#endif
21200#endif
21201
21202    return(test_ret);
21203}
21204
21205
21206static int
21207test_xmlNewDocText(void) {
21208    int test_ret = 0;
21209
21210    int mem_base;
21211    xmlNodePtr ret_val;
21212    xmlDocPtr doc; /* the document */
21213    int n_doc;
21214    xmlChar * content; /* the text content */
21215    int n_content;
21216
21217    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21218    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21219        mem_base = xmlMemBlocks();
21220        doc = gen_xmlDocPtr(n_doc, 0);
21221        content = gen_const_xmlChar_ptr(n_content, 1);
21222
21223        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21224        desret_xmlNodePtr(ret_val);
21225        call_tests++;
21226        des_xmlDocPtr(n_doc, doc, 0);
21227        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21228        xmlResetLastError();
21229        if (mem_base != xmlMemBlocks()) {
21230            printf("Leak of %d blocks found in xmlNewDocText",
21231	           xmlMemBlocks() - mem_base);
21232	    test_ret++;
21233            printf(" %d", n_doc);
21234            printf(" %d", n_content);
21235            printf("\n");
21236        }
21237    }
21238    }
21239    function_tests++;
21240
21241    return(test_ret);
21242}
21243
21244
21245static int
21246test_xmlNewDocTextLen(void) {
21247    int test_ret = 0;
21248
21249    int mem_base;
21250    xmlNodePtr ret_val;
21251    xmlDocPtr doc; /* the document */
21252    int n_doc;
21253    xmlChar * content; /* the text content */
21254    int n_content;
21255    int len; /* the text len. */
21256    int n_len;
21257
21258    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21259    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21260    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21261        mem_base = xmlMemBlocks();
21262        doc = gen_xmlDocPtr(n_doc, 0);
21263        content = gen_const_xmlChar_ptr(n_content, 1);
21264        len = gen_int(n_len, 2);
21265
21266        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21267        desret_xmlNodePtr(ret_val);
21268        call_tests++;
21269        des_xmlDocPtr(n_doc, doc, 0);
21270        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21271        des_int(n_len, len, 2);
21272        xmlResetLastError();
21273        if (mem_base != xmlMemBlocks()) {
21274            printf("Leak of %d blocks found in xmlNewDocTextLen",
21275	           xmlMemBlocks() - mem_base);
21276	    test_ret++;
21277            printf(" %d", n_doc);
21278            printf(" %d", n_content);
21279            printf(" %d", n_len);
21280            printf("\n");
21281        }
21282    }
21283    }
21284    }
21285    function_tests++;
21286
21287    return(test_ret);
21288}
21289
21290
21291static int
21292test_xmlNewDtd(void) {
21293    int test_ret = 0;
21294
21295    int mem_base;
21296    xmlDtdPtr ret_val;
21297    xmlDocPtr doc; /* the document pointer */
21298    int n_doc;
21299    xmlChar * name; /* the DTD name */
21300    int n_name;
21301    xmlChar * ExternalID; /* the external ID */
21302    int n_ExternalID;
21303    xmlChar * SystemID; /* the system ID */
21304    int n_SystemID;
21305
21306    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21307    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21308    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21309    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21310        mem_base = xmlMemBlocks();
21311        doc = gen_xmlDocPtr(n_doc, 0);
21312        name = gen_const_xmlChar_ptr(n_name, 1);
21313        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21314        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21315
21316        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21317        desret_xmlDtdPtr(ret_val);
21318        call_tests++;
21319        des_xmlDocPtr(n_doc, doc, 0);
21320        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21321        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21322        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21323        xmlResetLastError();
21324        if (mem_base != xmlMemBlocks()) {
21325            printf("Leak of %d blocks found in xmlNewDtd",
21326	           xmlMemBlocks() - mem_base);
21327	    test_ret++;
21328            printf(" %d", n_doc);
21329            printf(" %d", n_name);
21330            printf(" %d", n_ExternalID);
21331            printf(" %d", n_SystemID);
21332            printf("\n");
21333        }
21334    }
21335    }
21336    }
21337    }
21338    function_tests++;
21339
21340    return(test_ret);
21341}
21342
21343
21344static int
21345test_xmlNewNode(void) {
21346    int test_ret = 0;
21347
21348    int mem_base;
21349    xmlNodePtr ret_val;
21350    xmlNsPtr ns; /* namespace if any */
21351    int n_ns;
21352    xmlChar * name; /* the node name */
21353    int n_name;
21354
21355    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21356    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21357        mem_base = xmlMemBlocks();
21358        ns = gen_xmlNsPtr(n_ns, 0);
21359        name = gen_const_xmlChar_ptr(n_name, 1);
21360
21361        ret_val = xmlNewNode(ns, (const xmlChar *)name);
21362        desret_xmlNodePtr(ret_val);
21363        call_tests++;
21364        des_xmlNsPtr(n_ns, ns, 0);
21365        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21366        xmlResetLastError();
21367        if (mem_base != xmlMemBlocks()) {
21368            printf("Leak of %d blocks found in xmlNewNode",
21369	           xmlMemBlocks() - mem_base);
21370	    test_ret++;
21371            printf(" %d", n_ns);
21372            printf(" %d", n_name);
21373            printf("\n");
21374        }
21375    }
21376    }
21377    function_tests++;
21378
21379    return(test_ret);
21380}
21381
21382
21383static int
21384test_xmlNewNodeEatName(void) {
21385    int test_ret = 0;
21386
21387    int mem_base;
21388    xmlNodePtr ret_val;
21389    xmlNsPtr ns; /* namespace if any */
21390    int n_ns;
21391    xmlChar * name; /* the node name */
21392    int n_name;
21393
21394    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21395    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21396        mem_base = xmlMemBlocks();
21397        ns = gen_xmlNsPtr(n_ns, 0);
21398        name = gen_eaten_name(n_name, 1);
21399
21400        ret_val = xmlNewNodeEatName(ns, name);
21401        desret_xmlNodePtr(ret_val);
21402        call_tests++;
21403        des_xmlNsPtr(n_ns, ns, 0);
21404        des_eaten_name(n_name, name, 1);
21405        xmlResetLastError();
21406        if (mem_base != xmlMemBlocks()) {
21407            printf("Leak of %d blocks found in xmlNewNodeEatName",
21408	           xmlMemBlocks() - mem_base);
21409	    test_ret++;
21410            printf(" %d", n_ns);
21411            printf(" %d", n_name);
21412            printf("\n");
21413        }
21414    }
21415    }
21416    function_tests++;
21417
21418    return(test_ret);
21419}
21420
21421
21422static int
21423test_xmlNewNs(void) {
21424    int test_ret = 0;
21425
21426    int mem_base;
21427    xmlNsPtr ret_val;
21428    xmlNodePtr node; /* the element carrying the namespace */
21429    int n_node;
21430    xmlChar * href; /* the URI associated */
21431    int n_href;
21432    xmlChar * prefix; /* the prefix for the namespace */
21433    int n_prefix;
21434
21435    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21436    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21437    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21438        mem_base = xmlMemBlocks();
21439        node = gen_xmlNodePtr(n_node, 0);
21440        href = gen_const_xmlChar_ptr(n_href, 1);
21441        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21442
21443        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21444        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21445        desret_xmlNsPtr(ret_val);
21446        call_tests++;
21447        des_xmlNodePtr(n_node, node, 0);
21448        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21449        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21450        xmlResetLastError();
21451        if (mem_base != xmlMemBlocks()) {
21452            printf("Leak of %d blocks found in xmlNewNs",
21453	           xmlMemBlocks() - mem_base);
21454	    test_ret++;
21455            printf(" %d", n_node);
21456            printf(" %d", n_href);
21457            printf(" %d", n_prefix);
21458            printf("\n");
21459        }
21460    }
21461    }
21462    }
21463    function_tests++;
21464
21465    return(test_ret);
21466}
21467
21468
21469static int
21470test_xmlNewNsProp(void) {
21471    int test_ret = 0;
21472
21473    int mem_base;
21474    xmlAttrPtr ret_val;
21475    xmlNodePtr node; /* the holding node */
21476    int n_node;
21477    xmlNsPtr ns; /* the namespace */
21478    int n_ns;
21479    xmlChar * name; /* the name of the attribute */
21480    int n_name;
21481    xmlChar * value; /* the value of the attribute */
21482    int n_value;
21483
21484    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21485    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21486    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21487    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21488        mem_base = xmlMemBlocks();
21489        node = gen_xmlNodePtr(n_node, 0);
21490        ns = gen_xmlNsPtr(n_ns, 1);
21491        name = gen_const_xmlChar_ptr(n_name, 2);
21492        value = gen_const_xmlChar_ptr(n_value, 3);
21493
21494        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21495        desret_xmlAttrPtr(ret_val);
21496        call_tests++;
21497        des_xmlNodePtr(n_node, node, 0);
21498        des_xmlNsPtr(n_ns, ns, 1);
21499        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21500        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21501        xmlResetLastError();
21502        if (mem_base != xmlMemBlocks()) {
21503            printf("Leak of %d blocks found in xmlNewNsProp",
21504	           xmlMemBlocks() - mem_base);
21505	    test_ret++;
21506            printf(" %d", n_node);
21507            printf(" %d", n_ns);
21508            printf(" %d", n_name);
21509            printf(" %d", n_value);
21510            printf("\n");
21511        }
21512    }
21513    }
21514    }
21515    }
21516    function_tests++;
21517
21518    return(test_ret);
21519}
21520
21521
21522static int
21523test_xmlNewNsPropEatName(void) {
21524    int test_ret = 0;
21525
21526    int mem_base;
21527    xmlAttrPtr ret_val;
21528    xmlNodePtr node; /* the holding node */
21529    int n_node;
21530    xmlNsPtr ns; /* the namespace */
21531    int n_ns;
21532    xmlChar * name; /* the name of the attribute */
21533    int n_name;
21534    xmlChar * value; /* the value of the attribute */
21535    int n_value;
21536
21537    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21538    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21539    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21540    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21541        mem_base = xmlMemBlocks();
21542        node = gen_xmlNodePtr(n_node, 0);
21543        ns = gen_xmlNsPtr(n_ns, 1);
21544        name = gen_eaten_name(n_name, 2);
21545        value = gen_const_xmlChar_ptr(n_value, 3);
21546
21547        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21548        desret_xmlAttrPtr(ret_val);
21549        call_tests++;
21550        des_xmlNodePtr(n_node, node, 0);
21551        des_xmlNsPtr(n_ns, ns, 1);
21552        des_eaten_name(n_name, name, 2);
21553        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21554        xmlResetLastError();
21555        if (mem_base != xmlMemBlocks()) {
21556            printf("Leak of %d blocks found in xmlNewNsPropEatName",
21557	           xmlMemBlocks() - mem_base);
21558	    test_ret++;
21559            printf(" %d", n_node);
21560            printf(" %d", n_ns);
21561            printf(" %d", n_name);
21562            printf(" %d", n_value);
21563            printf("\n");
21564        }
21565    }
21566    }
21567    }
21568    }
21569    function_tests++;
21570
21571    return(test_ret);
21572}
21573
21574
21575static int
21576test_xmlNewPI(void) {
21577    int test_ret = 0;
21578
21579    int mem_base;
21580    xmlNodePtr ret_val;
21581    xmlChar * name; /* the processing instruction name */
21582    int n_name;
21583    xmlChar * content; /* the PI content */
21584    int n_content;
21585
21586    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21587    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21588        mem_base = xmlMemBlocks();
21589        name = gen_const_xmlChar_ptr(n_name, 0);
21590        content = gen_const_xmlChar_ptr(n_content, 1);
21591
21592        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21593        desret_xmlNodePtr(ret_val);
21594        call_tests++;
21595        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21596        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21597        xmlResetLastError();
21598        if (mem_base != xmlMemBlocks()) {
21599            printf("Leak of %d blocks found in xmlNewPI",
21600	           xmlMemBlocks() - mem_base);
21601	    test_ret++;
21602            printf(" %d", n_name);
21603            printf(" %d", n_content);
21604            printf("\n");
21605        }
21606    }
21607    }
21608    function_tests++;
21609
21610    return(test_ret);
21611}
21612
21613
21614static int
21615test_xmlNewProp(void) {
21616    int test_ret = 0;
21617
21618#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21619#ifdef LIBXML_TREE_ENABLED
21620    int mem_base;
21621    xmlAttrPtr ret_val;
21622    xmlNodePtr node; /* the holding node */
21623    int n_node;
21624    xmlChar * name; /* the name of the attribute */
21625    int n_name;
21626    xmlChar * value; /* the value of the attribute */
21627    int n_value;
21628
21629    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21630    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21631    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21632        mem_base = xmlMemBlocks();
21633        node = gen_xmlNodePtr(n_node, 0);
21634        name = gen_const_xmlChar_ptr(n_name, 1);
21635        value = gen_const_xmlChar_ptr(n_value, 2);
21636
21637        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21638        desret_xmlAttrPtr(ret_val);
21639        call_tests++;
21640        des_xmlNodePtr(n_node, node, 0);
21641        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21642        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21643        xmlResetLastError();
21644        if (mem_base != xmlMemBlocks()) {
21645            printf("Leak of %d blocks found in xmlNewProp",
21646	           xmlMemBlocks() - mem_base);
21647	    test_ret++;
21648            printf(" %d", n_node);
21649            printf(" %d", n_name);
21650            printf(" %d", n_value);
21651            printf("\n");
21652        }
21653    }
21654    }
21655    }
21656    function_tests++;
21657#endif
21658#endif
21659
21660    return(test_ret);
21661}
21662
21663
21664static int
21665test_xmlNewReference(void) {
21666    int test_ret = 0;
21667
21668    int mem_base;
21669    xmlNodePtr ret_val;
21670    xmlDocPtr doc; /* the document */
21671    int n_doc;
21672    xmlChar * name; /* the reference name, or the reference string with & and ; */
21673    int n_name;
21674
21675    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21676    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21677        mem_base = xmlMemBlocks();
21678        doc = gen_xmlDocPtr(n_doc, 0);
21679        name = gen_const_xmlChar_ptr(n_name, 1);
21680
21681        ret_val = xmlNewReference(doc, (const xmlChar *)name);
21682        desret_xmlNodePtr(ret_val);
21683        call_tests++;
21684        des_xmlDocPtr(n_doc, doc, 0);
21685        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21686        xmlResetLastError();
21687        if (mem_base != xmlMemBlocks()) {
21688            printf("Leak of %d blocks found in xmlNewReference",
21689	           xmlMemBlocks() - mem_base);
21690	    test_ret++;
21691            printf(" %d", n_doc);
21692            printf(" %d", n_name);
21693            printf("\n");
21694        }
21695    }
21696    }
21697    function_tests++;
21698
21699    return(test_ret);
21700}
21701
21702
21703static int
21704test_xmlNewText(void) {
21705    int test_ret = 0;
21706
21707    int mem_base;
21708    xmlNodePtr ret_val;
21709    xmlChar * content; /* the text content */
21710    int n_content;
21711
21712    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21713        mem_base = xmlMemBlocks();
21714        content = gen_const_xmlChar_ptr(n_content, 0);
21715
21716        ret_val = xmlNewText((const xmlChar *)content);
21717        desret_xmlNodePtr(ret_val);
21718        call_tests++;
21719        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21720        xmlResetLastError();
21721        if (mem_base != xmlMemBlocks()) {
21722            printf("Leak of %d blocks found in xmlNewText",
21723	           xmlMemBlocks() - mem_base);
21724	    test_ret++;
21725            printf(" %d", n_content);
21726            printf("\n");
21727        }
21728    }
21729    function_tests++;
21730
21731    return(test_ret);
21732}
21733
21734
21735static int
21736test_xmlNewTextChild(void) {
21737    int test_ret = 0;
21738
21739#if defined(LIBXML_TREE_ENABLED)
21740#ifdef LIBXML_TREE_ENABLED
21741    int mem_base;
21742    xmlNodePtr ret_val;
21743    xmlNodePtr parent; /* the parent node */
21744    int n_parent;
21745    xmlNsPtr ns; /* a namespace if any */
21746    int n_ns;
21747    xmlChar * name; /* the name of the child */
21748    int n_name;
21749    xmlChar * content; /* the text content of the child if any. */
21750    int n_content;
21751
21752    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21753    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21754    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21755    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21756        mem_base = xmlMemBlocks();
21757        parent = gen_xmlNodePtr(n_parent, 0);
21758        ns = gen_xmlNsPtr(n_ns, 1);
21759        name = gen_const_xmlChar_ptr(n_name, 2);
21760        content = gen_const_xmlChar_ptr(n_content, 3);
21761
21762        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21763        desret_xmlNodePtr(ret_val);
21764        call_tests++;
21765        des_xmlNodePtr(n_parent, parent, 0);
21766        des_xmlNsPtr(n_ns, ns, 1);
21767        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21768        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21769        xmlResetLastError();
21770        if (mem_base != xmlMemBlocks()) {
21771            printf("Leak of %d blocks found in xmlNewTextChild",
21772	           xmlMemBlocks() - mem_base);
21773	    test_ret++;
21774            printf(" %d", n_parent);
21775            printf(" %d", n_ns);
21776            printf(" %d", n_name);
21777            printf(" %d", n_content);
21778            printf("\n");
21779        }
21780    }
21781    }
21782    }
21783    }
21784    function_tests++;
21785#endif
21786#endif
21787
21788    return(test_ret);
21789}
21790
21791
21792static int
21793test_xmlNewTextLen(void) {
21794    int test_ret = 0;
21795
21796    int mem_base;
21797    xmlNodePtr ret_val;
21798    xmlChar * content; /* the text content */
21799    int n_content;
21800    int len; /* the text len. */
21801    int n_len;
21802
21803    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21804    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21805        mem_base = xmlMemBlocks();
21806        content = gen_const_xmlChar_ptr(n_content, 0);
21807        len = gen_int(n_len, 1);
21808
21809        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21810        desret_xmlNodePtr(ret_val);
21811        call_tests++;
21812        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21813        des_int(n_len, len, 1);
21814        xmlResetLastError();
21815        if (mem_base != xmlMemBlocks()) {
21816            printf("Leak of %d blocks found in xmlNewTextLen",
21817	           xmlMemBlocks() - mem_base);
21818	    test_ret++;
21819            printf(" %d", n_content);
21820            printf(" %d", n_len);
21821            printf("\n");
21822        }
21823    }
21824    }
21825    function_tests++;
21826
21827    return(test_ret);
21828}
21829
21830
21831static int
21832test_xmlNodeAddContent(void) {
21833    int test_ret = 0;
21834
21835    int mem_base;
21836    xmlNodePtr cur; /* the node being modified */
21837    int n_cur;
21838    xmlChar * content; /* extra content */
21839    int n_content;
21840
21841    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21842    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21843        mem_base = xmlMemBlocks();
21844        cur = gen_xmlNodePtr(n_cur, 0);
21845        content = gen_const_xmlChar_ptr(n_content, 1);
21846
21847        xmlNodeAddContent(cur, (const xmlChar *)content);
21848        call_tests++;
21849        des_xmlNodePtr(n_cur, cur, 0);
21850        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21851        xmlResetLastError();
21852        if (mem_base != xmlMemBlocks()) {
21853            printf("Leak of %d blocks found in xmlNodeAddContent",
21854	           xmlMemBlocks() - mem_base);
21855	    test_ret++;
21856            printf(" %d", n_cur);
21857            printf(" %d", n_content);
21858            printf("\n");
21859        }
21860    }
21861    }
21862    function_tests++;
21863
21864    return(test_ret);
21865}
21866
21867
21868static int
21869test_xmlNodeAddContentLen(void) {
21870    int test_ret = 0;
21871
21872    int mem_base;
21873    xmlNodePtr cur; /* the node being modified */
21874    int n_cur;
21875    xmlChar * content; /* extra content */
21876    int n_content;
21877    int len; /* the size of @content */
21878    int n_len;
21879
21880    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21881    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21882    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21883        mem_base = xmlMemBlocks();
21884        cur = gen_xmlNodePtr(n_cur, 0);
21885        content = gen_const_xmlChar_ptr(n_content, 1);
21886        len = gen_int(n_len, 2);
21887
21888        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21889        call_tests++;
21890        des_xmlNodePtr(n_cur, cur, 0);
21891        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21892        des_int(n_len, len, 2);
21893        xmlResetLastError();
21894        if (mem_base != xmlMemBlocks()) {
21895            printf("Leak of %d blocks found in xmlNodeAddContentLen",
21896	           xmlMemBlocks() - mem_base);
21897	    test_ret++;
21898            printf(" %d", n_cur);
21899            printf(" %d", n_content);
21900            printf(" %d", n_len);
21901            printf("\n");
21902        }
21903    }
21904    }
21905    }
21906    function_tests++;
21907
21908    return(test_ret);
21909}
21910
21911
21912static int
21913test_xmlNodeBufGetContent(void) {
21914    int test_ret = 0;
21915
21916    int mem_base;
21917    int ret_val;
21918    xmlBufferPtr buffer; /* a buffer */
21919    int n_buffer;
21920    xmlNodePtr cur; /* the node being read */
21921    int n_cur;
21922
21923    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21924    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21925        mem_base = xmlMemBlocks();
21926        buffer = gen_xmlBufferPtr(n_buffer, 0);
21927        cur = gen_xmlNodePtr(n_cur, 1);
21928
21929        ret_val = xmlNodeBufGetContent(buffer, cur);
21930        desret_int(ret_val);
21931        call_tests++;
21932        des_xmlBufferPtr(n_buffer, buffer, 0);
21933        des_xmlNodePtr(n_cur, cur, 1);
21934        xmlResetLastError();
21935        if (mem_base != xmlMemBlocks()) {
21936            printf("Leak of %d blocks found in xmlNodeBufGetContent",
21937	           xmlMemBlocks() - mem_base);
21938	    test_ret++;
21939            printf(" %d", n_buffer);
21940            printf(" %d", n_cur);
21941            printf("\n");
21942        }
21943    }
21944    }
21945    function_tests++;
21946
21947    return(test_ret);
21948}
21949
21950
21951static int
21952test_xmlNodeDump(void) {
21953    int test_ret = 0;
21954
21955#if defined(LIBXML_OUTPUT_ENABLED)
21956    int mem_base;
21957    int ret_val;
21958    xmlBufferPtr buf; /* the XML buffer output */
21959    int n_buf;
21960    xmlDocPtr doc; /* the document */
21961    int n_doc;
21962    xmlNodePtr cur; /* the current node */
21963    int n_cur;
21964    int level; /* the imbrication level for indenting */
21965    int n_level;
21966    int format; /* is formatting allowed */
21967    int n_format;
21968
21969    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21970    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21971    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21972    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21973    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21974        mem_base = xmlMemBlocks();
21975        buf = gen_xmlBufferPtr(n_buf, 0);
21976        doc = gen_xmlDocPtr(n_doc, 1);
21977        cur = gen_xmlNodePtr(n_cur, 2);
21978        level = gen_int(n_level, 3);
21979        format = gen_int(n_format, 4);
21980
21981        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21982        desret_int(ret_val);
21983        call_tests++;
21984        des_xmlBufferPtr(n_buf, buf, 0);
21985        des_xmlDocPtr(n_doc, doc, 1);
21986        des_xmlNodePtr(n_cur, cur, 2);
21987        des_int(n_level, level, 3);
21988        des_int(n_format, format, 4);
21989        xmlResetLastError();
21990        if (mem_base != xmlMemBlocks()) {
21991            printf("Leak of %d blocks found in xmlNodeDump",
21992	           xmlMemBlocks() - mem_base);
21993	    test_ret++;
21994            printf(" %d", n_buf);
21995            printf(" %d", n_doc);
21996            printf(" %d", n_cur);
21997            printf(" %d", n_level);
21998            printf(" %d", n_format);
21999            printf("\n");
22000        }
22001    }
22002    }
22003    }
22004    }
22005    }
22006    function_tests++;
22007#endif
22008
22009    return(test_ret);
22010}
22011
22012
22013static int
22014test_xmlNodeDumpOutput(void) {
22015    int test_ret = 0;
22016
22017#if defined(LIBXML_OUTPUT_ENABLED)
22018    int mem_base;
22019    xmlOutputBufferPtr buf; /* the XML buffer output */
22020    int n_buf;
22021    xmlDocPtr doc; /* the document */
22022    int n_doc;
22023    xmlNodePtr cur; /* the current node */
22024    int n_cur;
22025    int level; /* the imbrication level for indenting */
22026    int n_level;
22027    int format; /* is formatting allowed */
22028    int n_format;
22029    char * encoding; /* an optional encoding string */
22030    int n_encoding;
22031
22032    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22033    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22034    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22035    for (n_level = 0;n_level < gen_nb_int;n_level++) {
22036    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22037    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22038        mem_base = xmlMemBlocks();
22039        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22040        doc = gen_xmlDocPtr(n_doc, 1);
22041        cur = gen_xmlNodePtr(n_cur, 2);
22042        level = gen_int(n_level, 3);
22043        format = gen_int(n_format, 4);
22044        encoding = gen_const_char_ptr(n_encoding, 5);
22045
22046        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22047        call_tests++;
22048        des_xmlOutputBufferPtr(n_buf, buf, 0);
22049        des_xmlDocPtr(n_doc, doc, 1);
22050        des_xmlNodePtr(n_cur, cur, 2);
22051        des_int(n_level, level, 3);
22052        des_int(n_format, format, 4);
22053        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22054        xmlResetLastError();
22055        if (mem_base != xmlMemBlocks()) {
22056            printf("Leak of %d blocks found in xmlNodeDumpOutput",
22057	           xmlMemBlocks() - mem_base);
22058	    test_ret++;
22059            printf(" %d", n_buf);
22060            printf(" %d", n_doc);
22061            printf(" %d", n_cur);
22062            printf(" %d", n_level);
22063            printf(" %d", n_format);
22064            printf(" %d", n_encoding);
22065            printf("\n");
22066        }
22067    }
22068    }
22069    }
22070    }
22071    }
22072    }
22073    function_tests++;
22074#endif
22075
22076    return(test_ret);
22077}
22078
22079
22080static int
22081test_xmlNodeGetBase(void) {
22082    int test_ret = 0;
22083
22084    int mem_base;
22085    xmlChar * ret_val;
22086    xmlDocPtr doc; /* the document the node pertains to */
22087    int n_doc;
22088    xmlNodePtr cur; /* the node being checked */
22089    int n_cur;
22090
22091    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22092    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22093        mem_base = xmlMemBlocks();
22094        doc = gen_xmlDocPtr(n_doc, 0);
22095        cur = gen_xmlNodePtr(n_cur, 1);
22096
22097        ret_val = xmlNodeGetBase(doc, cur);
22098        desret_xmlChar_ptr(ret_val);
22099        call_tests++;
22100        des_xmlDocPtr(n_doc, doc, 0);
22101        des_xmlNodePtr(n_cur, cur, 1);
22102        xmlResetLastError();
22103        if (mem_base != xmlMemBlocks()) {
22104            printf("Leak of %d blocks found in xmlNodeGetBase",
22105	           xmlMemBlocks() - mem_base);
22106	    test_ret++;
22107            printf(" %d", n_doc);
22108            printf(" %d", n_cur);
22109            printf("\n");
22110        }
22111    }
22112    }
22113    function_tests++;
22114
22115    return(test_ret);
22116}
22117
22118
22119static int
22120test_xmlNodeGetContent(void) {
22121    int test_ret = 0;
22122
22123    int mem_base;
22124    xmlChar * ret_val;
22125    xmlNodePtr cur; /* the node being read */
22126    int n_cur;
22127
22128    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22129        mem_base = xmlMemBlocks();
22130        cur = gen_xmlNodePtr(n_cur, 0);
22131
22132        ret_val = xmlNodeGetContent(cur);
22133        desret_xmlChar_ptr(ret_val);
22134        call_tests++;
22135        des_xmlNodePtr(n_cur, cur, 0);
22136        xmlResetLastError();
22137        if (mem_base != xmlMemBlocks()) {
22138            printf("Leak of %d blocks found in xmlNodeGetContent",
22139	           xmlMemBlocks() - mem_base);
22140	    test_ret++;
22141            printf(" %d", n_cur);
22142            printf("\n");
22143        }
22144    }
22145    function_tests++;
22146
22147    return(test_ret);
22148}
22149
22150
22151static int
22152test_xmlNodeGetLang(void) {
22153    int test_ret = 0;
22154
22155    int mem_base;
22156    xmlChar * ret_val;
22157    xmlNodePtr cur; /* the node being checked */
22158    int n_cur;
22159
22160    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22161        mem_base = xmlMemBlocks();
22162        cur = gen_xmlNodePtr(n_cur, 0);
22163
22164        ret_val = xmlNodeGetLang(cur);
22165        desret_xmlChar_ptr(ret_val);
22166        call_tests++;
22167        des_xmlNodePtr(n_cur, cur, 0);
22168        xmlResetLastError();
22169        if (mem_base != xmlMemBlocks()) {
22170            printf("Leak of %d blocks found in xmlNodeGetLang",
22171	           xmlMemBlocks() - mem_base);
22172	    test_ret++;
22173            printf(" %d", n_cur);
22174            printf("\n");
22175        }
22176    }
22177    function_tests++;
22178
22179    return(test_ret);
22180}
22181
22182
22183static int
22184test_xmlNodeGetSpacePreserve(void) {
22185    int test_ret = 0;
22186
22187    int mem_base;
22188    int ret_val;
22189    xmlNodePtr cur; /* the node being checked */
22190    int n_cur;
22191
22192    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22193        mem_base = xmlMemBlocks();
22194        cur = gen_xmlNodePtr(n_cur, 0);
22195
22196        ret_val = xmlNodeGetSpacePreserve(cur);
22197        desret_int(ret_val);
22198        call_tests++;
22199        des_xmlNodePtr(n_cur, cur, 0);
22200        xmlResetLastError();
22201        if (mem_base != xmlMemBlocks()) {
22202            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22203	           xmlMemBlocks() - mem_base);
22204	    test_ret++;
22205            printf(" %d", n_cur);
22206            printf("\n");
22207        }
22208    }
22209    function_tests++;
22210
22211    return(test_ret);
22212}
22213
22214
22215static int
22216test_xmlNodeIsText(void) {
22217    int test_ret = 0;
22218
22219    int mem_base;
22220    int ret_val;
22221    xmlNodePtr node; /* the node */
22222    int n_node;
22223
22224    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22225        mem_base = xmlMemBlocks();
22226        node = gen_xmlNodePtr(n_node, 0);
22227
22228        ret_val = xmlNodeIsText(node);
22229        desret_int(ret_val);
22230        call_tests++;
22231        des_xmlNodePtr(n_node, node, 0);
22232        xmlResetLastError();
22233        if (mem_base != xmlMemBlocks()) {
22234            printf("Leak of %d blocks found in xmlNodeIsText",
22235	           xmlMemBlocks() - mem_base);
22236	    test_ret++;
22237            printf(" %d", n_node);
22238            printf("\n");
22239        }
22240    }
22241    function_tests++;
22242
22243    return(test_ret);
22244}
22245
22246
22247static int
22248test_xmlNodeListGetRawString(void) {
22249    int test_ret = 0;
22250
22251#if defined(LIBXML_TREE_ENABLED)
22252    int mem_base;
22253    xmlChar * ret_val;
22254    xmlDocPtr doc; /* the document */
22255    int n_doc;
22256    xmlNodePtr list; /* a Node list */
22257    int n_list;
22258    int inLine; /* should we replace entity contents or show their external form */
22259    int n_inLine;
22260
22261    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22262    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22263    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22264        mem_base = xmlMemBlocks();
22265        doc = gen_xmlDocPtr(n_doc, 0);
22266        list = gen_xmlNodePtr(n_list, 1);
22267        inLine = gen_int(n_inLine, 2);
22268
22269        ret_val = xmlNodeListGetRawString(doc, list, inLine);
22270        desret_xmlChar_ptr(ret_val);
22271        call_tests++;
22272        des_xmlDocPtr(n_doc, doc, 0);
22273        des_xmlNodePtr(n_list, list, 1);
22274        des_int(n_inLine, inLine, 2);
22275        xmlResetLastError();
22276        if (mem_base != xmlMemBlocks()) {
22277            printf("Leak of %d blocks found in xmlNodeListGetRawString",
22278	           xmlMemBlocks() - mem_base);
22279	    test_ret++;
22280            printf(" %d", n_doc);
22281            printf(" %d", n_list);
22282            printf(" %d", n_inLine);
22283            printf("\n");
22284        }
22285    }
22286    }
22287    }
22288    function_tests++;
22289#endif
22290
22291    return(test_ret);
22292}
22293
22294
22295static int
22296test_xmlNodeListGetString(void) {
22297    int test_ret = 0;
22298
22299    int mem_base;
22300    xmlChar * ret_val;
22301    xmlDocPtr doc; /* the document */
22302    int n_doc;
22303    xmlNodePtr list; /* a Node list */
22304    int n_list;
22305    int inLine; /* should we replace entity contents or show their external form */
22306    int n_inLine;
22307
22308    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22309    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22310    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22311        mem_base = xmlMemBlocks();
22312        doc = gen_xmlDocPtr(n_doc, 0);
22313        list = gen_xmlNodePtr(n_list, 1);
22314        inLine = gen_int(n_inLine, 2);
22315
22316        ret_val = xmlNodeListGetString(doc, list, inLine);
22317        desret_xmlChar_ptr(ret_val);
22318        call_tests++;
22319        des_xmlDocPtr(n_doc, doc, 0);
22320        des_xmlNodePtr(n_list, list, 1);
22321        des_int(n_inLine, inLine, 2);
22322        xmlResetLastError();
22323        if (mem_base != xmlMemBlocks()) {
22324            printf("Leak of %d blocks found in xmlNodeListGetString",
22325	           xmlMemBlocks() - mem_base);
22326	    test_ret++;
22327            printf(" %d", n_doc);
22328            printf(" %d", n_list);
22329            printf(" %d", n_inLine);
22330            printf("\n");
22331        }
22332    }
22333    }
22334    }
22335    function_tests++;
22336
22337    return(test_ret);
22338}
22339
22340
22341static int
22342test_xmlNodeSetBase(void) {
22343    int test_ret = 0;
22344
22345#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22346    int mem_base;
22347    xmlNodePtr cur; /* the node being changed */
22348    int n_cur;
22349    xmlChar * uri; /* the new base URI */
22350    int n_uri;
22351
22352    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22353    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22354        mem_base = xmlMemBlocks();
22355        cur = gen_xmlNodePtr(n_cur, 0);
22356        uri = gen_const_xmlChar_ptr(n_uri, 1);
22357
22358        xmlNodeSetBase(cur, (const xmlChar *)uri);
22359        call_tests++;
22360        des_xmlNodePtr(n_cur, cur, 0);
22361        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22362        xmlResetLastError();
22363        if (mem_base != xmlMemBlocks()) {
22364            printf("Leak of %d blocks found in xmlNodeSetBase",
22365	           xmlMemBlocks() - mem_base);
22366	    test_ret++;
22367            printf(" %d", n_cur);
22368            printf(" %d", n_uri);
22369            printf("\n");
22370        }
22371    }
22372    }
22373    function_tests++;
22374#endif
22375
22376    return(test_ret);
22377}
22378
22379
22380static int
22381test_xmlNodeSetContent(void) {
22382    int test_ret = 0;
22383
22384    int mem_base;
22385    xmlNodePtr cur; /* the node being modified */
22386    int n_cur;
22387    xmlChar * content; /* the new value of the content */
22388    int n_content;
22389
22390    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22391    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22392        mem_base = xmlMemBlocks();
22393        cur = gen_xmlNodePtr(n_cur, 0);
22394        content = gen_const_xmlChar_ptr(n_content, 1);
22395
22396        xmlNodeSetContent(cur, (const xmlChar *)content);
22397        call_tests++;
22398        des_xmlNodePtr(n_cur, cur, 0);
22399        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22400        xmlResetLastError();
22401        if (mem_base != xmlMemBlocks()) {
22402            printf("Leak of %d blocks found in xmlNodeSetContent",
22403	           xmlMemBlocks() - mem_base);
22404	    test_ret++;
22405            printf(" %d", n_cur);
22406            printf(" %d", n_content);
22407            printf("\n");
22408        }
22409    }
22410    }
22411    function_tests++;
22412
22413    return(test_ret);
22414}
22415
22416
22417static int
22418test_xmlNodeSetContentLen(void) {
22419    int test_ret = 0;
22420
22421#if defined(LIBXML_TREE_ENABLED)
22422    int mem_base;
22423    xmlNodePtr cur; /* the node being modified */
22424    int n_cur;
22425    xmlChar * content; /* the new value of the content */
22426    int n_content;
22427    int len; /* the size of @content */
22428    int n_len;
22429
22430    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22431    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22432    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22433        mem_base = xmlMemBlocks();
22434        cur = gen_xmlNodePtr(n_cur, 0);
22435        content = gen_const_xmlChar_ptr(n_content, 1);
22436        len = gen_int(n_len, 2);
22437
22438        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22439        call_tests++;
22440        des_xmlNodePtr(n_cur, cur, 0);
22441        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22442        des_int(n_len, len, 2);
22443        xmlResetLastError();
22444        if (mem_base != xmlMemBlocks()) {
22445            printf("Leak of %d blocks found in xmlNodeSetContentLen",
22446	           xmlMemBlocks() - mem_base);
22447	    test_ret++;
22448            printf(" %d", n_cur);
22449            printf(" %d", n_content);
22450            printf(" %d", n_len);
22451            printf("\n");
22452        }
22453    }
22454    }
22455    }
22456    function_tests++;
22457#endif
22458
22459    return(test_ret);
22460}
22461
22462
22463static int
22464test_xmlNodeSetLang(void) {
22465    int test_ret = 0;
22466
22467#if defined(LIBXML_TREE_ENABLED)
22468    int mem_base;
22469    xmlNodePtr cur; /* the node being changed */
22470    int n_cur;
22471    xmlChar * lang; /* the language description */
22472    int n_lang;
22473
22474    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22475    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22476        mem_base = xmlMemBlocks();
22477        cur = gen_xmlNodePtr(n_cur, 0);
22478        lang = gen_const_xmlChar_ptr(n_lang, 1);
22479
22480        xmlNodeSetLang(cur, (const xmlChar *)lang);
22481        call_tests++;
22482        des_xmlNodePtr(n_cur, cur, 0);
22483        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22484        xmlResetLastError();
22485        if (mem_base != xmlMemBlocks()) {
22486            printf("Leak of %d blocks found in xmlNodeSetLang",
22487	           xmlMemBlocks() - mem_base);
22488	    test_ret++;
22489            printf(" %d", n_cur);
22490            printf(" %d", n_lang);
22491            printf("\n");
22492        }
22493    }
22494    }
22495    function_tests++;
22496#endif
22497
22498    return(test_ret);
22499}
22500
22501
22502static int
22503test_xmlNodeSetName(void) {
22504    int test_ret = 0;
22505
22506#if defined(LIBXML_TREE_ENABLED)
22507    int mem_base;
22508    xmlNodePtr cur; /* the node being changed */
22509    int n_cur;
22510    xmlChar * name; /* the new tag name */
22511    int n_name;
22512
22513    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22514    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22515        mem_base = xmlMemBlocks();
22516        cur = gen_xmlNodePtr(n_cur, 0);
22517        name = gen_const_xmlChar_ptr(n_name, 1);
22518
22519        xmlNodeSetName(cur, (const xmlChar *)name);
22520        call_tests++;
22521        des_xmlNodePtr(n_cur, cur, 0);
22522        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22523        xmlResetLastError();
22524        if (mem_base != xmlMemBlocks()) {
22525            printf("Leak of %d blocks found in xmlNodeSetName",
22526	           xmlMemBlocks() - mem_base);
22527	    test_ret++;
22528            printf(" %d", n_cur);
22529            printf(" %d", n_name);
22530            printf("\n");
22531        }
22532    }
22533    }
22534    function_tests++;
22535#endif
22536
22537    return(test_ret);
22538}
22539
22540
22541static int
22542test_xmlNodeSetSpacePreserve(void) {
22543    int test_ret = 0;
22544
22545#if defined(LIBXML_TREE_ENABLED)
22546    int mem_base;
22547    xmlNodePtr cur; /* the node being changed */
22548    int n_cur;
22549    int val; /* the xml:space value ("0": default, 1: "preserve") */
22550    int n_val;
22551
22552    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22553    for (n_val = 0;n_val < gen_nb_int;n_val++) {
22554        mem_base = xmlMemBlocks();
22555        cur = gen_xmlNodePtr(n_cur, 0);
22556        val = gen_int(n_val, 1);
22557
22558        xmlNodeSetSpacePreserve(cur, val);
22559        call_tests++;
22560        des_xmlNodePtr(n_cur, cur, 0);
22561        des_int(n_val, val, 1);
22562        xmlResetLastError();
22563        if (mem_base != xmlMemBlocks()) {
22564            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22565	           xmlMemBlocks() - mem_base);
22566	    test_ret++;
22567            printf(" %d", n_cur);
22568            printf(" %d", n_val);
22569            printf("\n");
22570        }
22571    }
22572    }
22573    function_tests++;
22574#endif
22575
22576    return(test_ret);
22577}
22578
22579
22580static int
22581test_xmlReconciliateNs(void) {
22582    int test_ret = 0;
22583
22584#if defined(LIBXML_TREE_ENABLED)
22585#ifdef LIBXML_TREE_ENABLED
22586    int mem_base;
22587    int ret_val;
22588    xmlDocPtr doc; /* the document */
22589    int n_doc;
22590    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22591    int n_tree;
22592
22593    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22594    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22595        mem_base = xmlMemBlocks();
22596        doc = gen_xmlDocPtr(n_doc, 0);
22597        tree = gen_xmlNodePtr(n_tree, 1);
22598
22599        ret_val = xmlReconciliateNs(doc, tree);
22600        desret_int(ret_val);
22601        call_tests++;
22602        des_xmlDocPtr(n_doc, doc, 0);
22603        des_xmlNodePtr(n_tree, tree, 1);
22604        xmlResetLastError();
22605        if (mem_base != xmlMemBlocks()) {
22606            printf("Leak of %d blocks found in xmlReconciliateNs",
22607	           xmlMemBlocks() - mem_base);
22608	    test_ret++;
22609            printf(" %d", n_doc);
22610            printf(" %d", n_tree);
22611            printf("\n");
22612        }
22613    }
22614    }
22615    function_tests++;
22616#endif
22617#endif
22618
22619    return(test_ret);
22620}
22621
22622
22623static int
22624test_xmlRemoveProp(void) {
22625    int test_ret = 0;
22626
22627    int mem_base;
22628    int ret_val;
22629    xmlAttrPtr cur; /* an attribute */
22630    int n_cur;
22631
22632    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22633        mem_base = xmlMemBlocks();
22634        cur = gen_xmlAttrPtr(n_cur, 0);
22635
22636        ret_val = xmlRemoveProp(cur);
22637        cur = NULL;
22638        desret_int(ret_val);
22639        call_tests++;
22640        des_xmlAttrPtr(n_cur, cur, 0);
22641        xmlResetLastError();
22642        if (mem_base != xmlMemBlocks()) {
22643            printf("Leak of %d blocks found in xmlRemoveProp",
22644	           xmlMemBlocks() - mem_base);
22645	    test_ret++;
22646            printf(" %d", n_cur);
22647            printf("\n");
22648        }
22649    }
22650    function_tests++;
22651
22652    return(test_ret);
22653}
22654
22655
22656static int
22657test_xmlReplaceNode(void) {
22658    int test_ret = 0;
22659
22660#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22661    int mem_base;
22662    xmlNodePtr ret_val;
22663    xmlNodePtr old; /* the old node */
22664    int n_old;
22665    xmlNodePtr cur; /* the node */
22666    int n_cur;
22667
22668    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22669    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22670        mem_base = xmlMemBlocks();
22671        old = gen_xmlNodePtr(n_old, 0);
22672        cur = gen_xmlNodePtr_in(n_cur, 1);
22673
22674        ret_val = xmlReplaceNode(old, cur);
22675        if (cur != NULL) {
22676              xmlUnlinkNode(cur);
22677              xmlFreeNode(cur) ; cur = NULL ; }
22678          if (old != NULL) {
22679              xmlUnlinkNode(old);
22680              xmlFreeNode(old) ; old = NULL ; }
22681	  ret_val = NULL;
22682        desret_xmlNodePtr(ret_val);
22683        call_tests++;
22684        des_xmlNodePtr(n_old, old, 0);
22685        des_xmlNodePtr_in(n_cur, cur, 1);
22686        xmlResetLastError();
22687        if (mem_base != xmlMemBlocks()) {
22688            printf("Leak of %d blocks found in xmlReplaceNode",
22689	           xmlMemBlocks() - mem_base);
22690	    test_ret++;
22691            printf(" %d", n_old);
22692            printf(" %d", n_cur);
22693            printf("\n");
22694        }
22695    }
22696    }
22697    function_tests++;
22698#endif
22699
22700    return(test_ret);
22701}
22702
22703
22704static int
22705test_xmlSaveFile(void) {
22706    int test_ret = 0;
22707
22708#if defined(LIBXML_OUTPUT_ENABLED)
22709    int mem_base;
22710    int ret_val;
22711    const char * filename; /* the filename (or URL) */
22712    int n_filename;
22713    xmlDocPtr cur; /* the document */
22714    int n_cur;
22715
22716    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22717    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22718        mem_base = xmlMemBlocks();
22719        filename = gen_fileoutput(n_filename, 0);
22720        cur = gen_xmlDocPtr(n_cur, 1);
22721
22722        ret_val = xmlSaveFile(filename, cur);
22723        desret_int(ret_val);
22724        call_tests++;
22725        des_fileoutput(n_filename, filename, 0);
22726        des_xmlDocPtr(n_cur, cur, 1);
22727        xmlResetLastError();
22728        if (mem_base != xmlMemBlocks()) {
22729            printf("Leak of %d blocks found in xmlSaveFile",
22730	           xmlMemBlocks() - mem_base);
22731	    test_ret++;
22732            printf(" %d", n_filename);
22733            printf(" %d", n_cur);
22734            printf("\n");
22735        }
22736    }
22737    }
22738    function_tests++;
22739#endif
22740
22741    return(test_ret);
22742}
22743
22744
22745static int
22746test_xmlSaveFileEnc(void) {
22747    int test_ret = 0;
22748
22749#if defined(LIBXML_OUTPUT_ENABLED)
22750    int mem_base;
22751    int ret_val;
22752    const char * filename; /* the filename (or URL) */
22753    int n_filename;
22754    xmlDocPtr cur; /* the document */
22755    int n_cur;
22756    char * encoding; /* the name of an encoding (or NULL) */
22757    int n_encoding;
22758
22759    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22760    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22761    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22762        mem_base = xmlMemBlocks();
22763        filename = gen_fileoutput(n_filename, 0);
22764        cur = gen_xmlDocPtr(n_cur, 1);
22765        encoding = gen_const_char_ptr(n_encoding, 2);
22766
22767        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22768        desret_int(ret_val);
22769        call_tests++;
22770        des_fileoutput(n_filename, filename, 0);
22771        des_xmlDocPtr(n_cur, cur, 1);
22772        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22773        xmlResetLastError();
22774        if (mem_base != xmlMemBlocks()) {
22775            printf("Leak of %d blocks found in xmlSaveFileEnc",
22776	           xmlMemBlocks() - mem_base);
22777	    test_ret++;
22778            printf(" %d", n_filename);
22779            printf(" %d", n_cur);
22780            printf(" %d", n_encoding);
22781            printf("\n");
22782        }
22783    }
22784    }
22785    }
22786    function_tests++;
22787#endif
22788
22789    return(test_ret);
22790}
22791
22792
22793static int
22794test_xmlSaveFileTo(void) {
22795    int test_ret = 0;
22796
22797#if defined(LIBXML_OUTPUT_ENABLED)
22798    int mem_base;
22799    int ret_val;
22800    xmlOutputBufferPtr buf; /* an output I/O buffer */
22801    int n_buf;
22802    xmlDocPtr cur; /* the document */
22803    int n_cur;
22804    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22805    int n_encoding;
22806
22807    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22808    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22809    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22810        mem_base = xmlMemBlocks();
22811        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22812        cur = gen_xmlDocPtr(n_cur, 1);
22813        encoding = gen_const_char_ptr(n_encoding, 2);
22814
22815        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22816        buf = NULL;
22817        desret_int(ret_val);
22818        call_tests++;
22819        des_xmlOutputBufferPtr(n_buf, buf, 0);
22820        des_xmlDocPtr(n_cur, cur, 1);
22821        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22822        xmlResetLastError();
22823        if (mem_base != xmlMemBlocks()) {
22824            printf("Leak of %d blocks found in xmlSaveFileTo",
22825	           xmlMemBlocks() - mem_base);
22826	    test_ret++;
22827            printf(" %d", n_buf);
22828            printf(" %d", n_cur);
22829            printf(" %d", n_encoding);
22830            printf("\n");
22831        }
22832    }
22833    }
22834    }
22835    function_tests++;
22836#endif
22837
22838    return(test_ret);
22839}
22840
22841
22842static int
22843test_xmlSaveFormatFile(void) {
22844    int test_ret = 0;
22845
22846#if defined(LIBXML_OUTPUT_ENABLED)
22847    int mem_base;
22848    int ret_val;
22849    const char * filename; /* the filename (or URL) */
22850    int n_filename;
22851    xmlDocPtr cur; /* the document */
22852    int n_cur;
22853    int format; /* should formatting spaces been added */
22854    int n_format;
22855
22856    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22857    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22858    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22859        mem_base = xmlMemBlocks();
22860        filename = gen_fileoutput(n_filename, 0);
22861        cur = gen_xmlDocPtr(n_cur, 1);
22862        format = gen_int(n_format, 2);
22863
22864        ret_val = xmlSaveFormatFile(filename, cur, format);
22865        desret_int(ret_val);
22866        call_tests++;
22867        des_fileoutput(n_filename, filename, 0);
22868        des_xmlDocPtr(n_cur, cur, 1);
22869        des_int(n_format, format, 2);
22870        xmlResetLastError();
22871        if (mem_base != xmlMemBlocks()) {
22872            printf("Leak of %d blocks found in xmlSaveFormatFile",
22873	           xmlMemBlocks() - mem_base);
22874	    test_ret++;
22875            printf(" %d", n_filename);
22876            printf(" %d", n_cur);
22877            printf(" %d", n_format);
22878            printf("\n");
22879        }
22880    }
22881    }
22882    }
22883    function_tests++;
22884#endif
22885
22886    return(test_ret);
22887}
22888
22889
22890static int
22891test_xmlSaveFormatFileEnc(void) {
22892    int test_ret = 0;
22893
22894#if defined(LIBXML_OUTPUT_ENABLED)
22895    int mem_base;
22896    int ret_val;
22897    const char * filename; /* the filename or URL to output */
22898    int n_filename;
22899    xmlDocPtr cur; /* the document being saved */
22900    int n_cur;
22901    char * encoding; /* the name of the encoding to use or NULL. */
22902    int n_encoding;
22903    int format; /* should formatting spaces be added. */
22904    int n_format;
22905
22906    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22907    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22908    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22909    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22910        mem_base = xmlMemBlocks();
22911        filename = gen_fileoutput(n_filename, 0);
22912        cur = gen_xmlDocPtr(n_cur, 1);
22913        encoding = gen_const_char_ptr(n_encoding, 2);
22914        format = gen_int(n_format, 3);
22915
22916        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22917        desret_int(ret_val);
22918        call_tests++;
22919        des_fileoutput(n_filename, filename, 0);
22920        des_xmlDocPtr(n_cur, cur, 1);
22921        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22922        des_int(n_format, format, 3);
22923        xmlResetLastError();
22924        if (mem_base != xmlMemBlocks()) {
22925            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22926	           xmlMemBlocks() - mem_base);
22927	    test_ret++;
22928            printf(" %d", n_filename);
22929            printf(" %d", n_cur);
22930            printf(" %d", n_encoding);
22931            printf(" %d", n_format);
22932            printf("\n");
22933        }
22934    }
22935    }
22936    }
22937    }
22938    function_tests++;
22939#endif
22940
22941    return(test_ret);
22942}
22943
22944
22945static int
22946test_xmlSaveFormatFileTo(void) {
22947    int test_ret = 0;
22948
22949#if defined(LIBXML_OUTPUT_ENABLED)
22950    int mem_base;
22951    int ret_val;
22952    xmlOutputBufferPtr buf; /* an output I/O buffer */
22953    int n_buf;
22954    xmlDocPtr cur; /* the document */
22955    int n_cur;
22956    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22957    int n_encoding;
22958    int format; /* should formatting spaces been added */
22959    int n_format;
22960
22961    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22962    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22963    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22964    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22965        mem_base = xmlMemBlocks();
22966        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22967        cur = gen_xmlDocPtr(n_cur, 1);
22968        encoding = gen_const_char_ptr(n_encoding, 2);
22969        format = gen_int(n_format, 3);
22970
22971        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22972        buf = NULL;
22973        desret_int(ret_val);
22974        call_tests++;
22975        des_xmlOutputBufferPtr(n_buf, buf, 0);
22976        des_xmlDocPtr(n_cur, cur, 1);
22977        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22978        des_int(n_format, format, 3);
22979        xmlResetLastError();
22980        if (mem_base != xmlMemBlocks()) {
22981            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22982	           xmlMemBlocks() - mem_base);
22983	    test_ret++;
22984            printf(" %d", n_buf);
22985            printf(" %d", n_cur);
22986            printf(" %d", n_encoding);
22987            printf(" %d", n_format);
22988            printf("\n");
22989        }
22990    }
22991    }
22992    }
22993    }
22994    function_tests++;
22995#endif
22996
22997    return(test_ret);
22998}
22999
23000
23001static int
23002test_xmlSearchNs(void) {
23003    int test_ret = 0;
23004
23005    int mem_base;
23006    xmlNsPtr ret_val;
23007    xmlDocPtr doc; /* the document */
23008    int n_doc;
23009    xmlNodePtr node; /* the current node */
23010    int n_node;
23011    xmlChar * nameSpace; /* the namespace prefix */
23012    int n_nameSpace;
23013
23014    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23015    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23016    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23017        mem_base = xmlMemBlocks();
23018        doc = gen_xmlDocPtr(n_doc, 0);
23019        node = gen_xmlNodePtr(n_node, 1);
23020        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23021
23022        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23023        desret_xmlNsPtr(ret_val);
23024        call_tests++;
23025        des_xmlDocPtr(n_doc, doc, 0);
23026        des_xmlNodePtr(n_node, node, 1);
23027        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23028        xmlResetLastError();
23029        if (mem_base != xmlMemBlocks()) {
23030            printf("Leak of %d blocks found in xmlSearchNs",
23031	           xmlMemBlocks() - mem_base);
23032	    test_ret++;
23033            printf(" %d", n_doc);
23034            printf(" %d", n_node);
23035            printf(" %d", n_nameSpace);
23036            printf("\n");
23037        }
23038    }
23039    }
23040    }
23041    function_tests++;
23042
23043    return(test_ret);
23044}
23045
23046
23047static int
23048test_xmlSearchNsByHref(void) {
23049    int test_ret = 0;
23050
23051    int mem_base;
23052    xmlNsPtr ret_val;
23053    xmlDocPtr doc; /* the document */
23054    int n_doc;
23055    xmlNodePtr node; /* the current node */
23056    int n_node;
23057    xmlChar * href; /* the namespace value */
23058    int n_href;
23059
23060    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23061    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23062    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23063        mem_base = xmlMemBlocks();
23064        doc = gen_xmlDocPtr(n_doc, 0);
23065        node = gen_xmlNodePtr(n_node, 1);
23066        href = gen_const_xmlChar_ptr(n_href, 2);
23067
23068        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23069        desret_xmlNsPtr(ret_val);
23070        call_tests++;
23071        des_xmlDocPtr(n_doc, doc, 0);
23072        des_xmlNodePtr(n_node, node, 1);
23073        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23074        xmlResetLastError();
23075        if (mem_base != xmlMemBlocks()) {
23076            printf("Leak of %d blocks found in xmlSearchNsByHref",
23077	           xmlMemBlocks() - mem_base);
23078	    test_ret++;
23079            printf(" %d", n_doc);
23080            printf(" %d", n_node);
23081            printf(" %d", n_href);
23082            printf("\n");
23083        }
23084    }
23085    }
23086    }
23087    function_tests++;
23088
23089    return(test_ret);
23090}
23091
23092
23093static int
23094test_xmlSetBufferAllocationScheme(void) {
23095    int test_ret = 0;
23096
23097    int mem_base;
23098    xmlBufferAllocationScheme scheme; /* allocation method to use */
23099    int n_scheme;
23100
23101    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23102        mem_base = xmlMemBlocks();
23103        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23104
23105        xmlSetBufferAllocationScheme(scheme);
23106        call_tests++;
23107        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23108        xmlResetLastError();
23109        if (mem_base != xmlMemBlocks()) {
23110            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23111	           xmlMemBlocks() - mem_base);
23112	    test_ret++;
23113            printf(" %d", n_scheme);
23114            printf("\n");
23115        }
23116    }
23117    function_tests++;
23118
23119    return(test_ret);
23120}
23121
23122
23123static int
23124test_xmlSetCompressMode(void) {
23125    int test_ret = 0;
23126
23127    int mem_base;
23128    int mode; /* the compression ratio */
23129    int n_mode;
23130
23131    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23132        mem_base = xmlMemBlocks();
23133        mode = gen_int(n_mode, 0);
23134
23135        xmlSetCompressMode(mode);
23136        call_tests++;
23137        des_int(n_mode, mode, 0);
23138        xmlResetLastError();
23139        if (mem_base != xmlMemBlocks()) {
23140            printf("Leak of %d blocks found in xmlSetCompressMode",
23141	           xmlMemBlocks() - mem_base);
23142	    test_ret++;
23143            printf(" %d", n_mode);
23144            printf("\n");
23145        }
23146    }
23147    function_tests++;
23148
23149    return(test_ret);
23150}
23151
23152
23153static int
23154test_xmlSetDocCompressMode(void) {
23155    int test_ret = 0;
23156
23157    int mem_base;
23158    xmlDocPtr doc; /* the document */
23159    int n_doc;
23160    int mode; /* the compression ratio */
23161    int n_mode;
23162
23163    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23164    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23165        mem_base = xmlMemBlocks();
23166        doc = gen_xmlDocPtr(n_doc, 0);
23167        mode = gen_int(n_mode, 1);
23168
23169        xmlSetDocCompressMode(doc, mode);
23170        call_tests++;
23171        des_xmlDocPtr(n_doc, doc, 0);
23172        des_int(n_mode, mode, 1);
23173        xmlResetLastError();
23174        if (mem_base != xmlMemBlocks()) {
23175            printf("Leak of %d blocks found in xmlSetDocCompressMode",
23176	           xmlMemBlocks() - mem_base);
23177	    test_ret++;
23178            printf(" %d", n_doc);
23179            printf(" %d", n_mode);
23180            printf("\n");
23181        }
23182    }
23183    }
23184    function_tests++;
23185
23186    return(test_ret);
23187}
23188
23189
23190static int
23191test_xmlSetNs(void) {
23192    int test_ret = 0;
23193
23194    int mem_base;
23195    xmlNodePtr node; /* a node in the document */
23196    int n_node;
23197    xmlNsPtr ns; /* a namespace pointer */
23198    int n_ns;
23199
23200    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23201    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23202        mem_base = xmlMemBlocks();
23203        node = gen_xmlNodePtr(n_node, 0);
23204        ns = gen_xmlNsPtr(n_ns, 1);
23205
23206        xmlSetNs(node, ns);
23207        call_tests++;
23208        des_xmlNodePtr(n_node, node, 0);
23209        des_xmlNsPtr(n_ns, ns, 1);
23210        xmlResetLastError();
23211        if (mem_base != xmlMemBlocks()) {
23212            printf("Leak of %d blocks found in xmlSetNs",
23213	           xmlMemBlocks() - mem_base);
23214	    test_ret++;
23215            printf(" %d", n_node);
23216            printf(" %d", n_ns);
23217            printf("\n");
23218        }
23219    }
23220    }
23221    function_tests++;
23222
23223    return(test_ret);
23224}
23225
23226
23227static int
23228test_xmlSetNsProp(void) {
23229    int test_ret = 0;
23230
23231#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23232    int mem_base;
23233    xmlAttrPtr ret_val;
23234    xmlNodePtr node; /* the node */
23235    int n_node;
23236    xmlNsPtr ns; /* the namespace definition */
23237    int n_ns;
23238    xmlChar * name; /* the attribute name */
23239    int n_name;
23240    xmlChar * value; /* the attribute value */
23241    int n_value;
23242
23243    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23244    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23245    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23246    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23247        mem_base = xmlMemBlocks();
23248        node = gen_xmlNodePtr(n_node, 0);
23249        ns = gen_xmlNsPtr(n_ns, 1);
23250        name = gen_const_xmlChar_ptr(n_name, 2);
23251        value = gen_const_xmlChar_ptr(n_value, 3);
23252
23253        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23254        desret_xmlAttrPtr(ret_val);
23255        call_tests++;
23256        des_xmlNodePtr(n_node, node, 0);
23257        des_xmlNsPtr(n_ns, ns, 1);
23258        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23259        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23260        xmlResetLastError();
23261        if (mem_base != xmlMemBlocks()) {
23262            printf("Leak of %d blocks found in xmlSetNsProp",
23263	           xmlMemBlocks() - mem_base);
23264	    test_ret++;
23265            printf(" %d", n_node);
23266            printf(" %d", n_ns);
23267            printf(" %d", n_name);
23268            printf(" %d", n_value);
23269            printf("\n");
23270        }
23271    }
23272    }
23273    }
23274    }
23275    function_tests++;
23276#endif
23277
23278    return(test_ret);
23279}
23280
23281
23282static int
23283test_xmlSetProp(void) {
23284    int test_ret = 0;
23285
23286#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23287    int mem_base;
23288    xmlAttrPtr ret_val;
23289    xmlNodePtr node; /* the node */
23290    int n_node;
23291    xmlChar * name; /* the attribute name (a QName) */
23292    int n_name;
23293    xmlChar * value; /* the attribute value */
23294    int n_value;
23295
23296    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23297    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23298    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23299        mem_base = xmlMemBlocks();
23300        node = gen_xmlNodePtr(n_node, 0);
23301        name = gen_const_xmlChar_ptr(n_name, 1);
23302        value = gen_const_xmlChar_ptr(n_value, 2);
23303
23304        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23305        desret_xmlAttrPtr(ret_val);
23306        call_tests++;
23307        des_xmlNodePtr(n_node, node, 0);
23308        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23309        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23310        xmlResetLastError();
23311        if (mem_base != xmlMemBlocks()) {
23312            printf("Leak of %d blocks found in xmlSetProp",
23313	           xmlMemBlocks() - mem_base);
23314	    test_ret++;
23315            printf(" %d", n_node);
23316            printf(" %d", n_name);
23317            printf(" %d", n_value);
23318            printf("\n");
23319        }
23320    }
23321    }
23322    }
23323    function_tests++;
23324#endif
23325
23326    return(test_ret);
23327}
23328
23329
23330static int
23331test_xmlSplitQName2(void) {
23332    int test_ret = 0;
23333
23334    int mem_base;
23335    xmlChar * ret_val;
23336    xmlChar * name; /* the full QName */
23337    int n_name;
23338    xmlChar ** prefix; /* a xmlChar ** */
23339    int n_prefix;
23340
23341    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23342    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23343        mem_base = xmlMemBlocks();
23344        name = gen_const_xmlChar_ptr(n_name, 0);
23345        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23346
23347        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23348        desret_xmlChar_ptr(ret_val);
23349        call_tests++;
23350        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23351        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23352        xmlResetLastError();
23353        if (mem_base != xmlMemBlocks()) {
23354            printf("Leak of %d blocks found in xmlSplitQName2",
23355	           xmlMemBlocks() - mem_base);
23356	    test_ret++;
23357            printf(" %d", n_name);
23358            printf(" %d", n_prefix);
23359            printf("\n");
23360        }
23361    }
23362    }
23363    function_tests++;
23364
23365    return(test_ret);
23366}
23367
23368
23369static int
23370test_xmlSplitQName3(void) {
23371    int test_ret = 0;
23372
23373    int mem_base;
23374    const xmlChar * ret_val;
23375    xmlChar * name; /* the full QName */
23376    int n_name;
23377    int * len; /* an int * */
23378    int n_len;
23379
23380    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23381    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23382        mem_base = xmlMemBlocks();
23383        name = gen_const_xmlChar_ptr(n_name, 0);
23384        len = gen_int_ptr(n_len, 1);
23385
23386        ret_val = xmlSplitQName3((const xmlChar *)name, len);
23387        desret_const_xmlChar_ptr(ret_val);
23388        call_tests++;
23389        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23390        des_int_ptr(n_len, len, 1);
23391        xmlResetLastError();
23392        if (mem_base != xmlMemBlocks()) {
23393            printf("Leak of %d blocks found in xmlSplitQName3",
23394	           xmlMemBlocks() - mem_base);
23395	    test_ret++;
23396            printf(" %d", n_name);
23397            printf(" %d", n_len);
23398            printf("\n");
23399        }
23400    }
23401    }
23402    function_tests++;
23403
23404    return(test_ret);
23405}
23406
23407
23408static int
23409test_xmlStringGetNodeList(void) {
23410    int test_ret = 0;
23411
23412    int mem_base;
23413    xmlNodePtr ret_val;
23414    xmlDocPtr doc; /* the document */
23415    int n_doc;
23416    xmlChar * value; /* the value of the attribute */
23417    int n_value;
23418
23419    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23420    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23421        mem_base = xmlMemBlocks();
23422        doc = gen_xmlDocPtr(n_doc, 0);
23423        value = gen_const_xmlChar_ptr(n_value, 1);
23424
23425        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23426        desret_xmlNodePtr(ret_val);
23427        call_tests++;
23428        des_xmlDocPtr(n_doc, doc, 0);
23429        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23430        xmlResetLastError();
23431        if (mem_base != xmlMemBlocks()) {
23432            printf("Leak of %d blocks found in xmlStringGetNodeList",
23433	           xmlMemBlocks() - mem_base);
23434	    test_ret++;
23435            printf(" %d", n_doc);
23436            printf(" %d", n_value);
23437            printf("\n");
23438        }
23439    }
23440    }
23441    function_tests++;
23442
23443    return(test_ret);
23444}
23445
23446
23447static int
23448test_xmlStringLenGetNodeList(void) {
23449    int test_ret = 0;
23450
23451    int mem_base;
23452    xmlNodePtr ret_val;
23453    xmlDocPtr doc; /* the document */
23454    int n_doc;
23455    xmlChar * value; /* the value of the text */
23456    int n_value;
23457    int len; /* the length of the string value */
23458    int n_len;
23459
23460    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23461    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23462    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23463        mem_base = xmlMemBlocks();
23464        doc = gen_xmlDocPtr(n_doc, 0);
23465        value = gen_const_xmlChar_ptr(n_value, 1);
23466        len = gen_int(n_len, 2);
23467
23468        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23469        desret_xmlNodePtr(ret_val);
23470        call_tests++;
23471        des_xmlDocPtr(n_doc, doc, 0);
23472        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23473        des_int(n_len, len, 2);
23474        xmlResetLastError();
23475        if (mem_base != xmlMemBlocks()) {
23476            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23477	           xmlMemBlocks() - mem_base);
23478	    test_ret++;
23479            printf(" %d", n_doc);
23480            printf(" %d", n_value);
23481            printf(" %d", n_len);
23482            printf("\n");
23483        }
23484    }
23485    }
23486    }
23487    function_tests++;
23488
23489    return(test_ret);
23490}
23491
23492
23493static int
23494test_xmlTextConcat(void) {
23495    int test_ret = 0;
23496
23497    int mem_base;
23498    int ret_val;
23499    xmlNodePtr node; /* the node */
23500    int n_node;
23501    xmlChar * content; /* the content */
23502    int n_content;
23503    int len; /* @content length */
23504    int n_len;
23505
23506    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23507    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23508    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23509        mem_base = xmlMemBlocks();
23510        node = gen_xmlNodePtr(n_node, 0);
23511        content = gen_const_xmlChar_ptr(n_content, 1);
23512        len = gen_int(n_len, 2);
23513
23514        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23515        desret_int(ret_val);
23516        call_tests++;
23517        des_xmlNodePtr(n_node, node, 0);
23518        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23519        des_int(n_len, len, 2);
23520        xmlResetLastError();
23521        if (mem_base != xmlMemBlocks()) {
23522            printf("Leak of %d blocks found in xmlTextConcat",
23523	           xmlMemBlocks() - mem_base);
23524	    test_ret++;
23525            printf(" %d", n_node);
23526            printf(" %d", n_content);
23527            printf(" %d", n_len);
23528            printf("\n");
23529        }
23530    }
23531    }
23532    }
23533    function_tests++;
23534
23535    return(test_ret);
23536}
23537
23538
23539static int
23540test_xmlTextMerge(void) {
23541    int test_ret = 0;
23542
23543    int mem_base;
23544    xmlNodePtr ret_val;
23545    xmlNodePtr first; /* the first text node */
23546    int n_first;
23547    xmlNodePtr second; /* the second text node being merged */
23548    int n_second;
23549
23550    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23551    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23552        mem_base = xmlMemBlocks();
23553        first = gen_xmlNodePtr_in(n_first, 0);
23554        second = gen_xmlNodePtr_in(n_second, 1);
23555
23556        ret_val = xmlTextMerge(first, second);
23557        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23558              xmlUnlinkNode(second);
23559              xmlFreeNode(second) ; second = NULL ; }
23560        desret_xmlNodePtr(ret_val);
23561        call_tests++;
23562        des_xmlNodePtr_in(n_first, first, 0);
23563        des_xmlNodePtr_in(n_second, second, 1);
23564        xmlResetLastError();
23565        if (mem_base != xmlMemBlocks()) {
23566            printf("Leak of %d blocks found in xmlTextMerge",
23567	           xmlMemBlocks() - mem_base);
23568	    test_ret++;
23569            printf(" %d", n_first);
23570            printf(" %d", n_second);
23571            printf("\n");
23572        }
23573    }
23574    }
23575    function_tests++;
23576
23577    return(test_ret);
23578}
23579
23580
23581static int
23582test_xmlUnsetNsProp(void) {
23583    int test_ret = 0;
23584
23585#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23586    int mem_base;
23587    int ret_val;
23588    xmlNodePtr node; /* the node */
23589    int n_node;
23590    xmlNsPtr ns; /* the namespace definition */
23591    int n_ns;
23592    xmlChar * name; /* the attribute name */
23593    int n_name;
23594
23595    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23596    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23597    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23598        mem_base = xmlMemBlocks();
23599        node = gen_xmlNodePtr(n_node, 0);
23600        ns = gen_xmlNsPtr(n_ns, 1);
23601        name = gen_const_xmlChar_ptr(n_name, 2);
23602
23603        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23604        desret_int(ret_val);
23605        call_tests++;
23606        des_xmlNodePtr(n_node, node, 0);
23607        des_xmlNsPtr(n_ns, ns, 1);
23608        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23609        xmlResetLastError();
23610        if (mem_base != xmlMemBlocks()) {
23611            printf("Leak of %d blocks found in xmlUnsetNsProp",
23612	           xmlMemBlocks() - mem_base);
23613	    test_ret++;
23614            printf(" %d", n_node);
23615            printf(" %d", n_ns);
23616            printf(" %d", n_name);
23617            printf("\n");
23618        }
23619    }
23620    }
23621    }
23622    function_tests++;
23623#endif
23624
23625    return(test_ret);
23626}
23627
23628
23629static int
23630test_xmlUnsetProp(void) {
23631    int test_ret = 0;
23632
23633#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23634    int mem_base;
23635    int ret_val;
23636    xmlNodePtr node; /* the node */
23637    int n_node;
23638    xmlChar * name; /* the attribute name */
23639    int n_name;
23640
23641    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23642    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23643        mem_base = xmlMemBlocks();
23644        node = gen_xmlNodePtr(n_node, 0);
23645        name = gen_const_xmlChar_ptr(n_name, 1);
23646
23647        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23648        desret_int(ret_val);
23649        call_tests++;
23650        des_xmlNodePtr(n_node, node, 0);
23651        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23652        xmlResetLastError();
23653        if (mem_base != xmlMemBlocks()) {
23654            printf("Leak of %d blocks found in xmlUnsetProp",
23655	           xmlMemBlocks() - mem_base);
23656	    test_ret++;
23657            printf(" %d", n_node);
23658            printf(" %d", n_name);
23659            printf("\n");
23660        }
23661    }
23662    }
23663    function_tests++;
23664#endif
23665
23666    return(test_ret);
23667}
23668
23669
23670static int
23671test_xmlValidateNCName(void) {
23672    int test_ret = 0;
23673
23674#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)
23675#ifdef LIBXML_TREE_ENABLED
23676    int mem_base;
23677    int ret_val;
23678    xmlChar * value; /* the value to check */
23679    int n_value;
23680    int space; /* allow spaces in front and end of the string */
23681    int n_space;
23682
23683    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23684    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23685        mem_base = xmlMemBlocks();
23686        value = gen_const_xmlChar_ptr(n_value, 0);
23687        space = gen_int(n_space, 1);
23688
23689        ret_val = xmlValidateNCName((const xmlChar *)value, space);
23690        desret_int(ret_val);
23691        call_tests++;
23692        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23693        des_int(n_space, space, 1);
23694        xmlResetLastError();
23695        if (mem_base != xmlMemBlocks()) {
23696            printf("Leak of %d blocks found in xmlValidateNCName",
23697	           xmlMemBlocks() - mem_base);
23698	    test_ret++;
23699            printf(" %d", n_value);
23700            printf(" %d", n_space);
23701            printf("\n");
23702        }
23703    }
23704    }
23705    function_tests++;
23706#endif
23707#endif
23708
23709    return(test_ret);
23710}
23711
23712
23713static int
23714test_xmlValidateNMToken(void) {
23715    int test_ret = 0;
23716
23717#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23718#ifdef LIBXML_TREE_ENABLED
23719    int mem_base;
23720    int ret_val;
23721    xmlChar * value; /* the value to check */
23722    int n_value;
23723    int space; /* allow spaces in front and end of the string */
23724    int n_space;
23725
23726    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23727    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23728        mem_base = xmlMemBlocks();
23729        value = gen_const_xmlChar_ptr(n_value, 0);
23730        space = gen_int(n_space, 1);
23731
23732        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23733        desret_int(ret_val);
23734        call_tests++;
23735        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23736        des_int(n_space, space, 1);
23737        xmlResetLastError();
23738        if (mem_base != xmlMemBlocks()) {
23739            printf("Leak of %d blocks found in xmlValidateNMToken",
23740	           xmlMemBlocks() - mem_base);
23741	    test_ret++;
23742            printf(" %d", n_value);
23743            printf(" %d", n_space);
23744            printf("\n");
23745        }
23746    }
23747    }
23748    function_tests++;
23749#endif
23750#endif
23751
23752    return(test_ret);
23753}
23754
23755
23756static int
23757test_xmlValidateName(void) {
23758    int test_ret = 0;
23759
23760#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23761#ifdef LIBXML_TREE_ENABLED
23762    int mem_base;
23763    int ret_val;
23764    xmlChar * value; /* the value to check */
23765    int n_value;
23766    int space; /* allow spaces in front and end of the string */
23767    int n_space;
23768
23769    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23770    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23771        mem_base = xmlMemBlocks();
23772        value = gen_const_xmlChar_ptr(n_value, 0);
23773        space = gen_int(n_space, 1);
23774
23775        ret_val = xmlValidateName((const xmlChar *)value, space);
23776        desret_int(ret_val);
23777        call_tests++;
23778        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23779        des_int(n_space, space, 1);
23780        xmlResetLastError();
23781        if (mem_base != xmlMemBlocks()) {
23782            printf("Leak of %d blocks found in xmlValidateName",
23783	           xmlMemBlocks() - mem_base);
23784	    test_ret++;
23785            printf(" %d", n_value);
23786            printf(" %d", n_space);
23787            printf("\n");
23788        }
23789    }
23790    }
23791    function_tests++;
23792#endif
23793#endif
23794
23795    return(test_ret);
23796}
23797
23798
23799static int
23800test_xmlValidateQName(void) {
23801    int test_ret = 0;
23802
23803#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23804#ifdef LIBXML_TREE_ENABLED
23805    int mem_base;
23806    int ret_val;
23807    xmlChar * value; /* the value to check */
23808    int n_value;
23809    int space; /* allow spaces in front and end of the string */
23810    int n_space;
23811
23812    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23813    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23814        mem_base = xmlMemBlocks();
23815        value = gen_const_xmlChar_ptr(n_value, 0);
23816        space = gen_int(n_space, 1);
23817
23818        ret_val = xmlValidateQName((const xmlChar *)value, space);
23819        desret_int(ret_val);
23820        call_tests++;
23821        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23822        des_int(n_space, space, 1);
23823        xmlResetLastError();
23824        if (mem_base != xmlMemBlocks()) {
23825            printf("Leak of %d blocks found in xmlValidateQName",
23826	           xmlMemBlocks() - mem_base);
23827	    test_ret++;
23828            printf(" %d", n_value);
23829            printf(" %d", n_space);
23830            printf("\n");
23831        }
23832    }
23833    }
23834    function_tests++;
23835#endif
23836#endif
23837
23838    return(test_ret);
23839}
23840
23841static int
23842test_tree(void) {
23843    int test_ret = 0;
23844
23845    if (quiet == 0) printf("Testing tree : 133 of 152 functions ...\n");
23846    test_ret += test_xmlAddChild();
23847    test_ret += test_xmlAddChildList();
23848    test_ret += test_xmlAddNextSibling();
23849    test_ret += test_xmlAddPrevSibling();
23850    test_ret += test_xmlAddSibling();
23851    test_ret += test_xmlAttrSerializeTxtContent();
23852    test_ret += test_xmlBufferAdd();
23853    test_ret += test_xmlBufferAddHead();
23854    test_ret += test_xmlBufferCCat();
23855    test_ret += test_xmlBufferCat();
23856    test_ret += test_xmlBufferContent();
23857    test_ret += test_xmlBufferCreate();
23858    test_ret += test_xmlBufferCreateSize();
23859    test_ret += test_xmlBufferCreateStatic();
23860    test_ret += test_xmlBufferEmpty();
23861    test_ret += test_xmlBufferGrow();
23862    test_ret += test_xmlBufferLength();
23863    test_ret += test_xmlBufferResize();
23864    test_ret += test_xmlBufferSetAllocationScheme();
23865    test_ret += test_xmlBufferShrink();
23866    test_ret += test_xmlBufferWriteCHAR();
23867    test_ret += test_xmlBufferWriteChar();
23868    test_ret += test_xmlBufferWriteQuotedString();
23869    test_ret += test_xmlBuildQName();
23870    test_ret += test_xmlCopyDoc();
23871    test_ret += test_xmlCopyDtd();
23872    test_ret += test_xmlCopyNamespace();
23873    test_ret += test_xmlCopyNamespaceList();
23874    test_ret += test_xmlCopyNode();
23875    test_ret += test_xmlCopyNodeList();
23876    test_ret += test_xmlCopyProp();
23877    test_ret += test_xmlCopyPropList();
23878    test_ret += test_xmlCreateIntSubset();
23879    test_ret += test_xmlDOMWrapAdoptNode();
23880    test_ret += test_xmlDOMWrapCloneNode();
23881    test_ret += test_xmlDOMWrapNewCtxt();
23882    test_ret += test_xmlDOMWrapReconcileNamespaces();
23883    test_ret += test_xmlDOMWrapRemoveNode();
23884    test_ret += test_xmlDocCopyNode();
23885    test_ret += test_xmlDocCopyNodeList();
23886    test_ret += test_xmlDocDump();
23887    test_ret += test_xmlDocDumpFormatMemory();
23888    test_ret += test_xmlDocDumpFormatMemoryEnc();
23889    test_ret += test_xmlDocDumpMemory();
23890    test_ret += test_xmlDocDumpMemoryEnc();
23891    test_ret += test_xmlDocFormatDump();
23892    test_ret += test_xmlDocGetRootElement();
23893    test_ret += test_xmlDocSetRootElement();
23894    test_ret += test_xmlElemDump();
23895    test_ret += test_xmlGetBufferAllocationScheme();
23896    test_ret += test_xmlGetCompressMode();
23897    test_ret += test_xmlGetDocCompressMode();
23898    test_ret += test_xmlGetIntSubset();
23899    test_ret += test_xmlGetLastChild();
23900    test_ret += test_xmlGetLineNo();
23901    test_ret += test_xmlGetNoNsProp();
23902    test_ret += test_xmlGetNodePath();
23903    test_ret += test_xmlGetNsList();
23904    test_ret += test_xmlGetNsProp();
23905    test_ret += test_xmlGetProp();
23906    test_ret += test_xmlHasNsProp();
23907    test_ret += test_xmlHasProp();
23908    test_ret += test_xmlIsBlankNode();
23909    test_ret += test_xmlIsXHTML();
23910    test_ret += test_xmlNewCDataBlock();
23911    test_ret += test_xmlNewCharRef();
23912    test_ret += test_xmlNewChild();
23913    test_ret += test_xmlNewComment();
23914    test_ret += test_xmlNewDoc();
23915    test_ret += test_xmlNewDocComment();
23916    test_ret += test_xmlNewDocFragment();
23917    test_ret += test_xmlNewDocNode();
23918    test_ret += test_xmlNewDocNodeEatName();
23919    test_ret += test_xmlNewDocPI();
23920    test_ret += test_xmlNewDocProp();
23921    test_ret += test_xmlNewDocRawNode();
23922    test_ret += test_xmlNewDocText();
23923    test_ret += test_xmlNewDocTextLen();
23924    test_ret += test_xmlNewDtd();
23925    test_ret += test_xmlNewNode();
23926    test_ret += test_xmlNewNodeEatName();
23927    test_ret += test_xmlNewNs();
23928    test_ret += test_xmlNewNsProp();
23929    test_ret += test_xmlNewNsPropEatName();
23930    test_ret += test_xmlNewPI();
23931    test_ret += test_xmlNewProp();
23932    test_ret += test_xmlNewReference();
23933    test_ret += test_xmlNewText();
23934    test_ret += test_xmlNewTextChild();
23935    test_ret += test_xmlNewTextLen();
23936    test_ret += test_xmlNodeAddContent();
23937    test_ret += test_xmlNodeAddContentLen();
23938    test_ret += test_xmlNodeBufGetContent();
23939    test_ret += test_xmlNodeDump();
23940    test_ret += test_xmlNodeDumpOutput();
23941    test_ret += test_xmlNodeGetBase();
23942    test_ret += test_xmlNodeGetContent();
23943    test_ret += test_xmlNodeGetLang();
23944    test_ret += test_xmlNodeGetSpacePreserve();
23945    test_ret += test_xmlNodeIsText();
23946    test_ret += test_xmlNodeListGetRawString();
23947    test_ret += test_xmlNodeListGetString();
23948    test_ret += test_xmlNodeSetBase();
23949    test_ret += test_xmlNodeSetContent();
23950    test_ret += test_xmlNodeSetContentLen();
23951    test_ret += test_xmlNodeSetLang();
23952    test_ret += test_xmlNodeSetName();
23953    test_ret += test_xmlNodeSetSpacePreserve();
23954    test_ret += test_xmlReconciliateNs();
23955    test_ret += test_xmlRemoveProp();
23956    test_ret += test_xmlReplaceNode();
23957    test_ret += test_xmlSaveFile();
23958    test_ret += test_xmlSaveFileEnc();
23959    test_ret += test_xmlSaveFileTo();
23960    test_ret += test_xmlSaveFormatFile();
23961    test_ret += test_xmlSaveFormatFileEnc();
23962    test_ret += test_xmlSaveFormatFileTo();
23963    test_ret += test_xmlSearchNs();
23964    test_ret += test_xmlSearchNsByHref();
23965    test_ret += test_xmlSetBufferAllocationScheme();
23966    test_ret += test_xmlSetCompressMode();
23967    test_ret += test_xmlSetDocCompressMode();
23968    test_ret += test_xmlSetNs();
23969    test_ret += test_xmlSetNsProp();
23970    test_ret += test_xmlSetProp();
23971    test_ret += test_xmlSplitQName2();
23972    test_ret += test_xmlSplitQName3();
23973    test_ret += test_xmlStringGetNodeList();
23974    test_ret += test_xmlStringLenGetNodeList();
23975    test_ret += test_xmlTextConcat();
23976    test_ret += test_xmlTextMerge();
23977    test_ret += test_xmlUnsetNsProp();
23978    test_ret += test_xmlUnsetProp();
23979    test_ret += test_xmlValidateNCName();
23980    test_ret += test_xmlValidateNMToken();
23981    test_ret += test_xmlValidateName();
23982    test_ret += test_xmlValidateQName();
23983
23984    if (test_ret != 0)
23985	printf("Module tree: %d errors\n", test_ret);
23986    return(test_ret);
23987}
23988
23989static int
23990test_xmlBuildRelativeURI(void) {
23991    int test_ret = 0;
23992
23993    int mem_base;
23994    xmlChar * ret_val;
23995    xmlChar * URI; /* the URI reference under consideration */
23996    int n_URI;
23997    xmlChar * base; /* the base value */
23998    int n_base;
23999
24000    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24001    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24002        mem_base = xmlMemBlocks();
24003        URI = gen_const_xmlChar_ptr(n_URI, 0);
24004        base = gen_const_xmlChar_ptr(n_base, 1);
24005
24006        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24007        desret_xmlChar_ptr(ret_val);
24008        call_tests++;
24009        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24010        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24011        xmlResetLastError();
24012        if (mem_base != xmlMemBlocks()) {
24013            printf("Leak of %d blocks found in xmlBuildRelativeURI",
24014	           xmlMemBlocks() - mem_base);
24015	    test_ret++;
24016            printf(" %d", n_URI);
24017            printf(" %d", n_base);
24018            printf("\n");
24019        }
24020    }
24021    }
24022    function_tests++;
24023
24024    return(test_ret);
24025}
24026
24027
24028static int
24029test_xmlBuildURI(void) {
24030    int test_ret = 0;
24031
24032    int mem_base;
24033    xmlChar * ret_val;
24034    xmlChar * URI; /* the URI instance found in the document */
24035    int n_URI;
24036    xmlChar * base; /* the base value */
24037    int n_base;
24038
24039    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24040    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24041        mem_base = xmlMemBlocks();
24042        URI = gen_const_xmlChar_ptr(n_URI, 0);
24043        base = gen_const_xmlChar_ptr(n_base, 1);
24044
24045        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24046        desret_xmlChar_ptr(ret_val);
24047        call_tests++;
24048        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24049        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24050        xmlResetLastError();
24051        if (mem_base != xmlMemBlocks()) {
24052            printf("Leak of %d blocks found in xmlBuildURI",
24053	           xmlMemBlocks() - mem_base);
24054	    test_ret++;
24055            printf(" %d", n_URI);
24056            printf(" %d", n_base);
24057            printf("\n");
24058        }
24059    }
24060    }
24061    function_tests++;
24062
24063    return(test_ret);
24064}
24065
24066
24067static int
24068test_xmlCanonicPath(void) {
24069    int test_ret = 0;
24070
24071    int mem_base;
24072    xmlChar * ret_val;
24073    xmlChar * path; /* the resource locator in a filesystem notation */
24074    int n_path;
24075
24076    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24077        mem_base = xmlMemBlocks();
24078        path = gen_const_xmlChar_ptr(n_path, 0);
24079
24080        ret_val = xmlCanonicPath((const xmlChar *)path);
24081        desret_xmlChar_ptr(ret_val);
24082        call_tests++;
24083        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24084        xmlResetLastError();
24085        if (mem_base != xmlMemBlocks()) {
24086            printf("Leak of %d blocks found in xmlCanonicPath",
24087	           xmlMemBlocks() - mem_base);
24088	    test_ret++;
24089            printf(" %d", n_path);
24090            printf("\n");
24091        }
24092    }
24093    function_tests++;
24094
24095    return(test_ret);
24096}
24097
24098
24099static int
24100test_xmlCreateURI(void) {
24101    int test_ret = 0;
24102
24103
24104    /* missing type support */
24105    return(test_ret);
24106}
24107
24108
24109static int
24110test_xmlNormalizeURIPath(void) {
24111    int test_ret = 0;
24112
24113    int mem_base;
24114    int ret_val;
24115    char * path; /* pointer to the path string */
24116    int n_path;
24117
24118    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24119        mem_base = xmlMemBlocks();
24120        path = gen_char_ptr(n_path, 0);
24121
24122        ret_val = xmlNormalizeURIPath(path);
24123        desret_int(ret_val);
24124        call_tests++;
24125        des_char_ptr(n_path, path, 0);
24126        xmlResetLastError();
24127        if (mem_base != xmlMemBlocks()) {
24128            printf("Leak of %d blocks found in xmlNormalizeURIPath",
24129	           xmlMemBlocks() - mem_base);
24130	    test_ret++;
24131            printf(" %d", n_path);
24132            printf("\n");
24133        }
24134    }
24135    function_tests++;
24136
24137    return(test_ret);
24138}
24139
24140
24141static int
24142test_xmlParseURI(void) {
24143    int test_ret = 0;
24144
24145
24146    /* missing type support */
24147    return(test_ret);
24148}
24149
24150
24151static int
24152test_xmlParseURIRaw(void) {
24153    int test_ret = 0;
24154
24155
24156    /* missing type support */
24157    return(test_ret);
24158}
24159
24160
24161#define gen_nb_xmlURIPtr 1
24162static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24163    return(NULL);
24164}
24165static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24166}
24167
24168static int
24169test_xmlParseURIReference(void) {
24170    int test_ret = 0;
24171
24172    int mem_base;
24173    int ret_val;
24174    xmlURIPtr uri; /* pointer to an URI structure */
24175    int n_uri;
24176    char * str; /* the string to analyze */
24177    int n_str;
24178
24179    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24180    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24181        mem_base = xmlMemBlocks();
24182        uri = gen_xmlURIPtr(n_uri, 0);
24183        str = gen_const_char_ptr(n_str, 1);
24184
24185        ret_val = xmlParseURIReference(uri, (const char *)str);
24186        desret_int(ret_val);
24187        call_tests++;
24188        des_xmlURIPtr(n_uri, uri, 0);
24189        des_const_char_ptr(n_str, (const char *)str, 1);
24190        xmlResetLastError();
24191        if (mem_base != xmlMemBlocks()) {
24192            printf("Leak of %d blocks found in xmlParseURIReference",
24193	           xmlMemBlocks() - mem_base);
24194	    test_ret++;
24195            printf(" %d", n_uri);
24196            printf(" %d", n_str);
24197            printf("\n");
24198        }
24199    }
24200    }
24201    function_tests++;
24202
24203    return(test_ret);
24204}
24205
24206
24207static int
24208test_xmlPathToURI(void) {
24209    int test_ret = 0;
24210
24211    int mem_base;
24212    xmlChar * ret_val;
24213    xmlChar * path; /* the resource locator in a filesystem notation */
24214    int n_path;
24215
24216    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24217        mem_base = xmlMemBlocks();
24218        path = gen_const_xmlChar_ptr(n_path, 0);
24219
24220        ret_val = xmlPathToURI((const xmlChar *)path);
24221        desret_xmlChar_ptr(ret_val);
24222        call_tests++;
24223        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24224        xmlResetLastError();
24225        if (mem_base != xmlMemBlocks()) {
24226            printf("Leak of %d blocks found in xmlPathToURI",
24227	           xmlMemBlocks() - mem_base);
24228	    test_ret++;
24229            printf(" %d", n_path);
24230            printf("\n");
24231        }
24232    }
24233    function_tests++;
24234
24235    return(test_ret);
24236}
24237
24238
24239static int
24240test_xmlPrintURI(void) {
24241    int test_ret = 0;
24242
24243    int mem_base;
24244    FILE * stream; /* a FILE* for the output */
24245    int n_stream;
24246    xmlURIPtr uri; /* pointer to an xmlURI */
24247    int n_uri;
24248
24249    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24250    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24251        mem_base = xmlMemBlocks();
24252        stream = gen_FILE_ptr(n_stream, 0);
24253        uri = gen_xmlURIPtr(n_uri, 1);
24254
24255        xmlPrintURI(stream, uri);
24256        call_tests++;
24257        des_FILE_ptr(n_stream, stream, 0);
24258        des_xmlURIPtr(n_uri, uri, 1);
24259        xmlResetLastError();
24260        if (mem_base != xmlMemBlocks()) {
24261            printf("Leak of %d blocks found in xmlPrintURI",
24262	           xmlMemBlocks() - mem_base);
24263	    test_ret++;
24264            printf(" %d", n_stream);
24265            printf(" %d", n_uri);
24266            printf("\n");
24267        }
24268    }
24269    }
24270    function_tests++;
24271
24272    return(test_ret);
24273}
24274
24275
24276static int
24277test_xmlSaveUri(void) {
24278    int test_ret = 0;
24279
24280    int mem_base;
24281    xmlChar * ret_val;
24282    xmlURIPtr uri; /* pointer to an xmlURI */
24283    int n_uri;
24284
24285    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24286        mem_base = xmlMemBlocks();
24287        uri = gen_xmlURIPtr(n_uri, 0);
24288
24289        ret_val = xmlSaveUri(uri);
24290        desret_xmlChar_ptr(ret_val);
24291        call_tests++;
24292        des_xmlURIPtr(n_uri, uri, 0);
24293        xmlResetLastError();
24294        if (mem_base != xmlMemBlocks()) {
24295            printf("Leak of %d blocks found in xmlSaveUri",
24296	           xmlMemBlocks() - mem_base);
24297	    test_ret++;
24298            printf(" %d", n_uri);
24299            printf("\n");
24300        }
24301    }
24302    function_tests++;
24303
24304    return(test_ret);
24305}
24306
24307
24308static int
24309test_xmlURIEscape(void) {
24310    int test_ret = 0;
24311
24312    int mem_base;
24313    xmlChar * ret_val;
24314    xmlChar * str; /* the string of the URI to escape */
24315    int n_str;
24316
24317    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24318        mem_base = xmlMemBlocks();
24319        str = gen_const_xmlChar_ptr(n_str, 0);
24320
24321        ret_val = xmlURIEscape((const xmlChar *)str);
24322        desret_xmlChar_ptr(ret_val);
24323        call_tests++;
24324        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24325        xmlResetLastError();
24326        if (mem_base != xmlMemBlocks()) {
24327            printf("Leak of %d blocks found in xmlURIEscape",
24328	           xmlMemBlocks() - mem_base);
24329	    test_ret++;
24330            printf(" %d", n_str);
24331            printf("\n");
24332        }
24333    }
24334    function_tests++;
24335
24336    return(test_ret);
24337}
24338
24339
24340static int
24341test_xmlURIEscapeStr(void) {
24342    int test_ret = 0;
24343
24344    int mem_base;
24345    xmlChar * ret_val;
24346    xmlChar * str; /* string to escape */
24347    int n_str;
24348    xmlChar * list; /* exception list string of chars not to escape */
24349    int n_list;
24350
24351    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24352    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24353        mem_base = xmlMemBlocks();
24354        str = gen_const_xmlChar_ptr(n_str, 0);
24355        list = gen_const_xmlChar_ptr(n_list, 1);
24356
24357        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24358        desret_xmlChar_ptr(ret_val);
24359        call_tests++;
24360        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24361        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24362        xmlResetLastError();
24363        if (mem_base != xmlMemBlocks()) {
24364            printf("Leak of %d blocks found in xmlURIEscapeStr",
24365	           xmlMemBlocks() - mem_base);
24366	    test_ret++;
24367            printf(" %d", n_str);
24368            printf(" %d", n_list);
24369            printf("\n");
24370        }
24371    }
24372    }
24373    function_tests++;
24374
24375    return(test_ret);
24376}
24377
24378
24379static int
24380test_xmlURIUnescapeString(void) {
24381    int test_ret = 0;
24382
24383
24384    /* missing type support */
24385    return(test_ret);
24386}
24387
24388static int
24389test_uri(void) {
24390    int test_ret = 0;
24391
24392    if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24393    test_ret += test_xmlBuildRelativeURI();
24394    test_ret += test_xmlBuildURI();
24395    test_ret += test_xmlCanonicPath();
24396    test_ret += test_xmlCreateURI();
24397    test_ret += test_xmlNormalizeURIPath();
24398    test_ret += test_xmlParseURI();
24399    test_ret += test_xmlParseURIRaw();
24400    test_ret += test_xmlParseURIReference();
24401    test_ret += test_xmlPathToURI();
24402    test_ret += test_xmlPrintURI();
24403    test_ret += test_xmlSaveUri();
24404    test_ret += test_xmlURIEscape();
24405    test_ret += test_xmlURIEscapeStr();
24406    test_ret += test_xmlURIUnescapeString();
24407
24408    if (test_ret != 0)
24409	printf("Module uri: %d errors\n", test_ret);
24410    return(test_ret);
24411}
24412
24413static int
24414test_xmlAddAttributeDecl(void) {
24415    int test_ret = 0;
24416
24417    int mem_base;
24418    xmlAttributePtr ret_val;
24419    xmlValidCtxtPtr ctxt; /* the validation context */
24420    int n_ctxt;
24421    xmlDtdPtr dtd; /* pointer to the DTD */
24422    int n_dtd;
24423    xmlChar * elem; /* the element name */
24424    int n_elem;
24425    xmlChar * name; /* the attribute name */
24426    int n_name;
24427    xmlChar * ns; /* the attribute namespace prefix */
24428    int n_ns;
24429    xmlAttributeType type; /* the attribute type */
24430    int n_type;
24431    xmlAttributeDefault def; /* the attribute default type */
24432    int n_def;
24433    xmlChar * defaultValue; /* the attribute default value */
24434    int n_defaultValue;
24435    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24436    int n_tree;
24437
24438    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24439    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24440    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24441    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24442    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24443    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24444    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24445    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24446    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24447        mem_base = xmlMemBlocks();
24448        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24449        dtd = gen_xmlDtdPtr(n_dtd, 1);
24450        elem = gen_const_xmlChar_ptr(n_elem, 2);
24451        name = gen_const_xmlChar_ptr(n_name, 3);
24452        ns = gen_const_xmlChar_ptr(n_ns, 4);
24453        type = gen_xmlAttributeType(n_type, 5);
24454        def = gen_xmlAttributeDefault(n_def, 6);
24455        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24456        tree = gen_xmlEnumerationPtr(n_tree, 8);
24457
24458        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24459        desret_xmlAttributePtr(ret_val);
24460        call_tests++;
24461        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24462        des_xmlDtdPtr(n_dtd, dtd, 1);
24463        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24464        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24465        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24466        des_xmlAttributeType(n_type, type, 5);
24467        des_xmlAttributeDefault(n_def, def, 6);
24468        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24469        des_xmlEnumerationPtr(n_tree, tree, 8);
24470        xmlResetLastError();
24471        if (mem_base != xmlMemBlocks()) {
24472            printf("Leak of %d blocks found in xmlAddAttributeDecl",
24473	           xmlMemBlocks() - mem_base);
24474	    test_ret++;
24475            printf(" %d", n_ctxt);
24476            printf(" %d", n_dtd);
24477            printf(" %d", n_elem);
24478            printf(" %d", n_name);
24479            printf(" %d", n_ns);
24480            printf(" %d", n_type);
24481            printf(" %d", n_def);
24482            printf(" %d", n_defaultValue);
24483            printf(" %d", n_tree);
24484            printf("\n");
24485        }
24486    }
24487    }
24488    }
24489    }
24490    }
24491    }
24492    }
24493    }
24494    }
24495    function_tests++;
24496
24497    return(test_ret);
24498}
24499
24500
24501static int
24502test_xmlAddElementDecl(void) {
24503    int test_ret = 0;
24504
24505    int mem_base;
24506    xmlElementPtr ret_val;
24507    xmlValidCtxtPtr ctxt; /* the validation context */
24508    int n_ctxt;
24509    xmlDtdPtr dtd; /* pointer to the DTD */
24510    int n_dtd;
24511    xmlChar * name; /* the entity name */
24512    int n_name;
24513    xmlElementTypeVal type; /* the element type */
24514    int n_type;
24515    xmlElementContentPtr content; /* the element content tree or NULL */
24516    int n_content;
24517
24518    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24519    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24520    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24521    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24522    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24523        mem_base = xmlMemBlocks();
24524        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24525        dtd = gen_xmlDtdPtr(n_dtd, 1);
24526        name = gen_const_xmlChar_ptr(n_name, 2);
24527        type = gen_xmlElementTypeVal(n_type, 3);
24528        content = gen_xmlElementContentPtr(n_content, 4);
24529
24530        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24531        desret_xmlElementPtr(ret_val);
24532        call_tests++;
24533        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24534        des_xmlDtdPtr(n_dtd, dtd, 1);
24535        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24536        des_xmlElementTypeVal(n_type, type, 3);
24537        des_xmlElementContentPtr(n_content, content, 4);
24538        xmlResetLastError();
24539        if (mem_base != xmlMemBlocks()) {
24540            printf("Leak of %d blocks found in xmlAddElementDecl",
24541	           xmlMemBlocks() - mem_base);
24542	    test_ret++;
24543            printf(" %d", n_ctxt);
24544            printf(" %d", n_dtd);
24545            printf(" %d", n_name);
24546            printf(" %d", n_type);
24547            printf(" %d", n_content);
24548            printf("\n");
24549        }
24550    }
24551    }
24552    }
24553    }
24554    }
24555    function_tests++;
24556
24557    return(test_ret);
24558}
24559
24560
24561static int
24562test_xmlAddID(void) {
24563    int test_ret = 0;
24564
24565
24566    /* missing type support */
24567    return(test_ret);
24568}
24569
24570
24571static int
24572test_xmlAddNotationDecl(void) {
24573    int test_ret = 0;
24574
24575
24576    /* missing type support */
24577    return(test_ret);
24578}
24579
24580
24581static int
24582test_xmlAddRef(void) {
24583    int test_ret = 0;
24584
24585
24586    /* missing type support */
24587    return(test_ret);
24588}
24589
24590
24591#define gen_nb_xmlAttributeTablePtr 1
24592static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24593    return(NULL);
24594}
24595static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24596}
24597
24598static int
24599test_xmlCopyAttributeTable(void) {
24600    int test_ret = 0;
24601
24602
24603    /* missing type support */
24604    return(test_ret);
24605}
24606
24607
24608static int
24609test_xmlCopyDocElementContent(void) {
24610    int test_ret = 0;
24611
24612    int mem_base;
24613    xmlElementContentPtr ret_val;
24614    xmlDocPtr doc; /* the document owning the element declaration */
24615    int n_doc;
24616    xmlElementContentPtr cur; /* An element content pointer. */
24617    int n_cur;
24618
24619    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24620    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24621        mem_base = xmlMemBlocks();
24622        doc = gen_xmlDocPtr(n_doc, 0);
24623        cur = gen_xmlElementContentPtr(n_cur, 1);
24624
24625        ret_val = xmlCopyDocElementContent(doc, cur);
24626        desret_xmlElementContentPtr(ret_val);
24627        call_tests++;
24628        des_xmlDocPtr(n_doc, doc, 0);
24629        des_xmlElementContentPtr(n_cur, cur, 1);
24630        xmlResetLastError();
24631        if (mem_base != xmlMemBlocks()) {
24632            printf("Leak of %d blocks found in xmlCopyDocElementContent",
24633	           xmlMemBlocks() - mem_base);
24634	    test_ret++;
24635            printf(" %d", n_doc);
24636            printf(" %d", n_cur);
24637            printf("\n");
24638        }
24639    }
24640    }
24641    function_tests++;
24642
24643    return(test_ret);
24644}
24645
24646
24647static int
24648test_xmlCopyElementContent(void) {
24649    int test_ret = 0;
24650
24651    int mem_base;
24652    xmlElementContentPtr ret_val;
24653    xmlElementContentPtr cur; /* An element content pointer. */
24654    int n_cur;
24655
24656    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24657        mem_base = xmlMemBlocks();
24658        cur = gen_xmlElementContentPtr(n_cur, 0);
24659
24660        ret_val = xmlCopyElementContent(cur);
24661        desret_xmlElementContentPtr(ret_val);
24662        call_tests++;
24663        des_xmlElementContentPtr(n_cur, cur, 0);
24664        xmlResetLastError();
24665        if (mem_base != xmlMemBlocks()) {
24666            printf("Leak of %d blocks found in xmlCopyElementContent",
24667	           xmlMemBlocks() - mem_base);
24668	    test_ret++;
24669            printf(" %d", n_cur);
24670            printf("\n");
24671        }
24672    }
24673    function_tests++;
24674
24675    return(test_ret);
24676}
24677
24678
24679#define gen_nb_xmlElementTablePtr 1
24680static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24681    return(NULL);
24682}
24683static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24684}
24685
24686static int
24687test_xmlCopyElementTable(void) {
24688    int test_ret = 0;
24689
24690
24691    /* missing type support */
24692    return(test_ret);
24693}
24694
24695
24696static int
24697test_xmlCopyEnumeration(void) {
24698    int test_ret = 0;
24699
24700
24701    /* missing type support */
24702    return(test_ret);
24703}
24704
24705
24706#define gen_nb_xmlNotationTablePtr 1
24707static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24708    return(NULL);
24709}
24710static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24711}
24712
24713static int
24714test_xmlCopyNotationTable(void) {
24715    int test_ret = 0;
24716
24717
24718    /* missing type support */
24719    return(test_ret);
24720}
24721
24722
24723static int
24724test_xmlCreateEnumeration(void) {
24725    int test_ret = 0;
24726
24727
24728    /* missing type support */
24729    return(test_ret);
24730}
24731
24732
24733#define gen_nb_xmlAttributePtr 1
24734static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24735    return(NULL);
24736}
24737static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24738}
24739
24740static int
24741test_xmlDumpAttributeDecl(void) {
24742    int test_ret = 0;
24743
24744#if defined(LIBXML_OUTPUT_ENABLED)
24745    int mem_base;
24746    xmlBufferPtr buf; /* the XML buffer output */
24747    int n_buf;
24748    xmlAttributePtr attr; /* An attribute declaration */
24749    int n_attr;
24750
24751    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24752    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24753        mem_base = xmlMemBlocks();
24754        buf = gen_xmlBufferPtr(n_buf, 0);
24755        attr = gen_xmlAttributePtr(n_attr, 1);
24756
24757        xmlDumpAttributeDecl(buf, attr);
24758        call_tests++;
24759        des_xmlBufferPtr(n_buf, buf, 0);
24760        des_xmlAttributePtr(n_attr, attr, 1);
24761        xmlResetLastError();
24762        if (mem_base != xmlMemBlocks()) {
24763            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24764	           xmlMemBlocks() - mem_base);
24765	    test_ret++;
24766            printf(" %d", n_buf);
24767            printf(" %d", n_attr);
24768            printf("\n");
24769        }
24770    }
24771    }
24772    function_tests++;
24773#endif
24774
24775    return(test_ret);
24776}
24777
24778
24779static int
24780test_xmlDumpAttributeTable(void) {
24781    int test_ret = 0;
24782
24783#if defined(LIBXML_OUTPUT_ENABLED)
24784    int mem_base;
24785    xmlBufferPtr buf; /* the XML buffer output */
24786    int n_buf;
24787    xmlAttributeTablePtr table; /* An attribute table */
24788    int n_table;
24789
24790    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24791    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24792        mem_base = xmlMemBlocks();
24793        buf = gen_xmlBufferPtr(n_buf, 0);
24794        table = gen_xmlAttributeTablePtr(n_table, 1);
24795
24796        xmlDumpAttributeTable(buf, table);
24797        call_tests++;
24798        des_xmlBufferPtr(n_buf, buf, 0);
24799        des_xmlAttributeTablePtr(n_table, table, 1);
24800        xmlResetLastError();
24801        if (mem_base != xmlMemBlocks()) {
24802            printf("Leak of %d blocks found in xmlDumpAttributeTable",
24803	           xmlMemBlocks() - mem_base);
24804	    test_ret++;
24805            printf(" %d", n_buf);
24806            printf(" %d", n_table);
24807            printf("\n");
24808        }
24809    }
24810    }
24811    function_tests++;
24812#endif
24813
24814    return(test_ret);
24815}
24816
24817
24818#define gen_nb_xmlElementPtr 1
24819static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24820    return(NULL);
24821}
24822static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24823}
24824
24825static int
24826test_xmlDumpElementDecl(void) {
24827    int test_ret = 0;
24828
24829#if defined(LIBXML_OUTPUT_ENABLED)
24830    int mem_base;
24831    xmlBufferPtr buf; /* the XML buffer output */
24832    int n_buf;
24833    xmlElementPtr elem; /* An element table */
24834    int n_elem;
24835
24836    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24837    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24838        mem_base = xmlMemBlocks();
24839        buf = gen_xmlBufferPtr(n_buf, 0);
24840        elem = gen_xmlElementPtr(n_elem, 1);
24841
24842        xmlDumpElementDecl(buf, elem);
24843        call_tests++;
24844        des_xmlBufferPtr(n_buf, buf, 0);
24845        des_xmlElementPtr(n_elem, elem, 1);
24846        xmlResetLastError();
24847        if (mem_base != xmlMemBlocks()) {
24848            printf("Leak of %d blocks found in xmlDumpElementDecl",
24849	           xmlMemBlocks() - mem_base);
24850	    test_ret++;
24851            printf(" %d", n_buf);
24852            printf(" %d", n_elem);
24853            printf("\n");
24854        }
24855    }
24856    }
24857    function_tests++;
24858#endif
24859
24860    return(test_ret);
24861}
24862
24863
24864static int
24865test_xmlDumpElementTable(void) {
24866    int test_ret = 0;
24867
24868#if defined(LIBXML_OUTPUT_ENABLED)
24869    int mem_base;
24870    xmlBufferPtr buf; /* the XML buffer output */
24871    int n_buf;
24872    xmlElementTablePtr table; /* An element table */
24873    int n_table;
24874
24875    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24876    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24877        mem_base = xmlMemBlocks();
24878        buf = gen_xmlBufferPtr(n_buf, 0);
24879        table = gen_xmlElementTablePtr(n_table, 1);
24880
24881        xmlDumpElementTable(buf, table);
24882        call_tests++;
24883        des_xmlBufferPtr(n_buf, buf, 0);
24884        des_xmlElementTablePtr(n_table, table, 1);
24885        xmlResetLastError();
24886        if (mem_base != xmlMemBlocks()) {
24887            printf("Leak of %d blocks found in xmlDumpElementTable",
24888	           xmlMemBlocks() - mem_base);
24889	    test_ret++;
24890            printf(" %d", n_buf);
24891            printf(" %d", n_table);
24892            printf("\n");
24893        }
24894    }
24895    }
24896    function_tests++;
24897#endif
24898
24899    return(test_ret);
24900}
24901
24902
24903#define gen_nb_xmlNotationPtr 1
24904static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24905    return(NULL);
24906}
24907static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24908}
24909
24910static int
24911test_xmlDumpNotationDecl(void) {
24912    int test_ret = 0;
24913
24914#if defined(LIBXML_OUTPUT_ENABLED)
24915    int mem_base;
24916    xmlBufferPtr buf; /* the XML buffer output */
24917    int n_buf;
24918    xmlNotationPtr nota; /* A notation declaration */
24919    int n_nota;
24920
24921    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24922    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24923        mem_base = xmlMemBlocks();
24924        buf = gen_xmlBufferPtr(n_buf, 0);
24925        nota = gen_xmlNotationPtr(n_nota, 1);
24926
24927        xmlDumpNotationDecl(buf, nota);
24928        call_tests++;
24929        des_xmlBufferPtr(n_buf, buf, 0);
24930        des_xmlNotationPtr(n_nota, nota, 1);
24931        xmlResetLastError();
24932        if (mem_base != xmlMemBlocks()) {
24933            printf("Leak of %d blocks found in xmlDumpNotationDecl",
24934	           xmlMemBlocks() - mem_base);
24935	    test_ret++;
24936            printf(" %d", n_buf);
24937            printf(" %d", n_nota);
24938            printf("\n");
24939        }
24940    }
24941    }
24942    function_tests++;
24943#endif
24944
24945    return(test_ret);
24946}
24947
24948
24949static int
24950test_xmlDumpNotationTable(void) {
24951    int test_ret = 0;
24952
24953#if defined(LIBXML_OUTPUT_ENABLED)
24954    int mem_base;
24955    xmlBufferPtr buf; /* the XML buffer output */
24956    int n_buf;
24957    xmlNotationTablePtr table; /* A notation table */
24958    int n_table;
24959
24960    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24961    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24962        mem_base = xmlMemBlocks();
24963        buf = gen_xmlBufferPtr(n_buf, 0);
24964        table = gen_xmlNotationTablePtr(n_table, 1);
24965
24966        xmlDumpNotationTable(buf, table);
24967        call_tests++;
24968        des_xmlBufferPtr(n_buf, buf, 0);
24969        des_xmlNotationTablePtr(n_table, table, 1);
24970        xmlResetLastError();
24971        if (mem_base != xmlMemBlocks()) {
24972            printf("Leak of %d blocks found in xmlDumpNotationTable",
24973	           xmlMemBlocks() - mem_base);
24974	    test_ret++;
24975            printf(" %d", n_buf);
24976            printf(" %d", n_table);
24977            printf("\n");
24978        }
24979    }
24980    }
24981    function_tests++;
24982#endif
24983
24984    return(test_ret);
24985}
24986
24987
24988static int
24989test_xmlGetDtdAttrDesc(void) {
24990    int test_ret = 0;
24991
24992    int mem_base;
24993    xmlAttributePtr ret_val;
24994    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24995    int n_dtd;
24996    xmlChar * elem; /* the element name */
24997    int n_elem;
24998    xmlChar * name; /* the attribute name */
24999    int n_name;
25000
25001    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25002    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25003    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25004        mem_base = xmlMemBlocks();
25005        dtd = gen_xmlDtdPtr(n_dtd, 0);
25006        elem = gen_const_xmlChar_ptr(n_elem, 1);
25007        name = gen_const_xmlChar_ptr(n_name, 2);
25008
25009        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25010        desret_xmlAttributePtr(ret_val);
25011        call_tests++;
25012        des_xmlDtdPtr(n_dtd, dtd, 0);
25013        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25014        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25015        xmlResetLastError();
25016        if (mem_base != xmlMemBlocks()) {
25017            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25018	           xmlMemBlocks() - mem_base);
25019	    test_ret++;
25020            printf(" %d", n_dtd);
25021            printf(" %d", n_elem);
25022            printf(" %d", n_name);
25023            printf("\n");
25024        }
25025    }
25026    }
25027    }
25028    function_tests++;
25029
25030    return(test_ret);
25031}
25032
25033
25034static int
25035test_xmlGetDtdElementDesc(void) {
25036    int test_ret = 0;
25037
25038    int mem_base;
25039    xmlElementPtr ret_val;
25040    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25041    int n_dtd;
25042    xmlChar * name; /* the element name */
25043    int n_name;
25044
25045    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25046    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25047        mem_base = xmlMemBlocks();
25048        dtd = gen_xmlDtdPtr(n_dtd, 0);
25049        name = gen_const_xmlChar_ptr(n_name, 1);
25050
25051        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25052        desret_xmlElementPtr(ret_val);
25053        call_tests++;
25054        des_xmlDtdPtr(n_dtd, dtd, 0);
25055        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25056        xmlResetLastError();
25057        if (mem_base != xmlMemBlocks()) {
25058            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25059	           xmlMemBlocks() - mem_base);
25060	    test_ret++;
25061            printf(" %d", n_dtd);
25062            printf(" %d", n_name);
25063            printf("\n");
25064        }
25065    }
25066    }
25067    function_tests++;
25068
25069    return(test_ret);
25070}
25071
25072
25073static int
25074test_xmlGetDtdNotationDesc(void) {
25075    int test_ret = 0;
25076
25077
25078    /* missing type support */
25079    return(test_ret);
25080}
25081
25082
25083static int
25084test_xmlGetDtdQAttrDesc(void) {
25085    int test_ret = 0;
25086
25087    int mem_base;
25088    xmlAttributePtr ret_val;
25089    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25090    int n_dtd;
25091    xmlChar * elem; /* the element name */
25092    int n_elem;
25093    xmlChar * name; /* the attribute name */
25094    int n_name;
25095    xmlChar * prefix; /* the attribute namespace prefix */
25096    int n_prefix;
25097
25098    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25099    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25100    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25101    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25102        mem_base = xmlMemBlocks();
25103        dtd = gen_xmlDtdPtr(n_dtd, 0);
25104        elem = gen_const_xmlChar_ptr(n_elem, 1);
25105        name = gen_const_xmlChar_ptr(n_name, 2);
25106        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25107
25108        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25109        desret_xmlAttributePtr(ret_val);
25110        call_tests++;
25111        des_xmlDtdPtr(n_dtd, dtd, 0);
25112        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25113        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25114        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25115        xmlResetLastError();
25116        if (mem_base != xmlMemBlocks()) {
25117            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25118	           xmlMemBlocks() - mem_base);
25119	    test_ret++;
25120            printf(" %d", n_dtd);
25121            printf(" %d", n_elem);
25122            printf(" %d", n_name);
25123            printf(" %d", n_prefix);
25124            printf("\n");
25125        }
25126    }
25127    }
25128    }
25129    }
25130    function_tests++;
25131
25132    return(test_ret);
25133}
25134
25135
25136static int
25137test_xmlGetDtdQElementDesc(void) {
25138    int test_ret = 0;
25139
25140    int mem_base;
25141    xmlElementPtr ret_val;
25142    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25143    int n_dtd;
25144    xmlChar * name; /* the element name */
25145    int n_name;
25146    xmlChar * prefix; /* the element namespace prefix */
25147    int n_prefix;
25148
25149    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25150    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25151    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25152        mem_base = xmlMemBlocks();
25153        dtd = gen_xmlDtdPtr(n_dtd, 0);
25154        name = gen_const_xmlChar_ptr(n_name, 1);
25155        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25156
25157        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25158        desret_xmlElementPtr(ret_val);
25159        call_tests++;
25160        des_xmlDtdPtr(n_dtd, dtd, 0);
25161        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25162        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25163        xmlResetLastError();
25164        if (mem_base != xmlMemBlocks()) {
25165            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25166	           xmlMemBlocks() - mem_base);
25167	    test_ret++;
25168            printf(" %d", n_dtd);
25169            printf(" %d", n_name);
25170            printf(" %d", n_prefix);
25171            printf("\n");
25172        }
25173    }
25174    }
25175    }
25176    function_tests++;
25177
25178    return(test_ret);
25179}
25180
25181
25182static int
25183test_xmlGetID(void) {
25184    int test_ret = 0;
25185
25186    int mem_base;
25187    xmlAttrPtr ret_val;
25188    xmlDocPtr doc; /* pointer to the document */
25189    int n_doc;
25190    xmlChar * ID; /* the ID value */
25191    int n_ID;
25192
25193    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25194    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25195        mem_base = xmlMemBlocks();
25196        doc = gen_xmlDocPtr(n_doc, 0);
25197        ID = gen_const_xmlChar_ptr(n_ID, 1);
25198
25199        ret_val = xmlGetID(doc, (const xmlChar *)ID);
25200        desret_xmlAttrPtr(ret_val);
25201        call_tests++;
25202        des_xmlDocPtr(n_doc, doc, 0);
25203        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25204        xmlResetLastError();
25205        if (mem_base != xmlMemBlocks()) {
25206            printf("Leak of %d blocks found in xmlGetID",
25207	           xmlMemBlocks() - mem_base);
25208	    test_ret++;
25209            printf(" %d", n_doc);
25210            printf(" %d", n_ID);
25211            printf("\n");
25212        }
25213    }
25214    }
25215    function_tests++;
25216
25217    return(test_ret);
25218}
25219
25220
25221static int
25222test_xmlGetRefs(void) {
25223    int test_ret = 0;
25224
25225
25226    /* missing type support */
25227    return(test_ret);
25228}
25229
25230
25231static int
25232test_xmlIsID(void) {
25233    int test_ret = 0;
25234
25235    int mem_base;
25236    int ret_val;
25237    xmlDocPtr doc; /* the document */
25238    int n_doc;
25239    xmlNodePtr elem; /* the element carrying the attribute */
25240    int n_elem;
25241    xmlAttrPtr attr; /* the attribute */
25242    int n_attr;
25243
25244    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25245    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25246    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25247        mem_base = xmlMemBlocks();
25248        doc = gen_xmlDocPtr(n_doc, 0);
25249        elem = gen_xmlNodePtr(n_elem, 1);
25250        attr = gen_xmlAttrPtr(n_attr, 2);
25251
25252        ret_val = xmlIsID(doc, elem, attr);
25253        desret_int(ret_val);
25254        call_tests++;
25255        des_xmlDocPtr(n_doc, doc, 0);
25256        des_xmlNodePtr(n_elem, elem, 1);
25257        des_xmlAttrPtr(n_attr, attr, 2);
25258        xmlResetLastError();
25259        if (mem_base != xmlMemBlocks()) {
25260            printf("Leak of %d blocks found in xmlIsID",
25261	           xmlMemBlocks() - mem_base);
25262	    test_ret++;
25263            printf(" %d", n_doc);
25264            printf(" %d", n_elem);
25265            printf(" %d", n_attr);
25266            printf("\n");
25267        }
25268    }
25269    }
25270    }
25271    function_tests++;
25272
25273    return(test_ret);
25274}
25275
25276
25277static int
25278test_xmlIsMixedElement(void) {
25279    int test_ret = 0;
25280
25281    int mem_base;
25282    int ret_val;
25283    xmlDocPtr doc; /* the document */
25284    int n_doc;
25285    xmlChar * name; /* the element name */
25286    int n_name;
25287
25288    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25289    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25290        mem_base = xmlMemBlocks();
25291        doc = gen_xmlDocPtr(n_doc, 0);
25292        name = gen_const_xmlChar_ptr(n_name, 1);
25293
25294        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25295        desret_int(ret_val);
25296        call_tests++;
25297        des_xmlDocPtr(n_doc, doc, 0);
25298        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25299        xmlResetLastError();
25300        if (mem_base != xmlMemBlocks()) {
25301            printf("Leak of %d blocks found in xmlIsMixedElement",
25302	           xmlMemBlocks() - mem_base);
25303	    test_ret++;
25304            printf(" %d", n_doc);
25305            printf(" %d", n_name);
25306            printf("\n");
25307        }
25308    }
25309    }
25310    function_tests++;
25311
25312    return(test_ret);
25313}
25314
25315
25316static int
25317test_xmlIsRef(void) {
25318    int test_ret = 0;
25319
25320    int mem_base;
25321    int ret_val;
25322    xmlDocPtr doc; /* the document */
25323    int n_doc;
25324    xmlNodePtr elem; /* the element carrying the attribute */
25325    int n_elem;
25326    xmlAttrPtr attr; /* the attribute */
25327    int n_attr;
25328
25329    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25330    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25331    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25332        mem_base = xmlMemBlocks();
25333        doc = gen_xmlDocPtr(n_doc, 0);
25334        elem = gen_xmlNodePtr(n_elem, 1);
25335        attr = gen_xmlAttrPtr(n_attr, 2);
25336
25337        ret_val = xmlIsRef(doc, elem, attr);
25338        desret_int(ret_val);
25339        call_tests++;
25340        des_xmlDocPtr(n_doc, doc, 0);
25341        des_xmlNodePtr(n_elem, elem, 1);
25342        des_xmlAttrPtr(n_attr, attr, 2);
25343        xmlResetLastError();
25344        if (mem_base != xmlMemBlocks()) {
25345            printf("Leak of %d blocks found in xmlIsRef",
25346	           xmlMemBlocks() - mem_base);
25347	    test_ret++;
25348            printf(" %d", n_doc);
25349            printf(" %d", n_elem);
25350            printf(" %d", n_attr);
25351            printf("\n");
25352        }
25353    }
25354    }
25355    }
25356    function_tests++;
25357
25358    return(test_ret);
25359}
25360
25361
25362static int
25363test_xmlNewDocElementContent(void) {
25364    int test_ret = 0;
25365
25366    int mem_base;
25367    xmlElementContentPtr ret_val;
25368    xmlDocPtr doc; /* the document */
25369    int n_doc;
25370    xmlChar * name; /* the subelement name or NULL */
25371    int n_name;
25372    xmlElementContentType type; /* the type of element content decl */
25373    int n_type;
25374
25375    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25376    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25377    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25378        mem_base = xmlMemBlocks();
25379        doc = gen_xmlDocPtr(n_doc, 0);
25380        name = gen_const_xmlChar_ptr(n_name, 1);
25381        type = gen_xmlElementContentType(n_type, 2);
25382
25383        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25384        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25385        desret_xmlElementContentPtr(ret_val);
25386        call_tests++;
25387        des_xmlDocPtr(n_doc, doc, 0);
25388        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25389        des_xmlElementContentType(n_type, type, 2);
25390        xmlResetLastError();
25391        if (mem_base != xmlMemBlocks()) {
25392            printf("Leak of %d blocks found in xmlNewDocElementContent",
25393	           xmlMemBlocks() - mem_base);
25394	    test_ret++;
25395            printf(" %d", n_doc);
25396            printf(" %d", n_name);
25397            printf(" %d", n_type);
25398            printf("\n");
25399        }
25400    }
25401    }
25402    }
25403    function_tests++;
25404
25405    return(test_ret);
25406}
25407
25408
25409static int
25410test_xmlNewElementContent(void) {
25411    int test_ret = 0;
25412
25413    int mem_base;
25414    xmlElementContentPtr ret_val;
25415    xmlChar * name; /* the subelement name or NULL */
25416    int n_name;
25417    xmlElementContentType type; /* the type of element content decl */
25418    int n_type;
25419
25420    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25421    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25422        mem_base = xmlMemBlocks();
25423        name = gen_const_xmlChar_ptr(n_name, 0);
25424        type = gen_xmlElementContentType(n_type, 1);
25425
25426        ret_val = xmlNewElementContent((const xmlChar *)name, type);
25427        desret_xmlElementContentPtr(ret_val);
25428        call_tests++;
25429        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25430        des_xmlElementContentType(n_type, type, 1);
25431        xmlResetLastError();
25432        if (mem_base != xmlMemBlocks()) {
25433            printf("Leak of %d blocks found in xmlNewElementContent",
25434	           xmlMemBlocks() - mem_base);
25435	    test_ret++;
25436            printf(" %d", n_name);
25437            printf(" %d", n_type);
25438            printf("\n");
25439        }
25440    }
25441    }
25442    function_tests++;
25443
25444    return(test_ret);
25445}
25446
25447
25448static int
25449test_xmlNewValidCtxt(void) {
25450    int test_ret = 0;
25451
25452
25453    /* missing type support */
25454    return(test_ret);
25455}
25456
25457
25458static int
25459test_xmlRemoveID(void) {
25460    int test_ret = 0;
25461
25462    int mem_base;
25463    int ret_val;
25464    xmlDocPtr doc; /* the document */
25465    int n_doc;
25466    xmlAttrPtr attr; /* the attribute */
25467    int n_attr;
25468
25469    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25470    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25471        mem_base = xmlMemBlocks();
25472        doc = gen_xmlDocPtr(n_doc, 0);
25473        attr = gen_xmlAttrPtr(n_attr, 1);
25474
25475        ret_val = xmlRemoveID(doc, attr);
25476        desret_int(ret_val);
25477        call_tests++;
25478        des_xmlDocPtr(n_doc, doc, 0);
25479        des_xmlAttrPtr(n_attr, attr, 1);
25480        xmlResetLastError();
25481        if (mem_base != xmlMemBlocks()) {
25482            printf("Leak of %d blocks found in xmlRemoveID",
25483	           xmlMemBlocks() - mem_base);
25484	    test_ret++;
25485            printf(" %d", n_doc);
25486            printf(" %d", n_attr);
25487            printf("\n");
25488        }
25489    }
25490    }
25491    function_tests++;
25492
25493    return(test_ret);
25494}
25495
25496
25497static int
25498test_xmlRemoveRef(void) {
25499    int test_ret = 0;
25500
25501    int mem_base;
25502    int ret_val;
25503    xmlDocPtr doc; /* the document */
25504    int n_doc;
25505    xmlAttrPtr attr; /* the attribute */
25506    int n_attr;
25507
25508    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25509    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25510        mem_base = xmlMemBlocks();
25511        doc = gen_xmlDocPtr(n_doc, 0);
25512        attr = gen_xmlAttrPtr(n_attr, 1);
25513
25514        ret_val = xmlRemoveRef(doc, attr);
25515        desret_int(ret_val);
25516        call_tests++;
25517        des_xmlDocPtr(n_doc, doc, 0);
25518        des_xmlAttrPtr(n_attr, attr, 1);
25519        xmlResetLastError();
25520        if (mem_base != xmlMemBlocks()) {
25521            printf("Leak of %d blocks found in xmlRemoveRef",
25522	           xmlMemBlocks() - mem_base);
25523	    test_ret++;
25524            printf(" %d", n_doc);
25525            printf(" %d", n_attr);
25526            printf("\n");
25527        }
25528    }
25529    }
25530    function_tests++;
25531
25532    return(test_ret);
25533}
25534
25535
25536static int
25537test_xmlSnprintfElementContent(void) {
25538    int test_ret = 0;
25539
25540    int mem_base;
25541    char * buf; /* an output buffer */
25542    int n_buf;
25543    int size; /* the buffer size */
25544    int n_size;
25545    xmlElementContentPtr content; /* An element table */
25546    int n_content;
25547    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25548    int n_englob;
25549
25550    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25551    for (n_size = 0;n_size < gen_nb_int;n_size++) {
25552    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25553    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25554        mem_base = xmlMemBlocks();
25555        buf = gen_char_ptr(n_buf, 0);
25556        size = gen_int(n_size, 1);
25557        content = gen_xmlElementContentPtr(n_content, 2);
25558        englob = gen_int(n_englob, 3);
25559
25560        xmlSnprintfElementContent(buf, size, content, englob);
25561        call_tests++;
25562        des_char_ptr(n_buf, buf, 0);
25563        des_int(n_size, size, 1);
25564        des_xmlElementContentPtr(n_content, content, 2);
25565        des_int(n_englob, englob, 3);
25566        xmlResetLastError();
25567        if (mem_base != xmlMemBlocks()) {
25568            printf("Leak of %d blocks found in xmlSnprintfElementContent",
25569	           xmlMemBlocks() - mem_base);
25570	    test_ret++;
25571            printf(" %d", n_buf);
25572            printf(" %d", n_size);
25573            printf(" %d", n_content);
25574            printf(" %d", n_englob);
25575            printf("\n");
25576        }
25577    }
25578    }
25579    }
25580    }
25581    function_tests++;
25582
25583    return(test_ret);
25584}
25585
25586
25587static int
25588test_xmlSprintfElementContent(void) {
25589    int test_ret = 0;
25590
25591#if defined(LIBXML_OUTPUT_ENABLED)
25592#ifdef LIBXML_OUTPUT_ENABLED
25593    int mem_base;
25594    char * buf; /* an output buffer */
25595    int n_buf;
25596    xmlElementContentPtr content; /* An element table */
25597    int n_content;
25598    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25599    int n_englob;
25600
25601    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25602    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25603    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25604        mem_base = xmlMemBlocks();
25605        buf = gen_char_ptr(n_buf, 0);
25606        content = gen_xmlElementContentPtr(n_content, 1);
25607        englob = gen_int(n_englob, 2);
25608
25609        xmlSprintfElementContent(buf, content, englob);
25610        call_tests++;
25611        des_char_ptr(n_buf, buf, 0);
25612        des_xmlElementContentPtr(n_content, content, 1);
25613        des_int(n_englob, englob, 2);
25614        xmlResetLastError();
25615        if (mem_base != xmlMemBlocks()) {
25616            printf("Leak of %d blocks found in xmlSprintfElementContent",
25617	           xmlMemBlocks() - mem_base);
25618	    test_ret++;
25619            printf(" %d", n_buf);
25620            printf(" %d", n_content);
25621            printf(" %d", n_englob);
25622            printf("\n");
25623        }
25624    }
25625    }
25626    }
25627    function_tests++;
25628#endif
25629#endif
25630
25631    return(test_ret);
25632}
25633
25634
25635static int
25636test_xmlValidBuildContentModel(void) {
25637    int test_ret = 0;
25638
25639#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25640    int mem_base;
25641    int ret_val;
25642    xmlValidCtxtPtr ctxt; /* a validation context */
25643    int n_ctxt;
25644    xmlElementPtr elem; /* an element declaration node */
25645    int n_elem;
25646
25647    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25648    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25649        mem_base = xmlMemBlocks();
25650        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25651        elem = gen_xmlElementPtr(n_elem, 1);
25652
25653        ret_val = xmlValidBuildContentModel(ctxt, elem);
25654        desret_int(ret_val);
25655        call_tests++;
25656        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25657        des_xmlElementPtr(n_elem, elem, 1);
25658        xmlResetLastError();
25659        if (mem_base != xmlMemBlocks()) {
25660            printf("Leak of %d blocks found in xmlValidBuildContentModel",
25661	           xmlMemBlocks() - mem_base);
25662	    test_ret++;
25663            printf(" %d", n_ctxt);
25664            printf(" %d", n_elem);
25665            printf("\n");
25666        }
25667    }
25668    }
25669    function_tests++;
25670#endif
25671
25672    return(test_ret);
25673}
25674
25675
25676static int
25677test_xmlValidCtxtNormalizeAttributeValue(void) {
25678    int test_ret = 0;
25679
25680#if defined(LIBXML_VALID_ENABLED)
25681    int mem_base;
25682    xmlChar * ret_val;
25683    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25684    int n_ctxt;
25685    xmlDocPtr doc; /* the document */
25686    int n_doc;
25687    xmlNodePtr elem; /* the parent */
25688    int n_elem;
25689    xmlChar * name; /* the attribute name */
25690    int n_name;
25691    xmlChar * value; /* the attribute value */
25692    int n_value;
25693
25694    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25695    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25696    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25697    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25698    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25699        mem_base = xmlMemBlocks();
25700        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25701        doc = gen_xmlDocPtr(n_doc, 1);
25702        elem = gen_xmlNodePtr(n_elem, 2);
25703        name = gen_const_xmlChar_ptr(n_name, 3);
25704        value = gen_const_xmlChar_ptr(n_value, 4);
25705
25706        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25707        desret_xmlChar_ptr(ret_val);
25708        call_tests++;
25709        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25710        des_xmlDocPtr(n_doc, doc, 1);
25711        des_xmlNodePtr(n_elem, elem, 2);
25712        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25713        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25714        xmlResetLastError();
25715        if (mem_base != xmlMemBlocks()) {
25716            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25717	           xmlMemBlocks() - mem_base);
25718	    test_ret++;
25719            printf(" %d", n_ctxt);
25720            printf(" %d", n_doc);
25721            printf(" %d", n_elem);
25722            printf(" %d", n_name);
25723            printf(" %d", n_value);
25724            printf("\n");
25725        }
25726    }
25727    }
25728    }
25729    }
25730    }
25731    function_tests++;
25732#endif
25733
25734    return(test_ret);
25735}
25736
25737
25738#define gen_nb_xmlElementContent_ptr 1
25739static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25740    return(NULL);
25741}
25742static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25743}
25744
25745static int
25746test_xmlValidGetPotentialChildren(void) {
25747    int test_ret = 0;
25748
25749#if defined(LIBXML_VALID_ENABLED)
25750#ifdef LIBXML_VALID_ENABLED
25751    int mem_base;
25752    int ret_val;
25753    xmlElementContent * ctree; /* an element content tree */
25754    int n_ctree;
25755    xmlChar ** names; /* an array to store the list of child names */
25756    int n_names;
25757    int * len; /* a pointer to the number of element in the list */
25758    int n_len;
25759    int max; /* the size of the array */
25760    int n_max;
25761
25762    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25763    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25764    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25765    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25766        mem_base = xmlMemBlocks();
25767        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25768        names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25769        len = gen_int_ptr(n_len, 2);
25770        max = gen_int(n_max, 3);
25771
25772        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25773        desret_int(ret_val);
25774        call_tests++;
25775        des_xmlElementContent_ptr(n_ctree, ctree, 0);
25776        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25777        des_int_ptr(n_len, len, 2);
25778        des_int(n_max, max, 3);
25779        xmlResetLastError();
25780        if (mem_base != xmlMemBlocks()) {
25781            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25782	           xmlMemBlocks() - mem_base);
25783	    test_ret++;
25784            printf(" %d", n_ctree);
25785            printf(" %d", n_names);
25786            printf(" %d", n_len);
25787            printf(" %d", n_max);
25788            printf("\n");
25789        }
25790    }
25791    }
25792    }
25793    }
25794    function_tests++;
25795#endif
25796#endif
25797
25798    return(test_ret);
25799}
25800
25801
25802static int
25803test_xmlValidGetValidElements(void) {
25804    int test_ret = 0;
25805
25806#if defined(LIBXML_VALID_ENABLED)
25807#ifdef LIBXML_VALID_ENABLED
25808    int mem_base;
25809    int ret_val;
25810    xmlNode * prev; /* an element to insert after */
25811    int n_prev;
25812    xmlNode * next; /* an element to insert next */
25813    int n_next;
25814    xmlChar ** names; /* an array to store the list of child names */
25815    int n_names;
25816    int max; /* the size of the array */
25817    int n_max;
25818
25819    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25820    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25821    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25822    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25823        mem_base = xmlMemBlocks();
25824        prev = gen_xmlNodePtr(n_prev, 0);
25825        next = gen_xmlNodePtr(n_next, 1);
25826        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25827        max = gen_int(n_max, 3);
25828
25829        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25830        desret_int(ret_val);
25831        call_tests++;
25832        des_xmlNodePtr(n_prev, prev, 0);
25833        des_xmlNodePtr(n_next, next, 1);
25834        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25835        des_int(n_max, max, 3);
25836        xmlResetLastError();
25837        if (mem_base != xmlMemBlocks()) {
25838            printf("Leak of %d blocks found in xmlValidGetValidElements",
25839	           xmlMemBlocks() - mem_base);
25840	    test_ret++;
25841            printf(" %d", n_prev);
25842            printf(" %d", n_next);
25843            printf(" %d", n_names);
25844            printf(" %d", n_max);
25845            printf("\n");
25846        }
25847    }
25848    }
25849    }
25850    }
25851    function_tests++;
25852#endif
25853#endif
25854
25855    return(test_ret);
25856}
25857
25858
25859static int
25860test_xmlValidNormalizeAttributeValue(void) {
25861    int test_ret = 0;
25862
25863#if defined(LIBXML_VALID_ENABLED)
25864    int mem_base;
25865    xmlChar * ret_val;
25866    xmlDocPtr doc; /* the document */
25867    int n_doc;
25868    xmlNodePtr elem; /* the parent */
25869    int n_elem;
25870    xmlChar * name; /* the attribute name */
25871    int n_name;
25872    xmlChar * value; /* the attribute value */
25873    int n_value;
25874
25875    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25876    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25877    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25878    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25879        mem_base = xmlMemBlocks();
25880        doc = gen_xmlDocPtr(n_doc, 0);
25881        elem = gen_xmlNodePtr(n_elem, 1);
25882        name = gen_const_xmlChar_ptr(n_name, 2);
25883        value = gen_const_xmlChar_ptr(n_value, 3);
25884
25885        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25886        desret_xmlChar_ptr(ret_val);
25887        call_tests++;
25888        des_xmlDocPtr(n_doc, doc, 0);
25889        des_xmlNodePtr(n_elem, elem, 1);
25890        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25891        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25892        xmlResetLastError();
25893        if (mem_base != xmlMemBlocks()) {
25894            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25895	           xmlMemBlocks() - mem_base);
25896	    test_ret++;
25897            printf(" %d", n_doc);
25898            printf(" %d", n_elem);
25899            printf(" %d", n_name);
25900            printf(" %d", n_value);
25901            printf("\n");
25902        }
25903    }
25904    }
25905    }
25906    }
25907    function_tests++;
25908#endif
25909
25910    return(test_ret);
25911}
25912
25913
25914static int
25915test_xmlValidateAttributeDecl(void) {
25916    int test_ret = 0;
25917
25918#if defined(LIBXML_VALID_ENABLED)
25919    int mem_base;
25920    int ret_val;
25921    xmlValidCtxtPtr ctxt; /* the validation context */
25922    int n_ctxt;
25923    xmlDocPtr doc; /* a document instance */
25924    int n_doc;
25925    xmlAttributePtr attr; /* an attribute definition */
25926    int n_attr;
25927
25928    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25929    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25930    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25931        mem_base = xmlMemBlocks();
25932        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25933        doc = gen_xmlDocPtr(n_doc, 1);
25934        attr = gen_xmlAttributePtr(n_attr, 2);
25935
25936        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25937        desret_int(ret_val);
25938        call_tests++;
25939        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25940        des_xmlDocPtr(n_doc, doc, 1);
25941        des_xmlAttributePtr(n_attr, attr, 2);
25942        xmlResetLastError();
25943        if (mem_base != xmlMemBlocks()) {
25944            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25945	           xmlMemBlocks() - mem_base);
25946	    test_ret++;
25947            printf(" %d", n_ctxt);
25948            printf(" %d", n_doc);
25949            printf(" %d", n_attr);
25950            printf("\n");
25951        }
25952    }
25953    }
25954    }
25955    function_tests++;
25956#endif
25957
25958    return(test_ret);
25959}
25960
25961
25962static int
25963test_xmlValidateAttributeValue(void) {
25964    int test_ret = 0;
25965
25966#if defined(LIBXML_VALID_ENABLED)
25967    int mem_base;
25968    int ret_val;
25969    xmlAttributeType type; /*  */
25970    int n_type;
25971    xmlChar * value; /*  */
25972    int n_value;
25973
25974    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25975    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25976        mem_base = xmlMemBlocks();
25977        type = gen_xmlAttributeType(n_type, 0);
25978        value = gen_const_xmlChar_ptr(n_value, 1);
25979
25980        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25981        desret_int(ret_val);
25982        call_tests++;
25983        des_xmlAttributeType(n_type, type, 0);
25984        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25985        xmlResetLastError();
25986        if (mem_base != xmlMemBlocks()) {
25987            printf("Leak of %d blocks found in xmlValidateAttributeValue",
25988	           xmlMemBlocks() - mem_base);
25989	    test_ret++;
25990            printf(" %d", n_type);
25991            printf(" %d", n_value);
25992            printf("\n");
25993        }
25994    }
25995    }
25996    function_tests++;
25997#endif
25998
25999    return(test_ret);
26000}
26001
26002
26003static int
26004test_xmlValidateDocument(void) {
26005    int test_ret = 0;
26006
26007#if defined(LIBXML_VALID_ENABLED)
26008    int mem_base;
26009    int ret_val;
26010    xmlValidCtxtPtr ctxt; /* the validation context */
26011    int n_ctxt;
26012    xmlDocPtr doc; /* a document instance */
26013    int n_doc;
26014
26015    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26016    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26017        mem_base = xmlMemBlocks();
26018        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26019        doc = gen_xmlDocPtr(n_doc, 1);
26020
26021        ret_val = xmlValidateDocument(ctxt, doc);
26022        desret_int(ret_val);
26023        call_tests++;
26024        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26025        des_xmlDocPtr(n_doc, doc, 1);
26026        xmlResetLastError();
26027        if (mem_base != xmlMemBlocks()) {
26028            printf("Leak of %d blocks found in xmlValidateDocument",
26029	           xmlMemBlocks() - mem_base);
26030	    test_ret++;
26031            printf(" %d", n_ctxt);
26032            printf(" %d", n_doc);
26033            printf("\n");
26034        }
26035    }
26036    }
26037    function_tests++;
26038#endif
26039
26040    return(test_ret);
26041}
26042
26043
26044static int
26045test_xmlValidateDocumentFinal(void) {
26046    int test_ret = 0;
26047
26048#if defined(LIBXML_VALID_ENABLED)
26049    int mem_base;
26050    int ret_val;
26051    xmlValidCtxtPtr ctxt; /* the validation context */
26052    int n_ctxt;
26053    xmlDocPtr doc; /* a document instance */
26054    int n_doc;
26055
26056    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26057    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26058        mem_base = xmlMemBlocks();
26059        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26060        doc = gen_xmlDocPtr(n_doc, 1);
26061
26062        ret_val = xmlValidateDocumentFinal(ctxt, doc);
26063        desret_int(ret_val);
26064        call_tests++;
26065        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26066        des_xmlDocPtr(n_doc, doc, 1);
26067        xmlResetLastError();
26068        if (mem_base != xmlMemBlocks()) {
26069            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26070	           xmlMemBlocks() - mem_base);
26071	    test_ret++;
26072            printf(" %d", n_ctxt);
26073            printf(" %d", n_doc);
26074            printf("\n");
26075        }
26076    }
26077    }
26078    function_tests++;
26079#endif
26080
26081    return(test_ret);
26082}
26083
26084
26085static int
26086test_xmlValidateDtd(void) {
26087    int test_ret = 0;
26088
26089#if defined(LIBXML_VALID_ENABLED)
26090    int mem_base;
26091    int ret_val;
26092    xmlValidCtxtPtr ctxt; /* the validation context */
26093    int n_ctxt;
26094    xmlDocPtr doc; /* a document instance */
26095    int n_doc;
26096    xmlDtdPtr dtd; /* a dtd instance */
26097    int n_dtd;
26098
26099    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26100    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26101    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26102        mem_base = xmlMemBlocks();
26103        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26104        doc = gen_xmlDocPtr(n_doc, 1);
26105        dtd = gen_xmlDtdPtr(n_dtd, 2);
26106
26107        ret_val = xmlValidateDtd(ctxt, doc, dtd);
26108        desret_int(ret_val);
26109        call_tests++;
26110        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26111        des_xmlDocPtr(n_doc, doc, 1);
26112        des_xmlDtdPtr(n_dtd, dtd, 2);
26113        xmlResetLastError();
26114        if (mem_base != xmlMemBlocks()) {
26115            printf("Leak of %d blocks found in xmlValidateDtd",
26116	           xmlMemBlocks() - mem_base);
26117	    test_ret++;
26118            printf(" %d", n_ctxt);
26119            printf(" %d", n_doc);
26120            printf(" %d", n_dtd);
26121            printf("\n");
26122        }
26123    }
26124    }
26125    }
26126    function_tests++;
26127#endif
26128
26129    return(test_ret);
26130}
26131
26132
26133static int
26134test_xmlValidateDtdFinal(void) {
26135    int test_ret = 0;
26136
26137#if defined(LIBXML_VALID_ENABLED)
26138    int mem_base;
26139    int ret_val;
26140    xmlValidCtxtPtr ctxt; /* the validation context */
26141    int n_ctxt;
26142    xmlDocPtr doc; /* a document instance */
26143    int n_doc;
26144
26145    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26146    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26147        mem_base = xmlMemBlocks();
26148        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26149        doc = gen_xmlDocPtr(n_doc, 1);
26150
26151        ret_val = xmlValidateDtdFinal(ctxt, doc);
26152        desret_int(ret_val);
26153        call_tests++;
26154        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26155        des_xmlDocPtr(n_doc, doc, 1);
26156        xmlResetLastError();
26157        if (mem_base != xmlMemBlocks()) {
26158            printf("Leak of %d blocks found in xmlValidateDtdFinal",
26159	           xmlMemBlocks() - mem_base);
26160	    test_ret++;
26161            printf(" %d", n_ctxt);
26162            printf(" %d", n_doc);
26163            printf("\n");
26164        }
26165    }
26166    }
26167    function_tests++;
26168#endif
26169
26170    return(test_ret);
26171}
26172
26173
26174static int
26175test_xmlValidateElement(void) {
26176    int test_ret = 0;
26177
26178#if defined(LIBXML_VALID_ENABLED)
26179    int mem_base;
26180    int ret_val;
26181    xmlValidCtxtPtr ctxt; /* the validation context */
26182    int n_ctxt;
26183    xmlDocPtr doc; /* a document instance */
26184    int n_doc;
26185    xmlNodePtr elem; /* an element instance */
26186    int n_elem;
26187
26188    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26189    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26190    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26191        mem_base = xmlMemBlocks();
26192        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26193        doc = gen_xmlDocPtr(n_doc, 1);
26194        elem = gen_xmlNodePtr(n_elem, 2);
26195
26196        ret_val = xmlValidateElement(ctxt, doc, elem);
26197        desret_int(ret_val);
26198        call_tests++;
26199        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26200        des_xmlDocPtr(n_doc, doc, 1);
26201        des_xmlNodePtr(n_elem, elem, 2);
26202        xmlResetLastError();
26203        if (mem_base != xmlMemBlocks()) {
26204            printf("Leak of %d blocks found in xmlValidateElement",
26205	           xmlMemBlocks() - mem_base);
26206	    test_ret++;
26207            printf(" %d", n_ctxt);
26208            printf(" %d", n_doc);
26209            printf(" %d", n_elem);
26210            printf("\n");
26211        }
26212    }
26213    }
26214    }
26215    function_tests++;
26216#endif
26217
26218    return(test_ret);
26219}
26220
26221
26222static int
26223test_xmlValidateElementDecl(void) {
26224    int test_ret = 0;
26225
26226#if defined(LIBXML_VALID_ENABLED)
26227    int mem_base;
26228    int ret_val;
26229    xmlValidCtxtPtr ctxt; /* the validation context */
26230    int n_ctxt;
26231    xmlDocPtr doc; /* a document instance */
26232    int n_doc;
26233    xmlElementPtr elem; /* an element definition */
26234    int n_elem;
26235
26236    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26237    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26238    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26239        mem_base = xmlMemBlocks();
26240        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26241        doc = gen_xmlDocPtr(n_doc, 1);
26242        elem = gen_xmlElementPtr(n_elem, 2);
26243
26244        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26245        desret_int(ret_val);
26246        call_tests++;
26247        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26248        des_xmlDocPtr(n_doc, doc, 1);
26249        des_xmlElementPtr(n_elem, elem, 2);
26250        xmlResetLastError();
26251        if (mem_base != xmlMemBlocks()) {
26252            printf("Leak of %d blocks found in xmlValidateElementDecl",
26253	           xmlMemBlocks() - mem_base);
26254	    test_ret++;
26255            printf(" %d", n_ctxt);
26256            printf(" %d", n_doc);
26257            printf(" %d", n_elem);
26258            printf("\n");
26259        }
26260    }
26261    }
26262    }
26263    function_tests++;
26264#endif
26265
26266    return(test_ret);
26267}
26268
26269
26270static int
26271test_xmlValidateNameValue(void) {
26272    int test_ret = 0;
26273
26274#if defined(LIBXML_VALID_ENABLED)
26275    int mem_base;
26276    int ret_val;
26277    xmlChar * value; /* an Name value */
26278    int n_value;
26279
26280    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26281        mem_base = xmlMemBlocks();
26282        value = gen_const_xmlChar_ptr(n_value, 0);
26283
26284        ret_val = xmlValidateNameValue((const xmlChar *)value);
26285        desret_int(ret_val);
26286        call_tests++;
26287        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26288        xmlResetLastError();
26289        if (mem_base != xmlMemBlocks()) {
26290            printf("Leak of %d blocks found in xmlValidateNameValue",
26291	           xmlMemBlocks() - mem_base);
26292	    test_ret++;
26293            printf(" %d", n_value);
26294            printf("\n");
26295        }
26296    }
26297    function_tests++;
26298#endif
26299
26300    return(test_ret);
26301}
26302
26303
26304static int
26305test_xmlValidateNamesValue(void) {
26306    int test_ret = 0;
26307
26308#if defined(LIBXML_VALID_ENABLED)
26309    int mem_base;
26310    int ret_val;
26311    xmlChar * value; /* an Names value */
26312    int n_value;
26313
26314    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26315        mem_base = xmlMemBlocks();
26316        value = gen_const_xmlChar_ptr(n_value, 0);
26317
26318        ret_val = xmlValidateNamesValue((const xmlChar *)value);
26319        desret_int(ret_val);
26320        call_tests++;
26321        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26322        xmlResetLastError();
26323        if (mem_base != xmlMemBlocks()) {
26324            printf("Leak of %d blocks found in xmlValidateNamesValue",
26325	           xmlMemBlocks() - mem_base);
26326	    test_ret++;
26327            printf(" %d", n_value);
26328            printf("\n");
26329        }
26330    }
26331    function_tests++;
26332#endif
26333
26334    return(test_ret);
26335}
26336
26337
26338static int
26339test_xmlValidateNmtokenValue(void) {
26340    int test_ret = 0;
26341
26342#if defined(LIBXML_VALID_ENABLED)
26343    int mem_base;
26344    int ret_val;
26345    xmlChar * value; /* an Nmtoken value */
26346    int n_value;
26347
26348    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26349        mem_base = xmlMemBlocks();
26350        value = gen_const_xmlChar_ptr(n_value, 0);
26351
26352        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26353        desret_int(ret_val);
26354        call_tests++;
26355        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26356        xmlResetLastError();
26357        if (mem_base != xmlMemBlocks()) {
26358            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26359	           xmlMemBlocks() - mem_base);
26360	    test_ret++;
26361            printf(" %d", n_value);
26362            printf("\n");
26363        }
26364    }
26365    function_tests++;
26366#endif
26367
26368    return(test_ret);
26369}
26370
26371
26372static int
26373test_xmlValidateNmtokensValue(void) {
26374    int test_ret = 0;
26375
26376#if defined(LIBXML_VALID_ENABLED)
26377    int mem_base;
26378    int ret_val;
26379    xmlChar * value; /* an Nmtokens value */
26380    int n_value;
26381
26382    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26383        mem_base = xmlMemBlocks();
26384        value = gen_const_xmlChar_ptr(n_value, 0);
26385
26386        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26387        desret_int(ret_val);
26388        call_tests++;
26389        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26390        xmlResetLastError();
26391        if (mem_base != xmlMemBlocks()) {
26392            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26393	           xmlMemBlocks() - mem_base);
26394	    test_ret++;
26395            printf(" %d", n_value);
26396            printf("\n");
26397        }
26398    }
26399    function_tests++;
26400#endif
26401
26402    return(test_ret);
26403}
26404
26405
26406static int
26407test_xmlValidateNotationDecl(void) {
26408    int test_ret = 0;
26409
26410#if defined(LIBXML_VALID_ENABLED)
26411    int mem_base;
26412    int ret_val;
26413    xmlValidCtxtPtr ctxt; /* the validation context */
26414    int n_ctxt;
26415    xmlDocPtr doc; /* a document instance */
26416    int n_doc;
26417    xmlNotationPtr nota; /* a notation definition */
26418    int n_nota;
26419
26420    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26421    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26422    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26423        mem_base = xmlMemBlocks();
26424        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26425        doc = gen_xmlDocPtr(n_doc, 1);
26426        nota = gen_xmlNotationPtr(n_nota, 2);
26427
26428        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26429        desret_int(ret_val);
26430        call_tests++;
26431        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26432        des_xmlDocPtr(n_doc, doc, 1);
26433        des_xmlNotationPtr(n_nota, nota, 2);
26434        xmlResetLastError();
26435        if (mem_base != xmlMemBlocks()) {
26436            printf("Leak of %d blocks found in xmlValidateNotationDecl",
26437	           xmlMemBlocks() - mem_base);
26438	    test_ret++;
26439            printf(" %d", n_ctxt);
26440            printf(" %d", n_doc);
26441            printf(" %d", n_nota);
26442            printf("\n");
26443        }
26444    }
26445    }
26446    }
26447    function_tests++;
26448#endif
26449
26450    return(test_ret);
26451}
26452
26453
26454static int
26455test_xmlValidateNotationUse(void) {
26456    int test_ret = 0;
26457
26458#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26459    int mem_base;
26460    int ret_val;
26461    xmlValidCtxtPtr ctxt; /* the validation context */
26462    int n_ctxt;
26463    xmlDocPtr doc; /* the document */
26464    int n_doc;
26465    xmlChar * notationName; /* the notation name to check */
26466    int n_notationName;
26467
26468    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26469    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26470    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26471        mem_base = xmlMemBlocks();
26472        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26473        doc = gen_xmlDocPtr(n_doc, 1);
26474        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26475
26476        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26477        desret_int(ret_val);
26478        call_tests++;
26479        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26480        des_xmlDocPtr(n_doc, doc, 1);
26481        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26482        xmlResetLastError();
26483        if (mem_base != xmlMemBlocks()) {
26484            printf("Leak of %d blocks found in xmlValidateNotationUse",
26485	           xmlMemBlocks() - mem_base);
26486	    test_ret++;
26487            printf(" %d", n_ctxt);
26488            printf(" %d", n_doc);
26489            printf(" %d", n_notationName);
26490            printf("\n");
26491        }
26492    }
26493    }
26494    }
26495    function_tests++;
26496#endif
26497
26498    return(test_ret);
26499}
26500
26501
26502static int
26503test_xmlValidateOneAttribute(void) {
26504    int test_ret = 0;
26505
26506#if defined(LIBXML_VALID_ENABLED)
26507    int mem_base;
26508    int ret_val;
26509    xmlValidCtxtPtr ctxt; /* the validation context */
26510    int n_ctxt;
26511    xmlDocPtr doc; /* a document instance */
26512    int n_doc;
26513    xmlNodePtr elem; /* an element instance */
26514    int n_elem;
26515    xmlAttrPtr attr; /* an attribute instance */
26516    int n_attr;
26517    xmlChar * value; /* the attribute value (without entities processing) */
26518    int n_value;
26519
26520    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26521    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26522    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26523    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26524    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26525        mem_base = xmlMemBlocks();
26526        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26527        doc = gen_xmlDocPtr(n_doc, 1);
26528        elem = gen_xmlNodePtr(n_elem, 2);
26529        attr = gen_xmlAttrPtr(n_attr, 3);
26530        value = gen_const_xmlChar_ptr(n_value, 4);
26531
26532        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26533        desret_int(ret_val);
26534        call_tests++;
26535        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26536        des_xmlDocPtr(n_doc, doc, 1);
26537        des_xmlNodePtr(n_elem, elem, 2);
26538        des_xmlAttrPtr(n_attr, attr, 3);
26539        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26540        xmlResetLastError();
26541        if (mem_base != xmlMemBlocks()) {
26542            printf("Leak of %d blocks found in xmlValidateOneAttribute",
26543	           xmlMemBlocks() - mem_base);
26544	    test_ret++;
26545            printf(" %d", n_ctxt);
26546            printf(" %d", n_doc);
26547            printf(" %d", n_elem);
26548            printf(" %d", n_attr);
26549            printf(" %d", n_value);
26550            printf("\n");
26551        }
26552    }
26553    }
26554    }
26555    }
26556    }
26557    function_tests++;
26558#endif
26559
26560    return(test_ret);
26561}
26562
26563
26564static int
26565test_xmlValidateOneElement(void) {
26566    int test_ret = 0;
26567
26568#if defined(LIBXML_VALID_ENABLED)
26569    int mem_base;
26570    int ret_val;
26571    xmlValidCtxtPtr ctxt; /* the validation context */
26572    int n_ctxt;
26573    xmlDocPtr doc; /* a document instance */
26574    int n_doc;
26575    xmlNodePtr elem; /* an element instance */
26576    int n_elem;
26577
26578    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26579    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26580    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26581        mem_base = xmlMemBlocks();
26582        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26583        doc = gen_xmlDocPtr(n_doc, 1);
26584        elem = gen_xmlNodePtr(n_elem, 2);
26585
26586        ret_val = xmlValidateOneElement(ctxt, doc, elem);
26587        desret_int(ret_val);
26588        call_tests++;
26589        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26590        des_xmlDocPtr(n_doc, doc, 1);
26591        des_xmlNodePtr(n_elem, elem, 2);
26592        xmlResetLastError();
26593        if (mem_base != xmlMemBlocks()) {
26594            printf("Leak of %d blocks found in xmlValidateOneElement",
26595	           xmlMemBlocks() - mem_base);
26596	    test_ret++;
26597            printf(" %d", n_ctxt);
26598            printf(" %d", n_doc);
26599            printf(" %d", n_elem);
26600            printf("\n");
26601        }
26602    }
26603    }
26604    }
26605    function_tests++;
26606#endif
26607
26608    return(test_ret);
26609}
26610
26611
26612static int
26613test_xmlValidateOneNamespace(void) {
26614    int test_ret = 0;
26615
26616#if defined(LIBXML_VALID_ENABLED)
26617    int mem_base;
26618    int ret_val;
26619    xmlValidCtxtPtr ctxt; /* the validation context */
26620    int n_ctxt;
26621    xmlDocPtr doc; /* a document instance */
26622    int n_doc;
26623    xmlNodePtr elem; /* an element instance */
26624    int n_elem;
26625    xmlChar * prefix; /* the namespace prefix */
26626    int n_prefix;
26627    xmlNsPtr ns; /* an namespace declaration instance */
26628    int n_ns;
26629    xmlChar * value; /* the attribute value (without entities processing) */
26630    int n_value;
26631
26632    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26633    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26634    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26635    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26636    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26637    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26638        mem_base = xmlMemBlocks();
26639        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26640        doc = gen_xmlDocPtr(n_doc, 1);
26641        elem = gen_xmlNodePtr(n_elem, 2);
26642        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26643        ns = gen_xmlNsPtr(n_ns, 4);
26644        value = gen_const_xmlChar_ptr(n_value, 5);
26645
26646        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26647        desret_int(ret_val);
26648        call_tests++;
26649        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26650        des_xmlDocPtr(n_doc, doc, 1);
26651        des_xmlNodePtr(n_elem, elem, 2);
26652        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26653        des_xmlNsPtr(n_ns, ns, 4);
26654        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26655        xmlResetLastError();
26656        if (mem_base != xmlMemBlocks()) {
26657            printf("Leak of %d blocks found in xmlValidateOneNamespace",
26658	           xmlMemBlocks() - mem_base);
26659	    test_ret++;
26660            printf(" %d", n_ctxt);
26661            printf(" %d", n_doc);
26662            printf(" %d", n_elem);
26663            printf(" %d", n_prefix);
26664            printf(" %d", n_ns);
26665            printf(" %d", n_value);
26666            printf("\n");
26667        }
26668    }
26669    }
26670    }
26671    }
26672    }
26673    }
26674    function_tests++;
26675#endif
26676
26677    return(test_ret);
26678}
26679
26680
26681static int
26682test_xmlValidatePopElement(void) {
26683    int test_ret = 0;
26684
26685#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26686    int mem_base;
26687    int ret_val;
26688    xmlValidCtxtPtr ctxt; /* the validation context */
26689    int n_ctxt;
26690    xmlDocPtr doc; /* a document instance */
26691    int n_doc;
26692    xmlNodePtr elem; /* an element instance */
26693    int n_elem;
26694    xmlChar * qname; /* the qualified name as appearing in the serialization */
26695    int n_qname;
26696
26697    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26698    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26699    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26700    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26701        mem_base = xmlMemBlocks();
26702        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26703        doc = gen_xmlDocPtr(n_doc, 1);
26704        elem = gen_xmlNodePtr(n_elem, 2);
26705        qname = gen_const_xmlChar_ptr(n_qname, 3);
26706
26707        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26708        desret_int(ret_val);
26709        call_tests++;
26710        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26711        des_xmlDocPtr(n_doc, doc, 1);
26712        des_xmlNodePtr(n_elem, elem, 2);
26713        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26714        xmlResetLastError();
26715        if (mem_base != xmlMemBlocks()) {
26716            printf("Leak of %d blocks found in xmlValidatePopElement",
26717	           xmlMemBlocks() - mem_base);
26718	    test_ret++;
26719            printf(" %d", n_ctxt);
26720            printf(" %d", n_doc);
26721            printf(" %d", n_elem);
26722            printf(" %d", n_qname);
26723            printf("\n");
26724        }
26725    }
26726    }
26727    }
26728    }
26729    function_tests++;
26730#endif
26731
26732    return(test_ret);
26733}
26734
26735
26736static int
26737test_xmlValidatePushCData(void) {
26738    int test_ret = 0;
26739
26740#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26741    int mem_base;
26742    int ret_val;
26743    xmlValidCtxtPtr ctxt; /* the validation context */
26744    int n_ctxt;
26745    xmlChar * data; /* some character data read */
26746    int n_data;
26747    int len; /* the lenght of the data */
26748    int n_len;
26749
26750    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26751    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26752    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26753        mem_base = xmlMemBlocks();
26754        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26755        data = gen_const_xmlChar_ptr(n_data, 1);
26756        len = gen_int(n_len, 2);
26757
26758        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26759        desret_int(ret_val);
26760        call_tests++;
26761        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26762        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26763        des_int(n_len, len, 2);
26764        xmlResetLastError();
26765        if (mem_base != xmlMemBlocks()) {
26766            printf("Leak of %d blocks found in xmlValidatePushCData",
26767	           xmlMemBlocks() - mem_base);
26768	    test_ret++;
26769            printf(" %d", n_ctxt);
26770            printf(" %d", n_data);
26771            printf(" %d", n_len);
26772            printf("\n");
26773        }
26774    }
26775    }
26776    }
26777    function_tests++;
26778#endif
26779
26780    return(test_ret);
26781}
26782
26783
26784static int
26785test_xmlValidatePushElement(void) {
26786    int test_ret = 0;
26787
26788#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26789    int mem_base;
26790    int ret_val;
26791    xmlValidCtxtPtr ctxt; /* the validation context */
26792    int n_ctxt;
26793    xmlDocPtr doc; /* a document instance */
26794    int n_doc;
26795    xmlNodePtr elem; /* an element instance */
26796    int n_elem;
26797    xmlChar * qname; /* the qualified name as appearing in the serialization */
26798    int n_qname;
26799
26800    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26801    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26802    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26803    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26804        mem_base = xmlMemBlocks();
26805        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26806        doc = gen_xmlDocPtr(n_doc, 1);
26807        elem = gen_xmlNodePtr(n_elem, 2);
26808        qname = gen_const_xmlChar_ptr(n_qname, 3);
26809
26810        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26811        desret_int(ret_val);
26812        call_tests++;
26813        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26814        des_xmlDocPtr(n_doc, doc, 1);
26815        des_xmlNodePtr(n_elem, elem, 2);
26816        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26817        xmlResetLastError();
26818        if (mem_base != xmlMemBlocks()) {
26819            printf("Leak of %d blocks found in xmlValidatePushElement",
26820	           xmlMemBlocks() - mem_base);
26821	    test_ret++;
26822            printf(" %d", n_ctxt);
26823            printf(" %d", n_doc);
26824            printf(" %d", n_elem);
26825            printf(" %d", n_qname);
26826            printf("\n");
26827        }
26828    }
26829    }
26830    }
26831    }
26832    function_tests++;
26833#endif
26834
26835    return(test_ret);
26836}
26837
26838
26839static int
26840test_xmlValidateRoot(void) {
26841    int test_ret = 0;
26842
26843#if defined(LIBXML_VALID_ENABLED)
26844    int mem_base;
26845    int ret_val;
26846    xmlValidCtxtPtr ctxt; /* the validation context */
26847    int n_ctxt;
26848    xmlDocPtr doc; /* a document instance */
26849    int n_doc;
26850
26851    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26852    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26853        mem_base = xmlMemBlocks();
26854        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26855        doc = gen_xmlDocPtr(n_doc, 1);
26856
26857        ret_val = xmlValidateRoot(ctxt, doc);
26858        desret_int(ret_val);
26859        call_tests++;
26860        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26861        des_xmlDocPtr(n_doc, doc, 1);
26862        xmlResetLastError();
26863        if (mem_base != xmlMemBlocks()) {
26864            printf("Leak of %d blocks found in xmlValidateRoot",
26865	           xmlMemBlocks() - mem_base);
26866	    test_ret++;
26867            printf(" %d", n_ctxt);
26868            printf(" %d", n_doc);
26869            printf("\n");
26870        }
26871    }
26872    }
26873    function_tests++;
26874#endif
26875
26876    return(test_ret);
26877}
26878
26879static int
26880test_valid(void) {
26881    int test_ret = 0;
26882
26883    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26884    test_ret += test_xmlAddAttributeDecl();
26885    test_ret += test_xmlAddElementDecl();
26886    test_ret += test_xmlAddID();
26887    test_ret += test_xmlAddNotationDecl();
26888    test_ret += test_xmlAddRef();
26889    test_ret += test_xmlCopyAttributeTable();
26890    test_ret += test_xmlCopyDocElementContent();
26891    test_ret += test_xmlCopyElementContent();
26892    test_ret += test_xmlCopyElementTable();
26893    test_ret += test_xmlCopyEnumeration();
26894    test_ret += test_xmlCopyNotationTable();
26895    test_ret += test_xmlCreateEnumeration();
26896    test_ret += test_xmlDumpAttributeDecl();
26897    test_ret += test_xmlDumpAttributeTable();
26898    test_ret += test_xmlDumpElementDecl();
26899    test_ret += test_xmlDumpElementTable();
26900    test_ret += test_xmlDumpNotationDecl();
26901    test_ret += test_xmlDumpNotationTable();
26902    test_ret += test_xmlGetDtdAttrDesc();
26903    test_ret += test_xmlGetDtdElementDesc();
26904    test_ret += test_xmlGetDtdNotationDesc();
26905    test_ret += test_xmlGetDtdQAttrDesc();
26906    test_ret += test_xmlGetDtdQElementDesc();
26907    test_ret += test_xmlGetID();
26908    test_ret += test_xmlGetRefs();
26909    test_ret += test_xmlIsID();
26910    test_ret += test_xmlIsMixedElement();
26911    test_ret += test_xmlIsRef();
26912    test_ret += test_xmlNewDocElementContent();
26913    test_ret += test_xmlNewElementContent();
26914    test_ret += test_xmlNewValidCtxt();
26915    test_ret += test_xmlRemoveID();
26916    test_ret += test_xmlRemoveRef();
26917    test_ret += test_xmlSnprintfElementContent();
26918    test_ret += test_xmlSprintfElementContent();
26919    test_ret += test_xmlValidBuildContentModel();
26920    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26921    test_ret += test_xmlValidGetPotentialChildren();
26922    test_ret += test_xmlValidGetValidElements();
26923    test_ret += test_xmlValidNormalizeAttributeValue();
26924    test_ret += test_xmlValidateAttributeDecl();
26925    test_ret += test_xmlValidateAttributeValue();
26926    test_ret += test_xmlValidateDocument();
26927    test_ret += test_xmlValidateDocumentFinal();
26928    test_ret += test_xmlValidateDtd();
26929    test_ret += test_xmlValidateDtdFinal();
26930    test_ret += test_xmlValidateElement();
26931    test_ret += test_xmlValidateElementDecl();
26932    test_ret += test_xmlValidateNameValue();
26933    test_ret += test_xmlValidateNamesValue();
26934    test_ret += test_xmlValidateNmtokenValue();
26935    test_ret += test_xmlValidateNmtokensValue();
26936    test_ret += test_xmlValidateNotationDecl();
26937    test_ret += test_xmlValidateNotationUse();
26938    test_ret += test_xmlValidateOneAttribute();
26939    test_ret += test_xmlValidateOneElement();
26940    test_ret += test_xmlValidateOneNamespace();
26941    test_ret += test_xmlValidatePopElement();
26942    test_ret += test_xmlValidatePushCData();
26943    test_ret += test_xmlValidatePushElement();
26944    test_ret += test_xmlValidateRoot();
26945
26946    if (test_ret != 0)
26947	printf("Module valid: %d errors\n", test_ret);
26948    return(test_ret);
26949}
26950
26951static int
26952test_xmlXIncludeNewContext(void) {
26953    int test_ret = 0;
26954
26955
26956    /* missing type support */
26957    return(test_ret);
26958}
26959
26960
26961static int
26962test_xmlXIncludeProcess(void) {
26963    int test_ret = 0;
26964
26965#if defined(LIBXML_XINCLUDE_ENABLED)
26966    int mem_base;
26967    int ret_val;
26968    xmlDocPtr doc; /* an XML document */
26969    int n_doc;
26970
26971    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26972        mem_base = xmlMemBlocks();
26973        doc = gen_xmlDocPtr(n_doc, 0);
26974
26975        ret_val = xmlXIncludeProcess(doc);
26976        desret_int(ret_val);
26977        call_tests++;
26978        des_xmlDocPtr(n_doc, doc, 0);
26979        xmlResetLastError();
26980        if (mem_base != xmlMemBlocks()) {
26981            printf("Leak of %d blocks found in xmlXIncludeProcess",
26982	           xmlMemBlocks() - mem_base);
26983	    test_ret++;
26984            printf(" %d", n_doc);
26985            printf("\n");
26986        }
26987    }
26988    function_tests++;
26989#endif
26990
26991    return(test_ret);
26992}
26993
26994
26995static int
26996test_xmlXIncludeProcessFlags(void) {
26997    int test_ret = 0;
26998
26999#if defined(LIBXML_XINCLUDE_ENABLED)
27000    int mem_base;
27001    int ret_val;
27002    xmlDocPtr doc; /* an XML document */
27003    int n_doc;
27004    int flags; /* a set of xmlParserOption used for parsing XML includes */
27005    int n_flags;
27006
27007    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27008    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27009        mem_base = xmlMemBlocks();
27010        doc = gen_xmlDocPtr(n_doc, 0);
27011        flags = gen_int(n_flags, 1);
27012
27013        ret_val = xmlXIncludeProcessFlags(doc, flags);
27014        desret_int(ret_val);
27015        call_tests++;
27016        des_xmlDocPtr(n_doc, doc, 0);
27017        des_int(n_flags, flags, 1);
27018        xmlResetLastError();
27019        if (mem_base != xmlMemBlocks()) {
27020            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27021	           xmlMemBlocks() - mem_base);
27022	    test_ret++;
27023            printf(" %d", n_doc);
27024            printf(" %d", n_flags);
27025            printf("\n");
27026        }
27027    }
27028    }
27029    function_tests++;
27030#endif
27031
27032    return(test_ret);
27033}
27034
27035
27036static int
27037test_xmlXIncludeProcessFlagsData(void) {
27038    int test_ret = 0;
27039
27040#if defined(LIBXML_XINCLUDE_ENABLED)
27041    int mem_base;
27042    int ret_val;
27043    xmlDocPtr doc; /* an XML document */
27044    int n_doc;
27045    int flags; /* a set of xmlParserOption used for parsing XML includes */
27046    int n_flags;
27047    void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27048    int n_data;
27049
27050    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27051    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27052    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27053        mem_base = xmlMemBlocks();
27054        doc = gen_xmlDocPtr(n_doc, 0);
27055        flags = gen_int(n_flags, 1);
27056        data = gen_userdata(n_data, 2);
27057
27058        ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27059        desret_int(ret_val);
27060        call_tests++;
27061        des_xmlDocPtr(n_doc, doc, 0);
27062        des_int(n_flags, flags, 1);
27063        des_userdata(n_data, data, 2);
27064        xmlResetLastError();
27065        if (mem_base != xmlMemBlocks()) {
27066            printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27067	           xmlMemBlocks() - mem_base);
27068	    test_ret++;
27069            printf(" %d", n_doc);
27070            printf(" %d", n_flags);
27071            printf(" %d", n_data);
27072            printf("\n");
27073        }
27074    }
27075    }
27076    }
27077    function_tests++;
27078#endif
27079
27080    return(test_ret);
27081}
27082
27083#ifdef LIBXML_XINCLUDE_ENABLED
27084
27085#define gen_nb_xmlXIncludeCtxtPtr 1
27086static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27087    return(NULL);
27088}
27089static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27090}
27091#endif
27092
27093
27094static int
27095test_xmlXIncludeProcessNode(void) {
27096    int test_ret = 0;
27097
27098#if defined(LIBXML_XINCLUDE_ENABLED)
27099    int mem_base;
27100    int ret_val;
27101    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27102    int n_ctxt;
27103    xmlNodePtr node; /* a node in an XML document */
27104    int n_node;
27105
27106    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27107    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27108        mem_base = xmlMemBlocks();
27109        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27110        node = gen_xmlNodePtr(n_node, 1);
27111
27112        ret_val = xmlXIncludeProcessNode(ctxt, node);
27113        desret_int(ret_val);
27114        call_tests++;
27115        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27116        des_xmlNodePtr(n_node, node, 1);
27117        xmlResetLastError();
27118        if (mem_base != xmlMemBlocks()) {
27119            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27120	           xmlMemBlocks() - mem_base);
27121	    test_ret++;
27122            printf(" %d", n_ctxt);
27123            printf(" %d", n_node);
27124            printf("\n");
27125        }
27126    }
27127    }
27128    function_tests++;
27129#endif
27130
27131    return(test_ret);
27132}
27133
27134
27135static int
27136test_xmlXIncludeProcessTree(void) {
27137    int test_ret = 0;
27138
27139#if defined(LIBXML_XINCLUDE_ENABLED)
27140    int mem_base;
27141    int ret_val;
27142    xmlNodePtr tree; /* a node in an XML document */
27143    int n_tree;
27144
27145    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27146        mem_base = xmlMemBlocks();
27147        tree = gen_xmlNodePtr(n_tree, 0);
27148
27149        ret_val = xmlXIncludeProcessTree(tree);
27150        desret_int(ret_val);
27151        call_tests++;
27152        des_xmlNodePtr(n_tree, tree, 0);
27153        xmlResetLastError();
27154        if (mem_base != xmlMemBlocks()) {
27155            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27156	           xmlMemBlocks() - mem_base);
27157	    test_ret++;
27158            printf(" %d", n_tree);
27159            printf("\n");
27160        }
27161    }
27162    function_tests++;
27163#endif
27164
27165    return(test_ret);
27166}
27167
27168
27169static int
27170test_xmlXIncludeProcessTreeFlags(void) {
27171    int test_ret = 0;
27172
27173#if defined(LIBXML_XINCLUDE_ENABLED)
27174    int mem_base;
27175    int ret_val;
27176    xmlNodePtr tree; /* a node in an XML document */
27177    int n_tree;
27178    int flags; /* a set of xmlParserOption used for parsing XML includes */
27179    int n_flags;
27180
27181    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27182    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27183        mem_base = xmlMemBlocks();
27184        tree = gen_xmlNodePtr(n_tree, 0);
27185        flags = gen_int(n_flags, 1);
27186
27187        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27188        desret_int(ret_val);
27189        call_tests++;
27190        des_xmlNodePtr(n_tree, tree, 0);
27191        des_int(n_flags, flags, 1);
27192        xmlResetLastError();
27193        if (mem_base != xmlMemBlocks()) {
27194            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27195	           xmlMemBlocks() - mem_base);
27196	    test_ret++;
27197            printf(" %d", n_tree);
27198            printf(" %d", n_flags);
27199            printf("\n");
27200        }
27201    }
27202    }
27203    function_tests++;
27204#endif
27205
27206    return(test_ret);
27207}
27208
27209
27210static int
27211test_xmlXIncludeSetFlags(void) {
27212    int test_ret = 0;
27213
27214#if defined(LIBXML_XINCLUDE_ENABLED)
27215    int mem_base;
27216    int ret_val;
27217    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27218    int n_ctxt;
27219    int flags; /* a set of xmlParserOption used for parsing XML includes */
27220    int n_flags;
27221
27222    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27223    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27224        mem_base = xmlMemBlocks();
27225        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27226        flags = gen_int(n_flags, 1);
27227
27228        ret_val = xmlXIncludeSetFlags(ctxt, flags);
27229        desret_int(ret_val);
27230        call_tests++;
27231        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27232        des_int(n_flags, flags, 1);
27233        xmlResetLastError();
27234        if (mem_base != xmlMemBlocks()) {
27235            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27236	           xmlMemBlocks() - mem_base);
27237	    test_ret++;
27238            printf(" %d", n_ctxt);
27239            printf(" %d", n_flags);
27240            printf("\n");
27241        }
27242    }
27243    }
27244    function_tests++;
27245#endif
27246
27247    return(test_ret);
27248}
27249
27250static int
27251test_xinclude(void) {
27252    int test_ret = 0;
27253
27254    if (quiet == 0) printf("Testing xinclude : 7 of 9 functions ...\n");
27255    test_ret += test_xmlXIncludeNewContext();
27256    test_ret += test_xmlXIncludeProcess();
27257    test_ret += test_xmlXIncludeProcessFlags();
27258    test_ret += test_xmlXIncludeProcessFlagsData();
27259    test_ret += test_xmlXIncludeProcessNode();
27260    test_ret += test_xmlXIncludeProcessTree();
27261    test_ret += test_xmlXIncludeProcessTreeFlags();
27262    test_ret += test_xmlXIncludeSetFlags();
27263
27264    if (test_ret != 0)
27265	printf("Module xinclude: %d errors\n", test_ret);
27266    return(test_ret);
27267}
27268
27269static int
27270test_xmlAllocOutputBuffer(void) {
27271    int test_ret = 0;
27272
27273#if defined(LIBXML_OUTPUT_ENABLED)
27274    int mem_base;
27275    xmlOutputBufferPtr ret_val;
27276    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27277    int n_encoder;
27278
27279    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27280        mem_base = xmlMemBlocks();
27281        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27282
27283        ret_val = xmlAllocOutputBuffer(encoder);
27284        desret_xmlOutputBufferPtr(ret_val);
27285        call_tests++;
27286        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27287        xmlResetLastError();
27288        if (mem_base != xmlMemBlocks()) {
27289            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27290	           xmlMemBlocks() - mem_base);
27291	    test_ret++;
27292            printf(" %d", n_encoder);
27293            printf("\n");
27294        }
27295    }
27296    function_tests++;
27297#endif
27298
27299    return(test_ret);
27300}
27301
27302
27303static int
27304test_xmlAllocParserInputBuffer(void) {
27305    int test_ret = 0;
27306
27307    int mem_base;
27308    xmlParserInputBufferPtr ret_val;
27309    xmlCharEncoding enc; /* the charset encoding if known */
27310    int n_enc;
27311
27312    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27313        mem_base = xmlMemBlocks();
27314        enc = gen_xmlCharEncoding(n_enc, 0);
27315
27316        ret_val = xmlAllocParserInputBuffer(enc);
27317        desret_xmlParserInputBufferPtr(ret_val);
27318        call_tests++;
27319        des_xmlCharEncoding(n_enc, enc, 0);
27320        xmlResetLastError();
27321        if (mem_base != xmlMemBlocks()) {
27322            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27323	           xmlMemBlocks() - mem_base);
27324	    test_ret++;
27325            printf(" %d", n_enc);
27326            printf("\n");
27327        }
27328    }
27329    function_tests++;
27330
27331    return(test_ret);
27332}
27333
27334
27335static int
27336test_xmlCheckFilename(void) {
27337    int test_ret = 0;
27338
27339    int mem_base;
27340    int ret_val;
27341    char * path; /* the path to check */
27342    int n_path;
27343
27344    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27345        mem_base = xmlMemBlocks();
27346        path = gen_const_char_ptr(n_path, 0);
27347
27348        ret_val = xmlCheckFilename((const char *)path);
27349        desret_int(ret_val);
27350        call_tests++;
27351        des_const_char_ptr(n_path, (const char *)path, 0);
27352        xmlResetLastError();
27353        if (mem_base != xmlMemBlocks()) {
27354            printf("Leak of %d blocks found in xmlCheckFilename",
27355	           xmlMemBlocks() - mem_base);
27356	    test_ret++;
27357            printf(" %d", n_path);
27358            printf("\n");
27359        }
27360    }
27361    function_tests++;
27362
27363    return(test_ret);
27364}
27365
27366
27367static int
27368test_xmlCheckHTTPInput(void) {
27369    int test_ret = 0;
27370
27371    int mem_base;
27372    xmlParserInputPtr ret_val;
27373    xmlParserCtxtPtr ctxt; /* an XML parser context */
27374    int n_ctxt;
27375    xmlParserInputPtr ret; /* an XML parser input */
27376    int n_ret;
27377
27378    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27379    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27380        mem_base = xmlMemBlocks();
27381        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27382        ret = gen_xmlParserInputPtr(n_ret, 1);
27383
27384        ret_val = xmlCheckHTTPInput(ctxt, ret);
27385        desret_xmlParserInputPtr(ret_val);
27386        call_tests++;
27387        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27388        des_xmlParserInputPtr(n_ret, ret, 1);
27389        xmlResetLastError();
27390        if (mem_base != xmlMemBlocks()) {
27391            printf("Leak of %d blocks found in xmlCheckHTTPInput",
27392	           xmlMemBlocks() - mem_base);
27393	    test_ret++;
27394            printf(" %d", n_ctxt);
27395            printf(" %d", n_ret);
27396            printf("\n");
27397        }
27398    }
27399    }
27400    function_tests++;
27401
27402    return(test_ret);
27403}
27404
27405
27406static int
27407test_xmlCleanupInputCallbacks(void) {
27408    int test_ret = 0;
27409
27410    int mem_base;
27411
27412        mem_base = xmlMemBlocks();
27413
27414        xmlCleanupInputCallbacks();
27415        call_tests++;
27416        xmlResetLastError();
27417        if (mem_base != xmlMemBlocks()) {
27418            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27419	           xmlMemBlocks() - mem_base);
27420	    test_ret++;
27421            printf("\n");
27422        }
27423    function_tests++;
27424
27425    return(test_ret);
27426}
27427
27428
27429static int
27430test_xmlCleanupOutputCallbacks(void) {
27431    int test_ret = 0;
27432
27433#if defined(LIBXML_OUTPUT_ENABLED)
27434    int mem_base;
27435
27436        mem_base = xmlMemBlocks();
27437
27438        xmlCleanupOutputCallbacks();
27439        call_tests++;
27440        xmlResetLastError();
27441        if (mem_base != xmlMemBlocks()) {
27442            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27443	           xmlMemBlocks() - mem_base);
27444	    test_ret++;
27445            printf("\n");
27446        }
27447    function_tests++;
27448#endif
27449
27450    return(test_ret);
27451}
27452
27453
27454static int
27455test_xmlFileClose(void) {
27456    int test_ret = 0;
27457
27458    int mem_base;
27459    int ret_val;
27460    void * context; /* the I/O context */
27461    int n_context;
27462
27463    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27464        mem_base = xmlMemBlocks();
27465        context = gen_void_ptr(n_context, 0);
27466
27467        ret_val = xmlFileClose(context);
27468        desret_int(ret_val);
27469        call_tests++;
27470        des_void_ptr(n_context, context, 0);
27471        xmlResetLastError();
27472        if (mem_base != xmlMemBlocks()) {
27473            printf("Leak of %d blocks found in xmlFileClose",
27474	           xmlMemBlocks() - mem_base);
27475	    test_ret++;
27476            printf(" %d", n_context);
27477            printf("\n");
27478        }
27479    }
27480    function_tests++;
27481
27482    return(test_ret);
27483}
27484
27485
27486static int
27487test_xmlFileMatch(void) {
27488    int test_ret = 0;
27489
27490    int mem_base;
27491    int ret_val;
27492    const char * filename; /* the URI for matching */
27493    int n_filename;
27494
27495    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27496        mem_base = xmlMemBlocks();
27497        filename = gen_filepath(n_filename, 0);
27498
27499        ret_val = xmlFileMatch(filename);
27500        desret_int(ret_val);
27501        call_tests++;
27502        des_filepath(n_filename, filename, 0);
27503        xmlResetLastError();
27504        if (mem_base != xmlMemBlocks()) {
27505            printf("Leak of %d blocks found in xmlFileMatch",
27506	           xmlMemBlocks() - mem_base);
27507	    test_ret++;
27508            printf(" %d", n_filename);
27509            printf("\n");
27510        }
27511    }
27512    function_tests++;
27513
27514    return(test_ret);
27515}
27516
27517
27518static int
27519test_xmlFileOpen(void) {
27520    int test_ret = 0;
27521
27522    int mem_base;
27523    void * ret_val;
27524    const char * filename; /* the URI for matching */
27525    int n_filename;
27526
27527    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27528        mem_base = xmlMemBlocks();
27529        filename = gen_filepath(n_filename, 0);
27530
27531        ret_val = xmlFileOpen(filename);
27532        desret_void_ptr(ret_val);
27533        call_tests++;
27534        des_filepath(n_filename, filename, 0);
27535        xmlResetLastError();
27536        if (mem_base != xmlMemBlocks()) {
27537            printf("Leak of %d blocks found in xmlFileOpen",
27538	           xmlMemBlocks() - mem_base);
27539	    test_ret++;
27540            printf(" %d", n_filename);
27541            printf("\n");
27542        }
27543    }
27544    function_tests++;
27545
27546    return(test_ret);
27547}
27548
27549
27550static int
27551test_xmlFileRead(void) {
27552    int test_ret = 0;
27553
27554    int mem_base;
27555    int ret_val;
27556    void * context; /* the I/O context */
27557    int n_context;
27558    char * buffer; /* where to drop data */
27559    int n_buffer;
27560    int len; /* number of bytes to write */
27561    int n_len;
27562
27563    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27564    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27565    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27566        mem_base = xmlMemBlocks();
27567        context = gen_void_ptr(n_context, 0);
27568        buffer = gen_char_ptr(n_buffer, 1);
27569        len = gen_int(n_len, 2);
27570
27571        ret_val = xmlFileRead(context, buffer, len);
27572        desret_int(ret_val);
27573        call_tests++;
27574        des_void_ptr(n_context, context, 0);
27575        des_char_ptr(n_buffer, buffer, 1);
27576        des_int(n_len, len, 2);
27577        xmlResetLastError();
27578        if (mem_base != xmlMemBlocks()) {
27579            printf("Leak of %d blocks found in xmlFileRead",
27580	           xmlMemBlocks() - mem_base);
27581	    test_ret++;
27582            printf(" %d", n_context);
27583            printf(" %d", n_buffer);
27584            printf(" %d", n_len);
27585            printf("\n");
27586        }
27587    }
27588    }
27589    }
27590    function_tests++;
27591
27592    return(test_ret);
27593}
27594
27595
27596static int
27597test_xmlIOFTPClose(void) {
27598    int test_ret = 0;
27599
27600#if defined(LIBXML_FTP_ENABLED)
27601    int mem_base;
27602    int ret_val;
27603    void * context; /* the I/O context */
27604    int n_context;
27605
27606    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27607        mem_base = xmlMemBlocks();
27608        context = gen_void_ptr(n_context, 0);
27609
27610        ret_val = xmlIOFTPClose(context);
27611        desret_int(ret_val);
27612        call_tests++;
27613        des_void_ptr(n_context, context, 0);
27614        xmlResetLastError();
27615        if (mem_base != xmlMemBlocks()) {
27616            printf("Leak of %d blocks found in xmlIOFTPClose",
27617	           xmlMemBlocks() - mem_base);
27618	    test_ret++;
27619            printf(" %d", n_context);
27620            printf("\n");
27621        }
27622    }
27623    function_tests++;
27624#endif
27625
27626    return(test_ret);
27627}
27628
27629
27630static int
27631test_xmlIOFTPMatch(void) {
27632    int test_ret = 0;
27633
27634#if defined(LIBXML_FTP_ENABLED)
27635    int mem_base;
27636    int ret_val;
27637    const char * filename; /* the URI for matching */
27638    int n_filename;
27639
27640    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27641        mem_base = xmlMemBlocks();
27642        filename = gen_filepath(n_filename, 0);
27643
27644        ret_val = xmlIOFTPMatch(filename);
27645        desret_int(ret_val);
27646        call_tests++;
27647        des_filepath(n_filename, filename, 0);
27648        xmlResetLastError();
27649        if (mem_base != xmlMemBlocks()) {
27650            printf("Leak of %d blocks found in xmlIOFTPMatch",
27651	           xmlMemBlocks() - mem_base);
27652	    test_ret++;
27653            printf(" %d", n_filename);
27654            printf("\n");
27655        }
27656    }
27657    function_tests++;
27658#endif
27659
27660    return(test_ret);
27661}
27662
27663
27664static int
27665test_xmlIOFTPOpen(void) {
27666    int test_ret = 0;
27667
27668#if defined(LIBXML_FTP_ENABLED)
27669    int mem_base;
27670    void * ret_val;
27671    const char * filename; /* the URI for matching */
27672    int n_filename;
27673
27674    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27675        mem_base = xmlMemBlocks();
27676        filename = gen_filepath(n_filename, 0);
27677
27678        ret_val = xmlIOFTPOpen(filename);
27679        desret_void_ptr(ret_val);
27680        call_tests++;
27681        des_filepath(n_filename, filename, 0);
27682        xmlResetLastError();
27683        if (mem_base != xmlMemBlocks()) {
27684            printf("Leak of %d blocks found in xmlIOFTPOpen",
27685	           xmlMemBlocks() - mem_base);
27686	    test_ret++;
27687            printf(" %d", n_filename);
27688            printf("\n");
27689        }
27690    }
27691    function_tests++;
27692#endif
27693
27694    return(test_ret);
27695}
27696
27697
27698static int
27699test_xmlIOFTPRead(void) {
27700    int test_ret = 0;
27701
27702#if defined(LIBXML_FTP_ENABLED)
27703    int mem_base;
27704    int ret_val;
27705    void * context; /* the I/O context */
27706    int n_context;
27707    char * buffer; /* where to drop data */
27708    int n_buffer;
27709    int len; /* number of bytes to write */
27710    int n_len;
27711
27712    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27713    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27714    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27715        mem_base = xmlMemBlocks();
27716        context = gen_void_ptr(n_context, 0);
27717        buffer = gen_char_ptr(n_buffer, 1);
27718        len = gen_int(n_len, 2);
27719
27720        ret_val = xmlIOFTPRead(context, buffer, len);
27721        desret_int(ret_val);
27722        call_tests++;
27723        des_void_ptr(n_context, context, 0);
27724        des_char_ptr(n_buffer, buffer, 1);
27725        des_int(n_len, len, 2);
27726        xmlResetLastError();
27727        if (mem_base != xmlMemBlocks()) {
27728            printf("Leak of %d blocks found in xmlIOFTPRead",
27729	           xmlMemBlocks() - mem_base);
27730	    test_ret++;
27731            printf(" %d", n_context);
27732            printf(" %d", n_buffer);
27733            printf(" %d", n_len);
27734            printf("\n");
27735        }
27736    }
27737    }
27738    }
27739    function_tests++;
27740#endif
27741
27742    return(test_ret);
27743}
27744
27745
27746static int
27747test_xmlIOHTTPClose(void) {
27748    int test_ret = 0;
27749
27750#if defined(LIBXML_HTTP_ENABLED)
27751    int mem_base;
27752    int ret_val;
27753    void * context; /* the I/O context */
27754    int n_context;
27755
27756    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27757        mem_base = xmlMemBlocks();
27758        context = gen_void_ptr(n_context, 0);
27759
27760        ret_val = xmlIOHTTPClose(context);
27761        desret_int(ret_val);
27762        call_tests++;
27763        des_void_ptr(n_context, context, 0);
27764        xmlResetLastError();
27765        if (mem_base != xmlMemBlocks()) {
27766            printf("Leak of %d blocks found in xmlIOHTTPClose",
27767	           xmlMemBlocks() - mem_base);
27768	    test_ret++;
27769            printf(" %d", n_context);
27770            printf("\n");
27771        }
27772    }
27773    function_tests++;
27774#endif
27775
27776    return(test_ret);
27777}
27778
27779
27780static int
27781test_xmlIOHTTPMatch(void) {
27782    int test_ret = 0;
27783
27784#if defined(LIBXML_HTTP_ENABLED)
27785    int mem_base;
27786    int ret_val;
27787    const char * filename; /* the URI for matching */
27788    int n_filename;
27789
27790    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27791        mem_base = xmlMemBlocks();
27792        filename = gen_filepath(n_filename, 0);
27793
27794        ret_val = xmlIOHTTPMatch(filename);
27795        desret_int(ret_val);
27796        call_tests++;
27797        des_filepath(n_filename, filename, 0);
27798        xmlResetLastError();
27799        if (mem_base != xmlMemBlocks()) {
27800            printf("Leak of %d blocks found in xmlIOHTTPMatch",
27801	           xmlMemBlocks() - mem_base);
27802	    test_ret++;
27803            printf(" %d", n_filename);
27804            printf("\n");
27805        }
27806    }
27807    function_tests++;
27808#endif
27809
27810    return(test_ret);
27811}
27812
27813
27814static int
27815test_xmlIOHTTPOpen(void) {
27816    int test_ret = 0;
27817
27818#if defined(LIBXML_HTTP_ENABLED)
27819    int mem_base;
27820    void * ret_val;
27821    const char * filename; /* the URI for matching */
27822    int n_filename;
27823
27824    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27825        mem_base = xmlMemBlocks();
27826        filename = gen_filepath(n_filename, 0);
27827
27828        ret_val = xmlIOHTTPOpen(filename);
27829        desret_xmlNanoHTTPCtxtPtr(ret_val);
27830        call_tests++;
27831        des_filepath(n_filename, filename, 0);
27832        xmlResetLastError();
27833        if (mem_base != xmlMemBlocks()) {
27834            printf("Leak of %d blocks found in xmlIOHTTPOpen",
27835	           xmlMemBlocks() - mem_base);
27836	    test_ret++;
27837            printf(" %d", n_filename);
27838            printf("\n");
27839        }
27840    }
27841    function_tests++;
27842#endif
27843
27844    return(test_ret);
27845}
27846
27847
27848static int
27849test_xmlIOHTTPRead(void) {
27850    int test_ret = 0;
27851
27852#if defined(LIBXML_HTTP_ENABLED)
27853    int mem_base;
27854    int ret_val;
27855    void * context; /* the I/O context */
27856    int n_context;
27857    char * buffer; /* where to drop data */
27858    int n_buffer;
27859    int len; /* number of bytes to write */
27860    int n_len;
27861
27862    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27863    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27864    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27865        mem_base = xmlMemBlocks();
27866        context = gen_void_ptr(n_context, 0);
27867        buffer = gen_char_ptr(n_buffer, 1);
27868        len = gen_int(n_len, 2);
27869
27870        ret_val = xmlIOHTTPRead(context, buffer, len);
27871        desret_int(ret_val);
27872        call_tests++;
27873        des_void_ptr(n_context, context, 0);
27874        des_char_ptr(n_buffer, buffer, 1);
27875        des_int(n_len, len, 2);
27876        xmlResetLastError();
27877        if (mem_base != xmlMemBlocks()) {
27878            printf("Leak of %d blocks found in xmlIOHTTPRead",
27879	           xmlMemBlocks() - mem_base);
27880	    test_ret++;
27881            printf(" %d", n_context);
27882            printf(" %d", n_buffer);
27883            printf(" %d", n_len);
27884            printf("\n");
27885        }
27886    }
27887    }
27888    }
27889    function_tests++;
27890#endif
27891
27892    return(test_ret);
27893}
27894
27895
27896static int
27897test_xmlNoNetExternalEntityLoader(void) {
27898    int test_ret = 0;
27899
27900    int mem_base;
27901    xmlParserInputPtr ret_val;
27902    const char * URL; /* the URL for the entity to load */
27903    int n_URL;
27904    char * ID; /* the System ID for the entity to load */
27905    int n_ID;
27906    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27907    int n_ctxt;
27908
27909    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27910    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27911    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27912        mem_base = xmlMemBlocks();
27913        URL = gen_filepath(n_URL, 0);
27914        ID = gen_const_char_ptr(n_ID, 1);
27915        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27916
27917        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27918        desret_xmlParserInputPtr(ret_val);
27919        call_tests++;
27920        des_filepath(n_URL, URL, 0);
27921        des_const_char_ptr(n_ID, (const char *)ID, 1);
27922        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27923        xmlResetLastError();
27924        if (mem_base != xmlMemBlocks()) {
27925            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27926	           xmlMemBlocks() - mem_base);
27927	    test_ret++;
27928            printf(" %d", n_URL);
27929            printf(" %d", n_ID);
27930            printf(" %d", n_ctxt);
27931            printf("\n");
27932        }
27933    }
27934    }
27935    }
27936    function_tests++;
27937
27938    return(test_ret);
27939}
27940
27941
27942static int
27943test_xmlNormalizeWindowsPath(void) {
27944    int test_ret = 0;
27945
27946    int mem_base;
27947    xmlChar * ret_val;
27948    xmlChar * path; /* the input file path */
27949    int n_path;
27950
27951    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27952        mem_base = xmlMemBlocks();
27953        path = gen_const_xmlChar_ptr(n_path, 0);
27954
27955        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27956        desret_xmlChar_ptr(ret_val);
27957        call_tests++;
27958        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27959        xmlResetLastError();
27960        if (mem_base != xmlMemBlocks()) {
27961            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27962	           xmlMemBlocks() - mem_base);
27963	    test_ret++;
27964            printf(" %d", n_path);
27965            printf("\n");
27966        }
27967    }
27968    function_tests++;
27969
27970    return(test_ret);
27971}
27972
27973
27974static int
27975test_xmlOutputBufferCreateBuffer(void) {
27976    int test_ret = 0;
27977
27978#if defined(LIBXML_OUTPUT_ENABLED)
27979    int mem_base;
27980    xmlOutputBufferPtr ret_val;
27981    xmlBufferPtr buffer; /* a xmlBufferPtr */
27982    int n_buffer;
27983    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27984    int n_encoder;
27985
27986    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
27987    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27988        mem_base = xmlMemBlocks();
27989        buffer = gen_xmlBufferPtr(n_buffer, 0);
27990        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27991
27992        ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
27993        desret_xmlOutputBufferPtr(ret_val);
27994        call_tests++;
27995        des_xmlBufferPtr(n_buffer, buffer, 0);
27996        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
27997        xmlResetLastError();
27998        if (mem_base != xmlMemBlocks()) {
27999            printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28000	           xmlMemBlocks() - mem_base);
28001	    test_ret++;
28002            printf(" %d", n_buffer);
28003            printf(" %d", n_encoder);
28004            printf("\n");
28005        }
28006    }
28007    }
28008    function_tests++;
28009#endif
28010
28011    return(test_ret);
28012}
28013
28014
28015static int
28016test_xmlOutputBufferCreateFd(void) {
28017    int test_ret = 0;
28018
28019#if defined(LIBXML_OUTPUT_ENABLED)
28020    int mem_base;
28021    xmlOutputBufferPtr ret_val;
28022    int fd; /* a file descriptor number */
28023    int n_fd;
28024    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28025    int n_encoder;
28026
28027    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28028    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28029        mem_base = xmlMemBlocks();
28030        fd = gen_int(n_fd, 0);
28031        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28032
28033        ret_val = xmlOutputBufferCreateFd(fd, encoder);
28034        desret_xmlOutputBufferPtr(ret_val);
28035        call_tests++;
28036        des_int(n_fd, fd, 0);
28037        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28038        xmlResetLastError();
28039        if (mem_base != xmlMemBlocks()) {
28040            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28041	           xmlMemBlocks() - mem_base);
28042	    test_ret++;
28043            printf(" %d", n_fd);
28044            printf(" %d", n_encoder);
28045            printf("\n");
28046        }
28047    }
28048    }
28049    function_tests++;
28050#endif
28051
28052    return(test_ret);
28053}
28054
28055
28056static int
28057test_xmlOutputBufferCreateFile(void) {
28058    int test_ret = 0;
28059
28060#if defined(LIBXML_OUTPUT_ENABLED)
28061    int mem_base;
28062    xmlOutputBufferPtr ret_val;
28063    FILE * file; /* a FILE* */
28064    int n_file;
28065    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28066    int n_encoder;
28067
28068    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28069    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28070        mem_base = xmlMemBlocks();
28071        file = gen_FILE_ptr(n_file, 0);
28072        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28073
28074        ret_val = xmlOutputBufferCreateFile(file, encoder);
28075        desret_xmlOutputBufferPtr(ret_val);
28076        call_tests++;
28077        des_FILE_ptr(n_file, file, 0);
28078        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28079        xmlResetLastError();
28080        if (mem_base != xmlMemBlocks()) {
28081            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28082	           xmlMemBlocks() - mem_base);
28083	    test_ret++;
28084            printf(" %d", n_file);
28085            printf(" %d", n_encoder);
28086            printf("\n");
28087        }
28088    }
28089    }
28090    function_tests++;
28091#endif
28092
28093    return(test_ret);
28094}
28095
28096
28097static int
28098test_xmlOutputBufferCreateFilename(void) {
28099    int test_ret = 0;
28100
28101#if defined(LIBXML_OUTPUT_ENABLED)
28102    int mem_base;
28103    xmlOutputBufferPtr ret_val;
28104    const char * URI; /* a C string containing the URI or filename */
28105    int n_URI;
28106    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28107    int n_encoder;
28108    int compression; /* the compression ration (0 none, 9 max). */
28109    int n_compression;
28110
28111    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28112    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28113    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28114        mem_base = xmlMemBlocks();
28115        URI = gen_fileoutput(n_URI, 0);
28116        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28117        compression = gen_int(n_compression, 2);
28118
28119        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28120        desret_xmlOutputBufferPtr(ret_val);
28121        call_tests++;
28122        des_fileoutput(n_URI, URI, 0);
28123        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28124        des_int(n_compression, compression, 2);
28125        xmlResetLastError();
28126        if (mem_base != xmlMemBlocks()) {
28127            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28128	           xmlMemBlocks() - mem_base);
28129	    test_ret++;
28130            printf(" %d", n_URI);
28131            printf(" %d", n_encoder);
28132            printf(" %d", n_compression);
28133            printf("\n");
28134        }
28135    }
28136    }
28137    }
28138    function_tests++;
28139#endif
28140
28141    return(test_ret);
28142}
28143
28144
28145static int
28146test_xmlOutputBufferFlush(void) {
28147    int test_ret = 0;
28148
28149#if defined(LIBXML_OUTPUT_ENABLED)
28150    int mem_base;
28151    int ret_val;
28152    xmlOutputBufferPtr out; /* a buffered output */
28153    int n_out;
28154
28155    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28156        mem_base = xmlMemBlocks();
28157        out = gen_xmlOutputBufferPtr(n_out, 0);
28158
28159        ret_val = xmlOutputBufferFlush(out);
28160        desret_int(ret_val);
28161        call_tests++;
28162        des_xmlOutputBufferPtr(n_out, out, 0);
28163        xmlResetLastError();
28164        if (mem_base != xmlMemBlocks()) {
28165            printf("Leak of %d blocks found in xmlOutputBufferFlush",
28166	           xmlMemBlocks() - mem_base);
28167	    test_ret++;
28168            printf(" %d", n_out);
28169            printf("\n");
28170        }
28171    }
28172    function_tests++;
28173#endif
28174
28175    return(test_ret);
28176}
28177
28178
28179static int
28180test_xmlOutputBufferWrite(void) {
28181    int test_ret = 0;
28182
28183#if defined(LIBXML_OUTPUT_ENABLED)
28184    int mem_base;
28185    int ret_val;
28186    xmlOutputBufferPtr out; /* a buffered parser output */
28187    int n_out;
28188    int len; /* the size in bytes of the array. */
28189    int n_len;
28190    char * buf; /* an char array */
28191    int n_buf;
28192
28193    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28194    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28195    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28196        mem_base = xmlMemBlocks();
28197        out = gen_xmlOutputBufferPtr(n_out, 0);
28198        len = gen_int(n_len, 1);
28199        buf = gen_const_char_ptr(n_buf, 2);
28200
28201        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28202        desret_int(ret_val);
28203        call_tests++;
28204        des_xmlOutputBufferPtr(n_out, out, 0);
28205        des_int(n_len, len, 1);
28206        des_const_char_ptr(n_buf, (const char *)buf, 2);
28207        xmlResetLastError();
28208        if (mem_base != xmlMemBlocks()) {
28209            printf("Leak of %d blocks found in xmlOutputBufferWrite",
28210	           xmlMemBlocks() - mem_base);
28211	    test_ret++;
28212            printf(" %d", n_out);
28213            printf(" %d", n_len);
28214            printf(" %d", n_buf);
28215            printf("\n");
28216        }
28217    }
28218    }
28219    }
28220    function_tests++;
28221#endif
28222
28223    return(test_ret);
28224}
28225
28226
28227static int
28228test_xmlOutputBufferWriteEscape(void) {
28229    int test_ret = 0;
28230
28231
28232    /* missing type support */
28233    return(test_ret);
28234}
28235
28236
28237static int
28238test_xmlOutputBufferWriteString(void) {
28239    int test_ret = 0;
28240
28241#if defined(LIBXML_OUTPUT_ENABLED)
28242    int mem_base;
28243    int ret_val;
28244    xmlOutputBufferPtr out; /* a buffered parser output */
28245    int n_out;
28246    char * str; /* a zero terminated C string */
28247    int n_str;
28248
28249    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28250    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28251        mem_base = xmlMemBlocks();
28252        out = gen_xmlOutputBufferPtr(n_out, 0);
28253        str = gen_const_char_ptr(n_str, 1);
28254
28255        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28256        desret_int(ret_val);
28257        call_tests++;
28258        des_xmlOutputBufferPtr(n_out, out, 0);
28259        des_const_char_ptr(n_str, (const char *)str, 1);
28260        xmlResetLastError();
28261        if (mem_base != xmlMemBlocks()) {
28262            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28263	           xmlMemBlocks() - mem_base);
28264	    test_ret++;
28265            printf(" %d", n_out);
28266            printf(" %d", n_str);
28267            printf("\n");
28268        }
28269    }
28270    }
28271    function_tests++;
28272#endif
28273
28274    return(test_ret);
28275}
28276
28277
28278static int
28279test_xmlParserGetDirectory(void) {
28280    int test_ret = 0;
28281
28282
28283    /* missing type support */
28284    return(test_ret);
28285}
28286
28287
28288static int
28289test_xmlParserInputBufferCreateFd(void) {
28290    int test_ret = 0;
28291
28292    int mem_base;
28293    xmlParserInputBufferPtr ret_val;
28294    int fd; /* a file descriptor number */
28295    int n_fd;
28296    xmlCharEncoding enc; /* the charset encoding if known */
28297    int n_enc;
28298
28299    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28300    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28301        mem_base = xmlMemBlocks();
28302        fd = gen_int(n_fd, 0);
28303        enc = gen_xmlCharEncoding(n_enc, 1);
28304        if (fd >= 0) fd = -1;
28305
28306        ret_val = xmlParserInputBufferCreateFd(fd, enc);
28307        desret_xmlParserInputBufferPtr(ret_val);
28308        call_tests++;
28309        des_int(n_fd, fd, 0);
28310        des_xmlCharEncoding(n_enc, enc, 1);
28311        xmlResetLastError();
28312        if (mem_base != xmlMemBlocks()) {
28313            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28314	           xmlMemBlocks() - mem_base);
28315	    test_ret++;
28316            printf(" %d", n_fd);
28317            printf(" %d", n_enc);
28318            printf("\n");
28319        }
28320    }
28321    }
28322    function_tests++;
28323
28324    return(test_ret);
28325}
28326
28327
28328static int
28329test_xmlParserInputBufferCreateFile(void) {
28330    int test_ret = 0;
28331
28332    int mem_base;
28333    xmlParserInputBufferPtr ret_val;
28334    FILE * file; /* a FILE* */
28335    int n_file;
28336    xmlCharEncoding enc; /* the charset encoding if known */
28337    int n_enc;
28338
28339    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28340    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28341        mem_base = xmlMemBlocks();
28342        file = gen_FILE_ptr(n_file, 0);
28343        enc = gen_xmlCharEncoding(n_enc, 1);
28344
28345        ret_val = xmlParserInputBufferCreateFile(file, enc);
28346        desret_xmlParserInputBufferPtr(ret_val);
28347        call_tests++;
28348        des_FILE_ptr(n_file, file, 0);
28349        des_xmlCharEncoding(n_enc, enc, 1);
28350        xmlResetLastError();
28351        if (mem_base != xmlMemBlocks()) {
28352            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28353	           xmlMemBlocks() - mem_base);
28354	    test_ret++;
28355            printf(" %d", n_file);
28356            printf(" %d", n_enc);
28357            printf("\n");
28358        }
28359    }
28360    }
28361    function_tests++;
28362
28363    return(test_ret);
28364}
28365
28366
28367static int
28368test_xmlParserInputBufferCreateFilename(void) {
28369    int test_ret = 0;
28370
28371    int mem_base;
28372    xmlParserInputBufferPtr ret_val;
28373    const char * URI; /* a C string containing the URI or filename */
28374    int n_URI;
28375    xmlCharEncoding enc; /* the charset encoding if known */
28376    int n_enc;
28377
28378    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28379    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28380        mem_base = xmlMemBlocks();
28381        URI = gen_fileoutput(n_URI, 0);
28382        enc = gen_xmlCharEncoding(n_enc, 1);
28383
28384        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28385        desret_xmlParserInputBufferPtr(ret_val);
28386        call_tests++;
28387        des_fileoutput(n_URI, URI, 0);
28388        des_xmlCharEncoding(n_enc, enc, 1);
28389        xmlResetLastError();
28390        if (mem_base != xmlMemBlocks()) {
28391            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28392	           xmlMemBlocks() - mem_base);
28393	    test_ret++;
28394            printf(" %d", n_URI);
28395            printf(" %d", n_enc);
28396            printf("\n");
28397        }
28398    }
28399    }
28400    function_tests++;
28401
28402    return(test_ret);
28403}
28404
28405
28406static int
28407test_xmlParserInputBufferCreateMem(void) {
28408    int test_ret = 0;
28409
28410    int mem_base;
28411    xmlParserInputBufferPtr ret_val;
28412    char * mem; /* the memory input */
28413    int n_mem;
28414    int size; /* the length of the memory block */
28415    int n_size;
28416    xmlCharEncoding enc; /* the charset encoding if known */
28417    int n_enc;
28418
28419    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28420    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28421    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28422        mem_base = xmlMemBlocks();
28423        mem = gen_const_char_ptr(n_mem, 0);
28424        size = gen_int(n_size, 1);
28425        enc = gen_xmlCharEncoding(n_enc, 2);
28426
28427        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28428        desret_xmlParserInputBufferPtr(ret_val);
28429        call_tests++;
28430        des_const_char_ptr(n_mem, (const char *)mem, 0);
28431        des_int(n_size, size, 1);
28432        des_xmlCharEncoding(n_enc, enc, 2);
28433        xmlResetLastError();
28434        if (mem_base != xmlMemBlocks()) {
28435            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28436	           xmlMemBlocks() - mem_base);
28437	    test_ret++;
28438            printf(" %d", n_mem);
28439            printf(" %d", n_size);
28440            printf(" %d", n_enc);
28441            printf("\n");
28442        }
28443    }
28444    }
28445    }
28446    function_tests++;
28447
28448    return(test_ret);
28449}
28450
28451
28452static int
28453test_xmlParserInputBufferCreateStatic(void) {
28454    int test_ret = 0;
28455
28456    int mem_base;
28457    xmlParserInputBufferPtr ret_val;
28458    char * mem; /* the memory input */
28459    int n_mem;
28460    int size; /* the length of the memory block */
28461    int n_size;
28462    xmlCharEncoding enc; /* the charset encoding if known */
28463    int n_enc;
28464
28465    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28466    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28467    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28468        mem_base = xmlMemBlocks();
28469        mem = gen_const_char_ptr(n_mem, 0);
28470        size = gen_int(n_size, 1);
28471        enc = gen_xmlCharEncoding(n_enc, 2);
28472
28473        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28474        desret_xmlParserInputBufferPtr(ret_val);
28475        call_tests++;
28476        des_const_char_ptr(n_mem, (const char *)mem, 0);
28477        des_int(n_size, size, 1);
28478        des_xmlCharEncoding(n_enc, enc, 2);
28479        xmlResetLastError();
28480        if (mem_base != xmlMemBlocks()) {
28481            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28482	           xmlMemBlocks() - mem_base);
28483	    test_ret++;
28484            printf(" %d", n_mem);
28485            printf(" %d", n_size);
28486            printf(" %d", n_enc);
28487            printf("\n");
28488        }
28489    }
28490    }
28491    }
28492    function_tests++;
28493
28494    return(test_ret);
28495}
28496
28497
28498static int
28499test_xmlParserInputBufferGrow(void) {
28500    int test_ret = 0;
28501
28502    int mem_base;
28503    int ret_val;
28504    xmlParserInputBufferPtr in; /* a buffered parser input */
28505    int n_in;
28506    int len; /* indicative value of the amount of chars to read */
28507    int n_len;
28508
28509    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28510    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28511        mem_base = xmlMemBlocks();
28512        in = gen_xmlParserInputBufferPtr(n_in, 0);
28513        len = gen_int(n_len, 1);
28514
28515        ret_val = xmlParserInputBufferGrow(in, len);
28516        desret_int(ret_val);
28517        call_tests++;
28518        des_xmlParserInputBufferPtr(n_in, in, 0);
28519        des_int(n_len, len, 1);
28520        xmlResetLastError();
28521        if (mem_base != xmlMemBlocks()) {
28522            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28523	           xmlMemBlocks() - mem_base);
28524	    test_ret++;
28525            printf(" %d", n_in);
28526            printf(" %d", n_len);
28527            printf("\n");
28528        }
28529    }
28530    }
28531    function_tests++;
28532
28533    return(test_ret);
28534}
28535
28536
28537static int
28538test_xmlParserInputBufferPush(void) {
28539    int test_ret = 0;
28540
28541    int mem_base;
28542    int ret_val;
28543    xmlParserInputBufferPtr in; /* a buffered parser input */
28544    int n_in;
28545    int len; /* the size in bytes of the array. */
28546    int n_len;
28547    char * buf; /* an char array */
28548    int n_buf;
28549
28550    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28551    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28552    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28553        mem_base = xmlMemBlocks();
28554        in = gen_xmlParserInputBufferPtr(n_in, 0);
28555        len = gen_int(n_len, 1);
28556        buf = gen_const_char_ptr(n_buf, 2);
28557
28558        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28559        desret_int(ret_val);
28560        call_tests++;
28561        des_xmlParserInputBufferPtr(n_in, in, 0);
28562        des_int(n_len, len, 1);
28563        des_const_char_ptr(n_buf, (const char *)buf, 2);
28564        xmlResetLastError();
28565        if (mem_base != xmlMemBlocks()) {
28566            printf("Leak of %d blocks found in xmlParserInputBufferPush",
28567	           xmlMemBlocks() - mem_base);
28568	    test_ret++;
28569            printf(" %d", n_in);
28570            printf(" %d", n_len);
28571            printf(" %d", n_buf);
28572            printf("\n");
28573        }
28574    }
28575    }
28576    }
28577    function_tests++;
28578
28579    return(test_ret);
28580}
28581
28582
28583static int
28584test_xmlParserInputBufferRead(void) {
28585    int test_ret = 0;
28586
28587    int mem_base;
28588    int ret_val;
28589    xmlParserInputBufferPtr in; /* a buffered parser input */
28590    int n_in;
28591    int len; /* indicative value of the amount of chars to read */
28592    int n_len;
28593
28594    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28595    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28596        mem_base = xmlMemBlocks();
28597        in = gen_xmlParserInputBufferPtr(n_in, 0);
28598        len = gen_int(n_len, 1);
28599
28600        ret_val = xmlParserInputBufferRead(in, len);
28601        desret_int(ret_val);
28602        call_tests++;
28603        des_xmlParserInputBufferPtr(n_in, in, 0);
28604        des_int(n_len, len, 1);
28605        xmlResetLastError();
28606        if (mem_base != xmlMemBlocks()) {
28607            printf("Leak of %d blocks found in xmlParserInputBufferRead",
28608	           xmlMemBlocks() - mem_base);
28609	    test_ret++;
28610            printf(" %d", n_in);
28611            printf(" %d", n_len);
28612            printf("\n");
28613        }
28614    }
28615    }
28616    function_tests++;
28617
28618    return(test_ret);
28619}
28620
28621
28622static int
28623test_xmlPopInputCallbacks(void) {
28624    int test_ret = 0;
28625
28626    int mem_base;
28627    int ret_val;
28628
28629        mem_base = xmlMemBlocks();
28630
28631        ret_val = xmlPopInputCallbacks();
28632        desret_int(ret_val);
28633        call_tests++;
28634        xmlResetLastError();
28635        if (mem_base != xmlMemBlocks()) {
28636            printf("Leak of %d blocks found in xmlPopInputCallbacks",
28637	           xmlMemBlocks() - mem_base);
28638	    test_ret++;
28639            printf("\n");
28640        }
28641    function_tests++;
28642
28643    return(test_ret);
28644}
28645
28646
28647static int
28648test_xmlRegisterDefaultInputCallbacks(void) {
28649    int test_ret = 0;
28650
28651    int mem_base;
28652
28653        mem_base = xmlMemBlocks();
28654
28655        xmlRegisterDefaultInputCallbacks();
28656        call_tests++;
28657        xmlResetLastError();
28658        if (mem_base != xmlMemBlocks()) {
28659            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28660	           xmlMemBlocks() - mem_base);
28661	    test_ret++;
28662            printf("\n");
28663        }
28664    function_tests++;
28665
28666    return(test_ret);
28667}
28668
28669
28670static int
28671test_xmlRegisterDefaultOutputCallbacks(void) {
28672    int test_ret = 0;
28673
28674#if defined(LIBXML_OUTPUT_ENABLED)
28675    int mem_base;
28676
28677        mem_base = xmlMemBlocks();
28678
28679        xmlRegisterDefaultOutputCallbacks();
28680        call_tests++;
28681        xmlResetLastError();
28682        if (mem_base != xmlMemBlocks()) {
28683            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28684	           xmlMemBlocks() - mem_base);
28685	    test_ret++;
28686            printf("\n");
28687        }
28688    function_tests++;
28689#endif
28690
28691    return(test_ret);
28692}
28693
28694
28695static int
28696test_xmlRegisterHTTPPostCallbacks(void) {
28697    int test_ret = 0;
28698
28699#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28700    int mem_base;
28701
28702        mem_base = xmlMemBlocks();
28703
28704        xmlRegisterHTTPPostCallbacks();
28705        call_tests++;
28706        xmlResetLastError();
28707        if (mem_base != xmlMemBlocks()) {
28708            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28709	           xmlMemBlocks() - mem_base);
28710	    test_ret++;
28711            printf("\n");
28712        }
28713    function_tests++;
28714#endif
28715
28716    return(test_ret);
28717}
28718
28719static int
28720test_xmlIO(void) {
28721    int test_ret = 0;
28722
28723    if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28724    test_ret += test_xmlAllocOutputBuffer();
28725    test_ret += test_xmlAllocParserInputBuffer();
28726    test_ret += test_xmlCheckFilename();
28727    test_ret += test_xmlCheckHTTPInput();
28728    test_ret += test_xmlCleanupInputCallbacks();
28729    test_ret += test_xmlCleanupOutputCallbacks();
28730    test_ret += test_xmlFileClose();
28731    test_ret += test_xmlFileMatch();
28732    test_ret += test_xmlFileOpen();
28733    test_ret += test_xmlFileRead();
28734    test_ret += test_xmlIOFTPClose();
28735    test_ret += test_xmlIOFTPMatch();
28736    test_ret += test_xmlIOFTPOpen();
28737    test_ret += test_xmlIOFTPRead();
28738    test_ret += test_xmlIOHTTPClose();
28739    test_ret += test_xmlIOHTTPMatch();
28740    test_ret += test_xmlIOHTTPOpen();
28741    test_ret += test_xmlIOHTTPRead();
28742    test_ret += test_xmlNoNetExternalEntityLoader();
28743    test_ret += test_xmlNormalizeWindowsPath();
28744    test_ret += test_xmlOutputBufferCreateBuffer();
28745    test_ret += test_xmlOutputBufferCreateFd();
28746    test_ret += test_xmlOutputBufferCreateFile();
28747    test_ret += test_xmlOutputBufferCreateFilename();
28748    test_ret += test_xmlOutputBufferFlush();
28749    test_ret += test_xmlOutputBufferWrite();
28750    test_ret += test_xmlOutputBufferWriteEscape();
28751    test_ret += test_xmlOutputBufferWriteString();
28752    test_ret += test_xmlParserGetDirectory();
28753    test_ret += test_xmlParserInputBufferCreateFd();
28754    test_ret += test_xmlParserInputBufferCreateFile();
28755    test_ret += test_xmlParserInputBufferCreateFilename();
28756    test_ret += test_xmlParserInputBufferCreateMem();
28757    test_ret += test_xmlParserInputBufferCreateStatic();
28758    test_ret += test_xmlParserInputBufferGrow();
28759    test_ret += test_xmlParserInputBufferPush();
28760    test_ret += test_xmlParserInputBufferRead();
28761    test_ret += test_xmlPopInputCallbacks();
28762    test_ret += test_xmlRegisterDefaultInputCallbacks();
28763    test_ret += test_xmlRegisterDefaultOutputCallbacks();
28764    test_ret += test_xmlRegisterHTTPPostCallbacks();
28765
28766    if (test_ret != 0)
28767	printf("Module xmlIO: %d errors\n", test_ret);
28768    return(test_ret);
28769}
28770#ifdef LIBXML_AUTOMATA_ENABLED
28771
28772#define gen_nb_xmlAutomataPtr 1
28773static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28774    return(NULL);
28775}
28776static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28777}
28778#endif
28779
28780
28781static int
28782test_xmlAutomataCompile(void) {
28783    int test_ret = 0;
28784
28785
28786    /* missing type support */
28787    return(test_ret);
28788}
28789
28790
28791static int
28792test_xmlAutomataGetInitState(void) {
28793    int test_ret = 0;
28794
28795
28796    /* missing type support */
28797    return(test_ret);
28798}
28799
28800
28801static int
28802test_xmlAutomataIsDeterminist(void) {
28803    int test_ret = 0;
28804
28805#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28806    int mem_base;
28807    int ret_val;
28808    xmlAutomataPtr am; /* an automata */
28809    int n_am;
28810
28811    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28812        mem_base = xmlMemBlocks();
28813        am = gen_xmlAutomataPtr(n_am, 0);
28814
28815        ret_val = xmlAutomataIsDeterminist(am);
28816        desret_int(ret_val);
28817        call_tests++;
28818        des_xmlAutomataPtr(n_am, am, 0);
28819        xmlResetLastError();
28820        if (mem_base != xmlMemBlocks()) {
28821            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28822	           xmlMemBlocks() - mem_base);
28823	    test_ret++;
28824            printf(" %d", n_am);
28825            printf("\n");
28826        }
28827    }
28828    function_tests++;
28829#endif
28830
28831    return(test_ret);
28832}
28833
28834#ifdef LIBXML_AUTOMATA_ENABLED
28835
28836#define gen_nb_xmlAutomataStatePtr 1
28837static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28838    return(NULL);
28839}
28840static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28841}
28842#endif
28843
28844
28845static int
28846test_xmlAutomataNewAllTrans(void) {
28847    int test_ret = 0;
28848
28849
28850    /* missing type support */
28851    return(test_ret);
28852}
28853
28854
28855static int
28856test_xmlAutomataNewCountTrans(void) {
28857    int test_ret = 0;
28858
28859
28860    /* missing type support */
28861    return(test_ret);
28862}
28863
28864
28865static int
28866test_xmlAutomataNewCountTrans2(void) {
28867    int test_ret = 0;
28868
28869
28870    /* missing type support */
28871    return(test_ret);
28872}
28873
28874
28875static int
28876test_xmlAutomataNewCountedTrans(void) {
28877    int test_ret = 0;
28878
28879
28880    /* missing type support */
28881    return(test_ret);
28882}
28883
28884
28885static int
28886test_xmlAutomataNewCounter(void) {
28887    int test_ret = 0;
28888
28889#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28890    int mem_base;
28891    int ret_val;
28892    xmlAutomataPtr am; /* an automata */
28893    int n_am;
28894    int min; /* the minimal value on the counter */
28895    int n_min;
28896    int max; /* the maximal value on the counter */
28897    int n_max;
28898
28899    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28900    for (n_min = 0;n_min < gen_nb_int;n_min++) {
28901    for (n_max = 0;n_max < gen_nb_int;n_max++) {
28902        mem_base = xmlMemBlocks();
28903        am = gen_xmlAutomataPtr(n_am, 0);
28904        min = gen_int(n_min, 1);
28905        max = gen_int(n_max, 2);
28906
28907        ret_val = xmlAutomataNewCounter(am, min, max);
28908        desret_int(ret_val);
28909        call_tests++;
28910        des_xmlAutomataPtr(n_am, am, 0);
28911        des_int(n_min, min, 1);
28912        des_int(n_max, max, 2);
28913        xmlResetLastError();
28914        if (mem_base != xmlMemBlocks()) {
28915            printf("Leak of %d blocks found in xmlAutomataNewCounter",
28916	           xmlMemBlocks() - mem_base);
28917	    test_ret++;
28918            printf(" %d", n_am);
28919            printf(" %d", n_min);
28920            printf(" %d", n_max);
28921            printf("\n");
28922        }
28923    }
28924    }
28925    }
28926    function_tests++;
28927#endif
28928
28929    return(test_ret);
28930}
28931
28932
28933static int
28934test_xmlAutomataNewCounterTrans(void) {
28935    int test_ret = 0;
28936
28937
28938    /* missing type support */
28939    return(test_ret);
28940}
28941
28942
28943static int
28944test_xmlAutomataNewEpsilon(void) {
28945    int test_ret = 0;
28946
28947
28948    /* missing type support */
28949    return(test_ret);
28950}
28951
28952
28953static int
28954test_xmlAutomataNewNegTrans(void) {
28955    int test_ret = 0;
28956
28957
28958    /* missing type support */
28959    return(test_ret);
28960}
28961
28962
28963static int
28964test_xmlAutomataNewOnceTrans(void) {
28965    int test_ret = 0;
28966
28967
28968    /* missing type support */
28969    return(test_ret);
28970}
28971
28972
28973static int
28974test_xmlAutomataNewOnceTrans2(void) {
28975    int test_ret = 0;
28976
28977
28978    /* missing type support */
28979    return(test_ret);
28980}
28981
28982
28983static int
28984test_xmlAutomataNewState(void) {
28985    int test_ret = 0;
28986
28987
28988    /* missing type support */
28989    return(test_ret);
28990}
28991
28992
28993static int
28994test_xmlAutomataNewTransition(void) {
28995    int test_ret = 0;
28996
28997
28998    /* missing type support */
28999    return(test_ret);
29000}
29001
29002
29003static int
29004test_xmlAutomataNewTransition2(void) {
29005    int test_ret = 0;
29006
29007
29008    /* missing type support */
29009    return(test_ret);
29010}
29011
29012
29013static int
29014test_xmlAutomataSetFinalState(void) {
29015    int test_ret = 0;
29016
29017#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29018    int mem_base;
29019    int ret_val;
29020    xmlAutomataPtr am; /* an automata */
29021    int n_am;
29022    xmlAutomataStatePtr state; /* a state in this automata */
29023    int n_state;
29024
29025    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29026    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29027        mem_base = xmlMemBlocks();
29028        am = gen_xmlAutomataPtr(n_am, 0);
29029        state = gen_xmlAutomataStatePtr(n_state, 1);
29030
29031        ret_val = xmlAutomataSetFinalState(am, state);
29032        desret_int(ret_val);
29033        call_tests++;
29034        des_xmlAutomataPtr(n_am, am, 0);
29035        des_xmlAutomataStatePtr(n_state, state, 1);
29036        xmlResetLastError();
29037        if (mem_base != xmlMemBlocks()) {
29038            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29039	           xmlMemBlocks() - mem_base);
29040	    test_ret++;
29041            printf(" %d", n_am);
29042            printf(" %d", n_state);
29043            printf("\n");
29044        }
29045    }
29046    }
29047    function_tests++;
29048#endif
29049
29050    return(test_ret);
29051}
29052
29053
29054static int
29055test_xmlNewAutomata(void) {
29056    int test_ret = 0;
29057
29058
29059    /* missing type support */
29060    return(test_ret);
29061}
29062
29063static int
29064test_xmlautomata(void) {
29065    int test_ret = 0;
29066
29067    if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29068    test_ret += test_xmlAutomataCompile();
29069    test_ret += test_xmlAutomataGetInitState();
29070    test_ret += test_xmlAutomataIsDeterminist();
29071    test_ret += test_xmlAutomataNewAllTrans();
29072    test_ret += test_xmlAutomataNewCountTrans();
29073    test_ret += test_xmlAutomataNewCountTrans2();
29074    test_ret += test_xmlAutomataNewCountedTrans();
29075    test_ret += test_xmlAutomataNewCounter();
29076    test_ret += test_xmlAutomataNewCounterTrans();
29077    test_ret += test_xmlAutomataNewEpsilon();
29078    test_ret += test_xmlAutomataNewNegTrans();
29079    test_ret += test_xmlAutomataNewOnceTrans();
29080    test_ret += test_xmlAutomataNewOnceTrans2();
29081    test_ret += test_xmlAutomataNewState();
29082    test_ret += test_xmlAutomataNewTransition();
29083    test_ret += test_xmlAutomataNewTransition2();
29084    test_ret += test_xmlAutomataSetFinalState();
29085    test_ret += test_xmlNewAutomata();
29086
29087    if (test_ret != 0)
29088	printf("Module xmlautomata: %d errors\n", test_ret);
29089    return(test_ret);
29090}
29091
29092#define gen_nb_xmlGenericErrorFunc_ptr 1
29093static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29094    return(NULL);
29095}
29096static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29097}
29098
29099static int
29100test_initGenericErrorDefaultFunc(void) {
29101    int test_ret = 0;
29102
29103    int mem_base;
29104    xmlGenericErrorFunc * handler; /* the handler */
29105    int n_handler;
29106
29107    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29108        mem_base = xmlMemBlocks();
29109        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29110
29111        initGenericErrorDefaultFunc(handler);
29112        call_tests++;
29113        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29114        xmlResetLastError();
29115        if (mem_base != xmlMemBlocks()) {
29116            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29117	           xmlMemBlocks() - mem_base);
29118	    test_ret++;
29119            printf(" %d", n_handler);
29120            printf("\n");
29121        }
29122    }
29123    function_tests++;
29124
29125    return(test_ret);
29126}
29127
29128
29129#define gen_nb_xmlErrorPtr 1
29130static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29131    return(NULL);
29132}
29133static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29134}
29135
29136static int
29137test_xmlCopyError(void) {
29138    int test_ret = 0;
29139
29140    int mem_base;
29141    int ret_val;
29142    xmlErrorPtr from; /* a source error */
29143    int n_from;
29144    xmlErrorPtr to; /* a target error */
29145    int n_to;
29146
29147    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29148    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29149        mem_base = xmlMemBlocks();
29150        from = gen_xmlErrorPtr(n_from, 0);
29151        to = gen_xmlErrorPtr(n_to, 1);
29152
29153        ret_val = xmlCopyError(from, to);
29154        desret_int(ret_val);
29155        call_tests++;
29156        des_xmlErrorPtr(n_from, from, 0);
29157        des_xmlErrorPtr(n_to, to, 1);
29158        xmlResetLastError();
29159        if (mem_base != xmlMemBlocks()) {
29160            printf("Leak of %d blocks found in xmlCopyError",
29161	           xmlMemBlocks() - mem_base);
29162	    test_ret++;
29163            printf(" %d", n_from);
29164            printf(" %d", n_to);
29165            printf("\n");
29166        }
29167    }
29168    }
29169    function_tests++;
29170
29171    return(test_ret);
29172}
29173
29174
29175static int
29176test_xmlCtxtGetLastError(void) {
29177    int test_ret = 0;
29178
29179
29180    /* missing type support */
29181    return(test_ret);
29182}
29183
29184
29185static int
29186test_xmlCtxtResetLastError(void) {
29187    int test_ret = 0;
29188
29189    int mem_base;
29190    void * ctx; /* an XML parser context */
29191    int n_ctx;
29192
29193    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29194        mem_base = xmlMemBlocks();
29195        ctx = gen_void_ptr(n_ctx, 0);
29196
29197        xmlCtxtResetLastError(ctx);
29198        call_tests++;
29199        des_void_ptr(n_ctx, ctx, 0);
29200        xmlResetLastError();
29201        if (mem_base != xmlMemBlocks()) {
29202            printf("Leak of %d blocks found in xmlCtxtResetLastError",
29203	           xmlMemBlocks() - mem_base);
29204	    test_ret++;
29205            printf(" %d", n_ctx);
29206            printf("\n");
29207        }
29208    }
29209    function_tests++;
29210
29211    return(test_ret);
29212}
29213
29214
29215static int
29216test_xmlGetLastError(void) {
29217    int test_ret = 0;
29218
29219
29220    /* missing type support */
29221    return(test_ret);
29222}
29223
29224
29225static int
29226test_xmlParserError(void) {
29227    int test_ret = 0;
29228
29229
29230    /* missing type support */
29231    return(test_ret);
29232}
29233
29234
29235static int
29236test_xmlParserPrintFileContext(void) {
29237    int test_ret = 0;
29238
29239    int mem_base;
29240    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29241    int n_input;
29242
29243    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29244        mem_base = xmlMemBlocks();
29245        input = gen_xmlParserInputPtr(n_input, 0);
29246
29247        xmlParserPrintFileContext(input);
29248        call_tests++;
29249        des_xmlParserInputPtr(n_input, input, 0);
29250        xmlResetLastError();
29251        if (mem_base != xmlMemBlocks()) {
29252            printf("Leak of %d blocks found in xmlParserPrintFileContext",
29253	           xmlMemBlocks() - mem_base);
29254	    test_ret++;
29255            printf(" %d", n_input);
29256            printf("\n");
29257        }
29258    }
29259    function_tests++;
29260
29261    return(test_ret);
29262}
29263
29264
29265static int
29266test_xmlParserPrintFileInfo(void) {
29267    int test_ret = 0;
29268
29269    int mem_base;
29270    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29271    int n_input;
29272
29273    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29274        mem_base = xmlMemBlocks();
29275        input = gen_xmlParserInputPtr(n_input, 0);
29276
29277        xmlParserPrintFileInfo(input);
29278        call_tests++;
29279        des_xmlParserInputPtr(n_input, input, 0);
29280        xmlResetLastError();
29281        if (mem_base != xmlMemBlocks()) {
29282            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29283	           xmlMemBlocks() - mem_base);
29284	    test_ret++;
29285            printf(" %d", n_input);
29286            printf("\n");
29287        }
29288    }
29289    function_tests++;
29290
29291    return(test_ret);
29292}
29293
29294
29295static int
29296test_xmlParserValidityError(void) {
29297    int test_ret = 0;
29298
29299
29300    /* missing type support */
29301    return(test_ret);
29302}
29303
29304
29305static int
29306test_xmlParserValidityWarning(void) {
29307    int test_ret = 0;
29308
29309
29310    /* missing type support */
29311    return(test_ret);
29312}
29313
29314
29315static int
29316test_xmlParserWarning(void) {
29317    int test_ret = 0;
29318
29319
29320    /* missing type support */
29321    return(test_ret);
29322}
29323
29324
29325static int
29326test_xmlResetError(void) {
29327    int test_ret = 0;
29328
29329    int mem_base;
29330    xmlErrorPtr err; /* pointer to the error. */
29331    int n_err;
29332
29333    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29334        mem_base = xmlMemBlocks();
29335        err = gen_xmlErrorPtr(n_err, 0);
29336
29337        xmlResetError(err);
29338        call_tests++;
29339        des_xmlErrorPtr(n_err, err, 0);
29340        xmlResetLastError();
29341        if (mem_base != xmlMemBlocks()) {
29342            printf("Leak of %d blocks found in xmlResetError",
29343	           xmlMemBlocks() - mem_base);
29344	    test_ret++;
29345            printf(" %d", n_err);
29346            printf("\n");
29347        }
29348    }
29349    function_tests++;
29350
29351    return(test_ret);
29352}
29353
29354
29355static int
29356test_xmlResetLastError(void) {
29357    int test_ret = 0;
29358
29359
29360
29361        xmlResetLastError();
29362        call_tests++;
29363        xmlResetLastError();
29364    function_tests++;
29365
29366    return(test_ret);
29367}
29368
29369
29370static int
29371test_xmlSetGenericErrorFunc(void) {
29372    int test_ret = 0;
29373
29374
29375    /* missing type support */
29376    return(test_ret);
29377}
29378
29379
29380static int
29381test_xmlSetStructuredErrorFunc(void) {
29382    int test_ret = 0;
29383
29384
29385    /* missing type support */
29386    return(test_ret);
29387}
29388
29389static int
29390test_xmlerror(void) {
29391    int test_ret = 0;
29392
29393    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29394    test_ret += test_initGenericErrorDefaultFunc();
29395    test_ret += test_xmlCopyError();
29396    test_ret += test_xmlCtxtGetLastError();
29397    test_ret += test_xmlCtxtResetLastError();
29398    test_ret += test_xmlGetLastError();
29399    test_ret += test_xmlParserError();
29400    test_ret += test_xmlParserPrintFileContext();
29401    test_ret += test_xmlParserPrintFileInfo();
29402    test_ret += test_xmlParserValidityError();
29403    test_ret += test_xmlParserValidityWarning();
29404    test_ret += test_xmlParserWarning();
29405    test_ret += test_xmlResetError();
29406    test_ret += test_xmlResetLastError();
29407    test_ret += test_xmlSetGenericErrorFunc();
29408    test_ret += test_xmlSetStructuredErrorFunc();
29409
29410    if (test_ret != 0)
29411	printf("Module xmlerror: %d errors\n", test_ret);
29412    return(test_ret);
29413}
29414#ifdef LIBXML_MODULES_ENABLED
29415
29416#define gen_nb_xmlModulePtr 1
29417static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29418    return(NULL);
29419}
29420static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29421}
29422#endif
29423
29424
29425static int
29426test_xmlModuleClose(void) {
29427    int test_ret = 0;
29428
29429#if defined(LIBXML_MODULES_ENABLED)
29430    int mem_base;
29431    int ret_val;
29432    xmlModulePtr module; /* the module handle */
29433    int n_module;
29434
29435    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29436        mem_base = xmlMemBlocks();
29437        module = gen_xmlModulePtr(n_module, 0);
29438
29439        ret_val = xmlModuleClose(module);
29440        desret_int(ret_val);
29441        call_tests++;
29442        des_xmlModulePtr(n_module, module, 0);
29443        xmlResetLastError();
29444        if (mem_base != xmlMemBlocks()) {
29445            printf("Leak of %d blocks found in xmlModuleClose",
29446	           xmlMemBlocks() - mem_base);
29447	    test_ret++;
29448            printf(" %d", n_module);
29449            printf("\n");
29450        }
29451    }
29452    function_tests++;
29453#endif
29454
29455    return(test_ret);
29456}
29457
29458
29459static int
29460test_xmlModuleOpen(void) {
29461    int test_ret = 0;
29462
29463
29464    /* missing type support */
29465    return(test_ret);
29466}
29467
29468
29469static int
29470test_xmlModuleSymbol(void) {
29471    int test_ret = 0;
29472
29473#if defined(LIBXML_MODULES_ENABLED)
29474    int mem_base;
29475    int ret_val;
29476    xmlModulePtr module; /* the module */
29477    int n_module;
29478    char * name; /* the name of the symbol */
29479    int n_name;
29480    void ** symbol; /* the resulting symbol address */
29481    int n_symbol;
29482
29483    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29484    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29485    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29486        mem_base = xmlMemBlocks();
29487        module = gen_xmlModulePtr(n_module, 0);
29488        name = gen_const_char_ptr(n_name, 1);
29489        symbol = gen_void_ptr_ptr(n_symbol, 2);
29490
29491        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29492        desret_int(ret_val);
29493        call_tests++;
29494        des_xmlModulePtr(n_module, module, 0);
29495        des_const_char_ptr(n_name, (const char *)name, 1);
29496        des_void_ptr_ptr(n_symbol, symbol, 2);
29497        xmlResetLastError();
29498        if (mem_base != xmlMemBlocks()) {
29499            printf("Leak of %d blocks found in xmlModuleSymbol",
29500	           xmlMemBlocks() - mem_base);
29501	    test_ret++;
29502            printf(" %d", n_module);
29503            printf(" %d", n_name);
29504            printf(" %d", n_symbol);
29505            printf("\n");
29506        }
29507    }
29508    }
29509    }
29510    function_tests++;
29511#endif
29512
29513    return(test_ret);
29514}
29515
29516static int
29517test_xmlmodule(void) {
29518    int test_ret = 0;
29519
29520    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29521    test_ret += test_xmlModuleClose();
29522    test_ret += test_xmlModuleOpen();
29523    test_ret += test_xmlModuleSymbol();
29524
29525    if (test_ret != 0)
29526	printf("Module xmlmodule: %d errors\n", test_ret);
29527    return(test_ret);
29528}
29529
29530static int
29531test_xmlNewTextReader(void) {
29532    int test_ret = 0;
29533
29534#if defined(LIBXML_READER_ENABLED)
29535    int mem_base;
29536    xmlTextReaderPtr ret_val;
29537    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29538    int n_input;
29539    const char * URI; /* the URI information for the source if available */
29540    int n_URI;
29541
29542    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29543    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29544        mem_base = xmlMemBlocks();
29545        input = gen_xmlParserInputBufferPtr(n_input, 0);
29546        URI = gen_filepath(n_URI, 1);
29547
29548        ret_val = xmlNewTextReader(input, URI);
29549        desret_xmlTextReaderPtr(ret_val);
29550        call_tests++;
29551        des_xmlParserInputBufferPtr(n_input, input, 0);
29552        des_filepath(n_URI, URI, 1);
29553        xmlResetLastError();
29554        if (mem_base != xmlMemBlocks()) {
29555            printf("Leak of %d blocks found in xmlNewTextReader",
29556	           xmlMemBlocks() - mem_base);
29557	    test_ret++;
29558            printf(" %d", n_input);
29559            printf(" %d", n_URI);
29560            printf("\n");
29561        }
29562    }
29563    }
29564    function_tests++;
29565#endif
29566
29567    return(test_ret);
29568}
29569
29570
29571static int
29572test_xmlNewTextReaderFilename(void) {
29573    int test_ret = 0;
29574
29575#if defined(LIBXML_READER_ENABLED)
29576    int mem_base;
29577    xmlTextReaderPtr ret_val;
29578    const char * URI; /* the URI of the resource to process */
29579    int n_URI;
29580
29581    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29582        mem_base = xmlMemBlocks();
29583        URI = gen_filepath(n_URI, 0);
29584
29585        ret_val = xmlNewTextReaderFilename(URI);
29586        desret_xmlTextReaderPtr(ret_val);
29587        call_tests++;
29588        des_filepath(n_URI, URI, 0);
29589        xmlResetLastError();
29590        if (mem_base != xmlMemBlocks()) {
29591            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29592	           xmlMemBlocks() - mem_base);
29593	    test_ret++;
29594            printf(" %d", n_URI);
29595            printf("\n");
29596        }
29597    }
29598    function_tests++;
29599#endif
29600
29601    return(test_ret);
29602}
29603
29604
29605static int
29606test_xmlReaderForDoc(void) {
29607    int test_ret = 0;
29608
29609#if defined(LIBXML_READER_ENABLED)
29610    int mem_base;
29611    xmlTextReaderPtr ret_val;
29612    xmlChar * cur; /* a pointer to a zero terminated string */
29613    int n_cur;
29614    const char * URL; /* the base URL to use for the document */
29615    int n_URL;
29616    char * encoding; /* the document encoding, or NULL */
29617    int n_encoding;
29618    int options; /* a combination of xmlParserOption */
29619    int n_options;
29620
29621    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29622    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29623    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29624    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29625        mem_base = xmlMemBlocks();
29626        cur = gen_const_xmlChar_ptr(n_cur, 0);
29627        URL = gen_filepath(n_URL, 1);
29628        encoding = gen_const_char_ptr(n_encoding, 2);
29629        options = gen_parseroptions(n_options, 3);
29630
29631        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29632        desret_xmlTextReaderPtr(ret_val);
29633        call_tests++;
29634        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29635        des_filepath(n_URL, URL, 1);
29636        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29637        des_parseroptions(n_options, options, 3);
29638        xmlResetLastError();
29639        if (mem_base != xmlMemBlocks()) {
29640            printf("Leak of %d blocks found in xmlReaderForDoc",
29641	           xmlMemBlocks() - mem_base);
29642	    test_ret++;
29643            printf(" %d", n_cur);
29644            printf(" %d", n_URL);
29645            printf(" %d", n_encoding);
29646            printf(" %d", n_options);
29647            printf("\n");
29648        }
29649    }
29650    }
29651    }
29652    }
29653    function_tests++;
29654#endif
29655
29656    return(test_ret);
29657}
29658
29659
29660static int
29661test_xmlReaderForFile(void) {
29662    int test_ret = 0;
29663
29664#if defined(LIBXML_READER_ENABLED)
29665    int mem_base;
29666    xmlTextReaderPtr ret_val;
29667    const char * filename; /* a file or URL */
29668    int n_filename;
29669    char * encoding; /* the document encoding, or NULL */
29670    int n_encoding;
29671    int options; /* a combination of xmlParserOption */
29672    int n_options;
29673
29674    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29675    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29676    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29677        mem_base = xmlMemBlocks();
29678        filename = gen_filepath(n_filename, 0);
29679        encoding = gen_const_char_ptr(n_encoding, 1);
29680        options = gen_parseroptions(n_options, 2);
29681
29682        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29683        desret_xmlTextReaderPtr(ret_val);
29684        call_tests++;
29685        des_filepath(n_filename, filename, 0);
29686        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29687        des_parseroptions(n_options, options, 2);
29688        xmlResetLastError();
29689        if (mem_base != xmlMemBlocks()) {
29690            printf("Leak of %d blocks found in xmlReaderForFile",
29691	           xmlMemBlocks() - mem_base);
29692	    test_ret++;
29693            printf(" %d", n_filename);
29694            printf(" %d", n_encoding);
29695            printf(" %d", n_options);
29696            printf("\n");
29697        }
29698    }
29699    }
29700    }
29701    function_tests++;
29702#endif
29703
29704    return(test_ret);
29705}
29706
29707
29708static int
29709test_xmlReaderForMemory(void) {
29710    int test_ret = 0;
29711
29712#if defined(LIBXML_READER_ENABLED)
29713    int mem_base;
29714    xmlTextReaderPtr ret_val;
29715    char * buffer; /* a pointer to a char array */
29716    int n_buffer;
29717    int size; /* the size of the array */
29718    int n_size;
29719    const char * URL; /* the base URL to use for the document */
29720    int n_URL;
29721    char * encoding; /* the document encoding, or NULL */
29722    int n_encoding;
29723    int options; /* a combination of xmlParserOption */
29724    int n_options;
29725
29726    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29727    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29728    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29729    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29730    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29731        mem_base = xmlMemBlocks();
29732        buffer = gen_const_char_ptr(n_buffer, 0);
29733        size = gen_int(n_size, 1);
29734        URL = gen_filepath(n_URL, 2);
29735        encoding = gen_const_char_ptr(n_encoding, 3);
29736        options = gen_parseroptions(n_options, 4);
29737
29738        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29739        desret_xmlTextReaderPtr(ret_val);
29740        call_tests++;
29741        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29742        des_int(n_size, size, 1);
29743        des_filepath(n_URL, URL, 2);
29744        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29745        des_parseroptions(n_options, options, 4);
29746        xmlResetLastError();
29747        if (mem_base != xmlMemBlocks()) {
29748            printf("Leak of %d blocks found in xmlReaderForMemory",
29749	           xmlMemBlocks() - mem_base);
29750	    test_ret++;
29751            printf(" %d", n_buffer);
29752            printf(" %d", n_size);
29753            printf(" %d", n_URL);
29754            printf(" %d", n_encoding);
29755            printf(" %d", n_options);
29756            printf("\n");
29757        }
29758    }
29759    }
29760    }
29761    }
29762    }
29763    function_tests++;
29764#endif
29765
29766    return(test_ret);
29767}
29768
29769
29770static int
29771test_xmlReaderNewDoc(void) {
29772    int test_ret = 0;
29773
29774#if defined(LIBXML_READER_ENABLED)
29775    int mem_base;
29776    int ret_val;
29777    xmlTextReaderPtr reader; /* an XML reader */
29778    int n_reader;
29779    xmlChar * cur; /* a pointer to a zero terminated string */
29780    int n_cur;
29781    const char * URL; /* the base URL to use for the document */
29782    int n_URL;
29783    char * encoding; /* the document encoding, or NULL */
29784    int n_encoding;
29785    int options; /* a combination of xmlParserOption */
29786    int n_options;
29787
29788    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29789    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29790    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29791    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29792    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29793        mem_base = xmlMemBlocks();
29794        reader = gen_xmlTextReaderPtr(n_reader, 0);
29795        cur = gen_const_xmlChar_ptr(n_cur, 1);
29796        URL = gen_filepath(n_URL, 2);
29797        encoding = gen_const_char_ptr(n_encoding, 3);
29798        options = gen_parseroptions(n_options, 4);
29799
29800        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29801        desret_int(ret_val);
29802        call_tests++;
29803        des_xmlTextReaderPtr(n_reader, reader, 0);
29804        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29805        des_filepath(n_URL, URL, 2);
29806        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29807        des_parseroptions(n_options, options, 4);
29808        xmlResetLastError();
29809        if (mem_base != xmlMemBlocks()) {
29810            printf("Leak of %d blocks found in xmlReaderNewDoc",
29811	           xmlMemBlocks() - mem_base);
29812	    test_ret++;
29813            printf(" %d", n_reader);
29814            printf(" %d", n_cur);
29815            printf(" %d", n_URL);
29816            printf(" %d", n_encoding);
29817            printf(" %d", n_options);
29818            printf("\n");
29819        }
29820    }
29821    }
29822    }
29823    }
29824    }
29825    function_tests++;
29826#endif
29827
29828    return(test_ret);
29829}
29830
29831
29832static int
29833test_xmlReaderNewFile(void) {
29834    int test_ret = 0;
29835
29836#if defined(LIBXML_READER_ENABLED)
29837    int mem_base;
29838    int ret_val;
29839    xmlTextReaderPtr reader; /* an XML reader */
29840    int n_reader;
29841    const char * filename; /* a file or URL */
29842    int n_filename;
29843    char * encoding; /* the document encoding, or NULL */
29844    int n_encoding;
29845    int options; /* a combination of xmlParserOption */
29846    int n_options;
29847
29848    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29849    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29850    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29851    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29852        mem_base = xmlMemBlocks();
29853        reader = gen_xmlTextReaderPtr(n_reader, 0);
29854        filename = gen_filepath(n_filename, 1);
29855        encoding = gen_const_char_ptr(n_encoding, 2);
29856        options = gen_parseroptions(n_options, 3);
29857
29858        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
29859        desret_int(ret_val);
29860        call_tests++;
29861        des_xmlTextReaderPtr(n_reader, reader, 0);
29862        des_filepath(n_filename, filename, 1);
29863        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29864        des_parseroptions(n_options, options, 3);
29865        xmlResetLastError();
29866        if (mem_base != xmlMemBlocks()) {
29867            printf("Leak of %d blocks found in xmlReaderNewFile",
29868	           xmlMemBlocks() - mem_base);
29869	    test_ret++;
29870            printf(" %d", n_reader);
29871            printf(" %d", n_filename);
29872            printf(" %d", n_encoding);
29873            printf(" %d", n_options);
29874            printf("\n");
29875        }
29876    }
29877    }
29878    }
29879    }
29880    function_tests++;
29881#endif
29882
29883    return(test_ret);
29884}
29885
29886
29887static int
29888test_xmlReaderNewMemory(void) {
29889    int test_ret = 0;
29890
29891#if defined(LIBXML_READER_ENABLED)
29892    int mem_base;
29893    int ret_val;
29894    xmlTextReaderPtr reader; /* an XML reader */
29895    int n_reader;
29896    char * buffer; /* a pointer to a char array */
29897    int n_buffer;
29898    int size; /* the size of the array */
29899    int n_size;
29900    const char * URL; /* the base URL to use for the document */
29901    int n_URL;
29902    char * encoding; /* the document encoding, or NULL */
29903    int n_encoding;
29904    int options; /* a combination of xmlParserOption */
29905    int n_options;
29906
29907    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29908    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29909    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29910    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29911    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29912    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29913        mem_base = xmlMemBlocks();
29914        reader = gen_xmlTextReaderPtr(n_reader, 0);
29915        buffer = gen_const_char_ptr(n_buffer, 1);
29916        size = gen_int(n_size, 2);
29917        URL = gen_filepath(n_URL, 3);
29918        encoding = gen_const_char_ptr(n_encoding, 4);
29919        options = gen_parseroptions(n_options, 5);
29920
29921        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
29922        desret_int(ret_val);
29923        call_tests++;
29924        des_xmlTextReaderPtr(n_reader, reader, 0);
29925        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
29926        des_int(n_size, size, 2);
29927        des_filepath(n_URL, URL, 3);
29928        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
29929        des_parseroptions(n_options, options, 5);
29930        xmlResetLastError();
29931        if (mem_base != xmlMemBlocks()) {
29932            printf("Leak of %d blocks found in xmlReaderNewMemory",
29933	           xmlMemBlocks() - mem_base);
29934	    test_ret++;
29935            printf(" %d", n_reader);
29936            printf(" %d", n_buffer);
29937            printf(" %d", n_size);
29938            printf(" %d", n_URL);
29939            printf(" %d", n_encoding);
29940            printf(" %d", n_options);
29941            printf("\n");
29942        }
29943    }
29944    }
29945    }
29946    }
29947    }
29948    }
29949    function_tests++;
29950#endif
29951
29952    return(test_ret);
29953}
29954
29955
29956static int
29957test_xmlReaderNewWalker(void) {
29958    int test_ret = 0;
29959
29960#if defined(LIBXML_READER_ENABLED)
29961    int mem_base;
29962    int ret_val;
29963    xmlTextReaderPtr reader; /* an XML reader */
29964    int n_reader;
29965    xmlDocPtr doc; /* a preparsed document */
29966    int n_doc;
29967
29968    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29969    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29970        mem_base = xmlMemBlocks();
29971        reader = gen_xmlTextReaderPtr(n_reader, 0);
29972        doc = gen_xmlDocPtr(n_doc, 1);
29973
29974        ret_val = xmlReaderNewWalker(reader, doc);
29975        desret_int(ret_val);
29976        call_tests++;
29977        des_xmlTextReaderPtr(n_reader, reader, 0);
29978        des_xmlDocPtr(n_doc, doc, 1);
29979        xmlResetLastError();
29980        if (mem_base != xmlMemBlocks()) {
29981            printf("Leak of %d blocks found in xmlReaderNewWalker",
29982	           xmlMemBlocks() - mem_base);
29983	    test_ret++;
29984            printf(" %d", n_reader);
29985            printf(" %d", n_doc);
29986            printf("\n");
29987        }
29988    }
29989    }
29990    function_tests++;
29991#endif
29992
29993    return(test_ret);
29994}
29995
29996
29997static int
29998test_xmlReaderWalker(void) {
29999    int test_ret = 0;
30000
30001#if defined(LIBXML_READER_ENABLED)
30002    int mem_base;
30003    xmlTextReaderPtr ret_val;
30004    xmlDocPtr doc; /* a preparsed document */
30005    int n_doc;
30006
30007    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30008        mem_base = xmlMemBlocks();
30009        doc = gen_xmlDocPtr(n_doc, 0);
30010
30011        ret_val = xmlReaderWalker(doc);
30012        desret_xmlTextReaderPtr(ret_val);
30013        call_tests++;
30014        des_xmlDocPtr(n_doc, doc, 0);
30015        xmlResetLastError();
30016        if (mem_base != xmlMemBlocks()) {
30017            printf("Leak of %d blocks found in xmlReaderWalker",
30018	           xmlMemBlocks() - mem_base);
30019	    test_ret++;
30020            printf(" %d", n_doc);
30021            printf("\n");
30022        }
30023    }
30024    function_tests++;
30025#endif
30026
30027    return(test_ret);
30028}
30029
30030
30031static int
30032test_xmlTextReaderAttributeCount(void) {
30033    int test_ret = 0;
30034
30035#if defined(LIBXML_READER_ENABLED)
30036    int mem_base;
30037    int ret_val;
30038    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30039    int n_reader;
30040
30041    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30042        mem_base = xmlMemBlocks();
30043        reader = gen_xmlTextReaderPtr(n_reader, 0);
30044
30045        ret_val = xmlTextReaderAttributeCount(reader);
30046        desret_int(ret_val);
30047        call_tests++;
30048        des_xmlTextReaderPtr(n_reader, reader, 0);
30049        xmlResetLastError();
30050        if (mem_base != xmlMemBlocks()) {
30051            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30052	           xmlMemBlocks() - mem_base);
30053	    test_ret++;
30054            printf(" %d", n_reader);
30055            printf("\n");
30056        }
30057    }
30058    function_tests++;
30059#endif
30060
30061    return(test_ret);
30062}
30063
30064
30065static int
30066test_xmlTextReaderBaseUri(void) {
30067    int test_ret = 0;
30068
30069#if defined(LIBXML_READER_ENABLED)
30070    int mem_base;
30071    xmlChar * ret_val;
30072    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30073    int n_reader;
30074
30075    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30076        mem_base = xmlMemBlocks();
30077        reader = gen_xmlTextReaderPtr(n_reader, 0);
30078
30079        ret_val = xmlTextReaderBaseUri(reader);
30080        desret_xmlChar_ptr(ret_val);
30081        call_tests++;
30082        des_xmlTextReaderPtr(n_reader, reader, 0);
30083        xmlResetLastError();
30084        if (mem_base != xmlMemBlocks()) {
30085            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30086	           xmlMemBlocks() - mem_base);
30087	    test_ret++;
30088            printf(" %d", n_reader);
30089            printf("\n");
30090        }
30091    }
30092    function_tests++;
30093#endif
30094
30095    return(test_ret);
30096}
30097
30098
30099static int
30100test_xmlTextReaderByteConsumed(void) {
30101    int test_ret = 0;
30102
30103#if defined(LIBXML_READER_ENABLED)
30104    int mem_base;
30105    long ret_val;
30106    xmlTextReaderPtr reader; /* an XML reader */
30107    int n_reader;
30108
30109    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30110        mem_base = xmlMemBlocks();
30111        reader = gen_xmlTextReaderPtr(n_reader, 0);
30112
30113        ret_val = xmlTextReaderByteConsumed(reader);
30114        desret_long(ret_val);
30115        call_tests++;
30116        des_xmlTextReaderPtr(n_reader, reader, 0);
30117        xmlResetLastError();
30118        if (mem_base != xmlMemBlocks()) {
30119            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30120	           xmlMemBlocks() - mem_base);
30121	    test_ret++;
30122            printf(" %d", n_reader);
30123            printf("\n");
30124        }
30125    }
30126    function_tests++;
30127#endif
30128
30129    return(test_ret);
30130}
30131
30132
30133static int
30134test_xmlTextReaderClose(void) {
30135    int test_ret = 0;
30136
30137#if defined(LIBXML_READER_ENABLED)
30138    int mem_base;
30139    int ret_val;
30140    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30141    int n_reader;
30142
30143    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30144        mem_base = xmlMemBlocks();
30145        reader = gen_xmlTextReaderPtr(n_reader, 0);
30146
30147        ret_val = xmlTextReaderClose(reader);
30148        desret_int(ret_val);
30149        call_tests++;
30150        des_xmlTextReaderPtr(n_reader, reader, 0);
30151        xmlResetLastError();
30152        if (mem_base != xmlMemBlocks()) {
30153            printf("Leak of %d blocks found in xmlTextReaderClose",
30154	           xmlMemBlocks() - mem_base);
30155	    test_ret++;
30156            printf(" %d", n_reader);
30157            printf("\n");
30158        }
30159    }
30160    function_tests++;
30161#endif
30162
30163    return(test_ret);
30164}
30165
30166
30167static int
30168test_xmlTextReaderConstBaseUri(void) {
30169    int test_ret = 0;
30170
30171#if defined(LIBXML_READER_ENABLED)
30172    int mem_base;
30173    const xmlChar * ret_val;
30174    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30175    int n_reader;
30176
30177    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30178        mem_base = xmlMemBlocks();
30179        reader = gen_xmlTextReaderPtr(n_reader, 0);
30180
30181        ret_val = xmlTextReaderConstBaseUri(reader);
30182        desret_const_xmlChar_ptr(ret_val);
30183        call_tests++;
30184        des_xmlTextReaderPtr(n_reader, reader, 0);
30185        xmlResetLastError();
30186        if (mem_base != xmlMemBlocks()) {
30187            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30188	           xmlMemBlocks() - mem_base);
30189	    test_ret++;
30190            printf(" %d", n_reader);
30191            printf("\n");
30192        }
30193    }
30194    function_tests++;
30195#endif
30196
30197    return(test_ret);
30198}
30199
30200
30201static int
30202test_xmlTextReaderConstEncoding(void) {
30203    int test_ret = 0;
30204
30205#if defined(LIBXML_READER_ENABLED)
30206    int mem_base;
30207    const xmlChar * ret_val;
30208    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30209    int n_reader;
30210
30211    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30212        mem_base = xmlMemBlocks();
30213        reader = gen_xmlTextReaderPtr(n_reader, 0);
30214
30215        ret_val = xmlTextReaderConstEncoding(reader);
30216        desret_const_xmlChar_ptr(ret_val);
30217        call_tests++;
30218        des_xmlTextReaderPtr(n_reader, reader, 0);
30219        xmlResetLastError();
30220        if (mem_base != xmlMemBlocks()) {
30221            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30222	           xmlMemBlocks() - mem_base);
30223	    test_ret++;
30224            printf(" %d", n_reader);
30225            printf("\n");
30226        }
30227    }
30228    function_tests++;
30229#endif
30230
30231    return(test_ret);
30232}
30233
30234
30235static int
30236test_xmlTextReaderConstLocalName(void) {
30237    int test_ret = 0;
30238
30239#if defined(LIBXML_READER_ENABLED)
30240    int mem_base;
30241    const xmlChar * ret_val;
30242    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30243    int n_reader;
30244
30245    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30246        mem_base = xmlMemBlocks();
30247        reader = gen_xmlTextReaderPtr(n_reader, 0);
30248
30249        ret_val = xmlTextReaderConstLocalName(reader);
30250        desret_const_xmlChar_ptr(ret_val);
30251        call_tests++;
30252        des_xmlTextReaderPtr(n_reader, reader, 0);
30253        xmlResetLastError();
30254        if (mem_base != xmlMemBlocks()) {
30255            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30256	           xmlMemBlocks() - mem_base);
30257	    test_ret++;
30258            printf(" %d", n_reader);
30259            printf("\n");
30260        }
30261    }
30262    function_tests++;
30263#endif
30264
30265    return(test_ret);
30266}
30267
30268
30269static int
30270test_xmlTextReaderConstName(void) {
30271    int test_ret = 0;
30272
30273#if defined(LIBXML_READER_ENABLED)
30274    int mem_base;
30275    const xmlChar * ret_val;
30276    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30277    int n_reader;
30278
30279    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30280        mem_base = xmlMemBlocks();
30281        reader = gen_xmlTextReaderPtr(n_reader, 0);
30282
30283        ret_val = xmlTextReaderConstName(reader);
30284        desret_const_xmlChar_ptr(ret_val);
30285        call_tests++;
30286        des_xmlTextReaderPtr(n_reader, reader, 0);
30287        xmlResetLastError();
30288        if (mem_base != xmlMemBlocks()) {
30289            printf("Leak of %d blocks found in xmlTextReaderConstName",
30290	           xmlMemBlocks() - mem_base);
30291	    test_ret++;
30292            printf(" %d", n_reader);
30293            printf("\n");
30294        }
30295    }
30296    function_tests++;
30297#endif
30298
30299    return(test_ret);
30300}
30301
30302
30303static int
30304test_xmlTextReaderConstNamespaceUri(void) {
30305    int test_ret = 0;
30306
30307#if defined(LIBXML_READER_ENABLED)
30308    int mem_base;
30309    const xmlChar * ret_val;
30310    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30311    int n_reader;
30312
30313    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30314        mem_base = xmlMemBlocks();
30315        reader = gen_xmlTextReaderPtr(n_reader, 0);
30316
30317        ret_val = xmlTextReaderConstNamespaceUri(reader);
30318        desret_const_xmlChar_ptr(ret_val);
30319        call_tests++;
30320        des_xmlTextReaderPtr(n_reader, reader, 0);
30321        xmlResetLastError();
30322        if (mem_base != xmlMemBlocks()) {
30323            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30324	           xmlMemBlocks() - mem_base);
30325	    test_ret++;
30326            printf(" %d", n_reader);
30327            printf("\n");
30328        }
30329    }
30330    function_tests++;
30331#endif
30332
30333    return(test_ret);
30334}
30335
30336
30337static int
30338test_xmlTextReaderConstPrefix(void) {
30339    int test_ret = 0;
30340
30341#if defined(LIBXML_READER_ENABLED)
30342    int mem_base;
30343    const xmlChar * ret_val;
30344    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30345    int n_reader;
30346
30347    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30348        mem_base = xmlMemBlocks();
30349        reader = gen_xmlTextReaderPtr(n_reader, 0);
30350
30351        ret_val = xmlTextReaderConstPrefix(reader);
30352        desret_const_xmlChar_ptr(ret_val);
30353        call_tests++;
30354        des_xmlTextReaderPtr(n_reader, reader, 0);
30355        xmlResetLastError();
30356        if (mem_base != xmlMemBlocks()) {
30357            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30358	           xmlMemBlocks() - mem_base);
30359	    test_ret++;
30360            printf(" %d", n_reader);
30361            printf("\n");
30362        }
30363    }
30364    function_tests++;
30365#endif
30366
30367    return(test_ret);
30368}
30369
30370
30371static int
30372test_xmlTextReaderConstString(void) {
30373    int test_ret = 0;
30374
30375#if defined(LIBXML_READER_ENABLED)
30376    int mem_base;
30377    const xmlChar * ret_val;
30378    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30379    int n_reader;
30380    xmlChar * str; /* the string to intern. */
30381    int n_str;
30382
30383    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30384    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30385        mem_base = xmlMemBlocks();
30386        reader = gen_xmlTextReaderPtr(n_reader, 0);
30387        str = gen_const_xmlChar_ptr(n_str, 1);
30388
30389        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30390        desret_const_xmlChar_ptr(ret_val);
30391        call_tests++;
30392        des_xmlTextReaderPtr(n_reader, reader, 0);
30393        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30394        xmlResetLastError();
30395        if (mem_base != xmlMemBlocks()) {
30396            printf("Leak of %d blocks found in xmlTextReaderConstString",
30397	           xmlMemBlocks() - mem_base);
30398	    test_ret++;
30399            printf(" %d", n_reader);
30400            printf(" %d", n_str);
30401            printf("\n");
30402        }
30403    }
30404    }
30405    function_tests++;
30406#endif
30407
30408    return(test_ret);
30409}
30410
30411
30412static int
30413test_xmlTextReaderConstValue(void) {
30414    int test_ret = 0;
30415
30416#if defined(LIBXML_READER_ENABLED)
30417    int mem_base;
30418    const xmlChar * ret_val;
30419    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30420    int n_reader;
30421
30422    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30423        mem_base = xmlMemBlocks();
30424        reader = gen_xmlTextReaderPtr(n_reader, 0);
30425
30426        ret_val = xmlTextReaderConstValue(reader);
30427        desret_const_xmlChar_ptr(ret_val);
30428        call_tests++;
30429        des_xmlTextReaderPtr(n_reader, reader, 0);
30430        xmlResetLastError();
30431        if (mem_base != xmlMemBlocks()) {
30432            printf("Leak of %d blocks found in xmlTextReaderConstValue",
30433	           xmlMemBlocks() - mem_base);
30434	    test_ret++;
30435            printf(" %d", n_reader);
30436            printf("\n");
30437        }
30438    }
30439    function_tests++;
30440#endif
30441
30442    return(test_ret);
30443}
30444
30445
30446static int
30447test_xmlTextReaderConstXmlLang(void) {
30448    int test_ret = 0;
30449
30450#if defined(LIBXML_READER_ENABLED)
30451    int mem_base;
30452    const xmlChar * ret_val;
30453    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30454    int n_reader;
30455
30456    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30457        mem_base = xmlMemBlocks();
30458        reader = gen_xmlTextReaderPtr(n_reader, 0);
30459
30460        ret_val = xmlTextReaderConstXmlLang(reader);
30461        desret_const_xmlChar_ptr(ret_val);
30462        call_tests++;
30463        des_xmlTextReaderPtr(n_reader, reader, 0);
30464        xmlResetLastError();
30465        if (mem_base != xmlMemBlocks()) {
30466            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30467	           xmlMemBlocks() - mem_base);
30468	    test_ret++;
30469            printf(" %d", n_reader);
30470            printf("\n");
30471        }
30472    }
30473    function_tests++;
30474#endif
30475
30476    return(test_ret);
30477}
30478
30479
30480static int
30481test_xmlTextReaderConstXmlVersion(void) {
30482    int test_ret = 0;
30483
30484#if defined(LIBXML_READER_ENABLED)
30485    int mem_base;
30486    const xmlChar * ret_val;
30487    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30488    int n_reader;
30489
30490    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30491        mem_base = xmlMemBlocks();
30492        reader = gen_xmlTextReaderPtr(n_reader, 0);
30493
30494        ret_val = xmlTextReaderConstXmlVersion(reader);
30495        desret_const_xmlChar_ptr(ret_val);
30496        call_tests++;
30497        des_xmlTextReaderPtr(n_reader, reader, 0);
30498        xmlResetLastError();
30499        if (mem_base != xmlMemBlocks()) {
30500            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30501	           xmlMemBlocks() - mem_base);
30502	    test_ret++;
30503            printf(" %d", n_reader);
30504            printf("\n");
30505        }
30506    }
30507    function_tests++;
30508#endif
30509
30510    return(test_ret);
30511}
30512
30513
30514static int
30515test_xmlTextReaderCurrentDoc(void) {
30516    int test_ret = 0;
30517
30518#if defined(LIBXML_READER_ENABLED)
30519    int mem_base;
30520    xmlDocPtr ret_val;
30521    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30522    int n_reader;
30523
30524    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30525        mem_base = xmlMemBlocks();
30526        reader = gen_xmlTextReaderPtr(n_reader, 0);
30527
30528        ret_val = xmlTextReaderCurrentDoc(reader);
30529        desret_xmlDocPtr(ret_val);
30530        call_tests++;
30531        des_xmlTextReaderPtr(n_reader, reader, 0);
30532        xmlResetLastError();
30533        if (mem_base != xmlMemBlocks()) {
30534            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30535	           xmlMemBlocks() - mem_base);
30536	    test_ret++;
30537            printf(" %d", n_reader);
30538            printf("\n");
30539        }
30540    }
30541    function_tests++;
30542#endif
30543
30544    return(test_ret);
30545}
30546
30547
30548static int
30549test_xmlTextReaderCurrentNode(void) {
30550    int test_ret = 0;
30551
30552#if defined(LIBXML_READER_ENABLED)
30553    int mem_base;
30554    xmlNodePtr ret_val;
30555    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30556    int n_reader;
30557
30558    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30559        mem_base = xmlMemBlocks();
30560        reader = gen_xmlTextReaderPtr(n_reader, 0);
30561
30562        ret_val = xmlTextReaderCurrentNode(reader);
30563        desret_xmlNodePtr(ret_val);
30564        call_tests++;
30565        des_xmlTextReaderPtr(n_reader, reader, 0);
30566        xmlResetLastError();
30567        if (mem_base != xmlMemBlocks()) {
30568            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30569	           xmlMemBlocks() - mem_base);
30570	    test_ret++;
30571            printf(" %d", n_reader);
30572            printf("\n");
30573        }
30574    }
30575    function_tests++;
30576#endif
30577
30578    return(test_ret);
30579}
30580
30581
30582static int
30583test_xmlTextReaderDepth(void) {
30584    int test_ret = 0;
30585
30586#if defined(LIBXML_READER_ENABLED)
30587    int mem_base;
30588    int ret_val;
30589    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30590    int n_reader;
30591
30592    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30593        mem_base = xmlMemBlocks();
30594        reader = gen_xmlTextReaderPtr(n_reader, 0);
30595
30596        ret_val = xmlTextReaderDepth(reader);
30597        desret_int(ret_val);
30598        call_tests++;
30599        des_xmlTextReaderPtr(n_reader, reader, 0);
30600        xmlResetLastError();
30601        if (mem_base != xmlMemBlocks()) {
30602            printf("Leak of %d blocks found in xmlTextReaderDepth",
30603	           xmlMemBlocks() - mem_base);
30604	    test_ret++;
30605            printf(" %d", n_reader);
30606            printf("\n");
30607        }
30608    }
30609    function_tests++;
30610#endif
30611
30612    return(test_ret);
30613}
30614
30615
30616static int
30617test_xmlTextReaderExpand(void) {
30618    int test_ret = 0;
30619
30620#if defined(LIBXML_READER_ENABLED)
30621    int mem_base;
30622    xmlNodePtr ret_val;
30623    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30624    int n_reader;
30625
30626    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30627        mem_base = xmlMemBlocks();
30628        reader = gen_xmlTextReaderPtr(n_reader, 0);
30629
30630        ret_val = xmlTextReaderExpand(reader);
30631        desret_xmlNodePtr(ret_val);
30632        call_tests++;
30633        des_xmlTextReaderPtr(n_reader, reader, 0);
30634        xmlResetLastError();
30635        if (mem_base != xmlMemBlocks()) {
30636            printf("Leak of %d blocks found in xmlTextReaderExpand",
30637	           xmlMemBlocks() - mem_base);
30638	    test_ret++;
30639            printf(" %d", n_reader);
30640            printf("\n");
30641        }
30642    }
30643    function_tests++;
30644#endif
30645
30646    return(test_ret);
30647}
30648
30649
30650static int
30651test_xmlTextReaderGetAttribute(void) {
30652    int test_ret = 0;
30653
30654#if defined(LIBXML_READER_ENABLED)
30655    int mem_base;
30656    xmlChar * ret_val;
30657    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30658    int n_reader;
30659    xmlChar * name; /* the qualified name of the attribute. */
30660    int n_name;
30661
30662    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30663    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30664        mem_base = xmlMemBlocks();
30665        reader = gen_xmlTextReaderPtr(n_reader, 0);
30666        name = gen_const_xmlChar_ptr(n_name, 1);
30667
30668        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30669        desret_xmlChar_ptr(ret_val);
30670        call_tests++;
30671        des_xmlTextReaderPtr(n_reader, reader, 0);
30672        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30673        xmlResetLastError();
30674        if (mem_base != xmlMemBlocks()) {
30675            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30676	           xmlMemBlocks() - mem_base);
30677	    test_ret++;
30678            printf(" %d", n_reader);
30679            printf(" %d", n_name);
30680            printf("\n");
30681        }
30682    }
30683    }
30684    function_tests++;
30685#endif
30686
30687    return(test_ret);
30688}
30689
30690
30691static int
30692test_xmlTextReaderGetAttributeNo(void) {
30693    int test_ret = 0;
30694
30695#if defined(LIBXML_READER_ENABLED)
30696    int mem_base;
30697    xmlChar * ret_val;
30698    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30699    int n_reader;
30700    int no; /* the zero-based index of the attribute relative to the containing element */
30701    int n_no;
30702
30703    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30704    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30705        mem_base = xmlMemBlocks();
30706        reader = gen_xmlTextReaderPtr(n_reader, 0);
30707        no = gen_int(n_no, 1);
30708
30709        ret_val = xmlTextReaderGetAttributeNo(reader, no);
30710        desret_xmlChar_ptr(ret_val);
30711        call_tests++;
30712        des_xmlTextReaderPtr(n_reader, reader, 0);
30713        des_int(n_no, no, 1);
30714        xmlResetLastError();
30715        if (mem_base != xmlMemBlocks()) {
30716            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30717	           xmlMemBlocks() - mem_base);
30718	    test_ret++;
30719            printf(" %d", n_reader);
30720            printf(" %d", n_no);
30721            printf("\n");
30722        }
30723    }
30724    }
30725    function_tests++;
30726#endif
30727
30728    return(test_ret);
30729}
30730
30731
30732static int
30733test_xmlTextReaderGetAttributeNs(void) {
30734    int test_ret = 0;
30735
30736#if defined(LIBXML_READER_ENABLED)
30737    int mem_base;
30738    xmlChar * ret_val;
30739    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30740    int n_reader;
30741    xmlChar * localName; /* the local name of the attribute. */
30742    int n_localName;
30743    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30744    int n_namespaceURI;
30745
30746    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30747    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30748    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30749        mem_base = xmlMemBlocks();
30750        reader = gen_xmlTextReaderPtr(n_reader, 0);
30751        localName = gen_const_xmlChar_ptr(n_localName, 1);
30752        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30753
30754        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30755        desret_xmlChar_ptr(ret_val);
30756        call_tests++;
30757        des_xmlTextReaderPtr(n_reader, reader, 0);
30758        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30759        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30760        xmlResetLastError();
30761        if (mem_base != xmlMemBlocks()) {
30762            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30763	           xmlMemBlocks() - mem_base);
30764	    test_ret++;
30765            printf(" %d", n_reader);
30766            printf(" %d", n_localName);
30767            printf(" %d", n_namespaceURI);
30768            printf("\n");
30769        }
30770    }
30771    }
30772    }
30773    function_tests++;
30774#endif
30775
30776    return(test_ret);
30777}
30778
30779#ifdef LIBXML_READER_ENABLED
30780
30781#define gen_nb_xmlTextReaderErrorFunc_ptr 1
30782static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30783    return(NULL);
30784}
30785static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30786}
30787#endif
30788
30789
30790static int
30791test_xmlTextReaderGetErrorHandler(void) {
30792    int test_ret = 0;
30793
30794#if defined(LIBXML_READER_ENABLED)
30795    int mem_base;
30796    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30797    int n_reader;
30798    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30799    int n_f;
30800    void ** arg; /* a user argument */
30801    int n_arg;
30802
30803    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30804    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30805    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30806        mem_base = xmlMemBlocks();
30807        reader = gen_xmlTextReaderPtr(n_reader, 0);
30808        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30809        arg = gen_void_ptr_ptr(n_arg, 2);
30810
30811        xmlTextReaderGetErrorHandler(reader, f, arg);
30812        call_tests++;
30813        des_xmlTextReaderPtr(n_reader, reader, 0);
30814        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30815        des_void_ptr_ptr(n_arg, arg, 2);
30816        xmlResetLastError();
30817        if (mem_base != xmlMemBlocks()) {
30818            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30819	           xmlMemBlocks() - mem_base);
30820	    test_ret++;
30821            printf(" %d", n_reader);
30822            printf(" %d", n_f);
30823            printf(" %d", n_arg);
30824            printf("\n");
30825        }
30826    }
30827    }
30828    }
30829    function_tests++;
30830#endif
30831
30832    return(test_ret);
30833}
30834
30835
30836static int
30837test_xmlTextReaderGetParserColumnNumber(void) {
30838    int test_ret = 0;
30839
30840#if defined(LIBXML_READER_ENABLED)
30841    int mem_base;
30842    int ret_val;
30843    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30844    int n_reader;
30845
30846    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30847        mem_base = xmlMemBlocks();
30848        reader = gen_xmlTextReaderPtr(n_reader, 0);
30849
30850        ret_val = xmlTextReaderGetParserColumnNumber(reader);
30851        desret_int(ret_val);
30852        call_tests++;
30853        des_xmlTextReaderPtr(n_reader, reader, 0);
30854        xmlResetLastError();
30855        if (mem_base != xmlMemBlocks()) {
30856            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
30857	           xmlMemBlocks() - mem_base);
30858	    test_ret++;
30859            printf(" %d", n_reader);
30860            printf("\n");
30861        }
30862    }
30863    function_tests++;
30864#endif
30865
30866    return(test_ret);
30867}
30868
30869
30870static int
30871test_xmlTextReaderGetParserLineNumber(void) {
30872    int test_ret = 0;
30873
30874#if defined(LIBXML_READER_ENABLED)
30875    int mem_base;
30876    int ret_val;
30877    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30878    int n_reader;
30879
30880    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30881        mem_base = xmlMemBlocks();
30882        reader = gen_xmlTextReaderPtr(n_reader, 0);
30883
30884        ret_val = xmlTextReaderGetParserLineNumber(reader);
30885        desret_int(ret_val);
30886        call_tests++;
30887        des_xmlTextReaderPtr(n_reader, reader, 0);
30888        xmlResetLastError();
30889        if (mem_base != xmlMemBlocks()) {
30890            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
30891	           xmlMemBlocks() - mem_base);
30892	    test_ret++;
30893            printf(" %d", n_reader);
30894            printf("\n");
30895        }
30896    }
30897    function_tests++;
30898#endif
30899
30900    return(test_ret);
30901}
30902
30903
30904static int
30905test_xmlTextReaderGetParserProp(void) {
30906    int test_ret = 0;
30907
30908#if defined(LIBXML_READER_ENABLED)
30909    int mem_base;
30910    int ret_val;
30911    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30912    int n_reader;
30913    int prop; /* the xmlParserProperties to get */
30914    int n_prop;
30915
30916    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30917    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30918        mem_base = xmlMemBlocks();
30919        reader = gen_xmlTextReaderPtr(n_reader, 0);
30920        prop = gen_int(n_prop, 1);
30921
30922        ret_val = xmlTextReaderGetParserProp(reader, prop);
30923        desret_int(ret_val);
30924        call_tests++;
30925        des_xmlTextReaderPtr(n_reader, reader, 0);
30926        des_int(n_prop, prop, 1);
30927        xmlResetLastError();
30928        if (mem_base != xmlMemBlocks()) {
30929            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
30930	           xmlMemBlocks() - mem_base);
30931	    test_ret++;
30932            printf(" %d", n_reader);
30933            printf(" %d", n_prop);
30934            printf("\n");
30935        }
30936    }
30937    }
30938    function_tests++;
30939#endif
30940
30941    return(test_ret);
30942}
30943
30944
30945static int
30946test_xmlTextReaderGetRemainder(void) {
30947    int test_ret = 0;
30948
30949#if defined(LIBXML_READER_ENABLED)
30950    int mem_base;
30951    xmlParserInputBufferPtr ret_val;
30952    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30953    int n_reader;
30954
30955    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30956        mem_base = xmlMemBlocks();
30957        reader = gen_xmlTextReaderPtr(n_reader, 0);
30958
30959        ret_val = xmlTextReaderGetRemainder(reader);
30960        desret_xmlParserInputBufferPtr(ret_val);
30961        call_tests++;
30962        des_xmlTextReaderPtr(n_reader, reader, 0);
30963        xmlResetLastError();
30964        if (mem_base != xmlMemBlocks()) {
30965            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30966	           xmlMemBlocks() - mem_base);
30967	    test_ret++;
30968            printf(" %d", n_reader);
30969            printf("\n");
30970        }
30971    }
30972    function_tests++;
30973#endif
30974
30975    return(test_ret);
30976}
30977
30978
30979static int
30980test_xmlTextReaderHasAttributes(void) {
30981    int test_ret = 0;
30982
30983#if defined(LIBXML_READER_ENABLED)
30984    int mem_base;
30985    int ret_val;
30986    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30987    int n_reader;
30988
30989    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30990        mem_base = xmlMemBlocks();
30991        reader = gen_xmlTextReaderPtr(n_reader, 0);
30992
30993        ret_val = xmlTextReaderHasAttributes(reader);
30994        desret_int(ret_val);
30995        call_tests++;
30996        des_xmlTextReaderPtr(n_reader, reader, 0);
30997        xmlResetLastError();
30998        if (mem_base != xmlMemBlocks()) {
30999            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31000	           xmlMemBlocks() - mem_base);
31001	    test_ret++;
31002            printf(" %d", n_reader);
31003            printf("\n");
31004        }
31005    }
31006    function_tests++;
31007#endif
31008
31009    return(test_ret);
31010}
31011
31012
31013static int
31014test_xmlTextReaderHasValue(void) {
31015    int test_ret = 0;
31016
31017#if defined(LIBXML_READER_ENABLED)
31018    int mem_base;
31019    int ret_val;
31020    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31021    int n_reader;
31022
31023    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31024        mem_base = xmlMemBlocks();
31025        reader = gen_xmlTextReaderPtr(n_reader, 0);
31026
31027        ret_val = xmlTextReaderHasValue(reader);
31028        desret_int(ret_val);
31029        call_tests++;
31030        des_xmlTextReaderPtr(n_reader, reader, 0);
31031        xmlResetLastError();
31032        if (mem_base != xmlMemBlocks()) {
31033            printf("Leak of %d blocks found in xmlTextReaderHasValue",
31034	           xmlMemBlocks() - mem_base);
31035	    test_ret++;
31036            printf(" %d", n_reader);
31037            printf("\n");
31038        }
31039    }
31040    function_tests++;
31041#endif
31042
31043    return(test_ret);
31044}
31045
31046
31047static int
31048test_xmlTextReaderIsDefault(void) {
31049    int test_ret = 0;
31050
31051#if defined(LIBXML_READER_ENABLED)
31052    int mem_base;
31053    int ret_val;
31054    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31055    int n_reader;
31056
31057    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31058        mem_base = xmlMemBlocks();
31059        reader = gen_xmlTextReaderPtr(n_reader, 0);
31060
31061        ret_val = xmlTextReaderIsDefault(reader);
31062        desret_int(ret_val);
31063        call_tests++;
31064        des_xmlTextReaderPtr(n_reader, reader, 0);
31065        xmlResetLastError();
31066        if (mem_base != xmlMemBlocks()) {
31067            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31068	           xmlMemBlocks() - mem_base);
31069	    test_ret++;
31070            printf(" %d", n_reader);
31071            printf("\n");
31072        }
31073    }
31074    function_tests++;
31075#endif
31076
31077    return(test_ret);
31078}
31079
31080
31081static int
31082test_xmlTextReaderIsEmptyElement(void) {
31083    int test_ret = 0;
31084
31085#if defined(LIBXML_READER_ENABLED)
31086    int mem_base;
31087    int ret_val;
31088    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31089    int n_reader;
31090
31091    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31092        mem_base = xmlMemBlocks();
31093        reader = gen_xmlTextReaderPtr(n_reader, 0);
31094
31095        ret_val = xmlTextReaderIsEmptyElement(reader);
31096        desret_int(ret_val);
31097        call_tests++;
31098        des_xmlTextReaderPtr(n_reader, reader, 0);
31099        xmlResetLastError();
31100        if (mem_base != xmlMemBlocks()) {
31101            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31102	           xmlMemBlocks() - mem_base);
31103	    test_ret++;
31104            printf(" %d", n_reader);
31105            printf("\n");
31106        }
31107    }
31108    function_tests++;
31109#endif
31110
31111    return(test_ret);
31112}
31113
31114
31115static int
31116test_xmlTextReaderIsNamespaceDecl(void) {
31117    int test_ret = 0;
31118
31119#if defined(LIBXML_READER_ENABLED)
31120    int mem_base;
31121    int ret_val;
31122    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31123    int n_reader;
31124
31125    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31126        mem_base = xmlMemBlocks();
31127        reader = gen_xmlTextReaderPtr(n_reader, 0);
31128
31129        ret_val = xmlTextReaderIsNamespaceDecl(reader);
31130        desret_int(ret_val);
31131        call_tests++;
31132        des_xmlTextReaderPtr(n_reader, reader, 0);
31133        xmlResetLastError();
31134        if (mem_base != xmlMemBlocks()) {
31135            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31136	           xmlMemBlocks() - mem_base);
31137	    test_ret++;
31138            printf(" %d", n_reader);
31139            printf("\n");
31140        }
31141    }
31142    function_tests++;
31143#endif
31144
31145    return(test_ret);
31146}
31147
31148
31149static int
31150test_xmlTextReaderIsValid(void) {
31151    int test_ret = 0;
31152
31153#if defined(LIBXML_READER_ENABLED)
31154    int mem_base;
31155    int ret_val;
31156    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31157    int n_reader;
31158
31159    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31160        mem_base = xmlMemBlocks();
31161        reader = gen_xmlTextReaderPtr(n_reader, 0);
31162
31163        ret_val = xmlTextReaderIsValid(reader);
31164        desret_int(ret_val);
31165        call_tests++;
31166        des_xmlTextReaderPtr(n_reader, reader, 0);
31167        xmlResetLastError();
31168        if (mem_base != xmlMemBlocks()) {
31169            printf("Leak of %d blocks found in xmlTextReaderIsValid",
31170	           xmlMemBlocks() - mem_base);
31171	    test_ret++;
31172            printf(" %d", n_reader);
31173            printf("\n");
31174        }
31175    }
31176    function_tests++;
31177#endif
31178
31179    return(test_ret);
31180}
31181
31182
31183static int
31184test_xmlTextReaderLocalName(void) {
31185    int test_ret = 0;
31186
31187#if defined(LIBXML_READER_ENABLED)
31188    int mem_base;
31189    xmlChar * ret_val;
31190    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31191    int n_reader;
31192
31193    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31194        mem_base = xmlMemBlocks();
31195        reader = gen_xmlTextReaderPtr(n_reader, 0);
31196
31197        ret_val = xmlTextReaderLocalName(reader);
31198        desret_xmlChar_ptr(ret_val);
31199        call_tests++;
31200        des_xmlTextReaderPtr(n_reader, reader, 0);
31201        xmlResetLastError();
31202        if (mem_base != xmlMemBlocks()) {
31203            printf("Leak of %d blocks found in xmlTextReaderLocalName",
31204	           xmlMemBlocks() - mem_base);
31205	    test_ret++;
31206            printf(" %d", n_reader);
31207            printf("\n");
31208        }
31209    }
31210    function_tests++;
31211#endif
31212
31213    return(test_ret);
31214}
31215
31216#ifdef LIBXML_READER_ENABLED
31217
31218#define gen_nb_xmlTextReaderLocatorPtr 1
31219static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31220    return(NULL);
31221}
31222static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31223}
31224#endif
31225
31226
31227static int
31228test_xmlTextReaderLocatorBaseURI(void) {
31229    int test_ret = 0;
31230
31231#if defined(LIBXML_READER_ENABLED)
31232    int mem_base;
31233    xmlChar * ret_val;
31234    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31235    int n_locator;
31236
31237    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31238        mem_base = xmlMemBlocks();
31239        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31240
31241        ret_val = xmlTextReaderLocatorBaseURI(locator);
31242        desret_xmlChar_ptr(ret_val);
31243        call_tests++;
31244        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31245        xmlResetLastError();
31246        if (mem_base != xmlMemBlocks()) {
31247            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31248	           xmlMemBlocks() - mem_base);
31249	    test_ret++;
31250            printf(" %d", n_locator);
31251            printf("\n");
31252        }
31253    }
31254    function_tests++;
31255#endif
31256
31257    return(test_ret);
31258}
31259
31260
31261static int
31262test_xmlTextReaderLocatorLineNumber(void) {
31263    int test_ret = 0;
31264
31265#if defined(LIBXML_READER_ENABLED)
31266    int mem_base;
31267    int ret_val;
31268    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31269    int n_locator;
31270
31271    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31272        mem_base = xmlMemBlocks();
31273        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31274
31275        ret_val = xmlTextReaderLocatorLineNumber(locator);
31276        desret_int(ret_val);
31277        call_tests++;
31278        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31279        xmlResetLastError();
31280        if (mem_base != xmlMemBlocks()) {
31281            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31282	           xmlMemBlocks() - mem_base);
31283	    test_ret++;
31284            printf(" %d", n_locator);
31285            printf("\n");
31286        }
31287    }
31288    function_tests++;
31289#endif
31290
31291    return(test_ret);
31292}
31293
31294
31295static int
31296test_xmlTextReaderLookupNamespace(void) {
31297    int test_ret = 0;
31298
31299#if defined(LIBXML_READER_ENABLED)
31300    int mem_base;
31301    xmlChar * ret_val;
31302    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31303    int n_reader;
31304    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31305    int n_prefix;
31306
31307    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31308    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31309        mem_base = xmlMemBlocks();
31310        reader = gen_xmlTextReaderPtr(n_reader, 0);
31311        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31312
31313        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31314        desret_xmlChar_ptr(ret_val);
31315        call_tests++;
31316        des_xmlTextReaderPtr(n_reader, reader, 0);
31317        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31318        xmlResetLastError();
31319        if (mem_base != xmlMemBlocks()) {
31320            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31321	           xmlMemBlocks() - mem_base);
31322	    test_ret++;
31323            printf(" %d", n_reader);
31324            printf(" %d", n_prefix);
31325            printf("\n");
31326        }
31327    }
31328    }
31329    function_tests++;
31330#endif
31331
31332    return(test_ret);
31333}
31334
31335
31336static int
31337test_xmlTextReaderMoveToAttribute(void) {
31338    int test_ret = 0;
31339
31340#if defined(LIBXML_READER_ENABLED)
31341    int mem_base;
31342    int ret_val;
31343    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31344    int n_reader;
31345    xmlChar * name; /* the qualified name of the attribute. */
31346    int n_name;
31347
31348    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31349    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31350        mem_base = xmlMemBlocks();
31351        reader = gen_xmlTextReaderPtr(n_reader, 0);
31352        name = gen_const_xmlChar_ptr(n_name, 1);
31353
31354        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31355        desret_int(ret_val);
31356        call_tests++;
31357        des_xmlTextReaderPtr(n_reader, reader, 0);
31358        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31359        xmlResetLastError();
31360        if (mem_base != xmlMemBlocks()) {
31361            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31362	           xmlMemBlocks() - mem_base);
31363	    test_ret++;
31364            printf(" %d", n_reader);
31365            printf(" %d", n_name);
31366            printf("\n");
31367        }
31368    }
31369    }
31370    function_tests++;
31371#endif
31372
31373    return(test_ret);
31374}
31375
31376
31377static int
31378test_xmlTextReaderMoveToAttributeNo(void) {
31379    int test_ret = 0;
31380
31381#if defined(LIBXML_READER_ENABLED)
31382    int mem_base;
31383    int ret_val;
31384    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31385    int n_reader;
31386    int no; /* the zero-based index of the attribute relative to the containing element. */
31387    int n_no;
31388
31389    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31390    for (n_no = 0;n_no < gen_nb_int;n_no++) {
31391        mem_base = xmlMemBlocks();
31392        reader = gen_xmlTextReaderPtr(n_reader, 0);
31393        no = gen_int(n_no, 1);
31394
31395        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31396        desret_int(ret_val);
31397        call_tests++;
31398        des_xmlTextReaderPtr(n_reader, reader, 0);
31399        des_int(n_no, no, 1);
31400        xmlResetLastError();
31401        if (mem_base != xmlMemBlocks()) {
31402            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31403	           xmlMemBlocks() - mem_base);
31404	    test_ret++;
31405            printf(" %d", n_reader);
31406            printf(" %d", n_no);
31407            printf("\n");
31408        }
31409    }
31410    }
31411    function_tests++;
31412#endif
31413
31414    return(test_ret);
31415}
31416
31417
31418static int
31419test_xmlTextReaderMoveToAttributeNs(void) {
31420    int test_ret = 0;
31421
31422#if defined(LIBXML_READER_ENABLED)
31423    int mem_base;
31424    int ret_val;
31425    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31426    int n_reader;
31427    xmlChar * localName; /* the local name of the attribute. */
31428    int n_localName;
31429    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31430    int n_namespaceURI;
31431
31432    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31433    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31434    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31435        mem_base = xmlMemBlocks();
31436        reader = gen_xmlTextReaderPtr(n_reader, 0);
31437        localName = gen_const_xmlChar_ptr(n_localName, 1);
31438        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31439
31440        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31441        desret_int(ret_val);
31442        call_tests++;
31443        des_xmlTextReaderPtr(n_reader, reader, 0);
31444        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31445        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31446        xmlResetLastError();
31447        if (mem_base != xmlMemBlocks()) {
31448            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31449	           xmlMemBlocks() - mem_base);
31450	    test_ret++;
31451            printf(" %d", n_reader);
31452            printf(" %d", n_localName);
31453            printf(" %d", n_namespaceURI);
31454            printf("\n");
31455        }
31456    }
31457    }
31458    }
31459    function_tests++;
31460#endif
31461
31462    return(test_ret);
31463}
31464
31465
31466static int
31467test_xmlTextReaderMoveToElement(void) {
31468    int test_ret = 0;
31469
31470#if defined(LIBXML_READER_ENABLED)
31471    int mem_base;
31472    int ret_val;
31473    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31474    int n_reader;
31475
31476    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31477        mem_base = xmlMemBlocks();
31478        reader = gen_xmlTextReaderPtr(n_reader, 0);
31479
31480        ret_val = xmlTextReaderMoveToElement(reader);
31481        desret_int(ret_val);
31482        call_tests++;
31483        des_xmlTextReaderPtr(n_reader, reader, 0);
31484        xmlResetLastError();
31485        if (mem_base != xmlMemBlocks()) {
31486            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31487	           xmlMemBlocks() - mem_base);
31488	    test_ret++;
31489            printf(" %d", n_reader);
31490            printf("\n");
31491        }
31492    }
31493    function_tests++;
31494#endif
31495
31496    return(test_ret);
31497}
31498
31499
31500static int
31501test_xmlTextReaderMoveToFirstAttribute(void) {
31502    int test_ret = 0;
31503
31504#if defined(LIBXML_READER_ENABLED)
31505    int mem_base;
31506    int ret_val;
31507    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31508    int n_reader;
31509
31510    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31511        mem_base = xmlMemBlocks();
31512        reader = gen_xmlTextReaderPtr(n_reader, 0);
31513
31514        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31515        desret_int(ret_val);
31516        call_tests++;
31517        des_xmlTextReaderPtr(n_reader, reader, 0);
31518        xmlResetLastError();
31519        if (mem_base != xmlMemBlocks()) {
31520            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31521	           xmlMemBlocks() - mem_base);
31522	    test_ret++;
31523            printf(" %d", n_reader);
31524            printf("\n");
31525        }
31526    }
31527    function_tests++;
31528#endif
31529
31530    return(test_ret);
31531}
31532
31533
31534static int
31535test_xmlTextReaderMoveToNextAttribute(void) {
31536    int test_ret = 0;
31537
31538#if defined(LIBXML_READER_ENABLED)
31539    int mem_base;
31540    int ret_val;
31541    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31542    int n_reader;
31543
31544    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31545        mem_base = xmlMemBlocks();
31546        reader = gen_xmlTextReaderPtr(n_reader, 0);
31547
31548        ret_val = xmlTextReaderMoveToNextAttribute(reader);
31549        desret_int(ret_val);
31550        call_tests++;
31551        des_xmlTextReaderPtr(n_reader, reader, 0);
31552        xmlResetLastError();
31553        if (mem_base != xmlMemBlocks()) {
31554            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31555	           xmlMemBlocks() - mem_base);
31556	    test_ret++;
31557            printf(" %d", n_reader);
31558            printf("\n");
31559        }
31560    }
31561    function_tests++;
31562#endif
31563
31564    return(test_ret);
31565}
31566
31567
31568static int
31569test_xmlTextReaderName(void) {
31570    int test_ret = 0;
31571
31572#if defined(LIBXML_READER_ENABLED)
31573    int mem_base;
31574    xmlChar * ret_val;
31575    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31576    int n_reader;
31577
31578    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31579        mem_base = xmlMemBlocks();
31580        reader = gen_xmlTextReaderPtr(n_reader, 0);
31581
31582        ret_val = xmlTextReaderName(reader);
31583        desret_xmlChar_ptr(ret_val);
31584        call_tests++;
31585        des_xmlTextReaderPtr(n_reader, reader, 0);
31586        xmlResetLastError();
31587        if (mem_base != xmlMemBlocks()) {
31588            printf("Leak of %d blocks found in xmlTextReaderName",
31589	           xmlMemBlocks() - mem_base);
31590	    test_ret++;
31591            printf(" %d", n_reader);
31592            printf("\n");
31593        }
31594    }
31595    function_tests++;
31596#endif
31597
31598    return(test_ret);
31599}
31600
31601
31602static int
31603test_xmlTextReaderNamespaceUri(void) {
31604    int test_ret = 0;
31605
31606#if defined(LIBXML_READER_ENABLED)
31607    int mem_base;
31608    xmlChar * ret_val;
31609    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31610    int n_reader;
31611
31612    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31613        mem_base = xmlMemBlocks();
31614        reader = gen_xmlTextReaderPtr(n_reader, 0);
31615
31616        ret_val = xmlTextReaderNamespaceUri(reader);
31617        desret_xmlChar_ptr(ret_val);
31618        call_tests++;
31619        des_xmlTextReaderPtr(n_reader, reader, 0);
31620        xmlResetLastError();
31621        if (mem_base != xmlMemBlocks()) {
31622            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31623	           xmlMemBlocks() - mem_base);
31624	    test_ret++;
31625            printf(" %d", n_reader);
31626            printf("\n");
31627        }
31628    }
31629    function_tests++;
31630#endif
31631
31632    return(test_ret);
31633}
31634
31635
31636static int
31637test_xmlTextReaderNext(void) {
31638    int test_ret = 0;
31639
31640#if defined(LIBXML_READER_ENABLED)
31641    int mem_base;
31642    int ret_val;
31643    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31644    int n_reader;
31645
31646    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31647        mem_base = xmlMemBlocks();
31648        reader = gen_xmlTextReaderPtr(n_reader, 0);
31649
31650        ret_val = xmlTextReaderNext(reader);
31651        desret_int(ret_val);
31652        call_tests++;
31653        des_xmlTextReaderPtr(n_reader, reader, 0);
31654        xmlResetLastError();
31655        if (mem_base != xmlMemBlocks()) {
31656            printf("Leak of %d blocks found in xmlTextReaderNext",
31657	           xmlMemBlocks() - mem_base);
31658	    test_ret++;
31659            printf(" %d", n_reader);
31660            printf("\n");
31661        }
31662    }
31663    function_tests++;
31664#endif
31665
31666    return(test_ret);
31667}
31668
31669
31670static int
31671test_xmlTextReaderNextSibling(void) {
31672    int test_ret = 0;
31673
31674#if defined(LIBXML_READER_ENABLED)
31675    int mem_base;
31676    int ret_val;
31677    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31678    int n_reader;
31679
31680    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31681        mem_base = xmlMemBlocks();
31682        reader = gen_xmlTextReaderPtr(n_reader, 0);
31683
31684        ret_val = xmlTextReaderNextSibling(reader);
31685        desret_int(ret_val);
31686        call_tests++;
31687        des_xmlTextReaderPtr(n_reader, reader, 0);
31688        xmlResetLastError();
31689        if (mem_base != xmlMemBlocks()) {
31690            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31691	           xmlMemBlocks() - mem_base);
31692	    test_ret++;
31693            printf(" %d", n_reader);
31694            printf("\n");
31695        }
31696    }
31697    function_tests++;
31698#endif
31699
31700    return(test_ret);
31701}
31702
31703
31704static int
31705test_xmlTextReaderNodeType(void) {
31706    int test_ret = 0;
31707
31708#if defined(LIBXML_READER_ENABLED)
31709    int mem_base;
31710    int ret_val;
31711    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31712    int n_reader;
31713
31714    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31715        mem_base = xmlMemBlocks();
31716        reader = gen_xmlTextReaderPtr(n_reader, 0);
31717
31718        ret_val = xmlTextReaderNodeType(reader);
31719        desret_int(ret_val);
31720        call_tests++;
31721        des_xmlTextReaderPtr(n_reader, reader, 0);
31722        xmlResetLastError();
31723        if (mem_base != xmlMemBlocks()) {
31724            printf("Leak of %d blocks found in xmlTextReaderNodeType",
31725	           xmlMemBlocks() - mem_base);
31726	    test_ret++;
31727            printf(" %d", n_reader);
31728            printf("\n");
31729        }
31730    }
31731    function_tests++;
31732#endif
31733
31734    return(test_ret);
31735}
31736
31737
31738static int
31739test_xmlTextReaderNormalization(void) {
31740    int test_ret = 0;
31741
31742#if defined(LIBXML_READER_ENABLED)
31743    int mem_base;
31744    int ret_val;
31745    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31746    int n_reader;
31747
31748    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31749        mem_base = xmlMemBlocks();
31750        reader = gen_xmlTextReaderPtr(n_reader, 0);
31751
31752        ret_val = xmlTextReaderNormalization(reader);
31753        desret_int(ret_val);
31754        call_tests++;
31755        des_xmlTextReaderPtr(n_reader, reader, 0);
31756        xmlResetLastError();
31757        if (mem_base != xmlMemBlocks()) {
31758            printf("Leak of %d blocks found in xmlTextReaderNormalization",
31759	           xmlMemBlocks() - mem_base);
31760	    test_ret++;
31761            printf(" %d", n_reader);
31762            printf("\n");
31763        }
31764    }
31765    function_tests++;
31766#endif
31767
31768    return(test_ret);
31769}
31770
31771
31772static int
31773test_xmlTextReaderPrefix(void) {
31774    int test_ret = 0;
31775
31776#if defined(LIBXML_READER_ENABLED)
31777    int mem_base;
31778    xmlChar * ret_val;
31779    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31780    int n_reader;
31781
31782    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31783        mem_base = xmlMemBlocks();
31784        reader = gen_xmlTextReaderPtr(n_reader, 0);
31785
31786        ret_val = xmlTextReaderPrefix(reader);
31787        desret_xmlChar_ptr(ret_val);
31788        call_tests++;
31789        des_xmlTextReaderPtr(n_reader, reader, 0);
31790        xmlResetLastError();
31791        if (mem_base != xmlMemBlocks()) {
31792            printf("Leak of %d blocks found in xmlTextReaderPrefix",
31793	           xmlMemBlocks() - mem_base);
31794	    test_ret++;
31795            printf(" %d", n_reader);
31796            printf("\n");
31797        }
31798    }
31799    function_tests++;
31800#endif
31801
31802    return(test_ret);
31803}
31804
31805
31806static int
31807test_xmlTextReaderPreserve(void) {
31808    int test_ret = 0;
31809
31810#if defined(LIBXML_READER_ENABLED)
31811    int mem_base;
31812    xmlNodePtr ret_val;
31813    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31814    int n_reader;
31815
31816    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31817        mem_base = xmlMemBlocks();
31818        reader = gen_xmlTextReaderPtr(n_reader, 0);
31819
31820        ret_val = xmlTextReaderPreserve(reader);
31821        desret_xmlNodePtr(ret_val);
31822        call_tests++;
31823        des_xmlTextReaderPtr(n_reader, reader, 0);
31824        xmlResetLastError();
31825        if (mem_base != xmlMemBlocks()) {
31826            printf("Leak of %d blocks found in xmlTextReaderPreserve",
31827	           xmlMemBlocks() - mem_base);
31828	    test_ret++;
31829            printf(" %d", n_reader);
31830            printf("\n");
31831        }
31832    }
31833    function_tests++;
31834#endif
31835
31836    return(test_ret);
31837}
31838
31839
31840static int
31841test_xmlTextReaderPreservePattern(void) {
31842    int test_ret = 0;
31843
31844#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
31845#ifdef LIBXML_PATTERN_ENABLED
31846    int mem_base;
31847    int ret_val;
31848    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31849    int n_reader;
31850    xmlChar * pattern; /* an XPath subset pattern */
31851    int n_pattern;
31852    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
31853    int n_namespaces;
31854
31855    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31856    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
31857    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
31858        mem_base = xmlMemBlocks();
31859        reader = gen_xmlTextReaderPtr(n_reader, 0);
31860        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
31861        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
31862
31863        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
31864        desret_int(ret_val);
31865        call_tests++;
31866        des_xmlTextReaderPtr(n_reader, reader, 0);
31867        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
31868        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
31869        xmlResetLastError();
31870        if (mem_base != xmlMemBlocks()) {
31871            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
31872	           xmlMemBlocks() - mem_base);
31873	    test_ret++;
31874            printf(" %d", n_reader);
31875            printf(" %d", n_pattern);
31876            printf(" %d", n_namespaces);
31877            printf("\n");
31878        }
31879    }
31880    }
31881    }
31882    function_tests++;
31883#endif
31884#endif
31885
31886    return(test_ret);
31887}
31888
31889
31890static int
31891test_xmlTextReaderQuoteChar(void) {
31892    int test_ret = 0;
31893
31894#if defined(LIBXML_READER_ENABLED)
31895    int mem_base;
31896    int ret_val;
31897    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31898    int n_reader;
31899
31900    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31901        mem_base = xmlMemBlocks();
31902        reader = gen_xmlTextReaderPtr(n_reader, 0);
31903
31904        ret_val = xmlTextReaderQuoteChar(reader);
31905        desret_int(ret_val);
31906        call_tests++;
31907        des_xmlTextReaderPtr(n_reader, reader, 0);
31908        xmlResetLastError();
31909        if (mem_base != xmlMemBlocks()) {
31910            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
31911	           xmlMemBlocks() - mem_base);
31912	    test_ret++;
31913            printf(" %d", n_reader);
31914            printf("\n");
31915        }
31916    }
31917    function_tests++;
31918#endif
31919
31920    return(test_ret);
31921}
31922
31923
31924static int
31925test_xmlTextReaderRead(void) {
31926    int test_ret = 0;
31927
31928#if defined(LIBXML_READER_ENABLED)
31929    int mem_base;
31930    int ret_val;
31931    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31932    int n_reader;
31933
31934    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31935        mem_base = xmlMemBlocks();
31936        reader = gen_xmlTextReaderPtr(n_reader, 0);
31937
31938        ret_val = xmlTextReaderRead(reader);
31939        desret_int(ret_val);
31940        call_tests++;
31941        des_xmlTextReaderPtr(n_reader, reader, 0);
31942        xmlResetLastError();
31943        if (mem_base != xmlMemBlocks()) {
31944            printf("Leak of %d blocks found in xmlTextReaderRead",
31945	           xmlMemBlocks() - mem_base);
31946	    test_ret++;
31947            printf(" %d", n_reader);
31948            printf("\n");
31949        }
31950    }
31951    function_tests++;
31952#endif
31953
31954    return(test_ret);
31955}
31956
31957
31958static int
31959test_xmlTextReaderReadAttributeValue(void) {
31960    int test_ret = 0;
31961
31962#if defined(LIBXML_READER_ENABLED)
31963    int mem_base;
31964    int ret_val;
31965    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31966    int n_reader;
31967
31968    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31969        mem_base = xmlMemBlocks();
31970        reader = gen_xmlTextReaderPtr(n_reader, 0);
31971
31972        ret_val = xmlTextReaderReadAttributeValue(reader);
31973        desret_int(ret_val);
31974        call_tests++;
31975        des_xmlTextReaderPtr(n_reader, reader, 0);
31976        xmlResetLastError();
31977        if (mem_base != xmlMemBlocks()) {
31978            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31979	           xmlMemBlocks() - mem_base);
31980	    test_ret++;
31981            printf(" %d", n_reader);
31982            printf("\n");
31983        }
31984    }
31985    function_tests++;
31986#endif
31987
31988    return(test_ret);
31989}
31990
31991
31992static int
31993test_xmlTextReaderReadState(void) {
31994    int test_ret = 0;
31995
31996#if defined(LIBXML_READER_ENABLED)
31997    int mem_base;
31998    int ret_val;
31999    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32000    int n_reader;
32001
32002    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32003        mem_base = xmlMemBlocks();
32004        reader = gen_xmlTextReaderPtr(n_reader, 0);
32005
32006        ret_val = xmlTextReaderReadState(reader);
32007        desret_int(ret_val);
32008        call_tests++;
32009        des_xmlTextReaderPtr(n_reader, reader, 0);
32010        xmlResetLastError();
32011        if (mem_base != xmlMemBlocks()) {
32012            printf("Leak of %d blocks found in xmlTextReaderReadState",
32013	           xmlMemBlocks() - mem_base);
32014	    test_ret++;
32015            printf(" %d", n_reader);
32016            printf("\n");
32017        }
32018    }
32019    function_tests++;
32020#endif
32021
32022    return(test_ret);
32023}
32024
32025
32026static int
32027test_xmlTextReaderRelaxNGSetSchema(void) {
32028    int test_ret = 0;
32029
32030#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32031    int mem_base;
32032    int ret_val;
32033    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32034    int n_reader;
32035    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32036    int n_schema;
32037
32038    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32039    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32040        mem_base = xmlMemBlocks();
32041        reader = gen_xmlTextReaderPtr(n_reader, 0);
32042        schema = gen_xmlRelaxNGPtr(n_schema, 1);
32043
32044        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32045        desret_int(ret_val);
32046        call_tests++;
32047        des_xmlTextReaderPtr(n_reader, reader, 0);
32048        des_xmlRelaxNGPtr(n_schema, schema, 1);
32049        xmlResetLastError();
32050        if (mem_base != xmlMemBlocks()) {
32051            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32052	           xmlMemBlocks() - mem_base);
32053	    test_ret++;
32054            printf(" %d", n_reader);
32055            printf(" %d", n_schema);
32056            printf("\n");
32057        }
32058    }
32059    }
32060    function_tests++;
32061#endif
32062
32063    return(test_ret);
32064}
32065
32066
32067static int
32068test_xmlTextReaderRelaxNGValidate(void) {
32069    int test_ret = 0;
32070
32071#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32072    int mem_base;
32073    int ret_val;
32074    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32075    int n_reader;
32076    char * rng; /* the path to a RelaxNG schema or NULL */
32077    int n_rng;
32078
32079    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32080    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32081        mem_base = xmlMemBlocks();
32082        reader = gen_xmlTextReaderPtr(n_reader, 0);
32083        rng = gen_const_char_ptr(n_rng, 1);
32084
32085        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32086        desret_int(ret_val);
32087        call_tests++;
32088        des_xmlTextReaderPtr(n_reader, reader, 0);
32089        des_const_char_ptr(n_rng, (const char *)rng, 1);
32090        xmlResetLastError();
32091        if (mem_base != xmlMemBlocks()) {
32092            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32093	           xmlMemBlocks() - mem_base);
32094	    test_ret++;
32095            printf(" %d", n_reader);
32096            printf(" %d", n_rng);
32097            printf("\n");
32098        }
32099    }
32100    }
32101    function_tests++;
32102#endif
32103
32104    return(test_ret);
32105}
32106
32107
32108static int
32109test_xmlTextReaderSchemaValidate(void) {
32110    int test_ret = 0;
32111
32112#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32113    int ret_val;
32114    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32115    int n_reader;
32116    char * xsd; /* the path to a W3C XSD schema or NULL */
32117    int n_xsd;
32118
32119    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32120    for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32121        reader = gen_xmlTextReaderPtr(n_reader, 0);
32122        xsd = gen_const_char_ptr(n_xsd, 1);
32123
32124        ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32125        desret_int(ret_val);
32126        call_tests++;
32127        des_xmlTextReaderPtr(n_reader, reader, 0);
32128        des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32129        xmlResetLastError();
32130    }
32131    }
32132    function_tests++;
32133#endif
32134
32135    return(test_ret);
32136}
32137
32138
32139static int
32140test_xmlTextReaderSchemaValidateCtxt(void) {
32141    int test_ret = 0;
32142
32143#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32144    int mem_base;
32145    int ret_val;
32146    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32147    int n_reader;
32148    xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32149    int n_ctxt;
32150    int options; /* options (not used yet) */
32151    int n_options;
32152
32153    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32154    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32155    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32156        mem_base = xmlMemBlocks();
32157        reader = gen_xmlTextReaderPtr(n_reader, 0);
32158        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32159        options = gen_parseroptions(n_options, 2);
32160
32161        ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32162        desret_int(ret_val);
32163        call_tests++;
32164        des_xmlTextReaderPtr(n_reader, reader, 0);
32165        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32166        des_parseroptions(n_options, options, 2);
32167        xmlResetLastError();
32168        if (mem_base != xmlMemBlocks()) {
32169            printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32170	           xmlMemBlocks() - mem_base);
32171	    test_ret++;
32172            printf(" %d", n_reader);
32173            printf(" %d", n_ctxt);
32174            printf(" %d", n_options);
32175            printf("\n");
32176        }
32177    }
32178    }
32179    }
32180    function_tests++;
32181#endif
32182
32183    return(test_ret);
32184}
32185
32186
32187static int
32188test_xmlTextReaderSetErrorHandler(void) {
32189    int test_ret = 0;
32190
32191
32192    /* missing type support */
32193    return(test_ret);
32194}
32195
32196
32197static int
32198test_xmlTextReaderSetParserProp(void) {
32199    int test_ret = 0;
32200
32201#if defined(LIBXML_READER_ENABLED)
32202    int mem_base;
32203    int ret_val;
32204    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32205    int n_reader;
32206    int prop; /* the xmlParserProperties to set */
32207    int n_prop;
32208    int value; /* usually 0 or 1 to (de)activate it */
32209    int n_value;
32210
32211    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32212    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32213    for (n_value = 0;n_value < gen_nb_int;n_value++) {
32214        mem_base = xmlMemBlocks();
32215        reader = gen_xmlTextReaderPtr(n_reader, 0);
32216        prop = gen_int(n_prop, 1);
32217        value = gen_int(n_value, 2);
32218
32219        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32220        desret_int(ret_val);
32221        call_tests++;
32222        des_xmlTextReaderPtr(n_reader, reader, 0);
32223        des_int(n_prop, prop, 1);
32224        des_int(n_value, value, 2);
32225        xmlResetLastError();
32226        if (mem_base != xmlMemBlocks()) {
32227            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32228	           xmlMemBlocks() - mem_base);
32229	    test_ret++;
32230            printf(" %d", n_reader);
32231            printf(" %d", n_prop);
32232            printf(" %d", n_value);
32233            printf("\n");
32234        }
32235    }
32236    }
32237    }
32238    function_tests++;
32239#endif
32240
32241    return(test_ret);
32242}
32243
32244
32245static int
32246test_xmlTextReaderSetSchema(void) {
32247    int test_ret = 0;
32248
32249#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32250    int mem_base;
32251    int ret_val;
32252    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32253    int n_reader;
32254    xmlSchemaPtr schema; /* a precompiled Schema schema */
32255    int n_schema;
32256
32257    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32258    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32259        mem_base = xmlMemBlocks();
32260        reader = gen_xmlTextReaderPtr(n_reader, 0);
32261        schema = gen_xmlSchemaPtr(n_schema, 1);
32262
32263        ret_val = xmlTextReaderSetSchema(reader, schema);
32264        desret_int(ret_val);
32265        call_tests++;
32266        des_xmlTextReaderPtr(n_reader, reader, 0);
32267        des_xmlSchemaPtr(n_schema, schema, 1);
32268        xmlResetLastError();
32269        if (mem_base != xmlMemBlocks()) {
32270            printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32271	           xmlMemBlocks() - mem_base);
32272	    test_ret++;
32273            printf(" %d", n_reader);
32274            printf(" %d", n_schema);
32275            printf("\n");
32276        }
32277    }
32278    }
32279    function_tests++;
32280#endif
32281
32282    return(test_ret);
32283}
32284
32285
32286static int
32287test_xmlTextReaderSetStructuredErrorHandler(void) {
32288    int test_ret = 0;
32289
32290
32291    /* missing type support */
32292    return(test_ret);
32293}
32294
32295
32296static int
32297test_xmlTextReaderSetup(void) {
32298    int test_ret = 0;
32299
32300#if defined(LIBXML_READER_ENABLED)
32301    int mem_base;
32302    int ret_val;
32303    xmlTextReaderPtr reader; /* an XML reader */
32304    int n_reader;
32305    xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32306    int n_input;
32307    const char * URL; /* the base URL to use for the document */
32308    int n_URL;
32309    char * encoding; /* the document encoding, or NULL */
32310    int n_encoding;
32311    int options; /* a combination of xmlParserOption */
32312    int n_options;
32313
32314    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32315    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32316    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32317    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32318    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32319        mem_base = xmlMemBlocks();
32320        reader = gen_xmlTextReaderPtr(n_reader, 0);
32321        input = gen_xmlParserInputBufferPtr(n_input, 1);
32322        URL = gen_filepath(n_URL, 2);
32323        encoding = gen_const_char_ptr(n_encoding, 3);
32324        options = gen_parseroptions(n_options, 4);
32325
32326        ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32327        desret_int(ret_val);
32328        call_tests++;
32329        des_xmlTextReaderPtr(n_reader, reader, 0);
32330        des_filepath(n_URL, URL, 2);
32331        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32332        des_parseroptions(n_options, options, 4);
32333        xmlResetLastError();
32334        if (mem_base != xmlMemBlocks()) {
32335            printf("Leak of %d blocks found in xmlTextReaderSetup",
32336	           xmlMemBlocks() - mem_base);
32337	    test_ret++;
32338            printf(" %d", n_reader);
32339            printf(" %d", n_input);
32340            printf(" %d", n_URL);
32341            printf(" %d", n_encoding);
32342            printf(" %d", n_options);
32343            printf("\n");
32344        }
32345    }
32346    }
32347    }
32348    }
32349    }
32350    function_tests++;
32351#endif
32352
32353    return(test_ret);
32354}
32355
32356
32357static int
32358test_xmlTextReaderStandalone(void) {
32359    int test_ret = 0;
32360
32361#if defined(LIBXML_READER_ENABLED)
32362    int mem_base;
32363    int ret_val;
32364    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32365    int n_reader;
32366
32367    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32368        mem_base = xmlMemBlocks();
32369        reader = gen_xmlTextReaderPtr(n_reader, 0);
32370
32371        ret_val = xmlTextReaderStandalone(reader);
32372        desret_int(ret_val);
32373        call_tests++;
32374        des_xmlTextReaderPtr(n_reader, reader, 0);
32375        xmlResetLastError();
32376        if (mem_base != xmlMemBlocks()) {
32377            printf("Leak of %d blocks found in xmlTextReaderStandalone",
32378	           xmlMemBlocks() - mem_base);
32379	    test_ret++;
32380            printf(" %d", n_reader);
32381            printf("\n");
32382        }
32383    }
32384    function_tests++;
32385#endif
32386
32387    return(test_ret);
32388}
32389
32390
32391static int
32392test_xmlTextReaderValue(void) {
32393    int test_ret = 0;
32394
32395#if defined(LIBXML_READER_ENABLED)
32396    int mem_base;
32397    xmlChar * ret_val;
32398    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32399    int n_reader;
32400
32401    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32402        mem_base = xmlMemBlocks();
32403        reader = gen_xmlTextReaderPtr(n_reader, 0);
32404
32405        ret_val = xmlTextReaderValue(reader);
32406        desret_xmlChar_ptr(ret_val);
32407        call_tests++;
32408        des_xmlTextReaderPtr(n_reader, reader, 0);
32409        xmlResetLastError();
32410        if (mem_base != xmlMemBlocks()) {
32411            printf("Leak of %d blocks found in xmlTextReaderValue",
32412	           xmlMemBlocks() - mem_base);
32413	    test_ret++;
32414            printf(" %d", n_reader);
32415            printf("\n");
32416        }
32417    }
32418    function_tests++;
32419#endif
32420
32421    return(test_ret);
32422}
32423
32424
32425static int
32426test_xmlTextReaderXmlLang(void) {
32427    int test_ret = 0;
32428
32429#if defined(LIBXML_READER_ENABLED)
32430    int mem_base;
32431    xmlChar * ret_val;
32432    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32433    int n_reader;
32434
32435    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32436        mem_base = xmlMemBlocks();
32437        reader = gen_xmlTextReaderPtr(n_reader, 0);
32438
32439        ret_val = xmlTextReaderXmlLang(reader);
32440        desret_xmlChar_ptr(ret_val);
32441        call_tests++;
32442        des_xmlTextReaderPtr(n_reader, reader, 0);
32443        xmlResetLastError();
32444        if (mem_base != xmlMemBlocks()) {
32445            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32446	           xmlMemBlocks() - mem_base);
32447	    test_ret++;
32448            printf(" %d", n_reader);
32449            printf("\n");
32450        }
32451    }
32452    function_tests++;
32453#endif
32454
32455    return(test_ret);
32456}
32457
32458static int
32459test_xmlreader(void) {
32460    int test_ret = 0;
32461
32462    if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n");
32463    test_ret += test_xmlNewTextReader();
32464    test_ret += test_xmlNewTextReaderFilename();
32465    test_ret += test_xmlReaderForDoc();
32466    test_ret += test_xmlReaderForFile();
32467    test_ret += test_xmlReaderForMemory();
32468    test_ret += test_xmlReaderNewDoc();
32469    test_ret += test_xmlReaderNewFile();
32470    test_ret += test_xmlReaderNewMemory();
32471    test_ret += test_xmlReaderNewWalker();
32472    test_ret += test_xmlReaderWalker();
32473    test_ret += test_xmlTextReaderAttributeCount();
32474    test_ret += test_xmlTextReaderBaseUri();
32475    test_ret += test_xmlTextReaderByteConsumed();
32476    test_ret += test_xmlTextReaderClose();
32477    test_ret += test_xmlTextReaderConstBaseUri();
32478    test_ret += test_xmlTextReaderConstEncoding();
32479    test_ret += test_xmlTextReaderConstLocalName();
32480    test_ret += test_xmlTextReaderConstName();
32481    test_ret += test_xmlTextReaderConstNamespaceUri();
32482    test_ret += test_xmlTextReaderConstPrefix();
32483    test_ret += test_xmlTextReaderConstString();
32484    test_ret += test_xmlTextReaderConstValue();
32485    test_ret += test_xmlTextReaderConstXmlLang();
32486    test_ret += test_xmlTextReaderConstXmlVersion();
32487    test_ret += test_xmlTextReaderCurrentDoc();
32488    test_ret += test_xmlTextReaderCurrentNode();
32489    test_ret += test_xmlTextReaderDepth();
32490    test_ret += test_xmlTextReaderExpand();
32491    test_ret += test_xmlTextReaderGetAttribute();
32492    test_ret += test_xmlTextReaderGetAttributeNo();
32493    test_ret += test_xmlTextReaderGetAttributeNs();
32494    test_ret += test_xmlTextReaderGetErrorHandler();
32495    test_ret += test_xmlTextReaderGetParserColumnNumber();
32496    test_ret += test_xmlTextReaderGetParserLineNumber();
32497    test_ret += test_xmlTextReaderGetParserProp();
32498    test_ret += test_xmlTextReaderGetRemainder();
32499    test_ret += test_xmlTextReaderHasAttributes();
32500    test_ret += test_xmlTextReaderHasValue();
32501    test_ret += test_xmlTextReaderIsDefault();
32502    test_ret += test_xmlTextReaderIsEmptyElement();
32503    test_ret += test_xmlTextReaderIsNamespaceDecl();
32504    test_ret += test_xmlTextReaderIsValid();
32505    test_ret += test_xmlTextReaderLocalName();
32506    test_ret += test_xmlTextReaderLocatorBaseURI();
32507    test_ret += test_xmlTextReaderLocatorLineNumber();
32508    test_ret += test_xmlTextReaderLookupNamespace();
32509    test_ret += test_xmlTextReaderMoveToAttribute();
32510    test_ret += test_xmlTextReaderMoveToAttributeNo();
32511    test_ret += test_xmlTextReaderMoveToAttributeNs();
32512    test_ret += test_xmlTextReaderMoveToElement();
32513    test_ret += test_xmlTextReaderMoveToFirstAttribute();
32514    test_ret += test_xmlTextReaderMoveToNextAttribute();
32515    test_ret += test_xmlTextReaderName();
32516    test_ret += test_xmlTextReaderNamespaceUri();
32517    test_ret += test_xmlTextReaderNext();
32518    test_ret += test_xmlTextReaderNextSibling();
32519    test_ret += test_xmlTextReaderNodeType();
32520    test_ret += test_xmlTextReaderNormalization();
32521    test_ret += test_xmlTextReaderPrefix();
32522    test_ret += test_xmlTextReaderPreserve();
32523    test_ret += test_xmlTextReaderPreservePattern();
32524    test_ret += test_xmlTextReaderQuoteChar();
32525    test_ret += test_xmlTextReaderRead();
32526    test_ret += test_xmlTextReaderReadAttributeValue();
32527    test_ret += test_xmlTextReaderReadState();
32528    test_ret += test_xmlTextReaderRelaxNGSetSchema();
32529    test_ret += test_xmlTextReaderRelaxNGValidate();
32530    test_ret += test_xmlTextReaderSchemaValidate();
32531    test_ret += test_xmlTextReaderSchemaValidateCtxt();
32532    test_ret += test_xmlTextReaderSetErrorHandler();
32533    test_ret += test_xmlTextReaderSetParserProp();
32534    test_ret += test_xmlTextReaderSetSchema();
32535    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32536    test_ret += test_xmlTextReaderSetup();
32537    test_ret += test_xmlTextReaderStandalone();
32538    test_ret += test_xmlTextReaderValue();
32539    test_ret += test_xmlTextReaderXmlLang();
32540
32541    if (test_ret != 0)
32542	printf("Module xmlreader: %d errors\n", test_ret);
32543    return(test_ret);
32544}
32545
32546static int
32547test_xmlExpCtxtNbCons(void) {
32548    int test_ret = 0;
32549
32550#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32551    int mem_base;
32552    int ret_val;
32553    xmlExpCtxtPtr ctxt; /* an expression context */
32554    int n_ctxt;
32555
32556    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32557        mem_base = xmlMemBlocks();
32558        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32559
32560        ret_val = xmlExpCtxtNbCons(ctxt);
32561        desret_int(ret_val);
32562        call_tests++;
32563        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32564        xmlResetLastError();
32565        if (mem_base != xmlMemBlocks()) {
32566            printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32567	           xmlMemBlocks() - mem_base);
32568	    test_ret++;
32569            printf(" %d", n_ctxt);
32570            printf("\n");
32571        }
32572    }
32573    function_tests++;
32574#endif
32575
32576    return(test_ret);
32577}
32578
32579
32580static int
32581test_xmlExpCtxtNbNodes(void) {
32582    int test_ret = 0;
32583
32584#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32585    int mem_base;
32586    int ret_val;
32587    xmlExpCtxtPtr ctxt; /* an expression context */
32588    int n_ctxt;
32589
32590    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32591        mem_base = xmlMemBlocks();
32592        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32593
32594        ret_val = xmlExpCtxtNbNodes(ctxt);
32595        desret_int(ret_val);
32596        call_tests++;
32597        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32598        xmlResetLastError();
32599        if (mem_base != xmlMemBlocks()) {
32600            printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32601	           xmlMemBlocks() - mem_base);
32602	    test_ret++;
32603            printf(" %d", n_ctxt);
32604            printf("\n");
32605        }
32606    }
32607    function_tests++;
32608#endif
32609
32610    return(test_ret);
32611}
32612
32613
32614static int
32615test_xmlExpDump(void) {
32616    int test_ret = 0;
32617
32618#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32619    int mem_base;
32620    xmlBufferPtr buf; /* a buffer to receive the output */
32621    int n_buf;
32622    xmlExpNodePtr expr; /* the compiled expression */
32623    int n_expr;
32624
32625    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32626    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32627        mem_base = xmlMemBlocks();
32628        buf = gen_xmlBufferPtr(n_buf, 0);
32629        expr = gen_xmlExpNodePtr(n_expr, 1);
32630
32631        xmlExpDump(buf, expr);
32632        call_tests++;
32633        des_xmlBufferPtr(n_buf, buf, 0);
32634        des_xmlExpNodePtr(n_expr, expr, 1);
32635        xmlResetLastError();
32636        if (mem_base != xmlMemBlocks()) {
32637            printf("Leak of %d blocks found in xmlExpDump",
32638	           xmlMemBlocks() - mem_base);
32639	    test_ret++;
32640            printf(" %d", n_buf);
32641            printf(" %d", n_expr);
32642            printf("\n");
32643        }
32644    }
32645    }
32646    function_tests++;
32647#endif
32648
32649    return(test_ret);
32650}
32651
32652
32653static int
32654test_xmlExpExpDerive(void) {
32655    int test_ret = 0;
32656
32657
32658    /* missing type support */
32659    return(test_ret);
32660}
32661
32662
32663static int
32664test_xmlExpGetLanguage(void) {
32665    int test_ret = 0;
32666
32667#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32668    int mem_base;
32669    int ret_val;
32670    xmlExpCtxtPtr ctxt; /* the expression context */
32671    int n_ctxt;
32672    xmlExpNodePtr exp; /* the expression */
32673    int n_exp;
32674    xmlChar ** langList; /* where to store the tokens */
32675    int n_langList;
32676    int len; /* the allocated lenght of @list */
32677    int n_len;
32678
32679    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32680    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32681    for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32682    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32683        mem_base = xmlMemBlocks();
32684        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32685        exp = gen_xmlExpNodePtr(n_exp, 1);
32686        langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32687        len = gen_int(n_len, 3);
32688
32689        ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32690        desret_int(ret_val);
32691        call_tests++;
32692        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32693        des_xmlExpNodePtr(n_exp, exp, 1);
32694        des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32695        des_int(n_len, len, 3);
32696        xmlResetLastError();
32697        if (mem_base != xmlMemBlocks()) {
32698            printf("Leak of %d blocks found in xmlExpGetLanguage",
32699	           xmlMemBlocks() - mem_base);
32700	    test_ret++;
32701            printf(" %d", n_ctxt);
32702            printf(" %d", n_exp);
32703            printf(" %d", n_langList);
32704            printf(" %d", n_len);
32705            printf("\n");
32706        }
32707    }
32708    }
32709    }
32710    }
32711    function_tests++;
32712#endif
32713
32714    return(test_ret);
32715}
32716
32717
32718static int
32719test_xmlExpGetStart(void) {
32720    int test_ret = 0;
32721
32722#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32723    int mem_base;
32724    int ret_val;
32725    xmlExpCtxtPtr ctxt; /* the expression context */
32726    int n_ctxt;
32727    xmlExpNodePtr exp; /* the expression */
32728    int n_exp;
32729    xmlChar ** tokList; /* where to store the tokens */
32730    int n_tokList;
32731    int len; /* the allocated lenght of @list */
32732    int n_len;
32733
32734    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32735    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32736    for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32737    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32738        mem_base = xmlMemBlocks();
32739        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32740        exp = gen_xmlExpNodePtr(n_exp, 1);
32741        tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32742        len = gen_int(n_len, 3);
32743
32744        ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32745        desret_int(ret_val);
32746        call_tests++;
32747        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32748        des_xmlExpNodePtr(n_exp, exp, 1);
32749        des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32750        des_int(n_len, len, 3);
32751        xmlResetLastError();
32752        if (mem_base != xmlMemBlocks()) {
32753            printf("Leak of %d blocks found in xmlExpGetStart",
32754	           xmlMemBlocks() - mem_base);
32755	    test_ret++;
32756            printf(" %d", n_ctxt);
32757            printf(" %d", n_exp);
32758            printf(" %d", n_tokList);
32759            printf(" %d", n_len);
32760            printf("\n");
32761        }
32762    }
32763    }
32764    }
32765    }
32766    function_tests++;
32767#endif
32768
32769    return(test_ret);
32770}
32771
32772
32773static int
32774test_xmlExpIsNillable(void) {
32775    int test_ret = 0;
32776
32777#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32778    int mem_base;
32779    int ret_val;
32780    xmlExpNodePtr exp; /* the expression */
32781    int n_exp;
32782
32783    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32784        mem_base = xmlMemBlocks();
32785        exp = gen_xmlExpNodePtr(n_exp, 0);
32786
32787        ret_val = xmlExpIsNillable(exp);
32788        desret_int(ret_val);
32789        call_tests++;
32790        des_xmlExpNodePtr(n_exp, exp, 0);
32791        xmlResetLastError();
32792        if (mem_base != xmlMemBlocks()) {
32793            printf("Leak of %d blocks found in xmlExpIsNillable",
32794	           xmlMemBlocks() - mem_base);
32795	    test_ret++;
32796            printf(" %d", n_exp);
32797            printf("\n");
32798        }
32799    }
32800    function_tests++;
32801#endif
32802
32803    return(test_ret);
32804}
32805
32806
32807static int
32808test_xmlExpMaxToken(void) {
32809    int test_ret = 0;
32810
32811#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32812    int mem_base;
32813    int ret_val;
32814    xmlExpNodePtr expr; /* a compiled expression */
32815    int n_expr;
32816
32817    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32818        mem_base = xmlMemBlocks();
32819        expr = gen_xmlExpNodePtr(n_expr, 0);
32820
32821        ret_val = xmlExpMaxToken(expr);
32822        desret_int(ret_val);
32823        call_tests++;
32824        des_xmlExpNodePtr(n_expr, expr, 0);
32825        xmlResetLastError();
32826        if (mem_base != xmlMemBlocks()) {
32827            printf("Leak of %d blocks found in xmlExpMaxToken",
32828	           xmlMemBlocks() - mem_base);
32829	    test_ret++;
32830            printf(" %d", n_expr);
32831            printf("\n");
32832        }
32833    }
32834    function_tests++;
32835#endif
32836
32837    return(test_ret);
32838}
32839
32840
32841static int
32842test_xmlExpNewAtom(void) {
32843    int test_ret = 0;
32844
32845
32846    /* missing type support */
32847    return(test_ret);
32848}
32849
32850
32851static int
32852test_xmlExpNewCtxt(void) {
32853    int test_ret = 0;
32854
32855
32856    /* missing type support */
32857    return(test_ret);
32858}
32859
32860
32861static int
32862test_xmlExpNewOr(void) {
32863    int test_ret = 0;
32864
32865
32866    /* missing type support */
32867    return(test_ret);
32868}
32869
32870
32871static int
32872test_xmlExpNewRange(void) {
32873    int test_ret = 0;
32874
32875
32876    /* missing type support */
32877    return(test_ret);
32878}
32879
32880
32881static int
32882test_xmlExpNewSeq(void) {
32883    int test_ret = 0;
32884
32885
32886    /* missing type support */
32887    return(test_ret);
32888}
32889
32890
32891static int
32892test_xmlExpParse(void) {
32893    int test_ret = 0;
32894
32895
32896    /* missing type support */
32897    return(test_ret);
32898}
32899
32900
32901static int
32902test_xmlExpRef(void) {
32903    int test_ret = 0;
32904
32905#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32906    int mem_base;
32907    xmlExpNodePtr exp; /* the expression */
32908    int n_exp;
32909
32910    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32911        mem_base = xmlMemBlocks();
32912        exp = gen_xmlExpNodePtr(n_exp, 0);
32913
32914        xmlExpRef(exp);
32915        call_tests++;
32916        des_xmlExpNodePtr(n_exp, exp, 0);
32917        xmlResetLastError();
32918        if (mem_base != xmlMemBlocks()) {
32919            printf("Leak of %d blocks found in xmlExpRef",
32920	           xmlMemBlocks() - mem_base);
32921	    test_ret++;
32922            printf(" %d", n_exp);
32923            printf("\n");
32924        }
32925    }
32926    function_tests++;
32927#endif
32928
32929    return(test_ret);
32930}
32931
32932
32933static int
32934test_xmlExpStringDerive(void) {
32935    int test_ret = 0;
32936
32937
32938    /* missing type support */
32939    return(test_ret);
32940}
32941
32942
32943static int
32944test_xmlExpSubsume(void) {
32945    int test_ret = 0;
32946
32947#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32948    int mem_base;
32949    int ret_val;
32950    xmlExpCtxtPtr ctxt; /* the expressions context */
32951    int n_ctxt;
32952    xmlExpNodePtr exp; /* the englobing expression */
32953    int n_exp;
32954    xmlExpNodePtr sub; /* the subexpression */
32955    int n_sub;
32956
32957    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32958    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32959    for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
32960        mem_base = xmlMemBlocks();
32961        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32962        exp = gen_xmlExpNodePtr(n_exp, 1);
32963        sub = gen_xmlExpNodePtr(n_sub, 2);
32964
32965        ret_val = xmlExpSubsume(ctxt, exp, sub);
32966        desret_int(ret_val);
32967        call_tests++;
32968        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32969        des_xmlExpNodePtr(n_exp, exp, 1);
32970        des_xmlExpNodePtr(n_sub, sub, 2);
32971        xmlResetLastError();
32972        if (mem_base != xmlMemBlocks()) {
32973            printf("Leak of %d blocks found in xmlExpSubsume",
32974	           xmlMemBlocks() - mem_base);
32975	    test_ret++;
32976            printf(" %d", n_ctxt);
32977            printf(" %d", n_exp);
32978            printf(" %d", n_sub);
32979            printf("\n");
32980        }
32981    }
32982    }
32983    }
32984    function_tests++;
32985#endif
32986
32987    return(test_ret);
32988}
32989
32990#ifdef LIBXML_REGEXP_ENABLED
32991
32992#define gen_nb_xmlRegExecCtxtPtr 1
32993static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32994    return(NULL);
32995}
32996static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32997}
32998#endif
32999
33000
33001static int
33002test_xmlRegExecErrInfo(void) {
33003    int test_ret = 0;
33004
33005#if defined(LIBXML_REGEXP_ENABLED)
33006    int mem_base;
33007    int ret_val;
33008    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33009    int n_exec;
33010    xmlChar ** string; /* return value for the error string */
33011    int n_string;
33012    int * nbval; /* pointer to the number of accepted values IN/OUT */
33013    int n_nbval;
33014    int * nbneg; /* return number of negative transitions */
33015    int n_nbneg;
33016    xmlChar ** values; /* pointer to the array of acceptable values */
33017    int n_values;
33018    int * terminal; /* return value if this was a terminal state */
33019    int n_terminal;
33020
33021    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33022    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33023    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33024    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33025    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33026    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33027        mem_base = xmlMemBlocks();
33028        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33029        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33030        nbval = gen_int_ptr(n_nbval, 2);
33031        nbneg = gen_int_ptr(n_nbneg, 3);
33032        values = gen_xmlChar_ptr_ptr(n_values, 4);
33033        terminal = gen_int_ptr(n_terminal, 5);
33034
33035        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33036        desret_int(ret_val);
33037        call_tests++;
33038        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33039        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33040        des_int_ptr(n_nbval, nbval, 2);
33041        des_int_ptr(n_nbneg, nbneg, 3);
33042        des_xmlChar_ptr_ptr(n_values, values, 4);
33043        des_int_ptr(n_terminal, terminal, 5);
33044        xmlResetLastError();
33045        if (mem_base != xmlMemBlocks()) {
33046            printf("Leak of %d blocks found in xmlRegExecErrInfo",
33047	           xmlMemBlocks() - mem_base);
33048	    test_ret++;
33049            printf(" %d", n_exec);
33050            printf(" %d", n_string);
33051            printf(" %d", n_nbval);
33052            printf(" %d", n_nbneg);
33053            printf(" %d", n_values);
33054            printf(" %d", n_terminal);
33055            printf("\n");
33056        }
33057    }
33058    }
33059    }
33060    }
33061    }
33062    }
33063    function_tests++;
33064#endif
33065
33066    return(test_ret);
33067}
33068
33069
33070static int
33071test_xmlRegExecNextValues(void) {
33072    int test_ret = 0;
33073
33074#if defined(LIBXML_REGEXP_ENABLED)
33075    int mem_base;
33076    int ret_val;
33077    xmlRegExecCtxtPtr exec; /* a regexp execution context */
33078    int n_exec;
33079    int * nbval; /* pointer to the number of accepted values IN/OUT */
33080    int n_nbval;
33081    int * nbneg; /* return number of negative transitions */
33082    int n_nbneg;
33083    xmlChar ** values; /* pointer to the array of acceptable values */
33084    int n_values;
33085    int * terminal; /* return value if this was a terminal state */
33086    int n_terminal;
33087
33088    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33089    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33090    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33091    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33092    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33093        mem_base = xmlMemBlocks();
33094        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33095        nbval = gen_int_ptr(n_nbval, 1);
33096        nbneg = gen_int_ptr(n_nbneg, 2);
33097        values = gen_xmlChar_ptr_ptr(n_values, 3);
33098        terminal = gen_int_ptr(n_terminal, 4);
33099
33100        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33101        desret_int(ret_val);
33102        call_tests++;
33103        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33104        des_int_ptr(n_nbval, nbval, 1);
33105        des_int_ptr(n_nbneg, nbneg, 2);
33106        des_xmlChar_ptr_ptr(n_values, values, 3);
33107        des_int_ptr(n_terminal, terminal, 4);
33108        xmlResetLastError();
33109        if (mem_base != xmlMemBlocks()) {
33110            printf("Leak of %d blocks found in xmlRegExecNextValues",
33111	           xmlMemBlocks() - mem_base);
33112	    test_ret++;
33113            printf(" %d", n_exec);
33114            printf(" %d", n_nbval);
33115            printf(" %d", n_nbneg);
33116            printf(" %d", n_values);
33117            printf(" %d", n_terminal);
33118            printf("\n");
33119        }
33120    }
33121    }
33122    }
33123    }
33124    }
33125    function_tests++;
33126#endif
33127
33128    return(test_ret);
33129}
33130
33131
33132static int
33133test_xmlRegExecPushString(void) {
33134    int test_ret = 0;
33135
33136#if defined(LIBXML_REGEXP_ENABLED)
33137    int mem_base;
33138    int ret_val;
33139    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33140    int n_exec;
33141    xmlChar * value; /* a string token input */
33142    int n_value;
33143    void * data; /* data associated to the token to reuse in callbacks */
33144    int n_data;
33145
33146    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33147    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33148    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33149        mem_base = xmlMemBlocks();
33150        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33151        value = gen_const_xmlChar_ptr(n_value, 1);
33152        data = gen_userdata(n_data, 2);
33153
33154        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33155        desret_int(ret_val);
33156        call_tests++;
33157        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33158        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33159        des_userdata(n_data, data, 2);
33160        xmlResetLastError();
33161        if (mem_base != xmlMemBlocks()) {
33162            printf("Leak of %d blocks found in xmlRegExecPushString",
33163	           xmlMemBlocks() - mem_base);
33164	    test_ret++;
33165            printf(" %d", n_exec);
33166            printf(" %d", n_value);
33167            printf(" %d", n_data);
33168            printf("\n");
33169        }
33170    }
33171    }
33172    }
33173    function_tests++;
33174#endif
33175
33176    return(test_ret);
33177}
33178
33179
33180static int
33181test_xmlRegExecPushString2(void) {
33182    int test_ret = 0;
33183
33184#if defined(LIBXML_REGEXP_ENABLED)
33185    int mem_base;
33186    int ret_val;
33187    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33188    int n_exec;
33189    xmlChar * value; /* the first string token input */
33190    int n_value;
33191    xmlChar * value2; /* the second string token input */
33192    int n_value2;
33193    void * data; /* data associated to the token to reuse in callbacks */
33194    int n_data;
33195
33196    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33197    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33198    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33199    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33200        mem_base = xmlMemBlocks();
33201        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33202        value = gen_const_xmlChar_ptr(n_value, 1);
33203        value2 = gen_const_xmlChar_ptr(n_value2, 2);
33204        data = gen_userdata(n_data, 3);
33205
33206        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33207        desret_int(ret_val);
33208        call_tests++;
33209        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33210        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33211        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33212        des_userdata(n_data, data, 3);
33213        xmlResetLastError();
33214        if (mem_base != xmlMemBlocks()) {
33215            printf("Leak of %d blocks found in xmlRegExecPushString2",
33216	           xmlMemBlocks() - mem_base);
33217	    test_ret++;
33218            printf(" %d", n_exec);
33219            printf(" %d", n_value);
33220            printf(" %d", n_value2);
33221            printf(" %d", n_data);
33222            printf("\n");
33223        }
33224    }
33225    }
33226    }
33227    }
33228    function_tests++;
33229#endif
33230
33231    return(test_ret);
33232}
33233
33234#ifdef LIBXML_REGEXP_ENABLED
33235
33236#define gen_nb_xmlRegexpPtr 1
33237static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33238    return(NULL);
33239}
33240static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33241}
33242#endif
33243
33244
33245static int
33246test_xmlRegNewExecCtxt(void) {
33247    int test_ret = 0;
33248
33249
33250    /* missing type support */
33251    return(test_ret);
33252}
33253
33254
33255static int
33256test_xmlRegexpCompile(void) {
33257    int test_ret = 0;
33258
33259
33260    /* missing type support */
33261    return(test_ret);
33262}
33263
33264
33265static int
33266test_xmlRegexpExec(void) {
33267    int test_ret = 0;
33268
33269#if defined(LIBXML_REGEXP_ENABLED)
33270    int mem_base;
33271    int ret_val;
33272    xmlRegexpPtr comp; /* the compiled regular expression */
33273    int n_comp;
33274    xmlChar * content; /* the value to check against the regular expression */
33275    int n_content;
33276
33277    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33278    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33279        mem_base = xmlMemBlocks();
33280        comp = gen_xmlRegexpPtr(n_comp, 0);
33281        content = gen_const_xmlChar_ptr(n_content, 1);
33282
33283        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33284        desret_int(ret_val);
33285        call_tests++;
33286        des_xmlRegexpPtr(n_comp, comp, 0);
33287        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33288        xmlResetLastError();
33289        if (mem_base != xmlMemBlocks()) {
33290            printf("Leak of %d blocks found in xmlRegexpExec",
33291	           xmlMemBlocks() - mem_base);
33292	    test_ret++;
33293            printf(" %d", n_comp);
33294            printf(" %d", n_content);
33295            printf("\n");
33296        }
33297    }
33298    }
33299    function_tests++;
33300#endif
33301
33302    return(test_ret);
33303}
33304
33305
33306static int
33307test_xmlRegexpIsDeterminist(void) {
33308    int test_ret = 0;
33309
33310#if defined(LIBXML_REGEXP_ENABLED)
33311    int mem_base;
33312    int ret_val;
33313    xmlRegexpPtr comp; /* the compiled regular expression */
33314    int n_comp;
33315
33316    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33317        mem_base = xmlMemBlocks();
33318        comp = gen_xmlRegexpPtr(n_comp, 0);
33319
33320        ret_val = xmlRegexpIsDeterminist(comp);
33321        desret_int(ret_val);
33322        call_tests++;
33323        des_xmlRegexpPtr(n_comp, comp, 0);
33324        xmlResetLastError();
33325        if (mem_base != xmlMemBlocks()) {
33326            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33327	           xmlMemBlocks() - mem_base);
33328	    test_ret++;
33329            printf(" %d", n_comp);
33330            printf("\n");
33331        }
33332    }
33333    function_tests++;
33334#endif
33335
33336    return(test_ret);
33337}
33338
33339
33340static int
33341test_xmlRegexpPrint(void) {
33342    int test_ret = 0;
33343
33344#if defined(LIBXML_REGEXP_ENABLED)
33345    int mem_base;
33346    FILE * output; /* the file for the output debug */
33347    int n_output;
33348    xmlRegexpPtr regexp; /* the compiled regexp */
33349    int n_regexp;
33350
33351    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33352    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33353        mem_base = xmlMemBlocks();
33354        output = gen_FILE_ptr(n_output, 0);
33355        regexp = gen_xmlRegexpPtr(n_regexp, 1);
33356
33357        xmlRegexpPrint(output, regexp);
33358        call_tests++;
33359        des_FILE_ptr(n_output, output, 0);
33360        des_xmlRegexpPtr(n_regexp, regexp, 1);
33361        xmlResetLastError();
33362        if (mem_base != xmlMemBlocks()) {
33363            printf("Leak of %d blocks found in xmlRegexpPrint",
33364	           xmlMemBlocks() - mem_base);
33365	    test_ret++;
33366            printf(" %d", n_output);
33367            printf(" %d", n_regexp);
33368            printf("\n");
33369        }
33370    }
33371    }
33372    function_tests++;
33373#endif
33374
33375    return(test_ret);
33376}
33377
33378static int
33379test_xmlregexp(void) {
33380    int test_ret = 0;
33381
33382    if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33383    test_ret += test_xmlExpCtxtNbCons();
33384    test_ret += test_xmlExpCtxtNbNodes();
33385    test_ret += test_xmlExpDump();
33386    test_ret += test_xmlExpExpDerive();
33387    test_ret += test_xmlExpGetLanguage();
33388    test_ret += test_xmlExpGetStart();
33389    test_ret += test_xmlExpIsNillable();
33390    test_ret += test_xmlExpMaxToken();
33391    test_ret += test_xmlExpNewAtom();
33392    test_ret += test_xmlExpNewCtxt();
33393    test_ret += test_xmlExpNewOr();
33394    test_ret += test_xmlExpNewRange();
33395    test_ret += test_xmlExpNewSeq();
33396    test_ret += test_xmlExpParse();
33397    test_ret += test_xmlExpRef();
33398    test_ret += test_xmlExpStringDerive();
33399    test_ret += test_xmlExpSubsume();
33400    test_ret += test_xmlRegExecErrInfo();
33401    test_ret += test_xmlRegExecNextValues();
33402    test_ret += test_xmlRegExecPushString();
33403    test_ret += test_xmlRegExecPushString2();
33404    test_ret += test_xmlRegNewExecCtxt();
33405    test_ret += test_xmlRegexpCompile();
33406    test_ret += test_xmlRegexpExec();
33407    test_ret += test_xmlRegexpIsDeterminist();
33408    test_ret += test_xmlRegexpPrint();
33409
33410    if (test_ret != 0)
33411	printf("Module xmlregexp: %d errors\n", test_ret);
33412    return(test_ret);
33413}
33414#ifdef LIBXML_OUTPUT_ENABLED
33415
33416#define gen_nb_xmlSaveCtxtPtr 1
33417static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33418    return(NULL);
33419}
33420static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33421}
33422#endif
33423
33424
33425static int
33426test_xmlSaveClose(void) {
33427    int test_ret = 0;
33428
33429#if defined(LIBXML_OUTPUT_ENABLED)
33430    int mem_base;
33431    int ret_val;
33432    xmlSaveCtxtPtr ctxt; /* a document saving context */
33433    int n_ctxt;
33434
33435    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33436        mem_base = xmlMemBlocks();
33437        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33438
33439        ret_val = xmlSaveClose(ctxt);
33440        desret_int(ret_val);
33441        call_tests++;
33442        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33443        xmlResetLastError();
33444        if (mem_base != xmlMemBlocks()) {
33445            printf("Leak of %d blocks found in xmlSaveClose",
33446	           xmlMemBlocks() - mem_base);
33447	    test_ret++;
33448            printf(" %d", n_ctxt);
33449            printf("\n");
33450        }
33451    }
33452    function_tests++;
33453#endif
33454
33455    return(test_ret);
33456}
33457
33458
33459static int
33460test_xmlSaveDoc(void) {
33461    int test_ret = 0;
33462
33463#if defined(LIBXML_OUTPUT_ENABLED)
33464    int mem_base;
33465    long ret_val;
33466    xmlSaveCtxtPtr ctxt; /* a document saving context */
33467    int n_ctxt;
33468    xmlDocPtr doc; /* a document */
33469    int n_doc;
33470
33471    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33472    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33473        mem_base = xmlMemBlocks();
33474        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33475        doc = gen_xmlDocPtr(n_doc, 1);
33476
33477        ret_val = xmlSaveDoc(ctxt, doc);
33478        desret_long(ret_val);
33479        call_tests++;
33480        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33481        des_xmlDocPtr(n_doc, doc, 1);
33482        xmlResetLastError();
33483        if (mem_base != xmlMemBlocks()) {
33484            printf("Leak of %d blocks found in xmlSaveDoc",
33485	           xmlMemBlocks() - mem_base);
33486	    test_ret++;
33487            printf(" %d", n_ctxt);
33488            printf(" %d", n_doc);
33489            printf("\n");
33490        }
33491    }
33492    }
33493    function_tests++;
33494#endif
33495
33496    return(test_ret);
33497}
33498
33499
33500static int
33501test_xmlSaveFlush(void) {
33502    int test_ret = 0;
33503
33504#if defined(LIBXML_OUTPUT_ENABLED)
33505    int mem_base;
33506    int ret_val;
33507    xmlSaveCtxtPtr ctxt; /* a document saving context */
33508    int n_ctxt;
33509
33510    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33511        mem_base = xmlMemBlocks();
33512        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33513
33514        ret_val = xmlSaveFlush(ctxt);
33515        desret_int(ret_val);
33516        call_tests++;
33517        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33518        xmlResetLastError();
33519        if (mem_base != xmlMemBlocks()) {
33520            printf("Leak of %d blocks found in xmlSaveFlush",
33521	           xmlMemBlocks() - mem_base);
33522	    test_ret++;
33523            printf(" %d", n_ctxt);
33524            printf("\n");
33525        }
33526    }
33527    function_tests++;
33528#endif
33529
33530    return(test_ret);
33531}
33532
33533
33534static int
33535test_xmlSaveSetAttrEscape(void) {
33536    int test_ret = 0;
33537
33538
33539    /* missing type support */
33540    return(test_ret);
33541}
33542
33543
33544static int
33545test_xmlSaveSetEscape(void) {
33546    int test_ret = 0;
33547
33548
33549    /* missing type support */
33550    return(test_ret);
33551}
33552
33553
33554static int
33555test_xmlSaveToBuffer(void) {
33556    int test_ret = 0;
33557
33558
33559    /* missing type support */
33560    return(test_ret);
33561}
33562
33563
33564static int
33565test_xmlSaveToFd(void) {
33566    int test_ret = 0;
33567
33568
33569    /* missing type support */
33570    return(test_ret);
33571}
33572
33573
33574static int
33575test_xmlSaveToFilename(void) {
33576    int test_ret = 0;
33577
33578
33579    /* missing type support */
33580    return(test_ret);
33581}
33582
33583
33584static int
33585test_xmlSaveTree(void) {
33586    int test_ret = 0;
33587
33588#if defined(LIBXML_OUTPUT_ENABLED)
33589    int mem_base;
33590    long ret_val;
33591    xmlSaveCtxtPtr ctxt; /* a document saving context */
33592    int n_ctxt;
33593    xmlNodePtr node; /* the top node of the subtree to save */
33594    int n_node;
33595
33596    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33597    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33598        mem_base = xmlMemBlocks();
33599        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33600        node = gen_xmlNodePtr(n_node, 1);
33601
33602        ret_val = xmlSaveTree(ctxt, node);
33603        desret_long(ret_val);
33604        call_tests++;
33605        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33606        des_xmlNodePtr(n_node, node, 1);
33607        xmlResetLastError();
33608        if (mem_base != xmlMemBlocks()) {
33609            printf("Leak of %d blocks found in xmlSaveTree",
33610	           xmlMemBlocks() - mem_base);
33611	    test_ret++;
33612            printf(" %d", n_ctxt);
33613            printf(" %d", n_node);
33614            printf("\n");
33615        }
33616    }
33617    }
33618    function_tests++;
33619#endif
33620
33621    return(test_ret);
33622}
33623
33624static int
33625test_xmlsave(void) {
33626    int test_ret = 0;
33627
33628    if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33629    test_ret += test_xmlSaveClose();
33630    test_ret += test_xmlSaveDoc();
33631    test_ret += test_xmlSaveFlush();
33632    test_ret += test_xmlSaveSetAttrEscape();
33633    test_ret += test_xmlSaveSetEscape();
33634    test_ret += test_xmlSaveToBuffer();
33635    test_ret += test_xmlSaveToFd();
33636    test_ret += test_xmlSaveToFilename();
33637    test_ret += test_xmlSaveTree();
33638
33639    if (test_ret != 0)
33640	printf("Module xmlsave: %d errors\n", test_ret);
33641    return(test_ret);
33642}
33643
33644static int
33645test_xmlSchemaDump(void) {
33646    int test_ret = 0;
33647
33648#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33649    int mem_base;
33650    FILE * output; /* the file output */
33651    int n_output;
33652    xmlSchemaPtr schema; /* a schema structure */
33653    int n_schema;
33654
33655    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33656    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33657        mem_base = xmlMemBlocks();
33658        output = gen_FILE_ptr(n_output, 0);
33659        schema = gen_xmlSchemaPtr(n_schema, 1);
33660
33661        xmlSchemaDump(output, schema);
33662        call_tests++;
33663        des_FILE_ptr(n_output, output, 0);
33664        des_xmlSchemaPtr(n_schema, schema, 1);
33665        xmlResetLastError();
33666        if (mem_base != xmlMemBlocks()) {
33667            printf("Leak of %d blocks found in xmlSchemaDump",
33668	           xmlMemBlocks() - mem_base);
33669	    test_ret++;
33670            printf(" %d", n_output);
33671            printf(" %d", n_schema);
33672            printf("\n");
33673        }
33674    }
33675    }
33676    function_tests++;
33677#endif
33678
33679    return(test_ret);
33680}
33681
33682#ifdef LIBXML_SCHEMAS_ENABLED
33683
33684#define gen_nb_xmlSchemaParserCtxtPtr 1
33685static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33686    return(NULL);
33687}
33688static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33689}
33690#endif
33691
33692#ifdef LIBXML_SCHEMAS_ENABLED
33693
33694#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33695static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33696    return(NULL);
33697}
33698static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33699}
33700#endif
33701
33702#ifdef LIBXML_SCHEMAS_ENABLED
33703
33704#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33705static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33706    return(NULL);
33707}
33708static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33709}
33710#endif
33711
33712
33713static int
33714test_xmlSchemaGetParserErrors(void) {
33715    int test_ret = 0;
33716
33717#if defined(LIBXML_SCHEMAS_ENABLED)
33718    int mem_base;
33719    int ret_val;
33720    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33721    int n_ctxt;
33722    xmlSchemaValidityErrorFunc * err; /* the error callback result */
33723    int n_err;
33724    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33725    int n_warn;
33726    void ** ctx; /* contextual data for the callbacks result */
33727    int n_ctx;
33728
33729    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33730    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33731    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33732    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33733        mem_base = xmlMemBlocks();
33734        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33735        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33736        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33737        ctx = gen_void_ptr_ptr(n_ctx, 3);
33738
33739        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33740        desret_int(ret_val);
33741        call_tests++;
33742        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33743        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33744        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33745        des_void_ptr_ptr(n_ctx, ctx, 3);
33746        xmlResetLastError();
33747        if (mem_base != xmlMemBlocks()) {
33748            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33749	           xmlMemBlocks() - mem_base);
33750	    test_ret++;
33751            printf(" %d", n_ctxt);
33752            printf(" %d", n_err);
33753            printf(" %d", n_warn);
33754            printf(" %d", n_ctx);
33755            printf("\n");
33756        }
33757    }
33758    }
33759    }
33760    }
33761    function_tests++;
33762#endif
33763
33764    return(test_ret);
33765}
33766
33767
33768static int
33769test_xmlSchemaGetValidErrors(void) {
33770    int test_ret = 0;
33771
33772#if defined(LIBXML_SCHEMAS_ENABLED)
33773    int mem_base;
33774    int ret_val;
33775    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
33776    int n_ctxt;
33777    xmlSchemaValidityErrorFunc * err; /* the error function result */
33778    int n_err;
33779    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
33780    int n_warn;
33781    void ** ctx; /* the functions context result */
33782    int n_ctx;
33783
33784    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33785    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33786    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33787    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33788        mem_base = xmlMemBlocks();
33789        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33790        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33791        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33792        ctx = gen_void_ptr_ptr(n_ctx, 3);
33793
33794        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33795        desret_int(ret_val);
33796        call_tests++;
33797        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33798        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33799        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33800        des_void_ptr_ptr(n_ctx, ctx, 3);
33801        xmlResetLastError();
33802        if (mem_base != xmlMemBlocks()) {
33803            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33804	           xmlMemBlocks() - mem_base);
33805	    test_ret++;
33806            printf(" %d", n_ctxt);
33807            printf(" %d", n_err);
33808            printf(" %d", n_warn);
33809            printf(" %d", n_ctx);
33810            printf("\n");
33811        }
33812    }
33813    }
33814    }
33815    }
33816    function_tests++;
33817#endif
33818
33819    return(test_ret);
33820}
33821
33822
33823static int
33824test_xmlSchemaIsValid(void) {
33825    int test_ret = 0;
33826
33827#if defined(LIBXML_SCHEMAS_ENABLED)
33828    int mem_base;
33829    int ret_val;
33830    xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
33831    int n_ctxt;
33832
33833    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33834        mem_base = xmlMemBlocks();
33835        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33836
33837        ret_val = xmlSchemaIsValid(ctxt);
33838        desret_int(ret_val);
33839        call_tests++;
33840        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33841        xmlResetLastError();
33842        if (mem_base != xmlMemBlocks()) {
33843            printf("Leak of %d blocks found in xmlSchemaIsValid",
33844	           xmlMemBlocks() - mem_base);
33845	    test_ret++;
33846            printf(" %d", n_ctxt);
33847            printf("\n");
33848        }
33849    }
33850    function_tests++;
33851#endif
33852
33853    return(test_ret);
33854}
33855
33856
33857static int
33858test_xmlSchemaNewDocParserCtxt(void) {
33859    int test_ret = 0;
33860
33861#if defined(LIBXML_SCHEMAS_ENABLED)
33862    int mem_base;
33863    xmlSchemaParserCtxtPtr ret_val;
33864    xmlDocPtr doc; /* a preparsed document tree */
33865    int n_doc;
33866
33867    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33868        mem_base = xmlMemBlocks();
33869        doc = gen_xmlDocPtr(n_doc, 0);
33870
33871        ret_val = xmlSchemaNewDocParserCtxt(doc);
33872        desret_xmlSchemaParserCtxtPtr(ret_val);
33873        call_tests++;
33874        des_xmlDocPtr(n_doc, doc, 0);
33875        xmlResetLastError();
33876        if (mem_base != xmlMemBlocks()) {
33877            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
33878	           xmlMemBlocks() - mem_base);
33879	    test_ret++;
33880            printf(" %d", n_doc);
33881            printf("\n");
33882        }
33883    }
33884    function_tests++;
33885#endif
33886
33887    return(test_ret);
33888}
33889
33890
33891static int
33892test_xmlSchemaNewMemParserCtxt(void) {
33893    int test_ret = 0;
33894
33895#if defined(LIBXML_SCHEMAS_ENABLED)
33896    int mem_base;
33897    xmlSchemaParserCtxtPtr ret_val;
33898    char * buffer; /* a pointer to a char array containing the schemas */
33899    int n_buffer;
33900    int size; /* the size of the array */
33901    int n_size;
33902
33903    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
33904    for (n_size = 0;n_size < gen_nb_int;n_size++) {
33905        mem_base = xmlMemBlocks();
33906        buffer = gen_const_char_ptr(n_buffer, 0);
33907        size = gen_int(n_size, 1);
33908
33909        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
33910        desret_xmlSchemaParserCtxtPtr(ret_val);
33911        call_tests++;
33912        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
33913        des_int(n_size, size, 1);
33914        xmlResetLastError();
33915        if (mem_base != xmlMemBlocks()) {
33916            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
33917	           xmlMemBlocks() - mem_base);
33918	    test_ret++;
33919            printf(" %d", n_buffer);
33920            printf(" %d", n_size);
33921            printf("\n");
33922        }
33923    }
33924    }
33925    function_tests++;
33926#endif
33927
33928    return(test_ret);
33929}
33930
33931
33932static int
33933test_xmlSchemaNewParserCtxt(void) {
33934    int test_ret = 0;
33935
33936#if defined(LIBXML_SCHEMAS_ENABLED)
33937    int mem_base;
33938    xmlSchemaParserCtxtPtr ret_val;
33939    char * URL; /* the location of the schema */
33940    int n_URL;
33941
33942    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
33943        mem_base = xmlMemBlocks();
33944        URL = gen_const_char_ptr(n_URL, 0);
33945
33946        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
33947        desret_xmlSchemaParserCtxtPtr(ret_val);
33948        call_tests++;
33949        des_const_char_ptr(n_URL, (const char *)URL, 0);
33950        xmlResetLastError();
33951        if (mem_base != xmlMemBlocks()) {
33952            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
33953	           xmlMemBlocks() - mem_base);
33954	    test_ret++;
33955            printf(" %d", n_URL);
33956            printf("\n");
33957        }
33958    }
33959    function_tests++;
33960#endif
33961
33962    return(test_ret);
33963}
33964
33965
33966static int
33967test_xmlSchemaNewValidCtxt(void) {
33968    int test_ret = 0;
33969
33970
33971    /* missing type support */
33972    return(test_ret);
33973}
33974
33975
33976static int
33977test_xmlSchemaParse(void) {
33978    int test_ret = 0;
33979
33980
33981    /* missing type support */
33982    return(test_ret);
33983}
33984
33985#ifdef LIBXML_SCHEMAS_ENABLED
33986
33987#define gen_nb_xmlSAXHandlerPtr_ptr 1
33988static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33989    return(NULL);
33990}
33991static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33992}
33993#endif
33994
33995
33996static int
33997test_xmlSchemaSAXPlug(void) {
33998    int test_ret = 0;
33999
34000
34001    /* missing type support */
34002    return(test_ret);
34003}
34004
34005#ifdef LIBXML_SCHEMAS_ENABLED
34006
34007#define gen_nb_xmlSchemaSAXPlugPtr 1
34008static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34009    return(NULL);
34010}
34011static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34012}
34013#endif
34014
34015
34016static int
34017test_xmlSchemaSAXUnplug(void) {
34018    int test_ret = 0;
34019
34020#if defined(LIBXML_SCHEMAS_ENABLED)
34021    int mem_base;
34022    int ret_val;
34023    xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34024    int n_plug;
34025
34026    for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34027        mem_base = xmlMemBlocks();
34028        plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34029
34030        ret_val = xmlSchemaSAXUnplug(plug);
34031        desret_int(ret_val);
34032        call_tests++;
34033        des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34034        xmlResetLastError();
34035        if (mem_base != xmlMemBlocks()) {
34036            printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34037	           xmlMemBlocks() - mem_base);
34038	    test_ret++;
34039            printf(" %d", n_plug);
34040            printf("\n");
34041        }
34042    }
34043    function_tests++;
34044#endif
34045
34046    return(test_ret);
34047}
34048
34049
34050static int
34051test_xmlSchemaSetParserErrors(void) {
34052    int test_ret = 0;
34053
34054
34055    /* missing type support */
34056    return(test_ret);
34057}
34058
34059
34060static int
34061test_xmlSchemaSetParserStructuredErrors(void) {
34062    int test_ret = 0;
34063
34064
34065    /* missing type support */
34066    return(test_ret);
34067}
34068
34069
34070static int
34071test_xmlSchemaSetValidErrors(void) {
34072    int test_ret = 0;
34073
34074
34075    /* missing type support */
34076    return(test_ret);
34077}
34078
34079
34080static int
34081test_xmlSchemaSetValidOptions(void) {
34082    int test_ret = 0;
34083
34084#if defined(LIBXML_SCHEMAS_ENABLED)
34085    int mem_base;
34086    int ret_val;
34087    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34088    int n_ctxt;
34089    int options; /* a combination of xmlSchemaValidOption */
34090    int n_options;
34091
34092    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34093    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34094        mem_base = xmlMemBlocks();
34095        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34096        options = gen_int(n_options, 1);
34097
34098        ret_val = xmlSchemaSetValidOptions(ctxt, options);
34099        desret_int(ret_val);
34100        call_tests++;
34101        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34102        des_int(n_options, options, 1);
34103        xmlResetLastError();
34104        if (mem_base != xmlMemBlocks()) {
34105            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34106	           xmlMemBlocks() - mem_base);
34107	    test_ret++;
34108            printf(" %d", n_ctxt);
34109            printf(" %d", n_options);
34110            printf("\n");
34111        }
34112    }
34113    }
34114    function_tests++;
34115#endif
34116
34117    return(test_ret);
34118}
34119
34120
34121static int
34122test_xmlSchemaSetValidStructuredErrors(void) {
34123    int test_ret = 0;
34124
34125
34126    /* missing type support */
34127    return(test_ret);
34128}
34129
34130
34131static int
34132test_xmlSchemaValidCtxtGetOptions(void) {
34133    int test_ret = 0;
34134
34135#if defined(LIBXML_SCHEMAS_ENABLED)
34136    int mem_base;
34137    int ret_val;
34138    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34139    int n_ctxt;
34140
34141    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34142        mem_base = xmlMemBlocks();
34143        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34144
34145        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34146        desret_int(ret_val);
34147        call_tests++;
34148        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34149        xmlResetLastError();
34150        if (mem_base != xmlMemBlocks()) {
34151            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34152	           xmlMemBlocks() - mem_base);
34153	    test_ret++;
34154            printf(" %d", n_ctxt);
34155            printf("\n");
34156        }
34157    }
34158    function_tests++;
34159#endif
34160
34161    return(test_ret);
34162}
34163
34164
34165static int
34166test_xmlSchemaValidCtxtGetParserCtxt(void) {
34167    int test_ret = 0;
34168
34169#if defined(LIBXML_SCHEMAS_ENABLED)
34170    int mem_base;
34171    xmlParserCtxtPtr ret_val;
34172    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34173    int n_ctxt;
34174
34175    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34176        mem_base = xmlMemBlocks();
34177        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34178
34179        ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34180        desret_xmlParserCtxtPtr(ret_val);
34181        call_tests++;
34182        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34183        xmlResetLastError();
34184        if (mem_base != xmlMemBlocks()) {
34185            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34186	           xmlMemBlocks() - mem_base);
34187	    test_ret++;
34188            printf(" %d", n_ctxt);
34189            printf("\n");
34190        }
34191    }
34192    function_tests++;
34193#endif
34194
34195    return(test_ret);
34196}
34197
34198
34199static int
34200test_xmlSchemaValidateDoc(void) {
34201    int test_ret = 0;
34202
34203#if defined(LIBXML_SCHEMAS_ENABLED)
34204    int mem_base;
34205    int ret_val;
34206    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34207    int n_ctxt;
34208    xmlDocPtr doc; /* a parsed document tree */
34209    int n_doc;
34210
34211    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34212    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34213        mem_base = xmlMemBlocks();
34214        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34215        doc = gen_xmlDocPtr(n_doc, 1);
34216
34217        ret_val = xmlSchemaValidateDoc(ctxt, doc);
34218        desret_int(ret_val);
34219        call_tests++;
34220        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34221        des_xmlDocPtr(n_doc, doc, 1);
34222        xmlResetLastError();
34223        if (mem_base != xmlMemBlocks()) {
34224            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34225	           xmlMemBlocks() - mem_base);
34226	    test_ret++;
34227            printf(" %d", n_ctxt);
34228            printf(" %d", n_doc);
34229            printf("\n");
34230        }
34231    }
34232    }
34233    function_tests++;
34234#endif
34235
34236    return(test_ret);
34237}
34238
34239
34240static int
34241test_xmlSchemaValidateFile(void) {
34242    int test_ret = 0;
34243
34244#if defined(LIBXML_SCHEMAS_ENABLED)
34245    int mem_base;
34246    int ret_val;
34247    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34248    int n_ctxt;
34249    const char * filename; /* the URI of the instance */
34250    int n_filename;
34251    int options; /* a future set of options, currently unused */
34252    int n_options;
34253
34254    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34255    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34256    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34257        mem_base = xmlMemBlocks();
34258        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34259        filename = gen_filepath(n_filename, 1);
34260        options = gen_int(n_options, 2);
34261
34262        ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34263        desret_int(ret_val);
34264        call_tests++;
34265        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34266        des_filepath(n_filename, filename, 1);
34267        des_int(n_options, options, 2);
34268        xmlResetLastError();
34269        if (mem_base != xmlMemBlocks()) {
34270            printf("Leak of %d blocks found in xmlSchemaValidateFile",
34271	           xmlMemBlocks() - mem_base);
34272	    test_ret++;
34273            printf(" %d", n_ctxt);
34274            printf(" %d", n_filename);
34275            printf(" %d", n_options);
34276            printf("\n");
34277        }
34278    }
34279    }
34280    }
34281    function_tests++;
34282#endif
34283
34284    return(test_ret);
34285}
34286
34287
34288static int
34289test_xmlSchemaValidateOneElement(void) {
34290    int test_ret = 0;
34291
34292#if defined(LIBXML_SCHEMAS_ENABLED)
34293    int mem_base;
34294    int ret_val;
34295    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34296    int n_ctxt;
34297    xmlNodePtr elem; /* an element node */
34298    int n_elem;
34299
34300    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34301    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34302        mem_base = xmlMemBlocks();
34303        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34304        elem = gen_xmlNodePtr(n_elem, 1);
34305
34306        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34307        desret_int(ret_val);
34308        call_tests++;
34309        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34310        des_xmlNodePtr(n_elem, elem, 1);
34311        xmlResetLastError();
34312        if (mem_base != xmlMemBlocks()) {
34313            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34314	           xmlMemBlocks() - mem_base);
34315	    test_ret++;
34316            printf(" %d", n_ctxt);
34317            printf(" %d", n_elem);
34318            printf("\n");
34319        }
34320    }
34321    }
34322    function_tests++;
34323#endif
34324
34325    return(test_ret);
34326}
34327
34328
34329static int
34330test_xmlSchemaValidateStream(void) {
34331    int test_ret = 0;
34332
34333#if defined(LIBXML_SCHEMAS_ENABLED)
34334    int mem_base;
34335    int ret_val;
34336    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34337    int n_ctxt;
34338    xmlParserInputBufferPtr input; /* the input to use for reading the data */
34339    int n_input;
34340    xmlCharEncoding enc; /* an optional encoding information */
34341    int n_enc;
34342    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34343    int n_sax;
34344    void * user_data; /* the context to provide to the SAX handler. */
34345    int n_user_data;
34346
34347    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34348    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34349    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34350    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34351    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34352        mem_base = xmlMemBlocks();
34353        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34354        input = gen_xmlParserInputBufferPtr(n_input, 1);
34355        enc = gen_xmlCharEncoding(n_enc, 2);
34356        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34357        user_data = gen_userdata(n_user_data, 4);
34358
34359        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34360        desret_int(ret_val);
34361        call_tests++;
34362        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34363        des_xmlParserInputBufferPtr(n_input, input, 1);
34364        des_xmlCharEncoding(n_enc, enc, 2);
34365        des_xmlSAXHandlerPtr(n_sax, sax, 3);
34366        des_userdata(n_user_data, user_data, 4);
34367        xmlResetLastError();
34368        if (mem_base != xmlMemBlocks()) {
34369            printf("Leak of %d blocks found in xmlSchemaValidateStream",
34370	           xmlMemBlocks() - mem_base);
34371	    test_ret++;
34372            printf(" %d", n_ctxt);
34373            printf(" %d", n_input);
34374            printf(" %d", n_enc);
34375            printf(" %d", n_sax);
34376            printf(" %d", n_user_data);
34377            printf("\n");
34378        }
34379    }
34380    }
34381    }
34382    }
34383    }
34384    function_tests++;
34385#endif
34386
34387    return(test_ret);
34388}
34389
34390static int
34391test_xmlschemas(void) {
34392    int test_ret = 0;
34393
34394    if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34395    test_ret += test_xmlSchemaDump();
34396    test_ret += test_xmlSchemaGetParserErrors();
34397    test_ret += test_xmlSchemaGetValidErrors();
34398    test_ret += test_xmlSchemaIsValid();
34399    test_ret += test_xmlSchemaNewDocParserCtxt();
34400    test_ret += test_xmlSchemaNewMemParserCtxt();
34401    test_ret += test_xmlSchemaNewParserCtxt();
34402    test_ret += test_xmlSchemaNewValidCtxt();
34403    test_ret += test_xmlSchemaParse();
34404    test_ret += test_xmlSchemaSAXPlug();
34405    test_ret += test_xmlSchemaSAXUnplug();
34406    test_ret += test_xmlSchemaSetParserErrors();
34407    test_ret += test_xmlSchemaSetParserStructuredErrors();
34408    test_ret += test_xmlSchemaSetValidErrors();
34409    test_ret += test_xmlSchemaSetValidOptions();
34410    test_ret += test_xmlSchemaSetValidStructuredErrors();
34411    test_ret += test_xmlSchemaValidCtxtGetOptions();
34412    test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34413    test_ret += test_xmlSchemaValidateDoc();
34414    test_ret += test_xmlSchemaValidateFile();
34415    test_ret += test_xmlSchemaValidateOneElement();
34416    test_ret += test_xmlSchemaValidateStream();
34417
34418    if (test_ret != 0)
34419	printf("Module xmlschemas: %d errors\n", test_ret);
34420    return(test_ret);
34421}
34422#ifdef LIBXML_SCHEMAS_ENABLED
34423
34424#define gen_nb_xmlSchemaFacetPtr 1
34425static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34426    return(NULL);
34427}
34428static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34429}
34430#endif
34431
34432#ifdef LIBXML_SCHEMAS_ENABLED
34433
34434#define gen_nb_xmlSchemaTypePtr 1
34435static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34436    return(NULL);
34437}
34438static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34439}
34440#endif
34441
34442
34443static int
34444test_xmlSchemaCheckFacet(void) {
34445    int test_ret = 0;
34446
34447#if defined(LIBXML_SCHEMAS_ENABLED)
34448    int mem_base;
34449    int ret_val;
34450    xmlSchemaFacetPtr facet; /* the facet */
34451    int n_facet;
34452    xmlSchemaTypePtr typeDecl; /* the schema type definition */
34453    int n_typeDecl;
34454    xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34455    int n_pctxt;
34456    xmlChar * name; /* the optional name of the type */
34457    int n_name;
34458
34459    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34460    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34461    for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34462    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34463        mem_base = xmlMemBlocks();
34464        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34465        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34466        pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34467        name = gen_const_xmlChar_ptr(n_name, 3);
34468
34469        ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34470        desret_int(ret_val);
34471        call_tests++;
34472        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34473        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34474        des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34475        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34476        xmlResetLastError();
34477        if (mem_base != xmlMemBlocks()) {
34478            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34479	           xmlMemBlocks() - mem_base);
34480	    test_ret++;
34481            printf(" %d", n_facet);
34482            printf(" %d", n_typeDecl);
34483            printf(" %d", n_pctxt);
34484            printf(" %d", n_name);
34485            printf("\n");
34486        }
34487    }
34488    }
34489    }
34490    }
34491    function_tests++;
34492#endif
34493
34494    return(test_ret);
34495}
34496
34497
34498static int
34499test_xmlSchemaCleanupTypes(void) {
34500    int test_ret = 0;
34501
34502#if defined(LIBXML_SCHEMAS_ENABLED)
34503
34504
34505        xmlSchemaCleanupTypes();
34506        call_tests++;
34507        xmlResetLastError();
34508    function_tests++;
34509#endif
34510
34511    return(test_ret);
34512}
34513
34514
34515static int
34516test_xmlSchemaCollapseString(void) {
34517    int test_ret = 0;
34518
34519#if defined(LIBXML_SCHEMAS_ENABLED)
34520    int mem_base;
34521    xmlChar * ret_val;
34522    xmlChar * value; /* a value */
34523    int n_value;
34524
34525    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34526        mem_base = xmlMemBlocks();
34527        value = gen_const_xmlChar_ptr(n_value, 0);
34528
34529        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34530        desret_xmlChar_ptr(ret_val);
34531        call_tests++;
34532        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34533        xmlResetLastError();
34534        if (mem_base != xmlMemBlocks()) {
34535            printf("Leak of %d blocks found in xmlSchemaCollapseString",
34536	           xmlMemBlocks() - mem_base);
34537	    test_ret++;
34538            printf(" %d", n_value);
34539            printf("\n");
34540        }
34541    }
34542    function_tests++;
34543#endif
34544
34545    return(test_ret);
34546}
34547
34548#ifdef LIBXML_SCHEMAS_ENABLED
34549
34550#define gen_nb_xmlSchemaValPtr 1
34551static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34552    return(NULL);
34553}
34554static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34555}
34556#endif
34557
34558
34559static int
34560test_xmlSchemaCompareValues(void) {
34561    int test_ret = 0;
34562
34563#if defined(LIBXML_SCHEMAS_ENABLED)
34564    int mem_base;
34565    int ret_val;
34566    xmlSchemaValPtr x; /* a first value */
34567    int n_x;
34568    xmlSchemaValPtr y; /* a second value */
34569    int n_y;
34570
34571    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34572    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34573        mem_base = xmlMemBlocks();
34574        x = gen_xmlSchemaValPtr(n_x, 0);
34575        y = gen_xmlSchemaValPtr(n_y, 1);
34576
34577        ret_val = xmlSchemaCompareValues(x, y);
34578        desret_int(ret_val);
34579        call_tests++;
34580        des_xmlSchemaValPtr(n_x, x, 0);
34581        des_xmlSchemaValPtr(n_y, y, 1);
34582        xmlResetLastError();
34583        if (mem_base != xmlMemBlocks()) {
34584            printf("Leak of %d blocks found in xmlSchemaCompareValues",
34585	           xmlMemBlocks() - mem_base);
34586	    test_ret++;
34587            printf(" %d", n_x);
34588            printf(" %d", n_y);
34589            printf("\n");
34590        }
34591    }
34592    }
34593    function_tests++;
34594#endif
34595
34596    return(test_ret);
34597}
34598
34599
34600static int
34601test_xmlSchemaCompareValuesWhtsp(void) {
34602    int test_ret = 0;
34603
34604#if defined(LIBXML_SCHEMAS_ENABLED)
34605    int mem_base;
34606    int ret_val;
34607    xmlSchemaValPtr x; /* a first value */
34608    int n_x;
34609    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34610    int n_xws;
34611    xmlSchemaValPtr y; /* a second value */
34612    int n_y;
34613    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34614    int n_yws;
34615
34616    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34617    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34618    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34619    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34620        mem_base = xmlMemBlocks();
34621        x = gen_xmlSchemaValPtr(n_x, 0);
34622        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34623        y = gen_xmlSchemaValPtr(n_y, 2);
34624        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34625
34626        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34627        desret_int(ret_val);
34628        call_tests++;
34629        des_xmlSchemaValPtr(n_x, x, 0);
34630        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34631        des_xmlSchemaValPtr(n_y, y, 2);
34632        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34633        xmlResetLastError();
34634        if (mem_base != xmlMemBlocks()) {
34635            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34636	           xmlMemBlocks() - mem_base);
34637	    test_ret++;
34638            printf(" %d", n_x);
34639            printf(" %d", n_xws);
34640            printf(" %d", n_y);
34641            printf(" %d", n_yws);
34642            printf("\n");
34643        }
34644    }
34645    }
34646    }
34647    }
34648    function_tests++;
34649#endif
34650
34651    return(test_ret);
34652}
34653
34654
34655static int
34656test_xmlSchemaCopyValue(void) {
34657    int test_ret = 0;
34658
34659
34660    /* missing type support */
34661    return(test_ret);
34662}
34663
34664
34665static int
34666test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34667    int test_ret = 0;
34668
34669#if defined(LIBXML_SCHEMAS_ENABLED)
34670    int mem_base;
34671    xmlSchemaTypePtr ret_val;
34672    xmlSchemaTypePtr type; /* the built-in simple type. */
34673    int n_type;
34674
34675    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34676        mem_base = xmlMemBlocks();
34677        type = gen_xmlSchemaTypePtr(n_type, 0);
34678
34679        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34680        desret_xmlSchemaTypePtr(ret_val);
34681        call_tests++;
34682        des_xmlSchemaTypePtr(n_type, type, 0);
34683        xmlResetLastError();
34684        if (mem_base != xmlMemBlocks()) {
34685            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34686	           xmlMemBlocks() - mem_base);
34687	    test_ret++;
34688            printf(" %d", n_type);
34689            printf("\n");
34690        }
34691    }
34692    function_tests++;
34693#endif
34694
34695    return(test_ret);
34696}
34697
34698
34699static int
34700test_xmlSchemaGetBuiltInType(void) {
34701    int test_ret = 0;
34702
34703#if defined(LIBXML_SCHEMAS_ENABLED)
34704    xmlSchemaTypePtr ret_val;
34705    xmlSchemaValType type; /* the type of the built in type */
34706    int n_type;
34707
34708    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34709        type = gen_xmlSchemaValType(n_type, 0);
34710
34711        ret_val = xmlSchemaGetBuiltInType(type);
34712        desret_xmlSchemaTypePtr(ret_val);
34713        call_tests++;
34714        des_xmlSchemaValType(n_type, type, 0);
34715        xmlResetLastError();
34716    }
34717    function_tests++;
34718#endif
34719
34720    return(test_ret);
34721}
34722
34723
34724static int
34725test_xmlSchemaGetCanonValue(void) {
34726    int test_ret = 0;
34727
34728#if defined(LIBXML_SCHEMAS_ENABLED)
34729    int mem_base;
34730    int ret_val;
34731    xmlSchemaValPtr val; /* the precomputed value */
34732    int n_val;
34733    xmlChar ** retValue; /* the returned value */
34734    int n_retValue;
34735
34736    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34737    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34738        mem_base = xmlMemBlocks();
34739        val = gen_xmlSchemaValPtr(n_val, 0);
34740        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34741
34742        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34743        desret_int(ret_val);
34744        call_tests++;
34745        des_xmlSchemaValPtr(n_val, val, 0);
34746        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34747        xmlResetLastError();
34748        if (mem_base != xmlMemBlocks()) {
34749            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34750	           xmlMemBlocks() - mem_base);
34751	    test_ret++;
34752            printf(" %d", n_val);
34753            printf(" %d", n_retValue);
34754            printf("\n");
34755        }
34756    }
34757    }
34758    function_tests++;
34759#endif
34760
34761    return(test_ret);
34762}
34763
34764
34765static int
34766test_xmlSchemaGetCanonValueWhtsp(void) {
34767    int test_ret = 0;
34768
34769#if defined(LIBXML_SCHEMAS_ENABLED)
34770    int mem_base;
34771    int ret_val;
34772    xmlSchemaValPtr val; /* the precomputed value */
34773    int n_val;
34774    xmlChar ** retValue; /* the returned value */
34775    int n_retValue;
34776    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34777    int n_ws;
34778
34779    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34780    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34781    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34782        mem_base = xmlMemBlocks();
34783        val = gen_xmlSchemaValPtr(n_val, 0);
34784        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34785        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34786
34787        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34788        desret_int(ret_val);
34789        call_tests++;
34790        des_xmlSchemaValPtr(n_val, val, 0);
34791        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34792        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34793        xmlResetLastError();
34794        if (mem_base != xmlMemBlocks()) {
34795            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34796	           xmlMemBlocks() - mem_base);
34797	    test_ret++;
34798            printf(" %d", n_val);
34799            printf(" %d", n_retValue);
34800            printf(" %d", n_ws);
34801            printf("\n");
34802        }
34803    }
34804    }
34805    }
34806    function_tests++;
34807#endif
34808
34809    return(test_ret);
34810}
34811
34812
34813static int
34814test_xmlSchemaGetFacetValueAsULong(void) {
34815    int test_ret = 0;
34816
34817#if defined(LIBXML_SCHEMAS_ENABLED)
34818    int mem_base;
34819    unsigned long ret_val;
34820    xmlSchemaFacetPtr facet; /* an schemas type facet */
34821    int n_facet;
34822
34823    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34824        mem_base = xmlMemBlocks();
34825        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34826
34827        ret_val = xmlSchemaGetFacetValueAsULong(facet);
34828        desret_unsigned_long(ret_val);
34829        call_tests++;
34830        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34831        xmlResetLastError();
34832        if (mem_base != xmlMemBlocks()) {
34833            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
34834	           xmlMemBlocks() - mem_base);
34835	    test_ret++;
34836            printf(" %d", n_facet);
34837            printf("\n");
34838        }
34839    }
34840    function_tests++;
34841#endif
34842
34843    return(test_ret);
34844}
34845
34846
34847static int
34848test_xmlSchemaGetPredefinedType(void) {
34849    int test_ret = 0;
34850
34851#if defined(LIBXML_SCHEMAS_ENABLED)
34852    int mem_base;
34853    xmlSchemaTypePtr ret_val;
34854    xmlChar * name; /* the type name */
34855    int n_name;
34856    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
34857    int n_ns;
34858
34859    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34860    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
34861        mem_base = xmlMemBlocks();
34862        name = gen_const_xmlChar_ptr(n_name, 0);
34863        ns = gen_const_xmlChar_ptr(n_ns, 1);
34864
34865        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
34866        desret_xmlSchemaTypePtr(ret_val);
34867        call_tests++;
34868        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
34869        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
34870        xmlResetLastError();
34871        if (mem_base != xmlMemBlocks()) {
34872            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
34873	           xmlMemBlocks() - mem_base);
34874	    test_ret++;
34875            printf(" %d", n_name);
34876            printf(" %d", n_ns);
34877            printf("\n");
34878        }
34879    }
34880    }
34881    function_tests++;
34882#endif
34883
34884    return(test_ret);
34885}
34886
34887
34888static int
34889test_xmlSchemaGetValType(void) {
34890    int test_ret = 0;
34891
34892#if defined(LIBXML_SCHEMAS_ENABLED)
34893    int mem_base;
34894    xmlSchemaValType ret_val;
34895    xmlSchemaValPtr val; /* a schemas value */
34896    int n_val;
34897
34898    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34899        mem_base = xmlMemBlocks();
34900        val = gen_xmlSchemaValPtr(n_val, 0);
34901
34902        ret_val = xmlSchemaGetValType(val);
34903        desret_xmlSchemaValType(ret_val);
34904        call_tests++;
34905        des_xmlSchemaValPtr(n_val, val, 0);
34906        xmlResetLastError();
34907        if (mem_base != xmlMemBlocks()) {
34908            printf("Leak of %d blocks found in xmlSchemaGetValType",
34909	           xmlMemBlocks() - mem_base);
34910	    test_ret++;
34911            printf(" %d", n_val);
34912            printf("\n");
34913        }
34914    }
34915    function_tests++;
34916#endif
34917
34918    return(test_ret);
34919}
34920
34921
34922static int
34923test_xmlSchemaInitTypes(void) {
34924    int test_ret = 0;
34925
34926#if defined(LIBXML_SCHEMAS_ENABLED)
34927
34928
34929        xmlSchemaInitTypes();
34930        call_tests++;
34931        xmlResetLastError();
34932    function_tests++;
34933#endif
34934
34935    return(test_ret);
34936}
34937
34938
34939static int
34940test_xmlSchemaIsBuiltInTypeFacet(void) {
34941    int test_ret = 0;
34942
34943#if defined(LIBXML_SCHEMAS_ENABLED)
34944    int mem_base;
34945    int ret_val;
34946    xmlSchemaTypePtr type; /* the built-in type */
34947    int n_type;
34948    int facetType; /* the facet type */
34949    int n_facetType;
34950
34951    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34952    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
34953        mem_base = xmlMemBlocks();
34954        type = gen_xmlSchemaTypePtr(n_type, 0);
34955        facetType = gen_int(n_facetType, 1);
34956
34957        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
34958        desret_int(ret_val);
34959        call_tests++;
34960        des_xmlSchemaTypePtr(n_type, type, 0);
34961        des_int(n_facetType, facetType, 1);
34962        xmlResetLastError();
34963        if (mem_base != xmlMemBlocks()) {
34964            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
34965	           xmlMemBlocks() - mem_base);
34966	    test_ret++;
34967            printf(" %d", n_type);
34968            printf(" %d", n_facetType);
34969            printf("\n");
34970        }
34971    }
34972    }
34973    function_tests++;
34974#endif
34975
34976    return(test_ret);
34977}
34978
34979
34980static int
34981test_xmlSchemaNewFacet(void) {
34982    int test_ret = 0;
34983
34984
34985    /* missing type support */
34986    return(test_ret);
34987}
34988
34989
34990static int
34991test_xmlSchemaNewNOTATIONValue(void) {
34992    int test_ret = 0;
34993
34994
34995    /* missing type support */
34996    return(test_ret);
34997}
34998
34999
35000static int
35001test_xmlSchemaNewQNameValue(void) {
35002    int test_ret = 0;
35003
35004
35005    /* missing type support */
35006    return(test_ret);
35007}
35008
35009
35010static int
35011test_xmlSchemaNewStringValue(void) {
35012    int test_ret = 0;
35013
35014
35015    /* missing type support */
35016    return(test_ret);
35017}
35018
35019#ifdef LIBXML_SCHEMAS_ENABLED
35020
35021#define gen_nb_xmlSchemaValPtr_ptr 1
35022static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35023    return(NULL);
35024}
35025static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35026}
35027#endif
35028
35029
35030static int
35031test_xmlSchemaValPredefTypeNode(void) {
35032    int test_ret = 0;
35033
35034#if defined(LIBXML_SCHEMAS_ENABLED)
35035    int mem_base;
35036    int ret_val;
35037    xmlSchemaTypePtr type; /* the predefined type */
35038    int n_type;
35039    xmlChar * value; /* the value to check */
35040    int n_value;
35041    xmlSchemaValPtr * val; /* the return computed value */
35042    int n_val;
35043    xmlNodePtr node; /* the node containing the value */
35044    int n_node;
35045
35046    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35047    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35048    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35049    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35050        mem_base = xmlMemBlocks();
35051        type = gen_xmlSchemaTypePtr(n_type, 0);
35052        value = gen_const_xmlChar_ptr(n_value, 1);
35053        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35054        node = gen_xmlNodePtr(n_node, 3);
35055
35056        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35057        desret_int(ret_val);
35058        call_tests++;
35059        des_xmlSchemaTypePtr(n_type, type, 0);
35060        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35061        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35062        des_xmlNodePtr(n_node, node, 3);
35063        xmlResetLastError();
35064        if (mem_base != xmlMemBlocks()) {
35065            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35066	           xmlMemBlocks() - mem_base);
35067	    test_ret++;
35068            printf(" %d", n_type);
35069            printf(" %d", n_value);
35070            printf(" %d", n_val);
35071            printf(" %d", n_node);
35072            printf("\n");
35073        }
35074    }
35075    }
35076    }
35077    }
35078    function_tests++;
35079#endif
35080
35081    return(test_ret);
35082}
35083
35084
35085static int
35086test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35087    int test_ret = 0;
35088
35089#if defined(LIBXML_SCHEMAS_ENABLED)
35090    int mem_base;
35091    int ret_val;
35092    xmlSchemaTypePtr type; /* the predefined type */
35093    int n_type;
35094    xmlChar * value; /* the value to check */
35095    int n_value;
35096    xmlSchemaValPtr * val; /* the return computed value */
35097    int n_val;
35098    xmlNodePtr node; /* the node containing the value */
35099    int n_node;
35100
35101    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35102    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35103    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35104    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35105        mem_base = xmlMemBlocks();
35106        type = gen_xmlSchemaTypePtr(n_type, 0);
35107        value = gen_const_xmlChar_ptr(n_value, 1);
35108        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35109        node = gen_xmlNodePtr(n_node, 3);
35110
35111        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35112        desret_int(ret_val);
35113        call_tests++;
35114        des_xmlSchemaTypePtr(n_type, type, 0);
35115        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35116        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35117        des_xmlNodePtr(n_node, node, 3);
35118        xmlResetLastError();
35119        if (mem_base != xmlMemBlocks()) {
35120            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35121	           xmlMemBlocks() - mem_base);
35122	    test_ret++;
35123            printf(" %d", n_type);
35124            printf(" %d", n_value);
35125            printf(" %d", n_val);
35126            printf(" %d", n_node);
35127            printf("\n");
35128        }
35129    }
35130    }
35131    }
35132    }
35133    function_tests++;
35134#endif
35135
35136    return(test_ret);
35137}
35138
35139
35140static int
35141test_xmlSchemaValidateFacet(void) {
35142    int test_ret = 0;
35143
35144#if defined(LIBXML_SCHEMAS_ENABLED)
35145    int mem_base;
35146    int ret_val;
35147    xmlSchemaTypePtr base; /* the base type */
35148    int n_base;
35149    xmlSchemaFacetPtr facet; /* the facet to check */
35150    int n_facet;
35151    xmlChar * value; /* the lexical repr of the value to validate */
35152    int n_value;
35153    xmlSchemaValPtr val; /* the precomputed value */
35154    int n_val;
35155
35156    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35157    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35158    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35159    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35160        mem_base = xmlMemBlocks();
35161        base = gen_xmlSchemaTypePtr(n_base, 0);
35162        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35163        value = gen_const_xmlChar_ptr(n_value, 2);
35164        val = gen_xmlSchemaValPtr(n_val, 3);
35165
35166        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35167        desret_int(ret_val);
35168        call_tests++;
35169        des_xmlSchemaTypePtr(n_base, base, 0);
35170        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35171        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35172        des_xmlSchemaValPtr(n_val, val, 3);
35173        xmlResetLastError();
35174        if (mem_base != xmlMemBlocks()) {
35175            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35176	           xmlMemBlocks() - mem_base);
35177	    test_ret++;
35178            printf(" %d", n_base);
35179            printf(" %d", n_facet);
35180            printf(" %d", n_value);
35181            printf(" %d", n_val);
35182            printf("\n");
35183        }
35184    }
35185    }
35186    }
35187    }
35188    function_tests++;
35189#endif
35190
35191    return(test_ret);
35192}
35193
35194
35195static int
35196test_xmlSchemaValidateFacetWhtsp(void) {
35197    int test_ret = 0;
35198
35199#if defined(LIBXML_SCHEMAS_ENABLED)
35200    int mem_base;
35201    int ret_val;
35202    xmlSchemaFacetPtr facet; /* the facet to check */
35203    int n_facet;
35204    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35205    int n_fws;
35206    xmlSchemaValType valType; /* the built-in type of the value */
35207    int n_valType;
35208    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35209    int n_value;
35210    xmlSchemaValPtr val; /* the precomputed value */
35211    int n_val;
35212    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35213    int n_ws;
35214
35215    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35216    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35217    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35218    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35219    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35220    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35221        mem_base = xmlMemBlocks();
35222        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35223        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35224        valType = gen_xmlSchemaValType(n_valType, 2);
35225        value = gen_const_xmlChar_ptr(n_value, 3);
35226        val = gen_xmlSchemaValPtr(n_val, 4);
35227        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35228
35229        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35230        desret_int(ret_val);
35231        call_tests++;
35232        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35233        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35234        des_xmlSchemaValType(n_valType, valType, 2);
35235        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35236        des_xmlSchemaValPtr(n_val, val, 4);
35237        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35238        xmlResetLastError();
35239        if (mem_base != xmlMemBlocks()) {
35240            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35241	           xmlMemBlocks() - mem_base);
35242	    test_ret++;
35243            printf(" %d", n_facet);
35244            printf(" %d", n_fws);
35245            printf(" %d", n_valType);
35246            printf(" %d", n_value);
35247            printf(" %d", n_val);
35248            printf(" %d", n_ws);
35249            printf("\n");
35250        }
35251    }
35252    }
35253    }
35254    }
35255    }
35256    }
35257    function_tests++;
35258#endif
35259
35260    return(test_ret);
35261}
35262
35263
35264static int
35265test_xmlSchemaValidateLengthFacet(void) {
35266    int test_ret = 0;
35267
35268#if defined(LIBXML_SCHEMAS_ENABLED)
35269    int mem_base;
35270    int ret_val;
35271    xmlSchemaTypePtr type; /* the built-in type */
35272    int n_type;
35273    xmlSchemaFacetPtr facet; /* the facet to check */
35274    int n_facet;
35275    xmlChar * value; /* the lexical repr. of the value to be validated */
35276    int n_value;
35277    xmlSchemaValPtr val; /* the precomputed value */
35278    int n_val;
35279    unsigned long * length; /* the actual length of the value */
35280    int n_length;
35281
35282    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35283    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35284    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35285    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35286    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35287        mem_base = xmlMemBlocks();
35288        type = gen_xmlSchemaTypePtr(n_type, 0);
35289        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35290        value = gen_const_xmlChar_ptr(n_value, 2);
35291        val = gen_xmlSchemaValPtr(n_val, 3);
35292        length = gen_unsigned_long_ptr(n_length, 4);
35293
35294        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35295        desret_int(ret_val);
35296        call_tests++;
35297        des_xmlSchemaTypePtr(n_type, type, 0);
35298        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35299        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35300        des_xmlSchemaValPtr(n_val, val, 3);
35301        des_unsigned_long_ptr(n_length, length, 4);
35302        xmlResetLastError();
35303        if (mem_base != xmlMemBlocks()) {
35304            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35305	           xmlMemBlocks() - mem_base);
35306	    test_ret++;
35307            printf(" %d", n_type);
35308            printf(" %d", n_facet);
35309            printf(" %d", n_value);
35310            printf(" %d", n_val);
35311            printf(" %d", n_length);
35312            printf("\n");
35313        }
35314    }
35315    }
35316    }
35317    }
35318    }
35319    function_tests++;
35320#endif
35321
35322    return(test_ret);
35323}
35324
35325
35326static int
35327test_xmlSchemaValidateLengthFacetWhtsp(void) {
35328    int test_ret = 0;
35329
35330#if defined(LIBXML_SCHEMAS_ENABLED)
35331    int mem_base;
35332    int ret_val;
35333    xmlSchemaFacetPtr facet; /* the facet to check */
35334    int n_facet;
35335    xmlSchemaValType valType; /* the built-in type */
35336    int n_valType;
35337    xmlChar * value; /* the lexical repr. of the value to be validated */
35338    int n_value;
35339    xmlSchemaValPtr val; /* the precomputed value */
35340    int n_val;
35341    unsigned long * length; /* the actual length of the value */
35342    int n_length;
35343    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35344    int n_ws;
35345
35346    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35347    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35348    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35349    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35350    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35351    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35352        mem_base = xmlMemBlocks();
35353        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35354        valType = gen_xmlSchemaValType(n_valType, 1);
35355        value = gen_const_xmlChar_ptr(n_value, 2);
35356        val = gen_xmlSchemaValPtr(n_val, 3);
35357        length = gen_unsigned_long_ptr(n_length, 4);
35358        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35359
35360        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35361        desret_int(ret_val);
35362        call_tests++;
35363        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35364        des_xmlSchemaValType(n_valType, valType, 1);
35365        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35366        des_xmlSchemaValPtr(n_val, val, 3);
35367        des_unsigned_long_ptr(n_length, length, 4);
35368        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35369        xmlResetLastError();
35370        if (mem_base != xmlMemBlocks()) {
35371            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35372	           xmlMemBlocks() - mem_base);
35373	    test_ret++;
35374            printf(" %d", n_facet);
35375            printf(" %d", n_valType);
35376            printf(" %d", n_value);
35377            printf(" %d", n_val);
35378            printf(" %d", n_length);
35379            printf(" %d", n_ws);
35380            printf("\n");
35381        }
35382    }
35383    }
35384    }
35385    }
35386    }
35387    }
35388    function_tests++;
35389#endif
35390
35391    return(test_ret);
35392}
35393
35394
35395static int
35396test_xmlSchemaValidateListSimpleTypeFacet(void) {
35397    int test_ret = 0;
35398
35399#if defined(LIBXML_SCHEMAS_ENABLED)
35400    int mem_base;
35401    int ret_val;
35402    xmlSchemaFacetPtr facet; /* the facet to check */
35403    int n_facet;
35404    xmlChar * value; /* the lexical repr of the value to validate */
35405    int n_value;
35406    unsigned long actualLen; /* the number of list items */
35407    int n_actualLen;
35408    unsigned long * expectedLen; /* the resulting expected number of list items */
35409    int n_expectedLen;
35410
35411    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35412    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35413    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35414    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35415        mem_base = xmlMemBlocks();
35416        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35417        value = gen_const_xmlChar_ptr(n_value, 1);
35418        actualLen = gen_unsigned_long(n_actualLen, 2);
35419        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35420
35421        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35422        desret_int(ret_val);
35423        call_tests++;
35424        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35425        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35426        des_unsigned_long(n_actualLen, actualLen, 2);
35427        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35428        xmlResetLastError();
35429        if (mem_base != xmlMemBlocks()) {
35430            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35431	           xmlMemBlocks() - mem_base);
35432	    test_ret++;
35433            printf(" %d", n_facet);
35434            printf(" %d", n_value);
35435            printf(" %d", n_actualLen);
35436            printf(" %d", n_expectedLen);
35437            printf("\n");
35438        }
35439    }
35440    }
35441    }
35442    }
35443    function_tests++;
35444#endif
35445
35446    return(test_ret);
35447}
35448
35449
35450static int
35451test_xmlSchemaValidatePredefinedType(void) {
35452    int test_ret = 0;
35453
35454#if defined(LIBXML_SCHEMAS_ENABLED)
35455    int mem_base;
35456    int ret_val;
35457    xmlSchemaTypePtr type; /* the predefined type */
35458    int n_type;
35459    xmlChar * value; /* the value to check */
35460    int n_value;
35461    xmlSchemaValPtr * val; /* the return computed value */
35462    int n_val;
35463
35464    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35465    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35466    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35467        mem_base = xmlMemBlocks();
35468        type = gen_xmlSchemaTypePtr(n_type, 0);
35469        value = gen_const_xmlChar_ptr(n_value, 1);
35470        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35471
35472        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35473        desret_int(ret_val);
35474        call_tests++;
35475        des_xmlSchemaTypePtr(n_type, type, 0);
35476        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35477        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35478        xmlResetLastError();
35479        if (mem_base != xmlMemBlocks()) {
35480            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35481	           xmlMemBlocks() - mem_base);
35482	    test_ret++;
35483            printf(" %d", n_type);
35484            printf(" %d", n_value);
35485            printf(" %d", n_val);
35486            printf("\n");
35487        }
35488    }
35489    }
35490    }
35491    function_tests++;
35492#endif
35493
35494    return(test_ret);
35495}
35496
35497
35498static int
35499test_xmlSchemaValueAppend(void) {
35500    int test_ret = 0;
35501
35502#if defined(LIBXML_SCHEMAS_ENABLED)
35503    int mem_base;
35504    int ret_val;
35505    xmlSchemaValPtr prev; /* the value */
35506    int n_prev;
35507    xmlSchemaValPtr cur; /* the value to be appended */
35508    int n_cur;
35509
35510    for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35511    for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35512        mem_base = xmlMemBlocks();
35513        prev = gen_xmlSchemaValPtr(n_prev, 0);
35514        cur = gen_xmlSchemaValPtr(n_cur, 1);
35515
35516        ret_val = xmlSchemaValueAppend(prev, cur);
35517        desret_int(ret_val);
35518        call_tests++;
35519        des_xmlSchemaValPtr(n_prev, prev, 0);
35520        des_xmlSchemaValPtr(n_cur, cur, 1);
35521        xmlResetLastError();
35522        if (mem_base != xmlMemBlocks()) {
35523            printf("Leak of %d blocks found in xmlSchemaValueAppend",
35524	           xmlMemBlocks() - mem_base);
35525	    test_ret++;
35526            printf(" %d", n_prev);
35527            printf(" %d", n_cur);
35528            printf("\n");
35529        }
35530    }
35531    }
35532    function_tests++;
35533#endif
35534
35535    return(test_ret);
35536}
35537
35538
35539static int
35540test_xmlSchemaValueGetAsBoolean(void) {
35541    int test_ret = 0;
35542
35543#if defined(LIBXML_SCHEMAS_ENABLED)
35544    int mem_base;
35545    int ret_val;
35546    xmlSchemaValPtr val; /* the value */
35547    int n_val;
35548
35549    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35550        mem_base = xmlMemBlocks();
35551        val = gen_xmlSchemaValPtr(n_val, 0);
35552
35553        ret_val = xmlSchemaValueGetAsBoolean(val);
35554        desret_int(ret_val);
35555        call_tests++;
35556        des_xmlSchemaValPtr(n_val, val, 0);
35557        xmlResetLastError();
35558        if (mem_base != xmlMemBlocks()) {
35559            printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35560	           xmlMemBlocks() - mem_base);
35561	    test_ret++;
35562            printf(" %d", n_val);
35563            printf("\n");
35564        }
35565    }
35566    function_tests++;
35567#endif
35568
35569    return(test_ret);
35570}
35571
35572
35573static int
35574test_xmlSchemaValueGetAsString(void) {
35575    int test_ret = 0;
35576
35577#if defined(LIBXML_SCHEMAS_ENABLED)
35578    int mem_base;
35579    const xmlChar * ret_val;
35580    xmlSchemaValPtr val; /* the value */
35581    int n_val;
35582
35583    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35584        mem_base = xmlMemBlocks();
35585        val = gen_xmlSchemaValPtr(n_val, 0);
35586
35587        ret_val = xmlSchemaValueGetAsString(val);
35588        desret_const_xmlChar_ptr(ret_val);
35589        call_tests++;
35590        des_xmlSchemaValPtr(n_val, val, 0);
35591        xmlResetLastError();
35592        if (mem_base != xmlMemBlocks()) {
35593            printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35594	           xmlMemBlocks() - mem_base);
35595	    test_ret++;
35596            printf(" %d", n_val);
35597            printf("\n");
35598        }
35599    }
35600    function_tests++;
35601#endif
35602
35603    return(test_ret);
35604}
35605
35606
35607static int
35608test_xmlSchemaValueGetNext(void) {
35609    int test_ret = 0;
35610
35611
35612    /* missing type support */
35613    return(test_ret);
35614}
35615
35616
35617static int
35618test_xmlSchemaWhiteSpaceReplace(void) {
35619    int test_ret = 0;
35620
35621#if defined(LIBXML_SCHEMAS_ENABLED)
35622    int mem_base;
35623    xmlChar * ret_val;
35624    xmlChar * value; /* a value */
35625    int n_value;
35626
35627    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35628        mem_base = xmlMemBlocks();
35629        value = gen_const_xmlChar_ptr(n_value, 0);
35630
35631        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35632        desret_xmlChar_ptr(ret_val);
35633        call_tests++;
35634        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35635        xmlResetLastError();
35636        if (mem_base != xmlMemBlocks()) {
35637            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35638	           xmlMemBlocks() - mem_base);
35639	    test_ret++;
35640            printf(" %d", n_value);
35641            printf("\n");
35642        }
35643    }
35644    function_tests++;
35645#endif
35646
35647    return(test_ret);
35648}
35649
35650static int
35651test_xmlschemastypes(void) {
35652    int test_ret = 0;
35653
35654    if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35655    test_ret += test_xmlSchemaCheckFacet();
35656    test_ret += test_xmlSchemaCleanupTypes();
35657    test_ret += test_xmlSchemaCollapseString();
35658    test_ret += test_xmlSchemaCompareValues();
35659    test_ret += test_xmlSchemaCompareValuesWhtsp();
35660    test_ret += test_xmlSchemaCopyValue();
35661    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35662    test_ret += test_xmlSchemaGetBuiltInType();
35663    test_ret += test_xmlSchemaGetCanonValue();
35664    test_ret += test_xmlSchemaGetCanonValueWhtsp();
35665    test_ret += test_xmlSchemaGetFacetValueAsULong();
35666    test_ret += test_xmlSchemaGetPredefinedType();
35667    test_ret += test_xmlSchemaGetValType();
35668    test_ret += test_xmlSchemaInitTypes();
35669    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35670    test_ret += test_xmlSchemaNewFacet();
35671    test_ret += test_xmlSchemaNewNOTATIONValue();
35672    test_ret += test_xmlSchemaNewQNameValue();
35673    test_ret += test_xmlSchemaNewStringValue();
35674    test_ret += test_xmlSchemaValPredefTypeNode();
35675    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35676    test_ret += test_xmlSchemaValidateFacet();
35677    test_ret += test_xmlSchemaValidateFacetWhtsp();
35678    test_ret += test_xmlSchemaValidateLengthFacet();
35679    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35680    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35681    test_ret += test_xmlSchemaValidatePredefinedType();
35682    test_ret += test_xmlSchemaValueAppend();
35683    test_ret += test_xmlSchemaValueGetAsBoolean();
35684    test_ret += test_xmlSchemaValueGetAsString();
35685    test_ret += test_xmlSchemaValueGetNext();
35686    test_ret += test_xmlSchemaWhiteSpaceReplace();
35687
35688    if (test_ret != 0)
35689	printf("Module xmlschemastypes: %d errors\n", test_ret);
35690    return(test_ret);
35691}
35692
35693static int
35694test_xmlCharStrdup(void) {
35695    int test_ret = 0;
35696
35697    int mem_base;
35698    xmlChar * ret_val;
35699    char * cur; /* the input char * */
35700    int n_cur;
35701
35702    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35703        mem_base = xmlMemBlocks();
35704        cur = gen_const_char_ptr(n_cur, 0);
35705
35706        ret_val = xmlCharStrdup((const char *)cur);
35707        desret_xmlChar_ptr(ret_val);
35708        call_tests++;
35709        des_const_char_ptr(n_cur, (const char *)cur, 0);
35710        xmlResetLastError();
35711        if (mem_base != xmlMemBlocks()) {
35712            printf("Leak of %d blocks found in xmlCharStrdup",
35713	           xmlMemBlocks() - mem_base);
35714	    test_ret++;
35715            printf(" %d", n_cur);
35716            printf("\n");
35717        }
35718    }
35719    function_tests++;
35720
35721    return(test_ret);
35722}
35723
35724
35725static int
35726test_xmlCharStrndup(void) {
35727    int test_ret = 0;
35728
35729    int mem_base;
35730    xmlChar * ret_val;
35731    char * cur; /* the input char * */
35732    int n_cur;
35733    int len; /* the len of @cur */
35734    int n_len;
35735
35736    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35737    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35738        mem_base = xmlMemBlocks();
35739        cur = gen_const_char_ptr(n_cur, 0);
35740        len = gen_int(n_len, 1);
35741
35742        ret_val = xmlCharStrndup((const char *)cur, len);
35743        desret_xmlChar_ptr(ret_val);
35744        call_tests++;
35745        des_const_char_ptr(n_cur, (const char *)cur, 0);
35746        des_int(n_len, len, 1);
35747        xmlResetLastError();
35748        if (mem_base != xmlMemBlocks()) {
35749            printf("Leak of %d blocks found in xmlCharStrndup",
35750	           xmlMemBlocks() - mem_base);
35751	    test_ret++;
35752            printf(" %d", n_cur);
35753            printf(" %d", n_len);
35754            printf("\n");
35755        }
35756    }
35757    }
35758    function_tests++;
35759
35760    return(test_ret);
35761}
35762
35763
35764static int
35765test_xmlCheckUTF8(void) {
35766    int test_ret = 0;
35767
35768    int mem_base;
35769    int ret_val;
35770    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35771    int n_utf;
35772
35773    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35774        mem_base = xmlMemBlocks();
35775        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35776
35777        ret_val = xmlCheckUTF8((const unsigned char *)utf);
35778        desret_int(ret_val);
35779        call_tests++;
35780        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35781        xmlResetLastError();
35782        if (mem_base != xmlMemBlocks()) {
35783            printf("Leak of %d blocks found in xmlCheckUTF8",
35784	           xmlMemBlocks() - mem_base);
35785	    test_ret++;
35786            printf(" %d", n_utf);
35787            printf("\n");
35788        }
35789    }
35790    function_tests++;
35791
35792    return(test_ret);
35793}
35794
35795
35796static int
35797test_xmlGetUTF8Char(void) {
35798    int test_ret = 0;
35799
35800    int mem_base;
35801    int ret_val;
35802    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35803    int n_utf;
35804    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. */
35805    int n_len;
35806
35807    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35808    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35809        mem_base = xmlMemBlocks();
35810        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35811        len = gen_int_ptr(n_len, 1);
35812
35813        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35814        desret_int(ret_val);
35815        call_tests++;
35816        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35817        des_int_ptr(n_len, len, 1);
35818        xmlResetLastError();
35819        if (mem_base != xmlMemBlocks()) {
35820            printf("Leak of %d blocks found in xmlGetUTF8Char",
35821	           xmlMemBlocks() - mem_base);
35822	    test_ret++;
35823            printf(" %d", n_utf);
35824            printf(" %d", n_len);
35825            printf("\n");
35826        }
35827    }
35828    }
35829    function_tests++;
35830
35831    return(test_ret);
35832}
35833
35834
35835static int
35836test_xmlStrEqual(void) {
35837    int test_ret = 0;
35838
35839    int mem_base;
35840    int ret_val;
35841    xmlChar * str1; /* the first xmlChar * */
35842    int n_str1;
35843    xmlChar * str2; /* the second xmlChar * */
35844    int n_str2;
35845
35846    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35847    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35848        mem_base = xmlMemBlocks();
35849        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35850        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35851
35852        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
35853        desret_int(ret_val);
35854        call_tests++;
35855        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35856        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35857        xmlResetLastError();
35858        if (mem_base != xmlMemBlocks()) {
35859            printf("Leak of %d blocks found in xmlStrEqual",
35860	           xmlMemBlocks() - mem_base);
35861	    test_ret++;
35862            printf(" %d", n_str1);
35863            printf(" %d", n_str2);
35864            printf("\n");
35865        }
35866    }
35867    }
35868    function_tests++;
35869
35870    return(test_ret);
35871}
35872
35873
35874static int
35875test_xmlStrPrintf(void) {
35876    int test_ret = 0;
35877
35878
35879    /* missing type support */
35880    return(test_ret);
35881}
35882
35883
35884static int
35885test_xmlStrQEqual(void) {
35886    int test_ret = 0;
35887
35888    int mem_base;
35889    int ret_val;
35890    xmlChar * pref; /* the prefix of the QName */
35891    int n_pref;
35892    xmlChar * name; /* the localname of the QName */
35893    int n_name;
35894    xmlChar * str; /* the second xmlChar * */
35895    int n_str;
35896
35897    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
35898    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35899    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35900        mem_base = xmlMemBlocks();
35901        pref = gen_const_xmlChar_ptr(n_pref, 0);
35902        name = gen_const_xmlChar_ptr(n_name, 1);
35903        str = gen_const_xmlChar_ptr(n_str, 2);
35904
35905        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
35906        desret_int(ret_val);
35907        call_tests++;
35908        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
35909        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
35910        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
35911        xmlResetLastError();
35912        if (mem_base != xmlMemBlocks()) {
35913            printf("Leak of %d blocks found in xmlStrQEqual",
35914	           xmlMemBlocks() - mem_base);
35915	    test_ret++;
35916            printf(" %d", n_pref);
35917            printf(" %d", n_name);
35918            printf(" %d", n_str);
35919            printf("\n");
35920        }
35921    }
35922    }
35923    }
35924    function_tests++;
35925
35926    return(test_ret);
35927}
35928
35929
35930static int
35931test_xmlStrVPrintf(void) {
35932    int test_ret = 0;
35933
35934
35935    /* missing type support */
35936    return(test_ret);
35937}
35938
35939
35940static int
35941test_xmlStrcasecmp(void) {
35942    int test_ret = 0;
35943
35944    int mem_base;
35945    int ret_val;
35946    xmlChar * str1; /* the first xmlChar * */
35947    int n_str1;
35948    xmlChar * str2; /* the second xmlChar * */
35949    int n_str2;
35950
35951    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35952    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35953        mem_base = xmlMemBlocks();
35954        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35955        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35956
35957        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
35958        desret_int(ret_val);
35959        call_tests++;
35960        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35961        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35962        xmlResetLastError();
35963        if (mem_base != xmlMemBlocks()) {
35964            printf("Leak of %d blocks found in xmlStrcasecmp",
35965	           xmlMemBlocks() - mem_base);
35966	    test_ret++;
35967            printf(" %d", n_str1);
35968            printf(" %d", n_str2);
35969            printf("\n");
35970        }
35971    }
35972    }
35973    function_tests++;
35974
35975    return(test_ret);
35976}
35977
35978
35979static int
35980test_xmlStrcasestr(void) {
35981    int test_ret = 0;
35982
35983    int mem_base;
35984    const xmlChar * ret_val;
35985    xmlChar * str; /* the xmlChar * array (haystack) */
35986    int n_str;
35987    xmlChar * val; /* the xmlChar to search (needle) */
35988    int n_val;
35989
35990    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35991    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
35992        mem_base = xmlMemBlocks();
35993        str = gen_const_xmlChar_ptr(n_str, 0);
35994        val = gen_xmlChar_ptr(n_val, 1);
35995
35996        ret_val = xmlStrcasestr((const xmlChar *)str, val);
35997        desret_const_xmlChar_ptr(ret_val);
35998        call_tests++;
35999        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36000        des_xmlChar_ptr(n_val, val, 1);
36001        xmlResetLastError();
36002        if (mem_base != xmlMemBlocks()) {
36003            printf("Leak of %d blocks found in xmlStrcasestr",
36004	           xmlMemBlocks() - mem_base);
36005	    test_ret++;
36006            printf(" %d", n_str);
36007            printf(" %d", n_val);
36008            printf("\n");
36009        }
36010    }
36011    }
36012    function_tests++;
36013
36014    return(test_ret);
36015}
36016
36017
36018static int
36019test_xmlStrchr(void) {
36020    int test_ret = 0;
36021
36022    int mem_base;
36023    const xmlChar * ret_val;
36024    xmlChar * str; /* the xmlChar * array */
36025    int n_str;
36026    xmlChar val; /* the xmlChar to search */
36027    int n_val;
36028
36029    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36030    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36031        mem_base = xmlMemBlocks();
36032        str = gen_const_xmlChar_ptr(n_str, 0);
36033        val = gen_xmlChar(n_val, 1);
36034
36035        ret_val = xmlStrchr((const xmlChar *)str, val);
36036        desret_const_xmlChar_ptr(ret_val);
36037        call_tests++;
36038        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36039        des_xmlChar(n_val, val, 1);
36040        xmlResetLastError();
36041        if (mem_base != xmlMemBlocks()) {
36042            printf("Leak of %d blocks found in xmlStrchr",
36043	           xmlMemBlocks() - mem_base);
36044	    test_ret++;
36045            printf(" %d", n_str);
36046            printf(" %d", n_val);
36047            printf("\n");
36048        }
36049    }
36050    }
36051    function_tests++;
36052
36053    return(test_ret);
36054}
36055
36056
36057static int
36058test_xmlStrcmp(void) {
36059    int test_ret = 0;
36060
36061    int mem_base;
36062    int ret_val;
36063    xmlChar * str1; /* the first xmlChar * */
36064    int n_str1;
36065    xmlChar * str2; /* the second xmlChar * */
36066    int n_str2;
36067
36068    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36069    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36070        mem_base = xmlMemBlocks();
36071        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36072        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36073
36074        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36075        desret_int(ret_val);
36076        call_tests++;
36077        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36078        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36079        xmlResetLastError();
36080        if (mem_base != xmlMemBlocks()) {
36081            printf("Leak of %d blocks found in xmlStrcmp",
36082	           xmlMemBlocks() - mem_base);
36083	    test_ret++;
36084            printf(" %d", n_str1);
36085            printf(" %d", n_str2);
36086            printf("\n");
36087        }
36088    }
36089    }
36090    function_tests++;
36091
36092    return(test_ret);
36093}
36094
36095
36096static int
36097test_xmlStrdup(void) {
36098    int test_ret = 0;
36099
36100    int mem_base;
36101    xmlChar * ret_val;
36102    xmlChar * cur; /* the input xmlChar * */
36103    int n_cur;
36104
36105    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36106        mem_base = xmlMemBlocks();
36107        cur = gen_const_xmlChar_ptr(n_cur, 0);
36108
36109        ret_val = xmlStrdup((const xmlChar *)cur);
36110        desret_xmlChar_ptr(ret_val);
36111        call_tests++;
36112        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36113        xmlResetLastError();
36114        if (mem_base != xmlMemBlocks()) {
36115            printf("Leak of %d blocks found in xmlStrdup",
36116	           xmlMemBlocks() - mem_base);
36117	    test_ret++;
36118            printf(" %d", n_cur);
36119            printf("\n");
36120        }
36121    }
36122    function_tests++;
36123
36124    return(test_ret);
36125}
36126
36127
36128static int
36129test_xmlStrlen(void) {
36130    int test_ret = 0;
36131
36132    int mem_base;
36133    int ret_val;
36134    xmlChar * str; /* the xmlChar * array */
36135    int n_str;
36136
36137    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36138        mem_base = xmlMemBlocks();
36139        str = gen_const_xmlChar_ptr(n_str, 0);
36140
36141        ret_val = xmlStrlen((const xmlChar *)str);
36142        desret_int(ret_val);
36143        call_tests++;
36144        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36145        xmlResetLastError();
36146        if (mem_base != xmlMemBlocks()) {
36147            printf("Leak of %d blocks found in xmlStrlen",
36148	           xmlMemBlocks() - mem_base);
36149	    test_ret++;
36150            printf(" %d", n_str);
36151            printf("\n");
36152        }
36153    }
36154    function_tests++;
36155
36156    return(test_ret);
36157}
36158
36159
36160static int
36161test_xmlStrncasecmp(void) {
36162    int test_ret = 0;
36163
36164    int mem_base;
36165    int ret_val;
36166    xmlChar * str1; /* the first xmlChar * */
36167    int n_str1;
36168    xmlChar * str2; /* the second xmlChar * */
36169    int n_str2;
36170    int len; /* the max comparison length */
36171    int n_len;
36172
36173    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36174    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36175    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36176        mem_base = xmlMemBlocks();
36177        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36178        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36179        len = gen_int(n_len, 2);
36180
36181        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36182        desret_int(ret_val);
36183        call_tests++;
36184        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36185        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36186        des_int(n_len, len, 2);
36187        xmlResetLastError();
36188        if (mem_base != xmlMemBlocks()) {
36189            printf("Leak of %d blocks found in xmlStrncasecmp",
36190	           xmlMemBlocks() - mem_base);
36191	    test_ret++;
36192            printf(" %d", n_str1);
36193            printf(" %d", n_str2);
36194            printf(" %d", n_len);
36195            printf("\n");
36196        }
36197    }
36198    }
36199    }
36200    function_tests++;
36201
36202    return(test_ret);
36203}
36204
36205
36206static int
36207test_xmlStrncatNew(void) {
36208    int test_ret = 0;
36209
36210    int mem_base;
36211    xmlChar * ret_val;
36212    xmlChar * str1; /* first xmlChar string */
36213    int n_str1;
36214    xmlChar * str2; /* second xmlChar string */
36215    int n_str2;
36216    int len; /* the len of @str2 or < 0 */
36217    int n_len;
36218
36219    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36220    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36221    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36222        mem_base = xmlMemBlocks();
36223        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36224        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36225        len = gen_int(n_len, 2);
36226
36227        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36228        desret_xmlChar_ptr(ret_val);
36229        call_tests++;
36230        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36231        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36232        des_int(n_len, len, 2);
36233        xmlResetLastError();
36234        if (mem_base != xmlMemBlocks()) {
36235            printf("Leak of %d blocks found in xmlStrncatNew",
36236	           xmlMemBlocks() - mem_base);
36237	    test_ret++;
36238            printf(" %d", n_str1);
36239            printf(" %d", n_str2);
36240            printf(" %d", n_len);
36241            printf("\n");
36242        }
36243    }
36244    }
36245    }
36246    function_tests++;
36247
36248    return(test_ret);
36249}
36250
36251
36252static int
36253test_xmlStrncmp(void) {
36254    int test_ret = 0;
36255
36256    int mem_base;
36257    int ret_val;
36258    xmlChar * str1; /* the first xmlChar * */
36259    int n_str1;
36260    xmlChar * str2; /* the second xmlChar * */
36261    int n_str2;
36262    int len; /* the max comparison length */
36263    int n_len;
36264
36265    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36266    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36267    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36268        mem_base = xmlMemBlocks();
36269        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36270        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36271        len = gen_int(n_len, 2);
36272
36273        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36274        desret_int(ret_val);
36275        call_tests++;
36276        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36277        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36278        des_int(n_len, len, 2);
36279        xmlResetLastError();
36280        if (mem_base != xmlMemBlocks()) {
36281            printf("Leak of %d blocks found in xmlStrncmp",
36282	           xmlMemBlocks() - mem_base);
36283	    test_ret++;
36284            printf(" %d", n_str1);
36285            printf(" %d", n_str2);
36286            printf(" %d", n_len);
36287            printf("\n");
36288        }
36289    }
36290    }
36291    }
36292    function_tests++;
36293
36294    return(test_ret);
36295}
36296
36297
36298static int
36299test_xmlStrndup(void) {
36300    int test_ret = 0;
36301
36302    int mem_base;
36303    xmlChar * ret_val;
36304    xmlChar * cur; /* the input xmlChar * */
36305    int n_cur;
36306    int len; /* the len of @cur */
36307    int n_len;
36308
36309    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36310    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36311        mem_base = xmlMemBlocks();
36312        cur = gen_const_xmlChar_ptr(n_cur, 0);
36313        len = gen_int(n_len, 1);
36314
36315        ret_val = xmlStrndup((const xmlChar *)cur, len);
36316        desret_xmlChar_ptr(ret_val);
36317        call_tests++;
36318        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36319        des_int(n_len, len, 1);
36320        xmlResetLastError();
36321        if (mem_base != xmlMemBlocks()) {
36322            printf("Leak of %d blocks found in xmlStrndup",
36323	           xmlMemBlocks() - mem_base);
36324	    test_ret++;
36325            printf(" %d", n_cur);
36326            printf(" %d", n_len);
36327            printf("\n");
36328        }
36329    }
36330    }
36331    function_tests++;
36332
36333    return(test_ret);
36334}
36335
36336
36337static int
36338test_xmlStrstr(void) {
36339    int test_ret = 0;
36340
36341    int mem_base;
36342    const xmlChar * ret_val;
36343    xmlChar * str; /* the xmlChar * array (haystack) */
36344    int n_str;
36345    xmlChar * val; /* the xmlChar to search (needle) */
36346    int n_val;
36347
36348    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36349    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36350        mem_base = xmlMemBlocks();
36351        str = gen_const_xmlChar_ptr(n_str, 0);
36352        val = gen_const_xmlChar_ptr(n_val, 1);
36353
36354        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36355        desret_const_xmlChar_ptr(ret_val);
36356        call_tests++;
36357        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36358        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36359        xmlResetLastError();
36360        if (mem_base != xmlMemBlocks()) {
36361            printf("Leak of %d blocks found in xmlStrstr",
36362	           xmlMemBlocks() - mem_base);
36363	    test_ret++;
36364            printf(" %d", n_str);
36365            printf(" %d", n_val);
36366            printf("\n");
36367        }
36368    }
36369    }
36370    function_tests++;
36371
36372    return(test_ret);
36373}
36374
36375
36376static int
36377test_xmlStrsub(void) {
36378    int test_ret = 0;
36379
36380    int mem_base;
36381    xmlChar * ret_val;
36382    xmlChar * str; /* the xmlChar * array (haystack) */
36383    int n_str;
36384    int start; /* the index of the first char (zero based) */
36385    int n_start;
36386    int len; /* the length of the substring */
36387    int n_len;
36388
36389    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36390    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36391    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36392        mem_base = xmlMemBlocks();
36393        str = gen_const_xmlChar_ptr(n_str, 0);
36394        start = gen_int(n_start, 1);
36395        len = gen_int(n_len, 2);
36396
36397        ret_val = xmlStrsub((const xmlChar *)str, start, len);
36398        desret_xmlChar_ptr(ret_val);
36399        call_tests++;
36400        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36401        des_int(n_start, start, 1);
36402        des_int(n_len, len, 2);
36403        xmlResetLastError();
36404        if (mem_base != xmlMemBlocks()) {
36405            printf("Leak of %d blocks found in xmlStrsub",
36406	           xmlMemBlocks() - mem_base);
36407	    test_ret++;
36408            printf(" %d", n_str);
36409            printf(" %d", n_start);
36410            printf(" %d", n_len);
36411            printf("\n");
36412        }
36413    }
36414    }
36415    }
36416    function_tests++;
36417
36418    return(test_ret);
36419}
36420
36421
36422static int
36423test_xmlUTF8Charcmp(void) {
36424    int test_ret = 0;
36425
36426    int mem_base;
36427    int ret_val;
36428    xmlChar * utf1; /* pointer to first UTF8 char */
36429    int n_utf1;
36430    xmlChar * utf2; /* pointer to second UTF8 char */
36431    int n_utf2;
36432
36433    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36434    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36435        mem_base = xmlMemBlocks();
36436        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36437        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36438
36439        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36440        desret_int(ret_val);
36441        call_tests++;
36442        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36443        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36444        xmlResetLastError();
36445        if (mem_base != xmlMemBlocks()) {
36446            printf("Leak of %d blocks found in xmlUTF8Charcmp",
36447	           xmlMemBlocks() - mem_base);
36448	    test_ret++;
36449            printf(" %d", n_utf1);
36450            printf(" %d", n_utf2);
36451            printf("\n");
36452        }
36453    }
36454    }
36455    function_tests++;
36456
36457    return(test_ret);
36458}
36459
36460
36461static int
36462test_xmlUTF8Size(void) {
36463    int test_ret = 0;
36464
36465    int mem_base;
36466    int ret_val;
36467    xmlChar * utf; /* pointer to the UTF8 character */
36468    int n_utf;
36469
36470    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36471        mem_base = xmlMemBlocks();
36472        utf = gen_const_xmlChar_ptr(n_utf, 0);
36473
36474        ret_val = xmlUTF8Size((const xmlChar *)utf);
36475        desret_int(ret_val);
36476        call_tests++;
36477        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36478        xmlResetLastError();
36479        if (mem_base != xmlMemBlocks()) {
36480            printf("Leak of %d blocks found in xmlUTF8Size",
36481	           xmlMemBlocks() - mem_base);
36482	    test_ret++;
36483            printf(" %d", n_utf);
36484            printf("\n");
36485        }
36486    }
36487    function_tests++;
36488
36489    return(test_ret);
36490}
36491
36492
36493static int
36494test_xmlUTF8Strlen(void) {
36495    int test_ret = 0;
36496
36497    int mem_base;
36498    int ret_val;
36499    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36500    int n_utf;
36501
36502    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36503        mem_base = xmlMemBlocks();
36504        utf = gen_const_xmlChar_ptr(n_utf, 0);
36505
36506        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36507        desret_int(ret_val);
36508        call_tests++;
36509        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36510        xmlResetLastError();
36511        if (mem_base != xmlMemBlocks()) {
36512            printf("Leak of %d blocks found in xmlUTF8Strlen",
36513	           xmlMemBlocks() - mem_base);
36514	    test_ret++;
36515            printf(" %d", n_utf);
36516            printf("\n");
36517        }
36518    }
36519    function_tests++;
36520
36521    return(test_ret);
36522}
36523
36524
36525static int
36526test_xmlUTF8Strloc(void) {
36527    int test_ret = 0;
36528
36529    int mem_base;
36530    int ret_val;
36531    xmlChar * utf; /* the input UTF8 * */
36532    int n_utf;
36533    xmlChar * utfchar; /* the UTF8 character to be found */
36534    int n_utfchar;
36535
36536    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36537    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36538        mem_base = xmlMemBlocks();
36539        utf = gen_const_xmlChar_ptr(n_utf, 0);
36540        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36541
36542        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36543        desret_int(ret_val);
36544        call_tests++;
36545        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36546        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36547        xmlResetLastError();
36548        if (mem_base != xmlMemBlocks()) {
36549            printf("Leak of %d blocks found in xmlUTF8Strloc",
36550	           xmlMemBlocks() - mem_base);
36551	    test_ret++;
36552            printf(" %d", n_utf);
36553            printf(" %d", n_utfchar);
36554            printf("\n");
36555        }
36556    }
36557    }
36558    function_tests++;
36559
36560    return(test_ret);
36561}
36562
36563
36564static int
36565test_xmlUTF8Strndup(void) {
36566    int test_ret = 0;
36567
36568    int mem_base;
36569    xmlChar * ret_val;
36570    xmlChar * utf; /* the input UTF8 * */
36571    int n_utf;
36572    int len; /* the len of @utf (in chars) */
36573    int n_len;
36574
36575    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36576    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36577        mem_base = xmlMemBlocks();
36578        utf = gen_const_xmlChar_ptr(n_utf, 0);
36579        len = gen_int(n_len, 1);
36580
36581        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36582        desret_xmlChar_ptr(ret_val);
36583        call_tests++;
36584        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36585        des_int(n_len, len, 1);
36586        xmlResetLastError();
36587        if (mem_base != xmlMemBlocks()) {
36588            printf("Leak of %d blocks found in xmlUTF8Strndup",
36589	           xmlMemBlocks() - mem_base);
36590	    test_ret++;
36591            printf(" %d", n_utf);
36592            printf(" %d", n_len);
36593            printf("\n");
36594        }
36595    }
36596    }
36597    function_tests++;
36598
36599    return(test_ret);
36600}
36601
36602
36603static int
36604test_xmlUTF8Strpos(void) {
36605    int test_ret = 0;
36606
36607    int mem_base;
36608    const xmlChar * ret_val;
36609    xmlChar * utf; /* the input UTF8 * */
36610    int n_utf;
36611    int pos; /* the position of the desired UTF8 char (in chars) */
36612    int n_pos;
36613
36614    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36615    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36616        mem_base = xmlMemBlocks();
36617        utf = gen_const_xmlChar_ptr(n_utf, 0);
36618        pos = gen_int(n_pos, 1);
36619
36620        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36621        desret_const_xmlChar_ptr(ret_val);
36622        call_tests++;
36623        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36624        des_int(n_pos, pos, 1);
36625        xmlResetLastError();
36626        if (mem_base != xmlMemBlocks()) {
36627            printf("Leak of %d blocks found in xmlUTF8Strpos",
36628	           xmlMemBlocks() - mem_base);
36629	    test_ret++;
36630            printf(" %d", n_utf);
36631            printf(" %d", n_pos);
36632            printf("\n");
36633        }
36634    }
36635    }
36636    function_tests++;
36637
36638    return(test_ret);
36639}
36640
36641
36642static int
36643test_xmlUTF8Strsize(void) {
36644    int test_ret = 0;
36645
36646    int mem_base;
36647    int ret_val;
36648    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36649    int n_utf;
36650    int len; /* the number of characters in the array */
36651    int n_len;
36652
36653    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36654    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36655        mem_base = xmlMemBlocks();
36656        utf = gen_const_xmlChar_ptr(n_utf, 0);
36657        len = gen_int(n_len, 1);
36658
36659        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36660        desret_int(ret_val);
36661        call_tests++;
36662        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36663        des_int(n_len, len, 1);
36664        xmlResetLastError();
36665        if (mem_base != xmlMemBlocks()) {
36666            printf("Leak of %d blocks found in xmlUTF8Strsize",
36667	           xmlMemBlocks() - mem_base);
36668	    test_ret++;
36669            printf(" %d", n_utf);
36670            printf(" %d", n_len);
36671            printf("\n");
36672        }
36673    }
36674    }
36675    function_tests++;
36676
36677    return(test_ret);
36678}
36679
36680
36681static int
36682test_xmlUTF8Strsub(void) {
36683    int test_ret = 0;
36684
36685    int mem_base;
36686    xmlChar * ret_val;
36687    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36688    int n_utf;
36689    int start; /* relative pos of first char */
36690    int n_start;
36691    int len; /* total number to copy */
36692    int n_len;
36693
36694    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36695    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36696    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36697        mem_base = xmlMemBlocks();
36698        utf = gen_const_xmlChar_ptr(n_utf, 0);
36699        start = gen_int(n_start, 1);
36700        len = gen_int(n_len, 2);
36701
36702        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36703        desret_xmlChar_ptr(ret_val);
36704        call_tests++;
36705        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36706        des_int(n_start, start, 1);
36707        des_int(n_len, len, 2);
36708        xmlResetLastError();
36709        if (mem_base != xmlMemBlocks()) {
36710            printf("Leak of %d blocks found in xmlUTF8Strsub",
36711	           xmlMemBlocks() - mem_base);
36712	    test_ret++;
36713            printf(" %d", n_utf);
36714            printf(" %d", n_start);
36715            printf(" %d", n_len);
36716            printf("\n");
36717        }
36718    }
36719    }
36720    }
36721    function_tests++;
36722
36723    return(test_ret);
36724}
36725
36726static int
36727test_xmlstring(void) {
36728    int test_ret = 0;
36729
36730    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36731    test_ret += test_xmlCharStrdup();
36732    test_ret += test_xmlCharStrndup();
36733    test_ret += test_xmlCheckUTF8();
36734    test_ret += test_xmlGetUTF8Char();
36735    test_ret += test_xmlStrEqual();
36736    test_ret += test_xmlStrPrintf();
36737    test_ret += test_xmlStrQEqual();
36738    test_ret += test_xmlStrVPrintf();
36739    test_ret += test_xmlStrcasecmp();
36740    test_ret += test_xmlStrcasestr();
36741    test_ret += test_xmlStrchr();
36742    test_ret += test_xmlStrcmp();
36743    test_ret += test_xmlStrdup();
36744    test_ret += test_xmlStrlen();
36745    test_ret += test_xmlStrncasecmp();
36746    test_ret += test_xmlStrncatNew();
36747    test_ret += test_xmlStrncmp();
36748    test_ret += test_xmlStrndup();
36749    test_ret += test_xmlStrstr();
36750    test_ret += test_xmlStrsub();
36751    test_ret += test_xmlUTF8Charcmp();
36752    test_ret += test_xmlUTF8Size();
36753    test_ret += test_xmlUTF8Strlen();
36754    test_ret += test_xmlUTF8Strloc();
36755    test_ret += test_xmlUTF8Strndup();
36756    test_ret += test_xmlUTF8Strpos();
36757    test_ret += test_xmlUTF8Strsize();
36758    test_ret += test_xmlUTF8Strsub();
36759
36760    if (test_ret != 0)
36761	printf("Module xmlstring: %d errors\n", test_ret);
36762    return(test_ret);
36763}
36764
36765static int
36766test_xmlUCSIsAegeanNumbers(void) {
36767    int test_ret = 0;
36768
36769#if defined(LIBXML_UNICODE_ENABLED)
36770    int mem_base;
36771    int ret_val;
36772    int code; /* UCS code point */
36773    int n_code;
36774
36775    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36776        mem_base = xmlMemBlocks();
36777        code = gen_int(n_code, 0);
36778
36779        ret_val = xmlUCSIsAegeanNumbers(code);
36780        desret_int(ret_val);
36781        call_tests++;
36782        des_int(n_code, code, 0);
36783        xmlResetLastError();
36784        if (mem_base != xmlMemBlocks()) {
36785            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36786	           xmlMemBlocks() - mem_base);
36787	    test_ret++;
36788            printf(" %d", n_code);
36789            printf("\n");
36790        }
36791    }
36792    function_tests++;
36793#endif
36794
36795    return(test_ret);
36796}
36797
36798
36799static int
36800test_xmlUCSIsAlphabeticPresentationForms(void) {
36801    int test_ret = 0;
36802
36803#if defined(LIBXML_UNICODE_ENABLED)
36804    int mem_base;
36805    int ret_val;
36806    int code; /* UCS code point */
36807    int n_code;
36808
36809    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36810        mem_base = xmlMemBlocks();
36811        code = gen_int(n_code, 0);
36812
36813        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36814        desret_int(ret_val);
36815        call_tests++;
36816        des_int(n_code, code, 0);
36817        xmlResetLastError();
36818        if (mem_base != xmlMemBlocks()) {
36819            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36820	           xmlMemBlocks() - mem_base);
36821	    test_ret++;
36822            printf(" %d", n_code);
36823            printf("\n");
36824        }
36825    }
36826    function_tests++;
36827#endif
36828
36829    return(test_ret);
36830}
36831
36832
36833static int
36834test_xmlUCSIsArabic(void) {
36835    int test_ret = 0;
36836
36837#if defined(LIBXML_UNICODE_ENABLED)
36838    int mem_base;
36839    int ret_val;
36840    int code; /* UCS code point */
36841    int n_code;
36842
36843    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36844        mem_base = xmlMemBlocks();
36845        code = gen_int(n_code, 0);
36846
36847        ret_val = xmlUCSIsArabic(code);
36848        desret_int(ret_val);
36849        call_tests++;
36850        des_int(n_code, code, 0);
36851        xmlResetLastError();
36852        if (mem_base != xmlMemBlocks()) {
36853            printf("Leak of %d blocks found in xmlUCSIsArabic",
36854	           xmlMemBlocks() - mem_base);
36855	    test_ret++;
36856            printf(" %d", n_code);
36857            printf("\n");
36858        }
36859    }
36860    function_tests++;
36861#endif
36862
36863    return(test_ret);
36864}
36865
36866
36867static int
36868test_xmlUCSIsArabicPresentationFormsA(void) {
36869    int test_ret = 0;
36870
36871#if defined(LIBXML_UNICODE_ENABLED)
36872    int mem_base;
36873    int ret_val;
36874    int code; /* UCS code point */
36875    int n_code;
36876
36877    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36878        mem_base = xmlMemBlocks();
36879        code = gen_int(n_code, 0);
36880
36881        ret_val = xmlUCSIsArabicPresentationFormsA(code);
36882        desret_int(ret_val);
36883        call_tests++;
36884        des_int(n_code, code, 0);
36885        xmlResetLastError();
36886        if (mem_base != xmlMemBlocks()) {
36887            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
36888	           xmlMemBlocks() - mem_base);
36889	    test_ret++;
36890            printf(" %d", n_code);
36891            printf("\n");
36892        }
36893    }
36894    function_tests++;
36895#endif
36896
36897    return(test_ret);
36898}
36899
36900
36901static int
36902test_xmlUCSIsArabicPresentationFormsB(void) {
36903    int test_ret = 0;
36904
36905#if defined(LIBXML_UNICODE_ENABLED)
36906    int mem_base;
36907    int ret_val;
36908    int code; /* UCS code point */
36909    int n_code;
36910
36911    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36912        mem_base = xmlMemBlocks();
36913        code = gen_int(n_code, 0);
36914
36915        ret_val = xmlUCSIsArabicPresentationFormsB(code);
36916        desret_int(ret_val);
36917        call_tests++;
36918        des_int(n_code, code, 0);
36919        xmlResetLastError();
36920        if (mem_base != xmlMemBlocks()) {
36921            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
36922	           xmlMemBlocks() - mem_base);
36923	    test_ret++;
36924            printf(" %d", n_code);
36925            printf("\n");
36926        }
36927    }
36928    function_tests++;
36929#endif
36930
36931    return(test_ret);
36932}
36933
36934
36935static int
36936test_xmlUCSIsArmenian(void) {
36937    int test_ret = 0;
36938
36939#if defined(LIBXML_UNICODE_ENABLED)
36940    int mem_base;
36941    int ret_val;
36942    int code; /* UCS code point */
36943    int n_code;
36944
36945    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36946        mem_base = xmlMemBlocks();
36947        code = gen_int(n_code, 0);
36948
36949        ret_val = xmlUCSIsArmenian(code);
36950        desret_int(ret_val);
36951        call_tests++;
36952        des_int(n_code, code, 0);
36953        xmlResetLastError();
36954        if (mem_base != xmlMemBlocks()) {
36955            printf("Leak of %d blocks found in xmlUCSIsArmenian",
36956	           xmlMemBlocks() - mem_base);
36957	    test_ret++;
36958            printf(" %d", n_code);
36959            printf("\n");
36960        }
36961    }
36962    function_tests++;
36963#endif
36964
36965    return(test_ret);
36966}
36967
36968
36969static int
36970test_xmlUCSIsArrows(void) {
36971    int test_ret = 0;
36972
36973#if defined(LIBXML_UNICODE_ENABLED)
36974    int mem_base;
36975    int ret_val;
36976    int code; /* UCS code point */
36977    int n_code;
36978
36979    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36980        mem_base = xmlMemBlocks();
36981        code = gen_int(n_code, 0);
36982
36983        ret_val = xmlUCSIsArrows(code);
36984        desret_int(ret_val);
36985        call_tests++;
36986        des_int(n_code, code, 0);
36987        xmlResetLastError();
36988        if (mem_base != xmlMemBlocks()) {
36989            printf("Leak of %d blocks found in xmlUCSIsArrows",
36990	           xmlMemBlocks() - mem_base);
36991	    test_ret++;
36992            printf(" %d", n_code);
36993            printf("\n");
36994        }
36995    }
36996    function_tests++;
36997#endif
36998
36999    return(test_ret);
37000}
37001
37002
37003static int
37004test_xmlUCSIsBasicLatin(void) {
37005    int test_ret = 0;
37006
37007#if defined(LIBXML_UNICODE_ENABLED)
37008    int mem_base;
37009    int ret_val;
37010    int code; /* UCS code point */
37011    int n_code;
37012
37013    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37014        mem_base = xmlMemBlocks();
37015        code = gen_int(n_code, 0);
37016
37017        ret_val = xmlUCSIsBasicLatin(code);
37018        desret_int(ret_val);
37019        call_tests++;
37020        des_int(n_code, code, 0);
37021        xmlResetLastError();
37022        if (mem_base != xmlMemBlocks()) {
37023            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37024	           xmlMemBlocks() - mem_base);
37025	    test_ret++;
37026            printf(" %d", n_code);
37027            printf("\n");
37028        }
37029    }
37030    function_tests++;
37031#endif
37032
37033    return(test_ret);
37034}
37035
37036
37037static int
37038test_xmlUCSIsBengali(void) {
37039    int test_ret = 0;
37040
37041#if defined(LIBXML_UNICODE_ENABLED)
37042    int mem_base;
37043    int ret_val;
37044    int code; /* UCS code point */
37045    int n_code;
37046
37047    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37048        mem_base = xmlMemBlocks();
37049        code = gen_int(n_code, 0);
37050
37051        ret_val = xmlUCSIsBengali(code);
37052        desret_int(ret_val);
37053        call_tests++;
37054        des_int(n_code, code, 0);
37055        xmlResetLastError();
37056        if (mem_base != xmlMemBlocks()) {
37057            printf("Leak of %d blocks found in xmlUCSIsBengali",
37058	           xmlMemBlocks() - mem_base);
37059	    test_ret++;
37060            printf(" %d", n_code);
37061            printf("\n");
37062        }
37063    }
37064    function_tests++;
37065#endif
37066
37067    return(test_ret);
37068}
37069
37070
37071static int
37072test_xmlUCSIsBlock(void) {
37073    int test_ret = 0;
37074
37075#if defined(LIBXML_UNICODE_ENABLED)
37076    int mem_base;
37077    int ret_val;
37078    int code; /* UCS code point */
37079    int n_code;
37080    char * block; /* UCS block name */
37081    int n_block;
37082
37083    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37084    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37085        mem_base = xmlMemBlocks();
37086        code = gen_int(n_code, 0);
37087        block = gen_const_char_ptr(n_block, 1);
37088
37089        ret_val = xmlUCSIsBlock(code, (const char *)block);
37090        desret_int(ret_val);
37091        call_tests++;
37092        des_int(n_code, code, 0);
37093        des_const_char_ptr(n_block, (const char *)block, 1);
37094        xmlResetLastError();
37095        if (mem_base != xmlMemBlocks()) {
37096            printf("Leak of %d blocks found in xmlUCSIsBlock",
37097	           xmlMemBlocks() - mem_base);
37098	    test_ret++;
37099            printf(" %d", n_code);
37100            printf(" %d", n_block);
37101            printf("\n");
37102        }
37103    }
37104    }
37105    function_tests++;
37106#endif
37107
37108    return(test_ret);
37109}
37110
37111
37112static int
37113test_xmlUCSIsBlockElements(void) {
37114    int test_ret = 0;
37115
37116#if defined(LIBXML_UNICODE_ENABLED)
37117    int mem_base;
37118    int ret_val;
37119    int code; /* UCS code point */
37120    int n_code;
37121
37122    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37123        mem_base = xmlMemBlocks();
37124        code = gen_int(n_code, 0);
37125
37126        ret_val = xmlUCSIsBlockElements(code);
37127        desret_int(ret_val);
37128        call_tests++;
37129        des_int(n_code, code, 0);
37130        xmlResetLastError();
37131        if (mem_base != xmlMemBlocks()) {
37132            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37133	           xmlMemBlocks() - mem_base);
37134	    test_ret++;
37135            printf(" %d", n_code);
37136            printf("\n");
37137        }
37138    }
37139    function_tests++;
37140#endif
37141
37142    return(test_ret);
37143}
37144
37145
37146static int
37147test_xmlUCSIsBopomofo(void) {
37148    int test_ret = 0;
37149
37150#if defined(LIBXML_UNICODE_ENABLED)
37151    int mem_base;
37152    int ret_val;
37153    int code; /* UCS code point */
37154    int n_code;
37155
37156    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37157        mem_base = xmlMemBlocks();
37158        code = gen_int(n_code, 0);
37159
37160        ret_val = xmlUCSIsBopomofo(code);
37161        desret_int(ret_val);
37162        call_tests++;
37163        des_int(n_code, code, 0);
37164        xmlResetLastError();
37165        if (mem_base != xmlMemBlocks()) {
37166            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37167	           xmlMemBlocks() - mem_base);
37168	    test_ret++;
37169            printf(" %d", n_code);
37170            printf("\n");
37171        }
37172    }
37173    function_tests++;
37174#endif
37175
37176    return(test_ret);
37177}
37178
37179
37180static int
37181test_xmlUCSIsBopomofoExtended(void) {
37182    int test_ret = 0;
37183
37184#if defined(LIBXML_UNICODE_ENABLED)
37185    int mem_base;
37186    int ret_val;
37187    int code; /* UCS code point */
37188    int n_code;
37189
37190    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37191        mem_base = xmlMemBlocks();
37192        code = gen_int(n_code, 0);
37193
37194        ret_val = xmlUCSIsBopomofoExtended(code);
37195        desret_int(ret_val);
37196        call_tests++;
37197        des_int(n_code, code, 0);
37198        xmlResetLastError();
37199        if (mem_base != xmlMemBlocks()) {
37200            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37201	           xmlMemBlocks() - mem_base);
37202	    test_ret++;
37203            printf(" %d", n_code);
37204            printf("\n");
37205        }
37206    }
37207    function_tests++;
37208#endif
37209
37210    return(test_ret);
37211}
37212
37213
37214static int
37215test_xmlUCSIsBoxDrawing(void) {
37216    int test_ret = 0;
37217
37218#if defined(LIBXML_UNICODE_ENABLED)
37219    int mem_base;
37220    int ret_val;
37221    int code; /* UCS code point */
37222    int n_code;
37223
37224    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37225        mem_base = xmlMemBlocks();
37226        code = gen_int(n_code, 0);
37227
37228        ret_val = xmlUCSIsBoxDrawing(code);
37229        desret_int(ret_val);
37230        call_tests++;
37231        des_int(n_code, code, 0);
37232        xmlResetLastError();
37233        if (mem_base != xmlMemBlocks()) {
37234            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37235	           xmlMemBlocks() - mem_base);
37236	    test_ret++;
37237            printf(" %d", n_code);
37238            printf("\n");
37239        }
37240    }
37241    function_tests++;
37242#endif
37243
37244    return(test_ret);
37245}
37246
37247
37248static int
37249test_xmlUCSIsBraillePatterns(void) {
37250    int test_ret = 0;
37251
37252#if defined(LIBXML_UNICODE_ENABLED)
37253    int mem_base;
37254    int ret_val;
37255    int code; /* UCS code point */
37256    int n_code;
37257
37258    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37259        mem_base = xmlMemBlocks();
37260        code = gen_int(n_code, 0);
37261
37262        ret_val = xmlUCSIsBraillePatterns(code);
37263        desret_int(ret_val);
37264        call_tests++;
37265        des_int(n_code, code, 0);
37266        xmlResetLastError();
37267        if (mem_base != xmlMemBlocks()) {
37268            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37269	           xmlMemBlocks() - mem_base);
37270	    test_ret++;
37271            printf(" %d", n_code);
37272            printf("\n");
37273        }
37274    }
37275    function_tests++;
37276#endif
37277
37278    return(test_ret);
37279}
37280
37281
37282static int
37283test_xmlUCSIsBuhid(void) {
37284    int test_ret = 0;
37285
37286#if defined(LIBXML_UNICODE_ENABLED)
37287    int mem_base;
37288    int ret_val;
37289    int code; /* UCS code point */
37290    int n_code;
37291
37292    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37293        mem_base = xmlMemBlocks();
37294        code = gen_int(n_code, 0);
37295
37296        ret_val = xmlUCSIsBuhid(code);
37297        desret_int(ret_val);
37298        call_tests++;
37299        des_int(n_code, code, 0);
37300        xmlResetLastError();
37301        if (mem_base != xmlMemBlocks()) {
37302            printf("Leak of %d blocks found in xmlUCSIsBuhid",
37303	           xmlMemBlocks() - mem_base);
37304	    test_ret++;
37305            printf(" %d", n_code);
37306            printf("\n");
37307        }
37308    }
37309    function_tests++;
37310#endif
37311
37312    return(test_ret);
37313}
37314
37315
37316static int
37317test_xmlUCSIsByzantineMusicalSymbols(void) {
37318    int test_ret = 0;
37319
37320#if defined(LIBXML_UNICODE_ENABLED)
37321    int mem_base;
37322    int ret_val;
37323    int code; /* UCS code point */
37324    int n_code;
37325
37326    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37327        mem_base = xmlMemBlocks();
37328        code = gen_int(n_code, 0);
37329
37330        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37331        desret_int(ret_val);
37332        call_tests++;
37333        des_int(n_code, code, 0);
37334        xmlResetLastError();
37335        if (mem_base != xmlMemBlocks()) {
37336            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37337	           xmlMemBlocks() - mem_base);
37338	    test_ret++;
37339            printf(" %d", n_code);
37340            printf("\n");
37341        }
37342    }
37343    function_tests++;
37344#endif
37345
37346    return(test_ret);
37347}
37348
37349
37350static int
37351test_xmlUCSIsCJKCompatibility(void) {
37352    int test_ret = 0;
37353
37354#if defined(LIBXML_UNICODE_ENABLED)
37355    int mem_base;
37356    int ret_val;
37357    int code; /* UCS code point */
37358    int n_code;
37359
37360    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37361        mem_base = xmlMemBlocks();
37362        code = gen_int(n_code, 0);
37363
37364        ret_val = xmlUCSIsCJKCompatibility(code);
37365        desret_int(ret_val);
37366        call_tests++;
37367        des_int(n_code, code, 0);
37368        xmlResetLastError();
37369        if (mem_base != xmlMemBlocks()) {
37370            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37371	           xmlMemBlocks() - mem_base);
37372	    test_ret++;
37373            printf(" %d", n_code);
37374            printf("\n");
37375        }
37376    }
37377    function_tests++;
37378#endif
37379
37380    return(test_ret);
37381}
37382
37383
37384static int
37385test_xmlUCSIsCJKCompatibilityForms(void) {
37386    int test_ret = 0;
37387
37388#if defined(LIBXML_UNICODE_ENABLED)
37389    int mem_base;
37390    int ret_val;
37391    int code; /* UCS code point */
37392    int n_code;
37393
37394    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37395        mem_base = xmlMemBlocks();
37396        code = gen_int(n_code, 0);
37397
37398        ret_val = xmlUCSIsCJKCompatibilityForms(code);
37399        desret_int(ret_val);
37400        call_tests++;
37401        des_int(n_code, code, 0);
37402        xmlResetLastError();
37403        if (mem_base != xmlMemBlocks()) {
37404            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37405	           xmlMemBlocks() - mem_base);
37406	    test_ret++;
37407            printf(" %d", n_code);
37408            printf("\n");
37409        }
37410    }
37411    function_tests++;
37412#endif
37413
37414    return(test_ret);
37415}
37416
37417
37418static int
37419test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37420    int test_ret = 0;
37421
37422#if defined(LIBXML_UNICODE_ENABLED)
37423    int mem_base;
37424    int ret_val;
37425    int code; /* UCS code point */
37426    int n_code;
37427
37428    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37429        mem_base = xmlMemBlocks();
37430        code = gen_int(n_code, 0);
37431
37432        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37433        desret_int(ret_val);
37434        call_tests++;
37435        des_int(n_code, code, 0);
37436        xmlResetLastError();
37437        if (mem_base != xmlMemBlocks()) {
37438            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37439	           xmlMemBlocks() - mem_base);
37440	    test_ret++;
37441            printf(" %d", n_code);
37442            printf("\n");
37443        }
37444    }
37445    function_tests++;
37446#endif
37447
37448    return(test_ret);
37449}
37450
37451
37452static int
37453test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37454    int test_ret = 0;
37455
37456#if defined(LIBXML_UNICODE_ENABLED)
37457    int mem_base;
37458    int ret_val;
37459    int code; /* UCS code point */
37460    int n_code;
37461
37462    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37463        mem_base = xmlMemBlocks();
37464        code = gen_int(n_code, 0);
37465
37466        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37467        desret_int(ret_val);
37468        call_tests++;
37469        des_int(n_code, code, 0);
37470        xmlResetLastError();
37471        if (mem_base != xmlMemBlocks()) {
37472            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37473	           xmlMemBlocks() - mem_base);
37474	    test_ret++;
37475            printf(" %d", n_code);
37476            printf("\n");
37477        }
37478    }
37479    function_tests++;
37480#endif
37481
37482    return(test_ret);
37483}
37484
37485
37486static int
37487test_xmlUCSIsCJKRadicalsSupplement(void) {
37488    int test_ret = 0;
37489
37490#if defined(LIBXML_UNICODE_ENABLED)
37491    int mem_base;
37492    int ret_val;
37493    int code; /* UCS code point */
37494    int n_code;
37495
37496    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37497        mem_base = xmlMemBlocks();
37498        code = gen_int(n_code, 0);
37499
37500        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37501        desret_int(ret_val);
37502        call_tests++;
37503        des_int(n_code, code, 0);
37504        xmlResetLastError();
37505        if (mem_base != xmlMemBlocks()) {
37506            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37507	           xmlMemBlocks() - mem_base);
37508	    test_ret++;
37509            printf(" %d", n_code);
37510            printf("\n");
37511        }
37512    }
37513    function_tests++;
37514#endif
37515
37516    return(test_ret);
37517}
37518
37519
37520static int
37521test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37522    int test_ret = 0;
37523
37524#if defined(LIBXML_UNICODE_ENABLED)
37525    int mem_base;
37526    int ret_val;
37527    int code; /* UCS code point */
37528    int n_code;
37529
37530    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37531        mem_base = xmlMemBlocks();
37532        code = gen_int(n_code, 0);
37533
37534        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37535        desret_int(ret_val);
37536        call_tests++;
37537        des_int(n_code, code, 0);
37538        xmlResetLastError();
37539        if (mem_base != xmlMemBlocks()) {
37540            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37541	           xmlMemBlocks() - mem_base);
37542	    test_ret++;
37543            printf(" %d", n_code);
37544            printf("\n");
37545        }
37546    }
37547    function_tests++;
37548#endif
37549
37550    return(test_ret);
37551}
37552
37553
37554static int
37555test_xmlUCSIsCJKUnifiedIdeographs(void) {
37556    int test_ret = 0;
37557
37558#if defined(LIBXML_UNICODE_ENABLED)
37559    int mem_base;
37560    int ret_val;
37561    int code; /* UCS code point */
37562    int n_code;
37563
37564    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37565        mem_base = xmlMemBlocks();
37566        code = gen_int(n_code, 0);
37567
37568        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37569        desret_int(ret_val);
37570        call_tests++;
37571        des_int(n_code, code, 0);
37572        xmlResetLastError();
37573        if (mem_base != xmlMemBlocks()) {
37574            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37575	           xmlMemBlocks() - mem_base);
37576	    test_ret++;
37577            printf(" %d", n_code);
37578            printf("\n");
37579        }
37580    }
37581    function_tests++;
37582#endif
37583
37584    return(test_ret);
37585}
37586
37587
37588static int
37589test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37590    int test_ret = 0;
37591
37592#if defined(LIBXML_UNICODE_ENABLED)
37593    int mem_base;
37594    int ret_val;
37595    int code; /* UCS code point */
37596    int n_code;
37597
37598    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37599        mem_base = xmlMemBlocks();
37600        code = gen_int(n_code, 0);
37601
37602        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37603        desret_int(ret_val);
37604        call_tests++;
37605        des_int(n_code, code, 0);
37606        xmlResetLastError();
37607        if (mem_base != xmlMemBlocks()) {
37608            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37609	           xmlMemBlocks() - mem_base);
37610	    test_ret++;
37611            printf(" %d", n_code);
37612            printf("\n");
37613        }
37614    }
37615    function_tests++;
37616#endif
37617
37618    return(test_ret);
37619}
37620
37621
37622static int
37623test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37624    int test_ret = 0;
37625
37626#if defined(LIBXML_UNICODE_ENABLED)
37627    int mem_base;
37628    int ret_val;
37629    int code; /* UCS code point */
37630    int n_code;
37631
37632    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37633        mem_base = xmlMemBlocks();
37634        code = gen_int(n_code, 0);
37635
37636        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37637        desret_int(ret_val);
37638        call_tests++;
37639        des_int(n_code, code, 0);
37640        xmlResetLastError();
37641        if (mem_base != xmlMemBlocks()) {
37642            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37643	           xmlMemBlocks() - mem_base);
37644	    test_ret++;
37645            printf(" %d", n_code);
37646            printf("\n");
37647        }
37648    }
37649    function_tests++;
37650#endif
37651
37652    return(test_ret);
37653}
37654
37655
37656static int
37657test_xmlUCSIsCat(void) {
37658    int test_ret = 0;
37659
37660#if defined(LIBXML_UNICODE_ENABLED)
37661    int mem_base;
37662    int ret_val;
37663    int code; /* UCS code point */
37664    int n_code;
37665    char * cat; /* UCS Category name */
37666    int n_cat;
37667
37668    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37669    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37670        mem_base = xmlMemBlocks();
37671        code = gen_int(n_code, 0);
37672        cat = gen_const_char_ptr(n_cat, 1);
37673
37674        ret_val = xmlUCSIsCat(code, (const char *)cat);
37675        desret_int(ret_val);
37676        call_tests++;
37677        des_int(n_code, code, 0);
37678        des_const_char_ptr(n_cat, (const char *)cat, 1);
37679        xmlResetLastError();
37680        if (mem_base != xmlMemBlocks()) {
37681            printf("Leak of %d blocks found in xmlUCSIsCat",
37682	           xmlMemBlocks() - mem_base);
37683	    test_ret++;
37684            printf(" %d", n_code);
37685            printf(" %d", n_cat);
37686            printf("\n");
37687        }
37688    }
37689    }
37690    function_tests++;
37691#endif
37692
37693    return(test_ret);
37694}
37695
37696
37697static int
37698test_xmlUCSIsCatC(void) {
37699    int test_ret = 0;
37700
37701#if defined(LIBXML_UNICODE_ENABLED)
37702    int mem_base;
37703    int ret_val;
37704    int code; /* UCS code point */
37705    int n_code;
37706
37707    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37708        mem_base = xmlMemBlocks();
37709        code = gen_int(n_code, 0);
37710
37711        ret_val = xmlUCSIsCatC(code);
37712        desret_int(ret_val);
37713        call_tests++;
37714        des_int(n_code, code, 0);
37715        xmlResetLastError();
37716        if (mem_base != xmlMemBlocks()) {
37717            printf("Leak of %d blocks found in xmlUCSIsCatC",
37718	           xmlMemBlocks() - mem_base);
37719	    test_ret++;
37720            printf(" %d", n_code);
37721            printf("\n");
37722        }
37723    }
37724    function_tests++;
37725#endif
37726
37727    return(test_ret);
37728}
37729
37730
37731static int
37732test_xmlUCSIsCatCc(void) {
37733    int test_ret = 0;
37734
37735#if defined(LIBXML_UNICODE_ENABLED)
37736    int mem_base;
37737    int ret_val;
37738    int code; /* UCS code point */
37739    int n_code;
37740
37741    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37742        mem_base = xmlMemBlocks();
37743        code = gen_int(n_code, 0);
37744
37745        ret_val = xmlUCSIsCatCc(code);
37746        desret_int(ret_val);
37747        call_tests++;
37748        des_int(n_code, code, 0);
37749        xmlResetLastError();
37750        if (mem_base != xmlMemBlocks()) {
37751            printf("Leak of %d blocks found in xmlUCSIsCatCc",
37752	           xmlMemBlocks() - mem_base);
37753	    test_ret++;
37754            printf(" %d", n_code);
37755            printf("\n");
37756        }
37757    }
37758    function_tests++;
37759#endif
37760
37761    return(test_ret);
37762}
37763
37764
37765static int
37766test_xmlUCSIsCatCf(void) {
37767    int test_ret = 0;
37768
37769#if defined(LIBXML_UNICODE_ENABLED)
37770    int mem_base;
37771    int ret_val;
37772    int code; /* UCS code point */
37773    int n_code;
37774
37775    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37776        mem_base = xmlMemBlocks();
37777        code = gen_int(n_code, 0);
37778
37779        ret_val = xmlUCSIsCatCf(code);
37780        desret_int(ret_val);
37781        call_tests++;
37782        des_int(n_code, code, 0);
37783        xmlResetLastError();
37784        if (mem_base != xmlMemBlocks()) {
37785            printf("Leak of %d blocks found in xmlUCSIsCatCf",
37786	           xmlMemBlocks() - mem_base);
37787	    test_ret++;
37788            printf(" %d", n_code);
37789            printf("\n");
37790        }
37791    }
37792    function_tests++;
37793#endif
37794
37795    return(test_ret);
37796}
37797
37798
37799static int
37800test_xmlUCSIsCatCo(void) {
37801    int test_ret = 0;
37802
37803#if defined(LIBXML_UNICODE_ENABLED)
37804    int mem_base;
37805    int ret_val;
37806    int code; /* UCS code point */
37807    int n_code;
37808
37809    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37810        mem_base = xmlMemBlocks();
37811        code = gen_int(n_code, 0);
37812
37813        ret_val = xmlUCSIsCatCo(code);
37814        desret_int(ret_val);
37815        call_tests++;
37816        des_int(n_code, code, 0);
37817        xmlResetLastError();
37818        if (mem_base != xmlMemBlocks()) {
37819            printf("Leak of %d blocks found in xmlUCSIsCatCo",
37820	           xmlMemBlocks() - mem_base);
37821	    test_ret++;
37822            printf(" %d", n_code);
37823            printf("\n");
37824        }
37825    }
37826    function_tests++;
37827#endif
37828
37829    return(test_ret);
37830}
37831
37832
37833static int
37834test_xmlUCSIsCatCs(void) {
37835    int test_ret = 0;
37836
37837#if defined(LIBXML_UNICODE_ENABLED)
37838    int mem_base;
37839    int ret_val;
37840    int code; /* UCS code point */
37841    int n_code;
37842
37843    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37844        mem_base = xmlMemBlocks();
37845        code = gen_int(n_code, 0);
37846
37847        ret_val = xmlUCSIsCatCs(code);
37848        desret_int(ret_val);
37849        call_tests++;
37850        des_int(n_code, code, 0);
37851        xmlResetLastError();
37852        if (mem_base != xmlMemBlocks()) {
37853            printf("Leak of %d blocks found in xmlUCSIsCatCs",
37854	           xmlMemBlocks() - mem_base);
37855	    test_ret++;
37856            printf(" %d", n_code);
37857            printf("\n");
37858        }
37859    }
37860    function_tests++;
37861#endif
37862
37863    return(test_ret);
37864}
37865
37866
37867static int
37868test_xmlUCSIsCatL(void) {
37869    int test_ret = 0;
37870
37871#if defined(LIBXML_UNICODE_ENABLED)
37872    int mem_base;
37873    int ret_val;
37874    int code; /* UCS code point */
37875    int n_code;
37876
37877    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37878        mem_base = xmlMemBlocks();
37879        code = gen_int(n_code, 0);
37880
37881        ret_val = xmlUCSIsCatL(code);
37882        desret_int(ret_val);
37883        call_tests++;
37884        des_int(n_code, code, 0);
37885        xmlResetLastError();
37886        if (mem_base != xmlMemBlocks()) {
37887            printf("Leak of %d blocks found in xmlUCSIsCatL",
37888	           xmlMemBlocks() - mem_base);
37889	    test_ret++;
37890            printf(" %d", n_code);
37891            printf("\n");
37892        }
37893    }
37894    function_tests++;
37895#endif
37896
37897    return(test_ret);
37898}
37899
37900
37901static int
37902test_xmlUCSIsCatLl(void) {
37903    int test_ret = 0;
37904
37905#if defined(LIBXML_UNICODE_ENABLED)
37906    int mem_base;
37907    int ret_val;
37908    int code; /* UCS code point */
37909    int n_code;
37910
37911    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37912        mem_base = xmlMemBlocks();
37913        code = gen_int(n_code, 0);
37914
37915        ret_val = xmlUCSIsCatLl(code);
37916        desret_int(ret_val);
37917        call_tests++;
37918        des_int(n_code, code, 0);
37919        xmlResetLastError();
37920        if (mem_base != xmlMemBlocks()) {
37921            printf("Leak of %d blocks found in xmlUCSIsCatLl",
37922	           xmlMemBlocks() - mem_base);
37923	    test_ret++;
37924            printf(" %d", n_code);
37925            printf("\n");
37926        }
37927    }
37928    function_tests++;
37929#endif
37930
37931    return(test_ret);
37932}
37933
37934
37935static int
37936test_xmlUCSIsCatLm(void) {
37937    int test_ret = 0;
37938
37939#if defined(LIBXML_UNICODE_ENABLED)
37940    int mem_base;
37941    int ret_val;
37942    int code; /* UCS code point */
37943    int n_code;
37944
37945    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37946        mem_base = xmlMemBlocks();
37947        code = gen_int(n_code, 0);
37948
37949        ret_val = xmlUCSIsCatLm(code);
37950        desret_int(ret_val);
37951        call_tests++;
37952        des_int(n_code, code, 0);
37953        xmlResetLastError();
37954        if (mem_base != xmlMemBlocks()) {
37955            printf("Leak of %d blocks found in xmlUCSIsCatLm",
37956	           xmlMemBlocks() - mem_base);
37957	    test_ret++;
37958            printf(" %d", n_code);
37959            printf("\n");
37960        }
37961    }
37962    function_tests++;
37963#endif
37964
37965    return(test_ret);
37966}
37967
37968
37969static int
37970test_xmlUCSIsCatLo(void) {
37971    int test_ret = 0;
37972
37973#if defined(LIBXML_UNICODE_ENABLED)
37974    int mem_base;
37975    int ret_val;
37976    int code; /* UCS code point */
37977    int n_code;
37978
37979    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37980        mem_base = xmlMemBlocks();
37981        code = gen_int(n_code, 0);
37982
37983        ret_val = xmlUCSIsCatLo(code);
37984        desret_int(ret_val);
37985        call_tests++;
37986        des_int(n_code, code, 0);
37987        xmlResetLastError();
37988        if (mem_base != xmlMemBlocks()) {
37989            printf("Leak of %d blocks found in xmlUCSIsCatLo",
37990	           xmlMemBlocks() - mem_base);
37991	    test_ret++;
37992            printf(" %d", n_code);
37993            printf("\n");
37994        }
37995    }
37996    function_tests++;
37997#endif
37998
37999    return(test_ret);
38000}
38001
38002
38003static int
38004test_xmlUCSIsCatLt(void) {
38005    int test_ret = 0;
38006
38007#if defined(LIBXML_UNICODE_ENABLED)
38008    int mem_base;
38009    int ret_val;
38010    int code; /* UCS code point */
38011    int n_code;
38012
38013    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38014        mem_base = xmlMemBlocks();
38015        code = gen_int(n_code, 0);
38016
38017        ret_val = xmlUCSIsCatLt(code);
38018        desret_int(ret_val);
38019        call_tests++;
38020        des_int(n_code, code, 0);
38021        xmlResetLastError();
38022        if (mem_base != xmlMemBlocks()) {
38023            printf("Leak of %d blocks found in xmlUCSIsCatLt",
38024	           xmlMemBlocks() - mem_base);
38025	    test_ret++;
38026            printf(" %d", n_code);
38027            printf("\n");
38028        }
38029    }
38030    function_tests++;
38031#endif
38032
38033    return(test_ret);
38034}
38035
38036
38037static int
38038test_xmlUCSIsCatLu(void) {
38039    int test_ret = 0;
38040
38041#if defined(LIBXML_UNICODE_ENABLED)
38042    int mem_base;
38043    int ret_val;
38044    int code; /* UCS code point */
38045    int n_code;
38046
38047    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38048        mem_base = xmlMemBlocks();
38049        code = gen_int(n_code, 0);
38050
38051        ret_val = xmlUCSIsCatLu(code);
38052        desret_int(ret_val);
38053        call_tests++;
38054        des_int(n_code, code, 0);
38055        xmlResetLastError();
38056        if (mem_base != xmlMemBlocks()) {
38057            printf("Leak of %d blocks found in xmlUCSIsCatLu",
38058	           xmlMemBlocks() - mem_base);
38059	    test_ret++;
38060            printf(" %d", n_code);
38061            printf("\n");
38062        }
38063    }
38064    function_tests++;
38065#endif
38066
38067    return(test_ret);
38068}
38069
38070
38071static int
38072test_xmlUCSIsCatM(void) {
38073    int test_ret = 0;
38074
38075#if defined(LIBXML_UNICODE_ENABLED)
38076    int mem_base;
38077    int ret_val;
38078    int code; /* UCS code point */
38079    int n_code;
38080
38081    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38082        mem_base = xmlMemBlocks();
38083        code = gen_int(n_code, 0);
38084
38085        ret_val = xmlUCSIsCatM(code);
38086        desret_int(ret_val);
38087        call_tests++;
38088        des_int(n_code, code, 0);
38089        xmlResetLastError();
38090        if (mem_base != xmlMemBlocks()) {
38091            printf("Leak of %d blocks found in xmlUCSIsCatM",
38092	           xmlMemBlocks() - mem_base);
38093	    test_ret++;
38094            printf(" %d", n_code);
38095            printf("\n");
38096        }
38097    }
38098    function_tests++;
38099#endif
38100
38101    return(test_ret);
38102}
38103
38104
38105static int
38106test_xmlUCSIsCatMc(void) {
38107    int test_ret = 0;
38108
38109#if defined(LIBXML_UNICODE_ENABLED)
38110    int mem_base;
38111    int ret_val;
38112    int code; /* UCS code point */
38113    int n_code;
38114
38115    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38116        mem_base = xmlMemBlocks();
38117        code = gen_int(n_code, 0);
38118
38119        ret_val = xmlUCSIsCatMc(code);
38120        desret_int(ret_val);
38121        call_tests++;
38122        des_int(n_code, code, 0);
38123        xmlResetLastError();
38124        if (mem_base != xmlMemBlocks()) {
38125            printf("Leak of %d blocks found in xmlUCSIsCatMc",
38126	           xmlMemBlocks() - mem_base);
38127	    test_ret++;
38128            printf(" %d", n_code);
38129            printf("\n");
38130        }
38131    }
38132    function_tests++;
38133#endif
38134
38135    return(test_ret);
38136}
38137
38138
38139static int
38140test_xmlUCSIsCatMe(void) {
38141    int test_ret = 0;
38142
38143#if defined(LIBXML_UNICODE_ENABLED)
38144    int mem_base;
38145    int ret_val;
38146    int code; /* UCS code point */
38147    int n_code;
38148
38149    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38150        mem_base = xmlMemBlocks();
38151        code = gen_int(n_code, 0);
38152
38153        ret_val = xmlUCSIsCatMe(code);
38154        desret_int(ret_val);
38155        call_tests++;
38156        des_int(n_code, code, 0);
38157        xmlResetLastError();
38158        if (mem_base != xmlMemBlocks()) {
38159            printf("Leak of %d blocks found in xmlUCSIsCatMe",
38160	           xmlMemBlocks() - mem_base);
38161	    test_ret++;
38162            printf(" %d", n_code);
38163            printf("\n");
38164        }
38165    }
38166    function_tests++;
38167#endif
38168
38169    return(test_ret);
38170}
38171
38172
38173static int
38174test_xmlUCSIsCatMn(void) {
38175    int test_ret = 0;
38176
38177#if defined(LIBXML_UNICODE_ENABLED)
38178    int mem_base;
38179    int ret_val;
38180    int code; /* UCS code point */
38181    int n_code;
38182
38183    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38184        mem_base = xmlMemBlocks();
38185        code = gen_int(n_code, 0);
38186
38187        ret_val = xmlUCSIsCatMn(code);
38188        desret_int(ret_val);
38189        call_tests++;
38190        des_int(n_code, code, 0);
38191        xmlResetLastError();
38192        if (mem_base != xmlMemBlocks()) {
38193            printf("Leak of %d blocks found in xmlUCSIsCatMn",
38194	           xmlMemBlocks() - mem_base);
38195	    test_ret++;
38196            printf(" %d", n_code);
38197            printf("\n");
38198        }
38199    }
38200    function_tests++;
38201#endif
38202
38203    return(test_ret);
38204}
38205
38206
38207static int
38208test_xmlUCSIsCatN(void) {
38209    int test_ret = 0;
38210
38211#if defined(LIBXML_UNICODE_ENABLED)
38212    int mem_base;
38213    int ret_val;
38214    int code; /* UCS code point */
38215    int n_code;
38216
38217    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38218        mem_base = xmlMemBlocks();
38219        code = gen_int(n_code, 0);
38220
38221        ret_val = xmlUCSIsCatN(code);
38222        desret_int(ret_val);
38223        call_tests++;
38224        des_int(n_code, code, 0);
38225        xmlResetLastError();
38226        if (mem_base != xmlMemBlocks()) {
38227            printf("Leak of %d blocks found in xmlUCSIsCatN",
38228	           xmlMemBlocks() - mem_base);
38229	    test_ret++;
38230            printf(" %d", n_code);
38231            printf("\n");
38232        }
38233    }
38234    function_tests++;
38235#endif
38236
38237    return(test_ret);
38238}
38239
38240
38241static int
38242test_xmlUCSIsCatNd(void) {
38243    int test_ret = 0;
38244
38245#if defined(LIBXML_UNICODE_ENABLED)
38246    int mem_base;
38247    int ret_val;
38248    int code; /* UCS code point */
38249    int n_code;
38250
38251    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38252        mem_base = xmlMemBlocks();
38253        code = gen_int(n_code, 0);
38254
38255        ret_val = xmlUCSIsCatNd(code);
38256        desret_int(ret_val);
38257        call_tests++;
38258        des_int(n_code, code, 0);
38259        xmlResetLastError();
38260        if (mem_base != xmlMemBlocks()) {
38261            printf("Leak of %d blocks found in xmlUCSIsCatNd",
38262	           xmlMemBlocks() - mem_base);
38263	    test_ret++;
38264            printf(" %d", n_code);
38265            printf("\n");
38266        }
38267    }
38268    function_tests++;
38269#endif
38270
38271    return(test_ret);
38272}
38273
38274
38275static int
38276test_xmlUCSIsCatNl(void) {
38277    int test_ret = 0;
38278
38279#if defined(LIBXML_UNICODE_ENABLED)
38280    int mem_base;
38281    int ret_val;
38282    int code; /* UCS code point */
38283    int n_code;
38284
38285    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38286        mem_base = xmlMemBlocks();
38287        code = gen_int(n_code, 0);
38288
38289        ret_val = xmlUCSIsCatNl(code);
38290        desret_int(ret_val);
38291        call_tests++;
38292        des_int(n_code, code, 0);
38293        xmlResetLastError();
38294        if (mem_base != xmlMemBlocks()) {
38295            printf("Leak of %d blocks found in xmlUCSIsCatNl",
38296	           xmlMemBlocks() - mem_base);
38297	    test_ret++;
38298            printf(" %d", n_code);
38299            printf("\n");
38300        }
38301    }
38302    function_tests++;
38303#endif
38304
38305    return(test_ret);
38306}
38307
38308
38309static int
38310test_xmlUCSIsCatNo(void) {
38311    int test_ret = 0;
38312
38313#if defined(LIBXML_UNICODE_ENABLED)
38314    int mem_base;
38315    int ret_val;
38316    int code; /* UCS code point */
38317    int n_code;
38318
38319    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38320        mem_base = xmlMemBlocks();
38321        code = gen_int(n_code, 0);
38322
38323        ret_val = xmlUCSIsCatNo(code);
38324        desret_int(ret_val);
38325        call_tests++;
38326        des_int(n_code, code, 0);
38327        xmlResetLastError();
38328        if (mem_base != xmlMemBlocks()) {
38329            printf("Leak of %d blocks found in xmlUCSIsCatNo",
38330	           xmlMemBlocks() - mem_base);
38331	    test_ret++;
38332            printf(" %d", n_code);
38333            printf("\n");
38334        }
38335    }
38336    function_tests++;
38337#endif
38338
38339    return(test_ret);
38340}
38341
38342
38343static int
38344test_xmlUCSIsCatP(void) {
38345    int test_ret = 0;
38346
38347#if defined(LIBXML_UNICODE_ENABLED)
38348    int mem_base;
38349    int ret_val;
38350    int code; /* UCS code point */
38351    int n_code;
38352
38353    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38354        mem_base = xmlMemBlocks();
38355        code = gen_int(n_code, 0);
38356
38357        ret_val = xmlUCSIsCatP(code);
38358        desret_int(ret_val);
38359        call_tests++;
38360        des_int(n_code, code, 0);
38361        xmlResetLastError();
38362        if (mem_base != xmlMemBlocks()) {
38363            printf("Leak of %d blocks found in xmlUCSIsCatP",
38364	           xmlMemBlocks() - mem_base);
38365	    test_ret++;
38366            printf(" %d", n_code);
38367            printf("\n");
38368        }
38369    }
38370    function_tests++;
38371#endif
38372
38373    return(test_ret);
38374}
38375
38376
38377static int
38378test_xmlUCSIsCatPc(void) {
38379    int test_ret = 0;
38380
38381#if defined(LIBXML_UNICODE_ENABLED)
38382    int mem_base;
38383    int ret_val;
38384    int code; /* UCS code point */
38385    int n_code;
38386
38387    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38388        mem_base = xmlMemBlocks();
38389        code = gen_int(n_code, 0);
38390
38391        ret_val = xmlUCSIsCatPc(code);
38392        desret_int(ret_val);
38393        call_tests++;
38394        des_int(n_code, code, 0);
38395        xmlResetLastError();
38396        if (mem_base != xmlMemBlocks()) {
38397            printf("Leak of %d blocks found in xmlUCSIsCatPc",
38398	           xmlMemBlocks() - mem_base);
38399	    test_ret++;
38400            printf(" %d", n_code);
38401            printf("\n");
38402        }
38403    }
38404    function_tests++;
38405#endif
38406
38407    return(test_ret);
38408}
38409
38410
38411static int
38412test_xmlUCSIsCatPd(void) {
38413    int test_ret = 0;
38414
38415#if defined(LIBXML_UNICODE_ENABLED)
38416    int mem_base;
38417    int ret_val;
38418    int code; /* UCS code point */
38419    int n_code;
38420
38421    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38422        mem_base = xmlMemBlocks();
38423        code = gen_int(n_code, 0);
38424
38425        ret_val = xmlUCSIsCatPd(code);
38426        desret_int(ret_val);
38427        call_tests++;
38428        des_int(n_code, code, 0);
38429        xmlResetLastError();
38430        if (mem_base != xmlMemBlocks()) {
38431            printf("Leak of %d blocks found in xmlUCSIsCatPd",
38432	           xmlMemBlocks() - mem_base);
38433	    test_ret++;
38434            printf(" %d", n_code);
38435            printf("\n");
38436        }
38437    }
38438    function_tests++;
38439#endif
38440
38441    return(test_ret);
38442}
38443
38444
38445static int
38446test_xmlUCSIsCatPe(void) {
38447    int test_ret = 0;
38448
38449#if defined(LIBXML_UNICODE_ENABLED)
38450    int mem_base;
38451    int ret_val;
38452    int code; /* UCS code point */
38453    int n_code;
38454
38455    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38456        mem_base = xmlMemBlocks();
38457        code = gen_int(n_code, 0);
38458
38459        ret_val = xmlUCSIsCatPe(code);
38460        desret_int(ret_val);
38461        call_tests++;
38462        des_int(n_code, code, 0);
38463        xmlResetLastError();
38464        if (mem_base != xmlMemBlocks()) {
38465            printf("Leak of %d blocks found in xmlUCSIsCatPe",
38466	           xmlMemBlocks() - mem_base);
38467	    test_ret++;
38468            printf(" %d", n_code);
38469            printf("\n");
38470        }
38471    }
38472    function_tests++;
38473#endif
38474
38475    return(test_ret);
38476}
38477
38478
38479static int
38480test_xmlUCSIsCatPf(void) {
38481    int test_ret = 0;
38482
38483#if defined(LIBXML_UNICODE_ENABLED)
38484    int mem_base;
38485    int ret_val;
38486    int code; /* UCS code point */
38487    int n_code;
38488
38489    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38490        mem_base = xmlMemBlocks();
38491        code = gen_int(n_code, 0);
38492
38493        ret_val = xmlUCSIsCatPf(code);
38494        desret_int(ret_val);
38495        call_tests++;
38496        des_int(n_code, code, 0);
38497        xmlResetLastError();
38498        if (mem_base != xmlMemBlocks()) {
38499            printf("Leak of %d blocks found in xmlUCSIsCatPf",
38500	           xmlMemBlocks() - mem_base);
38501	    test_ret++;
38502            printf(" %d", n_code);
38503            printf("\n");
38504        }
38505    }
38506    function_tests++;
38507#endif
38508
38509    return(test_ret);
38510}
38511
38512
38513static int
38514test_xmlUCSIsCatPi(void) {
38515    int test_ret = 0;
38516
38517#if defined(LIBXML_UNICODE_ENABLED)
38518    int mem_base;
38519    int ret_val;
38520    int code; /* UCS code point */
38521    int n_code;
38522
38523    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38524        mem_base = xmlMemBlocks();
38525        code = gen_int(n_code, 0);
38526
38527        ret_val = xmlUCSIsCatPi(code);
38528        desret_int(ret_val);
38529        call_tests++;
38530        des_int(n_code, code, 0);
38531        xmlResetLastError();
38532        if (mem_base != xmlMemBlocks()) {
38533            printf("Leak of %d blocks found in xmlUCSIsCatPi",
38534	           xmlMemBlocks() - mem_base);
38535	    test_ret++;
38536            printf(" %d", n_code);
38537            printf("\n");
38538        }
38539    }
38540    function_tests++;
38541#endif
38542
38543    return(test_ret);
38544}
38545
38546
38547static int
38548test_xmlUCSIsCatPo(void) {
38549    int test_ret = 0;
38550
38551#if defined(LIBXML_UNICODE_ENABLED)
38552    int mem_base;
38553    int ret_val;
38554    int code; /* UCS code point */
38555    int n_code;
38556
38557    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38558        mem_base = xmlMemBlocks();
38559        code = gen_int(n_code, 0);
38560
38561        ret_val = xmlUCSIsCatPo(code);
38562        desret_int(ret_val);
38563        call_tests++;
38564        des_int(n_code, code, 0);
38565        xmlResetLastError();
38566        if (mem_base != xmlMemBlocks()) {
38567            printf("Leak of %d blocks found in xmlUCSIsCatPo",
38568	           xmlMemBlocks() - mem_base);
38569	    test_ret++;
38570            printf(" %d", n_code);
38571            printf("\n");
38572        }
38573    }
38574    function_tests++;
38575#endif
38576
38577    return(test_ret);
38578}
38579
38580
38581static int
38582test_xmlUCSIsCatPs(void) {
38583    int test_ret = 0;
38584
38585#if defined(LIBXML_UNICODE_ENABLED)
38586    int mem_base;
38587    int ret_val;
38588    int code; /* UCS code point */
38589    int n_code;
38590
38591    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38592        mem_base = xmlMemBlocks();
38593        code = gen_int(n_code, 0);
38594
38595        ret_val = xmlUCSIsCatPs(code);
38596        desret_int(ret_val);
38597        call_tests++;
38598        des_int(n_code, code, 0);
38599        xmlResetLastError();
38600        if (mem_base != xmlMemBlocks()) {
38601            printf("Leak of %d blocks found in xmlUCSIsCatPs",
38602	           xmlMemBlocks() - mem_base);
38603	    test_ret++;
38604            printf(" %d", n_code);
38605            printf("\n");
38606        }
38607    }
38608    function_tests++;
38609#endif
38610
38611    return(test_ret);
38612}
38613
38614
38615static int
38616test_xmlUCSIsCatS(void) {
38617    int test_ret = 0;
38618
38619#if defined(LIBXML_UNICODE_ENABLED)
38620    int mem_base;
38621    int ret_val;
38622    int code; /* UCS code point */
38623    int n_code;
38624
38625    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38626        mem_base = xmlMemBlocks();
38627        code = gen_int(n_code, 0);
38628
38629        ret_val = xmlUCSIsCatS(code);
38630        desret_int(ret_val);
38631        call_tests++;
38632        des_int(n_code, code, 0);
38633        xmlResetLastError();
38634        if (mem_base != xmlMemBlocks()) {
38635            printf("Leak of %d blocks found in xmlUCSIsCatS",
38636	           xmlMemBlocks() - mem_base);
38637	    test_ret++;
38638            printf(" %d", n_code);
38639            printf("\n");
38640        }
38641    }
38642    function_tests++;
38643#endif
38644
38645    return(test_ret);
38646}
38647
38648
38649static int
38650test_xmlUCSIsCatSc(void) {
38651    int test_ret = 0;
38652
38653#if defined(LIBXML_UNICODE_ENABLED)
38654    int mem_base;
38655    int ret_val;
38656    int code; /* UCS code point */
38657    int n_code;
38658
38659    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38660        mem_base = xmlMemBlocks();
38661        code = gen_int(n_code, 0);
38662
38663        ret_val = xmlUCSIsCatSc(code);
38664        desret_int(ret_val);
38665        call_tests++;
38666        des_int(n_code, code, 0);
38667        xmlResetLastError();
38668        if (mem_base != xmlMemBlocks()) {
38669            printf("Leak of %d blocks found in xmlUCSIsCatSc",
38670	           xmlMemBlocks() - mem_base);
38671	    test_ret++;
38672            printf(" %d", n_code);
38673            printf("\n");
38674        }
38675    }
38676    function_tests++;
38677#endif
38678
38679    return(test_ret);
38680}
38681
38682
38683static int
38684test_xmlUCSIsCatSk(void) {
38685    int test_ret = 0;
38686
38687#if defined(LIBXML_UNICODE_ENABLED)
38688    int mem_base;
38689    int ret_val;
38690    int code; /* UCS code point */
38691    int n_code;
38692
38693    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38694        mem_base = xmlMemBlocks();
38695        code = gen_int(n_code, 0);
38696
38697        ret_val = xmlUCSIsCatSk(code);
38698        desret_int(ret_val);
38699        call_tests++;
38700        des_int(n_code, code, 0);
38701        xmlResetLastError();
38702        if (mem_base != xmlMemBlocks()) {
38703            printf("Leak of %d blocks found in xmlUCSIsCatSk",
38704	           xmlMemBlocks() - mem_base);
38705	    test_ret++;
38706            printf(" %d", n_code);
38707            printf("\n");
38708        }
38709    }
38710    function_tests++;
38711#endif
38712
38713    return(test_ret);
38714}
38715
38716
38717static int
38718test_xmlUCSIsCatSm(void) {
38719    int test_ret = 0;
38720
38721#if defined(LIBXML_UNICODE_ENABLED)
38722    int mem_base;
38723    int ret_val;
38724    int code; /* UCS code point */
38725    int n_code;
38726
38727    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38728        mem_base = xmlMemBlocks();
38729        code = gen_int(n_code, 0);
38730
38731        ret_val = xmlUCSIsCatSm(code);
38732        desret_int(ret_val);
38733        call_tests++;
38734        des_int(n_code, code, 0);
38735        xmlResetLastError();
38736        if (mem_base != xmlMemBlocks()) {
38737            printf("Leak of %d blocks found in xmlUCSIsCatSm",
38738	           xmlMemBlocks() - mem_base);
38739	    test_ret++;
38740            printf(" %d", n_code);
38741            printf("\n");
38742        }
38743    }
38744    function_tests++;
38745#endif
38746
38747    return(test_ret);
38748}
38749
38750
38751static int
38752test_xmlUCSIsCatSo(void) {
38753    int test_ret = 0;
38754
38755#if defined(LIBXML_UNICODE_ENABLED)
38756    int mem_base;
38757    int ret_val;
38758    int code; /* UCS code point */
38759    int n_code;
38760
38761    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38762        mem_base = xmlMemBlocks();
38763        code = gen_int(n_code, 0);
38764
38765        ret_val = xmlUCSIsCatSo(code);
38766        desret_int(ret_val);
38767        call_tests++;
38768        des_int(n_code, code, 0);
38769        xmlResetLastError();
38770        if (mem_base != xmlMemBlocks()) {
38771            printf("Leak of %d blocks found in xmlUCSIsCatSo",
38772	           xmlMemBlocks() - mem_base);
38773	    test_ret++;
38774            printf(" %d", n_code);
38775            printf("\n");
38776        }
38777    }
38778    function_tests++;
38779#endif
38780
38781    return(test_ret);
38782}
38783
38784
38785static int
38786test_xmlUCSIsCatZ(void) {
38787    int test_ret = 0;
38788
38789#if defined(LIBXML_UNICODE_ENABLED)
38790    int mem_base;
38791    int ret_val;
38792    int code; /* UCS code point */
38793    int n_code;
38794
38795    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38796        mem_base = xmlMemBlocks();
38797        code = gen_int(n_code, 0);
38798
38799        ret_val = xmlUCSIsCatZ(code);
38800        desret_int(ret_val);
38801        call_tests++;
38802        des_int(n_code, code, 0);
38803        xmlResetLastError();
38804        if (mem_base != xmlMemBlocks()) {
38805            printf("Leak of %d blocks found in xmlUCSIsCatZ",
38806	           xmlMemBlocks() - mem_base);
38807	    test_ret++;
38808            printf(" %d", n_code);
38809            printf("\n");
38810        }
38811    }
38812    function_tests++;
38813#endif
38814
38815    return(test_ret);
38816}
38817
38818
38819static int
38820test_xmlUCSIsCatZl(void) {
38821    int test_ret = 0;
38822
38823#if defined(LIBXML_UNICODE_ENABLED)
38824    int mem_base;
38825    int ret_val;
38826    int code; /* UCS code point */
38827    int n_code;
38828
38829    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38830        mem_base = xmlMemBlocks();
38831        code = gen_int(n_code, 0);
38832
38833        ret_val = xmlUCSIsCatZl(code);
38834        desret_int(ret_val);
38835        call_tests++;
38836        des_int(n_code, code, 0);
38837        xmlResetLastError();
38838        if (mem_base != xmlMemBlocks()) {
38839            printf("Leak of %d blocks found in xmlUCSIsCatZl",
38840	           xmlMemBlocks() - mem_base);
38841	    test_ret++;
38842            printf(" %d", n_code);
38843            printf("\n");
38844        }
38845    }
38846    function_tests++;
38847#endif
38848
38849    return(test_ret);
38850}
38851
38852
38853static int
38854test_xmlUCSIsCatZp(void) {
38855    int test_ret = 0;
38856
38857#if defined(LIBXML_UNICODE_ENABLED)
38858    int mem_base;
38859    int ret_val;
38860    int code; /* UCS code point */
38861    int n_code;
38862
38863    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38864        mem_base = xmlMemBlocks();
38865        code = gen_int(n_code, 0);
38866
38867        ret_val = xmlUCSIsCatZp(code);
38868        desret_int(ret_val);
38869        call_tests++;
38870        des_int(n_code, code, 0);
38871        xmlResetLastError();
38872        if (mem_base != xmlMemBlocks()) {
38873            printf("Leak of %d blocks found in xmlUCSIsCatZp",
38874	           xmlMemBlocks() - mem_base);
38875	    test_ret++;
38876            printf(" %d", n_code);
38877            printf("\n");
38878        }
38879    }
38880    function_tests++;
38881#endif
38882
38883    return(test_ret);
38884}
38885
38886
38887static int
38888test_xmlUCSIsCatZs(void) {
38889    int test_ret = 0;
38890
38891#if defined(LIBXML_UNICODE_ENABLED)
38892    int mem_base;
38893    int ret_val;
38894    int code; /* UCS code point */
38895    int n_code;
38896
38897    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38898        mem_base = xmlMemBlocks();
38899        code = gen_int(n_code, 0);
38900
38901        ret_val = xmlUCSIsCatZs(code);
38902        desret_int(ret_val);
38903        call_tests++;
38904        des_int(n_code, code, 0);
38905        xmlResetLastError();
38906        if (mem_base != xmlMemBlocks()) {
38907            printf("Leak of %d blocks found in xmlUCSIsCatZs",
38908	           xmlMemBlocks() - mem_base);
38909	    test_ret++;
38910            printf(" %d", n_code);
38911            printf("\n");
38912        }
38913    }
38914    function_tests++;
38915#endif
38916
38917    return(test_ret);
38918}
38919
38920
38921static int
38922test_xmlUCSIsCherokee(void) {
38923    int test_ret = 0;
38924
38925#if defined(LIBXML_UNICODE_ENABLED)
38926    int mem_base;
38927    int ret_val;
38928    int code; /* UCS code point */
38929    int n_code;
38930
38931    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38932        mem_base = xmlMemBlocks();
38933        code = gen_int(n_code, 0);
38934
38935        ret_val = xmlUCSIsCherokee(code);
38936        desret_int(ret_val);
38937        call_tests++;
38938        des_int(n_code, code, 0);
38939        xmlResetLastError();
38940        if (mem_base != xmlMemBlocks()) {
38941            printf("Leak of %d blocks found in xmlUCSIsCherokee",
38942	           xmlMemBlocks() - mem_base);
38943	    test_ret++;
38944            printf(" %d", n_code);
38945            printf("\n");
38946        }
38947    }
38948    function_tests++;
38949#endif
38950
38951    return(test_ret);
38952}
38953
38954
38955static int
38956test_xmlUCSIsCombiningDiacriticalMarks(void) {
38957    int test_ret = 0;
38958
38959#if defined(LIBXML_UNICODE_ENABLED)
38960    int mem_base;
38961    int ret_val;
38962    int code; /* UCS code point */
38963    int n_code;
38964
38965    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38966        mem_base = xmlMemBlocks();
38967        code = gen_int(n_code, 0);
38968
38969        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
38970        desret_int(ret_val);
38971        call_tests++;
38972        des_int(n_code, code, 0);
38973        xmlResetLastError();
38974        if (mem_base != xmlMemBlocks()) {
38975            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
38976	           xmlMemBlocks() - mem_base);
38977	    test_ret++;
38978            printf(" %d", n_code);
38979            printf("\n");
38980        }
38981    }
38982    function_tests++;
38983#endif
38984
38985    return(test_ret);
38986}
38987
38988
38989static int
38990test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
38991    int test_ret = 0;
38992
38993#if defined(LIBXML_UNICODE_ENABLED)
38994    int mem_base;
38995    int ret_val;
38996    int code; /* UCS code point */
38997    int n_code;
38998
38999    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39000        mem_base = xmlMemBlocks();
39001        code = gen_int(n_code, 0);
39002
39003        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39004        desret_int(ret_val);
39005        call_tests++;
39006        des_int(n_code, code, 0);
39007        xmlResetLastError();
39008        if (mem_base != xmlMemBlocks()) {
39009            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39010	           xmlMemBlocks() - mem_base);
39011	    test_ret++;
39012            printf(" %d", n_code);
39013            printf("\n");
39014        }
39015    }
39016    function_tests++;
39017#endif
39018
39019    return(test_ret);
39020}
39021
39022
39023static int
39024test_xmlUCSIsCombiningHalfMarks(void) {
39025    int test_ret = 0;
39026
39027#if defined(LIBXML_UNICODE_ENABLED)
39028    int mem_base;
39029    int ret_val;
39030    int code; /* UCS code point */
39031    int n_code;
39032
39033    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39034        mem_base = xmlMemBlocks();
39035        code = gen_int(n_code, 0);
39036
39037        ret_val = xmlUCSIsCombiningHalfMarks(code);
39038        desret_int(ret_val);
39039        call_tests++;
39040        des_int(n_code, code, 0);
39041        xmlResetLastError();
39042        if (mem_base != xmlMemBlocks()) {
39043            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39044	           xmlMemBlocks() - mem_base);
39045	    test_ret++;
39046            printf(" %d", n_code);
39047            printf("\n");
39048        }
39049    }
39050    function_tests++;
39051#endif
39052
39053    return(test_ret);
39054}
39055
39056
39057static int
39058test_xmlUCSIsCombiningMarksforSymbols(void) {
39059    int test_ret = 0;
39060
39061#if defined(LIBXML_UNICODE_ENABLED)
39062    int mem_base;
39063    int ret_val;
39064    int code; /* UCS code point */
39065    int n_code;
39066
39067    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39068        mem_base = xmlMemBlocks();
39069        code = gen_int(n_code, 0);
39070
39071        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39072        desret_int(ret_val);
39073        call_tests++;
39074        des_int(n_code, code, 0);
39075        xmlResetLastError();
39076        if (mem_base != xmlMemBlocks()) {
39077            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39078	           xmlMemBlocks() - mem_base);
39079	    test_ret++;
39080            printf(" %d", n_code);
39081            printf("\n");
39082        }
39083    }
39084    function_tests++;
39085#endif
39086
39087    return(test_ret);
39088}
39089
39090
39091static int
39092test_xmlUCSIsControlPictures(void) {
39093    int test_ret = 0;
39094
39095#if defined(LIBXML_UNICODE_ENABLED)
39096    int mem_base;
39097    int ret_val;
39098    int code; /* UCS code point */
39099    int n_code;
39100
39101    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39102        mem_base = xmlMemBlocks();
39103        code = gen_int(n_code, 0);
39104
39105        ret_val = xmlUCSIsControlPictures(code);
39106        desret_int(ret_val);
39107        call_tests++;
39108        des_int(n_code, code, 0);
39109        xmlResetLastError();
39110        if (mem_base != xmlMemBlocks()) {
39111            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39112	           xmlMemBlocks() - mem_base);
39113	    test_ret++;
39114            printf(" %d", n_code);
39115            printf("\n");
39116        }
39117    }
39118    function_tests++;
39119#endif
39120
39121    return(test_ret);
39122}
39123
39124
39125static int
39126test_xmlUCSIsCurrencySymbols(void) {
39127    int test_ret = 0;
39128
39129#if defined(LIBXML_UNICODE_ENABLED)
39130    int mem_base;
39131    int ret_val;
39132    int code; /* UCS code point */
39133    int n_code;
39134
39135    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39136        mem_base = xmlMemBlocks();
39137        code = gen_int(n_code, 0);
39138
39139        ret_val = xmlUCSIsCurrencySymbols(code);
39140        desret_int(ret_val);
39141        call_tests++;
39142        des_int(n_code, code, 0);
39143        xmlResetLastError();
39144        if (mem_base != xmlMemBlocks()) {
39145            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39146	           xmlMemBlocks() - mem_base);
39147	    test_ret++;
39148            printf(" %d", n_code);
39149            printf("\n");
39150        }
39151    }
39152    function_tests++;
39153#endif
39154
39155    return(test_ret);
39156}
39157
39158
39159static int
39160test_xmlUCSIsCypriotSyllabary(void) {
39161    int test_ret = 0;
39162
39163#if defined(LIBXML_UNICODE_ENABLED)
39164    int mem_base;
39165    int ret_val;
39166    int code; /* UCS code point */
39167    int n_code;
39168
39169    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39170        mem_base = xmlMemBlocks();
39171        code = gen_int(n_code, 0);
39172
39173        ret_val = xmlUCSIsCypriotSyllabary(code);
39174        desret_int(ret_val);
39175        call_tests++;
39176        des_int(n_code, code, 0);
39177        xmlResetLastError();
39178        if (mem_base != xmlMemBlocks()) {
39179            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39180	           xmlMemBlocks() - mem_base);
39181	    test_ret++;
39182            printf(" %d", n_code);
39183            printf("\n");
39184        }
39185    }
39186    function_tests++;
39187#endif
39188
39189    return(test_ret);
39190}
39191
39192
39193static int
39194test_xmlUCSIsCyrillic(void) {
39195    int test_ret = 0;
39196
39197#if defined(LIBXML_UNICODE_ENABLED)
39198    int mem_base;
39199    int ret_val;
39200    int code; /* UCS code point */
39201    int n_code;
39202
39203    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39204        mem_base = xmlMemBlocks();
39205        code = gen_int(n_code, 0);
39206
39207        ret_val = xmlUCSIsCyrillic(code);
39208        desret_int(ret_val);
39209        call_tests++;
39210        des_int(n_code, code, 0);
39211        xmlResetLastError();
39212        if (mem_base != xmlMemBlocks()) {
39213            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39214	           xmlMemBlocks() - mem_base);
39215	    test_ret++;
39216            printf(" %d", n_code);
39217            printf("\n");
39218        }
39219    }
39220    function_tests++;
39221#endif
39222
39223    return(test_ret);
39224}
39225
39226
39227static int
39228test_xmlUCSIsCyrillicSupplement(void) {
39229    int test_ret = 0;
39230
39231#if defined(LIBXML_UNICODE_ENABLED)
39232    int mem_base;
39233    int ret_val;
39234    int code; /* UCS code point */
39235    int n_code;
39236
39237    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39238        mem_base = xmlMemBlocks();
39239        code = gen_int(n_code, 0);
39240
39241        ret_val = xmlUCSIsCyrillicSupplement(code);
39242        desret_int(ret_val);
39243        call_tests++;
39244        des_int(n_code, code, 0);
39245        xmlResetLastError();
39246        if (mem_base != xmlMemBlocks()) {
39247            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39248	           xmlMemBlocks() - mem_base);
39249	    test_ret++;
39250            printf(" %d", n_code);
39251            printf("\n");
39252        }
39253    }
39254    function_tests++;
39255#endif
39256
39257    return(test_ret);
39258}
39259
39260
39261static int
39262test_xmlUCSIsDeseret(void) {
39263    int test_ret = 0;
39264
39265#if defined(LIBXML_UNICODE_ENABLED)
39266    int mem_base;
39267    int ret_val;
39268    int code; /* UCS code point */
39269    int n_code;
39270
39271    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39272        mem_base = xmlMemBlocks();
39273        code = gen_int(n_code, 0);
39274
39275        ret_val = xmlUCSIsDeseret(code);
39276        desret_int(ret_val);
39277        call_tests++;
39278        des_int(n_code, code, 0);
39279        xmlResetLastError();
39280        if (mem_base != xmlMemBlocks()) {
39281            printf("Leak of %d blocks found in xmlUCSIsDeseret",
39282	           xmlMemBlocks() - mem_base);
39283	    test_ret++;
39284            printf(" %d", n_code);
39285            printf("\n");
39286        }
39287    }
39288    function_tests++;
39289#endif
39290
39291    return(test_ret);
39292}
39293
39294
39295static int
39296test_xmlUCSIsDevanagari(void) {
39297    int test_ret = 0;
39298
39299#if defined(LIBXML_UNICODE_ENABLED)
39300    int mem_base;
39301    int ret_val;
39302    int code; /* UCS code point */
39303    int n_code;
39304
39305    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39306        mem_base = xmlMemBlocks();
39307        code = gen_int(n_code, 0);
39308
39309        ret_val = xmlUCSIsDevanagari(code);
39310        desret_int(ret_val);
39311        call_tests++;
39312        des_int(n_code, code, 0);
39313        xmlResetLastError();
39314        if (mem_base != xmlMemBlocks()) {
39315            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39316	           xmlMemBlocks() - mem_base);
39317	    test_ret++;
39318            printf(" %d", n_code);
39319            printf("\n");
39320        }
39321    }
39322    function_tests++;
39323#endif
39324
39325    return(test_ret);
39326}
39327
39328
39329static int
39330test_xmlUCSIsDingbats(void) {
39331    int test_ret = 0;
39332
39333#if defined(LIBXML_UNICODE_ENABLED)
39334    int mem_base;
39335    int ret_val;
39336    int code; /* UCS code point */
39337    int n_code;
39338
39339    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39340        mem_base = xmlMemBlocks();
39341        code = gen_int(n_code, 0);
39342
39343        ret_val = xmlUCSIsDingbats(code);
39344        desret_int(ret_val);
39345        call_tests++;
39346        des_int(n_code, code, 0);
39347        xmlResetLastError();
39348        if (mem_base != xmlMemBlocks()) {
39349            printf("Leak of %d blocks found in xmlUCSIsDingbats",
39350	           xmlMemBlocks() - mem_base);
39351	    test_ret++;
39352            printf(" %d", n_code);
39353            printf("\n");
39354        }
39355    }
39356    function_tests++;
39357#endif
39358
39359    return(test_ret);
39360}
39361
39362
39363static int
39364test_xmlUCSIsEnclosedAlphanumerics(void) {
39365    int test_ret = 0;
39366
39367#if defined(LIBXML_UNICODE_ENABLED)
39368    int mem_base;
39369    int ret_val;
39370    int code; /* UCS code point */
39371    int n_code;
39372
39373    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39374        mem_base = xmlMemBlocks();
39375        code = gen_int(n_code, 0);
39376
39377        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39378        desret_int(ret_val);
39379        call_tests++;
39380        des_int(n_code, code, 0);
39381        xmlResetLastError();
39382        if (mem_base != xmlMemBlocks()) {
39383            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39384	           xmlMemBlocks() - mem_base);
39385	    test_ret++;
39386            printf(" %d", n_code);
39387            printf("\n");
39388        }
39389    }
39390    function_tests++;
39391#endif
39392
39393    return(test_ret);
39394}
39395
39396
39397static int
39398test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39399    int test_ret = 0;
39400
39401#if defined(LIBXML_UNICODE_ENABLED)
39402    int mem_base;
39403    int ret_val;
39404    int code; /* UCS code point */
39405    int n_code;
39406
39407    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39408        mem_base = xmlMemBlocks();
39409        code = gen_int(n_code, 0);
39410
39411        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39412        desret_int(ret_val);
39413        call_tests++;
39414        des_int(n_code, code, 0);
39415        xmlResetLastError();
39416        if (mem_base != xmlMemBlocks()) {
39417            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39418	           xmlMemBlocks() - mem_base);
39419	    test_ret++;
39420            printf(" %d", n_code);
39421            printf("\n");
39422        }
39423    }
39424    function_tests++;
39425#endif
39426
39427    return(test_ret);
39428}
39429
39430
39431static int
39432test_xmlUCSIsEthiopic(void) {
39433    int test_ret = 0;
39434
39435#if defined(LIBXML_UNICODE_ENABLED)
39436    int mem_base;
39437    int ret_val;
39438    int code; /* UCS code point */
39439    int n_code;
39440
39441    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39442        mem_base = xmlMemBlocks();
39443        code = gen_int(n_code, 0);
39444
39445        ret_val = xmlUCSIsEthiopic(code);
39446        desret_int(ret_val);
39447        call_tests++;
39448        des_int(n_code, code, 0);
39449        xmlResetLastError();
39450        if (mem_base != xmlMemBlocks()) {
39451            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39452	           xmlMemBlocks() - mem_base);
39453	    test_ret++;
39454            printf(" %d", n_code);
39455            printf("\n");
39456        }
39457    }
39458    function_tests++;
39459#endif
39460
39461    return(test_ret);
39462}
39463
39464
39465static int
39466test_xmlUCSIsGeneralPunctuation(void) {
39467    int test_ret = 0;
39468
39469#if defined(LIBXML_UNICODE_ENABLED)
39470    int mem_base;
39471    int ret_val;
39472    int code; /* UCS code point */
39473    int n_code;
39474
39475    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39476        mem_base = xmlMemBlocks();
39477        code = gen_int(n_code, 0);
39478
39479        ret_val = xmlUCSIsGeneralPunctuation(code);
39480        desret_int(ret_val);
39481        call_tests++;
39482        des_int(n_code, code, 0);
39483        xmlResetLastError();
39484        if (mem_base != xmlMemBlocks()) {
39485            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39486	           xmlMemBlocks() - mem_base);
39487	    test_ret++;
39488            printf(" %d", n_code);
39489            printf("\n");
39490        }
39491    }
39492    function_tests++;
39493#endif
39494
39495    return(test_ret);
39496}
39497
39498
39499static int
39500test_xmlUCSIsGeometricShapes(void) {
39501    int test_ret = 0;
39502
39503#if defined(LIBXML_UNICODE_ENABLED)
39504    int mem_base;
39505    int ret_val;
39506    int code; /* UCS code point */
39507    int n_code;
39508
39509    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39510        mem_base = xmlMemBlocks();
39511        code = gen_int(n_code, 0);
39512
39513        ret_val = xmlUCSIsGeometricShapes(code);
39514        desret_int(ret_val);
39515        call_tests++;
39516        des_int(n_code, code, 0);
39517        xmlResetLastError();
39518        if (mem_base != xmlMemBlocks()) {
39519            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39520	           xmlMemBlocks() - mem_base);
39521	    test_ret++;
39522            printf(" %d", n_code);
39523            printf("\n");
39524        }
39525    }
39526    function_tests++;
39527#endif
39528
39529    return(test_ret);
39530}
39531
39532
39533static int
39534test_xmlUCSIsGeorgian(void) {
39535    int test_ret = 0;
39536
39537#if defined(LIBXML_UNICODE_ENABLED)
39538    int mem_base;
39539    int ret_val;
39540    int code; /* UCS code point */
39541    int n_code;
39542
39543    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39544        mem_base = xmlMemBlocks();
39545        code = gen_int(n_code, 0);
39546
39547        ret_val = xmlUCSIsGeorgian(code);
39548        desret_int(ret_val);
39549        call_tests++;
39550        des_int(n_code, code, 0);
39551        xmlResetLastError();
39552        if (mem_base != xmlMemBlocks()) {
39553            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39554	           xmlMemBlocks() - mem_base);
39555	    test_ret++;
39556            printf(" %d", n_code);
39557            printf("\n");
39558        }
39559    }
39560    function_tests++;
39561#endif
39562
39563    return(test_ret);
39564}
39565
39566
39567static int
39568test_xmlUCSIsGothic(void) {
39569    int test_ret = 0;
39570
39571#if defined(LIBXML_UNICODE_ENABLED)
39572    int mem_base;
39573    int ret_val;
39574    int code; /* UCS code point */
39575    int n_code;
39576
39577    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39578        mem_base = xmlMemBlocks();
39579        code = gen_int(n_code, 0);
39580
39581        ret_val = xmlUCSIsGothic(code);
39582        desret_int(ret_val);
39583        call_tests++;
39584        des_int(n_code, code, 0);
39585        xmlResetLastError();
39586        if (mem_base != xmlMemBlocks()) {
39587            printf("Leak of %d blocks found in xmlUCSIsGothic",
39588	           xmlMemBlocks() - mem_base);
39589	    test_ret++;
39590            printf(" %d", n_code);
39591            printf("\n");
39592        }
39593    }
39594    function_tests++;
39595#endif
39596
39597    return(test_ret);
39598}
39599
39600
39601static int
39602test_xmlUCSIsGreek(void) {
39603    int test_ret = 0;
39604
39605#if defined(LIBXML_UNICODE_ENABLED)
39606    int mem_base;
39607    int ret_val;
39608    int code; /* UCS code point */
39609    int n_code;
39610
39611    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39612        mem_base = xmlMemBlocks();
39613        code = gen_int(n_code, 0);
39614
39615        ret_val = xmlUCSIsGreek(code);
39616        desret_int(ret_val);
39617        call_tests++;
39618        des_int(n_code, code, 0);
39619        xmlResetLastError();
39620        if (mem_base != xmlMemBlocks()) {
39621            printf("Leak of %d blocks found in xmlUCSIsGreek",
39622	           xmlMemBlocks() - mem_base);
39623	    test_ret++;
39624            printf(" %d", n_code);
39625            printf("\n");
39626        }
39627    }
39628    function_tests++;
39629#endif
39630
39631    return(test_ret);
39632}
39633
39634
39635static int
39636test_xmlUCSIsGreekExtended(void) {
39637    int test_ret = 0;
39638
39639#if defined(LIBXML_UNICODE_ENABLED)
39640    int mem_base;
39641    int ret_val;
39642    int code; /* UCS code point */
39643    int n_code;
39644
39645    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39646        mem_base = xmlMemBlocks();
39647        code = gen_int(n_code, 0);
39648
39649        ret_val = xmlUCSIsGreekExtended(code);
39650        desret_int(ret_val);
39651        call_tests++;
39652        des_int(n_code, code, 0);
39653        xmlResetLastError();
39654        if (mem_base != xmlMemBlocks()) {
39655            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39656	           xmlMemBlocks() - mem_base);
39657	    test_ret++;
39658            printf(" %d", n_code);
39659            printf("\n");
39660        }
39661    }
39662    function_tests++;
39663#endif
39664
39665    return(test_ret);
39666}
39667
39668
39669static int
39670test_xmlUCSIsGreekandCoptic(void) {
39671    int test_ret = 0;
39672
39673#if defined(LIBXML_UNICODE_ENABLED)
39674    int mem_base;
39675    int ret_val;
39676    int code; /* UCS code point */
39677    int n_code;
39678
39679    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39680        mem_base = xmlMemBlocks();
39681        code = gen_int(n_code, 0);
39682
39683        ret_val = xmlUCSIsGreekandCoptic(code);
39684        desret_int(ret_val);
39685        call_tests++;
39686        des_int(n_code, code, 0);
39687        xmlResetLastError();
39688        if (mem_base != xmlMemBlocks()) {
39689            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39690	           xmlMemBlocks() - mem_base);
39691	    test_ret++;
39692            printf(" %d", n_code);
39693            printf("\n");
39694        }
39695    }
39696    function_tests++;
39697#endif
39698
39699    return(test_ret);
39700}
39701
39702
39703static int
39704test_xmlUCSIsGujarati(void) {
39705    int test_ret = 0;
39706
39707#if defined(LIBXML_UNICODE_ENABLED)
39708    int mem_base;
39709    int ret_val;
39710    int code; /* UCS code point */
39711    int n_code;
39712
39713    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39714        mem_base = xmlMemBlocks();
39715        code = gen_int(n_code, 0);
39716
39717        ret_val = xmlUCSIsGujarati(code);
39718        desret_int(ret_val);
39719        call_tests++;
39720        des_int(n_code, code, 0);
39721        xmlResetLastError();
39722        if (mem_base != xmlMemBlocks()) {
39723            printf("Leak of %d blocks found in xmlUCSIsGujarati",
39724	           xmlMemBlocks() - mem_base);
39725	    test_ret++;
39726            printf(" %d", n_code);
39727            printf("\n");
39728        }
39729    }
39730    function_tests++;
39731#endif
39732
39733    return(test_ret);
39734}
39735
39736
39737static int
39738test_xmlUCSIsGurmukhi(void) {
39739    int test_ret = 0;
39740
39741#if defined(LIBXML_UNICODE_ENABLED)
39742    int mem_base;
39743    int ret_val;
39744    int code; /* UCS code point */
39745    int n_code;
39746
39747    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39748        mem_base = xmlMemBlocks();
39749        code = gen_int(n_code, 0);
39750
39751        ret_val = xmlUCSIsGurmukhi(code);
39752        desret_int(ret_val);
39753        call_tests++;
39754        des_int(n_code, code, 0);
39755        xmlResetLastError();
39756        if (mem_base != xmlMemBlocks()) {
39757            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39758	           xmlMemBlocks() - mem_base);
39759	    test_ret++;
39760            printf(" %d", n_code);
39761            printf("\n");
39762        }
39763    }
39764    function_tests++;
39765#endif
39766
39767    return(test_ret);
39768}
39769
39770
39771static int
39772test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39773    int test_ret = 0;
39774
39775#if defined(LIBXML_UNICODE_ENABLED)
39776    int mem_base;
39777    int ret_val;
39778    int code; /* UCS code point */
39779    int n_code;
39780
39781    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39782        mem_base = xmlMemBlocks();
39783        code = gen_int(n_code, 0);
39784
39785        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
39786        desret_int(ret_val);
39787        call_tests++;
39788        des_int(n_code, code, 0);
39789        xmlResetLastError();
39790        if (mem_base != xmlMemBlocks()) {
39791            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
39792	           xmlMemBlocks() - mem_base);
39793	    test_ret++;
39794            printf(" %d", n_code);
39795            printf("\n");
39796        }
39797    }
39798    function_tests++;
39799#endif
39800
39801    return(test_ret);
39802}
39803
39804
39805static int
39806test_xmlUCSIsHangulCompatibilityJamo(void) {
39807    int test_ret = 0;
39808
39809#if defined(LIBXML_UNICODE_ENABLED)
39810    int mem_base;
39811    int ret_val;
39812    int code; /* UCS code point */
39813    int n_code;
39814
39815    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39816        mem_base = xmlMemBlocks();
39817        code = gen_int(n_code, 0);
39818
39819        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
39820        desret_int(ret_val);
39821        call_tests++;
39822        des_int(n_code, code, 0);
39823        xmlResetLastError();
39824        if (mem_base != xmlMemBlocks()) {
39825            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
39826	           xmlMemBlocks() - mem_base);
39827	    test_ret++;
39828            printf(" %d", n_code);
39829            printf("\n");
39830        }
39831    }
39832    function_tests++;
39833#endif
39834
39835    return(test_ret);
39836}
39837
39838
39839static int
39840test_xmlUCSIsHangulJamo(void) {
39841    int test_ret = 0;
39842
39843#if defined(LIBXML_UNICODE_ENABLED)
39844    int mem_base;
39845    int ret_val;
39846    int code; /* UCS code point */
39847    int n_code;
39848
39849    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39850        mem_base = xmlMemBlocks();
39851        code = gen_int(n_code, 0);
39852
39853        ret_val = xmlUCSIsHangulJamo(code);
39854        desret_int(ret_val);
39855        call_tests++;
39856        des_int(n_code, code, 0);
39857        xmlResetLastError();
39858        if (mem_base != xmlMemBlocks()) {
39859            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
39860	           xmlMemBlocks() - mem_base);
39861	    test_ret++;
39862            printf(" %d", n_code);
39863            printf("\n");
39864        }
39865    }
39866    function_tests++;
39867#endif
39868
39869    return(test_ret);
39870}
39871
39872
39873static int
39874test_xmlUCSIsHangulSyllables(void) {
39875    int test_ret = 0;
39876
39877#if defined(LIBXML_UNICODE_ENABLED)
39878    int mem_base;
39879    int ret_val;
39880    int code; /* UCS code point */
39881    int n_code;
39882
39883    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39884        mem_base = xmlMemBlocks();
39885        code = gen_int(n_code, 0);
39886
39887        ret_val = xmlUCSIsHangulSyllables(code);
39888        desret_int(ret_val);
39889        call_tests++;
39890        des_int(n_code, code, 0);
39891        xmlResetLastError();
39892        if (mem_base != xmlMemBlocks()) {
39893            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
39894	           xmlMemBlocks() - mem_base);
39895	    test_ret++;
39896            printf(" %d", n_code);
39897            printf("\n");
39898        }
39899    }
39900    function_tests++;
39901#endif
39902
39903    return(test_ret);
39904}
39905
39906
39907static int
39908test_xmlUCSIsHanunoo(void) {
39909    int test_ret = 0;
39910
39911#if defined(LIBXML_UNICODE_ENABLED)
39912    int mem_base;
39913    int ret_val;
39914    int code; /* UCS code point */
39915    int n_code;
39916
39917    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39918        mem_base = xmlMemBlocks();
39919        code = gen_int(n_code, 0);
39920
39921        ret_val = xmlUCSIsHanunoo(code);
39922        desret_int(ret_val);
39923        call_tests++;
39924        des_int(n_code, code, 0);
39925        xmlResetLastError();
39926        if (mem_base != xmlMemBlocks()) {
39927            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
39928	           xmlMemBlocks() - mem_base);
39929	    test_ret++;
39930            printf(" %d", n_code);
39931            printf("\n");
39932        }
39933    }
39934    function_tests++;
39935#endif
39936
39937    return(test_ret);
39938}
39939
39940
39941static int
39942test_xmlUCSIsHebrew(void) {
39943    int test_ret = 0;
39944
39945#if defined(LIBXML_UNICODE_ENABLED)
39946    int mem_base;
39947    int ret_val;
39948    int code; /* UCS code point */
39949    int n_code;
39950
39951    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39952        mem_base = xmlMemBlocks();
39953        code = gen_int(n_code, 0);
39954
39955        ret_val = xmlUCSIsHebrew(code);
39956        desret_int(ret_val);
39957        call_tests++;
39958        des_int(n_code, code, 0);
39959        xmlResetLastError();
39960        if (mem_base != xmlMemBlocks()) {
39961            printf("Leak of %d blocks found in xmlUCSIsHebrew",
39962	           xmlMemBlocks() - mem_base);
39963	    test_ret++;
39964            printf(" %d", n_code);
39965            printf("\n");
39966        }
39967    }
39968    function_tests++;
39969#endif
39970
39971    return(test_ret);
39972}
39973
39974
39975static int
39976test_xmlUCSIsHighPrivateUseSurrogates(void) {
39977    int test_ret = 0;
39978
39979#if defined(LIBXML_UNICODE_ENABLED)
39980    int mem_base;
39981    int ret_val;
39982    int code; /* UCS code point */
39983    int n_code;
39984
39985    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39986        mem_base = xmlMemBlocks();
39987        code = gen_int(n_code, 0);
39988
39989        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
39990        desret_int(ret_val);
39991        call_tests++;
39992        des_int(n_code, code, 0);
39993        xmlResetLastError();
39994        if (mem_base != xmlMemBlocks()) {
39995            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
39996	           xmlMemBlocks() - mem_base);
39997	    test_ret++;
39998            printf(" %d", n_code);
39999            printf("\n");
40000        }
40001    }
40002    function_tests++;
40003#endif
40004
40005    return(test_ret);
40006}
40007
40008
40009static int
40010test_xmlUCSIsHighSurrogates(void) {
40011    int test_ret = 0;
40012
40013#if defined(LIBXML_UNICODE_ENABLED)
40014    int mem_base;
40015    int ret_val;
40016    int code; /* UCS code point */
40017    int n_code;
40018
40019    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40020        mem_base = xmlMemBlocks();
40021        code = gen_int(n_code, 0);
40022
40023        ret_val = xmlUCSIsHighSurrogates(code);
40024        desret_int(ret_val);
40025        call_tests++;
40026        des_int(n_code, code, 0);
40027        xmlResetLastError();
40028        if (mem_base != xmlMemBlocks()) {
40029            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40030	           xmlMemBlocks() - mem_base);
40031	    test_ret++;
40032            printf(" %d", n_code);
40033            printf("\n");
40034        }
40035    }
40036    function_tests++;
40037#endif
40038
40039    return(test_ret);
40040}
40041
40042
40043static int
40044test_xmlUCSIsHiragana(void) {
40045    int test_ret = 0;
40046
40047#if defined(LIBXML_UNICODE_ENABLED)
40048    int mem_base;
40049    int ret_val;
40050    int code; /* UCS code point */
40051    int n_code;
40052
40053    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40054        mem_base = xmlMemBlocks();
40055        code = gen_int(n_code, 0);
40056
40057        ret_val = xmlUCSIsHiragana(code);
40058        desret_int(ret_val);
40059        call_tests++;
40060        des_int(n_code, code, 0);
40061        xmlResetLastError();
40062        if (mem_base != xmlMemBlocks()) {
40063            printf("Leak of %d blocks found in xmlUCSIsHiragana",
40064	           xmlMemBlocks() - mem_base);
40065	    test_ret++;
40066            printf(" %d", n_code);
40067            printf("\n");
40068        }
40069    }
40070    function_tests++;
40071#endif
40072
40073    return(test_ret);
40074}
40075
40076
40077static int
40078test_xmlUCSIsIPAExtensions(void) {
40079    int test_ret = 0;
40080
40081#if defined(LIBXML_UNICODE_ENABLED)
40082    int mem_base;
40083    int ret_val;
40084    int code; /* UCS code point */
40085    int n_code;
40086
40087    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40088        mem_base = xmlMemBlocks();
40089        code = gen_int(n_code, 0);
40090
40091        ret_val = xmlUCSIsIPAExtensions(code);
40092        desret_int(ret_val);
40093        call_tests++;
40094        des_int(n_code, code, 0);
40095        xmlResetLastError();
40096        if (mem_base != xmlMemBlocks()) {
40097            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40098	           xmlMemBlocks() - mem_base);
40099	    test_ret++;
40100            printf(" %d", n_code);
40101            printf("\n");
40102        }
40103    }
40104    function_tests++;
40105#endif
40106
40107    return(test_ret);
40108}
40109
40110
40111static int
40112test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40113    int test_ret = 0;
40114
40115#if defined(LIBXML_UNICODE_ENABLED)
40116    int mem_base;
40117    int ret_val;
40118    int code; /* UCS code point */
40119    int n_code;
40120
40121    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40122        mem_base = xmlMemBlocks();
40123        code = gen_int(n_code, 0);
40124
40125        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40126        desret_int(ret_val);
40127        call_tests++;
40128        des_int(n_code, code, 0);
40129        xmlResetLastError();
40130        if (mem_base != xmlMemBlocks()) {
40131            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40132	           xmlMemBlocks() - mem_base);
40133	    test_ret++;
40134            printf(" %d", n_code);
40135            printf("\n");
40136        }
40137    }
40138    function_tests++;
40139#endif
40140
40141    return(test_ret);
40142}
40143
40144
40145static int
40146test_xmlUCSIsKanbun(void) {
40147    int test_ret = 0;
40148
40149#if defined(LIBXML_UNICODE_ENABLED)
40150    int mem_base;
40151    int ret_val;
40152    int code; /* UCS code point */
40153    int n_code;
40154
40155    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40156        mem_base = xmlMemBlocks();
40157        code = gen_int(n_code, 0);
40158
40159        ret_val = xmlUCSIsKanbun(code);
40160        desret_int(ret_val);
40161        call_tests++;
40162        des_int(n_code, code, 0);
40163        xmlResetLastError();
40164        if (mem_base != xmlMemBlocks()) {
40165            printf("Leak of %d blocks found in xmlUCSIsKanbun",
40166	           xmlMemBlocks() - mem_base);
40167	    test_ret++;
40168            printf(" %d", n_code);
40169            printf("\n");
40170        }
40171    }
40172    function_tests++;
40173#endif
40174
40175    return(test_ret);
40176}
40177
40178
40179static int
40180test_xmlUCSIsKangxiRadicals(void) {
40181    int test_ret = 0;
40182
40183#if defined(LIBXML_UNICODE_ENABLED)
40184    int mem_base;
40185    int ret_val;
40186    int code; /* UCS code point */
40187    int n_code;
40188
40189    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40190        mem_base = xmlMemBlocks();
40191        code = gen_int(n_code, 0);
40192
40193        ret_val = xmlUCSIsKangxiRadicals(code);
40194        desret_int(ret_val);
40195        call_tests++;
40196        des_int(n_code, code, 0);
40197        xmlResetLastError();
40198        if (mem_base != xmlMemBlocks()) {
40199            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40200	           xmlMemBlocks() - mem_base);
40201	    test_ret++;
40202            printf(" %d", n_code);
40203            printf("\n");
40204        }
40205    }
40206    function_tests++;
40207#endif
40208
40209    return(test_ret);
40210}
40211
40212
40213static int
40214test_xmlUCSIsKannada(void) {
40215    int test_ret = 0;
40216
40217#if defined(LIBXML_UNICODE_ENABLED)
40218    int mem_base;
40219    int ret_val;
40220    int code; /* UCS code point */
40221    int n_code;
40222
40223    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40224        mem_base = xmlMemBlocks();
40225        code = gen_int(n_code, 0);
40226
40227        ret_val = xmlUCSIsKannada(code);
40228        desret_int(ret_val);
40229        call_tests++;
40230        des_int(n_code, code, 0);
40231        xmlResetLastError();
40232        if (mem_base != xmlMemBlocks()) {
40233            printf("Leak of %d blocks found in xmlUCSIsKannada",
40234	           xmlMemBlocks() - mem_base);
40235	    test_ret++;
40236            printf(" %d", n_code);
40237            printf("\n");
40238        }
40239    }
40240    function_tests++;
40241#endif
40242
40243    return(test_ret);
40244}
40245
40246
40247static int
40248test_xmlUCSIsKatakana(void) {
40249    int test_ret = 0;
40250
40251#if defined(LIBXML_UNICODE_ENABLED)
40252    int mem_base;
40253    int ret_val;
40254    int code; /* UCS code point */
40255    int n_code;
40256
40257    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40258        mem_base = xmlMemBlocks();
40259        code = gen_int(n_code, 0);
40260
40261        ret_val = xmlUCSIsKatakana(code);
40262        desret_int(ret_val);
40263        call_tests++;
40264        des_int(n_code, code, 0);
40265        xmlResetLastError();
40266        if (mem_base != xmlMemBlocks()) {
40267            printf("Leak of %d blocks found in xmlUCSIsKatakana",
40268	           xmlMemBlocks() - mem_base);
40269	    test_ret++;
40270            printf(" %d", n_code);
40271            printf("\n");
40272        }
40273    }
40274    function_tests++;
40275#endif
40276
40277    return(test_ret);
40278}
40279
40280
40281static int
40282test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40283    int test_ret = 0;
40284
40285#if defined(LIBXML_UNICODE_ENABLED)
40286    int mem_base;
40287    int ret_val;
40288    int code; /* UCS code point */
40289    int n_code;
40290
40291    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40292        mem_base = xmlMemBlocks();
40293        code = gen_int(n_code, 0);
40294
40295        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40296        desret_int(ret_val);
40297        call_tests++;
40298        des_int(n_code, code, 0);
40299        xmlResetLastError();
40300        if (mem_base != xmlMemBlocks()) {
40301            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40302	           xmlMemBlocks() - mem_base);
40303	    test_ret++;
40304            printf(" %d", n_code);
40305            printf("\n");
40306        }
40307    }
40308    function_tests++;
40309#endif
40310
40311    return(test_ret);
40312}
40313
40314
40315static int
40316test_xmlUCSIsKhmer(void) {
40317    int test_ret = 0;
40318
40319#if defined(LIBXML_UNICODE_ENABLED)
40320    int mem_base;
40321    int ret_val;
40322    int code; /* UCS code point */
40323    int n_code;
40324
40325    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40326        mem_base = xmlMemBlocks();
40327        code = gen_int(n_code, 0);
40328
40329        ret_val = xmlUCSIsKhmer(code);
40330        desret_int(ret_val);
40331        call_tests++;
40332        des_int(n_code, code, 0);
40333        xmlResetLastError();
40334        if (mem_base != xmlMemBlocks()) {
40335            printf("Leak of %d blocks found in xmlUCSIsKhmer",
40336	           xmlMemBlocks() - mem_base);
40337	    test_ret++;
40338            printf(" %d", n_code);
40339            printf("\n");
40340        }
40341    }
40342    function_tests++;
40343#endif
40344
40345    return(test_ret);
40346}
40347
40348
40349static int
40350test_xmlUCSIsKhmerSymbols(void) {
40351    int test_ret = 0;
40352
40353#if defined(LIBXML_UNICODE_ENABLED)
40354    int mem_base;
40355    int ret_val;
40356    int code; /* UCS code point */
40357    int n_code;
40358
40359    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40360        mem_base = xmlMemBlocks();
40361        code = gen_int(n_code, 0);
40362
40363        ret_val = xmlUCSIsKhmerSymbols(code);
40364        desret_int(ret_val);
40365        call_tests++;
40366        des_int(n_code, code, 0);
40367        xmlResetLastError();
40368        if (mem_base != xmlMemBlocks()) {
40369            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40370	           xmlMemBlocks() - mem_base);
40371	    test_ret++;
40372            printf(" %d", n_code);
40373            printf("\n");
40374        }
40375    }
40376    function_tests++;
40377#endif
40378
40379    return(test_ret);
40380}
40381
40382
40383static int
40384test_xmlUCSIsLao(void) {
40385    int test_ret = 0;
40386
40387#if defined(LIBXML_UNICODE_ENABLED)
40388    int mem_base;
40389    int ret_val;
40390    int code; /* UCS code point */
40391    int n_code;
40392
40393    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40394        mem_base = xmlMemBlocks();
40395        code = gen_int(n_code, 0);
40396
40397        ret_val = xmlUCSIsLao(code);
40398        desret_int(ret_val);
40399        call_tests++;
40400        des_int(n_code, code, 0);
40401        xmlResetLastError();
40402        if (mem_base != xmlMemBlocks()) {
40403            printf("Leak of %d blocks found in xmlUCSIsLao",
40404	           xmlMemBlocks() - mem_base);
40405	    test_ret++;
40406            printf(" %d", n_code);
40407            printf("\n");
40408        }
40409    }
40410    function_tests++;
40411#endif
40412
40413    return(test_ret);
40414}
40415
40416
40417static int
40418test_xmlUCSIsLatin1Supplement(void) {
40419    int test_ret = 0;
40420
40421#if defined(LIBXML_UNICODE_ENABLED)
40422    int mem_base;
40423    int ret_val;
40424    int code; /* UCS code point */
40425    int n_code;
40426
40427    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40428        mem_base = xmlMemBlocks();
40429        code = gen_int(n_code, 0);
40430
40431        ret_val = xmlUCSIsLatin1Supplement(code);
40432        desret_int(ret_val);
40433        call_tests++;
40434        des_int(n_code, code, 0);
40435        xmlResetLastError();
40436        if (mem_base != xmlMemBlocks()) {
40437            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40438	           xmlMemBlocks() - mem_base);
40439	    test_ret++;
40440            printf(" %d", n_code);
40441            printf("\n");
40442        }
40443    }
40444    function_tests++;
40445#endif
40446
40447    return(test_ret);
40448}
40449
40450
40451static int
40452test_xmlUCSIsLatinExtendedA(void) {
40453    int test_ret = 0;
40454
40455#if defined(LIBXML_UNICODE_ENABLED)
40456    int mem_base;
40457    int ret_val;
40458    int code; /* UCS code point */
40459    int n_code;
40460
40461    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40462        mem_base = xmlMemBlocks();
40463        code = gen_int(n_code, 0);
40464
40465        ret_val = xmlUCSIsLatinExtendedA(code);
40466        desret_int(ret_val);
40467        call_tests++;
40468        des_int(n_code, code, 0);
40469        xmlResetLastError();
40470        if (mem_base != xmlMemBlocks()) {
40471            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40472	           xmlMemBlocks() - mem_base);
40473	    test_ret++;
40474            printf(" %d", n_code);
40475            printf("\n");
40476        }
40477    }
40478    function_tests++;
40479#endif
40480
40481    return(test_ret);
40482}
40483
40484
40485static int
40486test_xmlUCSIsLatinExtendedAdditional(void) {
40487    int test_ret = 0;
40488
40489#if defined(LIBXML_UNICODE_ENABLED)
40490    int mem_base;
40491    int ret_val;
40492    int code; /* UCS code point */
40493    int n_code;
40494
40495    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40496        mem_base = xmlMemBlocks();
40497        code = gen_int(n_code, 0);
40498
40499        ret_val = xmlUCSIsLatinExtendedAdditional(code);
40500        desret_int(ret_val);
40501        call_tests++;
40502        des_int(n_code, code, 0);
40503        xmlResetLastError();
40504        if (mem_base != xmlMemBlocks()) {
40505            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40506	           xmlMemBlocks() - mem_base);
40507	    test_ret++;
40508            printf(" %d", n_code);
40509            printf("\n");
40510        }
40511    }
40512    function_tests++;
40513#endif
40514
40515    return(test_ret);
40516}
40517
40518
40519static int
40520test_xmlUCSIsLatinExtendedB(void) {
40521    int test_ret = 0;
40522
40523#if defined(LIBXML_UNICODE_ENABLED)
40524    int mem_base;
40525    int ret_val;
40526    int code; /* UCS code point */
40527    int n_code;
40528
40529    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40530        mem_base = xmlMemBlocks();
40531        code = gen_int(n_code, 0);
40532
40533        ret_val = xmlUCSIsLatinExtendedB(code);
40534        desret_int(ret_val);
40535        call_tests++;
40536        des_int(n_code, code, 0);
40537        xmlResetLastError();
40538        if (mem_base != xmlMemBlocks()) {
40539            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40540	           xmlMemBlocks() - mem_base);
40541	    test_ret++;
40542            printf(" %d", n_code);
40543            printf("\n");
40544        }
40545    }
40546    function_tests++;
40547#endif
40548
40549    return(test_ret);
40550}
40551
40552
40553static int
40554test_xmlUCSIsLetterlikeSymbols(void) {
40555    int test_ret = 0;
40556
40557#if defined(LIBXML_UNICODE_ENABLED)
40558    int mem_base;
40559    int ret_val;
40560    int code; /* UCS code point */
40561    int n_code;
40562
40563    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40564        mem_base = xmlMemBlocks();
40565        code = gen_int(n_code, 0);
40566
40567        ret_val = xmlUCSIsLetterlikeSymbols(code);
40568        desret_int(ret_val);
40569        call_tests++;
40570        des_int(n_code, code, 0);
40571        xmlResetLastError();
40572        if (mem_base != xmlMemBlocks()) {
40573            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40574	           xmlMemBlocks() - mem_base);
40575	    test_ret++;
40576            printf(" %d", n_code);
40577            printf("\n");
40578        }
40579    }
40580    function_tests++;
40581#endif
40582
40583    return(test_ret);
40584}
40585
40586
40587static int
40588test_xmlUCSIsLimbu(void) {
40589    int test_ret = 0;
40590
40591#if defined(LIBXML_UNICODE_ENABLED)
40592    int mem_base;
40593    int ret_val;
40594    int code; /* UCS code point */
40595    int n_code;
40596
40597    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40598        mem_base = xmlMemBlocks();
40599        code = gen_int(n_code, 0);
40600
40601        ret_val = xmlUCSIsLimbu(code);
40602        desret_int(ret_val);
40603        call_tests++;
40604        des_int(n_code, code, 0);
40605        xmlResetLastError();
40606        if (mem_base != xmlMemBlocks()) {
40607            printf("Leak of %d blocks found in xmlUCSIsLimbu",
40608	           xmlMemBlocks() - mem_base);
40609	    test_ret++;
40610            printf(" %d", n_code);
40611            printf("\n");
40612        }
40613    }
40614    function_tests++;
40615#endif
40616
40617    return(test_ret);
40618}
40619
40620
40621static int
40622test_xmlUCSIsLinearBIdeograms(void) {
40623    int test_ret = 0;
40624
40625#if defined(LIBXML_UNICODE_ENABLED)
40626    int mem_base;
40627    int ret_val;
40628    int code; /* UCS code point */
40629    int n_code;
40630
40631    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40632        mem_base = xmlMemBlocks();
40633        code = gen_int(n_code, 0);
40634
40635        ret_val = xmlUCSIsLinearBIdeograms(code);
40636        desret_int(ret_val);
40637        call_tests++;
40638        des_int(n_code, code, 0);
40639        xmlResetLastError();
40640        if (mem_base != xmlMemBlocks()) {
40641            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40642	           xmlMemBlocks() - mem_base);
40643	    test_ret++;
40644            printf(" %d", n_code);
40645            printf("\n");
40646        }
40647    }
40648    function_tests++;
40649#endif
40650
40651    return(test_ret);
40652}
40653
40654
40655static int
40656test_xmlUCSIsLinearBSyllabary(void) {
40657    int test_ret = 0;
40658
40659#if defined(LIBXML_UNICODE_ENABLED)
40660    int mem_base;
40661    int ret_val;
40662    int code; /* UCS code point */
40663    int n_code;
40664
40665    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40666        mem_base = xmlMemBlocks();
40667        code = gen_int(n_code, 0);
40668
40669        ret_val = xmlUCSIsLinearBSyllabary(code);
40670        desret_int(ret_val);
40671        call_tests++;
40672        des_int(n_code, code, 0);
40673        xmlResetLastError();
40674        if (mem_base != xmlMemBlocks()) {
40675            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40676	           xmlMemBlocks() - mem_base);
40677	    test_ret++;
40678            printf(" %d", n_code);
40679            printf("\n");
40680        }
40681    }
40682    function_tests++;
40683#endif
40684
40685    return(test_ret);
40686}
40687
40688
40689static int
40690test_xmlUCSIsLowSurrogates(void) {
40691    int test_ret = 0;
40692
40693#if defined(LIBXML_UNICODE_ENABLED)
40694    int mem_base;
40695    int ret_val;
40696    int code; /* UCS code point */
40697    int n_code;
40698
40699    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40700        mem_base = xmlMemBlocks();
40701        code = gen_int(n_code, 0);
40702
40703        ret_val = xmlUCSIsLowSurrogates(code);
40704        desret_int(ret_val);
40705        call_tests++;
40706        des_int(n_code, code, 0);
40707        xmlResetLastError();
40708        if (mem_base != xmlMemBlocks()) {
40709            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40710	           xmlMemBlocks() - mem_base);
40711	    test_ret++;
40712            printf(" %d", n_code);
40713            printf("\n");
40714        }
40715    }
40716    function_tests++;
40717#endif
40718
40719    return(test_ret);
40720}
40721
40722
40723static int
40724test_xmlUCSIsMalayalam(void) {
40725    int test_ret = 0;
40726
40727#if defined(LIBXML_UNICODE_ENABLED)
40728    int mem_base;
40729    int ret_val;
40730    int code; /* UCS code point */
40731    int n_code;
40732
40733    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40734        mem_base = xmlMemBlocks();
40735        code = gen_int(n_code, 0);
40736
40737        ret_val = xmlUCSIsMalayalam(code);
40738        desret_int(ret_val);
40739        call_tests++;
40740        des_int(n_code, code, 0);
40741        xmlResetLastError();
40742        if (mem_base != xmlMemBlocks()) {
40743            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40744	           xmlMemBlocks() - mem_base);
40745	    test_ret++;
40746            printf(" %d", n_code);
40747            printf("\n");
40748        }
40749    }
40750    function_tests++;
40751#endif
40752
40753    return(test_ret);
40754}
40755
40756
40757static int
40758test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40759    int test_ret = 0;
40760
40761#if defined(LIBXML_UNICODE_ENABLED)
40762    int mem_base;
40763    int ret_val;
40764    int code; /* UCS code point */
40765    int n_code;
40766
40767    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40768        mem_base = xmlMemBlocks();
40769        code = gen_int(n_code, 0);
40770
40771        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40772        desret_int(ret_val);
40773        call_tests++;
40774        des_int(n_code, code, 0);
40775        xmlResetLastError();
40776        if (mem_base != xmlMemBlocks()) {
40777            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
40778	           xmlMemBlocks() - mem_base);
40779	    test_ret++;
40780            printf(" %d", n_code);
40781            printf("\n");
40782        }
40783    }
40784    function_tests++;
40785#endif
40786
40787    return(test_ret);
40788}
40789
40790
40791static int
40792test_xmlUCSIsMathematicalOperators(void) {
40793    int test_ret = 0;
40794
40795#if defined(LIBXML_UNICODE_ENABLED)
40796    int mem_base;
40797    int ret_val;
40798    int code; /* UCS code point */
40799    int n_code;
40800
40801    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40802        mem_base = xmlMemBlocks();
40803        code = gen_int(n_code, 0);
40804
40805        ret_val = xmlUCSIsMathematicalOperators(code);
40806        desret_int(ret_val);
40807        call_tests++;
40808        des_int(n_code, code, 0);
40809        xmlResetLastError();
40810        if (mem_base != xmlMemBlocks()) {
40811            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
40812	           xmlMemBlocks() - mem_base);
40813	    test_ret++;
40814            printf(" %d", n_code);
40815            printf("\n");
40816        }
40817    }
40818    function_tests++;
40819#endif
40820
40821    return(test_ret);
40822}
40823
40824
40825static int
40826test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
40827    int test_ret = 0;
40828
40829#if defined(LIBXML_UNICODE_ENABLED)
40830    int mem_base;
40831    int ret_val;
40832    int code; /* UCS code point */
40833    int n_code;
40834
40835    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40836        mem_base = xmlMemBlocks();
40837        code = gen_int(n_code, 0);
40838
40839        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
40840        desret_int(ret_val);
40841        call_tests++;
40842        des_int(n_code, code, 0);
40843        xmlResetLastError();
40844        if (mem_base != xmlMemBlocks()) {
40845            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
40846	           xmlMemBlocks() - mem_base);
40847	    test_ret++;
40848            printf(" %d", n_code);
40849            printf("\n");
40850        }
40851    }
40852    function_tests++;
40853#endif
40854
40855    return(test_ret);
40856}
40857
40858
40859static int
40860test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
40861    int test_ret = 0;
40862
40863#if defined(LIBXML_UNICODE_ENABLED)
40864    int mem_base;
40865    int ret_val;
40866    int code; /* UCS code point */
40867    int n_code;
40868
40869    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40870        mem_base = xmlMemBlocks();
40871        code = gen_int(n_code, 0);
40872
40873        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
40874        desret_int(ret_val);
40875        call_tests++;
40876        des_int(n_code, code, 0);
40877        xmlResetLastError();
40878        if (mem_base != xmlMemBlocks()) {
40879            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
40880	           xmlMemBlocks() - mem_base);
40881	    test_ret++;
40882            printf(" %d", n_code);
40883            printf("\n");
40884        }
40885    }
40886    function_tests++;
40887#endif
40888
40889    return(test_ret);
40890}
40891
40892
40893static int
40894test_xmlUCSIsMiscellaneousSymbols(void) {
40895    int test_ret = 0;
40896
40897#if defined(LIBXML_UNICODE_ENABLED)
40898    int mem_base;
40899    int ret_val;
40900    int code; /* UCS code point */
40901    int n_code;
40902
40903    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40904        mem_base = xmlMemBlocks();
40905        code = gen_int(n_code, 0);
40906
40907        ret_val = xmlUCSIsMiscellaneousSymbols(code);
40908        desret_int(ret_val);
40909        call_tests++;
40910        des_int(n_code, code, 0);
40911        xmlResetLastError();
40912        if (mem_base != xmlMemBlocks()) {
40913            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
40914	           xmlMemBlocks() - mem_base);
40915	    test_ret++;
40916            printf(" %d", n_code);
40917            printf("\n");
40918        }
40919    }
40920    function_tests++;
40921#endif
40922
40923    return(test_ret);
40924}
40925
40926
40927static int
40928test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
40929    int test_ret = 0;
40930
40931#if defined(LIBXML_UNICODE_ENABLED)
40932    int mem_base;
40933    int ret_val;
40934    int code; /* UCS code point */
40935    int n_code;
40936
40937    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40938        mem_base = xmlMemBlocks();
40939        code = gen_int(n_code, 0);
40940
40941        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
40942        desret_int(ret_val);
40943        call_tests++;
40944        des_int(n_code, code, 0);
40945        xmlResetLastError();
40946        if (mem_base != xmlMemBlocks()) {
40947            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
40948	           xmlMemBlocks() - mem_base);
40949	    test_ret++;
40950            printf(" %d", n_code);
40951            printf("\n");
40952        }
40953    }
40954    function_tests++;
40955#endif
40956
40957    return(test_ret);
40958}
40959
40960
40961static int
40962test_xmlUCSIsMiscellaneousTechnical(void) {
40963    int test_ret = 0;
40964
40965#if defined(LIBXML_UNICODE_ENABLED)
40966    int mem_base;
40967    int ret_val;
40968    int code; /* UCS code point */
40969    int n_code;
40970
40971    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40972        mem_base = xmlMemBlocks();
40973        code = gen_int(n_code, 0);
40974
40975        ret_val = xmlUCSIsMiscellaneousTechnical(code);
40976        desret_int(ret_val);
40977        call_tests++;
40978        des_int(n_code, code, 0);
40979        xmlResetLastError();
40980        if (mem_base != xmlMemBlocks()) {
40981            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
40982	           xmlMemBlocks() - mem_base);
40983	    test_ret++;
40984            printf(" %d", n_code);
40985            printf("\n");
40986        }
40987    }
40988    function_tests++;
40989#endif
40990
40991    return(test_ret);
40992}
40993
40994
40995static int
40996test_xmlUCSIsMongolian(void) {
40997    int test_ret = 0;
40998
40999#if defined(LIBXML_UNICODE_ENABLED)
41000    int mem_base;
41001    int ret_val;
41002    int code; /* UCS code point */
41003    int n_code;
41004
41005    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41006        mem_base = xmlMemBlocks();
41007        code = gen_int(n_code, 0);
41008
41009        ret_val = xmlUCSIsMongolian(code);
41010        desret_int(ret_val);
41011        call_tests++;
41012        des_int(n_code, code, 0);
41013        xmlResetLastError();
41014        if (mem_base != xmlMemBlocks()) {
41015            printf("Leak of %d blocks found in xmlUCSIsMongolian",
41016	           xmlMemBlocks() - mem_base);
41017	    test_ret++;
41018            printf(" %d", n_code);
41019            printf("\n");
41020        }
41021    }
41022    function_tests++;
41023#endif
41024
41025    return(test_ret);
41026}
41027
41028
41029static int
41030test_xmlUCSIsMusicalSymbols(void) {
41031    int test_ret = 0;
41032
41033#if defined(LIBXML_UNICODE_ENABLED)
41034    int mem_base;
41035    int ret_val;
41036    int code; /* UCS code point */
41037    int n_code;
41038
41039    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41040        mem_base = xmlMemBlocks();
41041        code = gen_int(n_code, 0);
41042
41043        ret_val = xmlUCSIsMusicalSymbols(code);
41044        desret_int(ret_val);
41045        call_tests++;
41046        des_int(n_code, code, 0);
41047        xmlResetLastError();
41048        if (mem_base != xmlMemBlocks()) {
41049            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41050	           xmlMemBlocks() - mem_base);
41051	    test_ret++;
41052            printf(" %d", n_code);
41053            printf("\n");
41054        }
41055    }
41056    function_tests++;
41057#endif
41058
41059    return(test_ret);
41060}
41061
41062
41063static int
41064test_xmlUCSIsMyanmar(void) {
41065    int test_ret = 0;
41066
41067#if defined(LIBXML_UNICODE_ENABLED)
41068    int mem_base;
41069    int ret_val;
41070    int code; /* UCS code point */
41071    int n_code;
41072
41073    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41074        mem_base = xmlMemBlocks();
41075        code = gen_int(n_code, 0);
41076
41077        ret_val = xmlUCSIsMyanmar(code);
41078        desret_int(ret_val);
41079        call_tests++;
41080        des_int(n_code, code, 0);
41081        xmlResetLastError();
41082        if (mem_base != xmlMemBlocks()) {
41083            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41084	           xmlMemBlocks() - mem_base);
41085	    test_ret++;
41086            printf(" %d", n_code);
41087            printf("\n");
41088        }
41089    }
41090    function_tests++;
41091#endif
41092
41093    return(test_ret);
41094}
41095
41096
41097static int
41098test_xmlUCSIsNumberForms(void) {
41099    int test_ret = 0;
41100
41101#if defined(LIBXML_UNICODE_ENABLED)
41102    int mem_base;
41103    int ret_val;
41104    int code; /* UCS code point */
41105    int n_code;
41106
41107    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41108        mem_base = xmlMemBlocks();
41109        code = gen_int(n_code, 0);
41110
41111        ret_val = xmlUCSIsNumberForms(code);
41112        desret_int(ret_val);
41113        call_tests++;
41114        des_int(n_code, code, 0);
41115        xmlResetLastError();
41116        if (mem_base != xmlMemBlocks()) {
41117            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41118	           xmlMemBlocks() - mem_base);
41119	    test_ret++;
41120            printf(" %d", n_code);
41121            printf("\n");
41122        }
41123    }
41124    function_tests++;
41125#endif
41126
41127    return(test_ret);
41128}
41129
41130
41131static int
41132test_xmlUCSIsOgham(void) {
41133    int test_ret = 0;
41134
41135#if defined(LIBXML_UNICODE_ENABLED)
41136    int mem_base;
41137    int ret_val;
41138    int code; /* UCS code point */
41139    int n_code;
41140
41141    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41142        mem_base = xmlMemBlocks();
41143        code = gen_int(n_code, 0);
41144
41145        ret_val = xmlUCSIsOgham(code);
41146        desret_int(ret_val);
41147        call_tests++;
41148        des_int(n_code, code, 0);
41149        xmlResetLastError();
41150        if (mem_base != xmlMemBlocks()) {
41151            printf("Leak of %d blocks found in xmlUCSIsOgham",
41152	           xmlMemBlocks() - mem_base);
41153	    test_ret++;
41154            printf(" %d", n_code);
41155            printf("\n");
41156        }
41157    }
41158    function_tests++;
41159#endif
41160
41161    return(test_ret);
41162}
41163
41164
41165static int
41166test_xmlUCSIsOldItalic(void) {
41167    int test_ret = 0;
41168
41169#if defined(LIBXML_UNICODE_ENABLED)
41170    int mem_base;
41171    int ret_val;
41172    int code; /* UCS code point */
41173    int n_code;
41174
41175    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41176        mem_base = xmlMemBlocks();
41177        code = gen_int(n_code, 0);
41178
41179        ret_val = xmlUCSIsOldItalic(code);
41180        desret_int(ret_val);
41181        call_tests++;
41182        des_int(n_code, code, 0);
41183        xmlResetLastError();
41184        if (mem_base != xmlMemBlocks()) {
41185            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41186	           xmlMemBlocks() - mem_base);
41187	    test_ret++;
41188            printf(" %d", n_code);
41189            printf("\n");
41190        }
41191    }
41192    function_tests++;
41193#endif
41194
41195    return(test_ret);
41196}
41197
41198
41199static int
41200test_xmlUCSIsOpticalCharacterRecognition(void) {
41201    int test_ret = 0;
41202
41203#if defined(LIBXML_UNICODE_ENABLED)
41204    int mem_base;
41205    int ret_val;
41206    int code; /* UCS code point */
41207    int n_code;
41208
41209    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41210        mem_base = xmlMemBlocks();
41211        code = gen_int(n_code, 0);
41212
41213        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41214        desret_int(ret_val);
41215        call_tests++;
41216        des_int(n_code, code, 0);
41217        xmlResetLastError();
41218        if (mem_base != xmlMemBlocks()) {
41219            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41220	           xmlMemBlocks() - mem_base);
41221	    test_ret++;
41222            printf(" %d", n_code);
41223            printf("\n");
41224        }
41225    }
41226    function_tests++;
41227#endif
41228
41229    return(test_ret);
41230}
41231
41232
41233static int
41234test_xmlUCSIsOriya(void) {
41235    int test_ret = 0;
41236
41237#if defined(LIBXML_UNICODE_ENABLED)
41238    int mem_base;
41239    int ret_val;
41240    int code; /* UCS code point */
41241    int n_code;
41242
41243    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41244        mem_base = xmlMemBlocks();
41245        code = gen_int(n_code, 0);
41246
41247        ret_val = xmlUCSIsOriya(code);
41248        desret_int(ret_val);
41249        call_tests++;
41250        des_int(n_code, code, 0);
41251        xmlResetLastError();
41252        if (mem_base != xmlMemBlocks()) {
41253            printf("Leak of %d blocks found in xmlUCSIsOriya",
41254	           xmlMemBlocks() - mem_base);
41255	    test_ret++;
41256            printf(" %d", n_code);
41257            printf("\n");
41258        }
41259    }
41260    function_tests++;
41261#endif
41262
41263    return(test_ret);
41264}
41265
41266
41267static int
41268test_xmlUCSIsOsmanya(void) {
41269    int test_ret = 0;
41270
41271#if defined(LIBXML_UNICODE_ENABLED)
41272    int mem_base;
41273    int ret_val;
41274    int code; /* UCS code point */
41275    int n_code;
41276
41277    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41278        mem_base = xmlMemBlocks();
41279        code = gen_int(n_code, 0);
41280
41281        ret_val = xmlUCSIsOsmanya(code);
41282        desret_int(ret_val);
41283        call_tests++;
41284        des_int(n_code, code, 0);
41285        xmlResetLastError();
41286        if (mem_base != xmlMemBlocks()) {
41287            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41288	           xmlMemBlocks() - mem_base);
41289	    test_ret++;
41290            printf(" %d", n_code);
41291            printf("\n");
41292        }
41293    }
41294    function_tests++;
41295#endif
41296
41297    return(test_ret);
41298}
41299
41300
41301static int
41302test_xmlUCSIsPhoneticExtensions(void) {
41303    int test_ret = 0;
41304
41305#if defined(LIBXML_UNICODE_ENABLED)
41306    int mem_base;
41307    int ret_val;
41308    int code; /* UCS code point */
41309    int n_code;
41310
41311    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41312        mem_base = xmlMemBlocks();
41313        code = gen_int(n_code, 0);
41314
41315        ret_val = xmlUCSIsPhoneticExtensions(code);
41316        desret_int(ret_val);
41317        call_tests++;
41318        des_int(n_code, code, 0);
41319        xmlResetLastError();
41320        if (mem_base != xmlMemBlocks()) {
41321            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41322	           xmlMemBlocks() - mem_base);
41323	    test_ret++;
41324            printf(" %d", n_code);
41325            printf("\n");
41326        }
41327    }
41328    function_tests++;
41329#endif
41330
41331    return(test_ret);
41332}
41333
41334
41335static int
41336test_xmlUCSIsPrivateUse(void) {
41337    int test_ret = 0;
41338
41339#if defined(LIBXML_UNICODE_ENABLED)
41340    int mem_base;
41341    int ret_val;
41342    int code; /* UCS code point */
41343    int n_code;
41344
41345    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41346        mem_base = xmlMemBlocks();
41347        code = gen_int(n_code, 0);
41348
41349        ret_val = xmlUCSIsPrivateUse(code);
41350        desret_int(ret_val);
41351        call_tests++;
41352        des_int(n_code, code, 0);
41353        xmlResetLastError();
41354        if (mem_base != xmlMemBlocks()) {
41355            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41356	           xmlMemBlocks() - mem_base);
41357	    test_ret++;
41358            printf(" %d", n_code);
41359            printf("\n");
41360        }
41361    }
41362    function_tests++;
41363#endif
41364
41365    return(test_ret);
41366}
41367
41368
41369static int
41370test_xmlUCSIsPrivateUseArea(void) {
41371    int test_ret = 0;
41372
41373#if defined(LIBXML_UNICODE_ENABLED)
41374    int mem_base;
41375    int ret_val;
41376    int code; /* UCS code point */
41377    int n_code;
41378
41379    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41380        mem_base = xmlMemBlocks();
41381        code = gen_int(n_code, 0);
41382
41383        ret_val = xmlUCSIsPrivateUseArea(code);
41384        desret_int(ret_val);
41385        call_tests++;
41386        des_int(n_code, code, 0);
41387        xmlResetLastError();
41388        if (mem_base != xmlMemBlocks()) {
41389            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41390	           xmlMemBlocks() - mem_base);
41391	    test_ret++;
41392            printf(" %d", n_code);
41393            printf("\n");
41394        }
41395    }
41396    function_tests++;
41397#endif
41398
41399    return(test_ret);
41400}
41401
41402
41403static int
41404test_xmlUCSIsRunic(void) {
41405    int test_ret = 0;
41406
41407#if defined(LIBXML_UNICODE_ENABLED)
41408    int mem_base;
41409    int ret_val;
41410    int code; /* UCS code point */
41411    int n_code;
41412
41413    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41414        mem_base = xmlMemBlocks();
41415        code = gen_int(n_code, 0);
41416
41417        ret_val = xmlUCSIsRunic(code);
41418        desret_int(ret_val);
41419        call_tests++;
41420        des_int(n_code, code, 0);
41421        xmlResetLastError();
41422        if (mem_base != xmlMemBlocks()) {
41423            printf("Leak of %d blocks found in xmlUCSIsRunic",
41424	           xmlMemBlocks() - mem_base);
41425	    test_ret++;
41426            printf(" %d", n_code);
41427            printf("\n");
41428        }
41429    }
41430    function_tests++;
41431#endif
41432
41433    return(test_ret);
41434}
41435
41436
41437static int
41438test_xmlUCSIsShavian(void) {
41439    int test_ret = 0;
41440
41441#if defined(LIBXML_UNICODE_ENABLED)
41442    int mem_base;
41443    int ret_val;
41444    int code; /* UCS code point */
41445    int n_code;
41446
41447    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41448        mem_base = xmlMemBlocks();
41449        code = gen_int(n_code, 0);
41450
41451        ret_val = xmlUCSIsShavian(code);
41452        desret_int(ret_val);
41453        call_tests++;
41454        des_int(n_code, code, 0);
41455        xmlResetLastError();
41456        if (mem_base != xmlMemBlocks()) {
41457            printf("Leak of %d blocks found in xmlUCSIsShavian",
41458	           xmlMemBlocks() - mem_base);
41459	    test_ret++;
41460            printf(" %d", n_code);
41461            printf("\n");
41462        }
41463    }
41464    function_tests++;
41465#endif
41466
41467    return(test_ret);
41468}
41469
41470
41471static int
41472test_xmlUCSIsSinhala(void) {
41473    int test_ret = 0;
41474
41475#if defined(LIBXML_UNICODE_ENABLED)
41476    int mem_base;
41477    int ret_val;
41478    int code; /* UCS code point */
41479    int n_code;
41480
41481    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41482        mem_base = xmlMemBlocks();
41483        code = gen_int(n_code, 0);
41484
41485        ret_val = xmlUCSIsSinhala(code);
41486        desret_int(ret_val);
41487        call_tests++;
41488        des_int(n_code, code, 0);
41489        xmlResetLastError();
41490        if (mem_base != xmlMemBlocks()) {
41491            printf("Leak of %d blocks found in xmlUCSIsSinhala",
41492	           xmlMemBlocks() - mem_base);
41493	    test_ret++;
41494            printf(" %d", n_code);
41495            printf("\n");
41496        }
41497    }
41498    function_tests++;
41499#endif
41500
41501    return(test_ret);
41502}
41503
41504
41505static int
41506test_xmlUCSIsSmallFormVariants(void) {
41507    int test_ret = 0;
41508
41509#if defined(LIBXML_UNICODE_ENABLED)
41510    int mem_base;
41511    int ret_val;
41512    int code; /* UCS code point */
41513    int n_code;
41514
41515    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41516        mem_base = xmlMemBlocks();
41517        code = gen_int(n_code, 0);
41518
41519        ret_val = xmlUCSIsSmallFormVariants(code);
41520        desret_int(ret_val);
41521        call_tests++;
41522        des_int(n_code, code, 0);
41523        xmlResetLastError();
41524        if (mem_base != xmlMemBlocks()) {
41525            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41526	           xmlMemBlocks() - mem_base);
41527	    test_ret++;
41528            printf(" %d", n_code);
41529            printf("\n");
41530        }
41531    }
41532    function_tests++;
41533#endif
41534
41535    return(test_ret);
41536}
41537
41538
41539static int
41540test_xmlUCSIsSpacingModifierLetters(void) {
41541    int test_ret = 0;
41542
41543#if defined(LIBXML_UNICODE_ENABLED)
41544    int mem_base;
41545    int ret_val;
41546    int code; /* UCS code point */
41547    int n_code;
41548
41549    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41550        mem_base = xmlMemBlocks();
41551        code = gen_int(n_code, 0);
41552
41553        ret_val = xmlUCSIsSpacingModifierLetters(code);
41554        desret_int(ret_val);
41555        call_tests++;
41556        des_int(n_code, code, 0);
41557        xmlResetLastError();
41558        if (mem_base != xmlMemBlocks()) {
41559            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41560	           xmlMemBlocks() - mem_base);
41561	    test_ret++;
41562            printf(" %d", n_code);
41563            printf("\n");
41564        }
41565    }
41566    function_tests++;
41567#endif
41568
41569    return(test_ret);
41570}
41571
41572
41573static int
41574test_xmlUCSIsSpecials(void) {
41575    int test_ret = 0;
41576
41577#if defined(LIBXML_UNICODE_ENABLED)
41578    int mem_base;
41579    int ret_val;
41580    int code; /* UCS code point */
41581    int n_code;
41582
41583    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41584        mem_base = xmlMemBlocks();
41585        code = gen_int(n_code, 0);
41586
41587        ret_val = xmlUCSIsSpecials(code);
41588        desret_int(ret_val);
41589        call_tests++;
41590        des_int(n_code, code, 0);
41591        xmlResetLastError();
41592        if (mem_base != xmlMemBlocks()) {
41593            printf("Leak of %d blocks found in xmlUCSIsSpecials",
41594	           xmlMemBlocks() - mem_base);
41595	    test_ret++;
41596            printf(" %d", n_code);
41597            printf("\n");
41598        }
41599    }
41600    function_tests++;
41601#endif
41602
41603    return(test_ret);
41604}
41605
41606
41607static int
41608test_xmlUCSIsSuperscriptsandSubscripts(void) {
41609    int test_ret = 0;
41610
41611#if defined(LIBXML_UNICODE_ENABLED)
41612    int mem_base;
41613    int ret_val;
41614    int code; /* UCS code point */
41615    int n_code;
41616
41617    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41618        mem_base = xmlMemBlocks();
41619        code = gen_int(n_code, 0);
41620
41621        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41622        desret_int(ret_val);
41623        call_tests++;
41624        des_int(n_code, code, 0);
41625        xmlResetLastError();
41626        if (mem_base != xmlMemBlocks()) {
41627            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41628	           xmlMemBlocks() - mem_base);
41629	    test_ret++;
41630            printf(" %d", n_code);
41631            printf("\n");
41632        }
41633    }
41634    function_tests++;
41635#endif
41636
41637    return(test_ret);
41638}
41639
41640
41641static int
41642test_xmlUCSIsSupplementalArrowsA(void) {
41643    int test_ret = 0;
41644
41645#if defined(LIBXML_UNICODE_ENABLED)
41646    int mem_base;
41647    int ret_val;
41648    int code; /* UCS code point */
41649    int n_code;
41650
41651    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41652        mem_base = xmlMemBlocks();
41653        code = gen_int(n_code, 0);
41654
41655        ret_val = xmlUCSIsSupplementalArrowsA(code);
41656        desret_int(ret_val);
41657        call_tests++;
41658        des_int(n_code, code, 0);
41659        xmlResetLastError();
41660        if (mem_base != xmlMemBlocks()) {
41661            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41662	           xmlMemBlocks() - mem_base);
41663	    test_ret++;
41664            printf(" %d", n_code);
41665            printf("\n");
41666        }
41667    }
41668    function_tests++;
41669#endif
41670
41671    return(test_ret);
41672}
41673
41674
41675static int
41676test_xmlUCSIsSupplementalArrowsB(void) {
41677    int test_ret = 0;
41678
41679#if defined(LIBXML_UNICODE_ENABLED)
41680    int mem_base;
41681    int ret_val;
41682    int code; /* UCS code point */
41683    int n_code;
41684
41685    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41686        mem_base = xmlMemBlocks();
41687        code = gen_int(n_code, 0);
41688
41689        ret_val = xmlUCSIsSupplementalArrowsB(code);
41690        desret_int(ret_val);
41691        call_tests++;
41692        des_int(n_code, code, 0);
41693        xmlResetLastError();
41694        if (mem_base != xmlMemBlocks()) {
41695            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41696	           xmlMemBlocks() - mem_base);
41697	    test_ret++;
41698            printf(" %d", n_code);
41699            printf("\n");
41700        }
41701    }
41702    function_tests++;
41703#endif
41704
41705    return(test_ret);
41706}
41707
41708
41709static int
41710test_xmlUCSIsSupplementalMathematicalOperators(void) {
41711    int test_ret = 0;
41712
41713#if defined(LIBXML_UNICODE_ENABLED)
41714    int mem_base;
41715    int ret_val;
41716    int code; /* UCS code point */
41717    int n_code;
41718
41719    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41720        mem_base = xmlMemBlocks();
41721        code = gen_int(n_code, 0);
41722
41723        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41724        desret_int(ret_val);
41725        call_tests++;
41726        des_int(n_code, code, 0);
41727        xmlResetLastError();
41728        if (mem_base != xmlMemBlocks()) {
41729            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41730	           xmlMemBlocks() - mem_base);
41731	    test_ret++;
41732            printf(" %d", n_code);
41733            printf("\n");
41734        }
41735    }
41736    function_tests++;
41737#endif
41738
41739    return(test_ret);
41740}
41741
41742
41743static int
41744test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41745    int test_ret = 0;
41746
41747#if defined(LIBXML_UNICODE_ENABLED)
41748    int mem_base;
41749    int ret_val;
41750    int code; /* UCS code point */
41751    int n_code;
41752
41753    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41754        mem_base = xmlMemBlocks();
41755        code = gen_int(n_code, 0);
41756
41757        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41758        desret_int(ret_val);
41759        call_tests++;
41760        des_int(n_code, code, 0);
41761        xmlResetLastError();
41762        if (mem_base != xmlMemBlocks()) {
41763            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41764	           xmlMemBlocks() - mem_base);
41765	    test_ret++;
41766            printf(" %d", n_code);
41767            printf("\n");
41768        }
41769    }
41770    function_tests++;
41771#endif
41772
41773    return(test_ret);
41774}
41775
41776
41777static int
41778test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
41779    int test_ret = 0;
41780
41781#if defined(LIBXML_UNICODE_ENABLED)
41782    int mem_base;
41783    int ret_val;
41784    int code; /* UCS code point */
41785    int n_code;
41786
41787    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41788        mem_base = xmlMemBlocks();
41789        code = gen_int(n_code, 0);
41790
41791        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
41792        desret_int(ret_val);
41793        call_tests++;
41794        des_int(n_code, code, 0);
41795        xmlResetLastError();
41796        if (mem_base != xmlMemBlocks()) {
41797            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
41798	           xmlMemBlocks() - mem_base);
41799	    test_ret++;
41800            printf(" %d", n_code);
41801            printf("\n");
41802        }
41803    }
41804    function_tests++;
41805#endif
41806
41807    return(test_ret);
41808}
41809
41810
41811static int
41812test_xmlUCSIsSyriac(void) {
41813    int test_ret = 0;
41814
41815#if defined(LIBXML_UNICODE_ENABLED)
41816    int mem_base;
41817    int ret_val;
41818    int code; /* UCS code point */
41819    int n_code;
41820
41821    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41822        mem_base = xmlMemBlocks();
41823        code = gen_int(n_code, 0);
41824
41825        ret_val = xmlUCSIsSyriac(code);
41826        desret_int(ret_val);
41827        call_tests++;
41828        des_int(n_code, code, 0);
41829        xmlResetLastError();
41830        if (mem_base != xmlMemBlocks()) {
41831            printf("Leak of %d blocks found in xmlUCSIsSyriac",
41832	           xmlMemBlocks() - mem_base);
41833	    test_ret++;
41834            printf(" %d", n_code);
41835            printf("\n");
41836        }
41837    }
41838    function_tests++;
41839#endif
41840
41841    return(test_ret);
41842}
41843
41844
41845static int
41846test_xmlUCSIsTagalog(void) {
41847    int test_ret = 0;
41848
41849#if defined(LIBXML_UNICODE_ENABLED)
41850    int mem_base;
41851    int ret_val;
41852    int code; /* UCS code point */
41853    int n_code;
41854
41855    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41856        mem_base = xmlMemBlocks();
41857        code = gen_int(n_code, 0);
41858
41859        ret_val = xmlUCSIsTagalog(code);
41860        desret_int(ret_val);
41861        call_tests++;
41862        des_int(n_code, code, 0);
41863        xmlResetLastError();
41864        if (mem_base != xmlMemBlocks()) {
41865            printf("Leak of %d blocks found in xmlUCSIsTagalog",
41866	           xmlMemBlocks() - mem_base);
41867	    test_ret++;
41868            printf(" %d", n_code);
41869            printf("\n");
41870        }
41871    }
41872    function_tests++;
41873#endif
41874
41875    return(test_ret);
41876}
41877
41878
41879static int
41880test_xmlUCSIsTagbanwa(void) {
41881    int test_ret = 0;
41882
41883#if defined(LIBXML_UNICODE_ENABLED)
41884    int mem_base;
41885    int ret_val;
41886    int code; /* UCS code point */
41887    int n_code;
41888
41889    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41890        mem_base = xmlMemBlocks();
41891        code = gen_int(n_code, 0);
41892
41893        ret_val = xmlUCSIsTagbanwa(code);
41894        desret_int(ret_val);
41895        call_tests++;
41896        des_int(n_code, code, 0);
41897        xmlResetLastError();
41898        if (mem_base != xmlMemBlocks()) {
41899            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
41900	           xmlMemBlocks() - mem_base);
41901	    test_ret++;
41902            printf(" %d", n_code);
41903            printf("\n");
41904        }
41905    }
41906    function_tests++;
41907#endif
41908
41909    return(test_ret);
41910}
41911
41912
41913static int
41914test_xmlUCSIsTags(void) {
41915    int test_ret = 0;
41916
41917#if defined(LIBXML_UNICODE_ENABLED)
41918    int mem_base;
41919    int ret_val;
41920    int code; /* UCS code point */
41921    int n_code;
41922
41923    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41924        mem_base = xmlMemBlocks();
41925        code = gen_int(n_code, 0);
41926
41927        ret_val = xmlUCSIsTags(code);
41928        desret_int(ret_val);
41929        call_tests++;
41930        des_int(n_code, code, 0);
41931        xmlResetLastError();
41932        if (mem_base != xmlMemBlocks()) {
41933            printf("Leak of %d blocks found in xmlUCSIsTags",
41934	           xmlMemBlocks() - mem_base);
41935	    test_ret++;
41936            printf(" %d", n_code);
41937            printf("\n");
41938        }
41939    }
41940    function_tests++;
41941#endif
41942
41943    return(test_ret);
41944}
41945
41946
41947static int
41948test_xmlUCSIsTaiLe(void) {
41949    int test_ret = 0;
41950
41951#if defined(LIBXML_UNICODE_ENABLED)
41952    int mem_base;
41953    int ret_val;
41954    int code; /* UCS code point */
41955    int n_code;
41956
41957    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41958        mem_base = xmlMemBlocks();
41959        code = gen_int(n_code, 0);
41960
41961        ret_val = xmlUCSIsTaiLe(code);
41962        desret_int(ret_val);
41963        call_tests++;
41964        des_int(n_code, code, 0);
41965        xmlResetLastError();
41966        if (mem_base != xmlMemBlocks()) {
41967            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
41968	           xmlMemBlocks() - mem_base);
41969	    test_ret++;
41970            printf(" %d", n_code);
41971            printf("\n");
41972        }
41973    }
41974    function_tests++;
41975#endif
41976
41977    return(test_ret);
41978}
41979
41980
41981static int
41982test_xmlUCSIsTaiXuanJingSymbols(void) {
41983    int test_ret = 0;
41984
41985#if defined(LIBXML_UNICODE_ENABLED)
41986    int mem_base;
41987    int ret_val;
41988    int code; /* UCS code point */
41989    int n_code;
41990
41991    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41992        mem_base = xmlMemBlocks();
41993        code = gen_int(n_code, 0);
41994
41995        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
41996        desret_int(ret_val);
41997        call_tests++;
41998        des_int(n_code, code, 0);
41999        xmlResetLastError();
42000        if (mem_base != xmlMemBlocks()) {
42001            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42002	           xmlMemBlocks() - mem_base);
42003	    test_ret++;
42004            printf(" %d", n_code);
42005            printf("\n");
42006        }
42007    }
42008    function_tests++;
42009#endif
42010
42011    return(test_ret);
42012}
42013
42014
42015static int
42016test_xmlUCSIsTamil(void) {
42017    int test_ret = 0;
42018
42019#if defined(LIBXML_UNICODE_ENABLED)
42020    int mem_base;
42021    int ret_val;
42022    int code; /* UCS code point */
42023    int n_code;
42024
42025    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42026        mem_base = xmlMemBlocks();
42027        code = gen_int(n_code, 0);
42028
42029        ret_val = xmlUCSIsTamil(code);
42030        desret_int(ret_val);
42031        call_tests++;
42032        des_int(n_code, code, 0);
42033        xmlResetLastError();
42034        if (mem_base != xmlMemBlocks()) {
42035            printf("Leak of %d blocks found in xmlUCSIsTamil",
42036	           xmlMemBlocks() - mem_base);
42037	    test_ret++;
42038            printf(" %d", n_code);
42039            printf("\n");
42040        }
42041    }
42042    function_tests++;
42043#endif
42044
42045    return(test_ret);
42046}
42047
42048
42049static int
42050test_xmlUCSIsTelugu(void) {
42051    int test_ret = 0;
42052
42053#if defined(LIBXML_UNICODE_ENABLED)
42054    int mem_base;
42055    int ret_val;
42056    int code; /* UCS code point */
42057    int n_code;
42058
42059    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42060        mem_base = xmlMemBlocks();
42061        code = gen_int(n_code, 0);
42062
42063        ret_val = xmlUCSIsTelugu(code);
42064        desret_int(ret_val);
42065        call_tests++;
42066        des_int(n_code, code, 0);
42067        xmlResetLastError();
42068        if (mem_base != xmlMemBlocks()) {
42069            printf("Leak of %d blocks found in xmlUCSIsTelugu",
42070	           xmlMemBlocks() - mem_base);
42071	    test_ret++;
42072            printf(" %d", n_code);
42073            printf("\n");
42074        }
42075    }
42076    function_tests++;
42077#endif
42078
42079    return(test_ret);
42080}
42081
42082
42083static int
42084test_xmlUCSIsThaana(void) {
42085    int test_ret = 0;
42086
42087#if defined(LIBXML_UNICODE_ENABLED)
42088    int mem_base;
42089    int ret_val;
42090    int code; /* UCS code point */
42091    int n_code;
42092
42093    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42094        mem_base = xmlMemBlocks();
42095        code = gen_int(n_code, 0);
42096
42097        ret_val = xmlUCSIsThaana(code);
42098        desret_int(ret_val);
42099        call_tests++;
42100        des_int(n_code, code, 0);
42101        xmlResetLastError();
42102        if (mem_base != xmlMemBlocks()) {
42103            printf("Leak of %d blocks found in xmlUCSIsThaana",
42104	           xmlMemBlocks() - mem_base);
42105	    test_ret++;
42106            printf(" %d", n_code);
42107            printf("\n");
42108        }
42109    }
42110    function_tests++;
42111#endif
42112
42113    return(test_ret);
42114}
42115
42116
42117static int
42118test_xmlUCSIsThai(void) {
42119    int test_ret = 0;
42120
42121#if defined(LIBXML_UNICODE_ENABLED)
42122    int mem_base;
42123    int ret_val;
42124    int code; /* UCS code point */
42125    int n_code;
42126
42127    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42128        mem_base = xmlMemBlocks();
42129        code = gen_int(n_code, 0);
42130
42131        ret_val = xmlUCSIsThai(code);
42132        desret_int(ret_val);
42133        call_tests++;
42134        des_int(n_code, code, 0);
42135        xmlResetLastError();
42136        if (mem_base != xmlMemBlocks()) {
42137            printf("Leak of %d blocks found in xmlUCSIsThai",
42138	           xmlMemBlocks() - mem_base);
42139	    test_ret++;
42140            printf(" %d", n_code);
42141            printf("\n");
42142        }
42143    }
42144    function_tests++;
42145#endif
42146
42147    return(test_ret);
42148}
42149
42150
42151static int
42152test_xmlUCSIsTibetan(void) {
42153    int test_ret = 0;
42154
42155#if defined(LIBXML_UNICODE_ENABLED)
42156    int mem_base;
42157    int ret_val;
42158    int code; /* UCS code point */
42159    int n_code;
42160
42161    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42162        mem_base = xmlMemBlocks();
42163        code = gen_int(n_code, 0);
42164
42165        ret_val = xmlUCSIsTibetan(code);
42166        desret_int(ret_val);
42167        call_tests++;
42168        des_int(n_code, code, 0);
42169        xmlResetLastError();
42170        if (mem_base != xmlMemBlocks()) {
42171            printf("Leak of %d blocks found in xmlUCSIsTibetan",
42172	           xmlMemBlocks() - mem_base);
42173	    test_ret++;
42174            printf(" %d", n_code);
42175            printf("\n");
42176        }
42177    }
42178    function_tests++;
42179#endif
42180
42181    return(test_ret);
42182}
42183
42184
42185static int
42186test_xmlUCSIsUgaritic(void) {
42187    int test_ret = 0;
42188
42189#if defined(LIBXML_UNICODE_ENABLED)
42190    int mem_base;
42191    int ret_val;
42192    int code; /* UCS code point */
42193    int n_code;
42194
42195    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42196        mem_base = xmlMemBlocks();
42197        code = gen_int(n_code, 0);
42198
42199        ret_val = xmlUCSIsUgaritic(code);
42200        desret_int(ret_val);
42201        call_tests++;
42202        des_int(n_code, code, 0);
42203        xmlResetLastError();
42204        if (mem_base != xmlMemBlocks()) {
42205            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42206	           xmlMemBlocks() - mem_base);
42207	    test_ret++;
42208            printf(" %d", n_code);
42209            printf("\n");
42210        }
42211    }
42212    function_tests++;
42213#endif
42214
42215    return(test_ret);
42216}
42217
42218
42219static int
42220test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42221    int test_ret = 0;
42222
42223#if defined(LIBXML_UNICODE_ENABLED)
42224    int mem_base;
42225    int ret_val;
42226    int code; /* UCS code point */
42227    int n_code;
42228
42229    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42230        mem_base = xmlMemBlocks();
42231        code = gen_int(n_code, 0);
42232
42233        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42234        desret_int(ret_val);
42235        call_tests++;
42236        des_int(n_code, code, 0);
42237        xmlResetLastError();
42238        if (mem_base != xmlMemBlocks()) {
42239            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42240	           xmlMemBlocks() - mem_base);
42241	    test_ret++;
42242            printf(" %d", n_code);
42243            printf("\n");
42244        }
42245    }
42246    function_tests++;
42247#endif
42248
42249    return(test_ret);
42250}
42251
42252
42253static int
42254test_xmlUCSIsVariationSelectors(void) {
42255    int test_ret = 0;
42256
42257#if defined(LIBXML_UNICODE_ENABLED)
42258    int mem_base;
42259    int ret_val;
42260    int code; /* UCS code point */
42261    int n_code;
42262
42263    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42264        mem_base = xmlMemBlocks();
42265        code = gen_int(n_code, 0);
42266
42267        ret_val = xmlUCSIsVariationSelectors(code);
42268        desret_int(ret_val);
42269        call_tests++;
42270        des_int(n_code, code, 0);
42271        xmlResetLastError();
42272        if (mem_base != xmlMemBlocks()) {
42273            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42274	           xmlMemBlocks() - mem_base);
42275	    test_ret++;
42276            printf(" %d", n_code);
42277            printf("\n");
42278        }
42279    }
42280    function_tests++;
42281#endif
42282
42283    return(test_ret);
42284}
42285
42286
42287static int
42288test_xmlUCSIsVariationSelectorsSupplement(void) {
42289    int test_ret = 0;
42290
42291#if defined(LIBXML_UNICODE_ENABLED)
42292    int mem_base;
42293    int ret_val;
42294    int code; /* UCS code point */
42295    int n_code;
42296
42297    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42298        mem_base = xmlMemBlocks();
42299        code = gen_int(n_code, 0);
42300
42301        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42302        desret_int(ret_val);
42303        call_tests++;
42304        des_int(n_code, code, 0);
42305        xmlResetLastError();
42306        if (mem_base != xmlMemBlocks()) {
42307            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42308	           xmlMemBlocks() - mem_base);
42309	    test_ret++;
42310            printf(" %d", n_code);
42311            printf("\n");
42312        }
42313    }
42314    function_tests++;
42315#endif
42316
42317    return(test_ret);
42318}
42319
42320
42321static int
42322test_xmlUCSIsYiRadicals(void) {
42323    int test_ret = 0;
42324
42325#if defined(LIBXML_UNICODE_ENABLED)
42326    int mem_base;
42327    int ret_val;
42328    int code; /* UCS code point */
42329    int n_code;
42330
42331    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42332        mem_base = xmlMemBlocks();
42333        code = gen_int(n_code, 0);
42334
42335        ret_val = xmlUCSIsYiRadicals(code);
42336        desret_int(ret_val);
42337        call_tests++;
42338        des_int(n_code, code, 0);
42339        xmlResetLastError();
42340        if (mem_base != xmlMemBlocks()) {
42341            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42342	           xmlMemBlocks() - mem_base);
42343	    test_ret++;
42344            printf(" %d", n_code);
42345            printf("\n");
42346        }
42347    }
42348    function_tests++;
42349#endif
42350
42351    return(test_ret);
42352}
42353
42354
42355static int
42356test_xmlUCSIsYiSyllables(void) {
42357    int test_ret = 0;
42358
42359#if defined(LIBXML_UNICODE_ENABLED)
42360    int mem_base;
42361    int ret_val;
42362    int code; /* UCS code point */
42363    int n_code;
42364
42365    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42366        mem_base = xmlMemBlocks();
42367        code = gen_int(n_code, 0);
42368
42369        ret_val = xmlUCSIsYiSyllables(code);
42370        desret_int(ret_val);
42371        call_tests++;
42372        des_int(n_code, code, 0);
42373        xmlResetLastError();
42374        if (mem_base != xmlMemBlocks()) {
42375            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42376	           xmlMemBlocks() - mem_base);
42377	    test_ret++;
42378            printf(" %d", n_code);
42379            printf("\n");
42380        }
42381    }
42382    function_tests++;
42383#endif
42384
42385    return(test_ret);
42386}
42387
42388
42389static int
42390test_xmlUCSIsYijingHexagramSymbols(void) {
42391    int test_ret = 0;
42392
42393#if defined(LIBXML_UNICODE_ENABLED)
42394    int mem_base;
42395    int ret_val;
42396    int code; /* UCS code point */
42397    int n_code;
42398
42399    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42400        mem_base = xmlMemBlocks();
42401        code = gen_int(n_code, 0);
42402
42403        ret_val = xmlUCSIsYijingHexagramSymbols(code);
42404        desret_int(ret_val);
42405        call_tests++;
42406        des_int(n_code, code, 0);
42407        xmlResetLastError();
42408        if (mem_base != xmlMemBlocks()) {
42409            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42410	           xmlMemBlocks() - mem_base);
42411	    test_ret++;
42412            printf(" %d", n_code);
42413            printf("\n");
42414        }
42415    }
42416    function_tests++;
42417#endif
42418
42419    return(test_ret);
42420}
42421
42422static int
42423test_xmlunicode(void) {
42424    int test_ret = 0;
42425
42426    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42427    test_ret += test_xmlUCSIsAegeanNumbers();
42428    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42429    test_ret += test_xmlUCSIsArabic();
42430    test_ret += test_xmlUCSIsArabicPresentationFormsA();
42431    test_ret += test_xmlUCSIsArabicPresentationFormsB();
42432    test_ret += test_xmlUCSIsArmenian();
42433    test_ret += test_xmlUCSIsArrows();
42434    test_ret += test_xmlUCSIsBasicLatin();
42435    test_ret += test_xmlUCSIsBengali();
42436    test_ret += test_xmlUCSIsBlock();
42437    test_ret += test_xmlUCSIsBlockElements();
42438    test_ret += test_xmlUCSIsBopomofo();
42439    test_ret += test_xmlUCSIsBopomofoExtended();
42440    test_ret += test_xmlUCSIsBoxDrawing();
42441    test_ret += test_xmlUCSIsBraillePatterns();
42442    test_ret += test_xmlUCSIsBuhid();
42443    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42444    test_ret += test_xmlUCSIsCJKCompatibility();
42445    test_ret += test_xmlUCSIsCJKCompatibilityForms();
42446    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42447    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42448    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42449    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42450    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42451    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42452    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42453    test_ret += test_xmlUCSIsCat();
42454    test_ret += test_xmlUCSIsCatC();
42455    test_ret += test_xmlUCSIsCatCc();
42456    test_ret += test_xmlUCSIsCatCf();
42457    test_ret += test_xmlUCSIsCatCo();
42458    test_ret += test_xmlUCSIsCatCs();
42459    test_ret += test_xmlUCSIsCatL();
42460    test_ret += test_xmlUCSIsCatLl();
42461    test_ret += test_xmlUCSIsCatLm();
42462    test_ret += test_xmlUCSIsCatLo();
42463    test_ret += test_xmlUCSIsCatLt();
42464    test_ret += test_xmlUCSIsCatLu();
42465    test_ret += test_xmlUCSIsCatM();
42466    test_ret += test_xmlUCSIsCatMc();
42467    test_ret += test_xmlUCSIsCatMe();
42468    test_ret += test_xmlUCSIsCatMn();
42469    test_ret += test_xmlUCSIsCatN();
42470    test_ret += test_xmlUCSIsCatNd();
42471    test_ret += test_xmlUCSIsCatNl();
42472    test_ret += test_xmlUCSIsCatNo();
42473    test_ret += test_xmlUCSIsCatP();
42474    test_ret += test_xmlUCSIsCatPc();
42475    test_ret += test_xmlUCSIsCatPd();
42476    test_ret += test_xmlUCSIsCatPe();
42477    test_ret += test_xmlUCSIsCatPf();
42478    test_ret += test_xmlUCSIsCatPi();
42479    test_ret += test_xmlUCSIsCatPo();
42480    test_ret += test_xmlUCSIsCatPs();
42481    test_ret += test_xmlUCSIsCatS();
42482    test_ret += test_xmlUCSIsCatSc();
42483    test_ret += test_xmlUCSIsCatSk();
42484    test_ret += test_xmlUCSIsCatSm();
42485    test_ret += test_xmlUCSIsCatSo();
42486    test_ret += test_xmlUCSIsCatZ();
42487    test_ret += test_xmlUCSIsCatZl();
42488    test_ret += test_xmlUCSIsCatZp();
42489    test_ret += test_xmlUCSIsCatZs();
42490    test_ret += test_xmlUCSIsCherokee();
42491    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42492    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42493    test_ret += test_xmlUCSIsCombiningHalfMarks();
42494    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42495    test_ret += test_xmlUCSIsControlPictures();
42496    test_ret += test_xmlUCSIsCurrencySymbols();
42497    test_ret += test_xmlUCSIsCypriotSyllabary();
42498    test_ret += test_xmlUCSIsCyrillic();
42499    test_ret += test_xmlUCSIsCyrillicSupplement();
42500    test_ret += test_xmlUCSIsDeseret();
42501    test_ret += test_xmlUCSIsDevanagari();
42502    test_ret += test_xmlUCSIsDingbats();
42503    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42504    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42505    test_ret += test_xmlUCSIsEthiopic();
42506    test_ret += test_xmlUCSIsGeneralPunctuation();
42507    test_ret += test_xmlUCSIsGeometricShapes();
42508    test_ret += test_xmlUCSIsGeorgian();
42509    test_ret += test_xmlUCSIsGothic();
42510    test_ret += test_xmlUCSIsGreek();
42511    test_ret += test_xmlUCSIsGreekExtended();
42512    test_ret += test_xmlUCSIsGreekandCoptic();
42513    test_ret += test_xmlUCSIsGujarati();
42514    test_ret += test_xmlUCSIsGurmukhi();
42515    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42516    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42517    test_ret += test_xmlUCSIsHangulJamo();
42518    test_ret += test_xmlUCSIsHangulSyllables();
42519    test_ret += test_xmlUCSIsHanunoo();
42520    test_ret += test_xmlUCSIsHebrew();
42521    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42522    test_ret += test_xmlUCSIsHighSurrogates();
42523    test_ret += test_xmlUCSIsHiragana();
42524    test_ret += test_xmlUCSIsIPAExtensions();
42525    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42526    test_ret += test_xmlUCSIsKanbun();
42527    test_ret += test_xmlUCSIsKangxiRadicals();
42528    test_ret += test_xmlUCSIsKannada();
42529    test_ret += test_xmlUCSIsKatakana();
42530    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42531    test_ret += test_xmlUCSIsKhmer();
42532    test_ret += test_xmlUCSIsKhmerSymbols();
42533    test_ret += test_xmlUCSIsLao();
42534    test_ret += test_xmlUCSIsLatin1Supplement();
42535    test_ret += test_xmlUCSIsLatinExtendedA();
42536    test_ret += test_xmlUCSIsLatinExtendedAdditional();
42537    test_ret += test_xmlUCSIsLatinExtendedB();
42538    test_ret += test_xmlUCSIsLetterlikeSymbols();
42539    test_ret += test_xmlUCSIsLimbu();
42540    test_ret += test_xmlUCSIsLinearBIdeograms();
42541    test_ret += test_xmlUCSIsLinearBSyllabary();
42542    test_ret += test_xmlUCSIsLowSurrogates();
42543    test_ret += test_xmlUCSIsMalayalam();
42544    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42545    test_ret += test_xmlUCSIsMathematicalOperators();
42546    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42547    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42548    test_ret += test_xmlUCSIsMiscellaneousSymbols();
42549    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42550    test_ret += test_xmlUCSIsMiscellaneousTechnical();
42551    test_ret += test_xmlUCSIsMongolian();
42552    test_ret += test_xmlUCSIsMusicalSymbols();
42553    test_ret += test_xmlUCSIsMyanmar();
42554    test_ret += test_xmlUCSIsNumberForms();
42555    test_ret += test_xmlUCSIsOgham();
42556    test_ret += test_xmlUCSIsOldItalic();
42557    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42558    test_ret += test_xmlUCSIsOriya();
42559    test_ret += test_xmlUCSIsOsmanya();
42560    test_ret += test_xmlUCSIsPhoneticExtensions();
42561    test_ret += test_xmlUCSIsPrivateUse();
42562    test_ret += test_xmlUCSIsPrivateUseArea();
42563    test_ret += test_xmlUCSIsRunic();
42564    test_ret += test_xmlUCSIsShavian();
42565    test_ret += test_xmlUCSIsSinhala();
42566    test_ret += test_xmlUCSIsSmallFormVariants();
42567    test_ret += test_xmlUCSIsSpacingModifierLetters();
42568    test_ret += test_xmlUCSIsSpecials();
42569    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42570    test_ret += test_xmlUCSIsSupplementalArrowsA();
42571    test_ret += test_xmlUCSIsSupplementalArrowsB();
42572    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42573    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42574    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42575    test_ret += test_xmlUCSIsSyriac();
42576    test_ret += test_xmlUCSIsTagalog();
42577    test_ret += test_xmlUCSIsTagbanwa();
42578    test_ret += test_xmlUCSIsTags();
42579    test_ret += test_xmlUCSIsTaiLe();
42580    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42581    test_ret += test_xmlUCSIsTamil();
42582    test_ret += test_xmlUCSIsTelugu();
42583    test_ret += test_xmlUCSIsThaana();
42584    test_ret += test_xmlUCSIsThai();
42585    test_ret += test_xmlUCSIsTibetan();
42586    test_ret += test_xmlUCSIsUgaritic();
42587    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42588    test_ret += test_xmlUCSIsVariationSelectors();
42589    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42590    test_ret += test_xmlUCSIsYiRadicals();
42591    test_ret += test_xmlUCSIsYiSyllables();
42592    test_ret += test_xmlUCSIsYijingHexagramSymbols();
42593
42594    if (test_ret != 0)
42595	printf("Module xmlunicode: %d errors\n", test_ret);
42596    return(test_ret);
42597}
42598
42599static int
42600test_xmlNewTextWriter(void) {
42601    int test_ret = 0;
42602
42603#if defined(LIBXML_WRITER_ENABLED)
42604    int mem_base;
42605    xmlTextWriterPtr ret_val;
42606    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42607    int n_out;
42608
42609    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42610        mem_base = xmlMemBlocks();
42611        out = gen_xmlOutputBufferPtr(n_out, 0);
42612
42613        ret_val = xmlNewTextWriter(out);
42614        if (ret_val != NULL) out = NULL;
42615        desret_xmlTextWriterPtr(ret_val);
42616        call_tests++;
42617        des_xmlOutputBufferPtr(n_out, out, 0);
42618        xmlResetLastError();
42619        if (mem_base != xmlMemBlocks()) {
42620            printf("Leak of %d blocks found in xmlNewTextWriter",
42621	           xmlMemBlocks() - mem_base);
42622	    test_ret++;
42623            printf(" %d", n_out);
42624            printf("\n");
42625        }
42626    }
42627    function_tests++;
42628#endif
42629
42630    return(test_ret);
42631}
42632
42633
42634static int
42635test_xmlNewTextWriterFilename(void) {
42636    int test_ret = 0;
42637
42638#if defined(LIBXML_WRITER_ENABLED)
42639    int mem_base;
42640    xmlTextWriterPtr ret_val;
42641    const char * uri; /* the URI of the resource for the output */
42642    int n_uri;
42643    int compression; /* compress the output? */
42644    int n_compression;
42645
42646    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42647    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42648        mem_base = xmlMemBlocks();
42649        uri = gen_fileoutput(n_uri, 0);
42650        compression = gen_int(n_compression, 1);
42651
42652        ret_val = xmlNewTextWriterFilename(uri, compression);
42653        desret_xmlTextWriterPtr(ret_val);
42654        call_tests++;
42655        des_fileoutput(n_uri, uri, 0);
42656        des_int(n_compression, compression, 1);
42657        xmlResetLastError();
42658        if (mem_base != xmlMemBlocks()) {
42659            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42660	           xmlMemBlocks() - mem_base);
42661	    test_ret++;
42662            printf(" %d", n_uri);
42663            printf(" %d", n_compression);
42664            printf("\n");
42665        }
42666    }
42667    }
42668    function_tests++;
42669#endif
42670
42671    return(test_ret);
42672}
42673
42674
42675static int
42676test_xmlNewTextWriterMemory(void) {
42677    int test_ret = 0;
42678
42679#if defined(LIBXML_WRITER_ENABLED)
42680    int mem_base;
42681    xmlTextWriterPtr ret_val;
42682    xmlBufferPtr buf; /* xmlBufferPtr */
42683    int n_buf;
42684    int compression; /* compress the output? */
42685    int n_compression;
42686
42687    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42688    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42689        mem_base = xmlMemBlocks();
42690        buf = gen_xmlBufferPtr(n_buf, 0);
42691        compression = gen_int(n_compression, 1);
42692
42693        ret_val = xmlNewTextWriterMemory(buf, compression);
42694        desret_xmlTextWriterPtr(ret_val);
42695        call_tests++;
42696        des_xmlBufferPtr(n_buf, buf, 0);
42697        des_int(n_compression, compression, 1);
42698        xmlResetLastError();
42699        if (mem_base != xmlMemBlocks()) {
42700            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42701	           xmlMemBlocks() - mem_base);
42702	    test_ret++;
42703            printf(" %d", n_buf);
42704            printf(" %d", n_compression);
42705            printf("\n");
42706        }
42707    }
42708    }
42709    function_tests++;
42710#endif
42711
42712    return(test_ret);
42713}
42714
42715
42716static int
42717test_xmlNewTextWriterPushParser(void) {
42718    int test_ret = 0;
42719
42720#if defined(LIBXML_WRITER_ENABLED)
42721    int mem_base;
42722    xmlTextWriterPtr ret_val;
42723    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42724    int n_ctxt;
42725    int compression; /* compress the output? */
42726    int n_compression;
42727
42728    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42729    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42730        mem_base = xmlMemBlocks();
42731        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42732        compression = gen_int(n_compression, 1);
42733
42734        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42735        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42736        desret_xmlTextWriterPtr(ret_val);
42737        call_tests++;
42738        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42739        des_int(n_compression, compression, 1);
42740        xmlResetLastError();
42741        if (mem_base != xmlMemBlocks()) {
42742            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42743	           xmlMemBlocks() - mem_base);
42744	    test_ret++;
42745            printf(" %d", n_ctxt);
42746            printf(" %d", n_compression);
42747            printf("\n");
42748        }
42749    }
42750    }
42751    function_tests++;
42752#endif
42753
42754    return(test_ret);
42755}
42756
42757
42758static int
42759test_xmlNewTextWriterTree(void) {
42760    int test_ret = 0;
42761
42762#if defined(LIBXML_WRITER_ENABLED)
42763    int mem_base;
42764    xmlTextWriterPtr ret_val;
42765    xmlDocPtr doc; /* xmlDocPtr */
42766    int n_doc;
42767    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42768    int n_node;
42769    int compression; /* compress the output? */
42770    int n_compression;
42771
42772    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42773    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42774    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42775        mem_base = xmlMemBlocks();
42776        doc = gen_xmlDocPtr(n_doc, 0);
42777        node = gen_xmlNodePtr(n_node, 1);
42778        compression = gen_int(n_compression, 2);
42779
42780        ret_val = xmlNewTextWriterTree(doc, node, compression);
42781        desret_xmlTextWriterPtr(ret_val);
42782        call_tests++;
42783        des_xmlDocPtr(n_doc, doc, 0);
42784        des_xmlNodePtr(n_node, node, 1);
42785        des_int(n_compression, compression, 2);
42786        xmlResetLastError();
42787        if (mem_base != xmlMemBlocks()) {
42788            printf("Leak of %d blocks found in xmlNewTextWriterTree",
42789	           xmlMemBlocks() - mem_base);
42790	    test_ret++;
42791            printf(" %d", n_doc);
42792            printf(" %d", n_node);
42793            printf(" %d", n_compression);
42794            printf("\n");
42795        }
42796    }
42797    }
42798    }
42799    function_tests++;
42800#endif
42801
42802    return(test_ret);
42803}
42804
42805
42806static int
42807test_xmlTextWriterEndAttribute(void) {
42808    int test_ret = 0;
42809
42810#if defined(LIBXML_WRITER_ENABLED)
42811    int mem_base;
42812    int ret_val;
42813    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42814    int n_writer;
42815
42816    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42817        mem_base = xmlMemBlocks();
42818        writer = gen_xmlTextWriterPtr(n_writer, 0);
42819
42820        ret_val = xmlTextWriterEndAttribute(writer);
42821        desret_int(ret_val);
42822        call_tests++;
42823        des_xmlTextWriterPtr(n_writer, writer, 0);
42824        xmlResetLastError();
42825        if (mem_base != xmlMemBlocks()) {
42826            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42827	           xmlMemBlocks() - mem_base);
42828	    test_ret++;
42829            printf(" %d", n_writer);
42830            printf("\n");
42831        }
42832    }
42833    function_tests++;
42834#endif
42835
42836    return(test_ret);
42837}
42838
42839
42840static int
42841test_xmlTextWriterEndCDATA(void) {
42842    int test_ret = 0;
42843
42844#if defined(LIBXML_WRITER_ENABLED)
42845    int mem_base;
42846    int ret_val;
42847    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42848    int n_writer;
42849
42850    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42851        mem_base = xmlMemBlocks();
42852        writer = gen_xmlTextWriterPtr(n_writer, 0);
42853
42854        ret_val = xmlTextWriterEndCDATA(writer);
42855        desret_int(ret_val);
42856        call_tests++;
42857        des_xmlTextWriterPtr(n_writer, writer, 0);
42858        xmlResetLastError();
42859        if (mem_base != xmlMemBlocks()) {
42860            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
42861	           xmlMemBlocks() - mem_base);
42862	    test_ret++;
42863            printf(" %d", n_writer);
42864            printf("\n");
42865        }
42866    }
42867    function_tests++;
42868#endif
42869
42870    return(test_ret);
42871}
42872
42873
42874static int
42875test_xmlTextWriterEndComment(void) {
42876    int test_ret = 0;
42877
42878#if defined(LIBXML_WRITER_ENABLED)
42879    int mem_base;
42880    int ret_val;
42881    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42882    int n_writer;
42883
42884    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42885        mem_base = xmlMemBlocks();
42886        writer = gen_xmlTextWriterPtr(n_writer, 0);
42887
42888        ret_val = xmlTextWriterEndComment(writer);
42889        desret_int(ret_val);
42890        call_tests++;
42891        des_xmlTextWriterPtr(n_writer, writer, 0);
42892        xmlResetLastError();
42893        if (mem_base != xmlMemBlocks()) {
42894            printf("Leak of %d blocks found in xmlTextWriterEndComment",
42895	           xmlMemBlocks() - mem_base);
42896	    test_ret++;
42897            printf(" %d", n_writer);
42898            printf("\n");
42899        }
42900    }
42901    function_tests++;
42902#endif
42903
42904    return(test_ret);
42905}
42906
42907
42908static int
42909test_xmlTextWriterEndDTD(void) {
42910    int test_ret = 0;
42911
42912#if defined(LIBXML_WRITER_ENABLED)
42913    int mem_base;
42914    int ret_val;
42915    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42916    int n_writer;
42917
42918    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42919        mem_base = xmlMemBlocks();
42920        writer = gen_xmlTextWriterPtr(n_writer, 0);
42921
42922        ret_val = xmlTextWriterEndDTD(writer);
42923        desret_int(ret_val);
42924        call_tests++;
42925        des_xmlTextWriterPtr(n_writer, writer, 0);
42926        xmlResetLastError();
42927        if (mem_base != xmlMemBlocks()) {
42928            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
42929	           xmlMemBlocks() - mem_base);
42930	    test_ret++;
42931            printf(" %d", n_writer);
42932            printf("\n");
42933        }
42934    }
42935    function_tests++;
42936#endif
42937
42938    return(test_ret);
42939}
42940
42941
42942static int
42943test_xmlTextWriterEndDTDAttlist(void) {
42944    int test_ret = 0;
42945
42946#if defined(LIBXML_WRITER_ENABLED)
42947    int mem_base;
42948    int ret_val;
42949    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42950    int n_writer;
42951
42952    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42953        mem_base = xmlMemBlocks();
42954        writer = gen_xmlTextWriterPtr(n_writer, 0);
42955
42956        ret_val = xmlTextWriterEndDTDAttlist(writer);
42957        desret_int(ret_val);
42958        call_tests++;
42959        des_xmlTextWriterPtr(n_writer, writer, 0);
42960        xmlResetLastError();
42961        if (mem_base != xmlMemBlocks()) {
42962            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
42963	           xmlMemBlocks() - mem_base);
42964	    test_ret++;
42965            printf(" %d", n_writer);
42966            printf("\n");
42967        }
42968    }
42969    function_tests++;
42970#endif
42971
42972    return(test_ret);
42973}
42974
42975
42976static int
42977test_xmlTextWriterEndDTDElement(void) {
42978    int test_ret = 0;
42979
42980#if defined(LIBXML_WRITER_ENABLED)
42981    int mem_base;
42982    int ret_val;
42983    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42984    int n_writer;
42985
42986    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42987        mem_base = xmlMemBlocks();
42988        writer = gen_xmlTextWriterPtr(n_writer, 0);
42989
42990        ret_val = xmlTextWriterEndDTDElement(writer);
42991        desret_int(ret_val);
42992        call_tests++;
42993        des_xmlTextWriterPtr(n_writer, writer, 0);
42994        xmlResetLastError();
42995        if (mem_base != xmlMemBlocks()) {
42996            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
42997	           xmlMemBlocks() - mem_base);
42998	    test_ret++;
42999            printf(" %d", n_writer);
43000            printf("\n");
43001        }
43002    }
43003    function_tests++;
43004#endif
43005
43006    return(test_ret);
43007}
43008
43009
43010static int
43011test_xmlTextWriterEndDTDEntity(void) {
43012    int test_ret = 0;
43013
43014#if defined(LIBXML_WRITER_ENABLED)
43015    int mem_base;
43016    int ret_val;
43017    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43018    int n_writer;
43019
43020    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43021        mem_base = xmlMemBlocks();
43022        writer = gen_xmlTextWriterPtr(n_writer, 0);
43023
43024        ret_val = xmlTextWriterEndDTDEntity(writer);
43025        desret_int(ret_val);
43026        call_tests++;
43027        des_xmlTextWriterPtr(n_writer, writer, 0);
43028        xmlResetLastError();
43029        if (mem_base != xmlMemBlocks()) {
43030            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43031	           xmlMemBlocks() - mem_base);
43032	    test_ret++;
43033            printf(" %d", n_writer);
43034            printf("\n");
43035        }
43036    }
43037    function_tests++;
43038#endif
43039
43040    return(test_ret);
43041}
43042
43043
43044static int
43045test_xmlTextWriterEndDocument(void) {
43046    int test_ret = 0;
43047
43048#if defined(LIBXML_WRITER_ENABLED)
43049    int mem_base;
43050    int ret_val;
43051    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43052    int n_writer;
43053
43054    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43055        mem_base = xmlMemBlocks();
43056        writer = gen_xmlTextWriterPtr(n_writer, 0);
43057
43058        ret_val = xmlTextWriterEndDocument(writer);
43059        desret_int(ret_val);
43060        call_tests++;
43061        des_xmlTextWriterPtr(n_writer, writer, 0);
43062        xmlResetLastError();
43063        if (mem_base != xmlMemBlocks()) {
43064            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43065	           xmlMemBlocks() - mem_base);
43066	    test_ret++;
43067            printf(" %d", n_writer);
43068            printf("\n");
43069        }
43070    }
43071    function_tests++;
43072#endif
43073
43074    return(test_ret);
43075}
43076
43077
43078static int
43079test_xmlTextWriterEndElement(void) {
43080    int test_ret = 0;
43081
43082#if defined(LIBXML_WRITER_ENABLED)
43083    int mem_base;
43084    int ret_val;
43085    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43086    int n_writer;
43087
43088    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43089        mem_base = xmlMemBlocks();
43090        writer = gen_xmlTextWriterPtr(n_writer, 0);
43091
43092        ret_val = xmlTextWriterEndElement(writer);
43093        desret_int(ret_val);
43094        call_tests++;
43095        des_xmlTextWriterPtr(n_writer, writer, 0);
43096        xmlResetLastError();
43097        if (mem_base != xmlMemBlocks()) {
43098            printf("Leak of %d blocks found in xmlTextWriterEndElement",
43099	           xmlMemBlocks() - mem_base);
43100	    test_ret++;
43101            printf(" %d", n_writer);
43102            printf("\n");
43103        }
43104    }
43105    function_tests++;
43106#endif
43107
43108    return(test_ret);
43109}
43110
43111
43112static int
43113test_xmlTextWriterEndPI(void) {
43114    int test_ret = 0;
43115
43116#if defined(LIBXML_WRITER_ENABLED)
43117    int mem_base;
43118    int ret_val;
43119    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43120    int n_writer;
43121
43122    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43123        mem_base = xmlMemBlocks();
43124        writer = gen_xmlTextWriterPtr(n_writer, 0);
43125
43126        ret_val = xmlTextWriterEndPI(writer);
43127        desret_int(ret_val);
43128        call_tests++;
43129        des_xmlTextWriterPtr(n_writer, writer, 0);
43130        xmlResetLastError();
43131        if (mem_base != xmlMemBlocks()) {
43132            printf("Leak of %d blocks found in xmlTextWriterEndPI",
43133	           xmlMemBlocks() - mem_base);
43134	    test_ret++;
43135            printf(" %d", n_writer);
43136            printf("\n");
43137        }
43138    }
43139    function_tests++;
43140#endif
43141
43142    return(test_ret);
43143}
43144
43145
43146static int
43147test_xmlTextWriterFlush(void) {
43148    int test_ret = 0;
43149
43150#if defined(LIBXML_WRITER_ENABLED)
43151    int mem_base;
43152    int ret_val;
43153    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43154    int n_writer;
43155
43156    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43157        mem_base = xmlMemBlocks();
43158        writer = gen_xmlTextWriterPtr(n_writer, 0);
43159
43160        ret_val = xmlTextWriterFlush(writer);
43161        desret_int(ret_val);
43162        call_tests++;
43163        des_xmlTextWriterPtr(n_writer, writer, 0);
43164        xmlResetLastError();
43165        if (mem_base != xmlMemBlocks()) {
43166            printf("Leak of %d blocks found in xmlTextWriterFlush",
43167	           xmlMemBlocks() - mem_base);
43168	    test_ret++;
43169            printf(" %d", n_writer);
43170            printf("\n");
43171        }
43172    }
43173    function_tests++;
43174#endif
43175
43176    return(test_ret);
43177}
43178
43179
43180static int
43181test_xmlTextWriterFullEndElement(void) {
43182    int test_ret = 0;
43183
43184#if defined(LIBXML_WRITER_ENABLED)
43185    int mem_base;
43186    int ret_val;
43187    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43188    int n_writer;
43189
43190    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43191        mem_base = xmlMemBlocks();
43192        writer = gen_xmlTextWriterPtr(n_writer, 0);
43193
43194        ret_val = xmlTextWriterFullEndElement(writer);
43195        desret_int(ret_val);
43196        call_tests++;
43197        des_xmlTextWriterPtr(n_writer, writer, 0);
43198        xmlResetLastError();
43199        if (mem_base != xmlMemBlocks()) {
43200            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43201	           xmlMemBlocks() - mem_base);
43202	    test_ret++;
43203            printf(" %d", n_writer);
43204            printf("\n");
43205        }
43206    }
43207    function_tests++;
43208#endif
43209
43210    return(test_ret);
43211}
43212
43213
43214static int
43215test_xmlTextWriterSetIndent(void) {
43216    int test_ret = 0;
43217
43218#if defined(LIBXML_WRITER_ENABLED)
43219    int mem_base;
43220    int ret_val;
43221    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43222    int n_writer;
43223    int indent; /* do indentation? */
43224    int n_indent;
43225
43226    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43227    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43228        mem_base = xmlMemBlocks();
43229        writer = gen_xmlTextWriterPtr(n_writer, 0);
43230        indent = gen_int(n_indent, 1);
43231
43232        ret_val = xmlTextWriterSetIndent(writer, indent);
43233        desret_int(ret_val);
43234        call_tests++;
43235        des_xmlTextWriterPtr(n_writer, writer, 0);
43236        des_int(n_indent, indent, 1);
43237        xmlResetLastError();
43238        if (mem_base != xmlMemBlocks()) {
43239            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43240	           xmlMemBlocks() - mem_base);
43241	    test_ret++;
43242            printf(" %d", n_writer);
43243            printf(" %d", n_indent);
43244            printf("\n");
43245        }
43246    }
43247    }
43248    function_tests++;
43249#endif
43250
43251    return(test_ret);
43252}
43253
43254
43255static int
43256test_xmlTextWriterSetIndentString(void) {
43257    int test_ret = 0;
43258
43259#if defined(LIBXML_WRITER_ENABLED)
43260    int mem_base;
43261    int ret_val;
43262    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43263    int n_writer;
43264    xmlChar * str; /* the xmlChar string */
43265    int n_str;
43266
43267    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43268    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43269        mem_base = xmlMemBlocks();
43270        writer = gen_xmlTextWriterPtr(n_writer, 0);
43271        str = gen_const_xmlChar_ptr(n_str, 1);
43272
43273        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43274        desret_int(ret_val);
43275        call_tests++;
43276        des_xmlTextWriterPtr(n_writer, writer, 0);
43277        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43278        xmlResetLastError();
43279        if (mem_base != xmlMemBlocks()) {
43280            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43281	           xmlMemBlocks() - mem_base);
43282	    test_ret++;
43283            printf(" %d", n_writer);
43284            printf(" %d", n_str);
43285            printf("\n");
43286        }
43287    }
43288    }
43289    function_tests++;
43290#endif
43291
43292    return(test_ret);
43293}
43294
43295
43296static int
43297test_xmlTextWriterStartAttribute(void) {
43298    int test_ret = 0;
43299
43300#if defined(LIBXML_WRITER_ENABLED)
43301    int mem_base;
43302    int ret_val;
43303    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43304    int n_writer;
43305    xmlChar * name; /* element name */
43306    int n_name;
43307
43308    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43309    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43310        mem_base = xmlMemBlocks();
43311        writer = gen_xmlTextWriterPtr(n_writer, 0);
43312        name = gen_const_xmlChar_ptr(n_name, 1);
43313
43314        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43315        desret_int(ret_val);
43316        call_tests++;
43317        des_xmlTextWriterPtr(n_writer, writer, 0);
43318        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43319        xmlResetLastError();
43320        if (mem_base != xmlMemBlocks()) {
43321            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43322	           xmlMemBlocks() - mem_base);
43323	    test_ret++;
43324            printf(" %d", n_writer);
43325            printf(" %d", n_name);
43326            printf("\n");
43327        }
43328    }
43329    }
43330    function_tests++;
43331#endif
43332
43333    return(test_ret);
43334}
43335
43336
43337static int
43338test_xmlTextWriterStartAttributeNS(void) {
43339    int test_ret = 0;
43340
43341#if defined(LIBXML_WRITER_ENABLED)
43342    int mem_base;
43343    int ret_val;
43344    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43345    int n_writer;
43346    xmlChar * prefix; /* namespace prefix or NULL */
43347    int n_prefix;
43348    xmlChar * name; /* element local name */
43349    int n_name;
43350    xmlChar * namespaceURI; /* namespace URI or NULL */
43351    int n_namespaceURI;
43352
43353    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43354    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43355    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43356    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43357        mem_base = xmlMemBlocks();
43358        writer = gen_xmlTextWriterPtr(n_writer, 0);
43359        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43360        name = gen_const_xmlChar_ptr(n_name, 2);
43361        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43362
43363        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43364        desret_int(ret_val);
43365        call_tests++;
43366        des_xmlTextWriterPtr(n_writer, writer, 0);
43367        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43368        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43369        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43370        xmlResetLastError();
43371        if (mem_base != xmlMemBlocks()) {
43372            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43373	           xmlMemBlocks() - mem_base);
43374	    test_ret++;
43375            printf(" %d", n_writer);
43376            printf(" %d", n_prefix);
43377            printf(" %d", n_name);
43378            printf(" %d", n_namespaceURI);
43379            printf("\n");
43380        }
43381    }
43382    }
43383    }
43384    }
43385    function_tests++;
43386#endif
43387
43388    return(test_ret);
43389}
43390
43391
43392static int
43393test_xmlTextWriterStartCDATA(void) {
43394    int test_ret = 0;
43395
43396#if defined(LIBXML_WRITER_ENABLED)
43397    int mem_base;
43398    int ret_val;
43399    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43400    int n_writer;
43401
43402    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43403        mem_base = xmlMemBlocks();
43404        writer = gen_xmlTextWriterPtr(n_writer, 0);
43405
43406        ret_val = xmlTextWriterStartCDATA(writer);
43407        desret_int(ret_val);
43408        call_tests++;
43409        des_xmlTextWriterPtr(n_writer, writer, 0);
43410        xmlResetLastError();
43411        if (mem_base != xmlMemBlocks()) {
43412            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43413	           xmlMemBlocks() - mem_base);
43414	    test_ret++;
43415            printf(" %d", n_writer);
43416            printf("\n");
43417        }
43418    }
43419    function_tests++;
43420#endif
43421
43422    return(test_ret);
43423}
43424
43425
43426static int
43427test_xmlTextWriterStartComment(void) {
43428    int test_ret = 0;
43429
43430#if defined(LIBXML_WRITER_ENABLED)
43431    int mem_base;
43432    int ret_val;
43433    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43434    int n_writer;
43435
43436    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43437        mem_base = xmlMemBlocks();
43438        writer = gen_xmlTextWriterPtr(n_writer, 0);
43439
43440        ret_val = xmlTextWriterStartComment(writer);
43441        desret_int(ret_val);
43442        call_tests++;
43443        des_xmlTextWriterPtr(n_writer, writer, 0);
43444        xmlResetLastError();
43445        if (mem_base != xmlMemBlocks()) {
43446            printf("Leak of %d blocks found in xmlTextWriterStartComment",
43447	           xmlMemBlocks() - mem_base);
43448	    test_ret++;
43449            printf(" %d", n_writer);
43450            printf("\n");
43451        }
43452    }
43453    function_tests++;
43454#endif
43455
43456    return(test_ret);
43457}
43458
43459
43460static int
43461test_xmlTextWriterStartDTD(void) {
43462    int test_ret = 0;
43463
43464#if defined(LIBXML_WRITER_ENABLED)
43465    int mem_base;
43466    int ret_val;
43467    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43468    int n_writer;
43469    xmlChar * name; /* the name of the DTD */
43470    int n_name;
43471    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43472    int n_pubid;
43473    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43474    int n_sysid;
43475
43476    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43477    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43478    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43479    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43480        mem_base = xmlMemBlocks();
43481        writer = gen_xmlTextWriterPtr(n_writer, 0);
43482        name = gen_const_xmlChar_ptr(n_name, 1);
43483        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43484        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43485
43486        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43487        desret_int(ret_val);
43488        call_tests++;
43489        des_xmlTextWriterPtr(n_writer, writer, 0);
43490        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43491        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43492        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43493        xmlResetLastError();
43494        if (mem_base != xmlMemBlocks()) {
43495            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43496	           xmlMemBlocks() - mem_base);
43497	    test_ret++;
43498            printf(" %d", n_writer);
43499            printf(" %d", n_name);
43500            printf(" %d", n_pubid);
43501            printf(" %d", n_sysid);
43502            printf("\n");
43503        }
43504    }
43505    }
43506    }
43507    }
43508    function_tests++;
43509#endif
43510
43511    return(test_ret);
43512}
43513
43514
43515static int
43516test_xmlTextWriterStartDTDAttlist(void) {
43517    int test_ret = 0;
43518
43519#if defined(LIBXML_WRITER_ENABLED)
43520    int mem_base;
43521    int ret_val;
43522    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43523    int n_writer;
43524    xmlChar * name; /* the name of the DTD ATTLIST */
43525    int n_name;
43526
43527    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43528    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43529        mem_base = xmlMemBlocks();
43530        writer = gen_xmlTextWriterPtr(n_writer, 0);
43531        name = gen_const_xmlChar_ptr(n_name, 1);
43532
43533        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43534        desret_int(ret_val);
43535        call_tests++;
43536        des_xmlTextWriterPtr(n_writer, writer, 0);
43537        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43538        xmlResetLastError();
43539        if (mem_base != xmlMemBlocks()) {
43540            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43541	           xmlMemBlocks() - mem_base);
43542	    test_ret++;
43543            printf(" %d", n_writer);
43544            printf(" %d", n_name);
43545            printf("\n");
43546        }
43547    }
43548    }
43549    function_tests++;
43550#endif
43551
43552    return(test_ret);
43553}
43554
43555
43556static int
43557test_xmlTextWriterStartDTDElement(void) {
43558    int test_ret = 0;
43559
43560#if defined(LIBXML_WRITER_ENABLED)
43561    int mem_base;
43562    int ret_val;
43563    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43564    int n_writer;
43565    xmlChar * name; /* the name of the DTD element */
43566    int n_name;
43567
43568    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43569    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43570        mem_base = xmlMemBlocks();
43571        writer = gen_xmlTextWriterPtr(n_writer, 0);
43572        name = gen_const_xmlChar_ptr(n_name, 1);
43573
43574        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43575        desret_int(ret_val);
43576        call_tests++;
43577        des_xmlTextWriterPtr(n_writer, writer, 0);
43578        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43579        xmlResetLastError();
43580        if (mem_base != xmlMemBlocks()) {
43581            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43582	           xmlMemBlocks() - mem_base);
43583	    test_ret++;
43584            printf(" %d", n_writer);
43585            printf(" %d", n_name);
43586            printf("\n");
43587        }
43588    }
43589    }
43590    function_tests++;
43591#endif
43592
43593    return(test_ret);
43594}
43595
43596
43597static int
43598test_xmlTextWriterStartDTDEntity(void) {
43599    int test_ret = 0;
43600
43601#if defined(LIBXML_WRITER_ENABLED)
43602    int mem_base;
43603    int ret_val;
43604    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43605    int n_writer;
43606    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43607    int n_pe;
43608    xmlChar * name; /* the name of the DTD ATTLIST */
43609    int n_name;
43610
43611    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43612    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43613    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43614        mem_base = xmlMemBlocks();
43615        writer = gen_xmlTextWriterPtr(n_writer, 0);
43616        pe = gen_int(n_pe, 1);
43617        name = gen_const_xmlChar_ptr(n_name, 2);
43618
43619        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43620        desret_int(ret_val);
43621        call_tests++;
43622        des_xmlTextWriterPtr(n_writer, writer, 0);
43623        des_int(n_pe, pe, 1);
43624        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43625        xmlResetLastError();
43626        if (mem_base != xmlMemBlocks()) {
43627            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43628	           xmlMemBlocks() - mem_base);
43629	    test_ret++;
43630            printf(" %d", n_writer);
43631            printf(" %d", n_pe);
43632            printf(" %d", n_name);
43633            printf("\n");
43634        }
43635    }
43636    }
43637    }
43638    function_tests++;
43639#endif
43640
43641    return(test_ret);
43642}
43643
43644
43645static int
43646test_xmlTextWriterStartDocument(void) {
43647    int test_ret = 0;
43648
43649#if defined(LIBXML_WRITER_ENABLED)
43650    int mem_base;
43651    int ret_val;
43652    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43653    int n_writer;
43654    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43655    int n_version;
43656    char * encoding; /* the encoding or NULL for default */
43657    int n_encoding;
43658    char * standalone; /* "yes" or "no" or NULL for default */
43659    int n_standalone;
43660
43661    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43662    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43663    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43664    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43665        mem_base = xmlMemBlocks();
43666        writer = gen_xmlTextWriterPtr(n_writer, 0);
43667        version = gen_const_char_ptr(n_version, 1);
43668        encoding = gen_const_char_ptr(n_encoding, 2);
43669        standalone = gen_const_char_ptr(n_standalone, 3);
43670
43671        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43672        desret_int(ret_val);
43673        call_tests++;
43674        des_xmlTextWriterPtr(n_writer, writer, 0);
43675        des_const_char_ptr(n_version, (const char *)version, 1);
43676        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43677        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43678        xmlResetLastError();
43679        if (mem_base != xmlMemBlocks()) {
43680            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43681	           xmlMemBlocks() - mem_base);
43682	    test_ret++;
43683            printf(" %d", n_writer);
43684            printf(" %d", n_version);
43685            printf(" %d", n_encoding);
43686            printf(" %d", n_standalone);
43687            printf("\n");
43688        }
43689    }
43690    }
43691    }
43692    }
43693    function_tests++;
43694#endif
43695
43696    return(test_ret);
43697}
43698
43699
43700static int
43701test_xmlTextWriterStartElement(void) {
43702    int test_ret = 0;
43703
43704#if defined(LIBXML_WRITER_ENABLED)
43705    int mem_base;
43706    int ret_val;
43707    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43708    int n_writer;
43709    xmlChar * name; /* element name */
43710    int n_name;
43711
43712    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43713    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43714        mem_base = xmlMemBlocks();
43715        writer = gen_xmlTextWriterPtr(n_writer, 0);
43716        name = gen_const_xmlChar_ptr(n_name, 1);
43717
43718        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43719        desret_int(ret_val);
43720        call_tests++;
43721        des_xmlTextWriterPtr(n_writer, writer, 0);
43722        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43723        xmlResetLastError();
43724        if (mem_base != xmlMemBlocks()) {
43725            printf("Leak of %d blocks found in xmlTextWriterStartElement",
43726	           xmlMemBlocks() - mem_base);
43727	    test_ret++;
43728            printf(" %d", n_writer);
43729            printf(" %d", n_name);
43730            printf("\n");
43731        }
43732    }
43733    }
43734    function_tests++;
43735#endif
43736
43737    return(test_ret);
43738}
43739
43740
43741static int
43742test_xmlTextWriterStartElementNS(void) {
43743    int test_ret = 0;
43744
43745#if defined(LIBXML_WRITER_ENABLED)
43746    int mem_base;
43747    int ret_val;
43748    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43749    int n_writer;
43750    xmlChar * prefix; /* namespace prefix or NULL */
43751    int n_prefix;
43752    xmlChar * name; /* element local name */
43753    int n_name;
43754    xmlChar * namespaceURI; /* namespace URI or NULL */
43755    int n_namespaceURI;
43756
43757    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43758    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43759    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43760    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43761        mem_base = xmlMemBlocks();
43762        writer = gen_xmlTextWriterPtr(n_writer, 0);
43763        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43764        name = gen_const_xmlChar_ptr(n_name, 2);
43765        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43766
43767        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43768        desret_int(ret_val);
43769        call_tests++;
43770        des_xmlTextWriterPtr(n_writer, writer, 0);
43771        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43772        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43773        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43774        xmlResetLastError();
43775        if (mem_base != xmlMemBlocks()) {
43776            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43777	           xmlMemBlocks() - mem_base);
43778	    test_ret++;
43779            printf(" %d", n_writer);
43780            printf(" %d", n_prefix);
43781            printf(" %d", n_name);
43782            printf(" %d", n_namespaceURI);
43783            printf("\n");
43784        }
43785    }
43786    }
43787    }
43788    }
43789    function_tests++;
43790#endif
43791
43792    return(test_ret);
43793}
43794
43795
43796static int
43797test_xmlTextWriterStartPI(void) {
43798    int test_ret = 0;
43799
43800#if defined(LIBXML_WRITER_ENABLED)
43801    int mem_base;
43802    int ret_val;
43803    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43804    int n_writer;
43805    xmlChar * target; /* PI target */
43806    int n_target;
43807
43808    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43809    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43810        mem_base = xmlMemBlocks();
43811        writer = gen_xmlTextWriterPtr(n_writer, 0);
43812        target = gen_const_xmlChar_ptr(n_target, 1);
43813
43814        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43815        desret_int(ret_val);
43816        call_tests++;
43817        des_xmlTextWriterPtr(n_writer, writer, 0);
43818        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43819        xmlResetLastError();
43820        if (mem_base != xmlMemBlocks()) {
43821            printf("Leak of %d blocks found in xmlTextWriterStartPI",
43822	           xmlMemBlocks() - mem_base);
43823	    test_ret++;
43824            printf(" %d", n_writer);
43825            printf(" %d", n_target);
43826            printf("\n");
43827        }
43828    }
43829    }
43830    function_tests++;
43831#endif
43832
43833    return(test_ret);
43834}
43835
43836
43837static int
43838test_xmlTextWriterWriteAttribute(void) {
43839    int test_ret = 0;
43840
43841#if defined(LIBXML_WRITER_ENABLED)
43842    int mem_base;
43843    int ret_val;
43844    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43845    int n_writer;
43846    xmlChar * name; /* attribute name */
43847    int n_name;
43848    xmlChar * content; /* attribute content */
43849    int n_content;
43850
43851    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43852    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43853    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43854        mem_base = xmlMemBlocks();
43855        writer = gen_xmlTextWriterPtr(n_writer, 0);
43856        name = gen_const_xmlChar_ptr(n_name, 1);
43857        content = gen_const_xmlChar_ptr(n_content, 2);
43858
43859        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
43860        desret_int(ret_val);
43861        call_tests++;
43862        des_xmlTextWriterPtr(n_writer, writer, 0);
43863        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43864        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43865        xmlResetLastError();
43866        if (mem_base != xmlMemBlocks()) {
43867            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
43868	           xmlMemBlocks() - mem_base);
43869	    test_ret++;
43870            printf(" %d", n_writer);
43871            printf(" %d", n_name);
43872            printf(" %d", n_content);
43873            printf("\n");
43874        }
43875    }
43876    }
43877    }
43878    function_tests++;
43879#endif
43880
43881    return(test_ret);
43882}
43883
43884
43885static int
43886test_xmlTextWriterWriteAttributeNS(void) {
43887    int test_ret = 0;
43888
43889#if defined(LIBXML_WRITER_ENABLED)
43890    int mem_base;
43891    int ret_val;
43892    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43893    int n_writer;
43894    xmlChar * prefix; /* namespace prefix */
43895    int n_prefix;
43896    xmlChar * name; /* attribute local name */
43897    int n_name;
43898    xmlChar * namespaceURI; /* namespace URI */
43899    int n_namespaceURI;
43900    xmlChar * content; /* attribute content */
43901    int n_content;
43902
43903    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43904    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43905    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43906    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43907    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43908        mem_base = xmlMemBlocks();
43909        writer = gen_xmlTextWriterPtr(n_writer, 0);
43910        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43911        name = gen_const_xmlChar_ptr(n_name, 2);
43912        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43913        content = gen_const_xmlChar_ptr(n_content, 4);
43914
43915        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
43916        desret_int(ret_val);
43917        call_tests++;
43918        des_xmlTextWriterPtr(n_writer, writer, 0);
43919        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43920        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43921        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43922        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
43923        xmlResetLastError();
43924        if (mem_base != xmlMemBlocks()) {
43925            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
43926	           xmlMemBlocks() - mem_base);
43927	    test_ret++;
43928            printf(" %d", n_writer);
43929            printf(" %d", n_prefix);
43930            printf(" %d", n_name);
43931            printf(" %d", n_namespaceURI);
43932            printf(" %d", n_content);
43933            printf("\n");
43934        }
43935    }
43936    }
43937    }
43938    }
43939    }
43940    function_tests++;
43941#endif
43942
43943    return(test_ret);
43944}
43945
43946
43947static int
43948test_xmlTextWriterWriteBase64(void) {
43949    int test_ret = 0;
43950
43951#if defined(LIBXML_WRITER_ENABLED)
43952    int mem_base;
43953    int ret_val;
43954    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43955    int n_writer;
43956    char * data; /* binary data */
43957    int n_data;
43958    int start; /* the position within the data of the first byte to encode */
43959    int n_start;
43960    int len; /* the number of bytes to encode */
43961    int n_len;
43962
43963    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43964    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43965    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43966    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43967        mem_base = xmlMemBlocks();
43968        writer = gen_xmlTextWriterPtr(n_writer, 0);
43969        data = gen_const_char_ptr(n_data, 1);
43970        start = gen_int(n_start, 2);
43971        len = gen_int(n_len, 3);
43972
43973        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
43974        desret_int(ret_val);
43975        call_tests++;
43976        des_xmlTextWriterPtr(n_writer, writer, 0);
43977        des_const_char_ptr(n_data, (const char *)data, 1);
43978        des_int(n_start, start, 2);
43979        des_int(n_len, len, 3);
43980        xmlResetLastError();
43981        if (mem_base != xmlMemBlocks()) {
43982            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
43983	           xmlMemBlocks() - mem_base);
43984	    test_ret++;
43985            printf(" %d", n_writer);
43986            printf(" %d", n_data);
43987            printf(" %d", n_start);
43988            printf(" %d", n_len);
43989            printf("\n");
43990        }
43991    }
43992    }
43993    }
43994    }
43995    function_tests++;
43996#endif
43997
43998    return(test_ret);
43999}
44000
44001
44002static int
44003test_xmlTextWriterWriteBinHex(void) {
44004    int test_ret = 0;
44005
44006#if defined(LIBXML_WRITER_ENABLED)
44007    int mem_base;
44008    int ret_val;
44009    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44010    int n_writer;
44011    char * data; /* binary data */
44012    int n_data;
44013    int start; /* the position within the data of the first byte to encode */
44014    int n_start;
44015    int len; /* the number of bytes to encode */
44016    int n_len;
44017
44018    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44019    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44020    for (n_start = 0;n_start < gen_nb_int;n_start++) {
44021    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44022        mem_base = xmlMemBlocks();
44023        writer = gen_xmlTextWriterPtr(n_writer, 0);
44024        data = gen_const_char_ptr(n_data, 1);
44025        start = gen_int(n_start, 2);
44026        len = gen_int(n_len, 3);
44027
44028        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44029        desret_int(ret_val);
44030        call_tests++;
44031        des_xmlTextWriterPtr(n_writer, writer, 0);
44032        des_const_char_ptr(n_data, (const char *)data, 1);
44033        des_int(n_start, start, 2);
44034        des_int(n_len, len, 3);
44035        xmlResetLastError();
44036        if (mem_base != xmlMemBlocks()) {
44037            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44038	           xmlMemBlocks() - mem_base);
44039	    test_ret++;
44040            printf(" %d", n_writer);
44041            printf(" %d", n_data);
44042            printf(" %d", n_start);
44043            printf(" %d", n_len);
44044            printf("\n");
44045        }
44046    }
44047    }
44048    }
44049    }
44050    function_tests++;
44051#endif
44052
44053    return(test_ret);
44054}
44055
44056
44057static int
44058test_xmlTextWriterWriteCDATA(void) {
44059    int test_ret = 0;
44060
44061#if defined(LIBXML_WRITER_ENABLED)
44062    int mem_base;
44063    int ret_val;
44064    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44065    int n_writer;
44066    xmlChar * content; /* CDATA content */
44067    int n_content;
44068
44069    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44070    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44071        mem_base = xmlMemBlocks();
44072        writer = gen_xmlTextWriterPtr(n_writer, 0);
44073        content = gen_const_xmlChar_ptr(n_content, 1);
44074
44075        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44076        desret_int(ret_val);
44077        call_tests++;
44078        des_xmlTextWriterPtr(n_writer, writer, 0);
44079        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44080        xmlResetLastError();
44081        if (mem_base != xmlMemBlocks()) {
44082            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44083	           xmlMemBlocks() - mem_base);
44084	    test_ret++;
44085            printf(" %d", n_writer);
44086            printf(" %d", n_content);
44087            printf("\n");
44088        }
44089    }
44090    }
44091    function_tests++;
44092#endif
44093
44094    return(test_ret);
44095}
44096
44097
44098static int
44099test_xmlTextWriterWriteComment(void) {
44100    int test_ret = 0;
44101
44102#if defined(LIBXML_WRITER_ENABLED)
44103    int mem_base;
44104    int ret_val;
44105    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44106    int n_writer;
44107    xmlChar * content; /* comment string */
44108    int n_content;
44109
44110    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44111    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44112        mem_base = xmlMemBlocks();
44113        writer = gen_xmlTextWriterPtr(n_writer, 0);
44114        content = gen_const_xmlChar_ptr(n_content, 1);
44115
44116        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44117        desret_int(ret_val);
44118        call_tests++;
44119        des_xmlTextWriterPtr(n_writer, writer, 0);
44120        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44121        xmlResetLastError();
44122        if (mem_base != xmlMemBlocks()) {
44123            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44124	           xmlMemBlocks() - mem_base);
44125	    test_ret++;
44126            printf(" %d", n_writer);
44127            printf(" %d", n_content);
44128            printf("\n");
44129        }
44130    }
44131    }
44132    function_tests++;
44133#endif
44134
44135    return(test_ret);
44136}
44137
44138
44139static int
44140test_xmlTextWriterWriteDTD(void) {
44141    int test_ret = 0;
44142
44143#if defined(LIBXML_WRITER_ENABLED)
44144    int mem_base;
44145    int ret_val;
44146    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44147    int n_writer;
44148    xmlChar * name; /* the name of the DTD */
44149    int n_name;
44150    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44151    int n_pubid;
44152    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44153    int n_sysid;
44154    xmlChar * subset; /* string content of the DTD */
44155    int n_subset;
44156
44157    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44158    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44159    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44160    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44161    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44162        mem_base = xmlMemBlocks();
44163        writer = gen_xmlTextWriterPtr(n_writer, 0);
44164        name = gen_const_xmlChar_ptr(n_name, 1);
44165        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44166        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44167        subset = gen_const_xmlChar_ptr(n_subset, 4);
44168
44169        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44170        desret_int(ret_val);
44171        call_tests++;
44172        des_xmlTextWriterPtr(n_writer, writer, 0);
44173        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44174        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44175        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44176        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44177        xmlResetLastError();
44178        if (mem_base != xmlMemBlocks()) {
44179            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44180	           xmlMemBlocks() - mem_base);
44181	    test_ret++;
44182            printf(" %d", n_writer);
44183            printf(" %d", n_name);
44184            printf(" %d", n_pubid);
44185            printf(" %d", n_sysid);
44186            printf(" %d", n_subset);
44187            printf("\n");
44188        }
44189    }
44190    }
44191    }
44192    }
44193    }
44194    function_tests++;
44195#endif
44196
44197    return(test_ret);
44198}
44199
44200
44201static int
44202test_xmlTextWriterWriteDTDAttlist(void) {
44203    int test_ret = 0;
44204
44205#if defined(LIBXML_WRITER_ENABLED)
44206    int mem_base;
44207    int ret_val;
44208    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44209    int n_writer;
44210    xmlChar * name; /* the name of the DTD ATTLIST */
44211    int n_name;
44212    xmlChar * content; /* content of the ATTLIST */
44213    int n_content;
44214
44215    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44216    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44217    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44218        mem_base = xmlMemBlocks();
44219        writer = gen_xmlTextWriterPtr(n_writer, 0);
44220        name = gen_const_xmlChar_ptr(n_name, 1);
44221        content = gen_const_xmlChar_ptr(n_content, 2);
44222
44223        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44224        desret_int(ret_val);
44225        call_tests++;
44226        des_xmlTextWriterPtr(n_writer, writer, 0);
44227        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44228        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44229        xmlResetLastError();
44230        if (mem_base != xmlMemBlocks()) {
44231            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44232	           xmlMemBlocks() - mem_base);
44233	    test_ret++;
44234            printf(" %d", n_writer);
44235            printf(" %d", n_name);
44236            printf(" %d", n_content);
44237            printf("\n");
44238        }
44239    }
44240    }
44241    }
44242    function_tests++;
44243#endif
44244
44245    return(test_ret);
44246}
44247
44248
44249static int
44250test_xmlTextWriterWriteDTDElement(void) {
44251    int test_ret = 0;
44252
44253#if defined(LIBXML_WRITER_ENABLED)
44254    int mem_base;
44255    int ret_val;
44256    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44257    int n_writer;
44258    xmlChar * name; /* the name of the DTD element */
44259    int n_name;
44260    xmlChar * content; /* content of the element */
44261    int n_content;
44262
44263    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44264    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44265    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44266        mem_base = xmlMemBlocks();
44267        writer = gen_xmlTextWriterPtr(n_writer, 0);
44268        name = gen_const_xmlChar_ptr(n_name, 1);
44269        content = gen_const_xmlChar_ptr(n_content, 2);
44270
44271        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44272        desret_int(ret_val);
44273        call_tests++;
44274        des_xmlTextWriterPtr(n_writer, writer, 0);
44275        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44276        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44277        xmlResetLastError();
44278        if (mem_base != xmlMemBlocks()) {
44279            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44280	           xmlMemBlocks() - mem_base);
44281	    test_ret++;
44282            printf(" %d", n_writer);
44283            printf(" %d", n_name);
44284            printf(" %d", n_content);
44285            printf("\n");
44286        }
44287    }
44288    }
44289    }
44290    function_tests++;
44291#endif
44292
44293    return(test_ret);
44294}
44295
44296
44297static int
44298test_xmlTextWriterWriteDTDEntity(void) {
44299    int test_ret = 0;
44300
44301#if defined(LIBXML_WRITER_ENABLED)
44302    int mem_base;
44303    int ret_val;
44304    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44305    int n_writer;
44306    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44307    int n_pe;
44308    xmlChar * name; /* the name of the DTD entity */
44309    int n_name;
44310    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44311    int n_pubid;
44312    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44313    int n_sysid;
44314    xmlChar * ndataid; /* the xml notation name. */
44315    int n_ndataid;
44316    xmlChar * content; /* content of the entity */
44317    int n_content;
44318
44319    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44320    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44321    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44322    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44323    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44324    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44325    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44326        mem_base = xmlMemBlocks();
44327        writer = gen_xmlTextWriterPtr(n_writer, 0);
44328        pe = gen_int(n_pe, 1);
44329        name = gen_const_xmlChar_ptr(n_name, 2);
44330        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44331        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44332        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44333        content = gen_const_xmlChar_ptr(n_content, 6);
44334
44335        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44336        desret_int(ret_val);
44337        call_tests++;
44338        des_xmlTextWriterPtr(n_writer, writer, 0);
44339        des_int(n_pe, pe, 1);
44340        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44341        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44342        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44343        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44344        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44345        xmlResetLastError();
44346        if (mem_base != xmlMemBlocks()) {
44347            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44348	           xmlMemBlocks() - mem_base);
44349	    test_ret++;
44350            printf(" %d", n_writer);
44351            printf(" %d", n_pe);
44352            printf(" %d", n_name);
44353            printf(" %d", n_pubid);
44354            printf(" %d", n_sysid);
44355            printf(" %d", n_ndataid);
44356            printf(" %d", n_content);
44357            printf("\n");
44358        }
44359    }
44360    }
44361    }
44362    }
44363    }
44364    }
44365    }
44366    function_tests++;
44367#endif
44368
44369    return(test_ret);
44370}
44371
44372
44373static int
44374test_xmlTextWriterWriteDTDExternalEntity(void) {
44375    int test_ret = 0;
44376
44377#if defined(LIBXML_WRITER_ENABLED)
44378    int mem_base;
44379    int ret_val;
44380    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44381    int n_writer;
44382    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44383    int n_pe;
44384    xmlChar * name; /* the name of the DTD entity */
44385    int n_name;
44386    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44387    int n_pubid;
44388    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44389    int n_sysid;
44390    xmlChar * ndataid; /* the xml notation name. */
44391    int n_ndataid;
44392
44393    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44394    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44395    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44396    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44397    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44398    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44399        mem_base = xmlMemBlocks();
44400        writer = gen_xmlTextWriterPtr(n_writer, 0);
44401        pe = gen_int(n_pe, 1);
44402        name = gen_const_xmlChar_ptr(n_name, 2);
44403        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44404        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44405        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44406
44407        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44408        desret_int(ret_val);
44409        call_tests++;
44410        des_xmlTextWriterPtr(n_writer, writer, 0);
44411        des_int(n_pe, pe, 1);
44412        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44413        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44414        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44415        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44416        xmlResetLastError();
44417        if (mem_base != xmlMemBlocks()) {
44418            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44419	           xmlMemBlocks() - mem_base);
44420	    test_ret++;
44421            printf(" %d", n_writer);
44422            printf(" %d", n_pe);
44423            printf(" %d", n_name);
44424            printf(" %d", n_pubid);
44425            printf(" %d", n_sysid);
44426            printf(" %d", n_ndataid);
44427            printf("\n");
44428        }
44429    }
44430    }
44431    }
44432    }
44433    }
44434    }
44435    function_tests++;
44436#endif
44437
44438    return(test_ret);
44439}
44440
44441
44442static int
44443test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44444    int test_ret = 0;
44445
44446#if defined(LIBXML_WRITER_ENABLED)
44447    int mem_base;
44448    int ret_val;
44449    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44450    int n_writer;
44451    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44452    int n_pubid;
44453    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44454    int n_sysid;
44455    xmlChar * ndataid; /* the xml notation name. */
44456    int n_ndataid;
44457
44458    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44459    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44460    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44461    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44462        mem_base = xmlMemBlocks();
44463        writer = gen_xmlTextWriterPtr(n_writer, 0);
44464        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44465        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44466        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44467
44468        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44469        desret_int(ret_val);
44470        call_tests++;
44471        des_xmlTextWriterPtr(n_writer, writer, 0);
44472        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44473        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44474        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44475        xmlResetLastError();
44476        if (mem_base != xmlMemBlocks()) {
44477            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44478	           xmlMemBlocks() - mem_base);
44479	    test_ret++;
44480            printf(" %d", n_writer);
44481            printf(" %d", n_pubid);
44482            printf(" %d", n_sysid);
44483            printf(" %d", n_ndataid);
44484            printf("\n");
44485        }
44486    }
44487    }
44488    }
44489    }
44490    function_tests++;
44491#endif
44492
44493    return(test_ret);
44494}
44495
44496
44497static int
44498test_xmlTextWriterWriteDTDInternalEntity(void) {
44499    int test_ret = 0;
44500
44501#if defined(LIBXML_WRITER_ENABLED)
44502    int mem_base;
44503    int ret_val;
44504    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44505    int n_writer;
44506    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44507    int n_pe;
44508    xmlChar * name; /* the name of the DTD entity */
44509    int n_name;
44510    xmlChar * content; /* content of the entity */
44511    int n_content;
44512
44513    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44514    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44515    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44516    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44517        mem_base = xmlMemBlocks();
44518        writer = gen_xmlTextWriterPtr(n_writer, 0);
44519        pe = gen_int(n_pe, 1);
44520        name = gen_const_xmlChar_ptr(n_name, 2);
44521        content = gen_const_xmlChar_ptr(n_content, 3);
44522
44523        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44524        desret_int(ret_val);
44525        call_tests++;
44526        des_xmlTextWriterPtr(n_writer, writer, 0);
44527        des_int(n_pe, pe, 1);
44528        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44529        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44530        xmlResetLastError();
44531        if (mem_base != xmlMemBlocks()) {
44532            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44533	           xmlMemBlocks() - mem_base);
44534	    test_ret++;
44535            printf(" %d", n_writer);
44536            printf(" %d", n_pe);
44537            printf(" %d", n_name);
44538            printf(" %d", n_content);
44539            printf("\n");
44540        }
44541    }
44542    }
44543    }
44544    }
44545    function_tests++;
44546#endif
44547
44548    return(test_ret);
44549}
44550
44551
44552static int
44553test_xmlTextWriterWriteDTDNotation(void) {
44554    int test_ret = 0;
44555
44556#if defined(LIBXML_WRITER_ENABLED)
44557    int mem_base;
44558    int ret_val;
44559    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44560    int n_writer;
44561    xmlChar * name; /* the name of the xml notation */
44562    int n_name;
44563    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44564    int n_pubid;
44565    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44566    int n_sysid;
44567
44568    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44569    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44570    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44571    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44572        mem_base = xmlMemBlocks();
44573        writer = gen_xmlTextWriterPtr(n_writer, 0);
44574        name = gen_const_xmlChar_ptr(n_name, 1);
44575        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44576        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44577
44578        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44579        desret_int(ret_val);
44580        call_tests++;
44581        des_xmlTextWriterPtr(n_writer, writer, 0);
44582        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44583        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44584        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44585        xmlResetLastError();
44586        if (mem_base != xmlMemBlocks()) {
44587            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44588	           xmlMemBlocks() - mem_base);
44589	    test_ret++;
44590            printf(" %d", n_writer);
44591            printf(" %d", n_name);
44592            printf(" %d", n_pubid);
44593            printf(" %d", n_sysid);
44594            printf("\n");
44595        }
44596    }
44597    }
44598    }
44599    }
44600    function_tests++;
44601#endif
44602
44603    return(test_ret);
44604}
44605
44606
44607static int
44608test_xmlTextWriterWriteElement(void) {
44609    int test_ret = 0;
44610
44611#if defined(LIBXML_WRITER_ENABLED)
44612    int mem_base;
44613    int ret_val;
44614    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44615    int n_writer;
44616    xmlChar * name; /* element name */
44617    int n_name;
44618    xmlChar * content; /* element content */
44619    int n_content;
44620
44621    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44622    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44623    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44624        mem_base = xmlMemBlocks();
44625        writer = gen_xmlTextWriterPtr(n_writer, 0);
44626        name = gen_const_xmlChar_ptr(n_name, 1);
44627        content = gen_const_xmlChar_ptr(n_content, 2);
44628
44629        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44630        desret_int(ret_val);
44631        call_tests++;
44632        des_xmlTextWriterPtr(n_writer, writer, 0);
44633        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44634        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44635        xmlResetLastError();
44636        if (mem_base != xmlMemBlocks()) {
44637            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44638	           xmlMemBlocks() - mem_base);
44639	    test_ret++;
44640            printf(" %d", n_writer);
44641            printf(" %d", n_name);
44642            printf(" %d", n_content);
44643            printf("\n");
44644        }
44645    }
44646    }
44647    }
44648    function_tests++;
44649#endif
44650
44651    return(test_ret);
44652}
44653
44654
44655static int
44656test_xmlTextWriterWriteElementNS(void) {
44657    int test_ret = 0;
44658
44659#if defined(LIBXML_WRITER_ENABLED)
44660    int mem_base;
44661    int ret_val;
44662    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44663    int n_writer;
44664    xmlChar * prefix; /* namespace prefix */
44665    int n_prefix;
44666    xmlChar * name; /* element local name */
44667    int n_name;
44668    xmlChar * namespaceURI; /* namespace URI */
44669    int n_namespaceURI;
44670    xmlChar * content; /* element content */
44671    int n_content;
44672
44673    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44674    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44675    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44676    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44677    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44678        mem_base = xmlMemBlocks();
44679        writer = gen_xmlTextWriterPtr(n_writer, 0);
44680        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44681        name = gen_const_xmlChar_ptr(n_name, 2);
44682        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44683        content = gen_const_xmlChar_ptr(n_content, 4);
44684
44685        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44686        desret_int(ret_val);
44687        call_tests++;
44688        des_xmlTextWriterPtr(n_writer, writer, 0);
44689        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44690        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44691        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44692        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44693        xmlResetLastError();
44694        if (mem_base != xmlMemBlocks()) {
44695            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44696	           xmlMemBlocks() - mem_base);
44697	    test_ret++;
44698            printf(" %d", n_writer);
44699            printf(" %d", n_prefix);
44700            printf(" %d", n_name);
44701            printf(" %d", n_namespaceURI);
44702            printf(" %d", n_content);
44703            printf("\n");
44704        }
44705    }
44706    }
44707    }
44708    }
44709    }
44710    function_tests++;
44711#endif
44712
44713    return(test_ret);
44714}
44715
44716
44717static int
44718test_xmlTextWriterWriteFormatAttribute(void) {
44719    int test_ret = 0;
44720
44721
44722    /* missing type support */
44723    return(test_ret);
44724}
44725
44726
44727static int
44728test_xmlTextWriterWriteFormatAttributeNS(void) {
44729    int test_ret = 0;
44730
44731
44732    /* missing type support */
44733    return(test_ret);
44734}
44735
44736
44737static int
44738test_xmlTextWriterWriteFormatCDATA(void) {
44739    int test_ret = 0;
44740
44741
44742    /* missing type support */
44743    return(test_ret);
44744}
44745
44746
44747static int
44748test_xmlTextWriterWriteFormatComment(void) {
44749    int test_ret = 0;
44750
44751
44752    /* missing type support */
44753    return(test_ret);
44754}
44755
44756
44757static int
44758test_xmlTextWriterWriteFormatDTD(void) {
44759    int test_ret = 0;
44760
44761
44762    /* missing type support */
44763    return(test_ret);
44764}
44765
44766
44767static int
44768test_xmlTextWriterWriteFormatDTDAttlist(void) {
44769    int test_ret = 0;
44770
44771
44772    /* missing type support */
44773    return(test_ret);
44774}
44775
44776
44777static int
44778test_xmlTextWriterWriteFormatDTDElement(void) {
44779    int test_ret = 0;
44780
44781
44782    /* missing type support */
44783    return(test_ret);
44784}
44785
44786
44787static int
44788test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44789    int test_ret = 0;
44790
44791
44792    /* missing type support */
44793    return(test_ret);
44794}
44795
44796
44797static int
44798test_xmlTextWriterWriteFormatElement(void) {
44799    int test_ret = 0;
44800
44801
44802    /* missing type support */
44803    return(test_ret);
44804}
44805
44806
44807static int
44808test_xmlTextWriterWriteFormatElementNS(void) {
44809    int test_ret = 0;
44810
44811
44812    /* missing type support */
44813    return(test_ret);
44814}
44815
44816
44817static int
44818test_xmlTextWriterWriteFormatPI(void) {
44819    int test_ret = 0;
44820
44821
44822    /* missing type support */
44823    return(test_ret);
44824}
44825
44826
44827static int
44828test_xmlTextWriterWriteFormatRaw(void) {
44829    int test_ret = 0;
44830
44831
44832    /* missing type support */
44833    return(test_ret);
44834}
44835
44836
44837static int
44838test_xmlTextWriterWriteFormatString(void) {
44839    int test_ret = 0;
44840
44841
44842    /* missing type support */
44843    return(test_ret);
44844}
44845
44846
44847static int
44848test_xmlTextWriterWritePI(void) {
44849    int test_ret = 0;
44850
44851#if defined(LIBXML_WRITER_ENABLED)
44852    int mem_base;
44853    int ret_val;
44854    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44855    int n_writer;
44856    xmlChar * target; /* PI target */
44857    int n_target;
44858    xmlChar * content; /* PI content */
44859    int n_content;
44860
44861    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44862    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44863    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44864        mem_base = xmlMemBlocks();
44865        writer = gen_xmlTextWriterPtr(n_writer, 0);
44866        target = gen_const_xmlChar_ptr(n_target, 1);
44867        content = gen_const_xmlChar_ptr(n_content, 2);
44868
44869        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
44870        desret_int(ret_val);
44871        call_tests++;
44872        des_xmlTextWriterPtr(n_writer, writer, 0);
44873        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44874        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44875        xmlResetLastError();
44876        if (mem_base != xmlMemBlocks()) {
44877            printf("Leak of %d blocks found in xmlTextWriterWritePI",
44878	           xmlMemBlocks() - mem_base);
44879	    test_ret++;
44880            printf(" %d", n_writer);
44881            printf(" %d", n_target);
44882            printf(" %d", n_content);
44883            printf("\n");
44884        }
44885    }
44886    }
44887    }
44888    function_tests++;
44889#endif
44890
44891    return(test_ret);
44892}
44893
44894
44895static int
44896test_xmlTextWriterWriteRaw(void) {
44897    int test_ret = 0;
44898
44899#if defined(LIBXML_WRITER_ENABLED)
44900    int mem_base;
44901    int ret_val;
44902    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44903    int n_writer;
44904    xmlChar * content; /* text string */
44905    int n_content;
44906
44907    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44908    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44909        mem_base = xmlMemBlocks();
44910        writer = gen_xmlTextWriterPtr(n_writer, 0);
44911        content = gen_const_xmlChar_ptr(n_content, 1);
44912
44913        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
44914        desret_int(ret_val);
44915        call_tests++;
44916        des_xmlTextWriterPtr(n_writer, writer, 0);
44917        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44918        xmlResetLastError();
44919        if (mem_base != xmlMemBlocks()) {
44920            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
44921	           xmlMemBlocks() - mem_base);
44922	    test_ret++;
44923            printf(" %d", n_writer);
44924            printf(" %d", n_content);
44925            printf("\n");
44926        }
44927    }
44928    }
44929    function_tests++;
44930#endif
44931
44932    return(test_ret);
44933}
44934
44935
44936static int
44937test_xmlTextWriterWriteRawLen(void) {
44938    int test_ret = 0;
44939
44940#if defined(LIBXML_WRITER_ENABLED)
44941    int mem_base;
44942    int ret_val;
44943    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44944    int n_writer;
44945    xmlChar * content; /* text string */
44946    int n_content;
44947    int len; /* length of the text string */
44948    int n_len;
44949
44950    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44951    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44952    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44953        mem_base = xmlMemBlocks();
44954        writer = gen_xmlTextWriterPtr(n_writer, 0);
44955        content = gen_const_xmlChar_ptr(n_content, 1);
44956        len = gen_int(n_len, 2);
44957
44958        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
44959        desret_int(ret_val);
44960        call_tests++;
44961        des_xmlTextWriterPtr(n_writer, writer, 0);
44962        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44963        des_int(n_len, len, 2);
44964        xmlResetLastError();
44965        if (mem_base != xmlMemBlocks()) {
44966            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
44967	           xmlMemBlocks() - mem_base);
44968	    test_ret++;
44969            printf(" %d", n_writer);
44970            printf(" %d", n_content);
44971            printf(" %d", n_len);
44972            printf("\n");
44973        }
44974    }
44975    }
44976    }
44977    function_tests++;
44978#endif
44979
44980    return(test_ret);
44981}
44982
44983
44984static int
44985test_xmlTextWriterWriteString(void) {
44986    int test_ret = 0;
44987
44988#if defined(LIBXML_WRITER_ENABLED)
44989    int mem_base;
44990    int ret_val;
44991    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44992    int n_writer;
44993    xmlChar * content; /* text string */
44994    int n_content;
44995
44996    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44997    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44998        mem_base = xmlMemBlocks();
44999        writer = gen_xmlTextWriterPtr(n_writer, 0);
45000        content = gen_const_xmlChar_ptr(n_content, 1);
45001
45002        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45003        desret_int(ret_val);
45004        call_tests++;
45005        des_xmlTextWriterPtr(n_writer, writer, 0);
45006        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45007        xmlResetLastError();
45008        if (mem_base != xmlMemBlocks()) {
45009            printf("Leak of %d blocks found in xmlTextWriterWriteString",
45010	           xmlMemBlocks() - mem_base);
45011	    test_ret++;
45012            printf(" %d", n_writer);
45013            printf(" %d", n_content);
45014            printf("\n");
45015        }
45016    }
45017    }
45018    function_tests++;
45019#endif
45020
45021    return(test_ret);
45022}
45023
45024
45025static int
45026test_xmlTextWriterWriteVFormatAttribute(void) {
45027    int test_ret = 0;
45028
45029
45030    /* missing type support */
45031    return(test_ret);
45032}
45033
45034
45035static int
45036test_xmlTextWriterWriteVFormatAttributeNS(void) {
45037    int test_ret = 0;
45038
45039
45040    /* missing type support */
45041    return(test_ret);
45042}
45043
45044
45045static int
45046test_xmlTextWriterWriteVFormatCDATA(void) {
45047    int test_ret = 0;
45048
45049
45050    /* missing type support */
45051    return(test_ret);
45052}
45053
45054
45055static int
45056test_xmlTextWriterWriteVFormatComment(void) {
45057    int test_ret = 0;
45058
45059
45060    /* missing type support */
45061    return(test_ret);
45062}
45063
45064
45065static int
45066test_xmlTextWriterWriteVFormatDTD(void) {
45067    int test_ret = 0;
45068
45069
45070    /* missing type support */
45071    return(test_ret);
45072}
45073
45074
45075static int
45076test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45077    int test_ret = 0;
45078
45079
45080    /* missing type support */
45081    return(test_ret);
45082}
45083
45084
45085static int
45086test_xmlTextWriterWriteVFormatDTDElement(void) {
45087    int test_ret = 0;
45088
45089
45090    /* missing type support */
45091    return(test_ret);
45092}
45093
45094
45095static int
45096test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45097    int test_ret = 0;
45098
45099
45100    /* missing type support */
45101    return(test_ret);
45102}
45103
45104
45105static int
45106test_xmlTextWriterWriteVFormatElement(void) {
45107    int test_ret = 0;
45108
45109
45110    /* missing type support */
45111    return(test_ret);
45112}
45113
45114
45115static int
45116test_xmlTextWriterWriteVFormatElementNS(void) {
45117    int test_ret = 0;
45118
45119
45120    /* missing type support */
45121    return(test_ret);
45122}
45123
45124
45125static int
45126test_xmlTextWriterWriteVFormatPI(void) {
45127    int test_ret = 0;
45128
45129
45130    /* missing type support */
45131    return(test_ret);
45132}
45133
45134
45135static int
45136test_xmlTextWriterWriteVFormatRaw(void) {
45137    int test_ret = 0;
45138
45139
45140    /* missing type support */
45141    return(test_ret);
45142}
45143
45144
45145static int
45146test_xmlTextWriterWriteVFormatString(void) {
45147    int test_ret = 0;
45148
45149
45150    /* missing type support */
45151    return(test_ret);
45152}
45153
45154static int
45155test_xmlwriter(void) {
45156    int test_ret = 0;
45157
45158    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45159    test_ret += test_xmlNewTextWriter();
45160    test_ret += test_xmlNewTextWriterFilename();
45161    test_ret += test_xmlNewTextWriterMemory();
45162    test_ret += test_xmlNewTextWriterPushParser();
45163    test_ret += test_xmlNewTextWriterTree();
45164    test_ret += test_xmlTextWriterEndAttribute();
45165    test_ret += test_xmlTextWriterEndCDATA();
45166    test_ret += test_xmlTextWriterEndComment();
45167    test_ret += test_xmlTextWriterEndDTD();
45168    test_ret += test_xmlTextWriterEndDTDAttlist();
45169    test_ret += test_xmlTextWriterEndDTDElement();
45170    test_ret += test_xmlTextWriterEndDTDEntity();
45171    test_ret += test_xmlTextWriterEndDocument();
45172    test_ret += test_xmlTextWriterEndElement();
45173    test_ret += test_xmlTextWriterEndPI();
45174    test_ret += test_xmlTextWriterFlush();
45175    test_ret += test_xmlTextWriterFullEndElement();
45176    test_ret += test_xmlTextWriterSetIndent();
45177    test_ret += test_xmlTextWriterSetIndentString();
45178    test_ret += test_xmlTextWriterStartAttribute();
45179    test_ret += test_xmlTextWriterStartAttributeNS();
45180    test_ret += test_xmlTextWriterStartCDATA();
45181    test_ret += test_xmlTextWriterStartComment();
45182    test_ret += test_xmlTextWriterStartDTD();
45183    test_ret += test_xmlTextWriterStartDTDAttlist();
45184    test_ret += test_xmlTextWriterStartDTDElement();
45185    test_ret += test_xmlTextWriterStartDTDEntity();
45186    test_ret += test_xmlTextWriterStartDocument();
45187    test_ret += test_xmlTextWriterStartElement();
45188    test_ret += test_xmlTextWriterStartElementNS();
45189    test_ret += test_xmlTextWriterStartPI();
45190    test_ret += test_xmlTextWriterWriteAttribute();
45191    test_ret += test_xmlTextWriterWriteAttributeNS();
45192    test_ret += test_xmlTextWriterWriteBase64();
45193    test_ret += test_xmlTextWriterWriteBinHex();
45194    test_ret += test_xmlTextWriterWriteCDATA();
45195    test_ret += test_xmlTextWriterWriteComment();
45196    test_ret += test_xmlTextWriterWriteDTD();
45197    test_ret += test_xmlTextWriterWriteDTDAttlist();
45198    test_ret += test_xmlTextWriterWriteDTDElement();
45199    test_ret += test_xmlTextWriterWriteDTDEntity();
45200    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45201    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45202    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45203    test_ret += test_xmlTextWriterWriteDTDNotation();
45204    test_ret += test_xmlTextWriterWriteElement();
45205    test_ret += test_xmlTextWriterWriteElementNS();
45206    test_ret += test_xmlTextWriterWriteFormatAttribute();
45207    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45208    test_ret += test_xmlTextWriterWriteFormatCDATA();
45209    test_ret += test_xmlTextWriterWriteFormatComment();
45210    test_ret += test_xmlTextWriterWriteFormatDTD();
45211    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45212    test_ret += test_xmlTextWriterWriteFormatDTDElement();
45213    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45214    test_ret += test_xmlTextWriterWriteFormatElement();
45215    test_ret += test_xmlTextWriterWriteFormatElementNS();
45216    test_ret += test_xmlTextWriterWriteFormatPI();
45217    test_ret += test_xmlTextWriterWriteFormatRaw();
45218    test_ret += test_xmlTextWriterWriteFormatString();
45219    test_ret += test_xmlTextWriterWritePI();
45220    test_ret += test_xmlTextWriterWriteRaw();
45221    test_ret += test_xmlTextWriterWriteRawLen();
45222    test_ret += test_xmlTextWriterWriteString();
45223    test_ret += test_xmlTextWriterWriteVFormatAttribute();
45224    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45225    test_ret += test_xmlTextWriterWriteVFormatCDATA();
45226    test_ret += test_xmlTextWriterWriteVFormatComment();
45227    test_ret += test_xmlTextWriterWriteVFormatDTD();
45228    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45229    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45230    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45231    test_ret += test_xmlTextWriterWriteVFormatElement();
45232    test_ret += test_xmlTextWriterWriteVFormatElementNS();
45233    test_ret += test_xmlTextWriterWriteVFormatPI();
45234    test_ret += test_xmlTextWriterWriteVFormatRaw();
45235    test_ret += test_xmlTextWriterWriteVFormatString();
45236
45237    if (test_ret != 0)
45238	printf("Module xmlwriter: %d errors\n", test_ret);
45239    return(test_ret);
45240}
45241
45242static int
45243test_xmlXPathCastBooleanToNumber(void) {
45244    int test_ret = 0;
45245
45246#if defined(LIBXML_XPATH_ENABLED)
45247    int mem_base;
45248    double ret_val;
45249    int val; /* a boolean */
45250    int n_val;
45251
45252    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45253        mem_base = xmlMemBlocks();
45254        val = gen_int(n_val, 0);
45255
45256        ret_val = xmlXPathCastBooleanToNumber(val);
45257        desret_double(ret_val);
45258        call_tests++;
45259        des_int(n_val, val, 0);
45260        xmlResetLastError();
45261        if (mem_base != xmlMemBlocks()) {
45262            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45263	           xmlMemBlocks() - mem_base);
45264	    test_ret++;
45265            printf(" %d", n_val);
45266            printf("\n");
45267        }
45268    }
45269    function_tests++;
45270#endif
45271
45272    return(test_ret);
45273}
45274
45275
45276static int
45277test_xmlXPathCastBooleanToString(void) {
45278    int test_ret = 0;
45279
45280#if defined(LIBXML_XPATH_ENABLED)
45281    int mem_base;
45282    xmlChar * ret_val;
45283    int val; /* a boolean */
45284    int n_val;
45285
45286    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45287        mem_base = xmlMemBlocks();
45288        val = gen_int(n_val, 0);
45289
45290        ret_val = xmlXPathCastBooleanToString(val);
45291        desret_xmlChar_ptr(ret_val);
45292        call_tests++;
45293        des_int(n_val, val, 0);
45294        xmlResetLastError();
45295        if (mem_base != xmlMemBlocks()) {
45296            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45297	           xmlMemBlocks() - mem_base);
45298	    test_ret++;
45299            printf(" %d", n_val);
45300            printf("\n");
45301        }
45302    }
45303    function_tests++;
45304#endif
45305
45306    return(test_ret);
45307}
45308
45309
45310static int
45311test_xmlXPathCastNodeSetToBoolean(void) {
45312    int test_ret = 0;
45313
45314#if defined(LIBXML_XPATH_ENABLED)
45315    int mem_base;
45316    int ret_val;
45317    xmlNodeSetPtr ns; /* a node-set */
45318    int n_ns;
45319
45320    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45321        mem_base = xmlMemBlocks();
45322        ns = gen_xmlNodeSetPtr(n_ns, 0);
45323
45324        ret_val = xmlXPathCastNodeSetToBoolean(ns);
45325        desret_int(ret_val);
45326        call_tests++;
45327        des_xmlNodeSetPtr(n_ns, ns, 0);
45328        xmlResetLastError();
45329        if (mem_base != xmlMemBlocks()) {
45330            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45331	           xmlMemBlocks() - mem_base);
45332	    test_ret++;
45333            printf(" %d", n_ns);
45334            printf("\n");
45335        }
45336    }
45337    function_tests++;
45338#endif
45339
45340    return(test_ret);
45341}
45342
45343
45344static int
45345test_xmlXPathCastNodeSetToNumber(void) {
45346    int test_ret = 0;
45347
45348#if defined(LIBXML_XPATH_ENABLED)
45349    int mem_base;
45350    double ret_val;
45351    xmlNodeSetPtr ns; /* a node-set */
45352    int n_ns;
45353
45354    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45355        mem_base = xmlMemBlocks();
45356        ns = gen_xmlNodeSetPtr(n_ns, 0);
45357
45358        ret_val = xmlXPathCastNodeSetToNumber(ns);
45359        desret_double(ret_val);
45360        call_tests++;
45361        des_xmlNodeSetPtr(n_ns, ns, 0);
45362        xmlResetLastError();
45363        if (mem_base != xmlMemBlocks()) {
45364            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45365	           xmlMemBlocks() - mem_base);
45366	    test_ret++;
45367            printf(" %d", n_ns);
45368            printf("\n");
45369        }
45370    }
45371    function_tests++;
45372#endif
45373
45374    return(test_ret);
45375}
45376
45377
45378static int
45379test_xmlXPathCastNodeSetToString(void) {
45380    int test_ret = 0;
45381
45382#if defined(LIBXML_XPATH_ENABLED)
45383    int mem_base;
45384    xmlChar * ret_val;
45385    xmlNodeSetPtr ns; /* a node-set */
45386    int n_ns;
45387
45388    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45389        mem_base = xmlMemBlocks();
45390        ns = gen_xmlNodeSetPtr(n_ns, 0);
45391
45392        ret_val = xmlXPathCastNodeSetToString(ns);
45393        desret_xmlChar_ptr(ret_val);
45394        call_tests++;
45395        des_xmlNodeSetPtr(n_ns, ns, 0);
45396        xmlResetLastError();
45397        if (mem_base != xmlMemBlocks()) {
45398            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45399	           xmlMemBlocks() - mem_base);
45400	    test_ret++;
45401            printf(" %d", n_ns);
45402            printf("\n");
45403        }
45404    }
45405    function_tests++;
45406#endif
45407
45408    return(test_ret);
45409}
45410
45411
45412static int
45413test_xmlXPathCastNodeToNumber(void) {
45414    int test_ret = 0;
45415
45416#if defined(LIBXML_XPATH_ENABLED)
45417    int mem_base;
45418    double ret_val;
45419    xmlNodePtr node; /* a node */
45420    int n_node;
45421
45422    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45423        mem_base = xmlMemBlocks();
45424        node = gen_xmlNodePtr(n_node, 0);
45425
45426        ret_val = xmlXPathCastNodeToNumber(node);
45427        desret_double(ret_val);
45428        call_tests++;
45429        des_xmlNodePtr(n_node, node, 0);
45430        xmlResetLastError();
45431        if (mem_base != xmlMemBlocks()) {
45432            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45433	           xmlMemBlocks() - mem_base);
45434	    test_ret++;
45435            printf(" %d", n_node);
45436            printf("\n");
45437        }
45438    }
45439    function_tests++;
45440#endif
45441
45442    return(test_ret);
45443}
45444
45445
45446static int
45447test_xmlXPathCastNodeToString(void) {
45448    int test_ret = 0;
45449
45450#if defined(LIBXML_XPATH_ENABLED)
45451    int mem_base;
45452    xmlChar * ret_val;
45453    xmlNodePtr node; /* a node */
45454    int n_node;
45455
45456    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45457        mem_base = xmlMemBlocks();
45458        node = gen_xmlNodePtr(n_node, 0);
45459
45460        ret_val = xmlXPathCastNodeToString(node);
45461        desret_xmlChar_ptr(ret_val);
45462        call_tests++;
45463        des_xmlNodePtr(n_node, node, 0);
45464        xmlResetLastError();
45465        if (mem_base != xmlMemBlocks()) {
45466            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45467	           xmlMemBlocks() - mem_base);
45468	    test_ret++;
45469            printf(" %d", n_node);
45470            printf("\n");
45471        }
45472    }
45473    function_tests++;
45474#endif
45475
45476    return(test_ret);
45477}
45478
45479
45480static int
45481test_xmlXPathCastNumberToBoolean(void) {
45482    int test_ret = 0;
45483
45484#if defined(LIBXML_XPATH_ENABLED)
45485    int mem_base;
45486    int ret_val;
45487    double val; /* a number */
45488    int n_val;
45489
45490    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45491        mem_base = xmlMemBlocks();
45492        val = gen_double(n_val, 0);
45493
45494        ret_val = xmlXPathCastNumberToBoolean(val);
45495        desret_int(ret_val);
45496        call_tests++;
45497        des_double(n_val, val, 0);
45498        xmlResetLastError();
45499        if (mem_base != xmlMemBlocks()) {
45500            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45501	           xmlMemBlocks() - mem_base);
45502	    test_ret++;
45503            printf(" %d", n_val);
45504            printf("\n");
45505        }
45506    }
45507    function_tests++;
45508#endif
45509
45510    return(test_ret);
45511}
45512
45513
45514static int
45515test_xmlXPathCastNumberToString(void) {
45516    int test_ret = 0;
45517
45518#if defined(LIBXML_XPATH_ENABLED)
45519    int mem_base;
45520    xmlChar * ret_val;
45521    double val; /* a number */
45522    int n_val;
45523
45524    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45525        mem_base = xmlMemBlocks();
45526        val = gen_double(n_val, 0);
45527
45528        ret_val = xmlXPathCastNumberToString(val);
45529        desret_xmlChar_ptr(ret_val);
45530        call_tests++;
45531        des_double(n_val, val, 0);
45532        xmlResetLastError();
45533        if (mem_base != xmlMemBlocks()) {
45534            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45535	           xmlMemBlocks() - mem_base);
45536	    test_ret++;
45537            printf(" %d", n_val);
45538            printf("\n");
45539        }
45540    }
45541    function_tests++;
45542#endif
45543
45544    return(test_ret);
45545}
45546
45547
45548static int
45549test_xmlXPathCastStringToBoolean(void) {
45550    int test_ret = 0;
45551
45552#if defined(LIBXML_XPATH_ENABLED)
45553    int mem_base;
45554    int ret_val;
45555    xmlChar * val; /* a string */
45556    int n_val;
45557
45558    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45559        mem_base = xmlMemBlocks();
45560        val = gen_const_xmlChar_ptr(n_val, 0);
45561
45562        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45563        desret_int(ret_val);
45564        call_tests++;
45565        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45566        xmlResetLastError();
45567        if (mem_base != xmlMemBlocks()) {
45568            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45569	           xmlMemBlocks() - mem_base);
45570	    test_ret++;
45571            printf(" %d", n_val);
45572            printf("\n");
45573        }
45574    }
45575    function_tests++;
45576#endif
45577
45578    return(test_ret);
45579}
45580
45581
45582static int
45583test_xmlXPathCastStringToNumber(void) {
45584    int test_ret = 0;
45585
45586#if defined(LIBXML_XPATH_ENABLED)
45587    int mem_base;
45588    double ret_val;
45589    xmlChar * val; /* a string */
45590    int n_val;
45591
45592    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45593        mem_base = xmlMemBlocks();
45594        val = gen_const_xmlChar_ptr(n_val, 0);
45595
45596        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45597        desret_double(ret_val);
45598        call_tests++;
45599        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45600        xmlResetLastError();
45601        if (mem_base != xmlMemBlocks()) {
45602            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45603	           xmlMemBlocks() - mem_base);
45604	    test_ret++;
45605            printf(" %d", n_val);
45606            printf("\n");
45607        }
45608    }
45609    function_tests++;
45610#endif
45611
45612    return(test_ret);
45613}
45614
45615
45616static int
45617test_xmlXPathCastToBoolean(void) {
45618    int test_ret = 0;
45619
45620#if defined(LIBXML_XPATH_ENABLED)
45621    int mem_base;
45622    int ret_val;
45623    xmlXPathObjectPtr val; /* an XPath object */
45624    int n_val;
45625
45626    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45627        mem_base = xmlMemBlocks();
45628        val = gen_xmlXPathObjectPtr(n_val, 0);
45629
45630        ret_val = xmlXPathCastToBoolean(val);
45631        desret_int(ret_val);
45632        call_tests++;
45633        des_xmlXPathObjectPtr(n_val, val, 0);
45634        xmlResetLastError();
45635        if (mem_base != xmlMemBlocks()) {
45636            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45637	           xmlMemBlocks() - mem_base);
45638	    test_ret++;
45639            printf(" %d", n_val);
45640            printf("\n");
45641        }
45642    }
45643    function_tests++;
45644#endif
45645
45646    return(test_ret);
45647}
45648
45649
45650static int
45651test_xmlXPathCastToNumber(void) {
45652    int test_ret = 0;
45653
45654#if defined(LIBXML_XPATH_ENABLED)
45655    int mem_base;
45656    double ret_val;
45657    xmlXPathObjectPtr val; /* an XPath object */
45658    int n_val;
45659
45660    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45661        mem_base = xmlMemBlocks();
45662        val = gen_xmlXPathObjectPtr(n_val, 0);
45663
45664        ret_val = xmlXPathCastToNumber(val);
45665        desret_double(ret_val);
45666        call_tests++;
45667        des_xmlXPathObjectPtr(n_val, val, 0);
45668        xmlResetLastError();
45669        if (mem_base != xmlMemBlocks()) {
45670            printf("Leak of %d blocks found in xmlXPathCastToNumber",
45671	           xmlMemBlocks() - mem_base);
45672	    test_ret++;
45673            printf(" %d", n_val);
45674            printf("\n");
45675        }
45676    }
45677    function_tests++;
45678#endif
45679
45680    return(test_ret);
45681}
45682
45683
45684static int
45685test_xmlXPathCastToString(void) {
45686    int test_ret = 0;
45687
45688#if defined(LIBXML_XPATH_ENABLED)
45689    int mem_base;
45690    xmlChar * ret_val;
45691    xmlXPathObjectPtr val; /* an XPath object */
45692    int n_val;
45693
45694    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45695        mem_base = xmlMemBlocks();
45696        val = gen_xmlXPathObjectPtr(n_val, 0);
45697
45698        ret_val = xmlXPathCastToString(val);
45699        desret_xmlChar_ptr(ret_val);
45700        call_tests++;
45701        des_xmlXPathObjectPtr(n_val, val, 0);
45702        xmlResetLastError();
45703        if (mem_base != xmlMemBlocks()) {
45704            printf("Leak of %d blocks found in xmlXPathCastToString",
45705	           xmlMemBlocks() - mem_base);
45706	    test_ret++;
45707            printf(" %d", n_val);
45708            printf("\n");
45709        }
45710    }
45711    function_tests++;
45712#endif
45713
45714    return(test_ret);
45715}
45716
45717
45718static int
45719test_xmlXPathCmpNodes(void) {
45720    int test_ret = 0;
45721
45722#if defined(LIBXML_XPATH_ENABLED)
45723    int mem_base;
45724    int ret_val;
45725    xmlNodePtr node1; /* the first node */
45726    int n_node1;
45727    xmlNodePtr node2; /* the second node */
45728    int n_node2;
45729
45730    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45731    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45732        mem_base = xmlMemBlocks();
45733        node1 = gen_xmlNodePtr(n_node1, 0);
45734        node2 = gen_xmlNodePtr(n_node2, 1);
45735
45736        ret_val = xmlXPathCmpNodes(node1, node2);
45737        desret_int(ret_val);
45738        call_tests++;
45739        des_xmlNodePtr(n_node1, node1, 0);
45740        des_xmlNodePtr(n_node2, node2, 1);
45741        xmlResetLastError();
45742        if (mem_base != xmlMemBlocks()) {
45743            printf("Leak of %d blocks found in xmlXPathCmpNodes",
45744	           xmlMemBlocks() - mem_base);
45745	    test_ret++;
45746            printf(" %d", n_node1);
45747            printf(" %d", n_node2);
45748            printf("\n");
45749        }
45750    }
45751    }
45752    function_tests++;
45753#endif
45754
45755    return(test_ret);
45756}
45757
45758
45759static int
45760test_xmlXPathCompile(void) {
45761    int test_ret = 0;
45762
45763
45764    /* missing type support */
45765    return(test_ret);
45766}
45767
45768#ifdef LIBXML_XPATH_ENABLED
45769
45770#define gen_nb_xmlXPathCompExprPtr 1
45771static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45772    return(NULL);
45773}
45774static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45775}
45776#endif
45777
45778#ifdef LIBXML_XPATH_ENABLED
45779
45780#define gen_nb_xmlXPathContextPtr 1
45781static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45782    return(NULL);
45783}
45784static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45785}
45786#endif
45787
45788
45789static int
45790test_xmlXPathCompiledEval(void) {
45791    int test_ret = 0;
45792
45793#if defined(LIBXML_XPATH_ENABLED)
45794    int mem_base;
45795    xmlXPathObjectPtr ret_val;
45796    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45797    int n_comp;
45798    xmlXPathContextPtr ctx; /* the XPath context */
45799    int n_ctx;
45800
45801    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45802    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45803        mem_base = xmlMemBlocks();
45804        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45805        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45806
45807        ret_val = xmlXPathCompiledEval(comp, ctx);
45808        desret_xmlXPathObjectPtr(ret_val);
45809        call_tests++;
45810        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45811        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45812        xmlResetLastError();
45813        if (mem_base != xmlMemBlocks()) {
45814            printf("Leak of %d blocks found in xmlXPathCompiledEval",
45815	           xmlMemBlocks() - mem_base);
45816	    test_ret++;
45817            printf(" %d", n_comp);
45818            printf(" %d", n_ctx);
45819            printf("\n");
45820        }
45821    }
45822    }
45823    function_tests++;
45824#endif
45825
45826    return(test_ret);
45827}
45828
45829
45830static int
45831test_xmlXPathCompiledEvalToBoolean(void) {
45832    int test_ret = 0;
45833
45834#if defined(LIBXML_XPATH_ENABLED)
45835    int mem_base;
45836    int ret_val;
45837    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45838    int n_comp;
45839    xmlXPathContextPtr ctxt; /* the XPath context */
45840    int n_ctxt;
45841
45842    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45843    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45844        mem_base = xmlMemBlocks();
45845        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45846        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
45847
45848        ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
45849        desret_int(ret_val);
45850        call_tests++;
45851        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45852        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
45853        xmlResetLastError();
45854        if (mem_base != xmlMemBlocks()) {
45855            printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
45856	           xmlMemBlocks() - mem_base);
45857	    test_ret++;
45858            printf(" %d", n_comp);
45859            printf(" %d", n_ctxt);
45860            printf("\n");
45861        }
45862    }
45863    }
45864    function_tests++;
45865#endif
45866
45867    return(test_ret);
45868}
45869
45870
45871static int
45872test_xmlXPathContextSetCache(void) {
45873    int test_ret = 0;
45874
45875#if defined(LIBXML_XPATH_ENABLED)
45876    int mem_base;
45877    int ret_val;
45878    xmlXPathContextPtr ctxt; /* the XPath context */
45879    int n_ctxt;
45880    int active; /* enables/disables (creates/frees) the cache */
45881    int n_active;
45882    int value; /* a value with semantics dependant on @options */
45883    int n_value;
45884    int options; /* options (currently only the value 0 is used) */
45885    int n_options;
45886
45887    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45888    for (n_active = 0;n_active < gen_nb_int;n_active++) {
45889    for (n_value = 0;n_value < gen_nb_int;n_value++) {
45890    for (n_options = 0;n_options < gen_nb_int;n_options++) {
45891        mem_base = xmlMemBlocks();
45892        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45893        active = gen_int(n_active, 1);
45894        value = gen_int(n_value, 2);
45895        options = gen_int(n_options, 3);
45896
45897        ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
45898        desret_int(ret_val);
45899        call_tests++;
45900        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45901        des_int(n_active, active, 1);
45902        des_int(n_value, value, 2);
45903        des_int(n_options, options, 3);
45904        xmlResetLastError();
45905        if (mem_base != xmlMemBlocks()) {
45906            printf("Leak of %d blocks found in xmlXPathContextSetCache",
45907	           xmlMemBlocks() - mem_base);
45908	    test_ret++;
45909            printf(" %d", n_ctxt);
45910            printf(" %d", n_active);
45911            printf(" %d", n_value);
45912            printf(" %d", n_options);
45913            printf("\n");
45914        }
45915    }
45916    }
45917    }
45918    }
45919    function_tests++;
45920#endif
45921
45922    return(test_ret);
45923}
45924
45925
45926static int
45927test_xmlXPathConvertBoolean(void) {
45928    int test_ret = 0;
45929
45930#if defined(LIBXML_XPATH_ENABLED)
45931    int mem_base;
45932    xmlXPathObjectPtr ret_val;
45933    xmlXPathObjectPtr val; /* an XPath object */
45934    int n_val;
45935
45936    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45937        mem_base = xmlMemBlocks();
45938        val = gen_xmlXPathObjectPtr(n_val, 0);
45939
45940        ret_val = xmlXPathConvertBoolean(val);
45941        val = NULL;
45942        desret_xmlXPathObjectPtr(ret_val);
45943        call_tests++;
45944        des_xmlXPathObjectPtr(n_val, val, 0);
45945        xmlResetLastError();
45946        if (mem_base != xmlMemBlocks()) {
45947            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
45948	           xmlMemBlocks() - mem_base);
45949	    test_ret++;
45950            printf(" %d", n_val);
45951            printf("\n");
45952        }
45953    }
45954    function_tests++;
45955#endif
45956
45957    return(test_ret);
45958}
45959
45960
45961static int
45962test_xmlXPathConvertNumber(void) {
45963    int test_ret = 0;
45964
45965#if defined(LIBXML_XPATH_ENABLED)
45966    int mem_base;
45967    xmlXPathObjectPtr ret_val;
45968    xmlXPathObjectPtr val; /* an XPath object */
45969    int n_val;
45970
45971    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45972        mem_base = xmlMemBlocks();
45973        val = gen_xmlXPathObjectPtr(n_val, 0);
45974
45975        ret_val = xmlXPathConvertNumber(val);
45976        val = NULL;
45977        desret_xmlXPathObjectPtr(ret_val);
45978        call_tests++;
45979        des_xmlXPathObjectPtr(n_val, val, 0);
45980        xmlResetLastError();
45981        if (mem_base != xmlMemBlocks()) {
45982            printf("Leak of %d blocks found in xmlXPathConvertNumber",
45983	           xmlMemBlocks() - mem_base);
45984	    test_ret++;
45985            printf(" %d", n_val);
45986            printf("\n");
45987        }
45988    }
45989    function_tests++;
45990#endif
45991
45992    return(test_ret);
45993}
45994
45995
45996static int
45997test_xmlXPathConvertString(void) {
45998    int test_ret = 0;
45999
46000#if defined(LIBXML_XPATH_ENABLED)
46001    int mem_base;
46002    xmlXPathObjectPtr ret_val;
46003    xmlXPathObjectPtr val; /* an XPath object */
46004    int n_val;
46005
46006    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46007        mem_base = xmlMemBlocks();
46008        val = gen_xmlXPathObjectPtr(n_val, 0);
46009
46010        ret_val = xmlXPathConvertString(val);
46011        val = NULL;
46012        desret_xmlXPathObjectPtr(ret_val);
46013        call_tests++;
46014        des_xmlXPathObjectPtr(n_val, val, 0);
46015        xmlResetLastError();
46016        if (mem_base != xmlMemBlocks()) {
46017            printf("Leak of %d blocks found in xmlXPathConvertString",
46018	           xmlMemBlocks() - mem_base);
46019	    test_ret++;
46020            printf(" %d", n_val);
46021            printf("\n");
46022        }
46023    }
46024    function_tests++;
46025#endif
46026
46027    return(test_ret);
46028}
46029
46030
46031static int
46032test_xmlXPathCtxtCompile(void) {
46033    int test_ret = 0;
46034
46035
46036    /* missing type support */
46037    return(test_ret);
46038}
46039
46040
46041static int
46042test_xmlXPathEval(void) {
46043    int test_ret = 0;
46044
46045#if defined(LIBXML_XPATH_ENABLED)
46046    int mem_base;
46047    xmlXPathObjectPtr ret_val;
46048    xmlChar * str; /* the XPath expression */
46049    int n_str;
46050    xmlXPathContextPtr ctx; /* the XPath context */
46051    int n_ctx;
46052
46053    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46054    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46055        mem_base = xmlMemBlocks();
46056        str = gen_const_xmlChar_ptr(n_str, 0);
46057        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46058
46059        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46060        desret_xmlXPathObjectPtr(ret_val);
46061        call_tests++;
46062        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46063        des_xmlXPathContextPtr(n_ctx, ctx, 1);
46064        xmlResetLastError();
46065        if (mem_base != xmlMemBlocks()) {
46066            printf("Leak of %d blocks found in xmlXPathEval",
46067	           xmlMemBlocks() - mem_base);
46068	    test_ret++;
46069            printf(" %d", n_str);
46070            printf(" %d", n_ctx);
46071            printf("\n");
46072        }
46073    }
46074    }
46075    function_tests++;
46076#endif
46077
46078    return(test_ret);
46079}
46080
46081
46082static int
46083test_xmlXPathEvalExpression(void) {
46084    int test_ret = 0;
46085
46086#if defined(LIBXML_XPATH_ENABLED)
46087    int mem_base;
46088    xmlXPathObjectPtr ret_val;
46089    xmlChar * str; /* the XPath expression */
46090    int n_str;
46091    xmlXPathContextPtr ctxt; /* the XPath context */
46092    int n_ctxt;
46093
46094    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46095    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46096        mem_base = xmlMemBlocks();
46097        str = gen_const_xmlChar_ptr(n_str, 0);
46098        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46099
46100        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46101        desret_xmlXPathObjectPtr(ret_val);
46102        call_tests++;
46103        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46104        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46105        xmlResetLastError();
46106        if (mem_base != xmlMemBlocks()) {
46107            printf("Leak of %d blocks found in xmlXPathEvalExpression",
46108	           xmlMemBlocks() - mem_base);
46109	    test_ret++;
46110            printf(" %d", n_str);
46111            printf(" %d", n_ctxt);
46112            printf("\n");
46113        }
46114    }
46115    }
46116    function_tests++;
46117#endif
46118
46119    return(test_ret);
46120}
46121
46122
46123static int
46124test_xmlXPathEvalPredicate(void) {
46125    int test_ret = 0;
46126
46127#if defined(LIBXML_XPATH_ENABLED)
46128    int mem_base;
46129    int ret_val;
46130    xmlXPathContextPtr ctxt; /* the XPath context */
46131    int n_ctxt;
46132    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46133    int n_res;
46134
46135    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46136    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46137        mem_base = xmlMemBlocks();
46138        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46139        res = gen_xmlXPathObjectPtr(n_res, 1);
46140
46141        ret_val = xmlXPathEvalPredicate(ctxt, res);
46142        desret_int(ret_val);
46143        call_tests++;
46144        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46145        des_xmlXPathObjectPtr(n_res, res, 1);
46146        xmlResetLastError();
46147        if (mem_base != xmlMemBlocks()) {
46148            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46149	           xmlMemBlocks() - mem_base);
46150	    test_ret++;
46151            printf(" %d", n_ctxt);
46152            printf(" %d", n_res);
46153            printf("\n");
46154        }
46155    }
46156    }
46157    function_tests++;
46158#endif
46159
46160    return(test_ret);
46161}
46162
46163
46164static int
46165test_xmlXPathInit(void) {
46166    int test_ret = 0;
46167
46168#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46169    int mem_base;
46170
46171        mem_base = xmlMemBlocks();
46172
46173        xmlXPathInit();
46174        call_tests++;
46175        xmlResetLastError();
46176        if (mem_base != xmlMemBlocks()) {
46177            printf("Leak of %d blocks found in xmlXPathInit",
46178	           xmlMemBlocks() - mem_base);
46179	    test_ret++;
46180            printf("\n");
46181        }
46182    function_tests++;
46183#endif
46184
46185    return(test_ret);
46186}
46187
46188
46189static int
46190test_xmlXPathIsInf(void) {
46191    int test_ret = 0;
46192
46193#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46194    int mem_base;
46195    int ret_val;
46196    double val; /* a double value */
46197    int n_val;
46198
46199    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46200        mem_base = xmlMemBlocks();
46201        val = gen_double(n_val, 0);
46202
46203        ret_val = xmlXPathIsInf(val);
46204        desret_int(ret_val);
46205        call_tests++;
46206        des_double(n_val, val, 0);
46207        xmlResetLastError();
46208        if (mem_base != xmlMemBlocks()) {
46209            printf("Leak of %d blocks found in xmlXPathIsInf",
46210	           xmlMemBlocks() - mem_base);
46211	    test_ret++;
46212            printf(" %d", n_val);
46213            printf("\n");
46214        }
46215    }
46216    function_tests++;
46217#endif
46218
46219    return(test_ret);
46220}
46221
46222
46223static int
46224test_xmlXPathIsNaN(void) {
46225    int test_ret = 0;
46226
46227#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46228    int mem_base;
46229    int ret_val;
46230    double val; /* a double value */
46231    int n_val;
46232
46233    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46234        mem_base = xmlMemBlocks();
46235        val = gen_double(n_val, 0);
46236
46237        ret_val = xmlXPathIsNaN(val);
46238        desret_int(ret_val);
46239        call_tests++;
46240        des_double(n_val, val, 0);
46241        xmlResetLastError();
46242        if (mem_base != xmlMemBlocks()) {
46243            printf("Leak of %d blocks found in xmlXPathIsNaN",
46244	           xmlMemBlocks() - mem_base);
46245	    test_ret++;
46246            printf(" %d", n_val);
46247            printf("\n");
46248        }
46249    }
46250    function_tests++;
46251#endif
46252
46253    return(test_ret);
46254}
46255
46256
46257static int
46258test_xmlXPathNewContext(void) {
46259    int test_ret = 0;
46260
46261
46262    /* missing type support */
46263    return(test_ret);
46264}
46265
46266
46267static int
46268test_xmlXPathNodeSetCreate(void) {
46269    int test_ret = 0;
46270
46271#if defined(LIBXML_XPATH_ENABLED)
46272    int mem_base;
46273    xmlNodeSetPtr ret_val;
46274    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46275    int n_val;
46276
46277    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46278        mem_base = xmlMemBlocks();
46279        val = gen_xmlNodePtr(n_val, 0);
46280
46281        ret_val = xmlXPathNodeSetCreate(val);
46282        desret_xmlNodeSetPtr(ret_val);
46283        call_tests++;
46284        des_xmlNodePtr(n_val, val, 0);
46285        xmlResetLastError();
46286        if (mem_base != xmlMemBlocks()) {
46287            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46288	           xmlMemBlocks() - mem_base);
46289	    test_ret++;
46290            printf(" %d", n_val);
46291            printf("\n");
46292        }
46293    }
46294    function_tests++;
46295#endif
46296
46297    return(test_ret);
46298}
46299
46300
46301static int
46302test_xmlXPathObjectCopy(void) {
46303    int test_ret = 0;
46304
46305#if defined(LIBXML_XPATH_ENABLED)
46306    int mem_base;
46307    xmlXPathObjectPtr ret_val;
46308    xmlXPathObjectPtr val; /* the original object */
46309    int n_val;
46310
46311    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46312        mem_base = xmlMemBlocks();
46313        val = gen_xmlXPathObjectPtr(n_val, 0);
46314
46315        ret_val = xmlXPathObjectCopy(val);
46316        desret_xmlXPathObjectPtr(ret_val);
46317        call_tests++;
46318        des_xmlXPathObjectPtr(n_val, val, 0);
46319        xmlResetLastError();
46320        if (mem_base != xmlMemBlocks()) {
46321            printf("Leak of %d blocks found in xmlXPathObjectCopy",
46322	           xmlMemBlocks() - mem_base);
46323	    test_ret++;
46324            printf(" %d", n_val);
46325            printf("\n");
46326        }
46327    }
46328    function_tests++;
46329#endif
46330
46331    return(test_ret);
46332}
46333
46334
46335static int
46336test_xmlXPathOrderDocElems(void) {
46337    int test_ret = 0;
46338
46339#if defined(LIBXML_XPATH_ENABLED)
46340    int mem_base;
46341    long ret_val;
46342    xmlDocPtr doc; /* an input document */
46343    int n_doc;
46344
46345    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46346        mem_base = xmlMemBlocks();
46347        doc = gen_xmlDocPtr(n_doc, 0);
46348
46349        ret_val = xmlXPathOrderDocElems(doc);
46350        desret_long(ret_val);
46351        call_tests++;
46352        des_xmlDocPtr(n_doc, doc, 0);
46353        xmlResetLastError();
46354        if (mem_base != xmlMemBlocks()) {
46355            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46356	           xmlMemBlocks() - mem_base);
46357	    test_ret++;
46358            printf(" %d", n_doc);
46359            printf("\n");
46360        }
46361    }
46362    function_tests++;
46363#endif
46364
46365    return(test_ret);
46366}
46367
46368static int
46369test_xpath(void) {
46370    int test_ret = 0;
46371
46372    if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46373    test_ret += test_xmlXPathCastBooleanToNumber();
46374    test_ret += test_xmlXPathCastBooleanToString();
46375    test_ret += test_xmlXPathCastNodeSetToBoolean();
46376    test_ret += test_xmlXPathCastNodeSetToNumber();
46377    test_ret += test_xmlXPathCastNodeSetToString();
46378    test_ret += test_xmlXPathCastNodeToNumber();
46379    test_ret += test_xmlXPathCastNodeToString();
46380    test_ret += test_xmlXPathCastNumberToBoolean();
46381    test_ret += test_xmlXPathCastNumberToString();
46382    test_ret += test_xmlXPathCastStringToBoolean();
46383    test_ret += test_xmlXPathCastStringToNumber();
46384    test_ret += test_xmlXPathCastToBoolean();
46385    test_ret += test_xmlXPathCastToNumber();
46386    test_ret += test_xmlXPathCastToString();
46387    test_ret += test_xmlXPathCmpNodes();
46388    test_ret += test_xmlXPathCompile();
46389    test_ret += test_xmlXPathCompiledEval();
46390    test_ret += test_xmlXPathCompiledEvalToBoolean();
46391    test_ret += test_xmlXPathContextSetCache();
46392    test_ret += test_xmlXPathConvertBoolean();
46393    test_ret += test_xmlXPathConvertNumber();
46394    test_ret += test_xmlXPathConvertString();
46395    test_ret += test_xmlXPathCtxtCompile();
46396    test_ret += test_xmlXPathEval();
46397    test_ret += test_xmlXPathEvalExpression();
46398    test_ret += test_xmlXPathEvalPredicate();
46399    test_ret += test_xmlXPathInit();
46400    test_ret += test_xmlXPathIsInf();
46401    test_ret += test_xmlXPathIsNaN();
46402    test_ret += test_xmlXPathNewContext();
46403    test_ret += test_xmlXPathNodeSetCreate();
46404    test_ret += test_xmlXPathObjectCopy();
46405    test_ret += test_xmlXPathOrderDocElems();
46406
46407    if (test_ret != 0)
46408	printf("Module xpath: %d errors\n", test_ret);
46409    return(test_ret);
46410}
46411#ifdef LIBXML_XPATH_ENABLED
46412
46413#define gen_nb_xmlXPathParserContextPtr 1
46414static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46415    return(NULL);
46416}
46417static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46418}
46419#endif
46420
46421
46422static int
46423test_valuePop(void) {
46424    int test_ret = 0;
46425
46426#if defined(LIBXML_XPATH_ENABLED)
46427    int mem_base;
46428    xmlXPathObjectPtr ret_val;
46429    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46430    int n_ctxt;
46431
46432    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46433        mem_base = xmlMemBlocks();
46434        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46435
46436        ret_val = valuePop(ctxt);
46437        desret_xmlXPathObjectPtr(ret_val);
46438        call_tests++;
46439        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46440        xmlResetLastError();
46441        if (mem_base != xmlMemBlocks()) {
46442            printf("Leak of %d blocks found in valuePop",
46443	           xmlMemBlocks() - mem_base);
46444	    test_ret++;
46445            printf(" %d", n_ctxt);
46446            printf("\n");
46447        }
46448    }
46449    function_tests++;
46450#endif
46451
46452    return(test_ret);
46453}
46454
46455
46456static int
46457test_valuePush(void) {
46458    int test_ret = 0;
46459
46460#if defined(LIBXML_XPATH_ENABLED)
46461    int mem_base;
46462    int ret_val;
46463    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46464    int n_ctxt;
46465    xmlXPathObjectPtr value; /* the XPath object */
46466    int n_value;
46467
46468    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46469    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46470        mem_base = xmlMemBlocks();
46471        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46472        value = gen_xmlXPathObjectPtr(n_value, 1);
46473
46474        ret_val = valuePush(ctxt, value);
46475        desret_int(ret_val);
46476        call_tests++;
46477        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46478        des_xmlXPathObjectPtr(n_value, value, 1);
46479        xmlResetLastError();
46480        if (mem_base != xmlMemBlocks()) {
46481            printf("Leak of %d blocks found in valuePush",
46482	           xmlMemBlocks() - mem_base);
46483	    test_ret++;
46484            printf(" %d", n_ctxt);
46485            printf(" %d", n_value);
46486            printf("\n");
46487        }
46488    }
46489    }
46490    function_tests++;
46491#endif
46492
46493    return(test_ret);
46494}
46495
46496
46497static int
46498test_xmlXPathAddValues(void) {
46499    int test_ret = 0;
46500
46501#if defined(LIBXML_XPATH_ENABLED)
46502    int mem_base;
46503    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46504    int n_ctxt;
46505
46506    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46507        mem_base = xmlMemBlocks();
46508        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46509
46510        xmlXPathAddValues(ctxt);
46511        call_tests++;
46512        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46513        xmlResetLastError();
46514        if (mem_base != xmlMemBlocks()) {
46515            printf("Leak of %d blocks found in xmlXPathAddValues",
46516	           xmlMemBlocks() - mem_base);
46517	    test_ret++;
46518            printf(" %d", n_ctxt);
46519            printf("\n");
46520        }
46521    }
46522    function_tests++;
46523#endif
46524
46525    return(test_ret);
46526}
46527
46528
46529static int
46530test_xmlXPathBooleanFunction(void) {
46531    int test_ret = 0;
46532
46533#if defined(LIBXML_XPATH_ENABLED)
46534    int mem_base;
46535    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46536    int n_ctxt;
46537    int nargs; /* the number of arguments */
46538    int n_nargs;
46539
46540    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46541    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46542        mem_base = xmlMemBlocks();
46543        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46544        nargs = gen_int(n_nargs, 1);
46545
46546        xmlXPathBooleanFunction(ctxt, nargs);
46547        call_tests++;
46548        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46549        des_int(n_nargs, nargs, 1);
46550        xmlResetLastError();
46551        if (mem_base != xmlMemBlocks()) {
46552            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46553	           xmlMemBlocks() - mem_base);
46554	    test_ret++;
46555            printf(" %d", n_ctxt);
46556            printf(" %d", n_nargs);
46557            printf("\n");
46558        }
46559    }
46560    }
46561    function_tests++;
46562#endif
46563
46564    return(test_ret);
46565}
46566
46567
46568static int
46569test_xmlXPathCeilingFunction(void) {
46570    int test_ret = 0;
46571
46572#if defined(LIBXML_XPATH_ENABLED)
46573    int mem_base;
46574    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46575    int n_ctxt;
46576    int nargs; /* the number of arguments */
46577    int n_nargs;
46578
46579    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46580    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46581        mem_base = xmlMemBlocks();
46582        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46583        nargs = gen_int(n_nargs, 1);
46584
46585        xmlXPathCeilingFunction(ctxt, nargs);
46586        call_tests++;
46587        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46588        des_int(n_nargs, nargs, 1);
46589        xmlResetLastError();
46590        if (mem_base != xmlMemBlocks()) {
46591            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46592	           xmlMemBlocks() - mem_base);
46593	    test_ret++;
46594            printf(" %d", n_ctxt);
46595            printf(" %d", n_nargs);
46596            printf("\n");
46597        }
46598    }
46599    }
46600    function_tests++;
46601#endif
46602
46603    return(test_ret);
46604}
46605
46606
46607static int
46608test_xmlXPathCompareValues(void) {
46609    int test_ret = 0;
46610
46611#if defined(LIBXML_XPATH_ENABLED)
46612    int mem_base;
46613    int ret_val;
46614    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46615    int n_ctxt;
46616    int inf; /* less than (1) or greater than (0) */
46617    int n_inf;
46618    int strict; /* is the comparison strict */
46619    int n_strict;
46620
46621    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46622    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46623    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46624        mem_base = xmlMemBlocks();
46625        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46626        inf = gen_int(n_inf, 1);
46627        strict = gen_int(n_strict, 2);
46628
46629        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46630        desret_int(ret_val);
46631        call_tests++;
46632        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46633        des_int(n_inf, inf, 1);
46634        des_int(n_strict, strict, 2);
46635        xmlResetLastError();
46636        if (mem_base != xmlMemBlocks()) {
46637            printf("Leak of %d blocks found in xmlXPathCompareValues",
46638	           xmlMemBlocks() - mem_base);
46639	    test_ret++;
46640            printf(" %d", n_ctxt);
46641            printf(" %d", n_inf);
46642            printf(" %d", n_strict);
46643            printf("\n");
46644        }
46645    }
46646    }
46647    }
46648    function_tests++;
46649#endif
46650
46651    return(test_ret);
46652}
46653
46654
46655static int
46656test_xmlXPathConcatFunction(void) {
46657    int test_ret = 0;
46658
46659#if defined(LIBXML_XPATH_ENABLED)
46660    int mem_base;
46661    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46662    int n_ctxt;
46663    int nargs; /* the number of arguments */
46664    int n_nargs;
46665
46666    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46667    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46668        mem_base = xmlMemBlocks();
46669        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46670        nargs = gen_int(n_nargs, 1);
46671
46672        xmlXPathConcatFunction(ctxt, nargs);
46673        call_tests++;
46674        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46675        des_int(n_nargs, nargs, 1);
46676        xmlResetLastError();
46677        if (mem_base != xmlMemBlocks()) {
46678            printf("Leak of %d blocks found in xmlXPathConcatFunction",
46679	           xmlMemBlocks() - mem_base);
46680	    test_ret++;
46681            printf(" %d", n_ctxt);
46682            printf(" %d", n_nargs);
46683            printf("\n");
46684        }
46685    }
46686    }
46687    function_tests++;
46688#endif
46689
46690    return(test_ret);
46691}
46692
46693
46694static int
46695test_xmlXPathContainsFunction(void) {
46696    int test_ret = 0;
46697
46698#if defined(LIBXML_XPATH_ENABLED)
46699    int mem_base;
46700    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46701    int n_ctxt;
46702    int nargs; /* the number of arguments */
46703    int n_nargs;
46704
46705    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46706    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46707        mem_base = xmlMemBlocks();
46708        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46709        nargs = gen_int(n_nargs, 1);
46710
46711        xmlXPathContainsFunction(ctxt, nargs);
46712        call_tests++;
46713        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46714        des_int(n_nargs, nargs, 1);
46715        xmlResetLastError();
46716        if (mem_base != xmlMemBlocks()) {
46717            printf("Leak of %d blocks found in xmlXPathContainsFunction",
46718	           xmlMemBlocks() - mem_base);
46719	    test_ret++;
46720            printf(" %d", n_ctxt);
46721            printf(" %d", n_nargs);
46722            printf("\n");
46723        }
46724    }
46725    }
46726    function_tests++;
46727#endif
46728
46729    return(test_ret);
46730}
46731
46732
46733static int
46734test_xmlXPathCountFunction(void) {
46735    int test_ret = 0;
46736
46737#if defined(LIBXML_XPATH_ENABLED)
46738    int mem_base;
46739    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46740    int n_ctxt;
46741    int nargs; /* the number of arguments */
46742    int n_nargs;
46743
46744    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46745    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46746        mem_base = xmlMemBlocks();
46747        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46748        nargs = gen_int(n_nargs, 1);
46749
46750        xmlXPathCountFunction(ctxt, nargs);
46751        call_tests++;
46752        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46753        des_int(n_nargs, nargs, 1);
46754        xmlResetLastError();
46755        if (mem_base != xmlMemBlocks()) {
46756            printf("Leak of %d blocks found in xmlXPathCountFunction",
46757	           xmlMemBlocks() - mem_base);
46758	    test_ret++;
46759            printf(" %d", n_ctxt);
46760            printf(" %d", n_nargs);
46761            printf("\n");
46762        }
46763    }
46764    }
46765    function_tests++;
46766#endif
46767
46768    return(test_ret);
46769}
46770
46771
46772static int
46773test_xmlXPathDebugDumpCompExpr(void) {
46774    int test_ret = 0;
46775
46776#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46777    int mem_base;
46778    FILE * output; /* the FILE * for the output */
46779    int n_output;
46780    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46781    int n_comp;
46782    int depth; /* the indentation level. */
46783    int n_depth;
46784
46785    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46786    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46787    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46788        mem_base = xmlMemBlocks();
46789        output = gen_FILE_ptr(n_output, 0);
46790        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46791        depth = gen_int(n_depth, 2);
46792
46793        xmlXPathDebugDumpCompExpr(output, comp, depth);
46794        call_tests++;
46795        des_FILE_ptr(n_output, output, 0);
46796        des_xmlXPathCompExprPtr(n_comp, comp, 1);
46797        des_int(n_depth, depth, 2);
46798        xmlResetLastError();
46799        if (mem_base != xmlMemBlocks()) {
46800            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46801	           xmlMemBlocks() - mem_base);
46802	    test_ret++;
46803            printf(" %d", n_output);
46804            printf(" %d", n_comp);
46805            printf(" %d", n_depth);
46806            printf("\n");
46807        }
46808    }
46809    }
46810    }
46811    function_tests++;
46812#endif
46813
46814    return(test_ret);
46815}
46816
46817
46818static int
46819test_xmlXPathDebugDumpObject(void) {
46820    int test_ret = 0;
46821
46822#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46823    int mem_base;
46824    FILE * output; /* the FILE * to dump the output */
46825    int n_output;
46826    xmlXPathObjectPtr cur; /* the object to inspect */
46827    int n_cur;
46828    int depth; /* indentation level */
46829    int n_depth;
46830
46831    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46832    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
46833    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46834        mem_base = xmlMemBlocks();
46835        output = gen_FILE_ptr(n_output, 0);
46836        cur = gen_xmlXPathObjectPtr(n_cur, 1);
46837        depth = gen_int(n_depth, 2);
46838
46839        xmlXPathDebugDumpObject(output, cur, depth);
46840        call_tests++;
46841        des_FILE_ptr(n_output, output, 0);
46842        des_xmlXPathObjectPtr(n_cur, cur, 1);
46843        des_int(n_depth, depth, 2);
46844        xmlResetLastError();
46845        if (mem_base != xmlMemBlocks()) {
46846            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
46847	           xmlMemBlocks() - mem_base);
46848	    test_ret++;
46849            printf(" %d", n_output);
46850            printf(" %d", n_cur);
46851            printf(" %d", n_depth);
46852            printf("\n");
46853        }
46854    }
46855    }
46856    }
46857    function_tests++;
46858#endif
46859
46860    return(test_ret);
46861}
46862
46863
46864static int
46865test_xmlXPathDifference(void) {
46866    int test_ret = 0;
46867
46868#if defined(LIBXML_XPATH_ENABLED)
46869    int mem_base;
46870    xmlNodeSetPtr ret_val;
46871    xmlNodeSetPtr nodes1; /* a node-set */
46872    int n_nodes1;
46873    xmlNodeSetPtr nodes2; /* a node-set */
46874    int n_nodes2;
46875
46876    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46877    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46878        mem_base = xmlMemBlocks();
46879        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46880        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46881
46882        ret_val = xmlXPathDifference(nodes1, nodes2);
46883        desret_xmlNodeSetPtr(ret_val);
46884        call_tests++;
46885        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46886        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46887        xmlResetLastError();
46888        if (mem_base != xmlMemBlocks()) {
46889            printf("Leak of %d blocks found in xmlXPathDifference",
46890	           xmlMemBlocks() - mem_base);
46891	    test_ret++;
46892            printf(" %d", n_nodes1);
46893            printf(" %d", n_nodes2);
46894            printf("\n");
46895        }
46896    }
46897    }
46898    function_tests++;
46899#endif
46900
46901    return(test_ret);
46902}
46903
46904
46905static int
46906test_xmlXPathDistinct(void) {
46907    int test_ret = 0;
46908
46909#if defined(LIBXML_XPATH_ENABLED)
46910    int mem_base;
46911    xmlNodeSetPtr ret_val;
46912    xmlNodeSetPtr nodes; /* a node-set */
46913    int n_nodes;
46914
46915    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46916        mem_base = xmlMemBlocks();
46917        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46918
46919        ret_val = xmlXPathDistinct(nodes);
46920        desret_xmlNodeSetPtr(ret_val);
46921        call_tests++;
46922        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46923        xmlResetLastError();
46924        if (mem_base != xmlMemBlocks()) {
46925            printf("Leak of %d blocks found in xmlXPathDistinct",
46926	           xmlMemBlocks() - mem_base);
46927	    test_ret++;
46928            printf(" %d", n_nodes);
46929            printf("\n");
46930        }
46931    }
46932    function_tests++;
46933#endif
46934
46935    return(test_ret);
46936}
46937
46938
46939static int
46940test_xmlXPathDistinctSorted(void) {
46941    int test_ret = 0;
46942
46943#if defined(LIBXML_XPATH_ENABLED)
46944    int mem_base;
46945    xmlNodeSetPtr ret_val;
46946    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46947    int n_nodes;
46948
46949    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46950        mem_base = xmlMemBlocks();
46951        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46952
46953        ret_val = xmlXPathDistinctSorted(nodes);
46954        desret_xmlNodeSetPtr(ret_val);
46955        call_tests++;
46956        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46957        xmlResetLastError();
46958        if (mem_base != xmlMemBlocks()) {
46959            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
46960	           xmlMemBlocks() - mem_base);
46961	    test_ret++;
46962            printf(" %d", n_nodes);
46963            printf("\n");
46964        }
46965    }
46966    function_tests++;
46967#endif
46968
46969    return(test_ret);
46970}
46971
46972
46973static int
46974test_xmlXPathDivValues(void) {
46975    int test_ret = 0;
46976
46977#if defined(LIBXML_XPATH_ENABLED)
46978    int mem_base;
46979    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46980    int n_ctxt;
46981
46982    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46983        mem_base = xmlMemBlocks();
46984        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46985
46986        xmlXPathDivValues(ctxt);
46987        call_tests++;
46988        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46989        xmlResetLastError();
46990        if (mem_base != xmlMemBlocks()) {
46991            printf("Leak of %d blocks found in xmlXPathDivValues",
46992	           xmlMemBlocks() - mem_base);
46993	    test_ret++;
46994            printf(" %d", n_ctxt);
46995            printf("\n");
46996        }
46997    }
46998    function_tests++;
46999#endif
47000
47001    return(test_ret);
47002}
47003
47004
47005static int
47006test_xmlXPathEqualValues(void) {
47007    int test_ret = 0;
47008
47009#if defined(LIBXML_XPATH_ENABLED)
47010    int mem_base;
47011    int ret_val;
47012    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47013    int n_ctxt;
47014
47015    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47016        mem_base = xmlMemBlocks();
47017        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47018
47019        ret_val = xmlXPathEqualValues(ctxt);
47020        desret_int(ret_val);
47021        call_tests++;
47022        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47023        xmlResetLastError();
47024        if (mem_base != xmlMemBlocks()) {
47025            printf("Leak of %d blocks found in xmlXPathEqualValues",
47026	           xmlMemBlocks() - mem_base);
47027	    test_ret++;
47028            printf(" %d", n_ctxt);
47029            printf("\n");
47030        }
47031    }
47032    function_tests++;
47033#endif
47034
47035    return(test_ret);
47036}
47037
47038
47039static int
47040test_xmlXPathErr(void) {
47041    int test_ret = 0;
47042
47043#if defined(LIBXML_XPATH_ENABLED)
47044    int mem_base;
47045    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47046    int n_ctxt;
47047    int error; /* the error code */
47048    int n_error;
47049
47050    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47051    for (n_error = 0;n_error < gen_nb_int;n_error++) {
47052        mem_base = xmlMemBlocks();
47053        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47054        error = gen_int(n_error, 1);
47055
47056        xmlXPathErr(ctxt, error);
47057        call_tests++;
47058        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47059        des_int(n_error, error, 1);
47060        xmlResetLastError();
47061        if (mem_base != xmlMemBlocks()) {
47062            printf("Leak of %d blocks found in xmlXPathErr",
47063	           xmlMemBlocks() - mem_base);
47064	    test_ret++;
47065            printf(" %d", n_ctxt);
47066            printf(" %d", n_error);
47067            printf("\n");
47068        }
47069    }
47070    }
47071    function_tests++;
47072#endif
47073
47074    return(test_ret);
47075}
47076
47077
47078static int
47079test_xmlXPathEvalExpr(void) {
47080    int test_ret = 0;
47081
47082#if defined(LIBXML_XPATH_ENABLED)
47083    int mem_base;
47084    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47085    int n_ctxt;
47086
47087    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47088        mem_base = xmlMemBlocks();
47089        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47090
47091        xmlXPathEvalExpr(ctxt);
47092        call_tests++;
47093        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47094        xmlResetLastError();
47095        if (mem_base != xmlMemBlocks()) {
47096            printf("Leak of %d blocks found in xmlXPathEvalExpr",
47097	           xmlMemBlocks() - mem_base);
47098	    test_ret++;
47099            printf(" %d", n_ctxt);
47100            printf("\n");
47101        }
47102    }
47103    function_tests++;
47104#endif
47105
47106    return(test_ret);
47107}
47108
47109
47110static int
47111test_xmlXPathEvaluatePredicateResult(void) {
47112    int test_ret = 0;
47113
47114#if defined(LIBXML_XPATH_ENABLED)
47115    int mem_base;
47116    int ret_val;
47117    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47118    int n_ctxt;
47119    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47120    int n_res;
47121
47122    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47123    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47124        mem_base = xmlMemBlocks();
47125        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47126        res = gen_xmlXPathObjectPtr(n_res, 1);
47127
47128        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47129        desret_int(ret_val);
47130        call_tests++;
47131        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47132        des_xmlXPathObjectPtr(n_res, res, 1);
47133        xmlResetLastError();
47134        if (mem_base != xmlMemBlocks()) {
47135            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47136	           xmlMemBlocks() - mem_base);
47137	    test_ret++;
47138            printf(" %d", n_ctxt);
47139            printf(" %d", n_res);
47140            printf("\n");
47141        }
47142    }
47143    }
47144    function_tests++;
47145#endif
47146
47147    return(test_ret);
47148}
47149
47150
47151static int
47152test_xmlXPathFalseFunction(void) {
47153    int test_ret = 0;
47154
47155#if defined(LIBXML_XPATH_ENABLED)
47156    int mem_base;
47157    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47158    int n_ctxt;
47159    int nargs; /* the number of arguments */
47160    int n_nargs;
47161
47162    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47163    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47164        mem_base = xmlMemBlocks();
47165        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47166        nargs = gen_int(n_nargs, 1);
47167
47168        xmlXPathFalseFunction(ctxt, nargs);
47169        call_tests++;
47170        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47171        des_int(n_nargs, nargs, 1);
47172        xmlResetLastError();
47173        if (mem_base != xmlMemBlocks()) {
47174            printf("Leak of %d blocks found in xmlXPathFalseFunction",
47175	           xmlMemBlocks() - mem_base);
47176	    test_ret++;
47177            printf(" %d", n_ctxt);
47178            printf(" %d", n_nargs);
47179            printf("\n");
47180        }
47181    }
47182    }
47183    function_tests++;
47184#endif
47185
47186    return(test_ret);
47187}
47188
47189
47190static int
47191test_xmlXPathFloorFunction(void) {
47192    int test_ret = 0;
47193
47194#if defined(LIBXML_XPATH_ENABLED)
47195    int mem_base;
47196    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47197    int n_ctxt;
47198    int nargs; /* the number of arguments */
47199    int n_nargs;
47200
47201    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47202    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47203        mem_base = xmlMemBlocks();
47204        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47205        nargs = gen_int(n_nargs, 1);
47206
47207        xmlXPathFloorFunction(ctxt, nargs);
47208        call_tests++;
47209        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47210        des_int(n_nargs, nargs, 1);
47211        xmlResetLastError();
47212        if (mem_base != xmlMemBlocks()) {
47213            printf("Leak of %d blocks found in xmlXPathFloorFunction",
47214	           xmlMemBlocks() - mem_base);
47215	    test_ret++;
47216            printf(" %d", n_ctxt);
47217            printf(" %d", n_nargs);
47218            printf("\n");
47219        }
47220    }
47221    }
47222    function_tests++;
47223#endif
47224
47225    return(test_ret);
47226}
47227
47228
47229static int
47230test_xmlXPathFunctionLookup(void) {
47231    int test_ret = 0;
47232
47233
47234    /* missing type support */
47235    return(test_ret);
47236}
47237
47238
47239static int
47240test_xmlXPathFunctionLookupNS(void) {
47241    int test_ret = 0;
47242
47243
47244    /* missing type support */
47245    return(test_ret);
47246}
47247
47248
47249static int
47250test_xmlXPathHasSameNodes(void) {
47251    int test_ret = 0;
47252
47253#if defined(LIBXML_XPATH_ENABLED)
47254    int mem_base;
47255    int ret_val;
47256    xmlNodeSetPtr nodes1; /* a node-set */
47257    int n_nodes1;
47258    xmlNodeSetPtr nodes2; /* a node-set */
47259    int n_nodes2;
47260
47261    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47262    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47263        mem_base = xmlMemBlocks();
47264        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47265        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47266
47267        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47268        desret_int(ret_val);
47269        call_tests++;
47270        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47271        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47272        xmlResetLastError();
47273        if (mem_base != xmlMemBlocks()) {
47274            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47275	           xmlMemBlocks() - mem_base);
47276	    test_ret++;
47277            printf(" %d", n_nodes1);
47278            printf(" %d", n_nodes2);
47279            printf("\n");
47280        }
47281    }
47282    }
47283    function_tests++;
47284#endif
47285
47286    return(test_ret);
47287}
47288
47289
47290static int
47291test_xmlXPathIdFunction(void) {
47292    int test_ret = 0;
47293
47294#if defined(LIBXML_XPATH_ENABLED)
47295    int mem_base;
47296    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47297    int n_ctxt;
47298    int nargs; /* the number of arguments */
47299    int n_nargs;
47300
47301    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47302    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47303        mem_base = xmlMemBlocks();
47304        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47305        nargs = gen_int(n_nargs, 1);
47306
47307        xmlXPathIdFunction(ctxt, nargs);
47308        call_tests++;
47309        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47310        des_int(n_nargs, nargs, 1);
47311        xmlResetLastError();
47312        if (mem_base != xmlMemBlocks()) {
47313            printf("Leak of %d blocks found in xmlXPathIdFunction",
47314	           xmlMemBlocks() - mem_base);
47315	    test_ret++;
47316            printf(" %d", n_ctxt);
47317            printf(" %d", n_nargs);
47318            printf("\n");
47319        }
47320    }
47321    }
47322    function_tests++;
47323#endif
47324
47325    return(test_ret);
47326}
47327
47328
47329static int
47330test_xmlXPathIntersection(void) {
47331    int test_ret = 0;
47332
47333#if defined(LIBXML_XPATH_ENABLED)
47334    int mem_base;
47335    xmlNodeSetPtr ret_val;
47336    xmlNodeSetPtr nodes1; /* a node-set */
47337    int n_nodes1;
47338    xmlNodeSetPtr nodes2; /* a node-set */
47339    int n_nodes2;
47340
47341    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47342    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47343        mem_base = xmlMemBlocks();
47344        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47345        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47346
47347        ret_val = xmlXPathIntersection(nodes1, nodes2);
47348        desret_xmlNodeSetPtr(ret_val);
47349        call_tests++;
47350        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47351        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47352        xmlResetLastError();
47353        if (mem_base != xmlMemBlocks()) {
47354            printf("Leak of %d blocks found in xmlXPathIntersection",
47355	           xmlMemBlocks() - mem_base);
47356	    test_ret++;
47357            printf(" %d", n_nodes1);
47358            printf(" %d", n_nodes2);
47359            printf("\n");
47360        }
47361    }
47362    }
47363    function_tests++;
47364#endif
47365
47366    return(test_ret);
47367}
47368
47369
47370static int
47371test_xmlXPathIsNodeType(void) {
47372    int test_ret = 0;
47373
47374#if defined(LIBXML_XPATH_ENABLED)
47375    int mem_base;
47376    int ret_val;
47377    xmlChar * name; /* a name string */
47378    int n_name;
47379
47380    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47381        mem_base = xmlMemBlocks();
47382        name = gen_const_xmlChar_ptr(n_name, 0);
47383
47384        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47385        desret_int(ret_val);
47386        call_tests++;
47387        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47388        xmlResetLastError();
47389        if (mem_base != xmlMemBlocks()) {
47390            printf("Leak of %d blocks found in xmlXPathIsNodeType",
47391	           xmlMemBlocks() - mem_base);
47392	    test_ret++;
47393            printf(" %d", n_name);
47394            printf("\n");
47395        }
47396    }
47397    function_tests++;
47398#endif
47399
47400    return(test_ret);
47401}
47402
47403
47404static int
47405test_xmlXPathLangFunction(void) {
47406    int test_ret = 0;
47407
47408#if defined(LIBXML_XPATH_ENABLED)
47409    int mem_base;
47410    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47411    int n_ctxt;
47412    int nargs; /* the number of arguments */
47413    int n_nargs;
47414
47415    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47416    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47417        mem_base = xmlMemBlocks();
47418        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47419        nargs = gen_int(n_nargs, 1);
47420
47421        xmlXPathLangFunction(ctxt, nargs);
47422        call_tests++;
47423        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47424        des_int(n_nargs, nargs, 1);
47425        xmlResetLastError();
47426        if (mem_base != xmlMemBlocks()) {
47427            printf("Leak of %d blocks found in xmlXPathLangFunction",
47428	           xmlMemBlocks() - mem_base);
47429	    test_ret++;
47430            printf(" %d", n_ctxt);
47431            printf(" %d", n_nargs);
47432            printf("\n");
47433        }
47434    }
47435    }
47436    function_tests++;
47437#endif
47438
47439    return(test_ret);
47440}
47441
47442
47443static int
47444test_xmlXPathLastFunction(void) {
47445    int test_ret = 0;
47446
47447#if defined(LIBXML_XPATH_ENABLED)
47448    int mem_base;
47449    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47450    int n_ctxt;
47451    int nargs; /* the number of arguments */
47452    int n_nargs;
47453
47454    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47455    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47456        mem_base = xmlMemBlocks();
47457        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47458        nargs = gen_int(n_nargs, 1);
47459
47460        xmlXPathLastFunction(ctxt, nargs);
47461        call_tests++;
47462        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47463        des_int(n_nargs, nargs, 1);
47464        xmlResetLastError();
47465        if (mem_base != xmlMemBlocks()) {
47466            printf("Leak of %d blocks found in xmlXPathLastFunction",
47467	           xmlMemBlocks() - mem_base);
47468	    test_ret++;
47469            printf(" %d", n_ctxt);
47470            printf(" %d", n_nargs);
47471            printf("\n");
47472        }
47473    }
47474    }
47475    function_tests++;
47476#endif
47477
47478    return(test_ret);
47479}
47480
47481
47482static int
47483test_xmlXPathLeading(void) {
47484    int test_ret = 0;
47485
47486#if defined(LIBXML_XPATH_ENABLED)
47487    int mem_base;
47488    xmlNodeSetPtr ret_val;
47489    xmlNodeSetPtr nodes1; /* a node-set */
47490    int n_nodes1;
47491    xmlNodeSetPtr nodes2; /* a node-set */
47492    int n_nodes2;
47493
47494    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47495    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47496        mem_base = xmlMemBlocks();
47497        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47498        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47499
47500        ret_val = xmlXPathLeading(nodes1, nodes2);
47501        desret_xmlNodeSetPtr(ret_val);
47502        call_tests++;
47503        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47504        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47505        xmlResetLastError();
47506        if (mem_base != xmlMemBlocks()) {
47507            printf("Leak of %d blocks found in xmlXPathLeading",
47508	           xmlMemBlocks() - mem_base);
47509	    test_ret++;
47510            printf(" %d", n_nodes1);
47511            printf(" %d", n_nodes2);
47512            printf("\n");
47513        }
47514    }
47515    }
47516    function_tests++;
47517#endif
47518
47519    return(test_ret);
47520}
47521
47522
47523static int
47524test_xmlXPathLeadingSorted(void) {
47525    int test_ret = 0;
47526
47527#if defined(LIBXML_XPATH_ENABLED)
47528    int mem_base;
47529    xmlNodeSetPtr ret_val;
47530    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47531    int n_nodes1;
47532    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47533    int n_nodes2;
47534
47535    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47536    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47537        mem_base = xmlMemBlocks();
47538        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47539        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47540
47541        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47542        desret_xmlNodeSetPtr(ret_val);
47543        call_tests++;
47544        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47545        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47546        xmlResetLastError();
47547        if (mem_base != xmlMemBlocks()) {
47548            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47549	           xmlMemBlocks() - mem_base);
47550	    test_ret++;
47551            printf(" %d", n_nodes1);
47552            printf(" %d", n_nodes2);
47553            printf("\n");
47554        }
47555    }
47556    }
47557    function_tests++;
47558#endif
47559
47560    return(test_ret);
47561}
47562
47563
47564static int
47565test_xmlXPathLocalNameFunction(void) {
47566    int test_ret = 0;
47567
47568#if defined(LIBXML_XPATH_ENABLED)
47569    int mem_base;
47570    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47571    int n_ctxt;
47572    int nargs; /* the number of arguments */
47573    int n_nargs;
47574
47575    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47576    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47577        mem_base = xmlMemBlocks();
47578        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47579        nargs = gen_int(n_nargs, 1);
47580
47581        xmlXPathLocalNameFunction(ctxt, nargs);
47582        call_tests++;
47583        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47584        des_int(n_nargs, nargs, 1);
47585        xmlResetLastError();
47586        if (mem_base != xmlMemBlocks()) {
47587            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47588	           xmlMemBlocks() - mem_base);
47589	    test_ret++;
47590            printf(" %d", n_ctxt);
47591            printf(" %d", n_nargs);
47592            printf("\n");
47593        }
47594    }
47595    }
47596    function_tests++;
47597#endif
47598
47599    return(test_ret);
47600}
47601
47602
47603static int
47604test_xmlXPathModValues(void) {
47605    int test_ret = 0;
47606
47607#if defined(LIBXML_XPATH_ENABLED)
47608    int mem_base;
47609    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47610    int n_ctxt;
47611
47612    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47613        mem_base = xmlMemBlocks();
47614        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47615
47616        xmlXPathModValues(ctxt);
47617        call_tests++;
47618        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47619        xmlResetLastError();
47620        if (mem_base != xmlMemBlocks()) {
47621            printf("Leak of %d blocks found in xmlXPathModValues",
47622	           xmlMemBlocks() - mem_base);
47623	    test_ret++;
47624            printf(" %d", n_ctxt);
47625            printf("\n");
47626        }
47627    }
47628    function_tests++;
47629#endif
47630
47631    return(test_ret);
47632}
47633
47634
47635static int
47636test_xmlXPathMultValues(void) {
47637    int test_ret = 0;
47638
47639#if defined(LIBXML_XPATH_ENABLED)
47640    int mem_base;
47641    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47642    int n_ctxt;
47643
47644    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47645        mem_base = xmlMemBlocks();
47646        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47647
47648        xmlXPathMultValues(ctxt);
47649        call_tests++;
47650        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47651        xmlResetLastError();
47652        if (mem_base != xmlMemBlocks()) {
47653            printf("Leak of %d blocks found in xmlXPathMultValues",
47654	           xmlMemBlocks() - mem_base);
47655	    test_ret++;
47656            printf(" %d", n_ctxt);
47657            printf("\n");
47658        }
47659    }
47660    function_tests++;
47661#endif
47662
47663    return(test_ret);
47664}
47665
47666
47667static int
47668test_xmlXPathNamespaceURIFunction(void) {
47669    int test_ret = 0;
47670
47671#if defined(LIBXML_XPATH_ENABLED)
47672    int mem_base;
47673    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47674    int n_ctxt;
47675    int nargs; /* the number of arguments */
47676    int n_nargs;
47677
47678    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47679    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47680        mem_base = xmlMemBlocks();
47681        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47682        nargs = gen_int(n_nargs, 1);
47683
47684        xmlXPathNamespaceURIFunction(ctxt, nargs);
47685        call_tests++;
47686        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47687        des_int(n_nargs, nargs, 1);
47688        xmlResetLastError();
47689        if (mem_base != xmlMemBlocks()) {
47690            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47691	           xmlMemBlocks() - mem_base);
47692	    test_ret++;
47693            printf(" %d", n_ctxt);
47694            printf(" %d", n_nargs);
47695            printf("\n");
47696        }
47697    }
47698    }
47699    function_tests++;
47700#endif
47701
47702    return(test_ret);
47703}
47704
47705
47706static int
47707test_xmlXPathNewBoolean(void) {
47708    int test_ret = 0;
47709
47710#if defined(LIBXML_XPATH_ENABLED)
47711    int mem_base;
47712    xmlXPathObjectPtr ret_val;
47713    int val; /* the boolean value */
47714    int n_val;
47715
47716    for (n_val = 0;n_val < gen_nb_int;n_val++) {
47717        mem_base = xmlMemBlocks();
47718        val = gen_int(n_val, 0);
47719
47720        ret_val = xmlXPathNewBoolean(val);
47721        desret_xmlXPathObjectPtr(ret_val);
47722        call_tests++;
47723        des_int(n_val, val, 0);
47724        xmlResetLastError();
47725        if (mem_base != xmlMemBlocks()) {
47726            printf("Leak of %d blocks found in xmlXPathNewBoolean",
47727	           xmlMemBlocks() - mem_base);
47728	    test_ret++;
47729            printf(" %d", n_val);
47730            printf("\n");
47731        }
47732    }
47733    function_tests++;
47734#endif
47735
47736    return(test_ret);
47737}
47738
47739
47740static int
47741test_xmlXPathNewCString(void) {
47742    int test_ret = 0;
47743
47744#if defined(LIBXML_XPATH_ENABLED)
47745    int mem_base;
47746    xmlXPathObjectPtr ret_val;
47747    char * val; /* the char * value */
47748    int n_val;
47749
47750    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47751        mem_base = xmlMemBlocks();
47752        val = gen_const_char_ptr(n_val, 0);
47753
47754        ret_val = xmlXPathNewCString((const char *)val);
47755        desret_xmlXPathObjectPtr(ret_val);
47756        call_tests++;
47757        des_const_char_ptr(n_val, (const char *)val, 0);
47758        xmlResetLastError();
47759        if (mem_base != xmlMemBlocks()) {
47760            printf("Leak of %d blocks found in xmlXPathNewCString",
47761	           xmlMemBlocks() - mem_base);
47762	    test_ret++;
47763            printf(" %d", n_val);
47764            printf("\n");
47765        }
47766    }
47767    function_tests++;
47768#endif
47769
47770    return(test_ret);
47771}
47772
47773
47774static int
47775test_xmlXPathNewFloat(void) {
47776    int test_ret = 0;
47777
47778#if defined(LIBXML_XPATH_ENABLED)
47779    int mem_base;
47780    xmlXPathObjectPtr ret_val;
47781    double val; /* the double value */
47782    int n_val;
47783
47784    for (n_val = 0;n_val < gen_nb_double;n_val++) {
47785        mem_base = xmlMemBlocks();
47786        val = gen_double(n_val, 0);
47787
47788        ret_val = xmlXPathNewFloat(val);
47789        desret_xmlXPathObjectPtr(ret_val);
47790        call_tests++;
47791        des_double(n_val, val, 0);
47792        xmlResetLastError();
47793        if (mem_base != xmlMemBlocks()) {
47794            printf("Leak of %d blocks found in xmlXPathNewFloat",
47795	           xmlMemBlocks() - mem_base);
47796	    test_ret++;
47797            printf(" %d", n_val);
47798            printf("\n");
47799        }
47800    }
47801    function_tests++;
47802#endif
47803
47804    return(test_ret);
47805}
47806
47807
47808static int
47809test_xmlXPathNewNodeSet(void) {
47810    int test_ret = 0;
47811
47812#if defined(LIBXML_XPATH_ENABLED)
47813    int mem_base;
47814    xmlXPathObjectPtr ret_val;
47815    xmlNodePtr val; /* the NodePtr value */
47816    int n_val;
47817
47818    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47819        mem_base = xmlMemBlocks();
47820        val = gen_xmlNodePtr(n_val, 0);
47821
47822        ret_val = xmlXPathNewNodeSet(val);
47823        desret_xmlXPathObjectPtr(ret_val);
47824        call_tests++;
47825        des_xmlNodePtr(n_val, val, 0);
47826        xmlResetLastError();
47827        if (mem_base != xmlMemBlocks()) {
47828            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47829	           xmlMemBlocks() - mem_base);
47830	    test_ret++;
47831            printf(" %d", n_val);
47832            printf("\n");
47833        }
47834    }
47835    function_tests++;
47836#endif
47837
47838    return(test_ret);
47839}
47840
47841
47842static int
47843test_xmlXPathNewNodeSetList(void) {
47844    int test_ret = 0;
47845
47846#if defined(LIBXML_XPATH_ENABLED)
47847    int mem_base;
47848    xmlXPathObjectPtr ret_val;
47849    xmlNodeSetPtr val; /* an existing NodeSet */
47850    int n_val;
47851
47852    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
47853        mem_base = xmlMemBlocks();
47854        val = gen_xmlNodeSetPtr(n_val, 0);
47855
47856        ret_val = xmlXPathNewNodeSetList(val);
47857        desret_xmlXPathObjectPtr(ret_val);
47858        call_tests++;
47859        des_xmlNodeSetPtr(n_val, val, 0);
47860        xmlResetLastError();
47861        if (mem_base != xmlMemBlocks()) {
47862            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
47863	           xmlMemBlocks() - mem_base);
47864	    test_ret++;
47865            printf(" %d", n_val);
47866            printf("\n");
47867        }
47868    }
47869    function_tests++;
47870#endif
47871
47872    return(test_ret);
47873}
47874
47875
47876static int
47877test_xmlXPathNewParserContext(void) {
47878    int test_ret = 0;
47879
47880
47881    /* missing type support */
47882    return(test_ret);
47883}
47884
47885
47886static int
47887test_xmlXPathNewString(void) {
47888    int test_ret = 0;
47889
47890#if defined(LIBXML_XPATH_ENABLED)
47891    int mem_base;
47892    xmlXPathObjectPtr ret_val;
47893    xmlChar * val; /* the xmlChar * value */
47894    int n_val;
47895
47896    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47897        mem_base = xmlMemBlocks();
47898        val = gen_const_xmlChar_ptr(n_val, 0);
47899
47900        ret_val = xmlXPathNewString((const xmlChar *)val);
47901        desret_xmlXPathObjectPtr(ret_val);
47902        call_tests++;
47903        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47904        xmlResetLastError();
47905        if (mem_base != xmlMemBlocks()) {
47906            printf("Leak of %d blocks found in xmlXPathNewString",
47907	           xmlMemBlocks() - mem_base);
47908	    test_ret++;
47909            printf(" %d", n_val);
47910            printf("\n");
47911        }
47912    }
47913    function_tests++;
47914#endif
47915
47916    return(test_ret);
47917}
47918
47919
47920static int
47921test_xmlXPathNextAncestor(void) {
47922    int test_ret = 0;
47923
47924#if defined(LIBXML_XPATH_ENABLED)
47925    int mem_base;
47926    xmlNodePtr ret_val;
47927    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47928    int n_ctxt;
47929    xmlNodePtr cur; /* the current node in the traversal */
47930    int n_cur;
47931
47932    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47933    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47934        mem_base = xmlMemBlocks();
47935        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47936        cur = gen_xmlNodePtr(n_cur, 1);
47937
47938        ret_val = xmlXPathNextAncestor(ctxt, cur);
47939        desret_xmlNodePtr(ret_val);
47940        call_tests++;
47941        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47942        des_xmlNodePtr(n_cur, cur, 1);
47943        xmlResetLastError();
47944        if (mem_base != xmlMemBlocks()) {
47945            printf("Leak of %d blocks found in xmlXPathNextAncestor",
47946	           xmlMemBlocks() - mem_base);
47947	    test_ret++;
47948            printf(" %d", n_ctxt);
47949            printf(" %d", n_cur);
47950            printf("\n");
47951        }
47952    }
47953    }
47954    function_tests++;
47955#endif
47956
47957    return(test_ret);
47958}
47959
47960
47961static int
47962test_xmlXPathNextAncestorOrSelf(void) {
47963    int test_ret = 0;
47964
47965#if defined(LIBXML_XPATH_ENABLED)
47966    int mem_base;
47967    xmlNodePtr ret_val;
47968    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47969    int n_ctxt;
47970    xmlNodePtr cur; /* the current node in the traversal */
47971    int n_cur;
47972
47973    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47974    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47975        mem_base = xmlMemBlocks();
47976        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47977        cur = gen_xmlNodePtr(n_cur, 1);
47978
47979        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
47980        desret_xmlNodePtr(ret_val);
47981        call_tests++;
47982        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47983        des_xmlNodePtr(n_cur, cur, 1);
47984        xmlResetLastError();
47985        if (mem_base != xmlMemBlocks()) {
47986            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
47987	           xmlMemBlocks() - mem_base);
47988	    test_ret++;
47989            printf(" %d", n_ctxt);
47990            printf(" %d", n_cur);
47991            printf("\n");
47992        }
47993    }
47994    }
47995    function_tests++;
47996#endif
47997
47998    return(test_ret);
47999}
48000
48001
48002static int
48003test_xmlXPathNextAttribute(void) {
48004    int test_ret = 0;
48005
48006#if defined(LIBXML_XPATH_ENABLED)
48007    int mem_base;
48008    xmlNodePtr ret_val;
48009    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48010    int n_ctxt;
48011    xmlNodePtr cur; /* the current attribute in the traversal */
48012    int n_cur;
48013
48014    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48015    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48016        mem_base = xmlMemBlocks();
48017        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48018        cur = gen_xmlNodePtr(n_cur, 1);
48019
48020        ret_val = xmlXPathNextAttribute(ctxt, cur);
48021        desret_xmlNodePtr(ret_val);
48022        call_tests++;
48023        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48024        des_xmlNodePtr(n_cur, cur, 1);
48025        xmlResetLastError();
48026        if (mem_base != xmlMemBlocks()) {
48027            printf("Leak of %d blocks found in xmlXPathNextAttribute",
48028	           xmlMemBlocks() - mem_base);
48029	    test_ret++;
48030            printf(" %d", n_ctxt);
48031            printf(" %d", n_cur);
48032            printf("\n");
48033        }
48034    }
48035    }
48036    function_tests++;
48037#endif
48038
48039    return(test_ret);
48040}
48041
48042
48043static int
48044test_xmlXPathNextChild(void) {
48045    int test_ret = 0;
48046
48047#if defined(LIBXML_XPATH_ENABLED)
48048    int mem_base;
48049    xmlNodePtr ret_val;
48050    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48051    int n_ctxt;
48052    xmlNodePtr cur; /* the current node in the traversal */
48053    int n_cur;
48054
48055    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48056    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48057        mem_base = xmlMemBlocks();
48058        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48059        cur = gen_xmlNodePtr(n_cur, 1);
48060
48061        ret_val = xmlXPathNextChild(ctxt, cur);
48062        desret_xmlNodePtr(ret_val);
48063        call_tests++;
48064        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48065        des_xmlNodePtr(n_cur, cur, 1);
48066        xmlResetLastError();
48067        if (mem_base != xmlMemBlocks()) {
48068            printf("Leak of %d blocks found in xmlXPathNextChild",
48069	           xmlMemBlocks() - mem_base);
48070	    test_ret++;
48071            printf(" %d", n_ctxt);
48072            printf(" %d", n_cur);
48073            printf("\n");
48074        }
48075    }
48076    }
48077    function_tests++;
48078#endif
48079
48080    return(test_ret);
48081}
48082
48083
48084static int
48085test_xmlXPathNextDescendant(void) {
48086    int test_ret = 0;
48087
48088#if defined(LIBXML_XPATH_ENABLED)
48089    int mem_base;
48090    xmlNodePtr ret_val;
48091    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48092    int n_ctxt;
48093    xmlNodePtr cur; /* the current node in the traversal */
48094    int n_cur;
48095
48096    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48097    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48098        mem_base = xmlMemBlocks();
48099        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48100        cur = gen_xmlNodePtr(n_cur, 1);
48101
48102        ret_val = xmlXPathNextDescendant(ctxt, cur);
48103        desret_xmlNodePtr(ret_val);
48104        call_tests++;
48105        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48106        des_xmlNodePtr(n_cur, cur, 1);
48107        xmlResetLastError();
48108        if (mem_base != xmlMemBlocks()) {
48109            printf("Leak of %d blocks found in xmlXPathNextDescendant",
48110	           xmlMemBlocks() - mem_base);
48111	    test_ret++;
48112            printf(" %d", n_ctxt);
48113            printf(" %d", n_cur);
48114            printf("\n");
48115        }
48116    }
48117    }
48118    function_tests++;
48119#endif
48120
48121    return(test_ret);
48122}
48123
48124
48125static int
48126test_xmlXPathNextDescendantOrSelf(void) {
48127    int test_ret = 0;
48128
48129#if defined(LIBXML_XPATH_ENABLED)
48130    int mem_base;
48131    xmlNodePtr ret_val;
48132    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48133    int n_ctxt;
48134    xmlNodePtr cur; /* the current node in the traversal */
48135    int n_cur;
48136
48137    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48138    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48139        mem_base = xmlMemBlocks();
48140        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48141        cur = gen_xmlNodePtr(n_cur, 1);
48142
48143        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48144        desret_xmlNodePtr(ret_val);
48145        call_tests++;
48146        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48147        des_xmlNodePtr(n_cur, cur, 1);
48148        xmlResetLastError();
48149        if (mem_base != xmlMemBlocks()) {
48150            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48151	           xmlMemBlocks() - mem_base);
48152	    test_ret++;
48153            printf(" %d", n_ctxt);
48154            printf(" %d", n_cur);
48155            printf("\n");
48156        }
48157    }
48158    }
48159    function_tests++;
48160#endif
48161
48162    return(test_ret);
48163}
48164
48165
48166static int
48167test_xmlXPathNextFollowing(void) {
48168    int test_ret = 0;
48169
48170#if defined(LIBXML_XPATH_ENABLED)
48171    int mem_base;
48172    xmlNodePtr ret_val;
48173    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48174    int n_ctxt;
48175    xmlNodePtr cur; /* the current node in the traversal */
48176    int n_cur;
48177
48178    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48179    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48180        mem_base = xmlMemBlocks();
48181        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48182        cur = gen_xmlNodePtr(n_cur, 1);
48183
48184        ret_val = xmlXPathNextFollowing(ctxt, cur);
48185        desret_xmlNodePtr(ret_val);
48186        call_tests++;
48187        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48188        des_xmlNodePtr(n_cur, cur, 1);
48189        xmlResetLastError();
48190        if (mem_base != xmlMemBlocks()) {
48191            printf("Leak of %d blocks found in xmlXPathNextFollowing",
48192	           xmlMemBlocks() - mem_base);
48193	    test_ret++;
48194            printf(" %d", n_ctxt);
48195            printf(" %d", n_cur);
48196            printf("\n");
48197        }
48198    }
48199    }
48200    function_tests++;
48201#endif
48202
48203    return(test_ret);
48204}
48205
48206
48207static int
48208test_xmlXPathNextFollowingSibling(void) {
48209    int test_ret = 0;
48210
48211#if defined(LIBXML_XPATH_ENABLED)
48212    int mem_base;
48213    xmlNodePtr ret_val;
48214    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48215    int n_ctxt;
48216    xmlNodePtr cur; /* the current node in the traversal */
48217    int n_cur;
48218
48219    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48220    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48221        mem_base = xmlMemBlocks();
48222        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48223        cur = gen_xmlNodePtr(n_cur, 1);
48224
48225        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48226        desret_xmlNodePtr(ret_val);
48227        call_tests++;
48228        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48229        des_xmlNodePtr(n_cur, cur, 1);
48230        xmlResetLastError();
48231        if (mem_base != xmlMemBlocks()) {
48232            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48233	           xmlMemBlocks() - mem_base);
48234	    test_ret++;
48235            printf(" %d", n_ctxt);
48236            printf(" %d", n_cur);
48237            printf("\n");
48238        }
48239    }
48240    }
48241    function_tests++;
48242#endif
48243
48244    return(test_ret);
48245}
48246
48247
48248static int
48249test_xmlXPathNextNamespace(void) {
48250    int test_ret = 0;
48251
48252#if defined(LIBXML_XPATH_ENABLED)
48253    int mem_base;
48254    xmlNodePtr ret_val;
48255    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48256    int n_ctxt;
48257    xmlNodePtr cur; /* the current attribute in the traversal */
48258    int n_cur;
48259
48260    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48261    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48262        mem_base = xmlMemBlocks();
48263        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48264        cur = gen_xmlNodePtr(n_cur, 1);
48265
48266        ret_val = xmlXPathNextNamespace(ctxt, cur);
48267        desret_xmlNodePtr(ret_val);
48268        call_tests++;
48269        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48270        des_xmlNodePtr(n_cur, cur, 1);
48271        xmlResetLastError();
48272        if (mem_base != xmlMemBlocks()) {
48273            printf("Leak of %d blocks found in xmlXPathNextNamespace",
48274	           xmlMemBlocks() - mem_base);
48275	    test_ret++;
48276            printf(" %d", n_ctxt);
48277            printf(" %d", n_cur);
48278            printf("\n");
48279        }
48280    }
48281    }
48282    function_tests++;
48283#endif
48284
48285    return(test_ret);
48286}
48287
48288
48289static int
48290test_xmlXPathNextParent(void) {
48291    int test_ret = 0;
48292
48293#if defined(LIBXML_XPATH_ENABLED)
48294    int mem_base;
48295    xmlNodePtr ret_val;
48296    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48297    int n_ctxt;
48298    xmlNodePtr cur; /* the current node in the traversal */
48299    int n_cur;
48300
48301    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48302    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48303        mem_base = xmlMemBlocks();
48304        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48305        cur = gen_xmlNodePtr(n_cur, 1);
48306
48307        ret_val = xmlXPathNextParent(ctxt, cur);
48308        desret_xmlNodePtr(ret_val);
48309        call_tests++;
48310        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48311        des_xmlNodePtr(n_cur, cur, 1);
48312        xmlResetLastError();
48313        if (mem_base != xmlMemBlocks()) {
48314            printf("Leak of %d blocks found in xmlXPathNextParent",
48315	           xmlMemBlocks() - mem_base);
48316	    test_ret++;
48317            printf(" %d", n_ctxt);
48318            printf(" %d", n_cur);
48319            printf("\n");
48320        }
48321    }
48322    }
48323    function_tests++;
48324#endif
48325
48326    return(test_ret);
48327}
48328
48329
48330static int
48331test_xmlXPathNextPreceding(void) {
48332    int test_ret = 0;
48333
48334#if defined(LIBXML_XPATH_ENABLED)
48335    int mem_base;
48336    xmlNodePtr ret_val;
48337    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48338    int n_ctxt;
48339    xmlNodePtr cur; /* the current node in the traversal */
48340    int n_cur;
48341
48342    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48343    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48344        mem_base = xmlMemBlocks();
48345        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48346        cur = gen_xmlNodePtr(n_cur, 1);
48347
48348        ret_val = xmlXPathNextPreceding(ctxt, cur);
48349        desret_xmlNodePtr(ret_val);
48350        call_tests++;
48351        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48352        des_xmlNodePtr(n_cur, cur, 1);
48353        xmlResetLastError();
48354        if (mem_base != xmlMemBlocks()) {
48355            printf("Leak of %d blocks found in xmlXPathNextPreceding",
48356	           xmlMemBlocks() - mem_base);
48357	    test_ret++;
48358            printf(" %d", n_ctxt);
48359            printf(" %d", n_cur);
48360            printf("\n");
48361        }
48362    }
48363    }
48364    function_tests++;
48365#endif
48366
48367    return(test_ret);
48368}
48369
48370
48371static int
48372test_xmlXPathNextPrecedingSibling(void) {
48373    int test_ret = 0;
48374
48375#if defined(LIBXML_XPATH_ENABLED)
48376    int mem_base;
48377    xmlNodePtr ret_val;
48378    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48379    int n_ctxt;
48380    xmlNodePtr cur; /* the current node in the traversal */
48381    int n_cur;
48382
48383    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48384    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48385        mem_base = xmlMemBlocks();
48386        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48387        cur = gen_xmlNodePtr(n_cur, 1);
48388
48389        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48390        desret_xmlNodePtr(ret_val);
48391        call_tests++;
48392        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48393        des_xmlNodePtr(n_cur, cur, 1);
48394        xmlResetLastError();
48395        if (mem_base != xmlMemBlocks()) {
48396            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48397	           xmlMemBlocks() - mem_base);
48398	    test_ret++;
48399            printf(" %d", n_ctxt);
48400            printf(" %d", n_cur);
48401            printf("\n");
48402        }
48403    }
48404    }
48405    function_tests++;
48406#endif
48407
48408    return(test_ret);
48409}
48410
48411
48412static int
48413test_xmlXPathNextSelf(void) {
48414    int test_ret = 0;
48415
48416#if defined(LIBXML_XPATH_ENABLED)
48417    int mem_base;
48418    xmlNodePtr ret_val;
48419    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48420    int n_ctxt;
48421    xmlNodePtr cur; /* the current node in the traversal */
48422    int n_cur;
48423
48424    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48425    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48426        mem_base = xmlMemBlocks();
48427        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48428        cur = gen_xmlNodePtr(n_cur, 1);
48429
48430        ret_val = xmlXPathNextSelf(ctxt, cur);
48431        desret_xmlNodePtr(ret_val);
48432        call_tests++;
48433        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48434        des_xmlNodePtr(n_cur, cur, 1);
48435        xmlResetLastError();
48436        if (mem_base != xmlMemBlocks()) {
48437            printf("Leak of %d blocks found in xmlXPathNextSelf",
48438	           xmlMemBlocks() - mem_base);
48439	    test_ret++;
48440            printf(" %d", n_ctxt);
48441            printf(" %d", n_cur);
48442            printf("\n");
48443        }
48444    }
48445    }
48446    function_tests++;
48447#endif
48448
48449    return(test_ret);
48450}
48451
48452
48453static int
48454test_xmlXPathNodeLeading(void) {
48455    int test_ret = 0;
48456
48457#if defined(LIBXML_XPATH_ENABLED)
48458    int mem_base;
48459    xmlNodeSetPtr ret_val;
48460    xmlNodeSetPtr nodes; /* a node-set */
48461    int n_nodes;
48462    xmlNodePtr node; /* a node */
48463    int n_node;
48464
48465    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48466    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48467        mem_base = xmlMemBlocks();
48468        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48469        node = gen_xmlNodePtr(n_node, 1);
48470
48471        ret_val = xmlXPathNodeLeading(nodes, node);
48472        desret_xmlNodeSetPtr(ret_val);
48473        call_tests++;
48474        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48475        des_xmlNodePtr(n_node, node, 1);
48476        xmlResetLastError();
48477        if (mem_base != xmlMemBlocks()) {
48478            printf("Leak of %d blocks found in xmlXPathNodeLeading",
48479	           xmlMemBlocks() - mem_base);
48480	    test_ret++;
48481            printf(" %d", n_nodes);
48482            printf(" %d", n_node);
48483            printf("\n");
48484        }
48485    }
48486    }
48487    function_tests++;
48488#endif
48489
48490    return(test_ret);
48491}
48492
48493
48494static int
48495test_xmlXPathNodeLeadingSorted(void) {
48496    int test_ret = 0;
48497
48498#if defined(LIBXML_XPATH_ENABLED)
48499    int mem_base;
48500    xmlNodeSetPtr ret_val;
48501    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48502    int n_nodes;
48503    xmlNodePtr node; /* a node */
48504    int n_node;
48505
48506    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48507    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48508        mem_base = xmlMemBlocks();
48509        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48510        node = gen_xmlNodePtr(n_node, 1);
48511
48512        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48513        desret_xmlNodeSetPtr(ret_val);
48514        call_tests++;
48515        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48516        des_xmlNodePtr(n_node, node, 1);
48517        xmlResetLastError();
48518        if (mem_base != xmlMemBlocks()) {
48519            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48520	           xmlMemBlocks() - mem_base);
48521	    test_ret++;
48522            printf(" %d", n_nodes);
48523            printf(" %d", n_node);
48524            printf("\n");
48525        }
48526    }
48527    }
48528    function_tests++;
48529#endif
48530
48531    return(test_ret);
48532}
48533
48534
48535static int
48536test_xmlXPathNodeSetAdd(void) {
48537    int test_ret = 0;
48538
48539#if defined(LIBXML_XPATH_ENABLED)
48540    int mem_base;
48541    xmlNodeSetPtr cur; /* the initial node set */
48542    int n_cur;
48543    xmlNodePtr val; /* a new xmlNodePtr */
48544    int n_val;
48545
48546    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48547    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48548        mem_base = xmlMemBlocks();
48549        cur = gen_xmlNodeSetPtr(n_cur, 0);
48550        val = gen_xmlNodePtr(n_val, 1);
48551
48552        xmlXPathNodeSetAdd(cur, val);
48553        call_tests++;
48554        des_xmlNodeSetPtr(n_cur, cur, 0);
48555        des_xmlNodePtr(n_val, val, 1);
48556        xmlResetLastError();
48557        if (mem_base != xmlMemBlocks()) {
48558            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48559	           xmlMemBlocks() - mem_base);
48560	    test_ret++;
48561            printf(" %d", n_cur);
48562            printf(" %d", n_val);
48563            printf("\n");
48564        }
48565    }
48566    }
48567    function_tests++;
48568#endif
48569
48570    return(test_ret);
48571}
48572
48573
48574static int
48575test_xmlXPathNodeSetAddNs(void) {
48576    int test_ret = 0;
48577
48578#if defined(LIBXML_XPATH_ENABLED)
48579    int mem_base;
48580    xmlNodeSetPtr cur; /* the initial node set */
48581    int n_cur;
48582    xmlNodePtr node; /* the hosting node */
48583    int n_node;
48584    xmlNsPtr ns; /* a the namespace node */
48585    int n_ns;
48586
48587    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48588    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48589    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48590        mem_base = xmlMemBlocks();
48591        cur = gen_xmlNodeSetPtr(n_cur, 0);
48592        node = gen_xmlNodePtr(n_node, 1);
48593        ns = gen_xmlNsPtr(n_ns, 2);
48594
48595        xmlXPathNodeSetAddNs(cur, node, ns);
48596        call_tests++;
48597        des_xmlNodeSetPtr(n_cur, cur, 0);
48598        des_xmlNodePtr(n_node, node, 1);
48599        des_xmlNsPtr(n_ns, ns, 2);
48600        xmlResetLastError();
48601        if (mem_base != xmlMemBlocks()) {
48602            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48603	           xmlMemBlocks() - mem_base);
48604	    test_ret++;
48605            printf(" %d", n_cur);
48606            printf(" %d", n_node);
48607            printf(" %d", n_ns);
48608            printf("\n");
48609        }
48610    }
48611    }
48612    }
48613    function_tests++;
48614#endif
48615
48616    return(test_ret);
48617}
48618
48619
48620static int
48621test_xmlXPathNodeSetAddUnique(void) {
48622    int test_ret = 0;
48623
48624#if defined(LIBXML_XPATH_ENABLED)
48625    int mem_base;
48626    xmlNodeSetPtr cur; /* the initial node set */
48627    int n_cur;
48628    xmlNodePtr val; /* a new xmlNodePtr */
48629    int n_val;
48630
48631    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48632    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48633        mem_base = xmlMemBlocks();
48634        cur = gen_xmlNodeSetPtr(n_cur, 0);
48635        val = gen_xmlNodePtr(n_val, 1);
48636
48637        xmlXPathNodeSetAddUnique(cur, val);
48638        call_tests++;
48639        des_xmlNodeSetPtr(n_cur, cur, 0);
48640        des_xmlNodePtr(n_val, val, 1);
48641        xmlResetLastError();
48642        if (mem_base != xmlMemBlocks()) {
48643            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48644	           xmlMemBlocks() - mem_base);
48645	    test_ret++;
48646            printf(" %d", n_cur);
48647            printf(" %d", n_val);
48648            printf("\n");
48649        }
48650    }
48651    }
48652    function_tests++;
48653#endif
48654
48655    return(test_ret);
48656}
48657
48658
48659static int
48660test_xmlXPathNodeSetContains(void) {
48661    int test_ret = 0;
48662
48663#if defined(LIBXML_XPATH_ENABLED)
48664    int mem_base;
48665    int ret_val;
48666    xmlNodeSetPtr cur; /* the node-set */
48667    int n_cur;
48668    xmlNodePtr val; /* the node */
48669    int n_val;
48670
48671    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48672    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48673        mem_base = xmlMemBlocks();
48674        cur = gen_xmlNodeSetPtr(n_cur, 0);
48675        val = gen_xmlNodePtr(n_val, 1);
48676
48677        ret_val = xmlXPathNodeSetContains(cur, val);
48678        desret_int(ret_val);
48679        call_tests++;
48680        des_xmlNodeSetPtr(n_cur, cur, 0);
48681        des_xmlNodePtr(n_val, val, 1);
48682        xmlResetLastError();
48683        if (mem_base != xmlMemBlocks()) {
48684            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48685	           xmlMemBlocks() - mem_base);
48686	    test_ret++;
48687            printf(" %d", n_cur);
48688            printf(" %d", n_val);
48689            printf("\n");
48690        }
48691    }
48692    }
48693    function_tests++;
48694#endif
48695
48696    return(test_ret);
48697}
48698
48699
48700static int
48701test_xmlXPathNodeSetDel(void) {
48702    int test_ret = 0;
48703
48704#if defined(LIBXML_XPATH_ENABLED)
48705    int mem_base;
48706    xmlNodeSetPtr cur; /* the initial node set */
48707    int n_cur;
48708    xmlNodePtr val; /* an xmlNodePtr */
48709    int n_val;
48710
48711    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48712    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48713        mem_base = xmlMemBlocks();
48714        cur = gen_xmlNodeSetPtr(n_cur, 0);
48715        val = gen_xmlNodePtr(n_val, 1);
48716
48717        xmlXPathNodeSetDel(cur, val);
48718        call_tests++;
48719        des_xmlNodeSetPtr(n_cur, cur, 0);
48720        des_xmlNodePtr(n_val, val, 1);
48721        xmlResetLastError();
48722        if (mem_base != xmlMemBlocks()) {
48723            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48724	           xmlMemBlocks() - mem_base);
48725	    test_ret++;
48726            printf(" %d", n_cur);
48727            printf(" %d", n_val);
48728            printf("\n");
48729        }
48730    }
48731    }
48732    function_tests++;
48733#endif
48734
48735    return(test_ret);
48736}
48737
48738
48739static int
48740test_xmlXPathNodeSetMerge(void) {
48741    int test_ret = 0;
48742
48743#if defined(LIBXML_XPATH_ENABLED)
48744    int mem_base;
48745    xmlNodeSetPtr ret_val;
48746    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48747    int n_val1;
48748    xmlNodeSetPtr val2; /* the second NodeSet */
48749    int n_val2;
48750
48751    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48752    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48753        mem_base = xmlMemBlocks();
48754        val1 = gen_xmlNodeSetPtr(n_val1, 0);
48755        val2 = gen_xmlNodeSetPtr(n_val2, 1);
48756
48757        ret_val = xmlXPathNodeSetMerge(val1, val2);
48758        desret_xmlNodeSetPtr(ret_val);
48759        call_tests++;
48760        des_xmlNodeSetPtr(n_val1, val1, 0);
48761        des_xmlNodeSetPtr(n_val2, val2, 1);
48762        xmlResetLastError();
48763        if (mem_base != xmlMemBlocks()) {
48764            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48765	           xmlMemBlocks() - mem_base);
48766	    test_ret++;
48767            printf(" %d", n_val1);
48768            printf(" %d", n_val2);
48769            printf("\n");
48770        }
48771    }
48772    }
48773    function_tests++;
48774#endif
48775
48776    return(test_ret);
48777}
48778
48779
48780static int
48781test_xmlXPathNodeSetRemove(void) {
48782    int test_ret = 0;
48783
48784#if defined(LIBXML_XPATH_ENABLED)
48785    int mem_base;
48786    xmlNodeSetPtr cur; /* the initial node set */
48787    int n_cur;
48788    int val; /* the index to remove */
48789    int n_val;
48790
48791    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48792    for (n_val = 0;n_val < gen_nb_int;n_val++) {
48793        mem_base = xmlMemBlocks();
48794        cur = gen_xmlNodeSetPtr(n_cur, 0);
48795        val = gen_int(n_val, 1);
48796
48797        xmlXPathNodeSetRemove(cur, val);
48798        call_tests++;
48799        des_xmlNodeSetPtr(n_cur, cur, 0);
48800        des_int(n_val, val, 1);
48801        xmlResetLastError();
48802        if (mem_base != xmlMemBlocks()) {
48803            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48804	           xmlMemBlocks() - mem_base);
48805	    test_ret++;
48806            printf(" %d", n_cur);
48807            printf(" %d", n_val);
48808            printf("\n");
48809        }
48810    }
48811    }
48812    function_tests++;
48813#endif
48814
48815    return(test_ret);
48816}
48817
48818
48819static int
48820test_xmlXPathNodeSetSort(void) {
48821    int test_ret = 0;
48822
48823#if defined(LIBXML_XPATH_ENABLED)
48824    int mem_base;
48825    xmlNodeSetPtr set; /* the node set */
48826    int n_set;
48827
48828    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48829        mem_base = xmlMemBlocks();
48830        set = gen_xmlNodeSetPtr(n_set, 0);
48831
48832        xmlXPathNodeSetSort(set);
48833        call_tests++;
48834        des_xmlNodeSetPtr(n_set, set, 0);
48835        xmlResetLastError();
48836        if (mem_base != xmlMemBlocks()) {
48837            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
48838	           xmlMemBlocks() - mem_base);
48839	    test_ret++;
48840            printf(" %d", n_set);
48841            printf("\n");
48842        }
48843    }
48844    function_tests++;
48845#endif
48846
48847    return(test_ret);
48848}
48849
48850
48851static int
48852test_xmlXPathNodeTrailing(void) {
48853    int test_ret = 0;
48854
48855#if defined(LIBXML_XPATH_ENABLED)
48856    int mem_base;
48857    xmlNodeSetPtr ret_val;
48858    xmlNodeSetPtr nodes; /* a node-set */
48859    int n_nodes;
48860    xmlNodePtr node; /* a node */
48861    int n_node;
48862
48863    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48864    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48865        mem_base = xmlMemBlocks();
48866        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48867        node = gen_xmlNodePtr(n_node, 1);
48868
48869        ret_val = xmlXPathNodeTrailing(nodes, node);
48870        desret_xmlNodeSetPtr(ret_val);
48871        call_tests++;
48872        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48873        des_xmlNodePtr(n_node, node, 1);
48874        xmlResetLastError();
48875        if (mem_base != xmlMemBlocks()) {
48876            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
48877	           xmlMemBlocks() - mem_base);
48878	    test_ret++;
48879            printf(" %d", n_nodes);
48880            printf(" %d", n_node);
48881            printf("\n");
48882        }
48883    }
48884    }
48885    function_tests++;
48886#endif
48887
48888    return(test_ret);
48889}
48890
48891
48892static int
48893test_xmlXPathNodeTrailingSorted(void) {
48894    int test_ret = 0;
48895
48896#if defined(LIBXML_XPATH_ENABLED)
48897    int mem_base;
48898    xmlNodeSetPtr ret_val;
48899    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48900    int n_nodes;
48901    xmlNodePtr node; /* a node */
48902    int n_node;
48903
48904    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48905    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48906        mem_base = xmlMemBlocks();
48907        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48908        node = gen_xmlNodePtr(n_node, 1);
48909
48910        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
48911        desret_xmlNodeSetPtr(ret_val);
48912        call_tests++;
48913        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48914        des_xmlNodePtr(n_node, node, 1);
48915        xmlResetLastError();
48916        if (mem_base != xmlMemBlocks()) {
48917            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
48918	           xmlMemBlocks() - mem_base);
48919	    test_ret++;
48920            printf(" %d", n_nodes);
48921            printf(" %d", n_node);
48922            printf("\n");
48923        }
48924    }
48925    }
48926    function_tests++;
48927#endif
48928
48929    return(test_ret);
48930}
48931
48932
48933static int
48934test_xmlXPathNormalizeFunction(void) {
48935    int test_ret = 0;
48936
48937#if defined(LIBXML_XPATH_ENABLED)
48938    int mem_base;
48939    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48940    int n_ctxt;
48941    int nargs; /* the number of arguments */
48942    int n_nargs;
48943
48944    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48945    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48946        mem_base = xmlMemBlocks();
48947        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48948        nargs = gen_int(n_nargs, 1);
48949
48950        xmlXPathNormalizeFunction(ctxt, nargs);
48951        call_tests++;
48952        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48953        des_int(n_nargs, nargs, 1);
48954        xmlResetLastError();
48955        if (mem_base != xmlMemBlocks()) {
48956            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
48957	           xmlMemBlocks() - mem_base);
48958	    test_ret++;
48959            printf(" %d", n_ctxt);
48960            printf(" %d", n_nargs);
48961            printf("\n");
48962        }
48963    }
48964    }
48965    function_tests++;
48966#endif
48967
48968    return(test_ret);
48969}
48970
48971
48972static int
48973test_xmlXPathNotEqualValues(void) {
48974    int test_ret = 0;
48975
48976#if defined(LIBXML_XPATH_ENABLED)
48977    int mem_base;
48978    int ret_val;
48979    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48980    int n_ctxt;
48981
48982    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48983        mem_base = xmlMemBlocks();
48984        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48985
48986        ret_val = xmlXPathNotEqualValues(ctxt);
48987        desret_int(ret_val);
48988        call_tests++;
48989        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48990        xmlResetLastError();
48991        if (mem_base != xmlMemBlocks()) {
48992            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
48993	           xmlMemBlocks() - mem_base);
48994	    test_ret++;
48995            printf(" %d", n_ctxt);
48996            printf("\n");
48997        }
48998    }
48999    function_tests++;
49000#endif
49001
49002    return(test_ret);
49003}
49004
49005
49006static int
49007test_xmlXPathNotFunction(void) {
49008    int test_ret = 0;
49009
49010#if defined(LIBXML_XPATH_ENABLED)
49011    int mem_base;
49012    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49013    int n_ctxt;
49014    int nargs; /* the number of arguments */
49015    int n_nargs;
49016
49017    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49018    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49019        mem_base = xmlMemBlocks();
49020        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49021        nargs = gen_int(n_nargs, 1);
49022
49023        xmlXPathNotFunction(ctxt, nargs);
49024        call_tests++;
49025        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49026        des_int(n_nargs, nargs, 1);
49027        xmlResetLastError();
49028        if (mem_base != xmlMemBlocks()) {
49029            printf("Leak of %d blocks found in xmlXPathNotFunction",
49030	           xmlMemBlocks() - mem_base);
49031	    test_ret++;
49032            printf(" %d", n_ctxt);
49033            printf(" %d", n_nargs);
49034            printf("\n");
49035        }
49036    }
49037    }
49038    function_tests++;
49039#endif
49040
49041    return(test_ret);
49042}
49043
49044
49045static int
49046test_xmlXPathNsLookup(void) {
49047    int test_ret = 0;
49048
49049#if defined(LIBXML_XPATH_ENABLED)
49050    int mem_base;
49051    const xmlChar * ret_val;
49052    xmlXPathContextPtr ctxt; /* the XPath context */
49053    int n_ctxt;
49054    xmlChar * prefix; /* the namespace prefix value */
49055    int n_prefix;
49056
49057    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49058    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49059        mem_base = xmlMemBlocks();
49060        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49061        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49062
49063        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49064        desret_const_xmlChar_ptr(ret_val);
49065        call_tests++;
49066        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49067        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49068        xmlResetLastError();
49069        if (mem_base != xmlMemBlocks()) {
49070            printf("Leak of %d blocks found in xmlXPathNsLookup",
49071	           xmlMemBlocks() - mem_base);
49072	    test_ret++;
49073            printf(" %d", n_ctxt);
49074            printf(" %d", n_prefix);
49075            printf("\n");
49076        }
49077    }
49078    }
49079    function_tests++;
49080#endif
49081
49082    return(test_ret);
49083}
49084
49085
49086static int
49087test_xmlXPathNumberFunction(void) {
49088    int test_ret = 0;
49089
49090#if defined(LIBXML_XPATH_ENABLED)
49091    int mem_base;
49092    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49093    int n_ctxt;
49094    int nargs; /* the number of arguments */
49095    int n_nargs;
49096
49097    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49098    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49099        mem_base = xmlMemBlocks();
49100        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49101        nargs = gen_int(n_nargs, 1);
49102
49103        xmlXPathNumberFunction(ctxt, nargs);
49104        call_tests++;
49105        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49106        des_int(n_nargs, nargs, 1);
49107        xmlResetLastError();
49108        if (mem_base != xmlMemBlocks()) {
49109            printf("Leak of %d blocks found in xmlXPathNumberFunction",
49110	           xmlMemBlocks() - mem_base);
49111	    test_ret++;
49112            printf(" %d", n_ctxt);
49113            printf(" %d", n_nargs);
49114            printf("\n");
49115        }
49116    }
49117    }
49118    function_tests++;
49119#endif
49120
49121    return(test_ret);
49122}
49123
49124
49125static int
49126test_xmlXPathParseNCName(void) {
49127    int test_ret = 0;
49128
49129#if defined(LIBXML_XPATH_ENABLED)
49130    int mem_base;
49131    xmlChar * ret_val;
49132    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49133    int n_ctxt;
49134
49135    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49136        mem_base = xmlMemBlocks();
49137        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49138
49139        ret_val = xmlXPathParseNCName(ctxt);
49140        desret_xmlChar_ptr(ret_val);
49141        call_tests++;
49142        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49143        xmlResetLastError();
49144        if (mem_base != xmlMemBlocks()) {
49145            printf("Leak of %d blocks found in xmlXPathParseNCName",
49146	           xmlMemBlocks() - mem_base);
49147	    test_ret++;
49148            printf(" %d", n_ctxt);
49149            printf("\n");
49150        }
49151    }
49152    function_tests++;
49153#endif
49154
49155    return(test_ret);
49156}
49157
49158
49159static int
49160test_xmlXPathParseName(void) {
49161    int test_ret = 0;
49162
49163#if defined(LIBXML_XPATH_ENABLED)
49164    int mem_base;
49165    xmlChar * ret_val;
49166    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49167    int n_ctxt;
49168
49169    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49170        mem_base = xmlMemBlocks();
49171        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49172
49173        ret_val = xmlXPathParseName(ctxt);
49174        desret_xmlChar_ptr(ret_val);
49175        call_tests++;
49176        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49177        xmlResetLastError();
49178        if (mem_base != xmlMemBlocks()) {
49179            printf("Leak of %d blocks found in xmlXPathParseName",
49180	           xmlMemBlocks() - mem_base);
49181	    test_ret++;
49182            printf(" %d", n_ctxt);
49183            printf("\n");
49184        }
49185    }
49186    function_tests++;
49187#endif
49188
49189    return(test_ret);
49190}
49191
49192
49193static int
49194test_xmlXPathPopBoolean(void) {
49195    int test_ret = 0;
49196
49197#if defined(LIBXML_XPATH_ENABLED)
49198    int mem_base;
49199    int ret_val;
49200    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49201    int n_ctxt;
49202
49203    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49204        mem_base = xmlMemBlocks();
49205        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49206
49207        ret_val = xmlXPathPopBoolean(ctxt);
49208        desret_int(ret_val);
49209        call_tests++;
49210        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49211        xmlResetLastError();
49212        if (mem_base != xmlMemBlocks()) {
49213            printf("Leak of %d blocks found in xmlXPathPopBoolean",
49214	           xmlMemBlocks() - mem_base);
49215	    test_ret++;
49216            printf(" %d", n_ctxt);
49217            printf("\n");
49218        }
49219    }
49220    function_tests++;
49221#endif
49222
49223    return(test_ret);
49224}
49225
49226
49227static int
49228test_xmlXPathPopExternal(void) {
49229    int test_ret = 0;
49230
49231#if defined(LIBXML_XPATH_ENABLED)
49232    int mem_base;
49233    void * ret_val;
49234    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49235    int n_ctxt;
49236
49237    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49238        mem_base = xmlMemBlocks();
49239        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49240
49241        ret_val = xmlXPathPopExternal(ctxt);
49242        desret_void_ptr(ret_val);
49243        call_tests++;
49244        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49245        xmlResetLastError();
49246        if (mem_base != xmlMemBlocks()) {
49247            printf("Leak of %d blocks found in xmlXPathPopExternal",
49248	           xmlMemBlocks() - mem_base);
49249	    test_ret++;
49250            printf(" %d", n_ctxt);
49251            printf("\n");
49252        }
49253    }
49254    function_tests++;
49255#endif
49256
49257    return(test_ret);
49258}
49259
49260
49261static int
49262test_xmlXPathPopNodeSet(void) {
49263    int test_ret = 0;
49264
49265#if defined(LIBXML_XPATH_ENABLED)
49266    int mem_base;
49267    xmlNodeSetPtr ret_val;
49268    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49269    int n_ctxt;
49270
49271    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49272        mem_base = xmlMemBlocks();
49273        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49274
49275        ret_val = xmlXPathPopNodeSet(ctxt);
49276        desret_xmlNodeSetPtr(ret_val);
49277        call_tests++;
49278        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49279        xmlResetLastError();
49280        if (mem_base != xmlMemBlocks()) {
49281            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49282	           xmlMemBlocks() - mem_base);
49283	    test_ret++;
49284            printf(" %d", n_ctxt);
49285            printf("\n");
49286        }
49287    }
49288    function_tests++;
49289#endif
49290
49291    return(test_ret);
49292}
49293
49294
49295static int
49296test_xmlXPathPopNumber(void) {
49297    int test_ret = 0;
49298
49299#if defined(LIBXML_XPATH_ENABLED)
49300    int mem_base;
49301    double ret_val;
49302    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49303    int n_ctxt;
49304
49305    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49306        mem_base = xmlMemBlocks();
49307        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49308
49309        ret_val = xmlXPathPopNumber(ctxt);
49310        desret_double(ret_val);
49311        call_tests++;
49312        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49313        xmlResetLastError();
49314        if (mem_base != xmlMemBlocks()) {
49315            printf("Leak of %d blocks found in xmlXPathPopNumber",
49316	           xmlMemBlocks() - mem_base);
49317	    test_ret++;
49318            printf(" %d", n_ctxt);
49319            printf("\n");
49320        }
49321    }
49322    function_tests++;
49323#endif
49324
49325    return(test_ret);
49326}
49327
49328
49329static int
49330test_xmlXPathPopString(void) {
49331    int test_ret = 0;
49332
49333#if defined(LIBXML_XPATH_ENABLED)
49334    int mem_base;
49335    xmlChar * ret_val;
49336    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49337    int n_ctxt;
49338
49339    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49340        mem_base = xmlMemBlocks();
49341        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49342
49343        ret_val = xmlXPathPopString(ctxt);
49344        desret_xmlChar_ptr(ret_val);
49345        call_tests++;
49346        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49347        xmlResetLastError();
49348        if (mem_base != xmlMemBlocks()) {
49349            printf("Leak of %d blocks found in xmlXPathPopString",
49350	           xmlMemBlocks() - mem_base);
49351	    test_ret++;
49352            printf(" %d", n_ctxt);
49353            printf("\n");
49354        }
49355    }
49356    function_tests++;
49357#endif
49358
49359    return(test_ret);
49360}
49361
49362
49363static int
49364test_xmlXPathPositionFunction(void) {
49365    int test_ret = 0;
49366
49367#if defined(LIBXML_XPATH_ENABLED)
49368    int mem_base;
49369    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49370    int n_ctxt;
49371    int nargs; /* the number of arguments */
49372    int n_nargs;
49373
49374    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49375    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49376        mem_base = xmlMemBlocks();
49377        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49378        nargs = gen_int(n_nargs, 1);
49379
49380        xmlXPathPositionFunction(ctxt, nargs);
49381        call_tests++;
49382        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49383        des_int(n_nargs, nargs, 1);
49384        xmlResetLastError();
49385        if (mem_base != xmlMemBlocks()) {
49386            printf("Leak of %d blocks found in xmlXPathPositionFunction",
49387	           xmlMemBlocks() - mem_base);
49388	    test_ret++;
49389            printf(" %d", n_ctxt);
49390            printf(" %d", n_nargs);
49391            printf("\n");
49392        }
49393    }
49394    }
49395    function_tests++;
49396#endif
49397
49398    return(test_ret);
49399}
49400
49401
49402static int
49403test_xmlXPathRegisterAllFunctions(void) {
49404    int test_ret = 0;
49405
49406#if defined(LIBXML_XPATH_ENABLED)
49407    int mem_base;
49408    xmlXPathContextPtr ctxt; /* the XPath context */
49409    int n_ctxt;
49410
49411    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49412        mem_base = xmlMemBlocks();
49413        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49414
49415        xmlXPathRegisterAllFunctions(ctxt);
49416        call_tests++;
49417        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49418        xmlResetLastError();
49419        if (mem_base != xmlMemBlocks()) {
49420            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49421	           xmlMemBlocks() - mem_base);
49422	    test_ret++;
49423            printf(" %d", n_ctxt);
49424            printf("\n");
49425        }
49426    }
49427    function_tests++;
49428#endif
49429
49430    return(test_ret);
49431}
49432
49433
49434static int
49435test_xmlXPathRegisterFunc(void) {
49436    int test_ret = 0;
49437
49438
49439    /* missing type support */
49440    return(test_ret);
49441}
49442
49443
49444static int
49445test_xmlXPathRegisterFuncLookup(void) {
49446    int test_ret = 0;
49447
49448
49449    /* missing type support */
49450    return(test_ret);
49451}
49452
49453
49454static int
49455test_xmlXPathRegisterFuncNS(void) {
49456    int test_ret = 0;
49457
49458
49459    /* missing type support */
49460    return(test_ret);
49461}
49462
49463
49464static int
49465test_xmlXPathRegisterNs(void) {
49466    int test_ret = 0;
49467
49468#if defined(LIBXML_XPATH_ENABLED)
49469    int mem_base;
49470    int ret_val;
49471    xmlXPathContextPtr ctxt; /* the XPath context */
49472    int n_ctxt;
49473    xmlChar * prefix; /* the namespace prefix */
49474    int n_prefix;
49475    xmlChar * ns_uri; /* the namespace name */
49476    int n_ns_uri;
49477
49478    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49479    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49480    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49481        mem_base = xmlMemBlocks();
49482        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49483        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49484        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49485
49486        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49487        desret_int(ret_val);
49488        call_tests++;
49489        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49490        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49491        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49492        xmlResetLastError();
49493        if (mem_base != xmlMemBlocks()) {
49494            printf("Leak of %d blocks found in xmlXPathRegisterNs",
49495	           xmlMemBlocks() - mem_base);
49496	    test_ret++;
49497            printf(" %d", n_ctxt);
49498            printf(" %d", n_prefix);
49499            printf(" %d", n_ns_uri);
49500            printf("\n");
49501        }
49502    }
49503    }
49504    }
49505    function_tests++;
49506#endif
49507
49508    return(test_ret);
49509}
49510
49511
49512static int
49513test_xmlXPathRegisterVariable(void) {
49514    int test_ret = 0;
49515
49516#if defined(LIBXML_XPATH_ENABLED)
49517    int mem_base;
49518    int ret_val;
49519    xmlXPathContextPtr ctxt; /* the XPath context */
49520    int n_ctxt;
49521    xmlChar * name; /* the variable name */
49522    int n_name;
49523    xmlXPathObjectPtr value; /* the variable value or NULL */
49524    int n_value;
49525
49526    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49527    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49528    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49529        mem_base = xmlMemBlocks();
49530        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49531        name = gen_const_xmlChar_ptr(n_name, 1);
49532        value = gen_xmlXPathObjectPtr(n_value, 2);
49533
49534        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49535        desret_int(ret_val);
49536        call_tests++;
49537        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49538        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49539        des_xmlXPathObjectPtr(n_value, value, 2);
49540        xmlResetLastError();
49541        if (mem_base != xmlMemBlocks()) {
49542            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49543	           xmlMemBlocks() - mem_base);
49544	    test_ret++;
49545            printf(" %d", n_ctxt);
49546            printf(" %d", n_name);
49547            printf(" %d", n_value);
49548            printf("\n");
49549        }
49550    }
49551    }
49552    }
49553    function_tests++;
49554#endif
49555
49556    return(test_ret);
49557}
49558
49559
49560static int
49561test_xmlXPathRegisterVariableLookup(void) {
49562    int test_ret = 0;
49563
49564
49565    /* missing type support */
49566    return(test_ret);
49567}
49568
49569
49570static int
49571test_xmlXPathRegisterVariableNS(void) {
49572    int test_ret = 0;
49573
49574#if defined(LIBXML_XPATH_ENABLED)
49575    int mem_base;
49576    int ret_val;
49577    xmlXPathContextPtr ctxt; /* the XPath context */
49578    int n_ctxt;
49579    xmlChar * name; /* the variable name */
49580    int n_name;
49581    xmlChar * ns_uri; /* the variable namespace URI */
49582    int n_ns_uri;
49583    xmlXPathObjectPtr value; /* the variable value or NULL */
49584    int n_value;
49585
49586    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49587    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49588    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49589    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49590        mem_base = xmlMemBlocks();
49591        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49592        name = gen_const_xmlChar_ptr(n_name, 1);
49593        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49594        value = gen_xmlXPathObjectPtr(n_value, 3);
49595
49596        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49597        desret_int(ret_val);
49598        call_tests++;
49599        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49600        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49601        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49602        des_xmlXPathObjectPtr(n_value, value, 3);
49603        xmlResetLastError();
49604        if (mem_base != xmlMemBlocks()) {
49605            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49606	           xmlMemBlocks() - mem_base);
49607	    test_ret++;
49608            printf(" %d", n_ctxt);
49609            printf(" %d", n_name);
49610            printf(" %d", n_ns_uri);
49611            printf(" %d", n_value);
49612            printf("\n");
49613        }
49614    }
49615    }
49616    }
49617    }
49618    function_tests++;
49619#endif
49620
49621    return(test_ret);
49622}
49623
49624
49625static int
49626test_xmlXPathRegisteredFuncsCleanup(void) {
49627    int test_ret = 0;
49628
49629#if defined(LIBXML_XPATH_ENABLED)
49630    int mem_base;
49631    xmlXPathContextPtr ctxt; /* the XPath context */
49632    int n_ctxt;
49633
49634    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49635        mem_base = xmlMemBlocks();
49636        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49637
49638        xmlXPathRegisteredFuncsCleanup(ctxt);
49639        call_tests++;
49640        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49641        xmlResetLastError();
49642        if (mem_base != xmlMemBlocks()) {
49643            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49644	           xmlMemBlocks() - mem_base);
49645	    test_ret++;
49646            printf(" %d", n_ctxt);
49647            printf("\n");
49648        }
49649    }
49650    function_tests++;
49651#endif
49652
49653    return(test_ret);
49654}
49655
49656
49657static int
49658test_xmlXPathRegisteredNsCleanup(void) {
49659    int test_ret = 0;
49660
49661#if defined(LIBXML_XPATH_ENABLED)
49662    int mem_base;
49663    xmlXPathContextPtr ctxt; /* the XPath context */
49664    int n_ctxt;
49665
49666    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49667        mem_base = xmlMemBlocks();
49668        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49669
49670        xmlXPathRegisteredNsCleanup(ctxt);
49671        call_tests++;
49672        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49673        xmlResetLastError();
49674        if (mem_base != xmlMemBlocks()) {
49675            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49676	           xmlMemBlocks() - mem_base);
49677	    test_ret++;
49678            printf(" %d", n_ctxt);
49679            printf("\n");
49680        }
49681    }
49682    function_tests++;
49683#endif
49684
49685    return(test_ret);
49686}
49687
49688
49689static int
49690test_xmlXPathRegisteredVariablesCleanup(void) {
49691    int test_ret = 0;
49692
49693#if defined(LIBXML_XPATH_ENABLED)
49694    int mem_base;
49695    xmlXPathContextPtr ctxt; /* the XPath context */
49696    int n_ctxt;
49697
49698    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49699        mem_base = xmlMemBlocks();
49700        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49701
49702        xmlXPathRegisteredVariablesCleanup(ctxt);
49703        call_tests++;
49704        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49705        xmlResetLastError();
49706        if (mem_base != xmlMemBlocks()) {
49707            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49708	           xmlMemBlocks() - mem_base);
49709	    test_ret++;
49710            printf(" %d", n_ctxt);
49711            printf("\n");
49712        }
49713    }
49714    function_tests++;
49715#endif
49716
49717    return(test_ret);
49718}
49719
49720
49721static int
49722test_xmlXPathRoot(void) {
49723    int test_ret = 0;
49724
49725#if defined(LIBXML_XPATH_ENABLED)
49726    int mem_base;
49727    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49728    int n_ctxt;
49729
49730    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49731        mem_base = xmlMemBlocks();
49732        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49733
49734        xmlXPathRoot(ctxt);
49735        call_tests++;
49736        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49737        xmlResetLastError();
49738        if (mem_base != xmlMemBlocks()) {
49739            printf("Leak of %d blocks found in xmlXPathRoot",
49740	           xmlMemBlocks() - mem_base);
49741	    test_ret++;
49742            printf(" %d", n_ctxt);
49743            printf("\n");
49744        }
49745    }
49746    function_tests++;
49747#endif
49748
49749    return(test_ret);
49750}
49751
49752
49753static int
49754test_xmlXPathRoundFunction(void) {
49755    int test_ret = 0;
49756
49757#if defined(LIBXML_XPATH_ENABLED)
49758    int mem_base;
49759    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49760    int n_ctxt;
49761    int nargs; /* the number of arguments */
49762    int n_nargs;
49763
49764    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49765    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49766        mem_base = xmlMemBlocks();
49767        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49768        nargs = gen_int(n_nargs, 1);
49769
49770        xmlXPathRoundFunction(ctxt, nargs);
49771        call_tests++;
49772        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49773        des_int(n_nargs, nargs, 1);
49774        xmlResetLastError();
49775        if (mem_base != xmlMemBlocks()) {
49776            printf("Leak of %d blocks found in xmlXPathRoundFunction",
49777	           xmlMemBlocks() - mem_base);
49778	    test_ret++;
49779            printf(" %d", n_ctxt);
49780            printf(" %d", n_nargs);
49781            printf("\n");
49782        }
49783    }
49784    }
49785    function_tests++;
49786#endif
49787
49788    return(test_ret);
49789}
49790
49791
49792static int
49793test_xmlXPathStartsWithFunction(void) {
49794    int test_ret = 0;
49795
49796#if defined(LIBXML_XPATH_ENABLED)
49797    int mem_base;
49798    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49799    int n_ctxt;
49800    int nargs; /* the number of arguments */
49801    int n_nargs;
49802
49803    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49804    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49805        mem_base = xmlMemBlocks();
49806        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49807        nargs = gen_int(n_nargs, 1);
49808
49809        xmlXPathStartsWithFunction(ctxt, nargs);
49810        call_tests++;
49811        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49812        des_int(n_nargs, nargs, 1);
49813        xmlResetLastError();
49814        if (mem_base != xmlMemBlocks()) {
49815            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49816	           xmlMemBlocks() - mem_base);
49817	    test_ret++;
49818            printf(" %d", n_ctxt);
49819            printf(" %d", n_nargs);
49820            printf("\n");
49821        }
49822    }
49823    }
49824    function_tests++;
49825#endif
49826
49827    return(test_ret);
49828}
49829
49830
49831static int
49832test_xmlXPathStringEvalNumber(void) {
49833    int test_ret = 0;
49834
49835#if defined(LIBXML_XPATH_ENABLED)
49836    int mem_base;
49837    double ret_val;
49838    xmlChar * str; /* A string to scan */
49839    int n_str;
49840
49841    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
49842        mem_base = xmlMemBlocks();
49843        str = gen_const_xmlChar_ptr(n_str, 0);
49844
49845        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
49846        desret_double(ret_val);
49847        call_tests++;
49848        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
49849        xmlResetLastError();
49850        if (mem_base != xmlMemBlocks()) {
49851            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
49852	           xmlMemBlocks() - mem_base);
49853	    test_ret++;
49854            printf(" %d", n_str);
49855            printf("\n");
49856        }
49857    }
49858    function_tests++;
49859#endif
49860
49861    return(test_ret);
49862}
49863
49864
49865static int
49866test_xmlXPathStringFunction(void) {
49867    int test_ret = 0;
49868
49869#if defined(LIBXML_XPATH_ENABLED)
49870    int mem_base;
49871    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49872    int n_ctxt;
49873    int nargs; /* the number of arguments */
49874    int n_nargs;
49875
49876    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49877    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49878        mem_base = xmlMemBlocks();
49879        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49880        nargs = gen_int(n_nargs, 1);
49881
49882        xmlXPathStringFunction(ctxt, nargs);
49883        call_tests++;
49884        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49885        des_int(n_nargs, nargs, 1);
49886        xmlResetLastError();
49887        if (mem_base != xmlMemBlocks()) {
49888            printf("Leak of %d blocks found in xmlXPathStringFunction",
49889	           xmlMemBlocks() - mem_base);
49890	    test_ret++;
49891            printf(" %d", n_ctxt);
49892            printf(" %d", n_nargs);
49893            printf("\n");
49894        }
49895    }
49896    }
49897    function_tests++;
49898#endif
49899
49900    return(test_ret);
49901}
49902
49903
49904static int
49905test_xmlXPathStringLengthFunction(void) {
49906    int test_ret = 0;
49907
49908#if defined(LIBXML_XPATH_ENABLED)
49909    int mem_base;
49910    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49911    int n_ctxt;
49912    int nargs; /* the number of arguments */
49913    int n_nargs;
49914
49915    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49916    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49917        mem_base = xmlMemBlocks();
49918        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49919        nargs = gen_int(n_nargs, 1);
49920
49921        xmlXPathStringLengthFunction(ctxt, nargs);
49922        call_tests++;
49923        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49924        des_int(n_nargs, nargs, 1);
49925        xmlResetLastError();
49926        if (mem_base != xmlMemBlocks()) {
49927            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
49928	           xmlMemBlocks() - mem_base);
49929	    test_ret++;
49930            printf(" %d", n_ctxt);
49931            printf(" %d", n_nargs);
49932            printf("\n");
49933        }
49934    }
49935    }
49936    function_tests++;
49937#endif
49938
49939    return(test_ret);
49940}
49941
49942
49943static int
49944test_xmlXPathSubValues(void) {
49945    int test_ret = 0;
49946
49947#if defined(LIBXML_XPATH_ENABLED)
49948    int mem_base;
49949    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49950    int n_ctxt;
49951
49952    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49953        mem_base = xmlMemBlocks();
49954        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49955
49956        xmlXPathSubValues(ctxt);
49957        call_tests++;
49958        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49959        xmlResetLastError();
49960        if (mem_base != xmlMemBlocks()) {
49961            printf("Leak of %d blocks found in xmlXPathSubValues",
49962	           xmlMemBlocks() - mem_base);
49963	    test_ret++;
49964            printf(" %d", n_ctxt);
49965            printf("\n");
49966        }
49967    }
49968    function_tests++;
49969#endif
49970
49971    return(test_ret);
49972}
49973
49974
49975static int
49976test_xmlXPathSubstringAfterFunction(void) {
49977    int test_ret = 0;
49978
49979#if defined(LIBXML_XPATH_ENABLED)
49980    int mem_base;
49981    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49982    int n_ctxt;
49983    int nargs; /* the number of arguments */
49984    int n_nargs;
49985
49986    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49987    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49988        mem_base = xmlMemBlocks();
49989        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49990        nargs = gen_int(n_nargs, 1);
49991
49992        xmlXPathSubstringAfterFunction(ctxt, nargs);
49993        call_tests++;
49994        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49995        des_int(n_nargs, nargs, 1);
49996        xmlResetLastError();
49997        if (mem_base != xmlMemBlocks()) {
49998            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
49999	           xmlMemBlocks() - mem_base);
50000	    test_ret++;
50001            printf(" %d", n_ctxt);
50002            printf(" %d", n_nargs);
50003            printf("\n");
50004        }
50005    }
50006    }
50007    function_tests++;
50008#endif
50009
50010    return(test_ret);
50011}
50012
50013
50014static int
50015test_xmlXPathSubstringBeforeFunction(void) {
50016    int test_ret = 0;
50017
50018#if defined(LIBXML_XPATH_ENABLED)
50019    int mem_base;
50020    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50021    int n_ctxt;
50022    int nargs; /* the number of arguments */
50023    int n_nargs;
50024
50025    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50026    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50027        mem_base = xmlMemBlocks();
50028        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50029        nargs = gen_int(n_nargs, 1);
50030
50031        xmlXPathSubstringBeforeFunction(ctxt, nargs);
50032        call_tests++;
50033        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50034        des_int(n_nargs, nargs, 1);
50035        xmlResetLastError();
50036        if (mem_base != xmlMemBlocks()) {
50037            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50038	           xmlMemBlocks() - mem_base);
50039	    test_ret++;
50040            printf(" %d", n_ctxt);
50041            printf(" %d", n_nargs);
50042            printf("\n");
50043        }
50044    }
50045    }
50046    function_tests++;
50047#endif
50048
50049    return(test_ret);
50050}
50051
50052
50053static int
50054test_xmlXPathSubstringFunction(void) {
50055    int test_ret = 0;
50056
50057#if defined(LIBXML_XPATH_ENABLED)
50058    int mem_base;
50059    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50060    int n_ctxt;
50061    int nargs; /* the number of arguments */
50062    int n_nargs;
50063
50064    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50065    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50066        mem_base = xmlMemBlocks();
50067        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50068        nargs = gen_int(n_nargs, 1);
50069
50070        xmlXPathSubstringFunction(ctxt, nargs);
50071        call_tests++;
50072        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50073        des_int(n_nargs, nargs, 1);
50074        xmlResetLastError();
50075        if (mem_base != xmlMemBlocks()) {
50076            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50077	           xmlMemBlocks() - mem_base);
50078	    test_ret++;
50079            printf(" %d", n_ctxt);
50080            printf(" %d", n_nargs);
50081            printf("\n");
50082        }
50083    }
50084    }
50085    function_tests++;
50086#endif
50087
50088    return(test_ret);
50089}
50090
50091
50092static int
50093test_xmlXPathSumFunction(void) {
50094    int test_ret = 0;
50095
50096#if defined(LIBXML_XPATH_ENABLED)
50097    int mem_base;
50098    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50099    int n_ctxt;
50100    int nargs; /* the number of arguments */
50101    int n_nargs;
50102
50103    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50104    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50105        mem_base = xmlMemBlocks();
50106        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50107        nargs = gen_int(n_nargs, 1);
50108
50109        xmlXPathSumFunction(ctxt, nargs);
50110        call_tests++;
50111        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50112        des_int(n_nargs, nargs, 1);
50113        xmlResetLastError();
50114        if (mem_base != xmlMemBlocks()) {
50115            printf("Leak of %d blocks found in xmlXPathSumFunction",
50116	           xmlMemBlocks() - mem_base);
50117	    test_ret++;
50118            printf(" %d", n_ctxt);
50119            printf(" %d", n_nargs);
50120            printf("\n");
50121        }
50122    }
50123    }
50124    function_tests++;
50125#endif
50126
50127    return(test_ret);
50128}
50129
50130
50131static int
50132test_xmlXPathTrailing(void) {
50133    int test_ret = 0;
50134
50135#if defined(LIBXML_XPATH_ENABLED)
50136    int mem_base;
50137    xmlNodeSetPtr ret_val;
50138    xmlNodeSetPtr nodes1; /* a node-set */
50139    int n_nodes1;
50140    xmlNodeSetPtr nodes2; /* a node-set */
50141    int n_nodes2;
50142
50143    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50144    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50145        mem_base = xmlMemBlocks();
50146        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50147        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50148
50149        ret_val = xmlXPathTrailing(nodes1, nodes2);
50150        desret_xmlNodeSetPtr(ret_val);
50151        call_tests++;
50152        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50153        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50154        xmlResetLastError();
50155        if (mem_base != xmlMemBlocks()) {
50156            printf("Leak of %d blocks found in xmlXPathTrailing",
50157	           xmlMemBlocks() - mem_base);
50158	    test_ret++;
50159            printf(" %d", n_nodes1);
50160            printf(" %d", n_nodes2);
50161            printf("\n");
50162        }
50163    }
50164    }
50165    function_tests++;
50166#endif
50167
50168    return(test_ret);
50169}
50170
50171
50172static int
50173test_xmlXPathTrailingSorted(void) {
50174    int test_ret = 0;
50175
50176#if defined(LIBXML_XPATH_ENABLED)
50177    int mem_base;
50178    xmlNodeSetPtr ret_val;
50179    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50180    int n_nodes1;
50181    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50182    int n_nodes2;
50183
50184    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50185    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50186        mem_base = xmlMemBlocks();
50187        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50188        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50189
50190        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50191        desret_xmlNodeSetPtr(ret_val);
50192        call_tests++;
50193        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50194        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50195        xmlResetLastError();
50196        if (mem_base != xmlMemBlocks()) {
50197            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50198	           xmlMemBlocks() - mem_base);
50199	    test_ret++;
50200            printf(" %d", n_nodes1);
50201            printf(" %d", n_nodes2);
50202            printf("\n");
50203        }
50204    }
50205    }
50206    function_tests++;
50207#endif
50208
50209    return(test_ret);
50210}
50211
50212
50213static int
50214test_xmlXPathTranslateFunction(void) {
50215    int test_ret = 0;
50216
50217#if defined(LIBXML_XPATH_ENABLED)
50218    int mem_base;
50219    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50220    int n_ctxt;
50221    int nargs; /* the number of arguments */
50222    int n_nargs;
50223
50224    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50225    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50226        mem_base = xmlMemBlocks();
50227        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50228        nargs = gen_int(n_nargs, 1);
50229
50230        xmlXPathTranslateFunction(ctxt, nargs);
50231        call_tests++;
50232        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50233        des_int(n_nargs, nargs, 1);
50234        xmlResetLastError();
50235        if (mem_base != xmlMemBlocks()) {
50236            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50237	           xmlMemBlocks() - mem_base);
50238	    test_ret++;
50239            printf(" %d", n_ctxt);
50240            printf(" %d", n_nargs);
50241            printf("\n");
50242        }
50243    }
50244    }
50245    function_tests++;
50246#endif
50247
50248    return(test_ret);
50249}
50250
50251
50252static int
50253test_xmlXPathTrueFunction(void) {
50254    int test_ret = 0;
50255
50256#if defined(LIBXML_XPATH_ENABLED)
50257    int mem_base;
50258    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50259    int n_ctxt;
50260    int nargs; /* the number of arguments */
50261    int n_nargs;
50262
50263    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50264    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50265        mem_base = xmlMemBlocks();
50266        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50267        nargs = gen_int(n_nargs, 1);
50268
50269        xmlXPathTrueFunction(ctxt, nargs);
50270        call_tests++;
50271        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50272        des_int(n_nargs, nargs, 1);
50273        xmlResetLastError();
50274        if (mem_base != xmlMemBlocks()) {
50275            printf("Leak of %d blocks found in xmlXPathTrueFunction",
50276	           xmlMemBlocks() - mem_base);
50277	    test_ret++;
50278            printf(" %d", n_ctxt);
50279            printf(" %d", n_nargs);
50280            printf("\n");
50281        }
50282    }
50283    }
50284    function_tests++;
50285#endif
50286
50287    return(test_ret);
50288}
50289
50290
50291static int
50292test_xmlXPathValueFlipSign(void) {
50293    int test_ret = 0;
50294
50295#if defined(LIBXML_XPATH_ENABLED)
50296    int mem_base;
50297    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50298    int n_ctxt;
50299
50300    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50301        mem_base = xmlMemBlocks();
50302        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50303
50304        xmlXPathValueFlipSign(ctxt);
50305        call_tests++;
50306        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50307        xmlResetLastError();
50308        if (mem_base != xmlMemBlocks()) {
50309            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50310	           xmlMemBlocks() - mem_base);
50311	    test_ret++;
50312            printf(" %d", n_ctxt);
50313            printf("\n");
50314        }
50315    }
50316    function_tests++;
50317#endif
50318
50319    return(test_ret);
50320}
50321
50322
50323static int
50324test_xmlXPathVariableLookup(void) {
50325    int test_ret = 0;
50326
50327#if defined(LIBXML_XPATH_ENABLED)
50328    int mem_base;
50329    xmlXPathObjectPtr ret_val;
50330    xmlXPathContextPtr ctxt; /* the XPath context */
50331    int n_ctxt;
50332    xmlChar * name; /* the variable name */
50333    int n_name;
50334
50335    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50336    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50337        mem_base = xmlMemBlocks();
50338        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50339        name = gen_const_xmlChar_ptr(n_name, 1);
50340
50341        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50342        desret_xmlXPathObjectPtr(ret_val);
50343        call_tests++;
50344        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50345        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50346        xmlResetLastError();
50347        if (mem_base != xmlMemBlocks()) {
50348            printf("Leak of %d blocks found in xmlXPathVariableLookup",
50349	           xmlMemBlocks() - mem_base);
50350	    test_ret++;
50351            printf(" %d", n_ctxt);
50352            printf(" %d", n_name);
50353            printf("\n");
50354        }
50355    }
50356    }
50357    function_tests++;
50358#endif
50359
50360    return(test_ret);
50361}
50362
50363
50364static int
50365test_xmlXPathVariableLookupNS(void) {
50366    int test_ret = 0;
50367
50368#if defined(LIBXML_XPATH_ENABLED)
50369    int mem_base;
50370    xmlXPathObjectPtr ret_val;
50371    xmlXPathContextPtr ctxt; /* the XPath context */
50372    int n_ctxt;
50373    xmlChar * name; /* the variable name */
50374    int n_name;
50375    xmlChar * ns_uri; /* the variable namespace URI */
50376    int n_ns_uri;
50377
50378    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50379    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50380    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50381        mem_base = xmlMemBlocks();
50382        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50383        name = gen_const_xmlChar_ptr(n_name, 1);
50384        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50385
50386        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50387        desret_xmlXPathObjectPtr(ret_val);
50388        call_tests++;
50389        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50390        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50391        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50392        xmlResetLastError();
50393        if (mem_base != xmlMemBlocks()) {
50394            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50395	           xmlMemBlocks() - mem_base);
50396	    test_ret++;
50397            printf(" %d", n_ctxt);
50398            printf(" %d", n_name);
50399            printf(" %d", n_ns_uri);
50400            printf("\n");
50401        }
50402    }
50403    }
50404    }
50405    function_tests++;
50406#endif
50407
50408    return(test_ret);
50409}
50410
50411
50412static int
50413test_xmlXPathWrapCString(void) {
50414    int test_ret = 0;
50415
50416#if defined(LIBXML_XPATH_ENABLED)
50417    int mem_base;
50418    xmlXPathObjectPtr ret_val;
50419    char * val; /* the char * value */
50420    int n_val;
50421
50422    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50423        mem_base = xmlMemBlocks();
50424        val = gen_char_ptr(n_val, 0);
50425
50426        ret_val = xmlXPathWrapCString(val);
50427        desret_xmlXPathObjectPtr(ret_val);
50428        call_tests++;
50429        des_char_ptr(n_val, val, 0);
50430        xmlResetLastError();
50431        if (mem_base != xmlMemBlocks()) {
50432            printf("Leak of %d blocks found in xmlXPathWrapCString",
50433	           xmlMemBlocks() - mem_base);
50434	    test_ret++;
50435            printf(" %d", n_val);
50436            printf("\n");
50437        }
50438    }
50439    function_tests++;
50440#endif
50441
50442    return(test_ret);
50443}
50444
50445
50446static int
50447test_xmlXPathWrapExternal(void) {
50448    int test_ret = 0;
50449
50450#if defined(LIBXML_XPATH_ENABLED)
50451    int mem_base;
50452    xmlXPathObjectPtr ret_val;
50453    void * val; /* the user data */
50454    int n_val;
50455
50456    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50457        mem_base = xmlMemBlocks();
50458        val = gen_void_ptr(n_val, 0);
50459
50460        ret_val = xmlXPathWrapExternal(val);
50461        desret_xmlXPathObjectPtr(ret_val);
50462        call_tests++;
50463        des_void_ptr(n_val, val, 0);
50464        xmlResetLastError();
50465        if (mem_base != xmlMemBlocks()) {
50466            printf("Leak of %d blocks found in xmlXPathWrapExternal",
50467	           xmlMemBlocks() - mem_base);
50468	    test_ret++;
50469            printf(" %d", n_val);
50470            printf("\n");
50471        }
50472    }
50473    function_tests++;
50474#endif
50475
50476    return(test_ret);
50477}
50478
50479
50480static int
50481test_xmlXPathWrapNodeSet(void) {
50482    int test_ret = 0;
50483
50484#if defined(LIBXML_XPATH_ENABLED)
50485    int mem_base;
50486    xmlXPathObjectPtr ret_val;
50487    xmlNodeSetPtr val; /* the NodePtr value */
50488    int n_val;
50489
50490    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50491        mem_base = xmlMemBlocks();
50492        val = gen_xmlNodeSetPtr(n_val, 0);
50493
50494        ret_val = xmlXPathWrapNodeSet(val);
50495        desret_xmlXPathObjectPtr(ret_val);
50496        call_tests++;
50497        des_xmlNodeSetPtr(n_val, val, 0);
50498        xmlResetLastError();
50499        if (mem_base != xmlMemBlocks()) {
50500            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50501	           xmlMemBlocks() - mem_base);
50502	    test_ret++;
50503            printf(" %d", n_val);
50504            printf("\n");
50505        }
50506    }
50507    function_tests++;
50508#endif
50509
50510    return(test_ret);
50511}
50512
50513
50514static int
50515test_xmlXPatherror(void) {
50516    int test_ret = 0;
50517
50518#if defined(LIBXML_XPATH_ENABLED)
50519    int mem_base;
50520    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50521    int n_ctxt;
50522    const char * file; /* the file name */
50523    int n_file;
50524    int line; /* the line number */
50525    int n_line;
50526    int no; /* the error number */
50527    int n_no;
50528
50529    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50530    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50531    for (n_line = 0;n_line < gen_nb_int;n_line++) {
50532    for (n_no = 0;n_no < gen_nb_int;n_no++) {
50533        mem_base = xmlMemBlocks();
50534        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50535        file = gen_filepath(n_file, 1);
50536        line = gen_int(n_line, 2);
50537        no = gen_int(n_no, 3);
50538
50539        xmlXPatherror(ctxt, file, line, no);
50540        call_tests++;
50541        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50542        des_filepath(n_file, file, 1);
50543        des_int(n_line, line, 2);
50544        des_int(n_no, no, 3);
50545        xmlResetLastError();
50546        if (mem_base != xmlMemBlocks()) {
50547            printf("Leak of %d blocks found in xmlXPatherror",
50548	           xmlMemBlocks() - mem_base);
50549	    test_ret++;
50550            printf(" %d", n_ctxt);
50551            printf(" %d", n_file);
50552            printf(" %d", n_line);
50553            printf(" %d", n_no);
50554            printf("\n");
50555        }
50556    }
50557    }
50558    }
50559    }
50560    function_tests++;
50561#endif
50562
50563    return(test_ret);
50564}
50565
50566static int
50567test_xpathInternals(void) {
50568    int test_ret = 0;
50569
50570    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50571    test_ret += test_valuePop();
50572    test_ret += test_valuePush();
50573    test_ret += test_xmlXPathAddValues();
50574    test_ret += test_xmlXPathBooleanFunction();
50575    test_ret += test_xmlXPathCeilingFunction();
50576    test_ret += test_xmlXPathCompareValues();
50577    test_ret += test_xmlXPathConcatFunction();
50578    test_ret += test_xmlXPathContainsFunction();
50579    test_ret += test_xmlXPathCountFunction();
50580    test_ret += test_xmlXPathDebugDumpCompExpr();
50581    test_ret += test_xmlXPathDebugDumpObject();
50582    test_ret += test_xmlXPathDifference();
50583    test_ret += test_xmlXPathDistinct();
50584    test_ret += test_xmlXPathDistinctSorted();
50585    test_ret += test_xmlXPathDivValues();
50586    test_ret += test_xmlXPathEqualValues();
50587    test_ret += test_xmlXPathErr();
50588    test_ret += test_xmlXPathEvalExpr();
50589    test_ret += test_xmlXPathEvaluatePredicateResult();
50590    test_ret += test_xmlXPathFalseFunction();
50591    test_ret += test_xmlXPathFloorFunction();
50592    test_ret += test_xmlXPathFunctionLookup();
50593    test_ret += test_xmlXPathFunctionLookupNS();
50594    test_ret += test_xmlXPathHasSameNodes();
50595    test_ret += test_xmlXPathIdFunction();
50596    test_ret += test_xmlXPathIntersection();
50597    test_ret += test_xmlXPathIsNodeType();
50598    test_ret += test_xmlXPathLangFunction();
50599    test_ret += test_xmlXPathLastFunction();
50600    test_ret += test_xmlXPathLeading();
50601    test_ret += test_xmlXPathLeadingSorted();
50602    test_ret += test_xmlXPathLocalNameFunction();
50603    test_ret += test_xmlXPathModValues();
50604    test_ret += test_xmlXPathMultValues();
50605    test_ret += test_xmlXPathNamespaceURIFunction();
50606    test_ret += test_xmlXPathNewBoolean();
50607    test_ret += test_xmlXPathNewCString();
50608    test_ret += test_xmlXPathNewFloat();
50609    test_ret += test_xmlXPathNewNodeSet();
50610    test_ret += test_xmlXPathNewNodeSetList();
50611    test_ret += test_xmlXPathNewParserContext();
50612    test_ret += test_xmlXPathNewString();
50613    test_ret += test_xmlXPathNextAncestor();
50614    test_ret += test_xmlXPathNextAncestorOrSelf();
50615    test_ret += test_xmlXPathNextAttribute();
50616    test_ret += test_xmlXPathNextChild();
50617    test_ret += test_xmlXPathNextDescendant();
50618    test_ret += test_xmlXPathNextDescendantOrSelf();
50619    test_ret += test_xmlXPathNextFollowing();
50620    test_ret += test_xmlXPathNextFollowingSibling();
50621    test_ret += test_xmlXPathNextNamespace();
50622    test_ret += test_xmlXPathNextParent();
50623    test_ret += test_xmlXPathNextPreceding();
50624    test_ret += test_xmlXPathNextPrecedingSibling();
50625    test_ret += test_xmlXPathNextSelf();
50626    test_ret += test_xmlXPathNodeLeading();
50627    test_ret += test_xmlXPathNodeLeadingSorted();
50628    test_ret += test_xmlXPathNodeSetAdd();
50629    test_ret += test_xmlXPathNodeSetAddNs();
50630    test_ret += test_xmlXPathNodeSetAddUnique();
50631    test_ret += test_xmlXPathNodeSetContains();
50632    test_ret += test_xmlXPathNodeSetDel();
50633    test_ret += test_xmlXPathNodeSetMerge();
50634    test_ret += test_xmlXPathNodeSetRemove();
50635    test_ret += test_xmlXPathNodeSetSort();
50636    test_ret += test_xmlXPathNodeTrailing();
50637    test_ret += test_xmlXPathNodeTrailingSorted();
50638    test_ret += test_xmlXPathNormalizeFunction();
50639    test_ret += test_xmlXPathNotEqualValues();
50640    test_ret += test_xmlXPathNotFunction();
50641    test_ret += test_xmlXPathNsLookup();
50642    test_ret += test_xmlXPathNumberFunction();
50643    test_ret += test_xmlXPathParseNCName();
50644    test_ret += test_xmlXPathParseName();
50645    test_ret += test_xmlXPathPopBoolean();
50646    test_ret += test_xmlXPathPopExternal();
50647    test_ret += test_xmlXPathPopNodeSet();
50648    test_ret += test_xmlXPathPopNumber();
50649    test_ret += test_xmlXPathPopString();
50650    test_ret += test_xmlXPathPositionFunction();
50651    test_ret += test_xmlXPathRegisterAllFunctions();
50652    test_ret += test_xmlXPathRegisterFunc();
50653    test_ret += test_xmlXPathRegisterFuncLookup();
50654    test_ret += test_xmlXPathRegisterFuncNS();
50655    test_ret += test_xmlXPathRegisterNs();
50656    test_ret += test_xmlXPathRegisterVariable();
50657    test_ret += test_xmlXPathRegisterVariableLookup();
50658    test_ret += test_xmlXPathRegisterVariableNS();
50659    test_ret += test_xmlXPathRegisteredFuncsCleanup();
50660    test_ret += test_xmlXPathRegisteredNsCleanup();
50661    test_ret += test_xmlXPathRegisteredVariablesCleanup();
50662    test_ret += test_xmlXPathRoot();
50663    test_ret += test_xmlXPathRoundFunction();
50664    test_ret += test_xmlXPathStartsWithFunction();
50665    test_ret += test_xmlXPathStringEvalNumber();
50666    test_ret += test_xmlXPathStringFunction();
50667    test_ret += test_xmlXPathStringLengthFunction();
50668    test_ret += test_xmlXPathSubValues();
50669    test_ret += test_xmlXPathSubstringAfterFunction();
50670    test_ret += test_xmlXPathSubstringBeforeFunction();
50671    test_ret += test_xmlXPathSubstringFunction();
50672    test_ret += test_xmlXPathSumFunction();
50673    test_ret += test_xmlXPathTrailing();
50674    test_ret += test_xmlXPathTrailingSorted();
50675    test_ret += test_xmlXPathTranslateFunction();
50676    test_ret += test_xmlXPathTrueFunction();
50677    test_ret += test_xmlXPathValueFlipSign();
50678    test_ret += test_xmlXPathVariableLookup();
50679    test_ret += test_xmlXPathVariableLookupNS();
50680    test_ret += test_xmlXPathWrapCString();
50681    test_ret += test_xmlXPathWrapExternal();
50682    test_ret += test_xmlXPathWrapNodeSet();
50683    test_ret += test_xmlXPatherror();
50684
50685    if (test_ret != 0)
50686	printf("Module xpathInternals: %d errors\n", test_ret);
50687    return(test_ret);
50688}
50689
50690static int
50691test_xmlXPtrBuildNodeList(void) {
50692    int test_ret = 0;
50693
50694#if defined(LIBXML_XPTR_ENABLED)
50695    int mem_base;
50696    xmlNodePtr ret_val;
50697    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50698    int n_obj;
50699
50700    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50701        mem_base = xmlMemBlocks();
50702        obj = gen_xmlXPathObjectPtr(n_obj, 0);
50703
50704        ret_val = xmlXPtrBuildNodeList(obj);
50705        desret_xmlNodePtr(ret_val);
50706        call_tests++;
50707        des_xmlXPathObjectPtr(n_obj, obj, 0);
50708        xmlResetLastError();
50709        if (mem_base != xmlMemBlocks()) {
50710            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50711	           xmlMemBlocks() - mem_base);
50712	    test_ret++;
50713            printf(" %d", n_obj);
50714            printf("\n");
50715        }
50716    }
50717    function_tests++;
50718#endif
50719
50720    return(test_ret);
50721}
50722
50723
50724static int
50725test_xmlXPtrEval(void) {
50726    int test_ret = 0;
50727
50728#if defined(LIBXML_XPTR_ENABLED)
50729    int mem_base;
50730    xmlXPathObjectPtr ret_val;
50731    xmlChar * str; /* the XPointer expression */
50732    int n_str;
50733    xmlXPathContextPtr ctx; /* the XPointer context */
50734    int n_ctx;
50735
50736    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50737    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50738        mem_base = xmlMemBlocks();
50739        str = gen_const_xmlChar_ptr(n_str, 0);
50740        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50741
50742        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50743        desret_xmlXPathObjectPtr(ret_val);
50744        call_tests++;
50745        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50746        des_xmlXPathContextPtr(n_ctx, ctx, 1);
50747        xmlResetLastError();
50748        if (mem_base != xmlMemBlocks()) {
50749            printf("Leak of %d blocks found in xmlXPtrEval",
50750	           xmlMemBlocks() - mem_base);
50751	    test_ret++;
50752            printf(" %d", n_str);
50753            printf(" %d", n_ctx);
50754            printf("\n");
50755        }
50756    }
50757    }
50758    function_tests++;
50759#endif
50760
50761    return(test_ret);
50762}
50763
50764
50765static int
50766test_xmlXPtrEvalRangePredicate(void) {
50767    int test_ret = 0;
50768
50769#if defined(LIBXML_XPTR_ENABLED)
50770    int mem_base;
50771    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50772    int n_ctxt;
50773
50774    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50775        mem_base = xmlMemBlocks();
50776        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50777
50778        xmlXPtrEvalRangePredicate(ctxt);
50779        call_tests++;
50780        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50781        xmlResetLastError();
50782        if (mem_base != xmlMemBlocks()) {
50783            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50784	           xmlMemBlocks() - mem_base);
50785	    test_ret++;
50786            printf(" %d", n_ctxt);
50787            printf("\n");
50788        }
50789    }
50790    function_tests++;
50791#endif
50792
50793    return(test_ret);
50794}
50795
50796#ifdef LIBXML_XPTR_ENABLED
50797
50798#define gen_nb_xmlLocationSetPtr 1
50799static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50800    return(NULL);
50801}
50802static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50803}
50804#endif
50805
50806
50807static int
50808test_xmlXPtrLocationSetAdd(void) {
50809    int test_ret = 0;
50810
50811#if defined(LIBXML_XPTR_ENABLED)
50812    int mem_base;
50813    xmlLocationSetPtr cur; /* the initial range set */
50814    int n_cur;
50815    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50816    int n_val;
50817
50818    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50819    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50820        mem_base = xmlMemBlocks();
50821        cur = gen_xmlLocationSetPtr(n_cur, 0);
50822        val = gen_xmlXPathObjectPtr(n_val, 1);
50823
50824        xmlXPtrLocationSetAdd(cur, val);
50825        call_tests++;
50826        des_xmlLocationSetPtr(n_cur, cur, 0);
50827        des_xmlXPathObjectPtr(n_val, val, 1);
50828        xmlResetLastError();
50829        if (mem_base != xmlMemBlocks()) {
50830            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
50831	           xmlMemBlocks() - mem_base);
50832	    test_ret++;
50833            printf(" %d", n_cur);
50834            printf(" %d", n_val);
50835            printf("\n");
50836        }
50837    }
50838    }
50839    function_tests++;
50840#endif
50841
50842    return(test_ret);
50843}
50844
50845
50846static int
50847test_xmlXPtrLocationSetCreate(void) {
50848    int test_ret = 0;
50849
50850
50851    /* missing type support */
50852    return(test_ret);
50853}
50854
50855
50856static int
50857test_xmlXPtrLocationSetDel(void) {
50858    int test_ret = 0;
50859
50860#if defined(LIBXML_XPTR_ENABLED)
50861    int mem_base;
50862    xmlLocationSetPtr cur; /* the initial range set */
50863    int n_cur;
50864    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
50865    int n_val;
50866
50867    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50868    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50869        mem_base = xmlMemBlocks();
50870        cur = gen_xmlLocationSetPtr(n_cur, 0);
50871        val = gen_xmlXPathObjectPtr(n_val, 1);
50872
50873        xmlXPtrLocationSetDel(cur, val);
50874        call_tests++;
50875        des_xmlLocationSetPtr(n_cur, cur, 0);
50876        des_xmlXPathObjectPtr(n_val, val, 1);
50877        xmlResetLastError();
50878        if (mem_base != xmlMemBlocks()) {
50879            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
50880	           xmlMemBlocks() - mem_base);
50881	    test_ret++;
50882            printf(" %d", n_cur);
50883            printf(" %d", n_val);
50884            printf("\n");
50885        }
50886    }
50887    }
50888    function_tests++;
50889#endif
50890
50891    return(test_ret);
50892}
50893
50894
50895static int
50896test_xmlXPtrLocationSetMerge(void) {
50897    int test_ret = 0;
50898
50899
50900    /* missing type support */
50901    return(test_ret);
50902}
50903
50904
50905static int
50906test_xmlXPtrLocationSetRemove(void) {
50907    int test_ret = 0;
50908
50909#if defined(LIBXML_XPTR_ENABLED)
50910    int mem_base;
50911    xmlLocationSetPtr cur; /* the initial range set */
50912    int n_cur;
50913    int val; /* the index to remove */
50914    int n_val;
50915
50916    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50917    for (n_val = 0;n_val < gen_nb_int;n_val++) {
50918        mem_base = xmlMemBlocks();
50919        cur = gen_xmlLocationSetPtr(n_cur, 0);
50920        val = gen_int(n_val, 1);
50921
50922        xmlXPtrLocationSetRemove(cur, val);
50923        call_tests++;
50924        des_xmlLocationSetPtr(n_cur, cur, 0);
50925        des_int(n_val, val, 1);
50926        xmlResetLastError();
50927        if (mem_base != xmlMemBlocks()) {
50928            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
50929	           xmlMemBlocks() - mem_base);
50930	    test_ret++;
50931            printf(" %d", n_cur);
50932            printf(" %d", n_val);
50933            printf("\n");
50934        }
50935    }
50936    }
50937    function_tests++;
50938#endif
50939
50940    return(test_ret);
50941}
50942
50943
50944static int
50945test_xmlXPtrNewCollapsedRange(void) {
50946    int test_ret = 0;
50947
50948#if defined(LIBXML_XPTR_ENABLED)
50949    int mem_base;
50950    xmlXPathObjectPtr ret_val;
50951    xmlNodePtr start; /* the starting and ending node */
50952    int n_start;
50953
50954    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50955        mem_base = xmlMemBlocks();
50956        start = gen_xmlNodePtr(n_start, 0);
50957
50958        ret_val = xmlXPtrNewCollapsedRange(start);
50959        desret_xmlXPathObjectPtr(ret_val);
50960        call_tests++;
50961        des_xmlNodePtr(n_start, start, 0);
50962        xmlResetLastError();
50963        if (mem_base != xmlMemBlocks()) {
50964            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
50965	           xmlMemBlocks() - mem_base);
50966	    test_ret++;
50967            printf(" %d", n_start);
50968            printf("\n");
50969        }
50970    }
50971    function_tests++;
50972#endif
50973
50974    return(test_ret);
50975}
50976
50977
50978static int
50979test_xmlXPtrNewContext(void) {
50980    int test_ret = 0;
50981
50982
50983    /* missing type support */
50984    return(test_ret);
50985}
50986
50987
50988static int
50989test_xmlXPtrNewLocationSetNodeSet(void) {
50990    int test_ret = 0;
50991
50992#if defined(LIBXML_XPTR_ENABLED)
50993    int mem_base;
50994    xmlXPathObjectPtr ret_val;
50995    xmlNodeSetPtr set; /* a node set */
50996    int n_set;
50997
50998    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
50999        mem_base = xmlMemBlocks();
51000        set = gen_xmlNodeSetPtr(n_set, 0);
51001
51002        ret_val = xmlXPtrNewLocationSetNodeSet(set);
51003        desret_xmlXPathObjectPtr(ret_val);
51004        call_tests++;
51005        des_xmlNodeSetPtr(n_set, set, 0);
51006        xmlResetLastError();
51007        if (mem_base != xmlMemBlocks()) {
51008            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51009	           xmlMemBlocks() - mem_base);
51010	    test_ret++;
51011            printf(" %d", n_set);
51012            printf("\n");
51013        }
51014    }
51015    function_tests++;
51016#endif
51017
51018    return(test_ret);
51019}
51020
51021
51022static int
51023test_xmlXPtrNewLocationSetNodes(void) {
51024    int test_ret = 0;
51025
51026#if defined(LIBXML_XPTR_ENABLED)
51027    int mem_base;
51028    xmlXPathObjectPtr ret_val;
51029    xmlNodePtr start; /* the start NodePtr value */
51030    int n_start;
51031    xmlNodePtr end; /* the end NodePtr value or NULL */
51032    int n_end;
51033
51034    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51035    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51036        mem_base = xmlMemBlocks();
51037        start = gen_xmlNodePtr(n_start, 0);
51038        end = gen_xmlNodePtr(n_end, 1);
51039
51040        ret_val = xmlXPtrNewLocationSetNodes(start, end);
51041        desret_xmlXPathObjectPtr(ret_val);
51042        call_tests++;
51043        des_xmlNodePtr(n_start, start, 0);
51044        des_xmlNodePtr(n_end, end, 1);
51045        xmlResetLastError();
51046        if (mem_base != xmlMemBlocks()) {
51047            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51048	           xmlMemBlocks() - mem_base);
51049	    test_ret++;
51050            printf(" %d", n_start);
51051            printf(" %d", n_end);
51052            printf("\n");
51053        }
51054    }
51055    }
51056    function_tests++;
51057#endif
51058
51059    return(test_ret);
51060}
51061
51062
51063static int
51064test_xmlXPtrNewRange(void) {
51065    int test_ret = 0;
51066
51067#if defined(LIBXML_XPTR_ENABLED)
51068    int mem_base;
51069    xmlXPathObjectPtr ret_val;
51070    xmlNodePtr start; /* the starting node */
51071    int n_start;
51072    int startindex; /* the start index */
51073    int n_startindex;
51074    xmlNodePtr end; /* the ending point */
51075    int n_end;
51076    int endindex; /* the ending index */
51077    int n_endindex;
51078
51079    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51080    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51081    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51082    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51083        mem_base = xmlMemBlocks();
51084        start = gen_xmlNodePtr(n_start, 0);
51085        startindex = gen_int(n_startindex, 1);
51086        end = gen_xmlNodePtr(n_end, 2);
51087        endindex = gen_int(n_endindex, 3);
51088
51089        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51090        desret_xmlXPathObjectPtr(ret_val);
51091        call_tests++;
51092        des_xmlNodePtr(n_start, start, 0);
51093        des_int(n_startindex, startindex, 1);
51094        des_xmlNodePtr(n_end, end, 2);
51095        des_int(n_endindex, endindex, 3);
51096        xmlResetLastError();
51097        if (mem_base != xmlMemBlocks()) {
51098            printf("Leak of %d blocks found in xmlXPtrNewRange",
51099	           xmlMemBlocks() - mem_base);
51100	    test_ret++;
51101            printf(" %d", n_start);
51102            printf(" %d", n_startindex);
51103            printf(" %d", n_end);
51104            printf(" %d", n_endindex);
51105            printf("\n");
51106        }
51107    }
51108    }
51109    }
51110    }
51111    function_tests++;
51112#endif
51113
51114    return(test_ret);
51115}
51116
51117
51118static int
51119test_xmlXPtrNewRangeNodeObject(void) {
51120    int test_ret = 0;
51121
51122#if defined(LIBXML_XPTR_ENABLED)
51123    int mem_base;
51124    xmlXPathObjectPtr ret_val;
51125    xmlNodePtr start; /* the starting node */
51126    int n_start;
51127    xmlXPathObjectPtr end; /* the ending object */
51128    int n_end;
51129
51130    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51131    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51132        mem_base = xmlMemBlocks();
51133        start = gen_xmlNodePtr(n_start, 0);
51134        end = gen_xmlXPathObjectPtr(n_end, 1);
51135
51136        ret_val = xmlXPtrNewRangeNodeObject(start, end);
51137        desret_xmlXPathObjectPtr(ret_val);
51138        call_tests++;
51139        des_xmlNodePtr(n_start, start, 0);
51140        des_xmlXPathObjectPtr(n_end, end, 1);
51141        xmlResetLastError();
51142        if (mem_base != xmlMemBlocks()) {
51143            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51144	           xmlMemBlocks() - mem_base);
51145	    test_ret++;
51146            printf(" %d", n_start);
51147            printf(" %d", n_end);
51148            printf("\n");
51149        }
51150    }
51151    }
51152    function_tests++;
51153#endif
51154
51155    return(test_ret);
51156}
51157
51158
51159static int
51160test_xmlXPtrNewRangeNodePoint(void) {
51161    int test_ret = 0;
51162
51163#if defined(LIBXML_XPTR_ENABLED)
51164    int mem_base;
51165    xmlXPathObjectPtr ret_val;
51166    xmlNodePtr start; /* the starting node */
51167    int n_start;
51168    xmlXPathObjectPtr end; /* the ending point */
51169    int n_end;
51170
51171    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51172    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51173        mem_base = xmlMemBlocks();
51174        start = gen_xmlNodePtr(n_start, 0);
51175        end = gen_xmlXPathObjectPtr(n_end, 1);
51176
51177        ret_val = xmlXPtrNewRangeNodePoint(start, end);
51178        desret_xmlXPathObjectPtr(ret_val);
51179        call_tests++;
51180        des_xmlNodePtr(n_start, start, 0);
51181        des_xmlXPathObjectPtr(n_end, end, 1);
51182        xmlResetLastError();
51183        if (mem_base != xmlMemBlocks()) {
51184            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51185	           xmlMemBlocks() - mem_base);
51186	    test_ret++;
51187            printf(" %d", n_start);
51188            printf(" %d", n_end);
51189            printf("\n");
51190        }
51191    }
51192    }
51193    function_tests++;
51194#endif
51195
51196    return(test_ret);
51197}
51198
51199
51200static int
51201test_xmlXPtrNewRangeNodes(void) {
51202    int test_ret = 0;
51203
51204#if defined(LIBXML_XPTR_ENABLED)
51205    int mem_base;
51206    xmlXPathObjectPtr ret_val;
51207    xmlNodePtr start; /* the starting node */
51208    int n_start;
51209    xmlNodePtr end; /* the ending node */
51210    int n_end;
51211
51212    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51213    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51214        mem_base = xmlMemBlocks();
51215        start = gen_xmlNodePtr(n_start, 0);
51216        end = gen_xmlNodePtr(n_end, 1);
51217
51218        ret_val = xmlXPtrNewRangeNodes(start, end);
51219        desret_xmlXPathObjectPtr(ret_val);
51220        call_tests++;
51221        des_xmlNodePtr(n_start, start, 0);
51222        des_xmlNodePtr(n_end, end, 1);
51223        xmlResetLastError();
51224        if (mem_base != xmlMemBlocks()) {
51225            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51226	           xmlMemBlocks() - mem_base);
51227	    test_ret++;
51228            printf(" %d", n_start);
51229            printf(" %d", n_end);
51230            printf("\n");
51231        }
51232    }
51233    }
51234    function_tests++;
51235#endif
51236
51237    return(test_ret);
51238}
51239
51240
51241static int
51242test_xmlXPtrNewRangePointNode(void) {
51243    int test_ret = 0;
51244
51245#if defined(LIBXML_XPTR_ENABLED)
51246    int mem_base;
51247    xmlXPathObjectPtr ret_val;
51248    xmlXPathObjectPtr start; /* the starting point */
51249    int n_start;
51250    xmlNodePtr end; /* the ending node */
51251    int n_end;
51252
51253    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51254    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51255        mem_base = xmlMemBlocks();
51256        start = gen_xmlXPathObjectPtr(n_start, 0);
51257        end = gen_xmlNodePtr(n_end, 1);
51258
51259        ret_val = xmlXPtrNewRangePointNode(start, end);
51260        desret_xmlXPathObjectPtr(ret_val);
51261        call_tests++;
51262        des_xmlXPathObjectPtr(n_start, start, 0);
51263        des_xmlNodePtr(n_end, end, 1);
51264        xmlResetLastError();
51265        if (mem_base != xmlMemBlocks()) {
51266            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51267	           xmlMemBlocks() - mem_base);
51268	    test_ret++;
51269            printf(" %d", n_start);
51270            printf(" %d", n_end);
51271            printf("\n");
51272        }
51273    }
51274    }
51275    function_tests++;
51276#endif
51277
51278    return(test_ret);
51279}
51280
51281
51282static int
51283test_xmlXPtrNewRangePoints(void) {
51284    int test_ret = 0;
51285
51286#if defined(LIBXML_XPTR_ENABLED)
51287    int mem_base;
51288    xmlXPathObjectPtr ret_val;
51289    xmlXPathObjectPtr start; /* the starting point */
51290    int n_start;
51291    xmlXPathObjectPtr end; /* the ending point */
51292    int n_end;
51293
51294    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51295    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51296        mem_base = xmlMemBlocks();
51297        start = gen_xmlXPathObjectPtr(n_start, 0);
51298        end = gen_xmlXPathObjectPtr(n_end, 1);
51299
51300        ret_val = xmlXPtrNewRangePoints(start, end);
51301        desret_xmlXPathObjectPtr(ret_val);
51302        call_tests++;
51303        des_xmlXPathObjectPtr(n_start, start, 0);
51304        des_xmlXPathObjectPtr(n_end, end, 1);
51305        xmlResetLastError();
51306        if (mem_base != xmlMemBlocks()) {
51307            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51308	           xmlMemBlocks() - mem_base);
51309	    test_ret++;
51310            printf(" %d", n_start);
51311            printf(" %d", n_end);
51312            printf("\n");
51313        }
51314    }
51315    }
51316    function_tests++;
51317#endif
51318
51319    return(test_ret);
51320}
51321
51322
51323static int
51324test_xmlXPtrRangeToFunction(void) {
51325    int test_ret = 0;
51326
51327#if defined(LIBXML_XPTR_ENABLED)
51328    int mem_base;
51329    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51330    int n_ctxt;
51331    int nargs; /* the number of args */
51332    int n_nargs;
51333
51334    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51335    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51336        mem_base = xmlMemBlocks();
51337        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51338        nargs = gen_int(n_nargs, 1);
51339
51340        xmlXPtrRangeToFunction(ctxt, nargs);
51341        call_tests++;
51342        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51343        des_int(n_nargs, nargs, 1);
51344        xmlResetLastError();
51345        if (mem_base != xmlMemBlocks()) {
51346            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51347	           xmlMemBlocks() - mem_base);
51348	    test_ret++;
51349            printf(" %d", n_ctxt);
51350            printf(" %d", n_nargs);
51351            printf("\n");
51352        }
51353    }
51354    }
51355    function_tests++;
51356#endif
51357
51358    return(test_ret);
51359}
51360
51361
51362static int
51363test_xmlXPtrWrapLocationSet(void) {
51364    int test_ret = 0;
51365
51366#if defined(LIBXML_XPTR_ENABLED)
51367    int mem_base;
51368    xmlXPathObjectPtr ret_val;
51369    xmlLocationSetPtr val; /* the LocationSet value */
51370    int n_val;
51371
51372    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51373        mem_base = xmlMemBlocks();
51374        val = gen_xmlLocationSetPtr(n_val, 0);
51375
51376        ret_val = xmlXPtrWrapLocationSet(val);
51377        desret_xmlXPathObjectPtr(ret_val);
51378        call_tests++;
51379        des_xmlLocationSetPtr(n_val, val, 0);
51380        xmlResetLastError();
51381        if (mem_base != xmlMemBlocks()) {
51382            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51383	           xmlMemBlocks() - mem_base);
51384	    test_ret++;
51385            printf(" %d", n_val);
51386            printf("\n");
51387        }
51388    }
51389    function_tests++;
51390#endif
51391
51392    return(test_ret);
51393}
51394
51395static int
51396test_xpointer(void) {
51397    int test_ret = 0;
51398
51399    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51400    test_ret += test_xmlXPtrBuildNodeList();
51401    test_ret += test_xmlXPtrEval();
51402    test_ret += test_xmlXPtrEvalRangePredicate();
51403    test_ret += test_xmlXPtrLocationSetAdd();
51404    test_ret += test_xmlXPtrLocationSetCreate();
51405    test_ret += test_xmlXPtrLocationSetDel();
51406    test_ret += test_xmlXPtrLocationSetMerge();
51407    test_ret += test_xmlXPtrLocationSetRemove();
51408    test_ret += test_xmlXPtrNewCollapsedRange();
51409    test_ret += test_xmlXPtrNewContext();
51410    test_ret += test_xmlXPtrNewLocationSetNodeSet();
51411    test_ret += test_xmlXPtrNewLocationSetNodes();
51412    test_ret += test_xmlXPtrNewRange();
51413    test_ret += test_xmlXPtrNewRangeNodeObject();
51414    test_ret += test_xmlXPtrNewRangeNodePoint();
51415    test_ret += test_xmlXPtrNewRangeNodes();
51416    test_ret += test_xmlXPtrNewRangePointNode();
51417    test_ret += test_xmlXPtrNewRangePoints();
51418    test_ret += test_xmlXPtrRangeToFunction();
51419    test_ret += test_xmlXPtrWrapLocationSet();
51420
51421    if (test_ret != 0)
51422	printf("Module xpointer: %d errors\n", test_ret);
51423    return(test_ret);
51424}
51425static int
51426test_module(const char *module) {
51427    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51428    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51429    if (!strcmp(module, "SAX2")) return(test_SAX2());
51430    if (!strcmp(module, "c14n")) return(test_c14n());
51431    if (!strcmp(module, "catalog")) return(test_catalog());
51432    if (!strcmp(module, "chvalid")) return(test_chvalid());
51433    if (!strcmp(module, "debugXML")) return(test_debugXML());
51434    if (!strcmp(module, "dict")) return(test_dict());
51435    if (!strcmp(module, "encoding")) return(test_encoding());
51436    if (!strcmp(module, "entities")) return(test_entities());
51437    if (!strcmp(module, "hash")) return(test_hash());
51438    if (!strcmp(module, "list")) return(test_list());
51439    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51440    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51441    if (!strcmp(module, "parser")) return(test_parser());
51442    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51443    if (!strcmp(module, "pattern")) return(test_pattern());
51444    if (!strcmp(module, "relaxng")) return(test_relaxng());
51445    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51446    if (!strcmp(module, "schematron")) return(test_schematron());
51447    if (!strcmp(module, "tree")) return(test_tree());
51448    if (!strcmp(module, "uri")) return(test_uri());
51449    if (!strcmp(module, "valid")) return(test_valid());
51450    if (!strcmp(module, "xinclude")) return(test_xinclude());
51451    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51452    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51453    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51454    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51455    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51456    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51457    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51458    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51459    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51460    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51461    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51462    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51463    if (!strcmp(module, "xpath")) return(test_xpath());
51464    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51465    if (!strcmp(module, "xpointer")) return(test_xpointer());
51466    return(0);
51467}
51468