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 const char *static_buf_content = "a static buffer";
603static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
604    if (no == 0) return(xmlBufferCreate());
605    if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13));
606    return(NULL);
607}
608static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) {
609    if (val != NULL) {
610        xmlBufferFree(val);
611    }
612}
613
614#define gen_nb_xmlListPtr 2
615static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) {
616    if (no == 0) return(xmlListCreate(NULL, NULL));
617    return(NULL);
618}
619static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) {
620    if (val != NULL) {
621        xmlListDelete(val);
622    }
623}
624
625#define gen_nb_xmlHashTablePtr 2
626static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) {
627    if (no == 0) return(xmlHashCreate(10));
628    return(NULL);
629}
630static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) {
631    if (val != NULL) {
632        xmlHashFree(val, NULL);
633    }
634}
635
636#include <libxml/xpathInternals.h>
637
638#ifdef LIBXML_XPATH_ENABLED
639#define gen_nb_xmlXPathObjectPtr 5
640static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) {
641    if (no == 0) return(xmlXPathNewString(BAD_CAST "string object"));
642    if (no == 1) return(xmlXPathNewFloat(1.1));
643    if (no == 2) return(xmlXPathNewBoolean(1));
644    if (no == 3) return(xmlXPathNewNodeSet(NULL));
645    return(NULL);
646}
647static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) {
648    if (val != NULL) {
649        xmlXPathFreeObject(val);
650    }
651}
652#endif
653
654#ifdef LIBXML_OUTPUT_ENABLED
655#define gen_nb_xmlOutputBufferPtr 2
656static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) {
657    if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0));
658    return(NULL);
659}
660static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) {
661    if (val != NULL) {
662        xmlOutputBufferClose(val);
663    }
664}
665#endif
666
667#ifdef LIBXML_FTP_ENABLED
668#define gen_nb_xmlNanoFTPCtxtPtr 4
669static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
670    if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
671    if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
672    if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
673    return(NULL);
674}
675static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
676    if (val != NULL) {
677        xmlNanoFTPFreeCtxt(val);
678    }
679}
680#endif
681
682#ifdef LIBXML_HTTP_ENABLED
683#define gen_nb_xmlNanoHTTPCtxtPtr 1
684static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
685    if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL));
686    if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL));
687    if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL));
688    return(NULL);
689}
690static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
691    if (val != NULL) {
692	xmlNanoHTTPClose(val);
693    }
694}
695#endif
696
697#define gen_nb_xmlCharEncoding 4
698static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) {
699    if (no == 0) return(XML_CHAR_ENCODING_UTF8);
700    if (no == 1) return(XML_CHAR_ENCODING_NONE);
701    if (no == 2) return(XML_CHAR_ENCODING_8859_1);
702    return(XML_CHAR_ENCODING_ERROR);
703}
704static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
705}
706
707#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
708
709#define gen_nb_xmlExpCtxtPtr 1
710static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
711    return(NULL);
712}
713static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
714}
715
716#define gen_nb_xmlExpNodePtr 1
717static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
718    return(NULL);
719}
720static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
721}
722
723#endif
724
725#if defined(LIBXML_SCHEMAS_ENABLED)
726#define gen_nb_xmlSchemaPtr 1
727static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
728    return(NULL);
729}
730static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
731}
732
733#define gen_nb_xmlSchemaValidCtxtPtr 1
734static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
735    return(NULL);
736}
737static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
738}
739
740#endif /* LIBXML_SCHEMAS_ENABLED */
741
742#define gen_nb_xmlHashDeallocator 2
743static void
744test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
745}
746
747static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) {
748    if (no == 0) return(test_xmlHashDeallocator);
749    return(NULL);
750}
751static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
752}
753
754
755static void desret_int(int val ATTRIBUTE_UNUSED) {
756}
757static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) {
758}
759static void desret_long(long val ATTRIBUTE_UNUSED) {
760}
761static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) {
762}
763static void desret_double(double val ATTRIBUTE_UNUSED) {
764}
765static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) {
766}
767#if 0
768static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) {
769}
770#endif
771static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) {
772}
773static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) {
774}
775static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) {
776}
777static void desret_xmlChar_ptr(xmlChar *val) {
778    if (val != NULL)
779	xmlFree(val);
780}
781static void desret_xmlDocPtr(xmlDocPtr val) {
782    if (val != api_doc)
783	xmlFreeDoc(val);
784}
785static void desret_xmlDictPtr(xmlDictPtr val) {
786    xmlDictFree(val);
787}
788#ifdef LIBXML_OUTPUT_ENABLED
789static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) {
790    xmlOutputBufferClose(val);
791}
792#endif
793#ifdef LIBXML_READER_ENABLED
794static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) {
795    xmlFreeTextReader(val);
796}
797#endif
798static void desret_xmlNodePtr(xmlNodePtr val) {
799    if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) {
800	xmlUnlinkNode(val);
801	xmlFreeNode(val);
802    }
803}
804static void desret_xmlAttrPtr(xmlAttrPtr val) {
805    if (val != NULL) {
806	xmlUnlinkNode((xmlNodePtr) val);
807	xmlFreeNode((xmlNodePtr) val);
808    }
809}
810static void desret_xmlEntityPtr(xmlEntityPtr val) {
811    if (val != NULL) {
812	xmlUnlinkNode((xmlNodePtr) val);
813	xmlFreeNode((xmlNodePtr) val);
814    }
815}
816static void desret_xmlElementPtr(xmlElementPtr val) {
817    if (val != NULL) {
818	xmlUnlinkNode((xmlNodePtr) val);
819    }
820}
821static void desret_xmlAttributePtr(xmlAttributePtr val) {
822    if (val != NULL) {
823	xmlUnlinkNode((xmlNodePtr) val);
824    }
825}
826static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) {
827}
828static void desret_xmlDtdPtr(xmlDtdPtr val) {
829    desret_xmlNodePtr((xmlNodePtr)val);
830}
831#ifdef LIBXML_XPATH_ENABLED
832static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) {
833    xmlXPathFreeObject(val);
834}
835static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) {
836    xmlXPathFreeNodeSet(val);
837}
838#endif
839static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) {
840    xmlFreeParserCtxt(val);
841}
842static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) {
843    xmlFreeParserInputBuffer(val);
844}
845static void desret_xmlParserInputPtr(xmlParserInputPtr val) {
846    xmlFreeInputStream(val);
847}
848#ifdef LIBXML_WRITER_ENABLED
849static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) {
850    xmlFreeTextWriter(val);
851}
852#endif
853static void desret_xmlBufferPtr(xmlBufferPtr val) {
854    xmlBufferFree(val);
855}
856#ifdef LIBXML_SCHEMAS_ENABLED
857static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) {
858    xmlSchemaFreeParserCtxt(val);
859}
860static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) {
861}
862static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) {
863    xmlRelaxNGFreeParserCtxt(val);
864}
865#endif
866#ifdef LIBXML_HTML_ENABLED
867static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) {
868}
869#endif
870#ifdef LIBXML_HTTP_ENABLED
871static void desret_xmlNanoHTTPCtxtPtr(void *val) {
872    xmlNanoHTTPClose(val);
873}
874#endif
875#ifdef LIBXML_FTP_ENABLED
876static void desret_xmlNanoFTPCtxtPtr(void *val) {
877    xmlNanoFTPClose(val);
878}
879#endif
880/* cut and pasted from autogenerated to avoid troubles */
881#define gen_nb_const_xmlChar_ptr_ptr 1
882static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
883    return(NULL);
884}
885static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
886}
887
888#define gen_nb_unsigned_char_ptr 1
889static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
890    return(NULL);
891}
892static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
893}
894
895#define gen_nb_const_unsigned_char_ptr 1
896static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
897    return(NULL);
898}
899static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
900}
901
902#ifdef LIBXML_HTML_ENABLED
903#define gen_nb_const_htmlNodePtr 1
904static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
905    return(NULL);
906}
907static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
908}
909#endif
910
911#ifdef LIBXML_HTML_ENABLED
912#define gen_nb_htmlDocPtr 3
913static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
914    if (no == 0) return(htmlNewDoc(NULL, NULL));
915    if (no == 1) return(htmlReadMemory("<html/>", 7, "test", NULL, 0));
916    return(NULL);
917}
918static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
919    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
920        xmlFreeDoc(val);
921}
922static void desret_htmlDocPtr(htmlDocPtr val) {
923    if ((val != NULL) && (val != api_doc) && (val->doc != api_doc))
924        xmlFreeDoc(val);
925}
926#define gen_nb_htmlParserCtxtPtr 3
927static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
928    if (no == 0) return(xmlNewParserCtxt());
929    if (no == 1) return(htmlCreateMemoryParserCtxt("<html/>", 7));
930    return(NULL);
931}
932static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
933    if (val != NULL)
934        htmlFreeParserCtxt(val);
935}
936static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) {
937    if (val != NULL)
938        htmlFreeParserCtxt(val);
939}
940#endif
941
942#ifdef LIBXML_XPATH_ENABLED
943#define gen_nb_xmlNodeSetPtr 1
944static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
945    return(NULL);
946}
947static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
948}
949#endif
950
951#ifdef LIBXML_DEBUG_ENABLED
952#ifdef LIBXML_XPATH_ENABLED
953#define gen_nb_xmlShellCtxtPtr 1
954static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
955    return(NULL);
956}
957static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
958}
959#endif
960#endif
961
962#ifdef LIBXML_PATTERN_ENABLED
963#define gen_nb_xmlPatternPtr 1
964static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
965    return(NULL);
966}
967static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
968}
969#endif
970
971#define gen_nb_xmlElementContentPtr 1
972static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
973    return(NULL);
974}
975static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) {
976    if (val != NULL)
977        xmlFreeElementContent(val);
978}
979static void desret_xmlElementContentPtr(xmlElementContentPtr val) {
980    if (val != NULL)
981        xmlFreeElementContent(val);
982}
983
984#define gen_nb_xmlParserNodeInfoSeqPtr 1
985static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
986    return(NULL);
987}
988static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
989}
990
991static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) {
992}
993
994#define gen_nb_void_ptr_ptr 1
995static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
996    return(NULL);
997}
998static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
999}
1000
1001/************************************************************************
1002 *									*
1003 *   WARNING: end of the manually maintained part of the test code	*
1004 *            do not remove or alter the CUT HERE line			*
1005 *									*
1006 ************************************************************************/
1007
1008/* CUT HERE: everything below that line is generated */
1009#ifdef LIBXML_HTML_ENABLED
1010static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1011}
1012
1013#endif
1014
1015#define gen_nb_xmlAttributeDefault 4
1016static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1017    if (no == 1) return(XML_ATTRIBUTE_FIXED);
1018    if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1019    if (no == 3) return(XML_ATTRIBUTE_NONE);
1020    if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1021    return(0);
1022}
1023
1024static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1025}
1026
1027#define gen_nb_xmlAttributeType 4
1028static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1029    if (no == 1) return(XML_ATTRIBUTE_CDATA);
1030    if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1031    if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1032    if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1033    return(0);
1034}
1035
1036static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1037}
1038
1039#define gen_nb_xmlBufferAllocationScheme 4
1040static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1041    if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1042    if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1043    if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
1044    if (no == 4) return(XML_BUFFER_ALLOC_IO);
1045    return(0);
1046}
1047
1048static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1049}
1050
1051static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1052}
1053
1054#ifdef LIBXML_CATALOG_ENABLED
1055#define gen_nb_xmlCatalogAllow 4
1056static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1057    if (no == 1) return(XML_CATA_ALLOW_ALL);
1058    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1059    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1060    if (no == 4) return(XML_CATA_ALLOW_NONE);
1061    return(0);
1062}
1063
1064static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1065}
1066
1067static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1068}
1069
1070#endif
1071
1072#ifdef LIBXML_CATALOG_ENABLED
1073#define gen_nb_xmlCatalogPrefer 3
1074static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1075    if (no == 1) return(XML_CATA_PREFER_NONE);
1076    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1077    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1078    return(0);
1079}
1080
1081static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1082}
1083
1084static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1085}
1086
1087#endif
1088
1089#define gen_nb_xmlElementContentType 4
1090static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1091    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1092    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1093    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1094    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1095    return(0);
1096}
1097
1098static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1099}
1100
1101#define gen_nb_xmlElementTypeVal 4
1102static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1103    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1104    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1105    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1106    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1107    return(0);
1108}
1109
1110static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1111}
1112
1113#define gen_nb_xmlFeature 4
1114static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1115    if (no == 1) return(XML_WITH_AUTOMATA);
1116    if (no == 2) return(XML_WITH_C14N);
1117    if (no == 3) return(XML_WITH_CATALOG);
1118    if (no == 4) return(XML_WITH_DEBUG);
1119    return(0);
1120}
1121
1122static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1123}
1124
1125static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1126}
1127
1128#ifdef LIBXML_SCHEMAS_ENABLED
1129#define gen_nb_xmlSchemaValType 4
1130static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1131    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1132    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1133    if (no == 3) return(XML_SCHEMAS_ANYURI);
1134    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1135    return(0);
1136}
1137
1138static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1139}
1140
1141static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1142}
1143
1144#endif
1145
1146#ifdef LIBXML_SCHEMAS_ENABLED
1147#define gen_nb_xmlSchemaWhitespaceValueType 4
1148static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1149    if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1150    if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1151    if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1152    if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1153    return(0);
1154}
1155
1156static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1157}
1158
1159#endif
1160
1161#include <libxml/HTMLparser.h>
1162#include <libxml/HTMLtree.h>
1163#include <libxml/SAX2.h>
1164#include <libxml/c14n.h>
1165#include <libxml/catalog.h>
1166#include <libxml/chvalid.h>
1167#include <libxml/debugXML.h>
1168#include <libxml/dict.h>
1169#include <libxml/encoding.h>
1170#include <libxml/entities.h>
1171#include <libxml/hash.h>
1172#include <libxml/list.h>
1173#include <libxml/nanoftp.h>
1174#include <libxml/nanohttp.h>
1175#include <libxml/parser.h>
1176#include <libxml/parserInternals.h>
1177#include <libxml/pattern.h>
1178#include <libxml/relaxng.h>
1179#include <libxml/schemasInternals.h>
1180#include <libxml/schematron.h>
1181#include <libxml/tree.h>
1182#include <libxml/uri.h>
1183#include <libxml/valid.h>
1184#include <libxml/xinclude.h>
1185#include <libxml/xmlIO.h>
1186#include <libxml/xmlautomata.h>
1187#include <libxml/xmlerror.h>
1188#include <libxml/xmlmodule.h>
1189#include <libxml/xmlreader.h>
1190#include <libxml/xmlregexp.h>
1191#include <libxml/xmlsave.h>
1192#include <libxml/xmlschemas.h>
1193#include <libxml/xmlschemastypes.h>
1194#include <libxml/xmlstring.h>
1195#include <libxml/xmlunicode.h>
1196#include <libxml/xmlwriter.h>
1197#include <libxml/xpath.h>
1198#include <libxml/xpathInternals.h>
1199#include <libxml/xpointer.h>
1200static int test_HTMLparser(void);
1201static int test_HTMLtree(void);
1202static int test_SAX2(void);
1203static int test_c14n(void);
1204static int test_catalog(void);
1205static int test_chvalid(void);
1206static int test_debugXML(void);
1207static int test_dict(void);
1208static int test_encoding(void);
1209static int test_entities(void);
1210static int test_hash(void);
1211static int test_list(void);
1212static int test_nanoftp(void);
1213static int test_nanohttp(void);
1214static int test_parser(void);
1215static int test_parserInternals(void);
1216static int test_pattern(void);
1217static int test_relaxng(void);
1218static int test_schemasInternals(void);
1219static int test_schematron(void);
1220static int test_tree(void);
1221static int test_uri(void);
1222static int test_valid(void);
1223static int test_xinclude(void);
1224static int test_xmlIO(void);
1225static int test_xmlautomata(void);
1226static int test_xmlerror(void);
1227static int test_xmlmodule(void);
1228static int test_xmlreader(void);
1229static int test_xmlregexp(void);
1230static int test_xmlsave(void);
1231static int test_xmlschemas(void);
1232static int test_xmlschemastypes(void);
1233static int test_xmlstring(void);
1234static int test_xmlunicode(void);
1235static int test_xmlwriter(void);
1236static int test_xpath(void);
1237static int test_xpathInternals(void);
1238static int test_xpointer(void);
1239
1240/**
1241 * testlibxml2:
1242 *
1243 * Main entry point of the tester for the full libxml2 module,
1244 * it calls all the tester entry point for each module.
1245 *
1246 * Returns the number of error found
1247 */
1248static int
1249testlibxml2(void)
1250{
1251    int test_ret = 0;
1252
1253    test_ret += test_HTMLparser();
1254    test_ret += test_HTMLtree();
1255    test_ret += test_SAX2();
1256    test_ret += test_c14n();
1257    test_ret += test_catalog();
1258    test_ret += test_chvalid();
1259    test_ret += test_debugXML();
1260    test_ret += test_dict();
1261    test_ret += test_encoding();
1262    test_ret += test_entities();
1263    test_ret += test_hash();
1264    test_ret += test_list();
1265    test_ret += test_nanoftp();
1266    test_ret += test_nanohttp();
1267    test_ret += test_parser();
1268    test_ret += test_parserInternals();
1269    test_ret += test_pattern();
1270    test_ret += test_relaxng();
1271    test_ret += test_schemasInternals();
1272    test_ret += test_schematron();
1273    test_ret += test_tree();
1274    test_ret += test_uri();
1275    test_ret += test_valid();
1276    test_ret += test_xinclude();
1277    test_ret += test_xmlIO();
1278    test_ret += test_xmlautomata();
1279    test_ret += test_xmlerror();
1280    test_ret += test_xmlmodule();
1281    test_ret += test_xmlreader();
1282    test_ret += test_xmlregexp();
1283    test_ret += test_xmlsave();
1284    test_ret += test_xmlschemas();
1285    test_ret += test_xmlschemastypes();
1286    test_ret += test_xmlstring();
1287    test_ret += test_xmlunicode();
1288    test_ret += test_xmlwriter();
1289    test_ret += test_xpath();
1290    test_ret += test_xpathInternals();
1291    test_ret += test_xpointer();
1292
1293    printf("Total: %d functions, %d tests, %d errors\n",
1294           function_tests, call_tests, test_ret);
1295    return(test_ret);
1296}
1297
1298
1299static int
1300test_UTF8ToHtml(void) {
1301    int test_ret = 0;
1302
1303#if defined(LIBXML_HTML_ENABLED)
1304    int mem_base;
1305    int ret_val;
1306    unsigned char * out; /* a pointer to an array of bytes to store the result */
1307    int n_out;
1308    int * outlen; /* the length of @out */
1309    int n_outlen;
1310    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1311    int n_in;
1312    int * inlen; /* the length of @in */
1313    int n_inlen;
1314
1315    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1316    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1317    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1318    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1319        mem_base = xmlMemBlocks();
1320        out = gen_unsigned_char_ptr(n_out, 0);
1321        outlen = gen_int_ptr(n_outlen, 1);
1322        in = gen_const_unsigned_char_ptr(n_in, 2);
1323        inlen = gen_int_ptr(n_inlen, 3);
1324
1325        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1326        desret_int(ret_val);
1327        call_tests++;
1328        des_unsigned_char_ptr(n_out, out, 0);
1329        des_int_ptr(n_outlen, outlen, 1);
1330        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1331        des_int_ptr(n_inlen, inlen, 3);
1332        xmlResetLastError();
1333        if (mem_base != xmlMemBlocks()) {
1334            printf("Leak of %d blocks found in UTF8ToHtml",
1335	           xmlMemBlocks() - mem_base);
1336	    test_ret++;
1337            printf(" %d", n_out);
1338            printf(" %d", n_outlen);
1339            printf(" %d", n_in);
1340            printf(" %d", n_inlen);
1341            printf("\n");
1342        }
1343    }
1344    }
1345    }
1346    }
1347    function_tests++;
1348#endif
1349
1350    return(test_ret);
1351}
1352
1353#ifdef LIBXML_HTML_ENABLED
1354
1355#define gen_nb_const_htmlElemDesc_ptr 1
1356static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1357    return(NULL);
1358}
1359static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1360}
1361#endif
1362
1363
1364static int
1365test_htmlAttrAllowed(void) {
1366    int test_ret = 0;
1367
1368#if defined(LIBXML_HTML_ENABLED)
1369    int mem_base;
1370    htmlStatus ret_val;
1371    htmlElemDesc * elt; /* HTML element */
1372    int n_elt;
1373    xmlChar * attr; /* HTML attribute */
1374    int n_attr;
1375    int legacy; /* whether to allow deprecated attributes */
1376    int n_legacy;
1377
1378    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1379    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1380    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1381        mem_base = xmlMemBlocks();
1382        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1383        attr = gen_const_xmlChar_ptr(n_attr, 1);
1384        legacy = gen_int(n_legacy, 2);
1385
1386        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1387        desret_htmlStatus(ret_val);
1388        call_tests++;
1389        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1390        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1391        des_int(n_legacy, legacy, 2);
1392        xmlResetLastError();
1393        if (mem_base != xmlMemBlocks()) {
1394            printf("Leak of %d blocks found in htmlAttrAllowed",
1395	           xmlMemBlocks() - mem_base);
1396	    test_ret++;
1397            printf(" %d", n_elt);
1398            printf(" %d", n_attr);
1399            printf(" %d", n_legacy);
1400            printf("\n");
1401        }
1402    }
1403    }
1404    }
1405    function_tests++;
1406#endif
1407
1408    return(test_ret);
1409}
1410
1411#ifdef LIBXML_HTML_ENABLED
1412
1413#define gen_nb_htmlNodePtr 1
1414static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1415    return(NULL);
1416}
1417static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1418}
1419#endif
1420
1421
1422static int
1423test_htmlAutoCloseTag(void) {
1424    int test_ret = 0;
1425
1426#if defined(LIBXML_HTML_ENABLED)
1427    int mem_base;
1428    int ret_val;
1429    htmlDocPtr doc; /* the HTML document */
1430    int n_doc;
1431    xmlChar * name; /* The tag name */
1432    int n_name;
1433    htmlNodePtr elem; /* the HTML element */
1434    int n_elem;
1435
1436    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1437    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1438    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1439        mem_base = xmlMemBlocks();
1440        doc = gen_htmlDocPtr(n_doc, 0);
1441        name = gen_const_xmlChar_ptr(n_name, 1);
1442        elem = gen_htmlNodePtr(n_elem, 2);
1443
1444        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1445        desret_int(ret_val);
1446        call_tests++;
1447        des_htmlDocPtr(n_doc, doc, 0);
1448        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1449        des_htmlNodePtr(n_elem, elem, 2);
1450        xmlResetLastError();
1451        if (mem_base != xmlMemBlocks()) {
1452            printf("Leak of %d blocks found in htmlAutoCloseTag",
1453	           xmlMemBlocks() - mem_base);
1454	    test_ret++;
1455            printf(" %d", n_doc);
1456            printf(" %d", n_name);
1457            printf(" %d", n_elem);
1458            printf("\n");
1459        }
1460    }
1461    }
1462    }
1463    function_tests++;
1464#endif
1465
1466    return(test_ret);
1467}
1468
1469
1470static int
1471test_htmlCreateMemoryParserCtxt(void) {
1472    int test_ret = 0;
1473
1474#if defined(LIBXML_HTML_ENABLED)
1475    int mem_base;
1476    htmlParserCtxtPtr ret_val;
1477    char * buffer; /* a pointer to a char array */
1478    int n_buffer;
1479    int size; /* the size of the array */
1480    int n_size;
1481
1482    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1483    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1484        mem_base = xmlMemBlocks();
1485        buffer = gen_const_char_ptr(n_buffer, 0);
1486        size = gen_int(n_size, 1);
1487
1488        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1489        desret_htmlParserCtxtPtr(ret_val);
1490        call_tests++;
1491        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1492        des_int(n_size, size, 1);
1493        xmlResetLastError();
1494        if (mem_base != xmlMemBlocks()) {
1495            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1496	           xmlMemBlocks() - mem_base);
1497	    test_ret++;
1498            printf(" %d", n_buffer);
1499            printf(" %d", n_size);
1500            printf("\n");
1501        }
1502    }
1503    }
1504    function_tests++;
1505#endif
1506
1507    return(test_ret);
1508}
1509
1510#ifdef LIBXML_HTML_ENABLED
1511
1512#define gen_nb_htmlSAXHandlerPtr 1
1513static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1514    return(NULL);
1515}
1516static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1517}
1518#endif
1519
1520
1521static int
1522test_htmlCreatePushParserCtxt(void) {
1523    int test_ret = 0;
1524
1525#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1526    int mem_base;
1527    htmlParserCtxtPtr ret_val;
1528    htmlSAXHandlerPtr sax; /* a SAX handler */
1529    int n_sax;
1530    void * user_data; /* The user data returned on SAX callbacks */
1531    int n_user_data;
1532    char * chunk; /* a pointer to an array of chars */
1533    int n_chunk;
1534    int size; /* number of chars in the array */
1535    int n_size;
1536    const char * filename; /* an optional file name or URI */
1537    int n_filename;
1538    xmlCharEncoding enc; /* an optional encoding */
1539    int n_enc;
1540
1541    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1542    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1543    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1544    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1545    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1546    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1547        mem_base = xmlMemBlocks();
1548        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1549        user_data = gen_userdata(n_user_data, 1);
1550        chunk = gen_const_char_ptr(n_chunk, 2);
1551        size = gen_int(n_size, 3);
1552        filename = gen_fileoutput(n_filename, 4);
1553        enc = gen_xmlCharEncoding(n_enc, 5);
1554
1555        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1556        desret_htmlParserCtxtPtr(ret_val);
1557        call_tests++;
1558        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1559        des_userdata(n_user_data, user_data, 1);
1560        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1561        des_int(n_size, size, 3);
1562        des_fileoutput(n_filename, filename, 4);
1563        des_xmlCharEncoding(n_enc, enc, 5);
1564        xmlResetLastError();
1565        if (mem_base != xmlMemBlocks()) {
1566            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1567	           xmlMemBlocks() - mem_base);
1568	    test_ret++;
1569            printf(" %d", n_sax);
1570            printf(" %d", n_user_data);
1571            printf(" %d", n_chunk);
1572            printf(" %d", n_size);
1573            printf(" %d", n_filename);
1574            printf(" %d", n_enc);
1575            printf("\n");
1576        }
1577    }
1578    }
1579    }
1580    }
1581    }
1582    }
1583    function_tests++;
1584#endif
1585
1586    return(test_ret);
1587}
1588
1589
1590static int
1591test_htmlCtxtReadDoc(void) {
1592    int test_ret = 0;
1593
1594#if defined(LIBXML_HTML_ENABLED)
1595    int mem_base;
1596    htmlDocPtr ret_val;
1597    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1598    int n_ctxt;
1599    xmlChar * cur; /* a pointer to a zero terminated string */
1600    int n_cur;
1601    const char * URL; /* the base URL to use for the document */
1602    int n_URL;
1603    char * encoding; /* the document encoding, or NULL */
1604    int n_encoding;
1605    int options; /* a combination of htmlParserOption(s) */
1606    int n_options;
1607
1608    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1609    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1610    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1611    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1612    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1613        mem_base = xmlMemBlocks();
1614        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1615        cur = gen_const_xmlChar_ptr(n_cur, 1);
1616        URL = gen_filepath(n_URL, 2);
1617        encoding = gen_const_char_ptr(n_encoding, 3);
1618        options = gen_int(n_options, 4);
1619
1620        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1621        desret_htmlDocPtr(ret_val);
1622        call_tests++;
1623        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1624        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1625        des_filepath(n_URL, URL, 2);
1626        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1627        des_int(n_options, options, 4);
1628        xmlResetLastError();
1629        if (mem_base != xmlMemBlocks()) {
1630            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1631	           xmlMemBlocks() - mem_base);
1632	    test_ret++;
1633            printf(" %d", n_ctxt);
1634            printf(" %d", n_cur);
1635            printf(" %d", n_URL);
1636            printf(" %d", n_encoding);
1637            printf(" %d", n_options);
1638            printf("\n");
1639        }
1640    }
1641    }
1642    }
1643    }
1644    }
1645    function_tests++;
1646#endif
1647
1648    return(test_ret);
1649}
1650
1651
1652static int
1653test_htmlCtxtReadFile(void) {
1654    int test_ret = 0;
1655
1656#if defined(LIBXML_HTML_ENABLED)
1657    htmlDocPtr ret_val;
1658    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1659    int n_ctxt;
1660    const char * filename; /* a file or URL */
1661    int n_filename;
1662    char * encoding; /* the document encoding, or NULL */
1663    int n_encoding;
1664    int options; /* a combination of htmlParserOption(s) */
1665    int n_options;
1666
1667    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1668    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1669    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1670    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1671        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1672        filename = gen_filepath(n_filename, 1);
1673        encoding = gen_const_char_ptr(n_encoding, 2);
1674        options = gen_int(n_options, 3);
1675
1676        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1677        desret_htmlDocPtr(ret_val);
1678        call_tests++;
1679        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1680        des_filepath(n_filename, filename, 1);
1681        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1682        des_int(n_options, options, 3);
1683        xmlResetLastError();
1684    }
1685    }
1686    }
1687    }
1688    function_tests++;
1689#endif
1690
1691    return(test_ret);
1692}
1693
1694
1695static int
1696test_htmlCtxtReadMemory(void) {
1697    int test_ret = 0;
1698
1699#if defined(LIBXML_HTML_ENABLED)
1700    int mem_base;
1701    htmlDocPtr ret_val;
1702    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1703    int n_ctxt;
1704    char * buffer; /* a pointer to a char array */
1705    int n_buffer;
1706    int size; /* the size of the array */
1707    int n_size;
1708    const char * URL; /* the base URL to use for the document */
1709    int n_URL;
1710    char * encoding; /* the document encoding, or NULL */
1711    int n_encoding;
1712    int options; /* a combination of htmlParserOption(s) */
1713    int n_options;
1714
1715    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1716    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1717    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1718    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1719    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1720    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1721        mem_base = xmlMemBlocks();
1722        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1723        buffer = gen_const_char_ptr(n_buffer, 1);
1724        size = gen_int(n_size, 2);
1725        URL = gen_filepath(n_URL, 3);
1726        encoding = gen_const_char_ptr(n_encoding, 4);
1727        options = gen_int(n_options, 5);
1728
1729        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1730        desret_htmlDocPtr(ret_val);
1731        call_tests++;
1732        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1733        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1734        des_int(n_size, size, 2);
1735        des_filepath(n_URL, URL, 3);
1736        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1737        des_int(n_options, options, 5);
1738        xmlResetLastError();
1739        if (mem_base != xmlMemBlocks()) {
1740            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1741	           xmlMemBlocks() - mem_base);
1742	    test_ret++;
1743            printf(" %d", n_ctxt);
1744            printf(" %d", n_buffer);
1745            printf(" %d", n_size);
1746            printf(" %d", n_URL);
1747            printf(" %d", n_encoding);
1748            printf(" %d", n_options);
1749            printf("\n");
1750        }
1751    }
1752    }
1753    }
1754    }
1755    }
1756    }
1757    function_tests++;
1758#endif
1759
1760    return(test_ret);
1761}
1762
1763
1764static int
1765test_htmlCtxtReset(void) {
1766    int test_ret = 0;
1767
1768#if defined(LIBXML_HTML_ENABLED)
1769    int mem_base;
1770    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1771    int n_ctxt;
1772
1773    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1774        mem_base = xmlMemBlocks();
1775        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1776
1777        htmlCtxtReset(ctxt);
1778        call_tests++;
1779        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1780        xmlResetLastError();
1781        if (mem_base != xmlMemBlocks()) {
1782            printf("Leak of %d blocks found in htmlCtxtReset",
1783	           xmlMemBlocks() - mem_base);
1784	    test_ret++;
1785            printf(" %d", n_ctxt);
1786            printf("\n");
1787        }
1788    }
1789    function_tests++;
1790#endif
1791
1792    return(test_ret);
1793}
1794
1795
1796static int
1797test_htmlCtxtUseOptions(void) {
1798    int test_ret = 0;
1799
1800#if defined(LIBXML_HTML_ENABLED)
1801    int mem_base;
1802    int ret_val;
1803    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1804    int n_ctxt;
1805    int options; /* a combination of htmlParserOption(s) */
1806    int n_options;
1807
1808    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1809    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1810        mem_base = xmlMemBlocks();
1811        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1812        options = gen_int(n_options, 1);
1813
1814        ret_val = htmlCtxtUseOptions(ctxt, options);
1815        desret_int(ret_val);
1816        call_tests++;
1817        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1818        des_int(n_options, options, 1);
1819        xmlResetLastError();
1820        if (mem_base != xmlMemBlocks()) {
1821            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1822	           xmlMemBlocks() - mem_base);
1823	    test_ret++;
1824            printf(" %d", n_ctxt);
1825            printf(" %d", n_options);
1826            printf("\n");
1827        }
1828    }
1829    }
1830    function_tests++;
1831#endif
1832
1833    return(test_ret);
1834}
1835
1836
1837static int
1838test_htmlElementAllowedHere(void) {
1839    int test_ret = 0;
1840
1841#if defined(LIBXML_HTML_ENABLED)
1842    int mem_base;
1843    int ret_val;
1844    htmlElemDesc * parent; /* HTML parent element */
1845    int n_parent;
1846    xmlChar * elt; /* HTML element */
1847    int n_elt;
1848
1849    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1850    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1851        mem_base = xmlMemBlocks();
1852        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1853        elt = gen_const_xmlChar_ptr(n_elt, 1);
1854
1855        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1856        desret_int(ret_val);
1857        call_tests++;
1858        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1859        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1860        xmlResetLastError();
1861        if (mem_base != xmlMemBlocks()) {
1862            printf("Leak of %d blocks found in htmlElementAllowedHere",
1863	           xmlMemBlocks() - mem_base);
1864	    test_ret++;
1865            printf(" %d", n_parent);
1866            printf(" %d", n_elt);
1867            printf("\n");
1868        }
1869    }
1870    }
1871    function_tests++;
1872#endif
1873
1874    return(test_ret);
1875}
1876
1877
1878static int
1879test_htmlElementStatusHere(void) {
1880    int test_ret = 0;
1881
1882#if defined(LIBXML_HTML_ENABLED)
1883    int mem_base;
1884    htmlStatus ret_val;
1885    htmlElemDesc * parent; /* HTML parent element */
1886    int n_parent;
1887    htmlElemDesc * elt; /* HTML element */
1888    int n_elt;
1889
1890    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1891    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1892        mem_base = xmlMemBlocks();
1893        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1894        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1895
1896        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1897        desret_htmlStatus(ret_val);
1898        call_tests++;
1899        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1900        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1901        xmlResetLastError();
1902        if (mem_base != xmlMemBlocks()) {
1903            printf("Leak of %d blocks found in htmlElementStatusHere",
1904	           xmlMemBlocks() - mem_base);
1905	    test_ret++;
1906            printf(" %d", n_parent);
1907            printf(" %d", n_elt);
1908            printf("\n");
1909        }
1910    }
1911    }
1912    function_tests++;
1913#endif
1914
1915    return(test_ret);
1916}
1917
1918
1919static int
1920test_htmlEncodeEntities(void) {
1921    int test_ret = 0;
1922
1923#if defined(LIBXML_HTML_ENABLED)
1924    int mem_base;
1925    int ret_val;
1926    unsigned char * out; /* a pointer to an array of bytes to store the result */
1927    int n_out;
1928    int * outlen; /* the length of @out */
1929    int n_outlen;
1930    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1931    int n_in;
1932    int * inlen; /* the length of @in */
1933    int n_inlen;
1934    int quoteChar; /* the quote character to escape (' or ") or zero. */
1935    int n_quoteChar;
1936
1937    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1938    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1939    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1940    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1941    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1942        mem_base = xmlMemBlocks();
1943        out = gen_unsigned_char_ptr(n_out, 0);
1944        outlen = gen_int_ptr(n_outlen, 1);
1945        in = gen_const_unsigned_char_ptr(n_in, 2);
1946        inlen = gen_int_ptr(n_inlen, 3);
1947        quoteChar = gen_int(n_quoteChar, 4);
1948
1949        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1950        desret_int(ret_val);
1951        call_tests++;
1952        des_unsigned_char_ptr(n_out, out, 0);
1953        des_int_ptr(n_outlen, outlen, 1);
1954        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1955        des_int_ptr(n_inlen, inlen, 3);
1956        des_int(n_quoteChar, quoteChar, 4);
1957        xmlResetLastError();
1958        if (mem_base != xmlMemBlocks()) {
1959            printf("Leak of %d blocks found in htmlEncodeEntities",
1960	           xmlMemBlocks() - mem_base);
1961	    test_ret++;
1962            printf(" %d", n_out);
1963            printf(" %d", n_outlen);
1964            printf(" %d", n_in);
1965            printf(" %d", n_inlen);
1966            printf(" %d", n_quoteChar);
1967            printf("\n");
1968        }
1969    }
1970    }
1971    }
1972    }
1973    }
1974    function_tests++;
1975#endif
1976
1977    return(test_ret);
1978}
1979
1980
1981static int
1982test_htmlEntityLookup(void) {
1983    int test_ret = 0;
1984
1985#if defined(LIBXML_HTML_ENABLED)
1986    int mem_base;
1987    const htmlEntityDesc * ret_val;
1988    xmlChar * name; /* the entity name */
1989    int n_name;
1990
1991    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1992        mem_base = xmlMemBlocks();
1993        name = gen_const_xmlChar_ptr(n_name, 0);
1994
1995        ret_val = htmlEntityLookup((const xmlChar *)name);
1996        desret_const_htmlEntityDesc_ptr(ret_val);
1997        call_tests++;
1998        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1999        xmlResetLastError();
2000        if (mem_base != xmlMemBlocks()) {
2001            printf("Leak of %d blocks found in htmlEntityLookup",
2002	           xmlMemBlocks() - mem_base);
2003	    test_ret++;
2004            printf(" %d", n_name);
2005            printf("\n");
2006        }
2007    }
2008    function_tests++;
2009#endif
2010
2011    return(test_ret);
2012}
2013
2014
2015static int
2016test_htmlEntityValueLookup(void) {
2017    int test_ret = 0;
2018
2019#if defined(LIBXML_HTML_ENABLED)
2020    int mem_base;
2021    const htmlEntityDesc * ret_val;
2022    unsigned int value; /* the entity's unicode value */
2023    int n_value;
2024
2025    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2026        mem_base = xmlMemBlocks();
2027        value = gen_unsigned_int(n_value, 0);
2028
2029        ret_val = htmlEntityValueLookup(value);
2030        desret_const_htmlEntityDesc_ptr(ret_val);
2031        call_tests++;
2032        des_unsigned_int(n_value, value, 0);
2033        xmlResetLastError();
2034        if (mem_base != xmlMemBlocks()) {
2035            printf("Leak of %d blocks found in htmlEntityValueLookup",
2036	           xmlMemBlocks() - mem_base);
2037	    test_ret++;
2038            printf(" %d", n_value);
2039            printf("\n");
2040        }
2041    }
2042    function_tests++;
2043#endif
2044
2045    return(test_ret);
2046}
2047
2048
2049static int
2050test_htmlHandleOmittedElem(void) {
2051    int test_ret = 0;
2052
2053#if defined(LIBXML_HTML_ENABLED)
2054    int mem_base;
2055    int ret_val;
2056    int val; /* int 0 or 1 */
2057    int n_val;
2058
2059    for (n_val = 0;n_val < gen_nb_int;n_val++) {
2060        mem_base = xmlMemBlocks();
2061        val = gen_int(n_val, 0);
2062
2063        ret_val = htmlHandleOmittedElem(val);
2064        desret_int(ret_val);
2065        call_tests++;
2066        des_int(n_val, val, 0);
2067        xmlResetLastError();
2068        if (mem_base != xmlMemBlocks()) {
2069            printf("Leak of %d blocks found in htmlHandleOmittedElem",
2070	           xmlMemBlocks() - mem_base);
2071	    test_ret++;
2072            printf(" %d", n_val);
2073            printf("\n");
2074        }
2075    }
2076    function_tests++;
2077#endif
2078
2079    return(test_ret);
2080}
2081
2082
2083static int
2084test_htmlIsAutoClosed(void) {
2085    int test_ret = 0;
2086
2087#if defined(LIBXML_HTML_ENABLED)
2088    int mem_base;
2089    int ret_val;
2090    htmlDocPtr doc; /* the HTML document */
2091    int n_doc;
2092    htmlNodePtr elem; /* the HTML element */
2093    int n_elem;
2094
2095    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2096    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2097        mem_base = xmlMemBlocks();
2098        doc = gen_htmlDocPtr(n_doc, 0);
2099        elem = gen_htmlNodePtr(n_elem, 1);
2100
2101        ret_val = htmlIsAutoClosed(doc, elem);
2102        desret_int(ret_val);
2103        call_tests++;
2104        des_htmlDocPtr(n_doc, doc, 0);
2105        des_htmlNodePtr(n_elem, elem, 1);
2106        xmlResetLastError();
2107        if (mem_base != xmlMemBlocks()) {
2108            printf("Leak of %d blocks found in htmlIsAutoClosed",
2109	           xmlMemBlocks() - mem_base);
2110	    test_ret++;
2111            printf(" %d", n_doc);
2112            printf(" %d", n_elem);
2113            printf("\n");
2114        }
2115    }
2116    }
2117    function_tests++;
2118#endif
2119
2120    return(test_ret);
2121}
2122
2123
2124static int
2125test_htmlIsScriptAttribute(void) {
2126    int test_ret = 0;
2127
2128#if defined(LIBXML_HTML_ENABLED)
2129    int mem_base;
2130    int ret_val;
2131    xmlChar * name; /* an attribute name */
2132    int n_name;
2133
2134    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2135        mem_base = xmlMemBlocks();
2136        name = gen_const_xmlChar_ptr(n_name, 0);
2137
2138        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2139        desret_int(ret_val);
2140        call_tests++;
2141        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2142        xmlResetLastError();
2143        if (mem_base != xmlMemBlocks()) {
2144            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2145	           xmlMemBlocks() - mem_base);
2146	    test_ret++;
2147            printf(" %d", n_name);
2148            printf("\n");
2149        }
2150    }
2151    function_tests++;
2152#endif
2153
2154    return(test_ret);
2155}
2156
2157
2158static int
2159test_htmlNewParserCtxt(void) {
2160    int test_ret = 0;
2161
2162#if defined(LIBXML_HTML_ENABLED)
2163    int mem_base;
2164    htmlParserCtxtPtr ret_val;
2165
2166        mem_base = xmlMemBlocks();
2167
2168        ret_val = htmlNewParserCtxt();
2169        desret_htmlParserCtxtPtr(ret_val);
2170        call_tests++;
2171        xmlResetLastError();
2172        if (mem_base != xmlMemBlocks()) {
2173            printf("Leak of %d blocks found in htmlNewParserCtxt",
2174	           xmlMemBlocks() - mem_base);
2175	    test_ret++;
2176            printf("\n");
2177        }
2178    function_tests++;
2179#endif
2180
2181    return(test_ret);
2182}
2183
2184
2185static int
2186test_htmlNodeStatus(void) {
2187    int test_ret = 0;
2188
2189#if defined(LIBXML_HTML_ENABLED)
2190    int mem_base;
2191    htmlStatus ret_val;
2192    htmlNodePtr node; /* an htmlNodePtr in a tree */
2193    int n_node;
2194    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2195    int n_legacy;
2196
2197    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2198    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2199        mem_base = xmlMemBlocks();
2200        node = gen_const_htmlNodePtr(n_node, 0);
2201        legacy = gen_int(n_legacy, 1);
2202
2203        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2204        desret_htmlStatus(ret_val);
2205        call_tests++;
2206        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2207        des_int(n_legacy, legacy, 1);
2208        xmlResetLastError();
2209        if (mem_base != xmlMemBlocks()) {
2210            printf("Leak of %d blocks found in htmlNodeStatus",
2211	           xmlMemBlocks() - mem_base);
2212	    test_ret++;
2213            printf(" %d", n_node);
2214            printf(" %d", n_legacy);
2215            printf("\n");
2216        }
2217    }
2218    }
2219    function_tests++;
2220#endif
2221
2222    return(test_ret);
2223}
2224
2225
2226static int
2227test_htmlParseCharRef(void) {
2228    int test_ret = 0;
2229
2230#if defined(LIBXML_HTML_ENABLED)
2231    int mem_base;
2232    int ret_val;
2233    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2234    int n_ctxt;
2235
2236    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2237        mem_base = xmlMemBlocks();
2238        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2239
2240        ret_val = htmlParseCharRef(ctxt);
2241        desret_int(ret_val);
2242        call_tests++;
2243        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2244        xmlResetLastError();
2245        if (mem_base != xmlMemBlocks()) {
2246            printf("Leak of %d blocks found in htmlParseCharRef",
2247	           xmlMemBlocks() - mem_base);
2248	    test_ret++;
2249            printf(" %d", n_ctxt);
2250            printf("\n");
2251        }
2252    }
2253    function_tests++;
2254#endif
2255
2256    return(test_ret);
2257}
2258
2259
2260static int
2261test_htmlParseChunk(void) {
2262    int test_ret = 0;
2263
2264#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2265    int mem_base;
2266    int ret_val;
2267    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2268    int n_ctxt;
2269    char * chunk; /* an char array */
2270    int n_chunk;
2271    int size; /* the size in byte of the chunk */
2272    int n_size;
2273    int terminate; /* last chunk indicator */
2274    int n_terminate;
2275
2276    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2277    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2278    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2279    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2280        mem_base = xmlMemBlocks();
2281        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2282        chunk = gen_const_char_ptr(n_chunk, 1);
2283        size = gen_int(n_size, 2);
2284        terminate = gen_int(n_terminate, 3);
2285
2286        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2287        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2288        desret_int(ret_val);
2289        call_tests++;
2290        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2291        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2292        des_int(n_size, size, 2);
2293        des_int(n_terminate, terminate, 3);
2294        xmlResetLastError();
2295        if (mem_base != xmlMemBlocks()) {
2296            printf("Leak of %d blocks found in htmlParseChunk",
2297	           xmlMemBlocks() - mem_base);
2298	    test_ret++;
2299            printf(" %d", n_ctxt);
2300            printf(" %d", n_chunk);
2301            printf(" %d", n_size);
2302            printf(" %d", n_terminate);
2303            printf("\n");
2304        }
2305    }
2306    }
2307    }
2308    }
2309    function_tests++;
2310#endif
2311
2312    return(test_ret);
2313}
2314
2315
2316static int
2317test_htmlParseDoc(void) {
2318    int test_ret = 0;
2319
2320#if defined(LIBXML_HTML_ENABLED)
2321    int mem_base;
2322    htmlDocPtr ret_val;
2323    xmlChar * cur; /* a pointer to an array of xmlChar */
2324    int n_cur;
2325    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2326    int n_encoding;
2327
2328    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2329    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2330        mem_base = xmlMemBlocks();
2331        cur = gen_xmlChar_ptr(n_cur, 0);
2332        encoding = gen_const_char_ptr(n_encoding, 1);
2333
2334        ret_val = htmlParseDoc(cur, (const char *)encoding);
2335        desret_htmlDocPtr(ret_val);
2336        call_tests++;
2337        des_xmlChar_ptr(n_cur, cur, 0);
2338        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2339        xmlResetLastError();
2340        if (mem_base != xmlMemBlocks()) {
2341            printf("Leak of %d blocks found in htmlParseDoc",
2342	           xmlMemBlocks() - mem_base);
2343	    test_ret++;
2344            printf(" %d", n_cur);
2345            printf(" %d", n_encoding);
2346            printf("\n");
2347        }
2348    }
2349    }
2350    function_tests++;
2351#endif
2352
2353    return(test_ret);
2354}
2355
2356
2357static int
2358test_htmlParseDocument(void) {
2359    int test_ret = 0;
2360
2361#if defined(LIBXML_HTML_ENABLED)
2362    int mem_base;
2363    int ret_val;
2364    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2365    int n_ctxt;
2366
2367    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2368        mem_base = xmlMemBlocks();
2369        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2370
2371        ret_val = htmlParseDocument(ctxt);
2372        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2373        desret_int(ret_val);
2374        call_tests++;
2375        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2376        xmlResetLastError();
2377        if (mem_base != xmlMemBlocks()) {
2378            printf("Leak of %d blocks found in htmlParseDocument",
2379	           xmlMemBlocks() - mem_base);
2380	    test_ret++;
2381            printf(" %d", n_ctxt);
2382            printf("\n");
2383        }
2384    }
2385    function_tests++;
2386#endif
2387
2388    return(test_ret);
2389}
2390
2391
2392static int
2393test_htmlParseElement(void) {
2394    int test_ret = 0;
2395
2396#if defined(LIBXML_HTML_ENABLED)
2397    int mem_base;
2398    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2399    int n_ctxt;
2400
2401    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2402        mem_base = xmlMemBlocks();
2403        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2404
2405        htmlParseElement(ctxt);
2406        call_tests++;
2407        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2408        xmlResetLastError();
2409        if (mem_base != xmlMemBlocks()) {
2410            printf("Leak of %d blocks found in htmlParseElement",
2411	           xmlMemBlocks() - mem_base);
2412	    test_ret++;
2413            printf(" %d", n_ctxt);
2414            printf("\n");
2415        }
2416    }
2417    function_tests++;
2418#endif
2419
2420    return(test_ret);
2421}
2422
2423
2424static int
2425test_htmlParseEntityRef(void) {
2426    int test_ret = 0;
2427
2428#if defined(LIBXML_HTML_ENABLED)
2429    int mem_base;
2430    const htmlEntityDesc * ret_val;
2431    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2432    int n_ctxt;
2433    xmlChar ** str; /* location to store the entity name */
2434    int n_str;
2435
2436    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2437    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2438        mem_base = xmlMemBlocks();
2439        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2440        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2441
2442        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2443        desret_const_htmlEntityDesc_ptr(ret_val);
2444        call_tests++;
2445        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2446        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2447        xmlResetLastError();
2448        if (mem_base != xmlMemBlocks()) {
2449            printf("Leak of %d blocks found in htmlParseEntityRef",
2450	           xmlMemBlocks() - mem_base);
2451	    test_ret++;
2452            printf(" %d", n_ctxt);
2453            printf(" %d", n_str);
2454            printf("\n");
2455        }
2456    }
2457    }
2458    function_tests++;
2459#endif
2460
2461    return(test_ret);
2462}
2463
2464
2465static int
2466test_htmlParseFile(void) {
2467    int test_ret = 0;
2468
2469#if defined(LIBXML_HTML_ENABLED)
2470    htmlDocPtr ret_val;
2471    const char * filename; /* the filename */
2472    int n_filename;
2473    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2474    int n_encoding;
2475
2476    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2477    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2478        filename = gen_filepath(n_filename, 0);
2479        encoding = gen_const_char_ptr(n_encoding, 1);
2480
2481        ret_val = htmlParseFile(filename, (const char *)encoding);
2482        desret_htmlDocPtr(ret_val);
2483        call_tests++;
2484        des_filepath(n_filename, filename, 0);
2485        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2486        xmlResetLastError();
2487    }
2488    }
2489    function_tests++;
2490#endif
2491
2492    return(test_ret);
2493}
2494
2495
2496static int
2497test_htmlReadDoc(void) {
2498    int test_ret = 0;
2499
2500#if defined(LIBXML_HTML_ENABLED)
2501    int mem_base;
2502    htmlDocPtr ret_val;
2503    xmlChar * cur; /* a pointer to a zero terminated string */
2504    int n_cur;
2505    const char * URL; /* the base URL to use for the document */
2506    int n_URL;
2507    char * encoding; /* the document encoding, or NULL */
2508    int n_encoding;
2509    int options; /* a combination of htmlParserOption(s) */
2510    int n_options;
2511
2512    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2513    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2514    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2515    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2516        mem_base = xmlMemBlocks();
2517        cur = gen_const_xmlChar_ptr(n_cur, 0);
2518        URL = gen_filepath(n_URL, 1);
2519        encoding = gen_const_char_ptr(n_encoding, 2);
2520        options = gen_int(n_options, 3);
2521
2522        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2523        desret_htmlDocPtr(ret_val);
2524        call_tests++;
2525        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2526        des_filepath(n_URL, URL, 1);
2527        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2528        des_int(n_options, options, 3);
2529        xmlResetLastError();
2530        if (mem_base != xmlMemBlocks()) {
2531            printf("Leak of %d blocks found in htmlReadDoc",
2532	           xmlMemBlocks() - mem_base);
2533	    test_ret++;
2534            printf(" %d", n_cur);
2535            printf(" %d", n_URL);
2536            printf(" %d", n_encoding);
2537            printf(" %d", n_options);
2538            printf("\n");
2539        }
2540    }
2541    }
2542    }
2543    }
2544    function_tests++;
2545#endif
2546
2547    return(test_ret);
2548}
2549
2550
2551static int
2552test_htmlReadFile(void) {
2553    int test_ret = 0;
2554
2555#if defined(LIBXML_HTML_ENABLED)
2556    int mem_base;
2557    htmlDocPtr ret_val;
2558    const char * filename; /* a file or URL */
2559    int n_filename;
2560    char * encoding; /* the document encoding, or NULL */
2561    int n_encoding;
2562    int options; /* a combination of htmlParserOption(s) */
2563    int n_options;
2564
2565    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2566    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2567    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2568        mem_base = xmlMemBlocks();
2569        filename = gen_filepath(n_filename, 0);
2570        encoding = gen_const_char_ptr(n_encoding, 1);
2571        options = gen_int(n_options, 2);
2572
2573        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2574        desret_htmlDocPtr(ret_val);
2575        call_tests++;
2576        des_filepath(n_filename, filename, 0);
2577        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2578        des_int(n_options, options, 2);
2579        xmlResetLastError();
2580        if (mem_base != xmlMemBlocks()) {
2581            printf("Leak of %d blocks found in htmlReadFile",
2582	           xmlMemBlocks() - mem_base);
2583	    test_ret++;
2584            printf(" %d", n_filename);
2585            printf(" %d", n_encoding);
2586            printf(" %d", n_options);
2587            printf("\n");
2588        }
2589    }
2590    }
2591    }
2592    function_tests++;
2593#endif
2594
2595    return(test_ret);
2596}
2597
2598
2599static int
2600test_htmlReadMemory(void) {
2601    int test_ret = 0;
2602
2603#if defined(LIBXML_HTML_ENABLED)
2604    int mem_base;
2605    htmlDocPtr ret_val;
2606    char * buffer; /* a pointer to a char array */
2607    int n_buffer;
2608    int size; /* the size of the array */
2609    int n_size;
2610    const char * URL; /* the base URL to use for the document */
2611    int n_URL;
2612    char * encoding; /* the document encoding, or NULL */
2613    int n_encoding;
2614    int options; /* a combination of htmlParserOption(s) */
2615    int n_options;
2616
2617    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2618    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2619    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2620    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2621    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2622        mem_base = xmlMemBlocks();
2623        buffer = gen_const_char_ptr(n_buffer, 0);
2624        size = gen_int(n_size, 1);
2625        URL = gen_filepath(n_URL, 2);
2626        encoding = gen_const_char_ptr(n_encoding, 3);
2627        options = gen_int(n_options, 4);
2628
2629        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2630        desret_htmlDocPtr(ret_val);
2631        call_tests++;
2632        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2633        des_int(n_size, size, 1);
2634        des_filepath(n_URL, URL, 2);
2635        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2636        des_int(n_options, options, 4);
2637        xmlResetLastError();
2638        if (mem_base != xmlMemBlocks()) {
2639            printf("Leak of %d blocks found in htmlReadMemory",
2640	           xmlMemBlocks() - mem_base);
2641	    test_ret++;
2642            printf(" %d", n_buffer);
2643            printf(" %d", n_size);
2644            printf(" %d", n_URL);
2645            printf(" %d", n_encoding);
2646            printf(" %d", n_options);
2647            printf("\n");
2648        }
2649    }
2650    }
2651    }
2652    }
2653    }
2654    function_tests++;
2655#endif
2656
2657    return(test_ret);
2658}
2659
2660
2661static int
2662test_htmlSAXParseDoc(void) {
2663    int test_ret = 0;
2664
2665#if defined(LIBXML_HTML_ENABLED)
2666    int mem_base;
2667    htmlDocPtr ret_val;
2668    xmlChar * cur; /* a pointer to an array of xmlChar */
2669    int n_cur;
2670    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2671    int n_encoding;
2672    htmlSAXHandlerPtr sax; /* the SAX handler block */
2673    int n_sax;
2674    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2675    int n_userData;
2676
2677    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2678    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2679    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2680    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2681        mem_base = xmlMemBlocks();
2682        cur = gen_xmlChar_ptr(n_cur, 0);
2683        encoding = gen_const_char_ptr(n_encoding, 1);
2684        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2685        userData = gen_userdata(n_userData, 3);
2686
2687        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2688        desret_htmlDocPtr(ret_val);
2689        call_tests++;
2690        des_xmlChar_ptr(n_cur, cur, 0);
2691        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2692        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2693        des_userdata(n_userData, userData, 3);
2694        xmlResetLastError();
2695        if (mem_base != xmlMemBlocks()) {
2696            printf("Leak of %d blocks found in htmlSAXParseDoc",
2697	           xmlMemBlocks() - mem_base);
2698	    test_ret++;
2699            printf(" %d", n_cur);
2700            printf(" %d", n_encoding);
2701            printf(" %d", n_sax);
2702            printf(" %d", n_userData);
2703            printf("\n");
2704        }
2705    }
2706    }
2707    }
2708    }
2709    function_tests++;
2710#endif
2711
2712    return(test_ret);
2713}
2714
2715
2716static int
2717test_htmlSAXParseFile(void) {
2718    int test_ret = 0;
2719
2720#if defined(LIBXML_HTML_ENABLED)
2721    int mem_base;
2722    htmlDocPtr ret_val;
2723    const char * filename; /* the filename */
2724    int n_filename;
2725    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2726    int n_encoding;
2727    htmlSAXHandlerPtr sax; /* the SAX handler block */
2728    int n_sax;
2729    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2730    int n_userData;
2731
2732    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2733    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2734    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2735    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2736        mem_base = xmlMemBlocks();
2737        filename = gen_filepath(n_filename, 0);
2738        encoding = gen_const_char_ptr(n_encoding, 1);
2739        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2740        userData = gen_userdata(n_userData, 3);
2741
2742        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2743        desret_htmlDocPtr(ret_val);
2744        call_tests++;
2745        des_filepath(n_filename, filename, 0);
2746        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2747        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2748        des_userdata(n_userData, userData, 3);
2749        xmlResetLastError();
2750        if (mem_base != xmlMemBlocks()) {
2751            printf("Leak of %d blocks found in htmlSAXParseFile",
2752	           xmlMemBlocks() - mem_base);
2753	    test_ret++;
2754            printf(" %d", n_filename);
2755            printf(" %d", n_encoding);
2756            printf(" %d", n_sax);
2757            printf(" %d", n_userData);
2758            printf("\n");
2759        }
2760    }
2761    }
2762    }
2763    }
2764    function_tests++;
2765#endif
2766
2767    return(test_ret);
2768}
2769
2770
2771static int
2772test_htmlTagLookup(void) {
2773    int test_ret = 0;
2774
2775
2776    /* missing type support */
2777    return(test_ret);
2778}
2779
2780static int
2781test_HTMLparser(void) {
2782    int test_ret = 0;
2783
2784    if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2785    test_ret += test_UTF8ToHtml();
2786    test_ret += test_htmlAttrAllowed();
2787    test_ret += test_htmlAutoCloseTag();
2788    test_ret += test_htmlCreateMemoryParserCtxt();
2789    test_ret += test_htmlCreatePushParserCtxt();
2790    test_ret += test_htmlCtxtReadDoc();
2791    test_ret += test_htmlCtxtReadFile();
2792    test_ret += test_htmlCtxtReadMemory();
2793    test_ret += test_htmlCtxtReset();
2794    test_ret += test_htmlCtxtUseOptions();
2795    test_ret += test_htmlElementAllowedHere();
2796    test_ret += test_htmlElementStatusHere();
2797    test_ret += test_htmlEncodeEntities();
2798    test_ret += test_htmlEntityLookup();
2799    test_ret += test_htmlEntityValueLookup();
2800    test_ret += test_htmlHandleOmittedElem();
2801    test_ret += test_htmlIsAutoClosed();
2802    test_ret += test_htmlIsScriptAttribute();
2803    test_ret += test_htmlNewParserCtxt();
2804    test_ret += test_htmlNodeStatus();
2805    test_ret += test_htmlParseCharRef();
2806    test_ret += test_htmlParseChunk();
2807    test_ret += test_htmlParseDoc();
2808    test_ret += test_htmlParseDocument();
2809    test_ret += test_htmlParseElement();
2810    test_ret += test_htmlParseEntityRef();
2811    test_ret += test_htmlParseFile();
2812    test_ret += test_htmlReadDoc();
2813    test_ret += test_htmlReadFile();
2814    test_ret += test_htmlReadMemory();
2815    test_ret += test_htmlSAXParseDoc();
2816    test_ret += test_htmlSAXParseFile();
2817    test_ret += test_htmlTagLookup();
2818
2819    if (test_ret != 0)
2820	printf("Module HTMLparser: %d errors\n", test_ret);
2821    return(test_ret);
2822}
2823
2824static int
2825test_htmlDocContentDumpFormatOutput(void) {
2826    int test_ret = 0;
2827
2828#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2829    int mem_base;
2830    xmlOutputBufferPtr buf; /* the HTML buffer output */
2831    int n_buf;
2832    xmlDocPtr cur; /* the document */
2833    int n_cur;
2834    char * encoding; /* the encoding string */
2835    int n_encoding;
2836    int format; /* should formatting spaces been added */
2837    int n_format;
2838
2839    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2840    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2841    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2842    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2843        mem_base = xmlMemBlocks();
2844        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2845        cur = gen_xmlDocPtr(n_cur, 1);
2846        encoding = gen_const_char_ptr(n_encoding, 2);
2847        format = gen_int(n_format, 3);
2848
2849        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2850        call_tests++;
2851        des_xmlOutputBufferPtr(n_buf, buf, 0);
2852        des_xmlDocPtr(n_cur, cur, 1);
2853        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2854        des_int(n_format, format, 3);
2855        xmlResetLastError();
2856        if (mem_base != xmlMemBlocks()) {
2857            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2858	           xmlMemBlocks() - mem_base);
2859	    test_ret++;
2860            printf(" %d", n_buf);
2861            printf(" %d", n_cur);
2862            printf(" %d", n_encoding);
2863            printf(" %d", n_format);
2864            printf("\n");
2865        }
2866    }
2867    }
2868    }
2869    }
2870    function_tests++;
2871#endif
2872
2873    return(test_ret);
2874}
2875
2876
2877static int
2878test_htmlDocContentDumpOutput(void) {
2879    int test_ret = 0;
2880
2881#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2882    int mem_base;
2883    xmlOutputBufferPtr buf; /* the HTML buffer output */
2884    int n_buf;
2885    xmlDocPtr cur; /* the document */
2886    int n_cur;
2887    char * encoding; /* the encoding string */
2888    int n_encoding;
2889
2890    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2891    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2892    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2893        mem_base = xmlMemBlocks();
2894        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2895        cur = gen_xmlDocPtr(n_cur, 1);
2896        encoding = gen_const_char_ptr(n_encoding, 2);
2897
2898        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2899        call_tests++;
2900        des_xmlOutputBufferPtr(n_buf, buf, 0);
2901        des_xmlDocPtr(n_cur, cur, 1);
2902        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2903        xmlResetLastError();
2904        if (mem_base != xmlMemBlocks()) {
2905            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2906	           xmlMemBlocks() - mem_base);
2907	    test_ret++;
2908            printf(" %d", n_buf);
2909            printf(" %d", n_cur);
2910            printf(" %d", n_encoding);
2911            printf("\n");
2912        }
2913    }
2914    }
2915    }
2916    function_tests++;
2917#endif
2918
2919    return(test_ret);
2920}
2921
2922
2923static int
2924test_htmlDocDump(void) {
2925    int test_ret = 0;
2926
2927#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2928    int mem_base;
2929    int ret_val;
2930    FILE * f; /* the FILE* */
2931    int n_f;
2932    xmlDocPtr cur; /* the document */
2933    int n_cur;
2934
2935    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2936    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2937        mem_base = xmlMemBlocks();
2938        f = gen_FILE_ptr(n_f, 0);
2939        cur = gen_xmlDocPtr(n_cur, 1);
2940
2941        ret_val = htmlDocDump(f, cur);
2942        desret_int(ret_val);
2943        call_tests++;
2944        des_FILE_ptr(n_f, f, 0);
2945        des_xmlDocPtr(n_cur, cur, 1);
2946        xmlResetLastError();
2947        if (mem_base != xmlMemBlocks()) {
2948            printf("Leak of %d blocks found in htmlDocDump",
2949	           xmlMemBlocks() - mem_base);
2950	    test_ret++;
2951            printf(" %d", n_f);
2952            printf(" %d", n_cur);
2953            printf("\n");
2954        }
2955    }
2956    }
2957    function_tests++;
2958#endif
2959
2960    return(test_ret);
2961}
2962
2963
2964#define gen_nb_xmlChar_ptr_ptr 1
2965static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2966    return(NULL);
2967}
2968static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2969}
2970
2971static int
2972test_htmlDocDumpMemory(void) {
2973    int test_ret = 0;
2974
2975#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2976    int mem_base;
2977    xmlDocPtr cur; /* the document */
2978    int n_cur;
2979    xmlChar ** mem; /* OUT: the memory pointer */
2980    int n_mem;
2981    int * size; /* OUT: the memory length */
2982    int n_size;
2983
2984    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2985    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2986    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2987        mem_base = xmlMemBlocks();
2988        cur = gen_xmlDocPtr(n_cur, 0);
2989        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2990        size = gen_int_ptr(n_size, 2);
2991
2992        htmlDocDumpMemory(cur, mem, size);
2993        call_tests++;
2994        des_xmlDocPtr(n_cur, cur, 0);
2995        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2996        des_int_ptr(n_size, size, 2);
2997        xmlResetLastError();
2998        if (mem_base != xmlMemBlocks()) {
2999            printf("Leak of %d blocks found in htmlDocDumpMemory",
3000	           xmlMemBlocks() - mem_base);
3001	    test_ret++;
3002            printf(" %d", n_cur);
3003            printf(" %d", n_mem);
3004            printf(" %d", n_size);
3005            printf("\n");
3006        }
3007    }
3008    }
3009    }
3010    function_tests++;
3011#endif
3012
3013    return(test_ret);
3014}
3015
3016
3017static int
3018test_htmlDocDumpMemoryFormat(void) {
3019    int test_ret = 0;
3020
3021#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3022    int mem_base;
3023    xmlDocPtr cur; /* the document */
3024    int n_cur;
3025    xmlChar ** mem; /* OUT: the memory pointer */
3026    int n_mem;
3027    int * size; /* OUT: the memory length */
3028    int n_size;
3029    int format; /* should formatting spaces been added */
3030    int n_format;
3031
3032    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3033    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3034    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3035    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3036        mem_base = xmlMemBlocks();
3037        cur = gen_xmlDocPtr(n_cur, 0);
3038        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3039        size = gen_int_ptr(n_size, 2);
3040        format = gen_int(n_format, 3);
3041
3042        htmlDocDumpMemoryFormat(cur, mem, size, format);
3043        call_tests++;
3044        des_xmlDocPtr(n_cur, cur, 0);
3045        des_xmlChar_ptr_ptr(n_mem, mem, 1);
3046        des_int_ptr(n_size, size, 2);
3047        des_int(n_format, format, 3);
3048        xmlResetLastError();
3049        if (mem_base != xmlMemBlocks()) {
3050            printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3051	           xmlMemBlocks() - mem_base);
3052	    test_ret++;
3053            printf(" %d", n_cur);
3054            printf(" %d", n_mem);
3055            printf(" %d", n_size);
3056            printf(" %d", n_format);
3057            printf("\n");
3058        }
3059    }
3060    }
3061    }
3062    }
3063    function_tests++;
3064#endif
3065
3066    return(test_ret);
3067}
3068
3069
3070static int
3071test_htmlGetMetaEncoding(void) {
3072    int test_ret = 0;
3073
3074#if defined(LIBXML_HTML_ENABLED)
3075    int mem_base;
3076    const xmlChar * ret_val;
3077    htmlDocPtr doc; /* the document */
3078    int n_doc;
3079
3080    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3081        mem_base = xmlMemBlocks();
3082        doc = gen_htmlDocPtr(n_doc, 0);
3083
3084        ret_val = htmlGetMetaEncoding(doc);
3085        desret_const_xmlChar_ptr(ret_val);
3086        call_tests++;
3087        des_htmlDocPtr(n_doc, doc, 0);
3088        xmlResetLastError();
3089        if (mem_base != xmlMemBlocks()) {
3090            printf("Leak of %d blocks found in htmlGetMetaEncoding",
3091	           xmlMemBlocks() - mem_base);
3092	    test_ret++;
3093            printf(" %d", n_doc);
3094            printf("\n");
3095        }
3096    }
3097    function_tests++;
3098#endif
3099
3100    return(test_ret);
3101}
3102
3103
3104static int
3105test_htmlIsBooleanAttr(void) {
3106    int test_ret = 0;
3107
3108#if defined(LIBXML_HTML_ENABLED)
3109    int mem_base;
3110    int ret_val;
3111    xmlChar * name; /* the name of the attribute to check */
3112    int n_name;
3113
3114    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3115        mem_base = xmlMemBlocks();
3116        name = gen_const_xmlChar_ptr(n_name, 0);
3117
3118        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3119        desret_int(ret_val);
3120        call_tests++;
3121        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3122        xmlResetLastError();
3123        if (mem_base != xmlMemBlocks()) {
3124            printf("Leak of %d blocks found in htmlIsBooleanAttr",
3125	           xmlMemBlocks() - mem_base);
3126	    test_ret++;
3127            printf(" %d", n_name);
3128            printf("\n");
3129        }
3130    }
3131    function_tests++;
3132#endif
3133
3134    return(test_ret);
3135}
3136
3137
3138static int
3139test_htmlNewDoc(void) {
3140    int test_ret = 0;
3141
3142#if defined(LIBXML_HTML_ENABLED)
3143    int mem_base;
3144    htmlDocPtr ret_val;
3145    xmlChar * URI; /* URI for the dtd, or NULL */
3146    int n_URI;
3147    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3148    int n_ExternalID;
3149
3150    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3151    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3152        mem_base = xmlMemBlocks();
3153        URI = gen_const_xmlChar_ptr(n_URI, 0);
3154        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3155
3156        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3157        desret_htmlDocPtr(ret_val);
3158        call_tests++;
3159        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3160        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3161        xmlResetLastError();
3162        if (mem_base != xmlMemBlocks()) {
3163            printf("Leak of %d blocks found in htmlNewDoc",
3164	           xmlMemBlocks() - mem_base);
3165	    test_ret++;
3166            printf(" %d", n_URI);
3167            printf(" %d", n_ExternalID);
3168            printf("\n");
3169        }
3170    }
3171    }
3172    function_tests++;
3173#endif
3174
3175    return(test_ret);
3176}
3177
3178
3179static int
3180test_htmlNewDocNoDtD(void) {
3181    int test_ret = 0;
3182
3183#if defined(LIBXML_HTML_ENABLED)
3184    int mem_base;
3185    htmlDocPtr ret_val;
3186    xmlChar * URI; /* URI for the dtd, or NULL */
3187    int n_URI;
3188    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3189    int n_ExternalID;
3190
3191    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3192    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3193        mem_base = xmlMemBlocks();
3194        URI = gen_const_xmlChar_ptr(n_URI, 0);
3195        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3196
3197        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3198        desret_htmlDocPtr(ret_val);
3199        call_tests++;
3200        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3201        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3202        xmlResetLastError();
3203        if (mem_base != xmlMemBlocks()) {
3204            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3205	           xmlMemBlocks() - mem_base);
3206	    test_ret++;
3207            printf(" %d", n_URI);
3208            printf(" %d", n_ExternalID);
3209            printf("\n");
3210        }
3211    }
3212    }
3213    function_tests++;
3214#endif
3215
3216    return(test_ret);
3217}
3218
3219
3220static int
3221test_htmlNodeDump(void) {
3222    int test_ret = 0;
3223
3224#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3225    int mem_base;
3226    int ret_val;
3227    xmlBufferPtr buf; /* the HTML buffer output */
3228    int n_buf;
3229    xmlDocPtr doc; /* the document */
3230    int n_doc;
3231    xmlNodePtr cur; /* the current node */
3232    int n_cur;
3233
3234    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3235    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3236    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3237        mem_base = xmlMemBlocks();
3238        buf = gen_xmlBufferPtr(n_buf, 0);
3239        doc = gen_xmlDocPtr(n_doc, 1);
3240        cur = gen_xmlNodePtr(n_cur, 2);
3241
3242        ret_val = htmlNodeDump(buf, doc, cur);
3243        desret_int(ret_val);
3244        call_tests++;
3245        des_xmlBufferPtr(n_buf, buf, 0);
3246        des_xmlDocPtr(n_doc, doc, 1);
3247        des_xmlNodePtr(n_cur, cur, 2);
3248        xmlResetLastError();
3249        if (mem_base != xmlMemBlocks()) {
3250            printf("Leak of %d blocks found in htmlNodeDump",
3251	           xmlMemBlocks() - mem_base);
3252	    test_ret++;
3253            printf(" %d", n_buf);
3254            printf(" %d", n_doc);
3255            printf(" %d", n_cur);
3256            printf("\n");
3257        }
3258    }
3259    }
3260    }
3261    function_tests++;
3262#endif
3263
3264    return(test_ret);
3265}
3266
3267
3268static int
3269test_htmlNodeDumpFile(void) {
3270    int test_ret = 0;
3271
3272#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3273    int mem_base;
3274    FILE * out; /* the FILE pointer */
3275    int n_out;
3276    xmlDocPtr doc; /* the document */
3277    int n_doc;
3278    xmlNodePtr cur; /* the current node */
3279    int n_cur;
3280
3281    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3282    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3283    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3284        mem_base = xmlMemBlocks();
3285        out = gen_FILE_ptr(n_out, 0);
3286        doc = gen_xmlDocPtr(n_doc, 1);
3287        cur = gen_xmlNodePtr(n_cur, 2);
3288
3289        htmlNodeDumpFile(out, doc, cur);
3290        call_tests++;
3291        des_FILE_ptr(n_out, out, 0);
3292        des_xmlDocPtr(n_doc, doc, 1);
3293        des_xmlNodePtr(n_cur, cur, 2);
3294        xmlResetLastError();
3295        if (mem_base != xmlMemBlocks()) {
3296            printf("Leak of %d blocks found in htmlNodeDumpFile",
3297	           xmlMemBlocks() - mem_base);
3298	    test_ret++;
3299            printf(" %d", n_out);
3300            printf(" %d", n_doc);
3301            printf(" %d", n_cur);
3302            printf("\n");
3303        }
3304    }
3305    }
3306    }
3307    function_tests++;
3308#endif
3309
3310    return(test_ret);
3311}
3312
3313
3314static int
3315test_htmlNodeDumpFileFormat(void) {
3316    int test_ret = 0;
3317
3318#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3319    int mem_base;
3320    int ret_val;
3321    FILE * out; /* the FILE pointer */
3322    int n_out;
3323    xmlDocPtr doc; /* the document */
3324    int n_doc;
3325    xmlNodePtr cur; /* the current node */
3326    int n_cur;
3327    char * encoding; /* the document encoding */
3328    int n_encoding;
3329    int format; /* should formatting spaces been added */
3330    int n_format;
3331
3332    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3333    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3334    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3335    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3336    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3337        mem_base = xmlMemBlocks();
3338        out = gen_FILE_ptr(n_out, 0);
3339        doc = gen_xmlDocPtr(n_doc, 1);
3340        cur = gen_xmlNodePtr(n_cur, 2);
3341        encoding = gen_const_char_ptr(n_encoding, 3);
3342        format = gen_int(n_format, 4);
3343
3344        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3345        desret_int(ret_val);
3346        call_tests++;
3347        des_FILE_ptr(n_out, out, 0);
3348        des_xmlDocPtr(n_doc, doc, 1);
3349        des_xmlNodePtr(n_cur, cur, 2);
3350        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3351        des_int(n_format, format, 4);
3352        xmlResetLastError();
3353        if (mem_base != xmlMemBlocks()) {
3354            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3355	           xmlMemBlocks() - mem_base);
3356	    test_ret++;
3357            printf(" %d", n_out);
3358            printf(" %d", n_doc);
3359            printf(" %d", n_cur);
3360            printf(" %d", n_encoding);
3361            printf(" %d", n_format);
3362            printf("\n");
3363        }
3364    }
3365    }
3366    }
3367    }
3368    }
3369    function_tests++;
3370#endif
3371
3372    return(test_ret);
3373}
3374
3375
3376static int
3377test_htmlNodeDumpFormatOutput(void) {
3378    int test_ret = 0;
3379
3380#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3381    int mem_base;
3382    xmlOutputBufferPtr buf; /* the HTML buffer output */
3383    int n_buf;
3384    xmlDocPtr doc; /* the document */
3385    int n_doc;
3386    xmlNodePtr cur; /* the current node */
3387    int n_cur;
3388    char * encoding; /* the encoding string */
3389    int n_encoding;
3390    int format; /* should formatting spaces been added */
3391    int n_format;
3392
3393    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3394    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3395    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3396    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3397    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3398        mem_base = xmlMemBlocks();
3399        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3400        doc = gen_xmlDocPtr(n_doc, 1);
3401        cur = gen_xmlNodePtr(n_cur, 2);
3402        encoding = gen_const_char_ptr(n_encoding, 3);
3403        format = gen_int(n_format, 4);
3404
3405        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3406        call_tests++;
3407        des_xmlOutputBufferPtr(n_buf, buf, 0);
3408        des_xmlDocPtr(n_doc, doc, 1);
3409        des_xmlNodePtr(n_cur, cur, 2);
3410        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3411        des_int(n_format, format, 4);
3412        xmlResetLastError();
3413        if (mem_base != xmlMemBlocks()) {
3414            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3415	           xmlMemBlocks() - mem_base);
3416	    test_ret++;
3417            printf(" %d", n_buf);
3418            printf(" %d", n_doc);
3419            printf(" %d", n_cur);
3420            printf(" %d", n_encoding);
3421            printf(" %d", n_format);
3422            printf("\n");
3423        }
3424    }
3425    }
3426    }
3427    }
3428    }
3429    function_tests++;
3430#endif
3431
3432    return(test_ret);
3433}
3434
3435
3436static int
3437test_htmlNodeDumpOutput(void) {
3438    int test_ret = 0;
3439
3440#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3441    int mem_base;
3442    xmlOutputBufferPtr buf; /* the HTML buffer output */
3443    int n_buf;
3444    xmlDocPtr doc; /* the document */
3445    int n_doc;
3446    xmlNodePtr cur; /* the current node */
3447    int n_cur;
3448    char * encoding; /* the encoding string */
3449    int n_encoding;
3450
3451    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3452    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3453    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3454    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3455        mem_base = xmlMemBlocks();
3456        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3457        doc = gen_xmlDocPtr(n_doc, 1);
3458        cur = gen_xmlNodePtr(n_cur, 2);
3459        encoding = gen_const_char_ptr(n_encoding, 3);
3460
3461        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3462        call_tests++;
3463        des_xmlOutputBufferPtr(n_buf, buf, 0);
3464        des_xmlDocPtr(n_doc, doc, 1);
3465        des_xmlNodePtr(n_cur, cur, 2);
3466        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3467        xmlResetLastError();
3468        if (mem_base != xmlMemBlocks()) {
3469            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3470	           xmlMemBlocks() - mem_base);
3471	    test_ret++;
3472            printf(" %d", n_buf);
3473            printf(" %d", n_doc);
3474            printf(" %d", n_cur);
3475            printf(" %d", n_encoding);
3476            printf("\n");
3477        }
3478    }
3479    }
3480    }
3481    }
3482    function_tests++;
3483#endif
3484
3485    return(test_ret);
3486}
3487
3488
3489static int
3490test_htmlSaveFile(void) {
3491    int test_ret = 0;
3492
3493#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3494    int mem_base;
3495    int ret_val;
3496    const char * filename; /* the filename (or URL) */
3497    int n_filename;
3498    xmlDocPtr cur; /* the document */
3499    int n_cur;
3500
3501    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3502    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3503        mem_base = xmlMemBlocks();
3504        filename = gen_fileoutput(n_filename, 0);
3505        cur = gen_xmlDocPtr(n_cur, 1);
3506
3507        ret_val = htmlSaveFile(filename, cur);
3508        desret_int(ret_val);
3509        call_tests++;
3510        des_fileoutput(n_filename, filename, 0);
3511        des_xmlDocPtr(n_cur, cur, 1);
3512        xmlResetLastError();
3513        if (mem_base != xmlMemBlocks()) {
3514            printf("Leak of %d blocks found in htmlSaveFile",
3515	           xmlMemBlocks() - mem_base);
3516	    test_ret++;
3517            printf(" %d", n_filename);
3518            printf(" %d", n_cur);
3519            printf("\n");
3520        }
3521    }
3522    }
3523    function_tests++;
3524#endif
3525
3526    return(test_ret);
3527}
3528
3529
3530static int
3531test_htmlSaveFileEnc(void) {
3532    int test_ret = 0;
3533
3534#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3535    int mem_base;
3536    int ret_val;
3537    const char * filename; /* the filename */
3538    int n_filename;
3539    xmlDocPtr cur; /* the document */
3540    int n_cur;
3541    char * encoding; /* the document encoding */
3542    int n_encoding;
3543
3544    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3545    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3546    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3547        mem_base = xmlMemBlocks();
3548        filename = gen_fileoutput(n_filename, 0);
3549        cur = gen_xmlDocPtr(n_cur, 1);
3550        encoding = gen_const_char_ptr(n_encoding, 2);
3551
3552        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3553        desret_int(ret_val);
3554        call_tests++;
3555        des_fileoutput(n_filename, filename, 0);
3556        des_xmlDocPtr(n_cur, cur, 1);
3557        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3558        xmlResetLastError();
3559        if (mem_base != xmlMemBlocks()) {
3560            printf("Leak of %d blocks found in htmlSaveFileEnc",
3561	           xmlMemBlocks() - mem_base);
3562	    test_ret++;
3563            printf(" %d", n_filename);
3564            printf(" %d", n_cur);
3565            printf(" %d", n_encoding);
3566            printf("\n");
3567        }
3568    }
3569    }
3570    }
3571    function_tests++;
3572#endif
3573
3574    return(test_ret);
3575}
3576
3577
3578static int
3579test_htmlSaveFileFormat(void) {
3580    int test_ret = 0;
3581
3582#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3583    int mem_base;
3584    int ret_val;
3585    const char * filename; /* the filename */
3586    int n_filename;
3587    xmlDocPtr cur; /* the document */
3588    int n_cur;
3589    char * encoding; /* the document encoding */
3590    int n_encoding;
3591    int format; /* should formatting spaces been added */
3592    int n_format;
3593
3594    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3595    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3596    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3597    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3598        mem_base = xmlMemBlocks();
3599        filename = gen_fileoutput(n_filename, 0);
3600        cur = gen_xmlDocPtr(n_cur, 1);
3601        encoding = gen_const_char_ptr(n_encoding, 2);
3602        format = gen_int(n_format, 3);
3603
3604        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3605        desret_int(ret_val);
3606        call_tests++;
3607        des_fileoutput(n_filename, filename, 0);
3608        des_xmlDocPtr(n_cur, cur, 1);
3609        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3610        des_int(n_format, format, 3);
3611        xmlResetLastError();
3612        if (mem_base != xmlMemBlocks()) {
3613            printf("Leak of %d blocks found in htmlSaveFileFormat",
3614	           xmlMemBlocks() - mem_base);
3615	    test_ret++;
3616            printf(" %d", n_filename);
3617            printf(" %d", n_cur);
3618            printf(" %d", n_encoding);
3619            printf(" %d", n_format);
3620            printf("\n");
3621        }
3622    }
3623    }
3624    }
3625    }
3626    function_tests++;
3627#endif
3628
3629    return(test_ret);
3630}
3631
3632
3633static int
3634test_htmlSetMetaEncoding(void) {
3635    int test_ret = 0;
3636
3637#if defined(LIBXML_HTML_ENABLED)
3638    int mem_base;
3639    int ret_val;
3640    htmlDocPtr doc; /* the document */
3641    int n_doc;
3642    xmlChar * encoding; /* the encoding string */
3643    int n_encoding;
3644
3645    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3646    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3647        mem_base = xmlMemBlocks();
3648        doc = gen_htmlDocPtr(n_doc, 0);
3649        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3650
3651        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3652        desret_int(ret_val);
3653        call_tests++;
3654        des_htmlDocPtr(n_doc, doc, 0);
3655        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3656        xmlResetLastError();
3657        if (mem_base != xmlMemBlocks()) {
3658            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3659	           xmlMemBlocks() - mem_base);
3660	    test_ret++;
3661            printf(" %d", n_doc);
3662            printf(" %d", n_encoding);
3663            printf("\n");
3664        }
3665    }
3666    }
3667    function_tests++;
3668#endif
3669
3670    return(test_ret);
3671}
3672
3673static int
3674test_HTMLtree(void) {
3675    int test_ret = 0;
3676
3677    if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3678    test_ret += test_htmlDocContentDumpFormatOutput();
3679    test_ret += test_htmlDocContentDumpOutput();
3680    test_ret += test_htmlDocDump();
3681    test_ret += test_htmlDocDumpMemory();
3682    test_ret += test_htmlDocDumpMemoryFormat();
3683    test_ret += test_htmlGetMetaEncoding();
3684    test_ret += test_htmlIsBooleanAttr();
3685    test_ret += test_htmlNewDoc();
3686    test_ret += test_htmlNewDocNoDtD();
3687    test_ret += test_htmlNodeDump();
3688    test_ret += test_htmlNodeDumpFile();
3689    test_ret += test_htmlNodeDumpFileFormat();
3690    test_ret += test_htmlNodeDumpFormatOutput();
3691    test_ret += test_htmlNodeDumpOutput();
3692    test_ret += test_htmlSaveFile();
3693    test_ret += test_htmlSaveFileEnc();
3694    test_ret += test_htmlSaveFileFormat();
3695    test_ret += test_htmlSetMetaEncoding();
3696
3697    if (test_ret != 0)
3698	printf("Module HTMLtree: %d errors\n", test_ret);
3699    return(test_ret);
3700}
3701
3702static int
3703test_docbDefaultSAXHandlerInit(void) {
3704    int test_ret = 0;
3705
3706#if defined(LIBXML_DOCB_ENABLED)
3707#ifdef LIBXML_DOCB_ENABLED
3708    int mem_base;
3709
3710        mem_base = xmlMemBlocks();
3711
3712        docbDefaultSAXHandlerInit();
3713        call_tests++;
3714        xmlResetLastError();
3715        if (mem_base != xmlMemBlocks()) {
3716            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3717	           xmlMemBlocks() - mem_base);
3718	    test_ret++;
3719            printf("\n");
3720        }
3721    function_tests++;
3722#endif
3723#endif
3724
3725    return(test_ret);
3726}
3727
3728
3729static int
3730test_htmlDefaultSAXHandlerInit(void) {
3731    int test_ret = 0;
3732
3733#if defined(LIBXML_HTML_ENABLED)
3734#ifdef LIBXML_HTML_ENABLED
3735    int mem_base;
3736
3737        mem_base = xmlMemBlocks();
3738
3739        htmlDefaultSAXHandlerInit();
3740        call_tests++;
3741        xmlResetLastError();
3742        if (mem_base != xmlMemBlocks()) {
3743            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3744	           xmlMemBlocks() - mem_base);
3745	    test_ret++;
3746            printf("\n");
3747        }
3748    function_tests++;
3749#endif
3750#endif
3751
3752    return(test_ret);
3753}
3754
3755
3756static int
3757test_xmlDefaultSAXHandlerInit(void) {
3758    int test_ret = 0;
3759
3760    int mem_base;
3761
3762        mem_base = xmlMemBlocks();
3763
3764        xmlDefaultSAXHandlerInit();
3765        call_tests++;
3766        xmlResetLastError();
3767        if (mem_base != xmlMemBlocks()) {
3768            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3769	           xmlMemBlocks() - mem_base);
3770	    test_ret++;
3771            printf("\n");
3772        }
3773    function_tests++;
3774
3775    return(test_ret);
3776}
3777
3778
3779#define gen_nb_xmlEnumerationPtr 1
3780static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3781    return(NULL);
3782}
3783static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3784}
3785
3786static int
3787test_xmlSAX2AttributeDecl(void) {
3788    int test_ret = 0;
3789
3790    int mem_base;
3791    void * ctx; /* the user data (XML parser context) */
3792    int n_ctx;
3793    xmlChar * elem; /* the name of the element */
3794    int n_elem;
3795    xmlChar * fullname; /* the attribute name */
3796    int n_fullname;
3797    int type; /* the attribute type */
3798    int n_type;
3799    int def; /* the type of default value */
3800    int n_def;
3801    xmlChar * defaultValue; /* the attribute default value */
3802    int n_defaultValue;
3803    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3804    int n_tree;
3805
3806    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3807    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3808    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3809    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3810    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3811    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3812    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3813        mem_base = xmlMemBlocks();
3814        ctx = gen_void_ptr(n_ctx, 0);
3815        elem = gen_const_xmlChar_ptr(n_elem, 1);
3816        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3817        type = gen_int(n_type, 3);
3818        def = gen_int(n_def, 4);
3819        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3820        tree = gen_xmlEnumerationPtr(n_tree, 6);
3821
3822        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3823        call_tests++;
3824        des_void_ptr(n_ctx, ctx, 0);
3825        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3826        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3827        des_int(n_type, type, 3);
3828        des_int(n_def, def, 4);
3829        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3830        des_xmlEnumerationPtr(n_tree, tree, 6);
3831        xmlResetLastError();
3832        if (mem_base != xmlMemBlocks()) {
3833            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3834	           xmlMemBlocks() - mem_base);
3835	    test_ret++;
3836            printf(" %d", n_ctx);
3837            printf(" %d", n_elem);
3838            printf(" %d", n_fullname);
3839            printf(" %d", n_type);
3840            printf(" %d", n_def);
3841            printf(" %d", n_defaultValue);
3842            printf(" %d", n_tree);
3843            printf("\n");
3844        }
3845    }
3846    }
3847    }
3848    }
3849    }
3850    }
3851    }
3852    function_tests++;
3853
3854    return(test_ret);
3855}
3856
3857
3858static int
3859test_xmlSAX2CDataBlock(void) {
3860    int test_ret = 0;
3861
3862    int mem_base;
3863    void * ctx; /* the user data (XML parser context) */
3864    int n_ctx;
3865    xmlChar * value; /* The pcdata content */
3866    int n_value;
3867    int len; /* the block length */
3868    int n_len;
3869
3870    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3871    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3872    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3873        mem_base = xmlMemBlocks();
3874        ctx = gen_void_ptr(n_ctx, 0);
3875        value = gen_const_xmlChar_ptr(n_value, 1);
3876        len = gen_int(n_len, 2);
3877
3878        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3879        call_tests++;
3880        des_void_ptr(n_ctx, ctx, 0);
3881        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3882        des_int(n_len, len, 2);
3883        xmlResetLastError();
3884        if (mem_base != xmlMemBlocks()) {
3885            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3886	           xmlMemBlocks() - mem_base);
3887	    test_ret++;
3888            printf(" %d", n_ctx);
3889            printf(" %d", n_value);
3890            printf(" %d", n_len);
3891            printf("\n");
3892        }
3893    }
3894    }
3895    }
3896    function_tests++;
3897
3898    return(test_ret);
3899}
3900
3901
3902static int
3903test_xmlSAX2Characters(void) {
3904    int test_ret = 0;
3905
3906    int mem_base;
3907    void * ctx; /* the user data (XML parser context) */
3908    int n_ctx;
3909    xmlChar * ch; /* a xmlChar string */
3910    int n_ch;
3911    int len; /* the number of xmlChar */
3912    int n_len;
3913
3914    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3915    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3916    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3917        mem_base = xmlMemBlocks();
3918        ctx = gen_void_ptr(n_ctx, 0);
3919        ch = gen_const_xmlChar_ptr(n_ch, 1);
3920        len = gen_int(n_len, 2);
3921
3922        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3923        call_tests++;
3924        des_void_ptr(n_ctx, ctx, 0);
3925        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3926        des_int(n_len, len, 2);
3927        xmlResetLastError();
3928        if (mem_base != xmlMemBlocks()) {
3929            printf("Leak of %d blocks found in xmlSAX2Characters",
3930	           xmlMemBlocks() - mem_base);
3931	    test_ret++;
3932            printf(" %d", n_ctx);
3933            printf(" %d", n_ch);
3934            printf(" %d", n_len);
3935            printf("\n");
3936        }
3937    }
3938    }
3939    }
3940    function_tests++;
3941
3942    return(test_ret);
3943}
3944
3945
3946static int
3947test_xmlSAX2Comment(void) {
3948    int test_ret = 0;
3949
3950    int mem_base;
3951    void * ctx; /* the user data (XML parser context) */
3952    int n_ctx;
3953    xmlChar * value; /* the xmlSAX2Comment content */
3954    int n_value;
3955
3956    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3957    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3958        mem_base = xmlMemBlocks();
3959        ctx = gen_void_ptr(n_ctx, 0);
3960        value = gen_const_xmlChar_ptr(n_value, 1);
3961
3962        xmlSAX2Comment(ctx, (const xmlChar *)value);
3963        call_tests++;
3964        des_void_ptr(n_ctx, ctx, 0);
3965        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3966        xmlResetLastError();
3967        if (mem_base != xmlMemBlocks()) {
3968            printf("Leak of %d blocks found in xmlSAX2Comment",
3969	           xmlMemBlocks() - mem_base);
3970	    test_ret++;
3971            printf(" %d", n_ctx);
3972            printf(" %d", n_value);
3973            printf("\n");
3974        }
3975    }
3976    }
3977    function_tests++;
3978
3979    return(test_ret);
3980}
3981
3982
3983static int
3984test_xmlSAX2ElementDecl(void) {
3985    int test_ret = 0;
3986
3987    int mem_base;
3988    void * ctx; /* the user data (XML parser context) */
3989    int n_ctx;
3990    xmlChar * name; /* the element name */
3991    int n_name;
3992    int type; /* the element type */
3993    int n_type;
3994    xmlElementContentPtr content; /* the element value tree */
3995    int n_content;
3996
3997    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3998    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3999    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4000    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
4001        mem_base = xmlMemBlocks();
4002        ctx = gen_void_ptr(n_ctx, 0);
4003        name = gen_const_xmlChar_ptr(n_name, 1);
4004        type = gen_int(n_type, 2);
4005        content = gen_xmlElementContentPtr(n_content, 3);
4006
4007        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4008        call_tests++;
4009        des_void_ptr(n_ctx, ctx, 0);
4010        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4011        des_int(n_type, type, 2);
4012        des_xmlElementContentPtr(n_content, content, 3);
4013        xmlResetLastError();
4014        if (mem_base != xmlMemBlocks()) {
4015            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4016	           xmlMemBlocks() - mem_base);
4017	    test_ret++;
4018            printf(" %d", n_ctx);
4019            printf(" %d", n_name);
4020            printf(" %d", n_type);
4021            printf(" %d", n_content);
4022            printf("\n");
4023        }
4024    }
4025    }
4026    }
4027    }
4028    function_tests++;
4029
4030    return(test_ret);
4031}
4032
4033
4034static int
4035test_xmlSAX2EndDocument(void) {
4036    int test_ret = 0;
4037
4038    int mem_base;
4039    void * ctx; /* the user data (XML parser context) */
4040    int n_ctx;
4041
4042    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4043        mem_base = xmlMemBlocks();
4044        ctx = gen_void_ptr(n_ctx, 0);
4045
4046        xmlSAX2EndDocument(ctx);
4047        call_tests++;
4048        des_void_ptr(n_ctx, ctx, 0);
4049        xmlResetLastError();
4050        if (mem_base != xmlMemBlocks()) {
4051            printf("Leak of %d blocks found in xmlSAX2EndDocument",
4052	           xmlMemBlocks() - mem_base);
4053	    test_ret++;
4054            printf(" %d", n_ctx);
4055            printf("\n");
4056        }
4057    }
4058    function_tests++;
4059
4060    return(test_ret);
4061}
4062
4063
4064static int
4065test_xmlSAX2EndElement(void) {
4066    int test_ret = 0;
4067
4068#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4069#ifdef LIBXML_SAX1_ENABLED
4070    int mem_base;
4071    void * ctx; /* the user data (XML parser context) */
4072    int n_ctx;
4073    xmlChar * name; /* The element name */
4074    int n_name;
4075
4076    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4077    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4078        mem_base = xmlMemBlocks();
4079        ctx = gen_void_ptr(n_ctx, 0);
4080        name = gen_const_xmlChar_ptr(n_name, 1);
4081
4082        xmlSAX2EndElement(ctx, (const xmlChar *)name);
4083        call_tests++;
4084        des_void_ptr(n_ctx, ctx, 0);
4085        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4086        xmlResetLastError();
4087        if (mem_base != xmlMemBlocks()) {
4088            printf("Leak of %d blocks found in xmlSAX2EndElement",
4089	           xmlMemBlocks() - mem_base);
4090	    test_ret++;
4091            printf(" %d", n_ctx);
4092            printf(" %d", n_name);
4093            printf("\n");
4094        }
4095    }
4096    }
4097    function_tests++;
4098#endif
4099#endif
4100
4101    return(test_ret);
4102}
4103
4104
4105static int
4106test_xmlSAX2EndElementNs(void) {
4107    int test_ret = 0;
4108
4109    int mem_base;
4110    void * ctx; /* the user data (XML parser context) */
4111    int n_ctx;
4112    xmlChar * localname; /* the local name of the element */
4113    int n_localname;
4114    xmlChar * prefix; /* the element namespace prefix if available */
4115    int n_prefix;
4116    xmlChar * URI; /* the element namespace name if available */
4117    int n_URI;
4118
4119    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4120    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4121    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4122    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4123        mem_base = xmlMemBlocks();
4124        ctx = gen_void_ptr(n_ctx, 0);
4125        localname = gen_const_xmlChar_ptr(n_localname, 1);
4126        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4127        URI = gen_const_xmlChar_ptr(n_URI, 3);
4128
4129        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4130        call_tests++;
4131        des_void_ptr(n_ctx, ctx, 0);
4132        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4133        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4134        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4135        xmlResetLastError();
4136        if (mem_base != xmlMemBlocks()) {
4137            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4138	           xmlMemBlocks() - mem_base);
4139	    test_ret++;
4140            printf(" %d", n_ctx);
4141            printf(" %d", n_localname);
4142            printf(" %d", n_prefix);
4143            printf(" %d", n_URI);
4144            printf("\n");
4145        }
4146    }
4147    }
4148    }
4149    }
4150    function_tests++;
4151
4152    return(test_ret);
4153}
4154
4155
4156static int
4157test_xmlSAX2EntityDecl(void) {
4158    int test_ret = 0;
4159
4160    int mem_base;
4161    void * ctx; /* the user data (XML parser context) */
4162    int n_ctx;
4163    xmlChar * name; /* the entity name */
4164    int n_name;
4165    int type; /* the entity type */
4166    int n_type;
4167    xmlChar * publicId; /* The public ID of the entity */
4168    int n_publicId;
4169    xmlChar * systemId; /* The system ID of the entity */
4170    int n_systemId;
4171    xmlChar * content; /* the entity value (without processing). */
4172    int n_content;
4173
4174    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4175    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4176    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4177    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4178    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4179    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4180        mem_base = xmlMemBlocks();
4181        ctx = gen_void_ptr(n_ctx, 0);
4182        name = gen_const_xmlChar_ptr(n_name, 1);
4183        type = gen_int(n_type, 2);
4184        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4185        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4186        content = gen_xmlChar_ptr(n_content, 5);
4187
4188        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4189        call_tests++;
4190        des_void_ptr(n_ctx, ctx, 0);
4191        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4192        des_int(n_type, type, 2);
4193        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4194        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4195        des_xmlChar_ptr(n_content, content, 5);
4196        xmlResetLastError();
4197        if (mem_base != xmlMemBlocks()) {
4198            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4199	           xmlMemBlocks() - mem_base);
4200	    test_ret++;
4201            printf(" %d", n_ctx);
4202            printf(" %d", n_name);
4203            printf(" %d", n_type);
4204            printf(" %d", n_publicId);
4205            printf(" %d", n_systemId);
4206            printf(" %d", n_content);
4207            printf("\n");
4208        }
4209    }
4210    }
4211    }
4212    }
4213    }
4214    }
4215    function_tests++;
4216
4217    return(test_ret);
4218}
4219
4220
4221static int
4222test_xmlSAX2ExternalSubset(void) {
4223    int test_ret = 0;
4224
4225    int mem_base;
4226    void * ctx; /* the user data (XML parser context) */
4227    int n_ctx;
4228    xmlChar * name; /* the root element name */
4229    int n_name;
4230    xmlChar * ExternalID; /* the external ID */
4231    int n_ExternalID;
4232    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4233    int n_SystemID;
4234
4235    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4236    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4237    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4238    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4239        mem_base = xmlMemBlocks();
4240        ctx = gen_void_ptr(n_ctx, 0);
4241        name = gen_const_xmlChar_ptr(n_name, 1);
4242        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4243        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4244
4245        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4246        call_tests++;
4247        des_void_ptr(n_ctx, ctx, 0);
4248        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4249        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4250        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4251        xmlResetLastError();
4252        if (mem_base != xmlMemBlocks()) {
4253            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4254	           xmlMemBlocks() - mem_base);
4255	    test_ret++;
4256            printf(" %d", n_ctx);
4257            printf(" %d", n_name);
4258            printf(" %d", n_ExternalID);
4259            printf(" %d", n_SystemID);
4260            printf("\n");
4261        }
4262    }
4263    }
4264    }
4265    }
4266    function_tests++;
4267
4268    return(test_ret);
4269}
4270
4271
4272static int
4273test_xmlSAX2GetColumnNumber(void) {
4274    int test_ret = 0;
4275
4276    int mem_base;
4277    int ret_val;
4278    void * ctx; /* the user data (XML parser context) */
4279    int n_ctx;
4280
4281    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4282        mem_base = xmlMemBlocks();
4283        ctx = gen_void_ptr(n_ctx, 0);
4284
4285        ret_val = xmlSAX2GetColumnNumber(ctx);
4286        desret_int(ret_val);
4287        call_tests++;
4288        des_void_ptr(n_ctx, ctx, 0);
4289        xmlResetLastError();
4290        if (mem_base != xmlMemBlocks()) {
4291            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4292	           xmlMemBlocks() - mem_base);
4293	    test_ret++;
4294            printf(" %d", n_ctx);
4295            printf("\n");
4296        }
4297    }
4298    function_tests++;
4299
4300    return(test_ret);
4301}
4302
4303
4304static int
4305test_xmlSAX2GetEntity(void) {
4306    int test_ret = 0;
4307
4308    int mem_base;
4309    xmlEntityPtr ret_val;
4310    void * ctx; /* the user data (XML parser context) */
4311    int n_ctx;
4312    xmlChar * name; /* The entity name */
4313    int n_name;
4314
4315    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4316    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4317        mem_base = xmlMemBlocks();
4318        ctx = gen_void_ptr(n_ctx, 0);
4319        name = gen_const_xmlChar_ptr(n_name, 1);
4320
4321        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4322        desret_xmlEntityPtr(ret_val);
4323        call_tests++;
4324        des_void_ptr(n_ctx, ctx, 0);
4325        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4326        xmlResetLastError();
4327        if (mem_base != xmlMemBlocks()) {
4328            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4329	           xmlMemBlocks() - mem_base);
4330	    test_ret++;
4331            printf(" %d", n_ctx);
4332            printf(" %d", n_name);
4333            printf("\n");
4334        }
4335    }
4336    }
4337    function_tests++;
4338
4339    return(test_ret);
4340}
4341
4342
4343static int
4344test_xmlSAX2GetLineNumber(void) {
4345    int test_ret = 0;
4346
4347    int mem_base;
4348    int ret_val;
4349    void * ctx; /* the user data (XML parser context) */
4350    int n_ctx;
4351
4352    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4353        mem_base = xmlMemBlocks();
4354        ctx = gen_void_ptr(n_ctx, 0);
4355
4356        ret_val = xmlSAX2GetLineNumber(ctx);
4357        desret_int(ret_val);
4358        call_tests++;
4359        des_void_ptr(n_ctx, ctx, 0);
4360        xmlResetLastError();
4361        if (mem_base != xmlMemBlocks()) {
4362            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4363	           xmlMemBlocks() - mem_base);
4364	    test_ret++;
4365            printf(" %d", n_ctx);
4366            printf("\n");
4367        }
4368    }
4369    function_tests++;
4370
4371    return(test_ret);
4372}
4373
4374
4375static int
4376test_xmlSAX2GetParameterEntity(void) {
4377    int test_ret = 0;
4378
4379    int mem_base;
4380    xmlEntityPtr ret_val;
4381    void * ctx; /* the user data (XML parser context) */
4382    int n_ctx;
4383    xmlChar * name; /* The entity name */
4384    int n_name;
4385
4386    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4387    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4388        mem_base = xmlMemBlocks();
4389        ctx = gen_void_ptr(n_ctx, 0);
4390        name = gen_const_xmlChar_ptr(n_name, 1);
4391
4392        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4393        desret_xmlEntityPtr(ret_val);
4394        call_tests++;
4395        des_void_ptr(n_ctx, ctx, 0);
4396        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4397        xmlResetLastError();
4398        if (mem_base != xmlMemBlocks()) {
4399            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4400	           xmlMemBlocks() - mem_base);
4401	    test_ret++;
4402            printf(" %d", n_ctx);
4403            printf(" %d", n_name);
4404            printf("\n");
4405        }
4406    }
4407    }
4408    function_tests++;
4409
4410    return(test_ret);
4411}
4412
4413
4414static int
4415test_xmlSAX2GetPublicId(void) {
4416    int test_ret = 0;
4417
4418    int mem_base;
4419    const xmlChar * ret_val;
4420    void * ctx; /* the user data (XML parser context) */
4421    int n_ctx;
4422
4423    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4424        mem_base = xmlMemBlocks();
4425        ctx = gen_void_ptr(n_ctx, 0);
4426
4427        ret_val = xmlSAX2GetPublicId(ctx);
4428        desret_const_xmlChar_ptr(ret_val);
4429        call_tests++;
4430        des_void_ptr(n_ctx, ctx, 0);
4431        xmlResetLastError();
4432        if (mem_base != xmlMemBlocks()) {
4433            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4434	           xmlMemBlocks() - mem_base);
4435	    test_ret++;
4436            printf(" %d", n_ctx);
4437            printf("\n");
4438        }
4439    }
4440    function_tests++;
4441
4442    return(test_ret);
4443}
4444
4445
4446static int
4447test_xmlSAX2GetSystemId(void) {
4448    int test_ret = 0;
4449
4450    int mem_base;
4451    const xmlChar * ret_val;
4452    void * ctx; /* the user data (XML parser context) */
4453    int n_ctx;
4454
4455    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4456        mem_base = xmlMemBlocks();
4457        ctx = gen_void_ptr(n_ctx, 0);
4458
4459        ret_val = xmlSAX2GetSystemId(ctx);
4460        desret_const_xmlChar_ptr(ret_val);
4461        call_tests++;
4462        des_void_ptr(n_ctx, ctx, 0);
4463        xmlResetLastError();
4464        if (mem_base != xmlMemBlocks()) {
4465            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4466	           xmlMemBlocks() - mem_base);
4467	    test_ret++;
4468            printf(" %d", n_ctx);
4469            printf("\n");
4470        }
4471    }
4472    function_tests++;
4473
4474    return(test_ret);
4475}
4476
4477
4478static int
4479test_xmlSAX2HasExternalSubset(void) {
4480    int test_ret = 0;
4481
4482    int mem_base;
4483    int ret_val;
4484    void * ctx; /* the user data (XML parser context) */
4485    int n_ctx;
4486
4487    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4488        mem_base = xmlMemBlocks();
4489        ctx = gen_void_ptr(n_ctx, 0);
4490
4491        ret_val = xmlSAX2HasExternalSubset(ctx);
4492        desret_int(ret_val);
4493        call_tests++;
4494        des_void_ptr(n_ctx, ctx, 0);
4495        xmlResetLastError();
4496        if (mem_base != xmlMemBlocks()) {
4497            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4498	           xmlMemBlocks() - mem_base);
4499	    test_ret++;
4500            printf(" %d", n_ctx);
4501            printf("\n");
4502        }
4503    }
4504    function_tests++;
4505
4506    return(test_ret);
4507}
4508
4509
4510static int
4511test_xmlSAX2HasInternalSubset(void) {
4512    int test_ret = 0;
4513
4514    int mem_base;
4515    int ret_val;
4516    void * ctx; /* the user data (XML parser context) */
4517    int n_ctx;
4518
4519    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4520        mem_base = xmlMemBlocks();
4521        ctx = gen_void_ptr(n_ctx, 0);
4522
4523        ret_val = xmlSAX2HasInternalSubset(ctx);
4524        desret_int(ret_val);
4525        call_tests++;
4526        des_void_ptr(n_ctx, ctx, 0);
4527        xmlResetLastError();
4528        if (mem_base != xmlMemBlocks()) {
4529            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4530	           xmlMemBlocks() - mem_base);
4531	    test_ret++;
4532            printf(" %d", n_ctx);
4533            printf("\n");
4534        }
4535    }
4536    function_tests++;
4537
4538    return(test_ret);
4539}
4540
4541
4542static int
4543test_xmlSAX2IgnorableWhitespace(void) {
4544    int test_ret = 0;
4545
4546    int mem_base;
4547    void * ctx; /* the user data (XML parser context) */
4548    int n_ctx;
4549    xmlChar * ch; /* a xmlChar string */
4550    int n_ch;
4551    int len; /* the number of xmlChar */
4552    int n_len;
4553
4554    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4555    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4556    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4557        mem_base = xmlMemBlocks();
4558        ctx = gen_void_ptr(n_ctx, 0);
4559        ch = gen_const_xmlChar_ptr(n_ch, 1);
4560        len = gen_int(n_len, 2);
4561
4562        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4563        call_tests++;
4564        des_void_ptr(n_ctx, ctx, 0);
4565        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4566        des_int(n_len, len, 2);
4567        xmlResetLastError();
4568        if (mem_base != xmlMemBlocks()) {
4569            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4570	           xmlMemBlocks() - mem_base);
4571	    test_ret++;
4572            printf(" %d", n_ctx);
4573            printf(" %d", n_ch);
4574            printf(" %d", n_len);
4575            printf("\n");
4576        }
4577    }
4578    }
4579    }
4580    function_tests++;
4581
4582    return(test_ret);
4583}
4584
4585
4586#define gen_nb_xmlSAXHandler_ptr 1
4587static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4588    return(NULL);
4589}
4590static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4591}
4592
4593static int
4594test_xmlSAX2InitDefaultSAXHandler(void) {
4595    int test_ret = 0;
4596
4597    int mem_base;
4598    xmlSAXHandler * hdlr; /* the SAX handler */
4599    int n_hdlr;
4600    int warning; /* flag if non-zero sets the handler warning procedure */
4601    int n_warning;
4602
4603    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4604    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4605        mem_base = xmlMemBlocks();
4606        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4607        warning = gen_int(n_warning, 1);
4608
4609        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4610        call_tests++;
4611        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4612        des_int(n_warning, warning, 1);
4613        xmlResetLastError();
4614        if (mem_base != xmlMemBlocks()) {
4615            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4616	           xmlMemBlocks() - mem_base);
4617	    test_ret++;
4618            printf(" %d", n_hdlr);
4619            printf(" %d", n_warning);
4620            printf("\n");
4621        }
4622    }
4623    }
4624    function_tests++;
4625
4626    return(test_ret);
4627}
4628
4629
4630static int
4631test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4632    int test_ret = 0;
4633
4634#if defined(LIBXML_DOCB_ENABLED)
4635    int mem_base;
4636    xmlSAXHandler * hdlr; /* the SAX handler */
4637    int n_hdlr;
4638
4639    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4640        mem_base = xmlMemBlocks();
4641        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4642
4643        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4644        call_tests++;
4645        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4646        xmlResetLastError();
4647        if (mem_base != xmlMemBlocks()) {
4648            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4649	           xmlMemBlocks() - mem_base);
4650	    test_ret++;
4651            printf(" %d", n_hdlr);
4652            printf("\n");
4653        }
4654    }
4655    function_tests++;
4656#endif
4657
4658    return(test_ret);
4659}
4660
4661
4662static int
4663test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4664    int test_ret = 0;
4665
4666#if defined(LIBXML_HTML_ENABLED)
4667    int mem_base;
4668    xmlSAXHandler * hdlr; /* the SAX handler */
4669    int n_hdlr;
4670
4671    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4672        mem_base = xmlMemBlocks();
4673        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4674
4675        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4676        call_tests++;
4677        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4678        xmlResetLastError();
4679        if (mem_base != xmlMemBlocks()) {
4680            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4681	           xmlMemBlocks() - mem_base);
4682	    test_ret++;
4683            printf(" %d", n_hdlr);
4684            printf("\n");
4685        }
4686    }
4687    function_tests++;
4688#endif
4689
4690    return(test_ret);
4691}
4692
4693
4694static int
4695test_xmlSAX2InternalSubset(void) {
4696    int test_ret = 0;
4697
4698    int mem_base;
4699    void * ctx; /* the user data (XML parser context) */
4700    int n_ctx;
4701    xmlChar * name; /* the root element name */
4702    int n_name;
4703    xmlChar * ExternalID; /* the external ID */
4704    int n_ExternalID;
4705    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4706    int n_SystemID;
4707
4708    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4709    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4710    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4711    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4712        mem_base = xmlMemBlocks();
4713        ctx = gen_void_ptr(n_ctx, 0);
4714        name = gen_const_xmlChar_ptr(n_name, 1);
4715        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4716        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4717
4718        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4719        call_tests++;
4720        des_void_ptr(n_ctx, ctx, 0);
4721        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4722        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4723        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4724        xmlResetLastError();
4725        if (mem_base != xmlMemBlocks()) {
4726            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4727	           xmlMemBlocks() - mem_base);
4728	    test_ret++;
4729            printf(" %d", n_ctx);
4730            printf(" %d", n_name);
4731            printf(" %d", n_ExternalID);
4732            printf(" %d", n_SystemID);
4733            printf("\n");
4734        }
4735    }
4736    }
4737    }
4738    }
4739    function_tests++;
4740
4741    return(test_ret);
4742}
4743
4744
4745static int
4746test_xmlSAX2IsStandalone(void) {
4747    int test_ret = 0;
4748
4749    int mem_base;
4750    int ret_val;
4751    void * ctx; /* the user data (XML parser context) */
4752    int n_ctx;
4753
4754    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4755        mem_base = xmlMemBlocks();
4756        ctx = gen_void_ptr(n_ctx, 0);
4757
4758        ret_val = xmlSAX2IsStandalone(ctx);
4759        desret_int(ret_val);
4760        call_tests++;
4761        des_void_ptr(n_ctx, ctx, 0);
4762        xmlResetLastError();
4763        if (mem_base != xmlMemBlocks()) {
4764            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4765	           xmlMemBlocks() - mem_base);
4766	    test_ret++;
4767            printf(" %d", n_ctx);
4768            printf("\n");
4769        }
4770    }
4771    function_tests++;
4772
4773    return(test_ret);
4774}
4775
4776
4777static int
4778test_xmlSAX2NotationDecl(void) {
4779    int test_ret = 0;
4780
4781    int mem_base;
4782    void * ctx; /* the user data (XML parser context) */
4783    int n_ctx;
4784    xmlChar * name; /* The name of the notation */
4785    int n_name;
4786    xmlChar * publicId; /* The public ID of the entity */
4787    int n_publicId;
4788    xmlChar * systemId; /* The system ID of the entity */
4789    int n_systemId;
4790
4791    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4792    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4793    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4794    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4795        mem_base = xmlMemBlocks();
4796        ctx = gen_void_ptr(n_ctx, 0);
4797        name = gen_const_xmlChar_ptr(n_name, 1);
4798        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4799        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4800
4801        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4802        call_tests++;
4803        des_void_ptr(n_ctx, ctx, 0);
4804        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4805        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4806        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4807        xmlResetLastError();
4808        if (mem_base != xmlMemBlocks()) {
4809            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4810	           xmlMemBlocks() - mem_base);
4811	    test_ret++;
4812            printf(" %d", n_ctx);
4813            printf(" %d", n_name);
4814            printf(" %d", n_publicId);
4815            printf(" %d", n_systemId);
4816            printf("\n");
4817        }
4818    }
4819    }
4820    }
4821    }
4822    function_tests++;
4823
4824    return(test_ret);
4825}
4826
4827
4828static int
4829test_xmlSAX2ProcessingInstruction(void) {
4830    int test_ret = 0;
4831
4832    int mem_base;
4833    void * ctx; /* the user data (XML parser context) */
4834    int n_ctx;
4835    xmlChar * target; /* the target name */
4836    int n_target;
4837    xmlChar * data; /* the PI data's */
4838    int n_data;
4839
4840    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4841    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4842    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4843        mem_base = xmlMemBlocks();
4844        ctx = gen_void_ptr(n_ctx, 0);
4845        target = gen_const_xmlChar_ptr(n_target, 1);
4846        data = gen_const_xmlChar_ptr(n_data, 2);
4847
4848        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4849        call_tests++;
4850        des_void_ptr(n_ctx, ctx, 0);
4851        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4852        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4853        xmlResetLastError();
4854        if (mem_base != xmlMemBlocks()) {
4855            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4856	           xmlMemBlocks() - mem_base);
4857	    test_ret++;
4858            printf(" %d", n_ctx);
4859            printf(" %d", n_target);
4860            printf(" %d", n_data);
4861            printf("\n");
4862        }
4863    }
4864    }
4865    }
4866    function_tests++;
4867
4868    return(test_ret);
4869}
4870
4871
4872static int
4873test_xmlSAX2Reference(void) {
4874    int test_ret = 0;
4875
4876    int mem_base;
4877    void * ctx; /* the user data (XML parser context) */
4878    int n_ctx;
4879    xmlChar * name; /* The entity name */
4880    int n_name;
4881
4882    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4883    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4884        mem_base = xmlMemBlocks();
4885        ctx = gen_void_ptr(n_ctx, 0);
4886        name = gen_const_xmlChar_ptr(n_name, 1);
4887
4888        xmlSAX2Reference(ctx, (const xmlChar *)name);
4889        call_tests++;
4890        des_void_ptr(n_ctx, ctx, 0);
4891        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4892        xmlResetLastError();
4893        if (mem_base != xmlMemBlocks()) {
4894            printf("Leak of %d blocks found in xmlSAX2Reference",
4895	           xmlMemBlocks() - mem_base);
4896	    test_ret++;
4897            printf(" %d", n_ctx);
4898            printf(" %d", n_name);
4899            printf("\n");
4900        }
4901    }
4902    }
4903    function_tests++;
4904
4905    return(test_ret);
4906}
4907
4908
4909static int
4910test_xmlSAX2ResolveEntity(void) {
4911    int test_ret = 0;
4912
4913    int mem_base;
4914    xmlParserInputPtr ret_val;
4915    void * ctx; /* the user data (XML parser context) */
4916    int n_ctx;
4917    xmlChar * publicId; /* The public ID of the entity */
4918    int n_publicId;
4919    xmlChar * systemId; /* The system ID of the entity */
4920    int n_systemId;
4921
4922    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4923    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4924    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4925        mem_base = xmlMemBlocks();
4926        ctx = gen_void_ptr(n_ctx, 0);
4927        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4928        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4929
4930        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4931        desret_xmlParserInputPtr(ret_val);
4932        call_tests++;
4933        des_void_ptr(n_ctx, ctx, 0);
4934        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4935        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4936        xmlResetLastError();
4937        if (mem_base != xmlMemBlocks()) {
4938            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4939	           xmlMemBlocks() - mem_base);
4940	    test_ret++;
4941            printf(" %d", n_ctx);
4942            printf(" %d", n_publicId);
4943            printf(" %d", n_systemId);
4944            printf("\n");
4945        }
4946    }
4947    }
4948    }
4949    function_tests++;
4950
4951    return(test_ret);
4952}
4953
4954
4955#define gen_nb_xmlSAXLocatorPtr 1
4956static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4957    return(NULL);
4958}
4959static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4960}
4961
4962static int
4963test_xmlSAX2SetDocumentLocator(void) {
4964    int test_ret = 0;
4965
4966    int mem_base;
4967    void * ctx; /* the user data (XML parser context) */
4968    int n_ctx;
4969    xmlSAXLocatorPtr loc; /* A SAX Locator */
4970    int n_loc;
4971
4972    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4973    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4974        mem_base = xmlMemBlocks();
4975        ctx = gen_void_ptr(n_ctx, 0);
4976        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4977
4978        xmlSAX2SetDocumentLocator(ctx, loc);
4979        call_tests++;
4980        des_void_ptr(n_ctx, ctx, 0);
4981        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4982        xmlResetLastError();
4983        if (mem_base != xmlMemBlocks()) {
4984            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4985	           xmlMemBlocks() - mem_base);
4986	    test_ret++;
4987            printf(" %d", n_ctx);
4988            printf(" %d", n_loc);
4989            printf("\n");
4990        }
4991    }
4992    }
4993    function_tests++;
4994
4995    return(test_ret);
4996}
4997
4998
4999static int
5000test_xmlSAX2StartDocument(void) {
5001    int test_ret = 0;
5002
5003    int mem_base;
5004    void * ctx; /* the user data (XML parser context) */
5005    int n_ctx;
5006
5007    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5008        mem_base = xmlMemBlocks();
5009        ctx = gen_void_ptr(n_ctx, 0);
5010
5011        xmlSAX2StartDocument(ctx);
5012        call_tests++;
5013        des_void_ptr(n_ctx, ctx, 0);
5014        xmlResetLastError();
5015        if (mem_base != xmlMemBlocks()) {
5016            printf("Leak of %d blocks found in xmlSAX2StartDocument",
5017	           xmlMemBlocks() - mem_base);
5018	    test_ret++;
5019            printf(" %d", n_ctx);
5020            printf("\n");
5021        }
5022    }
5023    function_tests++;
5024
5025    return(test_ret);
5026}
5027
5028
5029static int
5030test_xmlSAX2StartElement(void) {
5031    int test_ret = 0;
5032
5033#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
5034#ifdef LIBXML_SAX1_ENABLED
5035    int mem_base;
5036    void * ctx; /* the user data (XML parser context) */
5037    int n_ctx;
5038    xmlChar * fullname; /* The element name, including namespace prefix */
5039    int n_fullname;
5040    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5041    int n_atts;
5042
5043    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5044    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5045    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5046        mem_base = xmlMemBlocks();
5047        ctx = gen_void_ptr(n_ctx, 0);
5048        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5049        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5050
5051        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5052        call_tests++;
5053        des_void_ptr(n_ctx, ctx, 0);
5054        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5055        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5056        xmlResetLastError();
5057        if (mem_base != xmlMemBlocks()) {
5058            printf("Leak of %d blocks found in xmlSAX2StartElement",
5059	           xmlMemBlocks() - mem_base);
5060	    test_ret++;
5061            printf(" %d", n_ctx);
5062            printf(" %d", n_fullname);
5063            printf(" %d", n_atts);
5064            printf("\n");
5065        }
5066    }
5067    }
5068    }
5069    function_tests++;
5070#endif
5071#endif
5072
5073    return(test_ret);
5074}
5075
5076
5077static int
5078test_xmlSAX2StartElementNs(void) {
5079    int test_ret = 0;
5080
5081    int mem_base;
5082    void * ctx; /* the user data (XML parser context) */
5083    int n_ctx;
5084    xmlChar * localname; /* the local name of the element */
5085    int n_localname;
5086    xmlChar * prefix; /* the element namespace prefix if available */
5087    int n_prefix;
5088    xmlChar * URI; /* the element namespace name if available */
5089    int n_URI;
5090    int nb_namespaces; /* number of namespace definitions on that node */
5091    int n_nb_namespaces;
5092    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5093    int n_namespaces;
5094    int nb_attributes; /* the number of attributes on that node */
5095    int n_nb_attributes;
5096    int nb_defaulted; /* the number of defaulted attributes. */
5097    int n_nb_defaulted;
5098    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5099    int n_attributes;
5100
5101    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5102    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5103    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5104    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5105    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5106    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5107    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5108    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5109    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5110        mem_base = xmlMemBlocks();
5111        ctx = gen_void_ptr(n_ctx, 0);
5112        localname = gen_const_xmlChar_ptr(n_localname, 1);
5113        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5114        URI = gen_const_xmlChar_ptr(n_URI, 3);
5115        nb_namespaces = gen_int(n_nb_namespaces, 4);
5116        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5117        nb_attributes = gen_int(n_nb_attributes, 6);
5118        nb_defaulted = gen_int(n_nb_defaulted, 7);
5119        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5120
5121        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5122        call_tests++;
5123        des_void_ptr(n_ctx, ctx, 0);
5124        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5125        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5126        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5127        des_int(n_nb_namespaces, nb_namespaces, 4);
5128        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5129        des_int(n_nb_attributes, nb_attributes, 6);
5130        des_int(n_nb_defaulted, nb_defaulted, 7);
5131        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5132        xmlResetLastError();
5133        if (mem_base != xmlMemBlocks()) {
5134            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5135	           xmlMemBlocks() - mem_base);
5136	    test_ret++;
5137            printf(" %d", n_ctx);
5138            printf(" %d", n_localname);
5139            printf(" %d", n_prefix);
5140            printf(" %d", n_URI);
5141            printf(" %d", n_nb_namespaces);
5142            printf(" %d", n_namespaces);
5143            printf(" %d", n_nb_attributes);
5144            printf(" %d", n_nb_defaulted);
5145            printf(" %d", n_attributes);
5146            printf("\n");
5147        }
5148    }
5149    }
5150    }
5151    }
5152    }
5153    }
5154    }
5155    }
5156    }
5157    function_tests++;
5158
5159    return(test_ret);
5160}
5161
5162
5163static int
5164test_xmlSAX2UnparsedEntityDecl(void) {
5165    int test_ret = 0;
5166
5167    int mem_base;
5168    void * ctx; /* the user data (XML parser context) */
5169    int n_ctx;
5170    xmlChar * name; /* The name of the entity */
5171    int n_name;
5172    xmlChar * publicId; /* The public ID of the entity */
5173    int n_publicId;
5174    xmlChar * systemId; /* The system ID of the entity */
5175    int n_systemId;
5176    xmlChar * notationName; /* the name of the notation */
5177    int n_notationName;
5178
5179    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5180    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5181    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5182    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5183    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5184        mem_base = xmlMemBlocks();
5185        ctx = gen_void_ptr(n_ctx, 0);
5186        name = gen_const_xmlChar_ptr(n_name, 1);
5187        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5188        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5189        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5190
5191        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5192        call_tests++;
5193        des_void_ptr(n_ctx, ctx, 0);
5194        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5195        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5196        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5197        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5198        xmlResetLastError();
5199        if (mem_base != xmlMemBlocks()) {
5200            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5201	           xmlMemBlocks() - mem_base);
5202	    test_ret++;
5203            printf(" %d", n_ctx);
5204            printf(" %d", n_name);
5205            printf(" %d", n_publicId);
5206            printf(" %d", n_systemId);
5207            printf(" %d", n_notationName);
5208            printf("\n");
5209        }
5210    }
5211    }
5212    }
5213    }
5214    }
5215    function_tests++;
5216
5217    return(test_ret);
5218}
5219
5220
5221static int
5222test_xmlSAXDefaultVersion(void) {
5223    int test_ret = 0;
5224
5225#if defined(LIBXML_SAX1_ENABLED)
5226#ifdef LIBXML_SAX1_ENABLED
5227    int mem_base;
5228    int ret_val;
5229    int version; /* the version, 1 or 2 */
5230    int n_version;
5231
5232    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5233        mem_base = xmlMemBlocks();
5234        version = gen_int(n_version, 0);
5235
5236        ret_val = xmlSAXDefaultVersion(version);
5237        desret_int(ret_val);
5238        call_tests++;
5239        des_int(n_version, version, 0);
5240        xmlResetLastError();
5241        if (mem_base != xmlMemBlocks()) {
5242            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5243	           xmlMemBlocks() - mem_base);
5244	    test_ret++;
5245            printf(" %d", n_version);
5246            printf("\n");
5247        }
5248    }
5249    function_tests++;
5250#endif
5251#endif
5252
5253    return(test_ret);
5254}
5255
5256
5257static int
5258test_xmlSAXVersion(void) {
5259    int test_ret = 0;
5260
5261    int mem_base;
5262    int ret_val;
5263    xmlSAXHandler * hdlr; /* the SAX handler */
5264    int n_hdlr;
5265    int version; /* the version, 1 or 2 */
5266    int n_version;
5267
5268    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5269    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5270        mem_base = xmlMemBlocks();
5271        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5272        version = gen_int(n_version, 1);
5273
5274        ret_val = xmlSAXVersion(hdlr, version);
5275        desret_int(ret_val);
5276        call_tests++;
5277        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5278        des_int(n_version, version, 1);
5279        xmlResetLastError();
5280        if (mem_base != xmlMemBlocks()) {
5281            printf("Leak of %d blocks found in xmlSAXVersion",
5282	           xmlMemBlocks() - mem_base);
5283	    test_ret++;
5284            printf(" %d", n_hdlr);
5285            printf(" %d", n_version);
5286            printf("\n");
5287        }
5288    }
5289    }
5290    function_tests++;
5291
5292    return(test_ret);
5293}
5294
5295static int
5296test_SAX2(void) {
5297    int test_ret = 0;
5298
5299    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5300    test_ret += test_docbDefaultSAXHandlerInit();
5301    test_ret += test_htmlDefaultSAXHandlerInit();
5302    test_ret += test_xmlDefaultSAXHandlerInit();
5303    test_ret += test_xmlSAX2AttributeDecl();
5304    test_ret += test_xmlSAX2CDataBlock();
5305    test_ret += test_xmlSAX2Characters();
5306    test_ret += test_xmlSAX2Comment();
5307    test_ret += test_xmlSAX2ElementDecl();
5308    test_ret += test_xmlSAX2EndDocument();
5309    test_ret += test_xmlSAX2EndElement();
5310    test_ret += test_xmlSAX2EndElementNs();
5311    test_ret += test_xmlSAX2EntityDecl();
5312    test_ret += test_xmlSAX2ExternalSubset();
5313    test_ret += test_xmlSAX2GetColumnNumber();
5314    test_ret += test_xmlSAX2GetEntity();
5315    test_ret += test_xmlSAX2GetLineNumber();
5316    test_ret += test_xmlSAX2GetParameterEntity();
5317    test_ret += test_xmlSAX2GetPublicId();
5318    test_ret += test_xmlSAX2GetSystemId();
5319    test_ret += test_xmlSAX2HasExternalSubset();
5320    test_ret += test_xmlSAX2HasInternalSubset();
5321    test_ret += test_xmlSAX2IgnorableWhitespace();
5322    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5323    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5324    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5325    test_ret += test_xmlSAX2InternalSubset();
5326    test_ret += test_xmlSAX2IsStandalone();
5327    test_ret += test_xmlSAX2NotationDecl();
5328    test_ret += test_xmlSAX2ProcessingInstruction();
5329    test_ret += test_xmlSAX2Reference();
5330    test_ret += test_xmlSAX2ResolveEntity();
5331    test_ret += test_xmlSAX2SetDocumentLocator();
5332    test_ret += test_xmlSAX2StartDocument();
5333    test_ret += test_xmlSAX2StartElement();
5334    test_ret += test_xmlSAX2StartElementNs();
5335    test_ret += test_xmlSAX2UnparsedEntityDecl();
5336    test_ret += test_xmlSAXDefaultVersion();
5337    test_ret += test_xmlSAXVersion();
5338
5339    if (test_ret != 0)
5340	printf("Module SAX2: %d errors\n", test_ret);
5341    return(test_ret);
5342}
5343
5344static int
5345test_xmlC14NDocDumpMemory(void) {
5346    int test_ret = 0;
5347
5348#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5349    int mem_base;
5350    int ret_val;
5351    xmlDocPtr doc; /* the XML document for canonization */
5352    int n_doc;
5353    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5354    int n_nodes;
5355    int mode; /* the c14n mode (see @xmlC14NMode) */
5356    int n_mode;
5357    xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5358    int n_inclusive_ns_prefixes;
5359    int with_comments; /* include comments in the result (!=0) or not (==0) */
5360    int n_with_comments;
5361    xmlChar ** doc_txt_ptr; /* the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory */
5362    int n_doc_txt_ptr;
5363
5364    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5365    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5366    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5367    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5368    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5369    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5370        mem_base = xmlMemBlocks();
5371        doc = gen_xmlDocPtr(n_doc, 0);
5372        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5373        mode = gen_int(n_mode, 2);
5374        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5375        with_comments = gen_int(n_with_comments, 4);
5376        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5377
5378        ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5379        desret_int(ret_val);
5380        call_tests++;
5381        des_xmlDocPtr(n_doc, doc, 0);
5382        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5383        des_int(n_mode, mode, 2);
5384        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5385        des_int(n_with_comments, with_comments, 4);
5386        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5387        xmlResetLastError();
5388        if (mem_base != xmlMemBlocks()) {
5389            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5390	           xmlMemBlocks() - mem_base);
5391	    test_ret++;
5392            printf(" %d", n_doc);
5393            printf(" %d", n_nodes);
5394            printf(" %d", n_mode);
5395            printf(" %d", n_inclusive_ns_prefixes);
5396            printf(" %d", n_with_comments);
5397            printf(" %d", n_doc_txt_ptr);
5398            printf("\n");
5399        }
5400    }
5401    }
5402    }
5403    }
5404    }
5405    }
5406    function_tests++;
5407#endif
5408
5409    return(test_ret);
5410}
5411
5412
5413static int
5414test_xmlC14NDocSave(void) {
5415    int test_ret = 0;
5416
5417#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5418    int mem_base;
5419    int ret_val;
5420    xmlDocPtr doc; /* the XML document for canonization */
5421    int n_doc;
5422    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5423    int n_nodes;
5424    int mode; /* the c14n mode (see @xmlC14NMode) */
5425    int n_mode;
5426    xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5427    int n_inclusive_ns_prefixes;
5428    int with_comments; /* include comments in the result (!=0) or not (==0) */
5429    int n_with_comments;
5430    const char * filename; /* the filename to store canonical XML image */
5431    int n_filename;
5432    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5433    int n_compression;
5434
5435    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5436    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5437    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5438    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5439    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5440    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5441    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5442        mem_base = xmlMemBlocks();
5443        doc = gen_xmlDocPtr(n_doc, 0);
5444        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5445        mode = gen_int(n_mode, 2);
5446        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5447        with_comments = gen_int(n_with_comments, 4);
5448        filename = gen_fileoutput(n_filename, 5);
5449        compression = gen_int(n_compression, 6);
5450
5451        ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression);
5452        desret_int(ret_val);
5453        call_tests++;
5454        des_xmlDocPtr(n_doc, doc, 0);
5455        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5456        des_int(n_mode, mode, 2);
5457        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5458        des_int(n_with_comments, with_comments, 4);
5459        des_fileoutput(n_filename, filename, 5);
5460        des_int(n_compression, compression, 6);
5461        xmlResetLastError();
5462        if (mem_base != xmlMemBlocks()) {
5463            printf("Leak of %d blocks found in xmlC14NDocSave",
5464	           xmlMemBlocks() - mem_base);
5465	    test_ret++;
5466            printf(" %d", n_doc);
5467            printf(" %d", n_nodes);
5468            printf(" %d", n_mode);
5469            printf(" %d", n_inclusive_ns_prefixes);
5470            printf(" %d", n_with_comments);
5471            printf(" %d", n_filename);
5472            printf(" %d", n_compression);
5473            printf("\n");
5474        }
5475    }
5476    }
5477    }
5478    }
5479    }
5480    }
5481    }
5482    function_tests++;
5483#endif
5484
5485    return(test_ret);
5486}
5487
5488
5489static int
5490test_xmlC14NDocSaveTo(void) {
5491    int test_ret = 0;
5492
5493#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5494    int mem_base;
5495    int ret_val;
5496    xmlDocPtr doc; /* the XML document for canonization */
5497    int n_doc;
5498    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5499    int n_nodes;
5500    int mode; /* the c14n mode (see @xmlC14NMode) */
5501    int n_mode;
5502    xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */
5503    int n_inclusive_ns_prefixes;
5504    int with_comments; /* include comments in the result (!=0) or not (==0) */
5505    int n_with_comments;
5506    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5507    int n_buf;
5508
5509    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5510    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5511    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
5512    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5513    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5514    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5515        mem_base = xmlMemBlocks();
5516        doc = gen_xmlDocPtr(n_doc, 0);
5517        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5518        mode = gen_int(n_mode, 2);
5519        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5520        with_comments = gen_int(n_with_comments, 4);
5521        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5522
5523        ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf);
5524        desret_int(ret_val);
5525        call_tests++;
5526        des_xmlDocPtr(n_doc, doc, 0);
5527        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5528        des_int(n_mode, mode, 2);
5529        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5530        des_int(n_with_comments, with_comments, 4);
5531        des_xmlOutputBufferPtr(n_buf, buf, 5);
5532        xmlResetLastError();
5533        if (mem_base != xmlMemBlocks()) {
5534            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5535	           xmlMemBlocks() - mem_base);
5536	    test_ret++;
5537            printf(" %d", n_doc);
5538            printf(" %d", n_nodes);
5539            printf(" %d", n_mode);
5540            printf(" %d", n_inclusive_ns_prefixes);
5541            printf(" %d", n_with_comments);
5542            printf(" %d", n_buf);
5543            printf("\n");
5544        }
5545    }
5546    }
5547    }
5548    }
5549    }
5550    }
5551    function_tests++;
5552#endif
5553
5554    return(test_ret);
5555}
5556
5557
5558static int
5559test_xmlC14NExecute(void) {
5560    int test_ret = 0;
5561
5562
5563    /* missing type support */
5564    return(test_ret);
5565}
5566
5567static int
5568test_c14n(void) {
5569    int test_ret = 0;
5570
5571    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5572    test_ret += test_xmlC14NDocDumpMemory();
5573    test_ret += test_xmlC14NDocSave();
5574    test_ret += test_xmlC14NDocSaveTo();
5575    test_ret += test_xmlC14NExecute();
5576
5577    if (test_ret != 0)
5578	printf("Module c14n: %d errors\n", test_ret);
5579    return(test_ret);
5580}
5581#ifdef LIBXML_CATALOG_ENABLED
5582
5583#define gen_nb_xmlCatalogPtr 1
5584static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5585    return(NULL);
5586}
5587static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5588}
5589#endif
5590
5591
5592static int
5593test_xmlACatalogAdd(void) {
5594    int test_ret = 0;
5595
5596#if defined(LIBXML_CATALOG_ENABLED)
5597    int mem_base;
5598    int ret_val;
5599    xmlCatalogPtr catal; /* a Catalog */
5600    int n_catal;
5601    xmlChar * type; /* the type of record to add to the catalog */
5602    int n_type;
5603    xmlChar * orig; /* the system, public or prefix to match */
5604    int n_orig;
5605    xmlChar * replace; /* the replacement value for the match */
5606    int n_replace;
5607
5608    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5609    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5610    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5611    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5612        mem_base = xmlMemBlocks();
5613        catal = gen_xmlCatalogPtr(n_catal, 0);
5614        type = gen_const_xmlChar_ptr(n_type, 1);
5615        orig = gen_const_xmlChar_ptr(n_orig, 2);
5616        replace = gen_const_xmlChar_ptr(n_replace, 3);
5617
5618        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5619        desret_int(ret_val);
5620        call_tests++;
5621        des_xmlCatalogPtr(n_catal, catal, 0);
5622        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5623        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5624        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5625        xmlResetLastError();
5626        if (mem_base != xmlMemBlocks()) {
5627            printf("Leak of %d blocks found in xmlACatalogAdd",
5628	           xmlMemBlocks() - mem_base);
5629	    test_ret++;
5630            printf(" %d", n_catal);
5631            printf(" %d", n_type);
5632            printf(" %d", n_orig);
5633            printf(" %d", n_replace);
5634            printf("\n");
5635        }
5636    }
5637    }
5638    }
5639    }
5640    function_tests++;
5641#endif
5642
5643    return(test_ret);
5644}
5645
5646
5647static int
5648test_xmlACatalogDump(void) {
5649    int test_ret = 0;
5650
5651#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5652    int mem_base;
5653    xmlCatalogPtr catal; /* a Catalog */
5654    int n_catal;
5655    FILE * out; /* the file. */
5656    int n_out;
5657
5658    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5659    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5660        mem_base = xmlMemBlocks();
5661        catal = gen_xmlCatalogPtr(n_catal, 0);
5662        out = gen_FILE_ptr(n_out, 1);
5663
5664        xmlACatalogDump(catal, out);
5665        call_tests++;
5666        des_xmlCatalogPtr(n_catal, catal, 0);
5667        des_FILE_ptr(n_out, out, 1);
5668        xmlResetLastError();
5669        if (mem_base != xmlMemBlocks()) {
5670            printf("Leak of %d blocks found in xmlACatalogDump",
5671	           xmlMemBlocks() - mem_base);
5672	    test_ret++;
5673            printf(" %d", n_catal);
5674            printf(" %d", n_out);
5675            printf("\n");
5676        }
5677    }
5678    }
5679    function_tests++;
5680#endif
5681
5682    return(test_ret);
5683}
5684
5685
5686static int
5687test_xmlACatalogRemove(void) {
5688    int test_ret = 0;
5689
5690#if defined(LIBXML_CATALOG_ENABLED)
5691    int mem_base;
5692    int ret_val;
5693    xmlCatalogPtr catal; /* a Catalog */
5694    int n_catal;
5695    xmlChar * value; /* the value to remove */
5696    int n_value;
5697
5698    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5699    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5700        mem_base = xmlMemBlocks();
5701        catal = gen_xmlCatalogPtr(n_catal, 0);
5702        value = gen_const_xmlChar_ptr(n_value, 1);
5703
5704        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5705        desret_int(ret_val);
5706        call_tests++;
5707        des_xmlCatalogPtr(n_catal, catal, 0);
5708        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5709        xmlResetLastError();
5710        if (mem_base != xmlMemBlocks()) {
5711            printf("Leak of %d blocks found in xmlACatalogRemove",
5712	           xmlMemBlocks() - mem_base);
5713	    test_ret++;
5714            printf(" %d", n_catal);
5715            printf(" %d", n_value);
5716            printf("\n");
5717        }
5718    }
5719    }
5720    function_tests++;
5721#endif
5722
5723    return(test_ret);
5724}
5725
5726
5727static int
5728test_xmlACatalogResolve(void) {
5729    int test_ret = 0;
5730
5731#if defined(LIBXML_CATALOG_ENABLED)
5732    int mem_base;
5733    xmlChar * ret_val;
5734    xmlCatalogPtr catal; /* a Catalog */
5735    int n_catal;
5736    xmlChar * pubID; /* the public ID string */
5737    int n_pubID;
5738    xmlChar * sysID; /* the system ID string */
5739    int n_sysID;
5740
5741    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5742    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5743    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5744        mem_base = xmlMemBlocks();
5745        catal = gen_xmlCatalogPtr(n_catal, 0);
5746        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5747        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5748
5749        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5750        desret_xmlChar_ptr(ret_val);
5751        call_tests++;
5752        des_xmlCatalogPtr(n_catal, catal, 0);
5753        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5754        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5755        xmlResetLastError();
5756        if (mem_base != xmlMemBlocks()) {
5757            printf("Leak of %d blocks found in xmlACatalogResolve",
5758	           xmlMemBlocks() - mem_base);
5759	    test_ret++;
5760            printf(" %d", n_catal);
5761            printf(" %d", n_pubID);
5762            printf(" %d", n_sysID);
5763            printf("\n");
5764        }
5765    }
5766    }
5767    }
5768    function_tests++;
5769#endif
5770
5771    return(test_ret);
5772}
5773
5774
5775static int
5776test_xmlACatalogResolvePublic(void) {
5777    int test_ret = 0;
5778
5779#if defined(LIBXML_CATALOG_ENABLED)
5780    int mem_base;
5781    xmlChar * ret_val;
5782    xmlCatalogPtr catal; /* a Catalog */
5783    int n_catal;
5784    xmlChar * pubID; /* the public ID string */
5785    int n_pubID;
5786
5787    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5788    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5789        mem_base = xmlMemBlocks();
5790        catal = gen_xmlCatalogPtr(n_catal, 0);
5791        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5792
5793        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5794        desret_xmlChar_ptr(ret_val);
5795        call_tests++;
5796        des_xmlCatalogPtr(n_catal, catal, 0);
5797        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5798        xmlResetLastError();
5799        if (mem_base != xmlMemBlocks()) {
5800            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5801	           xmlMemBlocks() - mem_base);
5802	    test_ret++;
5803            printf(" %d", n_catal);
5804            printf(" %d", n_pubID);
5805            printf("\n");
5806        }
5807    }
5808    }
5809    function_tests++;
5810#endif
5811
5812    return(test_ret);
5813}
5814
5815
5816static int
5817test_xmlACatalogResolveSystem(void) {
5818    int test_ret = 0;
5819
5820#if defined(LIBXML_CATALOG_ENABLED)
5821    int mem_base;
5822    xmlChar * ret_val;
5823    xmlCatalogPtr catal; /* a Catalog */
5824    int n_catal;
5825    xmlChar * sysID; /* the system ID string */
5826    int n_sysID;
5827
5828    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5829    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5830        mem_base = xmlMemBlocks();
5831        catal = gen_xmlCatalogPtr(n_catal, 0);
5832        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5833
5834        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5835        desret_xmlChar_ptr(ret_val);
5836        call_tests++;
5837        des_xmlCatalogPtr(n_catal, catal, 0);
5838        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5839        xmlResetLastError();
5840        if (mem_base != xmlMemBlocks()) {
5841            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5842	           xmlMemBlocks() - mem_base);
5843	    test_ret++;
5844            printf(" %d", n_catal);
5845            printf(" %d", n_sysID);
5846            printf("\n");
5847        }
5848    }
5849    }
5850    function_tests++;
5851#endif
5852
5853    return(test_ret);
5854}
5855
5856
5857static int
5858test_xmlACatalogResolveURI(void) {
5859    int test_ret = 0;
5860
5861#if defined(LIBXML_CATALOG_ENABLED)
5862    int mem_base;
5863    xmlChar * ret_val;
5864    xmlCatalogPtr catal; /* a Catalog */
5865    int n_catal;
5866    xmlChar * URI; /* the URI */
5867    int n_URI;
5868
5869    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5870    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5871        mem_base = xmlMemBlocks();
5872        catal = gen_xmlCatalogPtr(n_catal, 0);
5873        URI = gen_const_xmlChar_ptr(n_URI, 1);
5874
5875        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5876        desret_xmlChar_ptr(ret_val);
5877        call_tests++;
5878        des_xmlCatalogPtr(n_catal, catal, 0);
5879        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5880        xmlResetLastError();
5881        if (mem_base != xmlMemBlocks()) {
5882            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5883	           xmlMemBlocks() - mem_base);
5884	    test_ret++;
5885            printf(" %d", n_catal);
5886            printf(" %d", n_URI);
5887            printf("\n");
5888        }
5889    }
5890    }
5891    function_tests++;
5892#endif
5893
5894    return(test_ret);
5895}
5896
5897
5898static int
5899test_xmlCatalogAdd(void) {
5900    int test_ret = 0;
5901
5902#if defined(LIBXML_CATALOG_ENABLED)
5903    int mem_base;
5904    int ret_val;
5905    xmlChar * type; /* the type of record to add to the catalog */
5906    int n_type;
5907    xmlChar * orig; /* the system, public or prefix to match */
5908    int n_orig;
5909    xmlChar * replace; /* the replacement value for the match */
5910    int n_replace;
5911
5912    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5913    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5914    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5915        mem_base = xmlMemBlocks();
5916        type = gen_const_xmlChar_ptr(n_type, 0);
5917        orig = gen_const_xmlChar_ptr(n_orig, 1);
5918        replace = gen_const_xmlChar_ptr(n_replace, 2);
5919
5920        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5921        desret_int(ret_val);
5922        call_tests++;
5923        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5924        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5925        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5926        xmlResetLastError();
5927        if (mem_base != xmlMemBlocks()) {
5928            printf("Leak of %d blocks found in xmlCatalogAdd",
5929	           xmlMemBlocks() - mem_base);
5930	    test_ret++;
5931            printf(" %d", n_type);
5932            printf(" %d", n_orig);
5933            printf(" %d", n_replace);
5934            printf("\n");
5935        }
5936    }
5937    }
5938    }
5939    function_tests++;
5940#endif
5941
5942    return(test_ret);
5943}
5944
5945
5946static int
5947test_xmlCatalogCleanup(void) {
5948    int test_ret = 0;
5949
5950#if defined(LIBXML_CATALOG_ENABLED)
5951
5952
5953        xmlCatalogCleanup();
5954        call_tests++;
5955        xmlResetLastError();
5956    function_tests++;
5957#endif
5958
5959    return(test_ret);
5960}
5961
5962
5963static int
5964test_xmlCatalogConvert(void) {
5965    int test_ret = 0;
5966
5967#if defined(LIBXML_CATALOG_ENABLED)
5968    int ret_val;
5969
5970
5971        ret_val = xmlCatalogConvert();
5972        desret_int(ret_val);
5973        call_tests++;
5974        xmlResetLastError();
5975    function_tests++;
5976#endif
5977
5978    return(test_ret);
5979}
5980
5981
5982static int
5983test_xmlCatalogDump(void) {
5984    int test_ret = 0;
5985
5986#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5987    int mem_base;
5988    FILE * out; /* the file. */
5989    int n_out;
5990
5991    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5992        mem_base = xmlMemBlocks();
5993        out = gen_FILE_ptr(n_out, 0);
5994
5995        xmlCatalogDump(out);
5996        call_tests++;
5997        des_FILE_ptr(n_out, out, 0);
5998        xmlResetLastError();
5999        if (mem_base != xmlMemBlocks()) {
6000            printf("Leak of %d blocks found in xmlCatalogDump",
6001	           xmlMemBlocks() - mem_base);
6002	    test_ret++;
6003            printf(" %d", n_out);
6004            printf("\n");
6005        }
6006    }
6007    function_tests++;
6008#endif
6009
6010    return(test_ret);
6011}
6012
6013
6014static int
6015test_xmlCatalogGetDefaults(void) {
6016    int test_ret = 0;
6017
6018#if defined(LIBXML_CATALOG_ENABLED)
6019    int mem_base;
6020    xmlCatalogAllow ret_val;
6021
6022        mem_base = xmlMemBlocks();
6023
6024        ret_val = xmlCatalogGetDefaults();
6025        desret_xmlCatalogAllow(ret_val);
6026        call_tests++;
6027        xmlResetLastError();
6028        if (mem_base != xmlMemBlocks()) {
6029            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6030	           xmlMemBlocks() - mem_base);
6031	    test_ret++;
6032            printf("\n");
6033        }
6034    function_tests++;
6035#endif
6036
6037    return(test_ret);
6038}
6039
6040
6041static int
6042test_xmlCatalogIsEmpty(void) {
6043    int test_ret = 0;
6044
6045#if defined(LIBXML_CATALOG_ENABLED)
6046    int mem_base;
6047    int ret_val;
6048    xmlCatalogPtr catal; /* should this create an SGML catalog */
6049    int n_catal;
6050
6051    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6052        mem_base = xmlMemBlocks();
6053        catal = gen_xmlCatalogPtr(n_catal, 0);
6054
6055        ret_val = xmlCatalogIsEmpty(catal);
6056        desret_int(ret_val);
6057        call_tests++;
6058        des_xmlCatalogPtr(n_catal, catal, 0);
6059        xmlResetLastError();
6060        if (mem_base != xmlMemBlocks()) {
6061            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6062	           xmlMemBlocks() - mem_base);
6063	    test_ret++;
6064            printf(" %d", n_catal);
6065            printf("\n");
6066        }
6067    }
6068    function_tests++;
6069#endif
6070
6071    return(test_ret);
6072}
6073
6074
6075static int
6076test_xmlCatalogLocalResolve(void) {
6077    int test_ret = 0;
6078
6079#if defined(LIBXML_CATALOG_ENABLED)
6080    int mem_base;
6081    xmlChar * ret_val;
6082    void * catalogs; /* a document's list of catalogs */
6083    int n_catalogs;
6084    xmlChar * pubID; /* the public ID string */
6085    int n_pubID;
6086    xmlChar * sysID; /* the system ID string */
6087    int n_sysID;
6088
6089    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6090    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6091    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6092        mem_base = xmlMemBlocks();
6093        catalogs = gen_void_ptr(n_catalogs, 0);
6094        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6095        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6096
6097        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6098        desret_xmlChar_ptr(ret_val);
6099        call_tests++;
6100        des_void_ptr(n_catalogs, catalogs, 0);
6101        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6102        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6103        xmlResetLastError();
6104        if (mem_base != xmlMemBlocks()) {
6105            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6106	           xmlMemBlocks() - mem_base);
6107	    test_ret++;
6108            printf(" %d", n_catalogs);
6109            printf(" %d", n_pubID);
6110            printf(" %d", n_sysID);
6111            printf("\n");
6112        }
6113    }
6114    }
6115    }
6116    function_tests++;
6117#endif
6118
6119    return(test_ret);
6120}
6121
6122
6123static int
6124test_xmlCatalogLocalResolveURI(void) {
6125    int test_ret = 0;
6126
6127#if defined(LIBXML_CATALOG_ENABLED)
6128    int mem_base;
6129    xmlChar * ret_val;
6130    void * catalogs; /* a document's list of catalogs */
6131    int n_catalogs;
6132    xmlChar * URI; /* the URI */
6133    int n_URI;
6134
6135    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6136    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6137        mem_base = xmlMemBlocks();
6138        catalogs = gen_void_ptr(n_catalogs, 0);
6139        URI = gen_const_xmlChar_ptr(n_URI, 1);
6140
6141        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6142        desret_xmlChar_ptr(ret_val);
6143        call_tests++;
6144        des_void_ptr(n_catalogs, catalogs, 0);
6145        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6146        xmlResetLastError();
6147        if (mem_base != xmlMemBlocks()) {
6148            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6149	           xmlMemBlocks() - mem_base);
6150	    test_ret++;
6151            printf(" %d", n_catalogs);
6152            printf(" %d", n_URI);
6153            printf("\n");
6154        }
6155    }
6156    }
6157    function_tests++;
6158#endif
6159
6160    return(test_ret);
6161}
6162
6163
6164static int
6165test_xmlCatalogRemove(void) {
6166    int test_ret = 0;
6167
6168#if defined(LIBXML_CATALOG_ENABLED)
6169    int ret_val;
6170    xmlChar * value; /* the value to remove */
6171    int n_value;
6172
6173    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6174        value = gen_const_xmlChar_ptr(n_value, 0);
6175
6176        ret_val = xmlCatalogRemove((const xmlChar *)value);
6177        desret_int(ret_val);
6178        call_tests++;
6179        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6180        xmlResetLastError();
6181    }
6182    function_tests++;
6183#endif
6184
6185    return(test_ret);
6186}
6187
6188
6189static int
6190test_xmlCatalogResolve(void) {
6191    int test_ret = 0;
6192
6193#if defined(LIBXML_CATALOG_ENABLED)
6194    xmlChar * ret_val;
6195    xmlChar * pubID; /* the public ID string */
6196    int n_pubID;
6197    xmlChar * sysID; /* the system ID string */
6198    int n_sysID;
6199
6200    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6201    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6202        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6203        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6204
6205        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6206        desret_xmlChar_ptr(ret_val);
6207        call_tests++;
6208        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6209        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6210        xmlResetLastError();
6211    }
6212    }
6213    function_tests++;
6214#endif
6215
6216    return(test_ret);
6217}
6218
6219
6220static int
6221test_xmlCatalogResolvePublic(void) {
6222    int test_ret = 0;
6223
6224#if defined(LIBXML_CATALOG_ENABLED)
6225    int mem_base;
6226    xmlChar * ret_val;
6227    xmlChar * pubID; /* the public ID string */
6228    int n_pubID;
6229
6230    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6231        mem_base = xmlMemBlocks();
6232        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6233
6234        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6235        desret_xmlChar_ptr(ret_val);
6236        call_tests++;
6237        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6238        xmlResetLastError();
6239        if (mem_base != xmlMemBlocks()) {
6240            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6241	           xmlMemBlocks() - mem_base);
6242	    test_ret++;
6243            printf(" %d", n_pubID);
6244            printf("\n");
6245        }
6246    }
6247    function_tests++;
6248#endif
6249
6250    return(test_ret);
6251}
6252
6253
6254static int
6255test_xmlCatalogResolveSystem(void) {
6256    int test_ret = 0;
6257
6258#if defined(LIBXML_CATALOG_ENABLED)
6259    int mem_base;
6260    xmlChar * ret_val;
6261    xmlChar * sysID; /* the system ID string */
6262    int n_sysID;
6263
6264    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6265        mem_base = xmlMemBlocks();
6266        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6267
6268        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6269        desret_xmlChar_ptr(ret_val);
6270        call_tests++;
6271        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6272        xmlResetLastError();
6273        if (mem_base != xmlMemBlocks()) {
6274            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6275	           xmlMemBlocks() - mem_base);
6276	    test_ret++;
6277            printf(" %d", n_sysID);
6278            printf("\n");
6279        }
6280    }
6281    function_tests++;
6282#endif
6283
6284    return(test_ret);
6285}
6286
6287
6288static int
6289test_xmlCatalogResolveURI(void) {
6290    int test_ret = 0;
6291
6292#if defined(LIBXML_CATALOG_ENABLED)
6293    int mem_base;
6294    xmlChar * ret_val;
6295    xmlChar * URI; /* the URI */
6296    int n_URI;
6297
6298    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6299        mem_base = xmlMemBlocks();
6300        URI = gen_const_xmlChar_ptr(n_URI, 0);
6301
6302        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6303        desret_xmlChar_ptr(ret_val);
6304        call_tests++;
6305        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6306        xmlResetLastError();
6307        if (mem_base != xmlMemBlocks()) {
6308            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6309	           xmlMemBlocks() - mem_base);
6310	    test_ret++;
6311            printf(" %d", n_URI);
6312            printf("\n");
6313        }
6314    }
6315    function_tests++;
6316#endif
6317
6318    return(test_ret);
6319}
6320
6321
6322static int
6323test_xmlCatalogSetDefaultPrefer(void) {
6324    int test_ret = 0;
6325
6326#if defined(LIBXML_CATALOG_ENABLED)
6327    int mem_base;
6328    xmlCatalogPrefer ret_val;
6329    xmlCatalogPrefer prefer; /* the default preference for delegation */
6330    int n_prefer;
6331
6332    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6333        mem_base = xmlMemBlocks();
6334        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6335
6336        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6337        desret_xmlCatalogPrefer(ret_val);
6338        call_tests++;
6339        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6340        xmlResetLastError();
6341        if (mem_base != xmlMemBlocks()) {
6342            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6343	           xmlMemBlocks() - mem_base);
6344	    test_ret++;
6345            printf(" %d", n_prefer);
6346            printf("\n");
6347        }
6348    }
6349    function_tests++;
6350#endif
6351
6352    return(test_ret);
6353}
6354
6355
6356static int
6357test_xmlCatalogSetDefaults(void) {
6358    int test_ret = 0;
6359
6360#if defined(LIBXML_CATALOG_ENABLED)
6361    int mem_base;
6362    xmlCatalogAllow allow; /* what catalogs should be accepted */
6363    int n_allow;
6364
6365    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6366        mem_base = xmlMemBlocks();
6367        allow = gen_xmlCatalogAllow(n_allow, 0);
6368
6369        xmlCatalogSetDefaults(allow);
6370        call_tests++;
6371        des_xmlCatalogAllow(n_allow, allow, 0);
6372        xmlResetLastError();
6373        if (mem_base != xmlMemBlocks()) {
6374            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6375	           xmlMemBlocks() - mem_base);
6376	    test_ret++;
6377            printf(" %d", n_allow);
6378            printf("\n");
6379        }
6380    }
6381    function_tests++;
6382#endif
6383
6384    return(test_ret);
6385}
6386
6387
6388static int
6389test_xmlConvertSGMLCatalog(void) {
6390    int test_ret = 0;
6391
6392#if defined(LIBXML_CATALOG_ENABLED)
6393    int mem_base;
6394    int ret_val;
6395    xmlCatalogPtr catal; /* the catalog */
6396    int n_catal;
6397
6398    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6399        mem_base = xmlMemBlocks();
6400        catal = gen_xmlCatalogPtr(n_catal, 0);
6401
6402        ret_val = xmlConvertSGMLCatalog(catal);
6403        desret_int(ret_val);
6404        call_tests++;
6405        des_xmlCatalogPtr(n_catal, catal, 0);
6406        xmlResetLastError();
6407        if (mem_base != xmlMemBlocks()) {
6408            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6409	           xmlMemBlocks() - mem_base);
6410	    test_ret++;
6411            printf(" %d", n_catal);
6412            printf("\n");
6413        }
6414    }
6415    function_tests++;
6416#endif
6417
6418    return(test_ret);
6419}
6420
6421
6422static int
6423test_xmlInitializeCatalog(void) {
6424    int test_ret = 0;
6425
6426#if defined(LIBXML_CATALOG_ENABLED)
6427    int mem_base;
6428
6429        mem_base = xmlMemBlocks();
6430
6431        xmlInitializeCatalog();
6432        call_tests++;
6433        xmlResetLastError();
6434        if (mem_base != xmlMemBlocks()) {
6435            printf("Leak of %d blocks found in xmlInitializeCatalog",
6436	           xmlMemBlocks() - mem_base);
6437	    test_ret++;
6438            printf("\n");
6439        }
6440    function_tests++;
6441#endif
6442
6443    return(test_ret);
6444}
6445
6446
6447static int
6448test_xmlLoadACatalog(void) {
6449    int test_ret = 0;
6450
6451
6452    /* missing type support */
6453    return(test_ret);
6454}
6455
6456
6457static int
6458test_xmlLoadCatalog(void) {
6459    int test_ret = 0;
6460
6461#if defined(LIBXML_CATALOG_ENABLED)
6462    int ret_val;
6463    const char * filename; /* a file path */
6464    int n_filename;
6465
6466    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6467        filename = gen_filepath(n_filename, 0);
6468
6469        ret_val = xmlLoadCatalog(filename);
6470        desret_int(ret_val);
6471        call_tests++;
6472        des_filepath(n_filename, filename, 0);
6473        xmlResetLastError();
6474    }
6475    function_tests++;
6476#endif
6477
6478    return(test_ret);
6479}
6480
6481
6482static int
6483test_xmlLoadCatalogs(void) {
6484    int test_ret = 0;
6485
6486#if defined(LIBXML_CATALOG_ENABLED)
6487    char * pathss; /* a list of directories separated by a colon or a space. */
6488    int n_pathss;
6489
6490    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6491        pathss = gen_const_char_ptr(n_pathss, 0);
6492
6493        xmlLoadCatalogs((const char *)pathss);
6494        call_tests++;
6495        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6496        xmlResetLastError();
6497    }
6498    function_tests++;
6499#endif
6500
6501    return(test_ret);
6502}
6503
6504
6505static int
6506test_xmlLoadSGMLSuperCatalog(void) {
6507    int test_ret = 0;
6508
6509
6510    /* missing type support */
6511    return(test_ret);
6512}
6513
6514
6515static int
6516test_xmlNewCatalog(void) {
6517    int test_ret = 0;
6518
6519
6520    /* missing type support */
6521    return(test_ret);
6522}
6523
6524
6525static int
6526test_xmlParseCatalogFile(void) {
6527    int test_ret = 0;
6528
6529#if defined(LIBXML_CATALOG_ENABLED)
6530    int mem_base;
6531    xmlDocPtr ret_val;
6532    const char * filename; /* the filename */
6533    int n_filename;
6534
6535    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6536        mem_base = xmlMemBlocks();
6537        filename = gen_filepath(n_filename, 0);
6538
6539        ret_val = xmlParseCatalogFile(filename);
6540        desret_xmlDocPtr(ret_val);
6541        call_tests++;
6542        des_filepath(n_filename, filename, 0);
6543        xmlResetLastError();
6544        if (mem_base != xmlMemBlocks()) {
6545            printf("Leak of %d blocks found in xmlParseCatalogFile",
6546	           xmlMemBlocks() - mem_base);
6547	    test_ret++;
6548            printf(" %d", n_filename);
6549            printf("\n");
6550        }
6551    }
6552    function_tests++;
6553#endif
6554
6555    return(test_ret);
6556}
6557
6558static int
6559test_catalog(void) {
6560    int test_ret = 0;
6561
6562    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6563    test_ret += test_xmlACatalogAdd();
6564    test_ret += test_xmlACatalogDump();
6565    test_ret += test_xmlACatalogRemove();
6566    test_ret += test_xmlACatalogResolve();
6567    test_ret += test_xmlACatalogResolvePublic();
6568    test_ret += test_xmlACatalogResolveSystem();
6569    test_ret += test_xmlACatalogResolveURI();
6570    test_ret += test_xmlCatalogAdd();
6571    test_ret += test_xmlCatalogCleanup();
6572    test_ret += test_xmlCatalogConvert();
6573    test_ret += test_xmlCatalogDump();
6574    test_ret += test_xmlCatalogGetDefaults();
6575    test_ret += test_xmlCatalogIsEmpty();
6576    test_ret += test_xmlCatalogLocalResolve();
6577    test_ret += test_xmlCatalogLocalResolveURI();
6578    test_ret += test_xmlCatalogRemove();
6579    test_ret += test_xmlCatalogResolve();
6580    test_ret += test_xmlCatalogResolvePublic();
6581    test_ret += test_xmlCatalogResolveSystem();
6582    test_ret += test_xmlCatalogResolveURI();
6583    test_ret += test_xmlCatalogSetDefaultPrefer();
6584    test_ret += test_xmlCatalogSetDefaults();
6585    test_ret += test_xmlConvertSGMLCatalog();
6586    test_ret += test_xmlInitializeCatalog();
6587    test_ret += test_xmlLoadACatalog();
6588    test_ret += test_xmlLoadCatalog();
6589    test_ret += test_xmlLoadCatalogs();
6590    test_ret += test_xmlLoadSGMLSuperCatalog();
6591    test_ret += test_xmlNewCatalog();
6592    test_ret += test_xmlParseCatalogFile();
6593
6594    if (test_ret != 0)
6595	printf("Module catalog: %d errors\n", test_ret);
6596    return(test_ret);
6597}
6598
6599#define gen_nb_const_xmlChRangeGroup_ptr 1
6600static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6601    return(NULL);
6602}
6603static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6604}
6605
6606static int
6607test_xmlCharInRange(void) {
6608    int test_ret = 0;
6609
6610    int mem_base;
6611    int ret_val;
6612    unsigned int val; /* character to be validated */
6613    int n_val;
6614    xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6615    int n_rptr;
6616
6617    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6618    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6619        mem_base = xmlMemBlocks();
6620        val = gen_unsigned_int(n_val, 0);
6621        rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6622
6623        ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6624        desret_int(ret_val);
6625        call_tests++;
6626        des_unsigned_int(n_val, val, 0);
6627        des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6628        xmlResetLastError();
6629        if (mem_base != xmlMemBlocks()) {
6630            printf("Leak of %d blocks found in xmlCharInRange",
6631	           xmlMemBlocks() - mem_base);
6632	    test_ret++;
6633            printf(" %d", n_val);
6634            printf(" %d", n_rptr);
6635            printf("\n");
6636        }
6637    }
6638    }
6639    function_tests++;
6640
6641    return(test_ret);
6642}
6643
6644
6645static int
6646test_xmlIsBaseChar(void) {
6647    int test_ret = 0;
6648
6649    int mem_base;
6650    int ret_val;
6651    unsigned int ch; /* character to validate */
6652    int n_ch;
6653
6654    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6655        mem_base = xmlMemBlocks();
6656        ch = gen_unsigned_int(n_ch, 0);
6657
6658        ret_val = xmlIsBaseChar(ch);
6659        desret_int(ret_val);
6660        call_tests++;
6661        des_unsigned_int(n_ch, ch, 0);
6662        xmlResetLastError();
6663        if (mem_base != xmlMemBlocks()) {
6664            printf("Leak of %d blocks found in xmlIsBaseChar",
6665	           xmlMemBlocks() - mem_base);
6666	    test_ret++;
6667            printf(" %d", n_ch);
6668            printf("\n");
6669        }
6670    }
6671    function_tests++;
6672
6673    return(test_ret);
6674}
6675
6676
6677static int
6678test_xmlIsBlank(void) {
6679    int test_ret = 0;
6680
6681    int mem_base;
6682    int ret_val;
6683    unsigned int ch; /* character to validate */
6684    int n_ch;
6685
6686    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6687        mem_base = xmlMemBlocks();
6688        ch = gen_unsigned_int(n_ch, 0);
6689
6690        ret_val = xmlIsBlank(ch);
6691        desret_int(ret_val);
6692        call_tests++;
6693        des_unsigned_int(n_ch, ch, 0);
6694        xmlResetLastError();
6695        if (mem_base != xmlMemBlocks()) {
6696            printf("Leak of %d blocks found in xmlIsBlank",
6697	           xmlMemBlocks() - mem_base);
6698	    test_ret++;
6699            printf(" %d", n_ch);
6700            printf("\n");
6701        }
6702    }
6703    function_tests++;
6704
6705    return(test_ret);
6706}
6707
6708
6709static int
6710test_xmlIsChar(void) {
6711    int test_ret = 0;
6712
6713    int mem_base;
6714    int ret_val;
6715    unsigned int ch; /* character to validate */
6716    int n_ch;
6717
6718    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6719        mem_base = xmlMemBlocks();
6720        ch = gen_unsigned_int(n_ch, 0);
6721
6722        ret_val = xmlIsChar(ch);
6723        desret_int(ret_val);
6724        call_tests++;
6725        des_unsigned_int(n_ch, ch, 0);
6726        xmlResetLastError();
6727        if (mem_base != xmlMemBlocks()) {
6728            printf("Leak of %d blocks found in xmlIsChar",
6729	           xmlMemBlocks() - mem_base);
6730	    test_ret++;
6731            printf(" %d", n_ch);
6732            printf("\n");
6733        }
6734    }
6735    function_tests++;
6736
6737    return(test_ret);
6738}
6739
6740
6741static int
6742test_xmlIsCombining(void) {
6743    int test_ret = 0;
6744
6745    int mem_base;
6746    int ret_val;
6747    unsigned int ch; /* character to validate */
6748    int n_ch;
6749
6750    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6751        mem_base = xmlMemBlocks();
6752        ch = gen_unsigned_int(n_ch, 0);
6753
6754        ret_val = xmlIsCombining(ch);
6755        desret_int(ret_val);
6756        call_tests++;
6757        des_unsigned_int(n_ch, ch, 0);
6758        xmlResetLastError();
6759        if (mem_base != xmlMemBlocks()) {
6760            printf("Leak of %d blocks found in xmlIsCombining",
6761	           xmlMemBlocks() - mem_base);
6762	    test_ret++;
6763            printf(" %d", n_ch);
6764            printf("\n");
6765        }
6766    }
6767    function_tests++;
6768
6769    return(test_ret);
6770}
6771
6772
6773static int
6774test_xmlIsDigit(void) {
6775    int test_ret = 0;
6776
6777    int mem_base;
6778    int ret_val;
6779    unsigned int ch; /* character to validate */
6780    int n_ch;
6781
6782    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6783        mem_base = xmlMemBlocks();
6784        ch = gen_unsigned_int(n_ch, 0);
6785
6786        ret_val = xmlIsDigit(ch);
6787        desret_int(ret_val);
6788        call_tests++;
6789        des_unsigned_int(n_ch, ch, 0);
6790        xmlResetLastError();
6791        if (mem_base != xmlMemBlocks()) {
6792            printf("Leak of %d blocks found in xmlIsDigit",
6793	           xmlMemBlocks() - mem_base);
6794	    test_ret++;
6795            printf(" %d", n_ch);
6796            printf("\n");
6797        }
6798    }
6799    function_tests++;
6800
6801    return(test_ret);
6802}
6803
6804
6805static int
6806test_xmlIsExtender(void) {
6807    int test_ret = 0;
6808
6809    int mem_base;
6810    int ret_val;
6811    unsigned int ch; /* character to validate */
6812    int n_ch;
6813
6814    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6815        mem_base = xmlMemBlocks();
6816        ch = gen_unsigned_int(n_ch, 0);
6817
6818        ret_val = xmlIsExtender(ch);
6819        desret_int(ret_val);
6820        call_tests++;
6821        des_unsigned_int(n_ch, ch, 0);
6822        xmlResetLastError();
6823        if (mem_base != xmlMemBlocks()) {
6824            printf("Leak of %d blocks found in xmlIsExtender",
6825	           xmlMemBlocks() - mem_base);
6826	    test_ret++;
6827            printf(" %d", n_ch);
6828            printf("\n");
6829        }
6830    }
6831    function_tests++;
6832
6833    return(test_ret);
6834}
6835
6836
6837static int
6838test_xmlIsIdeographic(void) {
6839    int test_ret = 0;
6840
6841    int mem_base;
6842    int ret_val;
6843    unsigned int ch; /* character to validate */
6844    int n_ch;
6845
6846    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6847        mem_base = xmlMemBlocks();
6848        ch = gen_unsigned_int(n_ch, 0);
6849
6850        ret_val = xmlIsIdeographic(ch);
6851        desret_int(ret_val);
6852        call_tests++;
6853        des_unsigned_int(n_ch, ch, 0);
6854        xmlResetLastError();
6855        if (mem_base != xmlMemBlocks()) {
6856            printf("Leak of %d blocks found in xmlIsIdeographic",
6857	           xmlMemBlocks() - mem_base);
6858	    test_ret++;
6859            printf(" %d", n_ch);
6860            printf("\n");
6861        }
6862    }
6863    function_tests++;
6864
6865    return(test_ret);
6866}
6867
6868
6869static int
6870test_xmlIsPubidChar(void) {
6871    int test_ret = 0;
6872
6873    int mem_base;
6874    int ret_val;
6875    unsigned int ch; /* character to validate */
6876    int n_ch;
6877
6878    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6879        mem_base = xmlMemBlocks();
6880        ch = gen_unsigned_int(n_ch, 0);
6881
6882        ret_val = xmlIsPubidChar(ch);
6883        desret_int(ret_val);
6884        call_tests++;
6885        des_unsigned_int(n_ch, ch, 0);
6886        xmlResetLastError();
6887        if (mem_base != xmlMemBlocks()) {
6888            printf("Leak of %d blocks found in xmlIsPubidChar",
6889	           xmlMemBlocks() - mem_base);
6890	    test_ret++;
6891            printf(" %d", n_ch);
6892            printf("\n");
6893        }
6894    }
6895    function_tests++;
6896
6897    return(test_ret);
6898}
6899
6900static int
6901test_chvalid(void) {
6902    int test_ret = 0;
6903
6904    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6905    test_ret += test_xmlCharInRange();
6906    test_ret += test_xmlIsBaseChar();
6907    test_ret += test_xmlIsBlank();
6908    test_ret += test_xmlIsChar();
6909    test_ret += test_xmlIsCombining();
6910    test_ret += test_xmlIsDigit();
6911    test_ret += test_xmlIsExtender();
6912    test_ret += test_xmlIsIdeographic();
6913    test_ret += test_xmlIsPubidChar();
6914
6915    if (test_ret != 0)
6916	printf("Module chvalid: %d errors\n", test_ret);
6917    return(test_ret);
6918}
6919
6920static int
6921test_xmlBoolToText(void) {
6922    int test_ret = 0;
6923
6924#if defined(LIBXML_DEBUG_ENABLED)
6925    int mem_base;
6926    const char * ret_val;
6927    int boolval; /* a bool to turn into text */
6928    int n_boolval;
6929
6930    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6931        mem_base = xmlMemBlocks();
6932        boolval = gen_int(n_boolval, 0);
6933
6934        ret_val = xmlBoolToText(boolval);
6935        desret_const_char_ptr(ret_val);
6936        call_tests++;
6937        des_int(n_boolval, boolval, 0);
6938        xmlResetLastError();
6939        if (mem_base != xmlMemBlocks()) {
6940            printf("Leak of %d blocks found in xmlBoolToText",
6941	           xmlMemBlocks() - mem_base);
6942	    test_ret++;
6943            printf(" %d", n_boolval);
6944            printf("\n");
6945        }
6946    }
6947    function_tests++;
6948#endif
6949
6950    return(test_ret);
6951}
6952
6953
6954static int
6955test_xmlDebugCheckDocument(void) {
6956    int test_ret = 0;
6957
6958#if defined(LIBXML_DEBUG_ENABLED)
6959    int mem_base;
6960    int ret_val;
6961    FILE * output; /* the FILE * for the output */
6962    int n_output;
6963    xmlDocPtr doc; /* the document */
6964    int n_doc;
6965
6966    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6967    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6968        mem_base = xmlMemBlocks();
6969        output = gen_debug_FILE_ptr(n_output, 0);
6970        doc = gen_xmlDocPtr(n_doc, 1);
6971
6972        ret_val = xmlDebugCheckDocument(output, doc);
6973        desret_int(ret_val);
6974        call_tests++;
6975        des_debug_FILE_ptr(n_output, output, 0);
6976        des_xmlDocPtr(n_doc, doc, 1);
6977        xmlResetLastError();
6978        if (mem_base != xmlMemBlocks()) {
6979            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6980	           xmlMemBlocks() - mem_base);
6981	    test_ret++;
6982            printf(" %d", n_output);
6983            printf(" %d", n_doc);
6984            printf("\n");
6985        }
6986    }
6987    }
6988    function_tests++;
6989#endif
6990
6991    return(test_ret);
6992}
6993
6994
6995static int
6996test_xmlDebugDumpAttr(void) {
6997    int test_ret = 0;
6998
6999#if defined(LIBXML_DEBUG_ENABLED)
7000    int mem_base;
7001    FILE * output; /* the FILE * for the output */
7002    int n_output;
7003    xmlAttrPtr attr; /* the attribute */
7004    int n_attr;
7005    int depth; /* the indentation level. */
7006    int n_depth;
7007
7008    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7009    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7010    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7011        mem_base = xmlMemBlocks();
7012        output = gen_debug_FILE_ptr(n_output, 0);
7013        attr = gen_xmlAttrPtr(n_attr, 1);
7014        depth = gen_int(n_depth, 2);
7015
7016        xmlDebugDumpAttr(output, attr, depth);
7017        call_tests++;
7018        des_debug_FILE_ptr(n_output, output, 0);
7019        des_xmlAttrPtr(n_attr, attr, 1);
7020        des_int(n_depth, depth, 2);
7021        xmlResetLastError();
7022        if (mem_base != xmlMemBlocks()) {
7023            printf("Leak of %d blocks found in xmlDebugDumpAttr",
7024	           xmlMemBlocks() - mem_base);
7025	    test_ret++;
7026            printf(" %d", n_output);
7027            printf(" %d", n_attr);
7028            printf(" %d", n_depth);
7029            printf("\n");
7030        }
7031    }
7032    }
7033    }
7034    function_tests++;
7035#endif
7036
7037    return(test_ret);
7038}
7039
7040
7041static int
7042test_xmlDebugDumpAttrList(void) {
7043    int test_ret = 0;
7044
7045#if defined(LIBXML_DEBUG_ENABLED)
7046    int mem_base;
7047    FILE * output; /* the FILE * for the output */
7048    int n_output;
7049    xmlAttrPtr attr; /* the attribute list */
7050    int n_attr;
7051    int depth; /* the indentation level. */
7052    int n_depth;
7053
7054    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7055    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7056    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7057        mem_base = xmlMemBlocks();
7058        output = gen_debug_FILE_ptr(n_output, 0);
7059        attr = gen_xmlAttrPtr(n_attr, 1);
7060        depth = gen_int(n_depth, 2);
7061
7062        xmlDebugDumpAttrList(output, attr, depth);
7063        call_tests++;
7064        des_debug_FILE_ptr(n_output, output, 0);
7065        des_xmlAttrPtr(n_attr, attr, 1);
7066        des_int(n_depth, depth, 2);
7067        xmlResetLastError();
7068        if (mem_base != xmlMemBlocks()) {
7069            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7070	           xmlMemBlocks() - mem_base);
7071	    test_ret++;
7072            printf(" %d", n_output);
7073            printf(" %d", n_attr);
7074            printf(" %d", n_depth);
7075            printf("\n");
7076        }
7077    }
7078    }
7079    }
7080    function_tests++;
7081#endif
7082
7083    return(test_ret);
7084}
7085
7086
7087static int
7088test_xmlDebugDumpDTD(void) {
7089    int test_ret = 0;
7090
7091#if defined(LIBXML_DEBUG_ENABLED)
7092    int mem_base;
7093    FILE * output; /* the FILE * for the output */
7094    int n_output;
7095    xmlDtdPtr dtd; /* the DTD */
7096    int n_dtd;
7097
7098    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7099    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7100        mem_base = xmlMemBlocks();
7101        output = gen_debug_FILE_ptr(n_output, 0);
7102        dtd = gen_xmlDtdPtr(n_dtd, 1);
7103
7104        xmlDebugDumpDTD(output, dtd);
7105        call_tests++;
7106        des_debug_FILE_ptr(n_output, output, 0);
7107        des_xmlDtdPtr(n_dtd, dtd, 1);
7108        xmlResetLastError();
7109        if (mem_base != xmlMemBlocks()) {
7110            printf("Leak of %d blocks found in xmlDebugDumpDTD",
7111	           xmlMemBlocks() - mem_base);
7112	    test_ret++;
7113            printf(" %d", n_output);
7114            printf(" %d", n_dtd);
7115            printf("\n");
7116        }
7117    }
7118    }
7119    function_tests++;
7120#endif
7121
7122    return(test_ret);
7123}
7124
7125
7126static int
7127test_xmlDebugDumpDocument(void) {
7128    int test_ret = 0;
7129
7130#if defined(LIBXML_DEBUG_ENABLED)
7131    int mem_base;
7132    FILE * output; /* the FILE * for the output */
7133    int n_output;
7134    xmlDocPtr doc; /* the document */
7135    int n_doc;
7136
7137    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7138    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7139        mem_base = xmlMemBlocks();
7140        output = gen_debug_FILE_ptr(n_output, 0);
7141        doc = gen_xmlDocPtr(n_doc, 1);
7142
7143        xmlDebugDumpDocument(output, doc);
7144        call_tests++;
7145        des_debug_FILE_ptr(n_output, output, 0);
7146        des_xmlDocPtr(n_doc, doc, 1);
7147        xmlResetLastError();
7148        if (mem_base != xmlMemBlocks()) {
7149            printf("Leak of %d blocks found in xmlDebugDumpDocument",
7150	           xmlMemBlocks() - mem_base);
7151	    test_ret++;
7152            printf(" %d", n_output);
7153            printf(" %d", n_doc);
7154            printf("\n");
7155        }
7156    }
7157    }
7158    function_tests++;
7159#endif
7160
7161    return(test_ret);
7162}
7163
7164
7165static int
7166test_xmlDebugDumpDocumentHead(void) {
7167    int test_ret = 0;
7168
7169#if defined(LIBXML_DEBUG_ENABLED)
7170    int mem_base;
7171    FILE * output; /* the FILE * for the output */
7172    int n_output;
7173    xmlDocPtr doc; /* the document */
7174    int n_doc;
7175
7176    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7177    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7178        mem_base = xmlMemBlocks();
7179        output = gen_debug_FILE_ptr(n_output, 0);
7180        doc = gen_xmlDocPtr(n_doc, 1);
7181
7182        xmlDebugDumpDocumentHead(output, doc);
7183        call_tests++;
7184        des_debug_FILE_ptr(n_output, output, 0);
7185        des_xmlDocPtr(n_doc, doc, 1);
7186        xmlResetLastError();
7187        if (mem_base != xmlMemBlocks()) {
7188            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7189	           xmlMemBlocks() - mem_base);
7190	    test_ret++;
7191            printf(" %d", n_output);
7192            printf(" %d", n_doc);
7193            printf("\n");
7194        }
7195    }
7196    }
7197    function_tests++;
7198#endif
7199
7200    return(test_ret);
7201}
7202
7203
7204static int
7205test_xmlDebugDumpEntities(void) {
7206    int test_ret = 0;
7207
7208#if defined(LIBXML_DEBUG_ENABLED)
7209    int mem_base;
7210    FILE * output; /* the FILE * for the output */
7211    int n_output;
7212    xmlDocPtr doc; /* the document */
7213    int n_doc;
7214
7215    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7216    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7217        mem_base = xmlMemBlocks();
7218        output = gen_debug_FILE_ptr(n_output, 0);
7219        doc = gen_xmlDocPtr(n_doc, 1);
7220
7221        xmlDebugDumpEntities(output, doc);
7222        call_tests++;
7223        des_debug_FILE_ptr(n_output, output, 0);
7224        des_xmlDocPtr(n_doc, doc, 1);
7225        xmlResetLastError();
7226        if (mem_base != xmlMemBlocks()) {
7227            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7228	           xmlMemBlocks() - mem_base);
7229	    test_ret++;
7230            printf(" %d", n_output);
7231            printf(" %d", n_doc);
7232            printf("\n");
7233        }
7234    }
7235    }
7236    function_tests++;
7237#endif
7238
7239    return(test_ret);
7240}
7241
7242
7243static int
7244test_xmlDebugDumpNode(void) {
7245    int test_ret = 0;
7246
7247#if defined(LIBXML_DEBUG_ENABLED)
7248    int mem_base;
7249    FILE * output; /* the FILE * for the output */
7250    int n_output;
7251    xmlNodePtr node; /* the node */
7252    int n_node;
7253    int depth; /* the indentation level. */
7254    int n_depth;
7255
7256    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7257    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7258    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7259        mem_base = xmlMemBlocks();
7260        output = gen_debug_FILE_ptr(n_output, 0);
7261        node = gen_xmlNodePtr(n_node, 1);
7262        depth = gen_int(n_depth, 2);
7263
7264        xmlDebugDumpNode(output, node, depth);
7265        call_tests++;
7266        des_debug_FILE_ptr(n_output, output, 0);
7267        des_xmlNodePtr(n_node, node, 1);
7268        des_int(n_depth, depth, 2);
7269        xmlResetLastError();
7270        if (mem_base != xmlMemBlocks()) {
7271            printf("Leak of %d blocks found in xmlDebugDumpNode",
7272	           xmlMemBlocks() - mem_base);
7273	    test_ret++;
7274            printf(" %d", n_output);
7275            printf(" %d", n_node);
7276            printf(" %d", n_depth);
7277            printf("\n");
7278        }
7279    }
7280    }
7281    }
7282    function_tests++;
7283#endif
7284
7285    return(test_ret);
7286}
7287
7288
7289static int
7290test_xmlDebugDumpNodeList(void) {
7291    int test_ret = 0;
7292
7293#if defined(LIBXML_DEBUG_ENABLED)
7294    int mem_base;
7295    FILE * output; /* the FILE * for the output */
7296    int n_output;
7297    xmlNodePtr node; /* the node list */
7298    int n_node;
7299    int depth; /* the indentation level. */
7300    int n_depth;
7301
7302    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7303    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7304    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7305        mem_base = xmlMemBlocks();
7306        output = gen_debug_FILE_ptr(n_output, 0);
7307        node = gen_xmlNodePtr(n_node, 1);
7308        depth = gen_int(n_depth, 2);
7309
7310        xmlDebugDumpNodeList(output, node, depth);
7311        call_tests++;
7312        des_debug_FILE_ptr(n_output, output, 0);
7313        des_xmlNodePtr(n_node, node, 1);
7314        des_int(n_depth, depth, 2);
7315        xmlResetLastError();
7316        if (mem_base != xmlMemBlocks()) {
7317            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7318	           xmlMemBlocks() - mem_base);
7319	    test_ret++;
7320            printf(" %d", n_output);
7321            printf(" %d", n_node);
7322            printf(" %d", n_depth);
7323            printf("\n");
7324        }
7325    }
7326    }
7327    }
7328    function_tests++;
7329#endif
7330
7331    return(test_ret);
7332}
7333
7334
7335static int
7336test_xmlDebugDumpOneNode(void) {
7337    int test_ret = 0;
7338
7339#if defined(LIBXML_DEBUG_ENABLED)
7340    int mem_base;
7341    FILE * output; /* the FILE * for the output */
7342    int n_output;
7343    xmlNodePtr node; /* the node */
7344    int n_node;
7345    int depth; /* the indentation level. */
7346    int n_depth;
7347
7348    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7349    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7350    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7351        mem_base = xmlMemBlocks();
7352        output = gen_debug_FILE_ptr(n_output, 0);
7353        node = gen_xmlNodePtr(n_node, 1);
7354        depth = gen_int(n_depth, 2);
7355
7356        xmlDebugDumpOneNode(output, node, depth);
7357        call_tests++;
7358        des_debug_FILE_ptr(n_output, output, 0);
7359        des_xmlNodePtr(n_node, node, 1);
7360        des_int(n_depth, depth, 2);
7361        xmlResetLastError();
7362        if (mem_base != xmlMemBlocks()) {
7363            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7364	           xmlMemBlocks() - mem_base);
7365	    test_ret++;
7366            printf(" %d", n_output);
7367            printf(" %d", n_node);
7368            printf(" %d", n_depth);
7369            printf("\n");
7370        }
7371    }
7372    }
7373    }
7374    function_tests++;
7375#endif
7376
7377    return(test_ret);
7378}
7379
7380
7381static int
7382test_xmlDebugDumpString(void) {
7383    int test_ret = 0;
7384
7385#if defined(LIBXML_DEBUG_ENABLED)
7386    int mem_base;
7387    FILE * output; /* the FILE * for the output */
7388    int n_output;
7389    xmlChar * str; /* the string */
7390    int n_str;
7391
7392    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7393    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7394        mem_base = xmlMemBlocks();
7395        output = gen_debug_FILE_ptr(n_output, 0);
7396        str = gen_const_xmlChar_ptr(n_str, 1);
7397
7398        xmlDebugDumpString(output, (const xmlChar *)str);
7399        call_tests++;
7400        des_debug_FILE_ptr(n_output, output, 0);
7401        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7402        xmlResetLastError();
7403        if (mem_base != xmlMemBlocks()) {
7404            printf("Leak of %d blocks found in xmlDebugDumpString",
7405	           xmlMemBlocks() - mem_base);
7406	    test_ret++;
7407            printf(" %d", n_output);
7408            printf(" %d", n_str);
7409            printf("\n");
7410        }
7411    }
7412    }
7413    function_tests++;
7414#endif
7415
7416    return(test_ret);
7417}
7418
7419
7420static int
7421test_xmlLsCountNode(void) {
7422    int test_ret = 0;
7423
7424#if defined(LIBXML_DEBUG_ENABLED)
7425    int mem_base;
7426    int ret_val;
7427    xmlNodePtr node; /* the node to count */
7428    int n_node;
7429
7430    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7431        mem_base = xmlMemBlocks();
7432        node = gen_xmlNodePtr(n_node, 0);
7433
7434        ret_val = xmlLsCountNode(node);
7435        desret_int(ret_val);
7436        call_tests++;
7437        des_xmlNodePtr(n_node, node, 0);
7438        xmlResetLastError();
7439        if (mem_base != xmlMemBlocks()) {
7440            printf("Leak of %d blocks found in xmlLsCountNode",
7441	           xmlMemBlocks() - mem_base);
7442	    test_ret++;
7443            printf(" %d", n_node);
7444            printf("\n");
7445        }
7446    }
7447    function_tests++;
7448#endif
7449
7450    return(test_ret);
7451}
7452
7453
7454static int
7455test_xmlLsOneNode(void) {
7456    int test_ret = 0;
7457
7458#if defined(LIBXML_DEBUG_ENABLED)
7459    int mem_base;
7460    FILE * output; /* the FILE * for the output */
7461    int n_output;
7462    xmlNodePtr node; /* the node to dump */
7463    int n_node;
7464
7465    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7466    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7467        mem_base = xmlMemBlocks();
7468        output = gen_debug_FILE_ptr(n_output, 0);
7469        node = gen_xmlNodePtr(n_node, 1);
7470
7471        xmlLsOneNode(output, node);
7472        call_tests++;
7473        des_debug_FILE_ptr(n_output, output, 0);
7474        des_xmlNodePtr(n_node, node, 1);
7475        xmlResetLastError();
7476        if (mem_base != xmlMemBlocks()) {
7477            printf("Leak of %d blocks found in xmlLsOneNode",
7478	           xmlMemBlocks() - mem_base);
7479	    test_ret++;
7480            printf(" %d", n_output);
7481            printf(" %d", n_node);
7482            printf("\n");
7483        }
7484    }
7485    }
7486    function_tests++;
7487#endif
7488
7489    return(test_ret);
7490}
7491
7492
7493#define gen_nb_char_ptr 1
7494static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7495    return(NULL);
7496}
7497static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7498}
7499
7500static int
7501test_xmlShell(void) {
7502    int test_ret = 0;
7503
7504
7505    /* missing type support */
7506    return(test_ret);
7507}
7508
7509
7510static int
7511test_xmlShellBase(void) {
7512    int test_ret = 0;
7513
7514#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7515    int mem_base;
7516    int ret_val;
7517    xmlShellCtxtPtr ctxt; /* the shell context */
7518    int n_ctxt;
7519    char * arg; /* unused */
7520    int n_arg;
7521    xmlNodePtr node; /* a node */
7522    int n_node;
7523    xmlNodePtr node2; /* unused */
7524    int n_node2;
7525
7526    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7527    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7528    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7529    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7530        mem_base = xmlMemBlocks();
7531        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7532        arg = gen_char_ptr(n_arg, 1);
7533        node = gen_xmlNodePtr(n_node, 2);
7534        node2 = gen_xmlNodePtr(n_node2, 3);
7535
7536        ret_val = xmlShellBase(ctxt, arg, node, node2);
7537        desret_int(ret_val);
7538        call_tests++;
7539        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7540        des_char_ptr(n_arg, arg, 1);
7541        des_xmlNodePtr(n_node, node, 2);
7542        des_xmlNodePtr(n_node2, node2, 3);
7543        xmlResetLastError();
7544        if (mem_base != xmlMemBlocks()) {
7545            printf("Leak of %d blocks found in xmlShellBase",
7546	           xmlMemBlocks() - mem_base);
7547	    test_ret++;
7548            printf(" %d", n_ctxt);
7549            printf(" %d", n_arg);
7550            printf(" %d", n_node);
7551            printf(" %d", n_node2);
7552            printf("\n");
7553        }
7554    }
7555    }
7556    }
7557    }
7558    function_tests++;
7559#endif
7560
7561    return(test_ret);
7562}
7563
7564
7565static int
7566test_xmlShellCat(void) {
7567    int test_ret = 0;
7568
7569#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7570    int mem_base;
7571    int ret_val;
7572    xmlShellCtxtPtr ctxt; /* the shell context */
7573    int n_ctxt;
7574    char * arg; /* unused */
7575    int n_arg;
7576    xmlNodePtr node; /* a node */
7577    int n_node;
7578    xmlNodePtr node2; /* unused */
7579    int n_node2;
7580
7581    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7582    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7583    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7584    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7585        mem_base = xmlMemBlocks();
7586        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7587        arg = gen_char_ptr(n_arg, 1);
7588        node = gen_xmlNodePtr(n_node, 2);
7589        node2 = gen_xmlNodePtr(n_node2, 3);
7590
7591        ret_val = xmlShellCat(ctxt, arg, node, node2);
7592        desret_int(ret_val);
7593        call_tests++;
7594        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7595        des_char_ptr(n_arg, arg, 1);
7596        des_xmlNodePtr(n_node, node, 2);
7597        des_xmlNodePtr(n_node2, node2, 3);
7598        xmlResetLastError();
7599        if (mem_base != xmlMemBlocks()) {
7600            printf("Leak of %d blocks found in xmlShellCat",
7601	           xmlMemBlocks() - mem_base);
7602	    test_ret++;
7603            printf(" %d", n_ctxt);
7604            printf(" %d", n_arg);
7605            printf(" %d", n_node);
7606            printf(" %d", n_node2);
7607            printf("\n");
7608        }
7609    }
7610    }
7611    }
7612    }
7613    function_tests++;
7614#endif
7615
7616    return(test_ret);
7617}
7618
7619
7620static int
7621test_xmlShellDir(void) {
7622    int test_ret = 0;
7623
7624#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7625    int mem_base;
7626    int ret_val;
7627    xmlShellCtxtPtr ctxt; /* the shell context */
7628    int n_ctxt;
7629    char * arg; /* unused */
7630    int n_arg;
7631    xmlNodePtr node; /* a node */
7632    int n_node;
7633    xmlNodePtr node2; /* unused */
7634    int n_node2;
7635
7636    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7637    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7638    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7639    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7640        mem_base = xmlMemBlocks();
7641        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7642        arg = gen_char_ptr(n_arg, 1);
7643        node = gen_xmlNodePtr(n_node, 2);
7644        node2 = gen_xmlNodePtr(n_node2, 3);
7645
7646        ret_val = xmlShellDir(ctxt, arg, node, node2);
7647        desret_int(ret_val);
7648        call_tests++;
7649        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7650        des_char_ptr(n_arg, arg, 1);
7651        des_xmlNodePtr(n_node, node, 2);
7652        des_xmlNodePtr(n_node2, node2, 3);
7653        xmlResetLastError();
7654        if (mem_base != xmlMemBlocks()) {
7655            printf("Leak of %d blocks found in xmlShellDir",
7656	           xmlMemBlocks() - mem_base);
7657	    test_ret++;
7658            printf(" %d", n_ctxt);
7659            printf(" %d", n_arg);
7660            printf(" %d", n_node);
7661            printf(" %d", n_node2);
7662            printf("\n");
7663        }
7664    }
7665    }
7666    }
7667    }
7668    function_tests++;
7669#endif
7670
7671    return(test_ret);
7672}
7673
7674
7675static int
7676test_xmlShellDu(void) {
7677    int test_ret = 0;
7678
7679#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7680    int mem_base;
7681    int ret_val;
7682    xmlShellCtxtPtr ctxt; /* the shell context */
7683    int n_ctxt;
7684    char * arg; /* unused */
7685    int n_arg;
7686    xmlNodePtr tree; /* a node defining a subtree */
7687    int n_tree;
7688    xmlNodePtr node2; /* unused */
7689    int n_node2;
7690
7691    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7692    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7693    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7694    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7695        mem_base = xmlMemBlocks();
7696        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7697        arg = gen_char_ptr(n_arg, 1);
7698        tree = gen_xmlNodePtr(n_tree, 2);
7699        node2 = gen_xmlNodePtr(n_node2, 3);
7700
7701        ret_val = xmlShellDu(ctxt, arg, tree, node2);
7702        desret_int(ret_val);
7703        call_tests++;
7704        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7705        des_char_ptr(n_arg, arg, 1);
7706        des_xmlNodePtr(n_tree, tree, 2);
7707        des_xmlNodePtr(n_node2, node2, 3);
7708        xmlResetLastError();
7709        if (mem_base != xmlMemBlocks()) {
7710            printf("Leak of %d blocks found in xmlShellDu",
7711	           xmlMemBlocks() - mem_base);
7712	    test_ret++;
7713            printf(" %d", n_ctxt);
7714            printf(" %d", n_arg);
7715            printf(" %d", n_tree);
7716            printf(" %d", n_node2);
7717            printf("\n");
7718        }
7719    }
7720    }
7721    }
7722    }
7723    function_tests++;
7724#endif
7725
7726    return(test_ret);
7727}
7728
7729
7730static int
7731test_xmlShellList(void) {
7732    int test_ret = 0;
7733
7734#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7735    int mem_base;
7736    int ret_val;
7737    xmlShellCtxtPtr ctxt; /* the shell context */
7738    int n_ctxt;
7739    char * arg; /* unused */
7740    int n_arg;
7741    xmlNodePtr node; /* a node */
7742    int n_node;
7743    xmlNodePtr node2; /* unused */
7744    int n_node2;
7745
7746    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7747    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7748    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7749    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7750        mem_base = xmlMemBlocks();
7751        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7752        arg = gen_char_ptr(n_arg, 1);
7753        node = gen_xmlNodePtr(n_node, 2);
7754        node2 = gen_xmlNodePtr(n_node2, 3);
7755
7756        ret_val = xmlShellList(ctxt, arg, node, node2);
7757        desret_int(ret_val);
7758        call_tests++;
7759        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7760        des_char_ptr(n_arg, arg, 1);
7761        des_xmlNodePtr(n_node, node, 2);
7762        des_xmlNodePtr(n_node2, node2, 3);
7763        xmlResetLastError();
7764        if (mem_base != xmlMemBlocks()) {
7765            printf("Leak of %d blocks found in xmlShellList",
7766	           xmlMemBlocks() - mem_base);
7767	    test_ret++;
7768            printf(" %d", n_ctxt);
7769            printf(" %d", n_arg);
7770            printf(" %d", n_node);
7771            printf(" %d", n_node2);
7772            printf("\n");
7773        }
7774    }
7775    }
7776    }
7777    }
7778    function_tests++;
7779#endif
7780
7781    return(test_ret);
7782}
7783
7784
7785static int
7786test_xmlShellLoad(void) {
7787    int test_ret = 0;
7788
7789#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7790    int mem_base;
7791    int ret_val;
7792    xmlShellCtxtPtr ctxt; /* the shell context */
7793    int n_ctxt;
7794    char * filename; /* the file name */
7795    int n_filename;
7796    xmlNodePtr node; /* unused */
7797    int n_node;
7798    xmlNodePtr node2; /* unused */
7799    int n_node2;
7800
7801    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7802    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7803    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7804    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7805        mem_base = xmlMemBlocks();
7806        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7807        filename = gen_char_ptr(n_filename, 1);
7808        node = gen_xmlNodePtr(n_node, 2);
7809        node2 = gen_xmlNodePtr(n_node2, 3);
7810
7811        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7812        desret_int(ret_val);
7813        call_tests++;
7814        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7815        des_char_ptr(n_filename, filename, 1);
7816        des_xmlNodePtr(n_node, node, 2);
7817        des_xmlNodePtr(n_node2, node2, 3);
7818        xmlResetLastError();
7819        if (mem_base != xmlMemBlocks()) {
7820            printf("Leak of %d blocks found in xmlShellLoad",
7821	           xmlMemBlocks() - mem_base);
7822	    test_ret++;
7823            printf(" %d", n_ctxt);
7824            printf(" %d", n_filename);
7825            printf(" %d", n_node);
7826            printf(" %d", n_node2);
7827            printf("\n");
7828        }
7829    }
7830    }
7831    }
7832    }
7833    function_tests++;
7834#endif
7835
7836    return(test_ret);
7837}
7838
7839
7840static int
7841test_xmlShellPrintXPathResult(void) {
7842    int test_ret = 0;
7843
7844#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7845    int mem_base;
7846    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7847    int n_list;
7848
7849    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7850        mem_base = xmlMemBlocks();
7851        list = gen_xmlXPathObjectPtr(n_list, 0);
7852
7853        xmlShellPrintXPathResult(list);
7854        call_tests++;
7855        des_xmlXPathObjectPtr(n_list, list, 0);
7856        xmlResetLastError();
7857        if (mem_base != xmlMemBlocks()) {
7858            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7859	           xmlMemBlocks() - mem_base);
7860	    test_ret++;
7861            printf(" %d", n_list);
7862            printf("\n");
7863        }
7864    }
7865    function_tests++;
7866#endif
7867
7868    return(test_ret);
7869}
7870
7871
7872static int
7873test_xmlShellPwd(void) {
7874    int test_ret = 0;
7875
7876#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7877    int mem_base;
7878    int ret_val;
7879    xmlShellCtxtPtr ctxt; /* the shell context */
7880    int n_ctxt;
7881    char * buffer; /* the output buffer */
7882    int n_buffer;
7883    xmlNodePtr node; /* a node */
7884    int n_node;
7885    xmlNodePtr node2; /* unused */
7886    int n_node2;
7887
7888    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7889    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7890    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7891    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7892        mem_base = xmlMemBlocks();
7893        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7894        buffer = gen_char_ptr(n_buffer, 1);
7895        node = gen_xmlNodePtr(n_node, 2);
7896        node2 = gen_xmlNodePtr(n_node2, 3);
7897
7898        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7899        desret_int(ret_val);
7900        call_tests++;
7901        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7902        des_char_ptr(n_buffer, buffer, 1);
7903        des_xmlNodePtr(n_node, node, 2);
7904        des_xmlNodePtr(n_node2, node2, 3);
7905        xmlResetLastError();
7906        if (mem_base != xmlMemBlocks()) {
7907            printf("Leak of %d blocks found in xmlShellPwd",
7908	           xmlMemBlocks() - mem_base);
7909	    test_ret++;
7910            printf(" %d", n_ctxt);
7911            printf(" %d", n_buffer);
7912            printf(" %d", n_node);
7913            printf(" %d", n_node2);
7914            printf("\n");
7915        }
7916    }
7917    }
7918    }
7919    }
7920    function_tests++;
7921#endif
7922
7923    return(test_ret);
7924}
7925
7926
7927static int
7928test_xmlShellSave(void) {
7929    int test_ret = 0;
7930
7931#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7932    int mem_base;
7933    int ret_val;
7934    xmlShellCtxtPtr ctxt; /* the shell context */
7935    int n_ctxt;
7936    char * filename; /* the file name (optional) */
7937    int n_filename;
7938    xmlNodePtr node; /* unused */
7939    int n_node;
7940    xmlNodePtr node2; /* unused */
7941    int n_node2;
7942
7943    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7944    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7945    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7946    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7947        mem_base = xmlMemBlocks();
7948        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7949        filename = gen_char_ptr(n_filename, 1);
7950        node = gen_xmlNodePtr(n_node, 2);
7951        node2 = gen_xmlNodePtr(n_node2, 3);
7952
7953        ret_val = xmlShellSave(ctxt, filename, node, node2);
7954        desret_int(ret_val);
7955        call_tests++;
7956        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7957        des_char_ptr(n_filename, filename, 1);
7958        des_xmlNodePtr(n_node, node, 2);
7959        des_xmlNodePtr(n_node2, node2, 3);
7960        xmlResetLastError();
7961        if (mem_base != xmlMemBlocks()) {
7962            printf("Leak of %d blocks found in xmlShellSave",
7963	           xmlMemBlocks() - mem_base);
7964	    test_ret++;
7965            printf(" %d", n_ctxt);
7966            printf(" %d", n_filename);
7967            printf(" %d", n_node);
7968            printf(" %d", n_node2);
7969            printf("\n");
7970        }
7971    }
7972    }
7973    }
7974    }
7975    function_tests++;
7976#endif
7977
7978    return(test_ret);
7979}
7980
7981
7982static int
7983test_xmlShellValidate(void) {
7984    int test_ret = 0;
7985
7986#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7987    int mem_base;
7988    int ret_val;
7989    xmlShellCtxtPtr ctxt; /* the shell context */
7990    int n_ctxt;
7991    char * dtd; /* the DTD URI (optional) */
7992    int n_dtd;
7993    xmlNodePtr node; /* unused */
7994    int n_node;
7995    xmlNodePtr node2; /* unused */
7996    int n_node2;
7997
7998    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7999    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
8000    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8001    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8002        mem_base = xmlMemBlocks();
8003        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8004        dtd = gen_char_ptr(n_dtd, 1);
8005        node = gen_xmlNodePtr(n_node, 2);
8006        node2 = gen_xmlNodePtr(n_node2, 3);
8007
8008        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8009        desret_int(ret_val);
8010        call_tests++;
8011        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8012        des_char_ptr(n_dtd, dtd, 1);
8013        des_xmlNodePtr(n_node, node, 2);
8014        des_xmlNodePtr(n_node2, node2, 3);
8015        xmlResetLastError();
8016        if (mem_base != xmlMemBlocks()) {
8017            printf("Leak of %d blocks found in xmlShellValidate",
8018	           xmlMemBlocks() - mem_base);
8019	    test_ret++;
8020            printf(" %d", n_ctxt);
8021            printf(" %d", n_dtd);
8022            printf(" %d", n_node);
8023            printf(" %d", n_node2);
8024            printf("\n");
8025        }
8026    }
8027    }
8028    }
8029    }
8030    function_tests++;
8031#endif
8032
8033    return(test_ret);
8034}
8035
8036
8037static int
8038test_xmlShellWrite(void) {
8039    int test_ret = 0;
8040
8041#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8042    int mem_base;
8043    int ret_val;
8044    xmlShellCtxtPtr ctxt; /* the shell context */
8045    int n_ctxt;
8046    char * filename; /* the file name */
8047    int n_filename;
8048    xmlNodePtr node; /* a node in the tree */
8049    int n_node;
8050    xmlNodePtr node2; /* unused */
8051    int n_node2;
8052
8053    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8054    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8055    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8056    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8057        mem_base = xmlMemBlocks();
8058        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8059        filename = gen_char_ptr(n_filename, 1);
8060        node = gen_xmlNodePtr(n_node, 2);
8061        node2 = gen_xmlNodePtr(n_node2, 3);
8062
8063        ret_val = xmlShellWrite(ctxt, filename, node, node2);
8064        desret_int(ret_val);
8065        call_tests++;
8066        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8067        des_char_ptr(n_filename, filename, 1);
8068        des_xmlNodePtr(n_node, node, 2);
8069        des_xmlNodePtr(n_node2, node2, 3);
8070        xmlResetLastError();
8071        if (mem_base != xmlMemBlocks()) {
8072            printf("Leak of %d blocks found in xmlShellWrite",
8073	           xmlMemBlocks() - mem_base);
8074	    test_ret++;
8075            printf(" %d", n_ctxt);
8076            printf(" %d", n_filename);
8077            printf(" %d", n_node);
8078            printf(" %d", n_node2);
8079            printf("\n");
8080        }
8081    }
8082    }
8083    }
8084    }
8085    function_tests++;
8086#endif
8087
8088    return(test_ret);
8089}
8090
8091static int
8092test_debugXML(void) {
8093    int test_ret = 0;
8094
8095    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8096    test_ret += test_xmlBoolToText();
8097    test_ret += test_xmlDebugCheckDocument();
8098    test_ret += test_xmlDebugDumpAttr();
8099    test_ret += test_xmlDebugDumpAttrList();
8100    test_ret += test_xmlDebugDumpDTD();
8101    test_ret += test_xmlDebugDumpDocument();
8102    test_ret += test_xmlDebugDumpDocumentHead();
8103    test_ret += test_xmlDebugDumpEntities();
8104    test_ret += test_xmlDebugDumpNode();
8105    test_ret += test_xmlDebugDumpNodeList();
8106    test_ret += test_xmlDebugDumpOneNode();
8107    test_ret += test_xmlDebugDumpString();
8108    test_ret += test_xmlLsCountNode();
8109    test_ret += test_xmlLsOneNode();
8110    test_ret += test_xmlShell();
8111    test_ret += test_xmlShellBase();
8112    test_ret += test_xmlShellCat();
8113    test_ret += test_xmlShellDir();
8114    test_ret += test_xmlShellDu();
8115    test_ret += test_xmlShellList();
8116    test_ret += test_xmlShellLoad();
8117    test_ret += test_xmlShellPrintXPathResult();
8118    test_ret += test_xmlShellPwd();
8119    test_ret += test_xmlShellSave();
8120    test_ret += test_xmlShellValidate();
8121    test_ret += test_xmlShellWrite();
8122
8123    if (test_ret != 0)
8124	printf("Module debugXML: %d errors\n", test_ret);
8125    return(test_ret);
8126}
8127
8128static int
8129test_xmlDictCleanup(void) {
8130    int test_ret = 0;
8131
8132    int mem_base;
8133
8134        mem_base = xmlMemBlocks();
8135
8136        xmlDictCleanup();
8137        call_tests++;
8138        xmlResetLastError();
8139        if (mem_base != xmlMemBlocks()) {
8140            printf("Leak of %d blocks found in xmlDictCleanup",
8141	           xmlMemBlocks() - mem_base);
8142	    test_ret++;
8143            printf("\n");
8144        }
8145    function_tests++;
8146
8147    return(test_ret);
8148}
8149
8150
8151static int
8152test_xmlDictCreate(void) {
8153    int test_ret = 0;
8154
8155    int mem_base;
8156    xmlDictPtr ret_val;
8157
8158        mem_base = xmlMemBlocks();
8159
8160        ret_val = xmlDictCreate();
8161        desret_xmlDictPtr(ret_val);
8162        call_tests++;
8163        xmlResetLastError();
8164        if (mem_base != xmlMemBlocks()) {
8165            printf("Leak of %d blocks found in xmlDictCreate",
8166	           xmlMemBlocks() - mem_base);
8167	    test_ret++;
8168            printf("\n");
8169        }
8170    function_tests++;
8171
8172    return(test_ret);
8173}
8174
8175
8176static int
8177test_xmlDictCreateSub(void) {
8178    int test_ret = 0;
8179
8180    int mem_base;
8181    xmlDictPtr ret_val;
8182    xmlDictPtr sub; /* an existing dictionnary */
8183    int n_sub;
8184
8185    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8186        mem_base = xmlMemBlocks();
8187        sub = gen_xmlDictPtr(n_sub, 0);
8188
8189        ret_val = xmlDictCreateSub(sub);
8190        desret_xmlDictPtr(ret_val);
8191        call_tests++;
8192        des_xmlDictPtr(n_sub, sub, 0);
8193        xmlResetLastError();
8194        if (mem_base != xmlMemBlocks()) {
8195            printf("Leak of %d blocks found in xmlDictCreateSub",
8196	           xmlMemBlocks() - mem_base);
8197	    test_ret++;
8198            printf(" %d", n_sub);
8199            printf("\n");
8200        }
8201    }
8202    function_tests++;
8203
8204    return(test_ret);
8205}
8206
8207
8208static int
8209test_xmlDictExists(void) {
8210    int test_ret = 0;
8211
8212    int mem_base;
8213    const xmlChar * ret_val;
8214    xmlDictPtr dict; /* the dictionnary */
8215    int n_dict;
8216    xmlChar * name; /* the name of the userdata */
8217    int n_name;
8218    int len; /* the length of the name, if -1 it is recomputed */
8219    int n_len;
8220
8221    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8222    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8223    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8224        mem_base = xmlMemBlocks();
8225        dict = gen_xmlDictPtr(n_dict, 0);
8226        name = gen_const_xmlChar_ptr(n_name, 1);
8227        len = gen_int(n_len, 2);
8228
8229        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8230        desret_const_xmlChar_ptr(ret_val);
8231        call_tests++;
8232        des_xmlDictPtr(n_dict, dict, 0);
8233        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8234        des_int(n_len, len, 2);
8235        xmlResetLastError();
8236        if (mem_base != xmlMemBlocks()) {
8237            printf("Leak of %d blocks found in xmlDictExists",
8238	           xmlMemBlocks() - mem_base);
8239	    test_ret++;
8240            printf(" %d", n_dict);
8241            printf(" %d", n_name);
8242            printf(" %d", n_len);
8243            printf("\n");
8244        }
8245    }
8246    }
8247    }
8248    function_tests++;
8249
8250    return(test_ret);
8251}
8252
8253
8254static int
8255test_xmlDictLookup(void) {
8256    int test_ret = 0;
8257
8258    int mem_base;
8259    const xmlChar * ret_val;
8260    xmlDictPtr dict; /* the dictionnary */
8261    int n_dict;
8262    xmlChar * name; /* the name of the userdata */
8263    int n_name;
8264    int len; /* the length of the name, if -1 it is recomputed */
8265    int n_len;
8266
8267    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8268    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8269    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8270        mem_base = xmlMemBlocks();
8271        dict = gen_xmlDictPtr(n_dict, 0);
8272        name = gen_const_xmlChar_ptr(n_name, 1);
8273        len = gen_int(n_len, 2);
8274
8275        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8276        desret_const_xmlChar_ptr(ret_val);
8277        call_tests++;
8278        des_xmlDictPtr(n_dict, dict, 0);
8279        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8280        des_int(n_len, len, 2);
8281        xmlResetLastError();
8282        if (mem_base != xmlMemBlocks()) {
8283            printf("Leak of %d blocks found in xmlDictLookup",
8284	           xmlMemBlocks() - mem_base);
8285	    test_ret++;
8286            printf(" %d", n_dict);
8287            printf(" %d", n_name);
8288            printf(" %d", n_len);
8289            printf("\n");
8290        }
8291    }
8292    }
8293    }
8294    function_tests++;
8295
8296    return(test_ret);
8297}
8298
8299
8300static int
8301test_xmlDictOwns(void) {
8302    int test_ret = 0;
8303
8304    int mem_base;
8305    int ret_val;
8306    xmlDictPtr dict; /* the dictionnary */
8307    int n_dict;
8308    xmlChar * str; /* the string */
8309    int n_str;
8310
8311    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8312    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8313        mem_base = xmlMemBlocks();
8314        dict = gen_xmlDictPtr(n_dict, 0);
8315        str = gen_const_xmlChar_ptr(n_str, 1);
8316
8317        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8318        desret_int(ret_val);
8319        call_tests++;
8320        des_xmlDictPtr(n_dict, dict, 0);
8321        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8322        xmlResetLastError();
8323        if (mem_base != xmlMemBlocks()) {
8324            printf("Leak of %d blocks found in xmlDictOwns",
8325	           xmlMemBlocks() - mem_base);
8326	    test_ret++;
8327            printf(" %d", n_dict);
8328            printf(" %d", n_str);
8329            printf("\n");
8330        }
8331    }
8332    }
8333    function_tests++;
8334
8335    return(test_ret);
8336}
8337
8338
8339static int
8340test_xmlDictQLookup(void) {
8341    int test_ret = 0;
8342
8343    int mem_base;
8344    const xmlChar * ret_val;
8345    xmlDictPtr dict; /* the dictionnary */
8346    int n_dict;
8347    xmlChar * prefix; /* the prefix */
8348    int n_prefix;
8349    xmlChar * name; /* the name */
8350    int n_name;
8351
8352    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8353    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8354    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8355        mem_base = xmlMemBlocks();
8356        dict = gen_xmlDictPtr(n_dict, 0);
8357        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8358        name = gen_const_xmlChar_ptr(n_name, 2);
8359
8360        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8361        desret_const_xmlChar_ptr(ret_val);
8362        call_tests++;
8363        des_xmlDictPtr(n_dict, dict, 0);
8364        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8365        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8366        xmlResetLastError();
8367        if (mem_base != xmlMemBlocks()) {
8368            printf("Leak of %d blocks found in xmlDictQLookup",
8369	           xmlMemBlocks() - mem_base);
8370	    test_ret++;
8371            printf(" %d", n_dict);
8372            printf(" %d", n_prefix);
8373            printf(" %d", n_name);
8374            printf("\n");
8375        }
8376    }
8377    }
8378    }
8379    function_tests++;
8380
8381    return(test_ret);
8382}
8383
8384
8385static int
8386test_xmlDictReference(void) {
8387    int test_ret = 0;
8388
8389    int mem_base;
8390    int ret_val;
8391    xmlDictPtr dict; /* the dictionnary */
8392    int n_dict;
8393
8394    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8395        mem_base = xmlMemBlocks();
8396        dict = gen_xmlDictPtr(n_dict, 0);
8397
8398        ret_val = xmlDictReference(dict);
8399        xmlDictFree(dict);
8400        desret_int(ret_val);
8401        call_tests++;
8402        des_xmlDictPtr(n_dict, dict, 0);
8403        xmlResetLastError();
8404        if (mem_base != xmlMemBlocks()) {
8405            printf("Leak of %d blocks found in xmlDictReference",
8406	           xmlMemBlocks() - mem_base);
8407	    test_ret++;
8408            printf(" %d", n_dict);
8409            printf("\n");
8410        }
8411    }
8412    function_tests++;
8413
8414    return(test_ret);
8415}
8416
8417
8418static int
8419test_xmlDictSize(void) {
8420    int test_ret = 0;
8421
8422    int mem_base;
8423    int ret_val;
8424    xmlDictPtr dict; /* the dictionnary */
8425    int n_dict;
8426
8427    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8428        mem_base = xmlMemBlocks();
8429        dict = gen_xmlDictPtr(n_dict, 0);
8430
8431        ret_val = xmlDictSize(dict);
8432        desret_int(ret_val);
8433        call_tests++;
8434        des_xmlDictPtr(n_dict, dict, 0);
8435        xmlResetLastError();
8436        if (mem_base != xmlMemBlocks()) {
8437            printf("Leak of %d blocks found in xmlDictSize",
8438	           xmlMemBlocks() - mem_base);
8439	    test_ret++;
8440            printf(" %d", n_dict);
8441            printf("\n");
8442        }
8443    }
8444    function_tests++;
8445
8446    return(test_ret);
8447}
8448
8449static int
8450test_dict(void) {
8451    int test_ret = 0;
8452
8453    if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8454    test_ret += test_xmlDictCleanup();
8455    test_ret += test_xmlDictCreate();
8456    test_ret += test_xmlDictCreateSub();
8457    test_ret += test_xmlDictExists();
8458    test_ret += test_xmlDictLookup();
8459    test_ret += test_xmlDictOwns();
8460    test_ret += test_xmlDictQLookup();
8461    test_ret += test_xmlDictReference();
8462    test_ret += test_xmlDictSize();
8463
8464    if (test_ret != 0)
8465	printf("Module dict: %d errors\n", test_ret);
8466    return(test_ret);
8467}
8468
8469static int
8470test_UTF8Toisolat1(void) {
8471    int test_ret = 0;
8472
8473#if defined(LIBXML_OUTPUT_ENABLED)
8474#ifdef LIBXML_OUTPUT_ENABLED
8475    int mem_base;
8476    int ret_val;
8477    unsigned char * out; /* a pointer to an array of bytes to store the result */
8478    int n_out;
8479    int * outlen; /* the length of @out */
8480    int n_outlen;
8481    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8482    int n_in;
8483    int * inlen; /* the length of @in */
8484    int n_inlen;
8485
8486    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8487    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8488    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8489    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8490        mem_base = xmlMemBlocks();
8491        out = gen_unsigned_char_ptr(n_out, 0);
8492        outlen = gen_int_ptr(n_outlen, 1);
8493        in = gen_const_unsigned_char_ptr(n_in, 2);
8494        inlen = gen_int_ptr(n_inlen, 3);
8495
8496        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8497        desret_int(ret_val);
8498        call_tests++;
8499        des_unsigned_char_ptr(n_out, out, 0);
8500        des_int_ptr(n_outlen, outlen, 1);
8501        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8502        des_int_ptr(n_inlen, inlen, 3);
8503        xmlResetLastError();
8504        if (mem_base != xmlMemBlocks()) {
8505            printf("Leak of %d blocks found in UTF8Toisolat1",
8506	           xmlMemBlocks() - mem_base);
8507	    test_ret++;
8508            printf(" %d", n_out);
8509            printf(" %d", n_outlen);
8510            printf(" %d", n_in);
8511            printf(" %d", n_inlen);
8512            printf("\n");
8513        }
8514    }
8515    }
8516    }
8517    }
8518    function_tests++;
8519#endif
8520#endif
8521
8522    return(test_ret);
8523}
8524
8525
8526static int
8527test_isolat1ToUTF8(void) {
8528    int test_ret = 0;
8529
8530    int mem_base;
8531    int ret_val;
8532    unsigned char * out; /* a pointer to an array of bytes to store the result */
8533    int n_out;
8534    int * outlen; /* the length of @out */
8535    int n_outlen;
8536    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8537    int n_in;
8538    int * inlen; /* the length of @in */
8539    int n_inlen;
8540
8541    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8542    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8543    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8544    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8545        mem_base = xmlMemBlocks();
8546        out = gen_unsigned_char_ptr(n_out, 0);
8547        outlen = gen_int_ptr(n_outlen, 1);
8548        in = gen_const_unsigned_char_ptr(n_in, 2);
8549        inlen = gen_int_ptr(n_inlen, 3);
8550
8551        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8552        desret_int(ret_val);
8553        call_tests++;
8554        des_unsigned_char_ptr(n_out, out, 0);
8555        des_int_ptr(n_outlen, outlen, 1);
8556        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8557        des_int_ptr(n_inlen, inlen, 3);
8558        xmlResetLastError();
8559        if (mem_base != xmlMemBlocks()) {
8560            printf("Leak of %d blocks found in isolat1ToUTF8",
8561	           xmlMemBlocks() - mem_base);
8562	    test_ret++;
8563            printf(" %d", n_out);
8564            printf(" %d", n_outlen);
8565            printf(" %d", n_in);
8566            printf(" %d", n_inlen);
8567            printf("\n");
8568        }
8569    }
8570    }
8571    }
8572    }
8573    function_tests++;
8574
8575    return(test_ret);
8576}
8577
8578
8579static int
8580test_xmlAddEncodingAlias(void) {
8581    int test_ret = 0;
8582
8583    int ret_val;
8584    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8585    int n_name;
8586    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8587    int n_alias;
8588
8589    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8590    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8591        name = gen_const_char_ptr(n_name, 0);
8592        alias = gen_const_char_ptr(n_alias, 1);
8593
8594        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8595        desret_int(ret_val);
8596        call_tests++;
8597        des_const_char_ptr(n_name, (const char *)name, 0);
8598        des_const_char_ptr(n_alias, (const char *)alias, 1);
8599        xmlResetLastError();
8600    }
8601    }
8602    function_tests++;
8603
8604    return(test_ret);
8605}
8606
8607
8608#define gen_nb_xmlCharEncodingHandler_ptr 1
8609static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8610    return(NULL);
8611}
8612static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8613}
8614
8615static int
8616test_xmlCharEncCloseFunc(void) {
8617    int test_ret = 0;
8618
8619    int mem_base;
8620    int ret_val;
8621    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8622    int n_handler;
8623
8624    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8625        mem_base = xmlMemBlocks();
8626        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8627
8628        ret_val = xmlCharEncCloseFunc(handler);
8629        desret_int(ret_val);
8630        call_tests++;
8631        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8632        xmlResetLastError();
8633        if (mem_base != xmlMemBlocks()) {
8634            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8635	           xmlMemBlocks() - mem_base);
8636	    test_ret++;
8637            printf(" %d", n_handler);
8638            printf("\n");
8639        }
8640    }
8641    function_tests++;
8642
8643    return(test_ret);
8644}
8645
8646
8647static int
8648test_xmlCharEncFirstLine(void) {
8649    int test_ret = 0;
8650
8651    int mem_base;
8652    int ret_val;
8653    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8654    int n_handler;
8655    xmlBufferPtr out; /* an xmlBuffer for the output. */
8656    int n_out;
8657    xmlBufferPtr in; /* an xmlBuffer for the input */
8658    int n_in;
8659
8660    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8661    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8662    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8663        mem_base = xmlMemBlocks();
8664        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8665        out = gen_xmlBufferPtr(n_out, 1);
8666        in = gen_xmlBufferPtr(n_in, 2);
8667
8668        ret_val = xmlCharEncFirstLine(handler, out, in);
8669        desret_int(ret_val);
8670        call_tests++;
8671        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8672        des_xmlBufferPtr(n_out, out, 1);
8673        des_xmlBufferPtr(n_in, in, 2);
8674        xmlResetLastError();
8675        if (mem_base != xmlMemBlocks()) {
8676            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8677	           xmlMemBlocks() - mem_base);
8678	    test_ret++;
8679            printf(" %d", n_handler);
8680            printf(" %d", n_out);
8681            printf(" %d", n_in);
8682            printf("\n");
8683        }
8684    }
8685    }
8686    }
8687    function_tests++;
8688
8689    return(test_ret);
8690}
8691
8692
8693static int
8694test_xmlCharEncInFunc(void) {
8695    int test_ret = 0;
8696
8697    int mem_base;
8698    int ret_val;
8699    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8700    int n_handler;
8701    xmlBufferPtr out; /* an xmlBuffer for the output. */
8702    int n_out;
8703    xmlBufferPtr in; /* an xmlBuffer for the input */
8704    int n_in;
8705
8706    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8707    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8708    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8709        mem_base = xmlMemBlocks();
8710        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8711        out = gen_xmlBufferPtr(n_out, 1);
8712        in = gen_xmlBufferPtr(n_in, 2);
8713
8714        ret_val = xmlCharEncInFunc(handler, out, in);
8715        desret_int(ret_val);
8716        call_tests++;
8717        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8718        des_xmlBufferPtr(n_out, out, 1);
8719        des_xmlBufferPtr(n_in, in, 2);
8720        xmlResetLastError();
8721        if (mem_base != xmlMemBlocks()) {
8722            printf("Leak of %d blocks found in xmlCharEncInFunc",
8723	           xmlMemBlocks() - mem_base);
8724	    test_ret++;
8725            printf(" %d", n_handler);
8726            printf(" %d", n_out);
8727            printf(" %d", n_in);
8728            printf("\n");
8729        }
8730    }
8731    }
8732    }
8733    function_tests++;
8734
8735    return(test_ret);
8736}
8737
8738
8739static int
8740test_xmlCharEncOutFunc(void) {
8741    int test_ret = 0;
8742
8743    int mem_base;
8744    int ret_val;
8745    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8746    int n_handler;
8747    xmlBufferPtr out; /* an xmlBuffer for the output. */
8748    int n_out;
8749    xmlBufferPtr in; /* an xmlBuffer for the input */
8750    int n_in;
8751
8752    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8753    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8754    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8755        mem_base = xmlMemBlocks();
8756        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8757        out = gen_xmlBufferPtr(n_out, 1);
8758        in = gen_xmlBufferPtr(n_in, 2);
8759
8760        ret_val = xmlCharEncOutFunc(handler, out, in);
8761        desret_int(ret_val);
8762        call_tests++;
8763        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8764        des_xmlBufferPtr(n_out, out, 1);
8765        des_xmlBufferPtr(n_in, in, 2);
8766        xmlResetLastError();
8767        if (mem_base != xmlMemBlocks()) {
8768            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8769	           xmlMemBlocks() - mem_base);
8770	    test_ret++;
8771            printf(" %d", n_handler);
8772            printf(" %d", n_out);
8773            printf(" %d", n_in);
8774            printf("\n");
8775        }
8776    }
8777    }
8778    }
8779    function_tests++;
8780
8781    return(test_ret);
8782}
8783
8784
8785static int
8786test_xmlCleanupCharEncodingHandlers(void) {
8787    int test_ret = 0;
8788
8789
8790
8791        xmlCleanupCharEncodingHandlers();
8792        call_tests++;
8793        xmlResetLastError();
8794    function_tests++;
8795
8796    return(test_ret);
8797}
8798
8799
8800static int
8801test_xmlCleanupEncodingAliases(void) {
8802    int test_ret = 0;
8803
8804    int mem_base;
8805
8806        mem_base = xmlMemBlocks();
8807
8808        xmlCleanupEncodingAliases();
8809        call_tests++;
8810        xmlResetLastError();
8811        if (mem_base != xmlMemBlocks()) {
8812            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8813	           xmlMemBlocks() - mem_base);
8814	    test_ret++;
8815            printf("\n");
8816        }
8817    function_tests++;
8818
8819    return(test_ret);
8820}
8821
8822
8823static int
8824test_xmlDelEncodingAlias(void) {
8825    int test_ret = 0;
8826
8827    int mem_base;
8828    int ret_val;
8829    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8830    int n_alias;
8831
8832    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8833        mem_base = xmlMemBlocks();
8834        alias = gen_const_char_ptr(n_alias, 0);
8835
8836        ret_val = xmlDelEncodingAlias((const char *)alias);
8837        desret_int(ret_val);
8838        call_tests++;
8839        des_const_char_ptr(n_alias, (const char *)alias, 0);
8840        xmlResetLastError();
8841        if (mem_base != xmlMemBlocks()) {
8842            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8843	           xmlMemBlocks() - mem_base);
8844	    test_ret++;
8845            printf(" %d", n_alias);
8846            printf("\n");
8847        }
8848    }
8849    function_tests++;
8850
8851    return(test_ret);
8852}
8853
8854
8855static int
8856test_xmlDetectCharEncoding(void) {
8857    int test_ret = 0;
8858
8859    int mem_base;
8860    xmlCharEncoding ret_val;
8861    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). */
8862    int n_in;
8863    int len; /* pointer to the length of the buffer */
8864    int n_len;
8865
8866    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8867    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8868        mem_base = xmlMemBlocks();
8869        in = gen_const_unsigned_char_ptr(n_in, 0);
8870        len = gen_int(n_len, 1);
8871
8872        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8873        desret_xmlCharEncoding(ret_val);
8874        call_tests++;
8875        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8876        des_int(n_len, len, 1);
8877        xmlResetLastError();
8878        if (mem_base != xmlMemBlocks()) {
8879            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8880	           xmlMemBlocks() - mem_base);
8881	    test_ret++;
8882            printf(" %d", n_in);
8883            printf(" %d", n_len);
8884            printf("\n");
8885        }
8886    }
8887    }
8888    function_tests++;
8889
8890    return(test_ret);
8891}
8892
8893
8894static int
8895test_xmlFindCharEncodingHandler(void) {
8896    int test_ret = 0;
8897
8898
8899    /* missing type support */
8900    return(test_ret);
8901}
8902
8903
8904static int
8905test_xmlGetCharEncodingHandler(void) {
8906    int test_ret = 0;
8907
8908
8909    /* missing type support */
8910    return(test_ret);
8911}
8912
8913
8914static int
8915test_xmlGetCharEncodingName(void) {
8916    int test_ret = 0;
8917
8918    int mem_base;
8919    const char * ret_val;
8920    xmlCharEncoding enc; /* the encoding */
8921    int n_enc;
8922
8923    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8924        mem_base = xmlMemBlocks();
8925        enc = gen_xmlCharEncoding(n_enc, 0);
8926
8927        ret_val = xmlGetCharEncodingName(enc);
8928        desret_const_char_ptr(ret_val);
8929        call_tests++;
8930        des_xmlCharEncoding(n_enc, enc, 0);
8931        xmlResetLastError();
8932        if (mem_base != xmlMemBlocks()) {
8933            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8934	           xmlMemBlocks() - mem_base);
8935	    test_ret++;
8936            printf(" %d", n_enc);
8937            printf("\n");
8938        }
8939    }
8940    function_tests++;
8941
8942    return(test_ret);
8943}
8944
8945
8946static int
8947test_xmlGetEncodingAlias(void) {
8948    int test_ret = 0;
8949
8950    int mem_base;
8951    const char * ret_val;
8952    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8953    int n_alias;
8954
8955    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8956        mem_base = xmlMemBlocks();
8957        alias = gen_const_char_ptr(n_alias, 0);
8958
8959        ret_val = xmlGetEncodingAlias((const char *)alias);
8960        desret_const_char_ptr(ret_val);
8961        call_tests++;
8962        des_const_char_ptr(n_alias, (const char *)alias, 0);
8963        xmlResetLastError();
8964        if (mem_base != xmlMemBlocks()) {
8965            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8966	           xmlMemBlocks() - mem_base);
8967	    test_ret++;
8968            printf(" %d", n_alias);
8969            printf("\n");
8970        }
8971    }
8972    function_tests++;
8973
8974    return(test_ret);
8975}
8976
8977
8978static int
8979test_xmlInitCharEncodingHandlers(void) {
8980    int test_ret = 0;
8981
8982
8983
8984        xmlInitCharEncodingHandlers();
8985        call_tests++;
8986        xmlResetLastError();
8987    function_tests++;
8988
8989    return(test_ret);
8990}
8991
8992
8993static int
8994test_xmlNewCharEncodingHandler(void) {
8995    int test_ret = 0;
8996
8997
8998    /* missing type support */
8999    return(test_ret);
9000}
9001
9002
9003static int
9004test_xmlParseCharEncoding(void) {
9005    int test_ret = 0;
9006
9007    int mem_base;
9008    xmlCharEncoding ret_val;
9009    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9010    int n_name;
9011
9012    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9013        mem_base = xmlMemBlocks();
9014        name = gen_const_char_ptr(n_name, 0);
9015
9016        ret_val = xmlParseCharEncoding((const char *)name);
9017        desret_xmlCharEncoding(ret_val);
9018        call_tests++;
9019        des_const_char_ptr(n_name, (const char *)name, 0);
9020        xmlResetLastError();
9021        if (mem_base != xmlMemBlocks()) {
9022            printf("Leak of %d blocks found in xmlParseCharEncoding",
9023	           xmlMemBlocks() - mem_base);
9024	    test_ret++;
9025            printf(" %d", n_name);
9026            printf("\n");
9027        }
9028    }
9029    function_tests++;
9030
9031    return(test_ret);
9032}
9033
9034
9035#define gen_nb_xmlCharEncodingHandlerPtr 1
9036static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9037    return(NULL);
9038}
9039static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9040}
9041
9042static int
9043test_xmlRegisterCharEncodingHandler(void) {
9044    int test_ret = 0;
9045
9046    int mem_base;
9047    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9048    int n_handler;
9049
9050    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9051        mem_base = xmlMemBlocks();
9052        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9053
9054        xmlRegisterCharEncodingHandler(handler);
9055        call_tests++;
9056        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9057        xmlResetLastError();
9058        if (mem_base != xmlMemBlocks()) {
9059            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9060	           xmlMemBlocks() - mem_base);
9061	    test_ret++;
9062            printf(" %d", n_handler);
9063            printf("\n");
9064        }
9065    }
9066    function_tests++;
9067
9068    return(test_ret);
9069}
9070
9071static int
9072test_encoding(void) {
9073    int test_ret = 0;
9074
9075    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9076    test_ret += test_UTF8Toisolat1();
9077    test_ret += test_isolat1ToUTF8();
9078    test_ret += test_xmlAddEncodingAlias();
9079    test_ret += test_xmlCharEncCloseFunc();
9080    test_ret += test_xmlCharEncFirstLine();
9081    test_ret += test_xmlCharEncInFunc();
9082    test_ret += test_xmlCharEncOutFunc();
9083    test_ret += test_xmlCleanupCharEncodingHandlers();
9084    test_ret += test_xmlCleanupEncodingAliases();
9085    test_ret += test_xmlDelEncodingAlias();
9086    test_ret += test_xmlDetectCharEncoding();
9087    test_ret += test_xmlFindCharEncodingHandler();
9088    test_ret += test_xmlGetCharEncodingHandler();
9089    test_ret += test_xmlGetCharEncodingName();
9090    test_ret += test_xmlGetEncodingAlias();
9091    test_ret += test_xmlInitCharEncodingHandlers();
9092    test_ret += test_xmlNewCharEncodingHandler();
9093    test_ret += test_xmlParseCharEncoding();
9094    test_ret += test_xmlRegisterCharEncodingHandler();
9095
9096    if (test_ret != 0)
9097	printf("Module encoding: %d errors\n", test_ret);
9098    return(test_ret);
9099}
9100
9101static int
9102test_xmlAddDocEntity(void) {
9103    int test_ret = 0;
9104
9105    int mem_base;
9106    xmlEntityPtr ret_val;
9107    xmlDocPtr doc; /* the document */
9108    int n_doc;
9109    xmlChar * name; /* the entity name */
9110    int n_name;
9111    int type; /* the entity type XML_xxx_yyy_ENTITY */
9112    int n_type;
9113    xmlChar * ExternalID; /* the entity external ID if available */
9114    int n_ExternalID;
9115    xmlChar * SystemID; /* the entity system ID if available */
9116    int n_SystemID;
9117    xmlChar * content; /* the entity content */
9118    int n_content;
9119
9120    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9121    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9122    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9123    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9124    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9125    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9126        mem_base = xmlMemBlocks();
9127        doc = gen_xmlDocPtr(n_doc, 0);
9128        name = gen_const_xmlChar_ptr(n_name, 1);
9129        type = gen_int(n_type, 2);
9130        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9131        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9132        content = gen_const_xmlChar_ptr(n_content, 5);
9133
9134        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9135        desret_xmlEntityPtr(ret_val);
9136        call_tests++;
9137        des_xmlDocPtr(n_doc, doc, 0);
9138        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9139        des_int(n_type, type, 2);
9140        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9141        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9142        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9143        xmlResetLastError();
9144        if (mem_base != xmlMemBlocks()) {
9145            printf("Leak of %d blocks found in xmlAddDocEntity",
9146	           xmlMemBlocks() - mem_base);
9147	    test_ret++;
9148            printf(" %d", n_doc);
9149            printf(" %d", n_name);
9150            printf(" %d", n_type);
9151            printf(" %d", n_ExternalID);
9152            printf(" %d", n_SystemID);
9153            printf(" %d", n_content);
9154            printf("\n");
9155        }
9156    }
9157    }
9158    }
9159    }
9160    }
9161    }
9162    function_tests++;
9163
9164    return(test_ret);
9165}
9166
9167
9168static int
9169test_xmlAddDtdEntity(void) {
9170    int test_ret = 0;
9171
9172    int mem_base;
9173    xmlEntityPtr ret_val;
9174    xmlDocPtr doc; /* the document */
9175    int n_doc;
9176    xmlChar * name; /* the entity name */
9177    int n_name;
9178    int type; /* the entity type XML_xxx_yyy_ENTITY */
9179    int n_type;
9180    xmlChar * ExternalID; /* the entity external ID if available */
9181    int n_ExternalID;
9182    xmlChar * SystemID; /* the entity system ID if available */
9183    int n_SystemID;
9184    xmlChar * content; /* the entity content */
9185    int n_content;
9186
9187    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9188    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9189    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9190    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9191    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9192    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9193        mem_base = xmlMemBlocks();
9194        doc = gen_xmlDocPtr(n_doc, 0);
9195        name = gen_const_xmlChar_ptr(n_name, 1);
9196        type = gen_int(n_type, 2);
9197        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9198        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9199        content = gen_const_xmlChar_ptr(n_content, 5);
9200
9201        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9202        desret_xmlEntityPtr(ret_val);
9203        call_tests++;
9204        des_xmlDocPtr(n_doc, doc, 0);
9205        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9206        des_int(n_type, type, 2);
9207        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9208        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9209        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9210        xmlResetLastError();
9211        if (mem_base != xmlMemBlocks()) {
9212            printf("Leak of %d blocks found in xmlAddDtdEntity",
9213	           xmlMemBlocks() - mem_base);
9214	    test_ret++;
9215            printf(" %d", n_doc);
9216            printf(" %d", n_name);
9217            printf(" %d", n_type);
9218            printf(" %d", n_ExternalID);
9219            printf(" %d", n_SystemID);
9220            printf(" %d", n_content);
9221            printf("\n");
9222        }
9223    }
9224    }
9225    }
9226    }
9227    }
9228    }
9229    function_tests++;
9230
9231    return(test_ret);
9232}
9233
9234
9235static int
9236test_xmlCleanupPredefinedEntities(void) {
9237    int test_ret = 0;
9238
9239#if defined(LIBXML_LEGACY_ENABLED)
9240#ifdef LIBXML_LEGACY_ENABLED
9241    int mem_base;
9242
9243        mem_base = xmlMemBlocks();
9244
9245        xmlCleanupPredefinedEntities();
9246        call_tests++;
9247        xmlResetLastError();
9248        if (mem_base != xmlMemBlocks()) {
9249            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9250	           xmlMemBlocks() - mem_base);
9251	    test_ret++;
9252            printf("\n");
9253        }
9254    function_tests++;
9255#endif
9256#endif
9257
9258    return(test_ret);
9259}
9260
9261
9262#define gen_nb_xmlEntitiesTablePtr 1
9263static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9264    return(NULL);
9265}
9266static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9267}
9268
9269static int
9270test_xmlCopyEntitiesTable(void) {
9271    int test_ret = 0;
9272
9273
9274    /* missing type support */
9275    return(test_ret);
9276}
9277
9278
9279static int
9280test_xmlCreateEntitiesTable(void) {
9281    int test_ret = 0;
9282
9283
9284    /* missing type support */
9285    return(test_ret);
9286}
9287
9288
9289static int
9290test_xmlDumpEntitiesTable(void) {
9291    int test_ret = 0;
9292
9293#if defined(LIBXML_OUTPUT_ENABLED)
9294    int mem_base;
9295    xmlBufferPtr buf; /* An XML buffer. */
9296    int n_buf;
9297    xmlEntitiesTablePtr table; /* An entity table */
9298    int n_table;
9299
9300    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9301    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9302        mem_base = xmlMemBlocks();
9303        buf = gen_xmlBufferPtr(n_buf, 0);
9304        table = gen_xmlEntitiesTablePtr(n_table, 1);
9305
9306        xmlDumpEntitiesTable(buf, table);
9307        call_tests++;
9308        des_xmlBufferPtr(n_buf, buf, 0);
9309        des_xmlEntitiesTablePtr(n_table, table, 1);
9310        xmlResetLastError();
9311        if (mem_base != xmlMemBlocks()) {
9312            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9313	           xmlMemBlocks() - mem_base);
9314	    test_ret++;
9315            printf(" %d", n_buf);
9316            printf(" %d", n_table);
9317            printf("\n");
9318        }
9319    }
9320    }
9321    function_tests++;
9322#endif
9323
9324    return(test_ret);
9325}
9326
9327
9328#define gen_nb_xmlEntityPtr 1
9329static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9330    return(NULL);
9331}
9332static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9333}
9334
9335static int
9336test_xmlDumpEntityDecl(void) {
9337    int test_ret = 0;
9338
9339#if defined(LIBXML_OUTPUT_ENABLED)
9340    int mem_base;
9341    xmlBufferPtr buf; /* An XML buffer. */
9342    int n_buf;
9343    xmlEntityPtr ent; /* An entity table */
9344    int n_ent;
9345
9346    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9347    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9348        mem_base = xmlMemBlocks();
9349        buf = gen_xmlBufferPtr(n_buf, 0);
9350        ent = gen_xmlEntityPtr(n_ent, 1);
9351
9352        xmlDumpEntityDecl(buf, ent);
9353        call_tests++;
9354        des_xmlBufferPtr(n_buf, buf, 0);
9355        des_xmlEntityPtr(n_ent, ent, 1);
9356        xmlResetLastError();
9357        if (mem_base != xmlMemBlocks()) {
9358            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9359	           xmlMemBlocks() - mem_base);
9360	    test_ret++;
9361            printf(" %d", n_buf);
9362            printf(" %d", n_ent);
9363            printf("\n");
9364        }
9365    }
9366    }
9367    function_tests++;
9368#endif
9369
9370    return(test_ret);
9371}
9372
9373
9374static int
9375test_xmlEncodeEntitiesReentrant(void) {
9376    int test_ret = 0;
9377
9378    int mem_base;
9379    xmlChar * ret_val;
9380    xmlDocPtr doc; /* the document containing the string */
9381    int n_doc;
9382    xmlChar * input; /* A string to convert to XML. */
9383    int n_input;
9384
9385    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9386    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9387        mem_base = xmlMemBlocks();
9388        doc = gen_xmlDocPtr(n_doc, 0);
9389        input = gen_const_xmlChar_ptr(n_input, 1);
9390
9391        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9392        desret_xmlChar_ptr(ret_val);
9393        call_tests++;
9394        des_xmlDocPtr(n_doc, doc, 0);
9395        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9396        xmlResetLastError();
9397        if (mem_base != xmlMemBlocks()) {
9398            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9399	           xmlMemBlocks() - mem_base);
9400	    test_ret++;
9401            printf(" %d", n_doc);
9402            printf(" %d", n_input);
9403            printf("\n");
9404        }
9405    }
9406    }
9407    function_tests++;
9408
9409    return(test_ret);
9410}
9411
9412
9413static int
9414test_xmlEncodeSpecialChars(void) {
9415    int test_ret = 0;
9416
9417    int mem_base;
9418    xmlChar * ret_val;
9419    xmlDocPtr doc; /* the document containing the string */
9420    int n_doc;
9421    xmlChar * input; /* A string to convert to XML. */
9422    int n_input;
9423
9424    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9425    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9426        mem_base = xmlMemBlocks();
9427        doc = gen_xmlDocPtr(n_doc, 0);
9428        input = gen_const_xmlChar_ptr(n_input, 1);
9429
9430        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9431        desret_xmlChar_ptr(ret_val);
9432        call_tests++;
9433        des_xmlDocPtr(n_doc, doc, 0);
9434        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9435        xmlResetLastError();
9436        if (mem_base != xmlMemBlocks()) {
9437            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9438	           xmlMemBlocks() - mem_base);
9439	    test_ret++;
9440            printf(" %d", n_doc);
9441            printf(" %d", n_input);
9442            printf("\n");
9443        }
9444    }
9445    }
9446    function_tests++;
9447
9448    return(test_ret);
9449}
9450
9451
9452static int
9453test_xmlGetDocEntity(void) {
9454    int test_ret = 0;
9455
9456    int mem_base;
9457    xmlEntityPtr ret_val;
9458    xmlDocPtr doc; /* the document referencing the entity */
9459    int n_doc;
9460    xmlChar * name; /* the entity name */
9461    int n_name;
9462
9463    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9464    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9465        mem_base = xmlMemBlocks();
9466        doc = gen_xmlDocPtr(n_doc, 0);
9467        name = gen_const_xmlChar_ptr(n_name, 1);
9468
9469        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9470        desret_xmlEntityPtr(ret_val);
9471        call_tests++;
9472        des_xmlDocPtr(n_doc, doc, 0);
9473        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9474        xmlResetLastError();
9475        if (mem_base != xmlMemBlocks()) {
9476            printf("Leak of %d blocks found in xmlGetDocEntity",
9477	           xmlMemBlocks() - mem_base);
9478	    test_ret++;
9479            printf(" %d", n_doc);
9480            printf(" %d", n_name);
9481            printf("\n");
9482        }
9483    }
9484    }
9485    function_tests++;
9486
9487    return(test_ret);
9488}
9489
9490
9491static int
9492test_xmlGetDtdEntity(void) {
9493    int test_ret = 0;
9494
9495    int mem_base;
9496    xmlEntityPtr ret_val;
9497    xmlDocPtr doc; /* the document referencing the entity */
9498    int n_doc;
9499    xmlChar * name; /* the entity name */
9500    int n_name;
9501
9502    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9503    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9504        mem_base = xmlMemBlocks();
9505        doc = gen_xmlDocPtr(n_doc, 0);
9506        name = gen_const_xmlChar_ptr(n_name, 1);
9507
9508        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9509        desret_xmlEntityPtr(ret_val);
9510        call_tests++;
9511        des_xmlDocPtr(n_doc, doc, 0);
9512        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9513        xmlResetLastError();
9514        if (mem_base != xmlMemBlocks()) {
9515            printf("Leak of %d blocks found in xmlGetDtdEntity",
9516	           xmlMemBlocks() - mem_base);
9517	    test_ret++;
9518            printf(" %d", n_doc);
9519            printf(" %d", n_name);
9520            printf("\n");
9521        }
9522    }
9523    }
9524    function_tests++;
9525
9526    return(test_ret);
9527}
9528
9529
9530static int
9531test_xmlGetParameterEntity(void) {
9532    int test_ret = 0;
9533
9534    int mem_base;
9535    xmlEntityPtr ret_val;
9536    xmlDocPtr doc; /* the document referencing the entity */
9537    int n_doc;
9538    xmlChar * name; /* the entity name */
9539    int n_name;
9540
9541    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9542    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9543        mem_base = xmlMemBlocks();
9544        doc = gen_xmlDocPtr(n_doc, 0);
9545        name = gen_const_xmlChar_ptr(n_name, 1);
9546
9547        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9548        desret_xmlEntityPtr(ret_val);
9549        call_tests++;
9550        des_xmlDocPtr(n_doc, doc, 0);
9551        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9552        xmlResetLastError();
9553        if (mem_base != xmlMemBlocks()) {
9554            printf("Leak of %d blocks found in xmlGetParameterEntity",
9555	           xmlMemBlocks() - mem_base);
9556	    test_ret++;
9557            printf(" %d", n_doc);
9558            printf(" %d", n_name);
9559            printf("\n");
9560        }
9561    }
9562    }
9563    function_tests++;
9564
9565    return(test_ret);
9566}
9567
9568
9569static int
9570test_xmlGetPredefinedEntity(void) {
9571    int test_ret = 0;
9572
9573    int mem_base;
9574    xmlEntityPtr ret_val;
9575    xmlChar * name; /* the entity name */
9576    int n_name;
9577
9578    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9579        mem_base = xmlMemBlocks();
9580        name = gen_const_xmlChar_ptr(n_name, 0);
9581
9582        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9583        desret_xmlEntityPtr(ret_val);
9584        call_tests++;
9585        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9586        xmlResetLastError();
9587        if (mem_base != xmlMemBlocks()) {
9588            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9589	           xmlMemBlocks() - mem_base);
9590	    test_ret++;
9591            printf(" %d", n_name);
9592            printf("\n");
9593        }
9594    }
9595    function_tests++;
9596
9597    return(test_ret);
9598}
9599
9600
9601static int
9602test_xmlInitializePredefinedEntities(void) {
9603    int test_ret = 0;
9604
9605#if defined(LIBXML_LEGACY_ENABLED)
9606#ifdef LIBXML_LEGACY_ENABLED
9607    int mem_base;
9608
9609        mem_base = xmlMemBlocks();
9610
9611        xmlInitializePredefinedEntities();
9612        call_tests++;
9613        xmlResetLastError();
9614        if (mem_base != xmlMemBlocks()) {
9615            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9616	           xmlMemBlocks() - mem_base);
9617	    test_ret++;
9618            printf("\n");
9619        }
9620    function_tests++;
9621#endif
9622#endif
9623
9624    return(test_ret);
9625}
9626
9627
9628static int
9629test_xmlNewEntity(void) {
9630    int test_ret = 0;
9631
9632    int mem_base;
9633    xmlEntityPtr ret_val;
9634    xmlDocPtr doc; /* the document */
9635    int n_doc;
9636    xmlChar * name; /* the entity name */
9637    int n_name;
9638    int type; /* the entity type XML_xxx_yyy_ENTITY */
9639    int n_type;
9640    xmlChar * ExternalID; /* the entity external ID if available */
9641    int n_ExternalID;
9642    xmlChar * SystemID; /* the entity system ID if available */
9643    int n_SystemID;
9644    xmlChar * content; /* the entity content */
9645    int n_content;
9646
9647    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9648    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9649    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9650    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9651    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9652    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9653        mem_base = xmlMemBlocks();
9654        doc = gen_xmlDocPtr(n_doc, 0);
9655        name = gen_const_xmlChar_ptr(n_name, 1);
9656        type = gen_int(n_type, 2);
9657        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9658        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9659        content = gen_const_xmlChar_ptr(n_content, 5);
9660
9661        ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9662        desret_xmlEntityPtr(ret_val);
9663        call_tests++;
9664        des_xmlDocPtr(n_doc, doc, 0);
9665        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9666        des_int(n_type, type, 2);
9667        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9668        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9669        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9670        xmlResetLastError();
9671        if (mem_base != xmlMemBlocks()) {
9672            printf("Leak of %d blocks found in xmlNewEntity",
9673	           xmlMemBlocks() - mem_base);
9674	    test_ret++;
9675            printf(" %d", n_doc);
9676            printf(" %d", n_name);
9677            printf(" %d", n_type);
9678            printf(" %d", n_ExternalID);
9679            printf(" %d", n_SystemID);
9680            printf(" %d", n_content);
9681            printf("\n");
9682        }
9683    }
9684    }
9685    }
9686    }
9687    }
9688    }
9689    function_tests++;
9690
9691    return(test_ret);
9692}
9693
9694static int
9695test_entities(void) {
9696    int test_ret = 0;
9697
9698    if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9699    test_ret += test_xmlAddDocEntity();
9700    test_ret += test_xmlAddDtdEntity();
9701    test_ret += test_xmlCleanupPredefinedEntities();
9702    test_ret += test_xmlCopyEntitiesTable();
9703    test_ret += test_xmlCreateEntitiesTable();
9704    test_ret += test_xmlDumpEntitiesTable();
9705    test_ret += test_xmlDumpEntityDecl();
9706    test_ret += test_xmlEncodeEntitiesReentrant();
9707    test_ret += test_xmlEncodeSpecialChars();
9708    test_ret += test_xmlGetDocEntity();
9709    test_ret += test_xmlGetDtdEntity();
9710    test_ret += test_xmlGetParameterEntity();
9711    test_ret += test_xmlGetPredefinedEntity();
9712    test_ret += test_xmlInitializePredefinedEntities();
9713    test_ret += test_xmlNewEntity();
9714
9715    if (test_ret != 0)
9716	printf("Module entities: %d errors\n", test_ret);
9717    return(test_ret);
9718}
9719
9720static int
9721test_xmlHashAddEntry(void) {
9722    int test_ret = 0;
9723
9724    int mem_base;
9725    int ret_val;
9726    xmlHashTablePtr table; /* the hash table */
9727    int n_table;
9728    xmlChar * name; /* the name of the userdata */
9729    int n_name;
9730    void * userdata; /* a pointer to the userdata */
9731    int n_userdata;
9732
9733    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9734    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9735    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9736        mem_base = xmlMemBlocks();
9737        table = gen_xmlHashTablePtr(n_table, 0);
9738        name = gen_const_xmlChar_ptr(n_name, 1);
9739        userdata = gen_userdata(n_userdata, 2);
9740
9741        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9742        desret_int(ret_val);
9743        call_tests++;
9744        des_xmlHashTablePtr(n_table, table, 0);
9745        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9746        des_userdata(n_userdata, userdata, 2);
9747        xmlResetLastError();
9748        if (mem_base != xmlMemBlocks()) {
9749            printf("Leak of %d blocks found in xmlHashAddEntry",
9750	           xmlMemBlocks() - mem_base);
9751	    test_ret++;
9752            printf(" %d", n_table);
9753            printf(" %d", n_name);
9754            printf(" %d", n_userdata);
9755            printf("\n");
9756        }
9757    }
9758    }
9759    }
9760    function_tests++;
9761
9762    return(test_ret);
9763}
9764
9765
9766static int
9767test_xmlHashAddEntry2(void) {
9768    int test_ret = 0;
9769
9770    int mem_base;
9771    int ret_val;
9772    xmlHashTablePtr table; /* the hash table */
9773    int n_table;
9774    xmlChar * name; /* the name of the userdata */
9775    int n_name;
9776    xmlChar * name2; /* a second name of the userdata */
9777    int n_name2;
9778    void * userdata; /* a pointer to the userdata */
9779    int n_userdata;
9780
9781    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9782    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9783    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9784    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9785        mem_base = xmlMemBlocks();
9786        table = gen_xmlHashTablePtr(n_table, 0);
9787        name = gen_const_xmlChar_ptr(n_name, 1);
9788        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9789        userdata = gen_userdata(n_userdata, 3);
9790
9791        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9792        desret_int(ret_val);
9793        call_tests++;
9794        des_xmlHashTablePtr(n_table, table, 0);
9795        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9796        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9797        des_userdata(n_userdata, userdata, 3);
9798        xmlResetLastError();
9799        if (mem_base != xmlMemBlocks()) {
9800            printf("Leak of %d blocks found in xmlHashAddEntry2",
9801	           xmlMemBlocks() - mem_base);
9802	    test_ret++;
9803            printf(" %d", n_table);
9804            printf(" %d", n_name);
9805            printf(" %d", n_name2);
9806            printf(" %d", n_userdata);
9807            printf("\n");
9808        }
9809    }
9810    }
9811    }
9812    }
9813    function_tests++;
9814
9815    return(test_ret);
9816}
9817
9818
9819static int
9820test_xmlHashAddEntry3(void) {
9821    int test_ret = 0;
9822
9823    int mem_base;
9824    int ret_val;
9825    xmlHashTablePtr table; /* the hash table */
9826    int n_table;
9827    xmlChar * name; /* the name of the userdata */
9828    int n_name;
9829    xmlChar * name2; /* a second name of the userdata */
9830    int n_name2;
9831    xmlChar * name3; /* a third name of the userdata */
9832    int n_name3;
9833    void * userdata; /* a pointer to the userdata */
9834    int n_userdata;
9835
9836    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9837    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9838    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9839    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9840    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9841        mem_base = xmlMemBlocks();
9842        table = gen_xmlHashTablePtr(n_table, 0);
9843        name = gen_const_xmlChar_ptr(n_name, 1);
9844        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9845        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9846        userdata = gen_userdata(n_userdata, 4);
9847
9848        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9849        desret_int(ret_val);
9850        call_tests++;
9851        des_xmlHashTablePtr(n_table, table, 0);
9852        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9853        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9854        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9855        des_userdata(n_userdata, userdata, 4);
9856        xmlResetLastError();
9857        if (mem_base != xmlMemBlocks()) {
9858            printf("Leak of %d blocks found in xmlHashAddEntry3",
9859	           xmlMemBlocks() - mem_base);
9860	    test_ret++;
9861            printf(" %d", n_table);
9862            printf(" %d", n_name);
9863            printf(" %d", n_name2);
9864            printf(" %d", n_name3);
9865            printf(" %d", n_userdata);
9866            printf("\n");
9867        }
9868    }
9869    }
9870    }
9871    }
9872    }
9873    function_tests++;
9874
9875    return(test_ret);
9876}
9877
9878
9879static int
9880test_xmlHashCopy(void) {
9881    int test_ret = 0;
9882
9883
9884    /* missing type support */
9885    return(test_ret);
9886}
9887
9888
9889static int
9890test_xmlHashCreate(void) {
9891    int test_ret = 0;
9892
9893
9894    /* missing type support */
9895    return(test_ret);
9896}
9897
9898
9899static int
9900test_xmlHashCreateDict(void) {
9901    int test_ret = 0;
9902
9903
9904    /* missing type support */
9905    return(test_ret);
9906}
9907
9908
9909static int
9910test_xmlHashLookup(void) {
9911    int test_ret = 0;
9912
9913    int mem_base;
9914    void * ret_val;
9915    xmlHashTablePtr table; /* the hash table */
9916    int n_table;
9917    xmlChar * name; /* the name of the userdata */
9918    int n_name;
9919
9920    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9921    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9922        mem_base = xmlMemBlocks();
9923        table = gen_xmlHashTablePtr(n_table, 0);
9924        name = gen_const_xmlChar_ptr(n_name, 1);
9925
9926        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9927        desret_void_ptr(ret_val);
9928        call_tests++;
9929        des_xmlHashTablePtr(n_table, table, 0);
9930        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9931        xmlResetLastError();
9932        if (mem_base != xmlMemBlocks()) {
9933            printf("Leak of %d blocks found in xmlHashLookup",
9934	           xmlMemBlocks() - mem_base);
9935	    test_ret++;
9936            printf(" %d", n_table);
9937            printf(" %d", n_name);
9938            printf("\n");
9939        }
9940    }
9941    }
9942    function_tests++;
9943
9944    return(test_ret);
9945}
9946
9947
9948static int
9949test_xmlHashLookup2(void) {
9950    int test_ret = 0;
9951
9952    int mem_base;
9953    void * ret_val;
9954    xmlHashTablePtr table; /* the hash table */
9955    int n_table;
9956    xmlChar * name; /* the name of the userdata */
9957    int n_name;
9958    xmlChar * name2; /* a second name of the userdata */
9959    int n_name2;
9960
9961    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9962    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9963    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9964        mem_base = xmlMemBlocks();
9965        table = gen_xmlHashTablePtr(n_table, 0);
9966        name = gen_const_xmlChar_ptr(n_name, 1);
9967        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9968
9969        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9970        desret_void_ptr(ret_val);
9971        call_tests++;
9972        des_xmlHashTablePtr(n_table, table, 0);
9973        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9974        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9975        xmlResetLastError();
9976        if (mem_base != xmlMemBlocks()) {
9977            printf("Leak of %d blocks found in xmlHashLookup2",
9978	           xmlMemBlocks() - mem_base);
9979	    test_ret++;
9980            printf(" %d", n_table);
9981            printf(" %d", n_name);
9982            printf(" %d", n_name2);
9983            printf("\n");
9984        }
9985    }
9986    }
9987    }
9988    function_tests++;
9989
9990    return(test_ret);
9991}
9992
9993
9994static int
9995test_xmlHashLookup3(void) {
9996    int test_ret = 0;
9997
9998    int mem_base;
9999    void * ret_val;
10000    xmlHashTablePtr table; /* the hash table */
10001    int n_table;
10002    xmlChar * name; /* the name of the userdata */
10003    int n_name;
10004    xmlChar * name2; /* a second name of the userdata */
10005    int n_name2;
10006    xmlChar * name3; /* a third name of the userdata */
10007    int n_name3;
10008
10009    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10010    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10011    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10012    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10013        mem_base = xmlMemBlocks();
10014        table = gen_xmlHashTablePtr(n_table, 0);
10015        name = gen_const_xmlChar_ptr(n_name, 1);
10016        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10017        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10018
10019        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10020        desret_void_ptr(ret_val);
10021        call_tests++;
10022        des_xmlHashTablePtr(n_table, table, 0);
10023        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10024        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10025        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10026        xmlResetLastError();
10027        if (mem_base != xmlMemBlocks()) {
10028            printf("Leak of %d blocks found in xmlHashLookup3",
10029	           xmlMemBlocks() - mem_base);
10030	    test_ret++;
10031            printf(" %d", n_table);
10032            printf(" %d", n_name);
10033            printf(" %d", n_name2);
10034            printf(" %d", n_name3);
10035            printf("\n");
10036        }
10037    }
10038    }
10039    }
10040    }
10041    function_tests++;
10042
10043    return(test_ret);
10044}
10045
10046
10047static int
10048test_xmlHashQLookup(void) {
10049    int test_ret = 0;
10050
10051    int mem_base;
10052    void * ret_val;
10053    xmlHashTablePtr table; /* the hash table */
10054    int n_table;
10055    xmlChar * prefix; /* the prefix of the userdata */
10056    int n_prefix;
10057    xmlChar * name; /* the name of the userdata */
10058    int n_name;
10059
10060    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10061    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10062    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10063        mem_base = xmlMemBlocks();
10064        table = gen_xmlHashTablePtr(n_table, 0);
10065        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10066        name = gen_const_xmlChar_ptr(n_name, 2);
10067
10068        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10069        desret_void_ptr(ret_val);
10070        call_tests++;
10071        des_xmlHashTablePtr(n_table, table, 0);
10072        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10073        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10074        xmlResetLastError();
10075        if (mem_base != xmlMemBlocks()) {
10076            printf("Leak of %d blocks found in xmlHashQLookup",
10077	           xmlMemBlocks() - mem_base);
10078	    test_ret++;
10079            printf(" %d", n_table);
10080            printf(" %d", n_prefix);
10081            printf(" %d", n_name);
10082            printf("\n");
10083        }
10084    }
10085    }
10086    }
10087    function_tests++;
10088
10089    return(test_ret);
10090}
10091
10092
10093static int
10094test_xmlHashQLookup2(void) {
10095    int test_ret = 0;
10096
10097    int mem_base;
10098    void * ret_val;
10099    xmlHashTablePtr table; /* the hash table */
10100    int n_table;
10101    xmlChar * prefix; /* the prefix of the userdata */
10102    int n_prefix;
10103    xmlChar * name; /* the name of the userdata */
10104    int n_name;
10105    xmlChar * prefix2; /* the second prefix of the userdata */
10106    int n_prefix2;
10107    xmlChar * name2; /* a second name of the userdata */
10108    int n_name2;
10109
10110    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10111    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10112    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10113    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10114    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10115        mem_base = xmlMemBlocks();
10116        table = gen_xmlHashTablePtr(n_table, 0);
10117        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10118        name = gen_const_xmlChar_ptr(n_name, 2);
10119        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10120        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10121
10122        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10123        desret_void_ptr(ret_val);
10124        call_tests++;
10125        des_xmlHashTablePtr(n_table, table, 0);
10126        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10127        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10128        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10129        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10130        xmlResetLastError();
10131        if (mem_base != xmlMemBlocks()) {
10132            printf("Leak of %d blocks found in xmlHashQLookup2",
10133	           xmlMemBlocks() - mem_base);
10134	    test_ret++;
10135            printf(" %d", n_table);
10136            printf(" %d", n_prefix);
10137            printf(" %d", n_name);
10138            printf(" %d", n_prefix2);
10139            printf(" %d", n_name2);
10140            printf("\n");
10141        }
10142    }
10143    }
10144    }
10145    }
10146    }
10147    function_tests++;
10148
10149    return(test_ret);
10150}
10151
10152
10153static int
10154test_xmlHashQLookup3(void) {
10155    int test_ret = 0;
10156
10157    int mem_base;
10158    void * ret_val;
10159    xmlHashTablePtr table; /* the hash table */
10160    int n_table;
10161    xmlChar * prefix; /* the prefix of the userdata */
10162    int n_prefix;
10163    xmlChar * name; /* the name of the userdata */
10164    int n_name;
10165    xmlChar * prefix2; /* the second prefix of the userdata */
10166    int n_prefix2;
10167    xmlChar * name2; /* a second name of the userdata */
10168    int n_name2;
10169    xmlChar * prefix3; /* the third prefix of the userdata */
10170    int n_prefix3;
10171    xmlChar * name3; /* a third name of the userdata */
10172    int n_name3;
10173
10174    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10175    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10176    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10177    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10178    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10179    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10180    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10181        mem_base = xmlMemBlocks();
10182        table = gen_xmlHashTablePtr(n_table, 0);
10183        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10184        name = gen_const_xmlChar_ptr(n_name, 2);
10185        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10186        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10187        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10188        name3 = gen_const_xmlChar_ptr(n_name3, 6);
10189
10190        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10191        desret_void_ptr(ret_val);
10192        call_tests++;
10193        des_xmlHashTablePtr(n_table, table, 0);
10194        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10195        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10196        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10197        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10198        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10199        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10200        xmlResetLastError();
10201        if (mem_base != xmlMemBlocks()) {
10202            printf("Leak of %d blocks found in xmlHashQLookup3",
10203	           xmlMemBlocks() - mem_base);
10204	    test_ret++;
10205            printf(" %d", n_table);
10206            printf(" %d", n_prefix);
10207            printf(" %d", n_name);
10208            printf(" %d", n_prefix2);
10209            printf(" %d", n_name2);
10210            printf(" %d", n_prefix3);
10211            printf(" %d", n_name3);
10212            printf("\n");
10213        }
10214    }
10215    }
10216    }
10217    }
10218    }
10219    }
10220    }
10221    function_tests++;
10222
10223    return(test_ret);
10224}
10225
10226
10227static int
10228test_xmlHashRemoveEntry(void) {
10229    int test_ret = 0;
10230
10231    int mem_base;
10232    int ret_val;
10233    xmlHashTablePtr table; /* the hash table */
10234    int n_table;
10235    xmlChar * name; /* the name of the userdata */
10236    int n_name;
10237    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10238    int n_f;
10239
10240    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10241    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10242    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10243        mem_base = xmlMemBlocks();
10244        table = gen_xmlHashTablePtr(n_table, 0);
10245        name = gen_const_xmlChar_ptr(n_name, 1);
10246        f = gen_xmlHashDeallocator(n_f, 2);
10247
10248        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10249        desret_int(ret_val);
10250        call_tests++;
10251        des_xmlHashTablePtr(n_table, table, 0);
10252        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10253        des_xmlHashDeallocator(n_f, f, 2);
10254        xmlResetLastError();
10255        if (mem_base != xmlMemBlocks()) {
10256            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10257	           xmlMemBlocks() - mem_base);
10258	    test_ret++;
10259            printf(" %d", n_table);
10260            printf(" %d", n_name);
10261            printf(" %d", n_f);
10262            printf("\n");
10263        }
10264    }
10265    }
10266    }
10267    function_tests++;
10268
10269    return(test_ret);
10270}
10271
10272
10273static int
10274test_xmlHashRemoveEntry2(void) {
10275    int test_ret = 0;
10276
10277    int mem_base;
10278    int ret_val;
10279    xmlHashTablePtr table; /* the hash table */
10280    int n_table;
10281    xmlChar * name; /* the name of the userdata */
10282    int n_name;
10283    xmlChar * name2; /* a second name of the userdata */
10284    int n_name2;
10285    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10286    int n_f;
10287
10288    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10289    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10290    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10291    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10292        mem_base = xmlMemBlocks();
10293        table = gen_xmlHashTablePtr(n_table, 0);
10294        name = gen_const_xmlChar_ptr(n_name, 1);
10295        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10296        f = gen_xmlHashDeallocator(n_f, 3);
10297
10298        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10299        desret_int(ret_val);
10300        call_tests++;
10301        des_xmlHashTablePtr(n_table, table, 0);
10302        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10303        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10304        des_xmlHashDeallocator(n_f, f, 3);
10305        xmlResetLastError();
10306        if (mem_base != xmlMemBlocks()) {
10307            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10308	           xmlMemBlocks() - mem_base);
10309	    test_ret++;
10310            printf(" %d", n_table);
10311            printf(" %d", n_name);
10312            printf(" %d", n_name2);
10313            printf(" %d", n_f);
10314            printf("\n");
10315        }
10316    }
10317    }
10318    }
10319    }
10320    function_tests++;
10321
10322    return(test_ret);
10323}
10324
10325
10326static int
10327test_xmlHashRemoveEntry3(void) {
10328    int test_ret = 0;
10329
10330    int mem_base;
10331    int ret_val;
10332    xmlHashTablePtr table; /* the hash table */
10333    int n_table;
10334    xmlChar * name; /* the name of the userdata */
10335    int n_name;
10336    xmlChar * name2; /* a second name of the userdata */
10337    int n_name2;
10338    xmlChar * name3; /* a third name of the userdata */
10339    int n_name3;
10340    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10341    int n_f;
10342
10343    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10344    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10345    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10346    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10347    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10348        mem_base = xmlMemBlocks();
10349        table = gen_xmlHashTablePtr(n_table, 0);
10350        name = gen_const_xmlChar_ptr(n_name, 1);
10351        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10352        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10353        f = gen_xmlHashDeallocator(n_f, 4);
10354
10355        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10356        desret_int(ret_val);
10357        call_tests++;
10358        des_xmlHashTablePtr(n_table, table, 0);
10359        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10360        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10361        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10362        des_xmlHashDeallocator(n_f, f, 4);
10363        xmlResetLastError();
10364        if (mem_base != xmlMemBlocks()) {
10365            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10366	           xmlMemBlocks() - mem_base);
10367	    test_ret++;
10368            printf(" %d", n_table);
10369            printf(" %d", n_name);
10370            printf(" %d", n_name2);
10371            printf(" %d", n_name3);
10372            printf(" %d", n_f);
10373            printf("\n");
10374        }
10375    }
10376    }
10377    }
10378    }
10379    }
10380    function_tests++;
10381
10382    return(test_ret);
10383}
10384
10385
10386static int
10387test_xmlHashScan(void) {
10388    int test_ret = 0;
10389
10390
10391    /* missing type support */
10392    return(test_ret);
10393}
10394
10395
10396static int
10397test_xmlHashScan3(void) {
10398    int test_ret = 0;
10399
10400
10401    /* missing type support */
10402    return(test_ret);
10403}
10404
10405
10406static int
10407test_xmlHashScanFull(void) {
10408    int test_ret = 0;
10409
10410
10411    /* missing type support */
10412    return(test_ret);
10413}
10414
10415
10416static int
10417test_xmlHashScanFull3(void) {
10418    int test_ret = 0;
10419
10420
10421    /* missing type support */
10422    return(test_ret);
10423}
10424
10425
10426static int
10427test_xmlHashSize(void) {
10428    int test_ret = 0;
10429
10430    int mem_base;
10431    int ret_val;
10432    xmlHashTablePtr table; /* the hash table */
10433    int n_table;
10434
10435    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10436        mem_base = xmlMemBlocks();
10437        table = gen_xmlHashTablePtr(n_table, 0);
10438
10439        ret_val = xmlHashSize(table);
10440        desret_int(ret_val);
10441        call_tests++;
10442        des_xmlHashTablePtr(n_table, table, 0);
10443        xmlResetLastError();
10444        if (mem_base != xmlMemBlocks()) {
10445            printf("Leak of %d blocks found in xmlHashSize",
10446	           xmlMemBlocks() - mem_base);
10447	    test_ret++;
10448            printf(" %d", n_table);
10449            printf("\n");
10450        }
10451    }
10452    function_tests++;
10453
10454    return(test_ret);
10455}
10456
10457
10458static int
10459test_xmlHashUpdateEntry(void) {
10460    int test_ret = 0;
10461
10462    int mem_base;
10463    int ret_val;
10464    xmlHashTablePtr table; /* the hash table */
10465    int n_table;
10466    xmlChar * name; /* the name of the userdata */
10467    int n_name;
10468    void * userdata; /* a pointer to the userdata */
10469    int n_userdata;
10470    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10471    int n_f;
10472
10473    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10474    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10475    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10476    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10477        mem_base = xmlMemBlocks();
10478        table = gen_xmlHashTablePtr(n_table, 0);
10479        name = gen_const_xmlChar_ptr(n_name, 1);
10480        userdata = gen_userdata(n_userdata, 2);
10481        f = gen_xmlHashDeallocator(n_f, 3);
10482
10483        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10484        desret_int(ret_val);
10485        call_tests++;
10486        des_xmlHashTablePtr(n_table, table, 0);
10487        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10488        des_userdata(n_userdata, userdata, 2);
10489        des_xmlHashDeallocator(n_f, f, 3);
10490        xmlResetLastError();
10491        if (mem_base != xmlMemBlocks()) {
10492            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10493	           xmlMemBlocks() - mem_base);
10494	    test_ret++;
10495            printf(" %d", n_table);
10496            printf(" %d", n_name);
10497            printf(" %d", n_userdata);
10498            printf(" %d", n_f);
10499            printf("\n");
10500        }
10501    }
10502    }
10503    }
10504    }
10505    function_tests++;
10506
10507    return(test_ret);
10508}
10509
10510
10511static int
10512test_xmlHashUpdateEntry2(void) {
10513    int test_ret = 0;
10514
10515    int mem_base;
10516    int ret_val;
10517    xmlHashTablePtr table; /* the hash table */
10518    int n_table;
10519    xmlChar * name; /* the name of the userdata */
10520    int n_name;
10521    xmlChar * name2; /* a second name of the userdata */
10522    int n_name2;
10523    void * userdata; /* a pointer to the userdata */
10524    int n_userdata;
10525    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10526    int n_f;
10527
10528    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10529    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10530    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10531    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10532    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10533        mem_base = xmlMemBlocks();
10534        table = gen_xmlHashTablePtr(n_table, 0);
10535        name = gen_const_xmlChar_ptr(n_name, 1);
10536        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10537        userdata = gen_userdata(n_userdata, 3);
10538        f = gen_xmlHashDeallocator(n_f, 4);
10539
10540        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10541        desret_int(ret_val);
10542        call_tests++;
10543        des_xmlHashTablePtr(n_table, table, 0);
10544        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10545        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10546        des_userdata(n_userdata, userdata, 3);
10547        des_xmlHashDeallocator(n_f, f, 4);
10548        xmlResetLastError();
10549        if (mem_base != xmlMemBlocks()) {
10550            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10551	           xmlMemBlocks() - mem_base);
10552	    test_ret++;
10553            printf(" %d", n_table);
10554            printf(" %d", n_name);
10555            printf(" %d", n_name2);
10556            printf(" %d", n_userdata);
10557            printf(" %d", n_f);
10558            printf("\n");
10559        }
10560    }
10561    }
10562    }
10563    }
10564    }
10565    function_tests++;
10566
10567    return(test_ret);
10568}
10569
10570
10571static int
10572test_xmlHashUpdateEntry3(void) {
10573    int test_ret = 0;
10574
10575    int mem_base;
10576    int ret_val;
10577    xmlHashTablePtr table; /* the hash table */
10578    int n_table;
10579    xmlChar * name; /* the name of the userdata */
10580    int n_name;
10581    xmlChar * name2; /* a second name of the userdata */
10582    int n_name2;
10583    xmlChar * name3; /* a third name of the userdata */
10584    int n_name3;
10585    void * userdata; /* a pointer to the userdata */
10586    int n_userdata;
10587    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10588    int n_f;
10589
10590    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10591    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10592    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10593    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10594    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10595    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10596        mem_base = xmlMemBlocks();
10597        table = gen_xmlHashTablePtr(n_table, 0);
10598        name = gen_const_xmlChar_ptr(n_name, 1);
10599        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10600        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10601        userdata = gen_userdata(n_userdata, 4);
10602        f = gen_xmlHashDeallocator(n_f, 5);
10603
10604        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10605        desret_int(ret_val);
10606        call_tests++;
10607        des_xmlHashTablePtr(n_table, table, 0);
10608        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10609        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10610        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10611        des_userdata(n_userdata, userdata, 4);
10612        des_xmlHashDeallocator(n_f, f, 5);
10613        xmlResetLastError();
10614        if (mem_base != xmlMemBlocks()) {
10615            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10616	           xmlMemBlocks() - mem_base);
10617	    test_ret++;
10618            printf(" %d", n_table);
10619            printf(" %d", n_name);
10620            printf(" %d", n_name2);
10621            printf(" %d", n_name3);
10622            printf(" %d", n_userdata);
10623            printf(" %d", n_f);
10624            printf("\n");
10625        }
10626    }
10627    }
10628    }
10629    }
10630    }
10631    }
10632    function_tests++;
10633
10634    return(test_ret);
10635}
10636
10637static int
10638test_hash(void) {
10639    int test_ret = 0;
10640
10641    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10642    test_ret += test_xmlHashAddEntry();
10643    test_ret += test_xmlHashAddEntry2();
10644    test_ret += test_xmlHashAddEntry3();
10645    test_ret += test_xmlHashCopy();
10646    test_ret += test_xmlHashCreate();
10647    test_ret += test_xmlHashCreateDict();
10648    test_ret += test_xmlHashLookup();
10649    test_ret += test_xmlHashLookup2();
10650    test_ret += test_xmlHashLookup3();
10651    test_ret += test_xmlHashQLookup();
10652    test_ret += test_xmlHashQLookup2();
10653    test_ret += test_xmlHashQLookup3();
10654    test_ret += test_xmlHashRemoveEntry();
10655    test_ret += test_xmlHashRemoveEntry2();
10656    test_ret += test_xmlHashRemoveEntry3();
10657    test_ret += test_xmlHashScan();
10658    test_ret += test_xmlHashScan3();
10659    test_ret += test_xmlHashScanFull();
10660    test_ret += test_xmlHashScanFull3();
10661    test_ret += test_xmlHashSize();
10662    test_ret += test_xmlHashUpdateEntry();
10663    test_ret += test_xmlHashUpdateEntry2();
10664    test_ret += test_xmlHashUpdateEntry3();
10665
10666    if (test_ret != 0)
10667	printf("Module hash: %d errors\n", test_ret);
10668    return(test_ret);
10669}
10670
10671#define gen_nb_xmlLinkPtr 1
10672static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10673    return(NULL);
10674}
10675static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10676}
10677
10678static int
10679test_xmlLinkGetData(void) {
10680    int test_ret = 0;
10681
10682    int mem_base;
10683    void * ret_val;
10684    xmlLinkPtr lk; /* a link */
10685    int n_lk;
10686
10687    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10688        mem_base = xmlMemBlocks();
10689        lk = gen_xmlLinkPtr(n_lk, 0);
10690
10691        ret_val = xmlLinkGetData(lk);
10692        desret_void_ptr(ret_val);
10693        call_tests++;
10694        des_xmlLinkPtr(n_lk, lk, 0);
10695        xmlResetLastError();
10696        if (mem_base != xmlMemBlocks()) {
10697            printf("Leak of %d blocks found in xmlLinkGetData",
10698	           xmlMemBlocks() - mem_base);
10699	    test_ret++;
10700            printf(" %d", n_lk);
10701            printf("\n");
10702        }
10703    }
10704    function_tests++;
10705
10706    return(test_ret);
10707}
10708
10709
10710static int
10711test_xmlListAppend(void) {
10712    int test_ret = 0;
10713
10714    int mem_base;
10715    int ret_val;
10716    xmlListPtr l; /* a list */
10717    int n_l;
10718    void * data; /* the data */
10719    int n_data;
10720
10721    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10722    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10723        mem_base = xmlMemBlocks();
10724        l = gen_xmlListPtr(n_l, 0);
10725        data = gen_userdata(n_data, 1);
10726
10727        ret_val = xmlListAppend(l, data);
10728        desret_int(ret_val);
10729        call_tests++;
10730        des_xmlListPtr(n_l, l, 0);
10731        des_userdata(n_data, data, 1);
10732        xmlResetLastError();
10733        if (mem_base != xmlMemBlocks()) {
10734            printf("Leak of %d blocks found in xmlListAppend",
10735	           xmlMemBlocks() - mem_base);
10736	    test_ret++;
10737            printf(" %d", n_l);
10738            printf(" %d", n_data);
10739            printf("\n");
10740        }
10741    }
10742    }
10743    function_tests++;
10744
10745    return(test_ret);
10746}
10747
10748
10749static int
10750test_xmlListClear(void) {
10751    int test_ret = 0;
10752
10753    int mem_base;
10754    xmlListPtr l; /* a list */
10755    int n_l;
10756
10757    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10758        mem_base = xmlMemBlocks();
10759        l = gen_xmlListPtr(n_l, 0);
10760
10761        xmlListClear(l);
10762        call_tests++;
10763        des_xmlListPtr(n_l, l, 0);
10764        xmlResetLastError();
10765        if (mem_base != xmlMemBlocks()) {
10766            printf("Leak of %d blocks found in xmlListClear",
10767	           xmlMemBlocks() - mem_base);
10768	    test_ret++;
10769            printf(" %d", n_l);
10770            printf("\n");
10771        }
10772    }
10773    function_tests++;
10774
10775    return(test_ret);
10776}
10777
10778
10779#define gen_nb_const_xmlListPtr 1
10780static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10781    return(NULL);
10782}
10783static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10784}
10785
10786static int
10787test_xmlListCopy(void) {
10788    int test_ret = 0;
10789
10790    int mem_base;
10791    int ret_val;
10792    xmlListPtr cur; /* the new list */
10793    int n_cur;
10794    xmlListPtr old; /* the old list */
10795    int n_old;
10796
10797    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10798    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10799        mem_base = xmlMemBlocks();
10800        cur = gen_xmlListPtr(n_cur, 0);
10801        old = gen_const_xmlListPtr(n_old, 1);
10802
10803        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10804        desret_int(ret_val);
10805        call_tests++;
10806        des_xmlListPtr(n_cur, cur, 0);
10807        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10808        xmlResetLastError();
10809        if (mem_base != xmlMemBlocks()) {
10810            printf("Leak of %d blocks found in xmlListCopy",
10811	           xmlMemBlocks() - mem_base);
10812	    test_ret++;
10813            printf(" %d", n_cur);
10814            printf(" %d", n_old);
10815            printf("\n");
10816        }
10817    }
10818    }
10819    function_tests++;
10820
10821    return(test_ret);
10822}
10823
10824
10825static int
10826test_xmlListCreate(void) {
10827    int test_ret = 0;
10828
10829
10830    /* missing type support */
10831    return(test_ret);
10832}
10833
10834
10835static int
10836test_xmlListDup(void) {
10837    int test_ret = 0;
10838
10839
10840    /* missing type support */
10841    return(test_ret);
10842}
10843
10844
10845static int
10846test_xmlListEmpty(void) {
10847    int test_ret = 0;
10848
10849    int mem_base;
10850    int ret_val;
10851    xmlListPtr l; /* a list */
10852    int n_l;
10853
10854    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10855        mem_base = xmlMemBlocks();
10856        l = gen_xmlListPtr(n_l, 0);
10857
10858        ret_val = xmlListEmpty(l);
10859        desret_int(ret_val);
10860        call_tests++;
10861        des_xmlListPtr(n_l, l, 0);
10862        xmlResetLastError();
10863        if (mem_base != xmlMemBlocks()) {
10864            printf("Leak of %d blocks found in xmlListEmpty",
10865	           xmlMemBlocks() - mem_base);
10866	    test_ret++;
10867            printf(" %d", n_l);
10868            printf("\n");
10869        }
10870    }
10871    function_tests++;
10872
10873    return(test_ret);
10874}
10875
10876
10877static int
10878test_xmlListEnd(void) {
10879    int test_ret = 0;
10880
10881
10882    /* missing type support */
10883    return(test_ret);
10884}
10885
10886
10887static int
10888test_xmlListFront(void) {
10889    int test_ret = 0;
10890
10891
10892    /* missing type support */
10893    return(test_ret);
10894}
10895
10896
10897static int
10898test_xmlListInsert(void) {
10899    int test_ret = 0;
10900
10901    int mem_base;
10902    int ret_val;
10903    xmlListPtr l; /* a list */
10904    int n_l;
10905    void * data; /* the data */
10906    int n_data;
10907
10908    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10909    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10910        mem_base = xmlMemBlocks();
10911        l = gen_xmlListPtr(n_l, 0);
10912        data = gen_userdata(n_data, 1);
10913
10914        ret_val = xmlListInsert(l, data);
10915        desret_int(ret_val);
10916        call_tests++;
10917        des_xmlListPtr(n_l, l, 0);
10918        des_userdata(n_data, data, 1);
10919        xmlResetLastError();
10920        if (mem_base != xmlMemBlocks()) {
10921            printf("Leak of %d blocks found in xmlListInsert",
10922	           xmlMemBlocks() - mem_base);
10923	    test_ret++;
10924            printf(" %d", n_l);
10925            printf(" %d", n_data);
10926            printf("\n");
10927        }
10928    }
10929    }
10930    function_tests++;
10931
10932    return(test_ret);
10933}
10934
10935
10936static int
10937test_xmlListMerge(void) {
10938    int test_ret = 0;
10939
10940    int mem_base;
10941    xmlListPtr l1; /* the original list */
10942    int n_l1;
10943    xmlListPtr l2; /* the new list */
10944    int n_l2;
10945
10946    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10947    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10948        mem_base = xmlMemBlocks();
10949        l1 = gen_xmlListPtr(n_l1, 0);
10950        l2 = gen_xmlListPtr(n_l2, 1);
10951
10952        xmlListMerge(l1, l2);
10953        call_tests++;
10954        des_xmlListPtr(n_l1, l1, 0);
10955        des_xmlListPtr(n_l2, l2, 1);
10956        xmlResetLastError();
10957        if (mem_base != xmlMemBlocks()) {
10958            printf("Leak of %d blocks found in xmlListMerge",
10959	           xmlMemBlocks() - mem_base);
10960	    test_ret++;
10961            printf(" %d", n_l1);
10962            printf(" %d", n_l2);
10963            printf("\n");
10964        }
10965    }
10966    }
10967    function_tests++;
10968
10969    return(test_ret);
10970}
10971
10972
10973static int
10974test_xmlListPopBack(void) {
10975    int test_ret = 0;
10976
10977    int mem_base;
10978    xmlListPtr l; /* a list */
10979    int n_l;
10980
10981    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10982        mem_base = xmlMemBlocks();
10983        l = gen_xmlListPtr(n_l, 0);
10984
10985        xmlListPopBack(l);
10986        call_tests++;
10987        des_xmlListPtr(n_l, l, 0);
10988        xmlResetLastError();
10989        if (mem_base != xmlMemBlocks()) {
10990            printf("Leak of %d blocks found in xmlListPopBack",
10991	           xmlMemBlocks() - mem_base);
10992	    test_ret++;
10993            printf(" %d", n_l);
10994            printf("\n");
10995        }
10996    }
10997    function_tests++;
10998
10999    return(test_ret);
11000}
11001
11002
11003static int
11004test_xmlListPopFront(void) {
11005    int test_ret = 0;
11006
11007    int mem_base;
11008    xmlListPtr l; /* a list */
11009    int n_l;
11010
11011    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11012        mem_base = xmlMemBlocks();
11013        l = gen_xmlListPtr(n_l, 0);
11014
11015        xmlListPopFront(l);
11016        call_tests++;
11017        des_xmlListPtr(n_l, l, 0);
11018        xmlResetLastError();
11019        if (mem_base != xmlMemBlocks()) {
11020            printf("Leak of %d blocks found in xmlListPopFront",
11021	           xmlMemBlocks() - mem_base);
11022	    test_ret++;
11023            printf(" %d", n_l);
11024            printf("\n");
11025        }
11026    }
11027    function_tests++;
11028
11029    return(test_ret);
11030}
11031
11032
11033static int
11034test_xmlListPushBack(void) {
11035    int test_ret = 0;
11036
11037    int mem_base;
11038    int ret_val;
11039    xmlListPtr l; /* a list */
11040    int n_l;
11041    void * data; /* new data */
11042    int n_data;
11043
11044    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11045    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11046        mem_base = xmlMemBlocks();
11047        l = gen_xmlListPtr(n_l, 0);
11048        data = gen_userdata(n_data, 1);
11049
11050        ret_val = xmlListPushBack(l, data);
11051        desret_int(ret_val);
11052        call_tests++;
11053        des_xmlListPtr(n_l, l, 0);
11054        des_userdata(n_data, data, 1);
11055        xmlResetLastError();
11056        if (mem_base != xmlMemBlocks()) {
11057            printf("Leak of %d blocks found in xmlListPushBack",
11058	           xmlMemBlocks() - mem_base);
11059	    test_ret++;
11060            printf(" %d", n_l);
11061            printf(" %d", n_data);
11062            printf("\n");
11063        }
11064    }
11065    }
11066    function_tests++;
11067
11068    return(test_ret);
11069}
11070
11071
11072static int
11073test_xmlListPushFront(void) {
11074    int test_ret = 0;
11075
11076    int mem_base;
11077    int ret_val;
11078    xmlListPtr l; /* a list */
11079    int n_l;
11080    void * data; /* new data */
11081    int n_data;
11082
11083    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11084    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11085        mem_base = xmlMemBlocks();
11086        l = gen_xmlListPtr(n_l, 0);
11087        data = gen_userdata(n_data, 1);
11088
11089        ret_val = xmlListPushFront(l, data);
11090        desret_int(ret_val);
11091        call_tests++;
11092        des_xmlListPtr(n_l, l, 0);
11093        des_userdata(n_data, data, 1);
11094        xmlResetLastError();
11095        if (mem_base != xmlMemBlocks()) {
11096            printf("Leak of %d blocks found in xmlListPushFront",
11097	           xmlMemBlocks() - mem_base);
11098	    test_ret++;
11099            printf(" %d", n_l);
11100            printf(" %d", n_data);
11101            printf("\n");
11102        }
11103    }
11104    }
11105    function_tests++;
11106
11107    return(test_ret);
11108}
11109
11110
11111static int
11112test_xmlListRemoveAll(void) {
11113    int test_ret = 0;
11114
11115    int mem_base;
11116    int ret_val;
11117    xmlListPtr l; /* a list */
11118    int n_l;
11119    void * data; /* list data */
11120    int n_data;
11121
11122    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11123    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11124        mem_base = xmlMemBlocks();
11125        l = gen_xmlListPtr(n_l, 0);
11126        data = gen_userdata(n_data, 1);
11127
11128        ret_val = xmlListRemoveAll(l, data);
11129        desret_int(ret_val);
11130        call_tests++;
11131        des_xmlListPtr(n_l, l, 0);
11132        des_userdata(n_data, data, 1);
11133        xmlResetLastError();
11134        if (mem_base != xmlMemBlocks()) {
11135            printf("Leak of %d blocks found in xmlListRemoveAll",
11136	           xmlMemBlocks() - mem_base);
11137	    test_ret++;
11138            printf(" %d", n_l);
11139            printf(" %d", n_data);
11140            printf("\n");
11141        }
11142    }
11143    }
11144    function_tests++;
11145
11146    return(test_ret);
11147}
11148
11149
11150static int
11151test_xmlListRemoveFirst(void) {
11152    int test_ret = 0;
11153
11154    int mem_base;
11155    int ret_val;
11156    xmlListPtr l; /* a list */
11157    int n_l;
11158    void * data; /* list data */
11159    int n_data;
11160
11161    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11162    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11163        mem_base = xmlMemBlocks();
11164        l = gen_xmlListPtr(n_l, 0);
11165        data = gen_userdata(n_data, 1);
11166
11167        ret_val = xmlListRemoveFirst(l, data);
11168        desret_int(ret_val);
11169        call_tests++;
11170        des_xmlListPtr(n_l, l, 0);
11171        des_userdata(n_data, data, 1);
11172        xmlResetLastError();
11173        if (mem_base != xmlMemBlocks()) {
11174            printf("Leak of %d blocks found in xmlListRemoveFirst",
11175	           xmlMemBlocks() - mem_base);
11176	    test_ret++;
11177            printf(" %d", n_l);
11178            printf(" %d", n_data);
11179            printf("\n");
11180        }
11181    }
11182    }
11183    function_tests++;
11184
11185    return(test_ret);
11186}
11187
11188
11189static int
11190test_xmlListRemoveLast(void) {
11191    int test_ret = 0;
11192
11193    int mem_base;
11194    int ret_val;
11195    xmlListPtr l; /* a list */
11196    int n_l;
11197    void * data; /* list data */
11198    int n_data;
11199
11200    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11201    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11202        mem_base = xmlMemBlocks();
11203        l = gen_xmlListPtr(n_l, 0);
11204        data = gen_userdata(n_data, 1);
11205
11206        ret_val = xmlListRemoveLast(l, data);
11207        desret_int(ret_val);
11208        call_tests++;
11209        des_xmlListPtr(n_l, l, 0);
11210        des_userdata(n_data, data, 1);
11211        xmlResetLastError();
11212        if (mem_base != xmlMemBlocks()) {
11213            printf("Leak of %d blocks found in xmlListRemoveLast",
11214	           xmlMemBlocks() - mem_base);
11215	    test_ret++;
11216            printf(" %d", n_l);
11217            printf(" %d", n_data);
11218            printf("\n");
11219        }
11220    }
11221    }
11222    function_tests++;
11223
11224    return(test_ret);
11225}
11226
11227
11228static int
11229test_xmlListReverse(void) {
11230    int test_ret = 0;
11231
11232    int mem_base;
11233    xmlListPtr l; /* a list */
11234    int n_l;
11235
11236    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11237        mem_base = xmlMemBlocks();
11238        l = gen_xmlListPtr(n_l, 0);
11239
11240        xmlListReverse(l);
11241        call_tests++;
11242        des_xmlListPtr(n_l, l, 0);
11243        xmlResetLastError();
11244        if (mem_base != xmlMemBlocks()) {
11245            printf("Leak of %d blocks found in xmlListReverse",
11246	           xmlMemBlocks() - mem_base);
11247	    test_ret++;
11248            printf(" %d", n_l);
11249            printf("\n");
11250        }
11251    }
11252    function_tests++;
11253
11254    return(test_ret);
11255}
11256
11257
11258static int
11259test_xmlListReverseSearch(void) {
11260    int test_ret = 0;
11261
11262    int mem_base;
11263    void * ret_val;
11264    xmlListPtr l; /* a list */
11265    int n_l;
11266    void * data; /* a search value */
11267    int n_data;
11268
11269    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11270    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11271        mem_base = xmlMemBlocks();
11272        l = gen_xmlListPtr(n_l, 0);
11273        data = gen_userdata(n_data, 1);
11274
11275        ret_val = xmlListReverseSearch(l, data);
11276        desret_void_ptr(ret_val);
11277        call_tests++;
11278        des_xmlListPtr(n_l, l, 0);
11279        des_userdata(n_data, data, 1);
11280        xmlResetLastError();
11281        if (mem_base != xmlMemBlocks()) {
11282            printf("Leak of %d blocks found in xmlListReverseSearch",
11283	           xmlMemBlocks() - mem_base);
11284	    test_ret++;
11285            printf(" %d", n_l);
11286            printf(" %d", n_data);
11287            printf("\n");
11288        }
11289    }
11290    }
11291    function_tests++;
11292
11293    return(test_ret);
11294}
11295
11296
11297static int
11298test_xmlListReverseWalk(void) {
11299    int test_ret = 0;
11300
11301
11302    /* missing type support */
11303    return(test_ret);
11304}
11305
11306
11307static int
11308test_xmlListSearch(void) {
11309    int test_ret = 0;
11310
11311    int mem_base;
11312    void * ret_val;
11313    xmlListPtr l; /* a list */
11314    int n_l;
11315    void * data; /* a search value */
11316    int n_data;
11317
11318    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11319    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11320        mem_base = xmlMemBlocks();
11321        l = gen_xmlListPtr(n_l, 0);
11322        data = gen_userdata(n_data, 1);
11323
11324        ret_val = xmlListSearch(l, data);
11325        desret_void_ptr(ret_val);
11326        call_tests++;
11327        des_xmlListPtr(n_l, l, 0);
11328        des_userdata(n_data, data, 1);
11329        xmlResetLastError();
11330        if (mem_base != xmlMemBlocks()) {
11331            printf("Leak of %d blocks found in xmlListSearch",
11332	           xmlMemBlocks() - mem_base);
11333	    test_ret++;
11334            printf(" %d", n_l);
11335            printf(" %d", n_data);
11336            printf("\n");
11337        }
11338    }
11339    }
11340    function_tests++;
11341
11342    return(test_ret);
11343}
11344
11345
11346static int
11347test_xmlListSize(void) {
11348    int test_ret = 0;
11349
11350    int mem_base;
11351    int ret_val;
11352    xmlListPtr l; /* a list */
11353    int n_l;
11354
11355    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11356        mem_base = xmlMemBlocks();
11357        l = gen_xmlListPtr(n_l, 0);
11358
11359        ret_val = xmlListSize(l);
11360        desret_int(ret_val);
11361        call_tests++;
11362        des_xmlListPtr(n_l, l, 0);
11363        xmlResetLastError();
11364        if (mem_base != xmlMemBlocks()) {
11365            printf("Leak of %d blocks found in xmlListSize",
11366	           xmlMemBlocks() - mem_base);
11367	    test_ret++;
11368            printf(" %d", n_l);
11369            printf("\n");
11370        }
11371    }
11372    function_tests++;
11373
11374    return(test_ret);
11375}
11376
11377
11378static int
11379test_xmlListSort(void) {
11380    int test_ret = 0;
11381
11382    int mem_base;
11383    xmlListPtr l; /* a list */
11384    int n_l;
11385
11386    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11387        mem_base = xmlMemBlocks();
11388        l = gen_xmlListPtr(n_l, 0);
11389
11390        xmlListSort(l);
11391        call_tests++;
11392        des_xmlListPtr(n_l, l, 0);
11393        xmlResetLastError();
11394        if (mem_base != xmlMemBlocks()) {
11395            printf("Leak of %d blocks found in xmlListSort",
11396	           xmlMemBlocks() - mem_base);
11397	    test_ret++;
11398            printf(" %d", n_l);
11399            printf("\n");
11400        }
11401    }
11402    function_tests++;
11403
11404    return(test_ret);
11405}
11406
11407
11408static int
11409test_xmlListWalk(void) {
11410    int test_ret = 0;
11411
11412
11413    /* missing type support */
11414    return(test_ret);
11415}
11416
11417static int
11418test_list(void) {
11419    int test_ret = 0;
11420
11421    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11422    test_ret += test_xmlLinkGetData();
11423    test_ret += test_xmlListAppend();
11424    test_ret += test_xmlListClear();
11425    test_ret += test_xmlListCopy();
11426    test_ret += test_xmlListCreate();
11427    test_ret += test_xmlListDup();
11428    test_ret += test_xmlListEmpty();
11429    test_ret += test_xmlListEnd();
11430    test_ret += test_xmlListFront();
11431    test_ret += test_xmlListInsert();
11432    test_ret += test_xmlListMerge();
11433    test_ret += test_xmlListPopBack();
11434    test_ret += test_xmlListPopFront();
11435    test_ret += test_xmlListPushBack();
11436    test_ret += test_xmlListPushFront();
11437    test_ret += test_xmlListRemoveAll();
11438    test_ret += test_xmlListRemoveFirst();
11439    test_ret += test_xmlListRemoveLast();
11440    test_ret += test_xmlListReverse();
11441    test_ret += test_xmlListReverseSearch();
11442    test_ret += test_xmlListReverseWalk();
11443    test_ret += test_xmlListSearch();
11444    test_ret += test_xmlListSize();
11445    test_ret += test_xmlListSort();
11446    test_ret += test_xmlListWalk();
11447
11448    if (test_ret != 0)
11449	printf("Module list: %d errors\n", test_ret);
11450    return(test_ret);
11451}
11452
11453static int
11454test_xmlNanoFTPCheckResponse(void) {
11455    int test_ret = 0;
11456
11457#if defined(LIBXML_FTP_ENABLED)
11458    int mem_base;
11459    int ret_val;
11460    void * ctx; /* an FTP context */
11461    int n_ctx;
11462
11463    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11464        mem_base = xmlMemBlocks();
11465        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11466
11467        ret_val = xmlNanoFTPCheckResponse(ctx);
11468        desret_int(ret_val);
11469        call_tests++;
11470        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11471        xmlResetLastError();
11472        if (mem_base != xmlMemBlocks()) {
11473            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11474	           xmlMemBlocks() - mem_base);
11475	    test_ret++;
11476            printf(" %d", n_ctx);
11477            printf("\n");
11478        }
11479    }
11480    function_tests++;
11481#endif
11482
11483    return(test_ret);
11484}
11485
11486
11487static int
11488test_xmlNanoFTPCleanup(void) {
11489    int test_ret = 0;
11490
11491#if defined(LIBXML_FTP_ENABLED)
11492    int mem_base;
11493
11494        mem_base = xmlMemBlocks();
11495
11496        xmlNanoFTPCleanup();
11497        call_tests++;
11498        xmlResetLastError();
11499        if (mem_base != xmlMemBlocks()) {
11500            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11501	           xmlMemBlocks() - mem_base);
11502	    test_ret++;
11503            printf("\n");
11504        }
11505    function_tests++;
11506#endif
11507
11508    return(test_ret);
11509}
11510
11511
11512static int
11513test_xmlNanoFTPCloseConnection(void) {
11514    int test_ret = 0;
11515
11516#if defined(LIBXML_FTP_ENABLED)
11517    int mem_base;
11518    int ret_val;
11519    void * ctx; /* an FTP context */
11520    int n_ctx;
11521
11522    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11523        mem_base = xmlMemBlocks();
11524        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11525
11526        ret_val = xmlNanoFTPCloseConnection(ctx);
11527        desret_int(ret_val);
11528        call_tests++;
11529        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11530        xmlResetLastError();
11531        if (mem_base != xmlMemBlocks()) {
11532            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11533	           xmlMemBlocks() - mem_base);
11534	    test_ret++;
11535            printf(" %d", n_ctx);
11536            printf("\n");
11537        }
11538    }
11539    function_tests++;
11540#endif
11541
11542    return(test_ret);
11543}
11544
11545
11546static int
11547test_xmlNanoFTPCwd(void) {
11548    int test_ret = 0;
11549
11550#if defined(LIBXML_FTP_ENABLED)
11551    int mem_base;
11552    int ret_val;
11553    void * ctx; /* an FTP context */
11554    int n_ctx;
11555    char * directory; /* a directory on the server */
11556    int n_directory;
11557
11558    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11559    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11560        mem_base = xmlMemBlocks();
11561        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11562        directory = gen_const_char_ptr(n_directory, 1);
11563
11564        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11565        desret_int(ret_val);
11566        call_tests++;
11567        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11568        des_const_char_ptr(n_directory, (const char *)directory, 1);
11569        xmlResetLastError();
11570        if (mem_base != xmlMemBlocks()) {
11571            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11572	           xmlMemBlocks() - mem_base);
11573	    test_ret++;
11574            printf(" %d", n_ctx);
11575            printf(" %d", n_directory);
11576            printf("\n");
11577        }
11578    }
11579    }
11580    function_tests++;
11581#endif
11582
11583    return(test_ret);
11584}
11585
11586
11587static int
11588test_xmlNanoFTPDele(void) {
11589    int test_ret = 0;
11590
11591#if defined(LIBXML_FTP_ENABLED)
11592    int mem_base;
11593    int ret_val;
11594    void * ctx; /* an FTP context */
11595    int n_ctx;
11596    const char * file; /* a file or directory on the server */
11597    int n_file;
11598
11599    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11600    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11601        mem_base = xmlMemBlocks();
11602        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11603        file = gen_filepath(n_file, 1);
11604
11605        ret_val = xmlNanoFTPDele(ctx, file);
11606        desret_int(ret_val);
11607        call_tests++;
11608        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11609        des_filepath(n_file, file, 1);
11610        xmlResetLastError();
11611        if (mem_base != xmlMemBlocks()) {
11612            printf("Leak of %d blocks found in xmlNanoFTPDele",
11613	           xmlMemBlocks() - mem_base);
11614	    test_ret++;
11615            printf(" %d", n_ctx);
11616            printf(" %d", n_file);
11617            printf("\n");
11618        }
11619    }
11620    }
11621    function_tests++;
11622#endif
11623
11624    return(test_ret);
11625}
11626
11627
11628static int
11629test_xmlNanoFTPGet(void) {
11630    int test_ret = 0;
11631
11632
11633    /* missing type support */
11634    return(test_ret);
11635}
11636
11637
11638static int
11639test_xmlNanoFTPGetConnection(void) {
11640    int test_ret = 0;
11641
11642#if defined(LIBXML_FTP_ENABLED)
11643    int mem_base;
11644    int ret_val;
11645    void * ctx; /* an FTP context */
11646    int n_ctx;
11647
11648    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11649        mem_base = xmlMemBlocks();
11650        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11651
11652        ret_val = xmlNanoFTPGetConnection(ctx);
11653        desret_int(ret_val);
11654        call_tests++;
11655        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11656        xmlResetLastError();
11657        if (mem_base != xmlMemBlocks()) {
11658            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11659	           xmlMemBlocks() - mem_base);
11660	    test_ret++;
11661            printf(" %d", n_ctx);
11662            printf("\n");
11663        }
11664    }
11665    function_tests++;
11666#endif
11667
11668    return(test_ret);
11669}
11670
11671
11672static int
11673test_xmlNanoFTPGetResponse(void) {
11674    int test_ret = 0;
11675
11676#if defined(LIBXML_FTP_ENABLED)
11677    int mem_base;
11678    int ret_val;
11679    void * ctx; /* an FTP context */
11680    int n_ctx;
11681
11682    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11683        mem_base = xmlMemBlocks();
11684        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11685
11686        ret_val = xmlNanoFTPGetResponse(ctx);
11687        desret_int(ret_val);
11688        call_tests++;
11689        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11690        xmlResetLastError();
11691        if (mem_base != xmlMemBlocks()) {
11692            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11693	           xmlMemBlocks() - mem_base);
11694	    test_ret++;
11695            printf(" %d", n_ctx);
11696            printf("\n");
11697        }
11698    }
11699    function_tests++;
11700#endif
11701
11702    return(test_ret);
11703}
11704
11705
11706static int
11707test_xmlNanoFTPGetSocket(void) {
11708    int test_ret = 0;
11709
11710#if defined(LIBXML_FTP_ENABLED)
11711    int mem_base;
11712    int ret_val;
11713    void * ctx; /* an FTP context */
11714    int n_ctx;
11715    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11716    int n_filename;
11717
11718    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11719    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11720        mem_base = xmlMemBlocks();
11721        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11722        filename = gen_filepath(n_filename, 1);
11723
11724        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11725        desret_int(ret_val);
11726        call_tests++;
11727        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11728        des_filepath(n_filename, filename, 1);
11729        xmlResetLastError();
11730        if (mem_base != xmlMemBlocks()) {
11731            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11732	           xmlMemBlocks() - mem_base);
11733	    test_ret++;
11734            printf(" %d", n_ctx);
11735            printf(" %d", n_filename);
11736            printf("\n");
11737        }
11738    }
11739    }
11740    function_tests++;
11741#endif
11742
11743    return(test_ret);
11744}
11745
11746
11747static int
11748test_xmlNanoFTPInit(void) {
11749    int test_ret = 0;
11750
11751#if defined(LIBXML_FTP_ENABLED)
11752    int mem_base;
11753
11754        mem_base = xmlMemBlocks();
11755
11756        xmlNanoFTPInit();
11757        call_tests++;
11758        xmlResetLastError();
11759        if (mem_base != xmlMemBlocks()) {
11760            printf("Leak of %d blocks found in xmlNanoFTPInit",
11761	           xmlMemBlocks() - mem_base);
11762	    test_ret++;
11763            printf("\n");
11764        }
11765    function_tests++;
11766#endif
11767
11768    return(test_ret);
11769}
11770
11771
11772static int
11773test_xmlNanoFTPList(void) {
11774    int test_ret = 0;
11775
11776
11777    /* missing type support */
11778    return(test_ret);
11779}
11780
11781
11782static int
11783test_xmlNanoFTPNewCtxt(void) {
11784    int test_ret = 0;
11785
11786#if defined(LIBXML_FTP_ENABLED)
11787    int mem_base;
11788    void * ret_val;
11789    const char * URL; /* The URL used to initialize the context */
11790    int n_URL;
11791
11792    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11793        mem_base = xmlMemBlocks();
11794        URL = gen_filepath(n_URL, 0);
11795
11796        ret_val = xmlNanoFTPNewCtxt(URL);
11797        desret_xmlNanoFTPCtxtPtr(ret_val);
11798        call_tests++;
11799        des_filepath(n_URL, URL, 0);
11800        xmlResetLastError();
11801        if (mem_base != xmlMemBlocks()) {
11802            printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11803	           xmlMemBlocks() - mem_base);
11804	    test_ret++;
11805            printf(" %d", n_URL);
11806            printf("\n");
11807        }
11808    }
11809    function_tests++;
11810#endif
11811
11812    return(test_ret);
11813}
11814
11815
11816static int
11817test_xmlNanoFTPOpen(void) {
11818    int test_ret = 0;
11819
11820#if defined(LIBXML_FTP_ENABLED)
11821    int mem_base;
11822    void * ret_val;
11823    const char * URL; /* the URL to the resource */
11824    int n_URL;
11825
11826    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11827        mem_base = xmlMemBlocks();
11828        URL = gen_filepath(n_URL, 0);
11829
11830        ret_val = xmlNanoFTPOpen(URL);
11831        desret_xmlNanoFTPCtxtPtr(ret_val);
11832        call_tests++;
11833        des_filepath(n_URL, URL, 0);
11834        xmlResetLastError();
11835        if (mem_base != xmlMemBlocks()) {
11836            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11837	           xmlMemBlocks() - mem_base);
11838	    test_ret++;
11839            printf(" %d", n_URL);
11840            printf("\n");
11841        }
11842    }
11843    function_tests++;
11844#endif
11845
11846    return(test_ret);
11847}
11848
11849
11850static int
11851test_xmlNanoFTPProxy(void) {
11852    int test_ret = 0;
11853
11854#if defined(LIBXML_FTP_ENABLED)
11855    char * host; /* the proxy host name */
11856    int n_host;
11857    int port; /* the proxy port */
11858    int n_port;
11859    char * user; /* the proxy user name */
11860    int n_user;
11861    char * passwd; /* the proxy password */
11862    int n_passwd;
11863    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11864    int n_type;
11865
11866    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11867    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11868    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11869    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11870    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11871        host = gen_const_char_ptr(n_host, 0);
11872        port = gen_int(n_port, 1);
11873        user = gen_const_char_ptr(n_user, 2);
11874        passwd = gen_const_char_ptr(n_passwd, 3);
11875        type = gen_int(n_type, 4);
11876
11877        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11878        call_tests++;
11879        des_const_char_ptr(n_host, (const char *)host, 0);
11880        des_int(n_port, port, 1);
11881        des_const_char_ptr(n_user, (const char *)user, 2);
11882        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11883        des_int(n_type, type, 4);
11884        xmlResetLastError();
11885    }
11886    }
11887    }
11888    }
11889    }
11890    function_tests++;
11891#endif
11892
11893    return(test_ret);
11894}
11895
11896
11897static int
11898test_xmlNanoFTPQuit(void) {
11899    int test_ret = 0;
11900
11901#if defined(LIBXML_FTP_ENABLED)
11902    int mem_base;
11903    int ret_val;
11904    void * ctx; /* an FTP context */
11905    int n_ctx;
11906
11907    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11908        mem_base = xmlMemBlocks();
11909        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11910
11911        ret_val = xmlNanoFTPQuit(ctx);
11912        desret_int(ret_val);
11913        call_tests++;
11914        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11915        xmlResetLastError();
11916        if (mem_base != xmlMemBlocks()) {
11917            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11918	           xmlMemBlocks() - mem_base);
11919	    test_ret++;
11920            printf(" %d", n_ctx);
11921            printf("\n");
11922        }
11923    }
11924    function_tests++;
11925#endif
11926
11927    return(test_ret);
11928}
11929
11930
11931static int
11932test_xmlNanoFTPRead(void) {
11933    int test_ret = 0;
11934
11935#if defined(LIBXML_FTP_ENABLED)
11936    int mem_base;
11937    int ret_val;
11938    void * ctx; /* the FTP context */
11939    int n_ctx;
11940    void * dest; /* a buffer */
11941    int n_dest;
11942    int len; /* the buffer length */
11943    int n_len;
11944
11945    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11946    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11947    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11948        mem_base = xmlMemBlocks();
11949        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11950        dest = gen_void_ptr(n_dest, 1);
11951        len = gen_int(n_len, 2);
11952
11953        ret_val = xmlNanoFTPRead(ctx, dest, len);
11954        desret_int(ret_val);
11955        call_tests++;
11956        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11957        des_void_ptr(n_dest, dest, 1);
11958        des_int(n_len, len, 2);
11959        xmlResetLastError();
11960        if (mem_base != xmlMemBlocks()) {
11961            printf("Leak of %d blocks found in xmlNanoFTPRead",
11962	           xmlMemBlocks() - mem_base);
11963	    test_ret++;
11964            printf(" %d", n_ctx);
11965            printf(" %d", n_dest);
11966            printf(" %d", n_len);
11967            printf("\n");
11968        }
11969    }
11970    }
11971    }
11972    function_tests++;
11973#endif
11974
11975    return(test_ret);
11976}
11977
11978
11979static int
11980test_xmlNanoFTPScanProxy(void) {
11981    int test_ret = 0;
11982
11983#if defined(LIBXML_FTP_ENABLED)
11984    const char * URL; /* The proxy URL used to initialize the proxy context */
11985    int n_URL;
11986
11987    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11988        URL = gen_filepath(n_URL, 0);
11989
11990        xmlNanoFTPScanProxy(URL);
11991        call_tests++;
11992        des_filepath(n_URL, URL, 0);
11993        xmlResetLastError();
11994    }
11995    function_tests++;
11996#endif
11997
11998    return(test_ret);
11999}
12000
12001
12002static int
12003test_xmlNanoFTPUpdateURL(void) {
12004    int test_ret = 0;
12005
12006#if defined(LIBXML_FTP_ENABLED)
12007    int mem_base;
12008    int ret_val;
12009    void * ctx; /* an FTP context */
12010    int n_ctx;
12011    const char * URL; /* The URL used to update the context */
12012    int n_URL;
12013
12014    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12015    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12016        mem_base = xmlMemBlocks();
12017        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12018        URL = gen_filepath(n_URL, 1);
12019
12020        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12021        desret_int(ret_val);
12022        call_tests++;
12023        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12024        des_filepath(n_URL, URL, 1);
12025        xmlResetLastError();
12026        if (mem_base != xmlMemBlocks()) {
12027            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12028	           xmlMemBlocks() - mem_base);
12029	    test_ret++;
12030            printf(" %d", n_ctx);
12031            printf(" %d", n_URL);
12032            printf("\n");
12033        }
12034    }
12035    }
12036    function_tests++;
12037#endif
12038
12039    return(test_ret);
12040}
12041
12042static int
12043test_nanoftp(void) {
12044    int test_ret = 0;
12045
12046    if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
12047    test_ret += test_xmlNanoFTPCheckResponse();
12048    test_ret += test_xmlNanoFTPCleanup();
12049    test_ret += test_xmlNanoFTPCloseConnection();
12050    test_ret += test_xmlNanoFTPCwd();
12051    test_ret += test_xmlNanoFTPDele();
12052    test_ret += test_xmlNanoFTPGet();
12053    test_ret += test_xmlNanoFTPGetConnection();
12054    test_ret += test_xmlNanoFTPGetResponse();
12055    test_ret += test_xmlNanoFTPGetSocket();
12056    test_ret += test_xmlNanoFTPInit();
12057    test_ret += test_xmlNanoFTPList();
12058    test_ret += test_xmlNanoFTPNewCtxt();
12059    test_ret += test_xmlNanoFTPOpen();
12060    test_ret += test_xmlNanoFTPProxy();
12061    test_ret += test_xmlNanoFTPQuit();
12062    test_ret += test_xmlNanoFTPRead();
12063    test_ret += test_xmlNanoFTPScanProxy();
12064    test_ret += test_xmlNanoFTPUpdateURL();
12065
12066    if (test_ret != 0)
12067	printf("Module nanoftp: %d errors\n", test_ret);
12068    return(test_ret);
12069}
12070
12071static int
12072test_xmlNanoHTTPAuthHeader(void) {
12073    int test_ret = 0;
12074
12075#if defined(LIBXML_HTTP_ENABLED)
12076    int mem_base;
12077    const char * ret_val;
12078    void * ctx; /* the HTTP context */
12079    int n_ctx;
12080
12081    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12082        mem_base = xmlMemBlocks();
12083        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12084
12085        ret_val = xmlNanoHTTPAuthHeader(ctx);
12086        desret_const_char_ptr(ret_val);
12087        call_tests++;
12088        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12089        xmlResetLastError();
12090        if (mem_base != xmlMemBlocks()) {
12091            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12092	           xmlMemBlocks() - mem_base);
12093	    test_ret++;
12094            printf(" %d", n_ctx);
12095            printf("\n");
12096        }
12097    }
12098    function_tests++;
12099#endif
12100
12101    return(test_ret);
12102}
12103
12104
12105static int
12106test_xmlNanoHTTPCleanup(void) {
12107    int test_ret = 0;
12108
12109#if defined(LIBXML_HTTP_ENABLED)
12110    int mem_base;
12111
12112        mem_base = xmlMemBlocks();
12113
12114        xmlNanoHTTPCleanup();
12115        call_tests++;
12116        xmlResetLastError();
12117        if (mem_base != xmlMemBlocks()) {
12118            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12119	           xmlMemBlocks() - mem_base);
12120	    test_ret++;
12121            printf("\n");
12122        }
12123    function_tests++;
12124#endif
12125
12126    return(test_ret);
12127}
12128
12129
12130static int
12131test_xmlNanoHTTPContentLength(void) {
12132    int test_ret = 0;
12133
12134#if defined(LIBXML_HTTP_ENABLED)
12135    int mem_base;
12136    int ret_val;
12137    void * ctx; /* the HTTP context */
12138    int n_ctx;
12139
12140    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12141        mem_base = xmlMemBlocks();
12142        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12143
12144        ret_val = xmlNanoHTTPContentLength(ctx);
12145        desret_int(ret_val);
12146        call_tests++;
12147        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12148        xmlResetLastError();
12149        if (mem_base != xmlMemBlocks()) {
12150            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12151	           xmlMemBlocks() - mem_base);
12152	    test_ret++;
12153            printf(" %d", n_ctx);
12154            printf("\n");
12155        }
12156    }
12157    function_tests++;
12158#endif
12159
12160    return(test_ret);
12161}
12162
12163
12164static int
12165test_xmlNanoHTTPEncoding(void) {
12166    int test_ret = 0;
12167
12168#if defined(LIBXML_HTTP_ENABLED)
12169    int mem_base;
12170    const char * ret_val;
12171    void * ctx; /* the HTTP context */
12172    int n_ctx;
12173
12174    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12175        mem_base = xmlMemBlocks();
12176        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12177
12178        ret_val = xmlNanoHTTPEncoding(ctx);
12179        desret_const_char_ptr(ret_val);
12180        call_tests++;
12181        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12182        xmlResetLastError();
12183        if (mem_base != xmlMemBlocks()) {
12184            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12185	           xmlMemBlocks() - mem_base);
12186	    test_ret++;
12187            printf(" %d", n_ctx);
12188            printf("\n");
12189        }
12190    }
12191    function_tests++;
12192#endif
12193
12194    return(test_ret);
12195}
12196
12197
12198#define gen_nb_char_ptr_ptr 1
12199static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12200    return(NULL);
12201}
12202static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12203}
12204
12205static int
12206test_xmlNanoHTTPFetch(void) {
12207    int test_ret = 0;
12208
12209#if defined(LIBXML_HTTP_ENABLED)
12210    int mem_base;
12211    int ret_val;
12212    const char * URL; /* The URL to load */
12213    int n_URL;
12214    const char * filename; /* the filename where the content should be saved */
12215    int n_filename;
12216    char ** contentType; /* if available the Content-Type information will be returned at that location */
12217    int n_contentType;
12218
12219    for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12220    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12221    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12222        mem_base = xmlMemBlocks();
12223        URL = gen_fileoutput(n_URL, 0);
12224        filename = gen_fileoutput(n_filename, 1);
12225        contentType = gen_char_ptr_ptr(n_contentType, 2);
12226
12227        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12228        desret_int(ret_val);
12229        call_tests++;
12230        des_fileoutput(n_URL, URL, 0);
12231        des_fileoutput(n_filename, filename, 1);
12232        des_char_ptr_ptr(n_contentType, contentType, 2);
12233        xmlResetLastError();
12234        if (mem_base != xmlMemBlocks()) {
12235            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12236	           xmlMemBlocks() - mem_base);
12237	    test_ret++;
12238            printf(" %d", n_URL);
12239            printf(" %d", n_filename);
12240            printf(" %d", n_contentType);
12241            printf("\n");
12242        }
12243    }
12244    }
12245    }
12246    function_tests++;
12247#endif
12248
12249    return(test_ret);
12250}
12251
12252
12253static int
12254test_xmlNanoHTTPInit(void) {
12255    int test_ret = 0;
12256
12257#if defined(LIBXML_HTTP_ENABLED)
12258    int mem_base;
12259
12260        mem_base = xmlMemBlocks();
12261
12262        xmlNanoHTTPInit();
12263        call_tests++;
12264        xmlResetLastError();
12265        if (mem_base != xmlMemBlocks()) {
12266            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12267	           xmlMemBlocks() - mem_base);
12268	    test_ret++;
12269            printf("\n");
12270        }
12271    function_tests++;
12272#endif
12273
12274    return(test_ret);
12275}
12276
12277
12278static int
12279test_xmlNanoHTTPMimeType(void) {
12280    int test_ret = 0;
12281
12282#if defined(LIBXML_HTTP_ENABLED)
12283    int mem_base;
12284    const char * ret_val;
12285    void * ctx; /* the HTTP context */
12286    int n_ctx;
12287
12288    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12289        mem_base = xmlMemBlocks();
12290        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12291
12292        ret_val = xmlNanoHTTPMimeType(ctx);
12293        desret_const_char_ptr(ret_val);
12294        call_tests++;
12295        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12296        xmlResetLastError();
12297        if (mem_base != xmlMemBlocks()) {
12298            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12299	           xmlMemBlocks() - mem_base);
12300	    test_ret++;
12301            printf(" %d", n_ctx);
12302            printf("\n");
12303        }
12304    }
12305    function_tests++;
12306#endif
12307
12308    return(test_ret);
12309}
12310
12311
12312static int
12313test_xmlNanoHTTPOpen(void) {
12314    int test_ret = 0;
12315
12316#if defined(LIBXML_HTTP_ENABLED)
12317    int mem_base;
12318    void * ret_val;
12319    const char * URL; /* The URL to load */
12320    int n_URL;
12321    char ** contentType; /* if available the Content-Type information will be returned at that location */
12322    int n_contentType;
12323
12324    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12325    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12326        mem_base = xmlMemBlocks();
12327        URL = gen_filepath(n_URL, 0);
12328        contentType = gen_char_ptr_ptr(n_contentType, 1);
12329
12330        ret_val = xmlNanoHTTPOpen(URL, contentType);
12331        desret_xmlNanoHTTPCtxtPtr(ret_val);
12332        call_tests++;
12333        des_filepath(n_URL, URL, 0);
12334        des_char_ptr_ptr(n_contentType, contentType, 1);
12335        xmlResetLastError();
12336        if (mem_base != xmlMemBlocks()) {
12337            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12338	           xmlMemBlocks() - mem_base);
12339	    test_ret++;
12340            printf(" %d", n_URL);
12341            printf(" %d", n_contentType);
12342            printf("\n");
12343        }
12344    }
12345    }
12346    function_tests++;
12347#endif
12348
12349    return(test_ret);
12350}
12351
12352
12353static int
12354test_xmlNanoHTTPOpenRedir(void) {
12355    int test_ret = 0;
12356
12357#if defined(LIBXML_HTTP_ENABLED)
12358    int mem_base;
12359    void * ret_val;
12360    const char * URL; /* The URL to load */
12361    int n_URL;
12362    char ** contentType; /* if available the Content-Type information will be returned at that location */
12363    int n_contentType;
12364    char ** redir; /* if available the redirected URL will be returned */
12365    int n_redir;
12366
12367    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12368    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12369    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12370        mem_base = xmlMemBlocks();
12371        URL = gen_filepath(n_URL, 0);
12372        contentType = gen_char_ptr_ptr(n_contentType, 1);
12373        redir = gen_char_ptr_ptr(n_redir, 2);
12374
12375        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12376        desret_xmlNanoHTTPCtxtPtr(ret_val);
12377        call_tests++;
12378        des_filepath(n_URL, URL, 0);
12379        des_char_ptr_ptr(n_contentType, contentType, 1);
12380        des_char_ptr_ptr(n_redir, redir, 2);
12381        xmlResetLastError();
12382        if (mem_base != xmlMemBlocks()) {
12383            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12384	           xmlMemBlocks() - mem_base);
12385	    test_ret++;
12386            printf(" %d", n_URL);
12387            printf(" %d", n_contentType);
12388            printf(" %d", n_redir);
12389            printf("\n");
12390        }
12391    }
12392    }
12393    }
12394    function_tests++;
12395#endif
12396
12397    return(test_ret);
12398}
12399
12400
12401static int
12402test_xmlNanoHTTPRead(void) {
12403    int test_ret = 0;
12404
12405#if defined(LIBXML_HTTP_ENABLED)
12406    int mem_base;
12407    int ret_val;
12408    void * ctx; /* the HTTP context */
12409    int n_ctx;
12410    void * dest; /* a buffer */
12411    int n_dest;
12412    int len; /* the buffer length */
12413    int n_len;
12414
12415    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12416    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12417    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12418        mem_base = xmlMemBlocks();
12419        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12420        dest = gen_void_ptr(n_dest, 1);
12421        len = gen_int(n_len, 2);
12422
12423        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12424        desret_int(ret_val);
12425        call_tests++;
12426        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12427        des_void_ptr(n_dest, dest, 1);
12428        des_int(n_len, len, 2);
12429        xmlResetLastError();
12430        if (mem_base != xmlMemBlocks()) {
12431            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12432	           xmlMemBlocks() - mem_base);
12433	    test_ret++;
12434            printf(" %d", n_ctx);
12435            printf(" %d", n_dest);
12436            printf(" %d", n_len);
12437            printf("\n");
12438        }
12439    }
12440    }
12441    }
12442    function_tests++;
12443#endif
12444
12445    return(test_ret);
12446}
12447
12448
12449static int
12450test_xmlNanoHTTPRedir(void) {
12451    int test_ret = 0;
12452
12453
12454    /* missing type support */
12455    return(test_ret);
12456}
12457
12458
12459static int
12460test_xmlNanoHTTPReturnCode(void) {
12461    int test_ret = 0;
12462
12463#if defined(LIBXML_HTTP_ENABLED)
12464    int mem_base;
12465    int ret_val;
12466    void * ctx; /* the HTTP context */
12467    int n_ctx;
12468
12469    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12470        mem_base = xmlMemBlocks();
12471        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12472
12473        ret_val = xmlNanoHTTPReturnCode(ctx);
12474        desret_int(ret_val);
12475        call_tests++;
12476        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12477        xmlResetLastError();
12478        if (mem_base != xmlMemBlocks()) {
12479            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12480	           xmlMemBlocks() - mem_base);
12481	    test_ret++;
12482            printf(" %d", n_ctx);
12483            printf("\n");
12484        }
12485    }
12486    function_tests++;
12487#endif
12488
12489    return(test_ret);
12490}
12491
12492
12493static int
12494test_xmlNanoHTTPSave(void) {
12495    int test_ret = 0;
12496
12497#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12498    int mem_base;
12499    int ret_val;
12500    void * ctxt; /* the HTTP context */
12501    int n_ctxt;
12502    const char * filename; /* the filename where the content should be saved */
12503    int n_filename;
12504
12505    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12506    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12507        mem_base = xmlMemBlocks();
12508        ctxt = gen_void_ptr(n_ctxt, 0);
12509        filename = gen_fileoutput(n_filename, 1);
12510
12511        ret_val = xmlNanoHTTPSave(ctxt, filename);
12512        desret_int(ret_val);
12513        call_tests++;
12514        des_void_ptr(n_ctxt, ctxt, 0);
12515        des_fileoutput(n_filename, filename, 1);
12516        xmlResetLastError();
12517        if (mem_base != xmlMemBlocks()) {
12518            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12519	           xmlMemBlocks() - mem_base);
12520	    test_ret++;
12521            printf(" %d", n_ctxt);
12522            printf(" %d", n_filename);
12523            printf("\n");
12524        }
12525    }
12526    }
12527    function_tests++;
12528#endif
12529
12530    return(test_ret);
12531}
12532
12533
12534static int
12535test_xmlNanoHTTPScanProxy(void) {
12536    int test_ret = 0;
12537
12538#if defined(LIBXML_HTTP_ENABLED)
12539    const char * URL; /* The proxy URL used to initialize the proxy context */
12540    int n_URL;
12541
12542    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12543        URL = gen_filepath(n_URL, 0);
12544
12545        xmlNanoHTTPScanProxy(URL);
12546        call_tests++;
12547        des_filepath(n_URL, URL, 0);
12548        xmlResetLastError();
12549    }
12550    function_tests++;
12551#endif
12552
12553    return(test_ret);
12554}
12555
12556static int
12557test_nanohttp(void) {
12558    int test_ret = 0;
12559
12560    if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12561    test_ret += test_xmlNanoHTTPAuthHeader();
12562    test_ret += test_xmlNanoHTTPCleanup();
12563    test_ret += test_xmlNanoHTTPContentLength();
12564    test_ret += test_xmlNanoHTTPEncoding();
12565    test_ret += test_xmlNanoHTTPFetch();
12566    test_ret += test_xmlNanoHTTPInit();
12567    test_ret += test_xmlNanoHTTPMimeType();
12568    test_ret += test_xmlNanoHTTPOpen();
12569    test_ret += test_xmlNanoHTTPOpenRedir();
12570    test_ret += test_xmlNanoHTTPRead();
12571    test_ret += test_xmlNanoHTTPRedir();
12572    test_ret += test_xmlNanoHTTPReturnCode();
12573    test_ret += test_xmlNanoHTTPSave();
12574    test_ret += test_xmlNanoHTTPScanProxy();
12575
12576    if (test_ret != 0)
12577	printf("Module nanohttp: %d errors\n", test_ret);
12578    return(test_ret);
12579}
12580
12581static int
12582test_xmlByteConsumed(void) {
12583    int test_ret = 0;
12584
12585    int mem_base;
12586    long ret_val;
12587    xmlParserCtxtPtr ctxt; /* an XML parser context */
12588    int n_ctxt;
12589
12590    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12591        mem_base = xmlMemBlocks();
12592        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12593
12594        ret_val = xmlByteConsumed(ctxt);
12595        desret_long(ret_val);
12596        call_tests++;
12597        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12598        xmlResetLastError();
12599        if (mem_base != xmlMemBlocks()) {
12600            printf("Leak of %d blocks found in xmlByteConsumed",
12601	           xmlMemBlocks() - mem_base);
12602	    test_ret++;
12603            printf(" %d", n_ctxt);
12604            printf("\n");
12605        }
12606    }
12607    function_tests++;
12608
12609    return(test_ret);
12610}
12611
12612
12613static int
12614test_xmlClearNodeInfoSeq(void) {
12615    int test_ret = 0;
12616
12617    int mem_base;
12618    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12619    int n_seq;
12620
12621    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12622        mem_base = xmlMemBlocks();
12623        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12624
12625        xmlClearNodeInfoSeq(seq);
12626        call_tests++;
12627        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12628        xmlResetLastError();
12629        if (mem_base != xmlMemBlocks()) {
12630            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12631	           xmlMemBlocks() - mem_base);
12632	    test_ret++;
12633            printf(" %d", n_seq);
12634            printf("\n");
12635        }
12636    }
12637    function_tests++;
12638
12639    return(test_ret);
12640}
12641
12642
12643static int
12644test_xmlClearParserCtxt(void) {
12645    int test_ret = 0;
12646
12647    int mem_base;
12648    xmlParserCtxtPtr ctxt; /* an XML parser context */
12649    int n_ctxt;
12650
12651    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12652        mem_base = xmlMemBlocks();
12653        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12654
12655        xmlClearParserCtxt(ctxt);
12656        call_tests++;
12657        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12658        xmlResetLastError();
12659        if (mem_base != xmlMemBlocks()) {
12660            printf("Leak of %d blocks found in xmlClearParserCtxt",
12661	           xmlMemBlocks() - mem_base);
12662	    test_ret++;
12663            printf(" %d", n_ctxt);
12664            printf("\n");
12665        }
12666    }
12667    function_tests++;
12668
12669    return(test_ret);
12670}
12671
12672
12673static int
12674test_xmlCreateDocParserCtxt(void) {
12675    int test_ret = 0;
12676
12677    int mem_base;
12678    xmlParserCtxtPtr ret_val;
12679    xmlChar * cur; /* a pointer to an array of xmlChar */
12680    int n_cur;
12681
12682    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12683        mem_base = xmlMemBlocks();
12684        cur = gen_const_xmlChar_ptr(n_cur, 0);
12685
12686        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12687        desret_xmlParserCtxtPtr(ret_val);
12688        call_tests++;
12689        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12690        xmlResetLastError();
12691        if (mem_base != xmlMemBlocks()) {
12692            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12693	           xmlMemBlocks() - mem_base);
12694	    test_ret++;
12695            printf(" %d", n_cur);
12696            printf("\n");
12697        }
12698    }
12699    function_tests++;
12700
12701    return(test_ret);
12702}
12703
12704
12705static int
12706test_xmlCreatePushParserCtxt(void) {
12707    int test_ret = 0;
12708
12709#if defined(LIBXML_PUSH_ENABLED)
12710    int mem_base;
12711    xmlParserCtxtPtr ret_val;
12712    xmlSAXHandlerPtr sax; /* a SAX handler */
12713    int n_sax;
12714    void * user_data; /* The user data returned on SAX callbacks */
12715    int n_user_data;
12716    char * chunk; /* a pointer to an array of chars */
12717    int n_chunk;
12718    int size; /* number of chars in the array */
12719    int n_size;
12720    const char * filename; /* an optional file name or URI */
12721    int n_filename;
12722
12723    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12724    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12725    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12726    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12727    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12728        mem_base = xmlMemBlocks();
12729        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12730        user_data = gen_userdata(n_user_data, 1);
12731        chunk = gen_const_char_ptr(n_chunk, 2);
12732        size = gen_int(n_size, 3);
12733        filename = gen_fileoutput(n_filename, 4);
12734
12735        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12736        desret_xmlParserCtxtPtr(ret_val);
12737        call_tests++;
12738        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12739        des_userdata(n_user_data, user_data, 1);
12740        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12741        des_int(n_size, size, 3);
12742        des_fileoutput(n_filename, filename, 4);
12743        xmlResetLastError();
12744        if (mem_base != xmlMemBlocks()) {
12745            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12746	           xmlMemBlocks() - mem_base);
12747	    test_ret++;
12748            printf(" %d", n_sax);
12749            printf(" %d", n_user_data);
12750            printf(" %d", n_chunk);
12751            printf(" %d", n_size);
12752            printf(" %d", n_filename);
12753            printf("\n");
12754        }
12755    }
12756    }
12757    }
12758    }
12759    }
12760    function_tests++;
12761#endif
12762
12763    return(test_ret);
12764}
12765
12766
12767static int
12768test_xmlCtxtReadDoc(void) {
12769    int test_ret = 0;
12770
12771    int mem_base;
12772    xmlDocPtr ret_val;
12773    xmlParserCtxtPtr ctxt; /* an XML parser context */
12774    int n_ctxt;
12775    xmlChar * cur; /* a pointer to a zero terminated string */
12776    int n_cur;
12777    const char * URL; /* the base URL to use for the document */
12778    int n_URL;
12779    char * encoding; /* the document encoding, or NULL */
12780    int n_encoding;
12781    int options; /* a combination of xmlParserOption */
12782    int n_options;
12783
12784    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12785    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12786    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12787    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12788    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12789        mem_base = xmlMemBlocks();
12790        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12791        cur = gen_const_xmlChar_ptr(n_cur, 1);
12792        URL = gen_filepath(n_URL, 2);
12793        encoding = gen_const_char_ptr(n_encoding, 3);
12794        options = gen_parseroptions(n_options, 4);
12795
12796        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12797        desret_xmlDocPtr(ret_val);
12798        call_tests++;
12799        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12800        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12801        des_filepath(n_URL, URL, 2);
12802        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12803        des_parseroptions(n_options, options, 4);
12804        xmlResetLastError();
12805        if (mem_base != xmlMemBlocks()) {
12806            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12807	           xmlMemBlocks() - mem_base);
12808	    test_ret++;
12809            printf(" %d", n_ctxt);
12810            printf(" %d", n_cur);
12811            printf(" %d", n_URL);
12812            printf(" %d", n_encoding);
12813            printf(" %d", n_options);
12814            printf("\n");
12815        }
12816    }
12817    }
12818    }
12819    }
12820    }
12821    function_tests++;
12822
12823    return(test_ret);
12824}
12825
12826
12827static int
12828test_xmlCtxtReadFile(void) {
12829    int test_ret = 0;
12830
12831    int mem_base;
12832    xmlDocPtr ret_val;
12833    xmlParserCtxtPtr ctxt; /* an XML parser context */
12834    int n_ctxt;
12835    const char * filename; /* a file or URL */
12836    int n_filename;
12837    char * encoding; /* the document encoding, or NULL */
12838    int n_encoding;
12839    int options; /* a combination of xmlParserOption */
12840    int n_options;
12841
12842    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12843    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12844    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12845    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12846        mem_base = xmlMemBlocks();
12847        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12848        filename = gen_filepath(n_filename, 1);
12849        encoding = gen_const_char_ptr(n_encoding, 2);
12850        options = gen_parseroptions(n_options, 3);
12851
12852        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12853        desret_xmlDocPtr(ret_val);
12854        call_tests++;
12855        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12856        des_filepath(n_filename, filename, 1);
12857        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12858        des_parseroptions(n_options, options, 3);
12859        xmlResetLastError();
12860        if (mem_base != xmlMemBlocks()) {
12861            printf("Leak of %d blocks found in xmlCtxtReadFile",
12862	           xmlMemBlocks() - mem_base);
12863	    test_ret++;
12864            printf(" %d", n_ctxt);
12865            printf(" %d", n_filename);
12866            printf(" %d", n_encoding);
12867            printf(" %d", n_options);
12868            printf("\n");
12869        }
12870    }
12871    }
12872    }
12873    }
12874    function_tests++;
12875
12876    return(test_ret);
12877}
12878
12879
12880static int
12881test_xmlCtxtReadMemory(void) {
12882    int test_ret = 0;
12883
12884    int mem_base;
12885    xmlDocPtr ret_val;
12886    xmlParserCtxtPtr ctxt; /* an XML parser context */
12887    int n_ctxt;
12888    char * buffer; /* a pointer to a char array */
12889    int n_buffer;
12890    int size; /* the size of the array */
12891    int n_size;
12892    const char * URL; /* the base URL to use for the document */
12893    int n_URL;
12894    char * encoding; /* the document encoding, or NULL */
12895    int n_encoding;
12896    int options; /* a combination of xmlParserOption */
12897    int n_options;
12898
12899    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12900    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12901    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12902    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12903    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12904    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12905        mem_base = xmlMemBlocks();
12906        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12907        buffer = gen_const_char_ptr(n_buffer, 1);
12908        size = gen_int(n_size, 2);
12909        URL = gen_filepath(n_URL, 3);
12910        encoding = gen_const_char_ptr(n_encoding, 4);
12911        options = gen_parseroptions(n_options, 5);
12912
12913        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12914        desret_xmlDocPtr(ret_val);
12915        call_tests++;
12916        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12917        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12918        des_int(n_size, size, 2);
12919        des_filepath(n_URL, URL, 3);
12920        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12921        des_parseroptions(n_options, options, 5);
12922        xmlResetLastError();
12923        if (mem_base != xmlMemBlocks()) {
12924            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12925	           xmlMemBlocks() - mem_base);
12926	    test_ret++;
12927            printf(" %d", n_ctxt);
12928            printf(" %d", n_buffer);
12929            printf(" %d", n_size);
12930            printf(" %d", n_URL);
12931            printf(" %d", n_encoding);
12932            printf(" %d", n_options);
12933            printf("\n");
12934        }
12935    }
12936    }
12937    }
12938    }
12939    }
12940    }
12941    function_tests++;
12942
12943    return(test_ret);
12944}
12945
12946
12947static int
12948test_xmlCtxtReset(void) {
12949    int test_ret = 0;
12950
12951    int mem_base;
12952    xmlParserCtxtPtr ctxt; /* an XML parser context */
12953    int n_ctxt;
12954
12955    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12956        mem_base = xmlMemBlocks();
12957        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12958
12959        xmlCtxtReset(ctxt);
12960        call_tests++;
12961        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12962        xmlResetLastError();
12963        if (mem_base != xmlMemBlocks()) {
12964            printf("Leak of %d blocks found in xmlCtxtReset",
12965	           xmlMemBlocks() - mem_base);
12966	    test_ret++;
12967            printf(" %d", n_ctxt);
12968            printf("\n");
12969        }
12970    }
12971    function_tests++;
12972
12973    return(test_ret);
12974}
12975
12976
12977static int
12978test_xmlCtxtResetPush(void) {
12979    int test_ret = 0;
12980
12981    int mem_base;
12982    int ret_val;
12983    xmlParserCtxtPtr ctxt; /* an XML parser context */
12984    int n_ctxt;
12985    char * chunk; /* a pointer to an array of chars */
12986    int n_chunk;
12987    int size; /* number of chars in the array */
12988    int n_size;
12989    const char * filename; /* an optional file name or URI */
12990    int n_filename;
12991    char * encoding; /* the document encoding, or NULL */
12992    int n_encoding;
12993
12994    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12995    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12996    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12997    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12998    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12999        mem_base = xmlMemBlocks();
13000        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13001        chunk = gen_const_char_ptr(n_chunk, 1);
13002        size = gen_int(n_size, 2);
13003        filename = gen_filepath(n_filename, 3);
13004        encoding = gen_const_char_ptr(n_encoding, 4);
13005
13006        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
13007        desret_int(ret_val);
13008        call_tests++;
13009        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13010        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13011        des_int(n_size, size, 2);
13012        des_filepath(n_filename, filename, 3);
13013        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13014        xmlResetLastError();
13015        if (mem_base != xmlMemBlocks()) {
13016            printf("Leak of %d blocks found in xmlCtxtResetPush",
13017	           xmlMemBlocks() - mem_base);
13018	    test_ret++;
13019            printf(" %d", n_ctxt);
13020            printf(" %d", n_chunk);
13021            printf(" %d", n_size);
13022            printf(" %d", n_filename);
13023            printf(" %d", n_encoding);
13024            printf("\n");
13025        }
13026    }
13027    }
13028    }
13029    }
13030    }
13031    function_tests++;
13032
13033    return(test_ret);
13034}
13035
13036
13037static int
13038test_xmlCtxtUseOptions(void) {
13039    int test_ret = 0;
13040
13041    int mem_base;
13042    int ret_val;
13043    xmlParserCtxtPtr ctxt; /* an XML parser context */
13044    int n_ctxt;
13045    int options; /* a combination of xmlParserOption */
13046    int n_options;
13047
13048    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13049    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13050        mem_base = xmlMemBlocks();
13051        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13052        options = gen_parseroptions(n_options, 1);
13053
13054        ret_val = xmlCtxtUseOptions(ctxt, options);
13055        desret_int(ret_val);
13056        call_tests++;
13057        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13058        des_parseroptions(n_options, options, 1);
13059        xmlResetLastError();
13060        if (mem_base != xmlMemBlocks()) {
13061            printf("Leak of %d blocks found in xmlCtxtUseOptions",
13062	           xmlMemBlocks() - mem_base);
13063	    test_ret++;
13064            printf(" %d", n_ctxt);
13065            printf(" %d", n_options);
13066            printf("\n");
13067        }
13068    }
13069    }
13070    function_tests++;
13071
13072    return(test_ret);
13073}
13074
13075
13076static int
13077test_xmlGetExternalEntityLoader(void) {
13078    int test_ret = 0;
13079
13080
13081    /* missing type support */
13082    return(test_ret);
13083}
13084
13085
13086static int
13087test_xmlGetFeature(void) {
13088    int test_ret = 0;
13089
13090#if defined(LIBXML_LEGACY_ENABLED)
13091#ifdef LIBXML_LEGACY_ENABLED
13092    int mem_base;
13093    int ret_val;
13094    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13095    int n_ctxt;
13096    char * name; /* the feature name */
13097    int n_name;
13098    void * result; /* location to store the result */
13099    int n_result;
13100
13101    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13102    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13103    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13104        mem_base = xmlMemBlocks();
13105        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13106        name = gen_const_char_ptr(n_name, 1);
13107        result = gen_void_ptr(n_result, 2);
13108
13109        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13110        desret_int(ret_val);
13111        call_tests++;
13112        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13113        des_const_char_ptr(n_name, (const char *)name, 1);
13114        des_void_ptr(n_result, result, 2);
13115        xmlResetLastError();
13116        if (mem_base != xmlMemBlocks()) {
13117            printf("Leak of %d blocks found in xmlGetFeature",
13118	           xmlMemBlocks() - mem_base);
13119	    test_ret++;
13120            printf(" %d", n_ctxt);
13121            printf(" %d", n_name);
13122            printf(" %d", n_result);
13123            printf("\n");
13124        }
13125    }
13126    }
13127    }
13128    function_tests++;
13129#endif
13130#endif
13131
13132    return(test_ret);
13133}
13134
13135
13136#define gen_nb_const_char_ptr_ptr 1
13137static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13138    return(NULL);
13139}
13140static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13141}
13142
13143static int
13144test_xmlGetFeaturesList(void) {
13145    int test_ret = 0;
13146
13147#if defined(LIBXML_LEGACY_ENABLED)
13148#ifdef LIBXML_LEGACY_ENABLED
13149    int mem_base;
13150    int ret_val;
13151    int * len; /* the length of the features name array (input/output) */
13152    int n_len;
13153    char ** result; /* an array of string to be filled with the features name. */
13154    int n_result;
13155
13156    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13157    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13158        mem_base = xmlMemBlocks();
13159        len = gen_int_ptr(n_len, 0);
13160        result = gen_const_char_ptr_ptr(n_result, 1);
13161
13162        ret_val = xmlGetFeaturesList(len, (const char **)result);
13163        desret_int(ret_val);
13164        call_tests++;
13165        des_int_ptr(n_len, len, 0);
13166        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13167        xmlResetLastError();
13168        if (mem_base != xmlMemBlocks()) {
13169            printf("Leak of %d blocks found in xmlGetFeaturesList",
13170	           xmlMemBlocks() - mem_base);
13171	    test_ret++;
13172            printf(" %d", n_len);
13173            printf(" %d", n_result);
13174            printf("\n");
13175        }
13176    }
13177    }
13178    function_tests++;
13179#endif
13180#endif
13181
13182    return(test_ret);
13183}
13184
13185
13186static int
13187test_xmlHasFeature(void) {
13188    int test_ret = 0;
13189
13190    int mem_base;
13191    int ret_val;
13192    xmlFeature feature; /* the feature to be examined */
13193    int n_feature;
13194
13195    for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13196        mem_base = xmlMemBlocks();
13197        feature = gen_xmlFeature(n_feature, 0);
13198
13199        ret_val = xmlHasFeature(feature);
13200        desret_int(ret_val);
13201        call_tests++;
13202        des_xmlFeature(n_feature, feature, 0);
13203        xmlResetLastError();
13204        if (mem_base != xmlMemBlocks()) {
13205            printf("Leak of %d blocks found in xmlHasFeature",
13206	           xmlMemBlocks() - mem_base);
13207	    test_ret++;
13208            printf(" %d", n_feature);
13209            printf("\n");
13210        }
13211    }
13212    function_tests++;
13213
13214    return(test_ret);
13215}
13216
13217
13218static int
13219test_xmlIOParseDTD(void) {
13220    int test_ret = 0;
13221
13222#if defined(LIBXML_VALID_ENABLED)
13223#ifdef LIBXML_VALID_ENABLED
13224    xmlDtdPtr ret_val;
13225    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13226    int n_sax;
13227    xmlParserInputBufferPtr input; /* an Input Buffer */
13228    int n_input;
13229    xmlCharEncoding enc; /* the charset encoding if known */
13230    int n_enc;
13231
13232    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13233    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13234    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13235        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13236        input = gen_xmlParserInputBufferPtr(n_input, 1);
13237        enc = gen_xmlCharEncoding(n_enc, 2);
13238
13239        ret_val = xmlIOParseDTD(sax, input, enc);
13240        input = NULL;
13241        desret_xmlDtdPtr(ret_val);
13242        call_tests++;
13243        des_xmlSAXHandlerPtr(n_sax, sax, 0);
13244        des_xmlParserInputBufferPtr(n_input, input, 1);
13245        des_xmlCharEncoding(n_enc, enc, 2);
13246        xmlResetLastError();
13247    }
13248    }
13249    }
13250    function_tests++;
13251#endif
13252#endif
13253
13254    return(test_ret);
13255}
13256
13257
13258static int
13259test_xmlInitNodeInfoSeq(void) {
13260    int test_ret = 0;
13261
13262    int mem_base;
13263    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13264    int n_seq;
13265
13266    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13267        mem_base = xmlMemBlocks();
13268        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13269
13270        xmlInitNodeInfoSeq(seq);
13271        call_tests++;
13272        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13273        xmlResetLastError();
13274        if (mem_base != xmlMemBlocks()) {
13275            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13276	           xmlMemBlocks() - mem_base);
13277	    test_ret++;
13278            printf(" %d", n_seq);
13279            printf("\n");
13280        }
13281    }
13282    function_tests++;
13283
13284    return(test_ret);
13285}
13286
13287
13288static int
13289test_xmlInitParser(void) {
13290    int test_ret = 0;
13291
13292    int mem_base;
13293
13294        mem_base = xmlMemBlocks();
13295
13296        xmlInitParser();
13297        call_tests++;
13298        xmlResetLastError();
13299        if (mem_base != xmlMemBlocks()) {
13300            printf("Leak of %d blocks found in xmlInitParser",
13301	           xmlMemBlocks() - mem_base);
13302	    test_ret++;
13303            printf("\n");
13304        }
13305    function_tests++;
13306
13307    return(test_ret);
13308}
13309
13310
13311static int
13312test_xmlInitParserCtxt(void) {
13313    int test_ret = 0;
13314
13315    int mem_base;
13316    int ret_val;
13317    xmlParserCtxtPtr ctxt; /* an XML parser context */
13318    int n_ctxt;
13319
13320    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13321        mem_base = xmlMemBlocks();
13322        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13323
13324        ret_val = xmlInitParserCtxt(ctxt);
13325        desret_int(ret_val);
13326        call_tests++;
13327        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13328        xmlResetLastError();
13329        if (mem_base != xmlMemBlocks()) {
13330            printf("Leak of %d blocks found in xmlInitParserCtxt",
13331	           xmlMemBlocks() - mem_base);
13332	    test_ret++;
13333            printf(" %d", n_ctxt);
13334            printf("\n");
13335        }
13336    }
13337    function_tests++;
13338
13339    return(test_ret);
13340}
13341
13342
13343static int
13344test_xmlKeepBlanksDefault(void) {
13345    int test_ret = 0;
13346
13347    int mem_base;
13348    int ret_val;
13349    int val; /* int 0 or 1 */
13350    int n_val;
13351
13352    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13353        mem_base = xmlMemBlocks();
13354        val = gen_int(n_val, 0);
13355
13356        ret_val = xmlKeepBlanksDefault(val);
13357        desret_int(ret_val);
13358        call_tests++;
13359        des_int(n_val, val, 0);
13360        xmlResetLastError();
13361        if (mem_base != xmlMemBlocks()) {
13362            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13363	           xmlMemBlocks() - mem_base);
13364	    test_ret++;
13365            printf(" %d", n_val);
13366            printf("\n");
13367        }
13368    }
13369    function_tests++;
13370
13371    return(test_ret);
13372}
13373
13374
13375static int
13376test_xmlLineNumbersDefault(void) {
13377    int test_ret = 0;
13378
13379    int mem_base;
13380    int ret_val;
13381    int val; /* int 0 or 1 */
13382    int n_val;
13383
13384    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13385        mem_base = xmlMemBlocks();
13386        val = gen_int(n_val, 0);
13387
13388        ret_val = xmlLineNumbersDefault(val);
13389        desret_int(ret_val);
13390        call_tests++;
13391        des_int(n_val, val, 0);
13392        xmlResetLastError();
13393        if (mem_base != xmlMemBlocks()) {
13394            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13395	           xmlMemBlocks() - mem_base);
13396	    test_ret++;
13397            printf(" %d", n_val);
13398            printf("\n");
13399        }
13400    }
13401    function_tests++;
13402
13403    return(test_ret);
13404}
13405
13406
13407static int
13408test_xmlLoadExternalEntity(void) {
13409    int test_ret = 0;
13410
13411    int mem_base;
13412    xmlParserInputPtr ret_val;
13413    const char * URL; /* the URL for the entity to load */
13414    int n_URL;
13415    char * ID; /* the Public ID for the entity to load */
13416    int n_ID;
13417    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13418    int n_ctxt;
13419
13420    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13421    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13422    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13423        mem_base = xmlMemBlocks();
13424        URL = gen_filepath(n_URL, 0);
13425        ID = gen_const_char_ptr(n_ID, 1);
13426        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13427
13428        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13429        desret_xmlParserInputPtr(ret_val);
13430        call_tests++;
13431        des_filepath(n_URL, URL, 0);
13432        des_const_char_ptr(n_ID, (const char *)ID, 1);
13433        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13434        xmlResetLastError();
13435        if (mem_base != xmlMemBlocks()) {
13436            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13437	           xmlMemBlocks() - mem_base);
13438	    test_ret++;
13439            printf(" %d", n_URL);
13440            printf(" %d", n_ID);
13441            printf(" %d", n_ctxt);
13442            printf("\n");
13443        }
13444    }
13445    }
13446    }
13447    function_tests++;
13448
13449    return(test_ret);
13450}
13451
13452
13453static int
13454test_xmlNewIOInputStream(void) {
13455    int test_ret = 0;
13456
13457    int mem_base;
13458    xmlParserInputPtr ret_val;
13459    xmlParserCtxtPtr ctxt; /* an XML parser context */
13460    int n_ctxt;
13461    xmlParserInputBufferPtr input; /* an I/O Input */
13462    int n_input;
13463    xmlCharEncoding enc; /* the charset encoding if known */
13464    int n_enc;
13465
13466    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13467    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13468    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13469        mem_base = xmlMemBlocks();
13470        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13471        input = gen_xmlParserInputBufferPtr(n_input, 1);
13472        enc = gen_xmlCharEncoding(n_enc, 2);
13473
13474        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13475        if (ret_val != NULL) input = NULL;
13476        desret_xmlParserInputPtr(ret_val);
13477        call_tests++;
13478        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13479        des_xmlParserInputBufferPtr(n_input, input, 1);
13480        des_xmlCharEncoding(n_enc, enc, 2);
13481        xmlResetLastError();
13482        if (mem_base != xmlMemBlocks()) {
13483            printf("Leak of %d blocks found in xmlNewIOInputStream",
13484	           xmlMemBlocks() - mem_base);
13485	    test_ret++;
13486            printf(" %d", n_ctxt);
13487            printf(" %d", n_input);
13488            printf(" %d", n_enc);
13489            printf("\n");
13490        }
13491    }
13492    }
13493    }
13494    function_tests++;
13495
13496    return(test_ret);
13497}
13498
13499
13500static int
13501test_xmlNewParserCtxt(void) {
13502    int test_ret = 0;
13503
13504    int mem_base;
13505    xmlParserCtxtPtr ret_val;
13506
13507        mem_base = xmlMemBlocks();
13508
13509        ret_val = xmlNewParserCtxt();
13510        desret_xmlParserCtxtPtr(ret_val);
13511        call_tests++;
13512        xmlResetLastError();
13513        if (mem_base != xmlMemBlocks()) {
13514            printf("Leak of %d blocks found in xmlNewParserCtxt",
13515	           xmlMemBlocks() - mem_base);
13516	    test_ret++;
13517            printf("\n");
13518        }
13519    function_tests++;
13520
13521    return(test_ret);
13522}
13523
13524
13525#define gen_nb_xmlNodePtr_ptr 1
13526static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13527    return(NULL);
13528}
13529static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13530}
13531
13532static int
13533test_xmlParseBalancedChunkMemory(void) {
13534    int test_ret = 0;
13535
13536#if defined(LIBXML_SAX1_ENABLED)
13537#ifdef LIBXML_SAX1_ENABLED
13538    int mem_base;
13539    int ret_val;
13540    xmlDocPtr doc; /* the document the chunk pertains to */
13541    int n_doc;
13542    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13543    int n_sax;
13544    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13545    int n_user_data;
13546    int depth; /* Used for loop detection, use 0 */
13547    int n_depth;
13548    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13549    int n_string;
13550    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13551    int n_lst;
13552
13553    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13554    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13555    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13556    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13557    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13558    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13559        mem_base = xmlMemBlocks();
13560        doc = gen_xmlDocPtr(n_doc, 0);
13561        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13562        user_data = gen_userdata(n_user_data, 2);
13563        depth = gen_int(n_depth, 3);
13564        string = gen_const_xmlChar_ptr(n_string, 4);
13565        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13566
13567#ifdef LIBXML_SAX1_ENABLED
13568        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13569#endif
13570
13571
13572        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13573        desret_int(ret_val);
13574        call_tests++;
13575        des_xmlDocPtr(n_doc, doc, 0);
13576        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13577        des_userdata(n_user_data, user_data, 2);
13578        des_int(n_depth, depth, 3);
13579        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13580        des_xmlNodePtr_ptr(n_lst, lst, 5);
13581        xmlResetLastError();
13582        if (mem_base != xmlMemBlocks()) {
13583            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13584	           xmlMemBlocks() - mem_base);
13585	    test_ret++;
13586            printf(" %d", n_doc);
13587            printf(" %d", n_sax);
13588            printf(" %d", n_user_data);
13589            printf(" %d", n_depth);
13590            printf(" %d", n_string);
13591            printf(" %d", n_lst);
13592            printf("\n");
13593        }
13594    }
13595    }
13596    }
13597    }
13598    }
13599    }
13600    function_tests++;
13601#endif
13602#endif
13603
13604    return(test_ret);
13605}
13606
13607
13608static int
13609test_xmlParseBalancedChunkMemoryRecover(void) {
13610    int test_ret = 0;
13611
13612#if defined(LIBXML_SAX1_ENABLED)
13613#ifdef LIBXML_SAX1_ENABLED
13614    int mem_base;
13615    int ret_val;
13616    xmlDocPtr doc; /* the document the chunk pertains to */
13617    int n_doc;
13618    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13619    int n_sax;
13620    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13621    int n_user_data;
13622    int depth; /* Used for loop detection, use 0 */
13623    int n_depth;
13624    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13625    int n_string;
13626    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13627    int n_lst;
13628    int recover; /* return nodes even if the data is broken (use 0) */
13629    int n_recover;
13630
13631    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13632    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13633    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13634    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13635    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13636    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13637    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13638        mem_base = xmlMemBlocks();
13639        doc = gen_xmlDocPtr(n_doc, 0);
13640        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13641        user_data = gen_userdata(n_user_data, 2);
13642        depth = gen_int(n_depth, 3);
13643        string = gen_const_xmlChar_ptr(n_string, 4);
13644        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13645        recover = gen_int(n_recover, 6);
13646
13647#ifdef LIBXML_SAX1_ENABLED
13648        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13649#endif
13650
13651
13652        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13653        desret_int(ret_val);
13654        call_tests++;
13655        des_xmlDocPtr(n_doc, doc, 0);
13656        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13657        des_userdata(n_user_data, user_data, 2);
13658        des_int(n_depth, depth, 3);
13659        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13660        des_xmlNodePtr_ptr(n_lst, lst, 5);
13661        des_int(n_recover, recover, 6);
13662        xmlResetLastError();
13663        if (mem_base != xmlMemBlocks()) {
13664            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13665	           xmlMemBlocks() - mem_base);
13666	    test_ret++;
13667            printf(" %d", n_doc);
13668            printf(" %d", n_sax);
13669            printf(" %d", n_user_data);
13670            printf(" %d", n_depth);
13671            printf(" %d", n_string);
13672            printf(" %d", n_lst);
13673            printf(" %d", n_recover);
13674            printf("\n");
13675        }
13676    }
13677    }
13678    }
13679    }
13680    }
13681    }
13682    }
13683    function_tests++;
13684#endif
13685#endif
13686
13687    return(test_ret);
13688}
13689
13690
13691static int
13692test_xmlParseChunk(void) {
13693    int test_ret = 0;
13694
13695#if defined(LIBXML_PUSH_ENABLED)
13696    int mem_base;
13697    int ret_val;
13698    xmlParserCtxtPtr ctxt; /* an XML parser context */
13699    int n_ctxt;
13700    char * chunk; /* an char array */
13701    int n_chunk;
13702    int size; /* the size in byte of the chunk */
13703    int n_size;
13704    int terminate; /* last chunk indicator */
13705    int n_terminate;
13706
13707    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13708    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13709    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13710    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13711        mem_base = xmlMemBlocks();
13712        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13713        chunk = gen_const_char_ptr(n_chunk, 1);
13714        size = gen_int(n_size, 2);
13715        terminate = gen_int(n_terminate, 3);
13716
13717        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13718        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13719        desret_int(ret_val);
13720        call_tests++;
13721        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13722        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13723        des_int(n_size, size, 2);
13724        des_int(n_terminate, terminate, 3);
13725        xmlResetLastError();
13726        if (mem_base != xmlMemBlocks()) {
13727            printf("Leak of %d blocks found in xmlParseChunk",
13728	           xmlMemBlocks() - mem_base);
13729	    test_ret++;
13730            printf(" %d", n_ctxt);
13731            printf(" %d", n_chunk);
13732            printf(" %d", n_size);
13733            printf(" %d", n_terminate);
13734            printf("\n");
13735        }
13736    }
13737    }
13738    }
13739    }
13740    function_tests++;
13741#endif
13742
13743    return(test_ret);
13744}
13745
13746
13747static int
13748test_xmlParseCtxtExternalEntity(void) {
13749    int test_ret = 0;
13750
13751    int mem_base;
13752    int ret_val;
13753    xmlParserCtxtPtr ctx; /* the existing parsing context */
13754    int n_ctx;
13755    xmlChar * URL; /* the URL for the entity to load */
13756    int n_URL;
13757    xmlChar * ID; /* the System ID for the entity to load */
13758    int n_ID;
13759    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13760    int n_lst;
13761
13762    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13763    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13764    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13765    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13766        mem_base = xmlMemBlocks();
13767        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13768        URL = gen_const_xmlChar_ptr(n_URL, 1);
13769        ID = gen_const_xmlChar_ptr(n_ID, 2);
13770        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13771
13772        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13773        desret_int(ret_val);
13774        call_tests++;
13775        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13776        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13777        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13778        des_xmlNodePtr_ptr(n_lst, lst, 3);
13779        xmlResetLastError();
13780        if (mem_base != xmlMemBlocks()) {
13781            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13782	           xmlMemBlocks() - mem_base);
13783	    test_ret++;
13784            printf(" %d", n_ctx);
13785            printf(" %d", n_URL);
13786            printf(" %d", n_ID);
13787            printf(" %d", n_lst);
13788            printf("\n");
13789        }
13790    }
13791    }
13792    }
13793    }
13794    function_tests++;
13795
13796    return(test_ret);
13797}
13798
13799
13800static int
13801test_xmlParseDTD(void) {
13802    int test_ret = 0;
13803
13804#if defined(LIBXML_VALID_ENABLED)
13805#ifdef LIBXML_VALID_ENABLED
13806    int mem_base;
13807    xmlDtdPtr ret_val;
13808    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13809    int n_ExternalID;
13810    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13811    int n_SystemID;
13812
13813    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13814    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13815        mem_base = xmlMemBlocks();
13816        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13817        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13818
13819        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13820        desret_xmlDtdPtr(ret_val);
13821        call_tests++;
13822        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13823        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13824        xmlResetLastError();
13825        if (mem_base != xmlMemBlocks()) {
13826            printf("Leak of %d blocks found in xmlParseDTD",
13827	           xmlMemBlocks() - mem_base);
13828	    test_ret++;
13829            printf(" %d", n_ExternalID);
13830            printf(" %d", n_SystemID);
13831            printf("\n");
13832        }
13833    }
13834    }
13835    function_tests++;
13836#endif
13837#endif
13838
13839    return(test_ret);
13840}
13841
13842
13843static int
13844test_xmlParseDoc(void) {
13845    int test_ret = 0;
13846
13847#if defined(LIBXML_SAX1_ENABLED)
13848#ifdef LIBXML_SAX1_ENABLED
13849    int mem_base;
13850    xmlDocPtr ret_val;
13851    xmlChar * cur; /* a pointer to an array of xmlChar */
13852    int n_cur;
13853
13854    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13855        mem_base = xmlMemBlocks();
13856        cur = gen_const_xmlChar_ptr(n_cur, 0);
13857
13858        ret_val = xmlParseDoc((const xmlChar *)cur);
13859        desret_xmlDocPtr(ret_val);
13860        call_tests++;
13861        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13862        xmlResetLastError();
13863        if (mem_base != xmlMemBlocks()) {
13864            printf("Leak of %d blocks found in xmlParseDoc",
13865	           xmlMemBlocks() - mem_base);
13866	    test_ret++;
13867            printf(" %d", n_cur);
13868            printf("\n");
13869        }
13870    }
13871    function_tests++;
13872#endif
13873#endif
13874
13875    return(test_ret);
13876}
13877
13878
13879static int
13880test_xmlParseDocument(void) {
13881    int test_ret = 0;
13882
13883    int mem_base;
13884    int ret_val;
13885    xmlParserCtxtPtr ctxt; /* an XML parser context */
13886    int n_ctxt;
13887
13888    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13889        mem_base = xmlMemBlocks();
13890        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13891
13892        ret_val = xmlParseDocument(ctxt);
13893        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13894        desret_int(ret_val);
13895        call_tests++;
13896        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13897        xmlResetLastError();
13898        if (mem_base != xmlMemBlocks()) {
13899            printf("Leak of %d blocks found in xmlParseDocument",
13900	           xmlMemBlocks() - mem_base);
13901	    test_ret++;
13902            printf(" %d", n_ctxt);
13903            printf("\n");
13904        }
13905    }
13906    function_tests++;
13907
13908    return(test_ret);
13909}
13910
13911
13912static int
13913test_xmlParseEntity(void) {
13914    int test_ret = 0;
13915
13916#if defined(LIBXML_SAX1_ENABLED)
13917#ifdef LIBXML_SAX1_ENABLED
13918    int mem_base;
13919    xmlDocPtr ret_val;
13920    const char * filename; /* the filename */
13921    int n_filename;
13922
13923    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13924        mem_base = xmlMemBlocks();
13925        filename = gen_filepath(n_filename, 0);
13926
13927        ret_val = xmlParseEntity(filename);
13928        desret_xmlDocPtr(ret_val);
13929        call_tests++;
13930        des_filepath(n_filename, filename, 0);
13931        xmlResetLastError();
13932        if (mem_base != xmlMemBlocks()) {
13933            printf("Leak of %d blocks found in xmlParseEntity",
13934	           xmlMemBlocks() - mem_base);
13935	    test_ret++;
13936            printf(" %d", n_filename);
13937            printf("\n");
13938        }
13939    }
13940    function_tests++;
13941#endif
13942#endif
13943
13944    return(test_ret);
13945}
13946
13947
13948static int
13949test_xmlParseExtParsedEnt(void) {
13950    int test_ret = 0;
13951
13952    int mem_base;
13953    int ret_val;
13954    xmlParserCtxtPtr ctxt; /* an XML parser context */
13955    int n_ctxt;
13956
13957    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13958        mem_base = xmlMemBlocks();
13959        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13960
13961        ret_val = xmlParseExtParsedEnt(ctxt);
13962        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13963        desret_int(ret_val);
13964        call_tests++;
13965        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13966        xmlResetLastError();
13967        if (mem_base != xmlMemBlocks()) {
13968            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13969	           xmlMemBlocks() - mem_base);
13970	    test_ret++;
13971            printf(" %d", n_ctxt);
13972            printf("\n");
13973        }
13974    }
13975    function_tests++;
13976
13977    return(test_ret);
13978}
13979
13980
13981static int
13982test_xmlParseExternalEntity(void) {
13983    int test_ret = 0;
13984
13985#if defined(LIBXML_SAX1_ENABLED)
13986#ifdef LIBXML_SAX1_ENABLED
13987    int mem_base;
13988    int ret_val;
13989    xmlDocPtr doc; /* the document the chunk pertains to */
13990    int n_doc;
13991    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13992    int n_sax;
13993    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13994    int n_user_data;
13995    int depth; /* Used for loop detection, use 0 */
13996    int n_depth;
13997    xmlChar * URL; /* the URL for the entity to load */
13998    int n_URL;
13999    xmlChar * ID; /* the System ID for the entity to load */
14000    int n_ID;
14001    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14002    int n_lst;
14003
14004    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
14005    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14006    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14007    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14008    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14009    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14010    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14011        mem_base = xmlMemBlocks();
14012        doc = gen_xmlDocPtr(n_doc, 0);
14013        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14014        user_data = gen_userdata(n_user_data, 2);
14015        depth = gen_int(n_depth, 3);
14016        URL = gen_const_xmlChar_ptr(n_URL, 4);
14017        ID = gen_const_xmlChar_ptr(n_ID, 5);
14018        lst = gen_xmlNodePtr_ptr(n_lst, 6);
14019
14020        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14021        desret_int(ret_val);
14022        call_tests++;
14023        des_xmlDocPtr(n_doc, doc, 0);
14024        des_xmlSAXHandlerPtr(n_sax, sax, 1);
14025        des_userdata(n_user_data, user_data, 2);
14026        des_int(n_depth, depth, 3);
14027        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14028        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14029        des_xmlNodePtr_ptr(n_lst, lst, 6);
14030        xmlResetLastError();
14031        if (mem_base != xmlMemBlocks()) {
14032            printf("Leak of %d blocks found in xmlParseExternalEntity",
14033	           xmlMemBlocks() - mem_base);
14034	    test_ret++;
14035            printf(" %d", n_doc);
14036            printf(" %d", n_sax);
14037            printf(" %d", n_user_data);
14038            printf(" %d", n_depth);
14039            printf(" %d", n_URL);
14040            printf(" %d", n_ID);
14041            printf(" %d", n_lst);
14042            printf("\n");
14043        }
14044    }
14045    }
14046    }
14047    }
14048    }
14049    }
14050    }
14051    function_tests++;
14052#endif
14053#endif
14054
14055    return(test_ret);
14056}
14057
14058
14059static int
14060test_xmlParseFile(void) {
14061    int test_ret = 0;
14062
14063#if defined(LIBXML_SAX1_ENABLED)
14064#ifdef LIBXML_SAX1_ENABLED
14065    int mem_base;
14066    xmlDocPtr ret_val;
14067    const char * filename; /* the filename */
14068    int n_filename;
14069
14070    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14071        mem_base = xmlMemBlocks();
14072        filename = gen_filepath(n_filename, 0);
14073
14074        ret_val = xmlParseFile(filename);
14075        desret_xmlDocPtr(ret_val);
14076        call_tests++;
14077        des_filepath(n_filename, filename, 0);
14078        xmlResetLastError();
14079        if (mem_base != xmlMemBlocks()) {
14080            printf("Leak of %d blocks found in xmlParseFile",
14081	           xmlMemBlocks() - mem_base);
14082	    test_ret++;
14083            printf(" %d", n_filename);
14084            printf("\n");
14085        }
14086    }
14087    function_tests++;
14088#endif
14089#endif
14090
14091    return(test_ret);
14092}
14093
14094
14095static int
14096test_xmlParseInNodeContext(void) {
14097    int test_ret = 0;
14098
14099    int mem_base;
14100    xmlParserErrors ret_val;
14101    xmlNodePtr node; /* the context node */
14102    int n_node;
14103    char * data; /* the input string */
14104    int n_data;
14105    int datalen; /* the input string length in bytes */
14106    int n_datalen;
14107    int options; /* a combination of xmlParserOption */
14108    int n_options;
14109    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14110    int n_lst;
14111
14112    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14113    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14114    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14115    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14116    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14117        mem_base = xmlMemBlocks();
14118        node = gen_xmlNodePtr(n_node, 0);
14119        data = gen_const_char_ptr(n_data, 1);
14120        datalen = gen_int(n_datalen, 2);
14121        options = gen_parseroptions(n_options, 3);
14122        lst = gen_xmlNodePtr_ptr(n_lst, 4);
14123
14124        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14125        desret_xmlParserErrors(ret_val);
14126        call_tests++;
14127        des_xmlNodePtr(n_node, node, 0);
14128        des_const_char_ptr(n_data, (const char *)data, 1);
14129        des_int(n_datalen, datalen, 2);
14130        des_parseroptions(n_options, options, 3);
14131        des_xmlNodePtr_ptr(n_lst, lst, 4);
14132        xmlResetLastError();
14133        if (mem_base != xmlMemBlocks()) {
14134            printf("Leak of %d blocks found in xmlParseInNodeContext",
14135	           xmlMemBlocks() - mem_base);
14136	    test_ret++;
14137            printf(" %d", n_node);
14138            printf(" %d", n_data);
14139            printf(" %d", n_datalen);
14140            printf(" %d", n_options);
14141            printf(" %d", n_lst);
14142            printf("\n");
14143        }
14144    }
14145    }
14146    }
14147    }
14148    }
14149    function_tests++;
14150
14151    return(test_ret);
14152}
14153
14154
14155static int
14156test_xmlParseMemory(void) {
14157    int test_ret = 0;
14158
14159#if defined(LIBXML_SAX1_ENABLED)
14160#ifdef LIBXML_SAX1_ENABLED
14161    int mem_base;
14162    xmlDocPtr ret_val;
14163    char * buffer; /* an pointer to a char array */
14164    int n_buffer;
14165    int size; /* the size of the array */
14166    int n_size;
14167
14168    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14169    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14170        mem_base = xmlMemBlocks();
14171        buffer = gen_const_char_ptr(n_buffer, 0);
14172        size = gen_int(n_size, 1);
14173
14174        ret_val = xmlParseMemory((const char *)buffer, size);
14175        desret_xmlDocPtr(ret_val);
14176        call_tests++;
14177        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14178        des_int(n_size, size, 1);
14179        xmlResetLastError();
14180        if (mem_base != xmlMemBlocks()) {
14181            printf("Leak of %d blocks found in xmlParseMemory",
14182	           xmlMemBlocks() - mem_base);
14183	    test_ret++;
14184            printf(" %d", n_buffer);
14185            printf(" %d", n_size);
14186            printf("\n");
14187        }
14188    }
14189    }
14190    function_tests++;
14191#endif
14192#endif
14193
14194    return(test_ret);
14195}
14196
14197
14198#define gen_nb_const_xmlParserNodeInfoPtr 1
14199static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14200    return(NULL);
14201}
14202static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14203}
14204
14205static int
14206test_xmlParserAddNodeInfo(void) {
14207    int test_ret = 0;
14208
14209    int mem_base;
14210    xmlParserCtxtPtr ctxt; /* an XML parser context */
14211    int n_ctxt;
14212    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14213    int n_info;
14214
14215    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14216    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14217        mem_base = xmlMemBlocks();
14218        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14219        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14220
14221        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14222        call_tests++;
14223        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14224        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14225        xmlResetLastError();
14226        if (mem_base != xmlMemBlocks()) {
14227            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14228	           xmlMemBlocks() - mem_base);
14229	    test_ret++;
14230            printf(" %d", n_ctxt);
14231            printf(" %d", n_info);
14232            printf("\n");
14233        }
14234    }
14235    }
14236    function_tests++;
14237
14238    return(test_ret);
14239}
14240
14241
14242#define gen_nb_const_xmlParserCtxtPtr 1
14243static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14244    return(NULL);
14245}
14246static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14247}
14248
14249#define gen_nb_const_xmlNodePtr 1
14250static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14251    return(NULL);
14252}
14253static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14254}
14255
14256static int
14257test_xmlParserFindNodeInfo(void) {
14258    int test_ret = 0;
14259
14260    int mem_base;
14261    const xmlParserNodeInfo * ret_val;
14262    xmlParserCtxtPtr ctx; /* an XML parser context */
14263    int n_ctx;
14264    xmlNodePtr node; /* an XML node within the tree */
14265    int n_node;
14266
14267    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14268    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14269        mem_base = xmlMemBlocks();
14270        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14271        node = gen_const_xmlNodePtr(n_node, 1);
14272
14273        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14274        desret_const_xmlParserNodeInfo_ptr(ret_val);
14275        call_tests++;
14276        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14277        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14278        xmlResetLastError();
14279        if (mem_base != xmlMemBlocks()) {
14280            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14281	           xmlMemBlocks() - mem_base);
14282	    test_ret++;
14283            printf(" %d", n_ctx);
14284            printf(" %d", n_node);
14285            printf("\n");
14286        }
14287    }
14288    }
14289    function_tests++;
14290
14291    return(test_ret);
14292}
14293
14294
14295#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14296static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14297    return(NULL);
14298}
14299static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14300}
14301
14302static int
14303test_xmlParserFindNodeInfoIndex(void) {
14304    int test_ret = 0;
14305
14306    int mem_base;
14307    unsigned long ret_val;
14308    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14309    int n_seq;
14310    xmlNodePtr node; /* an XML node pointer */
14311    int n_node;
14312
14313    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14314    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14315        mem_base = xmlMemBlocks();
14316        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14317        node = gen_const_xmlNodePtr(n_node, 1);
14318
14319        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14320        desret_unsigned_long(ret_val);
14321        call_tests++;
14322        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14323        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14324        xmlResetLastError();
14325        if (mem_base != xmlMemBlocks()) {
14326            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14327	           xmlMemBlocks() - mem_base);
14328	    test_ret++;
14329            printf(" %d", n_seq);
14330            printf(" %d", n_node);
14331            printf("\n");
14332        }
14333    }
14334    }
14335    function_tests++;
14336
14337    return(test_ret);
14338}
14339
14340
14341#define gen_nb_xmlParserInputPtr 1
14342static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14343    return(NULL);
14344}
14345static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14346}
14347
14348static int
14349test_xmlParserInputGrow(void) {
14350    int test_ret = 0;
14351
14352    int mem_base;
14353    int ret_val;
14354    xmlParserInputPtr in; /* an XML parser input */
14355    int n_in;
14356    int len; /* an indicative size for the lookahead */
14357    int n_len;
14358
14359    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14360    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14361        mem_base = xmlMemBlocks();
14362        in = gen_xmlParserInputPtr(n_in, 0);
14363        len = gen_int(n_len, 1);
14364
14365        ret_val = xmlParserInputGrow(in, len);
14366        desret_int(ret_val);
14367        call_tests++;
14368        des_xmlParserInputPtr(n_in, in, 0);
14369        des_int(n_len, len, 1);
14370        xmlResetLastError();
14371        if (mem_base != xmlMemBlocks()) {
14372            printf("Leak of %d blocks found in xmlParserInputGrow",
14373	           xmlMemBlocks() - mem_base);
14374	    test_ret++;
14375            printf(" %d", n_in);
14376            printf(" %d", n_len);
14377            printf("\n");
14378        }
14379    }
14380    }
14381    function_tests++;
14382
14383    return(test_ret);
14384}
14385
14386
14387static int
14388test_xmlParserInputRead(void) {
14389    int test_ret = 0;
14390
14391    int mem_base;
14392    int ret_val;
14393    xmlParserInputPtr in; /* an XML parser input */
14394    int n_in;
14395    int len; /* an indicative size for the lookahead */
14396    int n_len;
14397
14398    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14399    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14400        mem_base = xmlMemBlocks();
14401        in = gen_xmlParserInputPtr(n_in, 0);
14402        len = gen_int(n_len, 1);
14403
14404        ret_val = xmlParserInputRead(in, len);
14405        desret_int(ret_val);
14406        call_tests++;
14407        des_xmlParserInputPtr(n_in, in, 0);
14408        des_int(n_len, len, 1);
14409        xmlResetLastError();
14410        if (mem_base != xmlMemBlocks()) {
14411            printf("Leak of %d blocks found in xmlParserInputRead",
14412	           xmlMemBlocks() - mem_base);
14413	    test_ret++;
14414            printf(" %d", n_in);
14415            printf(" %d", n_len);
14416            printf("\n");
14417        }
14418    }
14419    }
14420    function_tests++;
14421
14422    return(test_ret);
14423}
14424
14425
14426static int
14427test_xmlPedanticParserDefault(void) {
14428    int test_ret = 0;
14429
14430    int mem_base;
14431    int ret_val;
14432    int val; /* int 0 or 1 */
14433    int n_val;
14434
14435    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14436        mem_base = xmlMemBlocks();
14437        val = gen_int(n_val, 0);
14438
14439        ret_val = xmlPedanticParserDefault(val);
14440        desret_int(ret_val);
14441        call_tests++;
14442        des_int(n_val, val, 0);
14443        xmlResetLastError();
14444        if (mem_base != xmlMemBlocks()) {
14445            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14446	           xmlMemBlocks() - mem_base);
14447	    test_ret++;
14448            printf(" %d", n_val);
14449            printf("\n");
14450        }
14451    }
14452    function_tests++;
14453
14454    return(test_ret);
14455}
14456
14457
14458static int
14459test_xmlReadDoc(void) {
14460    int test_ret = 0;
14461
14462    int mem_base;
14463    xmlDocPtr ret_val;
14464    xmlChar * cur; /* a pointer to a zero terminated string */
14465    int n_cur;
14466    const char * URL; /* the base URL to use for the document */
14467    int n_URL;
14468    char * encoding; /* the document encoding, or NULL */
14469    int n_encoding;
14470    int options; /* a combination of xmlParserOption */
14471    int n_options;
14472
14473    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14474    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14475    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14476    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14477        mem_base = xmlMemBlocks();
14478        cur = gen_const_xmlChar_ptr(n_cur, 0);
14479        URL = gen_filepath(n_URL, 1);
14480        encoding = gen_const_char_ptr(n_encoding, 2);
14481        options = gen_parseroptions(n_options, 3);
14482
14483        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14484        desret_xmlDocPtr(ret_val);
14485        call_tests++;
14486        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14487        des_filepath(n_URL, URL, 1);
14488        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14489        des_parseroptions(n_options, options, 3);
14490        xmlResetLastError();
14491        if (mem_base != xmlMemBlocks()) {
14492            printf("Leak of %d blocks found in xmlReadDoc",
14493	           xmlMemBlocks() - mem_base);
14494	    test_ret++;
14495            printf(" %d", n_cur);
14496            printf(" %d", n_URL);
14497            printf(" %d", n_encoding);
14498            printf(" %d", n_options);
14499            printf("\n");
14500        }
14501    }
14502    }
14503    }
14504    }
14505    function_tests++;
14506
14507    return(test_ret);
14508}
14509
14510
14511static int
14512test_xmlReadFile(void) {
14513    int test_ret = 0;
14514
14515    int mem_base;
14516    xmlDocPtr ret_val;
14517    const char * filename; /* a file or URL */
14518    int n_filename;
14519    char * encoding; /* the document encoding, or NULL */
14520    int n_encoding;
14521    int options; /* a combination of xmlParserOption */
14522    int n_options;
14523
14524    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14525    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14526    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14527        mem_base = xmlMemBlocks();
14528        filename = gen_filepath(n_filename, 0);
14529        encoding = gen_const_char_ptr(n_encoding, 1);
14530        options = gen_parseroptions(n_options, 2);
14531
14532        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14533        desret_xmlDocPtr(ret_val);
14534        call_tests++;
14535        des_filepath(n_filename, filename, 0);
14536        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14537        des_parseroptions(n_options, options, 2);
14538        xmlResetLastError();
14539        if (mem_base != xmlMemBlocks()) {
14540            printf("Leak of %d blocks found in xmlReadFile",
14541	           xmlMemBlocks() - mem_base);
14542	    test_ret++;
14543            printf(" %d", n_filename);
14544            printf(" %d", n_encoding);
14545            printf(" %d", n_options);
14546            printf("\n");
14547        }
14548    }
14549    }
14550    }
14551    function_tests++;
14552
14553    return(test_ret);
14554}
14555
14556
14557static int
14558test_xmlReadMemory(void) {
14559    int test_ret = 0;
14560
14561    int mem_base;
14562    xmlDocPtr ret_val;
14563    char * buffer; /* a pointer to a char array */
14564    int n_buffer;
14565    int size; /* the size of the array */
14566    int n_size;
14567    const char * URL; /* the base URL to use for the document */
14568    int n_URL;
14569    char * encoding; /* the document encoding, or NULL */
14570    int n_encoding;
14571    int options; /* a combination of xmlParserOption */
14572    int n_options;
14573
14574    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14575    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14576    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14577    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14578    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14579        mem_base = xmlMemBlocks();
14580        buffer = gen_const_char_ptr(n_buffer, 0);
14581        size = gen_int(n_size, 1);
14582        URL = gen_filepath(n_URL, 2);
14583        encoding = gen_const_char_ptr(n_encoding, 3);
14584        options = gen_parseroptions(n_options, 4);
14585
14586        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14587        desret_xmlDocPtr(ret_val);
14588        call_tests++;
14589        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14590        des_int(n_size, size, 1);
14591        des_filepath(n_URL, URL, 2);
14592        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14593        des_parseroptions(n_options, options, 4);
14594        xmlResetLastError();
14595        if (mem_base != xmlMemBlocks()) {
14596            printf("Leak of %d blocks found in xmlReadMemory",
14597	           xmlMemBlocks() - mem_base);
14598	    test_ret++;
14599            printf(" %d", n_buffer);
14600            printf(" %d", n_size);
14601            printf(" %d", n_URL);
14602            printf(" %d", n_encoding);
14603            printf(" %d", n_options);
14604            printf("\n");
14605        }
14606    }
14607    }
14608    }
14609    }
14610    }
14611    function_tests++;
14612
14613    return(test_ret);
14614}
14615
14616
14617static int
14618test_xmlRecoverDoc(void) {
14619    int test_ret = 0;
14620
14621#if defined(LIBXML_SAX1_ENABLED)
14622#ifdef LIBXML_SAX1_ENABLED
14623    int mem_base;
14624    xmlDocPtr ret_val;
14625    xmlChar * cur; /* a pointer to an array of xmlChar */
14626    int n_cur;
14627
14628    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14629        mem_base = xmlMemBlocks();
14630        cur = gen_const_xmlChar_ptr(n_cur, 0);
14631
14632        ret_val = xmlRecoverDoc((const xmlChar *)cur);
14633        desret_xmlDocPtr(ret_val);
14634        call_tests++;
14635        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14636        xmlResetLastError();
14637        if (mem_base != xmlMemBlocks()) {
14638            printf("Leak of %d blocks found in xmlRecoverDoc",
14639	           xmlMemBlocks() - mem_base);
14640	    test_ret++;
14641            printf(" %d", n_cur);
14642            printf("\n");
14643        }
14644    }
14645    function_tests++;
14646#endif
14647#endif
14648
14649    return(test_ret);
14650}
14651
14652
14653static int
14654test_xmlRecoverFile(void) {
14655    int test_ret = 0;
14656
14657#if defined(LIBXML_SAX1_ENABLED)
14658#ifdef LIBXML_SAX1_ENABLED
14659    int mem_base;
14660    xmlDocPtr ret_val;
14661    const char * filename; /* the filename */
14662    int n_filename;
14663
14664    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14665        mem_base = xmlMemBlocks();
14666        filename = gen_filepath(n_filename, 0);
14667
14668        ret_val = xmlRecoverFile(filename);
14669        desret_xmlDocPtr(ret_val);
14670        call_tests++;
14671        des_filepath(n_filename, filename, 0);
14672        xmlResetLastError();
14673        if (mem_base != xmlMemBlocks()) {
14674            printf("Leak of %d blocks found in xmlRecoverFile",
14675	           xmlMemBlocks() - mem_base);
14676	    test_ret++;
14677            printf(" %d", n_filename);
14678            printf("\n");
14679        }
14680    }
14681    function_tests++;
14682#endif
14683#endif
14684
14685    return(test_ret);
14686}
14687
14688
14689static int
14690test_xmlRecoverMemory(void) {
14691    int test_ret = 0;
14692
14693#if defined(LIBXML_SAX1_ENABLED)
14694#ifdef LIBXML_SAX1_ENABLED
14695    int mem_base;
14696    xmlDocPtr ret_val;
14697    char * buffer; /* an pointer to a char array */
14698    int n_buffer;
14699    int size; /* the size of the array */
14700    int n_size;
14701
14702    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14703    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14704        mem_base = xmlMemBlocks();
14705        buffer = gen_const_char_ptr(n_buffer, 0);
14706        size = gen_int(n_size, 1);
14707
14708        ret_val = xmlRecoverMemory((const char *)buffer, size);
14709        desret_xmlDocPtr(ret_val);
14710        call_tests++;
14711        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14712        des_int(n_size, size, 1);
14713        xmlResetLastError();
14714        if (mem_base != xmlMemBlocks()) {
14715            printf("Leak of %d blocks found in xmlRecoverMemory",
14716	           xmlMemBlocks() - mem_base);
14717	    test_ret++;
14718            printf(" %d", n_buffer);
14719            printf(" %d", n_size);
14720            printf("\n");
14721        }
14722    }
14723    }
14724    function_tests++;
14725#endif
14726#endif
14727
14728    return(test_ret);
14729}
14730
14731
14732static int
14733test_xmlSAXParseDTD(void) {
14734    int test_ret = 0;
14735
14736#if defined(LIBXML_VALID_ENABLED)
14737#ifdef LIBXML_SAX1_ENABLED
14738    int mem_base;
14739    xmlDtdPtr ret_val;
14740    xmlSAXHandlerPtr sax; /* the SAX handler block */
14741    int n_sax;
14742    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14743    int n_ExternalID;
14744    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14745    int n_SystemID;
14746
14747    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14748    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14749    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14750        mem_base = xmlMemBlocks();
14751        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14752        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14753        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14754
14755        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14756        desret_xmlDtdPtr(ret_val);
14757        call_tests++;
14758        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14759        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14760        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14761        xmlResetLastError();
14762        if (mem_base != xmlMemBlocks()) {
14763            printf("Leak of %d blocks found in xmlSAXParseDTD",
14764	           xmlMemBlocks() - mem_base);
14765	    test_ret++;
14766            printf(" %d", n_sax);
14767            printf(" %d", n_ExternalID);
14768            printf(" %d", n_SystemID);
14769            printf("\n");
14770        }
14771    }
14772    }
14773    }
14774    function_tests++;
14775#endif
14776#endif
14777
14778    return(test_ret);
14779}
14780
14781
14782static int
14783test_xmlSAXParseDoc(void) {
14784    int test_ret = 0;
14785
14786#if defined(LIBXML_SAX1_ENABLED)
14787#ifdef LIBXML_SAX1_ENABLED
14788    int mem_base;
14789    xmlDocPtr ret_val;
14790    xmlSAXHandlerPtr sax; /* the SAX handler block */
14791    int n_sax;
14792    xmlChar * cur; /* a pointer to an array of xmlChar */
14793    int n_cur;
14794    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14795    int n_recovery;
14796
14797    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14798    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14799    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14800        mem_base = xmlMemBlocks();
14801        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14802        cur = gen_const_xmlChar_ptr(n_cur, 1);
14803        recovery = gen_int(n_recovery, 2);
14804
14805        ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14806        desret_xmlDocPtr(ret_val);
14807        call_tests++;
14808        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14809        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14810        des_int(n_recovery, recovery, 2);
14811        xmlResetLastError();
14812        if (mem_base != xmlMemBlocks()) {
14813            printf("Leak of %d blocks found in xmlSAXParseDoc",
14814	           xmlMemBlocks() - mem_base);
14815	    test_ret++;
14816            printf(" %d", n_sax);
14817            printf(" %d", n_cur);
14818            printf(" %d", n_recovery);
14819            printf("\n");
14820        }
14821    }
14822    }
14823    }
14824    function_tests++;
14825#endif
14826#endif
14827
14828    return(test_ret);
14829}
14830
14831
14832static int
14833test_xmlSAXParseEntity(void) {
14834    int test_ret = 0;
14835
14836#if defined(LIBXML_SAX1_ENABLED)
14837#ifdef LIBXML_SAX1_ENABLED
14838    int mem_base;
14839    xmlDocPtr ret_val;
14840    xmlSAXHandlerPtr sax; /* the SAX handler block */
14841    int n_sax;
14842    const char * filename; /* the filename */
14843    int n_filename;
14844
14845    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14846    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14847        mem_base = xmlMemBlocks();
14848        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14849        filename = gen_filepath(n_filename, 1);
14850
14851        ret_val = xmlSAXParseEntity(sax, filename);
14852        desret_xmlDocPtr(ret_val);
14853        call_tests++;
14854        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14855        des_filepath(n_filename, filename, 1);
14856        xmlResetLastError();
14857        if (mem_base != xmlMemBlocks()) {
14858            printf("Leak of %d blocks found in xmlSAXParseEntity",
14859	           xmlMemBlocks() - mem_base);
14860	    test_ret++;
14861            printf(" %d", n_sax);
14862            printf(" %d", n_filename);
14863            printf("\n");
14864        }
14865    }
14866    }
14867    function_tests++;
14868#endif
14869#endif
14870
14871    return(test_ret);
14872}
14873
14874
14875static int
14876test_xmlSAXParseFile(void) {
14877    int test_ret = 0;
14878
14879#if defined(LIBXML_SAX1_ENABLED)
14880#ifdef LIBXML_SAX1_ENABLED
14881    int mem_base;
14882    xmlDocPtr ret_val;
14883    xmlSAXHandlerPtr sax; /* the SAX handler block */
14884    int n_sax;
14885    const char * filename; /* the filename */
14886    int n_filename;
14887    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14888    int n_recovery;
14889
14890    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14891    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14892    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14893        mem_base = xmlMemBlocks();
14894        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14895        filename = gen_filepath(n_filename, 1);
14896        recovery = gen_int(n_recovery, 2);
14897
14898        ret_val = xmlSAXParseFile(sax, filename, recovery);
14899        desret_xmlDocPtr(ret_val);
14900        call_tests++;
14901        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14902        des_filepath(n_filename, filename, 1);
14903        des_int(n_recovery, recovery, 2);
14904        xmlResetLastError();
14905        if (mem_base != xmlMemBlocks()) {
14906            printf("Leak of %d blocks found in xmlSAXParseFile",
14907	           xmlMemBlocks() - mem_base);
14908	    test_ret++;
14909            printf(" %d", n_sax);
14910            printf(" %d", n_filename);
14911            printf(" %d", n_recovery);
14912            printf("\n");
14913        }
14914    }
14915    }
14916    }
14917    function_tests++;
14918#endif
14919#endif
14920
14921    return(test_ret);
14922}
14923
14924
14925static int
14926test_xmlSAXParseFileWithData(void) {
14927    int test_ret = 0;
14928
14929#if defined(LIBXML_SAX1_ENABLED)
14930#ifdef LIBXML_SAX1_ENABLED
14931    int mem_base;
14932    xmlDocPtr ret_val;
14933    xmlSAXHandlerPtr sax; /* the SAX handler block */
14934    int n_sax;
14935    const char * filename; /* the filename */
14936    int n_filename;
14937    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14938    int n_recovery;
14939    void * data; /* the userdata */
14940    int n_data;
14941
14942    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14943    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14944    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14945    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14946        mem_base = xmlMemBlocks();
14947        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14948        filename = gen_filepath(n_filename, 1);
14949        recovery = gen_int(n_recovery, 2);
14950        data = gen_userdata(n_data, 3);
14951
14952        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14953        desret_xmlDocPtr(ret_val);
14954        call_tests++;
14955        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14956        des_filepath(n_filename, filename, 1);
14957        des_int(n_recovery, recovery, 2);
14958        des_userdata(n_data, data, 3);
14959        xmlResetLastError();
14960        if (mem_base != xmlMemBlocks()) {
14961            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14962	           xmlMemBlocks() - mem_base);
14963	    test_ret++;
14964            printf(" %d", n_sax);
14965            printf(" %d", n_filename);
14966            printf(" %d", n_recovery);
14967            printf(" %d", n_data);
14968            printf("\n");
14969        }
14970    }
14971    }
14972    }
14973    }
14974    function_tests++;
14975#endif
14976#endif
14977
14978    return(test_ret);
14979}
14980
14981
14982static int
14983test_xmlSAXParseMemory(void) {
14984    int test_ret = 0;
14985
14986#if defined(LIBXML_SAX1_ENABLED)
14987#ifdef LIBXML_SAX1_ENABLED
14988    int mem_base;
14989    xmlDocPtr ret_val;
14990    xmlSAXHandlerPtr sax; /* the SAX handler block */
14991    int n_sax;
14992    char * buffer; /* an pointer to a char array */
14993    int n_buffer;
14994    int size; /* the size of the array */
14995    int n_size;
14996    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14997    int n_recovery;
14998
14999    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15000    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15001    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15002    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15003        mem_base = xmlMemBlocks();
15004        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15005        buffer = gen_const_char_ptr(n_buffer, 1);
15006        size = gen_int(n_size, 2);
15007        recovery = gen_int(n_recovery, 3);
15008
15009        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15010        desret_xmlDocPtr(ret_val);
15011        call_tests++;
15012        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15013        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15014        des_int(n_size, size, 2);
15015        des_int(n_recovery, recovery, 3);
15016        xmlResetLastError();
15017        if (mem_base != xmlMemBlocks()) {
15018            printf("Leak of %d blocks found in xmlSAXParseMemory",
15019	           xmlMemBlocks() - mem_base);
15020	    test_ret++;
15021            printf(" %d", n_sax);
15022            printf(" %d", n_buffer);
15023            printf(" %d", n_size);
15024            printf(" %d", n_recovery);
15025            printf("\n");
15026        }
15027    }
15028    }
15029    }
15030    }
15031    function_tests++;
15032#endif
15033#endif
15034
15035    return(test_ret);
15036}
15037
15038
15039static int
15040test_xmlSAXParseMemoryWithData(void) {
15041    int test_ret = 0;
15042
15043#if defined(LIBXML_SAX1_ENABLED)
15044#ifdef LIBXML_SAX1_ENABLED
15045    int mem_base;
15046    xmlDocPtr ret_val;
15047    xmlSAXHandlerPtr sax; /* the SAX handler block */
15048    int n_sax;
15049    char * buffer; /* an pointer to a char array */
15050    int n_buffer;
15051    int size; /* the size of the array */
15052    int n_size;
15053    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15054    int n_recovery;
15055    void * data; /* the userdata */
15056    int n_data;
15057
15058    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15059    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15060    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15061    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15062    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15063        mem_base = xmlMemBlocks();
15064        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15065        buffer = gen_const_char_ptr(n_buffer, 1);
15066        size = gen_int(n_size, 2);
15067        recovery = gen_int(n_recovery, 3);
15068        data = gen_userdata(n_data, 4);
15069
15070        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15071        desret_xmlDocPtr(ret_val);
15072        call_tests++;
15073        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15074        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15075        des_int(n_size, size, 2);
15076        des_int(n_recovery, recovery, 3);
15077        des_userdata(n_data, data, 4);
15078        xmlResetLastError();
15079        if (mem_base != xmlMemBlocks()) {
15080            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15081	           xmlMemBlocks() - mem_base);
15082	    test_ret++;
15083            printf(" %d", n_sax);
15084            printf(" %d", n_buffer);
15085            printf(" %d", n_size);
15086            printf(" %d", n_recovery);
15087            printf(" %d", n_data);
15088            printf("\n");
15089        }
15090    }
15091    }
15092    }
15093    }
15094    }
15095    function_tests++;
15096#endif
15097#endif
15098
15099    return(test_ret);
15100}
15101
15102
15103static int
15104test_xmlSAXUserParseFile(void) {
15105    int test_ret = 0;
15106
15107#if defined(LIBXML_SAX1_ENABLED)
15108#ifdef LIBXML_SAX1_ENABLED
15109    int mem_base;
15110    int ret_val;
15111    xmlSAXHandlerPtr sax; /* a SAX handler */
15112    int n_sax;
15113    void * user_data; /* The user data returned on SAX callbacks */
15114    int n_user_data;
15115    const char * filename; /* a file name */
15116    int n_filename;
15117
15118    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15119    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15120    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15121        mem_base = xmlMemBlocks();
15122        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15123        user_data = gen_userdata(n_user_data, 1);
15124        filename = gen_filepath(n_filename, 2);
15125
15126#ifdef LIBXML_SAX1_ENABLED
15127        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15128#endif
15129
15130
15131        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15132        desret_int(ret_val);
15133        call_tests++;
15134        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15135        des_userdata(n_user_data, user_data, 1);
15136        des_filepath(n_filename, filename, 2);
15137        xmlResetLastError();
15138        if (mem_base != xmlMemBlocks()) {
15139            printf("Leak of %d blocks found in xmlSAXUserParseFile",
15140	           xmlMemBlocks() - mem_base);
15141	    test_ret++;
15142            printf(" %d", n_sax);
15143            printf(" %d", n_user_data);
15144            printf(" %d", n_filename);
15145            printf("\n");
15146        }
15147    }
15148    }
15149    }
15150    function_tests++;
15151#endif
15152#endif
15153
15154    return(test_ret);
15155}
15156
15157
15158static int
15159test_xmlSAXUserParseMemory(void) {
15160    int test_ret = 0;
15161
15162#if defined(LIBXML_SAX1_ENABLED)
15163#ifdef LIBXML_SAX1_ENABLED
15164    int mem_base;
15165    int ret_val;
15166    xmlSAXHandlerPtr sax; /* a SAX handler */
15167    int n_sax;
15168    void * user_data; /* The user data returned on SAX callbacks */
15169    int n_user_data;
15170    char * buffer; /* an in-memory XML document input */
15171    int n_buffer;
15172    int size; /* the length of the XML document in bytes */
15173    int n_size;
15174
15175    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15176    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15177    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15178    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15179        mem_base = xmlMemBlocks();
15180        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15181        user_data = gen_userdata(n_user_data, 1);
15182        buffer = gen_const_char_ptr(n_buffer, 2);
15183        size = gen_int(n_size, 3);
15184
15185#ifdef LIBXML_SAX1_ENABLED
15186        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15187#endif
15188
15189
15190        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15191        desret_int(ret_val);
15192        call_tests++;
15193        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15194        des_userdata(n_user_data, user_data, 1);
15195        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15196        des_int(n_size, size, 3);
15197        xmlResetLastError();
15198        if (mem_base != xmlMemBlocks()) {
15199            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15200	           xmlMemBlocks() - mem_base);
15201	    test_ret++;
15202            printf(" %d", n_sax);
15203            printf(" %d", n_user_data);
15204            printf(" %d", n_buffer);
15205            printf(" %d", n_size);
15206            printf("\n");
15207        }
15208    }
15209    }
15210    }
15211    }
15212    function_tests++;
15213#endif
15214#endif
15215
15216    return(test_ret);
15217}
15218
15219
15220static int
15221test_xmlSetExternalEntityLoader(void) {
15222    int test_ret = 0;
15223
15224
15225    /* missing type support */
15226    return(test_ret);
15227}
15228
15229
15230static int
15231test_xmlSetFeature(void) {
15232    int test_ret = 0;
15233
15234#if defined(LIBXML_LEGACY_ENABLED)
15235#ifdef LIBXML_LEGACY_ENABLED
15236    int mem_base;
15237    int ret_val;
15238    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15239    int n_ctxt;
15240    char * name; /* the feature name */
15241    int n_name;
15242    void * value; /* pointer to the location of the new value */
15243    int n_value;
15244
15245    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15246    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15247    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15248        mem_base = xmlMemBlocks();
15249        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15250        name = gen_const_char_ptr(n_name, 1);
15251        value = gen_void_ptr(n_value, 2);
15252
15253        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15254        desret_int(ret_val);
15255        call_tests++;
15256        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15257        des_const_char_ptr(n_name, (const char *)name, 1);
15258        des_void_ptr(n_value, value, 2);
15259        xmlResetLastError();
15260        if (mem_base != xmlMemBlocks()) {
15261            printf("Leak of %d blocks found in xmlSetFeature",
15262	           xmlMemBlocks() - mem_base);
15263	    test_ret++;
15264            printf(" %d", n_ctxt);
15265            printf(" %d", n_name);
15266            printf(" %d", n_value);
15267            printf("\n");
15268        }
15269    }
15270    }
15271    }
15272    function_tests++;
15273#endif
15274#endif
15275
15276    return(test_ret);
15277}
15278
15279
15280static int
15281test_xmlSetupParserForBuffer(void) {
15282    int test_ret = 0;
15283
15284#if defined(LIBXML_SAX1_ENABLED)
15285#ifdef LIBXML_SAX1_ENABLED
15286    int mem_base;
15287    xmlParserCtxtPtr ctxt; /* an XML parser context */
15288    int n_ctxt;
15289    xmlChar * buffer; /* a xmlChar * buffer */
15290    int n_buffer;
15291    const char * filename; /* a file name */
15292    int n_filename;
15293
15294    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15295    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15296    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15297        mem_base = xmlMemBlocks();
15298        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15299        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15300        filename = gen_filepath(n_filename, 2);
15301
15302        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15303        call_tests++;
15304        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15305        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15306        des_filepath(n_filename, filename, 2);
15307        xmlResetLastError();
15308        if (mem_base != xmlMemBlocks()) {
15309            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15310	           xmlMemBlocks() - mem_base);
15311	    test_ret++;
15312            printf(" %d", n_ctxt);
15313            printf(" %d", n_buffer);
15314            printf(" %d", n_filename);
15315            printf("\n");
15316        }
15317    }
15318    }
15319    }
15320    function_tests++;
15321#endif
15322#endif
15323
15324    return(test_ret);
15325}
15326
15327
15328static int
15329test_xmlStopParser(void) {
15330    int test_ret = 0;
15331
15332#ifdef LIBXML_PUSH_ENABLED
15333    int mem_base;
15334    xmlParserCtxtPtr ctxt; /* an XML parser context */
15335    int n_ctxt;
15336
15337    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15338        mem_base = xmlMemBlocks();
15339        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15340
15341        xmlStopParser(ctxt);
15342        call_tests++;
15343        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15344        xmlResetLastError();
15345        if (mem_base != xmlMemBlocks()) {
15346            printf("Leak of %d blocks found in xmlStopParser",
15347	           xmlMemBlocks() - mem_base);
15348	    test_ret++;
15349            printf(" %d", n_ctxt);
15350            printf("\n");
15351        }
15352    }
15353    function_tests++;
15354#endif
15355
15356    return(test_ret);
15357}
15358
15359
15360static int
15361test_xmlSubstituteEntitiesDefault(void) {
15362    int test_ret = 0;
15363
15364    int mem_base;
15365    int ret_val;
15366    int val; /* int 0 or 1 */
15367    int n_val;
15368
15369    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15370        mem_base = xmlMemBlocks();
15371        val = gen_int(n_val, 0);
15372
15373        ret_val = xmlSubstituteEntitiesDefault(val);
15374        desret_int(ret_val);
15375        call_tests++;
15376        des_int(n_val, val, 0);
15377        xmlResetLastError();
15378        if (mem_base != xmlMemBlocks()) {
15379            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15380	           xmlMemBlocks() - mem_base);
15381	    test_ret++;
15382            printf(" %d", n_val);
15383            printf("\n");
15384        }
15385    }
15386    function_tests++;
15387
15388    return(test_ret);
15389}
15390
15391static int
15392test_parser(void) {
15393    int test_ret = 0;
15394
15395    if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15396    test_ret += test_xmlByteConsumed();
15397    test_ret += test_xmlClearNodeInfoSeq();
15398    test_ret += test_xmlClearParserCtxt();
15399    test_ret += test_xmlCreateDocParserCtxt();
15400    test_ret += test_xmlCreatePushParserCtxt();
15401    test_ret += test_xmlCtxtReadDoc();
15402    test_ret += test_xmlCtxtReadFile();
15403    test_ret += test_xmlCtxtReadMemory();
15404    test_ret += test_xmlCtxtReset();
15405    test_ret += test_xmlCtxtResetPush();
15406    test_ret += test_xmlCtxtUseOptions();
15407    test_ret += test_xmlGetExternalEntityLoader();
15408    test_ret += test_xmlGetFeature();
15409    test_ret += test_xmlGetFeaturesList();
15410    test_ret += test_xmlHasFeature();
15411    test_ret += test_xmlIOParseDTD();
15412    test_ret += test_xmlInitNodeInfoSeq();
15413    test_ret += test_xmlInitParser();
15414    test_ret += test_xmlInitParserCtxt();
15415    test_ret += test_xmlKeepBlanksDefault();
15416    test_ret += test_xmlLineNumbersDefault();
15417    test_ret += test_xmlLoadExternalEntity();
15418    test_ret += test_xmlNewIOInputStream();
15419    test_ret += test_xmlNewParserCtxt();
15420    test_ret += test_xmlParseBalancedChunkMemory();
15421    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15422    test_ret += test_xmlParseChunk();
15423    test_ret += test_xmlParseCtxtExternalEntity();
15424    test_ret += test_xmlParseDTD();
15425    test_ret += test_xmlParseDoc();
15426    test_ret += test_xmlParseDocument();
15427    test_ret += test_xmlParseEntity();
15428    test_ret += test_xmlParseExtParsedEnt();
15429    test_ret += test_xmlParseExternalEntity();
15430    test_ret += test_xmlParseFile();
15431    test_ret += test_xmlParseInNodeContext();
15432    test_ret += test_xmlParseMemory();
15433    test_ret += test_xmlParserAddNodeInfo();
15434    test_ret += test_xmlParserFindNodeInfo();
15435    test_ret += test_xmlParserFindNodeInfoIndex();
15436    test_ret += test_xmlParserInputGrow();
15437    test_ret += test_xmlParserInputRead();
15438    test_ret += test_xmlPedanticParserDefault();
15439    test_ret += test_xmlReadDoc();
15440    test_ret += test_xmlReadFile();
15441    test_ret += test_xmlReadMemory();
15442    test_ret += test_xmlRecoverDoc();
15443    test_ret += test_xmlRecoverFile();
15444    test_ret += test_xmlRecoverMemory();
15445    test_ret += test_xmlSAXParseDTD();
15446    test_ret += test_xmlSAXParseDoc();
15447    test_ret += test_xmlSAXParseEntity();
15448    test_ret += test_xmlSAXParseFile();
15449    test_ret += test_xmlSAXParseFileWithData();
15450    test_ret += test_xmlSAXParseMemory();
15451    test_ret += test_xmlSAXParseMemoryWithData();
15452    test_ret += test_xmlSAXUserParseFile();
15453    test_ret += test_xmlSAXUserParseMemory();
15454    test_ret += test_xmlSetExternalEntityLoader();
15455    test_ret += test_xmlSetFeature();
15456    test_ret += test_xmlSetupParserForBuffer();
15457    test_ret += test_xmlStopParser();
15458    test_ret += test_xmlSubstituteEntitiesDefault();
15459
15460    if (test_ret != 0)
15461	printf("Module parser: %d errors\n", test_ret);
15462    return(test_ret);
15463}
15464
15465static int
15466test_htmlCreateFileParserCtxt(void) {
15467    int test_ret = 0;
15468
15469#if defined(LIBXML_HTML_ENABLED)
15470    int mem_base;
15471    htmlParserCtxtPtr ret_val;
15472    const char * filename; /* the filename */
15473    int n_filename;
15474    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15475    int n_encoding;
15476
15477    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15478    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15479        mem_base = xmlMemBlocks();
15480        filename = gen_fileoutput(n_filename, 0);
15481        encoding = gen_const_char_ptr(n_encoding, 1);
15482
15483        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15484        desret_htmlParserCtxtPtr(ret_val);
15485        call_tests++;
15486        des_fileoutput(n_filename, filename, 0);
15487        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15488        xmlResetLastError();
15489        if (mem_base != xmlMemBlocks()) {
15490            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15491	           xmlMemBlocks() - mem_base);
15492	    test_ret++;
15493            printf(" %d", n_filename);
15494            printf(" %d", n_encoding);
15495            printf("\n");
15496        }
15497    }
15498    }
15499    function_tests++;
15500#endif
15501
15502    return(test_ret);
15503}
15504
15505
15506static int
15507test_htmlInitAutoClose(void) {
15508    int test_ret = 0;
15509
15510#if defined(LIBXML_HTML_ENABLED)
15511    int mem_base;
15512
15513        mem_base = xmlMemBlocks();
15514
15515        htmlInitAutoClose();
15516        call_tests++;
15517        xmlResetLastError();
15518        if (mem_base != xmlMemBlocks()) {
15519            printf("Leak of %d blocks found in htmlInitAutoClose",
15520	           xmlMemBlocks() - mem_base);
15521	    test_ret++;
15522            printf("\n");
15523        }
15524    function_tests++;
15525#endif
15526
15527    return(test_ret);
15528}
15529
15530
15531static int
15532test_inputPop(void) {
15533    int test_ret = 0;
15534
15535    int mem_base;
15536    xmlParserInputPtr ret_val;
15537    xmlParserCtxtPtr ctxt; /* an XML parser context */
15538    int n_ctxt;
15539
15540    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15541        mem_base = xmlMemBlocks();
15542        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15543
15544        ret_val = inputPop(ctxt);
15545        desret_xmlParserInputPtr(ret_val);
15546        call_tests++;
15547        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15548        xmlResetLastError();
15549        if (mem_base != xmlMemBlocks()) {
15550            printf("Leak of %d blocks found in inputPop",
15551	           xmlMemBlocks() - mem_base);
15552	    test_ret++;
15553            printf(" %d", n_ctxt);
15554            printf("\n");
15555        }
15556    }
15557    function_tests++;
15558
15559    return(test_ret);
15560}
15561
15562
15563static int
15564test_inputPush(void) {
15565    int test_ret = 0;
15566
15567    int mem_base;
15568    int ret_val;
15569    xmlParserCtxtPtr ctxt; /* an XML parser context */
15570    int n_ctxt;
15571    xmlParserInputPtr value; /* the parser input */
15572    int n_value;
15573
15574    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15575    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15576        mem_base = xmlMemBlocks();
15577        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15578        value = gen_xmlParserInputPtr(n_value, 1);
15579
15580        ret_val = inputPush(ctxt, value);
15581        desret_int(ret_val);
15582        call_tests++;
15583        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15584        des_xmlParserInputPtr(n_value, value, 1);
15585        xmlResetLastError();
15586        if (mem_base != xmlMemBlocks()) {
15587            printf("Leak of %d blocks found in inputPush",
15588	           xmlMemBlocks() - mem_base);
15589	    test_ret++;
15590            printf(" %d", n_ctxt);
15591            printf(" %d", n_value);
15592            printf("\n");
15593        }
15594    }
15595    }
15596    function_tests++;
15597
15598    return(test_ret);
15599}
15600
15601
15602static int
15603test_namePop(void) {
15604    int test_ret = 0;
15605
15606    int mem_base;
15607    const xmlChar * ret_val;
15608    xmlParserCtxtPtr ctxt; /* an XML parser context */
15609    int n_ctxt;
15610
15611    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15612        mem_base = xmlMemBlocks();
15613        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15614
15615        ret_val = namePop(ctxt);
15616        desret_const_xmlChar_ptr(ret_val);
15617        call_tests++;
15618        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15619        xmlResetLastError();
15620        if (mem_base != xmlMemBlocks()) {
15621            printf("Leak of %d blocks found in namePop",
15622	           xmlMemBlocks() - mem_base);
15623	    test_ret++;
15624            printf(" %d", n_ctxt);
15625            printf("\n");
15626        }
15627    }
15628    function_tests++;
15629
15630    return(test_ret);
15631}
15632
15633
15634static int
15635test_namePush(void) {
15636    int test_ret = 0;
15637
15638    int mem_base;
15639    int ret_val;
15640    xmlParserCtxtPtr ctxt; /* an XML parser context */
15641    int n_ctxt;
15642    xmlChar * value; /* the element name */
15643    int n_value;
15644
15645    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15646    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15647        mem_base = xmlMemBlocks();
15648        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15649        value = gen_const_xmlChar_ptr(n_value, 1);
15650
15651        ret_val = namePush(ctxt, (const xmlChar *)value);
15652        desret_int(ret_val);
15653        call_tests++;
15654        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15655        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15656        xmlResetLastError();
15657        if (mem_base != xmlMemBlocks()) {
15658            printf("Leak of %d blocks found in namePush",
15659	           xmlMemBlocks() - mem_base);
15660	    test_ret++;
15661            printf(" %d", n_ctxt);
15662            printf(" %d", n_value);
15663            printf("\n");
15664        }
15665    }
15666    }
15667    function_tests++;
15668
15669    return(test_ret);
15670}
15671
15672
15673static int
15674test_nodePop(void) {
15675    int test_ret = 0;
15676
15677    int mem_base;
15678    xmlNodePtr ret_val;
15679    xmlParserCtxtPtr ctxt; /* an XML parser context */
15680    int n_ctxt;
15681
15682    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15683        mem_base = xmlMemBlocks();
15684        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15685
15686        ret_val = nodePop(ctxt);
15687        desret_xmlNodePtr(ret_val);
15688        call_tests++;
15689        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15690        xmlResetLastError();
15691        if (mem_base != xmlMemBlocks()) {
15692            printf("Leak of %d blocks found in nodePop",
15693	           xmlMemBlocks() - mem_base);
15694	    test_ret++;
15695            printf(" %d", n_ctxt);
15696            printf("\n");
15697        }
15698    }
15699    function_tests++;
15700
15701    return(test_ret);
15702}
15703
15704
15705static int
15706test_nodePush(void) {
15707    int test_ret = 0;
15708
15709    int mem_base;
15710    int ret_val;
15711    xmlParserCtxtPtr ctxt; /* an XML parser context */
15712    int n_ctxt;
15713    xmlNodePtr value; /* the element node */
15714    int n_value;
15715
15716    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15717    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15718        mem_base = xmlMemBlocks();
15719        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15720        value = gen_xmlNodePtr(n_value, 1);
15721
15722        ret_val = nodePush(ctxt, value);
15723        desret_int(ret_val);
15724        call_tests++;
15725        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15726        des_xmlNodePtr(n_value, value, 1);
15727        xmlResetLastError();
15728        if (mem_base != xmlMemBlocks()) {
15729            printf("Leak of %d blocks found in nodePush",
15730	           xmlMemBlocks() - mem_base);
15731	    test_ret++;
15732            printf(" %d", n_ctxt);
15733            printf(" %d", n_value);
15734            printf("\n");
15735        }
15736    }
15737    }
15738    function_tests++;
15739
15740    return(test_ret);
15741}
15742
15743
15744static int
15745test_xmlCheckLanguageID(void) {
15746    int test_ret = 0;
15747
15748    int mem_base;
15749    int ret_val;
15750    xmlChar * lang; /* pointer to the string value */
15751    int n_lang;
15752
15753    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15754        mem_base = xmlMemBlocks();
15755        lang = gen_const_xmlChar_ptr(n_lang, 0);
15756
15757        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15758        desret_int(ret_val);
15759        call_tests++;
15760        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15761        xmlResetLastError();
15762        if (mem_base != xmlMemBlocks()) {
15763            printf("Leak of %d blocks found in xmlCheckLanguageID",
15764	           xmlMemBlocks() - mem_base);
15765	    test_ret++;
15766            printf(" %d", n_lang);
15767            printf("\n");
15768        }
15769    }
15770    function_tests++;
15771
15772    return(test_ret);
15773}
15774
15775
15776static int
15777test_xmlCopyChar(void) {
15778    int test_ret = 0;
15779
15780    int mem_base;
15781    int ret_val;
15782    int len; /* Ignored, compatibility */
15783    int n_len;
15784    xmlChar * out; /* pointer to an array of xmlChar */
15785    int n_out;
15786    int val; /* the char value */
15787    int n_val;
15788
15789    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15790    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15791    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15792        mem_base = xmlMemBlocks();
15793        len = gen_int(n_len, 0);
15794        out = gen_xmlChar_ptr(n_out, 1);
15795        val = gen_int(n_val, 2);
15796
15797        ret_val = xmlCopyChar(len, out, val);
15798        desret_int(ret_val);
15799        call_tests++;
15800        des_int(n_len, len, 0);
15801        des_xmlChar_ptr(n_out, out, 1);
15802        des_int(n_val, val, 2);
15803        xmlResetLastError();
15804        if (mem_base != xmlMemBlocks()) {
15805            printf("Leak of %d blocks found in xmlCopyChar",
15806	           xmlMemBlocks() - mem_base);
15807	    test_ret++;
15808            printf(" %d", n_len);
15809            printf(" %d", n_out);
15810            printf(" %d", n_val);
15811            printf("\n");
15812        }
15813    }
15814    }
15815    }
15816    function_tests++;
15817
15818    return(test_ret);
15819}
15820
15821
15822static int
15823test_xmlCopyCharMultiByte(void) {
15824    int test_ret = 0;
15825
15826    int mem_base;
15827    int ret_val;
15828    xmlChar * out; /* pointer to an array of xmlChar */
15829    int n_out;
15830    int val; /* the char value */
15831    int n_val;
15832
15833    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15834    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15835        mem_base = xmlMemBlocks();
15836        out = gen_xmlChar_ptr(n_out, 0);
15837        val = gen_int(n_val, 1);
15838
15839        ret_val = xmlCopyCharMultiByte(out, val);
15840        desret_int(ret_val);
15841        call_tests++;
15842        des_xmlChar_ptr(n_out, out, 0);
15843        des_int(n_val, val, 1);
15844        xmlResetLastError();
15845        if (mem_base != xmlMemBlocks()) {
15846            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15847	           xmlMemBlocks() - mem_base);
15848	    test_ret++;
15849            printf(" %d", n_out);
15850            printf(" %d", n_val);
15851            printf("\n");
15852        }
15853    }
15854    }
15855    function_tests++;
15856
15857    return(test_ret);
15858}
15859
15860
15861static int
15862test_xmlCreateEntityParserCtxt(void) {
15863    int test_ret = 0;
15864
15865    int mem_base;
15866    xmlParserCtxtPtr ret_val;
15867    xmlChar * URL; /* the entity URL */
15868    int n_URL;
15869    xmlChar * ID; /* the entity PUBLIC ID */
15870    int n_ID;
15871    xmlChar * base; /* a possible base for the target URI */
15872    int n_base;
15873
15874    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15875    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15876    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15877        mem_base = xmlMemBlocks();
15878        URL = gen_const_xmlChar_ptr(n_URL, 0);
15879        ID = gen_const_xmlChar_ptr(n_ID, 1);
15880        base = gen_const_xmlChar_ptr(n_base, 2);
15881
15882        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15883        desret_xmlParserCtxtPtr(ret_val);
15884        call_tests++;
15885        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15886        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15887        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15888        xmlResetLastError();
15889        if (mem_base != xmlMemBlocks()) {
15890            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15891	           xmlMemBlocks() - mem_base);
15892	    test_ret++;
15893            printf(" %d", n_URL);
15894            printf(" %d", n_ID);
15895            printf(" %d", n_base);
15896            printf("\n");
15897        }
15898    }
15899    }
15900    }
15901    function_tests++;
15902
15903    return(test_ret);
15904}
15905
15906
15907static int
15908test_xmlCreateFileParserCtxt(void) {
15909    int test_ret = 0;
15910
15911    int mem_base;
15912    xmlParserCtxtPtr ret_val;
15913    const char * filename; /* the filename */
15914    int n_filename;
15915
15916    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15917        mem_base = xmlMemBlocks();
15918        filename = gen_fileoutput(n_filename, 0);
15919
15920        ret_val = xmlCreateFileParserCtxt(filename);
15921        desret_xmlParserCtxtPtr(ret_val);
15922        call_tests++;
15923        des_fileoutput(n_filename, filename, 0);
15924        xmlResetLastError();
15925        if (mem_base != xmlMemBlocks()) {
15926            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15927	           xmlMemBlocks() - mem_base);
15928	    test_ret++;
15929            printf(" %d", n_filename);
15930            printf("\n");
15931        }
15932    }
15933    function_tests++;
15934
15935    return(test_ret);
15936}
15937
15938
15939static int
15940test_xmlCreateMemoryParserCtxt(void) {
15941    int test_ret = 0;
15942
15943    int mem_base;
15944    xmlParserCtxtPtr ret_val;
15945    char * buffer; /* a pointer to a char array */
15946    int n_buffer;
15947    int size; /* the size of the array */
15948    int n_size;
15949
15950    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15951    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15952        mem_base = xmlMemBlocks();
15953        buffer = gen_const_char_ptr(n_buffer, 0);
15954        size = gen_int(n_size, 1);
15955
15956        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15957        desret_xmlParserCtxtPtr(ret_val);
15958        call_tests++;
15959        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15960        des_int(n_size, size, 1);
15961        xmlResetLastError();
15962        if (mem_base != xmlMemBlocks()) {
15963            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15964	           xmlMemBlocks() - mem_base);
15965	    test_ret++;
15966            printf(" %d", n_buffer);
15967            printf(" %d", n_size);
15968            printf("\n");
15969        }
15970    }
15971    }
15972    function_tests++;
15973
15974    return(test_ret);
15975}
15976
15977
15978static int
15979test_xmlCreateURLParserCtxt(void) {
15980    int test_ret = 0;
15981
15982    int mem_base;
15983    xmlParserCtxtPtr ret_val;
15984    const char * filename; /* the filename or URL */
15985    int n_filename;
15986    int options; /* a combination of xmlParserOption */
15987    int n_options;
15988
15989    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15990    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15991        mem_base = xmlMemBlocks();
15992        filename = gen_fileoutput(n_filename, 0);
15993        options = gen_int(n_options, 1);
15994
15995        ret_val = xmlCreateURLParserCtxt(filename, options);
15996        desret_xmlParserCtxtPtr(ret_val);
15997        call_tests++;
15998        des_fileoutput(n_filename, filename, 0);
15999        des_int(n_options, options, 1);
16000        xmlResetLastError();
16001        if (mem_base != xmlMemBlocks()) {
16002            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
16003	           xmlMemBlocks() - mem_base);
16004	    test_ret++;
16005            printf(" %d", n_filename);
16006            printf(" %d", n_options);
16007            printf("\n");
16008        }
16009    }
16010    }
16011    function_tests++;
16012
16013    return(test_ret);
16014}
16015
16016
16017static int
16018test_xmlCurrentChar(void) {
16019    int test_ret = 0;
16020
16021    int mem_base;
16022    int ret_val;
16023    xmlParserCtxtPtr ctxt; /* the XML parser context */
16024    int n_ctxt;
16025    int * len; /* pointer to the length of the char read */
16026    int n_len;
16027
16028    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16029    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16030        mem_base = xmlMemBlocks();
16031        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16032        len = gen_int_ptr(n_len, 1);
16033
16034        ret_val = xmlCurrentChar(ctxt, len);
16035        desret_int(ret_val);
16036        call_tests++;
16037        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16038        des_int_ptr(n_len, len, 1);
16039        xmlResetLastError();
16040        if (mem_base != xmlMemBlocks()) {
16041            printf("Leak of %d blocks found in xmlCurrentChar",
16042	           xmlMemBlocks() - mem_base);
16043	    test_ret++;
16044            printf(" %d", n_ctxt);
16045            printf(" %d", n_len);
16046            printf("\n");
16047        }
16048    }
16049    }
16050    function_tests++;
16051
16052    return(test_ret);
16053}
16054
16055
16056static int
16057test_xmlErrMemory(void) {
16058    int test_ret = 0;
16059
16060    int mem_base;
16061    xmlParserCtxtPtr ctxt; /* an XML parser context */
16062    int n_ctxt;
16063    char * extra; /* extra informations */
16064    int n_extra;
16065
16066    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16067    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16068        mem_base = xmlMemBlocks();
16069        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16070        extra = gen_const_char_ptr(n_extra, 1);
16071
16072        xmlErrMemory(ctxt, (const char *)extra);
16073        call_tests++;
16074        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16075        des_const_char_ptr(n_extra, (const char *)extra, 1);
16076        xmlResetLastError();
16077        if (mem_base != xmlMemBlocks()) {
16078            printf("Leak of %d blocks found in xmlErrMemory",
16079	           xmlMemBlocks() - mem_base);
16080	    test_ret++;
16081            printf(" %d", n_ctxt);
16082            printf(" %d", n_extra);
16083            printf("\n");
16084        }
16085    }
16086    }
16087    function_tests++;
16088
16089    return(test_ret);
16090}
16091
16092
16093static int
16094test_xmlIsLetter(void) {
16095    int test_ret = 0;
16096
16097    int mem_base;
16098    int ret_val;
16099    int c; /* an unicode character (int) */
16100    int n_c;
16101
16102    for (n_c = 0;n_c < gen_nb_int;n_c++) {
16103        mem_base = xmlMemBlocks();
16104        c = gen_int(n_c, 0);
16105
16106        ret_val = xmlIsLetter(c);
16107        desret_int(ret_val);
16108        call_tests++;
16109        des_int(n_c, c, 0);
16110        xmlResetLastError();
16111        if (mem_base != xmlMemBlocks()) {
16112            printf("Leak of %d blocks found in xmlIsLetter",
16113	           xmlMemBlocks() - mem_base);
16114	    test_ret++;
16115            printf(" %d", n_c);
16116            printf("\n");
16117        }
16118    }
16119    function_tests++;
16120
16121    return(test_ret);
16122}
16123
16124
16125static int
16126test_xmlNewEntityInputStream(void) {
16127    int test_ret = 0;
16128
16129    int mem_base;
16130    xmlParserInputPtr ret_val;
16131    xmlParserCtxtPtr ctxt; /* an XML parser context */
16132    int n_ctxt;
16133    xmlEntityPtr entity; /* an Entity pointer */
16134    int n_entity;
16135
16136    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16137    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16138        mem_base = xmlMemBlocks();
16139        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16140        entity = gen_xmlEntityPtr(n_entity, 1);
16141
16142        ret_val = xmlNewEntityInputStream(ctxt, entity);
16143        desret_xmlParserInputPtr(ret_val);
16144        call_tests++;
16145        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16146        des_xmlEntityPtr(n_entity, entity, 1);
16147        xmlResetLastError();
16148        if (mem_base != xmlMemBlocks()) {
16149            printf("Leak of %d blocks found in xmlNewEntityInputStream",
16150	           xmlMemBlocks() - mem_base);
16151	    test_ret++;
16152            printf(" %d", n_ctxt);
16153            printf(" %d", n_entity);
16154            printf("\n");
16155        }
16156    }
16157    }
16158    function_tests++;
16159
16160    return(test_ret);
16161}
16162
16163
16164static int
16165test_xmlNewInputFromFile(void) {
16166    int test_ret = 0;
16167
16168    int mem_base;
16169    xmlParserInputPtr ret_val;
16170    xmlParserCtxtPtr ctxt; /* an XML parser context */
16171    int n_ctxt;
16172    const char * filename; /* the filename to use as entity */
16173    int n_filename;
16174
16175    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16176    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16177        mem_base = xmlMemBlocks();
16178        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16179        filename = gen_filepath(n_filename, 1);
16180
16181        ret_val = xmlNewInputFromFile(ctxt, filename);
16182        desret_xmlParserInputPtr(ret_val);
16183        call_tests++;
16184        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16185        des_filepath(n_filename, filename, 1);
16186        xmlResetLastError();
16187        if (mem_base != xmlMemBlocks()) {
16188            printf("Leak of %d blocks found in xmlNewInputFromFile",
16189	           xmlMemBlocks() - mem_base);
16190	    test_ret++;
16191            printf(" %d", n_ctxt);
16192            printf(" %d", n_filename);
16193            printf("\n");
16194        }
16195    }
16196    }
16197    function_tests++;
16198
16199    return(test_ret);
16200}
16201
16202
16203static int
16204test_xmlNewInputStream(void) {
16205    int test_ret = 0;
16206
16207    int mem_base;
16208    xmlParserInputPtr ret_val;
16209    xmlParserCtxtPtr ctxt; /* an XML parser context */
16210    int n_ctxt;
16211
16212    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16213        mem_base = xmlMemBlocks();
16214        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16215
16216        ret_val = xmlNewInputStream(ctxt);
16217        desret_xmlParserInputPtr(ret_val);
16218        call_tests++;
16219        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16220        xmlResetLastError();
16221        if (mem_base != xmlMemBlocks()) {
16222            printf("Leak of %d blocks found in xmlNewInputStream",
16223	           xmlMemBlocks() - mem_base);
16224	    test_ret++;
16225            printf(" %d", n_ctxt);
16226            printf("\n");
16227        }
16228    }
16229    function_tests++;
16230
16231    return(test_ret);
16232}
16233
16234
16235static int
16236test_xmlNewStringInputStream(void) {
16237    int test_ret = 0;
16238
16239    int mem_base;
16240    xmlParserInputPtr ret_val;
16241    xmlParserCtxtPtr ctxt; /* an XML parser context */
16242    int n_ctxt;
16243    xmlChar * buffer; /* an memory buffer */
16244    int n_buffer;
16245
16246    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16247    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16248        mem_base = xmlMemBlocks();
16249        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16250        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16251
16252        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16253        desret_xmlParserInputPtr(ret_val);
16254        call_tests++;
16255        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16256        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16257        xmlResetLastError();
16258        if (mem_base != xmlMemBlocks()) {
16259            printf("Leak of %d blocks found in xmlNewStringInputStream",
16260	           xmlMemBlocks() - mem_base);
16261	    test_ret++;
16262            printf(" %d", n_ctxt);
16263            printf(" %d", n_buffer);
16264            printf("\n");
16265        }
16266    }
16267    }
16268    function_tests++;
16269
16270    return(test_ret);
16271}
16272
16273
16274static int
16275test_xmlNextChar(void) {
16276    int test_ret = 0;
16277
16278    int mem_base;
16279    xmlParserCtxtPtr ctxt; /* the XML parser context */
16280    int n_ctxt;
16281
16282    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16283        mem_base = xmlMemBlocks();
16284        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16285
16286        xmlNextChar(ctxt);
16287        call_tests++;
16288        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16289        xmlResetLastError();
16290        if (mem_base != xmlMemBlocks()) {
16291            printf("Leak of %d blocks found in xmlNextChar",
16292	           xmlMemBlocks() - mem_base);
16293	    test_ret++;
16294            printf(" %d", n_ctxt);
16295            printf("\n");
16296        }
16297    }
16298    function_tests++;
16299
16300    return(test_ret);
16301}
16302
16303
16304static int
16305test_xmlParserInputShrink(void) {
16306    int test_ret = 0;
16307
16308    int mem_base;
16309    xmlParserInputPtr in; /* an XML parser input */
16310    int n_in;
16311
16312    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16313        mem_base = xmlMemBlocks();
16314        in = gen_xmlParserInputPtr(n_in, 0);
16315
16316        xmlParserInputShrink(in);
16317        call_tests++;
16318        des_xmlParserInputPtr(n_in, in, 0);
16319        xmlResetLastError();
16320        if (mem_base != xmlMemBlocks()) {
16321            printf("Leak of %d blocks found in xmlParserInputShrink",
16322	           xmlMemBlocks() - mem_base);
16323	    test_ret++;
16324            printf(" %d", n_in);
16325            printf("\n");
16326        }
16327    }
16328    function_tests++;
16329
16330    return(test_ret);
16331}
16332
16333
16334static int
16335test_xmlPopInput(void) {
16336    int test_ret = 0;
16337
16338    int mem_base;
16339    xmlChar ret_val;
16340    xmlParserCtxtPtr ctxt; /* an XML parser context */
16341    int n_ctxt;
16342
16343    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16344        mem_base = xmlMemBlocks();
16345        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16346
16347        ret_val = xmlPopInput(ctxt);
16348        desret_xmlChar(ret_val);
16349        call_tests++;
16350        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16351        xmlResetLastError();
16352        if (mem_base != xmlMemBlocks()) {
16353            printf("Leak of %d blocks found in xmlPopInput",
16354	           xmlMemBlocks() - mem_base);
16355	    test_ret++;
16356            printf(" %d", n_ctxt);
16357            printf("\n");
16358        }
16359    }
16360    function_tests++;
16361
16362    return(test_ret);
16363}
16364
16365
16366static int
16367test_xmlPushInput(void) {
16368    int test_ret = 0;
16369
16370    int mem_base;
16371    int ret_val;
16372    xmlParserCtxtPtr ctxt; /* an XML parser context */
16373    int n_ctxt;
16374    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16375    int n_input;
16376
16377    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16378    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16379        mem_base = xmlMemBlocks();
16380        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16381        input = gen_xmlParserInputPtr(n_input, 1);
16382
16383        ret_val = xmlPushInput(ctxt, input);
16384        desret_int(ret_val);
16385        call_tests++;
16386        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16387        des_xmlParserInputPtr(n_input, input, 1);
16388        xmlResetLastError();
16389        if (mem_base != xmlMemBlocks()) {
16390            printf("Leak of %d blocks found in xmlPushInput",
16391	           xmlMemBlocks() - mem_base);
16392	    test_ret++;
16393            printf(" %d", n_ctxt);
16394            printf(" %d", n_input);
16395            printf("\n");
16396        }
16397    }
16398    }
16399    function_tests++;
16400
16401    return(test_ret);
16402}
16403
16404
16405static int
16406test_xmlSetEntityReferenceFunc(void) {
16407    int test_ret = 0;
16408
16409
16410    /* missing type support */
16411    return(test_ret);
16412}
16413
16414
16415static int
16416test_xmlSplitQName(void) {
16417    int test_ret = 0;
16418
16419    int mem_base;
16420    xmlChar * ret_val;
16421    xmlParserCtxtPtr ctxt; /* an XML parser context */
16422    int n_ctxt;
16423    xmlChar * name; /* an XML parser context */
16424    int n_name;
16425    xmlChar ** prefix; /* a xmlChar ** */
16426    int n_prefix;
16427
16428    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16429    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16430    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16431        mem_base = xmlMemBlocks();
16432        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16433        name = gen_const_xmlChar_ptr(n_name, 1);
16434        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16435
16436        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16437        desret_xmlChar_ptr(ret_val);
16438        call_tests++;
16439        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16440        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16441        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16442        xmlResetLastError();
16443        if (mem_base != xmlMemBlocks()) {
16444            printf("Leak of %d blocks found in xmlSplitQName",
16445	           xmlMemBlocks() - mem_base);
16446	    test_ret++;
16447            printf(" %d", n_ctxt);
16448            printf(" %d", n_name);
16449            printf(" %d", n_prefix);
16450            printf("\n");
16451        }
16452    }
16453    }
16454    }
16455    function_tests++;
16456
16457    return(test_ret);
16458}
16459
16460
16461static int
16462test_xmlStringCurrentChar(void) {
16463    int test_ret = 0;
16464
16465    int mem_base;
16466    int ret_val;
16467    xmlParserCtxtPtr ctxt; /* the XML parser context */
16468    int n_ctxt;
16469    xmlChar * cur; /* pointer to the beginning of the char */
16470    int n_cur;
16471    int * len; /* pointer to the length of the char read */
16472    int n_len;
16473
16474    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16475    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16476    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16477        mem_base = xmlMemBlocks();
16478        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16479        cur = gen_const_xmlChar_ptr(n_cur, 1);
16480        len = gen_int_ptr(n_len, 2);
16481
16482        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16483        desret_int(ret_val);
16484        call_tests++;
16485        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16486        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16487        des_int_ptr(n_len, len, 2);
16488        xmlResetLastError();
16489        if (mem_base != xmlMemBlocks()) {
16490            printf("Leak of %d blocks found in xmlStringCurrentChar",
16491	           xmlMemBlocks() - mem_base);
16492	    test_ret++;
16493            printf(" %d", n_ctxt);
16494            printf(" %d", n_cur);
16495            printf(" %d", n_len);
16496            printf("\n");
16497        }
16498    }
16499    }
16500    }
16501    function_tests++;
16502
16503    return(test_ret);
16504}
16505
16506
16507static int
16508test_xmlStringDecodeEntities(void) {
16509    int test_ret = 0;
16510
16511    int mem_base;
16512    xmlChar * ret_val;
16513    xmlParserCtxtPtr ctxt; /* the parser context */
16514    int n_ctxt;
16515    xmlChar * str; /* the input string */
16516    int n_str;
16517    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16518    int n_what;
16519    xmlChar end; /* an end marker xmlChar, 0 if none */
16520    int n_end;
16521    xmlChar end2; /* an end marker xmlChar, 0 if none */
16522    int n_end2;
16523    xmlChar end3; /* an end marker xmlChar, 0 if none */
16524    int n_end3;
16525
16526    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16527    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16528    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16529    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16530    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16531    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16532        mem_base = xmlMemBlocks();
16533        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16534        str = gen_const_xmlChar_ptr(n_str, 1);
16535        what = gen_int(n_what, 2);
16536        end = gen_xmlChar(n_end, 3);
16537        end2 = gen_xmlChar(n_end2, 4);
16538        end3 = gen_xmlChar(n_end3, 5);
16539
16540        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16541        desret_xmlChar_ptr(ret_val);
16542        call_tests++;
16543        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16544        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16545        des_int(n_what, what, 2);
16546        des_xmlChar(n_end, end, 3);
16547        des_xmlChar(n_end2, end2, 4);
16548        des_xmlChar(n_end3, end3, 5);
16549        xmlResetLastError();
16550        if (mem_base != xmlMemBlocks()) {
16551            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16552	           xmlMemBlocks() - mem_base);
16553	    test_ret++;
16554            printf(" %d", n_ctxt);
16555            printf(" %d", n_str);
16556            printf(" %d", n_what);
16557            printf(" %d", n_end);
16558            printf(" %d", n_end2);
16559            printf(" %d", n_end3);
16560            printf("\n");
16561        }
16562    }
16563    }
16564    }
16565    }
16566    }
16567    }
16568    function_tests++;
16569
16570    return(test_ret);
16571}
16572
16573
16574static int
16575test_xmlStringLenDecodeEntities(void) {
16576    int test_ret = 0;
16577
16578    int mem_base;
16579    xmlChar * ret_val;
16580    xmlParserCtxtPtr ctxt; /* the parser context */
16581    int n_ctxt;
16582    xmlChar * str; /* the input string */
16583    int n_str;
16584    int len; /* the string length */
16585    int n_len;
16586    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16587    int n_what;
16588    xmlChar end; /* an end marker xmlChar, 0 if none */
16589    int n_end;
16590    xmlChar end2; /* an end marker xmlChar, 0 if none */
16591    int n_end2;
16592    xmlChar end3; /* an end marker xmlChar, 0 if none */
16593    int n_end3;
16594
16595    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16596    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16597    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16598    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16599    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16600    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16601    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16602        mem_base = xmlMemBlocks();
16603        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16604        str = gen_const_xmlChar_ptr(n_str, 1);
16605        len = gen_int(n_len, 2);
16606        what = gen_int(n_what, 3);
16607        end = gen_xmlChar(n_end, 4);
16608        end2 = gen_xmlChar(n_end2, 5);
16609        end3 = gen_xmlChar(n_end3, 6);
16610
16611        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16612        desret_xmlChar_ptr(ret_val);
16613        call_tests++;
16614        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16615        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16616        des_int(n_len, len, 2);
16617        des_int(n_what, what, 3);
16618        des_xmlChar(n_end, end, 4);
16619        des_xmlChar(n_end2, end2, 5);
16620        des_xmlChar(n_end3, end3, 6);
16621        xmlResetLastError();
16622        if (mem_base != xmlMemBlocks()) {
16623            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16624	           xmlMemBlocks() - mem_base);
16625	    test_ret++;
16626            printf(" %d", n_ctxt);
16627            printf(" %d", n_str);
16628            printf(" %d", n_len);
16629            printf(" %d", n_what);
16630            printf(" %d", n_end);
16631            printf(" %d", n_end2);
16632            printf(" %d", n_end3);
16633            printf("\n");
16634        }
16635    }
16636    }
16637    }
16638    }
16639    }
16640    }
16641    }
16642    function_tests++;
16643
16644    return(test_ret);
16645}
16646
16647
16648static int
16649test_xmlSwitchEncoding(void) {
16650    int test_ret = 0;
16651
16652    int mem_base;
16653    int ret_val;
16654    xmlParserCtxtPtr ctxt; /* the parser context */
16655    int n_ctxt;
16656    xmlCharEncoding enc; /* the encoding value (number) */
16657    int n_enc;
16658
16659    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16660    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16661        mem_base = xmlMemBlocks();
16662        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16663        enc = gen_xmlCharEncoding(n_enc, 1);
16664
16665        ret_val = xmlSwitchEncoding(ctxt, enc);
16666        desret_int(ret_val);
16667        call_tests++;
16668        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16669        des_xmlCharEncoding(n_enc, enc, 1);
16670        xmlResetLastError();
16671        if (mem_base != xmlMemBlocks()) {
16672            printf("Leak of %d blocks found in xmlSwitchEncoding",
16673	           xmlMemBlocks() - mem_base);
16674	    test_ret++;
16675            printf(" %d", n_ctxt);
16676            printf(" %d", n_enc);
16677            printf("\n");
16678        }
16679    }
16680    }
16681    function_tests++;
16682
16683    return(test_ret);
16684}
16685
16686
16687static int
16688test_xmlSwitchInputEncoding(void) {
16689    int test_ret = 0;
16690
16691    int mem_base;
16692    int ret_val;
16693    xmlParserCtxtPtr ctxt; /* the parser context */
16694    int n_ctxt;
16695    xmlParserInputPtr input; /* the input stream */
16696    int n_input;
16697    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16698    int n_handler;
16699
16700    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16701    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16702    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16703        mem_base = xmlMemBlocks();
16704        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16705        input = gen_xmlParserInputPtr(n_input, 1);
16706        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16707
16708        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16709        desret_int(ret_val);
16710        call_tests++;
16711        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16712        des_xmlParserInputPtr(n_input, input, 1);
16713        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16714        xmlResetLastError();
16715        if (mem_base != xmlMemBlocks()) {
16716            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16717	           xmlMemBlocks() - mem_base);
16718	    test_ret++;
16719            printf(" %d", n_ctxt);
16720            printf(" %d", n_input);
16721            printf(" %d", n_handler);
16722            printf("\n");
16723        }
16724    }
16725    }
16726    }
16727    function_tests++;
16728
16729    return(test_ret);
16730}
16731
16732
16733static int
16734test_xmlSwitchToEncoding(void) {
16735    int test_ret = 0;
16736
16737    int mem_base;
16738    int ret_val;
16739    xmlParserCtxtPtr ctxt; /* the parser context */
16740    int n_ctxt;
16741    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16742    int n_handler;
16743
16744    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16745    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16746        mem_base = xmlMemBlocks();
16747        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16748        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16749
16750        ret_val = xmlSwitchToEncoding(ctxt, handler);
16751        desret_int(ret_val);
16752        call_tests++;
16753        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16754        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16755        xmlResetLastError();
16756        if (mem_base != xmlMemBlocks()) {
16757            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16758	           xmlMemBlocks() - mem_base);
16759	    test_ret++;
16760            printf(" %d", n_ctxt);
16761            printf(" %d", n_handler);
16762            printf("\n");
16763        }
16764    }
16765    }
16766    function_tests++;
16767
16768    return(test_ret);
16769}
16770
16771static int
16772test_parserInternals(void) {
16773    int test_ret = 0;
16774
16775    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16776    test_ret += test_htmlCreateFileParserCtxt();
16777    test_ret += test_htmlInitAutoClose();
16778    test_ret += test_inputPop();
16779    test_ret += test_inputPush();
16780    test_ret += test_namePop();
16781    test_ret += test_namePush();
16782    test_ret += test_nodePop();
16783    test_ret += test_nodePush();
16784    test_ret += test_xmlCheckLanguageID();
16785    test_ret += test_xmlCopyChar();
16786    test_ret += test_xmlCopyCharMultiByte();
16787    test_ret += test_xmlCreateEntityParserCtxt();
16788    test_ret += test_xmlCreateFileParserCtxt();
16789    test_ret += test_xmlCreateMemoryParserCtxt();
16790    test_ret += test_xmlCreateURLParserCtxt();
16791    test_ret += test_xmlCurrentChar();
16792    test_ret += test_xmlErrMemory();
16793    test_ret += test_xmlIsLetter();
16794    test_ret += test_xmlNewEntityInputStream();
16795    test_ret += test_xmlNewInputFromFile();
16796    test_ret += test_xmlNewInputStream();
16797    test_ret += test_xmlNewStringInputStream();
16798    test_ret += test_xmlNextChar();
16799    test_ret += test_xmlParserInputShrink();
16800    test_ret += test_xmlPopInput();
16801    test_ret += test_xmlPushInput();
16802    test_ret += test_xmlSetEntityReferenceFunc();
16803    test_ret += test_xmlSplitQName();
16804    test_ret += test_xmlStringCurrentChar();
16805    test_ret += test_xmlStringDecodeEntities();
16806    test_ret += test_xmlStringLenDecodeEntities();
16807    test_ret += test_xmlSwitchEncoding();
16808    test_ret += test_xmlSwitchInputEncoding();
16809    test_ret += test_xmlSwitchToEncoding();
16810
16811    if (test_ret != 0)
16812	printf("Module parserInternals: %d errors\n", test_ret);
16813    return(test_ret);
16814}
16815
16816static int
16817test_xmlPatternFromRoot(void) {
16818    int test_ret = 0;
16819
16820#if defined(LIBXML_PATTERN_ENABLED)
16821    int mem_base;
16822    int ret_val;
16823    xmlPatternPtr comp; /* the precompiled pattern */
16824    int n_comp;
16825
16826    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16827        mem_base = xmlMemBlocks();
16828        comp = gen_xmlPatternPtr(n_comp, 0);
16829
16830        ret_val = xmlPatternFromRoot(comp);
16831        desret_int(ret_val);
16832        call_tests++;
16833        des_xmlPatternPtr(n_comp, comp, 0);
16834        xmlResetLastError();
16835        if (mem_base != xmlMemBlocks()) {
16836            printf("Leak of %d blocks found in xmlPatternFromRoot",
16837	           xmlMemBlocks() - mem_base);
16838	    test_ret++;
16839            printf(" %d", n_comp);
16840            printf("\n");
16841        }
16842    }
16843    function_tests++;
16844#endif
16845
16846    return(test_ret);
16847}
16848
16849
16850static int
16851test_xmlPatternGetStreamCtxt(void) {
16852    int test_ret = 0;
16853
16854
16855    /* missing type support */
16856    return(test_ret);
16857}
16858
16859
16860static int
16861test_xmlPatternMatch(void) {
16862    int test_ret = 0;
16863
16864#if defined(LIBXML_PATTERN_ENABLED)
16865    int mem_base;
16866    int ret_val;
16867    xmlPatternPtr comp; /* the precompiled pattern */
16868    int n_comp;
16869    xmlNodePtr node; /* a node */
16870    int n_node;
16871
16872    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16873    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16874        mem_base = xmlMemBlocks();
16875        comp = gen_xmlPatternPtr(n_comp, 0);
16876        node = gen_xmlNodePtr(n_node, 1);
16877
16878        ret_val = xmlPatternMatch(comp, node);
16879        desret_int(ret_val);
16880        call_tests++;
16881        des_xmlPatternPtr(n_comp, comp, 0);
16882        des_xmlNodePtr(n_node, node, 1);
16883        xmlResetLastError();
16884        if (mem_base != xmlMemBlocks()) {
16885            printf("Leak of %d blocks found in xmlPatternMatch",
16886	           xmlMemBlocks() - mem_base);
16887	    test_ret++;
16888            printf(" %d", n_comp);
16889            printf(" %d", n_node);
16890            printf("\n");
16891        }
16892    }
16893    }
16894    function_tests++;
16895#endif
16896
16897    return(test_ret);
16898}
16899
16900
16901static int
16902test_xmlPatternMaxDepth(void) {
16903    int test_ret = 0;
16904
16905#if defined(LIBXML_PATTERN_ENABLED)
16906    int mem_base;
16907    int ret_val;
16908    xmlPatternPtr comp; /* the precompiled pattern */
16909    int n_comp;
16910
16911    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16912        mem_base = xmlMemBlocks();
16913        comp = gen_xmlPatternPtr(n_comp, 0);
16914
16915        ret_val = xmlPatternMaxDepth(comp);
16916        desret_int(ret_val);
16917        call_tests++;
16918        des_xmlPatternPtr(n_comp, comp, 0);
16919        xmlResetLastError();
16920        if (mem_base != xmlMemBlocks()) {
16921            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16922	           xmlMemBlocks() - mem_base);
16923	    test_ret++;
16924            printf(" %d", n_comp);
16925            printf("\n");
16926        }
16927    }
16928    function_tests++;
16929#endif
16930
16931    return(test_ret);
16932}
16933
16934
16935static int
16936test_xmlPatternMinDepth(void) {
16937    int test_ret = 0;
16938
16939#if defined(LIBXML_PATTERN_ENABLED)
16940    int mem_base;
16941    int ret_val;
16942    xmlPatternPtr comp; /* the precompiled pattern */
16943    int n_comp;
16944
16945    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16946        mem_base = xmlMemBlocks();
16947        comp = gen_xmlPatternPtr(n_comp, 0);
16948
16949        ret_val = xmlPatternMinDepth(comp);
16950        desret_int(ret_val);
16951        call_tests++;
16952        des_xmlPatternPtr(n_comp, comp, 0);
16953        xmlResetLastError();
16954        if (mem_base != xmlMemBlocks()) {
16955            printf("Leak of %d blocks found in xmlPatternMinDepth",
16956	           xmlMemBlocks() - mem_base);
16957	    test_ret++;
16958            printf(" %d", n_comp);
16959            printf("\n");
16960        }
16961    }
16962    function_tests++;
16963#endif
16964
16965    return(test_ret);
16966}
16967
16968
16969static int
16970test_xmlPatternStreamable(void) {
16971    int test_ret = 0;
16972
16973#if defined(LIBXML_PATTERN_ENABLED)
16974    int mem_base;
16975    int ret_val;
16976    xmlPatternPtr comp; /* the precompiled pattern */
16977    int n_comp;
16978
16979    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16980        mem_base = xmlMemBlocks();
16981        comp = gen_xmlPatternPtr(n_comp, 0);
16982
16983        ret_val = xmlPatternStreamable(comp);
16984        desret_int(ret_val);
16985        call_tests++;
16986        des_xmlPatternPtr(n_comp, comp, 0);
16987        xmlResetLastError();
16988        if (mem_base != xmlMemBlocks()) {
16989            printf("Leak of %d blocks found in xmlPatternStreamable",
16990	           xmlMemBlocks() - mem_base);
16991	    test_ret++;
16992            printf(" %d", n_comp);
16993            printf("\n");
16994        }
16995    }
16996    function_tests++;
16997#endif
16998
16999    return(test_ret);
17000}
17001
17002
17003static int
17004test_xmlPatterncompile(void) {
17005    int test_ret = 0;
17006
17007
17008    /* missing type support */
17009    return(test_ret);
17010}
17011
17012#ifdef LIBXML_PATTERN_ENABLED
17013
17014#define gen_nb_xmlStreamCtxtPtr 1
17015static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17016    return(NULL);
17017}
17018static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17019}
17020#endif
17021
17022
17023static int
17024test_xmlStreamPop(void) {
17025    int test_ret = 0;
17026
17027#if defined(LIBXML_PATTERN_ENABLED)
17028    int mem_base;
17029    int ret_val;
17030    xmlStreamCtxtPtr stream; /* the stream context */
17031    int n_stream;
17032
17033    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17034        mem_base = xmlMemBlocks();
17035        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17036
17037        ret_val = xmlStreamPop(stream);
17038        desret_int(ret_val);
17039        call_tests++;
17040        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17041        xmlResetLastError();
17042        if (mem_base != xmlMemBlocks()) {
17043            printf("Leak of %d blocks found in xmlStreamPop",
17044	           xmlMemBlocks() - mem_base);
17045	    test_ret++;
17046            printf(" %d", n_stream);
17047            printf("\n");
17048        }
17049    }
17050    function_tests++;
17051#endif
17052
17053    return(test_ret);
17054}
17055
17056
17057static int
17058test_xmlStreamPush(void) {
17059    int test_ret = 0;
17060
17061#if defined(LIBXML_PATTERN_ENABLED)
17062    int mem_base;
17063    int ret_val;
17064    xmlStreamCtxtPtr stream; /* the stream context */
17065    int n_stream;
17066    xmlChar * name; /* the current name */
17067    int n_name;
17068    xmlChar * ns; /* the namespace name */
17069    int n_ns;
17070
17071    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17072    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17073    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17074        mem_base = xmlMemBlocks();
17075        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17076        name = gen_const_xmlChar_ptr(n_name, 1);
17077        ns = gen_const_xmlChar_ptr(n_ns, 2);
17078
17079        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17080        desret_int(ret_val);
17081        call_tests++;
17082        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17083        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17084        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17085        xmlResetLastError();
17086        if (mem_base != xmlMemBlocks()) {
17087            printf("Leak of %d blocks found in xmlStreamPush",
17088	           xmlMemBlocks() - mem_base);
17089	    test_ret++;
17090            printf(" %d", n_stream);
17091            printf(" %d", n_name);
17092            printf(" %d", n_ns);
17093            printf("\n");
17094        }
17095    }
17096    }
17097    }
17098    function_tests++;
17099#endif
17100
17101    return(test_ret);
17102}
17103
17104
17105static int
17106test_xmlStreamPushAttr(void) {
17107    int test_ret = 0;
17108
17109#if defined(LIBXML_PATTERN_ENABLED)
17110    int mem_base;
17111    int ret_val;
17112    xmlStreamCtxtPtr stream; /* the stream context */
17113    int n_stream;
17114    xmlChar * name; /* the current name */
17115    int n_name;
17116    xmlChar * ns; /* the namespace name */
17117    int n_ns;
17118
17119    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17120    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17121    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17122        mem_base = xmlMemBlocks();
17123        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17124        name = gen_const_xmlChar_ptr(n_name, 1);
17125        ns = gen_const_xmlChar_ptr(n_ns, 2);
17126
17127        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17128        desret_int(ret_val);
17129        call_tests++;
17130        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17131        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17132        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17133        xmlResetLastError();
17134        if (mem_base != xmlMemBlocks()) {
17135            printf("Leak of %d blocks found in xmlStreamPushAttr",
17136	           xmlMemBlocks() - mem_base);
17137	    test_ret++;
17138            printf(" %d", n_stream);
17139            printf(" %d", n_name);
17140            printf(" %d", n_ns);
17141            printf("\n");
17142        }
17143    }
17144    }
17145    }
17146    function_tests++;
17147#endif
17148
17149    return(test_ret);
17150}
17151
17152
17153static int
17154test_xmlStreamPushNode(void) {
17155    int test_ret = 0;
17156
17157#if defined(LIBXML_PATTERN_ENABLED)
17158    int mem_base;
17159    int ret_val;
17160    xmlStreamCtxtPtr stream; /* the stream context */
17161    int n_stream;
17162    xmlChar * name; /* the current name */
17163    int n_name;
17164    xmlChar * ns; /* the namespace name */
17165    int n_ns;
17166    int nodeType; /* the type of the node being pushed */
17167    int n_nodeType;
17168
17169    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17170    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17171    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17172    for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17173        mem_base = xmlMemBlocks();
17174        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17175        name = gen_const_xmlChar_ptr(n_name, 1);
17176        ns = gen_const_xmlChar_ptr(n_ns, 2);
17177        nodeType = gen_int(n_nodeType, 3);
17178
17179        ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17180        desret_int(ret_val);
17181        call_tests++;
17182        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17183        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17184        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17185        des_int(n_nodeType, nodeType, 3);
17186        xmlResetLastError();
17187        if (mem_base != xmlMemBlocks()) {
17188            printf("Leak of %d blocks found in xmlStreamPushNode",
17189	           xmlMemBlocks() - mem_base);
17190	    test_ret++;
17191            printf(" %d", n_stream);
17192            printf(" %d", n_name);
17193            printf(" %d", n_ns);
17194            printf(" %d", n_nodeType);
17195            printf("\n");
17196        }
17197    }
17198    }
17199    }
17200    }
17201    function_tests++;
17202#endif
17203
17204    return(test_ret);
17205}
17206
17207
17208static int
17209test_xmlStreamWantsAnyNode(void) {
17210    int test_ret = 0;
17211
17212#if defined(LIBXML_PATTERN_ENABLED)
17213    int mem_base;
17214    int ret_val;
17215    xmlStreamCtxtPtr streamCtxt; /* the stream context */
17216    int n_streamCtxt;
17217
17218    for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17219        mem_base = xmlMemBlocks();
17220        streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17221
17222        ret_val = xmlStreamWantsAnyNode(streamCtxt);
17223        desret_int(ret_val);
17224        call_tests++;
17225        des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17226        xmlResetLastError();
17227        if (mem_base != xmlMemBlocks()) {
17228            printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17229	           xmlMemBlocks() - mem_base);
17230	    test_ret++;
17231            printf(" %d", n_streamCtxt);
17232            printf("\n");
17233        }
17234    }
17235    function_tests++;
17236#endif
17237
17238    return(test_ret);
17239}
17240
17241static int
17242test_pattern(void) {
17243    int test_ret = 0;
17244
17245    if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17246    test_ret += test_xmlPatternFromRoot();
17247    test_ret += test_xmlPatternGetStreamCtxt();
17248    test_ret += test_xmlPatternMatch();
17249    test_ret += test_xmlPatternMaxDepth();
17250    test_ret += test_xmlPatternMinDepth();
17251    test_ret += test_xmlPatternStreamable();
17252    test_ret += test_xmlPatterncompile();
17253    test_ret += test_xmlStreamPop();
17254    test_ret += test_xmlStreamPush();
17255    test_ret += test_xmlStreamPushAttr();
17256    test_ret += test_xmlStreamPushNode();
17257    test_ret += test_xmlStreamWantsAnyNode();
17258
17259    if (test_ret != 0)
17260	printf("Module pattern: %d errors\n", test_ret);
17261    return(test_ret);
17262}
17263#ifdef LIBXML_SCHEMAS_ENABLED
17264
17265#define gen_nb_xmlRelaxNGPtr 1
17266static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17267    return(NULL);
17268}
17269static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17270}
17271#endif
17272
17273
17274static int
17275test_xmlRelaxNGDump(void) {
17276    int test_ret = 0;
17277
17278#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17279    int mem_base;
17280    FILE * output; /* the file output */
17281    int n_output;
17282    xmlRelaxNGPtr schema; /* a schema structure */
17283    int n_schema;
17284
17285    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17286    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17287        mem_base = xmlMemBlocks();
17288        output = gen_FILE_ptr(n_output, 0);
17289        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17290
17291        xmlRelaxNGDump(output, schema);
17292        call_tests++;
17293        des_FILE_ptr(n_output, output, 0);
17294        des_xmlRelaxNGPtr(n_schema, schema, 1);
17295        xmlResetLastError();
17296        if (mem_base != xmlMemBlocks()) {
17297            printf("Leak of %d blocks found in xmlRelaxNGDump",
17298	           xmlMemBlocks() - mem_base);
17299	    test_ret++;
17300            printf(" %d", n_output);
17301            printf(" %d", n_schema);
17302            printf("\n");
17303        }
17304    }
17305    }
17306    function_tests++;
17307#endif
17308
17309    return(test_ret);
17310}
17311
17312
17313static int
17314test_xmlRelaxNGDumpTree(void) {
17315    int test_ret = 0;
17316
17317#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17318    int mem_base;
17319    FILE * output; /* the file output */
17320    int n_output;
17321    xmlRelaxNGPtr schema; /* a schema structure */
17322    int n_schema;
17323
17324    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17325    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17326        mem_base = xmlMemBlocks();
17327        output = gen_FILE_ptr(n_output, 0);
17328        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17329
17330        xmlRelaxNGDumpTree(output, schema);
17331        call_tests++;
17332        des_FILE_ptr(n_output, output, 0);
17333        des_xmlRelaxNGPtr(n_schema, schema, 1);
17334        xmlResetLastError();
17335        if (mem_base != xmlMemBlocks()) {
17336            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17337	           xmlMemBlocks() - mem_base);
17338	    test_ret++;
17339            printf(" %d", n_output);
17340            printf(" %d", n_schema);
17341            printf("\n");
17342        }
17343    }
17344    }
17345    function_tests++;
17346#endif
17347
17348    return(test_ret);
17349}
17350
17351#ifdef LIBXML_SCHEMAS_ENABLED
17352
17353#define gen_nb_xmlRelaxNGParserCtxtPtr 1
17354static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17355    return(NULL);
17356}
17357static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17358}
17359#endif
17360
17361#ifdef LIBXML_SCHEMAS_ENABLED
17362
17363#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17364static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17365    return(NULL);
17366}
17367static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17368}
17369#endif
17370
17371#ifdef LIBXML_SCHEMAS_ENABLED
17372
17373#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17374static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17375    return(NULL);
17376}
17377static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17378}
17379#endif
17380
17381
17382static int
17383test_xmlRelaxNGGetParserErrors(void) {
17384    int test_ret = 0;
17385
17386#if defined(LIBXML_SCHEMAS_ENABLED)
17387    int mem_base;
17388    int ret_val;
17389    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17390    int n_ctxt;
17391    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17392    int n_err;
17393    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17394    int n_warn;
17395    void ** ctx; /* contextual data for the callbacks result */
17396    int n_ctx;
17397
17398    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17399    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17400    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17401    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17402        mem_base = xmlMemBlocks();
17403        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17404        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17405        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17406        ctx = gen_void_ptr_ptr(n_ctx, 3);
17407
17408        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17409        desret_int(ret_val);
17410        call_tests++;
17411        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17412        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17413        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17414        des_void_ptr_ptr(n_ctx, ctx, 3);
17415        xmlResetLastError();
17416        if (mem_base != xmlMemBlocks()) {
17417            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17418	           xmlMemBlocks() - mem_base);
17419	    test_ret++;
17420            printf(" %d", n_ctxt);
17421            printf(" %d", n_err);
17422            printf(" %d", n_warn);
17423            printf(" %d", n_ctx);
17424            printf("\n");
17425        }
17426    }
17427    }
17428    }
17429    }
17430    function_tests++;
17431#endif
17432
17433    return(test_ret);
17434}
17435
17436#ifdef LIBXML_SCHEMAS_ENABLED
17437
17438#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17439static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17440    return(NULL);
17441}
17442static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17443}
17444#endif
17445
17446
17447static int
17448test_xmlRelaxNGGetValidErrors(void) {
17449    int test_ret = 0;
17450
17451#if defined(LIBXML_SCHEMAS_ENABLED)
17452    int mem_base;
17453    int ret_val;
17454    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17455    int n_ctxt;
17456    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17457    int n_err;
17458    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17459    int n_warn;
17460    void ** ctx; /* the functions context result */
17461    int n_ctx;
17462
17463    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17464    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17465    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17466    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17467        mem_base = xmlMemBlocks();
17468        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17469        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17470        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17471        ctx = gen_void_ptr_ptr(n_ctx, 3);
17472
17473        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17474        desret_int(ret_val);
17475        call_tests++;
17476        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17477        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17478        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17479        des_void_ptr_ptr(n_ctx, ctx, 3);
17480        xmlResetLastError();
17481        if (mem_base != xmlMemBlocks()) {
17482            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17483	           xmlMemBlocks() - mem_base);
17484	    test_ret++;
17485            printf(" %d", n_ctxt);
17486            printf(" %d", n_err);
17487            printf(" %d", n_warn);
17488            printf(" %d", n_ctx);
17489            printf("\n");
17490        }
17491    }
17492    }
17493    }
17494    }
17495    function_tests++;
17496#endif
17497
17498    return(test_ret);
17499}
17500
17501
17502static int
17503test_xmlRelaxNGInitTypes(void) {
17504    int test_ret = 0;
17505
17506#if defined(LIBXML_SCHEMAS_ENABLED)
17507    int mem_base;
17508    int ret_val;
17509
17510        mem_base = xmlMemBlocks();
17511
17512        ret_val = xmlRelaxNGInitTypes();
17513        desret_int(ret_val);
17514        call_tests++;
17515        xmlResetLastError();
17516        if (mem_base != xmlMemBlocks()) {
17517            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17518	           xmlMemBlocks() - mem_base);
17519	    test_ret++;
17520            printf("\n");
17521        }
17522    function_tests++;
17523#endif
17524
17525    return(test_ret);
17526}
17527
17528
17529static int
17530test_xmlRelaxNGNewDocParserCtxt(void) {
17531    int test_ret = 0;
17532
17533#if defined(LIBXML_SCHEMAS_ENABLED)
17534    int mem_base;
17535    xmlRelaxNGParserCtxtPtr ret_val;
17536    xmlDocPtr doc; /* a preparsed document tree */
17537    int n_doc;
17538
17539    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17540        mem_base = xmlMemBlocks();
17541        doc = gen_xmlDocPtr(n_doc, 0);
17542
17543        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17544        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17545        call_tests++;
17546        des_xmlDocPtr(n_doc, doc, 0);
17547        xmlResetLastError();
17548        if (mem_base != xmlMemBlocks()) {
17549            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17550	           xmlMemBlocks() - mem_base);
17551	    test_ret++;
17552            printf(" %d", n_doc);
17553            printf("\n");
17554        }
17555    }
17556    function_tests++;
17557#endif
17558
17559    return(test_ret);
17560}
17561
17562
17563static int
17564test_xmlRelaxNGNewMemParserCtxt(void) {
17565    int test_ret = 0;
17566
17567#if defined(LIBXML_SCHEMAS_ENABLED)
17568    int mem_base;
17569    xmlRelaxNGParserCtxtPtr ret_val;
17570    char * buffer; /* a pointer to a char array containing the schemas */
17571    int n_buffer;
17572    int size; /* the size of the array */
17573    int n_size;
17574
17575    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17576    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17577        mem_base = xmlMemBlocks();
17578        buffer = gen_const_char_ptr(n_buffer, 0);
17579        size = gen_int(n_size, 1);
17580
17581        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17582        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17583        call_tests++;
17584        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17585        des_int(n_size, size, 1);
17586        xmlResetLastError();
17587        if (mem_base != xmlMemBlocks()) {
17588            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17589	           xmlMemBlocks() - mem_base);
17590	    test_ret++;
17591            printf(" %d", n_buffer);
17592            printf(" %d", n_size);
17593            printf("\n");
17594        }
17595    }
17596    }
17597    function_tests++;
17598#endif
17599
17600    return(test_ret);
17601}
17602
17603
17604static int
17605test_xmlRelaxNGNewParserCtxt(void) {
17606    int test_ret = 0;
17607
17608#if defined(LIBXML_SCHEMAS_ENABLED)
17609    int mem_base;
17610    xmlRelaxNGParserCtxtPtr ret_val;
17611    char * URL; /* the location of the schema */
17612    int n_URL;
17613
17614    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17615        mem_base = xmlMemBlocks();
17616        URL = gen_const_char_ptr(n_URL, 0);
17617
17618        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17619        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17620        call_tests++;
17621        des_const_char_ptr(n_URL, (const char *)URL, 0);
17622        xmlResetLastError();
17623        if (mem_base != xmlMemBlocks()) {
17624            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17625	           xmlMemBlocks() - mem_base);
17626	    test_ret++;
17627            printf(" %d", n_URL);
17628            printf("\n");
17629        }
17630    }
17631    function_tests++;
17632#endif
17633
17634    return(test_ret);
17635}
17636
17637
17638static int
17639test_xmlRelaxNGNewValidCtxt(void) {
17640    int test_ret = 0;
17641
17642
17643    /* missing type support */
17644    return(test_ret);
17645}
17646
17647
17648static int
17649test_xmlRelaxNGParse(void) {
17650    int test_ret = 0;
17651
17652
17653    /* missing type support */
17654    return(test_ret);
17655}
17656
17657
17658static int
17659test_xmlRelaxNGSetParserErrors(void) {
17660    int test_ret = 0;
17661
17662
17663    /* missing type support */
17664    return(test_ret);
17665}
17666
17667
17668static int
17669test_xmlRelaxNGSetParserStructuredErrors(void) {
17670    int test_ret = 0;
17671
17672
17673    /* missing type support */
17674    return(test_ret);
17675}
17676
17677
17678static int
17679test_xmlRelaxNGSetValidErrors(void) {
17680    int test_ret = 0;
17681
17682
17683    /* missing type support */
17684    return(test_ret);
17685}
17686
17687
17688static int
17689test_xmlRelaxNGSetValidStructuredErrors(void) {
17690    int test_ret = 0;
17691
17692
17693    /* missing type support */
17694    return(test_ret);
17695}
17696
17697
17698static int
17699test_xmlRelaxNGValidateDoc(void) {
17700    int test_ret = 0;
17701
17702#if defined(LIBXML_SCHEMAS_ENABLED)
17703    int mem_base;
17704    int ret_val;
17705    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17706    int n_ctxt;
17707    xmlDocPtr doc; /* a parsed document tree */
17708    int n_doc;
17709
17710    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17711    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17712        mem_base = xmlMemBlocks();
17713        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17714        doc = gen_xmlDocPtr(n_doc, 1);
17715
17716        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17717        desret_int(ret_val);
17718        call_tests++;
17719        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17720        des_xmlDocPtr(n_doc, doc, 1);
17721        xmlResetLastError();
17722        if (mem_base != xmlMemBlocks()) {
17723            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17724	           xmlMemBlocks() - mem_base);
17725	    test_ret++;
17726            printf(" %d", n_ctxt);
17727            printf(" %d", n_doc);
17728            printf("\n");
17729        }
17730    }
17731    }
17732    function_tests++;
17733#endif
17734
17735    return(test_ret);
17736}
17737
17738
17739static int
17740test_xmlRelaxNGValidateFullElement(void) {
17741    int test_ret = 0;
17742
17743#if defined(LIBXML_SCHEMAS_ENABLED)
17744    int mem_base;
17745    int ret_val;
17746    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17747    int n_ctxt;
17748    xmlDocPtr doc; /* a document instance */
17749    int n_doc;
17750    xmlNodePtr elem; /* an element instance */
17751    int n_elem;
17752
17753    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17754    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17755    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17756        mem_base = xmlMemBlocks();
17757        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17758        doc = gen_xmlDocPtr(n_doc, 1);
17759        elem = gen_xmlNodePtr(n_elem, 2);
17760
17761        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17762        desret_int(ret_val);
17763        call_tests++;
17764        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17765        des_xmlDocPtr(n_doc, doc, 1);
17766        des_xmlNodePtr(n_elem, elem, 2);
17767        xmlResetLastError();
17768        if (mem_base != xmlMemBlocks()) {
17769            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17770	           xmlMemBlocks() - mem_base);
17771	    test_ret++;
17772            printf(" %d", n_ctxt);
17773            printf(" %d", n_doc);
17774            printf(" %d", n_elem);
17775            printf("\n");
17776        }
17777    }
17778    }
17779    }
17780    function_tests++;
17781#endif
17782
17783    return(test_ret);
17784}
17785
17786
17787static int
17788test_xmlRelaxNGValidatePopElement(void) {
17789    int test_ret = 0;
17790
17791#if defined(LIBXML_SCHEMAS_ENABLED)
17792    int mem_base;
17793    int ret_val;
17794    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17795    int n_ctxt;
17796    xmlDocPtr doc; /* a document instance */
17797    int n_doc;
17798    xmlNodePtr elem; /* an element instance */
17799    int n_elem;
17800
17801    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17802    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17803    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17804        mem_base = xmlMemBlocks();
17805        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17806        doc = gen_xmlDocPtr(n_doc, 1);
17807        elem = gen_xmlNodePtr(n_elem, 2);
17808
17809        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17810        desret_int(ret_val);
17811        call_tests++;
17812        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17813        des_xmlDocPtr(n_doc, doc, 1);
17814        des_xmlNodePtr(n_elem, elem, 2);
17815        xmlResetLastError();
17816        if (mem_base != xmlMemBlocks()) {
17817            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17818	           xmlMemBlocks() - mem_base);
17819	    test_ret++;
17820            printf(" %d", n_ctxt);
17821            printf(" %d", n_doc);
17822            printf(" %d", n_elem);
17823            printf("\n");
17824        }
17825    }
17826    }
17827    }
17828    function_tests++;
17829#endif
17830
17831    return(test_ret);
17832}
17833
17834
17835static int
17836test_xmlRelaxNGValidatePushCData(void) {
17837    int test_ret = 0;
17838
17839#if defined(LIBXML_SCHEMAS_ENABLED)
17840    int mem_base;
17841    int ret_val;
17842    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17843    int n_ctxt;
17844    xmlChar * data; /* some character data read */
17845    int n_data;
17846    int len; /* the lenght of the data */
17847    int n_len;
17848
17849    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17850    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17851    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17852        mem_base = xmlMemBlocks();
17853        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17854        data = gen_const_xmlChar_ptr(n_data, 1);
17855        len = gen_int(n_len, 2);
17856
17857        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17858        desret_int(ret_val);
17859        call_tests++;
17860        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17861        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17862        des_int(n_len, len, 2);
17863        xmlResetLastError();
17864        if (mem_base != xmlMemBlocks()) {
17865            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17866	           xmlMemBlocks() - mem_base);
17867	    test_ret++;
17868            printf(" %d", n_ctxt);
17869            printf(" %d", n_data);
17870            printf(" %d", n_len);
17871            printf("\n");
17872        }
17873    }
17874    }
17875    }
17876    function_tests++;
17877#endif
17878
17879    return(test_ret);
17880}
17881
17882
17883static int
17884test_xmlRelaxNGValidatePushElement(void) {
17885    int test_ret = 0;
17886
17887#if defined(LIBXML_SCHEMAS_ENABLED)
17888    int mem_base;
17889    int ret_val;
17890    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17891    int n_ctxt;
17892    xmlDocPtr doc; /* a document instance */
17893    int n_doc;
17894    xmlNodePtr elem; /* an element instance */
17895    int n_elem;
17896
17897    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17898    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17899    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17900        mem_base = xmlMemBlocks();
17901        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17902        doc = gen_xmlDocPtr(n_doc, 1);
17903        elem = gen_xmlNodePtr(n_elem, 2);
17904
17905        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17906        desret_int(ret_val);
17907        call_tests++;
17908        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17909        des_xmlDocPtr(n_doc, doc, 1);
17910        des_xmlNodePtr(n_elem, elem, 2);
17911        xmlResetLastError();
17912        if (mem_base != xmlMemBlocks()) {
17913            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17914	           xmlMemBlocks() - mem_base);
17915	    test_ret++;
17916            printf(" %d", n_ctxt);
17917            printf(" %d", n_doc);
17918            printf(" %d", n_elem);
17919            printf("\n");
17920        }
17921    }
17922    }
17923    }
17924    function_tests++;
17925#endif
17926
17927    return(test_ret);
17928}
17929
17930
17931static int
17932test_xmlRelaxParserSetFlag(void) {
17933    int test_ret = 0;
17934
17935#if defined(LIBXML_SCHEMAS_ENABLED)
17936    int mem_base;
17937    int ret_val;
17938    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17939    int n_ctxt;
17940    int flags; /* a set of flags values */
17941    int n_flags;
17942
17943    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17944    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17945        mem_base = xmlMemBlocks();
17946        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17947        flags = gen_int(n_flags, 1);
17948
17949        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17950        desret_int(ret_val);
17951        call_tests++;
17952        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17953        des_int(n_flags, flags, 1);
17954        xmlResetLastError();
17955        if (mem_base != xmlMemBlocks()) {
17956            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17957	           xmlMemBlocks() - mem_base);
17958	    test_ret++;
17959            printf(" %d", n_ctxt);
17960            printf(" %d", n_flags);
17961            printf("\n");
17962        }
17963    }
17964    }
17965    function_tests++;
17966#endif
17967
17968    return(test_ret);
17969}
17970
17971static int
17972test_relaxng(void) {
17973    int test_ret = 0;
17974
17975    if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17976    test_ret += test_xmlRelaxNGDump();
17977    test_ret += test_xmlRelaxNGDumpTree();
17978    test_ret += test_xmlRelaxNGGetParserErrors();
17979    test_ret += test_xmlRelaxNGGetValidErrors();
17980    test_ret += test_xmlRelaxNGInitTypes();
17981    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17982    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17983    test_ret += test_xmlRelaxNGNewParserCtxt();
17984    test_ret += test_xmlRelaxNGNewValidCtxt();
17985    test_ret += test_xmlRelaxNGParse();
17986    test_ret += test_xmlRelaxNGSetParserErrors();
17987    test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17988    test_ret += test_xmlRelaxNGSetValidErrors();
17989    test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17990    test_ret += test_xmlRelaxNGValidateDoc();
17991    test_ret += test_xmlRelaxNGValidateFullElement();
17992    test_ret += test_xmlRelaxNGValidatePopElement();
17993    test_ret += test_xmlRelaxNGValidatePushCData();
17994    test_ret += test_xmlRelaxNGValidatePushElement();
17995    test_ret += test_xmlRelaxParserSetFlag();
17996
17997    if (test_ret != 0)
17998	printf("Module relaxng: %d errors\n", test_ret);
17999    return(test_ret);
18000}
18001static int
18002test_schemasInternals(void) {
18003    int test_ret = 0;
18004
18005    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18006
18007    if (test_ret != 0)
18008	printf("Module schemasInternals: %d errors\n", test_ret);
18009    return(test_ret);
18010}
18011
18012static int
18013test_xmlSchematronNewDocParserCtxt(void) {
18014    int test_ret = 0;
18015
18016
18017    /* missing type support */
18018    return(test_ret);
18019}
18020
18021
18022static int
18023test_xmlSchematronNewMemParserCtxt(void) {
18024    int test_ret = 0;
18025
18026
18027    /* missing type support */
18028    return(test_ret);
18029}
18030
18031
18032static int
18033test_xmlSchematronNewParserCtxt(void) {
18034    int test_ret = 0;
18035
18036
18037    /* missing type support */
18038    return(test_ret);
18039}
18040
18041#ifdef LIBXML_SCHEMATRON_ENABLED
18042
18043#define gen_nb_xmlSchematronPtr 1
18044static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18045    return(NULL);
18046}
18047static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18048}
18049#endif
18050
18051
18052static int
18053test_xmlSchematronNewValidCtxt(void) {
18054    int test_ret = 0;
18055
18056
18057    /* missing type support */
18058    return(test_ret);
18059}
18060
18061#ifdef LIBXML_SCHEMATRON_ENABLED
18062
18063#define gen_nb_xmlSchematronParserCtxtPtr 1
18064static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18065    return(NULL);
18066}
18067static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18068}
18069#endif
18070
18071
18072static int
18073test_xmlSchematronParse(void) {
18074    int test_ret = 0;
18075
18076
18077    /* missing type support */
18078    return(test_ret);
18079}
18080
18081#ifdef LIBXML_SCHEMATRON_ENABLED
18082
18083#define gen_nb_xmlSchematronValidCtxtPtr 1
18084static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18085    return(NULL);
18086}
18087static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18088}
18089#endif
18090
18091
18092static int
18093test_xmlSchematronSetValidStructuredErrors(void) {
18094    int test_ret = 0;
18095
18096
18097    /* missing type support */
18098    return(test_ret);
18099}
18100
18101
18102static int
18103test_xmlSchematronValidateDoc(void) {
18104    int test_ret = 0;
18105
18106#if defined(LIBXML_SCHEMATRON_ENABLED)
18107    int mem_base;
18108    int ret_val;
18109    xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18110    int n_ctxt;
18111    xmlDocPtr instance; /* the document instace tree */
18112    int n_instance;
18113
18114    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18115    for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18116        mem_base = xmlMemBlocks();
18117        ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18118        instance = gen_xmlDocPtr(n_instance, 1);
18119
18120        ret_val = xmlSchematronValidateDoc(ctxt, instance);
18121        desret_int(ret_val);
18122        call_tests++;
18123        des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18124        des_xmlDocPtr(n_instance, instance, 1);
18125        xmlResetLastError();
18126        if (mem_base != xmlMemBlocks()) {
18127            printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18128	           xmlMemBlocks() - mem_base);
18129	    test_ret++;
18130            printf(" %d", n_ctxt);
18131            printf(" %d", n_instance);
18132            printf("\n");
18133        }
18134    }
18135    }
18136    function_tests++;
18137#endif
18138
18139    return(test_ret);
18140}
18141
18142static int
18143test_schematron(void) {
18144    int test_ret = 0;
18145
18146    if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18147    test_ret += test_xmlSchematronNewDocParserCtxt();
18148    test_ret += test_xmlSchematronNewMemParserCtxt();
18149    test_ret += test_xmlSchematronNewParserCtxt();
18150    test_ret += test_xmlSchematronNewValidCtxt();
18151    test_ret += test_xmlSchematronParse();
18152    test_ret += test_xmlSchematronSetValidStructuredErrors();
18153    test_ret += test_xmlSchematronValidateDoc();
18154
18155    if (test_ret != 0)
18156	printf("Module schematron: %d errors\n", test_ret);
18157    return(test_ret);
18158}
18159
18160static int
18161test_xmlAddChild(void) {
18162    int test_ret = 0;
18163
18164    int mem_base;
18165    xmlNodePtr ret_val;
18166    xmlNodePtr parent; /* the parent node */
18167    int n_parent;
18168    xmlNodePtr cur; /* the child node */
18169    int n_cur;
18170
18171    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18172    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18173        mem_base = xmlMemBlocks();
18174        parent = gen_xmlNodePtr(n_parent, 0);
18175        cur = gen_xmlNodePtr_in(n_cur, 1);
18176
18177        ret_val = xmlAddChild(parent, cur);
18178        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18179        desret_xmlNodePtr(ret_val);
18180        call_tests++;
18181        des_xmlNodePtr(n_parent, parent, 0);
18182        des_xmlNodePtr_in(n_cur, cur, 1);
18183        xmlResetLastError();
18184        if (mem_base != xmlMemBlocks()) {
18185            printf("Leak of %d blocks found in xmlAddChild",
18186	           xmlMemBlocks() - mem_base);
18187	    test_ret++;
18188            printf(" %d", n_parent);
18189            printf(" %d", n_cur);
18190            printf("\n");
18191        }
18192    }
18193    }
18194    function_tests++;
18195
18196    return(test_ret);
18197}
18198
18199
18200static int
18201test_xmlAddChildList(void) {
18202    int test_ret = 0;
18203
18204    int mem_base;
18205    xmlNodePtr ret_val;
18206    xmlNodePtr parent; /* the parent node */
18207    int n_parent;
18208    xmlNodePtr cur; /* the first node in the list */
18209    int n_cur;
18210
18211    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18212    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18213        mem_base = xmlMemBlocks();
18214        parent = gen_xmlNodePtr(n_parent, 0);
18215        cur = gen_xmlNodePtr_in(n_cur, 1);
18216
18217        ret_val = xmlAddChildList(parent, cur);
18218        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18219        desret_xmlNodePtr(ret_val);
18220        call_tests++;
18221        des_xmlNodePtr(n_parent, parent, 0);
18222        des_xmlNodePtr_in(n_cur, cur, 1);
18223        xmlResetLastError();
18224        if (mem_base != xmlMemBlocks()) {
18225            printf("Leak of %d blocks found in xmlAddChildList",
18226	           xmlMemBlocks() - mem_base);
18227	    test_ret++;
18228            printf(" %d", n_parent);
18229            printf(" %d", n_cur);
18230            printf("\n");
18231        }
18232    }
18233    }
18234    function_tests++;
18235
18236    return(test_ret);
18237}
18238
18239
18240static int
18241test_xmlAddNextSibling(void) {
18242    int test_ret = 0;
18243
18244    int mem_base;
18245    xmlNodePtr ret_val;
18246    xmlNodePtr cur; /* the child node */
18247    int n_cur;
18248    xmlNodePtr elem; /* the new node */
18249    int n_elem;
18250
18251    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18252    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18253        mem_base = xmlMemBlocks();
18254        cur = gen_xmlNodePtr(n_cur, 0);
18255        elem = gen_xmlNodePtr_in(n_elem, 1);
18256
18257        ret_val = xmlAddNextSibling(cur, elem);
18258        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18259        desret_xmlNodePtr(ret_val);
18260        call_tests++;
18261        des_xmlNodePtr(n_cur, cur, 0);
18262        des_xmlNodePtr_in(n_elem, elem, 1);
18263        xmlResetLastError();
18264        if (mem_base != xmlMemBlocks()) {
18265            printf("Leak of %d blocks found in xmlAddNextSibling",
18266	           xmlMemBlocks() - mem_base);
18267	    test_ret++;
18268            printf(" %d", n_cur);
18269            printf(" %d", n_elem);
18270            printf("\n");
18271        }
18272    }
18273    }
18274    function_tests++;
18275
18276    return(test_ret);
18277}
18278
18279
18280static int
18281test_xmlAddPrevSibling(void) {
18282    int test_ret = 0;
18283
18284#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18285    int mem_base;
18286    xmlNodePtr ret_val;
18287    xmlNodePtr cur; /* the child node */
18288    int n_cur;
18289    xmlNodePtr elem; /* the new node */
18290    int n_elem;
18291
18292    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18293    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18294        mem_base = xmlMemBlocks();
18295        cur = gen_xmlNodePtr(n_cur, 0);
18296        elem = gen_xmlNodePtr_in(n_elem, 1);
18297
18298        ret_val = xmlAddPrevSibling(cur, elem);
18299        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18300        desret_xmlNodePtr(ret_val);
18301        call_tests++;
18302        des_xmlNodePtr(n_cur, cur, 0);
18303        des_xmlNodePtr_in(n_elem, elem, 1);
18304        xmlResetLastError();
18305        if (mem_base != xmlMemBlocks()) {
18306            printf("Leak of %d blocks found in xmlAddPrevSibling",
18307	           xmlMemBlocks() - mem_base);
18308	    test_ret++;
18309            printf(" %d", n_cur);
18310            printf(" %d", n_elem);
18311            printf("\n");
18312        }
18313    }
18314    }
18315    function_tests++;
18316#endif
18317
18318    return(test_ret);
18319}
18320
18321
18322static int
18323test_xmlAddSibling(void) {
18324    int test_ret = 0;
18325
18326    int mem_base;
18327    xmlNodePtr ret_val;
18328    xmlNodePtr cur; /* the child node */
18329    int n_cur;
18330    xmlNodePtr elem; /* the new node */
18331    int n_elem;
18332
18333    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18334    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18335        mem_base = xmlMemBlocks();
18336        cur = gen_xmlNodePtr(n_cur, 0);
18337        elem = gen_xmlNodePtr_in(n_elem, 1);
18338
18339        ret_val = xmlAddSibling(cur, elem);
18340        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18341        desret_xmlNodePtr(ret_val);
18342        call_tests++;
18343        des_xmlNodePtr(n_cur, cur, 0);
18344        des_xmlNodePtr_in(n_elem, elem, 1);
18345        xmlResetLastError();
18346        if (mem_base != xmlMemBlocks()) {
18347            printf("Leak of %d blocks found in xmlAddSibling",
18348	           xmlMemBlocks() - mem_base);
18349	    test_ret++;
18350            printf(" %d", n_cur);
18351            printf(" %d", n_elem);
18352            printf("\n");
18353        }
18354    }
18355    }
18356    function_tests++;
18357
18358    return(test_ret);
18359}
18360
18361
18362static int
18363test_xmlAttrSerializeTxtContent(void) {
18364    int test_ret = 0;
18365
18366#if defined(LIBXML_OUTPUT_ENABLED)
18367#ifdef LIBXML_OUTPUT_ENABLED
18368    int mem_base;
18369    xmlBufferPtr buf; /* the XML buffer output */
18370    int n_buf;
18371    xmlDocPtr doc; /* the document */
18372    int n_doc;
18373    xmlAttrPtr attr; /* the attribute node */
18374    int n_attr;
18375    xmlChar * string; /* the text content */
18376    int n_string;
18377
18378    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18379    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18380    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18381    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18382        mem_base = xmlMemBlocks();
18383        buf = gen_xmlBufferPtr(n_buf, 0);
18384        doc = gen_xmlDocPtr(n_doc, 1);
18385        attr = gen_xmlAttrPtr(n_attr, 2);
18386        string = gen_const_xmlChar_ptr(n_string, 3);
18387
18388        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18389        call_tests++;
18390        des_xmlBufferPtr(n_buf, buf, 0);
18391        des_xmlDocPtr(n_doc, doc, 1);
18392        des_xmlAttrPtr(n_attr, attr, 2);
18393        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18394        xmlResetLastError();
18395        if (mem_base != xmlMemBlocks()) {
18396            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18397	           xmlMemBlocks() - mem_base);
18398	    test_ret++;
18399            printf(" %d", n_buf);
18400            printf(" %d", n_doc);
18401            printf(" %d", n_attr);
18402            printf(" %d", n_string);
18403            printf("\n");
18404        }
18405    }
18406    }
18407    }
18408    }
18409    function_tests++;
18410#endif
18411#endif
18412
18413    return(test_ret);
18414}
18415
18416
18417static int
18418test_xmlBufferAdd(void) {
18419    int test_ret = 0;
18420
18421    int mem_base;
18422    int ret_val;
18423    xmlBufferPtr buf; /* the buffer to dump */
18424    int n_buf;
18425    xmlChar * str; /* the #xmlChar string */
18426    int n_str;
18427    int len; /* the number of #xmlChar to add */
18428    int n_len;
18429
18430    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18431    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18432    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18433        mem_base = xmlMemBlocks();
18434        buf = gen_xmlBufferPtr(n_buf, 0);
18435        str = gen_const_xmlChar_ptr(n_str, 1);
18436        len = gen_int(n_len, 2);
18437
18438        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18439        desret_int(ret_val);
18440        call_tests++;
18441        des_xmlBufferPtr(n_buf, buf, 0);
18442        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18443        des_int(n_len, len, 2);
18444        xmlResetLastError();
18445        if (mem_base != xmlMemBlocks()) {
18446            printf("Leak of %d blocks found in xmlBufferAdd",
18447	           xmlMemBlocks() - mem_base);
18448	    test_ret++;
18449            printf(" %d", n_buf);
18450            printf(" %d", n_str);
18451            printf(" %d", n_len);
18452            printf("\n");
18453        }
18454    }
18455    }
18456    }
18457    function_tests++;
18458
18459    return(test_ret);
18460}
18461
18462
18463static int
18464test_xmlBufferAddHead(void) {
18465    int test_ret = 0;
18466
18467    int mem_base;
18468    int ret_val;
18469    xmlBufferPtr buf; /* the buffer */
18470    int n_buf;
18471    xmlChar * str; /* the #xmlChar string */
18472    int n_str;
18473    int len; /* the number of #xmlChar to add */
18474    int n_len;
18475
18476    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18477    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18478    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18479        mem_base = xmlMemBlocks();
18480        buf = gen_xmlBufferPtr(n_buf, 0);
18481        str = gen_const_xmlChar_ptr(n_str, 1);
18482        len = gen_int(n_len, 2);
18483
18484        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18485        desret_int(ret_val);
18486        call_tests++;
18487        des_xmlBufferPtr(n_buf, buf, 0);
18488        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18489        des_int(n_len, len, 2);
18490        xmlResetLastError();
18491        if (mem_base != xmlMemBlocks()) {
18492            printf("Leak of %d blocks found in xmlBufferAddHead",
18493	           xmlMemBlocks() - mem_base);
18494	    test_ret++;
18495            printf(" %d", n_buf);
18496            printf(" %d", n_str);
18497            printf(" %d", n_len);
18498            printf("\n");
18499        }
18500    }
18501    }
18502    }
18503    function_tests++;
18504
18505    return(test_ret);
18506}
18507
18508
18509static int
18510test_xmlBufferCCat(void) {
18511    int test_ret = 0;
18512
18513    int mem_base;
18514    int ret_val;
18515    xmlBufferPtr buf; /* the buffer to dump */
18516    int n_buf;
18517    char * str; /* the C char string */
18518    int n_str;
18519
18520    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18521    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18522        mem_base = xmlMemBlocks();
18523        buf = gen_xmlBufferPtr(n_buf, 0);
18524        str = gen_const_char_ptr(n_str, 1);
18525
18526        ret_val = xmlBufferCCat(buf, (const char *)str);
18527        desret_int(ret_val);
18528        call_tests++;
18529        des_xmlBufferPtr(n_buf, buf, 0);
18530        des_const_char_ptr(n_str, (const char *)str, 1);
18531        xmlResetLastError();
18532        if (mem_base != xmlMemBlocks()) {
18533            printf("Leak of %d blocks found in xmlBufferCCat",
18534	           xmlMemBlocks() - mem_base);
18535	    test_ret++;
18536            printf(" %d", n_buf);
18537            printf(" %d", n_str);
18538            printf("\n");
18539        }
18540    }
18541    }
18542    function_tests++;
18543
18544    return(test_ret);
18545}
18546
18547
18548static int
18549test_xmlBufferCat(void) {
18550    int test_ret = 0;
18551
18552    int mem_base;
18553    int ret_val;
18554    xmlBufferPtr buf; /* the buffer to add to */
18555    int n_buf;
18556    xmlChar * str; /* the #xmlChar string */
18557    int n_str;
18558
18559    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18560    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18561        mem_base = xmlMemBlocks();
18562        buf = gen_xmlBufferPtr(n_buf, 0);
18563        str = gen_const_xmlChar_ptr(n_str, 1);
18564
18565        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18566        desret_int(ret_val);
18567        call_tests++;
18568        des_xmlBufferPtr(n_buf, buf, 0);
18569        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18570        xmlResetLastError();
18571        if (mem_base != xmlMemBlocks()) {
18572            printf("Leak of %d blocks found in xmlBufferCat",
18573	           xmlMemBlocks() - mem_base);
18574	    test_ret++;
18575            printf(" %d", n_buf);
18576            printf(" %d", n_str);
18577            printf("\n");
18578        }
18579    }
18580    }
18581    function_tests++;
18582
18583    return(test_ret);
18584}
18585
18586
18587#define gen_nb_const_xmlBufferPtr 1
18588static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18589    return(NULL);
18590}
18591static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18592}
18593
18594static int
18595test_xmlBufferContent(void) {
18596    int test_ret = 0;
18597
18598    int mem_base;
18599    const xmlChar * ret_val;
18600    xmlBufferPtr buf; /* the buffer */
18601    int n_buf;
18602
18603    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18604        mem_base = xmlMemBlocks();
18605        buf = gen_const_xmlBufferPtr(n_buf, 0);
18606
18607        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18608        desret_const_xmlChar_ptr(ret_val);
18609        call_tests++;
18610        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18611        xmlResetLastError();
18612        if (mem_base != xmlMemBlocks()) {
18613            printf("Leak of %d blocks found in xmlBufferContent",
18614	           xmlMemBlocks() - mem_base);
18615	    test_ret++;
18616            printf(" %d", n_buf);
18617            printf("\n");
18618        }
18619    }
18620    function_tests++;
18621
18622    return(test_ret);
18623}
18624
18625
18626static int
18627test_xmlBufferCreate(void) {
18628    int test_ret = 0;
18629
18630    int mem_base;
18631    xmlBufferPtr ret_val;
18632
18633        mem_base = xmlMemBlocks();
18634
18635        ret_val = xmlBufferCreate();
18636        desret_xmlBufferPtr(ret_val);
18637        call_tests++;
18638        xmlResetLastError();
18639        if (mem_base != xmlMemBlocks()) {
18640            printf("Leak of %d blocks found in xmlBufferCreate",
18641	           xmlMemBlocks() - mem_base);
18642	    test_ret++;
18643            printf("\n");
18644        }
18645    function_tests++;
18646
18647    return(test_ret);
18648}
18649
18650
18651static int
18652test_xmlBufferCreateSize(void) {
18653    int test_ret = 0;
18654
18655
18656    /* missing type support */
18657    return(test_ret);
18658}
18659
18660
18661static int
18662test_xmlBufferCreateStatic(void) {
18663    int test_ret = 0;
18664
18665
18666    /* missing type support */
18667    return(test_ret);
18668}
18669
18670
18671static int
18672test_xmlBufferEmpty(void) {
18673    int test_ret = 0;
18674
18675    int mem_base;
18676    xmlBufferPtr buf; /* the buffer */
18677    int n_buf;
18678
18679    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18680        mem_base = xmlMemBlocks();
18681        buf = gen_xmlBufferPtr(n_buf, 0);
18682
18683        xmlBufferEmpty(buf);
18684        call_tests++;
18685        des_xmlBufferPtr(n_buf, buf, 0);
18686        xmlResetLastError();
18687        if (mem_base != xmlMemBlocks()) {
18688            printf("Leak of %d blocks found in xmlBufferEmpty",
18689	           xmlMemBlocks() - mem_base);
18690	    test_ret++;
18691            printf(" %d", n_buf);
18692            printf("\n");
18693        }
18694    }
18695    function_tests++;
18696
18697    return(test_ret);
18698}
18699
18700
18701static int
18702test_xmlBufferGrow(void) {
18703    int test_ret = 0;
18704
18705    int mem_base;
18706    int ret_val;
18707    xmlBufferPtr buf; /* the buffer */
18708    int n_buf;
18709    unsigned int len; /* the minimum free size to allocate */
18710    int n_len;
18711
18712    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18713    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18714        mem_base = xmlMemBlocks();
18715        buf = gen_xmlBufferPtr(n_buf, 0);
18716        len = gen_unsigned_int(n_len, 1);
18717
18718        ret_val = xmlBufferGrow(buf, len);
18719        desret_int(ret_val);
18720        call_tests++;
18721        des_xmlBufferPtr(n_buf, buf, 0);
18722        des_unsigned_int(n_len, len, 1);
18723        xmlResetLastError();
18724        if (mem_base != xmlMemBlocks()) {
18725            printf("Leak of %d blocks found in xmlBufferGrow",
18726	           xmlMemBlocks() - mem_base);
18727	    test_ret++;
18728            printf(" %d", n_buf);
18729            printf(" %d", n_len);
18730            printf("\n");
18731        }
18732    }
18733    }
18734    function_tests++;
18735
18736    return(test_ret);
18737}
18738
18739
18740static int
18741test_xmlBufferLength(void) {
18742    int test_ret = 0;
18743
18744    int mem_base;
18745    int ret_val;
18746    xmlBufferPtr buf; /* the buffer */
18747    int n_buf;
18748
18749    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18750        mem_base = xmlMemBlocks();
18751        buf = gen_const_xmlBufferPtr(n_buf, 0);
18752
18753        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18754        desret_int(ret_val);
18755        call_tests++;
18756        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18757        xmlResetLastError();
18758        if (mem_base != xmlMemBlocks()) {
18759            printf("Leak of %d blocks found in xmlBufferLength",
18760	           xmlMemBlocks() - mem_base);
18761	    test_ret++;
18762            printf(" %d", n_buf);
18763            printf("\n");
18764        }
18765    }
18766    function_tests++;
18767
18768    return(test_ret);
18769}
18770
18771
18772static int
18773test_xmlBufferResize(void) {
18774    int test_ret = 0;
18775
18776    int mem_base;
18777    int ret_val;
18778    xmlBufferPtr buf; /* the buffer to resize */
18779    int n_buf;
18780    unsigned int size; /* the desired size */
18781    int n_size;
18782
18783    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18784    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18785        mem_base = xmlMemBlocks();
18786        buf = gen_xmlBufferPtr(n_buf, 0);
18787        size = gen_unsigned_int(n_size, 1);
18788
18789        ret_val = xmlBufferResize(buf, size);
18790        desret_int(ret_val);
18791        call_tests++;
18792        des_xmlBufferPtr(n_buf, buf, 0);
18793        des_unsigned_int(n_size, size, 1);
18794        xmlResetLastError();
18795        if (mem_base != xmlMemBlocks()) {
18796            printf("Leak of %d blocks found in xmlBufferResize",
18797	           xmlMemBlocks() - mem_base);
18798	    test_ret++;
18799            printf(" %d", n_buf);
18800            printf(" %d", n_size);
18801            printf("\n");
18802        }
18803    }
18804    }
18805    function_tests++;
18806
18807    return(test_ret);
18808}
18809
18810
18811static int
18812test_xmlBufferSetAllocationScheme(void) {
18813    int test_ret = 0;
18814
18815    int mem_base;
18816    xmlBufferPtr buf; /* the buffer to tune */
18817    int n_buf;
18818    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18819    int n_scheme;
18820
18821    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18822    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18823        mem_base = xmlMemBlocks();
18824        buf = gen_xmlBufferPtr(n_buf, 0);
18825        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18826
18827        xmlBufferSetAllocationScheme(buf, scheme);
18828        if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
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_xmlChildElementCount(void) {
19058    int test_ret = 0;
19059
19060#if defined(LIBXML_TREE_ENABLED)
19061    int mem_base;
19062    unsigned long ret_val;
19063    xmlNodePtr parent; /* the parent node */
19064    int n_parent;
19065
19066    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
19067        mem_base = xmlMemBlocks();
19068        parent = gen_xmlNodePtr(n_parent, 0);
19069
19070        ret_val = xmlChildElementCount(parent);
19071        desret_unsigned_long(ret_val);
19072        call_tests++;
19073        des_xmlNodePtr(n_parent, parent, 0);
19074        xmlResetLastError();
19075        if (mem_base != xmlMemBlocks()) {
19076            printf("Leak of %d blocks found in xmlChildElementCount",
19077	           xmlMemBlocks() - mem_base);
19078	    test_ret++;
19079            printf(" %d", n_parent);
19080            printf("\n");
19081        }
19082    }
19083    function_tests++;
19084#endif
19085
19086    return(test_ret);
19087}
19088
19089
19090static int
19091test_xmlCopyDoc(void) {
19092    int test_ret = 0;
19093
19094#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19095    int mem_base;
19096    xmlDocPtr ret_val;
19097    xmlDocPtr doc; /* the document */
19098    int n_doc;
19099    int recursive; /* if not zero do a recursive copy. */
19100    int n_recursive;
19101
19102    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19103    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19104        mem_base = xmlMemBlocks();
19105        doc = gen_xmlDocPtr(n_doc, 0);
19106        recursive = gen_int(n_recursive, 1);
19107
19108        ret_val = xmlCopyDoc(doc, recursive);
19109        desret_xmlDocPtr(ret_val);
19110        call_tests++;
19111        des_xmlDocPtr(n_doc, doc, 0);
19112        des_int(n_recursive, recursive, 1);
19113        xmlResetLastError();
19114        if (mem_base != xmlMemBlocks()) {
19115            printf("Leak of %d blocks found in xmlCopyDoc",
19116	           xmlMemBlocks() - mem_base);
19117	    test_ret++;
19118            printf(" %d", n_doc);
19119            printf(" %d", n_recursive);
19120            printf("\n");
19121        }
19122    }
19123    }
19124    function_tests++;
19125#endif
19126
19127    return(test_ret);
19128}
19129
19130
19131static int
19132test_xmlCopyDtd(void) {
19133    int test_ret = 0;
19134
19135#if defined(LIBXML_TREE_ENABLED)
19136    int mem_base;
19137    xmlDtdPtr ret_val;
19138    xmlDtdPtr dtd; /* the dtd */
19139    int n_dtd;
19140
19141    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19142        mem_base = xmlMemBlocks();
19143        dtd = gen_xmlDtdPtr(n_dtd, 0);
19144
19145        ret_val = xmlCopyDtd(dtd);
19146        desret_xmlDtdPtr(ret_val);
19147        call_tests++;
19148        des_xmlDtdPtr(n_dtd, dtd, 0);
19149        xmlResetLastError();
19150        if (mem_base != xmlMemBlocks()) {
19151            printf("Leak of %d blocks found in xmlCopyDtd",
19152	           xmlMemBlocks() - mem_base);
19153	    test_ret++;
19154            printf(" %d", n_dtd);
19155            printf("\n");
19156        }
19157    }
19158    function_tests++;
19159#endif
19160
19161    return(test_ret);
19162}
19163
19164
19165static int
19166test_xmlCopyNamespace(void) {
19167    int test_ret = 0;
19168
19169    int mem_base;
19170    xmlNsPtr ret_val;
19171    xmlNsPtr cur; /* the namespace */
19172    int n_cur;
19173
19174    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19175        mem_base = xmlMemBlocks();
19176        cur = gen_xmlNsPtr(n_cur, 0);
19177
19178        ret_val = xmlCopyNamespace(cur);
19179        if (ret_val != NULL) xmlFreeNs(ret_val);
19180        desret_xmlNsPtr(ret_val);
19181        call_tests++;
19182        des_xmlNsPtr(n_cur, cur, 0);
19183        xmlResetLastError();
19184        if (mem_base != xmlMemBlocks()) {
19185            printf("Leak of %d blocks found in xmlCopyNamespace",
19186	           xmlMemBlocks() - mem_base);
19187	    test_ret++;
19188            printf(" %d", n_cur);
19189            printf("\n");
19190        }
19191    }
19192    function_tests++;
19193
19194    return(test_ret);
19195}
19196
19197
19198static int
19199test_xmlCopyNamespaceList(void) {
19200    int test_ret = 0;
19201
19202    int mem_base;
19203    xmlNsPtr ret_val;
19204    xmlNsPtr cur; /* the first namespace */
19205    int n_cur;
19206
19207    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19208        mem_base = xmlMemBlocks();
19209        cur = gen_xmlNsPtr(n_cur, 0);
19210
19211        ret_val = xmlCopyNamespaceList(cur);
19212        if (ret_val != NULL) xmlFreeNsList(ret_val);
19213        desret_xmlNsPtr(ret_val);
19214        call_tests++;
19215        des_xmlNsPtr(n_cur, cur, 0);
19216        xmlResetLastError();
19217        if (mem_base != xmlMemBlocks()) {
19218            printf("Leak of %d blocks found in xmlCopyNamespaceList",
19219	           xmlMemBlocks() - mem_base);
19220	    test_ret++;
19221            printf(" %d", n_cur);
19222            printf("\n");
19223        }
19224    }
19225    function_tests++;
19226
19227    return(test_ret);
19228}
19229
19230
19231static int
19232test_xmlCopyNode(void) {
19233    int test_ret = 0;
19234
19235    int mem_base;
19236    xmlNodePtr ret_val;
19237    xmlNodePtr node; /* the node */
19238    int n_node;
19239    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19240    int n_extended;
19241
19242    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19243    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19244        mem_base = xmlMemBlocks();
19245        node = gen_const_xmlNodePtr(n_node, 0);
19246        extended = gen_int(n_extended, 1);
19247
19248        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19249        desret_xmlNodePtr(ret_val);
19250        call_tests++;
19251        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19252        des_int(n_extended, extended, 1);
19253        xmlResetLastError();
19254        if (mem_base != xmlMemBlocks()) {
19255            printf("Leak of %d blocks found in xmlCopyNode",
19256	           xmlMemBlocks() - mem_base);
19257	    test_ret++;
19258            printf(" %d", n_node);
19259            printf(" %d", n_extended);
19260            printf("\n");
19261        }
19262    }
19263    }
19264    function_tests++;
19265
19266    return(test_ret);
19267}
19268
19269
19270static int
19271test_xmlCopyNodeList(void) {
19272    int test_ret = 0;
19273
19274    int mem_base;
19275    xmlNodePtr ret_val;
19276    xmlNodePtr node; /* the first node in the list. */
19277    int n_node;
19278
19279    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19280        mem_base = xmlMemBlocks();
19281        node = gen_const_xmlNodePtr(n_node, 0);
19282
19283        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19284        desret_xmlNodePtr(ret_val);
19285        call_tests++;
19286        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19287        xmlResetLastError();
19288        if (mem_base != xmlMemBlocks()) {
19289            printf("Leak of %d blocks found in xmlCopyNodeList",
19290	           xmlMemBlocks() - mem_base);
19291	    test_ret++;
19292            printf(" %d", n_node);
19293            printf("\n");
19294        }
19295    }
19296    function_tests++;
19297
19298    return(test_ret);
19299}
19300
19301
19302static int
19303test_xmlCopyProp(void) {
19304    int test_ret = 0;
19305
19306    int mem_base;
19307    xmlAttrPtr ret_val;
19308    xmlNodePtr target; /* the element where the attribute will be grafted */
19309    int n_target;
19310    xmlAttrPtr cur; /* the attribute */
19311    int n_cur;
19312
19313    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19314    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19315        mem_base = xmlMemBlocks();
19316        target = gen_xmlNodePtr(n_target, 0);
19317        cur = gen_xmlAttrPtr(n_cur, 1);
19318
19319        ret_val = xmlCopyProp(target, cur);
19320        desret_xmlAttrPtr(ret_val);
19321        call_tests++;
19322        des_xmlNodePtr(n_target, target, 0);
19323        des_xmlAttrPtr(n_cur, cur, 1);
19324        xmlResetLastError();
19325        if (mem_base != xmlMemBlocks()) {
19326            printf("Leak of %d blocks found in xmlCopyProp",
19327	           xmlMemBlocks() - mem_base);
19328	    test_ret++;
19329            printf(" %d", n_target);
19330            printf(" %d", n_cur);
19331            printf("\n");
19332        }
19333    }
19334    }
19335    function_tests++;
19336
19337    return(test_ret);
19338}
19339
19340
19341static int
19342test_xmlCopyPropList(void) {
19343    int test_ret = 0;
19344
19345    int mem_base;
19346    xmlAttrPtr ret_val;
19347    xmlNodePtr target; /* the element where the attributes will be grafted */
19348    int n_target;
19349    xmlAttrPtr cur; /* the first attribute */
19350    int n_cur;
19351
19352    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19353    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19354        mem_base = xmlMemBlocks();
19355        target = gen_xmlNodePtr(n_target, 0);
19356        cur = gen_xmlAttrPtr(n_cur, 1);
19357
19358        ret_val = xmlCopyPropList(target, cur);
19359        desret_xmlAttrPtr(ret_val);
19360        call_tests++;
19361        des_xmlNodePtr(n_target, target, 0);
19362        des_xmlAttrPtr(n_cur, cur, 1);
19363        xmlResetLastError();
19364        if (mem_base != xmlMemBlocks()) {
19365            printf("Leak of %d blocks found in xmlCopyPropList",
19366	           xmlMemBlocks() - mem_base);
19367	    test_ret++;
19368            printf(" %d", n_target);
19369            printf(" %d", n_cur);
19370            printf("\n");
19371        }
19372    }
19373    }
19374    function_tests++;
19375
19376    return(test_ret);
19377}
19378
19379
19380static int
19381test_xmlCreateIntSubset(void) {
19382    int test_ret = 0;
19383
19384    int mem_base;
19385    xmlDtdPtr ret_val;
19386    xmlDocPtr doc; /* the document pointer */
19387    int n_doc;
19388    xmlChar * name; /* the DTD name */
19389    int n_name;
19390    xmlChar * ExternalID; /* the external (PUBLIC) ID */
19391    int n_ExternalID;
19392    xmlChar * SystemID; /* the system ID */
19393    int n_SystemID;
19394
19395    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19396    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19397    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19398    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19399        mem_base = xmlMemBlocks();
19400        doc = gen_xmlDocPtr(n_doc, 0);
19401        name = gen_const_xmlChar_ptr(n_name, 1);
19402        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19403        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19404
19405        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19406        desret_xmlDtdPtr(ret_val);
19407        call_tests++;
19408        des_xmlDocPtr(n_doc, doc, 0);
19409        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19410        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19411        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19412        xmlResetLastError();
19413        if (mem_base != xmlMemBlocks()) {
19414            printf("Leak of %d blocks found in xmlCreateIntSubset",
19415	           xmlMemBlocks() - mem_base);
19416	    test_ret++;
19417            printf(" %d", n_doc);
19418            printf(" %d", n_name);
19419            printf(" %d", n_ExternalID);
19420            printf(" %d", n_SystemID);
19421            printf("\n");
19422        }
19423    }
19424    }
19425    }
19426    }
19427    function_tests++;
19428
19429    return(test_ret);
19430}
19431
19432
19433#define gen_nb_xmlDOMWrapCtxtPtr 1
19434static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19435    return(NULL);
19436}
19437static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19438}
19439
19440static int
19441test_xmlDOMWrapAdoptNode(void) {
19442    int test_ret = 0;
19443
19444    int mem_base;
19445    int ret_val;
19446    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19447    int n_ctxt;
19448    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19449    int n_sourceDoc;
19450    xmlNodePtr node; /* the node to start with */
19451    int n_node;
19452    xmlDocPtr destDoc; /* the destination doc */
19453    int n_destDoc;
19454    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19455    int n_destParent;
19456    int options; /* option flags */
19457    int n_options;
19458
19459    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19460    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19461    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19462    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19463    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19464    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19465        mem_base = xmlMemBlocks();
19466        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19467        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19468        node = gen_xmlNodePtr(n_node, 2);
19469        destDoc = gen_xmlDocPtr(n_destDoc, 3);
19470        destParent = gen_xmlNodePtr(n_destParent, 4);
19471        options = gen_int(n_options, 5);
19472
19473        ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19474        if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19475        desret_int(ret_val);
19476        call_tests++;
19477        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19478        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19479        des_xmlNodePtr(n_node, node, 2);
19480        des_xmlDocPtr(n_destDoc, destDoc, 3);
19481        des_xmlNodePtr(n_destParent, destParent, 4);
19482        des_int(n_options, options, 5);
19483        xmlResetLastError();
19484        if (mem_base != xmlMemBlocks()) {
19485            printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19486	           xmlMemBlocks() - mem_base);
19487	    test_ret++;
19488            printf(" %d", n_ctxt);
19489            printf(" %d", n_sourceDoc);
19490            printf(" %d", n_node);
19491            printf(" %d", n_destDoc);
19492            printf(" %d", n_destParent);
19493            printf(" %d", n_options);
19494            printf("\n");
19495        }
19496    }
19497    }
19498    }
19499    }
19500    }
19501    }
19502    function_tests++;
19503
19504    return(test_ret);
19505}
19506
19507
19508static int
19509test_xmlDOMWrapCloneNode(void) {
19510    int test_ret = 0;
19511
19512    int mem_base;
19513    int ret_val;
19514    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19515    int n_ctxt;
19516    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19517    int n_sourceDoc;
19518    xmlNodePtr node; /* the node to start with */
19519    int n_node;
19520    xmlNodePtr * resNode; /* the clone of the given @node */
19521    int n_resNode;
19522    xmlDocPtr destDoc; /* the destination doc */
19523    int n_destDoc;
19524    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19525    int n_destParent;
19526    int deep; /* descend into child if set */
19527    int n_deep;
19528    int options; /* option flags */
19529    int n_options;
19530
19531    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19532    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19533    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19534    for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19535    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19536    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19537    for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19538    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19539        mem_base = xmlMemBlocks();
19540        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19541        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19542        node = gen_xmlNodePtr(n_node, 2);
19543        resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19544        destDoc = gen_xmlDocPtr(n_destDoc, 4);
19545        destParent = gen_xmlNodePtr(n_destParent, 5);
19546        deep = gen_int(n_deep, 6);
19547        options = gen_int(n_options, 7);
19548
19549        ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19550        desret_int(ret_val);
19551        call_tests++;
19552        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19553        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19554        des_xmlNodePtr(n_node, node, 2);
19555        des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19556        des_xmlDocPtr(n_destDoc, destDoc, 4);
19557        des_xmlNodePtr(n_destParent, destParent, 5);
19558        des_int(n_deep, deep, 6);
19559        des_int(n_options, options, 7);
19560        xmlResetLastError();
19561        if (mem_base != xmlMemBlocks()) {
19562            printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19563	           xmlMemBlocks() - mem_base);
19564	    test_ret++;
19565            printf(" %d", n_ctxt);
19566            printf(" %d", n_sourceDoc);
19567            printf(" %d", n_node);
19568            printf(" %d", n_resNode);
19569            printf(" %d", n_destDoc);
19570            printf(" %d", n_destParent);
19571            printf(" %d", n_deep);
19572            printf(" %d", n_options);
19573            printf("\n");
19574        }
19575    }
19576    }
19577    }
19578    }
19579    }
19580    }
19581    }
19582    }
19583    function_tests++;
19584
19585    return(test_ret);
19586}
19587
19588
19589static int
19590test_xmlDOMWrapNewCtxt(void) {
19591    int test_ret = 0;
19592
19593
19594    /* missing type support */
19595    return(test_ret);
19596}
19597
19598
19599static int
19600test_xmlDOMWrapReconcileNamespaces(void) {
19601    int test_ret = 0;
19602
19603    int mem_base;
19604    int ret_val;
19605    xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19606    int n_ctxt;
19607    xmlNodePtr elem; /* the element-node */
19608    int n_elem;
19609    int options; /* option flags */
19610    int n_options;
19611
19612    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19613    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19614    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19615        mem_base = xmlMemBlocks();
19616        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19617        elem = gen_xmlNodePtr(n_elem, 1);
19618        options = gen_int(n_options, 2);
19619
19620        ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19621        desret_int(ret_val);
19622        call_tests++;
19623        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19624        des_xmlNodePtr(n_elem, elem, 1);
19625        des_int(n_options, options, 2);
19626        xmlResetLastError();
19627        if (mem_base != xmlMemBlocks()) {
19628            printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19629	           xmlMemBlocks() - mem_base);
19630	    test_ret++;
19631            printf(" %d", n_ctxt);
19632            printf(" %d", n_elem);
19633            printf(" %d", n_options);
19634            printf("\n");
19635        }
19636    }
19637    }
19638    }
19639    function_tests++;
19640
19641    return(test_ret);
19642}
19643
19644
19645static int
19646test_xmlDOMWrapRemoveNode(void) {
19647    int test_ret = 0;
19648
19649    int mem_base;
19650    int ret_val;
19651    xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19652    int n_ctxt;
19653    xmlDocPtr doc; /* the doc */
19654    int n_doc;
19655    xmlNodePtr node; /* the node to be removed. */
19656    int n_node;
19657    int options; /* set of options, unused at the moment */
19658    int n_options;
19659
19660    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19661    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19662    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19663    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19664        mem_base = xmlMemBlocks();
19665        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19666        doc = gen_xmlDocPtr(n_doc, 1);
19667        node = gen_xmlNodePtr(n_node, 2);
19668        options = gen_int(n_options, 3);
19669
19670        ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19671        desret_int(ret_val);
19672        call_tests++;
19673        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19674        des_xmlDocPtr(n_doc, doc, 1);
19675        des_xmlNodePtr(n_node, node, 2);
19676        des_int(n_options, options, 3);
19677        xmlResetLastError();
19678        if (mem_base != xmlMemBlocks()) {
19679            printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19680	           xmlMemBlocks() - mem_base);
19681	    test_ret++;
19682            printf(" %d", n_ctxt);
19683            printf(" %d", n_doc);
19684            printf(" %d", n_node);
19685            printf(" %d", n_options);
19686            printf("\n");
19687        }
19688    }
19689    }
19690    }
19691    }
19692    function_tests++;
19693
19694    return(test_ret);
19695}
19696
19697
19698static int
19699test_xmlDocCopyNode(void) {
19700    int test_ret = 0;
19701
19702    int mem_base;
19703    xmlNodePtr ret_val;
19704    xmlNodePtr node; /* the node */
19705    int n_node;
19706    xmlDocPtr doc; /* the document */
19707    int n_doc;
19708    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19709    int n_extended;
19710
19711    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19712    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19713    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19714        mem_base = xmlMemBlocks();
19715        node = gen_const_xmlNodePtr(n_node, 0);
19716        doc = gen_xmlDocPtr(n_doc, 1);
19717        extended = gen_int(n_extended, 2);
19718
19719        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19720        desret_xmlNodePtr(ret_val);
19721        call_tests++;
19722        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19723        des_xmlDocPtr(n_doc, doc, 1);
19724        des_int(n_extended, extended, 2);
19725        xmlResetLastError();
19726        if (mem_base != xmlMemBlocks()) {
19727            printf("Leak of %d blocks found in xmlDocCopyNode",
19728	           xmlMemBlocks() - mem_base);
19729	    test_ret++;
19730            printf(" %d", n_node);
19731            printf(" %d", n_doc);
19732            printf(" %d", n_extended);
19733            printf("\n");
19734        }
19735    }
19736    }
19737    }
19738    function_tests++;
19739
19740    return(test_ret);
19741}
19742
19743
19744static int
19745test_xmlDocCopyNodeList(void) {
19746    int test_ret = 0;
19747
19748    int mem_base;
19749    xmlNodePtr ret_val;
19750    xmlDocPtr doc; /* the target document */
19751    int n_doc;
19752    xmlNodePtr node; /* the first node in the list. */
19753    int n_node;
19754
19755    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19756    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19757        mem_base = xmlMemBlocks();
19758        doc = gen_xmlDocPtr(n_doc, 0);
19759        node = gen_const_xmlNodePtr(n_node, 1);
19760
19761        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19762        desret_xmlNodePtr(ret_val);
19763        call_tests++;
19764        des_xmlDocPtr(n_doc, doc, 0);
19765        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19766        xmlResetLastError();
19767        if (mem_base != xmlMemBlocks()) {
19768            printf("Leak of %d blocks found in xmlDocCopyNodeList",
19769	           xmlMemBlocks() - mem_base);
19770	    test_ret++;
19771            printf(" %d", n_doc);
19772            printf(" %d", n_node);
19773            printf("\n");
19774        }
19775    }
19776    }
19777    function_tests++;
19778
19779    return(test_ret);
19780}
19781
19782
19783static int
19784test_xmlDocDump(void) {
19785    int test_ret = 0;
19786
19787#if defined(LIBXML_OUTPUT_ENABLED)
19788    int mem_base;
19789    int ret_val;
19790    FILE * f; /* the FILE* */
19791    int n_f;
19792    xmlDocPtr cur; /* the document */
19793    int n_cur;
19794
19795    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19796    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19797        mem_base = xmlMemBlocks();
19798        f = gen_FILE_ptr(n_f, 0);
19799        cur = gen_xmlDocPtr(n_cur, 1);
19800
19801        ret_val = xmlDocDump(f, cur);
19802        desret_int(ret_val);
19803        call_tests++;
19804        des_FILE_ptr(n_f, f, 0);
19805        des_xmlDocPtr(n_cur, cur, 1);
19806        xmlResetLastError();
19807        if (mem_base != xmlMemBlocks()) {
19808            printf("Leak of %d blocks found in xmlDocDump",
19809	           xmlMemBlocks() - mem_base);
19810	    test_ret++;
19811            printf(" %d", n_f);
19812            printf(" %d", n_cur);
19813            printf("\n");
19814        }
19815    }
19816    }
19817    function_tests++;
19818#endif
19819
19820    return(test_ret);
19821}
19822
19823
19824static int
19825test_xmlDocDumpFormatMemory(void) {
19826    int test_ret = 0;
19827
19828#if defined(LIBXML_OUTPUT_ENABLED)
19829    int mem_base;
19830    xmlDocPtr cur; /* the document */
19831    int n_cur;
19832    xmlChar ** mem; /* OUT: the memory pointer */
19833    int n_mem;
19834    int * size; /* OUT: the memory length */
19835    int n_size;
19836    int format; /* should formatting spaces been added */
19837    int n_format;
19838
19839    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19840    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19841    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19842    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19843        mem_base = xmlMemBlocks();
19844        cur = gen_xmlDocPtr(n_cur, 0);
19845        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19846        size = gen_int_ptr(n_size, 2);
19847        format = gen_int(n_format, 3);
19848
19849        xmlDocDumpFormatMemory(cur, mem, size, format);
19850        call_tests++;
19851        des_xmlDocPtr(n_cur, cur, 0);
19852        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19853        des_int_ptr(n_size, size, 2);
19854        des_int(n_format, format, 3);
19855        xmlResetLastError();
19856        if (mem_base != xmlMemBlocks()) {
19857            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19858	           xmlMemBlocks() - mem_base);
19859	    test_ret++;
19860            printf(" %d", n_cur);
19861            printf(" %d", n_mem);
19862            printf(" %d", n_size);
19863            printf(" %d", n_format);
19864            printf("\n");
19865        }
19866    }
19867    }
19868    }
19869    }
19870    function_tests++;
19871#endif
19872
19873    return(test_ret);
19874}
19875
19876
19877static int
19878test_xmlDocDumpFormatMemoryEnc(void) {
19879    int test_ret = 0;
19880
19881#if defined(LIBXML_OUTPUT_ENABLED)
19882    int mem_base;
19883    xmlDocPtr out_doc; /* Document to generate XML text from */
19884    int n_out_doc;
19885    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19886    int n_doc_txt_ptr;
19887    int * doc_txt_len; /* Length of the generated XML text */
19888    int n_doc_txt_len;
19889    char * txt_encoding; /* Character encoding to use when generating XML text */
19890    int n_txt_encoding;
19891    int format; /* should formatting spaces been added */
19892    int n_format;
19893
19894    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19895    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19896    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19897    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19898    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19899        mem_base = xmlMemBlocks();
19900        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19901        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19902        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19903        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19904        format = gen_int(n_format, 4);
19905
19906        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19907        call_tests++;
19908        des_xmlDocPtr(n_out_doc, out_doc, 0);
19909        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19910        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19911        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19912        des_int(n_format, format, 4);
19913        xmlResetLastError();
19914        if (mem_base != xmlMemBlocks()) {
19915            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19916	           xmlMemBlocks() - mem_base);
19917	    test_ret++;
19918            printf(" %d", n_out_doc);
19919            printf(" %d", n_doc_txt_ptr);
19920            printf(" %d", n_doc_txt_len);
19921            printf(" %d", n_txt_encoding);
19922            printf(" %d", n_format);
19923            printf("\n");
19924        }
19925    }
19926    }
19927    }
19928    }
19929    }
19930    function_tests++;
19931#endif
19932
19933    return(test_ret);
19934}
19935
19936
19937static int
19938test_xmlDocDumpMemory(void) {
19939    int test_ret = 0;
19940
19941#if defined(LIBXML_OUTPUT_ENABLED)
19942    int mem_base;
19943    xmlDocPtr cur; /* the document */
19944    int n_cur;
19945    xmlChar ** mem; /* OUT: the memory pointer */
19946    int n_mem;
19947    int * size; /* OUT: the memory length */
19948    int n_size;
19949
19950    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19951    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19952    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19953        mem_base = xmlMemBlocks();
19954        cur = gen_xmlDocPtr(n_cur, 0);
19955        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19956        size = gen_int_ptr(n_size, 2);
19957
19958        xmlDocDumpMemory(cur, mem, size);
19959        call_tests++;
19960        des_xmlDocPtr(n_cur, cur, 0);
19961        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19962        des_int_ptr(n_size, size, 2);
19963        xmlResetLastError();
19964        if (mem_base != xmlMemBlocks()) {
19965            printf("Leak of %d blocks found in xmlDocDumpMemory",
19966	           xmlMemBlocks() - mem_base);
19967	    test_ret++;
19968            printf(" %d", n_cur);
19969            printf(" %d", n_mem);
19970            printf(" %d", n_size);
19971            printf("\n");
19972        }
19973    }
19974    }
19975    }
19976    function_tests++;
19977#endif
19978
19979    return(test_ret);
19980}
19981
19982
19983static int
19984test_xmlDocDumpMemoryEnc(void) {
19985    int test_ret = 0;
19986
19987#if defined(LIBXML_OUTPUT_ENABLED)
19988    int mem_base;
19989    xmlDocPtr out_doc; /* Document to generate XML text from */
19990    int n_out_doc;
19991    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19992    int n_doc_txt_ptr;
19993    int * doc_txt_len; /* Length of the generated XML text */
19994    int n_doc_txt_len;
19995    char * txt_encoding; /* Character encoding to use when generating XML text */
19996    int n_txt_encoding;
19997
19998    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19999    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
20000    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
20001    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
20002        mem_base = xmlMemBlocks();
20003        out_doc = gen_xmlDocPtr(n_out_doc, 0);
20004        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
20005        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
20006        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
20007
20008        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
20009        call_tests++;
20010        des_xmlDocPtr(n_out_doc, out_doc, 0);
20011        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
20012        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
20013        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
20014        xmlResetLastError();
20015        if (mem_base != xmlMemBlocks()) {
20016            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
20017	           xmlMemBlocks() - mem_base);
20018	    test_ret++;
20019            printf(" %d", n_out_doc);
20020            printf(" %d", n_doc_txt_ptr);
20021            printf(" %d", n_doc_txt_len);
20022            printf(" %d", n_txt_encoding);
20023            printf("\n");
20024        }
20025    }
20026    }
20027    }
20028    }
20029    function_tests++;
20030#endif
20031
20032    return(test_ret);
20033}
20034
20035
20036static int
20037test_xmlDocFormatDump(void) {
20038    int test_ret = 0;
20039
20040#if defined(LIBXML_OUTPUT_ENABLED)
20041    int mem_base;
20042    int ret_val;
20043    FILE * f; /* the FILE* */
20044    int n_f;
20045    xmlDocPtr cur; /* the document */
20046    int n_cur;
20047    int format; /* should formatting spaces been added */
20048    int n_format;
20049
20050    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20051    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20052    for (n_format = 0;n_format < gen_nb_int;n_format++) {
20053        mem_base = xmlMemBlocks();
20054        f = gen_FILE_ptr(n_f, 0);
20055        cur = gen_xmlDocPtr(n_cur, 1);
20056        format = gen_int(n_format, 2);
20057
20058        ret_val = xmlDocFormatDump(f, cur, format);
20059        desret_int(ret_val);
20060        call_tests++;
20061        des_FILE_ptr(n_f, f, 0);
20062        des_xmlDocPtr(n_cur, cur, 1);
20063        des_int(n_format, format, 2);
20064        xmlResetLastError();
20065        if (mem_base != xmlMemBlocks()) {
20066            printf("Leak of %d blocks found in xmlDocFormatDump",
20067	           xmlMemBlocks() - mem_base);
20068	    test_ret++;
20069            printf(" %d", n_f);
20070            printf(" %d", n_cur);
20071            printf(" %d", n_format);
20072            printf("\n");
20073        }
20074    }
20075    }
20076    }
20077    function_tests++;
20078#endif
20079
20080    return(test_ret);
20081}
20082
20083
20084static int
20085test_xmlDocGetRootElement(void) {
20086    int test_ret = 0;
20087
20088    int mem_base;
20089    xmlNodePtr ret_val;
20090    xmlDocPtr doc; /* the document */
20091    int n_doc;
20092
20093    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20094        mem_base = xmlMemBlocks();
20095        doc = gen_xmlDocPtr(n_doc, 0);
20096
20097        ret_val = xmlDocGetRootElement(doc);
20098        desret_xmlNodePtr(ret_val);
20099        call_tests++;
20100        des_xmlDocPtr(n_doc, doc, 0);
20101        xmlResetLastError();
20102        if (mem_base != xmlMemBlocks()) {
20103            printf("Leak of %d blocks found in xmlDocGetRootElement",
20104	           xmlMemBlocks() - mem_base);
20105	    test_ret++;
20106            printf(" %d", n_doc);
20107            printf("\n");
20108        }
20109    }
20110    function_tests++;
20111
20112    return(test_ret);
20113}
20114
20115
20116static int
20117test_xmlDocSetRootElement(void) {
20118    int test_ret = 0;
20119
20120#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20121    int mem_base;
20122    xmlNodePtr ret_val;
20123    xmlDocPtr doc; /* the document */
20124    int n_doc;
20125    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. */
20126    int n_root;
20127
20128    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20129    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20130        mem_base = xmlMemBlocks();
20131        doc = gen_xmlDocPtr(n_doc, 0);
20132        root = gen_xmlNodePtr_in(n_root, 1);
20133
20134        ret_val = xmlDocSetRootElement(doc, root);
20135        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20136        desret_xmlNodePtr(ret_val);
20137        call_tests++;
20138        des_xmlDocPtr(n_doc, doc, 0);
20139        des_xmlNodePtr_in(n_root, root, 1);
20140        xmlResetLastError();
20141        if (mem_base != xmlMemBlocks()) {
20142            printf("Leak of %d blocks found in xmlDocSetRootElement",
20143	           xmlMemBlocks() - mem_base);
20144	    test_ret++;
20145            printf(" %d", n_doc);
20146            printf(" %d", n_root);
20147            printf("\n");
20148        }
20149    }
20150    }
20151    function_tests++;
20152#endif
20153
20154    return(test_ret);
20155}
20156
20157
20158static int
20159test_xmlElemDump(void) {
20160    int test_ret = 0;
20161
20162#if defined(LIBXML_OUTPUT_ENABLED)
20163    int mem_base;
20164    FILE * f; /* the FILE * for the output */
20165    int n_f;
20166    xmlDocPtr doc; /* the document */
20167    int n_doc;
20168    xmlNodePtr cur; /* the current node */
20169    int n_cur;
20170
20171    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20172    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20173    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20174        mem_base = xmlMemBlocks();
20175        f = gen_FILE_ptr(n_f, 0);
20176        doc = gen_xmlDocPtr(n_doc, 1);
20177        cur = gen_xmlNodePtr(n_cur, 2);
20178
20179        xmlElemDump(f, doc, cur);
20180        call_tests++;
20181        des_FILE_ptr(n_f, f, 0);
20182        des_xmlDocPtr(n_doc, doc, 1);
20183        des_xmlNodePtr(n_cur, cur, 2);
20184        xmlResetLastError();
20185        if (mem_base != xmlMemBlocks()) {
20186            printf("Leak of %d blocks found in xmlElemDump",
20187	           xmlMemBlocks() - mem_base);
20188	    test_ret++;
20189            printf(" %d", n_f);
20190            printf(" %d", n_doc);
20191            printf(" %d", n_cur);
20192            printf("\n");
20193        }
20194    }
20195    }
20196    }
20197    function_tests++;
20198#endif
20199
20200    return(test_ret);
20201}
20202
20203
20204static int
20205test_xmlFirstElementChild(void) {
20206    int test_ret = 0;
20207
20208#if defined(LIBXML_TREE_ENABLED)
20209    int mem_base;
20210    xmlNodePtr ret_val;
20211    xmlNodePtr parent; /* the parent node */
20212    int n_parent;
20213
20214    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20215        mem_base = xmlMemBlocks();
20216        parent = gen_xmlNodePtr(n_parent, 0);
20217
20218        ret_val = xmlFirstElementChild(parent);
20219        desret_xmlNodePtr(ret_val);
20220        call_tests++;
20221        des_xmlNodePtr(n_parent, parent, 0);
20222        xmlResetLastError();
20223        if (mem_base != xmlMemBlocks()) {
20224            printf("Leak of %d blocks found in xmlFirstElementChild",
20225	           xmlMemBlocks() - mem_base);
20226	    test_ret++;
20227            printf(" %d", n_parent);
20228            printf("\n");
20229        }
20230    }
20231    function_tests++;
20232#endif
20233
20234    return(test_ret);
20235}
20236
20237
20238static int
20239test_xmlGetBufferAllocationScheme(void) {
20240    int test_ret = 0;
20241
20242    int mem_base;
20243    xmlBufferAllocationScheme ret_val;
20244
20245        mem_base = xmlMemBlocks();
20246
20247        ret_val = xmlGetBufferAllocationScheme();
20248        desret_xmlBufferAllocationScheme(ret_val);
20249        call_tests++;
20250        xmlResetLastError();
20251        if (mem_base != xmlMemBlocks()) {
20252            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20253	           xmlMemBlocks() - mem_base);
20254	    test_ret++;
20255            printf("\n");
20256        }
20257    function_tests++;
20258
20259    return(test_ret);
20260}
20261
20262
20263static int
20264test_xmlGetCompressMode(void) {
20265    int test_ret = 0;
20266
20267    int mem_base;
20268    int ret_val;
20269
20270        mem_base = xmlMemBlocks();
20271
20272        ret_val = xmlGetCompressMode();
20273        desret_int(ret_val);
20274        call_tests++;
20275        xmlResetLastError();
20276        if (mem_base != xmlMemBlocks()) {
20277            printf("Leak of %d blocks found in xmlGetCompressMode",
20278	           xmlMemBlocks() - mem_base);
20279	    test_ret++;
20280            printf("\n");
20281        }
20282    function_tests++;
20283
20284    return(test_ret);
20285}
20286
20287
20288static int
20289test_xmlGetDocCompressMode(void) {
20290    int test_ret = 0;
20291
20292    int mem_base;
20293    int ret_val;
20294    xmlDocPtr doc; /* the document */
20295    int n_doc;
20296
20297    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20298        mem_base = xmlMemBlocks();
20299        doc = gen_xmlDocPtr(n_doc, 0);
20300
20301        ret_val = xmlGetDocCompressMode(doc);
20302        desret_int(ret_val);
20303        call_tests++;
20304        des_xmlDocPtr(n_doc, doc, 0);
20305        xmlResetLastError();
20306        if (mem_base != xmlMemBlocks()) {
20307            printf("Leak of %d blocks found in xmlGetDocCompressMode",
20308	           xmlMemBlocks() - mem_base);
20309	    test_ret++;
20310            printf(" %d", n_doc);
20311            printf("\n");
20312        }
20313    }
20314    function_tests++;
20315
20316    return(test_ret);
20317}
20318
20319
20320static int
20321test_xmlGetIntSubset(void) {
20322    int test_ret = 0;
20323
20324    int mem_base;
20325    xmlDtdPtr ret_val;
20326    xmlDocPtr doc; /* the document pointer */
20327    int n_doc;
20328
20329    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20330        mem_base = xmlMemBlocks();
20331        doc = gen_xmlDocPtr(n_doc, 0);
20332
20333        ret_val = xmlGetIntSubset(doc);
20334        desret_xmlDtdPtr(ret_val);
20335        call_tests++;
20336        des_xmlDocPtr(n_doc, doc, 0);
20337        xmlResetLastError();
20338        if (mem_base != xmlMemBlocks()) {
20339            printf("Leak of %d blocks found in xmlGetIntSubset",
20340	           xmlMemBlocks() - mem_base);
20341	    test_ret++;
20342            printf(" %d", n_doc);
20343            printf("\n");
20344        }
20345    }
20346    function_tests++;
20347
20348    return(test_ret);
20349}
20350
20351
20352static int
20353test_xmlGetLastChild(void) {
20354    int test_ret = 0;
20355
20356    int mem_base;
20357    xmlNodePtr ret_val;
20358    xmlNodePtr parent; /* the parent node */
20359    int n_parent;
20360
20361    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20362        mem_base = xmlMemBlocks();
20363        parent = gen_xmlNodePtr(n_parent, 0);
20364
20365        ret_val = xmlGetLastChild(parent);
20366        desret_xmlNodePtr(ret_val);
20367        call_tests++;
20368        des_xmlNodePtr(n_parent, parent, 0);
20369        xmlResetLastError();
20370        if (mem_base != xmlMemBlocks()) {
20371            printf("Leak of %d blocks found in xmlGetLastChild",
20372	           xmlMemBlocks() - mem_base);
20373	    test_ret++;
20374            printf(" %d", n_parent);
20375            printf("\n");
20376        }
20377    }
20378    function_tests++;
20379
20380    return(test_ret);
20381}
20382
20383
20384static int
20385test_xmlGetLineNo(void) {
20386    int test_ret = 0;
20387
20388    int mem_base;
20389    long ret_val;
20390    xmlNodePtr node; /* valid node */
20391    int n_node;
20392
20393    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20394        mem_base = xmlMemBlocks();
20395        node = gen_xmlNodePtr(n_node, 0);
20396
20397        ret_val = xmlGetLineNo(node);
20398        desret_long(ret_val);
20399        call_tests++;
20400        des_xmlNodePtr(n_node, node, 0);
20401        xmlResetLastError();
20402        if (mem_base != xmlMemBlocks()) {
20403            printf("Leak of %d blocks found in xmlGetLineNo",
20404	           xmlMemBlocks() - mem_base);
20405	    test_ret++;
20406            printf(" %d", n_node);
20407            printf("\n");
20408        }
20409    }
20410    function_tests++;
20411
20412    return(test_ret);
20413}
20414
20415
20416static int
20417test_xmlGetNoNsProp(void) {
20418    int test_ret = 0;
20419
20420    int mem_base;
20421    xmlChar * ret_val;
20422    xmlNodePtr node; /* the node */
20423    int n_node;
20424    xmlChar * name; /* the attribute name */
20425    int n_name;
20426
20427    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20428    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20429        mem_base = xmlMemBlocks();
20430        node = gen_xmlNodePtr(n_node, 0);
20431        name = gen_const_xmlChar_ptr(n_name, 1);
20432
20433        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20434        desret_xmlChar_ptr(ret_val);
20435        call_tests++;
20436        des_xmlNodePtr(n_node, node, 0);
20437        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20438        xmlResetLastError();
20439        if (mem_base != xmlMemBlocks()) {
20440            printf("Leak of %d blocks found in xmlGetNoNsProp",
20441	           xmlMemBlocks() - mem_base);
20442	    test_ret++;
20443            printf(" %d", n_node);
20444            printf(" %d", n_name);
20445            printf("\n");
20446        }
20447    }
20448    }
20449    function_tests++;
20450
20451    return(test_ret);
20452}
20453
20454
20455static int
20456test_xmlGetNodePath(void) {
20457    int test_ret = 0;
20458
20459#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20460    int mem_base;
20461    xmlChar * ret_val;
20462    xmlNodePtr node; /* a node */
20463    int n_node;
20464
20465    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20466        mem_base = xmlMemBlocks();
20467        node = gen_xmlNodePtr(n_node, 0);
20468
20469        ret_val = xmlGetNodePath(node);
20470        desret_xmlChar_ptr(ret_val);
20471        call_tests++;
20472        des_xmlNodePtr(n_node, node, 0);
20473        xmlResetLastError();
20474        if (mem_base != xmlMemBlocks()) {
20475            printf("Leak of %d blocks found in xmlGetNodePath",
20476	           xmlMemBlocks() - mem_base);
20477	    test_ret++;
20478            printf(" %d", n_node);
20479            printf("\n");
20480        }
20481    }
20482    function_tests++;
20483#endif
20484
20485    return(test_ret);
20486}
20487
20488
20489static int
20490test_xmlGetNsList(void) {
20491    int test_ret = 0;
20492
20493
20494    /* missing type support */
20495    return(test_ret);
20496}
20497
20498
20499static int
20500test_xmlGetNsProp(void) {
20501    int test_ret = 0;
20502
20503    int mem_base;
20504    xmlChar * ret_val;
20505    xmlNodePtr node; /* the node */
20506    int n_node;
20507    xmlChar * name; /* the attribute name */
20508    int n_name;
20509    xmlChar * nameSpace; /* the URI of the namespace */
20510    int n_nameSpace;
20511
20512    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20513    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20514    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20515        mem_base = xmlMemBlocks();
20516        node = gen_xmlNodePtr(n_node, 0);
20517        name = gen_const_xmlChar_ptr(n_name, 1);
20518        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20519
20520        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20521        desret_xmlChar_ptr(ret_val);
20522        call_tests++;
20523        des_xmlNodePtr(n_node, node, 0);
20524        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20525        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20526        xmlResetLastError();
20527        if (mem_base != xmlMemBlocks()) {
20528            printf("Leak of %d blocks found in xmlGetNsProp",
20529	           xmlMemBlocks() - mem_base);
20530	    test_ret++;
20531            printf(" %d", n_node);
20532            printf(" %d", n_name);
20533            printf(" %d", n_nameSpace);
20534            printf("\n");
20535        }
20536    }
20537    }
20538    }
20539    function_tests++;
20540
20541    return(test_ret);
20542}
20543
20544
20545static int
20546test_xmlGetProp(void) {
20547    int test_ret = 0;
20548
20549    int mem_base;
20550    xmlChar * ret_val;
20551    xmlNodePtr node; /* the node */
20552    int n_node;
20553    xmlChar * name; /* the attribute name */
20554    int n_name;
20555
20556    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20557    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20558        mem_base = xmlMemBlocks();
20559        node = gen_xmlNodePtr(n_node, 0);
20560        name = gen_const_xmlChar_ptr(n_name, 1);
20561
20562        ret_val = xmlGetProp(node, (const xmlChar *)name);
20563        desret_xmlChar_ptr(ret_val);
20564        call_tests++;
20565        des_xmlNodePtr(n_node, node, 0);
20566        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20567        xmlResetLastError();
20568        if (mem_base != xmlMemBlocks()) {
20569            printf("Leak of %d blocks found in xmlGetProp",
20570	           xmlMemBlocks() - mem_base);
20571	    test_ret++;
20572            printf(" %d", n_node);
20573            printf(" %d", n_name);
20574            printf("\n");
20575        }
20576    }
20577    }
20578    function_tests++;
20579
20580    return(test_ret);
20581}
20582
20583
20584static int
20585test_xmlHasNsProp(void) {
20586    int test_ret = 0;
20587
20588    int mem_base;
20589    xmlAttrPtr ret_val;
20590    xmlNodePtr node; /* the node */
20591    int n_node;
20592    xmlChar * name; /* the attribute name */
20593    int n_name;
20594    xmlChar * nameSpace; /* the URI of the namespace */
20595    int n_nameSpace;
20596
20597    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20598    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20599    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20600        mem_base = xmlMemBlocks();
20601        node = gen_xmlNodePtr(n_node, 0);
20602        name = gen_const_xmlChar_ptr(n_name, 1);
20603        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20604
20605        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20606        desret_xmlAttrPtr(ret_val);
20607        call_tests++;
20608        des_xmlNodePtr(n_node, node, 0);
20609        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20610        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20611        xmlResetLastError();
20612        if (mem_base != xmlMemBlocks()) {
20613            printf("Leak of %d blocks found in xmlHasNsProp",
20614	           xmlMemBlocks() - mem_base);
20615	    test_ret++;
20616            printf(" %d", n_node);
20617            printf(" %d", n_name);
20618            printf(" %d", n_nameSpace);
20619            printf("\n");
20620        }
20621    }
20622    }
20623    }
20624    function_tests++;
20625
20626    return(test_ret);
20627}
20628
20629
20630static int
20631test_xmlHasProp(void) {
20632    int test_ret = 0;
20633
20634    int mem_base;
20635    xmlAttrPtr ret_val;
20636    xmlNodePtr node; /* the node */
20637    int n_node;
20638    xmlChar * name; /* the attribute name */
20639    int n_name;
20640
20641    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20642    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20643        mem_base = xmlMemBlocks();
20644        node = gen_xmlNodePtr(n_node, 0);
20645        name = gen_const_xmlChar_ptr(n_name, 1);
20646
20647        ret_val = xmlHasProp(node, (const xmlChar *)name);
20648        desret_xmlAttrPtr(ret_val);
20649        call_tests++;
20650        des_xmlNodePtr(n_node, node, 0);
20651        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20652        xmlResetLastError();
20653        if (mem_base != xmlMemBlocks()) {
20654            printf("Leak of %d blocks found in xmlHasProp",
20655	           xmlMemBlocks() - mem_base);
20656	    test_ret++;
20657            printf(" %d", n_node);
20658            printf(" %d", n_name);
20659            printf("\n");
20660        }
20661    }
20662    }
20663    function_tests++;
20664
20665    return(test_ret);
20666}
20667
20668
20669static int
20670test_xmlIsBlankNode(void) {
20671    int test_ret = 0;
20672
20673    int mem_base;
20674    int ret_val;
20675    xmlNodePtr node; /* the node */
20676    int n_node;
20677
20678    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20679        mem_base = xmlMemBlocks();
20680        node = gen_xmlNodePtr(n_node, 0);
20681
20682        ret_val = xmlIsBlankNode(node);
20683        desret_int(ret_val);
20684        call_tests++;
20685        des_xmlNodePtr(n_node, node, 0);
20686        xmlResetLastError();
20687        if (mem_base != xmlMemBlocks()) {
20688            printf("Leak of %d blocks found in xmlIsBlankNode",
20689	           xmlMemBlocks() - mem_base);
20690	    test_ret++;
20691            printf(" %d", n_node);
20692            printf("\n");
20693        }
20694    }
20695    function_tests++;
20696
20697    return(test_ret);
20698}
20699
20700
20701static int
20702test_xmlIsXHTML(void) {
20703    int test_ret = 0;
20704
20705    int mem_base;
20706    int ret_val;
20707    xmlChar * systemID; /* the system identifier */
20708    int n_systemID;
20709    xmlChar * publicID; /* the public identifier */
20710    int n_publicID;
20711
20712    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20713    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20714        mem_base = xmlMemBlocks();
20715        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20716        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20717
20718        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20719        desret_int(ret_val);
20720        call_tests++;
20721        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20722        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20723        xmlResetLastError();
20724        if (mem_base != xmlMemBlocks()) {
20725            printf("Leak of %d blocks found in xmlIsXHTML",
20726	           xmlMemBlocks() - mem_base);
20727	    test_ret++;
20728            printf(" %d", n_systemID);
20729            printf(" %d", n_publicID);
20730            printf("\n");
20731        }
20732    }
20733    }
20734    function_tests++;
20735
20736    return(test_ret);
20737}
20738
20739
20740static int
20741test_xmlLastElementChild(void) {
20742    int test_ret = 0;
20743
20744#if defined(LIBXML_TREE_ENABLED)
20745    int mem_base;
20746    xmlNodePtr ret_val;
20747    xmlNodePtr parent; /* the parent node */
20748    int n_parent;
20749
20750    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20751        mem_base = xmlMemBlocks();
20752        parent = gen_xmlNodePtr(n_parent, 0);
20753
20754        ret_val = xmlLastElementChild(parent);
20755        desret_xmlNodePtr(ret_val);
20756        call_tests++;
20757        des_xmlNodePtr(n_parent, parent, 0);
20758        xmlResetLastError();
20759        if (mem_base != xmlMemBlocks()) {
20760            printf("Leak of %d blocks found in xmlLastElementChild",
20761	           xmlMemBlocks() - mem_base);
20762	    test_ret++;
20763            printf(" %d", n_parent);
20764            printf("\n");
20765        }
20766    }
20767    function_tests++;
20768#endif
20769
20770    return(test_ret);
20771}
20772
20773
20774static int
20775test_xmlNewCDataBlock(void) {
20776    int test_ret = 0;
20777
20778    int mem_base;
20779    xmlNodePtr ret_val;
20780    xmlDocPtr doc; /* the document */
20781    int n_doc;
20782    xmlChar * content; /* the CDATA block content content */
20783    int n_content;
20784    int len; /* the length of the block */
20785    int n_len;
20786
20787    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20788    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20789    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20790        mem_base = xmlMemBlocks();
20791        doc = gen_xmlDocPtr(n_doc, 0);
20792        content = gen_const_xmlChar_ptr(n_content, 1);
20793        len = gen_int(n_len, 2);
20794
20795        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20796        desret_xmlNodePtr(ret_val);
20797        call_tests++;
20798        des_xmlDocPtr(n_doc, doc, 0);
20799        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20800        des_int(n_len, len, 2);
20801        xmlResetLastError();
20802        if (mem_base != xmlMemBlocks()) {
20803            printf("Leak of %d blocks found in xmlNewCDataBlock",
20804	           xmlMemBlocks() - mem_base);
20805	    test_ret++;
20806            printf(" %d", n_doc);
20807            printf(" %d", n_content);
20808            printf(" %d", n_len);
20809            printf("\n");
20810        }
20811    }
20812    }
20813    }
20814    function_tests++;
20815
20816    return(test_ret);
20817}
20818
20819
20820static int
20821test_xmlNewCharRef(void) {
20822    int test_ret = 0;
20823
20824    int mem_base;
20825    xmlNodePtr ret_val;
20826    xmlDocPtr doc; /* the document */
20827    int n_doc;
20828    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20829    int n_name;
20830
20831    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20832    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20833        mem_base = xmlMemBlocks();
20834        doc = gen_xmlDocPtr(n_doc, 0);
20835        name = gen_const_xmlChar_ptr(n_name, 1);
20836
20837        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20838        desret_xmlNodePtr(ret_val);
20839        call_tests++;
20840        des_xmlDocPtr(n_doc, doc, 0);
20841        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20842        xmlResetLastError();
20843        if (mem_base != xmlMemBlocks()) {
20844            printf("Leak of %d blocks found in xmlNewCharRef",
20845	           xmlMemBlocks() - mem_base);
20846	    test_ret++;
20847            printf(" %d", n_doc);
20848            printf(" %d", n_name);
20849            printf("\n");
20850        }
20851    }
20852    }
20853    function_tests++;
20854
20855    return(test_ret);
20856}
20857
20858
20859static int
20860test_xmlNewChild(void) {
20861    int test_ret = 0;
20862
20863#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20864#ifdef LIBXML_TREE_ENABLED
20865    int mem_base;
20866    xmlNodePtr ret_val;
20867    xmlNodePtr parent; /* the parent node */
20868    int n_parent;
20869    xmlNsPtr ns; /* a namespace if any */
20870    int n_ns;
20871    xmlChar * name; /* the name of the child */
20872    int n_name;
20873    xmlChar * content; /* the XML content of the child if any. */
20874    int n_content;
20875
20876    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20877    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20878    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20879    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20880        mem_base = xmlMemBlocks();
20881        parent = gen_xmlNodePtr(n_parent, 0);
20882        ns = gen_xmlNsPtr(n_ns, 1);
20883        name = gen_const_xmlChar_ptr(n_name, 2);
20884        content = gen_const_xmlChar_ptr(n_content, 3);
20885
20886        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20887        desret_xmlNodePtr(ret_val);
20888        call_tests++;
20889        des_xmlNodePtr(n_parent, parent, 0);
20890        des_xmlNsPtr(n_ns, ns, 1);
20891        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20892        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20893        xmlResetLastError();
20894        if (mem_base != xmlMemBlocks()) {
20895            printf("Leak of %d blocks found in xmlNewChild",
20896	           xmlMemBlocks() - mem_base);
20897	    test_ret++;
20898            printf(" %d", n_parent);
20899            printf(" %d", n_ns);
20900            printf(" %d", n_name);
20901            printf(" %d", n_content);
20902            printf("\n");
20903        }
20904    }
20905    }
20906    }
20907    }
20908    function_tests++;
20909#endif
20910#endif
20911
20912    return(test_ret);
20913}
20914
20915
20916static int
20917test_xmlNewComment(void) {
20918    int test_ret = 0;
20919
20920    int mem_base;
20921    xmlNodePtr ret_val;
20922    xmlChar * content; /* the comment content */
20923    int n_content;
20924
20925    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20926        mem_base = xmlMemBlocks();
20927        content = gen_const_xmlChar_ptr(n_content, 0);
20928
20929        ret_val = xmlNewComment((const xmlChar *)content);
20930        desret_xmlNodePtr(ret_val);
20931        call_tests++;
20932        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20933        xmlResetLastError();
20934        if (mem_base != xmlMemBlocks()) {
20935            printf("Leak of %d blocks found in xmlNewComment",
20936	           xmlMemBlocks() - mem_base);
20937	    test_ret++;
20938            printf(" %d", n_content);
20939            printf("\n");
20940        }
20941    }
20942    function_tests++;
20943
20944    return(test_ret);
20945}
20946
20947
20948static int
20949test_xmlNewDoc(void) {
20950    int test_ret = 0;
20951
20952    int mem_base;
20953    xmlDocPtr ret_val;
20954    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20955    int n_version;
20956
20957    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20958        mem_base = xmlMemBlocks();
20959        version = gen_const_xmlChar_ptr(n_version, 0);
20960
20961        ret_val = xmlNewDoc((const xmlChar *)version);
20962        desret_xmlDocPtr(ret_val);
20963        call_tests++;
20964        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20965        xmlResetLastError();
20966        if (mem_base != xmlMemBlocks()) {
20967            printf("Leak of %d blocks found in xmlNewDoc",
20968	           xmlMemBlocks() - mem_base);
20969	    test_ret++;
20970            printf(" %d", n_version);
20971            printf("\n");
20972        }
20973    }
20974    function_tests++;
20975
20976    return(test_ret);
20977}
20978
20979
20980static int
20981test_xmlNewDocComment(void) {
20982    int test_ret = 0;
20983
20984    int mem_base;
20985    xmlNodePtr ret_val;
20986    xmlDocPtr doc; /* the document */
20987    int n_doc;
20988    xmlChar * content; /* the comment content */
20989    int n_content;
20990
20991    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20992    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20993        mem_base = xmlMemBlocks();
20994        doc = gen_xmlDocPtr(n_doc, 0);
20995        content = gen_const_xmlChar_ptr(n_content, 1);
20996
20997        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20998        desret_xmlNodePtr(ret_val);
20999        call_tests++;
21000        des_xmlDocPtr(n_doc, doc, 0);
21001        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21002        xmlResetLastError();
21003        if (mem_base != xmlMemBlocks()) {
21004            printf("Leak of %d blocks found in xmlNewDocComment",
21005	           xmlMemBlocks() - mem_base);
21006	    test_ret++;
21007            printf(" %d", n_doc);
21008            printf(" %d", n_content);
21009            printf("\n");
21010        }
21011    }
21012    }
21013    function_tests++;
21014
21015    return(test_ret);
21016}
21017
21018
21019static int
21020test_xmlNewDocFragment(void) {
21021    int test_ret = 0;
21022
21023#if defined(LIBXML_TREE_ENABLED)
21024    int mem_base;
21025    xmlNodePtr ret_val;
21026    xmlDocPtr doc; /* the document owning the fragment */
21027    int n_doc;
21028
21029    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21030        mem_base = xmlMemBlocks();
21031        doc = gen_xmlDocPtr(n_doc, 0);
21032
21033        ret_val = xmlNewDocFragment(doc);
21034        desret_xmlNodePtr(ret_val);
21035        call_tests++;
21036        des_xmlDocPtr(n_doc, doc, 0);
21037        xmlResetLastError();
21038        if (mem_base != xmlMemBlocks()) {
21039            printf("Leak of %d blocks found in xmlNewDocFragment",
21040	           xmlMemBlocks() - mem_base);
21041	    test_ret++;
21042            printf(" %d", n_doc);
21043            printf("\n");
21044        }
21045    }
21046    function_tests++;
21047#endif
21048
21049    return(test_ret);
21050}
21051
21052
21053static int
21054test_xmlNewDocNode(void) {
21055    int test_ret = 0;
21056
21057    int mem_base;
21058    xmlNodePtr ret_val;
21059    xmlDocPtr doc; /* the document */
21060    int n_doc;
21061    xmlNsPtr ns; /* namespace if any */
21062    int n_ns;
21063    xmlChar * name; /* the node name */
21064    int n_name;
21065    xmlChar * content; /* the XML text content if any */
21066    int n_content;
21067
21068    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21069    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21070    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21071    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21072        mem_base = xmlMemBlocks();
21073        doc = gen_xmlDocPtr(n_doc, 0);
21074        ns = gen_xmlNsPtr(n_ns, 1);
21075        name = gen_const_xmlChar_ptr(n_name, 2);
21076        content = gen_const_xmlChar_ptr(n_content, 3);
21077
21078        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21079        desret_xmlNodePtr(ret_val);
21080        call_tests++;
21081        des_xmlDocPtr(n_doc, doc, 0);
21082        des_xmlNsPtr(n_ns, ns, 1);
21083        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21084        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21085        xmlResetLastError();
21086        if (mem_base != xmlMemBlocks()) {
21087            printf("Leak of %d blocks found in xmlNewDocNode",
21088	           xmlMemBlocks() - mem_base);
21089	    test_ret++;
21090            printf(" %d", n_doc);
21091            printf(" %d", n_ns);
21092            printf(" %d", n_name);
21093            printf(" %d", n_content);
21094            printf("\n");
21095        }
21096    }
21097    }
21098    }
21099    }
21100    function_tests++;
21101
21102    return(test_ret);
21103}
21104
21105
21106static int
21107test_xmlNewDocNodeEatName(void) {
21108    int test_ret = 0;
21109
21110    int mem_base;
21111    xmlNodePtr ret_val;
21112    xmlDocPtr doc; /* the document */
21113    int n_doc;
21114    xmlNsPtr ns; /* namespace if any */
21115    int n_ns;
21116    xmlChar * name; /* the node name */
21117    int n_name;
21118    xmlChar * content; /* the XML text content if any */
21119    int n_content;
21120
21121    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21122    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21123    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21124    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21125        mem_base = xmlMemBlocks();
21126        doc = gen_xmlDocPtr(n_doc, 0);
21127        ns = gen_xmlNsPtr(n_ns, 1);
21128        name = gen_eaten_name(n_name, 2);
21129        content = gen_const_xmlChar_ptr(n_content, 3);
21130
21131        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21132        desret_xmlNodePtr(ret_val);
21133        call_tests++;
21134        des_xmlDocPtr(n_doc, doc, 0);
21135        des_xmlNsPtr(n_ns, ns, 1);
21136        des_eaten_name(n_name, name, 2);
21137        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21138        xmlResetLastError();
21139        if (mem_base != xmlMemBlocks()) {
21140            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21141	           xmlMemBlocks() - mem_base);
21142	    test_ret++;
21143            printf(" %d", n_doc);
21144            printf(" %d", n_ns);
21145            printf(" %d", n_name);
21146            printf(" %d", n_content);
21147            printf("\n");
21148        }
21149    }
21150    }
21151    }
21152    }
21153    function_tests++;
21154
21155    return(test_ret);
21156}
21157
21158
21159static int
21160test_xmlNewDocPI(void) {
21161    int test_ret = 0;
21162
21163    int mem_base;
21164    xmlNodePtr ret_val;
21165    xmlDocPtr doc; /* the target document */
21166    int n_doc;
21167    xmlChar * name; /* the processing instruction name */
21168    int n_name;
21169    xmlChar * content; /* the PI content */
21170    int n_content;
21171
21172    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21173    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21174    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21175        mem_base = xmlMemBlocks();
21176        doc = gen_xmlDocPtr(n_doc, 0);
21177        name = gen_const_xmlChar_ptr(n_name, 1);
21178        content = gen_const_xmlChar_ptr(n_content, 2);
21179
21180        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21181        desret_xmlNodePtr(ret_val);
21182        call_tests++;
21183        des_xmlDocPtr(n_doc, doc, 0);
21184        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21185        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21186        xmlResetLastError();
21187        if (mem_base != xmlMemBlocks()) {
21188            printf("Leak of %d blocks found in xmlNewDocPI",
21189	           xmlMemBlocks() - mem_base);
21190	    test_ret++;
21191            printf(" %d", n_doc);
21192            printf(" %d", n_name);
21193            printf(" %d", n_content);
21194            printf("\n");
21195        }
21196    }
21197    }
21198    }
21199    function_tests++;
21200
21201    return(test_ret);
21202}
21203
21204
21205static int
21206test_xmlNewDocProp(void) {
21207    int test_ret = 0;
21208
21209    int mem_base;
21210    xmlAttrPtr ret_val;
21211    xmlDocPtr doc; /* the document */
21212    int n_doc;
21213    xmlChar * name; /* the name of the attribute */
21214    int n_name;
21215    xmlChar * value; /* the value of the attribute */
21216    int n_value;
21217
21218    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21219    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21220    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21221        mem_base = xmlMemBlocks();
21222        doc = gen_xmlDocPtr(n_doc, 0);
21223        name = gen_const_xmlChar_ptr(n_name, 1);
21224        value = gen_const_xmlChar_ptr(n_value, 2);
21225
21226        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21227        desret_xmlAttrPtr(ret_val);
21228        call_tests++;
21229        des_xmlDocPtr(n_doc, doc, 0);
21230        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21231        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21232        xmlResetLastError();
21233        if (mem_base != xmlMemBlocks()) {
21234            printf("Leak of %d blocks found in xmlNewDocProp",
21235	           xmlMemBlocks() - mem_base);
21236	    test_ret++;
21237            printf(" %d", n_doc);
21238            printf(" %d", n_name);
21239            printf(" %d", n_value);
21240            printf("\n");
21241        }
21242    }
21243    }
21244    }
21245    function_tests++;
21246
21247    return(test_ret);
21248}
21249
21250
21251static int
21252test_xmlNewDocRawNode(void) {
21253    int test_ret = 0;
21254
21255#if defined(LIBXML_TREE_ENABLED)
21256#ifdef LIBXML_TREE_ENABLED
21257    int mem_base;
21258    xmlNodePtr ret_val;
21259    xmlDocPtr doc; /* the document */
21260    int n_doc;
21261    xmlNsPtr ns; /* namespace if any */
21262    int n_ns;
21263    xmlChar * name; /* the node name */
21264    int n_name;
21265    xmlChar * content; /* the text content if any */
21266    int n_content;
21267
21268    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21269    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21270    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21271    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21272        mem_base = xmlMemBlocks();
21273        doc = gen_xmlDocPtr(n_doc, 0);
21274        ns = gen_xmlNsPtr(n_ns, 1);
21275        name = gen_const_xmlChar_ptr(n_name, 2);
21276        content = gen_const_xmlChar_ptr(n_content, 3);
21277
21278        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21279        desret_xmlNodePtr(ret_val);
21280        call_tests++;
21281        des_xmlDocPtr(n_doc, doc, 0);
21282        des_xmlNsPtr(n_ns, ns, 1);
21283        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21284        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21285        xmlResetLastError();
21286        if (mem_base != xmlMemBlocks()) {
21287            printf("Leak of %d blocks found in xmlNewDocRawNode",
21288	           xmlMemBlocks() - mem_base);
21289	    test_ret++;
21290            printf(" %d", n_doc);
21291            printf(" %d", n_ns);
21292            printf(" %d", n_name);
21293            printf(" %d", n_content);
21294            printf("\n");
21295        }
21296    }
21297    }
21298    }
21299    }
21300    function_tests++;
21301#endif
21302#endif
21303
21304    return(test_ret);
21305}
21306
21307
21308static int
21309test_xmlNewDocText(void) {
21310    int test_ret = 0;
21311
21312    int mem_base;
21313    xmlNodePtr ret_val;
21314    xmlDocPtr doc; /* the document */
21315    int n_doc;
21316    xmlChar * content; /* the text content */
21317    int n_content;
21318
21319    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21320    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21321        mem_base = xmlMemBlocks();
21322        doc = gen_xmlDocPtr(n_doc, 0);
21323        content = gen_const_xmlChar_ptr(n_content, 1);
21324
21325        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21326        desret_xmlNodePtr(ret_val);
21327        call_tests++;
21328        des_xmlDocPtr(n_doc, doc, 0);
21329        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21330        xmlResetLastError();
21331        if (mem_base != xmlMemBlocks()) {
21332            printf("Leak of %d blocks found in xmlNewDocText",
21333	           xmlMemBlocks() - mem_base);
21334	    test_ret++;
21335            printf(" %d", n_doc);
21336            printf(" %d", n_content);
21337            printf("\n");
21338        }
21339    }
21340    }
21341    function_tests++;
21342
21343    return(test_ret);
21344}
21345
21346
21347static int
21348test_xmlNewDocTextLen(void) {
21349    int test_ret = 0;
21350
21351    int mem_base;
21352    xmlNodePtr ret_val;
21353    xmlDocPtr doc; /* the document */
21354    int n_doc;
21355    xmlChar * content; /* the text content */
21356    int n_content;
21357    int len; /* the text len. */
21358    int n_len;
21359
21360    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21361    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21362    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21363        mem_base = xmlMemBlocks();
21364        doc = gen_xmlDocPtr(n_doc, 0);
21365        content = gen_const_xmlChar_ptr(n_content, 1);
21366        len = gen_int(n_len, 2);
21367
21368        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21369        desret_xmlNodePtr(ret_val);
21370        call_tests++;
21371        des_xmlDocPtr(n_doc, doc, 0);
21372        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21373        des_int(n_len, len, 2);
21374        xmlResetLastError();
21375        if (mem_base != xmlMemBlocks()) {
21376            printf("Leak of %d blocks found in xmlNewDocTextLen",
21377	           xmlMemBlocks() - mem_base);
21378	    test_ret++;
21379            printf(" %d", n_doc);
21380            printf(" %d", n_content);
21381            printf(" %d", n_len);
21382            printf("\n");
21383        }
21384    }
21385    }
21386    }
21387    function_tests++;
21388
21389    return(test_ret);
21390}
21391
21392
21393static int
21394test_xmlNewDtd(void) {
21395    int test_ret = 0;
21396
21397    int mem_base;
21398    xmlDtdPtr ret_val;
21399    xmlDocPtr doc; /* the document pointer */
21400    int n_doc;
21401    xmlChar * name; /* the DTD name */
21402    int n_name;
21403    xmlChar * ExternalID; /* the external ID */
21404    int n_ExternalID;
21405    xmlChar * SystemID; /* the system ID */
21406    int n_SystemID;
21407
21408    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21409    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21410    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21411    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21412        mem_base = xmlMemBlocks();
21413        doc = gen_xmlDocPtr(n_doc, 0);
21414        name = gen_const_xmlChar_ptr(n_name, 1);
21415        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21416        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21417
21418        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21419        desret_xmlDtdPtr(ret_val);
21420        call_tests++;
21421        des_xmlDocPtr(n_doc, doc, 0);
21422        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21423        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21424        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21425        xmlResetLastError();
21426        if (mem_base != xmlMemBlocks()) {
21427            printf("Leak of %d blocks found in xmlNewDtd",
21428	           xmlMemBlocks() - mem_base);
21429	    test_ret++;
21430            printf(" %d", n_doc);
21431            printf(" %d", n_name);
21432            printf(" %d", n_ExternalID);
21433            printf(" %d", n_SystemID);
21434            printf("\n");
21435        }
21436    }
21437    }
21438    }
21439    }
21440    function_tests++;
21441
21442    return(test_ret);
21443}
21444
21445
21446static int
21447test_xmlNewNode(void) {
21448    int test_ret = 0;
21449
21450    int mem_base;
21451    xmlNodePtr ret_val;
21452    xmlNsPtr ns; /* namespace if any */
21453    int n_ns;
21454    xmlChar * name; /* the node name */
21455    int n_name;
21456
21457    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21458    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21459        mem_base = xmlMemBlocks();
21460        ns = gen_xmlNsPtr(n_ns, 0);
21461        name = gen_const_xmlChar_ptr(n_name, 1);
21462
21463        ret_val = xmlNewNode(ns, (const xmlChar *)name);
21464        desret_xmlNodePtr(ret_val);
21465        call_tests++;
21466        des_xmlNsPtr(n_ns, ns, 0);
21467        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21468        xmlResetLastError();
21469        if (mem_base != xmlMemBlocks()) {
21470            printf("Leak of %d blocks found in xmlNewNode",
21471	           xmlMemBlocks() - mem_base);
21472	    test_ret++;
21473            printf(" %d", n_ns);
21474            printf(" %d", n_name);
21475            printf("\n");
21476        }
21477    }
21478    }
21479    function_tests++;
21480
21481    return(test_ret);
21482}
21483
21484
21485static int
21486test_xmlNewNodeEatName(void) {
21487    int test_ret = 0;
21488
21489    int mem_base;
21490    xmlNodePtr ret_val;
21491    xmlNsPtr ns; /* namespace if any */
21492    int n_ns;
21493    xmlChar * name; /* the node name */
21494    int n_name;
21495
21496    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21497    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21498        mem_base = xmlMemBlocks();
21499        ns = gen_xmlNsPtr(n_ns, 0);
21500        name = gen_eaten_name(n_name, 1);
21501
21502        ret_val = xmlNewNodeEatName(ns, name);
21503        desret_xmlNodePtr(ret_val);
21504        call_tests++;
21505        des_xmlNsPtr(n_ns, ns, 0);
21506        des_eaten_name(n_name, name, 1);
21507        xmlResetLastError();
21508        if (mem_base != xmlMemBlocks()) {
21509            printf("Leak of %d blocks found in xmlNewNodeEatName",
21510	           xmlMemBlocks() - mem_base);
21511	    test_ret++;
21512            printf(" %d", n_ns);
21513            printf(" %d", n_name);
21514            printf("\n");
21515        }
21516    }
21517    }
21518    function_tests++;
21519
21520    return(test_ret);
21521}
21522
21523
21524static int
21525test_xmlNewNs(void) {
21526    int test_ret = 0;
21527
21528    int mem_base;
21529    xmlNsPtr ret_val;
21530    xmlNodePtr node; /* the element carrying the namespace */
21531    int n_node;
21532    xmlChar * href; /* the URI associated */
21533    int n_href;
21534    xmlChar * prefix; /* the prefix for the namespace */
21535    int n_prefix;
21536
21537    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21538    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21539    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21540        mem_base = xmlMemBlocks();
21541        node = gen_xmlNodePtr(n_node, 0);
21542        href = gen_const_xmlChar_ptr(n_href, 1);
21543        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21544
21545        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21546        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21547        desret_xmlNsPtr(ret_val);
21548        call_tests++;
21549        des_xmlNodePtr(n_node, node, 0);
21550        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21551        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21552        xmlResetLastError();
21553        if (mem_base != xmlMemBlocks()) {
21554            printf("Leak of %d blocks found in xmlNewNs",
21555	           xmlMemBlocks() - mem_base);
21556	    test_ret++;
21557            printf(" %d", n_node);
21558            printf(" %d", n_href);
21559            printf(" %d", n_prefix);
21560            printf("\n");
21561        }
21562    }
21563    }
21564    }
21565    function_tests++;
21566
21567    return(test_ret);
21568}
21569
21570
21571static int
21572test_xmlNewNsProp(void) {
21573    int test_ret = 0;
21574
21575    int mem_base;
21576    xmlAttrPtr ret_val;
21577    xmlNodePtr node; /* the holding node */
21578    int n_node;
21579    xmlNsPtr ns; /* the namespace */
21580    int n_ns;
21581    xmlChar * name; /* the name of the attribute */
21582    int n_name;
21583    xmlChar * value; /* the value of the attribute */
21584    int n_value;
21585
21586    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21587    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21588    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21589    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21590        mem_base = xmlMemBlocks();
21591        node = gen_xmlNodePtr(n_node, 0);
21592        ns = gen_xmlNsPtr(n_ns, 1);
21593        name = gen_const_xmlChar_ptr(n_name, 2);
21594        value = gen_const_xmlChar_ptr(n_value, 3);
21595
21596        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21597        desret_xmlAttrPtr(ret_val);
21598        call_tests++;
21599        des_xmlNodePtr(n_node, node, 0);
21600        des_xmlNsPtr(n_ns, ns, 1);
21601        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21602        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21603        xmlResetLastError();
21604        if (mem_base != xmlMemBlocks()) {
21605            printf("Leak of %d blocks found in xmlNewNsProp",
21606	           xmlMemBlocks() - mem_base);
21607	    test_ret++;
21608            printf(" %d", n_node);
21609            printf(" %d", n_ns);
21610            printf(" %d", n_name);
21611            printf(" %d", n_value);
21612            printf("\n");
21613        }
21614    }
21615    }
21616    }
21617    }
21618    function_tests++;
21619
21620    return(test_ret);
21621}
21622
21623
21624static int
21625test_xmlNewNsPropEatName(void) {
21626    int test_ret = 0;
21627
21628    int mem_base;
21629    xmlAttrPtr ret_val;
21630    xmlNodePtr node; /* the holding node */
21631    int n_node;
21632    xmlNsPtr ns; /* the namespace */
21633    int n_ns;
21634    xmlChar * name; /* the name of the attribute */
21635    int n_name;
21636    xmlChar * value; /* the value of the attribute */
21637    int n_value;
21638
21639    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21640    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21641    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21642    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21643        mem_base = xmlMemBlocks();
21644        node = gen_xmlNodePtr(n_node, 0);
21645        ns = gen_xmlNsPtr(n_ns, 1);
21646        name = gen_eaten_name(n_name, 2);
21647        value = gen_const_xmlChar_ptr(n_value, 3);
21648
21649        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21650        desret_xmlAttrPtr(ret_val);
21651        call_tests++;
21652        des_xmlNodePtr(n_node, node, 0);
21653        des_xmlNsPtr(n_ns, ns, 1);
21654        des_eaten_name(n_name, name, 2);
21655        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21656        xmlResetLastError();
21657        if (mem_base != xmlMemBlocks()) {
21658            printf("Leak of %d blocks found in xmlNewNsPropEatName",
21659	           xmlMemBlocks() - mem_base);
21660	    test_ret++;
21661            printf(" %d", n_node);
21662            printf(" %d", n_ns);
21663            printf(" %d", n_name);
21664            printf(" %d", n_value);
21665            printf("\n");
21666        }
21667    }
21668    }
21669    }
21670    }
21671    function_tests++;
21672
21673    return(test_ret);
21674}
21675
21676
21677static int
21678test_xmlNewPI(void) {
21679    int test_ret = 0;
21680
21681    int mem_base;
21682    xmlNodePtr ret_val;
21683    xmlChar * name; /* the processing instruction name */
21684    int n_name;
21685    xmlChar * content; /* the PI content */
21686    int n_content;
21687
21688    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21689    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21690        mem_base = xmlMemBlocks();
21691        name = gen_const_xmlChar_ptr(n_name, 0);
21692        content = gen_const_xmlChar_ptr(n_content, 1);
21693
21694        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21695        desret_xmlNodePtr(ret_val);
21696        call_tests++;
21697        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21698        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21699        xmlResetLastError();
21700        if (mem_base != xmlMemBlocks()) {
21701            printf("Leak of %d blocks found in xmlNewPI",
21702	           xmlMemBlocks() - mem_base);
21703	    test_ret++;
21704            printf(" %d", n_name);
21705            printf(" %d", n_content);
21706            printf("\n");
21707        }
21708    }
21709    }
21710    function_tests++;
21711
21712    return(test_ret);
21713}
21714
21715
21716static int
21717test_xmlNewProp(void) {
21718    int test_ret = 0;
21719
21720#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21721#ifdef LIBXML_TREE_ENABLED
21722    int mem_base;
21723    xmlAttrPtr ret_val;
21724    xmlNodePtr node; /* the holding node */
21725    int n_node;
21726    xmlChar * name; /* the name of the attribute */
21727    int n_name;
21728    xmlChar * value; /* the value of the attribute */
21729    int n_value;
21730
21731    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21732    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21733    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21734        mem_base = xmlMemBlocks();
21735        node = gen_xmlNodePtr(n_node, 0);
21736        name = gen_const_xmlChar_ptr(n_name, 1);
21737        value = gen_const_xmlChar_ptr(n_value, 2);
21738
21739        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21740        desret_xmlAttrPtr(ret_val);
21741        call_tests++;
21742        des_xmlNodePtr(n_node, node, 0);
21743        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21744        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21745        xmlResetLastError();
21746        if (mem_base != xmlMemBlocks()) {
21747            printf("Leak of %d blocks found in xmlNewProp",
21748	           xmlMemBlocks() - mem_base);
21749	    test_ret++;
21750            printf(" %d", n_node);
21751            printf(" %d", n_name);
21752            printf(" %d", n_value);
21753            printf("\n");
21754        }
21755    }
21756    }
21757    }
21758    function_tests++;
21759#endif
21760#endif
21761
21762    return(test_ret);
21763}
21764
21765
21766static int
21767test_xmlNewReference(void) {
21768    int test_ret = 0;
21769
21770    int mem_base;
21771    xmlNodePtr ret_val;
21772    xmlDocPtr doc; /* the document */
21773    int n_doc;
21774    xmlChar * name; /* the reference name, or the reference string with & and ; */
21775    int n_name;
21776
21777    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21778    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21779        mem_base = xmlMemBlocks();
21780        doc = gen_xmlDocPtr(n_doc, 0);
21781        name = gen_const_xmlChar_ptr(n_name, 1);
21782
21783        ret_val = xmlNewReference(doc, (const xmlChar *)name);
21784        desret_xmlNodePtr(ret_val);
21785        call_tests++;
21786        des_xmlDocPtr(n_doc, doc, 0);
21787        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21788        xmlResetLastError();
21789        if (mem_base != xmlMemBlocks()) {
21790            printf("Leak of %d blocks found in xmlNewReference",
21791	           xmlMemBlocks() - mem_base);
21792	    test_ret++;
21793            printf(" %d", n_doc);
21794            printf(" %d", n_name);
21795            printf("\n");
21796        }
21797    }
21798    }
21799    function_tests++;
21800
21801    return(test_ret);
21802}
21803
21804
21805static int
21806test_xmlNewText(void) {
21807    int test_ret = 0;
21808
21809    int mem_base;
21810    xmlNodePtr ret_val;
21811    xmlChar * content; /* the text content */
21812    int n_content;
21813
21814    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21815        mem_base = xmlMemBlocks();
21816        content = gen_const_xmlChar_ptr(n_content, 0);
21817
21818        ret_val = xmlNewText((const xmlChar *)content);
21819        desret_xmlNodePtr(ret_val);
21820        call_tests++;
21821        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21822        xmlResetLastError();
21823        if (mem_base != xmlMemBlocks()) {
21824            printf("Leak of %d blocks found in xmlNewText",
21825	           xmlMemBlocks() - mem_base);
21826	    test_ret++;
21827            printf(" %d", n_content);
21828            printf("\n");
21829        }
21830    }
21831    function_tests++;
21832
21833    return(test_ret);
21834}
21835
21836
21837static int
21838test_xmlNewTextChild(void) {
21839    int test_ret = 0;
21840
21841#if defined(LIBXML_TREE_ENABLED)
21842#ifdef LIBXML_TREE_ENABLED
21843    int mem_base;
21844    xmlNodePtr ret_val;
21845    xmlNodePtr parent; /* the parent node */
21846    int n_parent;
21847    xmlNsPtr ns; /* a namespace if any */
21848    int n_ns;
21849    xmlChar * name; /* the name of the child */
21850    int n_name;
21851    xmlChar * content; /* the text content of the child if any. */
21852    int n_content;
21853
21854    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21855    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21856    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21857    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21858        mem_base = xmlMemBlocks();
21859        parent = gen_xmlNodePtr(n_parent, 0);
21860        ns = gen_xmlNsPtr(n_ns, 1);
21861        name = gen_const_xmlChar_ptr(n_name, 2);
21862        content = gen_const_xmlChar_ptr(n_content, 3);
21863
21864        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21865        desret_xmlNodePtr(ret_val);
21866        call_tests++;
21867        des_xmlNodePtr(n_parent, parent, 0);
21868        des_xmlNsPtr(n_ns, ns, 1);
21869        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21870        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21871        xmlResetLastError();
21872        if (mem_base != xmlMemBlocks()) {
21873            printf("Leak of %d blocks found in xmlNewTextChild",
21874	           xmlMemBlocks() - mem_base);
21875	    test_ret++;
21876            printf(" %d", n_parent);
21877            printf(" %d", n_ns);
21878            printf(" %d", n_name);
21879            printf(" %d", n_content);
21880            printf("\n");
21881        }
21882    }
21883    }
21884    }
21885    }
21886    function_tests++;
21887#endif
21888#endif
21889
21890    return(test_ret);
21891}
21892
21893
21894static int
21895test_xmlNewTextLen(void) {
21896    int test_ret = 0;
21897
21898    int mem_base;
21899    xmlNodePtr ret_val;
21900    xmlChar * content; /* the text content */
21901    int n_content;
21902    int len; /* the text len. */
21903    int n_len;
21904
21905    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21906    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21907        mem_base = xmlMemBlocks();
21908        content = gen_const_xmlChar_ptr(n_content, 0);
21909        len = gen_int(n_len, 1);
21910
21911        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21912        desret_xmlNodePtr(ret_val);
21913        call_tests++;
21914        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21915        des_int(n_len, len, 1);
21916        xmlResetLastError();
21917        if (mem_base != xmlMemBlocks()) {
21918            printf("Leak of %d blocks found in xmlNewTextLen",
21919	           xmlMemBlocks() - mem_base);
21920	    test_ret++;
21921            printf(" %d", n_content);
21922            printf(" %d", n_len);
21923            printf("\n");
21924        }
21925    }
21926    }
21927    function_tests++;
21928
21929    return(test_ret);
21930}
21931
21932
21933static int
21934test_xmlNextElementSibling(void) {
21935    int test_ret = 0;
21936
21937#if defined(LIBXML_TREE_ENABLED)
21938    int mem_base;
21939    xmlNodePtr ret_val;
21940    xmlNodePtr node; /* the current node */
21941    int n_node;
21942
21943    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21944        mem_base = xmlMemBlocks();
21945        node = gen_xmlNodePtr(n_node, 0);
21946
21947        ret_val = xmlNextElementSibling(node);
21948        desret_xmlNodePtr(ret_val);
21949        call_tests++;
21950        des_xmlNodePtr(n_node, node, 0);
21951        xmlResetLastError();
21952        if (mem_base != xmlMemBlocks()) {
21953            printf("Leak of %d blocks found in xmlNextElementSibling",
21954	           xmlMemBlocks() - mem_base);
21955	    test_ret++;
21956            printf(" %d", n_node);
21957            printf("\n");
21958        }
21959    }
21960    function_tests++;
21961#endif
21962
21963    return(test_ret);
21964}
21965
21966
21967static int
21968test_xmlNodeAddContent(void) {
21969    int test_ret = 0;
21970
21971    int mem_base;
21972    xmlNodePtr cur; /* the node being modified */
21973    int n_cur;
21974    xmlChar * content; /* extra content */
21975    int n_content;
21976
21977    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21978    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21979        mem_base = xmlMemBlocks();
21980        cur = gen_xmlNodePtr(n_cur, 0);
21981        content = gen_const_xmlChar_ptr(n_content, 1);
21982
21983        xmlNodeAddContent(cur, (const xmlChar *)content);
21984        call_tests++;
21985        des_xmlNodePtr(n_cur, cur, 0);
21986        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21987        xmlResetLastError();
21988        if (mem_base != xmlMemBlocks()) {
21989            printf("Leak of %d blocks found in xmlNodeAddContent",
21990	           xmlMemBlocks() - mem_base);
21991	    test_ret++;
21992            printf(" %d", n_cur);
21993            printf(" %d", n_content);
21994            printf("\n");
21995        }
21996    }
21997    }
21998    function_tests++;
21999
22000    return(test_ret);
22001}
22002
22003
22004static int
22005test_xmlNodeAddContentLen(void) {
22006    int test_ret = 0;
22007
22008    int mem_base;
22009    xmlNodePtr cur; /* the node being modified */
22010    int n_cur;
22011    xmlChar * content; /* extra content */
22012    int n_content;
22013    int len; /* the size of @content */
22014    int n_len;
22015
22016    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22017    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22018    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22019        mem_base = xmlMemBlocks();
22020        cur = gen_xmlNodePtr(n_cur, 0);
22021        content = gen_const_xmlChar_ptr(n_content, 1);
22022        len = gen_int(n_len, 2);
22023
22024        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
22025        call_tests++;
22026        des_xmlNodePtr(n_cur, cur, 0);
22027        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22028        des_int(n_len, len, 2);
22029        xmlResetLastError();
22030        if (mem_base != xmlMemBlocks()) {
22031            printf("Leak of %d blocks found in xmlNodeAddContentLen",
22032	           xmlMemBlocks() - mem_base);
22033	    test_ret++;
22034            printf(" %d", n_cur);
22035            printf(" %d", n_content);
22036            printf(" %d", n_len);
22037            printf("\n");
22038        }
22039    }
22040    }
22041    }
22042    function_tests++;
22043
22044    return(test_ret);
22045}
22046
22047
22048static int
22049test_xmlNodeBufGetContent(void) {
22050    int test_ret = 0;
22051
22052    int mem_base;
22053    int ret_val;
22054    xmlBufferPtr buffer; /* a buffer */
22055    int n_buffer;
22056    xmlNodePtr cur; /* the node being read */
22057    int n_cur;
22058
22059    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
22060    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22061        mem_base = xmlMemBlocks();
22062        buffer = gen_xmlBufferPtr(n_buffer, 0);
22063        cur = gen_xmlNodePtr(n_cur, 1);
22064
22065        ret_val = xmlNodeBufGetContent(buffer, cur);
22066        desret_int(ret_val);
22067        call_tests++;
22068        des_xmlBufferPtr(n_buffer, buffer, 0);
22069        des_xmlNodePtr(n_cur, cur, 1);
22070        xmlResetLastError();
22071        if (mem_base != xmlMemBlocks()) {
22072            printf("Leak of %d blocks found in xmlNodeBufGetContent",
22073	           xmlMemBlocks() - mem_base);
22074	    test_ret++;
22075            printf(" %d", n_buffer);
22076            printf(" %d", n_cur);
22077            printf("\n");
22078        }
22079    }
22080    }
22081    function_tests++;
22082
22083    return(test_ret);
22084}
22085
22086
22087static int
22088test_xmlNodeDump(void) {
22089    int test_ret = 0;
22090
22091#if defined(LIBXML_OUTPUT_ENABLED)
22092    int mem_base;
22093    int ret_val;
22094    xmlBufferPtr buf; /* the XML buffer output */
22095    int n_buf;
22096    xmlDocPtr doc; /* the document */
22097    int n_doc;
22098    xmlNodePtr cur; /* the current node */
22099    int n_cur;
22100    int level; /* the imbrication level for indenting */
22101    int n_level;
22102    int format; /* is formatting allowed */
22103    int n_format;
22104
22105    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
22106    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22107    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22108    for (n_level = 0;n_level < gen_nb_int;n_level++) {
22109    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22110        mem_base = xmlMemBlocks();
22111        buf = gen_xmlBufferPtr(n_buf, 0);
22112        doc = gen_xmlDocPtr(n_doc, 1);
22113        cur = gen_xmlNodePtr(n_cur, 2);
22114        level = gen_int(n_level, 3);
22115        format = gen_int(n_format, 4);
22116
22117        ret_val = xmlNodeDump(buf, doc, cur, level, format);
22118        desret_int(ret_val);
22119        call_tests++;
22120        des_xmlBufferPtr(n_buf, buf, 0);
22121        des_xmlDocPtr(n_doc, doc, 1);
22122        des_xmlNodePtr(n_cur, cur, 2);
22123        des_int(n_level, level, 3);
22124        des_int(n_format, format, 4);
22125        xmlResetLastError();
22126        if (mem_base != xmlMemBlocks()) {
22127            printf("Leak of %d blocks found in xmlNodeDump",
22128	           xmlMemBlocks() - mem_base);
22129	    test_ret++;
22130            printf(" %d", n_buf);
22131            printf(" %d", n_doc);
22132            printf(" %d", n_cur);
22133            printf(" %d", n_level);
22134            printf(" %d", n_format);
22135            printf("\n");
22136        }
22137    }
22138    }
22139    }
22140    }
22141    }
22142    function_tests++;
22143#endif
22144
22145    return(test_ret);
22146}
22147
22148
22149static int
22150test_xmlNodeDumpOutput(void) {
22151    int test_ret = 0;
22152
22153#if defined(LIBXML_OUTPUT_ENABLED)
22154    int mem_base;
22155    xmlOutputBufferPtr buf; /* the XML buffer output */
22156    int n_buf;
22157    xmlDocPtr doc; /* the document */
22158    int n_doc;
22159    xmlNodePtr cur; /* the current node */
22160    int n_cur;
22161    int level; /* the imbrication level for indenting */
22162    int n_level;
22163    int format; /* is formatting allowed */
22164    int n_format;
22165    char * encoding; /* an optional encoding string */
22166    int n_encoding;
22167
22168    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22169    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22170    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22171    for (n_level = 0;n_level < gen_nb_int;n_level++) {
22172    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22173    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22174        mem_base = xmlMemBlocks();
22175        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22176        doc = gen_xmlDocPtr(n_doc, 1);
22177        cur = gen_xmlNodePtr(n_cur, 2);
22178        level = gen_int(n_level, 3);
22179        format = gen_int(n_format, 4);
22180        encoding = gen_const_char_ptr(n_encoding, 5);
22181
22182        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22183        call_tests++;
22184        des_xmlOutputBufferPtr(n_buf, buf, 0);
22185        des_xmlDocPtr(n_doc, doc, 1);
22186        des_xmlNodePtr(n_cur, cur, 2);
22187        des_int(n_level, level, 3);
22188        des_int(n_format, format, 4);
22189        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22190        xmlResetLastError();
22191        if (mem_base != xmlMemBlocks()) {
22192            printf("Leak of %d blocks found in xmlNodeDumpOutput",
22193	           xmlMemBlocks() - mem_base);
22194	    test_ret++;
22195            printf(" %d", n_buf);
22196            printf(" %d", n_doc);
22197            printf(" %d", n_cur);
22198            printf(" %d", n_level);
22199            printf(" %d", n_format);
22200            printf(" %d", n_encoding);
22201            printf("\n");
22202        }
22203    }
22204    }
22205    }
22206    }
22207    }
22208    }
22209    function_tests++;
22210#endif
22211
22212    return(test_ret);
22213}
22214
22215
22216static int
22217test_xmlNodeGetBase(void) {
22218    int test_ret = 0;
22219
22220    int mem_base;
22221    xmlChar * ret_val;
22222    xmlDocPtr doc; /* the document the node pertains to */
22223    int n_doc;
22224    xmlNodePtr cur; /* the node being checked */
22225    int n_cur;
22226
22227    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22228    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22229        mem_base = xmlMemBlocks();
22230        doc = gen_xmlDocPtr(n_doc, 0);
22231        cur = gen_xmlNodePtr(n_cur, 1);
22232
22233        ret_val = xmlNodeGetBase(doc, cur);
22234        desret_xmlChar_ptr(ret_val);
22235        call_tests++;
22236        des_xmlDocPtr(n_doc, doc, 0);
22237        des_xmlNodePtr(n_cur, cur, 1);
22238        xmlResetLastError();
22239        if (mem_base != xmlMemBlocks()) {
22240            printf("Leak of %d blocks found in xmlNodeGetBase",
22241	           xmlMemBlocks() - mem_base);
22242	    test_ret++;
22243            printf(" %d", n_doc);
22244            printf(" %d", n_cur);
22245            printf("\n");
22246        }
22247    }
22248    }
22249    function_tests++;
22250
22251    return(test_ret);
22252}
22253
22254
22255static int
22256test_xmlNodeGetContent(void) {
22257    int test_ret = 0;
22258
22259    int mem_base;
22260    xmlChar * ret_val;
22261    xmlNodePtr cur; /* the node being read */
22262    int n_cur;
22263
22264    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22265        mem_base = xmlMemBlocks();
22266        cur = gen_xmlNodePtr(n_cur, 0);
22267
22268        ret_val = xmlNodeGetContent(cur);
22269        desret_xmlChar_ptr(ret_val);
22270        call_tests++;
22271        des_xmlNodePtr(n_cur, cur, 0);
22272        xmlResetLastError();
22273        if (mem_base != xmlMemBlocks()) {
22274            printf("Leak of %d blocks found in xmlNodeGetContent",
22275	           xmlMemBlocks() - mem_base);
22276	    test_ret++;
22277            printf(" %d", n_cur);
22278            printf("\n");
22279        }
22280    }
22281    function_tests++;
22282
22283    return(test_ret);
22284}
22285
22286
22287static int
22288test_xmlNodeGetLang(void) {
22289    int test_ret = 0;
22290
22291    int mem_base;
22292    xmlChar * ret_val;
22293    xmlNodePtr cur; /* the node being checked */
22294    int n_cur;
22295
22296    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22297        mem_base = xmlMemBlocks();
22298        cur = gen_xmlNodePtr(n_cur, 0);
22299
22300        ret_val = xmlNodeGetLang(cur);
22301        desret_xmlChar_ptr(ret_val);
22302        call_tests++;
22303        des_xmlNodePtr(n_cur, cur, 0);
22304        xmlResetLastError();
22305        if (mem_base != xmlMemBlocks()) {
22306            printf("Leak of %d blocks found in xmlNodeGetLang",
22307	           xmlMemBlocks() - mem_base);
22308	    test_ret++;
22309            printf(" %d", n_cur);
22310            printf("\n");
22311        }
22312    }
22313    function_tests++;
22314
22315    return(test_ret);
22316}
22317
22318
22319static int
22320test_xmlNodeGetSpacePreserve(void) {
22321    int test_ret = 0;
22322
22323    int mem_base;
22324    int ret_val;
22325    xmlNodePtr cur; /* the node being checked */
22326    int n_cur;
22327
22328    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22329        mem_base = xmlMemBlocks();
22330        cur = gen_xmlNodePtr(n_cur, 0);
22331
22332        ret_val = xmlNodeGetSpacePreserve(cur);
22333        desret_int(ret_val);
22334        call_tests++;
22335        des_xmlNodePtr(n_cur, cur, 0);
22336        xmlResetLastError();
22337        if (mem_base != xmlMemBlocks()) {
22338            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22339	           xmlMemBlocks() - mem_base);
22340	    test_ret++;
22341            printf(" %d", n_cur);
22342            printf("\n");
22343        }
22344    }
22345    function_tests++;
22346
22347    return(test_ret);
22348}
22349
22350
22351static int
22352test_xmlNodeIsText(void) {
22353    int test_ret = 0;
22354
22355    int mem_base;
22356    int ret_val;
22357    xmlNodePtr node; /* the node */
22358    int n_node;
22359
22360    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22361        mem_base = xmlMemBlocks();
22362        node = gen_xmlNodePtr(n_node, 0);
22363
22364        ret_val = xmlNodeIsText(node);
22365        desret_int(ret_val);
22366        call_tests++;
22367        des_xmlNodePtr(n_node, node, 0);
22368        xmlResetLastError();
22369        if (mem_base != xmlMemBlocks()) {
22370            printf("Leak of %d blocks found in xmlNodeIsText",
22371	           xmlMemBlocks() - mem_base);
22372	    test_ret++;
22373            printf(" %d", n_node);
22374            printf("\n");
22375        }
22376    }
22377    function_tests++;
22378
22379    return(test_ret);
22380}
22381
22382
22383static int
22384test_xmlNodeListGetRawString(void) {
22385    int test_ret = 0;
22386
22387#if defined(LIBXML_TREE_ENABLED)
22388    int mem_base;
22389    xmlChar * ret_val;
22390    xmlDocPtr doc; /* the document */
22391    int n_doc;
22392    xmlNodePtr list; /* a Node list */
22393    int n_list;
22394    int inLine; /* should we replace entity contents or show their external form */
22395    int n_inLine;
22396
22397    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22398    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22399    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22400        mem_base = xmlMemBlocks();
22401        doc = gen_xmlDocPtr(n_doc, 0);
22402        list = gen_xmlNodePtr(n_list, 1);
22403        inLine = gen_int(n_inLine, 2);
22404
22405        ret_val = xmlNodeListGetRawString(doc, list, inLine);
22406        desret_xmlChar_ptr(ret_val);
22407        call_tests++;
22408        des_xmlDocPtr(n_doc, doc, 0);
22409        des_xmlNodePtr(n_list, list, 1);
22410        des_int(n_inLine, inLine, 2);
22411        xmlResetLastError();
22412        if (mem_base != xmlMemBlocks()) {
22413            printf("Leak of %d blocks found in xmlNodeListGetRawString",
22414	           xmlMemBlocks() - mem_base);
22415	    test_ret++;
22416            printf(" %d", n_doc);
22417            printf(" %d", n_list);
22418            printf(" %d", n_inLine);
22419            printf("\n");
22420        }
22421    }
22422    }
22423    }
22424    function_tests++;
22425#endif
22426
22427    return(test_ret);
22428}
22429
22430
22431static int
22432test_xmlNodeListGetString(void) {
22433    int test_ret = 0;
22434
22435    int mem_base;
22436    xmlChar * ret_val;
22437    xmlDocPtr doc; /* the document */
22438    int n_doc;
22439    xmlNodePtr list; /* a Node list */
22440    int n_list;
22441    int inLine; /* should we replace entity contents or show their external form */
22442    int n_inLine;
22443
22444    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22445    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22446    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22447        mem_base = xmlMemBlocks();
22448        doc = gen_xmlDocPtr(n_doc, 0);
22449        list = gen_xmlNodePtr(n_list, 1);
22450        inLine = gen_int(n_inLine, 2);
22451
22452        ret_val = xmlNodeListGetString(doc, list, inLine);
22453        desret_xmlChar_ptr(ret_val);
22454        call_tests++;
22455        des_xmlDocPtr(n_doc, doc, 0);
22456        des_xmlNodePtr(n_list, list, 1);
22457        des_int(n_inLine, inLine, 2);
22458        xmlResetLastError();
22459        if (mem_base != xmlMemBlocks()) {
22460            printf("Leak of %d blocks found in xmlNodeListGetString",
22461	           xmlMemBlocks() - mem_base);
22462	    test_ret++;
22463            printf(" %d", n_doc);
22464            printf(" %d", n_list);
22465            printf(" %d", n_inLine);
22466            printf("\n");
22467        }
22468    }
22469    }
22470    }
22471    function_tests++;
22472
22473    return(test_ret);
22474}
22475
22476
22477static int
22478test_xmlNodeSetBase(void) {
22479    int test_ret = 0;
22480
22481#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22482    int mem_base;
22483    xmlNodePtr cur; /* the node being changed */
22484    int n_cur;
22485    xmlChar * uri; /* the new base URI */
22486    int n_uri;
22487
22488    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22489    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22490        mem_base = xmlMemBlocks();
22491        cur = gen_xmlNodePtr(n_cur, 0);
22492        uri = gen_const_xmlChar_ptr(n_uri, 1);
22493
22494        xmlNodeSetBase(cur, (const xmlChar *)uri);
22495        call_tests++;
22496        des_xmlNodePtr(n_cur, cur, 0);
22497        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22498        xmlResetLastError();
22499        if (mem_base != xmlMemBlocks()) {
22500            printf("Leak of %d blocks found in xmlNodeSetBase",
22501	           xmlMemBlocks() - mem_base);
22502	    test_ret++;
22503            printf(" %d", n_cur);
22504            printf(" %d", n_uri);
22505            printf("\n");
22506        }
22507    }
22508    }
22509    function_tests++;
22510#endif
22511
22512    return(test_ret);
22513}
22514
22515
22516static int
22517test_xmlNodeSetContent(void) {
22518    int test_ret = 0;
22519
22520    int mem_base;
22521    xmlNodePtr cur; /* the node being modified */
22522    int n_cur;
22523    xmlChar * content; /* the new value of the content */
22524    int n_content;
22525
22526    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22527    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22528        mem_base = xmlMemBlocks();
22529        cur = gen_xmlNodePtr(n_cur, 0);
22530        content = gen_const_xmlChar_ptr(n_content, 1);
22531
22532        xmlNodeSetContent(cur, (const xmlChar *)content);
22533        call_tests++;
22534        des_xmlNodePtr(n_cur, cur, 0);
22535        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22536        xmlResetLastError();
22537        if (mem_base != xmlMemBlocks()) {
22538            printf("Leak of %d blocks found in xmlNodeSetContent",
22539	           xmlMemBlocks() - mem_base);
22540	    test_ret++;
22541            printf(" %d", n_cur);
22542            printf(" %d", n_content);
22543            printf("\n");
22544        }
22545    }
22546    }
22547    function_tests++;
22548
22549    return(test_ret);
22550}
22551
22552
22553static int
22554test_xmlNodeSetContentLen(void) {
22555    int test_ret = 0;
22556
22557#if defined(LIBXML_TREE_ENABLED)
22558    int mem_base;
22559    xmlNodePtr cur; /* the node being modified */
22560    int n_cur;
22561    xmlChar * content; /* the new value of the content */
22562    int n_content;
22563    int len; /* the size of @content */
22564    int n_len;
22565
22566    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22567    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22568    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22569        mem_base = xmlMemBlocks();
22570        cur = gen_xmlNodePtr(n_cur, 0);
22571        content = gen_const_xmlChar_ptr(n_content, 1);
22572        len = gen_int(n_len, 2);
22573
22574        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22575        call_tests++;
22576        des_xmlNodePtr(n_cur, cur, 0);
22577        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22578        des_int(n_len, len, 2);
22579        xmlResetLastError();
22580        if (mem_base != xmlMemBlocks()) {
22581            printf("Leak of %d blocks found in xmlNodeSetContentLen",
22582	           xmlMemBlocks() - mem_base);
22583	    test_ret++;
22584            printf(" %d", n_cur);
22585            printf(" %d", n_content);
22586            printf(" %d", n_len);
22587            printf("\n");
22588        }
22589    }
22590    }
22591    }
22592    function_tests++;
22593#endif
22594
22595    return(test_ret);
22596}
22597
22598
22599static int
22600test_xmlNodeSetLang(void) {
22601    int test_ret = 0;
22602
22603#if defined(LIBXML_TREE_ENABLED)
22604    int mem_base;
22605    xmlNodePtr cur; /* the node being changed */
22606    int n_cur;
22607    xmlChar * lang; /* the language description */
22608    int n_lang;
22609
22610    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22611    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22612        mem_base = xmlMemBlocks();
22613        cur = gen_xmlNodePtr(n_cur, 0);
22614        lang = gen_const_xmlChar_ptr(n_lang, 1);
22615
22616        xmlNodeSetLang(cur, (const xmlChar *)lang);
22617        call_tests++;
22618        des_xmlNodePtr(n_cur, cur, 0);
22619        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22620        xmlResetLastError();
22621        if (mem_base != xmlMemBlocks()) {
22622            printf("Leak of %d blocks found in xmlNodeSetLang",
22623	           xmlMemBlocks() - mem_base);
22624	    test_ret++;
22625            printf(" %d", n_cur);
22626            printf(" %d", n_lang);
22627            printf("\n");
22628        }
22629    }
22630    }
22631    function_tests++;
22632#endif
22633
22634    return(test_ret);
22635}
22636
22637
22638static int
22639test_xmlNodeSetName(void) {
22640    int test_ret = 0;
22641
22642#if defined(LIBXML_TREE_ENABLED)
22643    int mem_base;
22644    xmlNodePtr cur; /* the node being changed */
22645    int n_cur;
22646    xmlChar * name; /* the new tag name */
22647    int n_name;
22648
22649    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22650    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22651        mem_base = xmlMemBlocks();
22652        cur = gen_xmlNodePtr(n_cur, 0);
22653        name = gen_const_xmlChar_ptr(n_name, 1);
22654
22655        xmlNodeSetName(cur, (const xmlChar *)name);
22656        call_tests++;
22657        des_xmlNodePtr(n_cur, cur, 0);
22658        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22659        xmlResetLastError();
22660        if (mem_base != xmlMemBlocks()) {
22661            printf("Leak of %d blocks found in xmlNodeSetName",
22662	           xmlMemBlocks() - mem_base);
22663	    test_ret++;
22664            printf(" %d", n_cur);
22665            printf(" %d", n_name);
22666            printf("\n");
22667        }
22668    }
22669    }
22670    function_tests++;
22671#endif
22672
22673    return(test_ret);
22674}
22675
22676
22677static int
22678test_xmlNodeSetSpacePreserve(void) {
22679    int test_ret = 0;
22680
22681#if defined(LIBXML_TREE_ENABLED)
22682    int mem_base;
22683    xmlNodePtr cur; /* the node being changed */
22684    int n_cur;
22685    int val; /* the xml:space value ("0": default, 1: "preserve") */
22686    int n_val;
22687
22688    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22689    for (n_val = 0;n_val < gen_nb_int;n_val++) {
22690        mem_base = xmlMemBlocks();
22691        cur = gen_xmlNodePtr(n_cur, 0);
22692        val = gen_int(n_val, 1);
22693
22694        xmlNodeSetSpacePreserve(cur, val);
22695        call_tests++;
22696        des_xmlNodePtr(n_cur, cur, 0);
22697        des_int(n_val, val, 1);
22698        xmlResetLastError();
22699        if (mem_base != xmlMemBlocks()) {
22700            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22701	           xmlMemBlocks() - mem_base);
22702	    test_ret++;
22703            printf(" %d", n_cur);
22704            printf(" %d", n_val);
22705            printf("\n");
22706        }
22707    }
22708    }
22709    function_tests++;
22710#endif
22711
22712    return(test_ret);
22713}
22714
22715
22716static int
22717test_xmlPreviousElementSibling(void) {
22718    int test_ret = 0;
22719
22720#if defined(LIBXML_TREE_ENABLED)
22721    int mem_base;
22722    xmlNodePtr ret_val;
22723    xmlNodePtr node; /* the current node */
22724    int n_node;
22725
22726    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22727        mem_base = xmlMemBlocks();
22728        node = gen_xmlNodePtr(n_node, 0);
22729
22730        ret_val = xmlPreviousElementSibling(node);
22731        desret_xmlNodePtr(ret_val);
22732        call_tests++;
22733        des_xmlNodePtr(n_node, node, 0);
22734        xmlResetLastError();
22735        if (mem_base != xmlMemBlocks()) {
22736            printf("Leak of %d blocks found in xmlPreviousElementSibling",
22737	           xmlMemBlocks() - mem_base);
22738	    test_ret++;
22739            printf(" %d", n_node);
22740            printf("\n");
22741        }
22742    }
22743    function_tests++;
22744#endif
22745
22746    return(test_ret);
22747}
22748
22749
22750static int
22751test_xmlReconciliateNs(void) {
22752    int test_ret = 0;
22753
22754#if defined(LIBXML_TREE_ENABLED)
22755#ifdef LIBXML_TREE_ENABLED
22756    int mem_base;
22757    int ret_val;
22758    xmlDocPtr doc; /* the document */
22759    int n_doc;
22760    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22761    int n_tree;
22762
22763    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22764    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22765        mem_base = xmlMemBlocks();
22766        doc = gen_xmlDocPtr(n_doc, 0);
22767        tree = gen_xmlNodePtr(n_tree, 1);
22768
22769        ret_val = xmlReconciliateNs(doc, tree);
22770        desret_int(ret_val);
22771        call_tests++;
22772        des_xmlDocPtr(n_doc, doc, 0);
22773        des_xmlNodePtr(n_tree, tree, 1);
22774        xmlResetLastError();
22775        if (mem_base != xmlMemBlocks()) {
22776            printf("Leak of %d blocks found in xmlReconciliateNs",
22777	           xmlMemBlocks() - mem_base);
22778	    test_ret++;
22779            printf(" %d", n_doc);
22780            printf(" %d", n_tree);
22781            printf("\n");
22782        }
22783    }
22784    }
22785    function_tests++;
22786#endif
22787#endif
22788
22789    return(test_ret);
22790}
22791
22792
22793static int
22794test_xmlRemoveProp(void) {
22795    int test_ret = 0;
22796
22797    int mem_base;
22798    int ret_val;
22799    xmlAttrPtr cur; /* an attribute */
22800    int n_cur;
22801
22802    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22803        mem_base = xmlMemBlocks();
22804        cur = gen_xmlAttrPtr(n_cur, 0);
22805
22806        ret_val = xmlRemoveProp(cur);
22807        cur = NULL;
22808        desret_int(ret_val);
22809        call_tests++;
22810        des_xmlAttrPtr(n_cur, cur, 0);
22811        xmlResetLastError();
22812        if (mem_base != xmlMemBlocks()) {
22813            printf("Leak of %d blocks found in xmlRemoveProp",
22814	           xmlMemBlocks() - mem_base);
22815	    test_ret++;
22816            printf(" %d", n_cur);
22817            printf("\n");
22818        }
22819    }
22820    function_tests++;
22821
22822    return(test_ret);
22823}
22824
22825
22826static int
22827test_xmlReplaceNode(void) {
22828    int test_ret = 0;
22829
22830#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22831    int mem_base;
22832    xmlNodePtr ret_val;
22833    xmlNodePtr old; /* the old node */
22834    int n_old;
22835    xmlNodePtr cur; /* the node */
22836    int n_cur;
22837
22838    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22839    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22840        mem_base = xmlMemBlocks();
22841        old = gen_xmlNodePtr(n_old, 0);
22842        cur = gen_xmlNodePtr_in(n_cur, 1);
22843
22844        ret_val = xmlReplaceNode(old, cur);
22845        if (cur != NULL) {
22846              xmlUnlinkNode(cur);
22847              xmlFreeNode(cur) ; cur = NULL ; }
22848          if (old != NULL) {
22849              xmlUnlinkNode(old);
22850              xmlFreeNode(old) ; old = NULL ; }
22851	  ret_val = NULL;
22852        desret_xmlNodePtr(ret_val);
22853        call_tests++;
22854        des_xmlNodePtr(n_old, old, 0);
22855        des_xmlNodePtr_in(n_cur, cur, 1);
22856        xmlResetLastError();
22857        if (mem_base != xmlMemBlocks()) {
22858            printf("Leak of %d blocks found in xmlReplaceNode",
22859	           xmlMemBlocks() - mem_base);
22860	    test_ret++;
22861            printf(" %d", n_old);
22862            printf(" %d", n_cur);
22863            printf("\n");
22864        }
22865    }
22866    }
22867    function_tests++;
22868#endif
22869
22870    return(test_ret);
22871}
22872
22873
22874static int
22875test_xmlSaveFile(void) {
22876    int test_ret = 0;
22877
22878#if defined(LIBXML_OUTPUT_ENABLED)
22879    int mem_base;
22880    int ret_val;
22881    const char * filename; /* the filename (or URL) */
22882    int n_filename;
22883    xmlDocPtr cur; /* the document */
22884    int n_cur;
22885
22886    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22887    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22888        mem_base = xmlMemBlocks();
22889        filename = gen_fileoutput(n_filename, 0);
22890        cur = gen_xmlDocPtr(n_cur, 1);
22891
22892        ret_val = xmlSaveFile(filename, cur);
22893        desret_int(ret_val);
22894        call_tests++;
22895        des_fileoutput(n_filename, filename, 0);
22896        des_xmlDocPtr(n_cur, cur, 1);
22897        xmlResetLastError();
22898        if (mem_base != xmlMemBlocks()) {
22899            printf("Leak of %d blocks found in xmlSaveFile",
22900	           xmlMemBlocks() - mem_base);
22901	    test_ret++;
22902            printf(" %d", n_filename);
22903            printf(" %d", n_cur);
22904            printf("\n");
22905        }
22906    }
22907    }
22908    function_tests++;
22909#endif
22910
22911    return(test_ret);
22912}
22913
22914
22915static int
22916test_xmlSaveFileEnc(void) {
22917    int test_ret = 0;
22918
22919#if defined(LIBXML_OUTPUT_ENABLED)
22920    int mem_base;
22921    int ret_val;
22922    const char * filename; /* the filename (or URL) */
22923    int n_filename;
22924    xmlDocPtr cur; /* the document */
22925    int n_cur;
22926    char * encoding; /* the name of an encoding (or NULL) */
22927    int n_encoding;
22928
22929    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22930    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22931    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22932        mem_base = xmlMemBlocks();
22933        filename = gen_fileoutput(n_filename, 0);
22934        cur = gen_xmlDocPtr(n_cur, 1);
22935        encoding = gen_const_char_ptr(n_encoding, 2);
22936
22937        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22938        desret_int(ret_val);
22939        call_tests++;
22940        des_fileoutput(n_filename, filename, 0);
22941        des_xmlDocPtr(n_cur, cur, 1);
22942        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22943        xmlResetLastError();
22944        if (mem_base != xmlMemBlocks()) {
22945            printf("Leak of %d blocks found in xmlSaveFileEnc",
22946	           xmlMemBlocks() - mem_base);
22947	    test_ret++;
22948            printf(" %d", n_filename);
22949            printf(" %d", n_cur);
22950            printf(" %d", n_encoding);
22951            printf("\n");
22952        }
22953    }
22954    }
22955    }
22956    function_tests++;
22957#endif
22958
22959    return(test_ret);
22960}
22961
22962
22963static int
22964test_xmlSaveFileTo(void) {
22965    int test_ret = 0;
22966
22967#if defined(LIBXML_OUTPUT_ENABLED)
22968    int mem_base;
22969    int ret_val;
22970    xmlOutputBufferPtr buf; /* an output I/O buffer */
22971    int n_buf;
22972    xmlDocPtr cur; /* the document */
22973    int n_cur;
22974    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22975    int n_encoding;
22976
22977    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22978    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22979    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22980        mem_base = xmlMemBlocks();
22981        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22982        cur = gen_xmlDocPtr(n_cur, 1);
22983        encoding = gen_const_char_ptr(n_encoding, 2);
22984
22985        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22986        buf = NULL;
22987        desret_int(ret_val);
22988        call_tests++;
22989        des_xmlOutputBufferPtr(n_buf, buf, 0);
22990        des_xmlDocPtr(n_cur, cur, 1);
22991        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22992        xmlResetLastError();
22993        if (mem_base != xmlMemBlocks()) {
22994            printf("Leak of %d blocks found in xmlSaveFileTo",
22995	           xmlMemBlocks() - mem_base);
22996	    test_ret++;
22997            printf(" %d", n_buf);
22998            printf(" %d", n_cur);
22999            printf(" %d", n_encoding);
23000            printf("\n");
23001        }
23002    }
23003    }
23004    }
23005    function_tests++;
23006#endif
23007
23008    return(test_ret);
23009}
23010
23011
23012static int
23013test_xmlSaveFormatFile(void) {
23014    int test_ret = 0;
23015
23016#if defined(LIBXML_OUTPUT_ENABLED)
23017    int mem_base;
23018    int ret_val;
23019    const char * filename; /* the filename (or URL) */
23020    int n_filename;
23021    xmlDocPtr cur; /* the document */
23022    int n_cur;
23023    int format; /* should formatting spaces been added */
23024    int n_format;
23025
23026    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23027    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23028    for (n_format = 0;n_format < gen_nb_int;n_format++) {
23029        mem_base = xmlMemBlocks();
23030        filename = gen_fileoutput(n_filename, 0);
23031        cur = gen_xmlDocPtr(n_cur, 1);
23032        format = gen_int(n_format, 2);
23033
23034        ret_val = xmlSaveFormatFile(filename, cur, format);
23035        desret_int(ret_val);
23036        call_tests++;
23037        des_fileoutput(n_filename, filename, 0);
23038        des_xmlDocPtr(n_cur, cur, 1);
23039        des_int(n_format, format, 2);
23040        xmlResetLastError();
23041        if (mem_base != xmlMemBlocks()) {
23042            printf("Leak of %d blocks found in xmlSaveFormatFile",
23043	           xmlMemBlocks() - mem_base);
23044	    test_ret++;
23045            printf(" %d", n_filename);
23046            printf(" %d", n_cur);
23047            printf(" %d", n_format);
23048            printf("\n");
23049        }
23050    }
23051    }
23052    }
23053    function_tests++;
23054#endif
23055
23056    return(test_ret);
23057}
23058
23059
23060static int
23061test_xmlSaveFormatFileEnc(void) {
23062    int test_ret = 0;
23063
23064#if defined(LIBXML_OUTPUT_ENABLED)
23065    int mem_base;
23066    int ret_val;
23067    const char * filename; /* the filename or URL to output */
23068    int n_filename;
23069    xmlDocPtr cur; /* the document being saved */
23070    int n_cur;
23071    char * encoding; /* the name of the encoding to use or NULL. */
23072    int n_encoding;
23073    int format; /* should formatting spaces be added. */
23074    int n_format;
23075
23076    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
23077    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23078    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23079    for (n_format = 0;n_format < gen_nb_int;n_format++) {
23080        mem_base = xmlMemBlocks();
23081        filename = gen_fileoutput(n_filename, 0);
23082        cur = gen_xmlDocPtr(n_cur, 1);
23083        encoding = gen_const_char_ptr(n_encoding, 2);
23084        format = gen_int(n_format, 3);
23085
23086        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
23087        desret_int(ret_val);
23088        call_tests++;
23089        des_fileoutput(n_filename, filename, 0);
23090        des_xmlDocPtr(n_cur, cur, 1);
23091        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23092        des_int(n_format, format, 3);
23093        xmlResetLastError();
23094        if (mem_base != xmlMemBlocks()) {
23095            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
23096	           xmlMemBlocks() - mem_base);
23097	    test_ret++;
23098            printf(" %d", n_filename);
23099            printf(" %d", n_cur);
23100            printf(" %d", n_encoding);
23101            printf(" %d", n_format);
23102            printf("\n");
23103        }
23104    }
23105    }
23106    }
23107    }
23108    function_tests++;
23109#endif
23110
23111    return(test_ret);
23112}
23113
23114
23115static int
23116test_xmlSaveFormatFileTo(void) {
23117    int test_ret = 0;
23118
23119#if defined(LIBXML_OUTPUT_ENABLED)
23120    int mem_base;
23121    int ret_val;
23122    xmlOutputBufferPtr buf; /* an output I/O buffer */
23123    int n_buf;
23124    xmlDocPtr cur; /* the document */
23125    int n_cur;
23126    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
23127    int n_encoding;
23128    int format; /* should formatting spaces been added */
23129    int n_format;
23130
23131    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
23132    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
23133    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
23134    for (n_format = 0;n_format < gen_nb_int;n_format++) {
23135        mem_base = xmlMemBlocks();
23136        buf = gen_xmlOutputBufferPtr(n_buf, 0);
23137        cur = gen_xmlDocPtr(n_cur, 1);
23138        encoding = gen_const_char_ptr(n_encoding, 2);
23139        format = gen_int(n_format, 3);
23140
23141        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
23142        buf = NULL;
23143        desret_int(ret_val);
23144        call_tests++;
23145        des_xmlOutputBufferPtr(n_buf, buf, 0);
23146        des_xmlDocPtr(n_cur, cur, 1);
23147        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
23148        des_int(n_format, format, 3);
23149        xmlResetLastError();
23150        if (mem_base != xmlMemBlocks()) {
23151            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
23152	           xmlMemBlocks() - mem_base);
23153	    test_ret++;
23154            printf(" %d", n_buf);
23155            printf(" %d", n_cur);
23156            printf(" %d", n_encoding);
23157            printf(" %d", n_format);
23158            printf("\n");
23159        }
23160    }
23161    }
23162    }
23163    }
23164    function_tests++;
23165#endif
23166
23167    return(test_ret);
23168}
23169
23170
23171static int
23172test_xmlSearchNs(void) {
23173    int test_ret = 0;
23174
23175    int mem_base;
23176    xmlNsPtr ret_val;
23177    xmlDocPtr doc; /* the document */
23178    int n_doc;
23179    xmlNodePtr node; /* the current node */
23180    int n_node;
23181    xmlChar * nameSpace; /* the namespace prefix */
23182    int n_nameSpace;
23183
23184    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23185    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23186    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23187        mem_base = xmlMemBlocks();
23188        doc = gen_xmlDocPtr(n_doc, 0);
23189        node = gen_xmlNodePtr(n_node, 1);
23190        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23191
23192        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23193        desret_xmlNsPtr(ret_val);
23194        call_tests++;
23195        des_xmlDocPtr(n_doc, doc, 0);
23196        des_xmlNodePtr(n_node, node, 1);
23197        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23198        xmlResetLastError();
23199        if (mem_base != xmlMemBlocks()) {
23200            printf("Leak of %d blocks found in xmlSearchNs",
23201	           xmlMemBlocks() - mem_base);
23202	    test_ret++;
23203            printf(" %d", n_doc);
23204            printf(" %d", n_node);
23205            printf(" %d", n_nameSpace);
23206            printf("\n");
23207        }
23208    }
23209    }
23210    }
23211    function_tests++;
23212
23213    return(test_ret);
23214}
23215
23216
23217static int
23218test_xmlSearchNsByHref(void) {
23219    int test_ret = 0;
23220
23221    int mem_base;
23222    xmlNsPtr ret_val;
23223    xmlDocPtr doc; /* the document */
23224    int n_doc;
23225    xmlNodePtr node; /* the current node */
23226    int n_node;
23227    xmlChar * href; /* the namespace value */
23228    int n_href;
23229
23230    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23231    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23232    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23233        mem_base = xmlMemBlocks();
23234        doc = gen_xmlDocPtr(n_doc, 0);
23235        node = gen_xmlNodePtr(n_node, 1);
23236        href = gen_const_xmlChar_ptr(n_href, 2);
23237
23238        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23239        desret_xmlNsPtr(ret_val);
23240        call_tests++;
23241        des_xmlDocPtr(n_doc, doc, 0);
23242        des_xmlNodePtr(n_node, node, 1);
23243        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23244        xmlResetLastError();
23245        if (mem_base != xmlMemBlocks()) {
23246            printf("Leak of %d blocks found in xmlSearchNsByHref",
23247	           xmlMemBlocks() - mem_base);
23248	    test_ret++;
23249            printf(" %d", n_doc);
23250            printf(" %d", n_node);
23251            printf(" %d", n_href);
23252            printf("\n");
23253        }
23254    }
23255    }
23256    }
23257    function_tests++;
23258
23259    return(test_ret);
23260}
23261
23262
23263static int
23264test_xmlSetBufferAllocationScheme(void) {
23265    int test_ret = 0;
23266
23267    int mem_base;
23268    xmlBufferAllocationScheme scheme; /* allocation method to use */
23269    int n_scheme;
23270
23271    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23272        mem_base = xmlMemBlocks();
23273        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23274
23275        xmlSetBufferAllocationScheme(scheme);
23276        call_tests++;
23277        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23278        xmlResetLastError();
23279        if (mem_base != xmlMemBlocks()) {
23280            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23281	           xmlMemBlocks() - mem_base);
23282	    test_ret++;
23283            printf(" %d", n_scheme);
23284            printf("\n");
23285        }
23286    }
23287    function_tests++;
23288
23289    return(test_ret);
23290}
23291
23292
23293static int
23294test_xmlSetCompressMode(void) {
23295    int test_ret = 0;
23296
23297    int mem_base;
23298    int mode; /* the compression ratio */
23299    int n_mode;
23300
23301    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23302        mem_base = xmlMemBlocks();
23303        mode = gen_int(n_mode, 0);
23304
23305        xmlSetCompressMode(mode);
23306        call_tests++;
23307        des_int(n_mode, mode, 0);
23308        xmlResetLastError();
23309        if (mem_base != xmlMemBlocks()) {
23310            printf("Leak of %d blocks found in xmlSetCompressMode",
23311	           xmlMemBlocks() - mem_base);
23312	    test_ret++;
23313            printf(" %d", n_mode);
23314            printf("\n");
23315        }
23316    }
23317    function_tests++;
23318
23319    return(test_ret);
23320}
23321
23322
23323static int
23324test_xmlSetDocCompressMode(void) {
23325    int test_ret = 0;
23326
23327    int mem_base;
23328    xmlDocPtr doc; /* the document */
23329    int n_doc;
23330    int mode; /* the compression ratio */
23331    int n_mode;
23332
23333    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23334    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23335        mem_base = xmlMemBlocks();
23336        doc = gen_xmlDocPtr(n_doc, 0);
23337        mode = gen_int(n_mode, 1);
23338
23339        xmlSetDocCompressMode(doc, mode);
23340        call_tests++;
23341        des_xmlDocPtr(n_doc, doc, 0);
23342        des_int(n_mode, mode, 1);
23343        xmlResetLastError();
23344        if (mem_base != xmlMemBlocks()) {
23345            printf("Leak of %d blocks found in xmlSetDocCompressMode",
23346	           xmlMemBlocks() - mem_base);
23347	    test_ret++;
23348            printf(" %d", n_doc);
23349            printf(" %d", n_mode);
23350            printf("\n");
23351        }
23352    }
23353    }
23354    function_tests++;
23355
23356    return(test_ret);
23357}
23358
23359
23360static int
23361test_xmlSetNs(void) {
23362    int test_ret = 0;
23363
23364    int mem_base;
23365    xmlNodePtr node; /* a node in the document */
23366    int n_node;
23367    xmlNsPtr ns; /* a namespace pointer */
23368    int n_ns;
23369
23370    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23371    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23372        mem_base = xmlMemBlocks();
23373        node = gen_xmlNodePtr(n_node, 0);
23374        ns = gen_xmlNsPtr(n_ns, 1);
23375
23376        xmlSetNs(node, ns);
23377        call_tests++;
23378        des_xmlNodePtr(n_node, node, 0);
23379        des_xmlNsPtr(n_ns, ns, 1);
23380        xmlResetLastError();
23381        if (mem_base != xmlMemBlocks()) {
23382            printf("Leak of %d blocks found in xmlSetNs",
23383	           xmlMemBlocks() - mem_base);
23384	    test_ret++;
23385            printf(" %d", n_node);
23386            printf(" %d", n_ns);
23387            printf("\n");
23388        }
23389    }
23390    }
23391    function_tests++;
23392
23393    return(test_ret);
23394}
23395
23396
23397static int
23398test_xmlSetNsProp(void) {
23399    int test_ret = 0;
23400
23401#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23402    int mem_base;
23403    xmlAttrPtr ret_val;
23404    xmlNodePtr node; /* the node */
23405    int n_node;
23406    xmlNsPtr ns; /* the namespace definition */
23407    int n_ns;
23408    xmlChar * name; /* the attribute name */
23409    int n_name;
23410    xmlChar * value; /* the attribute value */
23411    int n_value;
23412
23413    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23414    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23415    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23416    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23417        mem_base = xmlMemBlocks();
23418        node = gen_xmlNodePtr(n_node, 0);
23419        ns = gen_xmlNsPtr(n_ns, 1);
23420        name = gen_const_xmlChar_ptr(n_name, 2);
23421        value = gen_const_xmlChar_ptr(n_value, 3);
23422
23423        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23424        desret_xmlAttrPtr(ret_val);
23425        call_tests++;
23426        des_xmlNodePtr(n_node, node, 0);
23427        des_xmlNsPtr(n_ns, ns, 1);
23428        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23429        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23430        xmlResetLastError();
23431        if (mem_base != xmlMemBlocks()) {
23432            printf("Leak of %d blocks found in xmlSetNsProp",
23433	           xmlMemBlocks() - mem_base);
23434	    test_ret++;
23435            printf(" %d", n_node);
23436            printf(" %d", n_ns);
23437            printf(" %d", n_name);
23438            printf(" %d", n_value);
23439            printf("\n");
23440        }
23441    }
23442    }
23443    }
23444    }
23445    function_tests++;
23446#endif
23447
23448    return(test_ret);
23449}
23450
23451
23452static int
23453test_xmlSetProp(void) {
23454    int test_ret = 0;
23455
23456#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23457    int mem_base;
23458    xmlAttrPtr ret_val;
23459    xmlNodePtr node; /* the node */
23460    int n_node;
23461    xmlChar * name; /* the attribute name (a QName) */
23462    int n_name;
23463    xmlChar * value; /* the attribute value */
23464    int n_value;
23465
23466    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23467    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23468    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23469        mem_base = xmlMemBlocks();
23470        node = gen_xmlNodePtr(n_node, 0);
23471        name = gen_const_xmlChar_ptr(n_name, 1);
23472        value = gen_const_xmlChar_ptr(n_value, 2);
23473
23474        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23475        desret_xmlAttrPtr(ret_val);
23476        call_tests++;
23477        des_xmlNodePtr(n_node, node, 0);
23478        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23479        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23480        xmlResetLastError();
23481        if (mem_base != xmlMemBlocks()) {
23482            printf("Leak of %d blocks found in xmlSetProp",
23483	           xmlMemBlocks() - mem_base);
23484	    test_ret++;
23485            printf(" %d", n_node);
23486            printf(" %d", n_name);
23487            printf(" %d", n_value);
23488            printf("\n");
23489        }
23490    }
23491    }
23492    }
23493    function_tests++;
23494#endif
23495
23496    return(test_ret);
23497}
23498
23499
23500static int
23501test_xmlSplitQName2(void) {
23502    int test_ret = 0;
23503
23504    int mem_base;
23505    xmlChar * ret_val;
23506    xmlChar * name; /* the full QName */
23507    int n_name;
23508    xmlChar ** prefix; /* a xmlChar ** */
23509    int n_prefix;
23510
23511    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23512    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23513        mem_base = xmlMemBlocks();
23514        name = gen_const_xmlChar_ptr(n_name, 0);
23515        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23516
23517        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23518        desret_xmlChar_ptr(ret_val);
23519        call_tests++;
23520        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23521        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23522        xmlResetLastError();
23523        if (mem_base != xmlMemBlocks()) {
23524            printf("Leak of %d blocks found in xmlSplitQName2",
23525	           xmlMemBlocks() - mem_base);
23526	    test_ret++;
23527            printf(" %d", n_name);
23528            printf(" %d", n_prefix);
23529            printf("\n");
23530        }
23531    }
23532    }
23533    function_tests++;
23534
23535    return(test_ret);
23536}
23537
23538
23539static int
23540test_xmlSplitQName3(void) {
23541    int test_ret = 0;
23542
23543    int mem_base;
23544    const xmlChar * ret_val;
23545    xmlChar * name; /* the full QName */
23546    int n_name;
23547    int * len; /* an int * */
23548    int n_len;
23549
23550    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23551    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23552        mem_base = xmlMemBlocks();
23553        name = gen_const_xmlChar_ptr(n_name, 0);
23554        len = gen_int_ptr(n_len, 1);
23555
23556        ret_val = xmlSplitQName3((const xmlChar *)name, len);
23557        desret_const_xmlChar_ptr(ret_val);
23558        call_tests++;
23559        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23560        des_int_ptr(n_len, len, 1);
23561        xmlResetLastError();
23562        if (mem_base != xmlMemBlocks()) {
23563            printf("Leak of %d blocks found in xmlSplitQName3",
23564	           xmlMemBlocks() - mem_base);
23565	    test_ret++;
23566            printf(" %d", n_name);
23567            printf(" %d", n_len);
23568            printf("\n");
23569        }
23570    }
23571    }
23572    function_tests++;
23573
23574    return(test_ret);
23575}
23576
23577
23578static int
23579test_xmlStringGetNodeList(void) {
23580    int test_ret = 0;
23581
23582    int mem_base;
23583    xmlNodePtr ret_val;
23584    xmlDocPtr doc; /* the document */
23585    int n_doc;
23586    xmlChar * value; /* the value of the attribute */
23587    int n_value;
23588
23589    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23590    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23591        mem_base = xmlMemBlocks();
23592        doc = gen_xmlDocPtr(n_doc, 0);
23593        value = gen_const_xmlChar_ptr(n_value, 1);
23594
23595        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23596        desret_xmlNodePtr(ret_val);
23597        call_tests++;
23598        des_xmlDocPtr(n_doc, doc, 0);
23599        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23600        xmlResetLastError();
23601        if (mem_base != xmlMemBlocks()) {
23602            printf("Leak of %d blocks found in xmlStringGetNodeList",
23603	           xmlMemBlocks() - mem_base);
23604	    test_ret++;
23605            printf(" %d", n_doc);
23606            printf(" %d", n_value);
23607            printf("\n");
23608        }
23609    }
23610    }
23611    function_tests++;
23612
23613    return(test_ret);
23614}
23615
23616
23617static int
23618test_xmlStringLenGetNodeList(void) {
23619    int test_ret = 0;
23620
23621    int mem_base;
23622    xmlNodePtr ret_val;
23623    xmlDocPtr doc; /* the document */
23624    int n_doc;
23625    xmlChar * value; /* the value of the text */
23626    int n_value;
23627    int len; /* the length of the string value */
23628    int n_len;
23629
23630    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23631    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23632    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23633        mem_base = xmlMemBlocks();
23634        doc = gen_xmlDocPtr(n_doc, 0);
23635        value = gen_const_xmlChar_ptr(n_value, 1);
23636        len = gen_int(n_len, 2);
23637
23638        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23639        desret_xmlNodePtr(ret_val);
23640        call_tests++;
23641        des_xmlDocPtr(n_doc, doc, 0);
23642        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23643        des_int(n_len, len, 2);
23644        xmlResetLastError();
23645        if (mem_base != xmlMemBlocks()) {
23646            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23647	           xmlMemBlocks() - mem_base);
23648	    test_ret++;
23649            printf(" %d", n_doc);
23650            printf(" %d", n_value);
23651            printf(" %d", n_len);
23652            printf("\n");
23653        }
23654    }
23655    }
23656    }
23657    function_tests++;
23658
23659    return(test_ret);
23660}
23661
23662
23663static int
23664test_xmlTextConcat(void) {
23665    int test_ret = 0;
23666
23667    int mem_base;
23668    int ret_val;
23669    xmlNodePtr node; /* the node */
23670    int n_node;
23671    xmlChar * content; /* the content */
23672    int n_content;
23673    int len; /* @content length */
23674    int n_len;
23675
23676    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23677    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23678    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23679        mem_base = xmlMemBlocks();
23680        node = gen_xmlNodePtr(n_node, 0);
23681        content = gen_const_xmlChar_ptr(n_content, 1);
23682        len = gen_int(n_len, 2);
23683
23684        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23685        desret_int(ret_val);
23686        call_tests++;
23687        des_xmlNodePtr(n_node, node, 0);
23688        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23689        des_int(n_len, len, 2);
23690        xmlResetLastError();
23691        if (mem_base != xmlMemBlocks()) {
23692            printf("Leak of %d blocks found in xmlTextConcat",
23693	           xmlMemBlocks() - mem_base);
23694	    test_ret++;
23695            printf(" %d", n_node);
23696            printf(" %d", n_content);
23697            printf(" %d", n_len);
23698            printf("\n");
23699        }
23700    }
23701    }
23702    }
23703    function_tests++;
23704
23705    return(test_ret);
23706}
23707
23708
23709static int
23710test_xmlTextMerge(void) {
23711    int test_ret = 0;
23712
23713    int mem_base;
23714    xmlNodePtr ret_val;
23715    xmlNodePtr first; /* the first text node */
23716    int n_first;
23717    xmlNodePtr second; /* the second text node being merged */
23718    int n_second;
23719
23720    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23721    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23722        mem_base = xmlMemBlocks();
23723        first = gen_xmlNodePtr_in(n_first, 0);
23724        second = gen_xmlNodePtr_in(n_second, 1);
23725
23726        ret_val = xmlTextMerge(first, second);
23727        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23728              xmlUnlinkNode(second);
23729              xmlFreeNode(second) ; second = NULL ; }
23730        desret_xmlNodePtr(ret_val);
23731        call_tests++;
23732        des_xmlNodePtr_in(n_first, first, 0);
23733        des_xmlNodePtr_in(n_second, second, 1);
23734        xmlResetLastError();
23735        if (mem_base != xmlMemBlocks()) {
23736            printf("Leak of %d blocks found in xmlTextMerge",
23737	           xmlMemBlocks() - mem_base);
23738	    test_ret++;
23739            printf(" %d", n_first);
23740            printf(" %d", n_second);
23741            printf("\n");
23742        }
23743    }
23744    }
23745    function_tests++;
23746
23747    return(test_ret);
23748}
23749
23750
23751static int
23752test_xmlUnsetNsProp(void) {
23753    int test_ret = 0;
23754
23755#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23756    int mem_base;
23757    int ret_val;
23758    xmlNodePtr node; /* the node */
23759    int n_node;
23760    xmlNsPtr ns; /* the namespace definition */
23761    int n_ns;
23762    xmlChar * name; /* the attribute name */
23763    int n_name;
23764
23765    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23766    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23767    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23768        mem_base = xmlMemBlocks();
23769        node = gen_xmlNodePtr(n_node, 0);
23770        ns = gen_xmlNsPtr(n_ns, 1);
23771        name = gen_const_xmlChar_ptr(n_name, 2);
23772
23773        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23774        desret_int(ret_val);
23775        call_tests++;
23776        des_xmlNodePtr(n_node, node, 0);
23777        des_xmlNsPtr(n_ns, ns, 1);
23778        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23779        xmlResetLastError();
23780        if (mem_base != xmlMemBlocks()) {
23781            printf("Leak of %d blocks found in xmlUnsetNsProp",
23782	           xmlMemBlocks() - mem_base);
23783	    test_ret++;
23784            printf(" %d", n_node);
23785            printf(" %d", n_ns);
23786            printf(" %d", n_name);
23787            printf("\n");
23788        }
23789    }
23790    }
23791    }
23792    function_tests++;
23793#endif
23794
23795    return(test_ret);
23796}
23797
23798
23799static int
23800test_xmlUnsetProp(void) {
23801    int test_ret = 0;
23802
23803#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23804    int mem_base;
23805    int ret_val;
23806    xmlNodePtr node; /* the node */
23807    int n_node;
23808    xmlChar * name; /* the attribute name */
23809    int n_name;
23810
23811    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23812    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23813        mem_base = xmlMemBlocks();
23814        node = gen_xmlNodePtr(n_node, 0);
23815        name = gen_const_xmlChar_ptr(n_name, 1);
23816
23817        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23818        desret_int(ret_val);
23819        call_tests++;
23820        des_xmlNodePtr(n_node, node, 0);
23821        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23822        xmlResetLastError();
23823        if (mem_base != xmlMemBlocks()) {
23824            printf("Leak of %d blocks found in xmlUnsetProp",
23825	           xmlMemBlocks() - mem_base);
23826	    test_ret++;
23827            printf(" %d", n_node);
23828            printf(" %d", n_name);
23829            printf("\n");
23830        }
23831    }
23832    }
23833    function_tests++;
23834#endif
23835
23836    return(test_ret);
23837}
23838
23839
23840static int
23841test_xmlValidateNCName(void) {
23842    int test_ret = 0;
23843
23844#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)
23845#ifdef LIBXML_TREE_ENABLED
23846    int mem_base;
23847    int ret_val;
23848    xmlChar * value; /* the value to check */
23849    int n_value;
23850    int space; /* allow spaces in front and end of the string */
23851    int n_space;
23852
23853    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23854    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23855        mem_base = xmlMemBlocks();
23856        value = gen_const_xmlChar_ptr(n_value, 0);
23857        space = gen_int(n_space, 1);
23858
23859        ret_val = xmlValidateNCName((const xmlChar *)value, space);
23860        desret_int(ret_val);
23861        call_tests++;
23862        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23863        des_int(n_space, space, 1);
23864        xmlResetLastError();
23865        if (mem_base != xmlMemBlocks()) {
23866            printf("Leak of %d blocks found in xmlValidateNCName",
23867	           xmlMemBlocks() - mem_base);
23868	    test_ret++;
23869            printf(" %d", n_value);
23870            printf(" %d", n_space);
23871            printf("\n");
23872        }
23873    }
23874    }
23875    function_tests++;
23876#endif
23877#endif
23878
23879    return(test_ret);
23880}
23881
23882
23883static int
23884test_xmlValidateNMToken(void) {
23885    int test_ret = 0;
23886
23887#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23888#ifdef LIBXML_TREE_ENABLED
23889    int mem_base;
23890    int ret_val;
23891    xmlChar * value; /* the value to check */
23892    int n_value;
23893    int space; /* allow spaces in front and end of the string */
23894    int n_space;
23895
23896    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23897    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23898        mem_base = xmlMemBlocks();
23899        value = gen_const_xmlChar_ptr(n_value, 0);
23900        space = gen_int(n_space, 1);
23901
23902        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23903        desret_int(ret_val);
23904        call_tests++;
23905        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23906        des_int(n_space, space, 1);
23907        xmlResetLastError();
23908        if (mem_base != xmlMemBlocks()) {
23909            printf("Leak of %d blocks found in xmlValidateNMToken",
23910	           xmlMemBlocks() - mem_base);
23911	    test_ret++;
23912            printf(" %d", n_value);
23913            printf(" %d", n_space);
23914            printf("\n");
23915        }
23916    }
23917    }
23918    function_tests++;
23919#endif
23920#endif
23921
23922    return(test_ret);
23923}
23924
23925
23926static int
23927test_xmlValidateName(void) {
23928    int test_ret = 0;
23929
23930#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23931#ifdef LIBXML_TREE_ENABLED
23932    int mem_base;
23933    int ret_val;
23934    xmlChar * value; /* the value to check */
23935    int n_value;
23936    int space; /* allow spaces in front and end of the string */
23937    int n_space;
23938
23939    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23940    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23941        mem_base = xmlMemBlocks();
23942        value = gen_const_xmlChar_ptr(n_value, 0);
23943        space = gen_int(n_space, 1);
23944
23945        ret_val = xmlValidateName((const xmlChar *)value, space);
23946        desret_int(ret_val);
23947        call_tests++;
23948        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23949        des_int(n_space, space, 1);
23950        xmlResetLastError();
23951        if (mem_base != xmlMemBlocks()) {
23952            printf("Leak of %d blocks found in xmlValidateName",
23953	           xmlMemBlocks() - mem_base);
23954	    test_ret++;
23955            printf(" %d", n_value);
23956            printf(" %d", n_space);
23957            printf("\n");
23958        }
23959    }
23960    }
23961    function_tests++;
23962#endif
23963#endif
23964
23965    return(test_ret);
23966}
23967
23968
23969static int
23970test_xmlValidateQName(void) {
23971    int test_ret = 0;
23972
23973#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23974#ifdef LIBXML_TREE_ENABLED
23975    int mem_base;
23976    int ret_val;
23977    xmlChar * value; /* the value to check */
23978    int n_value;
23979    int space; /* allow spaces in front and end of the string */
23980    int n_space;
23981
23982    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23983    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23984        mem_base = xmlMemBlocks();
23985        value = gen_const_xmlChar_ptr(n_value, 0);
23986        space = gen_int(n_space, 1);
23987
23988        ret_val = xmlValidateQName((const xmlChar *)value, space);
23989        desret_int(ret_val);
23990        call_tests++;
23991        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23992        des_int(n_space, space, 1);
23993        xmlResetLastError();
23994        if (mem_base != xmlMemBlocks()) {
23995            printf("Leak of %d blocks found in xmlValidateQName",
23996	           xmlMemBlocks() - mem_base);
23997	    test_ret++;
23998            printf(" %d", n_value);
23999            printf(" %d", n_space);
24000            printf("\n");
24001        }
24002    }
24003    }
24004    function_tests++;
24005#endif
24006#endif
24007
24008    return(test_ret);
24009}
24010
24011static int
24012test_tree(void) {
24013    int test_ret = 0;
24014
24015    if (quiet == 0) printf("Testing tree : 138 of 157 functions ...\n");
24016    test_ret += test_xmlAddChild();
24017    test_ret += test_xmlAddChildList();
24018    test_ret += test_xmlAddNextSibling();
24019    test_ret += test_xmlAddPrevSibling();
24020    test_ret += test_xmlAddSibling();
24021    test_ret += test_xmlAttrSerializeTxtContent();
24022    test_ret += test_xmlBufferAdd();
24023    test_ret += test_xmlBufferAddHead();
24024    test_ret += test_xmlBufferCCat();
24025    test_ret += test_xmlBufferCat();
24026    test_ret += test_xmlBufferContent();
24027    test_ret += test_xmlBufferCreate();
24028    test_ret += test_xmlBufferCreateSize();
24029    test_ret += test_xmlBufferCreateStatic();
24030    test_ret += test_xmlBufferEmpty();
24031    test_ret += test_xmlBufferGrow();
24032    test_ret += test_xmlBufferLength();
24033    test_ret += test_xmlBufferResize();
24034    test_ret += test_xmlBufferSetAllocationScheme();
24035    test_ret += test_xmlBufferShrink();
24036    test_ret += test_xmlBufferWriteCHAR();
24037    test_ret += test_xmlBufferWriteChar();
24038    test_ret += test_xmlBufferWriteQuotedString();
24039    test_ret += test_xmlBuildQName();
24040    test_ret += test_xmlChildElementCount();
24041    test_ret += test_xmlCopyDoc();
24042    test_ret += test_xmlCopyDtd();
24043    test_ret += test_xmlCopyNamespace();
24044    test_ret += test_xmlCopyNamespaceList();
24045    test_ret += test_xmlCopyNode();
24046    test_ret += test_xmlCopyNodeList();
24047    test_ret += test_xmlCopyProp();
24048    test_ret += test_xmlCopyPropList();
24049    test_ret += test_xmlCreateIntSubset();
24050    test_ret += test_xmlDOMWrapAdoptNode();
24051    test_ret += test_xmlDOMWrapCloneNode();
24052    test_ret += test_xmlDOMWrapNewCtxt();
24053    test_ret += test_xmlDOMWrapReconcileNamespaces();
24054    test_ret += test_xmlDOMWrapRemoveNode();
24055    test_ret += test_xmlDocCopyNode();
24056    test_ret += test_xmlDocCopyNodeList();
24057    test_ret += test_xmlDocDump();
24058    test_ret += test_xmlDocDumpFormatMemory();
24059    test_ret += test_xmlDocDumpFormatMemoryEnc();
24060    test_ret += test_xmlDocDumpMemory();
24061    test_ret += test_xmlDocDumpMemoryEnc();
24062    test_ret += test_xmlDocFormatDump();
24063    test_ret += test_xmlDocGetRootElement();
24064    test_ret += test_xmlDocSetRootElement();
24065    test_ret += test_xmlElemDump();
24066    test_ret += test_xmlFirstElementChild();
24067    test_ret += test_xmlGetBufferAllocationScheme();
24068    test_ret += test_xmlGetCompressMode();
24069    test_ret += test_xmlGetDocCompressMode();
24070    test_ret += test_xmlGetIntSubset();
24071    test_ret += test_xmlGetLastChild();
24072    test_ret += test_xmlGetLineNo();
24073    test_ret += test_xmlGetNoNsProp();
24074    test_ret += test_xmlGetNodePath();
24075    test_ret += test_xmlGetNsList();
24076    test_ret += test_xmlGetNsProp();
24077    test_ret += test_xmlGetProp();
24078    test_ret += test_xmlHasNsProp();
24079    test_ret += test_xmlHasProp();
24080    test_ret += test_xmlIsBlankNode();
24081    test_ret += test_xmlIsXHTML();
24082    test_ret += test_xmlLastElementChild();
24083    test_ret += test_xmlNewCDataBlock();
24084    test_ret += test_xmlNewCharRef();
24085    test_ret += test_xmlNewChild();
24086    test_ret += test_xmlNewComment();
24087    test_ret += test_xmlNewDoc();
24088    test_ret += test_xmlNewDocComment();
24089    test_ret += test_xmlNewDocFragment();
24090    test_ret += test_xmlNewDocNode();
24091    test_ret += test_xmlNewDocNodeEatName();
24092    test_ret += test_xmlNewDocPI();
24093    test_ret += test_xmlNewDocProp();
24094    test_ret += test_xmlNewDocRawNode();
24095    test_ret += test_xmlNewDocText();
24096    test_ret += test_xmlNewDocTextLen();
24097    test_ret += test_xmlNewDtd();
24098    test_ret += test_xmlNewNode();
24099    test_ret += test_xmlNewNodeEatName();
24100    test_ret += test_xmlNewNs();
24101    test_ret += test_xmlNewNsProp();
24102    test_ret += test_xmlNewNsPropEatName();
24103    test_ret += test_xmlNewPI();
24104    test_ret += test_xmlNewProp();
24105    test_ret += test_xmlNewReference();
24106    test_ret += test_xmlNewText();
24107    test_ret += test_xmlNewTextChild();
24108    test_ret += test_xmlNewTextLen();
24109    test_ret += test_xmlNextElementSibling();
24110    test_ret += test_xmlNodeAddContent();
24111    test_ret += test_xmlNodeAddContentLen();
24112    test_ret += test_xmlNodeBufGetContent();
24113    test_ret += test_xmlNodeDump();
24114    test_ret += test_xmlNodeDumpOutput();
24115    test_ret += test_xmlNodeGetBase();
24116    test_ret += test_xmlNodeGetContent();
24117    test_ret += test_xmlNodeGetLang();
24118    test_ret += test_xmlNodeGetSpacePreserve();
24119    test_ret += test_xmlNodeIsText();
24120    test_ret += test_xmlNodeListGetRawString();
24121    test_ret += test_xmlNodeListGetString();
24122    test_ret += test_xmlNodeSetBase();
24123    test_ret += test_xmlNodeSetContent();
24124    test_ret += test_xmlNodeSetContentLen();
24125    test_ret += test_xmlNodeSetLang();
24126    test_ret += test_xmlNodeSetName();
24127    test_ret += test_xmlNodeSetSpacePreserve();
24128    test_ret += test_xmlPreviousElementSibling();
24129    test_ret += test_xmlReconciliateNs();
24130    test_ret += test_xmlRemoveProp();
24131    test_ret += test_xmlReplaceNode();
24132    test_ret += test_xmlSaveFile();
24133    test_ret += test_xmlSaveFileEnc();
24134    test_ret += test_xmlSaveFileTo();
24135    test_ret += test_xmlSaveFormatFile();
24136    test_ret += test_xmlSaveFormatFileEnc();
24137    test_ret += test_xmlSaveFormatFileTo();
24138    test_ret += test_xmlSearchNs();
24139    test_ret += test_xmlSearchNsByHref();
24140    test_ret += test_xmlSetBufferAllocationScheme();
24141    test_ret += test_xmlSetCompressMode();
24142    test_ret += test_xmlSetDocCompressMode();
24143    test_ret += test_xmlSetNs();
24144    test_ret += test_xmlSetNsProp();
24145    test_ret += test_xmlSetProp();
24146    test_ret += test_xmlSplitQName2();
24147    test_ret += test_xmlSplitQName3();
24148    test_ret += test_xmlStringGetNodeList();
24149    test_ret += test_xmlStringLenGetNodeList();
24150    test_ret += test_xmlTextConcat();
24151    test_ret += test_xmlTextMerge();
24152    test_ret += test_xmlUnsetNsProp();
24153    test_ret += test_xmlUnsetProp();
24154    test_ret += test_xmlValidateNCName();
24155    test_ret += test_xmlValidateNMToken();
24156    test_ret += test_xmlValidateName();
24157    test_ret += test_xmlValidateQName();
24158
24159    if (test_ret != 0)
24160	printf("Module tree: %d errors\n", test_ret);
24161    return(test_ret);
24162}
24163
24164static int
24165test_xmlBuildRelativeURI(void) {
24166    int test_ret = 0;
24167
24168    int mem_base;
24169    xmlChar * ret_val;
24170    xmlChar * URI; /* the URI reference under consideration */
24171    int n_URI;
24172    xmlChar * base; /* the base value */
24173    int n_base;
24174
24175    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24176    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24177        mem_base = xmlMemBlocks();
24178        URI = gen_const_xmlChar_ptr(n_URI, 0);
24179        base = gen_const_xmlChar_ptr(n_base, 1);
24180
24181        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24182        desret_xmlChar_ptr(ret_val);
24183        call_tests++;
24184        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24185        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24186        xmlResetLastError();
24187        if (mem_base != xmlMemBlocks()) {
24188            printf("Leak of %d blocks found in xmlBuildRelativeURI",
24189	           xmlMemBlocks() - mem_base);
24190	    test_ret++;
24191            printf(" %d", n_URI);
24192            printf(" %d", n_base);
24193            printf("\n");
24194        }
24195    }
24196    }
24197    function_tests++;
24198
24199    return(test_ret);
24200}
24201
24202
24203static int
24204test_xmlBuildURI(void) {
24205    int test_ret = 0;
24206
24207    int mem_base;
24208    xmlChar * ret_val;
24209    xmlChar * URI; /* the URI instance found in the document */
24210    int n_URI;
24211    xmlChar * base; /* the base value */
24212    int n_base;
24213
24214    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24215    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24216        mem_base = xmlMemBlocks();
24217        URI = gen_const_xmlChar_ptr(n_URI, 0);
24218        base = gen_const_xmlChar_ptr(n_base, 1);
24219
24220        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24221        desret_xmlChar_ptr(ret_val);
24222        call_tests++;
24223        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24224        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24225        xmlResetLastError();
24226        if (mem_base != xmlMemBlocks()) {
24227            printf("Leak of %d blocks found in xmlBuildURI",
24228	           xmlMemBlocks() - mem_base);
24229	    test_ret++;
24230            printf(" %d", n_URI);
24231            printf(" %d", n_base);
24232            printf("\n");
24233        }
24234    }
24235    }
24236    function_tests++;
24237
24238    return(test_ret);
24239}
24240
24241
24242static int
24243test_xmlCanonicPath(void) {
24244    int test_ret = 0;
24245
24246    int mem_base;
24247    xmlChar * ret_val;
24248    xmlChar * path; /* the resource locator in a filesystem notation */
24249    int n_path;
24250
24251    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24252        mem_base = xmlMemBlocks();
24253        path = gen_const_xmlChar_ptr(n_path, 0);
24254
24255        ret_val = xmlCanonicPath((const xmlChar *)path);
24256        desret_xmlChar_ptr(ret_val);
24257        call_tests++;
24258        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24259        xmlResetLastError();
24260        if (mem_base != xmlMemBlocks()) {
24261            printf("Leak of %d blocks found in xmlCanonicPath",
24262	           xmlMemBlocks() - mem_base);
24263	    test_ret++;
24264            printf(" %d", n_path);
24265            printf("\n");
24266        }
24267    }
24268    function_tests++;
24269
24270    return(test_ret);
24271}
24272
24273
24274static int
24275test_xmlCreateURI(void) {
24276    int test_ret = 0;
24277
24278
24279    /* missing type support */
24280    return(test_ret);
24281}
24282
24283
24284static int
24285test_xmlNormalizeURIPath(void) {
24286    int test_ret = 0;
24287
24288    int mem_base;
24289    int ret_val;
24290    char * path; /* pointer to the path string */
24291    int n_path;
24292
24293    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24294        mem_base = xmlMemBlocks();
24295        path = gen_char_ptr(n_path, 0);
24296
24297        ret_val = xmlNormalizeURIPath(path);
24298        desret_int(ret_val);
24299        call_tests++;
24300        des_char_ptr(n_path, path, 0);
24301        xmlResetLastError();
24302        if (mem_base != xmlMemBlocks()) {
24303            printf("Leak of %d blocks found in xmlNormalizeURIPath",
24304	           xmlMemBlocks() - mem_base);
24305	    test_ret++;
24306            printf(" %d", n_path);
24307            printf("\n");
24308        }
24309    }
24310    function_tests++;
24311
24312    return(test_ret);
24313}
24314
24315
24316static int
24317test_xmlParseURI(void) {
24318    int test_ret = 0;
24319
24320
24321    /* missing type support */
24322    return(test_ret);
24323}
24324
24325
24326static int
24327test_xmlParseURIRaw(void) {
24328    int test_ret = 0;
24329
24330
24331    /* missing type support */
24332    return(test_ret);
24333}
24334
24335
24336#define gen_nb_xmlURIPtr 1
24337static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24338    return(NULL);
24339}
24340static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24341}
24342
24343static int
24344test_xmlParseURIReference(void) {
24345    int test_ret = 0;
24346
24347    int mem_base;
24348    int ret_val;
24349    xmlURIPtr uri; /* pointer to an URI structure */
24350    int n_uri;
24351    char * str; /* the string to analyze */
24352    int n_str;
24353
24354    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24355    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24356        mem_base = xmlMemBlocks();
24357        uri = gen_xmlURIPtr(n_uri, 0);
24358        str = gen_const_char_ptr(n_str, 1);
24359
24360        ret_val = xmlParseURIReference(uri, (const char *)str);
24361        desret_int(ret_val);
24362        call_tests++;
24363        des_xmlURIPtr(n_uri, uri, 0);
24364        des_const_char_ptr(n_str, (const char *)str, 1);
24365        xmlResetLastError();
24366        if (mem_base != xmlMemBlocks()) {
24367            printf("Leak of %d blocks found in xmlParseURIReference",
24368	           xmlMemBlocks() - mem_base);
24369	    test_ret++;
24370            printf(" %d", n_uri);
24371            printf(" %d", n_str);
24372            printf("\n");
24373        }
24374    }
24375    }
24376    function_tests++;
24377
24378    return(test_ret);
24379}
24380
24381
24382static int
24383test_xmlPathToURI(void) {
24384    int test_ret = 0;
24385
24386    int mem_base;
24387    xmlChar * ret_val;
24388    xmlChar * path; /* the resource locator in a filesystem notation */
24389    int n_path;
24390
24391    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24392        mem_base = xmlMemBlocks();
24393        path = gen_const_xmlChar_ptr(n_path, 0);
24394
24395        ret_val = xmlPathToURI((const xmlChar *)path);
24396        desret_xmlChar_ptr(ret_val);
24397        call_tests++;
24398        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24399        xmlResetLastError();
24400        if (mem_base != xmlMemBlocks()) {
24401            printf("Leak of %d blocks found in xmlPathToURI",
24402	           xmlMemBlocks() - mem_base);
24403	    test_ret++;
24404            printf(" %d", n_path);
24405            printf("\n");
24406        }
24407    }
24408    function_tests++;
24409
24410    return(test_ret);
24411}
24412
24413
24414static int
24415test_xmlPrintURI(void) {
24416    int test_ret = 0;
24417
24418    int mem_base;
24419    FILE * stream; /* a FILE* for the output */
24420    int n_stream;
24421    xmlURIPtr uri; /* pointer to an xmlURI */
24422    int n_uri;
24423
24424    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24425    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24426        mem_base = xmlMemBlocks();
24427        stream = gen_FILE_ptr(n_stream, 0);
24428        uri = gen_xmlURIPtr(n_uri, 1);
24429
24430        xmlPrintURI(stream, uri);
24431        call_tests++;
24432        des_FILE_ptr(n_stream, stream, 0);
24433        des_xmlURIPtr(n_uri, uri, 1);
24434        xmlResetLastError();
24435        if (mem_base != xmlMemBlocks()) {
24436            printf("Leak of %d blocks found in xmlPrintURI",
24437	           xmlMemBlocks() - mem_base);
24438	    test_ret++;
24439            printf(" %d", n_stream);
24440            printf(" %d", n_uri);
24441            printf("\n");
24442        }
24443    }
24444    }
24445    function_tests++;
24446
24447    return(test_ret);
24448}
24449
24450
24451static int
24452test_xmlSaveUri(void) {
24453    int test_ret = 0;
24454
24455    int mem_base;
24456    xmlChar * ret_val;
24457    xmlURIPtr uri; /* pointer to an xmlURI */
24458    int n_uri;
24459
24460    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24461        mem_base = xmlMemBlocks();
24462        uri = gen_xmlURIPtr(n_uri, 0);
24463
24464        ret_val = xmlSaveUri(uri);
24465        desret_xmlChar_ptr(ret_val);
24466        call_tests++;
24467        des_xmlURIPtr(n_uri, uri, 0);
24468        xmlResetLastError();
24469        if (mem_base != xmlMemBlocks()) {
24470            printf("Leak of %d blocks found in xmlSaveUri",
24471	           xmlMemBlocks() - mem_base);
24472	    test_ret++;
24473            printf(" %d", n_uri);
24474            printf("\n");
24475        }
24476    }
24477    function_tests++;
24478
24479    return(test_ret);
24480}
24481
24482
24483static int
24484test_xmlURIEscape(void) {
24485    int test_ret = 0;
24486
24487    int mem_base;
24488    xmlChar * ret_val;
24489    xmlChar * str; /* the string of the URI to escape */
24490    int n_str;
24491
24492    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24493        mem_base = xmlMemBlocks();
24494        str = gen_const_xmlChar_ptr(n_str, 0);
24495
24496        ret_val = xmlURIEscape((const xmlChar *)str);
24497        desret_xmlChar_ptr(ret_val);
24498        call_tests++;
24499        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24500        xmlResetLastError();
24501        if (mem_base != xmlMemBlocks()) {
24502            printf("Leak of %d blocks found in xmlURIEscape",
24503	           xmlMemBlocks() - mem_base);
24504	    test_ret++;
24505            printf(" %d", n_str);
24506            printf("\n");
24507        }
24508    }
24509    function_tests++;
24510
24511    return(test_ret);
24512}
24513
24514
24515static int
24516test_xmlURIEscapeStr(void) {
24517    int test_ret = 0;
24518
24519    int mem_base;
24520    xmlChar * ret_val;
24521    xmlChar * str; /* string to escape */
24522    int n_str;
24523    xmlChar * list; /* exception list string of chars not to escape */
24524    int n_list;
24525
24526    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24527    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24528        mem_base = xmlMemBlocks();
24529        str = gen_const_xmlChar_ptr(n_str, 0);
24530        list = gen_const_xmlChar_ptr(n_list, 1);
24531
24532        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24533        desret_xmlChar_ptr(ret_val);
24534        call_tests++;
24535        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24536        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24537        xmlResetLastError();
24538        if (mem_base != xmlMemBlocks()) {
24539            printf("Leak of %d blocks found in xmlURIEscapeStr",
24540	           xmlMemBlocks() - mem_base);
24541	    test_ret++;
24542            printf(" %d", n_str);
24543            printf(" %d", n_list);
24544            printf("\n");
24545        }
24546    }
24547    }
24548    function_tests++;
24549
24550    return(test_ret);
24551}
24552
24553
24554static int
24555test_xmlURIUnescapeString(void) {
24556    int test_ret = 0;
24557
24558
24559    /* missing type support */
24560    return(test_ret);
24561}
24562
24563static int
24564test_uri(void) {
24565    int test_ret = 0;
24566
24567    if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24568    test_ret += test_xmlBuildRelativeURI();
24569    test_ret += test_xmlBuildURI();
24570    test_ret += test_xmlCanonicPath();
24571    test_ret += test_xmlCreateURI();
24572    test_ret += test_xmlNormalizeURIPath();
24573    test_ret += test_xmlParseURI();
24574    test_ret += test_xmlParseURIRaw();
24575    test_ret += test_xmlParseURIReference();
24576    test_ret += test_xmlPathToURI();
24577    test_ret += test_xmlPrintURI();
24578    test_ret += test_xmlSaveUri();
24579    test_ret += test_xmlURIEscape();
24580    test_ret += test_xmlURIEscapeStr();
24581    test_ret += test_xmlURIUnescapeString();
24582
24583    if (test_ret != 0)
24584	printf("Module uri: %d errors\n", test_ret);
24585    return(test_ret);
24586}
24587
24588static int
24589test_xmlAddAttributeDecl(void) {
24590    int test_ret = 0;
24591
24592    int mem_base;
24593    xmlAttributePtr ret_val;
24594    xmlValidCtxtPtr ctxt; /* the validation context */
24595    int n_ctxt;
24596    xmlDtdPtr dtd; /* pointer to the DTD */
24597    int n_dtd;
24598    xmlChar * elem; /* the element name */
24599    int n_elem;
24600    xmlChar * name; /* the attribute name */
24601    int n_name;
24602    xmlChar * ns; /* the attribute namespace prefix */
24603    int n_ns;
24604    xmlAttributeType type; /* the attribute type */
24605    int n_type;
24606    xmlAttributeDefault def; /* the attribute default type */
24607    int n_def;
24608    xmlChar * defaultValue; /* the attribute default value */
24609    int n_defaultValue;
24610    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24611    int n_tree;
24612
24613    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24614    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24615    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24616    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24617    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24618    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24619    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24620    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24621    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24622        mem_base = xmlMemBlocks();
24623        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24624        dtd = gen_xmlDtdPtr(n_dtd, 1);
24625        elem = gen_const_xmlChar_ptr(n_elem, 2);
24626        name = gen_const_xmlChar_ptr(n_name, 3);
24627        ns = gen_const_xmlChar_ptr(n_ns, 4);
24628        type = gen_xmlAttributeType(n_type, 5);
24629        def = gen_xmlAttributeDefault(n_def, 6);
24630        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24631        tree = gen_xmlEnumerationPtr(n_tree, 8);
24632
24633        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24634        desret_xmlAttributePtr(ret_val);
24635        call_tests++;
24636        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24637        des_xmlDtdPtr(n_dtd, dtd, 1);
24638        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24639        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24640        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24641        des_xmlAttributeType(n_type, type, 5);
24642        des_xmlAttributeDefault(n_def, def, 6);
24643        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24644        des_xmlEnumerationPtr(n_tree, tree, 8);
24645        xmlResetLastError();
24646        if (mem_base != xmlMemBlocks()) {
24647            printf("Leak of %d blocks found in xmlAddAttributeDecl",
24648	           xmlMemBlocks() - mem_base);
24649	    test_ret++;
24650            printf(" %d", n_ctxt);
24651            printf(" %d", n_dtd);
24652            printf(" %d", n_elem);
24653            printf(" %d", n_name);
24654            printf(" %d", n_ns);
24655            printf(" %d", n_type);
24656            printf(" %d", n_def);
24657            printf(" %d", n_defaultValue);
24658            printf(" %d", n_tree);
24659            printf("\n");
24660        }
24661    }
24662    }
24663    }
24664    }
24665    }
24666    }
24667    }
24668    }
24669    }
24670    function_tests++;
24671
24672    return(test_ret);
24673}
24674
24675
24676static int
24677test_xmlAddElementDecl(void) {
24678    int test_ret = 0;
24679
24680    int mem_base;
24681    xmlElementPtr ret_val;
24682    xmlValidCtxtPtr ctxt; /* the validation context */
24683    int n_ctxt;
24684    xmlDtdPtr dtd; /* pointer to the DTD */
24685    int n_dtd;
24686    xmlChar * name; /* the entity name */
24687    int n_name;
24688    xmlElementTypeVal type; /* the element type */
24689    int n_type;
24690    xmlElementContentPtr content; /* the element content tree or NULL */
24691    int n_content;
24692
24693    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24694    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24695    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24696    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24697    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24698        mem_base = xmlMemBlocks();
24699        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24700        dtd = gen_xmlDtdPtr(n_dtd, 1);
24701        name = gen_const_xmlChar_ptr(n_name, 2);
24702        type = gen_xmlElementTypeVal(n_type, 3);
24703        content = gen_xmlElementContentPtr(n_content, 4);
24704
24705        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24706        desret_xmlElementPtr(ret_val);
24707        call_tests++;
24708        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24709        des_xmlDtdPtr(n_dtd, dtd, 1);
24710        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24711        des_xmlElementTypeVal(n_type, type, 3);
24712        des_xmlElementContentPtr(n_content, content, 4);
24713        xmlResetLastError();
24714        if (mem_base != xmlMemBlocks()) {
24715            printf("Leak of %d blocks found in xmlAddElementDecl",
24716	           xmlMemBlocks() - mem_base);
24717	    test_ret++;
24718            printf(" %d", n_ctxt);
24719            printf(" %d", n_dtd);
24720            printf(" %d", n_name);
24721            printf(" %d", n_type);
24722            printf(" %d", n_content);
24723            printf("\n");
24724        }
24725    }
24726    }
24727    }
24728    }
24729    }
24730    function_tests++;
24731
24732    return(test_ret);
24733}
24734
24735
24736static int
24737test_xmlAddID(void) {
24738    int test_ret = 0;
24739
24740
24741    /* missing type support */
24742    return(test_ret);
24743}
24744
24745
24746static int
24747test_xmlAddNotationDecl(void) {
24748    int test_ret = 0;
24749
24750
24751    /* missing type support */
24752    return(test_ret);
24753}
24754
24755
24756static int
24757test_xmlAddRef(void) {
24758    int test_ret = 0;
24759
24760
24761    /* missing type support */
24762    return(test_ret);
24763}
24764
24765
24766#define gen_nb_xmlAttributeTablePtr 1
24767static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24768    return(NULL);
24769}
24770static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24771}
24772
24773static int
24774test_xmlCopyAttributeTable(void) {
24775    int test_ret = 0;
24776
24777
24778    /* missing type support */
24779    return(test_ret);
24780}
24781
24782
24783static int
24784test_xmlCopyDocElementContent(void) {
24785    int test_ret = 0;
24786
24787    int mem_base;
24788    xmlElementContentPtr ret_val;
24789    xmlDocPtr doc; /* the document owning the element declaration */
24790    int n_doc;
24791    xmlElementContentPtr cur; /* An element content pointer. */
24792    int n_cur;
24793
24794    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24795    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24796        mem_base = xmlMemBlocks();
24797        doc = gen_xmlDocPtr(n_doc, 0);
24798        cur = gen_xmlElementContentPtr(n_cur, 1);
24799
24800        ret_val = xmlCopyDocElementContent(doc, cur);
24801        desret_xmlElementContentPtr(ret_val);
24802        call_tests++;
24803        des_xmlDocPtr(n_doc, doc, 0);
24804        des_xmlElementContentPtr(n_cur, cur, 1);
24805        xmlResetLastError();
24806        if (mem_base != xmlMemBlocks()) {
24807            printf("Leak of %d blocks found in xmlCopyDocElementContent",
24808	           xmlMemBlocks() - mem_base);
24809	    test_ret++;
24810            printf(" %d", n_doc);
24811            printf(" %d", n_cur);
24812            printf("\n");
24813        }
24814    }
24815    }
24816    function_tests++;
24817
24818    return(test_ret);
24819}
24820
24821
24822static int
24823test_xmlCopyElementContent(void) {
24824    int test_ret = 0;
24825
24826    int mem_base;
24827    xmlElementContentPtr ret_val;
24828    xmlElementContentPtr cur; /* An element content pointer. */
24829    int n_cur;
24830
24831    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24832        mem_base = xmlMemBlocks();
24833        cur = gen_xmlElementContentPtr(n_cur, 0);
24834
24835        ret_val = xmlCopyElementContent(cur);
24836        desret_xmlElementContentPtr(ret_val);
24837        call_tests++;
24838        des_xmlElementContentPtr(n_cur, cur, 0);
24839        xmlResetLastError();
24840        if (mem_base != xmlMemBlocks()) {
24841            printf("Leak of %d blocks found in xmlCopyElementContent",
24842	           xmlMemBlocks() - mem_base);
24843	    test_ret++;
24844            printf(" %d", n_cur);
24845            printf("\n");
24846        }
24847    }
24848    function_tests++;
24849
24850    return(test_ret);
24851}
24852
24853
24854#define gen_nb_xmlElementTablePtr 1
24855static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24856    return(NULL);
24857}
24858static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24859}
24860
24861static int
24862test_xmlCopyElementTable(void) {
24863    int test_ret = 0;
24864
24865
24866    /* missing type support */
24867    return(test_ret);
24868}
24869
24870
24871static int
24872test_xmlCopyEnumeration(void) {
24873    int test_ret = 0;
24874
24875
24876    /* missing type support */
24877    return(test_ret);
24878}
24879
24880
24881#define gen_nb_xmlNotationTablePtr 1
24882static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24883    return(NULL);
24884}
24885static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24886}
24887
24888static int
24889test_xmlCopyNotationTable(void) {
24890    int test_ret = 0;
24891
24892
24893    /* missing type support */
24894    return(test_ret);
24895}
24896
24897
24898static int
24899test_xmlCreateEnumeration(void) {
24900    int test_ret = 0;
24901
24902
24903    /* missing type support */
24904    return(test_ret);
24905}
24906
24907
24908#define gen_nb_xmlAttributePtr 1
24909static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24910    return(NULL);
24911}
24912static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24913}
24914
24915static int
24916test_xmlDumpAttributeDecl(void) {
24917    int test_ret = 0;
24918
24919#if defined(LIBXML_OUTPUT_ENABLED)
24920    int mem_base;
24921    xmlBufferPtr buf; /* the XML buffer output */
24922    int n_buf;
24923    xmlAttributePtr attr; /* An attribute declaration */
24924    int n_attr;
24925
24926    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24927    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24928        mem_base = xmlMemBlocks();
24929        buf = gen_xmlBufferPtr(n_buf, 0);
24930        attr = gen_xmlAttributePtr(n_attr, 1);
24931
24932        xmlDumpAttributeDecl(buf, attr);
24933        call_tests++;
24934        des_xmlBufferPtr(n_buf, buf, 0);
24935        des_xmlAttributePtr(n_attr, attr, 1);
24936        xmlResetLastError();
24937        if (mem_base != xmlMemBlocks()) {
24938            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24939	           xmlMemBlocks() - mem_base);
24940	    test_ret++;
24941            printf(" %d", n_buf);
24942            printf(" %d", n_attr);
24943            printf("\n");
24944        }
24945    }
24946    }
24947    function_tests++;
24948#endif
24949
24950    return(test_ret);
24951}
24952
24953
24954static int
24955test_xmlDumpAttributeTable(void) {
24956    int test_ret = 0;
24957
24958#if defined(LIBXML_OUTPUT_ENABLED)
24959    int mem_base;
24960    xmlBufferPtr buf; /* the XML buffer output */
24961    int n_buf;
24962    xmlAttributeTablePtr table; /* An attribute table */
24963    int n_table;
24964
24965    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24966    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24967        mem_base = xmlMemBlocks();
24968        buf = gen_xmlBufferPtr(n_buf, 0);
24969        table = gen_xmlAttributeTablePtr(n_table, 1);
24970
24971        xmlDumpAttributeTable(buf, table);
24972        call_tests++;
24973        des_xmlBufferPtr(n_buf, buf, 0);
24974        des_xmlAttributeTablePtr(n_table, table, 1);
24975        xmlResetLastError();
24976        if (mem_base != xmlMemBlocks()) {
24977            printf("Leak of %d blocks found in xmlDumpAttributeTable",
24978	           xmlMemBlocks() - mem_base);
24979	    test_ret++;
24980            printf(" %d", n_buf);
24981            printf(" %d", n_table);
24982            printf("\n");
24983        }
24984    }
24985    }
24986    function_tests++;
24987#endif
24988
24989    return(test_ret);
24990}
24991
24992
24993#define gen_nb_xmlElementPtr 1
24994static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24995    return(NULL);
24996}
24997static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24998}
24999
25000static int
25001test_xmlDumpElementDecl(void) {
25002    int test_ret = 0;
25003
25004#if defined(LIBXML_OUTPUT_ENABLED)
25005    int mem_base;
25006    xmlBufferPtr buf; /* the XML buffer output */
25007    int n_buf;
25008    xmlElementPtr elem; /* An element table */
25009    int n_elem;
25010
25011    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25012    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25013        mem_base = xmlMemBlocks();
25014        buf = gen_xmlBufferPtr(n_buf, 0);
25015        elem = gen_xmlElementPtr(n_elem, 1);
25016
25017        xmlDumpElementDecl(buf, elem);
25018        call_tests++;
25019        des_xmlBufferPtr(n_buf, buf, 0);
25020        des_xmlElementPtr(n_elem, elem, 1);
25021        xmlResetLastError();
25022        if (mem_base != xmlMemBlocks()) {
25023            printf("Leak of %d blocks found in xmlDumpElementDecl",
25024	           xmlMemBlocks() - mem_base);
25025	    test_ret++;
25026            printf(" %d", n_buf);
25027            printf(" %d", n_elem);
25028            printf("\n");
25029        }
25030    }
25031    }
25032    function_tests++;
25033#endif
25034
25035    return(test_ret);
25036}
25037
25038
25039static int
25040test_xmlDumpElementTable(void) {
25041    int test_ret = 0;
25042
25043#if defined(LIBXML_OUTPUT_ENABLED)
25044    int mem_base;
25045    xmlBufferPtr buf; /* the XML buffer output */
25046    int n_buf;
25047    xmlElementTablePtr table; /* An element table */
25048    int n_table;
25049
25050    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25051    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
25052        mem_base = xmlMemBlocks();
25053        buf = gen_xmlBufferPtr(n_buf, 0);
25054        table = gen_xmlElementTablePtr(n_table, 1);
25055
25056        xmlDumpElementTable(buf, table);
25057        call_tests++;
25058        des_xmlBufferPtr(n_buf, buf, 0);
25059        des_xmlElementTablePtr(n_table, table, 1);
25060        xmlResetLastError();
25061        if (mem_base != xmlMemBlocks()) {
25062            printf("Leak of %d blocks found in xmlDumpElementTable",
25063	           xmlMemBlocks() - mem_base);
25064	    test_ret++;
25065            printf(" %d", n_buf);
25066            printf(" %d", n_table);
25067            printf("\n");
25068        }
25069    }
25070    }
25071    function_tests++;
25072#endif
25073
25074    return(test_ret);
25075}
25076
25077
25078#define gen_nb_xmlNotationPtr 1
25079static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25080    return(NULL);
25081}
25082static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25083}
25084
25085static int
25086test_xmlDumpNotationDecl(void) {
25087    int test_ret = 0;
25088
25089#if defined(LIBXML_OUTPUT_ENABLED)
25090    int mem_base;
25091    xmlBufferPtr buf; /* the XML buffer output */
25092    int n_buf;
25093    xmlNotationPtr nota; /* A notation declaration */
25094    int n_nota;
25095
25096    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25097    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
25098        mem_base = xmlMemBlocks();
25099        buf = gen_xmlBufferPtr(n_buf, 0);
25100        nota = gen_xmlNotationPtr(n_nota, 1);
25101
25102        xmlDumpNotationDecl(buf, nota);
25103        call_tests++;
25104        des_xmlBufferPtr(n_buf, buf, 0);
25105        des_xmlNotationPtr(n_nota, nota, 1);
25106        xmlResetLastError();
25107        if (mem_base != xmlMemBlocks()) {
25108            printf("Leak of %d blocks found in xmlDumpNotationDecl",
25109	           xmlMemBlocks() - mem_base);
25110	    test_ret++;
25111            printf(" %d", n_buf);
25112            printf(" %d", n_nota);
25113            printf("\n");
25114        }
25115    }
25116    }
25117    function_tests++;
25118#endif
25119
25120    return(test_ret);
25121}
25122
25123
25124static int
25125test_xmlDumpNotationTable(void) {
25126    int test_ret = 0;
25127
25128#if defined(LIBXML_OUTPUT_ENABLED)
25129    int mem_base;
25130    xmlBufferPtr buf; /* the XML buffer output */
25131    int n_buf;
25132    xmlNotationTablePtr table; /* A notation table */
25133    int n_table;
25134
25135    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
25136    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
25137        mem_base = xmlMemBlocks();
25138        buf = gen_xmlBufferPtr(n_buf, 0);
25139        table = gen_xmlNotationTablePtr(n_table, 1);
25140
25141        xmlDumpNotationTable(buf, table);
25142        call_tests++;
25143        des_xmlBufferPtr(n_buf, buf, 0);
25144        des_xmlNotationTablePtr(n_table, table, 1);
25145        xmlResetLastError();
25146        if (mem_base != xmlMemBlocks()) {
25147            printf("Leak of %d blocks found in xmlDumpNotationTable",
25148	           xmlMemBlocks() - mem_base);
25149	    test_ret++;
25150            printf(" %d", n_buf);
25151            printf(" %d", n_table);
25152            printf("\n");
25153        }
25154    }
25155    }
25156    function_tests++;
25157#endif
25158
25159    return(test_ret);
25160}
25161
25162
25163static int
25164test_xmlGetDtdAttrDesc(void) {
25165    int test_ret = 0;
25166
25167    int mem_base;
25168    xmlAttributePtr ret_val;
25169    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25170    int n_dtd;
25171    xmlChar * elem; /* the element name */
25172    int n_elem;
25173    xmlChar * name; /* the attribute name */
25174    int n_name;
25175
25176    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25177    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25178    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25179        mem_base = xmlMemBlocks();
25180        dtd = gen_xmlDtdPtr(n_dtd, 0);
25181        elem = gen_const_xmlChar_ptr(n_elem, 1);
25182        name = gen_const_xmlChar_ptr(n_name, 2);
25183
25184        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25185        desret_xmlAttributePtr(ret_val);
25186        call_tests++;
25187        des_xmlDtdPtr(n_dtd, dtd, 0);
25188        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25189        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25190        xmlResetLastError();
25191        if (mem_base != xmlMemBlocks()) {
25192            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25193	           xmlMemBlocks() - mem_base);
25194	    test_ret++;
25195            printf(" %d", n_dtd);
25196            printf(" %d", n_elem);
25197            printf(" %d", n_name);
25198            printf("\n");
25199        }
25200    }
25201    }
25202    }
25203    function_tests++;
25204
25205    return(test_ret);
25206}
25207
25208
25209static int
25210test_xmlGetDtdElementDesc(void) {
25211    int test_ret = 0;
25212
25213    int mem_base;
25214    xmlElementPtr ret_val;
25215    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25216    int n_dtd;
25217    xmlChar * name; /* the element name */
25218    int n_name;
25219
25220    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25221    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25222        mem_base = xmlMemBlocks();
25223        dtd = gen_xmlDtdPtr(n_dtd, 0);
25224        name = gen_const_xmlChar_ptr(n_name, 1);
25225
25226        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25227        desret_xmlElementPtr(ret_val);
25228        call_tests++;
25229        des_xmlDtdPtr(n_dtd, dtd, 0);
25230        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25231        xmlResetLastError();
25232        if (mem_base != xmlMemBlocks()) {
25233            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25234	           xmlMemBlocks() - mem_base);
25235	    test_ret++;
25236            printf(" %d", n_dtd);
25237            printf(" %d", n_name);
25238            printf("\n");
25239        }
25240    }
25241    }
25242    function_tests++;
25243
25244    return(test_ret);
25245}
25246
25247
25248static int
25249test_xmlGetDtdNotationDesc(void) {
25250    int test_ret = 0;
25251
25252
25253    /* missing type support */
25254    return(test_ret);
25255}
25256
25257
25258static int
25259test_xmlGetDtdQAttrDesc(void) {
25260    int test_ret = 0;
25261
25262    int mem_base;
25263    xmlAttributePtr ret_val;
25264    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25265    int n_dtd;
25266    xmlChar * elem; /* the element name */
25267    int n_elem;
25268    xmlChar * name; /* the attribute name */
25269    int n_name;
25270    xmlChar * prefix; /* the attribute namespace prefix */
25271    int n_prefix;
25272
25273    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25274    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25275    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25276    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25277        mem_base = xmlMemBlocks();
25278        dtd = gen_xmlDtdPtr(n_dtd, 0);
25279        elem = gen_const_xmlChar_ptr(n_elem, 1);
25280        name = gen_const_xmlChar_ptr(n_name, 2);
25281        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25282
25283        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25284        desret_xmlAttributePtr(ret_val);
25285        call_tests++;
25286        des_xmlDtdPtr(n_dtd, dtd, 0);
25287        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25288        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25289        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25290        xmlResetLastError();
25291        if (mem_base != xmlMemBlocks()) {
25292            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25293	           xmlMemBlocks() - mem_base);
25294	    test_ret++;
25295            printf(" %d", n_dtd);
25296            printf(" %d", n_elem);
25297            printf(" %d", n_name);
25298            printf(" %d", n_prefix);
25299            printf("\n");
25300        }
25301    }
25302    }
25303    }
25304    }
25305    function_tests++;
25306
25307    return(test_ret);
25308}
25309
25310
25311static int
25312test_xmlGetDtdQElementDesc(void) {
25313    int test_ret = 0;
25314
25315    int mem_base;
25316    xmlElementPtr ret_val;
25317    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25318    int n_dtd;
25319    xmlChar * name; /* the element name */
25320    int n_name;
25321    xmlChar * prefix; /* the element namespace prefix */
25322    int n_prefix;
25323
25324    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25325    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25326    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25327        mem_base = xmlMemBlocks();
25328        dtd = gen_xmlDtdPtr(n_dtd, 0);
25329        name = gen_const_xmlChar_ptr(n_name, 1);
25330        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25331
25332        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25333        desret_xmlElementPtr(ret_val);
25334        call_tests++;
25335        des_xmlDtdPtr(n_dtd, dtd, 0);
25336        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25337        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25338        xmlResetLastError();
25339        if (mem_base != xmlMemBlocks()) {
25340            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25341	           xmlMemBlocks() - mem_base);
25342	    test_ret++;
25343            printf(" %d", n_dtd);
25344            printf(" %d", n_name);
25345            printf(" %d", n_prefix);
25346            printf("\n");
25347        }
25348    }
25349    }
25350    }
25351    function_tests++;
25352
25353    return(test_ret);
25354}
25355
25356
25357static int
25358test_xmlGetID(void) {
25359    int test_ret = 0;
25360
25361    int mem_base;
25362    xmlAttrPtr ret_val;
25363    xmlDocPtr doc; /* pointer to the document */
25364    int n_doc;
25365    xmlChar * ID; /* the ID value */
25366    int n_ID;
25367
25368    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25369    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25370        mem_base = xmlMemBlocks();
25371        doc = gen_xmlDocPtr(n_doc, 0);
25372        ID = gen_const_xmlChar_ptr(n_ID, 1);
25373
25374        ret_val = xmlGetID(doc, (const xmlChar *)ID);
25375        desret_xmlAttrPtr(ret_val);
25376        call_tests++;
25377        des_xmlDocPtr(n_doc, doc, 0);
25378        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25379        xmlResetLastError();
25380        if (mem_base != xmlMemBlocks()) {
25381            printf("Leak of %d blocks found in xmlGetID",
25382	           xmlMemBlocks() - mem_base);
25383	    test_ret++;
25384            printf(" %d", n_doc);
25385            printf(" %d", n_ID);
25386            printf("\n");
25387        }
25388    }
25389    }
25390    function_tests++;
25391
25392    return(test_ret);
25393}
25394
25395
25396static int
25397test_xmlGetRefs(void) {
25398    int test_ret = 0;
25399
25400
25401    /* missing type support */
25402    return(test_ret);
25403}
25404
25405
25406static int
25407test_xmlIsID(void) {
25408    int test_ret = 0;
25409
25410    int mem_base;
25411    int ret_val;
25412    xmlDocPtr doc; /* the document */
25413    int n_doc;
25414    xmlNodePtr elem; /* the element carrying the attribute */
25415    int n_elem;
25416    xmlAttrPtr attr; /* the attribute */
25417    int n_attr;
25418
25419    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25420    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25421    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25422        mem_base = xmlMemBlocks();
25423        doc = gen_xmlDocPtr(n_doc, 0);
25424        elem = gen_xmlNodePtr(n_elem, 1);
25425        attr = gen_xmlAttrPtr(n_attr, 2);
25426
25427        ret_val = xmlIsID(doc, elem, attr);
25428        desret_int(ret_val);
25429        call_tests++;
25430        des_xmlDocPtr(n_doc, doc, 0);
25431        des_xmlNodePtr(n_elem, elem, 1);
25432        des_xmlAttrPtr(n_attr, attr, 2);
25433        xmlResetLastError();
25434        if (mem_base != xmlMemBlocks()) {
25435            printf("Leak of %d blocks found in xmlIsID",
25436	           xmlMemBlocks() - mem_base);
25437	    test_ret++;
25438            printf(" %d", n_doc);
25439            printf(" %d", n_elem);
25440            printf(" %d", n_attr);
25441            printf("\n");
25442        }
25443    }
25444    }
25445    }
25446    function_tests++;
25447
25448    return(test_ret);
25449}
25450
25451
25452static int
25453test_xmlIsMixedElement(void) {
25454    int test_ret = 0;
25455
25456    int mem_base;
25457    int ret_val;
25458    xmlDocPtr doc; /* the document */
25459    int n_doc;
25460    xmlChar * name; /* the element name */
25461    int n_name;
25462
25463    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25464    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25465        mem_base = xmlMemBlocks();
25466        doc = gen_xmlDocPtr(n_doc, 0);
25467        name = gen_const_xmlChar_ptr(n_name, 1);
25468
25469        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25470        desret_int(ret_val);
25471        call_tests++;
25472        des_xmlDocPtr(n_doc, doc, 0);
25473        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25474        xmlResetLastError();
25475        if (mem_base != xmlMemBlocks()) {
25476            printf("Leak of %d blocks found in xmlIsMixedElement",
25477	           xmlMemBlocks() - mem_base);
25478	    test_ret++;
25479            printf(" %d", n_doc);
25480            printf(" %d", n_name);
25481            printf("\n");
25482        }
25483    }
25484    }
25485    function_tests++;
25486
25487    return(test_ret);
25488}
25489
25490
25491static int
25492test_xmlIsRef(void) {
25493    int test_ret = 0;
25494
25495    int mem_base;
25496    int ret_val;
25497    xmlDocPtr doc; /* the document */
25498    int n_doc;
25499    xmlNodePtr elem; /* the element carrying the attribute */
25500    int n_elem;
25501    xmlAttrPtr attr; /* the attribute */
25502    int n_attr;
25503
25504    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25505    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25506    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25507        mem_base = xmlMemBlocks();
25508        doc = gen_xmlDocPtr(n_doc, 0);
25509        elem = gen_xmlNodePtr(n_elem, 1);
25510        attr = gen_xmlAttrPtr(n_attr, 2);
25511
25512        ret_val = xmlIsRef(doc, elem, attr);
25513        desret_int(ret_val);
25514        call_tests++;
25515        des_xmlDocPtr(n_doc, doc, 0);
25516        des_xmlNodePtr(n_elem, elem, 1);
25517        des_xmlAttrPtr(n_attr, attr, 2);
25518        xmlResetLastError();
25519        if (mem_base != xmlMemBlocks()) {
25520            printf("Leak of %d blocks found in xmlIsRef",
25521	           xmlMemBlocks() - mem_base);
25522	    test_ret++;
25523            printf(" %d", n_doc);
25524            printf(" %d", n_elem);
25525            printf(" %d", n_attr);
25526            printf("\n");
25527        }
25528    }
25529    }
25530    }
25531    function_tests++;
25532
25533    return(test_ret);
25534}
25535
25536
25537static int
25538test_xmlNewDocElementContent(void) {
25539    int test_ret = 0;
25540
25541    int mem_base;
25542    xmlElementContentPtr ret_val;
25543    xmlDocPtr doc; /* the document */
25544    int n_doc;
25545    xmlChar * name; /* the subelement name or NULL */
25546    int n_name;
25547    xmlElementContentType type; /* the type of element content decl */
25548    int n_type;
25549
25550    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25551    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25552    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25553        mem_base = xmlMemBlocks();
25554        doc = gen_xmlDocPtr(n_doc, 0);
25555        name = gen_const_xmlChar_ptr(n_name, 1);
25556        type = gen_xmlElementContentType(n_type, 2);
25557
25558        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25559        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25560        desret_xmlElementContentPtr(ret_val);
25561        call_tests++;
25562        des_xmlDocPtr(n_doc, doc, 0);
25563        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25564        des_xmlElementContentType(n_type, type, 2);
25565        xmlResetLastError();
25566        if (mem_base != xmlMemBlocks()) {
25567            printf("Leak of %d blocks found in xmlNewDocElementContent",
25568	           xmlMemBlocks() - mem_base);
25569	    test_ret++;
25570            printf(" %d", n_doc);
25571            printf(" %d", n_name);
25572            printf(" %d", n_type);
25573            printf("\n");
25574        }
25575    }
25576    }
25577    }
25578    function_tests++;
25579
25580    return(test_ret);
25581}
25582
25583
25584static int
25585test_xmlNewElementContent(void) {
25586    int test_ret = 0;
25587
25588    int mem_base;
25589    xmlElementContentPtr ret_val;
25590    xmlChar * name; /* the subelement name or NULL */
25591    int n_name;
25592    xmlElementContentType type; /* the type of element content decl */
25593    int n_type;
25594
25595    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25596    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25597        mem_base = xmlMemBlocks();
25598        name = gen_const_xmlChar_ptr(n_name, 0);
25599        type = gen_xmlElementContentType(n_type, 1);
25600
25601        ret_val = xmlNewElementContent((const xmlChar *)name, type);
25602        desret_xmlElementContentPtr(ret_val);
25603        call_tests++;
25604        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25605        des_xmlElementContentType(n_type, type, 1);
25606        xmlResetLastError();
25607        if (mem_base != xmlMemBlocks()) {
25608            printf("Leak of %d blocks found in xmlNewElementContent",
25609	           xmlMemBlocks() - mem_base);
25610	    test_ret++;
25611            printf(" %d", n_name);
25612            printf(" %d", n_type);
25613            printf("\n");
25614        }
25615    }
25616    }
25617    function_tests++;
25618
25619    return(test_ret);
25620}
25621
25622
25623static int
25624test_xmlNewValidCtxt(void) {
25625    int test_ret = 0;
25626
25627
25628    /* missing type support */
25629    return(test_ret);
25630}
25631
25632
25633static int
25634test_xmlRemoveID(void) {
25635    int test_ret = 0;
25636
25637    int mem_base;
25638    int ret_val;
25639    xmlDocPtr doc; /* the document */
25640    int n_doc;
25641    xmlAttrPtr attr; /* the attribute */
25642    int n_attr;
25643
25644    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25645    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25646        mem_base = xmlMemBlocks();
25647        doc = gen_xmlDocPtr(n_doc, 0);
25648        attr = gen_xmlAttrPtr(n_attr, 1);
25649
25650        ret_val = xmlRemoveID(doc, attr);
25651        desret_int(ret_val);
25652        call_tests++;
25653        des_xmlDocPtr(n_doc, doc, 0);
25654        des_xmlAttrPtr(n_attr, attr, 1);
25655        xmlResetLastError();
25656        if (mem_base != xmlMemBlocks()) {
25657            printf("Leak of %d blocks found in xmlRemoveID",
25658	           xmlMemBlocks() - mem_base);
25659	    test_ret++;
25660            printf(" %d", n_doc);
25661            printf(" %d", n_attr);
25662            printf("\n");
25663        }
25664    }
25665    }
25666    function_tests++;
25667
25668    return(test_ret);
25669}
25670
25671
25672static int
25673test_xmlRemoveRef(void) {
25674    int test_ret = 0;
25675
25676    int mem_base;
25677    int ret_val;
25678    xmlDocPtr doc; /* the document */
25679    int n_doc;
25680    xmlAttrPtr attr; /* the attribute */
25681    int n_attr;
25682
25683    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25684    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25685        mem_base = xmlMemBlocks();
25686        doc = gen_xmlDocPtr(n_doc, 0);
25687        attr = gen_xmlAttrPtr(n_attr, 1);
25688
25689        ret_val = xmlRemoveRef(doc, attr);
25690        desret_int(ret_val);
25691        call_tests++;
25692        des_xmlDocPtr(n_doc, doc, 0);
25693        des_xmlAttrPtr(n_attr, attr, 1);
25694        xmlResetLastError();
25695        if (mem_base != xmlMemBlocks()) {
25696            printf("Leak of %d blocks found in xmlRemoveRef",
25697	           xmlMemBlocks() - mem_base);
25698	    test_ret++;
25699            printf(" %d", n_doc);
25700            printf(" %d", n_attr);
25701            printf("\n");
25702        }
25703    }
25704    }
25705    function_tests++;
25706
25707    return(test_ret);
25708}
25709
25710
25711static int
25712test_xmlSnprintfElementContent(void) {
25713    int test_ret = 0;
25714
25715    int mem_base;
25716    char * buf; /* an output buffer */
25717    int n_buf;
25718    int size; /* the buffer size */
25719    int n_size;
25720    xmlElementContentPtr content; /* An element table */
25721    int n_content;
25722    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25723    int n_englob;
25724
25725    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25726    for (n_size = 0;n_size < gen_nb_int;n_size++) {
25727    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25728    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25729        mem_base = xmlMemBlocks();
25730        buf = gen_char_ptr(n_buf, 0);
25731        size = gen_int(n_size, 1);
25732        content = gen_xmlElementContentPtr(n_content, 2);
25733        englob = gen_int(n_englob, 3);
25734
25735        xmlSnprintfElementContent(buf, size, content, englob);
25736        call_tests++;
25737        des_char_ptr(n_buf, buf, 0);
25738        des_int(n_size, size, 1);
25739        des_xmlElementContentPtr(n_content, content, 2);
25740        des_int(n_englob, englob, 3);
25741        xmlResetLastError();
25742        if (mem_base != xmlMemBlocks()) {
25743            printf("Leak of %d blocks found in xmlSnprintfElementContent",
25744	           xmlMemBlocks() - mem_base);
25745	    test_ret++;
25746            printf(" %d", n_buf);
25747            printf(" %d", n_size);
25748            printf(" %d", n_content);
25749            printf(" %d", n_englob);
25750            printf("\n");
25751        }
25752    }
25753    }
25754    }
25755    }
25756    function_tests++;
25757
25758    return(test_ret);
25759}
25760
25761
25762static int
25763test_xmlSprintfElementContent(void) {
25764    int test_ret = 0;
25765
25766#if defined(LIBXML_OUTPUT_ENABLED)
25767#ifdef LIBXML_OUTPUT_ENABLED
25768    int mem_base;
25769    char * buf; /* an output buffer */
25770    int n_buf;
25771    xmlElementContentPtr content; /* An element table */
25772    int n_content;
25773    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25774    int n_englob;
25775
25776    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25777    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25778    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25779        mem_base = xmlMemBlocks();
25780        buf = gen_char_ptr(n_buf, 0);
25781        content = gen_xmlElementContentPtr(n_content, 1);
25782        englob = gen_int(n_englob, 2);
25783
25784        xmlSprintfElementContent(buf, content, englob);
25785        call_tests++;
25786        des_char_ptr(n_buf, buf, 0);
25787        des_xmlElementContentPtr(n_content, content, 1);
25788        des_int(n_englob, englob, 2);
25789        xmlResetLastError();
25790        if (mem_base != xmlMemBlocks()) {
25791            printf("Leak of %d blocks found in xmlSprintfElementContent",
25792	           xmlMemBlocks() - mem_base);
25793	    test_ret++;
25794            printf(" %d", n_buf);
25795            printf(" %d", n_content);
25796            printf(" %d", n_englob);
25797            printf("\n");
25798        }
25799    }
25800    }
25801    }
25802    function_tests++;
25803#endif
25804#endif
25805
25806    return(test_ret);
25807}
25808
25809
25810static int
25811test_xmlValidBuildContentModel(void) {
25812    int test_ret = 0;
25813
25814#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25815    int mem_base;
25816    int ret_val;
25817    xmlValidCtxtPtr ctxt; /* a validation context */
25818    int n_ctxt;
25819    xmlElementPtr elem; /* an element declaration node */
25820    int n_elem;
25821
25822    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25823    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25824        mem_base = xmlMemBlocks();
25825        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25826        elem = gen_xmlElementPtr(n_elem, 1);
25827
25828        ret_val = xmlValidBuildContentModel(ctxt, elem);
25829        desret_int(ret_val);
25830        call_tests++;
25831        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25832        des_xmlElementPtr(n_elem, elem, 1);
25833        xmlResetLastError();
25834        if (mem_base != xmlMemBlocks()) {
25835            printf("Leak of %d blocks found in xmlValidBuildContentModel",
25836	           xmlMemBlocks() - mem_base);
25837	    test_ret++;
25838            printf(" %d", n_ctxt);
25839            printf(" %d", n_elem);
25840            printf("\n");
25841        }
25842    }
25843    }
25844    function_tests++;
25845#endif
25846
25847    return(test_ret);
25848}
25849
25850
25851static int
25852test_xmlValidCtxtNormalizeAttributeValue(void) {
25853    int test_ret = 0;
25854
25855#if defined(LIBXML_VALID_ENABLED)
25856    int mem_base;
25857    xmlChar * ret_val;
25858    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25859    int n_ctxt;
25860    xmlDocPtr doc; /* the document */
25861    int n_doc;
25862    xmlNodePtr elem; /* the parent */
25863    int n_elem;
25864    xmlChar * name; /* the attribute name */
25865    int n_name;
25866    xmlChar * value; /* the attribute value */
25867    int n_value;
25868
25869    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25870    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25871    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25872    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25873    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25874        mem_base = xmlMemBlocks();
25875        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25876        doc = gen_xmlDocPtr(n_doc, 1);
25877        elem = gen_xmlNodePtr(n_elem, 2);
25878        name = gen_const_xmlChar_ptr(n_name, 3);
25879        value = gen_const_xmlChar_ptr(n_value, 4);
25880
25881        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25882        desret_xmlChar_ptr(ret_val);
25883        call_tests++;
25884        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25885        des_xmlDocPtr(n_doc, doc, 1);
25886        des_xmlNodePtr(n_elem, elem, 2);
25887        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25888        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25889        xmlResetLastError();
25890        if (mem_base != xmlMemBlocks()) {
25891            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25892	           xmlMemBlocks() - mem_base);
25893	    test_ret++;
25894            printf(" %d", n_ctxt);
25895            printf(" %d", n_doc);
25896            printf(" %d", n_elem);
25897            printf(" %d", n_name);
25898            printf(" %d", n_value);
25899            printf("\n");
25900        }
25901    }
25902    }
25903    }
25904    }
25905    }
25906    function_tests++;
25907#endif
25908
25909    return(test_ret);
25910}
25911
25912
25913#define gen_nb_xmlElementContent_ptr 1
25914static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25915    return(NULL);
25916}
25917static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25918}
25919
25920static int
25921test_xmlValidGetPotentialChildren(void) {
25922    int test_ret = 0;
25923
25924#if defined(LIBXML_VALID_ENABLED)
25925#ifdef LIBXML_VALID_ENABLED
25926    int mem_base;
25927    int ret_val;
25928    xmlElementContent * ctree; /* an element content tree */
25929    int n_ctree;
25930    xmlChar ** names; /* an array to store the list of child names */
25931    int n_names;
25932    int * len; /* a pointer to the number of element in the list */
25933    int n_len;
25934    int max; /* the size of the array */
25935    int n_max;
25936
25937    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25938    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25939    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25940    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25941        mem_base = xmlMemBlocks();
25942        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25943        names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25944        len = gen_int_ptr(n_len, 2);
25945        max = gen_int(n_max, 3);
25946
25947        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25948        desret_int(ret_val);
25949        call_tests++;
25950        des_xmlElementContent_ptr(n_ctree, ctree, 0);
25951        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25952        des_int_ptr(n_len, len, 2);
25953        des_int(n_max, max, 3);
25954        xmlResetLastError();
25955        if (mem_base != xmlMemBlocks()) {
25956            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25957	           xmlMemBlocks() - mem_base);
25958	    test_ret++;
25959            printf(" %d", n_ctree);
25960            printf(" %d", n_names);
25961            printf(" %d", n_len);
25962            printf(" %d", n_max);
25963            printf("\n");
25964        }
25965    }
25966    }
25967    }
25968    }
25969    function_tests++;
25970#endif
25971#endif
25972
25973    return(test_ret);
25974}
25975
25976
25977static int
25978test_xmlValidGetValidElements(void) {
25979    int test_ret = 0;
25980
25981#if defined(LIBXML_VALID_ENABLED)
25982#ifdef LIBXML_VALID_ENABLED
25983    int mem_base;
25984    int ret_val;
25985    xmlNode * prev; /* an element to insert after */
25986    int n_prev;
25987    xmlNode * next; /* an element to insert next */
25988    int n_next;
25989    xmlChar ** names; /* an array to store the list of child names */
25990    int n_names;
25991    int max; /* the size of the array */
25992    int n_max;
25993
25994    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25995    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25996    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25997    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25998        mem_base = xmlMemBlocks();
25999        prev = gen_xmlNodePtr(n_prev, 0);
26000        next = gen_xmlNodePtr(n_next, 1);
26001        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
26002        max = gen_int(n_max, 3);
26003
26004        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
26005        desret_int(ret_val);
26006        call_tests++;
26007        des_xmlNodePtr(n_prev, prev, 0);
26008        des_xmlNodePtr(n_next, next, 1);
26009        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
26010        des_int(n_max, max, 3);
26011        xmlResetLastError();
26012        if (mem_base != xmlMemBlocks()) {
26013            printf("Leak of %d blocks found in xmlValidGetValidElements",
26014	           xmlMemBlocks() - mem_base);
26015	    test_ret++;
26016            printf(" %d", n_prev);
26017            printf(" %d", n_next);
26018            printf(" %d", n_names);
26019            printf(" %d", n_max);
26020            printf("\n");
26021        }
26022    }
26023    }
26024    }
26025    }
26026    function_tests++;
26027#endif
26028#endif
26029
26030    return(test_ret);
26031}
26032
26033
26034static int
26035test_xmlValidNormalizeAttributeValue(void) {
26036    int test_ret = 0;
26037
26038#if defined(LIBXML_VALID_ENABLED)
26039    int mem_base;
26040    xmlChar * ret_val;
26041    xmlDocPtr doc; /* the document */
26042    int n_doc;
26043    xmlNodePtr elem; /* the parent */
26044    int n_elem;
26045    xmlChar * name; /* the attribute name */
26046    int n_name;
26047    xmlChar * value; /* the attribute value */
26048    int n_value;
26049
26050    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26051    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26052    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
26053    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26054        mem_base = xmlMemBlocks();
26055        doc = gen_xmlDocPtr(n_doc, 0);
26056        elem = gen_xmlNodePtr(n_elem, 1);
26057        name = gen_const_xmlChar_ptr(n_name, 2);
26058        value = gen_const_xmlChar_ptr(n_value, 3);
26059
26060        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
26061        desret_xmlChar_ptr(ret_val);
26062        call_tests++;
26063        des_xmlDocPtr(n_doc, doc, 0);
26064        des_xmlNodePtr(n_elem, elem, 1);
26065        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
26066        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
26067        xmlResetLastError();
26068        if (mem_base != xmlMemBlocks()) {
26069            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
26070	           xmlMemBlocks() - mem_base);
26071	    test_ret++;
26072            printf(" %d", n_doc);
26073            printf(" %d", n_elem);
26074            printf(" %d", n_name);
26075            printf(" %d", n_value);
26076            printf("\n");
26077        }
26078    }
26079    }
26080    }
26081    }
26082    function_tests++;
26083#endif
26084
26085    return(test_ret);
26086}
26087
26088
26089static int
26090test_xmlValidateAttributeDecl(void) {
26091    int test_ret = 0;
26092
26093#if defined(LIBXML_VALID_ENABLED)
26094    int mem_base;
26095    int ret_val;
26096    xmlValidCtxtPtr ctxt; /* the validation context */
26097    int n_ctxt;
26098    xmlDocPtr doc; /* a document instance */
26099    int n_doc;
26100    xmlAttributePtr attr; /* an attribute definition */
26101    int n_attr;
26102
26103    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26104    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26105    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
26106        mem_base = xmlMemBlocks();
26107        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26108        doc = gen_xmlDocPtr(n_doc, 1);
26109        attr = gen_xmlAttributePtr(n_attr, 2);
26110
26111        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
26112        desret_int(ret_val);
26113        call_tests++;
26114        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26115        des_xmlDocPtr(n_doc, doc, 1);
26116        des_xmlAttributePtr(n_attr, attr, 2);
26117        xmlResetLastError();
26118        if (mem_base != xmlMemBlocks()) {
26119            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
26120	           xmlMemBlocks() - mem_base);
26121	    test_ret++;
26122            printf(" %d", n_ctxt);
26123            printf(" %d", n_doc);
26124            printf(" %d", n_attr);
26125            printf("\n");
26126        }
26127    }
26128    }
26129    }
26130    function_tests++;
26131#endif
26132
26133    return(test_ret);
26134}
26135
26136
26137static int
26138test_xmlValidateAttributeValue(void) {
26139    int test_ret = 0;
26140
26141#if defined(LIBXML_VALID_ENABLED)
26142    int mem_base;
26143    int ret_val;
26144    xmlAttributeType type; /* an attribute type */
26145    int n_type;
26146    xmlChar * value; /* an attribute value */
26147    int n_value;
26148
26149    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
26150    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26151        mem_base = xmlMemBlocks();
26152        type = gen_xmlAttributeType(n_type, 0);
26153        value = gen_const_xmlChar_ptr(n_value, 1);
26154
26155        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
26156        desret_int(ret_val);
26157        call_tests++;
26158        des_xmlAttributeType(n_type, type, 0);
26159        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
26160        xmlResetLastError();
26161        if (mem_base != xmlMemBlocks()) {
26162            printf("Leak of %d blocks found in xmlValidateAttributeValue",
26163	           xmlMemBlocks() - mem_base);
26164	    test_ret++;
26165            printf(" %d", n_type);
26166            printf(" %d", n_value);
26167            printf("\n");
26168        }
26169    }
26170    }
26171    function_tests++;
26172#endif
26173
26174    return(test_ret);
26175}
26176
26177
26178static int
26179test_xmlValidateDocument(void) {
26180    int test_ret = 0;
26181
26182#if defined(LIBXML_VALID_ENABLED)
26183    int mem_base;
26184    int ret_val;
26185    xmlValidCtxtPtr ctxt; /* the validation context */
26186    int n_ctxt;
26187    xmlDocPtr doc; /* a document instance */
26188    int n_doc;
26189
26190    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26191    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26192        mem_base = xmlMemBlocks();
26193        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26194        doc = gen_xmlDocPtr(n_doc, 1);
26195
26196        ret_val = xmlValidateDocument(ctxt, doc);
26197        desret_int(ret_val);
26198        call_tests++;
26199        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26200        des_xmlDocPtr(n_doc, doc, 1);
26201        xmlResetLastError();
26202        if (mem_base != xmlMemBlocks()) {
26203            printf("Leak of %d blocks found in xmlValidateDocument",
26204	           xmlMemBlocks() - mem_base);
26205	    test_ret++;
26206            printf(" %d", n_ctxt);
26207            printf(" %d", n_doc);
26208            printf("\n");
26209        }
26210    }
26211    }
26212    function_tests++;
26213#endif
26214
26215    return(test_ret);
26216}
26217
26218
26219static int
26220test_xmlValidateDocumentFinal(void) {
26221    int test_ret = 0;
26222
26223#if defined(LIBXML_VALID_ENABLED)
26224    int mem_base;
26225    int ret_val;
26226    xmlValidCtxtPtr ctxt; /* the validation context */
26227    int n_ctxt;
26228    xmlDocPtr doc; /* a document instance */
26229    int n_doc;
26230
26231    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26232    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26233        mem_base = xmlMemBlocks();
26234        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26235        doc = gen_xmlDocPtr(n_doc, 1);
26236
26237        ret_val = xmlValidateDocumentFinal(ctxt, doc);
26238        desret_int(ret_val);
26239        call_tests++;
26240        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26241        des_xmlDocPtr(n_doc, doc, 1);
26242        xmlResetLastError();
26243        if (mem_base != xmlMemBlocks()) {
26244            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26245	           xmlMemBlocks() - mem_base);
26246	    test_ret++;
26247            printf(" %d", n_ctxt);
26248            printf(" %d", n_doc);
26249            printf("\n");
26250        }
26251    }
26252    }
26253    function_tests++;
26254#endif
26255
26256    return(test_ret);
26257}
26258
26259
26260static int
26261test_xmlValidateDtd(void) {
26262    int test_ret = 0;
26263
26264#if defined(LIBXML_VALID_ENABLED)
26265    int mem_base;
26266    int ret_val;
26267    xmlValidCtxtPtr ctxt; /* the validation context */
26268    int n_ctxt;
26269    xmlDocPtr doc; /* a document instance */
26270    int n_doc;
26271    xmlDtdPtr dtd; /* a dtd instance */
26272    int n_dtd;
26273
26274    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26275    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26276    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26277        mem_base = xmlMemBlocks();
26278        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26279        doc = gen_xmlDocPtr(n_doc, 1);
26280        dtd = gen_xmlDtdPtr(n_dtd, 2);
26281
26282        ret_val = xmlValidateDtd(ctxt, doc, dtd);
26283        desret_int(ret_val);
26284        call_tests++;
26285        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26286        des_xmlDocPtr(n_doc, doc, 1);
26287        des_xmlDtdPtr(n_dtd, dtd, 2);
26288        xmlResetLastError();
26289        if (mem_base != xmlMemBlocks()) {
26290            printf("Leak of %d blocks found in xmlValidateDtd",
26291	           xmlMemBlocks() - mem_base);
26292	    test_ret++;
26293            printf(" %d", n_ctxt);
26294            printf(" %d", n_doc);
26295            printf(" %d", n_dtd);
26296            printf("\n");
26297        }
26298    }
26299    }
26300    }
26301    function_tests++;
26302#endif
26303
26304    return(test_ret);
26305}
26306
26307
26308static int
26309test_xmlValidateDtdFinal(void) {
26310    int test_ret = 0;
26311
26312#if defined(LIBXML_VALID_ENABLED)
26313    int mem_base;
26314    int ret_val;
26315    xmlValidCtxtPtr ctxt; /* the validation context */
26316    int n_ctxt;
26317    xmlDocPtr doc; /* a document instance */
26318    int n_doc;
26319
26320    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26321    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26322        mem_base = xmlMemBlocks();
26323        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26324        doc = gen_xmlDocPtr(n_doc, 1);
26325
26326        ret_val = xmlValidateDtdFinal(ctxt, doc);
26327        desret_int(ret_val);
26328        call_tests++;
26329        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26330        des_xmlDocPtr(n_doc, doc, 1);
26331        xmlResetLastError();
26332        if (mem_base != xmlMemBlocks()) {
26333            printf("Leak of %d blocks found in xmlValidateDtdFinal",
26334	           xmlMemBlocks() - mem_base);
26335	    test_ret++;
26336            printf(" %d", n_ctxt);
26337            printf(" %d", n_doc);
26338            printf("\n");
26339        }
26340    }
26341    }
26342    function_tests++;
26343#endif
26344
26345    return(test_ret);
26346}
26347
26348
26349static int
26350test_xmlValidateElement(void) {
26351    int test_ret = 0;
26352
26353#if defined(LIBXML_VALID_ENABLED)
26354    int mem_base;
26355    int ret_val;
26356    xmlValidCtxtPtr ctxt; /* the validation context */
26357    int n_ctxt;
26358    xmlDocPtr doc; /* a document instance */
26359    int n_doc;
26360    xmlNodePtr elem; /* an element instance */
26361    int n_elem;
26362
26363    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26364    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26365    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26366        mem_base = xmlMemBlocks();
26367        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26368        doc = gen_xmlDocPtr(n_doc, 1);
26369        elem = gen_xmlNodePtr(n_elem, 2);
26370
26371        ret_val = xmlValidateElement(ctxt, doc, elem);
26372        desret_int(ret_val);
26373        call_tests++;
26374        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26375        des_xmlDocPtr(n_doc, doc, 1);
26376        des_xmlNodePtr(n_elem, elem, 2);
26377        xmlResetLastError();
26378        if (mem_base != xmlMemBlocks()) {
26379            printf("Leak of %d blocks found in xmlValidateElement",
26380	           xmlMemBlocks() - mem_base);
26381	    test_ret++;
26382            printf(" %d", n_ctxt);
26383            printf(" %d", n_doc);
26384            printf(" %d", n_elem);
26385            printf("\n");
26386        }
26387    }
26388    }
26389    }
26390    function_tests++;
26391#endif
26392
26393    return(test_ret);
26394}
26395
26396
26397static int
26398test_xmlValidateElementDecl(void) {
26399    int test_ret = 0;
26400
26401#if defined(LIBXML_VALID_ENABLED)
26402    int mem_base;
26403    int ret_val;
26404    xmlValidCtxtPtr ctxt; /* the validation context */
26405    int n_ctxt;
26406    xmlDocPtr doc; /* a document instance */
26407    int n_doc;
26408    xmlElementPtr elem; /* an element definition */
26409    int n_elem;
26410
26411    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26412    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26413    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26414        mem_base = xmlMemBlocks();
26415        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26416        doc = gen_xmlDocPtr(n_doc, 1);
26417        elem = gen_xmlElementPtr(n_elem, 2);
26418
26419        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26420        desret_int(ret_val);
26421        call_tests++;
26422        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26423        des_xmlDocPtr(n_doc, doc, 1);
26424        des_xmlElementPtr(n_elem, elem, 2);
26425        xmlResetLastError();
26426        if (mem_base != xmlMemBlocks()) {
26427            printf("Leak of %d blocks found in xmlValidateElementDecl",
26428	           xmlMemBlocks() - mem_base);
26429	    test_ret++;
26430            printf(" %d", n_ctxt);
26431            printf(" %d", n_doc);
26432            printf(" %d", n_elem);
26433            printf("\n");
26434        }
26435    }
26436    }
26437    }
26438    function_tests++;
26439#endif
26440
26441    return(test_ret);
26442}
26443
26444
26445static int
26446test_xmlValidateNameValue(void) {
26447    int test_ret = 0;
26448
26449#if defined(LIBXML_VALID_ENABLED)
26450    int mem_base;
26451    int ret_val;
26452    xmlChar * value; /* an Name value */
26453    int n_value;
26454
26455    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26456        mem_base = xmlMemBlocks();
26457        value = gen_const_xmlChar_ptr(n_value, 0);
26458
26459        ret_val = xmlValidateNameValue((const xmlChar *)value);
26460        desret_int(ret_val);
26461        call_tests++;
26462        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26463        xmlResetLastError();
26464        if (mem_base != xmlMemBlocks()) {
26465            printf("Leak of %d blocks found in xmlValidateNameValue",
26466	           xmlMemBlocks() - mem_base);
26467	    test_ret++;
26468            printf(" %d", n_value);
26469            printf("\n");
26470        }
26471    }
26472    function_tests++;
26473#endif
26474
26475    return(test_ret);
26476}
26477
26478
26479static int
26480test_xmlValidateNamesValue(void) {
26481    int test_ret = 0;
26482
26483#if defined(LIBXML_VALID_ENABLED)
26484    int mem_base;
26485    int ret_val;
26486    xmlChar * value; /* an Names value */
26487    int n_value;
26488
26489    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26490        mem_base = xmlMemBlocks();
26491        value = gen_const_xmlChar_ptr(n_value, 0);
26492
26493        ret_val = xmlValidateNamesValue((const xmlChar *)value);
26494        desret_int(ret_val);
26495        call_tests++;
26496        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26497        xmlResetLastError();
26498        if (mem_base != xmlMemBlocks()) {
26499            printf("Leak of %d blocks found in xmlValidateNamesValue",
26500	           xmlMemBlocks() - mem_base);
26501	    test_ret++;
26502            printf(" %d", n_value);
26503            printf("\n");
26504        }
26505    }
26506    function_tests++;
26507#endif
26508
26509    return(test_ret);
26510}
26511
26512
26513static int
26514test_xmlValidateNmtokenValue(void) {
26515    int test_ret = 0;
26516
26517#if defined(LIBXML_VALID_ENABLED)
26518    int mem_base;
26519    int ret_val;
26520    xmlChar * value; /* an Nmtoken value */
26521    int n_value;
26522
26523    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26524        mem_base = xmlMemBlocks();
26525        value = gen_const_xmlChar_ptr(n_value, 0);
26526
26527        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26528        desret_int(ret_val);
26529        call_tests++;
26530        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26531        xmlResetLastError();
26532        if (mem_base != xmlMemBlocks()) {
26533            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26534	           xmlMemBlocks() - mem_base);
26535	    test_ret++;
26536            printf(" %d", n_value);
26537            printf("\n");
26538        }
26539    }
26540    function_tests++;
26541#endif
26542
26543    return(test_ret);
26544}
26545
26546
26547static int
26548test_xmlValidateNmtokensValue(void) {
26549    int test_ret = 0;
26550
26551#if defined(LIBXML_VALID_ENABLED)
26552    int mem_base;
26553    int ret_val;
26554    xmlChar * value; /* an Nmtokens value */
26555    int n_value;
26556
26557    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26558        mem_base = xmlMemBlocks();
26559        value = gen_const_xmlChar_ptr(n_value, 0);
26560
26561        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26562        desret_int(ret_val);
26563        call_tests++;
26564        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26565        xmlResetLastError();
26566        if (mem_base != xmlMemBlocks()) {
26567            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26568	           xmlMemBlocks() - mem_base);
26569	    test_ret++;
26570            printf(" %d", n_value);
26571            printf("\n");
26572        }
26573    }
26574    function_tests++;
26575#endif
26576
26577    return(test_ret);
26578}
26579
26580
26581static int
26582test_xmlValidateNotationDecl(void) {
26583    int test_ret = 0;
26584
26585#if defined(LIBXML_VALID_ENABLED)
26586    int mem_base;
26587    int ret_val;
26588    xmlValidCtxtPtr ctxt; /* the validation context */
26589    int n_ctxt;
26590    xmlDocPtr doc; /* a document instance */
26591    int n_doc;
26592    xmlNotationPtr nota; /* a notation definition */
26593    int n_nota;
26594
26595    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26596    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26597    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26598        mem_base = xmlMemBlocks();
26599        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26600        doc = gen_xmlDocPtr(n_doc, 1);
26601        nota = gen_xmlNotationPtr(n_nota, 2);
26602
26603        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26604        desret_int(ret_val);
26605        call_tests++;
26606        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26607        des_xmlDocPtr(n_doc, doc, 1);
26608        des_xmlNotationPtr(n_nota, nota, 2);
26609        xmlResetLastError();
26610        if (mem_base != xmlMemBlocks()) {
26611            printf("Leak of %d blocks found in xmlValidateNotationDecl",
26612	           xmlMemBlocks() - mem_base);
26613	    test_ret++;
26614            printf(" %d", n_ctxt);
26615            printf(" %d", n_doc);
26616            printf(" %d", n_nota);
26617            printf("\n");
26618        }
26619    }
26620    }
26621    }
26622    function_tests++;
26623#endif
26624
26625    return(test_ret);
26626}
26627
26628
26629static int
26630test_xmlValidateNotationUse(void) {
26631    int test_ret = 0;
26632
26633#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26634    int mem_base;
26635    int ret_val;
26636    xmlValidCtxtPtr ctxt; /* the validation context */
26637    int n_ctxt;
26638    xmlDocPtr doc; /* the document */
26639    int n_doc;
26640    xmlChar * notationName; /* the notation name to check */
26641    int n_notationName;
26642
26643    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26644    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26645    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26646        mem_base = xmlMemBlocks();
26647        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26648        doc = gen_xmlDocPtr(n_doc, 1);
26649        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26650
26651        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26652        desret_int(ret_val);
26653        call_tests++;
26654        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26655        des_xmlDocPtr(n_doc, doc, 1);
26656        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26657        xmlResetLastError();
26658        if (mem_base != xmlMemBlocks()) {
26659            printf("Leak of %d blocks found in xmlValidateNotationUse",
26660	           xmlMemBlocks() - mem_base);
26661	    test_ret++;
26662            printf(" %d", n_ctxt);
26663            printf(" %d", n_doc);
26664            printf(" %d", n_notationName);
26665            printf("\n");
26666        }
26667    }
26668    }
26669    }
26670    function_tests++;
26671#endif
26672
26673    return(test_ret);
26674}
26675
26676
26677static int
26678test_xmlValidateOneAttribute(void) {
26679    int test_ret = 0;
26680
26681#if defined(LIBXML_VALID_ENABLED)
26682    int mem_base;
26683    int ret_val;
26684    xmlValidCtxtPtr ctxt; /* the validation context */
26685    int n_ctxt;
26686    xmlDocPtr doc; /* a document instance */
26687    int n_doc;
26688    xmlNodePtr elem; /* an element instance */
26689    int n_elem;
26690    xmlAttrPtr attr; /* an attribute instance */
26691    int n_attr;
26692    xmlChar * value; /* the attribute value (without entities processing) */
26693    int n_value;
26694
26695    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26696    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26697    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26698    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26699    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26700        mem_base = xmlMemBlocks();
26701        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26702        doc = gen_xmlDocPtr(n_doc, 1);
26703        elem = gen_xmlNodePtr(n_elem, 2);
26704        attr = gen_xmlAttrPtr(n_attr, 3);
26705        value = gen_const_xmlChar_ptr(n_value, 4);
26706
26707        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
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_xmlAttrPtr(n_attr, attr, 3);
26714        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26715        xmlResetLastError();
26716        if (mem_base != xmlMemBlocks()) {
26717            printf("Leak of %d blocks found in xmlValidateOneAttribute",
26718	           xmlMemBlocks() - mem_base);
26719	    test_ret++;
26720            printf(" %d", n_ctxt);
26721            printf(" %d", n_doc);
26722            printf(" %d", n_elem);
26723            printf(" %d", n_attr);
26724            printf(" %d", n_value);
26725            printf("\n");
26726        }
26727    }
26728    }
26729    }
26730    }
26731    }
26732    function_tests++;
26733#endif
26734
26735    return(test_ret);
26736}
26737
26738
26739static int
26740test_xmlValidateOneElement(void) {
26741    int test_ret = 0;
26742
26743#if defined(LIBXML_VALID_ENABLED)
26744    int mem_base;
26745    int ret_val;
26746    xmlValidCtxtPtr ctxt; /* the validation context */
26747    int n_ctxt;
26748    xmlDocPtr doc; /* a document instance */
26749    int n_doc;
26750    xmlNodePtr elem; /* an element instance */
26751    int n_elem;
26752
26753    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26754    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26755    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26756        mem_base = xmlMemBlocks();
26757        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26758        doc = gen_xmlDocPtr(n_doc, 1);
26759        elem = gen_xmlNodePtr(n_elem, 2);
26760
26761        ret_val = xmlValidateOneElement(ctxt, doc, elem);
26762        desret_int(ret_val);
26763        call_tests++;
26764        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26765        des_xmlDocPtr(n_doc, doc, 1);
26766        des_xmlNodePtr(n_elem, elem, 2);
26767        xmlResetLastError();
26768        if (mem_base != xmlMemBlocks()) {
26769            printf("Leak of %d blocks found in xmlValidateOneElement",
26770	           xmlMemBlocks() - mem_base);
26771	    test_ret++;
26772            printf(" %d", n_ctxt);
26773            printf(" %d", n_doc);
26774            printf(" %d", n_elem);
26775            printf("\n");
26776        }
26777    }
26778    }
26779    }
26780    function_tests++;
26781#endif
26782
26783    return(test_ret);
26784}
26785
26786
26787static int
26788test_xmlValidateOneNamespace(void) {
26789    int test_ret = 0;
26790
26791#if defined(LIBXML_VALID_ENABLED)
26792    int mem_base;
26793    int ret_val;
26794    xmlValidCtxtPtr ctxt; /* the validation context */
26795    int n_ctxt;
26796    xmlDocPtr doc; /* a document instance */
26797    int n_doc;
26798    xmlNodePtr elem; /* an element instance */
26799    int n_elem;
26800    xmlChar * prefix; /* the namespace prefix */
26801    int n_prefix;
26802    xmlNsPtr ns; /* an namespace declaration instance */
26803    int n_ns;
26804    xmlChar * value; /* the attribute value (without entities processing) */
26805    int n_value;
26806
26807    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26808    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26809    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26810    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26811    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26812    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26813        mem_base = xmlMemBlocks();
26814        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26815        doc = gen_xmlDocPtr(n_doc, 1);
26816        elem = gen_xmlNodePtr(n_elem, 2);
26817        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26818        ns = gen_xmlNsPtr(n_ns, 4);
26819        value = gen_const_xmlChar_ptr(n_value, 5);
26820
26821        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26822        desret_int(ret_val);
26823        call_tests++;
26824        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26825        des_xmlDocPtr(n_doc, doc, 1);
26826        des_xmlNodePtr(n_elem, elem, 2);
26827        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26828        des_xmlNsPtr(n_ns, ns, 4);
26829        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26830        xmlResetLastError();
26831        if (mem_base != xmlMemBlocks()) {
26832            printf("Leak of %d blocks found in xmlValidateOneNamespace",
26833	           xmlMemBlocks() - mem_base);
26834	    test_ret++;
26835            printf(" %d", n_ctxt);
26836            printf(" %d", n_doc);
26837            printf(" %d", n_elem);
26838            printf(" %d", n_prefix);
26839            printf(" %d", n_ns);
26840            printf(" %d", n_value);
26841            printf("\n");
26842        }
26843    }
26844    }
26845    }
26846    }
26847    }
26848    }
26849    function_tests++;
26850#endif
26851
26852    return(test_ret);
26853}
26854
26855
26856static int
26857test_xmlValidatePopElement(void) {
26858    int test_ret = 0;
26859
26860#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26861    int mem_base;
26862    int ret_val;
26863    xmlValidCtxtPtr ctxt; /* the validation context */
26864    int n_ctxt;
26865    xmlDocPtr doc; /* a document instance */
26866    int n_doc;
26867    xmlNodePtr elem; /* an element instance */
26868    int n_elem;
26869    xmlChar * qname; /* the qualified name as appearing in the serialization */
26870    int n_qname;
26871
26872    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26873    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26874    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26875    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26876        mem_base = xmlMemBlocks();
26877        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26878        doc = gen_xmlDocPtr(n_doc, 1);
26879        elem = gen_xmlNodePtr(n_elem, 2);
26880        qname = gen_const_xmlChar_ptr(n_qname, 3);
26881
26882        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26883        desret_int(ret_val);
26884        call_tests++;
26885        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26886        des_xmlDocPtr(n_doc, doc, 1);
26887        des_xmlNodePtr(n_elem, elem, 2);
26888        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26889        xmlResetLastError();
26890        if (mem_base != xmlMemBlocks()) {
26891            printf("Leak of %d blocks found in xmlValidatePopElement",
26892	           xmlMemBlocks() - mem_base);
26893	    test_ret++;
26894            printf(" %d", n_ctxt);
26895            printf(" %d", n_doc);
26896            printf(" %d", n_elem);
26897            printf(" %d", n_qname);
26898            printf("\n");
26899        }
26900    }
26901    }
26902    }
26903    }
26904    function_tests++;
26905#endif
26906
26907    return(test_ret);
26908}
26909
26910
26911static int
26912test_xmlValidatePushCData(void) {
26913    int test_ret = 0;
26914
26915#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26916    int mem_base;
26917    int ret_val;
26918    xmlValidCtxtPtr ctxt; /* the validation context */
26919    int n_ctxt;
26920    xmlChar * data; /* some character data read */
26921    int n_data;
26922    int len; /* the lenght of the data */
26923    int n_len;
26924
26925    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26926    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26927    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26928        mem_base = xmlMemBlocks();
26929        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26930        data = gen_const_xmlChar_ptr(n_data, 1);
26931        len = gen_int(n_len, 2);
26932
26933        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26934        desret_int(ret_val);
26935        call_tests++;
26936        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26937        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26938        des_int(n_len, len, 2);
26939        xmlResetLastError();
26940        if (mem_base != xmlMemBlocks()) {
26941            printf("Leak of %d blocks found in xmlValidatePushCData",
26942	           xmlMemBlocks() - mem_base);
26943	    test_ret++;
26944            printf(" %d", n_ctxt);
26945            printf(" %d", n_data);
26946            printf(" %d", n_len);
26947            printf("\n");
26948        }
26949    }
26950    }
26951    }
26952    function_tests++;
26953#endif
26954
26955    return(test_ret);
26956}
26957
26958
26959static int
26960test_xmlValidatePushElement(void) {
26961    int test_ret = 0;
26962
26963#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26964    int mem_base;
26965    int ret_val;
26966    xmlValidCtxtPtr ctxt; /* the validation context */
26967    int n_ctxt;
26968    xmlDocPtr doc; /* a document instance */
26969    int n_doc;
26970    xmlNodePtr elem; /* an element instance */
26971    int n_elem;
26972    xmlChar * qname; /* the qualified name as appearing in the serialization */
26973    int n_qname;
26974
26975    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26976    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26977    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26978    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26979        mem_base = xmlMemBlocks();
26980        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26981        doc = gen_xmlDocPtr(n_doc, 1);
26982        elem = gen_xmlNodePtr(n_elem, 2);
26983        qname = gen_const_xmlChar_ptr(n_qname, 3);
26984
26985        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26986        desret_int(ret_val);
26987        call_tests++;
26988        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26989        des_xmlDocPtr(n_doc, doc, 1);
26990        des_xmlNodePtr(n_elem, elem, 2);
26991        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26992        xmlResetLastError();
26993        if (mem_base != xmlMemBlocks()) {
26994            printf("Leak of %d blocks found in xmlValidatePushElement",
26995	           xmlMemBlocks() - mem_base);
26996	    test_ret++;
26997            printf(" %d", n_ctxt);
26998            printf(" %d", n_doc);
26999            printf(" %d", n_elem);
27000            printf(" %d", n_qname);
27001            printf("\n");
27002        }
27003    }
27004    }
27005    }
27006    }
27007    function_tests++;
27008#endif
27009
27010    return(test_ret);
27011}
27012
27013
27014static int
27015test_xmlValidateRoot(void) {
27016    int test_ret = 0;
27017
27018#if defined(LIBXML_VALID_ENABLED)
27019    int mem_base;
27020    int ret_val;
27021    xmlValidCtxtPtr ctxt; /* the validation context */
27022    int n_ctxt;
27023    xmlDocPtr doc; /* a document instance */
27024    int n_doc;
27025
27026    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
27027    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27028        mem_base = xmlMemBlocks();
27029        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
27030        doc = gen_xmlDocPtr(n_doc, 1);
27031
27032        ret_val = xmlValidateRoot(ctxt, doc);
27033        desret_int(ret_val);
27034        call_tests++;
27035        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
27036        des_xmlDocPtr(n_doc, doc, 1);
27037        xmlResetLastError();
27038        if (mem_base != xmlMemBlocks()) {
27039            printf("Leak of %d blocks found in xmlValidateRoot",
27040	           xmlMemBlocks() - mem_base);
27041	    test_ret++;
27042            printf(" %d", n_ctxt);
27043            printf(" %d", n_doc);
27044            printf("\n");
27045        }
27046    }
27047    }
27048    function_tests++;
27049#endif
27050
27051    return(test_ret);
27052}
27053
27054static int
27055test_valid(void) {
27056    int test_ret = 0;
27057
27058    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
27059    test_ret += test_xmlAddAttributeDecl();
27060    test_ret += test_xmlAddElementDecl();
27061    test_ret += test_xmlAddID();
27062    test_ret += test_xmlAddNotationDecl();
27063    test_ret += test_xmlAddRef();
27064    test_ret += test_xmlCopyAttributeTable();
27065    test_ret += test_xmlCopyDocElementContent();
27066    test_ret += test_xmlCopyElementContent();
27067    test_ret += test_xmlCopyElementTable();
27068    test_ret += test_xmlCopyEnumeration();
27069    test_ret += test_xmlCopyNotationTable();
27070    test_ret += test_xmlCreateEnumeration();
27071    test_ret += test_xmlDumpAttributeDecl();
27072    test_ret += test_xmlDumpAttributeTable();
27073    test_ret += test_xmlDumpElementDecl();
27074    test_ret += test_xmlDumpElementTable();
27075    test_ret += test_xmlDumpNotationDecl();
27076    test_ret += test_xmlDumpNotationTable();
27077    test_ret += test_xmlGetDtdAttrDesc();
27078    test_ret += test_xmlGetDtdElementDesc();
27079    test_ret += test_xmlGetDtdNotationDesc();
27080    test_ret += test_xmlGetDtdQAttrDesc();
27081    test_ret += test_xmlGetDtdQElementDesc();
27082    test_ret += test_xmlGetID();
27083    test_ret += test_xmlGetRefs();
27084    test_ret += test_xmlIsID();
27085    test_ret += test_xmlIsMixedElement();
27086    test_ret += test_xmlIsRef();
27087    test_ret += test_xmlNewDocElementContent();
27088    test_ret += test_xmlNewElementContent();
27089    test_ret += test_xmlNewValidCtxt();
27090    test_ret += test_xmlRemoveID();
27091    test_ret += test_xmlRemoveRef();
27092    test_ret += test_xmlSnprintfElementContent();
27093    test_ret += test_xmlSprintfElementContent();
27094    test_ret += test_xmlValidBuildContentModel();
27095    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
27096    test_ret += test_xmlValidGetPotentialChildren();
27097    test_ret += test_xmlValidGetValidElements();
27098    test_ret += test_xmlValidNormalizeAttributeValue();
27099    test_ret += test_xmlValidateAttributeDecl();
27100    test_ret += test_xmlValidateAttributeValue();
27101    test_ret += test_xmlValidateDocument();
27102    test_ret += test_xmlValidateDocumentFinal();
27103    test_ret += test_xmlValidateDtd();
27104    test_ret += test_xmlValidateDtdFinal();
27105    test_ret += test_xmlValidateElement();
27106    test_ret += test_xmlValidateElementDecl();
27107    test_ret += test_xmlValidateNameValue();
27108    test_ret += test_xmlValidateNamesValue();
27109    test_ret += test_xmlValidateNmtokenValue();
27110    test_ret += test_xmlValidateNmtokensValue();
27111    test_ret += test_xmlValidateNotationDecl();
27112    test_ret += test_xmlValidateNotationUse();
27113    test_ret += test_xmlValidateOneAttribute();
27114    test_ret += test_xmlValidateOneElement();
27115    test_ret += test_xmlValidateOneNamespace();
27116    test_ret += test_xmlValidatePopElement();
27117    test_ret += test_xmlValidatePushCData();
27118    test_ret += test_xmlValidatePushElement();
27119    test_ret += test_xmlValidateRoot();
27120
27121    if (test_ret != 0)
27122	printf("Module valid: %d errors\n", test_ret);
27123    return(test_ret);
27124}
27125
27126static int
27127test_xmlXIncludeNewContext(void) {
27128    int test_ret = 0;
27129
27130
27131    /* missing type support */
27132    return(test_ret);
27133}
27134
27135
27136static int
27137test_xmlXIncludeProcess(void) {
27138    int test_ret = 0;
27139
27140#if defined(LIBXML_XINCLUDE_ENABLED)
27141    int mem_base;
27142    int ret_val;
27143    xmlDocPtr doc; /* an XML document */
27144    int n_doc;
27145
27146    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27147        mem_base = xmlMemBlocks();
27148        doc = gen_xmlDocPtr(n_doc, 0);
27149
27150        ret_val = xmlXIncludeProcess(doc);
27151        desret_int(ret_val);
27152        call_tests++;
27153        des_xmlDocPtr(n_doc, doc, 0);
27154        xmlResetLastError();
27155        if (mem_base != xmlMemBlocks()) {
27156            printf("Leak of %d blocks found in xmlXIncludeProcess",
27157	           xmlMemBlocks() - mem_base);
27158	    test_ret++;
27159            printf(" %d", n_doc);
27160            printf("\n");
27161        }
27162    }
27163    function_tests++;
27164#endif
27165
27166    return(test_ret);
27167}
27168
27169
27170static int
27171test_xmlXIncludeProcessFlags(void) {
27172    int test_ret = 0;
27173
27174#if defined(LIBXML_XINCLUDE_ENABLED)
27175    int mem_base;
27176    int ret_val;
27177    xmlDocPtr doc; /* an XML document */
27178    int n_doc;
27179    int flags; /* a set of xmlParserOption used for parsing XML includes */
27180    int n_flags;
27181
27182    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27183    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27184        mem_base = xmlMemBlocks();
27185        doc = gen_xmlDocPtr(n_doc, 0);
27186        flags = gen_int(n_flags, 1);
27187
27188        ret_val = xmlXIncludeProcessFlags(doc, flags);
27189        desret_int(ret_val);
27190        call_tests++;
27191        des_xmlDocPtr(n_doc, doc, 0);
27192        des_int(n_flags, flags, 1);
27193        xmlResetLastError();
27194        if (mem_base != xmlMemBlocks()) {
27195            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27196	           xmlMemBlocks() - mem_base);
27197	    test_ret++;
27198            printf(" %d", n_doc);
27199            printf(" %d", n_flags);
27200            printf("\n");
27201        }
27202    }
27203    }
27204    function_tests++;
27205#endif
27206
27207    return(test_ret);
27208}
27209
27210
27211static int
27212test_xmlXIncludeProcessFlagsData(void) {
27213    int test_ret = 0;
27214
27215#if defined(LIBXML_XINCLUDE_ENABLED)
27216    int mem_base;
27217    int ret_val;
27218    xmlDocPtr doc; /* an XML document */
27219    int n_doc;
27220    int flags; /* a set of xmlParserOption used for parsing XML includes */
27221    int n_flags;
27222    void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27223    int n_data;
27224
27225    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27226    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27227    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27228        mem_base = xmlMemBlocks();
27229        doc = gen_xmlDocPtr(n_doc, 0);
27230        flags = gen_int(n_flags, 1);
27231        data = gen_userdata(n_data, 2);
27232
27233        ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27234        desret_int(ret_val);
27235        call_tests++;
27236        des_xmlDocPtr(n_doc, doc, 0);
27237        des_int(n_flags, flags, 1);
27238        des_userdata(n_data, data, 2);
27239        xmlResetLastError();
27240        if (mem_base != xmlMemBlocks()) {
27241            printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27242	           xmlMemBlocks() - mem_base);
27243	    test_ret++;
27244            printf(" %d", n_doc);
27245            printf(" %d", n_flags);
27246            printf(" %d", n_data);
27247            printf("\n");
27248        }
27249    }
27250    }
27251    }
27252    function_tests++;
27253#endif
27254
27255    return(test_ret);
27256}
27257
27258#ifdef LIBXML_XINCLUDE_ENABLED
27259
27260#define gen_nb_xmlXIncludeCtxtPtr 1
27261static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27262    return(NULL);
27263}
27264static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27265}
27266#endif
27267
27268
27269static int
27270test_xmlXIncludeProcessNode(void) {
27271    int test_ret = 0;
27272
27273#if defined(LIBXML_XINCLUDE_ENABLED)
27274    int mem_base;
27275    int ret_val;
27276    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27277    int n_ctxt;
27278    xmlNodePtr node; /* a node in an XML document */
27279    int n_node;
27280
27281    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27282    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27283        mem_base = xmlMemBlocks();
27284        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27285        node = gen_xmlNodePtr(n_node, 1);
27286
27287        ret_val = xmlXIncludeProcessNode(ctxt, node);
27288        desret_int(ret_val);
27289        call_tests++;
27290        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27291        des_xmlNodePtr(n_node, node, 1);
27292        xmlResetLastError();
27293        if (mem_base != xmlMemBlocks()) {
27294            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27295	           xmlMemBlocks() - mem_base);
27296	    test_ret++;
27297            printf(" %d", n_ctxt);
27298            printf(" %d", n_node);
27299            printf("\n");
27300        }
27301    }
27302    }
27303    function_tests++;
27304#endif
27305
27306    return(test_ret);
27307}
27308
27309
27310static int
27311test_xmlXIncludeProcessTree(void) {
27312    int test_ret = 0;
27313
27314#if defined(LIBXML_XINCLUDE_ENABLED)
27315    int mem_base;
27316    int ret_val;
27317    xmlNodePtr tree; /* a node in an XML document */
27318    int n_tree;
27319
27320    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27321        mem_base = xmlMemBlocks();
27322        tree = gen_xmlNodePtr(n_tree, 0);
27323
27324        ret_val = xmlXIncludeProcessTree(tree);
27325        desret_int(ret_val);
27326        call_tests++;
27327        des_xmlNodePtr(n_tree, tree, 0);
27328        xmlResetLastError();
27329        if (mem_base != xmlMemBlocks()) {
27330            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27331	           xmlMemBlocks() - mem_base);
27332	    test_ret++;
27333            printf(" %d", n_tree);
27334            printf("\n");
27335        }
27336    }
27337    function_tests++;
27338#endif
27339
27340    return(test_ret);
27341}
27342
27343
27344static int
27345test_xmlXIncludeProcessTreeFlags(void) {
27346    int test_ret = 0;
27347
27348#if defined(LIBXML_XINCLUDE_ENABLED)
27349    int mem_base;
27350    int ret_val;
27351    xmlNodePtr tree; /* a node in an XML document */
27352    int n_tree;
27353    int flags; /* a set of xmlParserOption used for parsing XML includes */
27354    int n_flags;
27355
27356    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27357    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27358        mem_base = xmlMemBlocks();
27359        tree = gen_xmlNodePtr(n_tree, 0);
27360        flags = gen_int(n_flags, 1);
27361
27362        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27363        desret_int(ret_val);
27364        call_tests++;
27365        des_xmlNodePtr(n_tree, tree, 0);
27366        des_int(n_flags, flags, 1);
27367        xmlResetLastError();
27368        if (mem_base != xmlMemBlocks()) {
27369            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27370	           xmlMemBlocks() - mem_base);
27371	    test_ret++;
27372            printf(" %d", n_tree);
27373            printf(" %d", n_flags);
27374            printf("\n");
27375        }
27376    }
27377    }
27378    function_tests++;
27379#endif
27380
27381    return(test_ret);
27382}
27383
27384
27385static int
27386test_xmlXIncludeProcessTreeFlagsData(void) {
27387    int test_ret = 0;
27388
27389#if defined(LIBXML_XINCLUDE_ENABLED)
27390    int mem_base;
27391    int ret_val;
27392    xmlNodePtr tree; /* an XML node */
27393    int n_tree;
27394    int flags; /* a set of xmlParserOption used for parsing XML includes */
27395    int n_flags;
27396    void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27397    int n_data;
27398
27399    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27400    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27401    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27402        mem_base = xmlMemBlocks();
27403        tree = gen_xmlNodePtr(n_tree, 0);
27404        flags = gen_int(n_flags, 1);
27405        data = gen_userdata(n_data, 2);
27406
27407        ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data);
27408        desret_int(ret_val);
27409        call_tests++;
27410        des_xmlNodePtr(n_tree, tree, 0);
27411        des_int(n_flags, flags, 1);
27412        des_userdata(n_data, data, 2);
27413        xmlResetLastError();
27414        if (mem_base != xmlMemBlocks()) {
27415            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData",
27416	           xmlMemBlocks() - mem_base);
27417	    test_ret++;
27418            printf(" %d", n_tree);
27419            printf(" %d", n_flags);
27420            printf(" %d", n_data);
27421            printf("\n");
27422        }
27423    }
27424    }
27425    }
27426    function_tests++;
27427#endif
27428
27429    return(test_ret);
27430}
27431
27432
27433static int
27434test_xmlXIncludeSetFlags(void) {
27435    int test_ret = 0;
27436
27437#if defined(LIBXML_XINCLUDE_ENABLED)
27438    int mem_base;
27439    int ret_val;
27440    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27441    int n_ctxt;
27442    int flags; /* a set of xmlParserOption used for parsing XML includes */
27443    int n_flags;
27444
27445    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27446    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27447        mem_base = xmlMemBlocks();
27448        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27449        flags = gen_int(n_flags, 1);
27450
27451        ret_val = xmlXIncludeSetFlags(ctxt, flags);
27452        desret_int(ret_val);
27453        call_tests++;
27454        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27455        des_int(n_flags, flags, 1);
27456        xmlResetLastError();
27457        if (mem_base != xmlMemBlocks()) {
27458            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27459	           xmlMemBlocks() - mem_base);
27460	    test_ret++;
27461            printf(" %d", n_ctxt);
27462            printf(" %d", n_flags);
27463            printf("\n");
27464        }
27465    }
27466    }
27467    function_tests++;
27468#endif
27469
27470    return(test_ret);
27471}
27472
27473static int
27474test_xinclude(void) {
27475    int test_ret = 0;
27476
27477    if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n");
27478    test_ret += test_xmlXIncludeNewContext();
27479    test_ret += test_xmlXIncludeProcess();
27480    test_ret += test_xmlXIncludeProcessFlags();
27481    test_ret += test_xmlXIncludeProcessFlagsData();
27482    test_ret += test_xmlXIncludeProcessNode();
27483    test_ret += test_xmlXIncludeProcessTree();
27484    test_ret += test_xmlXIncludeProcessTreeFlags();
27485    test_ret += test_xmlXIncludeProcessTreeFlagsData();
27486    test_ret += test_xmlXIncludeSetFlags();
27487
27488    if (test_ret != 0)
27489	printf("Module xinclude: %d errors\n", test_ret);
27490    return(test_ret);
27491}
27492
27493static int
27494test_xmlAllocOutputBuffer(void) {
27495    int test_ret = 0;
27496
27497#if defined(LIBXML_OUTPUT_ENABLED)
27498    int mem_base;
27499    xmlOutputBufferPtr ret_val;
27500    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27501    int n_encoder;
27502
27503    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27504        mem_base = xmlMemBlocks();
27505        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27506
27507        ret_val = xmlAllocOutputBuffer(encoder);
27508        desret_xmlOutputBufferPtr(ret_val);
27509        call_tests++;
27510        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27511        xmlResetLastError();
27512        if (mem_base != xmlMemBlocks()) {
27513            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27514	           xmlMemBlocks() - mem_base);
27515	    test_ret++;
27516            printf(" %d", n_encoder);
27517            printf("\n");
27518        }
27519    }
27520    function_tests++;
27521#endif
27522
27523    return(test_ret);
27524}
27525
27526
27527static int
27528test_xmlAllocParserInputBuffer(void) {
27529    int test_ret = 0;
27530
27531    int mem_base;
27532    xmlParserInputBufferPtr ret_val;
27533    xmlCharEncoding enc; /* the charset encoding if known */
27534    int n_enc;
27535
27536    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27537        mem_base = xmlMemBlocks();
27538        enc = gen_xmlCharEncoding(n_enc, 0);
27539
27540        ret_val = xmlAllocParserInputBuffer(enc);
27541        desret_xmlParserInputBufferPtr(ret_val);
27542        call_tests++;
27543        des_xmlCharEncoding(n_enc, enc, 0);
27544        xmlResetLastError();
27545        if (mem_base != xmlMemBlocks()) {
27546            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27547	           xmlMemBlocks() - mem_base);
27548	    test_ret++;
27549            printf(" %d", n_enc);
27550            printf("\n");
27551        }
27552    }
27553    function_tests++;
27554
27555    return(test_ret);
27556}
27557
27558
27559static int
27560test_xmlCheckFilename(void) {
27561    int test_ret = 0;
27562
27563    int mem_base;
27564    int ret_val;
27565    char * path; /* the path to check */
27566    int n_path;
27567
27568    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27569        mem_base = xmlMemBlocks();
27570        path = gen_const_char_ptr(n_path, 0);
27571
27572        ret_val = xmlCheckFilename((const char *)path);
27573        desret_int(ret_val);
27574        call_tests++;
27575        des_const_char_ptr(n_path, (const char *)path, 0);
27576        xmlResetLastError();
27577        if (mem_base != xmlMemBlocks()) {
27578            printf("Leak of %d blocks found in xmlCheckFilename",
27579	           xmlMemBlocks() - mem_base);
27580	    test_ret++;
27581            printf(" %d", n_path);
27582            printf("\n");
27583        }
27584    }
27585    function_tests++;
27586
27587    return(test_ret);
27588}
27589
27590
27591static int
27592test_xmlCheckHTTPInput(void) {
27593    int test_ret = 0;
27594
27595    int mem_base;
27596    xmlParserInputPtr ret_val;
27597    xmlParserCtxtPtr ctxt; /* an XML parser context */
27598    int n_ctxt;
27599    xmlParserInputPtr ret; /* an XML parser input */
27600    int n_ret;
27601
27602    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27603    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27604        mem_base = xmlMemBlocks();
27605        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27606        ret = gen_xmlParserInputPtr(n_ret, 1);
27607
27608        ret_val = xmlCheckHTTPInput(ctxt, ret);
27609        desret_xmlParserInputPtr(ret_val);
27610        call_tests++;
27611        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27612        des_xmlParserInputPtr(n_ret, ret, 1);
27613        xmlResetLastError();
27614        if (mem_base != xmlMemBlocks()) {
27615            printf("Leak of %d blocks found in xmlCheckHTTPInput",
27616	           xmlMemBlocks() - mem_base);
27617	    test_ret++;
27618            printf(" %d", n_ctxt);
27619            printf(" %d", n_ret);
27620            printf("\n");
27621        }
27622    }
27623    }
27624    function_tests++;
27625
27626    return(test_ret);
27627}
27628
27629
27630static int
27631test_xmlCleanupInputCallbacks(void) {
27632    int test_ret = 0;
27633
27634    int mem_base;
27635
27636        mem_base = xmlMemBlocks();
27637
27638        xmlCleanupInputCallbacks();
27639        call_tests++;
27640        xmlResetLastError();
27641        if (mem_base != xmlMemBlocks()) {
27642            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27643	           xmlMemBlocks() - mem_base);
27644	    test_ret++;
27645            printf("\n");
27646        }
27647    function_tests++;
27648
27649    return(test_ret);
27650}
27651
27652
27653static int
27654test_xmlCleanupOutputCallbacks(void) {
27655    int test_ret = 0;
27656
27657#if defined(LIBXML_OUTPUT_ENABLED)
27658    int mem_base;
27659
27660        mem_base = xmlMemBlocks();
27661
27662        xmlCleanupOutputCallbacks();
27663        call_tests++;
27664        xmlResetLastError();
27665        if (mem_base != xmlMemBlocks()) {
27666            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27667	           xmlMemBlocks() - mem_base);
27668	    test_ret++;
27669            printf("\n");
27670        }
27671    function_tests++;
27672#endif
27673
27674    return(test_ret);
27675}
27676
27677
27678static int
27679test_xmlFileClose(void) {
27680    int test_ret = 0;
27681
27682    int mem_base;
27683    int ret_val;
27684    void * context; /* the I/O context */
27685    int n_context;
27686
27687    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27688        mem_base = xmlMemBlocks();
27689        context = gen_void_ptr(n_context, 0);
27690
27691        ret_val = xmlFileClose(context);
27692        desret_int(ret_val);
27693        call_tests++;
27694        des_void_ptr(n_context, context, 0);
27695        xmlResetLastError();
27696        if (mem_base != xmlMemBlocks()) {
27697            printf("Leak of %d blocks found in xmlFileClose",
27698	           xmlMemBlocks() - mem_base);
27699	    test_ret++;
27700            printf(" %d", n_context);
27701            printf("\n");
27702        }
27703    }
27704    function_tests++;
27705
27706    return(test_ret);
27707}
27708
27709
27710static int
27711test_xmlFileMatch(void) {
27712    int test_ret = 0;
27713
27714    int mem_base;
27715    int ret_val;
27716    const char * filename; /* the URI for matching */
27717    int n_filename;
27718
27719    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27720        mem_base = xmlMemBlocks();
27721        filename = gen_filepath(n_filename, 0);
27722
27723        ret_val = xmlFileMatch(filename);
27724        desret_int(ret_val);
27725        call_tests++;
27726        des_filepath(n_filename, filename, 0);
27727        xmlResetLastError();
27728        if (mem_base != xmlMemBlocks()) {
27729            printf("Leak of %d blocks found in xmlFileMatch",
27730	           xmlMemBlocks() - mem_base);
27731	    test_ret++;
27732            printf(" %d", n_filename);
27733            printf("\n");
27734        }
27735    }
27736    function_tests++;
27737
27738    return(test_ret);
27739}
27740
27741
27742static int
27743test_xmlFileOpen(void) {
27744    int test_ret = 0;
27745
27746    int mem_base;
27747    void * ret_val;
27748    const char * filename; /* the URI for matching */
27749    int n_filename;
27750
27751    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27752        mem_base = xmlMemBlocks();
27753        filename = gen_filepath(n_filename, 0);
27754
27755        ret_val = xmlFileOpen(filename);
27756        desret_void_ptr(ret_val);
27757        call_tests++;
27758        des_filepath(n_filename, filename, 0);
27759        xmlResetLastError();
27760        if (mem_base != xmlMemBlocks()) {
27761            printf("Leak of %d blocks found in xmlFileOpen",
27762	           xmlMemBlocks() - mem_base);
27763	    test_ret++;
27764            printf(" %d", n_filename);
27765            printf("\n");
27766        }
27767    }
27768    function_tests++;
27769
27770    return(test_ret);
27771}
27772
27773
27774static int
27775test_xmlFileRead(void) {
27776    int test_ret = 0;
27777
27778    int mem_base;
27779    int ret_val;
27780    void * context; /* the I/O context */
27781    int n_context;
27782    char * buffer; /* where to drop data */
27783    int n_buffer;
27784    int len; /* number of bytes to write */
27785    int n_len;
27786
27787    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27788    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27789    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27790        mem_base = xmlMemBlocks();
27791        context = gen_void_ptr(n_context, 0);
27792        buffer = gen_char_ptr(n_buffer, 1);
27793        len = gen_int(n_len, 2);
27794
27795        ret_val = xmlFileRead(context, buffer, len);
27796        desret_int(ret_val);
27797        call_tests++;
27798        des_void_ptr(n_context, context, 0);
27799        des_char_ptr(n_buffer, buffer, 1);
27800        des_int(n_len, len, 2);
27801        xmlResetLastError();
27802        if (mem_base != xmlMemBlocks()) {
27803            printf("Leak of %d blocks found in xmlFileRead",
27804	           xmlMemBlocks() - mem_base);
27805	    test_ret++;
27806            printf(" %d", n_context);
27807            printf(" %d", n_buffer);
27808            printf(" %d", n_len);
27809            printf("\n");
27810        }
27811    }
27812    }
27813    }
27814    function_tests++;
27815
27816    return(test_ret);
27817}
27818
27819
27820static int
27821test_xmlIOFTPClose(void) {
27822    int test_ret = 0;
27823
27824#if defined(LIBXML_FTP_ENABLED)
27825    int mem_base;
27826    int ret_val;
27827    void * context; /* the I/O context */
27828    int n_context;
27829
27830    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27831        mem_base = xmlMemBlocks();
27832        context = gen_void_ptr(n_context, 0);
27833
27834        ret_val = xmlIOFTPClose(context);
27835        desret_int(ret_val);
27836        call_tests++;
27837        des_void_ptr(n_context, context, 0);
27838        xmlResetLastError();
27839        if (mem_base != xmlMemBlocks()) {
27840            printf("Leak of %d blocks found in xmlIOFTPClose",
27841	           xmlMemBlocks() - mem_base);
27842	    test_ret++;
27843            printf(" %d", n_context);
27844            printf("\n");
27845        }
27846    }
27847    function_tests++;
27848#endif
27849
27850    return(test_ret);
27851}
27852
27853
27854static int
27855test_xmlIOFTPMatch(void) {
27856    int test_ret = 0;
27857
27858#if defined(LIBXML_FTP_ENABLED)
27859    int mem_base;
27860    int ret_val;
27861    const char * filename; /* the URI for matching */
27862    int n_filename;
27863
27864    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27865        mem_base = xmlMemBlocks();
27866        filename = gen_filepath(n_filename, 0);
27867
27868        ret_val = xmlIOFTPMatch(filename);
27869        desret_int(ret_val);
27870        call_tests++;
27871        des_filepath(n_filename, filename, 0);
27872        xmlResetLastError();
27873        if (mem_base != xmlMemBlocks()) {
27874            printf("Leak of %d blocks found in xmlIOFTPMatch",
27875	           xmlMemBlocks() - mem_base);
27876	    test_ret++;
27877            printf(" %d", n_filename);
27878            printf("\n");
27879        }
27880    }
27881    function_tests++;
27882#endif
27883
27884    return(test_ret);
27885}
27886
27887
27888static int
27889test_xmlIOFTPOpen(void) {
27890    int test_ret = 0;
27891
27892#if defined(LIBXML_FTP_ENABLED)
27893    int mem_base;
27894    void * ret_val;
27895    const char * filename; /* the URI for matching */
27896    int n_filename;
27897
27898    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27899        mem_base = xmlMemBlocks();
27900        filename = gen_filepath(n_filename, 0);
27901
27902        ret_val = xmlIOFTPOpen(filename);
27903        desret_void_ptr(ret_val);
27904        call_tests++;
27905        des_filepath(n_filename, filename, 0);
27906        xmlResetLastError();
27907        if (mem_base != xmlMemBlocks()) {
27908            printf("Leak of %d blocks found in xmlIOFTPOpen",
27909	           xmlMemBlocks() - mem_base);
27910	    test_ret++;
27911            printf(" %d", n_filename);
27912            printf("\n");
27913        }
27914    }
27915    function_tests++;
27916#endif
27917
27918    return(test_ret);
27919}
27920
27921
27922static int
27923test_xmlIOFTPRead(void) {
27924    int test_ret = 0;
27925
27926#if defined(LIBXML_FTP_ENABLED)
27927    int mem_base;
27928    int ret_val;
27929    void * context; /* the I/O context */
27930    int n_context;
27931    char * buffer; /* where to drop data */
27932    int n_buffer;
27933    int len; /* number of bytes to write */
27934    int n_len;
27935
27936    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27937    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27938    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27939        mem_base = xmlMemBlocks();
27940        context = gen_void_ptr(n_context, 0);
27941        buffer = gen_char_ptr(n_buffer, 1);
27942        len = gen_int(n_len, 2);
27943
27944        ret_val = xmlIOFTPRead(context, buffer, len);
27945        desret_int(ret_val);
27946        call_tests++;
27947        des_void_ptr(n_context, context, 0);
27948        des_char_ptr(n_buffer, buffer, 1);
27949        des_int(n_len, len, 2);
27950        xmlResetLastError();
27951        if (mem_base != xmlMemBlocks()) {
27952            printf("Leak of %d blocks found in xmlIOFTPRead",
27953	           xmlMemBlocks() - mem_base);
27954	    test_ret++;
27955            printf(" %d", n_context);
27956            printf(" %d", n_buffer);
27957            printf(" %d", n_len);
27958            printf("\n");
27959        }
27960    }
27961    }
27962    }
27963    function_tests++;
27964#endif
27965
27966    return(test_ret);
27967}
27968
27969
27970static int
27971test_xmlIOHTTPClose(void) {
27972    int test_ret = 0;
27973
27974#if defined(LIBXML_HTTP_ENABLED)
27975    int mem_base;
27976    int ret_val;
27977    void * context; /* the I/O context */
27978    int n_context;
27979
27980    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27981        mem_base = xmlMemBlocks();
27982        context = gen_void_ptr(n_context, 0);
27983
27984        ret_val = xmlIOHTTPClose(context);
27985        desret_int(ret_val);
27986        call_tests++;
27987        des_void_ptr(n_context, context, 0);
27988        xmlResetLastError();
27989        if (mem_base != xmlMemBlocks()) {
27990            printf("Leak of %d blocks found in xmlIOHTTPClose",
27991	           xmlMemBlocks() - mem_base);
27992	    test_ret++;
27993            printf(" %d", n_context);
27994            printf("\n");
27995        }
27996    }
27997    function_tests++;
27998#endif
27999
28000    return(test_ret);
28001}
28002
28003
28004static int
28005test_xmlIOHTTPMatch(void) {
28006    int test_ret = 0;
28007
28008#if defined(LIBXML_HTTP_ENABLED)
28009    int mem_base;
28010    int ret_val;
28011    const char * filename; /* the URI for matching */
28012    int n_filename;
28013
28014    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28015        mem_base = xmlMemBlocks();
28016        filename = gen_filepath(n_filename, 0);
28017
28018        ret_val = xmlIOHTTPMatch(filename);
28019        desret_int(ret_val);
28020        call_tests++;
28021        des_filepath(n_filename, filename, 0);
28022        xmlResetLastError();
28023        if (mem_base != xmlMemBlocks()) {
28024            printf("Leak of %d blocks found in xmlIOHTTPMatch",
28025	           xmlMemBlocks() - mem_base);
28026	    test_ret++;
28027            printf(" %d", n_filename);
28028            printf("\n");
28029        }
28030    }
28031    function_tests++;
28032#endif
28033
28034    return(test_ret);
28035}
28036
28037
28038static int
28039test_xmlIOHTTPOpen(void) {
28040    int test_ret = 0;
28041
28042#if defined(LIBXML_HTTP_ENABLED)
28043    int mem_base;
28044    void * ret_val;
28045    const char * filename; /* the URI for matching */
28046    int n_filename;
28047
28048    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
28049        mem_base = xmlMemBlocks();
28050        filename = gen_filepath(n_filename, 0);
28051
28052        ret_val = xmlIOHTTPOpen(filename);
28053        desret_xmlNanoHTTPCtxtPtr(ret_val);
28054        call_tests++;
28055        des_filepath(n_filename, filename, 0);
28056        xmlResetLastError();
28057        if (mem_base != xmlMemBlocks()) {
28058            printf("Leak of %d blocks found in xmlIOHTTPOpen",
28059	           xmlMemBlocks() - mem_base);
28060	    test_ret++;
28061            printf(" %d", n_filename);
28062            printf("\n");
28063        }
28064    }
28065    function_tests++;
28066#endif
28067
28068    return(test_ret);
28069}
28070
28071
28072static int
28073test_xmlIOHTTPRead(void) {
28074    int test_ret = 0;
28075
28076#if defined(LIBXML_HTTP_ENABLED)
28077    int mem_base;
28078    int ret_val;
28079    void * context; /* the I/O context */
28080    int n_context;
28081    char * buffer; /* where to drop data */
28082    int n_buffer;
28083    int len; /* number of bytes to write */
28084    int n_len;
28085
28086    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
28087    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
28088    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28089        mem_base = xmlMemBlocks();
28090        context = gen_void_ptr(n_context, 0);
28091        buffer = gen_char_ptr(n_buffer, 1);
28092        len = gen_int(n_len, 2);
28093
28094        ret_val = xmlIOHTTPRead(context, buffer, len);
28095        desret_int(ret_val);
28096        call_tests++;
28097        des_void_ptr(n_context, context, 0);
28098        des_char_ptr(n_buffer, buffer, 1);
28099        des_int(n_len, len, 2);
28100        xmlResetLastError();
28101        if (mem_base != xmlMemBlocks()) {
28102            printf("Leak of %d blocks found in xmlIOHTTPRead",
28103	           xmlMemBlocks() - mem_base);
28104	    test_ret++;
28105            printf(" %d", n_context);
28106            printf(" %d", n_buffer);
28107            printf(" %d", n_len);
28108            printf("\n");
28109        }
28110    }
28111    }
28112    }
28113    function_tests++;
28114#endif
28115
28116    return(test_ret);
28117}
28118
28119
28120static int
28121test_xmlNoNetExternalEntityLoader(void) {
28122    int test_ret = 0;
28123
28124    int mem_base;
28125    xmlParserInputPtr ret_val;
28126    const char * URL; /* the URL for the entity to load */
28127    int n_URL;
28128    char * ID; /* the System ID for the entity to load */
28129    int n_ID;
28130    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
28131    int n_ctxt;
28132
28133    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
28134    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
28135    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
28136        mem_base = xmlMemBlocks();
28137        URL = gen_filepath(n_URL, 0);
28138        ID = gen_const_char_ptr(n_ID, 1);
28139        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
28140
28141        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
28142        desret_xmlParserInputPtr(ret_val);
28143        call_tests++;
28144        des_filepath(n_URL, URL, 0);
28145        des_const_char_ptr(n_ID, (const char *)ID, 1);
28146        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
28147        xmlResetLastError();
28148        if (mem_base != xmlMemBlocks()) {
28149            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
28150	           xmlMemBlocks() - mem_base);
28151	    test_ret++;
28152            printf(" %d", n_URL);
28153            printf(" %d", n_ID);
28154            printf(" %d", n_ctxt);
28155            printf("\n");
28156        }
28157    }
28158    }
28159    }
28160    function_tests++;
28161
28162    return(test_ret);
28163}
28164
28165
28166static int
28167test_xmlNormalizeWindowsPath(void) {
28168    int test_ret = 0;
28169
28170    int mem_base;
28171    xmlChar * ret_val;
28172    xmlChar * path; /* the input file path */
28173    int n_path;
28174
28175    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
28176        mem_base = xmlMemBlocks();
28177        path = gen_const_xmlChar_ptr(n_path, 0);
28178
28179        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
28180        desret_xmlChar_ptr(ret_val);
28181        call_tests++;
28182        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
28183        xmlResetLastError();
28184        if (mem_base != xmlMemBlocks()) {
28185            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
28186	           xmlMemBlocks() - mem_base);
28187	    test_ret++;
28188            printf(" %d", n_path);
28189            printf("\n");
28190        }
28191    }
28192    function_tests++;
28193
28194    return(test_ret);
28195}
28196
28197
28198static int
28199test_xmlOutputBufferCreateBuffer(void) {
28200    int test_ret = 0;
28201
28202#if defined(LIBXML_OUTPUT_ENABLED)
28203    int mem_base;
28204    xmlOutputBufferPtr ret_val;
28205    xmlBufferPtr buffer; /* a xmlBufferPtr */
28206    int n_buffer;
28207    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28208    int n_encoder;
28209
28210    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
28211    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28212        mem_base = xmlMemBlocks();
28213        buffer = gen_xmlBufferPtr(n_buffer, 0);
28214        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28215
28216        ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
28217        desret_xmlOutputBufferPtr(ret_val);
28218        call_tests++;
28219        des_xmlBufferPtr(n_buffer, buffer, 0);
28220        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28221        xmlResetLastError();
28222        if (mem_base != xmlMemBlocks()) {
28223            printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28224	           xmlMemBlocks() - mem_base);
28225	    test_ret++;
28226            printf(" %d", n_buffer);
28227            printf(" %d", n_encoder);
28228            printf("\n");
28229        }
28230    }
28231    }
28232    function_tests++;
28233#endif
28234
28235    return(test_ret);
28236}
28237
28238
28239static int
28240test_xmlOutputBufferCreateFd(void) {
28241    int test_ret = 0;
28242
28243#if defined(LIBXML_OUTPUT_ENABLED)
28244    int mem_base;
28245    xmlOutputBufferPtr ret_val;
28246    int fd; /* a file descriptor number */
28247    int n_fd;
28248    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28249    int n_encoder;
28250
28251    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28252    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28253        mem_base = xmlMemBlocks();
28254        fd = gen_int(n_fd, 0);
28255        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28256
28257        ret_val = xmlOutputBufferCreateFd(fd, encoder);
28258        desret_xmlOutputBufferPtr(ret_val);
28259        call_tests++;
28260        des_int(n_fd, fd, 0);
28261        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28262        xmlResetLastError();
28263        if (mem_base != xmlMemBlocks()) {
28264            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28265	           xmlMemBlocks() - mem_base);
28266	    test_ret++;
28267            printf(" %d", n_fd);
28268            printf(" %d", n_encoder);
28269            printf("\n");
28270        }
28271    }
28272    }
28273    function_tests++;
28274#endif
28275
28276    return(test_ret);
28277}
28278
28279
28280static int
28281test_xmlOutputBufferCreateFile(void) {
28282    int test_ret = 0;
28283
28284#if defined(LIBXML_OUTPUT_ENABLED)
28285    int mem_base;
28286    xmlOutputBufferPtr ret_val;
28287    FILE * file; /* a FILE* */
28288    int n_file;
28289    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28290    int n_encoder;
28291
28292    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28293    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28294        mem_base = xmlMemBlocks();
28295        file = gen_FILE_ptr(n_file, 0);
28296        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28297
28298        ret_val = xmlOutputBufferCreateFile(file, encoder);
28299        desret_xmlOutputBufferPtr(ret_val);
28300        call_tests++;
28301        des_FILE_ptr(n_file, file, 0);
28302        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28303        xmlResetLastError();
28304        if (mem_base != xmlMemBlocks()) {
28305            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28306	           xmlMemBlocks() - mem_base);
28307	    test_ret++;
28308            printf(" %d", n_file);
28309            printf(" %d", n_encoder);
28310            printf("\n");
28311        }
28312    }
28313    }
28314    function_tests++;
28315#endif
28316
28317    return(test_ret);
28318}
28319
28320
28321static int
28322test_xmlOutputBufferCreateFilename(void) {
28323    int test_ret = 0;
28324
28325#if defined(LIBXML_OUTPUT_ENABLED)
28326    int mem_base;
28327    xmlOutputBufferPtr ret_val;
28328    const char * URI; /* a C string containing the URI or filename */
28329    int n_URI;
28330    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28331    int n_encoder;
28332    int compression; /* the compression ration (0 none, 9 max). */
28333    int n_compression;
28334
28335    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28336    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28337    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28338        mem_base = xmlMemBlocks();
28339        URI = gen_fileoutput(n_URI, 0);
28340        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28341        compression = gen_int(n_compression, 2);
28342
28343        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28344        desret_xmlOutputBufferPtr(ret_val);
28345        call_tests++;
28346        des_fileoutput(n_URI, URI, 0);
28347        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28348        des_int(n_compression, compression, 2);
28349        xmlResetLastError();
28350        if (mem_base != xmlMemBlocks()) {
28351            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28352	           xmlMemBlocks() - mem_base);
28353	    test_ret++;
28354            printf(" %d", n_URI);
28355            printf(" %d", n_encoder);
28356            printf(" %d", n_compression);
28357            printf("\n");
28358        }
28359    }
28360    }
28361    }
28362    function_tests++;
28363#endif
28364
28365    return(test_ret);
28366}
28367
28368
28369static int
28370test_xmlOutputBufferFlush(void) {
28371    int test_ret = 0;
28372
28373#if defined(LIBXML_OUTPUT_ENABLED)
28374    int mem_base;
28375    int ret_val;
28376    xmlOutputBufferPtr out; /* a buffered output */
28377    int n_out;
28378
28379    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28380        mem_base = xmlMemBlocks();
28381        out = gen_xmlOutputBufferPtr(n_out, 0);
28382
28383        ret_val = xmlOutputBufferFlush(out);
28384        desret_int(ret_val);
28385        call_tests++;
28386        des_xmlOutputBufferPtr(n_out, out, 0);
28387        xmlResetLastError();
28388        if (mem_base != xmlMemBlocks()) {
28389            printf("Leak of %d blocks found in xmlOutputBufferFlush",
28390	           xmlMemBlocks() - mem_base);
28391	    test_ret++;
28392            printf(" %d", n_out);
28393            printf("\n");
28394        }
28395    }
28396    function_tests++;
28397#endif
28398
28399    return(test_ret);
28400}
28401
28402
28403static int
28404test_xmlOutputBufferWrite(void) {
28405    int test_ret = 0;
28406
28407#if defined(LIBXML_OUTPUT_ENABLED)
28408    int mem_base;
28409    int ret_val;
28410    xmlOutputBufferPtr out; /* a buffered parser output */
28411    int n_out;
28412    int len; /* the size in bytes of the array. */
28413    int n_len;
28414    char * buf; /* an char array */
28415    int n_buf;
28416
28417    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28418    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28419    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28420        mem_base = xmlMemBlocks();
28421        out = gen_xmlOutputBufferPtr(n_out, 0);
28422        len = gen_int(n_len, 1);
28423        buf = gen_const_char_ptr(n_buf, 2);
28424
28425        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28426        desret_int(ret_val);
28427        call_tests++;
28428        des_xmlOutputBufferPtr(n_out, out, 0);
28429        des_int(n_len, len, 1);
28430        des_const_char_ptr(n_buf, (const char *)buf, 2);
28431        xmlResetLastError();
28432        if (mem_base != xmlMemBlocks()) {
28433            printf("Leak of %d blocks found in xmlOutputBufferWrite",
28434	           xmlMemBlocks() - mem_base);
28435	    test_ret++;
28436            printf(" %d", n_out);
28437            printf(" %d", n_len);
28438            printf(" %d", n_buf);
28439            printf("\n");
28440        }
28441    }
28442    }
28443    }
28444    function_tests++;
28445#endif
28446
28447    return(test_ret);
28448}
28449
28450
28451static int
28452test_xmlOutputBufferWriteEscape(void) {
28453    int test_ret = 0;
28454
28455
28456    /* missing type support */
28457    return(test_ret);
28458}
28459
28460
28461static int
28462test_xmlOutputBufferWriteString(void) {
28463    int test_ret = 0;
28464
28465#if defined(LIBXML_OUTPUT_ENABLED)
28466    int mem_base;
28467    int ret_val;
28468    xmlOutputBufferPtr out; /* a buffered parser output */
28469    int n_out;
28470    char * str; /* a zero terminated C string */
28471    int n_str;
28472
28473    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28474    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28475        mem_base = xmlMemBlocks();
28476        out = gen_xmlOutputBufferPtr(n_out, 0);
28477        str = gen_const_char_ptr(n_str, 1);
28478
28479        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28480        desret_int(ret_val);
28481        call_tests++;
28482        des_xmlOutputBufferPtr(n_out, out, 0);
28483        des_const_char_ptr(n_str, (const char *)str, 1);
28484        xmlResetLastError();
28485        if (mem_base != xmlMemBlocks()) {
28486            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28487	           xmlMemBlocks() - mem_base);
28488	    test_ret++;
28489            printf(" %d", n_out);
28490            printf(" %d", n_str);
28491            printf("\n");
28492        }
28493    }
28494    }
28495    function_tests++;
28496#endif
28497
28498    return(test_ret);
28499}
28500
28501
28502static int
28503test_xmlParserGetDirectory(void) {
28504    int test_ret = 0;
28505
28506
28507    /* missing type support */
28508    return(test_ret);
28509}
28510
28511
28512static int
28513test_xmlParserInputBufferCreateFd(void) {
28514    int test_ret = 0;
28515
28516    int mem_base;
28517    xmlParserInputBufferPtr ret_val;
28518    int fd; /* a file descriptor number */
28519    int n_fd;
28520    xmlCharEncoding enc; /* the charset encoding if known */
28521    int n_enc;
28522
28523    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28524    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28525        mem_base = xmlMemBlocks();
28526        fd = gen_int(n_fd, 0);
28527        enc = gen_xmlCharEncoding(n_enc, 1);
28528        if (fd >= 0) fd = -1;
28529
28530        ret_val = xmlParserInputBufferCreateFd(fd, enc);
28531        desret_xmlParserInputBufferPtr(ret_val);
28532        call_tests++;
28533        des_int(n_fd, fd, 0);
28534        des_xmlCharEncoding(n_enc, enc, 1);
28535        xmlResetLastError();
28536        if (mem_base != xmlMemBlocks()) {
28537            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28538	           xmlMemBlocks() - mem_base);
28539	    test_ret++;
28540            printf(" %d", n_fd);
28541            printf(" %d", n_enc);
28542            printf("\n");
28543        }
28544    }
28545    }
28546    function_tests++;
28547
28548    return(test_ret);
28549}
28550
28551
28552static int
28553test_xmlParserInputBufferCreateFile(void) {
28554    int test_ret = 0;
28555
28556    int mem_base;
28557    xmlParserInputBufferPtr ret_val;
28558    FILE * file; /* a FILE* */
28559    int n_file;
28560    xmlCharEncoding enc; /* the charset encoding if known */
28561    int n_enc;
28562
28563    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28564    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28565        mem_base = xmlMemBlocks();
28566        file = gen_FILE_ptr(n_file, 0);
28567        enc = gen_xmlCharEncoding(n_enc, 1);
28568
28569        ret_val = xmlParserInputBufferCreateFile(file, enc);
28570        desret_xmlParserInputBufferPtr(ret_val);
28571        call_tests++;
28572        des_FILE_ptr(n_file, file, 0);
28573        des_xmlCharEncoding(n_enc, enc, 1);
28574        xmlResetLastError();
28575        if (mem_base != xmlMemBlocks()) {
28576            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28577	           xmlMemBlocks() - mem_base);
28578	    test_ret++;
28579            printf(" %d", n_file);
28580            printf(" %d", n_enc);
28581            printf("\n");
28582        }
28583    }
28584    }
28585    function_tests++;
28586
28587    return(test_ret);
28588}
28589
28590
28591static int
28592test_xmlParserInputBufferCreateFilename(void) {
28593    int test_ret = 0;
28594
28595    int mem_base;
28596    xmlParserInputBufferPtr ret_val;
28597    const char * URI; /* a C string containing the URI or filename */
28598    int n_URI;
28599    xmlCharEncoding enc; /* the charset encoding if known */
28600    int n_enc;
28601
28602    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28603    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28604        mem_base = xmlMemBlocks();
28605        URI = gen_fileoutput(n_URI, 0);
28606        enc = gen_xmlCharEncoding(n_enc, 1);
28607
28608        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28609        desret_xmlParserInputBufferPtr(ret_val);
28610        call_tests++;
28611        des_fileoutput(n_URI, URI, 0);
28612        des_xmlCharEncoding(n_enc, enc, 1);
28613        xmlResetLastError();
28614        if (mem_base != xmlMemBlocks()) {
28615            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28616	           xmlMemBlocks() - mem_base);
28617	    test_ret++;
28618            printf(" %d", n_URI);
28619            printf(" %d", n_enc);
28620            printf("\n");
28621        }
28622    }
28623    }
28624    function_tests++;
28625
28626    return(test_ret);
28627}
28628
28629
28630static int
28631test_xmlParserInputBufferCreateMem(void) {
28632    int test_ret = 0;
28633
28634    int mem_base;
28635    xmlParserInputBufferPtr ret_val;
28636    char * mem; /* the memory input */
28637    int n_mem;
28638    int size; /* the length of the memory block */
28639    int n_size;
28640    xmlCharEncoding enc; /* the charset encoding if known */
28641    int n_enc;
28642
28643    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28644    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28645    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28646        mem_base = xmlMemBlocks();
28647        mem = gen_const_char_ptr(n_mem, 0);
28648        size = gen_int(n_size, 1);
28649        enc = gen_xmlCharEncoding(n_enc, 2);
28650
28651        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28652        desret_xmlParserInputBufferPtr(ret_val);
28653        call_tests++;
28654        des_const_char_ptr(n_mem, (const char *)mem, 0);
28655        des_int(n_size, size, 1);
28656        des_xmlCharEncoding(n_enc, enc, 2);
28657        xmlResetLastError();
28658        if (mem_base != xmlMemBlocks()) {
28659            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28660	           xmlMemBlocks() - mem_base);
28661	    test_ret++;
28662            printf(" %d", n_mem);
28663            printf(" %d", n_size);
28664            printf(" %d", n_enc);
28665            printf("\n");
28666        }
28667    }
28668    }
28669    }
28670    function_tests++;
28671
28672    return(test_ret);
28673}
28674
28675
28676static int
28677test_xmlParserInputBufferCreateStatic(void) {
28678    int test_ret = 0;
28679
28680    int mem_base;
28681    xmlParserInputBufferPtr ret_val;
28682    char * mem; /* the memory input */
28683    int n_mem;
28684    int size; /* the length of the memory block */
28685    int n_size;
28686    xmlCharEncoding enc; /* the charset encoding if known */
28687    int n_enc;
28688
28689    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28690    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28691    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28692        mem_base = xmlMemBlocks();
28693        mem = gen_const_char_ptr(n_mem, 0);
28694        size = gen_int(n_size, 1);
28695        enc = gen_xmlCharEncoding(n_enc, 2);
28696
28697        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28698        desret_xmlParserInputBufferPtr(ret_val);
28699        call_tests++;
28700        des_const_char_ptr(n_mem, (const char *)mem, 0);
28701        des_int(n_size, size, 1);
28702        des_xmlCharEncoding(n_enc, enc, 2);
28703        xmlResetLastError();
28704        if (mem_base != xmlMemBlocks()) {
28705            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28706	           xmlMemBlocks() - mem_base);
28707	    test_ret++;
28708            printf(" %d", n_mem);
28709            printf(" %d", n_size);
28710            printf(" %d", n_enc);
28711            printf("\n");
28712        }
28713    }
28714    }
28715    }
28716    function_tests++;
28717
28718    return(test_ret);
28719}
28720
28721
28722static int
28723test_xmlParserInputBufferGrow(void) {
28724    int test_ret = 0;
28725
28726    int mem_base;
28727    int ret_val;
28728    xmlParserInputBufferPtr in; /* a buffered parser input */
28729    int n_in;
28730    int len; /* indicative value of the amount of chars to read */
28731    int n_len;
28732
28733    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28734    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28735        mem_base = xmlMemBlocks();
28736        in = gen_xmlParserInputBufferPtr(n_in, 0);
28737        len = gen_int(n_len, 1);
28738
28739        ret_val = xmlParserInputBufferGrow(in, len);
28740        desret_int(ret_val);
28741        call_tests++;
28742        des_xmlParserInputBufferPtr(n_in, in, 0);
28743        des_int(n_len, len, 1);
28744        xmlResetLastError();
28745        if (mem_base != xmlMemBlocks()) {
28746            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28747	           xmlMemBlocks() - mem_base);
28748	    test_ret++;
28749            printf(" %d", n_in);
28750            printf(" %d", n_len);
28751            printf("\n");
28752        }
28753    }
28754    }
28755    function_tests++;
28756
28757    return(test_ret);
28758}
28759
28760
28761static int
28762test_xmlParserInputBufferPush(void) {
28763    int test_ret = 0;
28764
28765    int mem_base;
28766    int ret_val;
28767    xmlParserInputBufferPtr in; /* a buffered parser input */
28768    int n_in;
28769    int len; /* the size in bytes of the array. */
28770    int n_len;
28771    char * buf; /* an char array */
28772    int n_buf;
28773
28774    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28775    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28776    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28777        mem_base = xmlMemBlocks();
28778        in = gen_xmlParserInputBufferPtr(n_in, 0);
28779        len = gen_int(n_len, 1);
28780        buf = gen_const_char_ptr(n_buf, 2);
28781
28782        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28783        desret_int(ret_val);
28784        call_tests++;
28785        des_xmlParserInputBufferPtr(n_in, in, 0);
28786        des_int(n_len, len, 1);
28787        des_const_char_ptr(n_buf, (const char *)buf, 2);
28788        xmlResetLastError();
28789        if (mem_base != xmlMemBlocks()) {
28790            printf("Leak of %d blocks found in xmlParserInputBufferPush",
28791	           xmlMemBlocks() - mem_base);
28792	    test_ret++;
28793            printf(" %d", n_in);
28794            printf(" %d", n_len);
28795            printf(" %d", n_buf);
28796            printf("\n");
28797        }
28798    }
28799    }
28800    }
28801    function_tests++;
28802
28803    return(test_ret);
28804}
28805
28806
28807static int
28808test_xmlParserInputBufferRead(void) {
28809    int test_ret = 0;
28810
28811    int mem_base;
28812    int ret_val;
28813    xmlParserInputBufferPtr in; /* a buffered parser input */
28814    int n_in;
28815    int len; /* indicative value of the amount of chars to read */
28816    int n_len;
28817
28818    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28819    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28820        mem_base = xmlMemBlocks();
28821        in = gen_xmlParserInputBufferPtr(n_in, 0);
28822        len = gen_int(n_len, 1);
28823
28824        ret_val = xmlParserInputBufferRead(in, len);
28825        desret_int(ret_val);
28826        call_tests++;
28827        des_xmlParserInputBufferPtr(n_in, in, 0);
28828        des_int(n_len, len, 1);
28829        xmlResetLastError();
28830        if (mem_base != xmlMemBlocks()) {
28831            printf("Leak of %d blocks found in xmlParserInputBufferRead",
28832	           xmlMemBlocks() - mem_base);
28833	    test_ret++;
28834            printf(" %d", n_in);
28835            printf(" %d", n_len);
28836            printf("\n");
28837        }
28838    }
28839    }
28840    function_tests++;
28841
28842    return(test_ret);
28843}
28844
28845
28846static int
28847test_xmlPopInputCallbacks(void) {
28848    int test_ret = 0;
28849
28850    int mem_base;
28851    int ret_val;
28852
28853        mem_base = xmlMemBlocks();
28854
28855        ret_val = xmlPopInputCallbacks();
28856        desret_int(ret_val);
28857        call_tests++;
28858        xmlResetLastError();
28859        if (mem_base != xmlMemBlocks()) {
28860            printf("Leak of %d blocks found in xmlPopInputCallbacks",
28861	           xmlMemBlocks() - mem_base);
28862	    test_ret++;
28863            printf("\n");
28864        }
28865    function_tests++;
28866
28867    return(test_ret);
28868}
28869
28870
28871static int
28872test_xmlRegisterDefaultInputCallbacks(void) {
28873    int test_ret = 0;
28874
28875    int mem_base;
28876
28877        mem_base = xmlMemBlocks();
28878
28879        xmlRegisterDefaultInputCallbacks();
28880        call_tests++;
28881        xmlResetLastError();
28882        if (mem_base != xmlMemBlocks()) {
28883            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28884	           xmlMemBlocks() - mem_base);
28885	    test_ret++;
28886            printf("\n");
28887        }
28888    function_tests++;
28889
28890    return(test_ret);
28891}
28892
28893
28894static int
28895test_xmlRegisterDefaultOutputCallbacks(void) {
28896    int test_ret = 0;
28897
28898#if defined(LIBXML_OUTPUT_ENABLED)
28899    int mem_base;
28900
28901        mem_base = xmlMemBlocks();
28902
28903        xmlRegisterDefaultOutputCallbacks();
28904        call_tests++;
28905        xmlResetLastError();
28906        if (mem_base != xmlMemBlocks()) {
28907            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28908	           xmlMemBlocks() - mem_base);
28909	    test_ret++;
28910            printf("\n");
28911        }
28912    function_tests++;
28913#endif
28914
28915    return(test_ret);
28916}
28917
28918
28919static int
28920test_xmlRegisterHTTPPostCallbacks(void) {
28921    int test_ret = 0;
28922
28923#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28924    int mem_base;
28925
28926        mem_base = xmlMemBlocks();
28927
28928        xmlRegisterHTTPPostCallbacks();
28929        call_tests++;
28930        xmlResetLastError();
28931        if (mem_base != xmlMemBlocks()) {
28932            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28933	           xmlMemBlocks() - mem_base);
28934	    test_ret++;
28935            printf("\n");
28936        }
28937    function_tests++;
28938#endif
28939
28940    return(test_ret);
28941}
28942
28943static int
28944test_xmlIO(void) {
28945    int test_ret = 0;
28946
28947    if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28948    test_ret += test_xmlAllocOutputBuffer();
28949    test_ret += test_xmlAllocParserInputBuffer();
28950    test_ret += test_xmlCheckFilename();
28951    test_ret += test_xmlCheckHTTPInput();
28952    test_ret += test_xmlCleanupInputCallbacks();
28953    test_ret += test_xmlCleanupOutputCallbacks();
28954    test_ret += test_xmlFileClose();
28955    test_ret += test_xmlFileMatch();
28956    test_ret += test_xmlFileOpen();
28957    test_ret += test_xmlFileRead();
28958    test_ret += test_xmlIOFTPClose();
28959    test_ret += test_xmlIOFTPMatch();
28960    test_ret += test_xmlIOFTPOpen();
28961    test_ret += test_xmlIOFTPRead();
28962    test_ret += test_xmlIOHTTPClose();
28963    test_ret += test_xmlIOHTTPMatch();
28964    test_ret += test_xmlIOHTTPOpen();
28965    test_ret += test_xmlIOHTTPRead();
28966    test_ret += test_xmlNoNetExternalEntityLoader();
28967    test_ret += test_xmlNormalizeWindowsPath();
28968    test_ret += test_xmlOutputBufferCreateBuffer();
28969    test_ret += test_xmlOutputBufferCreateFd();
28970    test_ret += test_xmlOutputBufferCreateFile();
28971    test_ret += test_xmlOutputBufferCreateFilename();
28972    test_ret += test_xmlOutputBufferFlush();
28973    test_ret += test_xmlOutputBufferWrite();
28974    test_ret += test_xmlOutputBufferWriteEscape();
28975    test_ret += test_xmlOutputBufferWriteString();
28976    test_ret += test_xmlParserGetDirectory();
28977    test_ret += test_xmlParserInputBufferCreateFd();
28978    test_ret += test_xmlParserInputBufferCreateFile();
28979    test_ret += test_xmlParserInputBufferCreateFilename();
28980    test_ret += test_xmlParserInputBufferCreateMem();
28981    test_ret += test_xmlParserInputBufferCreateStatic();
28982    test_ret += test_xmlParserInputBufferGrow();
28983    test_ret += test_xmlParserInputBufferPush();
28984    test_ret += test_xmlParserInputBufferRead();
28985    test_ret += test_xmlPopInputCallbacks();
28986    test_ret += test_xmlRegisterDefaultInputCallbacks();
28987    test_ret += test_xmlRegisterDefaultOutputCallbacks();
28988    test_ret += test_xmlRegisterHTTPPostCallbacks();
28989
28990    if (test_ret != 0)
28991	printf("Module xmlIO: %d errors\n", test_ret);
28992    return(test_ret);
28993}
28994#ifdef LIBXML_AUTOMATA_ENABLED
28995
28996#define gen_nb_xmlAutomataPtr 1
28997static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28998    return(NULL);
28999}
29000static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29001}
29002#endif
29003
29004
29005static int
29006test_xmlAutomataCompile(void) {
29007    int test_ret = 0;
29008
29009
29010    /* missing type support */
29011    return(test_ret);
29012}
29013
29014
29015static int
29016test_xmlAutomataGetInitState(void) {
29017    int test_ret = 0;
29018
29019
29020    /* missing type support */
29021    return(test_ret);
29022}
29023
29024
29025static int
29026test_xmlAutomataIsDeterminist(void) {
29027    int test_ret = 0;
29028
29029#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29030    int mem_base;
29031    int ret_val;
29032    xmlAutomataPtr am; /* an automata */
29033    int n_am;
29034
29035    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29036        mem_base = xmlMemBlocks();
29037        am = gen_xmlAutomataPtr(n_am, 0);
29038
29039        ret_val = xmlAutomataIsDeterminist(am);
29040        desret_int(ret_val);
29041        call_tests++;
29042        des_xmlAutomataPtr(n_am, am, 0);
29043        xmlResetLastError();
29044        if (mem_base != xmlMemBlocks()) {
29045            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
29046	           xmlMemBlocks() - mem_base);
29047	    test_ret++;
29048            printf(" %d", n_am);
29049            printf("\n");
29050        }
29051    }
29052    function_tests++;
29053#endif
29054
29055    return(test_ret);
29056}
29057
29058#ifdef LIBXML_AUTOMATA_ENABLED
29059
29060#define gen_nb_xmlAutomataStatePtr 1
29061static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29062    return(NULL);
29063}
29064static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29065}
29066#endif
29067
29068
29069static int
29070test_xmlAutomataNewAllTrans(void) {
29071    int test_ret = 0;
29072
29073
29074    /* missing type support */
29075    return(test_ret);
29076}
29077
29078
29079static int
29080test_xmlAutomataNewCountTrans(void) {
29081    int test_ret = 0;
29082
29083
29084    /* missing type support */
29085    return(test_ret);
29086}
29087
29088
29089static int
29090test_xmlAutomataNewCountTrans2(void) {
29091    int test_ret = 0;
29092
29093
29094    /* missing type support */
29095    return(test_ret);
29096}
29097
29098
29099static int
29100test_xmlAutomataNewCountedTrans(void) {
29101    int test_ret = 0;
29102
29103
29104    /* missing type support */
29105    return(test_ret);
29106}
29107
29108
29109static int
29110test_xmlAutomataNewCounter(void) {
29111    int test_ret = 0;
29112
29113#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29114    int mem_base;
29115    int ret_val;
29116    xmlAutomataPtr am; /* an automata */
29117    int n_am;
29118    int min; /* the minimal value on the counter */
29119    int n_min;
29120    int max; /* the maximal value on the counter */
29121    int n_max;
29122
29123    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29124    for (n_min = 0;n_min < gen_nb_int;n_min++) {
29125    for (n_max = 0;n_max < gen_nb_int;n_max++) {
29126        mem_base = xmlMemBlocks();
29127        am = gen_xmlAutomataPtr(n_am, 0);
29128        min = gen_int(n_min, 1);
29129        max = gen_int(n_max, 2);
29130
29131        ret_val = xmlAutomataNewCounter(am, min, max);
29132        desret_int(ret_val);
29133        call_tests++;
29134        des_xmlAutomataPtr(n_am, am, 0);
29135        des_int(n_min, min, 1);
29136        des_int(n_max, max, 2);
29137        xmlResetLastError();
29138        if (mem_base != xmlMemBlocks()) {
29139            printf("Leak of %d blocks found in xmlAutomataNewCounter",
29140	           xmlMemBlocks() - mem_base);
29141	    test_ret++;
29142            printf(" %d", n_am);
29143            printf(" %d", n_min);
29144            printf(" %d", n_max);
29145            printf("\n");
29146        }
29147    }
29148    }
29149    }
29150    function_tests++;
29151#endif
29152
29153    return(test_ret);
29154}
29155
29156
29157static int
29158test_xmlAutomataNewCounterTrans(void) {
29159    int test_ret = 0;
29160
29161
29162    /* missing type support */
29163    return(test_ret);
29164}
29165
29166
29167static int
29168test_xmlAutomataNewEpsilon(void) {
29169    int test_ret = 0;
29170
29171
29172    /* missing type support */
29173    return(test_ret);
29174}
29175
29176
29177static int
29178test_xmlAutomataNewNegTrans(void) {
29179    int test_ret = 0;
29180
29181
29182    /* missing type support */
29183    return(test_ret);
29184}
29185
29186
29187static int
29188test_xmlAutomataNewOnceTrans(void) {
29189    int test_ret = 0;
29190
29191
29192    /* missing type support */
29193    return(test_ret);
29194}
29195
29196
29197static int
29198test_xmlAutomataNewOnceTrans2(void) {
29199    int test_ret = 0;
29200
29201
29202    /* missing type support */
29203    return(test_ret);
29204}
29205
29206
29207static int
29208test_xmlAutomataNewState(void) {
29209    int test_ret = 0;
29210
29211
29212    /* missing type support */
29213    return(test_ret);
29214}
29215
29216
29217static int
29218test_xmlAutomataNewTransition(void) {
29219    int test_ret = 0;
29220
29221
29222    /* missing type support */
29223    return(test_ret);
29224}
29225
29226
29227static int
29228test_xmlAutomataNewTransition2(void) {
29229    int test_ret = 0;
29230
29231
29232    /* missing type support */
29233    return(test_ret);
29234}
29235
29236
29237static int
29238test_xmlAutomataSetFinalState(void) {
29239    int test_ret = 0;
29240
29241#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29242    int mem_base;
29243    int ret_val;
29244    xmlAutomataPtr am; /* an automata */
29245    int n_am;
29246    xmlAutomataStatePtr state; /* a state in this automata */
29247    int n_state;
29248
29249    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29250    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29251        mem_base = xmlMemBlocks();
29252        am = gen_xmlAutomataPtr(n_am, 0);
29253        state = gen_xmlAutomataStatePtr(n_state, 1);
29254
29255        ret_val = xmlAutomataSetFinalState(am, state);
29256        desret_int(ret_val);
29257        call_tests++;
29258        des_xmlAutomataPtr(n_am, am, 0);
29259        des_xmlAutomataStatePtr(n_state, state, 1);
29260        xmlResetLastError();
29261        if (mem_base != xmlMemBlocks()) {
29262            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29263	           xmlMemBlocks() - mem_base);
29264	    test_ret++;
29265            printf(" %d", n_am);
29266            printf(" %d", n_state);
29267            printf("\n");
29268        }
29269    }
29270    }
29271    function_tests++;
29272#endif
29273
29274    return(test_ret);
29275}
29276
29277
29278static int
29279test_xmlNewAutomata(void) {
29280    int test_ret = 0;
29281
29282
29283    /* missing type support */
29284    return(test_ret);
29285}
29286
29287static int
29288test_xmlautomata(void) {
29289    int test_ret = 0;
29290
29291    if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29292    test_ret += test_xmlAutomataCompile();
29293    test_ret += test_xmlAutomataGetInitState();
29294    test_ret += test_xmlAutomataIsDeterminist();
29295    test_ret += test_xmlAutomataNewAllTrans();
29296    test_ret += test_xmlAutomataNewCountTrans();
29297    test_ret += test_xmlAutomataNewCountTrans2();
29298    test_ret += test_xmlAutomataNewCountedTrans();
29299    test_ret += test_xmlAutomataNewCounter();
29300    test_ret += test_xmlAutomataNewCounterTrans();
29301    test_ret += test_xmlAutomataNewEpsilon();
29302    test_ret += test_xmlAutomataNewNegTrans();
29303    test_ret += test_xmlAutomataNewOnceTrans();
29304    test_ret += test_xmlAutomataNewOnceTrans2();
29305    test_ret += test_xmlAutomataNewState();
29306    test_ret += test_xmlAutomataNewTransition();
29307    test_ret += test_xmlAutomataNewTransition2();
29308    test_ret += test_xmlAutomataSetFinalState();
29309    test_ret += test_xmlNewAutomata();
29310
29311    if (test_ret != 0)
29312	printf("Module xmlautomata: %d errors\n", test_ret);
29313    return(test_ret);
29314}
29315
29316#define gen_nb_xmlGenericErrorFunc_ptr 1
29317static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29318    return(NULL);
29319}
29320static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29321}
29322
29323static int
29324test_initGenericErrorDefaultFunc(void) {
29325    int test_ret = 0;
29326
29327    int mem_base;
29328    xmlGenericErrorFunc * handler; /* the handler */
29329    int n_handler;
29330
29331    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29332        mem_base = xmlMemBlocks();
29333        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29334
29335        initGenericErrorDefaultFunc(handler);
29336        call_tests++;
29337        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29338        xmlResetLastError();
29339        if (mem_base != xmlMemBlocks()) {
29340            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29341	           xmlMemBlocks() - mem_base);
29342	    test_ret++;
29343            printf(" %d", n_handler);
29344            printf("\n");
29345        }
29346    }
29347    function_tests++;
29348
29349    return(test_ret);
29350}
29351
29352
29353#define gen_nb_xmlErrorPtr 1
29354static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29355    return(NULL);
29356}
29357static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29358}
29359
29360static int
29361test_xmlCopyError(void) {
29362    int test_ret = 0;
29363
29364    int mem_base;
29365    int ret_val;
29366    xmlErrorPtr from; /* a source error */
29367    int n_from;
29368    xmlErrorPtr to; /* a target error */
29369    int n_to;
29370
29371    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29372    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29373        mem_base = xmlMemBlocks();
29374        from = gen_xmlErrorPtr(n_from, 0);
29375        to = gen_xmlErrorPtr(n_to, 1);
29376
29377        ret_val = xmlCopyError(from, to);
29378        desret_int(ret_val);
29379        call_tests++;
29380        des_xmlErrorPtr(n_from, from, 0);
29381        des_xmlErrorPtr(n_to, to, 1);
29382        xmlResetLastError();
29383        if (mem_base != xmlMemBlocks()) {
29384            printf("Leak of %d blocks found in xmlCopyError",
29385	           xmlMemBlocks() - mem_base);
29386	    test_ret++;
29387            printf(" %d", n_from);
29388            printf(" %d", n_to);
29389            printf("\n");
29390        }
29391    }
29392    }
29393    function_tests++;
29394
29395    return(test_ret);
29396}
29397
29398
29399static int
29400test_xmlCtxtGetLastError(void) {
29401    int test_ret = 0;
29402
29403
29404    /* missing type support */
29405    return(test_ret);
29406}
29407
29408
29409static int
29410test_xmlCtxtResetLastError(void) {
29411    int test_ret = 0;
29412
29413    int mem_base;
29414    void * ctx; /* an XML parser context */
29415    int n_ctx;
29416
29417    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29418        mem_base = xmlMemBlocks();
29419        ctx = gen_void_ptr(n_ctx, 0);
29420
29421        xmlCtxtResetLastError(ctx);
29422        call_tests++;
29423        des_void_ptr(n_ctx, ctx, 0);
29424        xmlResetLastError();
29425        if (mem_base != xmlMemBlocks()) {
29426            printf("Leak of %d blocks found in xmlCtxtResetLastError",
29427	           xmlMemBlocks() - mem_base);
29428	    test_ret++;
29429            printf(" %d", n_ctx);
29430            printf("\n");
29431        }
29432    }
29433    function_tests++;
29434
29435    return(test_ret);
29436}
29437
29438
29439static int
29440test_xmlGetLastError(void) {
29441    int test_ret = 0;
29442
29443
29444    /* missing type support */
29445    return(test_ret);
29446}
29447
29448
29449static int
29450test_xmlParserError(void) {
29451    int test_ret = 0;
29452
29453
29454    /* missing type support */
29455    return(test_ret);
29456}
29457
29458
29459static int
29460test_xmlParserPrintFileContext(void) {
29461    int test_ret = 0;
29462
29463    int mem_base;
29464    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29465    int n_input;
29466
29467    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29468        mem_base = xmlMemBlocks();
29469        input = gen_xmlParserInputPtr(n_input, 0);
29470
29471        xmlParserPrintFileContext(input);
29472        call_tests++;
29473        des_xmlParserInputPtr(n_input, input, 0);
29474        xmlResetLastError();
29475        if (mem_base != xmlMemBlocks()) {
29476            printf("Leak of %d blocks found in xmlParserPrintFileContext",
29477	           xmlMemBlocks() - mem_base);
29478	    test_ret++;
29479            printf(" %d", n_input);
29480            printf("\n");
29481        }
29482    }
29483    function_tests++;
29484
29485    return(test_ret);
29486}
29487
29488
29489static int
29490test_xmlParserPrintFileInfo(void) {
29491    int test_ret = 0;
29492
29493    int mem_base;
29494    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29495    int n_input;
29496
29497    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29498        mem_base = xmlMemBlocks();
29499        input = gen_xmlParserInputPtr(n_input, 0);
29500
29501        xmlParserPrintFileInfo(input);
29502        call_tests++;
29503        des_xmlParserInputPtr(n_input, input, 0);
29504        xmlResetLastError();
29505        if (mem_base != xmlMemBlocks()) {
29506            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29507	           xmlMemBlocks() - mem_base);
29508	    test_ret++;
29509            printf(" %d", n_input);
29510            printf("\n");
29511        }
29512    }
29513    function_tests++;
29514
29515    return(test_ret);
29516}
29517
29518
29519static int
29520test_xmlParserValidityError(void) {
29521    int test_ret = 0;
29522
29523
29524    /* missing type support */
29525    return(test_ret);
29526}
29527
29528
29529static int
29530test_xmlParserValidityWarning(void) {
29531    int test_ret = 0;
29532
29533
29534    /* missing type support */
29535    return(test_ret);
29536}
29537
29538
29539static int
29540test_xmlParserWarning(void) {
29541    int test_ret = 0;
29542
29543
29544    /* missing type support */
29545    return(test_ret);
29546}
29547
29548
29549static int
29550test_xmlResetError(void) {
29551    int test_ret = 0;
29552
29553    int mem_base;
29554    xmlErrorPtr err; /* pointer to the error. */
29555    int n_err;
29556
29557    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29558        mem_base = xmlMemBlocks();
29559        err = gen_xmlErrorPtr(n_err, 0);
29560
29561        xmlResetError(err);
29562        call_tests++;
29563        des_xmlErrorPtr(n_err, err, 0);
29564        xmlResetLastError();
29565        if (mem_base != xmlMemBlocks()) {
29566            printf("Leak of %d blocks found in xmlResetError",
29567	           xmlMemBlocks() - mem_base);
29568	    test_ret++;
29569            printf(" %d", n_err);
29570            printf("\n");
29571        }
29572    }
29573    function_tests++;
29574
29575    return(test_ret);
29576}
29577
29578
29579static int
29580test_xmlResetLastError(void) {
29581    int test_ret = 0;
29582
29583
29584
29585        xmlResetLastError();
29586        call_tests++;
29587        xmlResetLastError();
29588    function_tests++;
29589
29590    return(test_ret);
29591}
29592
29593
29594static int
29595test_xmlSetGenericErrorFunc(void) {
29596    int test_ret = 0;
29597
29598
29599    /* missing type support */
29600    return(test_ret);
29601}
29602
29603
29604static int
29605test_xmlSetStructuredErrorFunc(void) {
29606    int test_ret = 0;
29607
29608
29609    /* missing type support */
29610    return(test_ret);
29611}
29612
29613static int
29614test_xmlerror(void) {
29615    int test_ret = 0;
29616
29617    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29618    test_ret += test_initGenericErrorDefaultFunc();
29619    test_ret += test_xmlCopyError();
29620    test_ret += test_xmlCtxtGetLastError();
29621    test_ret += test_xmlCtxtResetLastError();
29622    test_ret += test_xmlGetLastError();
29623    test_ret += test_xmlParserError();
29624    test_ret += test_xmlParserPrintFileContext();
29625    test_ret += test_xmlParserPrintFileInfo();
29626    test_ret += test_xmlParserValidityError();
29627    test_ret += test_xmlParserValidityWarning();
29628    test_ret += test_xmlParserWarning();
29629    test_ret += test_xmlResetError();
29630    test_ret += test_xmlResetLastError();
29631    test_ret += test_xmlSetGenericErrorFunc();
29632    test_ret += test_xmlSetStructuredErrorFunc();
29633
29634    if (test_ret != 0)
29635	printf("Module xmlerror: %d errors\n", test_ret);
29636    return(test_ret);
29637}
29638#ifdef LIBXML_MODULES_ENABLED
29639
29640#define gen_nb_xmlModulePtr 1
29641static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29642    return(NULL);
29643}
29644static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29645}
29646#endif
29647
29648
29649static int
29650test_xmlModuleClose(void) {
29651    int test_ret = 0;
29652
29653#if defined(LIBXML_MODULES_ENABLED)
29654    int mem_base;
29655    int ret_val;
29656    xmlModulePtr module; /* the module handle */
29657    int n_module;
29658
29659    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29660        mem_base = xmlMemBlocks();
29661        module = gen_xmlModulePtr(n_module, 0);
29662
29663        ret_val = xmlModuleClose(module);
29664        desret_int(ret_val);
29665        call_tests++;
29666        des_xmlModulePtr(n_module, module, 0);
29667        xmlResetLastError();
29668        if (mem_base != xmlMemBlocks()) {
29669            printf("Leak of %d blocks found in xmlModuleClose",
29670	           xmlMemBlocks() - mem_base);
29671	    test_ret++;
29672            printf(" %d", n_module);
29673            printf("\n");
29674        }
29675    }
29676    function_tests++;
29677#endif
29678
29679    return(test_ret);
29680}
29681
29682
29683static int
29684test_xmlModuleOpen(void) {
29685    int test_ret = 0;
29686
29687
29688    /* missing type support */
29689    return(test_ret);
29690}
29691
29692
29693static int
29694test_xmlModuleSymbol(void) {
29695    int test_ret = 0;
29696
29697#if defined(LIBXML_MODULES_ENABLED)
29698    int mem_base;
29699    int ret_val;
29700    xmlModulePtr module; /* the module */
29701    int n_module;
29702    char * name; /* the name of the symbol */
29703    int n_name;
29704    void ** symbol; /* the resulting symbol address */
29705    int n_symbol;
29706
29707    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29708    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29709    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29710        mem_base = xmlMemBlocks();
29711        module = gen_xmlModulePtr(n_module, 0);
29712        name = gen_const_char_ptr(n_name, 1);
29713        symbol = gen_void_ptr_ptr(n_symbol, 2);
29714
29715        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29716        desret_int(ret_val);
29717        call_tests++;
29718        des_xmlModulePtr(n_module, module, 0);
29719        des_const_char_ptr(n_name, (const char *)name, 1);
29720        des_void_ptr_ptr(n_symbol, symbol, 2);
29721        xmlResetLastError();
29722        if (mem_base != xmlMemBlocks()) {
29723            printf("Leak of %d blocks found in xmlModuleSymbol",
29724	           xmlMemBlocks() - mem_base);
29725	    test_ret++;
29726            printf(" %d", n_module);
29727            printf(" %d", n_name);
29728            printf(" %d", n_symbol);
29729            printf("\n");
29730        }
29731    }
29732    }
29733    }
29734    function_tests++;
29735#endif
29736
29737    return(test_ret);
29738}
29739
29740static int
29741test_xmlmodule(void) {
29742    int test_ret = 0;
29743
29744    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29745    test_ret += test_xmlModuleClose();
29746    test_ret += test_xmlModuleOpen();
29747    test_ret += test_xmlModuleSymbol();
29748
29749    if (test_ret != 0)
29750	printf("Module xmlmodule: %d errors\n", test_ret);
29751    return(test_ret);
29752}
29753
29754static int
29755test_xmlNewTextReader(void) {
29756    int test_ret = 0;
29757
29758#if defined(LIBXML_READER_ENABLED)
29759    int mem_base;
29760    xmlTextReaderPtr ret_val;
29761    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29762    int n_input;
29763    const char * URI; /* the URI information for the source if available */
29764    int n_URI;
29765
29766    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29767    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29768        mem_base = xmlMemBlocks();
29769        input = gen_xmlParserInputBufferPtr(n_input, 0);
29770        URI = gen_filepath(n_URI, 1);
29771
29772        ret_val = xmlNewTextReader(input, URI);
29773        desret_xmlTextReaderPtr(ret_val);
29774        call_tests++;
29775        des_xmlParserInputBufferPtr(n_input, input, 0);
29776        des_filepath(n_URI, URI, 1);
29777        xmlResetLastError();
29778        if (mem_base != xmlMemBlocks()) {
29779            printf("Leak of %d blocks found in xmlNewTextReader",
29780	           xmlMemBlocks() - mem_base);
29781	    test_ret++;
29782            printf(" %d", n_input);
29783            printf(" %d", n_URI);
29784            printf("\n");
29785        }
29786    }
29787    }
29788    function_tests++;
29789#endif
29790
29791    return(test_ret);
29792}
29793
29794
29795static int
29796test_xmlNewTextReaderFilename(void) {
29797    int test_ret = 0;
29798
29799#if defined(LIBXML_READER_ENABLED)
29800    int mem_base;
29801    xmlTextReaderPtr ret_val;
29802    const char * URI; /* the URI of the resource to process */
29803    int n_URI;
29804
29805    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29806        mem_base = xmlMemBlocks();
29807        URI = gen_filepath(n_URI, 0);
29808
29809        ret_val = xmlNewTextReaderFilename(URI);
29810        desret_xmlTextReaderPtr(ret_val);
29811        call_tests++;
29812        des_filepath(n_URI, URI, 0);
29813        xmlResetLastError();
29814        if (mem_base != xmlMemBlocks()) {
29815            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29816	           xmlMemBlocks() - mem_base);
29817	    test_ret++;
29818            printf(" %d", n_URI);
29819            printf("\n");
29820        }
29821    }
29822    function_tests++;
29823#endif
29824
29825    return(test_ret);
29826}
29827
29828
29829static int
29830test_xmlReaderForDoc(void) {
29831    int test_ret = 0;
29832
29833#if defined(LIBXML_READER_ENABLED)
29834    int mem_base;
29835    xmlTextReaderPtr ret_val;
29836    xmlChar * cur; /* a pointer to a zero terminated string */
29837    int n_cur;
29838    const char * URL; /* the base URL to use for the document */
29839    int n_URL;
29840    char * encoding; /* the document encoding, or NULL */
29841    int n_encoding;
29842    int options; /* a combination of xmlParserOption */
29843    int n_options;
29844
29845    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29846    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29847    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29848    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29849        mem_base = xmlMemBlocks();
29850        cur = gen_const_xmlChar_ptr(n_cur, 0);
29851        URL = gen_filepath(n_URL, 1);
29852        encoding = gen_const_char_ptr(n_encoding, 2);
29853        options = gen_parseroptions(n_options, 3);
29854
29855        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29856        desret_xmlTextReaderPtr(ret_val);
29857        call_tests++;
29858        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29859        des_filepath(n_URL, URL, 1);
29860        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29861        des_parseroptions(n_options, options, 3);
29862        xmlResetLastError();
29863        if (mem_base != xmlMemBlocks()) {
29864            printf("Leak of %d blocks found in xmlReaderForDoc",
29865	           xmlMemBlocks() - mem_base);
29866	    test_ret++;
29867            printf(" %d", n_cur);
29868            printf(" %d", n_URL);
29869            printf(" %d", n_encoding);
29870            printf(" %d", n_options);
29871            printf("\n");
29872        }
29873    }
29874    }
29875    }
29876    }
29877    function_tests++;
29878#endif
29879
29880    return(test_ret);
29881}
29882
29883
29884static int
29885test_xmlReaderForFile(void) {
29886    int test_ret = 0;
29887
29888#if defined(LIBXML_READER_ENABLED)
29889    int mem_base;
29890    xmlTextReaderPtr ret_val;
29891    const char * filename; /* a file or URL */
29892    int n_filename;
29893    char * encoding; /* the document encoding, or NULL */
29894    int n_encoding;
29895    int options; /* a combination of xmlParserOption */
29896    int n_options;
29897
29898    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29899    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29900    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29901        mem_base = xmlMemBlocks();
29902        filename = gen_filepath(n_filename, 0);
29903        encoding = gen_const_char_ptr(n_encoding, 1);
29904        options = gen_parseroptions(n_options, 2);
29905
29906        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29907        desret_xmlTextReaderPtr(ret_val);
29908        call_tests++;
29909        des_filepath(n_filename, filename, 0);
29910        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29911        des_parseroptions(n_options, options, 2);
29912        xmlResetLastError();
29913        if (mem_base != xmlMemBlocks()) {
29914            printf("Leak of %d blocks found in xmlReaderForFile",
29915	           xmlMemBlocks() - mem_base);
29916	    test_ret++;
29917            printf(" %d", n_filename);
29918            printf(" %d", n_encoding);
29919            printf(" %d", n_options);
29920            printf("\n");
29921        }
29922    }
29923    }
29924    }
29925    function_tests++;
29926#endif
29927
29928    return(test_ret);
29929}
29930
29931
29932static int
29933test_xmlReaderForMemory(void) {
29934    int test_ret = 0;
29935
29936#if defined(LIBXML_READER_ENABLED)
29937    int mem_base;
29938    xmlTextReaderPtr ret_val;
29939    char * buffer; /* a pointer to a char array */
29940    int n_buffer;
29941    int size; /* the size of the array */
29942    int n_size;
29943    const char * URL; /* the base URL to use for the document */
29944    int n_URL;
29945    char * encoding; /* the document encoding, or NULL */
29946    int n_encoding;
29947    int options; /* a combination of xmlParserOption */
29948    int n_options;
29949
29950    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29951    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29952    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29953    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29954    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29955        mem_base = xmlMemBlocks();
29956        buffer = gen_const_char_ptr(n_buffer, 0);
29957        size = gen_int(n_size, 1);
29958        URL = gen_filepath(n_URL, 2);
29959        encoding = gen_const_char_ptr(n_encoding, 3);
29960        options = gen_parseroptions(n_options, 4);
29961
29962        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29963        desret_xmlTextReaderPtr(ret_val);
29964        call_tests++;
29965        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29966        des_int(n_size, size, 1);
29967        des_filepath(n_URL, URL, 2);
29968        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29969        des_parseroptions(n_options, options, 4);
29970        xmlResetLastError();
29971        if (mem_base != xmlMemBlocks()) {
29972            printf("Leak of %d blocks found in xmlReaderForMemory",
29973	           xmlMemBlocks() - mem_base);
29974	    test_ret++;
29975            printf(" %d", n_buffer);
29976            printf(" %d", n_size);
29977            printf(" %d", n_URL);
29978            printf(" %d", n_encoding);
29979            printf(" %d", n_options);
29980            printf("\n");
29981        }
29982    }
29983    }
29984    }
29985    }
29986    }
29987    function_tests++;
29988#endif
29989
29990    return(test_ret);
29991}
29992
29993
29994static int
29995test_xmlReaderNewDoc(void) {
29996    int test_ret = 0;
29997
29998#if defined(LIBXML_READER_ENABLED)
29999    int mem_base;
30000    int ret_val;
30001    xmlTextReaderPtr reader; /* an XML reader */
30002    int n_reader;
30003    xmlChar * cur; /* a pointer to a zero terminated string */
30004    int n_cur;
30005    const char * URL; /* the base URL to use for the document */
30006    int n_URL;
30007    char * encoding; /* the document encoding, or NULL */
30008    int n_encoding;
30009    int options; /* a combination of xmlParserOption */
30010    int n_options;
30011
30012    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30013    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
30014    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30015    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30016    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30017        mem_base = xmlMemBlocks();
30018        reader = gen_xmlTextReaderPtr(n_reader, 0);
30019        cur = gen_const_xmlChar_ptr(n_cur, 1);
30020        URL = gen_filepath(n_URL, 2);
30021        encoding = gen_const_char_ptr(n_encoding, 3);
30022        options = gen_parseroptions(n_options, 4);
30023
30024        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
30025        desret_int(ret_val);
30026        call_tests++;
30027        des_xmlTextReaderPtr(n_reader, reader, 0);
30028        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
30029        des_filepath(n_URL, URL, 2);
30030        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
30031        des_parseroptions(n_options, options, 4);
30032        xmlResetLastError();
30033        if (mem_base != xmlMemBlocks()) {
30034            printf("Leak of %d blocks found in xmlReaderNewDoc",
30035	           xmlMemBlocks() - mem_base);
30036	    test_ret++;
30037            printf(" %d", n_reader);
30038            printf(" %d", n_cur);
30039            printf(" %d", n_URL);
30040            printf(" %d", n_encoding);
30041            printf(" %d", n_options);
30042            printf("\n");
30043        }
30044    }
30045    }
30046    }
30047    }
30048    }
30049    function_tests++;
30050#endif
30051
30052    return(test_ret);
30053}
30054
30055
30056static int
30057test_xmlReaderNewFile(void) {
30058    int test_ret = 0;
30059
30060#if defined(LIBXML_READER_ENABLED)
30061    int mem_base;
30062    int ret_val;
30063    xmlTextReaderPtr reader; /* an XML reader */
30064    int n_reader;
30065    const char * filename; /* a file or URL */
30066    int n_filename;
30067    char * encoding; /* the document encoding, or NULL */
30068    int n_encoding;
30069    int options; /* a combination of xmlParserOption */
30070    int n_options;
30071
30072    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30073    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
30074    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30075    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30076        mem_base = xmlMemBlocks();
30077        reader = gen_xmlTextReaderPtr(n_reader, 0);
30078        filename = gen_filepath(n_filename, 1);
30079        encoding = gen_const_char_ptr(n_encoding, 2);
30080        options = gen_parseroptions(n_options, 3);
30081
30082        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
30083        desret_int(ret_val);
30084        call_tests++;
30085        des_xmlTextReaderPtr(n_reader, reader, 0);
30086        des_filepath(n_filename, filename, 1);
30087        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
30088        des_parseroptions(n_options, options, 3);
30089        xmlResetLastError();
30090        if (mem_base != xmlMemBlocks()) {
30091            printf("Leak of %d blocks found in xmlReaderNewFile",
30092	           xmlMemBlocks() - mem_base);
30093	    test_ret++;
30094            printf(" %d", n_reader);
30095            printf(" %d", n_filename);
30096            printf(" %d", n_encoding);
30097            printf(" %d", n_options);
30098            printf("\n");
30099        }
30100    }
30101    }
30102    }
30103    }
30104    function_tests++;
30105#endif
30106
30107    return(test_ret);
30108}
30109
30110
30111static int
30112test_xmlReaderNewMemory(void) {
30113    int test_ret = 0;
30114
30115#if defined(LIBXML_READER_ENABLED)
30116    int mem_base;
30117    int ret_val;
30118    xmlTextReaderPtr reader; /* an XML reader */
30119    int n_reader;
30120    char * buffer; /* a pointer to a char array */
30121    int n_buffer;
30122    int size; /* the size of the array */
30123    int n_size;
30124    const char * URL; /* the base URL to use for the document */
30125    int n_URL;
30126    char * encoding; /* the document encoding, or NULL */
30127    int n_encoding;
30128    int options; /* a combination of xmlParserOption */
30129    int n_options;
30130
30131    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30132    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
30133    for (n_size = 0;n_size < gen_nb_int;n_size++) {
30134    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
30135    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
30136    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
30137        mem_base = xmlMemBlocks();
30138        reader = gen_xmlTextReaderPtr(n_reader, 0);
30139        buffer = gen_const_char_ptr(n_buffer, 1);
30140        size = gen_int(n_size, 2);
30141        URL = gen_filepath(n_URL, 3);
30142        encoding = gen_const_char_ptr(n_encoding, 4);
30143        options = gen_parseroptions(n_options, 5);
30144
30145        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
30146        desret_int(ret_val);
30147        call_tests++;
30148        des_xmlTextReaderPtr(n_reader, reader, 0);
30149        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
30150        des_int(n_size, size, 2);
30151        des_filepath(n_URL, URL, 3);
30152        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
30153        des_parseroptions(n_options, options, 5);
30154        xmlResetLastError();
30155        if (mem_base != xmlMemBlocks()) {
30156            printf("Leak of %d blocks found in xmlReaderNewMemory",
30157	           xmlMemBlocks() - mem_base);
30158	    test_ret++;
30159            printf(" %d", n_reader);
30160            printf(" %d", n_buffer);
30161            printf(" %d", n_size);
30162            printf(" %d", n_URL);
30163            printf(" %d", n_encoding);
30164            printf(" %d", n_options);
30165            printf("\n");
30166        }
30167    }
30168    }
30169    }
30170    }
30171    }
30172    }
30173    function_tests++;
30174#endif
30175
30176    return(test_ret);
30177}
30178
30179
30180static int
30181test_xmlReaderNewWalker(void) {
30182    int test_ret = 0;
30183
30184#if defined(LIBXML_READER_ENABLED)
30185    int mem_base;
30186    int ret_val;
30187    xmlTextReaderPtr reader; /* an XML reader */
30188    int n_reader;
30189    xmlDocPtr doc; /* a preparsed document */
30190    int n_doc;
30191
30192    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30193    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30194        mem_base = xmlMemBlocks();
30195        reader = gen_xmlTextReaderPtr(n_reader, 0);
30196        doc = gen_xmlDocPtr(n_doc, 1);
30197
30198        ret_val = xmlReaderNewWalker(reader, doc);
30199        desret_int(ret_val);
30200        call_tests++;
30201        des_xmlTextReaderPtr(n_reader, reader, 0);
30202        des_xmlDocPtr(n_doc, doc, 1);
30203        xmlResetLastError();
30204        if (mem_base != xmlMemBlocks()) {
30205            printf("Leak of %d blocks found in xmlReaderNewWalker",
30206	           xmlMemBlocks() - mem_base);
30207	    test_ret++;
30208            printf(" %d", n_reader);
30209            printf(" %d", n_doc);
30210            printf("\n");
30211        }
30212    }
30213    }
30214    function_tests++;
30215#endif
30216
30217    return(test_ret);
30218}
30219
30220
30221static int
30222test_xmlReaderWalker(void) {
30223    int test_ret = 0;
30224
30225#if defined(LIBXML_READER_ENABLED)
30226    int mem_base;
30227    xmlTextReaderPtr ret_val;
30228    xmlDocPtr doc; /* a preparsed document */
30229    int n_doc;
30230
30231    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30232        mem_base = xmlMemBlocks();
30233        doc = gen_xmlDocPtr(n_doc, 0);
30234
30235        ret_val = xmlReaderWalker(doc);
30236        desret_xmlTextReaderPtr(ret_val);
30237        call_tests++;
30238        des_xmlDocPtr(n_doc, doc, 0);
30239        xmlResetLastError();
30240        if (mem_base != xmlMemBlocks()) {
30241            printf("Leak of %d blocks found in xmlReaderWalker",
30242	           xmlMemBlocks() - mem_base);
30243	    test_ret++;
30244            printf(" %d", n_doc);
30245            printf("\n");
30246        }
30247    }
30248    function_tests++;
30249#endif
30250
30251    return(test_ret);
30252}
30253
30254
30255static int
30256test_xmlTextReaderAttributeCount(void) {
30257    int test_ret = 0;
30258
30259#if defined(LIBXML_READER_ENABLED)
30260    int mem_base;
30261    int ret_val;
30262    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30263    int n_reader;
30264
30265    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30266        mem_base = xmlMemBlocks();
30267        reader = gen_xmlTextReaderPtr(n_reader, 0);
30268
30269        ret_val = xmlTextReaderAttributeCount(reader);
30270        desret_int(ret_val);
30271        call_tests++;
30272        des_xmlTextReaderPtr(n_reader, reader, 0);
30273        xmlResetLastError();
30274        if (mem_base != xmlMemBlocks()) {
30275            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30276	           xmlMemBlocks() - mem_base);
30277	    test_ret++;
30278            printf(" %d", n_reader);
30279            printf("\n");
30280        }
30281    }
30282    function_tests++;
30283#endif
30284
30285    return(test_ret);
30286}
30287
30288
30289static int
30290test_xmlTextReaderBaseUri(void) {
30291    int test_ret = 0;
30292
30293#if defined(LIBXML_READER_ENABLED)
30294    int mem_base;
30295    xmlChar * ret_val;
30296    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30297    int n_reader;
30298
30299    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30300        mem_base = xmlMemBlocks();
30301        reader = gen_xmlTextReaderPtr(n_reader, 0);
30302
30303        ret_val = xmlTextReaderBaseUri(reader);
30304        desret_xmlChar_ptr(ret_val);
30305        call_tests++;
30306        des_xmlTextReaderPtr(n_reader, reader, 0);
30307        xmlResetLastError();
30308        if (mem_base != xmlMemBlocks()) {
30309            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30310	           xmlMemBlocks() - mem_base);
30311	    test_ret++;
30312            printf(" %d", n_reader);
30313            printf("\n");
30314        }
30315    }
30316    function_tests++;
30317#endif
30318
30319    return(test_ret);
30320}
30321
30322
30323static int
30324test_xmlTextReaderByteConsumed(void) {
30325    int test_ret = 0;
30326
30327#if defined(LIBXML_READER_ENABLED)
30328    int mem_base;
30329    long ret_val;
30330    xmlTextReaderPtr reader; /* an XML reader */
30331    int n_reader;
30332
30333    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30334        mem_base = xmlMemBlocks();
30335        reader = gen_xmlTextReaderPtr(n_reader, 0);
30336
30337        ret_val = xmlTextReaderByteConsumed(reader);
30338        desret_long(ret_val);
30339        call_tests++;
30340        des_xmlTextReaderPtr(n_reader, reader, 0);
30341        xmlResetLastError();
30342        if (mem_base != xmlMemBlocks()) {
30343            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30344	           xmlMemBlocks() - mem_base);
30345	    test_ret++;
30346            printf(" %d", n_reader);
30347            printf("\n");
30348        }
30349    }
30350    function_tests++;
30351#endif
30352
30353    return(test_ret);
30354}
30355
30356
30357static int
30358test_xmlTextReaderClose(void) {
30359    int test_ret = 0;
30360
30361#if defined(LIBXML_READER_ENABLED)
30362    int mem_base;
30363    int ret_val;
30364    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30365    int n_reader;
30366
30367    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30368        mem_base = xmlMemBlocks();
30369        reader = gen_xmlTextReaderPtr(n_reader, 0);
30370
30371        ret_val = xmlTextReaderClose(reader);
30372        desret_int(ret_val);
30373        call_tests++;
30374        des_xmlTextReaderPtr(n_reader, reader, 0);
30375        xmlResetLastError();
30376        if (mem_base != xmlMemBlocks()) {
30377            printf("Leak of %d blocks found in xmlTextReaderClose",
30378	           xmlMemBlocks() - mem_base);
30379	    test_ret++;
30380            printf(" %d", n_reader);
30381            printf("\n");
30382        }
30383    }
30384    function_tests++;
30385#endif
30386
30387    return(test_ret);
30388}
30389
30390
30391static int
30392test_xmlTextReaderConstBaseUri(void) {
30393    int test_ret = 0;
30394
30395#if defined(LIBXML_READER_ENABLED)
30396    int mem_base;
30397    const xmlChar * ret_val;
30398    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30399    int n_reader;
30400
30401    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30402        mem_base = xmlMemBlocks();
30403        reader = gen_xmlTextReaderPtr(n_reader, 0);
30404
30405        ret_val = xmlTextReaderConstBaseUri(reader);
30406        desret_const_xmlChar_ptr(ret_val);
30407        call_tests++;
30408        des_xmlTextReaderPtr(n_reader, reader, 0);
30409        xmlResetLastError();
30410        if (mem_base != xmlMemBlocks()) {
30411            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30412	           xmlMemBlocks() - mem_base);
30413	    test_ret++;
30414            printf(" %d", n_reader);
30415            printf("\n");
30416        }
30417    }
30418    function_tests++;
30419#endif
30420
30421    return(test_ret);
30422}
30423
30424
30425static int
30426test_xmlTextReaderConstEncoding(void) {
30427    int test_ret = 0;
30428
30429#if defined(LIBXML_READER_ENABLED)
30430    int mem_base;
30431    const xmlChar * ret_val;
30432    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30433    int n_reader;
30434
30435    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30436        mem_base = xmlMemBlocks();
30437        reader = gen_xmlTextReaderPtr(n_reader, 0);
30438
30439        ret_val = xmlTextReaderConstEncoding(reader);
30440        desret_const_xmlChar_ptr(ret_val);
30441        call_tests++;
30442        des_xmlTextReaderPtr(n_reader, reader, 0);
30443        xmlResetLastError();
30444        if (mem_base != xmlMemBlocks()) {
30445            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30446	           xmlMemBlocks() - mem_base);
30447	    test_ret++;
30448            printf(" %d", n_reader);
30449            printf("\n");
30450        }
30451    }
30452    function_tests++;
30453#endif
30454
30455    return(test_ret);
30456}
30457
30458
30459static int
30460test_xmlTextReaderConstLocalName(void) {
30461    int test_ret = 0;
30462
30463#if defined(LIBXML_READER_ENABLED)
30464    int mem_base;
30465    const xmlChar * ret_val;
30466    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30467    int n_reader;
30468
30469    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30470        mem_base = xmlMemBlocks();
30471        reader = gen_xmlTextReaderPtr(n_reader, 0);
30472
30473        ret_val = xmlTextReaderConstLocalName(reader);
30474        desret_const_xmlChar_ptr(ret_val);
30475        call_tests++;
30476        des_xmlTextReaderPtr(n_reader, reader, 0);
30477        xmlResetLastError();
30478        if (mem_base != xmlMemBlocks()) {
30479            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30480	           xmlMemBlocks() - mem_base);
30481	    test_ret++;
30482            printf(" %d", n_reader);
30483            printf("\n");
30484        }
30485    }
30486    function_tests++;
30487#endif
30488
30489    return(test_ret);
30490}
30491
30492
30493static int
30494test_xmlTextReaderConstName(void) {
30495    int test_ret = 0;
30496
30497#if defined(LIBXML_READER_ENABLED)
30498    int mem_base;
30499    const xmlChar * ret_val;
30500    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30501    int n_reader;
30502
30503    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30504        mem_base = xmlMemBlocks();
30505        reader = gen_xmlTextReaderPtr(n_reader, 0);
30506
30507        ret_val = xmlTextReaderConstName(reader);
30508        desret_const_xmlChar_ptr(ret_val);
30509        call_tests++;
30510        des_xmlTextReaderPtr(n_reader, reader, 0);
30511        xmlResetLastError();
30512        if (mem_base != xmlMemBlocks()) {
30513            printf("Leak of %d blocks found in xmlTextReaderConstName",
30514	           xmlMemBlocks() - mem_base);
30515	    test_ret++;
30516            printf(" %d", n_reader);
30517            printf("\n");
30518        }
30519    }
30520    function_tests++;
30521#endif
30522
30523    return(test_ret);
30524}
30525
30526
30527static int
30528test_xmlTextReaderConstNamespaceUri(void) {
30529    int test_ret = 0;
30530
30531#if defined(LIBXML_READER_ENABLED)
30532    int mem_base;
30533    const xmlChar * ret_val;
30534    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30535    int n_reader;
30536
30537    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30538        mem_base = xmlMemBlocks();
30539        reader = gen_xmlTextReaderPtr(n_reader, 0);
30540
30541        ret_val = xmlTextReaderConstNamespaceUri(reader);
30542        desret_const_xmlChar_ptr(ret_val);
30543        call_tests++;
30544        des_xmlTextReaderPtr(n_reader, reader, 0);
30545        xmlResetLastError();
30546        if (mem_base != xmlMemBlocks()) {
30547            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30548	           xmlMemBlocks() - mem_base);
30549	    test_ret++;
30550            printf(" %d", n_reader);
30551            printf("\n");
30552        }
30553    }
30554    function_tests++;
30555#endif
30556
30557    return(test_ret);
30558}
30559
30560
30561static int
30562test_xmlTextReaderConstPrefix(void) {
30563    int test_ret = 0;
30564
30565#if defined(LIBXML_READER_ENABLED)
30566    int mem_base;
30567    const xmlChar * ret_val;
30568    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30569    int n_reader;
30570
30571    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30572        mem_base = xmlMemBlocks();
30573        reader = gen_xmlTextReaderPtr(n_reader, 0);
30574
30575        ret_val = xmlTextReaderConstPrefix(reader);
30576        desret_const_xmlChar_ptr(ret_val);
30577        call_tests++;
30578        des_xmlTextReaderPtr(n_reader, reader, 0);
30579        xmlResetLastError();
30580        if (mem_base != xmlMemBlocks()) {
30581            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30582	           xmlMemBlocks() - mem_base);
30583	    test_ret++;
30584            printf(" %d", n_reader);
30585            printf("\n");
30586        }
30587    }
30588    function_tests++;
30589#endif
30590
30591    return(test_ret);
30592}
30593
30594
30595static int
30596test_xmlTextReaderConstString(void) {
30597    int test_ret = 0;
30598
30599#if defined(LIBXML_READER_ENABLED)
30600    int mem_base;
30601    const xmlChar * ret_val;
30602    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30603    int n_reader;
30604    xmlChar * str; /* the string to intern. */
30605    int n_str;
30606
30607    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30608    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30609        mem_base = xmlMemBlocks();
30610        reader = gen_xmlTextReaderPtr(n_reader, 0);
30611        str = gen_const_xmlChar_ptr(n_str, 1);
30612
30613        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30614        desret_const_xmlChar_ptr(ret_val);
30615        call_tests++;
30616        des_xmlTextReaderPtr(n_reader, reader, 0);
30617        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30618        xmlResetLastError();
30619        if (mem_base != xmlMemBlocks()) {
30620            printf("Leak of %d blocks found in xmlTextReaderConstString",
30621	           xmlMemBlocks() - mem_base);
30622	    test_ret++;
30623            printf(" %d", n_reader);
30624            printf(" %d", n_str);
30625            printf("\n");
30626        }
30627    }
30628    }
30629    function_tests++;
30630#endif
30631
30632    return(test_ret);
30633}
30634
30635
30636static int
30637test_xmlTextReaderConstValue(void) {
30638    int test_ret = 0;
30639
30640#if defined(LIBXML_READER_ENABLED)
30641    int mem_base;
30642    const xmlChar * ret_val;
30643    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30644    int n_reader;
30645
30646    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30647        mem_base = xmlMemBlocks();
30648        reader = gen_xmlTextReaderPtr(n_reader, 0);
30649
30650        ret_val = xmlTextReaderConstValue(reader);
30651        desret_const_xmlChar_ptr(ret_val);
30652        call_tests++;
30653        des_xmlTextReaderPtr(n_reader, reader, 0);
30654        xmlResetLastError();
30655        if (mem_base != xmlMemBlocks()) {
30656            printf("Leak of %d blocks found in xmlTextReaderConstValue",
30657	           xmlMemBlocks() - mem_base);
30658	    test_ret++;
30659            printf(" %d", n_reader);
30660            printf("\n");
30661        }
30662    }
30663    function_tests++;
30664#endif
30665
30666    return(test_ret);
30667}
30668
30669
30670static int
30671test_xmlTextReaderConstXmlLang(void) {
30672    int test_ret = 0;
30673
30674#if defined(LIBXML_READER_ENABLED)
30675    int mem_base;
30676    const xmlChar * ret_val;
30677    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30678    int n_reader;
30679
30680    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30681        mem_base = xmlMemBlocks();
30682        reader = gen_xmlTextReaderPtr(n_reader, 0);
30683
30684        ret_val = xmlTextReaderConstXmlLang(reader);
30685        desret_const_xmlChar_ptr(ret_val);
30686        call_tests++;
30687        des_xmlTextReaderPtr(n_reader, reader, 0);
30688        xmlResetLastError();
30689        if (mem_base != xmlMemBlocks()) {
30690            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30691	           xmlMemBlocks() - mem_base);
30692	    test_ret++;
30693            printf(" %d", n_reader);
30694            printf("\n");
30695        }
30696    }
30697    function_tests++;
30698#endif
30699
30700    return(test_ret);
30701}
30702
30703
30704static int
30705test_xmlTextReaderConstXmlVersion(void) {
30706    int test_ret = 0;
30707
30708#if defined(LIBXML_READER_ENABLED)
30709    int mem_base;
30710    const xmlChar * ret_val;
30711    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30712    int n_reader;
30713
30714    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30715        mem_base = xmlMemBlocks();
30716        reader = gen_xmlTextReaderPtr(n_reader, 0);
30717
30718        ret_val = xmlTextReaderConstXmlVersion(reader);
30719        desret_const_xmlChar_ptr(ret_val);
30720        call_tests++;
30721        des_xmlTextReaderPtr(n_reader, reader, 0);
30722        xmlResetLastError();
30723        if (mem_base != xmlMemBlocks()) {
30724            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30725	           xmlMemBlocks() - mem_base);
30726	    test_ret++;
30727            printf(" %d", n_reader);
30728            printf("\n");
30729        }
30730    }
30731    function_tests++;
30732#endif
30733
30734    return(test_ret);
30735}
30736
30737
30738static int
30739test_xmlTextReaderCurrentDoc(void) {
30740    int test_ret = 0;
30741
30742#if defined(LIBXML_READER_ENABLED)
30743    int mem_base;
30744    xmlDocPtr ret_val;
30745    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30746    int n_reader;
30747
30748    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30749        mem_base = xmlMemBlocks();
30750        reader = gen_xmlTextReaderPtr(n_reader, 0);
30751
30752        ret_val = xmlTextReaderCurrentDoc(reader);
30753        desret_xmlDocPtr(ret_val);
30754        call_tests++;
30755        des_xmlTextReaderPtr(n_reader, reader, 0);
30756        xmlResetLastError();
30757        if (mem_base != xmlMemBlocks()) {
30758            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30759	           xmlMemBlocks() - mem_base);
30760	    test_ret++;
30761            printf(" %d", n_reader);
30762            printf("\n");
30763        }
30764    }
30765    function_tests++;
30766#endif
30767
30768    return(test_ret);
30769}
30770
30771
30772static int
30773test_xmlTextReaderCurrentNode(void) {
30774    int test_ret = 0;
30775
30776#if defined(LIBXML_READER_ENABLED)
30777    int mem_base;
30778    xmlNodePtr ret_val;
30779    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30780    int n_reader;
30781
30782    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30783        mem_base = xmlMemBlocks();
30784        reader = gen_xmlTextReaderPtr(n_reader, 0);
30785
30786        ret_val = xmlTextReaderCurrentNode(reader);
30787        desret_xmlNodePtr(ret_val);
30788        call_tests++;
30789        des_xmlTextReaderPtr(n_reader, reader, 0);
30790        xmlResetLastError();
30791        if (mem_base != xmlMemBlocks()) {
30792            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30793	           xmlMemBlocks() - mem_base);
30794	    test_ret++;
30795            printf(" %d", n_reader);
30796            printf("\n");
30797        }
30798    }
30799    function_tests++;
30800#endif
30801
30802    return(test_ret);
30803}
30804
30805
30806static int
30807test_xmlTextReaderDepth(void) {
30808    int test_ret = 0;
30809
30810#if defined(LIBXML_READER_ENABLED)
30811    int mem_base;
30812    int ret_val;
30813    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30814    int n_reader;
30815
30816    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30817        mem_base = xmlMemBlocks();
30818        reader = gen_xmlTextReaderPtr(n_reader, 0);
30819
30820        ret_val = xmlTextReaderDepth(reader);
30821        desret_int(ret_val);
30822        call_tests++;
30823        des_xmlTextReaderPtr(n_reader, reader, 0);
30824        xmlResetLastError();
30825        if (mem_base != xmlMemBlocks()) {
30826            printf("Leak of %d blocks found in xmlTextReaderDepth",
30827	           xmlMemBlocks() - mem_base);
30828	    test_ret++;
30829            printf(" %d", n_reader);
30830            printf("\n");
30831        }
30832    }
30833    function_tests++;
30834#endif
30835
30836    return(test_ret);
30837}
30838
30839
30840static int
30841test_xmlTextReaderExpand(void) {
30842    int test_ret = 0;
30843
30844#if defined(LIBXML_READER_ENABLED)
30845    int mem_base;
30846    xmlNodePtr ret_val;
30847    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30848    int n_reader;
30849
30850    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30851        mem_base = xmlMemBlocks();
30852        reader = gen_xmlTextReaderPtr(n_reader, 0);
30853
30854        ret_val = xmlTextReaderExpand(reader);
30855        desret_xmlNodePtr(ret_val);
30856        call_tests++;
30857        des_xmlTextReaderPtr(n_reader, reader, 0);
30858        xmlResetLastError();
30859        if (mem_base != xmlMemBlocks()) {
30860            printf("Leak of %d blocks found in xmlTextReaderExpand",
30861	           xmlMemBlocks() - mem_base);
30862	    test_ret++;
30863            printf(" %d", n_reader);
30864            printf("\n");
30865        }
30866    }
30867    function_tests++;
30868#endif
30869
30870    return(test_ret);
30871}
30872
30873
30874static int
30875test_xmlTextReaderGetAttribute(void) {
30876    int test_ret = 0;
30877
30878#if defined(LIBXML_READER_ENABLED)
30879    int mem_base;
30880    xmlChar * ret_val;
30881    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30882    int n_reader;
30883    xmlChar * name; /* the qualified name of the attribute. */
30884    int n_name;
30885
30886    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30887    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30888        mem_base = xmlMemBlocks();
30889        reader = gen_xmlTextReaderPtr(n_reader, 0);
30890        name = gen_const_xmlChar_ptr(n_name, 1);
30891
30892        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30893        desret_xmlChar_ptr(ret_val);
30894        call_tests++;
30895        des_xmlTextReaderPtr(n_reader, reader, 0);
30896        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30897        xmlResetLastError();
30898        if (mem_base != xmlMemBlocks()) {
30899            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30900	           xmlMemBlocks() - mem_base);
30901	    test_ret++;
30902            printf(" %d", n_reader);
30903            printf(" %d", n_name);
30904            printf("\n");
30905        }
30906    }
30907    }
30908    function_tests++;
30909#endif
30910
30911    return(test_ret);
30912}
30913
30914
30915static int
30916test_xmlTextReaderGetAttributeNo(void) {
30917    int test_ret = 0;
30918
30919#if defined(LIBXML_READER_ENABLED)
30920    int mem_base;
30921    xmlChar * ret_val;
30922    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30923    int n_reader;
30924    int no; /* the zero-based index of the attribute relative to the containing element */
30925    int n_no;
30926
30927    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30928    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30929        mem_base = xmlMemBlocks();
30930        reader = gen_xmlTextReaderPtr(n_reader, 0);
30931        no = gen_int(n_no, 1);
30932
30933        ret_val = xmlTextReaderGetAttributeNo(reader, no);
30934        desret_xmlChar_ptr(ret_val);
30935        call_tests++;
30936        des_xmlTextReaderPtr(n_reader, reader, 0);
30937        des_int(n_no, no, 1);
30938        xmlResetLastError();
30939        if (mem_base != xmlMemBlocks()) {
30940            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30941	           xmlMemBlocks() - mem_base);
30942	    test_ret++;
30943            printf(" %d", n_reader);
30944            printf(" %d", n_no);
30945            printf("\n");
30946        }
30947    }
30948    }
30949    function_tests++;
30950#endif
30951
30952    return(test_ret);
30953}
30954
30955
30956static int
30957test_xmlTextReaderGetAttributeNs(void) {
30958    int test_ret = 0;
30959
30960#if defined(LIBXML_READER_ENABLED)
30961    int mem_base;
30962    xmlChar * ret_val;
30963    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30964    int n_reader;
30965    xmlChar * localName; /* the local name of the attribute. */
30966    int n_localName;
30967    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30968    int n_namespaceURI;
30969
30970    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30971    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30972    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30973        mem_base = xmlMemBlocks();
30974        reader = gen_xmlTextReaderPtr(n_reader, 0);
30975        localName = gen_const_xmlChar_ptr(n_localName, 1);
30976        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30977
30978        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30979        desret_xmlChar_ptr(ret_val);
30980        call_tests++;
30981        des_xmlTextReaderPtr(n_reader, reader, 0);
30982        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30983        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30984        xmlResetLastError();
30985        if (mem_base != xmlMemBlocks()) {
30986            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30987	           xmlMemBlocks() - mem_base);
30988	    test_ret++;
30989            printf(" %d", n_reader);
30990            printf(" %d", n_localName);
30991            printf(" %d", n_namespaceURI);
30992            printf("\n");
30993        }
30994    }
30995    }
30996    }
30997    function_tests++;
30998#endif
30999
31000    return(test_ret);
31001}
31002
31003#ifdef LIBXML_READER_ENABLED
31004
31005#define gen_nb_xmlTextReaderErrorFunc_ptr 1
31006static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31007    return(NULL);
31008}
31009static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31010}
31011#endif
31012
31013
31014static int
31015test_xmlTextReaderGetErrorHandler(void) {
31016    int test_ret = 0;
31017
31018#if defined(LIBXML_READER_ENABLED)
31019    int mem_base;
31020    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31021    int n_reader;
31022    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
31023    int n_f;
31024    void ** arg; /* a user argument */
31025    int n_arg;
31026
31027    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31028    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
31029    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
31030        mem_base = xmlMemBlocks();
31031        reader = gen_xmlTextReaderPtr(n_reader, 0);
31032        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
31033        arg = gen_void_ptr_ptr(n_arg, 2);
31034
31035        xmlTextReaderGetErrorHandler(reader, f, arg);
31036        call_tests++;
31037        des_xmlTextReaderPtr(n_reader, reader, 0);
31038        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
31039        des_void_ptr_ptr(n_arg, arg, 2);
31040        xmlResetLastError();
31041        if (mem_base != xmlMemBlocks()) {
31042            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
31043	           xmlMemBlocks() - mem_base);
31044	    test_ret++;
31045            printf(" %d", n_reader);
31046            printf(" %d", n_f);
31047            printf(" %d", n_arg);
31048            printf("\n");
31049        }
31050    }
31051    }
31052    }
31053    function_tests++;
31054#endif
31055
31056    return(test_ret);
31057}
31058
31059
31060static int
31061test_xmlTextReaderGetParserColumnNumber(void) {
31062    int test_ret = 0;
31063
31064#if defined(LIBXML_READER_ENABLED)
31065    int mem_base;
31066    int ret_val;
31067    xmlTextReaderPtr reader; /* the user data (XML reader context) */
31068    int n_reader;
31069
31070    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31071        mem_base = xmlMemBlocks();
31072        reader = gen_xmlTextReaderPtr(n_reader, 0);
31073
31074        ret_val = xmlTextReaderGetParserColumnNumber(reader);
31075        desret_int(ret_val);
31076        call_tests++;
31077        des_xmlTextReaderPtr(n_reader, reader, 0);
31078        xmlResetLastError();
31079        if (mem_base != xmlMemBlocks()) {
31080            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
31081	           xmlMemBlocks() - mem_base);
31082	    test_ret++;
31083            printf(" %d", n_reader);
31084            printf("\n");
31085        }
31086    }
31087    function_tests++;
31088#endif
31089
31090    return(test_ret);
31091}
31092
31093
31094static int
31095test_xmlTextReaderGetParserLineNumber(void) {
31096    int test_ret = 0;
31097
31098#if defined(LIBXML_READER_ENABLED)
31099    int mem_base;
31100    int ret_val;
31101    xmlTextReaderPtr reader; /* the user data (XML reader context) */
31102    int n_reader;
31103
31104    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31105        mem_base = xmlMemBlocks();
31106        reader = gen_xmlTextReaderPtr(n_reader, 0);
31107
31108        ret_val = xmlTextReaderGetParserLineNumber(reader);
31109        desret_int(ret_val);
31110        call_tests++;
31111        des_xmlTextReaderPtr(n_reader, reader, 0);
31112        xmlResetLastError();
31113        if (mem_base != xmlMemBlocks()) {
31114            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
31115	           xmlMemBlocks() - mem_base);
31116	    test_ret++;
31117            printf(" %d", n_reader);
31118            printf("\n");
31119        }
31120    }
31121    function_tests++;
31122#endif
31123
31124    return(test_ret);
31125}
31126
31127
31128static int
31129test_xmlTextReaderGetParserProp(void) {
31130    int test_ret = 0;
31131
31132#if defined(LIBXML_READER_ENABLED)
31133    int mem_base;
31134    int ret_val;
31135    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31136    int n_reader;
31137    int prop; /* the xmlParserProperties to get */
31138    int n_prop;
31139
31140    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31141    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
31142        mem_base = xmlMemBlocks();
31143        reader = gen_xmlTextReaderPtr(n_reader, 0);
31144        prop = gen_int(n_prop, 1);
31145
31146        ret_val = xmlTextReaderGetParserProp(reader, prop);
31147        desret_int(ret_val);
31148        call_tests++;
31149        des_xmlTextReaderPtr(n_reader, reader, 0);
31150        des_int(n_prop, prop, 1);
31151        xmlResetLastError();
31152        if (mem_base != xmlMemBlocks()) {
31153            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
31154	           xmlMemBlocks() - mem_base);
31155	    test_ret++;
31156            printf(" %d", n_reader);
31157            printf(" %d", n_prop);
31158            printf("\n");
31159        }
31160    }
31161    }
31162    function_tests++;
31163#endif
31164
31165    return(test_ret);
31166}
31167
31168
31169static int
31170test_xmlTextReaderGetRemainder(void) {
31171    int test_ret = 0;
31172
31173#if defined(LIBXML_READER_ENABLED)
31174    int mem_base;
31175    xmlParserInputBufferPtr ret_val;
31176    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31177    int n_reader;
31178
31179    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31180        mem_base = xmlMemBlocks();
31181        reader = gen_xmlTextReaderPtr(n_reader, 0);
31182
31183        ret_val = xmlTextReaderGetRemainder(reader);
31184        desret_xmlParserInputBufferPtr(ret_val);
31185        call_tests++;
31186        des_xmlTextReaderPtr(n_reader, reader, 0);
31187        xmlResetLastError();
31188        if (mem_base != xmlMemBlocks()) {
31189            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
31190	           xmlMemBlocks() - mem_base);
31191	    test_ret++;
31192            printf(" %d", n_reader);
31193            printf("\n");
31194        }
31195    }
31196    function_tests++;
31197#endif
31198
31199    return(test_ret);
31200}
31201
31202
31203static int
31204test_xmlTextReaderHasAttributes(void) {
31205    int test_ret = 0;
31206
31207#if defined(LIBXML_READER_ENABLED)
31208    int mem_base;
31209    int ret_val;
31210    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31211    int n_reader;
31212
31213    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31214        mem_base = xmlMemBlocks();
31215        reader = gen_xmlTextReaderPtr(n_reader, 0);
31216
31217        ret_val = xmlTextReaderHasAttributes(reader);
31218        desret_int(ret_val);
31219        call_tests++;
31220        des_xmlTextReaderPtr(n_reader, reader, 0);
31221        xmlResetLastError();
31222        if (mem_base != xmlMemBlocks()) {
31223            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31224	           xmlMemBlocks() - mem_base);
31225	    test_ret++;
31226            printf(" %d", n_reader);
31227            printf("\n");
31228        }
31229    }
31230    function_tests++;
31231#endif
31232
31233    return(test_ret);
31234}
31235
31236
31237static int
31238test_xmlTextReaderHasValue(void) {
31239    int test_ret = 0;
31240
31241#if defined(LIBXML_READER_ENABLED)
31242    int mem_base;
31243    int ret_val;
31244    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31245    int n_reader;
31246
31247    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31248        mem_base = xmlMemBlocks();
31249        reader = gen_xmlTextReaderPtr(n_reader, 0);
31250
31251        ret_val = xmlTextReaderHasValue(reader);
31252        desret_int(ret_val);
31253        call_tests++;
31254        des_xmlTextReaderPtr(n_reader, reader, 0);
31255        xmlResetLastError();
31256        if (mem_base != xmlMemBlocks()) {
31257            printf("Leak of %d blocks found in xmlTextReaderHasValue",
31258	           xmlMemBlocks() - mem_base);
31259	    test_ret++;
31260            printf(" %d", n_reader);
31261            printf("\n");
31262        }
31263    }
31264    function_tests++;
31265#endif
31266
31267    return(test_ret);
31268}
31269
31270
31271static int
31272test_xmlTextReaderIsDefault(void) {
31273    int test_ret = 0;
31274
31275#if defined(LIBXML_READER_ENABLED)
31276    int mem_base;
31277    int ret_val;
31278    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31279    int n_reader;
31280
31281    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31282        mem_base = xmlMemBlocks();
31283        reader = gen_xmlTextReaderPtr(n_reader, 0);
31284
31285        ret_val = xmlTextReaderIsDefault(reader);
31286        desret_int(ret_val);
31287        call_tests++;
31288        des_xmlTextReaderPtr(n_reader, reader, 0);
31289        xmlResetLastError();
31290        if (mem_base != xmlMemBlocks()) {
31291            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31292	           xmlMemBlocks() - mem_base);
31293	    test_ret++;
31294            printf(" %d", n_reader);
31295            printf("\n");
31296        }
31297    }
31298    function_tests++;
31299#endif
31300
31301    return(test_ret);
31302}
31303
31304
31305static int
31306test_xmlTextReaderIsEmptyElement(void) {
31307    int test_ret = 0;
31308
31309#if defined(LIBXML_READER_ENABLED)
31310    int mem_base;
31311    int ret_val;
31312    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31313    int n_reader;
31314
31315    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31316        mem_base = xmlMemBlocks();
31317        reader = gen_xmlTextReaderPtr(n_reader, 0);
31318
31319        ret_val = xmlTextReaderIsEmptyElement(reader);
31320        desret_int(ret_val);
31321        call_tests++;
31322        des_xmlTextReaderPtr(n_reader, reader, 0);
31323        xmlResetLastError();
31324        if (mem_base != xmlMemBlocks()) {
31325            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31326	           xmlMemBlocks() - mem_base);
31327	    test_ret++;
31328            printf(" %d", n_reader);
31329            printf("\n");
31330        }
31331    }
31332    function_tests++;
31333#endif
31334
31335    return(test_ret);
31336}
31337
31338
31339static int
31340test_xmlTextReaderIsNamespaceDecl(void) {
31341    int test_ret = 0;
31342
31343#if defined(LIBXML_READER_ENABLED)
31344    int mem_base;
31345    int ret_val;
31346    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31347    int n_reader;
31348
31349    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31350        mem_base = xmlMemBlocks();
31351        reader = gen_xmlTextReaderPtr(n_reader, 0);
31352
31353        ret_val = xmlTextReaderIsNamespaceDecl(reader);
31354        desret_int(ret_val);
31355        call_tests++;
31356        des_xmlTextReaderPtr(n_reader, reader, 0);
31357        xmlResetLastError();
31358        if (mem_base != xmlMemBlocks()) {
31359            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31360	           xmlMemBlocks() - mem_base);
31361	    test_ret++;
31362            printf(" %d", n_reader);
31363            printf("\n");
31364        }
31365    }
31366    function_tests++;
31367#endif
31368
31369    return(test_ret);
31370}
31371
31372
31373static int
31374test_xmlTextReaderIsValid(void) {
31375    int test_ret = 0;
31376
31377#if defined(LIBXML_READER_ENABLED)
31378    int mem_base;
31379    int ret_val;
31380    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31381    int n_reader;
31382
31383    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31384        mem_base = xmlMemBlocks();
31385        reader = gen_xmlTextReaderPtr(n_reader, 0);
31386
31387        ret_val = xmlTextReaderIsValid(reader);
31388        desret_int(ret_val);
31389        call_tests++;
31390        des_xmlTextReaderPtr(n_reader, reader, 0);
31391        xmlResetLastError();
31392        if (mem_base != xmlMemBlocks()) {
31393            printf("Leak of %d blocks found in xmlTextReaderIsValid",
31394	           xmlMemBlocks() - mem_base);
31395	    test_ret++;
31396            printf(" %d", n_reader);
31397            printf("\n");
31398        }
31399    }
31400    function_tests++;
31401#endif
31402
31403    return(test_ret);
31404}
31405
31406
31407static int
31408test_xmlTextReaderLocalName(void) {
31409    int test_ret = 0;
31410
31411#if defined(LIBXML_READER_ENABLED)
31412    int mem_base;
31413    xmlChar * ret_val;
31414    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31415    int n_reader;
31416
31417    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31418        mem_base = xmlMemBlocks();
31419        reader = gen_xmlTextReaderPtr(n_reader, 0);
31420
31421        ret_val = xmlTextReaderLocalName(reader);
31422        desret_xmlChar_ptr(ret_val);
31423        call_tests++;
31424        des_xmlTextReaderPtr(n_reader, reader, 0);
31425        xmlResetLastError();
31426        if (mem_base != xmlMemBlocks()) {
31427            printf("Leak of %d blocks found in xmlTextReaderLocalName",
31428	           xmlMemBlocks() - mem_base);
31429	    test_ret++;
31430            printf(" %d", n_reader);
31431            printf("\n");
31432        }
31433    }
31434    function_tests++;
31435#endif
31436
31437    return(test_ret);
31438}
31439
31440#ifdef LIBXML_READER_ENABLED
31441
31442#define gen_nb_xmlTextReaderLocatorPtr 1
31443static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31444    return(NULL);
31445}
31446static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31447}
31448#endif
31449
31450
31451static int
31452test_xmlTextReaderLocatorBaseURI(void) {
31453    int test_ret = 0;
31454
31455#if defined(LIBXML_READER_ENABLED)
31456    int mem_base;
31457    xmlChar * ret_val;
31458    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31459    int n_locator;
31460
31461    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31462        mem_base = xmlMemBlocks();
31463        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31464
31465        ret_val = xmlTextReaderLocatorBaseURI(locator);
31466        desret_xmlChar_ptr(ret_val);
31467        call_tests++;
31468        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31469        xmlResetLastError();
31470        if (mem_base != xmlMemBlocks()) {
31471            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31472	           xmlMemBlocks() - mem_base);
31473	    test_ret++;
31474            printf(" %d", n_locator);
31475            printf("\n");
31476        }
31477    }
31478    function_tests++;
31479#endif
31480
31481    return(test_ret);
31482}
31483
31484
31485static int
31486test_xmlTextReaderLocatorLineNumber(void) {
31487    int test_ret = 0;
31488
31489#if defined(LIBXML_READER_ENABLED)
31490    int mem_base;
31491    int ret_val;
31492    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31493    int n_locator;
31494
31495    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31496        mem_base = xmlMemBlocks();
31497        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31498
31499        ret_val = xmlTextReaderLocatorLineNumber(locator);
31500        desret_int(ret_val);
31501        call_tests++;
31502        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31503        xmlResetLastError();
31504        if (mem_base != xmlMemBlocks()) {
31505            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31506	           xmlMemBlocks() - mem_base);
31507	    test_ret++;
31508            printf(" %d", n_locator);
31509            printf("\n");
31510        }
31511    }
31512    function_tests++;
31513#endif
31514
31515    return(test_ret);
31516}
31517
31518
31519static int
31520test_xmlTextReaderLookupNamespace(void) {
31521    int test_ret = 0;
31522
31523#if defined(LIBXML_READER_ENABLED)
31524    int mem_base;
31525    xmlChar * ret_val;
31526    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31527    int n_reader;
31528    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31529    int n_prefix;
31530
31531    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31532    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31533        mem_base = xmlMemBlocks();
31534        reader = gen_xmlTextReaderPtr(n_reader, 0);
31535        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31536
31537        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31538        desret_xmlChar_ptr(ret_val);
31539        call_tests++;
31540        des_xmlTextReaderPtr(n_reader, reader, 0);
31541        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31542        xmlResetLastError();
31543        if (mem_base != xmlMemBlocks()) {
31544            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31545	           xmlMemBlocks() - mem_base);
31546	    test_ret++;
31547            printf(" %d", n_reader);
31548            printf(" %d", n_prefix);
31549            printf("\n");
31550        }
31551    }
31552    }
31553    function_tests++;
31554#endif
31555
31556    return(test_ret);
31557}
31558
31559
31560static int
31561test_xmlTextReaderMoveToAttribute(void) {
31562    int test_ret = 0;
31563
31564#if defined(LIBXML_READER_ENABLED)
31565    int mem_base;
31566    int ret_val;
31567    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31568    int n_reader;
31569    xmlChar * name; /* the qualified name of the attribute. */
31570    int n_name;
31571
31572    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31573    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31574        mem_base = xmlMemBlocks();
31575        reader = gen_xmlTextReaderPtr(n_reader, 0);
31576        name = gen_const_xmlChar_ptr(n_name, 1);
31577
31578        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31579        desret_int(ret_val);
31580        call_tests++;
31581        des_xmlTextReaderPtr(n_reader, reader, 0);
31582        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31583        xmlResetLastError();
31584        if (mem_base != xmlMemBlocks()) {
31585            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31586	           xmlMemBlocks() - mem_base);
31587	    test_ret++;
31588            printf(" %d", n_reader);
31589            printf(" %d", n_name);
31590            printf("\n");
31591        }
31592    }
31593    }
31594    function_tests++;
31595#endif
31596
31597    return(test_ret);
31598}
31599
31600
31601static int
31602test_xmlTextReaderMoveToAttributeNo(void) {
31603    int test_ret = 0;
31604
31605#if defined(LIBXML_READER_ENABLED)
31606    int mem_base;
31607    int ret_val;
31608    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31609    int n_reader;
31610    int no; /* the zero-based index of the attribute relative to the containing element. */
31611    int n_no;
31612
31613    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31614    for (n_no = 0;n_no < gen_nb_int;n_no++) {
31615        mem_base = xmlMemBlocks();
31616        reader = gen_xmlTextReaderPtr(n_reader, 0);
31617        no = gen_int(n_no, 1);
31618
31619        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31620        desret_int(ret_val);
31621        call_tests++;
31622        des_xmlTextReaderPtr(n_reader, reader, 0);
31623        des_int(n_no, no, 1);
31624        xmlResetLastError();
31625        if (mem_base != xmlMemBlocks()) {
31626            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31627	           xmlMemBlocks() - mem_base);
31628	    test_ret++;
31629            printf(" %d", n_reader);
31630            printf(" %d", n_no);
31631            printf("\n");
31632        }
31633    }
31634    }
31635    function_tests++;
31636#endif
31637
31638    return(test_ret);
31639}
31640
31641
31642static int
31643test_xmlTextReaderMoveToAttributeNs(void) {
31644    int test_ret = 0;
31645
31646#if defined(LIBXML_READER_ENABLED)
31647    int mem_base;
31648    int ret_val;
31649    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31650    int n_reader;
31651    xmlChar * localName; /* the local name of the attribute. */
31652    int n_localName;
31653    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31654    int n_namespaceURI;
31655
31656    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31657    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31658    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31659        mem_base = xmlMemBlocks();
31660        reader = gen_xmlTextReaderPtr(n_reader, 0);
31661        localName = gen_const_xmlChar_ptr(n_localName, 1);
31662        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31663
31664        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31665        desret_int(ret_val);
31666        call_tests++;
31667        des_xmlTextReaderPtr(n_reader, reader, 0);
31668        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31669        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31670        xmlResetLastError();
31671        if (mem_base != xmlMemBlocks()) {
31672            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31673	           xmlMemBlocks() - mem_base);
31674	    test_ret++;
31675            printf(" %d", n_reader);
31676            printf(" %d", n_localName);
31677            printf(" %d", n_namespaceURI);
31678            printf("\n");
31679        }
31680    }
31681    }
31682    }
31683    function_tests++;
31684#endif
31685
31686    return(test_ret);
31687}
31688
31689
31690static int
31691test_xmlTextReaderMoveToElement(void) {
31692    int test_ret = 0;
31693
31694#if defined(LIBXML_READER_ENABLED)
31695    int mem_base;
31696    int ret_val;
31697    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31698    int n_reader;
31699
31700    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31701        mem_base = xmlMemBlocks();
31702        reader = gen_xmlTextReaderPtr(n_reader, 0);
31703
31704        ret_val = xmlTextReaderMoveToElement(reader);
31705        desret_int(ret_val);
31706        call_tests++;
31707        des_xmlTextReaderPtr(n_reader, reader, 0);
31708        xmlResetLastError();
31709        if (mem_base != xmlMemBlocks()) {
31710            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31711	           xmlMemBlocks() - mem_base);
31712	    test_ret++;
31713            printf(" %d", n_reader);
31714            printf("\n");
31715        }
31716    }
31717    function_tests++;
31718#endif
31719
31720    return(test_ret);
31721}
31722
31723
31724static int
31725test_xmlTextReaderMoveToFirstAttribute(void) {
31726    int test_ret = 0;
31727
31728#if defined(LIBXML_READER_ENABLED)
31729    int mem_base;
31730    int ret_val;
31731    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31732    int n_reader;
31733
31734    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31735        mem_base = xmlMemBlocks();
31736        reader = gen_xmlTextReaderPtr(n_reader, 0);
31737
31738        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31739        desret_int(ret_val);
31740        call_tests++;
31741        des_xmlTextReaderPtr(n_reader, reader, 0);
31742        xmlResetLastError();
31743        if (mem_base != xmlMemBlocks()) {
31744            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31745	           xmlMemBlocks() - mem_base);
31746	    test_ret++;
31747            printf(" %d", n_reader);
31748            printf("\n");
31749        }
31750    }
31751    function_tests++;
31752#endif
31753
31754    return(test_ret);
31755}
31756
31757
31758static int
31759test_xmlTextReaderMoveToNextAttribute(void) {
31760    int test_ret = 0;
31761
31762#if defined(LIBXML_READER_ENABLED)
31763    int mem_base;
31764    int ret_val;
31765    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31766    int n_reader;
31767
31768    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31769        mem_base = xmlMemBlocks();
31770        reader = gen_xmlTextReaderPtr(n_reader, 0);
31771
31772        ret_val = xmlTextReaderMoveToNextAttribute(reader);
31773        desret_int(ret_val);
31774        call_tests++;
31775        des_xmlTextReaderPtr(n_reader, reader, 0);
31776        xmlResetLastError();
31777        if (mem_base != xmlMemBlocks()) {
31778            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31779	           xmlMemBlocks() - mem_base);
31780	    test_ret++;
31781            printf(" %d", n_reader);
31782            printf("\n");
31783        }
31784    }
31785    function_tests++;
31786#endif
31787
31788    return(test_ret);
31789}
31790
31791
31792static int
31793test_xmlTextReaderName(void) {
31794    int test_ret = 0;
31795
31796#if defined(LIBXML_READER_ENABLED)
31797    int mem_base;
31798    xmlChar * ret_val;
31799    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31800    int n_reader;
31801
31802    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31803        mem_base = xmlMemBlocks();
31804        reader = gen_xmlTextReaderPtr(n_reader, 0);
31805
31806        ret_val = xmlTextReaderName(reader);
31807        desret_xmlChar_ptr(ret_val);
31808        call_tests++;
31809        des_xmlTextReaderPtr(n_reader, reader, 0);
31810        xmlResetLastError();
31811        if (mem_base != xmlMemBlocks()) {
31812            printf("Leak of %d blocks found in xmlTextReaderName",
31813	           xmlMemBlocks() - mem_base);
31814	    test_ret++;
31815            printf(" %d", n_reader);
31816            printf("\n");
31817        }
31818    }
31819    function_tests++;
31820#endif
31821
31822    return(test_ret);
31823}
31824
31825
31826static int
31827test_xmlTextReaderNamespaceUri(void) {
31828    int test_ret = 0;
31829
31830#if defined(LIBXML_READER_ENABLED)
31831    int mem_base;
31832    xmlChar * ret_val;
31833    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31834    int n_reader;
31835
31836    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31837        mem_base = xmlMemBlocks();
31838        reader = gen_xmlTextReaderPtr(n_reader, 0);
31839
31840        ret_val = xmlTextReaderNamespaceUri(reader);
31841        desret_xmlChar_ptr(ret_val);
31842        call_tests++;
31843        des_xmlTextReaderPtr(n_reader, reader, 0);
31844        xmlResetLastError();
31845        if (mem_base != xmlMemBlocks()) {
31846            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31847	           xmlMemBlocks() - mem_base);
31848	    test_ret++;
31849            printf(" %d", n_reader);
31850            printf("\n");
31851        }
31852    }
31853    function_tests++;
31854#endif
31855
31856    return(test_ret);
31857}
31858
31859
31860static int
31861test_xmlTextReaderNext(void) {
31862    int test_ret = 0;
31863
31864#if defined(LIBXML_READER_ENABLED)
31865    int mem_base;
31866    int ret_val;
31867    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31868    int n_reader;
31869
31870    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31871        mem_base = xmlMemBlocks();
31872        reader = gen_xmlTextReaderPtr(n_reader, 0);
31873
31874        ret_val = xmlTextReaderNext(reader);
31875        desret_int(ret_val);
31876        call_tests++;
31877        des_xmlTextReaderPtr(n_reader, reader, 0);
31878        xmlResetLastError();
31879        if (mem_base != xmlMemBlocks()) {
31880            printf("Leak of %d blocks found in xmlTextReaderNext",
31881	           xmlMemBlocks() - mem_base);
31882	    test_ret++;
31883            printf(" %d", n_reader);
31884            printf("\n");
31885        }
31886    }
31887    function_tests++;
31888#endif
31889
31890    return(test_ret);
31891}
31892
31893
31894static int
31895test_xmlTextReaderNextSibling(void) {
31896    int test_ret = 0;
31897
31898#if defined(LIBXML_READER_ENABLED)
31899    int mem_base;
31900    int ret_val;
31901    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31902    int n_reader;
31903
31904    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31905        mem_base = xmlMemBlocks();
31906        reader = gen_xmlTextReaderPtr(n_reader, 0);
31907
31908        ret_val = xmlTextReaderNextSibling(reader);
31909        desret_int(ret_val);
31910        call_tests++;
31911        des_xmlTextReaderPtr(n_reader, reader, 0);
31912        xmlResetLastError();
31913        if (mem_base != xmlMemBlocks()) {
31914            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31915	           xmlMemBlocks() - mem_base);
31916	    test_ret++;
31917            printf(" %d", n_reader);
31918            printf("\n");
31919        }
31920    }
31921    function_tests++;
31922#endif
31923
31924    return(test_ret);
31925}
31926
31927
31928static int
31929test_xmlTextReaderNodeType(void) {
31930    int test_ret = 0;
31931
31932#if defined(LIBXML_READER_ENABLED)
31933    int mem_base;
31934    int ret_val;
31935    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31936    int n_reader;
31937
31938    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31939        mem_base = xmlMemBlocks();
31940        reader = gen_xmlTextReaderPtr(n_reader, 0);
31941
31942        ret_val = xmlTextReaderNodeType(reader);
31943        desret_int(ret_val);
31944        call_tests++;
31945        des_xmlTextReaderPtr(n_reader, reader, 0);
31946        xmlResetLastError();
31947        if (mem_base != xmlMemBlocks()) {
31948            printf("Leak of %d blocks found in xmlTextReaderNodeType",
31949	           xmlMemBlocks() - mem_base);
31950	    test_ret++;
31951            printf(" %d", n_reader);
31952            printf("\n");
31953        }
31954    }
31955    function_tests++;
31956#endif
31957
31958    return(test_ret);
31959}
31960
31961
31962static int
31963test_xmlTextReaderNormalization(void) {
31964    int test_ret = 0;
31965
31966#if defined(LIBXML_READER_ENABLED)
31967    int mem_base;
31968    int ret_val;
31969    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31970    int n_reader;
31971
31972    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31973        mem_base = xmlMemBlocks();
31974        reader = gen_xmlTextReaderPtr(n_reader, 0);
31975
31976        ret_val = xmlTextReaderNormalization(reader);
31977        desret_int(ret_val);
31978        call_tests++;
31979        des_xmlTextReaderPtr(n_reader, reader, 0);
31980        xmlResetLastError();
31981        if (mem_base != xmlMemBlocks()) {
31982            printf("Leak of %d blocks found in xmlTextReaderNormalization",
31983	           xmlMemBlocks() - mem_base);
31984	    test_ret++;
31985            printf(" %d", n_reader);
31986            printf("\n");
31987        }
31988    }
31989    function_tests++;
31990#endif
31991
31992    return(test_ret);
31993}
31994
31995
31996static int
31997test_xmlTextReaderPrefix(void) {
31998    int test_ret = 0;
31999
32000#if defined(LIBXML_READER_ENABLED)
32001    int mem_base;
32002    xmlChar * ret_val;
32003    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32004    int n_reader;
32005
32006    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32007        mem_base = xmlMemBlocks();
32008        reader = gen_xmlTextReaderPtr(n_reader, 0);
32009
32010        ret_val = xmlTextReaderPrefix(reader);
32011        desret_xmlChar_ptr(ret_val);
32012        call_tests++;
32013        des_xmlTextReaderPtr(n_reader, reader, 0);
32014        xmlResetLastError();
32015        if (mem_base != xmlMemBlocks()) {
32016            printf("Leak of %d blocks found in xmlTextReaderPrefix",
32017	           xmlMemBlocks() - mem_base);
32018	    test_ret++;
32019            printf(" %d", n_reader);
32020            printf("\n");
32021        }
32022    }
32023    function_tests++;
32024#endif
32025
32026    return(test_ret);
32027}
32028
32029
32030static int
32031test_xmlTextReaderPreserve(void) {
32032    int test_ret = 0;
32033
32034#if defined(LIBXML_READER_ENABLED)
32035    int mem_base;
32036    xmlNodePtr ret_val;
32037    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32038    int n_reader;
32039
32040    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32041        mem_base = xmlMemBlocks();
32042        reader = gen_xmlTextReaderPtr(n_reader, 0);
32043
32044        ret_val = xmlTextReaderPreserve(reader);
32045        desret_xmlNodePtr(ret_val);
32046        call_tests++;
32047        des_xmlTextReaderPtr(n_reader, reader, 0);
32048        xmlResetLastError();
32049        if (mem_base != xmlMemBlocks()) {
32050            printf("Leak of %d blocks found in xmlTextReaderPreserve",
32051	           xmlMemBlocks() - mem_base);
32052	    test_ret++;
32053            printf(" %d", n_reader);
32054            printf("\n");
32055        }
32056    }
32057    function_tests++;
32058#endif
32059
32060    return(test_ret);
32061}
32062
32063
32064static int
32065test_xmlTextReaderPreservePattern(void) {
32066    int test_ret = 0;
32067
32068#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
32069#ifdef LIBXML_PATTERN_ENABLED
32070    int mem_base;
32071    int ret_val;
32072    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32073    int n_reader;
32074    xmlChar * pattern; /* an XPath subset pattern */
32075    int n_pattern;
32076    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
32077    int n_namespaces;
32078
32079    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32080    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
32081    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
32082        mem_base = xmlMemBlocks();
32083        reader = gen_xmlTextReaderPtr(n_reader, 0);
32084        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
32085        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
32086
32087        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
32088        desret_int(ret_val);
32089        call_tests++;
32090        des_xmlTextReaderPtr(n_reader, reader, 0);
32091        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
32092        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
32093        xmlResetLastError();
32094        if (mem_base != xmlMemBlocks()) {
32095            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
32096	           xmlMemBlocks() - mem_base);
32097	    test_ret++;
32098            printf(" %d", n_reader);
32099            printf(" %d", n_pattern);
32100            printf(" %d", n_namespaces);
32101            printf("\n");
32102        }
32103    }
32104    }
32105    }
32106    function_tests++;
32107#endif
32108#endif
32109
32110    return(test_ret);
32111}
32112
32113
32114static int
32115test_xmlTextReaderQuoteChar(void) {
32116    int test_ret = 0;
32117
32118#if defined(LIBXML_READER_ENABLED)
32119    int mem_base;
32120    int ret_val;
32121    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32122    int n_reader;
32123
32124    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32125        mem_base = xmlMemBlocks();
32126        reader = gen_xmlTextReaderPtr(n_reader, 0);
32127
32128        ret_val = xmlTextReaderQuoteChar(reader);
32129        desret_int(ret_val);
32130        call_tests++;
32131        des_xmlTextReaderPtr(n_reader, reader, 0);
32132        xmlResetLastError();
32133        if (mem_base != xmlMemBlocks()) {
32134            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
32135	           xmlMemBlocks() - mem_base);
32136	    test_ret++;
32137            printf(" %d", n_reader);
32138            printf("\n");
32139        }
32140    }
32141    function_tests++;
32142#endif
32143
32144    return(test_ret);
32145}
32146
32147
32148static int
32149test_xmlTextReaderRead(void) {
32150    int test_ret = 0;
32151
32152#if defined(LIBXML_READER_ENABLED)
32153    int mem_base;
32154    int ret_val;
32155    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32156    int n_reader;
32157
32158    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32159        mem_base = xmlMemBlocks();
32160        reader = gen_xmlTextReaderPtr(n_reader, 0);
32161
32162        ret_val = xmlTextReaderRead(reader);
32163        desret_int(ret_val);
32164        call_tests++;
32165        des_xmlTextReaderPtr(n_reader, reader, 0);
32166        xmlResetLastError();
32167        if (mem_base != xmlMemBlocks()) {
32168            printf("Leak of %d blocks found in xmlTextReaderRead",
32169	           xmlMemBlocks() - mem_base);
32170	    test_ret++;
32171            printf(" %d", n_reader);
32172            printf("\n");
32173        }
32174    }
32175    function_tests++;
32176#endif
32177
32178    return(test_ret);
32179}
32180
32181
32182static int
32183test_xmlTextReaderReadAttributeValue(void) {
32184    int test_ret = 0;
32185
32186#if defined(LIBXML_READER_ENABLED)
32187    int mem_base;
32188    int ret_val;
32189    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32190    int n_reader;
32191
32192    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32193        mem_base = xmlMemBlocks();
32194        reader = gen_xmlTextReaderPtr(n_reader, 0);
32195
32196        ret_val = xmlTextReaderReadAttributeValue(reader);
32197        desret_int(ret_val);
32198        call_tests++;
32199        des_xmlTextReaderPtr(n_reader, reader, 0);
32200        xmlResetLastError();
32201        if (mem_base != xmlMemBlocks()) {
32202            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
32203	           xmlMemBlocks() - mem_base);
32204	    test_ret++;
32205            printf(" %d", n_reader);
32206            printf("\n");
32207        }
32208    }
32209    function_tests++;
32210#endif
32211
32212    return(test_ret);
32213}
32214
32215
32216static int
32217test_xmlTextReaderReadState(void) {
32218    int test_ret = 0;
32219
32220#if defined(LIBXML_READER_ENABLED)
32221    int mem_base;
32222    int ret_val;
32223    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32224    int n_reader;
32225
32226    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32227        mem_base = xmlMemBlocks();
32228        reader = gen_xmlTextReaderPtr(n_reader, 0);
32229
32230        ret_val = xmlTextReaderReadState(reader);
32231        desret_int(ret_val);
32232        call_tests++;
32233        des_xmlTextReaderPtr(n_reader, reader, 0);
32234        xmlResetLastError();
32235        if (mem_base != xmlMemBlocks()) {
32236            printf("Leak of %d blocks found in xmlTextReaderReadState",
32237	           xmlMemBlocks() - mem_base);
32238	    test_ret++;
32239            printf(" %d", n_reader);
32240            printf("\n");
32241        }
32242    }
32243    function_tests++;
32244#endif
32245
32246    return(test_ret);
32247}
32248
32249
32250static int
32251test_xmlTextReaderRelaxNGSetSchema(void) {
32252    int test_ret = 0;
32253
32254#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32255    int mem_base;
32256    int ret_val;
32257    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32258    int n_reader;
32259    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32260    int n_schema;
32261
32262    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32263    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32264        mem_base = xmlMemBlocks();
32265        reader = gen_xmlTextReaderPtr(n_reader, 0);
32266        schema = gen_xmlRelaxNGPtr(n_schema, 1);
32267
32268        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32269        desret_int(ret_val);
32270        call_tests++;
32271        des_xmlTextReaderPtr(n_reader, reader, 0);
32272        des_xmlRelaxNGPtr(n_schema, schema, 1);
32273        xmlResetLastError();
32274        if (mem_base != xmlMemBlocks()) {
32275            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32276	           xmlMemBlocks() - mem_base);
32277	    test_ret++;
32278            printf(" %d", n_reader);
32279            printf(" %d", n_schema);
32280            printf("\n");
32281        }
32282    }
32283    }
32284    function_tests++;
32285#endif
32286
32287    return(test_ret);
32288}
32289
32290
32291static int
32292test_xmlTextReaderRelaxNGValidate(void) {
32293    int test_ret = 0;
32294
32295#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32296    int mem_base;
32297    int ret_val;
32298    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32299    int n_reader;
32300    char * rng; /* the path to a RelaxNG schema or NULL */
32301    int n_rng;
32302
32303    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32304    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32305        mem_base = xmlMemBlocks();
32306        reader = gen_xmlTextReaderPtr(n_reader, 0);
32307        rng = gen_const_char_ptr(n_rng, 1);
32308
32309        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32310        desret_int(ret_val);
32311        call_tests++;
32312        des_xmlTextReaderPtr(n_reader, reader, 0);
32313        des_const_char_ptr(n_rng, (const char *)rng, 1);
32314        xmlResetLastError();
32315        if (mem_base != xmlMemBlocks()) {
32316            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32317	           xmlMemBlocks() - mem_base);
32318	    test_ret++;
32319            printf(" %d", n_reader);
32320            printf(" %d", n_rng);
32321            printf("\n");
32322        }
32323    }
32324    }
32325    function_tests++;
32326#endif
32327
32328    return(test_ret);
32329}
32330
32331
32332static int
32333test_xmlTextReaderSchemaValidate(void) {
32334    int test_ret = 0;
32335
32336#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32337    int ret_val;
32338    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32339    int n_reader;
32340    char * xsd; /* the path to a W3C XSD schema or NULL */
32341    int n_xsd;
32342
32343    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32344    for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32345        reader = gen_xmlTextReaderPtr(n_reader, 0);
32346        xsd = gen_const_char_ptr(n_xsd, 1);
32347
32348        ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32349        desret_int(ret_val);
32350        call_tests++;
32351        des_xmlTextReaderPtr(n_reader, reader, 0);
32352        des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32353        xmlResetLastError();
32354    }
32355    }
32356    function_tests++;
32357#endif
32358
32359    return(test_ret);
32360}
32361
32362
32363static int
32364test_xmlTextReaderSchemaValidateCtxt(void) {
32365    int test_ret = 0;
32366
32367#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32368    int mem_base;
32369    int ret_val;
32370    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32371    int n_reader;
32372    xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32373    int n_ctxt;
32374    int options; /* options (not used yet) */
32375    int n_options;
32376
32377    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32378    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32379    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32380        mem_base = xmlMemBlocks();
32381        reader = gen_xmlTextReaderPtr(n_reader, 0);
32382        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32383        options = gen_parseroptions(n_options, 2);
32384
32385        ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32386        desret_int(ret_val);
32387        call_tests++;
32388        des_xmlTextReaderPtr(n_reader, reader, 0);
32389        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32390        des_parseroptions(n_options, options, 2);
32391        xmlResetLastError();
32392        if (mem_base != xmlMemBlocks()) {
32393            printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32394	           xmlMemBlocks() - mem_base);
32395	    test_ret++;
32396            printf(" %d", n_reader);
32397            printf(" %d", n_ctxt);
32398            printf(" %d", n_options);
32399            printf("\n");
32400        }
32401    }
32402    }
32403    }
32404    function_tests++;
32405#endif
32406
32407    return(test_ret);
32408}
32409
32410
32411static int
32412test_xmlTextReaderSetErrorHandler(void) {
32413    int test_ret = 0;
32414
32415
32416    /* missing type support */
32417    return(test_ret);
32418}
32419
32420
32421static int
32422test_xmlTextReaderSetParserProp(void) {
32423    int test_ret = 0;
32424
32425#if defined(LIBXML_READER_ENABLED)
32426    int mem_base;
32427    int ret_val;
32428    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32429    int n_reader;
32430    int prop; /* the xmlParserProperties to set */
32431    int n_prop;
32432    int value; /* usually 0 or 1 to (de)activate it */
32433    int n_value;
32434
32435    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32436    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32437    for (n_value = 0;n_value < gen_nb_int;n_value++) {
32438        mem_base = xmlMemBlocks();
32439        reader = gen_xmlTextReaderPtr(n_reader, 0);
32440        prop = gen_int(n_prop, 1);
32441        value = gen_int(n_value, 2);
32442
32443        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32444        desret_int(ret_val);
32445        call_tests++;
32446        des_xmlTextReaderPtr(n_reader, reader, 0);
32447        des_int(n_prop, prop, 1);
32448        des_int(n_value, value, 2);
32449        xmlResetLastError();
32450        if (mem_base != xmlMemBlocks()) {
32451            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32452	           xmlMemBlocks() - mem_base);
32453	    test_ret++;
32454            printf(" %d", n_reader);
32455            printf(" %d", n_prop);
32456            printf(" %d", n_value);
32457            printf("\n");
32458        }
32459    }
32460    }
32461    }
32462    function_tests++;
32463#endif
32464
32465    return(test_ret);
32466}
32467
32468
32469static int
32470test_xmlTextReaderSetSchema(void) {
32471    int test_ret = 0;
32472
32473#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32474    int mem_base;
32475    int ret_val;
32476    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32477    int n_reader;
32478    xmlSchemaPtr schema; /* a precompiled Schema schema */
32479    int n_schema;
32480
32481    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32482    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32483        mem_base = xmlMemBlocks();
32484        reader = gen_xmlTextReaderPtr(n_reader, 0);
32485        schema = gen_xmlSchemaPtr(n_schema, 1);
32486
32487        ret_val = xmlTextReaderSetSchema(reader, schema);
32488        desret_int(ret_val);
32489        call_tests++;
32490        des_xmlTextReaderPtr(n_reader, reader, 0);
32491        des_xmlSchemaPtr(n_schema, schema, 1);
32492        xmlResetLastError();
32493        if (mem_base != xmlMemBlocks()) {
32494            printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32495	           xmlMemBlocks() - mem_base);
32496	    test_ret++;
32497            printf(" %d", n_reader);
32498            printf(" %d", n_schema);
32499            printf("\n");
32500        }
32501    }
32502    }
32503    function_tests++;
32504#endif
32505
32506    return(test_ret);
32507}
32508
32509
32510static int
32511test_xmlTextReaderSetStructuredErrorHandler(void) {
32512    int test_ret = 0;
32513
32514
32515    /* missing type support */
32516    return(test_ret);
32517}
32518
32519
32520static int
32521test_xmlTextReaderSetup(void) {
32522    int test_ret = 0;
32523
32524#if defined(LIBXML_READER_ENABLED)
32525    int mem_base;
32526    int ret_val;
32527    xmlTextReaderPtr reader; /* an XML reader */
32528    int n_reader;
32529    xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32530    int n_input;
32531    const char * URL; /* the base URL to use for the document */
32532    int n_URL;
32533    char * encoding; /* the document encoding, or NULL */
32534    int n_encoding;
32535    int options; /* a combination of xmlParserOption */
32536    int n_options;
32537
32538    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32539    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32540    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32541    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32542    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32543        mem_base = xmlMemBlocks();
32544        reader = gen_xmlTextReaderPtr(n_reader, 0);
32545        input = gen_xmlParserInputBufferPtr(n_input, 1);
32546        URL = gen_filepath(n_URL, 2);
32547        encoding = gen_const_char_ptr(n_encoding, 3);
32548        options = gen_parseroptions(n_options, 4);
32549
32550        ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32551        desret_int(ret_val);
32552        call_tests++;
32553        des_xmlTextReaderPtr(n_reader, reader, 0);
32554        des_filepath(n_URL, URL, 2);
32555        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32556        des_parseroptions(n_options, options, 4);
32557        xmlResetLastError();
32558        if (mem_base != xmlMemBlocks()) {
32559            printf("Leak of %d blocks found in xmlTextReaderSetup",
32560	           xmlMemBlocks() - mem_base);
32561	    test_ret++;
32562            printf(" %d", n_reader);
32563            printf(" %d", n_input);
32564            printf(" %d", n_URL);
32565            printf(" %d", n_encoding);
32566            printf(" %d", n_options);
32567            printf("\n");
32568        }
32569    }
32570    }
32571    }
32572    }
32573    }
32574    function_tests++;
32575#endif
32576
32577    return(test_ret);
32578}
32579
32580
32581static int
32582test_xmlTextReaderStandalone(void) {
32583    int test_ret = 0;
32584
32585#if defined(LIBXML_READER_ENABLED)
32586    int mem_base;
32587    int ret_val;
32588    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32589    int n_reader;
32590
32591    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32592        mem_base = xmlMemBlocks();
32593        reader = gen_xmlTextReaderPtr(n_reader, 0);
32594
32595        ret_val = xmlTextReaderStandalone(reader);
32596        desret_int(ret_val);
32597        call_tests++;
32598        des_xmlTextReaderPtr(n_reader, reader, 0);
32599        xmlResetLastError();
32600        if (mem_base != xmlMemBlocks()) {
32601            printf("Leak of %d blocks found in xmlTextReaderStandalone",
32602	           xmlMemBlocks() - mem_base);
32603	    test_ret++;
32604            printf(" %d", n_reader);
32605            printf("\n");
32606        }
32607    }
32608    function_tests++;
32609#endif
32610
32611    return(test_ret);
32612}
32613
32614
32615static int
32616test_xmlTextReaderValue(void) {
32617    int test_ret = 0;
32618
32619#if defined(LIBXML_READER_ENABLED)
32620    int mem_base;
32621    xmlChar * ret_val;
32622    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32623    int n_reader;
32624
32625    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32626        mem_base = xmlMemBlocks();
32627        reader = gen_xmlTextReaderPtr(n_reader, 0);
32628
32629        ret_val = xmlTextReaderValue(reader);
32630        desret_xmlChar_ptr(ret_val);
32631        call_tests++;
32632        des_xmlTextReaderPtr(n_reader, reader, 0);
32633        xmlResetLastError();
32634        if (mem_base != xmlMemBlocks()) {
32635            printf("Leak of %d blocks found in xmlTextReaderValue",
32636	           xmlMemBlocks() - mem_base);
32637	    test_ret++;
32638            printf(" %d", n_reader);
32639            printf("\n");
32640        }
32641    }
32642    function_tests++;
32643#endif
32644
32645    return(test_ret);
32646}
32647
32648
32649static int
32650test_xmlTextReaderXmlLang(void) {
32651    int test_ret = 0;
32652
32653#if defined(LIBXML_READER_ENABLED)
32654    int mem_base;
32655    xmlChar * ret_val;
32656    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32657    int n_reader;
32658
32659    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32660        mem_base = xmlMemBlocks();
32661        reader = gen_xmlTextReaderPtr(n_reader, 0);
32662
32663        ret_val = xmlTextReaderXmlLang(reader);
32664        desret_xmlChar_ptr(ret_val);
32665        call_tests++;
32666        des_xmlTextReaderPtr(n_reader, reader, 0);
32667        xmlResetLastError();
32668        if (mem_base != xmlMemBlocks()) {
32669            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32670	           xmlMemBlocks() - mem_base);
32671	    test_ret++;
32672            printf(" %d", n_reader);
32673            printf("\n");
32674        }
32675    }
32676    function_tests++;
32677#endif
32678
32679    return(test_ret);
32680}
32681
32682static int
32683test_xmlreader(void) {
32684    int test_ret = 0;
32685
32686    if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n");
32687    test_ret += test_xmlNewTextReader();
32688    test_ret += test_xmlNewTextReaderFilename();
32689    test_ret += test_xmlReaderForDoc();
32690    test_ret += test_xmlReaderForFile();
32691    test_ret += test_xmlReaderForMemory();
32692    test_ret += test_xmlReaderNewDoc();
32693    test_ret += test_xmlReaderNewFile();
32694    test_ret += test_xmlReaderNewMemory();
32695    test_ret += test_xmlReaderNewWalker();
32696    test_ret += test_xmlReaderWalker();
32697    test_ret += test_xmlTextReaderAttributeCount();
32698    test_ret += test_xmlTextReaderBaseUri();
32699    test_ret += test_xmlTextReaderByteConsumed();
32700    test_ret += test_xmlTextReaderClose();
32701    test_ret += test_xmlTextReaderConstBaseUri();
32702    test_ret += test_xmlTextReaderConstEncoding();
32703    test_ret += test_xmlTextReaderConstLocalName();
32704    test_ret += test_xmlTextReaderConstName();
32705    test_ret += test_xmlTextReaderConstNamespaceUri();
32706    test_ret += test_xmlTextReaderConstPrefix();
32707    test_ret += test_xmlTextReaderConstString();
32708    test_ret += test_xmlTextReaderConstValue();
32709    test_ret += test_xmlTextReaderConstXmlLang();
32710    test_ret += test_xmlTextReaderConstXmlVersion();
32711    test_ret += test_xmlTextReaderCurrentDoc();
32712    test_ret += test_xmlTextReaderCurrentNode();
32713    test_ret += test_xmlTextReaderDepth();
32714    test_ret += test_xmlTextReaderExpand();
32715    test_ret += test_xmlTextReaderGetAttribute();
32716    test_ret += test_xmlTextReaderGetAttributeNo();
32717    test_ret += test_xmlTextReaderGetAttributeNs();
32718    test_ret += test_xmlTextReaderGetErrorHandler();
32719    test_ret += test_xmlTextReaderGetParserColumnNumber();
32720    test_ret += test_xmlTextReaderGetParserLineNumber();
32721    test_ret += test_xmlTextReaderGetParserProp();
32722    test_ret += test_xmlTextReaderGetRemainder();
32723    test_ret += test_xmlTextReaderHasAttributes();
32724    test_ret += test_xmlTextReaderHasValue();
32725    test_ret += test_xmlTextReaderIsDefault();
32726    test_ret += test_xmlTextReaderIsEmptyElement();
32727    test_ret += test_xmlTextReaderIsNamespaceDecl();
32728    test_ret += test_xmlTextReaderIsValid();
32729    test_ret += test_xmlTextReaderLocalName();
32730    test_ret += test_xmlTextReaderLocatorBaseURI();
32731    test_ret += test_xmlTextReaderLocatorLineNumber();
32732    test_ret += test_xmlTextReaderLookupNamespace();
32733    test_ret += test_xmlTextReaderMoveToAttribute();
32734    test_ret += test_xmlTextReaderMoveToAttributeNo();
32735    test_ret += test_xmlTextReaderMoveToAttributeNs();
32736    test_ret += test_xmlTextReaderMoveToElement();
32737    test_ret += test_xmlTextReaderMoveToFirstAttribute();
32738    test_ret += test_xmlTextReaderMoveToNextAttribute();
32739    test_ret += test_xmlTextReaderName();
32740    test_ret += test_xmlTextReaderNamespaceUri();
32741    test_ret += test_xmlTextReaderNext();
32742    test_ret += test_xmlTextReaderNextSibling();
32743    test_ret += test_xmlTextReaderNodeType();
32744    test_ret += test_xmlTextReaderNormalization();
32745    test_ret += test_xmlTextReaderPrefix();
32746    test_ret += test_xmlTextReaderPreserve();
32747    test_ret += test_xmlTextReaderPreservePattern();
32748    test_ret += test_xmlTextReaderQuoteChar();
32749    test_ret += test_xmlTextReaderRead();
32750    test_ret += test_xmlTextReaderReadAttributeValue();
32751    test_ret += test_xmlTextReaderReadState();
32752    test_ret += test_xmlTextReaderRelaxNGSetSchema();
32753    test_ret += test_xmlTextReaderRelaxNGValidate();
32754    test_ret += test_xmlTextReaderSchemaValidate();
32755    test_ret += test_xmlTextReaderSchemaValidateCtxt();
32756    test_ret += test_xmlTextReaderSetErrorHandler();
32757    test_ret += test_xmlTextReaderSetParserProp();
32758    test_ret += test_xmlTextReaderSetSchema();
32759    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32760    test_ret += test_xmlTextReaderSetup();
32761    test_ret += test_xmlTextReaderStandalone();
32762    test_ret += test_xmlTextReaderValue();
32763    test_ret += test_xmlTextReaderXmlLang();
32764
32765    if (test_ret != 0)
32766	printf("Module xmlreader: %d errors\n", test_ret);
32767    return(test_ret);
32768}
32769
32770static int
32771test_xmlExpCtxtNbCons(void) {
32772    int test_ret = 0;
32773
32774#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32775    int mem_base;
32776    int ret_val;
32777    xmlExpCtxtPtr ctxt; /* an expression context */
32778    int n_ctxt;
32779
32780    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32781        mem_base = xmlMemBlocks();
32782        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32783
32784        ret_val = xmlExpCtxtNbCons(ctxt);
32785        desret_int(ret_val);
32786        call_tests++;
32787        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32788        xmlResetLastError();
32789        if (mem_base != xmlMemBlocks()) {
32790            printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32791	           xmlMemBlocks() - mem_base);
32792	    test_ret++;
32793            printf(" %d", n_ctxt);
32794            printf("\n");
32795        }
32796    }
32797    function_tests++;
32798#endif
32799
32800    return(test_ret);
32801}
32802
32803
32804static int
32805test_xmlExpCtxtNbNodes(void) {
32806    int test_ret = 0;
32807
32808#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32809    int mem_base;
32810    int ret_val;
32811    xmlExpCtxtPtr ctxt; /* an expression context */
32812    int n_ctxt;
32813
32814    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32815        mem_base = xmlMemBlocks();
32816        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32817
32818        ret_val = xmlExpCtxtNbNodes(ctxt);
32819        desret_int(ret_val);
32820        call_tests++;
32821        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32822        xmlResetLastError();
32823        if (mem_base != xmlMemBlocks()) {
32824            printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32825	           xmlMemBlocks() - mem_base);
32826	    test_ret++;
32827            printf(" %d", n_ctxt);
32828            printf("\n");
32829        }
32830    }
32831    function_tests++;
32832#endif
32833
32834    return(test_ret);
32835}
32836
32837
32838static int
32839test_xmlExpDump(void) {
32840    int test_ret = 0;
32841
32842#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32843    int mem_base;
32844    xmlBufferPtr buf; /* a buffer to receive the output */
32845    int n_buf;
32846    xmlExpNodePtr expr; /* the compiled expression */
32847    int n_expr;
32848
32849    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32850    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32851        mem_base = xmlMemBlocks();
32852        buf = gen_xmlBufferPtr(n_buf, 0);
32853        expr = gen_xmlExpNodePtr(n_expr, 1);
32854
32855        xmlExpDump(buf, expr);
32856        call_tests++;
32857        des_xmlBufferPtr(n_buf, buf, 0);
32858        des_xmlExpNodePtr(n_expr, expr, 1);
32859        xmlResetLastError();
32860        if (mem_base != xmlMemBlocks()) {
32861            printf("Leak of %d blocks found in xmlExpDump",
32862	           xmlMemBlocks() - mem_base);
32863	    test_ret++;
32864            printf(" %d", n_buf);
32865            printf(" %d", n_expr);
32866            printf("\n");
32867        }
32868    }
32869    }
32870    function_tests++;
32871#endif
32872
32873    return(test_ret);
32874}
32875
32876
32877static int
32878test_xmlExpExpDerive(void) {
32879    int test_ret = 0;
32880
32881
32882    /* missing type support */
32883    return(test_ret);
32884}
32885
32886
32887static int
32888test_xmlExpGetLanguage(void) {
32889    int test_ret = 0;
32890
32891#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32892    int mem_base;
32893    int ret_val;
32894    xmlExpCtxtPtr ctxt; /* the expression context */
32895    int n_ctxt;
32896    xmlExpNodePtr exp; /* the expression */
32897    int n_exp;
32898    xmlChar ** langList; /* where to store the tokens */
32899    int n_langList;
32900    int len; /* the allocated lenght of @list */
32901    int n_len;
32902
32903    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32904    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32905    for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32906    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32907        mem_base = xmlMemBlocks();
32908        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32909        exp = gen_xmlExpNodePtr(n_exp, 1);
32910        langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32911        len = gen_int(n_len, 3);
32912
32913        ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32914        desret_int(ret_val);
32915        call_tests++;
32916        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32917        des_xmlExpNodePtr(n_exp, exp, 1);
32918        des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32919        des_int(n_len, len, 3);
32920        xmlResetLastError();
32921        if (mem_base != xmlMemBlocks()) {
32922            printf("Leak of %d blocks found in xmlExpGetLanguage",
32923	           xmlMemBlocks() - mem_base);
32924	    test_ret++;
32925            printf(" %d", n_ctxt);
32926            printf(" %d", n_exp);
32927            printf(" %d", n_langList);
32928            printf(" %d", n_len);
32929            printf("\n");
32930        }
32931    }
32932    }
32933    }
32934    }
32935    function_tests++;
32936#endif
32937
32938    return(test_ret);
32939}
32940
32941
32942static int
32943test_xmlExpGetStart(void) {
32944    int test_ret = 0;
32945
32946#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32947    int mem_base;
32948    int ret_val;
32949    xmlExpCtxtPtr ctxt; /* the expression context */
32950    int n_ctxt;
32951    xmlExpNodePtr exp; /* the expression */
32952    int n_exp;
32953    xmlChar ** tokList; /* where to store the tokens */
32954    int n_tokList;
32955    int len; /* the allocated lenght of @list */
32956    int n_len;
32957
32958    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32959    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32960    for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32961    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32962        mem_base = xmlMemBlocks();
32963        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32964        exp = gen_xmlExpNodePtr(n_exp, 1);
32965        tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32966        len = gen_int(n_len, 3);
32967
32968        ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32969        desret_int(ret_val);
32970        call_tests++;
32971        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32972        des_xmlExpNodePtr(n_exp, exp, 1);
32973        des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32974        des_int(n_len, len, 3);
32975        xmlResetLastError();
32976        if (mem_base != xmlMemBlocks()) {
32977            printf("Leak of %d blocks found in xmlExpGetStart",
32978	           xmlMemBlocks() - mem_base);
32979	    test_ret++;
32980            printf(" %d", n_ctxt);
32981            printf(" %d", n_exp);
32982            printf(" %d", n_tokList);
32983            printf(" %d", n_len);
32984            printf("\n");
32985        }
32986    }
32987    }
32988    }
32989    }
32990    function_tests++;
32991#endif
32992
32993    return(test_ret);
32994}
32995
32996
32997static int
32998test_xmlExpIsNillable(void) {
32999    int test_ret = 0;
33000
33001#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33002    int mem_base;
33003    int ret_val;
33004    xmlExpNodePtr exp; /* the expression */
33005    int n_exp;
33006
33007    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33008        mem_base = xmlMemBlocks();
33009        exp = gen_xmlExpNodePtr(n_exp, 0);
33010
33011        ret_val = xmlExpIsNillable(exp);
33012        desret_int(ret_val);
33013        call_tests++;
33014        des_xmlExpNodePtr(n_exp, exp, 0);
33015        xmlResetLastError();
33016        if (mem_base != xmlMemBlocks()) {
33017            printf("Leak of %d blocks found in xmlExpIsNillable",
33018	           xmlMemBlocks() - mem_base);
33019	    test_ret++;
33020            printf(" %d", n_exp);
33021            printf("\n");
33022        }
33023    }
33024    function_tests++;
33025#endif
33026
33027    return(test_ret);
33028}
33029
33030
33031static int
33032test_xmlExpMaxToken(void) {
33033    int test_ret = 0;
33034
33035#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33036    int mem_base;
33037    int ret_val;
33038    xmlExpNodePtr expr; /* a compiled expression */
33039    int n_expr;
33040
33041    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
33042        mem_base = xmlMemBlocks();
33043        expr = gen_xmlExpNodePtr(n_expr, 0);
33044
33045        ret_val = xmlExpMaxToken(expr);
33046        desret_int(ret_val);
33047        call_tests++;
33048        des_xmlExpNodePtr(n_expr, expr, 0);
33049        xmlResetLastError();
33050        if (mem_base != xmlMemBlocks()) {
33051            printf("Leak of %d blocks found in xmlExpMaxToken",
33052	           xmlMemBlocks() - mem_base);
33053	    test_ret++;
33054            printf(" %d", n_expr);
33055            printf("\n");
33056        }
33057    }
33058    function_tests++;
33059#endif
33060
33061    return(test_ret);
33062}
33063
33064
33065static int
33066test_xmlExpNewAtom(void) {
33067    int test_ret = 0;
33068
33069
33070    /* missing type support */
33071    return(test_ret);
33072}
33073
33074
33075static int
33076test_xmlExpNewCtxt(void) {
33077    int test_ret = 0;
33078
33079
33080    /* missing type support */
33081    return(test_ret);
33082}
33083
33084
33085static int
33086test_xmlExpNewOr(void) {
33087    int test_ret = 0;
33088
33089
33090    /* missing type support */
33091    return(test_ret);
33092}
33093
33094
33095static int
33096test_xmlExpNewRange(void) {
33097    int test_ret = 0;
33098
33099
33100    /* missing type support */
33101    return(test_ret);
33102}
33103
33104
33105static int
33106test_xmlExpNewSeq(void) {
33107    int test_ret = 0;
33108
33109
33110    /* missing type support */
33111    return(test_ret);
33112}
33113
33114
33115static int
33116test_xmlExpParse(void) {
33117    int test_ret = 0;
33118
33119
33120    /* missing type support */
33121    return(test_ret);
33122}
33123
33124
33125static int
33126test_xmlExpRef(void) {
33127    int test_ret = 0;
33128
33129#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33130    int mem_base;
33131    xmlExpNodePtr exp; /* the expression */
33132    int n_exp;
33133
33134    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33135        mem_base = xmlMemBlocks();
33136        exp = gen_xmlExpNodePtr(n_exp, 0);
33137
33138        xmlExpRef(exp);
33139        call_tests++;
33140        des_xmlExpNodePtr(n_exp, exp, 0);
33141        xmlResetLastError();
33142        if (mem_base != xmlMemBlocks()) {
33143            printf("Leak of %d blocks found in xmlExpRef",
33144	           xmlMemBlocks() - mem_base);
33145	    test_ret++;
33146            printf(" %d", n_exp);
33147            printf("\n");
33148        }
33149    }
33150    function_tests++;
33151#endif
33152
33153    return(test_ret);
33154}
33155
33156
33157static int
33158test_xmlExpStringDerive(void) {
33159    int test_ret = 0;
33160
33161
33162    /* missing type support */
33163    return(test_ret);
33164}
33165
33166
33167static int
33168test_xmlExpSubsume(void) {
33169    int test_ret = 0;
33170
33171#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
33172    int mem_base;
33173    int ret_val;
33174    xmlExpCtxtPtr ctxt; /* the expressions context */
33175    int n_ctxt;
33176    xmlExpNodePtr exp; /* the englobing expression */
33177    int n_exp;
33178    xmlExpNodePtr sub; /* the subexpression */
33179    int n_sub;
33180
33181    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
33182    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
33183    for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
33184        mem_base = xmlMemBlocks();
33185        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
33186        exp = gen_xmlExpNodePtr(n_exp, 1);
33187        sub = gen_xmlExpNodePtr(n_sub, 2);
33188
33189        ret_val = xmlExpSubsume(ctxt, exp, sub);
33190        desret_int(ret_val);
33191        call_tests++;
33192        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
33193        des_xmlExpNodePtr(n_exp, exp, 1);
33194        des_xmlExpNodePtr(n_sub, sub, 2);
33195        xmlResetLastError();
33196        if (mem_base != xmlMemBlocks()) {
33197            printf("Leak of %d blocks found in xmlExpSubsume",
33198	           xmlMemBlocks() - mem_base);
33199	    test_ret++;
33200            printf(" %d", n_ctxt);
33201            printf(" %d", n_exp);
33202            printf(" %d", n_sub);
33203            printf("\n");
33204        }
33205    }
33206    }
33207    }
33208    function_tests++;
33209#endif
33210
33211    return(test_ret);
33212}
33213
33214#ifdef LIBXML_REGEXP_ENABLED
33215
33216#define gen_nb_xmlRegExecCtxtPtr 1
33217static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33218    return(NULL);
33219}
33220static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33221}
33222#endif
33223
33224
33225static int
33226test_xmlRegExecErrInfo(void) {
33227    int test_ret = 0;
33228
33229#if defined(LIBXML_REGEXP_ENABLED)
33230    int mem_base;
33231    int ret_val;
33232    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33233    int n_exec;
33234    xmlChar ** string; /* return value for the error string */
33235    int n_string;
33236    int * nbval; /* pointer to the number of accepted values IN/OUT */
33237    int n_nbval;
33238    int * nbneg; /* return number of negative transitions */
33239    int n_nbneg;
33240    xmlChar ** values; /* pointer to the array of acceptable values */
33241    int n_values;
33242    int * terminal; /* return value if this was a terminal state */
33243    int n_terminal;
33244
33245    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33246    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33247    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33248    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33249    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33250    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33251        mem_base = xmlMemBlocks();
33252        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33253        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33254        nbval = gen_int_ptr(n_nbval, 2);
33255        nbneg = gen_int_ptr(n_nbneg, 3);
33256        values = gen_xmlChar_ptr_ptr(n_values, 4);
33257        terminal = gen_int_ptr(n_terminal, 5);
33258
33259        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33260        desret_int(ret_val);
33261        call_tests++;
33262        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33263        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33264        des_int_ptr(n_nbval, nbval, 2);
33265        des_int_ptr(n_nbneg, nbneg, 3);
33266        des_xmlChar_ptr_ptr(n_values, values, 4);
33267        des_int_ptr(n_terminal, terminal, 5);
33268        xmlResetLastError();
33269        if (mem_base != xmlMemBlocks()) {
33270            printf("Leak of %d blocks found in xmlRegExecErrInfo",
33271	           xmlMemBlocks() - mem_base);
33272	    test_ret++;
33273            printf(" %d", n_exec);
33274            printf(" %d", n_string);
33275            printf(" %d", n_nbval);
33276            printf(" %d", n_nbneg);
33277            printf(" %d", n_values);
33278            printf(" %d", n_terminal);
33279            printf("\n");
33280        }
33281    }
33282    }
33283    }
33284    }
33285    }
33286    }
33287    function_tests++;
33288#endif
33289
33290    return(test_ret);
33291}
33292
33293
33294static int
33295test_xmlRegExecNextValues(void) {
33296    int test_ret = 0;
33297
33298#if defined(LIBXML_REGEXP_ENABLED)
33299    int mem_base;
33300    int ret_val;
33301    xmlRegExecCtxtPtr exec; /* a regexp execution context */
33302    int n_exec;
33303    int * nbval; /* pointer to the number of accepted values IN/OUT */
33304    int n_nbval;
33305    int * nbneg; /* return number of negative transitions */
33306    int n_nbneg;
33307    xmlChar ** values; /* pointer to the array of acceptable values */
33308    int n_values;
33309    int * terminal; /* return value if this was a terminal state */
33310    int n_terminal;
33311
33312    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33313    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33314    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33315    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33316    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33317        mem_base = xmlMemBlocks();
33318        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33319        nbval = gen_int_ptr(n_nbval, 1);
33320        nbneg = gen_int_ptr(n_nbneg, 2);
33321        values = gen_xmlChar_ptr_ptr(n_values, 3);
33322        terminal = gen_int_ptr(n_terminal, 4);
33323
33324        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33325        desret_int(ret_val);
33326        call_tests++;
33327        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33328        des_int_ptr(n_nbval, nbval, 1);
33329        des_int_ptr(n_nbneg, nbneg, 2);
33330        des_xmlChar_ptr_ptr(n_values, values, 3);
33331        des_int_ptr(n_terminal, terminal, 4);
33332        xmlResetLastError();
33333        if (mem_base != xmlMemBlocks()) {
33334            printf("Leak of %d blocks found in xmlRegExecNextValues",
33335	           xmlMemBlocks() - mem_base);
33336	    test_ret++;
33337            printf(" %d", n_exec);
33338            printf(" %d", n_nbval);
33339            printf(" %d", n_nbneg);
33340            printf(" %d", n_values);
33341            printf(" %d", n_terminal);
33342            printf("\n");
33343        }
33344    }
33345    }
33346    }
33347    }
33348    }
33349    function_tests++;
33350#endif
33351
33352    return(test_ret);
33353}
33354
33355
33356static int
33357test_xmlRegExecPushString(void) {
33358    int test_ret = 0;
33359
33360#if defined(LIBXML_REGEXP_ENABLED)
33361    int mem_base;
33362    int ret_val;
33363    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33364    int n_exec;
33365    xmlChar * value; /* a string token input */
33366    int n_value;
33367    void * data; /* data associated to the token to reuse in callbacks */
33368    int n_data;
33369
33370    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33371    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33372    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33373        mem_base = xmlMemBlocks();
33374        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33375        value = gen_const_xmlChar_ptr(n_value, 1);
33376        data = gen_userdata(n_data, 2);
33377
33378        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33379        desret_int(ret_val);
33380        call_tests++;
33381        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33382        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33383        des_userdata(n_data, data, 2);
33384        xmlResetLastError();
33385        if (mem_base != xmlMemBlocks()) {
33386            printf("Leak of %d blocks found in xmlRegExecPushString",
33387	           xmlMemBlocks() - mem_base);
33388	    test_ret++;
33389            printf(" %d", n_exec);
33390            printf(" %d", n_value);
33391            printf(" %d", n_data);
33392            printf("\n");
33393        }
33394    }
33395    }
33396    }
33397    function_tests++;
33398#endif
33399
33400    return(test_ret);
33401}
33402
33403
33404static int
33405test_xmlRegExecPushString2(void) {
33406    int test_ret = 0;
33407
33408#if defined(LIBXML_REGEXP_ENABLED)
33409    int mem_base;
33410    int ret_val;
33411    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33412    int n_exec;
33413    xmlChar * value; /* the first string token input */
33414    int n_value;
33415    xmlChar * value2; /* the second string token input */
33416    int n_value2;
33417    void * data; /* data associated to the token to reuse in callbacks */
33418    int n_data;
33419
33420    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33421    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33422    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33423    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33424        mem_base = xmlMemBlocks();
33425        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33426        value = gen_const_xmlChar_ptr(n_value, 1);
33427        value2 = gen_const_xmlChar_ptr(n_value2, 2);
33428        data = gen_userdata(n_data, 3);
33429
33430        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33431        desret_int(ret_val);
33432        call_tests++;
33433        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33434        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33435        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33436        des_userdata(n_data, data, 3);
33437        xmlResetLastError();
33438        if (mem_base != xmlMemBlocks()) {
33439            printf("Leak of %d blocks found in xmlRegExecPushString2",
33440	           xmlMemBlocks() - mem_base);
33441	    test_ret++;
33442            printf(" %d", n_exec);
33443            printf(" %d", n_value);
33444            printf(" %d", n_value2);
33445            printf(" %d", n_data);
33446            printf("\n");
33447        }
33448    }
33449    }
33450    }
33451    }
33452    function_tests++;
33453#endif
33454
33455    return(test_ret);
33456}
33457
33458#ifdef LIBXML_REGEXP_ENABLED
33459
33460#define gen_nb_xmlRegexpPtr 1
33461static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33462    return(NULL);
33463}
33464static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33465}
33466#endif
33467
33468
33469static int
33470test_xmlRegNewExecCtxt(void) {
33471    int test_ret = 0;
33472
33473
33474    /* missing type support */
33475    return(test_ret);
33476}
33477
33478
33479static int
33480test_xmlRegexpCompile(void) {
33481    int test_ret = 0;
33482
33483
33484    /* missing type support */
33485    return(test_ret);
33486}
33487
33488
33489static int
33490test_xmlRegexpExec(void) {
33491    int test_ret = 0;
33492
33493#if defined(LIBXML_REGEXP_ENABLED)
33494    int mem_base;
33495    int ret_val;
33496    xmlRegexpPtr comp; /* the compiled regular expression */
33497    int n_comp;
33498    xmlChar * content; /* the value to check against the regular expression */
33499    int n_content;
33500
33501    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33502    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33503        mem_base = xmlMemBlocks();
33504        comp = gen_xmlRegexpPtr(n_comp, 0);
33505        content = gen_const_xmlChar_ptr(n_content, 1);
33506
33507        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33508        desret_int(ret_val);
33509        call_tests++;
33510        des_xmlRegexpPtr(n_comp, comp, 0);
33511        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33512        xmlResetLastError();
33513        if (mem_base != xmlMemBlocks()) {
33514            printf("Leak of %d blocks found in xmlRegexpExec",
33515	           xmlMemBlocks() - mem_base);
33516	    test_ret++;
33517            printf(" %d", n_comp);
33518            printf(" %d", n_content);
33519            printf("\n");
33520        }
33521    }
33522    }
33523    function_tests++;
33524#endif
33525
33526    return(test_ret);
33527}
33528
33529
33530static int
33531test_xmlRegexpIsDeterminist(void) {
33532    int test_ret = 0;
33533
33534#if defined(LIBXML_REGEXP_ENABLED)
33535    int mem_base;
33536    int ret_val;
33537    xmlRegexpPtr comp; /* the compiled regular expression */
33538    int n_comp;
33539
33540    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33541        mem_base = xmlMemBlocks();
33542        comp = gen_xmlRegexpPtr(n_comp, 0);
33543
33544        ret_val = xmlRegexpIsDeterminist(comp);
33545        desret_int(ret_val);
33546        call_tests++;
33547        des_xmlRegexpPtr(n_comp, comp, 0);
33548        xmlResetLastError();
33549        if (mem_base != xmlMemBlocks()) {
33550            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33551	           xmlMemBlocks() - mem_base);
33552	    test_ret++;
33553            printf(" %d", n_comp);
33554            printf("\n");
33555        }
33556    }
33557    function_tests++;
33558#endif
33559
33560    return(test_ret);
33561}
33562
33563
33564static int
33565test_xmlRegexpPrint(void) {
33566    int test_ret = 0;
33567
33568#if defined(LIBXML_REGEXP_ENABLED)
33569    int mem_base;
33570    FILE * output; /* the file for the output debug */
33571    int n_output;
33572    xmlRegexpPtr regexp; /* the compiled regexp */
33573    int n_regexp;
33574
33575    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33576    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33577        mem_base = xmlMemBlocks();
33578        output = gen_FILE_ptr(n_output, 0);
33579        regexp = gen_xmlRegexpPtr(n_regexp, 1);
33580
33581        xmlRegexpPrint(output, regexp);
33582        call_tests++;
33583        des_FILE_ptr(n_output, output, 0);
33584        des_xmlRegexpPtr(n_regexp, regexp, 1);
33585        xmlResetLastError();
33586        if (mem_base != xmlMemBlocks()) {
33587            printf("Leak of %d blocks found in xmlRegexpPrint",
33588	           xmlMemBlocks() - mem_base);
33589	    test_ret++;
33590            printf(" %d", n_output);
33591            printf(" %d", n_regexp);
33592            printf("\n");
33593        }
33594    }
33595    }
33596    function_tests++;
33597#endif
33598
33599    return(test_ret);
33600}
33601
33602static int
33603test_xmlregexp(void) {
33604    int test_ret = 0;
33605
33606    if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33607    test_ret += test_xmlExpCtxtNbCons();
33608    test_ret += test_xmlExpCtxtNbNodes();
33609    test_ret += test_xmlExpDump();
33610    test_ret += test_xmlExpExpDerive();
33611    test_ret += test_xmlExpGetLanguage();
33612    test_ret += test_xmlExpGetStart();
33613    test_ret += test_xmlExpIsNillable();
33614    test_ret += test_xmlExpMaxToken();
33615    test_ret += test_xmlExpNewAtom();
33616    test_ret += test_xmlExpNewCtxt();
33617    test_ret += test_xmlExpNewOr();
33618    test_ret += test_xmlExpNewRange();
33619    test_ret += test_xmlExpNewSeq();
33620    test_ret += test_xmlExpParse();
33621    test_ret += test_xmlExpRef();
33622    test_ret += test_xmlExpStringDerive();
33623    test_ret += test_xmlExpSubsume();
33624    test_ret += test_xmlRegExecErrInfo();
33625    test_ret += test_xmlRegExecNextValues();
33626    test_ret += test_xmlRegExecPushString();
33627    test_ret += test_xmlRegExecPushString2();
33628    test_ret += test_xmlRegNewExecCtxt();
33629    test_ret += test_xmlRegexpCompile();
33630    test_ret += test_xmlRegexpExec();
33631    test_ret += test_xmlRegexpIsDeterminist();
33632    test_ret += test_xmlRegexpPrint();
33633
33634    if (test_ret != 0)
33635	printf("Module xmlregexp: %d errors\n", test_ret);
33636    return(test_ret);
33637}
33638#ifdef LIBXML_OUTPUT_ENABLED
33639
33640#define gen_nb_xmlSaveCtxtPtr 1
33641static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33642    return(NULL);
33643}
33644static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33645}
33646#endif
33647
33648
33649static int
33650test_xmlSaveClose(void) {
33651    int test_ret = 0;
33652
33653#if defined(LIBXML_OUTPUT_ENABLED)
33654    int mem_base;
33655    int ret_val;
33656    xmlSaveCtxtPtr ctxt; /* a document saving context */
33657    int n_ctxt;
33658
33659    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33660        mem_base = xmlMemBlocks();
33661        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33662
33663        ret_val = xmlSaveClose(ctxt);
33664        desret_int(ret_val);
33665        call_tests++;
33666        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33667        xmlResetLastError();
33668        if (mem_base != xmlMemBlocks()) {
33669            printf("Leak of %d blocks found in xmlSaveClose",
33670	           xmlMemBlocks() - mem_base);
33671	    test_ret++;
33672            printf(" %d", n_ctxt);
33673            printf("\n");
33674        }
33675    }
33676    function_tests++;
33677#endif
33678
33679    return(test_ret);
33680}
33681
33682
33683static int
33684test_xmlSaveDoc(void) {
33685    int test_ret = 0;
33686
33687#if defined(LIBXML_OUTPUT_ENABLED)
33688    int mem_base;
33689    long ret_val;
33690    xmlSaveCtxtPtr ctxt; /* a document saving context */
33691    int n_ctxt;
33692    xmlDocPtr doc; /* a document */
33693    int n_doc;
33694
33695    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33696    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33697        mem_base = xmlMemBlocks();
33698        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33699        doc = gen_xmlDocPtr(n_doc, 1);
33700
33701        ret_val = xmlSaveDoc(ctxt, doc);
33702        desret_long(ret_val);
33703        call_tests++;
33704        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33705        des_xmlDocPtr(n_doc, doc, 1);
33706        xmlResetLastError();
33707        if (mem_base != xmlMemBlocks()) {
33708            printf("Leak of %d blocks found in xmlSaveDoc",
33709	           xmlMemBlocks() - mem_base);
33710	    test_ret++;
33711            printf(" %d", n_ctxt);
33712            printf(" %d", n_doc);
33713            printf("\n");
33714        }
33715    }
33716    }
33717    function_tests++;
33718#endif
33719
33720    return(test_ret);
33721}
33722
33723
33724static int
33725test_xmlSaveFlush(void) {
33726    int test_ret = 0;
33727
33728#if defined(LIBXML_OUTPUT_ENABLED)
33729    int mem_base;
33730    int ret_val;
33731    xmlSaveCtxtPtr ctxt; /* a document saving context */
33732    int n_ctxt;
33733
33734    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33735        mem_base = xmlMemBlocks();
33736        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33737
33738        ret_val = xmlSaveFlush(ctxt);
33739        desret_int(ret_val);
33740        call_tests++;
33741        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33742        xmlResetLastError();
33743        if (mem_base != xmlMemBlocks()) {
33744            printf("Leak of %d blocks found in xmlSaveFlush",
33745	           xmlMemBlocks() - mem_base);
33746	    test_ret++;
33747            printf(" %d", n_ctxt);
33748            printf("\n");
33749        }
33750    }
33751    function_tests++;
33752#endif
33753
33754    return(test_ret);
33755}
33756
33757
33758static int
33759test_xmlSaveSetAttrEscape(void) {
33760    int test_ret = 0;
33761
33762
33763    /* missing type support */
33764    return(test_ret);
33765}
33766
33767
33768static int
33769test_xmlSaveSetEscape(void) {
33770    int test_ret = 0;
33771
33772
33773    /* missing type support */
33774    return(test_ret);
33775}
33776
33777
33778static int
33779test_xmlSaveToBuffer(void) {
33780    int test_ret = 0;
33781
33782
33783    /* missing type support */
33784    return(test_ret);
33785}
33786
33787
33788static int
33789test_xmlSaveToFd(void) {
33790    int test_ret = 0;
33791
33792
33793    /* missing type support */
33794    return(test_ret);
33795}
33796
33797
33798static int
33799test_xmlSaveToFilename(void) {
33800    int test_ret = 0;
33801
33802
33803    /* missing type support */
33804    return(test_ret);
33805}
33806
33807
33808static int
33809test_xmlSaveTree(void) {
33810    int test_ret = 0;
33811
33812#if defined(LIBXML_OUTPUT_ENABLED)
33813    int mem_base;
33814    long ret_val;
33815    xmlSaveCtxtPtr ctxt; /* a document saving context */
33816    int n_ctxt;
33817    xmlNodePtr node; /* the top node of the subtree to save */
33818    int n_node;
33819
33820    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33821    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33822        mem_base = xmlMemBlocks();
33823        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33824        node = gen_xmlNodePtr(n_node, 1);
33825
33826        ret_val = xmlSaveTree(ctxt, node);
33827        desret_long(ret_val);
33828        call_tests++;
33829        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33830        des_xmlNodePtr(n_node, node, 1);
33831        xmlResetLastError();
33832        if (mem_base != xmlMemBlocks()) {
33833            printf("Leak of %d blocks found in xmlSaveTree",
33834	           xmlMemBlocks() - mem_base);
33835	    test_ret++;
33836            printf(" %d", n_ctxt);
33837            printf(" %d", n_node);
33838            printf("\n");
33839        }
33840    }
33841    }
33842    function_tests++;
33843#endif
33844
33845    return(test_ret);
33846}
33847
33848static int
33849test_xmlsave(void) {
33850    int test_ret = 0;
33851
33852    if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33853    test_ret += test_xmlSaveClose();
33854    test_ret += test_xmlSaveDoc();
33855    test_ret += test_xmlSaveFlush();
33856    test_ret += test_xmlSaveSetAttrEscape();
33857    test_ret += test_xmlSaveSetEscape();
33858    test_ret += test_xmlSaveToBuffer();
33859    test_ret += test_xmlSaveToFd();
33860    test_ret += test_xmlSaveToFilename();
33861    test_ret += test_xmlSaveTree();
33862
33863    if (test_ret != 0)
33864	printf("Module xmlsave: %d errors\n", test_ret);
33865    return(test_ret);
33866}
33867
33868static int
33869test_xmlSchemaDump(void) {
33870    int test_ret = 0;
33871
33872#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33873    int mem_base;
33874    FILE * output; /* the file output */
33875    int n_output;
33876    xmlSchemaPtr schema; /* a schema structure */
33877    int n_schema;
33878
33879    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33880    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33881        mem_base = xmlMemBlocks();
33882        output = gen_FILE_ptr(n_output, 0);
33883        schema = gen_xmlSchemaPtr(n_schema, 1);
33884
33885        xmlSchemaDump(output, schema);
33886        call_tests++;
33887        des_FILE_ptr(n_output, output, 0);
33888        des_xmlSchemaPtr(n_schema, schema, 1);
33889        xmlResetLastError();
33890        if (mem_base != xmlMemBlocks()) {
33891            printf("Leak of %d blocks found in xmlSchemaDump",
33892	           xmlMemBlocks() - mem_base);
33893	    test_ret++;
33894            printf(" %d", n_output);
33895            printf(" %d", n_schema);
33896            printf("\n");
33897        }
33898    }
33899    }
33900    function_tests++;
33901#endif
33902
33903    return(test_ret);
33904}
33905
33906#ifdef LIBXML_SCHEMAS_ENABLED
33907
33908#define gen_nb_xmlSchemaParserCtxtPtr 1
33909static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33910    return(NULL);
33911}
33912static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33913}
33914#endif
33915
33916#ifdef LIBXML_SCHEMAS_ENABLED
33917
33918#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33919static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33920    return(NULL);
33921}
33922static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33923}
33924#endif
33925
33926#ifdef LIBXML_SCHEMAS_ENABLED
33927
33928#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33929static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33930    return(NULL);
33931}
33932static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33933}
33934#endif
33935
33936
33937static int
33938test_xmlSchemaGetParserErrors(void) {
33939    int test_ret = 0;
33940
33941#if defined(LIBXML_SCHEMAS_ENABLED)
33942    int mem_base;
33943    int ret_val;
33944    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33945    int n_ctxt;
33946    xmlSchemaValidityErrorFunc * err; /* the error callback result */
33947    int n_err;
33948    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33949    int n_warn;
33950    void ** ctx; /* contextual data for the callbacks result */
33951    int n_ctx;
33952
33953    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33954    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33955    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33956    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33957        mem_base = xmlMemBlocks();
33958        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33959        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33960        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33961        ctx = gen_void_ptr_ptr(n_ctx, 3);
33962
33963        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33964        desret_int(ret_val);
33965        call_tests++;
33966        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33967        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33968        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33969        des_void_ptr_ptr(n_ctx, ctx, 3);
33970        xmlResetLastError();
33971        if (mem_base != xmlMemBlocks()) {
33972            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33973	           xmlMemBlocks() - mem_base);
33974	    test_ret++;
33975            printf(" %d", n_ctxt);
33976            printf(" %d", n_err);
33977            printf(" %d", n_warn);
33978            printf(" %d", n_ctx);
33979            printf("\n");
33980        }
33981    }
33982    }
33983    }
33984    }
33985    function_tests++;
33986#endif
33987
33988    return(test_ret);
33989}
33990
33991
33992static int
33993test_xmlSchemaGetValidErrors(void) {
33994    int test_ret = 0;
33995
33996#if defined(LIBXML_SCHEMAS_ENABLED)
33997    int mem_base;
33998    int ret_val;
33999    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
34000    int n_ctxt;
34001    xmlSchemaValidityErrorFunc * err; /* the error function result */
34002    int n_err;
34003    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
34004    int n_warn;
34005    void ** ctx; /* the functions context result */
34006    int n_ctx;
34007
34008    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34009    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
34010    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
34011    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
34012        mem_base = xmlMemBlocks();
34013        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34014        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
34015        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
34016        ctx = gen_void_ptr_ptr(n_ctx, 3);
34017
34018        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
34019        desret_int(ret_val);
34020        call_tests++;
34021        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34022        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
34023        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
34024        des_void_ptr_ptr(n_ctx, ctx, 3);
34025        xmlResetLastError();
34026        if (mem_base != xmlMemBlocks()) {
34027            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
34028	           xmlMemBlocks() - mem_base);
34029	    test_ret++;
34030            printf(" %d", n_ctxt);
34031            printf(" %d", n_err);
34032            printf(" %d", n_warn);
34033            printf(" %d", n_ctx);
34034            printf("\n");
34035        }
34036    }
34037    }
34038    }
34039    }
34040    function_tests++;
34041#endif
34042
34043    return(test_ret);
34044}
34045
34046
34047static int
34048test_xmlSchemaIsValid(void) {
34049    int test_ret = 0;
34050
34051#if defined(LIBXML_SCHEMAS_ENABLED)
34052    int mem_base;
34053    int ret_val;
34054    xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
34055    int n_ctxt;
34056
34057    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34058        mem_base = xmlMemBlocks();
34059        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34060
34061        ret_val = xmlSchemaIsValid(ctxt);
34062        desret_int(ret_val);
34063        call_tests++;
34064        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34065        xmlResetLastError();
34066        if (mem_base != xmlMemBlocks()) {
34067            printf("Leak of %d blocks found in xmlSchemaIsValid",
34068	           xmlMemBlocks() - mem_base);
34069	    test_ret++;
34070            printf(" %d", n_ctxt);
34071            printf("\n");
34072        }
34073    }
34074    function_tests++;
34075#endif
34076
34077    return(test_ret);
34078}
34079
34080
34081static int
34082test_xmlSchemaNewDocParserCtxt(void) {
34083    int test_ret = 0;
34084
34085#if defined(LIBXML_SCHEMAS_ENABLED)
34086    int mem_base;
34087    xmlSchemaParserCtxtPtr ret_val;
34088    xmlDocPtr doc; /* a preparsed document tree */
34089    int n_doc;
34090
34091    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34092        mem_base = xmlMemBlocks();
34093        doc = gen_xmlDocPtr(n_doc, 0);
34094
34095        ret_val = xmlSchemaNewDocParserCtxt(doc);
34096        desret_xmlSchemaParserCtxtPtr(ret_val);
34097        call_tests++;
34098        des_xmlDocPtr(n_doc, doc, 0);
34099        xmlResetLastError();
34100        if (mem_base != xmlMemBlocks()) {
34101            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
34102	           xmlMemBlocks() - mem_base);
34103	    test_ret++;
34104            printf(" %d", n_doc);
34105            printf("\n");
34106        }
34107    }
34108    function_tests++;
34109#endif
34110
34111    return(test_ret);
34112}
34113
34114
34115static int
34116test_xmlSchemaNewMemParserCtxt(void) {
34117    int test_ret = 0;
34118
34119#if defined(LIBXML_SCHEMAS_ENABLED)
34120    int mem_base;
34121    xmlSchemaParserCtxtPtr ret_val;
34122    char * buffer; /* a pointer to a char array containing the schemas */
34123    int n_buffer;
34124    int size; /* the size of the array */
34125    int n_size;
34126
34127    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
34128    for (n_size = 0;n_size < gen_nb_int;n_size++) {
34129        mem_base = xmlMemBlocks();
34130        buffer = gen_const_char_ptr(n_buffer, 0);
34131        size = gen_int(n_size, 1);
34132
34133        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
34134        desret_xmlSchemaParserCtxtPtr(ret_val);
34135        call_tests++;
34136        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
34137        des_int(n_size, size, 1);
34138        xmlResetLastError();
34139        if (mem_base != xmlMemBlocks()) {
34140            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
34141	           xmlMemBlocks() - mem_base);
34142	    test_ret++;
34143            printf(" %d", n_buffer);
34144            printf(" %d", n_size);
34145            printf("\n");
34146        }
34147    }
34148    }
34149    function_tests++;
34150#endif
34151
34152    return(test_ret);
34153}
34154
34155
34156static int
34157test_xmlSchemaNewParserCtxt(void) {
34158    int test_ret = 0;
34159
34160#if defined(LIBXML_SCHEMAS_ENABLED)
34161    int mem_base;
34162    xmlSchemaParserCtxtPtr ret_val;
34163    char * URL; /* the location of the schema */
34164    int n_URL;
34165
34166    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
34167        mem_base = xmlMemBlocks();
34168        URL = gen_const_char_ptr(n_URL, 0);
34169
34170        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
34171        desret_xmlSchemaParserCtxtPtr(ret_val);
34172        call_tests++;
34173        des_const_char_ptr(n_URL, (const char *)URL, 0);
34174        xmlResetLastError();
34175        if (mem_base != xmlMemBlocks()) {
34176            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
34177	           xmlMemBlocks() - mem_base);
34178	    test_ret++;
34179            printf(" %d", n_URL);
34180            printf("\n");
34181        }
34182    }
34183    function_tests++;
34184#endif
34185
34186    return(test_ret);
34187}
34188
34189
34190static int
34191test_xmlSchemaNewValidCtxt(void) {
34192    int test_ret = 0;
34193
34194
34195    /* missing type support */
34196    return(test_ret);
34197}
34198
34199
34200static int
34201test_xmlSchemaParse(void) {
34202    int test_ret = 0;
34203
34204
34205    /* missing type support */
34206    return(test_ret);
34207}
34208
34209#ifdef LIBXML_SCHEMAS_ENABLED
34210
34211#define gen_nb_xmlSAXHandlerPtr_ptr 1
34212static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34213    return(NULL);
34214}
34215static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34216}
34217#endif
34218
34219
34220static int
34221test_xmlSchemaSAXPlug(void) {
34222    int test_ret = 0;
34223
34224
34225    /* missing type support */
34226    return(test_ret);
34227}
34228
34229#ifdef LIBXML_SCHEMAS_ENABLED
34230
34231#define gen_nb_xmlSchemaSAXPlugPtr 1
34232static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34233    return(NULL);
34234}
34235static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34236}
34237#endif
34238
34239
34240static int
34241test_xmlSchemaSAXUnplug(void) {
34242    int test_ret = 0;
34243
34244#if defined(LIBXML_SCHEMAS_ENABLED)
34245    int mem_base;
34246    int ret_val;
34247    xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34248    int n_plug;
34249
34250    for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34251        mem_base = xmlMemBlocks();
34252        plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34253
34254        ret_val = xmlSchemaSAXUnplug(plug);
34255        desret_int(ret_val);
34256        call_tests++;
34257        des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34258        xmlResetLastError();
34259        if (mem_base != xmlMemBlocks()) {
34260            printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34261	           xmlMemBlocks() - mem_base);
34262	    test_ret++;
34263            printf(" %d", n_plug);
34264            printf("\n");
34265        }
34266    }
34267    function_tests++;
34268#endif
34269
34270    return(test_ret);
34271}
34272
34273
34274static int
34275test_xmlSchemaSetParserErrors(void) {
34276    int test_ret = 0;
34277
34278
34279    /* missing type support */
34280    return(test_ret);
34281}
34282
34283
34284static int
34285test_xmlSchemaSetParserStructuredErrors(void) {
34286    int test_ret = 0;
34287
34288
34289    /* missing type support */
34290    return(test_ret);
34291}
34292
34293
34294static int
34295test_xmlSchemaSetValidErrors(void) {
34296    int test_ret = 0;
34297
34298
34299    /* missing type support */
34300    return(test_ret);
34301}
34302
34303
34304static int
34305test_xmlSchemaSetValidOptions(void) {
34306    int test_ret = 0;
34307
34308#if defined(LIBXML_SCHEMAS_ENABLED)
34309    int mem_base;
34310    int ret_val;
34311    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34312    int n_ctxt;
34313    int options; /* a combination of xmlSchemaValidOption */
34314    int n_options;
34315
34316    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34317    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34318        mem_base = xmlMemBlocks();
34319        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34320        options = gen_int(n_options, 1);
34321
34322        ret_val = xmlSchemaSetValidOptions(ctxt, options);
34323        desret_int(ret_val);
34324        call_tests++;
34325        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34326        des_int(n_options, options, 1);
34327        xmlResetLastError();
34328        if (mem_base != xmlMemBlocks()) {
34329            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34330	           xmlMemBlocks() - mem_base);
34331	    test_ret++;
34332            printf(" %d", n_ctxt);
34333            printf(" %d", n_options);
34334            printf("\n");
34335        }
34336    }
34337    }
34338    function_tests++;
34339#endif
34340
34341    return(test_ret);
34342}
34343
34344
34345static int
34346test_xmlSchemaSetValidStructuredErrors(void) {
34347    int test_ret = 0;
34348
34349
34350    /* missing type support */
34351    return(test_ret);
34352}
34353
34354
34355static int
34356test_xmlSchemaValidCtxtGetOptions(void) {
34357    int test_ret = 0;
34358
34359#if defined(LIBXML_SCHEMAS_ENABLED)
34360    int mem_base;
34361    int ret_val;
34362    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34363    int n_ctxt;
34364
34365    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34366        mem_base = xmlMemBlocks();
34367        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34368
34369        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34370        desret_int(ret_val);
34371        call_tests++;
34372        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34373        xmlResetLastError();
34374        if (mem_base != xmlMemBlocks()) {
34375            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34376	           xmlMemBlocks() - mem_base);
34377	    test_ret++;
34378            printf(" %d", n_ctxt);
34379            printf("\n");
34380        }
34381    }
34382    function_tests++;
34383#endif
34384
34385    return(test_ret);
34386}
34387
34388
34389static int
34390test_xmlSchemaValidCtxtGetParserCtxt(void) {
34391    int test_ret = 0;
34392
34393#if defined(LIBXML_SCHEMAS_ENABLED)
34394    int mem_base;
34395    xmlParserCtxtPtr ret_val;
34396    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34397    int n_ctxt;
34398
34399    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34400        mem_base = xmlMemBlocks();
34401        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34402
34403        ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34404        desret_xmlParserCtxtPtr(ret_val);
34405        call_tests++;
34406        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34407        xmlResetLastError();
34408        if (mem_base != xmlMemBlocks()) {
34409            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34410	           xmlMemBlocks() - mem_base);
34411	    test_ret++;
34412            printf(" %d", n_ctxt);
34413            printf("\n");
34414        }
34415    }
34416    function_tests++;
34417#endif
34418
34419    return(test_ret);
34420}
34421
34422
34423static int
34424test_xmlSchemaValidateDoc(void) {
34425    int test_ret = 0;
34426
34427#if defined(LIBXML_SCHEMAS_ENABLED)
34428    int mem_base;
34429    int ret_val;
34430    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34431    int n_ctxt;
34432    xmlDocPtr doc; /* a parsed document tree */
34433    int n_doc;
34434
34435    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34436    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34437        mem_base = xmlMemBlocks();
34438        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34439        doc = gen_xmlDocPtr(n_doc, 1);
34440
34441        ret_val = xmlSchemaValidateDoc(ctxt, doc);
34442        desret_int(ret_val);
34443        call_tests++;
34444        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34445        des_xmlDocPtr(n_doc, doc, 1);
34446        xmlResetLastError();
34447        if (mem_base != xmlMemBlocks()) {
34448            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34449	           xmlMemBlocks() - mem_base);
34450	    test_ret++;
34451            printf(" %d", n_ctxt);
34452            printf(" %d", n_doc);
34453            printf("\n");
34454        }
34455    }
34456    }
34457    function_tests++;
34458#endif
34459
34460    return(test_ret);
34461}
34462
34463
34464static int
34465test_xmlSchemaValidateFile(void) {
34466    int test_ret = 0;
34467
34468#if defined(LIBXML_SCHEMAS_ENABLED)
34469    int mem_base;
34470    int ret_val;
34471    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34472    int n_ctxt;
34473    const char * filename; /* the URI of the instance */
34474    int n_filename;
34475    int options; /* a future set of options, currently unused */
34476    int n_options;
34477
34478    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34479    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34480    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34481        mem_base = xmlMemBlocks();
34482        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34483        filename = gen_filepath(n_filename, 1);
34484        options = gen_int(n_options, 2);
34485
34486        ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34487        desret_int(ret_val);
34488        call_tests++;
34489        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34490        des_filepath(n_filename, filename, 1);
34491        des_int(n_options, options, 2);
34492        xmlResetLastError();
34493        if (mem_base != xmlMemBlocks()) {
34494            printf("Leak of %d blocks found in xmlSchemaValidateFile",
34495	           xmlMemBlocks() - mem_base);
34496	    test_ret++;
34497            printf(" %d", n_ctxt);
34498            printf(" %d", n_filename);
34499            printf(" %d", n_options);
34500            printf("\n");
34501        }
34502    }
34503    }
34504    }
34505    function_tests++;
34506#endif
34507
34508    return(test_ret);
34509}
34510
34511
34512static int
34513test_xmlSchemaValidateOneElement(void) {
34514    int test_ret = 0;
34515
34516#if defined(LIBXML_SCHEMAS_ENABLED)
34517    int mem_base;
34518    int ret_val;
34519    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34520    int n_ctxt;
34521    xmlNodePtr elem; /* an element node */
34522    int n_elem;
34523
34524    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34525    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34526        mem_base = xmlMemBlocks();
34527        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34528        elem = gen_xmlNodePtr(n_elem, 1);
34529
34530        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34531        desret_int(ret_val);
34532        call_tests++;
34533        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34534        des_xmlNodePtr(n_elem, elem, 1);
34535        xmlResetLastError();
34536        if (mem_base != xmlMemBlocks()) {
34537            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34538	           xmlMemBlocks() - mem_base);
34539	    test_ret++;
34540            printf(" %d", n_ctxt);
34541            printf(" %d", n_elem);
34542            printf("\n");
34543        }
34544    }
34545    }
34546    function_tests++;
34547#endif
34548
34549    return(test_ret);
34550}
34551
34552
34553static int
34554test_xmlSchemaValidateStream(void) {
34555    int test_ret = 0;
34556
34557#if defined(LIBXML_SCHEMAS_ENABLED)
34558    int mem_base;
34559    int ret_val;
34560    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34561    int n_ctxt;
34562    xmlParserInputBufferPtr input; /* the input to use for reading the data */
34563    int n_input;
34564    xmlCharEncoding enc; /* an optional encoding information */
34565    int n_enc;
34566    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34567    int n_sax;
34568    void * user_data; /* the context to provide to the SAX handler. */
34569    int n_user_data;
34570
34571    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34572    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34573    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34574    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34575    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34576        mem_base = xmlMemBlocks();
34577        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34578        input = gen_xmlParserInputBufferPtr(n_input, 1);
34579        enc = gen_xmlCharEncoding(n_enc, 2);
34580        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34581        user_data = gen_userdata(n_user_data, 4);
34582
34583        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34584        desret_int(ret_val);
34585        call_tests++;
34586        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34587        des_xmlParserInputBufferPtr(n_input, input, 1);
34588        des_xmlCharEncoding(n_enc, enc, 2);
34589        des_xmlSAXHandlerPtr(n_sax, sax, 3);
34590        des_userdata(n_user_data, user_data, 4);
34591        xmlResetLastError();
34592        if (mem_base != xmlMemBlocks()) {
34593            printf("Leak of %d blocks found in xmlSchemaValidateStream",
34594	           xmlMemBlocks() - mem_base);
34595	    test_ret++;
34596            printf(" %d", n_ctxt);
34597            printf(" %d", n_input);
34598            printf(" %d", n_enc);
34599            printf(" %d", n_sax);
34600            printf(" %d", n_user_data);
34601            printf("\n");
34602        }
34603    }
34604    }
34605    }
34606    }
34607    }
34608    function_tests++;
34609#endif
34610
34611    return(test_ret);
34612}
34613
34614static int
34615test_xmlschemas(void) {
34616    int test_ret = 0;
34617
34618    if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34619    test_ret += test_xmlSchemaDump();
34620    test_ret += test_xmlSchemaGetParserErrors();
34621    test_ret += test_xmlSchemaGetValidErrors();
34622    test_ret += test_xmlSchemaIsValid();
34623    test_ret += test_xmlSchemaNewDocParserCtxt();
34624    test_ret += test_xmlSchemaNewMemParserCtxt();
34625    test_ret += test_xmlSchemaNewParserCtxt();
34626    test_ret += test_xmlSchemaNewValidCtxt();
34627    test_ret += test_xmlSchemaParse();
34628    test_ret += test_xmlSchemaSAXPlug();
34629    test_ret += test_xmlSchemaSAXUnplug();
34630    test_ret += test_xmlSchemaSetParserErrors();
34631    test_ret += test_xmlSchemaSetParserStructuredErrors();
34632    test_ret += test_xmlSchemaSetValidErrors();
34633    test_ret += test_xmlSchemaSetValidOptions();
34634    test_ret += test_xmlSchemaSetValidStructuredErrors();
34635    test_ret += test_xmlSchemaValidCtxtGetOptions();
34636    test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34637    test_ret += test_xmlSchemaValidateDoc();
34638    test_ret += test_xmlSchemaValidateFile();
34639    test_ret += test_xmlSchemaValidateOneElement();
34640    test_ret += test_xmlSchemaValidateStream();
34641
34642    if (test_ret != 0)
34643	printf("Module xmlschemas: %d errors\n", test_ret);
34644    return(test_ret);
34645}
34646#ifdef LIBXML_SCHEMAS_ENABLED
34647
34648#define gen_nb_xmlSchemaFacetPtr 1
34649static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34650    return(NULL);
34651}
34652static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34653}
34654#endif
34655
34656#ifdef LIBXML_SCHEMAS_ENABLED
34657
34658#define gen_nb_xmlSchemaTypePtr 1
34659static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34660    return(NULL);
34661}
34662static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34663}
34664#endif
34665
34666
34667static int
34668test_xmlSchemaCheckFacet(void) {
34669    int test_ret = 0;
34670
34671#if defined(LIBXML_SCHEMAS_ENABLED)
34672    int mem_base;
34673    int ret_val;
34674    xmlSchemaFacetPtr facet; /* the facet */
34675    int n_facet;
34676    xmlSchemaTypePtr typeDecl; /* the schema type definition */
34677    int n_typeDecl;
34678    xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34679    int n_pctxt;
34680    xmlChar * name; /* the optional name of the type */
34681    int n_name;
34682
34683    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34684    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34685    for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34686    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34687        mem_base = xmlMemBlocks();
34688        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34689        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34690        pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34691        name = gen_const_xmlChar_ptr(n_name, 3);
34692
34693        ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34694        desret_int(ret_val);
34695        call_tests++;
34696        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34697        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34698        des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34699        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34700        xmlResetLastError();
34701        if (mem_base != xmlMemBlocks()) {
34702            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34703	           xmlMemBlocks() - mem_base);
34704	    test_ret++;
34705            printf(" %d", n_facet);
34706            printf(" %d", n_typeDecl);
34707            printf(" %d", n_pctxt);
34708            printf(" %d", n_name);
34709            printf("\n");
34710        }
34711    }
34712    }
34713    }
34714    }
34715    function_tests++;
34716#endif
34717
34718    return(test_ret);
34719}
34720
34721
34722static int
34723test_xmlSchemaCleanupTypes(void) {
34724    int test_ret = 0;
34725
34726#if defined(LIBXML_SCHEMAS_ENABLED)
34727
34728
34729        xmlSchemaCleanupTypes();
34730        call_tests++;
34731        xmlResetLastError();
34732    function_tests++;
34733#endif
34734
34735    return(test_ret);
34736}
34737
34738
34739static int
34740test_xmlSchemaCollapseString(void) {
34741    int test_ret = 0;
34742
34743#if defined(LIBXML_SCHEMAS_ENABLED)
34744    int mem_base;
34745    xmlChar * ret_val;
34746    xmlChar * value; /* a value */
34747    int n_value;
34748
34749    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34750        mem_base = xmlMemBlocks();
34751        value = gen_const_xmlChar_ptr(n_value, 0);
34752
34753        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34754        desret_xmlChar_ptr(ret_val);
34755        call_tests++;
34756        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34757        xmlResetLastError();
34758        if (mem_base != xmlMemBlocks()) {
34759            printf("Leak of %d blocks found in xmlSchemaCollapseString",
34760	           xmlMemBlocks() - mem_base);
34761	    test_ret++;
34762            printf(" %d", n_value);
34763            printf("\n");
34764        }
34765    }
34766    function_tests++;
34767#endif
34768
34769    return(test_ret);
34770}
34771
34772#ifdef LIBXML_SCHEMAS_ENABLED
34773
34774#define gen_nb_xmlSchemaValPtr 1
34775static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34776    return(NULL);
34777}
34778static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34779}
34780#endif
34781
34782
34783static int
34784test_xmlSchemaCompareValues(void) {
34785    int test_ret = 0;
34786
34787#if defined(LIBXML_SCHEMAS_ENABLED)
34788    int mem_base;
34789    int ret_val;
34790    xmlSchemaValPtr x; /* a first value */
34791    int n_x;
34792    xmlSchemaValPtr y; /* a second value */
34793    int n_y;
34794
34795    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34796    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34797        mem_base = xmlMemBlocks();
34798        x = gen_xmlSchemaValPtr(n_x, 0);
34799        y = gen_xmlSchemaValPtr(n_y, 1);
34800
34801        ret_val = xmlSchemaCompareValues(x, y);
34802        desret_int(ret_val);
34803        call_tests++;
34804        des_xmlSchemaValPtr(n_x, x, 0);
34805        des_xmlSchemaValPtr(n_y, y, 1);
34806        xmlResetLastError();
34807        if (mem_base != xmlMemBlocks()) {
34808            printf("Leak of %d blocks found in xmlSchemaCompareValues",
34809	           xmlMemBlocks() - mem_base);
34810	    test_ret++;
34811            printf(" %d", n_x);
34812            printf(" %d", n_y);
34813            printf("\n");
34814        }
34815    }
34816    }
34817    function_tests++;
34818#endif
34819
34820    return(test_ret);
34821}
34822
34823
34824static int
34825test_xmlSchemaCompareValuesWhtsp(void) {
34826    int test_ret = 0;
34827
34828#if defined(LIBXML_SCHEMAS_ENABLED)
34829    int mem_base;
34830    int ret_val;
34831    xmlSchemaValPtr x; /* a first value */
34832    int n_x;
34833    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34834    int n_xws;
34835    xmlSchemaValPtr y; /* a second value */
34836    int n_y;
34837    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34838    int n_yws;
34839
34840    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34841    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34842    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34843    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34844        mem_base = xmlMemBlocks();
34845        x = gen_xmlSchemaValPtr(n_x, 0);
34846        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34847        y = gen_xmlSchemaValPtr(n_y, 2);
34848        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34849
34850        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34851        desret_int(ret_val);
34852        call_tests++;
34853        des_xmlSchemaValPtr(n_x, x, 0);
34854        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34855        des_xmlSchemaValPtr(n_y, y, 2);
34856        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34857        xmlResetLastError();
34858        if (mem_base != xmlMemBlocks()) {
34859            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34860	           xmlMemBlocks() - mem_base);
34861	    test_ret++;
34862            printf(" %d", n_x);
34863            printf(" %d", n_xws);
34864            printf(" %d", n_y);
34865            printf(" %d", n_yws);
34866            printf("\n");
34867        }
34868    }
34869    }
34870    }
34871    }
34872    function_tests++;
34873#endif
34874
34875    return(test_ret);
34876}
34877
34878
34879static int
34880test_xmlSchemaCopyValue(void) {
34881    int test_ret = 0;
34882
34883
34884    /* missing type support */
34885    return(test_ret);
34886}
34887
34888
34889static int
34890test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34891    int test_ret = 0;
34892
34893#if defined(LIBXML_SCHEMAS_ENABLED)
34894    int mem_base;
34895    xmlSchemaTypePtr ret_val;
34896    xmlSchemaTypePtr type; /* the built-in simple type. */
34897    int n_type;
34898
34899    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34900        mem_base = xmlMemBlocks();
34901        type = gen_xmlSchemaTypePtr(n_type, 0);
34902
34903        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34904        desret_xmlSchemaTypePtr(ret_val);
34905        call_tests++;
34906        des_xmlSchemaTypePtr(n_type, type, 0);
34907        xmlResetLastError();
34908        if (mem_base != xmlMemBlocks()) {
34909            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34910	           xmlMemBlocks() - mem_base);
34911	    test_ret++;
34912            printf(" %d", n_type);
34913            printf("\n");
34914        }
34915    }
34916    function_tests++;
34917#endif
34918
34919    return(test_ret);
34920}
34921
34922
34923static int
34924test_xmlSchemaGetBuiltInType(void) {
34925    int test_ret = 0;
34926
34927#if defined(LIBXML_SCHEMAS_ENABLED)
34928    xmlSchemaTypePtr ret_val;
34929    xmlSchemaValType type; /* the type of the built in type */
34930    int n_type;
34931
34932    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34933        type = gen_xmlSchemaValType(n_type, 0);
34934
34935        ret_val = xmlSchemaGetBuiltInType(type);
34936        desret_xmlSchemaTypePtr(ret_val);
34937        call_tests++;
34938        des_xmlSchemaValType(n_type, type, 0);
34939        xmlResetLastError();
34940    }
34941    function_tests++;
34942#endif
34943
34944    return(test_ret);
34945}
34946
34947
34948static int
34949test_xmlSchemaGetCanonValue(void) {
34950    int test_ret = 0;
34951
34952#if defined(LIBXML_SCHEMAS_ENABLED)
34953    int mem_base;
34954    int ret_val;
34955    xmlSchemaValPtr val; /* the precomputed value */
34956    int n_val;
34957    xmlChar ** retValue; /* the returned value */
34958    int n_retValue;
34959
34960    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34961    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34962        mem_base = xmlMemBlocks();
34963        val = gen_xmlSchemaValPtr(n_val, 0);
34964        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34965
34966        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34967        desret_int(ret_val);
34968        call_tests++;
34969        des_xmlSchemaValPtr(n_val, val, 0);
34970        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34971        xmlResetLastError();
34972        if (mem_base != xmlMemBlocks()) {
34973            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34974	           xmlMemBlocks() - mem_base);
34975	    test_ret++;
34976            printf(" %d", n_val);
34977            printf(" %d", n_retValue);
34978            printf("\n");
34979        }
34980    }
34981    }
34982    function_tests++;
34983#endif
34984
34985    return(test_ret);
34986}
34987
34988
34989static int
34990test_xmlSchemaGetCanonValueWhtsp(void) {
34991    int test_ret = 0;
34992
34993#if defined(LIBXML_SCHEMAS_ENABLED)
34994    int mem_base;
34995    int ret_val;
34996    xmlSchemaValPtr val; /* the precomputed value */
34997    int n_val;
34998    xmlChar ** retValue; /* the returned value */
34999    int n_retValue;
35000    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35001    int n_ws;
35002
35003    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35004    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
35005    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35006        mem_base = xmlMemBlocks();
35007        val = gen_xmlSchemaValPtr(n_val, 0);
35008        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
35009        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
35010
35011        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
35012        desret_int(ret_val);
35013        call_tests++;
35014        des_xmlSchemaValPtr(n_val, val, 0);
35015        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
35016        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
35017        xmlResetLastError();
35018        if (mem_base != xmlMemBlocks()) {
35019            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
35020	           xmlMemBlocks() - mem_base);
35021	    test_ret++;
35022            printf(" %d", n_val);
35023            printf(" %d", n_retValue);
35024            printf(" %d", n_ws);
35025            printf("\n");
35026        }
35027    }
35028    }
35029    }
35030    function_tests++;
35031#endif
35032
35033    return(test_ret);
35034}
35035
35036
35037static int
35038test_xmlSchemaGetFacetValueAsULong(void) {
35039    int test_ret = 0;
35040
35041#if defined(LIBXML_SCHEMAS_ENABLED)
35042    int mem_base;
35043    unsigned long ret_val;
35044    xmlSchemaFacetPtr facet; /* an schemas type facet */
35045    int n_facet;
35046
35047    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35048        mem_base = xmlMemBlocks();
35049        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35050
35051        ret_val = xmlSchemaGetFacetValueAsULong(facet);
35052        desret_unsigned_long(ret_val);
35053        call_tests++;
35054        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35055        xmlResetLastError();
35056        if (mem_base != xmlMemBlocks()) {
35057            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
35058	           xmlMemBlocks() - mem_base);
35059	    test_ret++;
35060            printf(" %d", n_facet);
35061            printf("\n");
35062        }
35063    }
35064    function_tests++;
35065#endif
35066
35067    return(test_ret);
35068}
35069
35070
35071static int
35072test_xmlSchemaGetPredefinedType(void) {
35073    int test_ret = 0;
35074
35075#if defined(LIBXML_SCHEMAS_ENABLED)
35076    int mem_base;
35077    xmlSchemaTypePtr ret_val;
35078    xmlChar * name; /* the type name */
35079    int n_name;
35080    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
35081    int n_ns;
35082
35083    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35084    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
35085        mem_base = xmlMemBlocks();
35086        name = gen_const_xmlChar_ptr(n_name, 0);
35087        ns = gen_const_xmlChar_ptr(n_ns, 1);
35088
35089        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
35090        desret_xmlSchemaTypePtr(ret_val);
35091        call_tests++;
35092        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
35093        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
35094        xmlResetLastError();
35095        if (mem_base != xmlMemBlocks()) {
35096            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
35097	           xmlMemBlocks() - mem_base);
35098	    test_ret++;
35099            printf(" %d", n_name);
35100            printf(" %d", n_ns);
35101            printf("\n");
35102        }
35103    }
35104    }
35105    function_tests++;
35106#endif
35107
35108    return(test_ret);
35109}
35110
35111
35112static int
35113test_xmlSchemaGetValType(void) {
35114    int test_ret = 0;
35115
35116#if defined(LIBXML_SCHEMAS_ENABLED)
35117    int mem_base;
35118    xmlSchemaValType ret_val;
35119    xmlSchemaValPtr val; /* a schemas value */
35120    int n_val;
35121
35122    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35123        mem_base = xmlMemBlocks();
35124        val = gen_xmlSchemaValPtr(n_val, 0);
35125
35126        ret_val = xmlSchemaGetValType(val);
35127        desret_xmlSchemaValType(ret_val);
35128        call_tests++;
35129        des_xmlSchemaValPtr(n_val, val, 0);
35130        xmlResetLastError();
35131        if (mem_base != xmlMemBlocks()) {
35132            printf("Leak of %d blocks found in xmlSchemaGetValType",
35133	           xmlMemBlocks() - mem_base);
35134	    test_ret++;
35135            printf(" %d", n_val);
35136            printf("\n");
35137        }
35138    }
35139    function_tests++;
35140#endif
35141
35142    return(test_ret);
35143}
35144
35145
35146static int
35147test_xmlSchemaInitTypes(void) {
35148    int test_ret = 0;
35149
35150#if defined(LIBXML_SCHEMAS_ENABLED)
35151
35152
35153        xmlSchemaInitTypes();
35154        call_tests++;
35155        xmlResetLastError();
35156    function_tests++;
35157#endif
35158
35159    return(test_ret);
35160}
35161
35162
35163static int
35164test_xmlSchemaIsBuiltInTypeFacet(void) {
35165    int test_ret = 0;
35166
35167#if defined(LIBXML_SCHEMAS_ENABLED)
35168    int mem_base;
35169    int ret_val;
35170    xmlSchemaTypePtr type; /* the built-in type */
35171    int n_type;
35172    int facetType; /* the facet type */
35173    int n_facetType;
35174
35175    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35176    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
35177        mem_base = xmlMemBlocks();
35178        type = gen_xmlSchemaTypePtr(n_type, 0);
35179        facetType = gen_int(n_facetType, 1);
35180
35181        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
35182        desret_int(ret_val);
35183        call_tests++;
35184        des_xmlSchemaTypePtr(n_type, type, 0);
35185        des_int(n_facetType, facetType, 1);
35186        xmlResetLastError();
35187        if (mem_base != xmlMemBlocks()) {
35188            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
35189	           xmlMemBlocks() - mem_base);
35190	    test_ret++;
35191            printf(" %d", n_type);
35192            printf(" %d", n_facetType);
35193            printf("\n");
35194        }
35195    }
35196    }
35197    function_tests++;
35198#endif
35199
35200    return(test_ret);
35201}
35202
35203
35204static int
35205test_xmlSchemaNewFacet(void) {
35206    int test_ret = 0;
35207
35208
35209    /* missing type support */
35210    return(test_ret);
35211}
35212
35213
35214static int
35215test_xmlSchemaNewNOTATIONValue(void) {
35216    int test_ret = 0;
35217
35218
35219    /* missing type support */
35220    return(test_ret);
35221}
35222
35223
35224static int
35225test_xmlSchemaNewQNameValue(void) {
35226    int test_ret = 0;
35227
35228
35229    /* missing type support */
35230    return(test_ret);
35231}
35232
35233
35234static int
35235test_xmlSchemaNewStringValue(void) {
35236    int test_ret = 0;
35237
35238
35239    /* missing type support */
35240    return(test_ret);
35241}
35242
35243#ifdef LIBXML_SCHEMAS_ENABLED
35244
35245#define gen_nb_xmlSchemaValPtr_ptr 1
35246static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35247    return(NULL);
35248}
35249static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35250}
35251#endif
35252
35253
35254static int
35255test_xmlSchemaValPredefTypeNode(void) {
35256    int test_ret = 0;
35257
35258#if defined(LIBXML_SCHEMAS_ENABLED)
35259    int mem_base;
35260    int ret_val;
35261    xmlSchemaTypePtr type; /* the predefined type */
35262    int n_type;
35263    xmlChar * value; /* the value to check */
35264    int n_value;
35265    xmlSchemaValPtr * val; /* the return computed value */
35266    int n_val;
35267    xmlNodePtr node; /* the node containing the value */
35268    int n_node;
35269
35270    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35271    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35272    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35273    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35274        mem_base = xmlMemBlocks();
35275        type = gen_xmlSchemaTypePtr(n_type, 0);
35276        value = gen_const_xmlChar_ptr(n_value, 1);
35277        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35278        node = gen_xmlNodePtr(n_node, 3);
35279
35280        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35281        desret_int(ret_val);
35282        call_tests++;
35283        des_xmlSchemaTypePtr(n_type, type, 0);
35284        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35285        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35286        des_xmlNodePtr(n_node, node, 3);
35287        xmlResetLastError();
35288        if (mem_base != xmlMemBlocks()) {
35289            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35290	           xmlMemBlocks() - mem_base);
35291	    test_ret++;
35292            printf(" %d", n_type);
35293            printf(" %d", n_value);
35294            printf(" %d", n_val);
35295            printf(" %d", n_node);
35296            printf("\n");
35297        }
35298    }
35299    }
35300    }
35301    }
35302    function_tests++;
35303#endif
35304
35305    return(test_ret);
35306}
35307
35308
35309static int
35310test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35311    int test_ret = 0;
35312
35313#if defined(LIBXML_SCHEMAS_ENABLED)
35314    int mem_base;
35315    int ret_val;
35316    xmlSchemaTypePtr type; /* the predefined type */
35317    int n_type;
35318    xmlChar * value; /* the value to check */
35319    int n_value;
35320    xmlSchemaValPtr * val; /* the return computed value */
35321    int n_val;
35322    xmlNodePtr node; /* the node containing the value */
35323    int n_node;
35324
35325    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35326    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35327    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35328    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35329        mem_base = xmlMemBlocks();
35330        type = gen_xmlSchemaTypePtr(n_type, 0);
35331        value = gen_const_xmlChar_ptr(n_value, 1);
35332        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35333        node = gen_xmlNodePtr(n_node, 3);
35334
35335        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35336        desret_int(ret_val);
35337        call_tests++;
35338        des_xmlSchemaTypePtr(n_type, type, 0);
35339        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35340        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35341        des_xmlNodePtr(n_node, node, 3);
35342        xmlResetLastError();
35343        if (mem_base != xmlMemBlocks()) {
35344            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35345	           xmlMemBlocks() - mem_base);
35346	    test_ret++;
35347            printf(" %d", n_type);
35348            printf(" %d", n_value);
35349            printf(" %d", n_val);
35350            printf(" %d", n_node);
35351            printf("\n");
35352        }
35353    }
35354    }
35355    }
35356    }
35357    function_tests++;
35358#endif
35359
35360    return(test_ret);
35361}
35362
35363
35364static int
35365test_xmlSchemaValidateFacet(void) {
35366    int test_ret = 0;
35367
35368#if defined(LIBXML_SCHEMAS_ENABLED)
35369    int mem_base;
35370    int ret_val;
35371    xmlSchemaTypePtr base; /* the base type */
35372    int n_base;
35373    xmlSchemaFacetPtr facet; /* the facet to check */
35374    int n_facet;
35375    xmlChar * value; /* the lexical repr of the value to validate */
35376    int n_value;
35377    xmlSchemaValPtr val; /* the precomputed value */
35378    int n_val;
35379
35380    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35381    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35382    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35383    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35384        mem_base = xmlMemBlocks();
35385        base = gen_xmlSchemaTypePtr(n_base, 0);
35386        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35387        value = gen_const_xmlChar_ptr(n_value, 2);
35388        val = gen_xmlSchemaValPtr(n_val, 3);
35389
35390        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35391        desret_int(ret_val);
35392        call_tests++;
35393        des_xmlSchemaTypePtr(n_base, base, 0);
35394        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35395        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35396        des_xmlSchemaValPtr(n_val, val, 3);
35397        xmlResetLastError();
35398        if (mem_base != xmlMemBlocks()) {
35399            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35400	           xmlMemBlocks() - mem_base);
35401	    test_ret++;
35402            printf(" %d", n_base);
35403            printf(" %d", n_facet);
35404            printf(" %d", n_value);
35405            printf(" %d", n_val);
35406            printf("\n");
35407        }
35408    }
35409    }
35410    }
35411    }
35412    function_tests++;
35413#endif
35414
35415    return(test_ret);
35416}
35417
35418
35419static int
35420test_xmlSchemaValidateFacetWhtsp(void) {
35421    int test_ret = 0;
35422
35423#if defined(LIBXML_SCHEMAS_ENABLED)
35424    int mem_base;
35425    int ret_val;
35426    xmlSchemaFacetPtr facet; /* the facet to check */
35427    int n_facet;
35428    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35429    int n_fws;
35430    xmlSchemaValType valType; /* the built-in type of the value */
35431    int n_valType;
35432    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35433    int n_value;
35434    xmlSchemaValPtr val; /* the precomputed value */
35435    int n_val;
35436    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35437    int n_ws;
35438
35439    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35440    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35441    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35442    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35443    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35444    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35445        mem_base = xmlMemBlocks();
35446        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35447        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35448        valType = gen_xmlSchemaValType(n_valType, 2);
35449        value = gen_const_xmlChar_ptr(n_value, 3);
35450        val = gen_xmlSchemaValPtr(n_val, 4);
35451        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35452
35453        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35454        desret_int(ret_val);
35455        call_tests++;
35456        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35457        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35458        des_xmlSchemaValType(n_valType, valType, 2);
35459        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35460        des_xmlSchemaValPtr(n_val, val, 4);
35461        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35462        xmlResetLastError();
35463        if (mem_base != xmlMemBlocks()) {
35464            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35465	           xmlMemBlocks() - mem_base);
35466	    test_ret++;
35467            printf(" %d", n_facet);
35468            printf(" %d", n_fws);
35469            printf(" %d", n_valType);
35470            printf(" %d", n_value);
35471            printf(" %d", n_val);
35472            printf(" %d", n_ws);
35473            printf("\n");
35474        }
35475    }
35476    }
35477    }
35478    }
35479    }
35480    }
35481    function_tests++;
35482#endif
35483
35484    return(test_ret);
35485}
35486
35487
35488static int
35489test_xmlSchemaValidateLengthFacet(void) {
35490    int test_ret = 0;
35491
35492#if defined(LIBXML_SCHEMAS_ENABLED)
35493    int mem_base;
35494    int ret_val;
35495    xmlSchemaTypePtr type; /* the built-in type */
35496    int n_type;
35497    xmlSchemaFacetPtr facet; /* the facet to check */
35498    int n_facet;
35499    xmlChar * value; /* the lexical repr. of the value to be validated */
35500    int n_value;
35501    xmlSchemaValPtr val; /* the precomputed value */
35502    int n_val;
35503    unsigned long * length; /* the actual length of the value */
35504    int n_length;
35505
35506    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35507    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35508    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35509    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35510    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35511        mem_base = xmlMemBlocks();
35512        type = gen_xmlSchemaTypePtr(n_type, 0);
35513        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35514        value = gen_const_xmlChar_ptr(n_value, 2);
35515        val = gen_xmlSchemaValPtr(n_val, 3);
35516        length = gen_unsigned_long_ptr(n_length, 4);
35517
35518        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35519        desret_int(ret_val);
35520        call_tests++;
35521        des_xmlSchemaTypePtr(n_type, type, 0);
35522        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35523        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35524        des_xmlSchemaValPtr(n_val, val, 3);
35525        des_unsigned_long_ptr(n_length, length, 4);
35526        xmlResetLastError();
35527        if (mem_base != xmlMemBlocks()) {
35528            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35529	           xmlMemBlocks() - mem_base);
35530	    test_ret++;
35531            printf(" %d", n_type);
35532            printf(" %d", n_facet);
35533            printf(" %d", n_value);
35534            printf(" %d", n_val);
35535            printf(" %d", n_length);
35536            printf("\n");
35537        }
35538    }
35539    }
35540    }
35541    }
35542    }
35543    function_tests++;
35544#endif
35545
35546    return(test_ret);
35547}
35548
35549
35550static int
35551test_xmlSchemaValidateLengthFacetWhtsp(void) {
35552    int test_ret = 0;
35553
35554#if defined(LIBXML_SCHEMAS_ENABLED)
35555    int mem_base;
35556    int ret_val;
35557    xmlSchemaFacetPtr facet; /* the facet to check */
35558    int n_facet;
35559    xmlSchemaValType valType; /* the built-in type */
35560    int n_valType;
35561    xmlChar * value; /* the lexical repr. of the value to be validated */
35562    int n_value;
35563    xmlSchemaValPtr val; /* the precomputed value */
35564    int n_val;
35565    unsigned long * length; /* the actual length of the value */
35566    int n_length;
35567    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35568    int n_ws;
35569
35570    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35571    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35572    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35573    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35574    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35575    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35576        mem_base = xmlMemBlocks();
35577        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35578        valType = gen_xmlSchemaValType(n_valType, 1);
35579        value = gen_const_xmlChar_ptr(n_value, 2);
35580        val = gen_xmlSchemaValPtr(n_val, 3);
35581        length = gen_unsigned_long_ptr(n_length, 4);
35582        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35583
35584        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35585        desret_int(ret_val);
35586        call_tests++;
35587        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35588        des_xmlSchemaValType(n_valType, valType, 1);
35589        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35590        des_xmlSchemaValPtr(n_val, val, 3);
35591        des_unsigned_long_ptr(n_length, length, 4);
35592        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35593        xmlResetLastError();
35594        if (mem_base != xmlMemBlocks()) {
35595            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35596	           xmlMemBlocks() - mem_base);
35597	    test_ret++;
35598            printf(" %d", n_facet);
35599            printf(" %d", n_valType);
35600            printf(" %d", n_value);
35601            printf(" %d", n_val);
35602            printf(" %d", n_length);
35603            printf(" %d", n_ws);
35604            printf("\n");
35605        }
35606    }
35607    }
35608    }
35609    }
35610    }
35611    }
35612    function_tests++;
35613#endif
35614
35615    return(test_ret);
35616}
35617
35618
35619static int
35620test_xmlSchemaValidateListSimpleTypeFacet(void) {
35621    int test_ret = 0;
35622
35623#if defined(LIBXML_SCHEMAS_ENABLED)
35624    int mem_base;
35625    int ret_val;
35626    xmlSchemaFacetPtr facet; /* the facet to check */
35627    int n_facet;
35628    xmlChar * value; /* the lexical repr of the value to validate */
35629    int n_value;
35630    unsigned long actualLen; /* the number of list items */
35631    int n_actualLen;
35632    unsigned long * expectedLen; /* the resulting expected number of list items */
35633    int n_expectedLen;
35634
35635    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35636    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35637    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35638    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35639        mem_base = xmlMemBlocks();
35640        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35641        value = gen_const_xmlChar_ptr(n_value, 1);
35642        actualLen = gen_unsigned_long(n_actualLen, 2);
35643        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35644
35645        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35646        desret_int(ret_val);
35647        call_tests++;
35648        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35649        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35650        des_unsigned_long(n_actualLen, actualLen, 2);
35651        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35652        xmlResetLastError();
35653        if (mem_base != xmlMemBlocks()) {
35654            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35655	           xmlMemBlocks() - mem_base);
35656	    test_ret++;
35657            printf(" %d", n_facet);
35658            printf(" %d", n_value);
35659            printf(" %d", n_actualLen);
35660            printf(" %d", n_expectedLen);
35661            printf("\n");
35662        }
35663    }
35664    }
35665    }
35666    }
35667    function_tests++;
35668#endif
35669
35670    return(test_ret);
35671}
35672
35673
35674static int
35675test_xmlSchemaValidatePredefinedType(void) {
35676    int test_ret = 0;
35677
35678#if defined(LIBXML_SCHEMAS_ENABLED)
35679    int mem_base;
35680    int ret_val;
35681    xmlSchemaTypePtr type; /* the predefined type */
35682    int n_type;
35683    xmlChar * value; /* the value to check */
35684    int n_value;
35685    xmlSchemaValPtr * val; /* the return computed value */
35686    int n_val;
35687
35688    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35689    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35690    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35691        mem_base = xmlMemBlocks();
35692        type = gen_xmlSchemaTypePtr(n_type, 0);
35693        value = gen_const_xmlChar_ptr(n_value, 1);
35694        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35695
35696        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35697        desret_int(ret_val);
35698        call_tests++;
35699        des_xmlSchemaTypePtr(n_type, type, 0);
35700        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35701        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35702        xmlResetLastError();
35703        if (mem_base != xmlMemBlocks()) {
35704            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35705	           xmlMemBlocks() - mem_base);
35706	    test_ret++;
35707            printf(" %d", n_type);
35708            printf(" %d", n_value);
35709            printf(" %d", n_val);
35710            printf("\n");
35711        }
35712    }
35713    }
35714    }
35715    function_tests++;
35716#endif
35717
35718    return(test_ret);
35719}
35720
35721
35722static int
35723test_xmlSchemaValueAppend(void) {
35724    int test_ret = 0;
35725
35726#if defined(LIBXML_SCHEMAS_ENABLED)
35727    int mem_base;
35728    int ret_val;
35729    xmlSchemaValPtr prev; /* the value */
35730    int n_prev;
35731    xmlSchemaValPtr cur; /* the value to be appended */
35732    int n_cur;
35733
35734    for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35735    for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35736        mem_base = xmlMemBlocks();
35737        prev = gen_xmlSchemaValPtr(n_prev, 0);
35738        cur = gen_xmlSchemaValPtr(n_cur, 1);
35739
35740        ret_val = xmlSchemaValueAppend(prev, cur);
35741        desret_int(ret_val);
35742        call_tests++;
35743        des_xmlSchemaValPtr(n_prev, prev, 0);
35744        des_xmlSchemaValPtr(n_cur, cur, 1);
35745        xmlResetLastError();
35746        if (mem_base != xmlMemBlocks()) {
35747            printf("Leak of %d blocks found in xmlSchemaValueAppend",
35748	           xmlMemBlocks() - mem_base);
35749	    test_ret++;
35750            printf(" %d", n_prev);
35751            printf(" %d", n_cur);
35752            printf("\n");
35753        }
35754    }
35755    }
35756    function_tests++;
35757#endif
35758
35759    return(test_ret);
35760}
35761
35762
35763static int
35764test_xmlSchemaValueGetAsBoolean(void) {
35765    int test_ret = 0;
35766
35767#if defined(LIBXML_SCHEMAS_ENABLED)
35768    int mem_base;
35769    int ret_val;
35770    xmlSchemaValPtr val; /* the value */
35771    int n_val;
35772
35773    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35774        mem_base = xmlMemBlocks();
35775        val = gen_xmlSchemaValPtr(n_val, 0);
35776
35777        ret_val = xmlSchemaValueGetAsBoolean(val);
35778        desret_int(ret_val);
35779        call_tests++;
35780        des_xmlSchemaValPtr(n_val, val, 0);
35781        xmlResetLastError();
35782        if (mem_base != xmlMemBlocks()) {
35783            printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35784	           xmlMemBlocks() - mem_base);
35785	    test_ret++;
35786            printf(" %d", n_val);
35787            printf("\n");
35788        }
35789    }
35790    function_tests++;
35791#endif
35792
35793    return(test_ret);
35794}
35795
35796
35797static int
35798test_xmlSchemaValueGetAsString(void) {
35799    int test_ret = 0;
35800
35801#if defined(LIBXML_SCHEMAS_ENABLED)
35802    int mem_base;
35803    const xmlChar * ret_val;
35804    xmlSchemaValPtr val; /* the value */
35805    int n_val;
35806
35807    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35808        mem_base = xmlMemBlocks();
35809        val = gen_xmlSchemaValPtr(n_val, 0);
35810
35811        ret_val = xmlSchemaValueGetAsString(val);
35812        desret_const_xmlChar_ptr(ret_val);
35813        call_tests++;
35814        des_xmlSchemaValPtr(n_val, val, 0);
35815        xmlResetLastError();
35816        if (mem_base != xmlMemBlocks()) {
35817            printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35818	           xmlMemBlocks() - mem_base);
35819	    test_ret++;
35820            printf(" %d", n_val);
35821            printf("\n");
35822        }
35823    }
35824    function_tests++;
35825#endif
35826
35827    return(test_ret);
35828}
35829
35830
35831static int
35832test_xmlSchemaValueGetNext(void) {
35833    int test_ret = 0;
35834
35835
35836    /* missing type support */
35837    return(test_ret);
35838}
35839
35840
35841static int
35842test_xmlSchemaWhiteSpaceReplace(void) {
35843    int test_ret = 0;
35844
35845#if defined(LIBXML_SCHEMAS_ENABLED)
35846    int mem_base;
35847    xmlChar * ret_val;
35848    xmlChar * value; /* a value */
35849    int n_value;
35850
35851    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35852        mem_base = xmlMemBlocks();
35853        value = gen_const_xmlChar_ptr(n_value, 0);
35854
35855        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35856        desret_xmlChar_ptr(ret_val);
35857        call_tests++;
35858        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35859        xmlResetLastError();
35860        if (mem_base != xmlMemBlocks()) {
35861            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35862	           xmlMemBlocks() - mem_base);
35863	    test_ret++;
35864            printf(" %d", n_value);
35865            printf("\n");
35866        }
35867    }
35868    function_tests++;
35869#endif
35870
35871    return(test_ret);
35872}
35873
35874static int
35875test_xmlschemastypes(void) {
35876    int test_ret = 0;
35877
35878    if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35879    test_ret += test_xmlSchemaCheckFacet();
35880    test_ret += test_xmlSchemaCleanupTypes();
35881    test_ret += test_xmlSchemaCollapseString();
35882    test_ret += test_xmlSchemaCompareValues();
35883    test_ret += test_xmlSchemaCompareValuesWhtsp();
35884    test_ret += test_xmlSchemaCopyValue();
35885    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35886    test_ret += test_xmlSchemaGetBuiltInType();
35887    test_ret += test_xmlSchemaGetCanonValue();
35888    test_ret += test_xmlSchemaGetCanonValueWhtsp();
35889    test_ret += test_xmlSchemaGetFacetValueAsULong();
35890    test_ret += test_xmlSchemaGetPredefinedType();
35891    test_ret += test_xmlSchemaGetValType();
35892    test_ret += test_xmlSchemaInitTypes();
35893    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35894    test_ret += test_xmlSchemaNewFacet();
35895    test_ret += test_xmlSchemaNewNOTATIONValue();
35896    test_ret += test_xmlSchemaNewQNameValue();
35897    test_ret += test_xmlSchemaNewStringValue();
35898    test_ret += test_xmlSchemaValPredefTypeNode();
35899    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35900    test_ret += test_xmlSchemaValidateFacet();
35901    test_ret += test_xmlSchemaValidateFacetWhtsp();
35902    test_ret += test_xmlSchemaValidateLengthFacet();
35903    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35904    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35905    test_ret += test_xmlSchemaValidatePredefinedType();
35906    test_ret += test_xmlSchemaValueAppend();
35907    test_ret += test_xmlSchemaValueGetAsBoolean();
35908    test_ret += test_xmlSchemaValueGetAsString();
35909    test_ret += test_xmlSchemaValueGetNext();
35910    test_ret += test_xmlSchemaWhiteSpaceReplace();
35911
35912    if (test_ret != 0)
35913	printf("Module xmlschemastypes: %d errors\n", test_ret);
35914    return(test_ret);
35915}
35916
35917static int
35918test_xmlCharStrdup(void) {
35919    int test_ret = 0;
35920
35921    int mem_base;
35922    xmlChar * ret_val;
35923    char * cur; /* the input char * */
35924    int n_cur;
35925
35926    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35927        mem_base = xmlMemBlocks();
35928        cur = gen_const_char_ptr(n_cur, 0);
35929
35930        ret_val = xmlCharStrdup((const char *)cur);
35931        desret_xmlChar_ptr(ret_val);
35932        call_tests++;
35933        des_const_char_ptr(n_cur, (const char *)cur, 0);
35934        xmlResetLastError();
35935        if (mem_base != xmlMemBlocks()) {
35936            printf("Leak of %d blocks found in xmlCharStrdup",
35937	           xmlMemBlocks() - mem_base);
35938	    test_ret++;
35939            printf(" %d", n_cur);
35940            printf("\n");
35941        }
35942    }
35943    function_tests++;
35944
35945    return(test_ret);
35946}
35947
35948
35949static int
35950test_xmlCharStrndup(void) {
35951    int test_ret = 0;
35952
35953    int mem_base;
35954    xmlChar * ret_val;
35955    char * cur; /* the input char * */
35956    int n_cur;
35957    int len; /* the len of @cur */
35958    int n_len;
35959
35960    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35961    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35962        mem_base = xmlMemBlocks();
35963        cur = gen_const_char_ptr(n_cur, 0);
35964        len = gen_int(n_len, 1);
35965
35966        ret_val = xmlCharStrndup((const char *)cur, len);
35967        desret_xmlChar_ptr(ret_val);
35968        call_tests++;
35969        des_const_char_ptr(n_cur, (const char *)cur, 0);
35970        des_int(n_len, len, 1);
35971        xmlResetLastError();
35972        if (mem_base != xmlMemBlocks()) {
35973            printf("Leak of %d blocks found in xmlCharStrndup",
35974	           xmlMemBlocks() - mem_base);
35975	    test_ret++;
35976            printf(" %d", n_cur);
35977            printf(" %d", n_len);
35978            printf("\n");
35979        }
35980    }
35981    }
35982    function_tests++;
35983
35984    return(test_ret);
35985}
35986
35987
35988static int
35989test_xmlCheckUTF8(void) {
35990    int test_ret = 0;
35991
35992    int mem_base;
35993    int ret_val;
35994    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35995    int n_utf;
35996
35997    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35998        mem_base = xmlMemBlocks();
35999        utf = gen_const_unsigned_char_ptr(n_utf, 0);
36000
36001        ret_val = xmlCheckUTF8((const unsigned char *)utf);
36002        desret_int(ret_val);
36003        call_tests++;
36004        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36005        xmlResetLastError();
36006        if (mem_base != xmlMemBlocks()) {
36007            printf("Leak of %d blocks found in xmlCheckUTF8",
36008	           xmlMemBlocks() - mem_base);
36009	    test_ret++;
36010            printf(" %d", n_utf);
36011            printf("\n");
36012        }
36013    }
36014    function_tests++;
36015
36016    return(test_ret);
36017}
36018
36019
36020static int
36021test_xmlGetUTF8Char(void) {
36022    int test_ret = 0;
36023
36024    int mem_base;
36025    int ret_val;
36026    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
36027    int n_utf;
36028    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. */
36029    int n_len;
36030
36031    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
36032    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
36033        mem_base = xmlMemBlocks();
36034        utf = gen_const_unsigned_char_ptr(n_utf, 0);
36035        len = gen_int_ptr(n_len, 1);
36036
36037        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
36038        desret_int(ret_val);
36039        call_tests++;
36040        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
36041        des_int_ptr(n_len, len, 1);
36042        xmlResetLastError();
36043        if (mem_base != xmlMemBlocks()) {
36044            printf("Leak of %d blocks found in xmlGetUTF8Char",
36045	           xmlMemBlocks() - mem_base);
36046	    test_ret++;
36047            printf(" %d", n_utf);
36048            printf(" %d", n_len);
36049            printf("\n");
36050        }
36051    }
36052    }
36053    function_tests++;
36054
36055    return(test_ret);
36056}
36057
36058
36059static int
36060test_xmlStrEqual(void) {
36061    int test_ret = 0;
36062
36063    int mem_base;
36064    int ret_val;
36065    xmlChar * str1; /* the first xmlChar * */
36066    int n_str1;
36067    xmlChar * str2; /* the second xmlChar * */
36068    int n_str2;
36069
36070    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36071    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36072        mem_base = xmlMemBlocks();
36073        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36074        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36075
36076        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
36077        desret_int(ret_val);
36078        call_tests++;
36079        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36080        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36081        xmlResetLastError();
36082        if (mem_base != xmlMemBlocks()) {
36083            printf("Leak of %d blocks found in xmlStrEqual",
36084	           xmlMemBlocks() - mem_base);
36085	    test_ret++;
36086            printf(" %d", n_str1);
36087            printf(" %d", n_str2);
36088            printf("\n");
36089        }
36090    }
36091    }
36092    function_tests++;
36093
36094    return(test_ret);
36095}
36096
36097
36098static int
36099test_xmlStrPrintf(void) {
36100    int test_ret = 0;
36101
36102
36103    /* missing type support */
36104    return(test_ret);
36105}
36106
36107
36108static int
36109test_xmlStrQEqual(void) {
36110    int test_ret = 0;
36111
36112    int mem_base;
36113    int ret_val;
36114    xmlChar * pref; /* the prefix of the QName */
36115    int n_pref;
36116    xmlChar * name; /* the localname of the QName */
36117    int n_name;
36118    xmlChar * str; /* the second xmlChar * */
36119    int n_str;
36120
36121    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
36122    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
36123    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36124        mem_base = xmlMemBlocks();
36125        pref = gen_const_xmlChar_ptr(n_pref, 0);
36126        name = gen_const_xmlChar_ptr(n_name, 1);
36127        str = gen_const_xmlChar_ptr(n_str, 2);
36128
36129        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
36130        desret_int(ret_val);
36131        call_tests++;
36132        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
36133        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
36134        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
36135        xmlResetLastError();
36136        if (mem_base != xmlMemBlocks()) {
36137            printf("Leak of %d blocks found in xmlStrQEqual",
36138	           xmlMemBlocks() - mem_base);
36139	    test_ret++;
36140            printf(" %d", n_pref);
36141            printf(" %d", n_name);
36142            printf(" %d", n_str);
36143            printf("\n");
36144        }
36145    }
36146    }
36147    }
36148    function_tests++;
36149
36150    return(test_ret);
36151}
36152
36153
36154static int
36155test_xmlStrVPrintf(void) {
36156    int test_ret = 0;
36157
36158
36159    /* missing type support */
36160    return(test_ret);
36161}
36162
36163
36164static int
36165test_xmlStrcasecmp(void) {
36166    int test_ret = 0;
36167
36168    int mem_base;
36169    int ret_val;
36170    xmlChar * str1; /* the first xmlChar * */
36171    int n_str1;
36172    xmlChar * str2; /* the second xmlChar * */
36173    int n_str2;
36174
36175    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36176    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36177        mem_base = xmlMemBlocks();
36178        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36179        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36180
36181        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
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        xmlResetLastError();
36187        if (mem_base != xmlMemBlocks()) {
36188            printf("Leak of %d blocks found in xmlStrcasecmp",
36189	           xmlMemBlocks() - mem_base);
36190	    test_ret++;
36191            printf(" %d", n_str1);
36192            printf(" %d", n_str2);
36193            printf("\n");
36194        }
36195    }
36196    }
36197    function_tests++;
36198
36199    return(test_ret);
36200}
36201
36202
36203static int
36204test_xmlStrcasestr(void) {
36205    int test_ret = 0;
36206
36207    int mem_base;
36208    const xmlChar * ret_val;
36209    xmlChar * str; /* the xmlChar * array (haystack) */
36210    int n_str;
36211    xmlChar * val; /* the xmlChar to search (needle) */
36212    int n_val;
36213
36214    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36215    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36216        mem_base = xmlMemBlocks();
36217        str = gen_const_xmlChar_ptr(n_str, 0);
36218        val = gen_const_xmlChar_ptr(n_val, 1);
36219
36220        ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val);
36221        desret_const_xmlChar_ptr(ret_val);
36222        call_tests++;
36223        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36224        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36225        xmlResetLastError();
36226        if (mem_base != xmlMemBlocks()) {
36227            printf("Leak of %d blocks found in xmlStrcasestr",
36228	           xmlMemBlocks() - mem_base);
36229	    test_ret++;
36230            printf(" %d", n_str);
36231            printf(" %d", n_val);
36232            printf("\n");
36233        }
36234    }
36235    }
36236    function_tests++;
36237
36238    return(test_ret);
36239}
36240
36241
36242static int
36243test_xmlStrchr(void) {
36244    int test_ret = 0;
36245
36246    int mem_base;
36247    const xmlChar * ret_val;
36248    xmlChar * str; /* the xmlChar * array */
36249    int n_str;
36250    xmlChar val; /* the xmlChar to search */
36251    int n_val;
36252
36253    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36254    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36255        mem_base = xmlMemBlocks();
36256        str = gen_const_xmlChar_ptr(n_str, 0);
36257        val = gen_xmlChar(n_val, 1);
36258
36259        ret_val = xmlStrchr((const xmlChar *)str, val);
36260        desret_const_xmlChar_ptr(ret_val);
36261        call_tests++;
36262        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36263        des_xmlChar(n_val, val, 1);
36264        xmlResetLastError();
36265        if (mem_base != xmlMemBlocks()) {
36266            printf("Leak of %d blocks found in xmlStrchr",
36267	           xmlMemBlocks() - mem_base);
36268	    test_ret++;
36269            printf(" %d", n_str);
36270            printf(" %d", n_val);
36271            printf("\n");
36272        }
36273    }
36274    }
36275    function_tests++;
36276
36277    return(test_ret);
36278}
36279
36280
36281static int
36282test_xmlStrcmp(void) {
36283    int test_ret = 0;
36284
36285    int mem_base;
36286    int ret_val;
36287    xmlChar * str1; /* the first xmlChar * */
36288    int n_str1;
36289    xmlChar * str2; /* the second xmlChar * */
36290    int n_str2;
36291
36292    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36293    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36294        mem_base = xmlMemBlocks();
36295        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36296        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36297
36298        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36299        desret_int(ret_val);
36300        call_tests++;
36301        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36302        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36303        xmlResetLastError();
36304        if (mem_base != xmlMemBlocks()) {
36305            printf("Leak of %d blocks found in xmlStrcmp",
36306	           xmlMemBlocks() - mem_base);
36307	    test_ret++;
36308            printf(" %d", n_str1);
36309            printf(" %d", n_str2);
36310            printf("\n");
36311        }
36312    }
36313    }
36314    function_tests++;
36315
36316    return(test_ret);
36317}
36318
36319
36320static int
36321test_xmlStrdup(void) {
36322    int test_ret = 0;
36323
36324    int mem_base;
36325    xmlChar * ret_val;
36326    xmlChar * cur; /* the input xmlChar * */
36327    int n_cur;
36328
36329    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36330        mem_base = xmlMemBlocks();
36331        cur = gen_const_xmlChar_ptr(n_cur, 0);
36332
36333        ret_val = xmlStrdup((const xmlChar *)cur);
36334        desret_xmlChar_ptr(ret_val);
36335        call_tests++;
36336        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36337        xmlResetLastError();
36338        if (mem_base != xmlMemBlocks()) {
36339            printf("Leak of %d blocks found in xmlStrdup",
36340	           xmlMemBlocks() - mem_base);
36341	    test_ret++;
36342            printf(" %d", n_cur);
36343            printf("\n");
36344        }
36345    }
36346    function_tests++;
36347
36348    return(test_ret);
36349}
36350
36351
36352static int
36353test_xmlStrlen(void) {
36354    int test_ret = 0;
36355
36356    int mem_base;
36357    int ret_val;
36358    xmlChar * str; /* the xmlChar * array */
36359    int n_str;
36360
36361    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36362        mem_base = xmlMemBlocks();
36363        str = gen_const_xmlChar_ptr(n_str, 0);
36364
36365        ret_val = xmlStrlen((const xmlChar *)str);
36366        desret_int(ret_val);
36367        call_tests++;
36368        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36369        xmlResetLastError();
36370        if (mem_base != xmlMemBlocks()) {
36371            printf("Leak of %d blocks found in xmlStrlen",
36372	           xmlMemBlocks() - mem_base);
36373	    test_ret++;
36374            printf(" %d", n_str);
36375            printf("\n");
36376        }
36377    }
36378    function_tests++;
36379
36380    return(test_ret);
36381}
36382
36383
36384static int
36385test_xmlStrncasecmp(void) {
36386    int test_ret = 0;
36387
36388    int mem_base;
36389    int ret_val;
36390    xmlChar * str1; /* the first xmlChar * */
36391    int n_str1;
36392    xmlChar * str2; /* the second xmlChar * */
36393    int n_str2;
36394    int len; /* the max comparison length */
36395    int n_len;
36396
36397    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36398    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36399    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36400        mem_base = xmlMemBlocks();
36401        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36402        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36403        len = gen_int(n_len, 2);
36404
36405        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36406        desret_int(ret_val);
36407        call_tests++;
36408        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36409        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36410        des_int(n_len, len, 2);
36411        xmlResetLastError();
36412        if (mem_base != xmlMemBlocks()) {
36413            printf("Leak of %d blocks found in xmlStrncasecmp",
36414	           xmlMemBlocks() - mem_base);
36415	    test_ret++;
36416            printf(" %d", n_str1);
36417            printf(" %d", n_str2);
36418            printf(" %d", n_len);
36419            printf("\n");
36420        }
36421    }
36422    }
36423    }
36424    function_tests++;
36425
36426    return(test_ret);
36427}
36428
36429
36430static int
36431test_xmlStrncatNew(void) {
36432    int test_ret = 0;
36433
36434    int mem_base;
36435    xmlChar * ret_val;
36436    xmlChar * str1; /* first xmlChar string */
36437    int n_str1;
36438    xmlChar * str2; /* second xmlChar string */
36439    int n_str2;
36440    int len; /* the len of @str2 or < 0 */
36441    int n_len;
36442
36443    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36444    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36445    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36446        mem_base = xmlMemBlocks();
36447        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36448        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36449        len = gen_int(n_len, 2);
36450
36451        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36452        desret_xmlChar_ptr(ret_val);
36453        call_tests++;
36454        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36455        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36456        des_int(n_len, len, 2);
36457        xmlResetLastError();
36458        if (mem_base != xmlMemBlocks()) {
36459            printf("Leak of %d blocks found in xmlStrncatNew",
36460	           xmlMemBlocks() - mem_base);
36461	    test_ret++;
36462            printf(" %d", n_str1);
36463            printf(" %d", n_str2);
36464            printf(" %d", n_len);
36465            printf("\n");
36466        }
36467    }
36468    }
36469    }
36470    function_tests++;
36471
36472    return(test_ret);
36473}
36474
36475
36476static int
36477test_xmlStrncmp(void) {
36478    int test_ret = 0;
36479
36480    int mem_base;
36481    int ret_val;
36482    xmlChar * str1; /* the first xmlChar * */
36483    int n_str1;
36484    xmlChar * str2; /* the second xmlChar * */
36485    int n_str2;
36486    int len; /* the max comparison length */
36487    int n_len;
36488
36489    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36490    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36491    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36492        mem_base = xmlMemBlocks();
36493        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36494        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36495        len = gen_int(n_len, 2);
36496
36497        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36498        desret_int(ret_val);
36499        call_tests++;
36500        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36501        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36502        des_int(n_len, len, 2);
36503        xmlResetLastError();
36504        if (mem_base != xmlMemBlocks()) {
36505            printf("Leak of %d blocks found in xmlStrncmp",
36506	           xmlMemBlocks() - mem_base);
36507	    test_ret++;
36508            printf(" %d", n_str1);
36509            printf(" %d", n_str2);
36510            printf(" %d", n_len);
36511            printf("\n");
36512        }
36513    }
36514    }
36515    }
36516    function_tests++;
36517
36518    return(test_ret);
36519}
36520
36521
36522static int
36523test_xmlStrndup(void) {
36524    int test_ret = 0;
36525
36526    int mem_base;
36527    xmlChar * ret_val;
36528    xmlChar * cur; /* the input xmlChar * */
36529    int n_cur;
36530    int len; /* the len of @cur */
36531    int n_len;
36532
36533    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36534    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36535        mem_base = xmlMemBlocks();
36536        cur = gen_const_xmlChar_ptr(n_cur, 0);
36537        len = gen_int(n_len, 1);
36538
36539        ret_val = xmlStrndup((const xmlChar *)cur, len);
36540        desret_xmlChar_ptr(ret_val);
36541        call_tests++;
36542        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36543        des_int(n_len, len, 1);
36544        xmlResetLastError();
36545        if (mem_base != xmlMemBlocks()) {
36546            printf("Leak of %d blocks found in xmlStrndup",
36547	           xmlMemBlocks() - mem_base);
36548	    test_ret++;
36549            printf(" %d", n_cur);
36550            printf(" %d", n_len);
36551            printf("\n");
36552        }
36553    }
36554    }
36555    function_tests++;
36556
36557    return(test_ret);
36558}
36559
36560
36561static int
36562test_xmlStrstr(void) {
36563    int test_ret = 0;
36564
36565    int mem_base;
36566    const xmlChar * ret_val;
36567    xmlChar * str; /* the xmlChar * array (haystack) */
36568    int n_str;
36569    xmlChar * val; /* the xmlChar to search (needle) */
36570    int n_val;
36571
36572    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36573    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36574        mem_base = xmlMemBlocks();
36575        str = gen_const_xmlChar_ptr(n_str, 0);
36576        val = gen_const_xmlChar_ptr(n_val, 1);
36577
36578        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36579        desret_const_xmlChar_ptr(ret_val);
36580        call_tests++;
36581        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36582        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36583        xmlResetLastError();
36584        if (mem_base != xmlMemBlocks()) {
36585            printf("Leak of %d blocks found in xmlStrstr",
36586	           xmlMemBlocks() - mem_base);
36587	    test_ret++;
36588            printf(" %d", n_str);
36589            printf(" %d", n_val);
36590            printf("\n");
36591        }
36592    }
36593    }
36594    function_tests++;
36595
36596    return(test_ret);
36597}
36598
36599
36600static int
36601test_xmlStrsub(void) {
36602    int test_ret = 0;
36603
36604    int mem_base;
36605    xmlChar * ret_val;
36606    xmlChar * str; /* the xmlChar * array (haystack) */
36607    int n_str;
36608    int start; /* the index of the first char (zero based) */
36609    int n_start;
36610    int len; /* the length of the substring */
36611    int n_len;
36612
36613    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36614    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36615    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36616        mem_base = xmlMemBlocks();
36617        str = gen_const_xmlChar_ptr(n_str, 0);
36618        start = gen_int(n_start, 1);
36619        len = gen_int(n_len, 2);
36620
36621        ret_val = xmlStrsub((const xmlChar *)str, start, len);
36622        desret_xmlChar_ptr(ret_val);
36623        call_tests++;
36624        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36625        des_int(n_start, start, 1);
36626        des_int(n_len, len, 2);
36627        xmlResetLastError();
36628        if (mem_base != xmlMemBlocks()) {
36629            printf("Leak of %d blocks found in xmlStrsub",
36630	           xmlMemBlocks() - mem_base);
36631	    test_ret++;
36632            printf(" %d", n_str);
36633            printf(" %d", n_start);
36634            printf(" %d", n_len);
36635            printf("\n");
36636        }
36637    }
36638    }
36639    }
36640    function_tests++;
36641
36642    return(test_ret);
36643}
36644
36645
36646static int
36647test_xmlUTF8Charcmp(void) {
36648    int test_ret = 0;
36649
36650    int mem_base;
36651    int ret_val;
36652    xmlChar * utf1; /* pointer to first UTF8 char */
36653    int n_utf1;
36654    xmlChar * utf2; /* pointer to second UTF8 char */
36655    int n_utf2;
36656
36657    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36658    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36659        mem_base = xmlMemBlocks();
36660        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36661        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36662
36663        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36664        desret_int(ret_val);
36665        call_tests++;
36666        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36667        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36668        xmlResetLastError();
36669        if (mem_base != xmlMemBlocks()) {
36670            printf("Leak of %d blocks found in xmlUTF8Charcmp",
36671	           xmlMemBlocks() - mem_base);
36672	    test_ret++;
36673            printf(" %d", n_utf1);
36674            printf(" %d", n_utf2);
36675            printf("\n");
36676        }
36677    }
36678    }
36679    function_tests++;
36680
36681    return(test_ret);
36682}
36683
36684
36685static int
36686test_xmlUTF8Size(void) {
36687    int test_ret = 0;
36688
36689    int mem_base;
36690    int ret_val;
36691    xmlChar * utf; /* pointer to the UTF8 character */
36692    int n_utf;
36693
36694    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36695        mem_base = xmlMemBlocks();
36696        utf = gen_const_xmlChar_ptr(n_utf, 0);
36697
36698        ret_val = xmlUTF8Size((const xmlChar *)utf);
36699        desret_int(ret_val);
36700        call_tests++;
36701        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36702        xmlResetLastError();
36703        if (mem_base != xmlMemBlocks()) {
36704            printf("Leak of %d blocks found in xmlUTF8Size",
36705	           xmlMemBlocks() - mem_base);
36706	    test_ret++;
36707            printf(" %d", n_utf);
36708            printf("\n");
36709        }
36710    }
36711    function_tests++;
36712
36713    return(test_ret);
36714}
36715
36716
36717static int
36718test_xmlUTF8Strlen(void) {
36719    int test_ret = 0;
36720
36721    int mem_base;
36722    int ret_val;
36723    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36724    int n_utf;
36725
36726    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36727        mem_base = xmlMemBlocks();
36728        utf = gen_const_xmlChar_ptr(n_utf, 0);
36729
36730        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36731        desret_int(ret_val);
36732        call_tests++;
36733        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36734        xmlResetLastError();
36735        if (mem_base != xmlMemBlocks()) {
36736            printf("Leak of %d blocks found in xmlUTF8Strlen",
36737	           xmlMemBlocks() - mem_base);
36738	    test_ret++;
36739            printf(" %d", n_utf);
36740            printf("\n");
36741        }
36742    }
36743    function_tests++;
36744
36745    return(test_ret);
36746}
36747
36748
36749static int
36750test_xmlUTF8Strloc(void) {
36751    int test_ret = 0;
36752
36753    int mem_base;
36754    int ret_val;
36755    xmlChar * utf; /* the input UTF8 * */
36756    int n_utf;
36757    xmlChar * utfchar; /* the UTF8 character to be found */
36758    int n_utfchar;
36759
36760    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36761    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36762        mem_base = xmlMemBlocks();
36763        utf = gen_const_xmlChar_ptr(n_utf, 0);
36764        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36765
36766        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36767        desret_int(ret_val);
36768        call_tests++;
36769        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36770        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36771        xmlResetLastError();
36772        if (mem_base != xmlMemBlocks()) {
36773            printf("Leak of %d blocks found in xmlUTF8Strloc",
36774	           xmlMemBlocks() - mem_base);
36775	    test_ret++;
36776            printf(" %d", n_utf);
36777            printf(" %d", n_utfchar);
36778            printf("\n");
36779        }
36780    }
36781    }
36782    function_tests++;
36783
36784    return(test_ret);
36785}
36786
36787
36788static int
36789test_xmlUTF8Strndup(void) {
36790    int test_ret = 0;
36791
36792    int mem_base;
36793    xmlChar * ret_val;
36794    xmlChar * utf; /* the input UTF8 * */
36795    int n_utf;
36796    int len; /* the len of @utf (in chars) */
36797    int n_len;
36798
36799    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36800    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36801        mem_base = xmlMemBlocks();
36802        utf = gen_const_xmlChar_ptr(n_utf, 0);
36803        len = gen_int(n_len, 1);
36804
36805        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36806        desret_xmlChar_ptr(ret_val);
36807        call_tests++;
36808        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36809        des_int(n_len, len, 1);
36810        xmlResetLastError();
36811        if (mem_base != xmlMemBlocks()) {
36812            printf("Leak of %d blocks found in xmlUTF8Strndup",
36813	           xmlMemBlocks() - mem_base);
36814	    test_ret++;
36815            printf(" %d", n_utf);
36816            printf(" %d", n_len);
36817            printf("\n");
36818        }
36819    }
36820    }
36821    function_tests++;
36822
36823    return(test_ret);
36824}
36825
36826
36827static int
36828test_xmlUTF8Strpos(void) {
36829    int test_ret = 0;
36830
36831    int mem_base;
36832    const xmlChar * ret_val;
36833    xmlChar * utf; /* the input UTF8 * */
36834    int n_utf;
36835    int pos; /* the position of the desired UTF8 char (in chars) */
36836    int n_pos;
36837
36838    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36839    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36840        mem_base = xmlMemBlocks();
36841        utf = gen_const_xmlChar_ptr(n_utf, 0);
36842        pos = gen_int(n_pos, 1);
36843
36844        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36845        desret_const_xmlChar_ptr(ret_val);
36846        call_tests++;
36847        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36848        des_int(n_pos, pos, 1);
36849        xmlResetLastError();
36850        if (mem_base != xmlMemBlocks()) {
36851            printf("Leak of %d blocks found in xmlUTF8Strpos",
36852	           xmlMemBlocks() - mem_base);
36853	    test_ret++;
36854            printf(" %d", n_utf);
36855            printf(" %d", n_pos);
36856            printf("\n");
36857        }
36858    }
36859    }
36860    function_tests++;
36861
36862    return(test_ret);
36863}
36864
36865
36866static int
36867test_xmlUTF8Strsize(void) {
36868    int test_ret = 0;
36869
36870    int mem_base;
36871    int ret_val;
36872    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36873    int n_utf;
36874    int len; /* the number of characters in the array */
36875    int n_len;
36876
36877    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36878    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36879        mem_base = xmlMemBlocks();
36880        utf = gen_const_xmlChar_ptr(n_utf, 0);
36881        len = gen_int(n_len, 1);
36882
36883        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36884        desret_int(ret_val);
36885        call_tests++;
36886        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36887        des_int(n_len, len, 1);
36888        xmlResetLastError();
36889        if (mem_base != xmlMemBlocks()) {
36890            printf("Leak of %d blocks found in xmlUTF8Strsize",
36891	           xmlMemBlocks() - mem_base);
36892	    test_ret++;
36893            printf(" %d", n_utf);
36894            printf(" %d", n_len);
36895            printf("\n");
36896        }
36897    }
36898    }
36899    function_tests++;
36900
36901    return(test_ret);
36902}
36903
36904
36905static int
36906test_xmlUTF8Strsub(void) {
36907    int test_ret = 0;
36908
36909    int mem_base;
36910    xmlChar * ret_val;
36911    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36912    int n_utf;
36913    int start; /* relative pos of first char */
36914    int n_start;
36915    int len; /* total number to copy */
36916    int n_len;
36917
36918    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36919    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36920    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36921        mem_base = xmlMemBlocks();
36922        utf = gen_const_xmlChar_ptr(n_utf, 0);
36923        start = gen_int(n_start, 1);
36924        len = gen_int(n_len, 2);
36925
36926        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36927        desret_xmlChar_ptr(ret_val);
36928        call_tests++;
36929        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36930        des_int(n_start, start, 1);
36931        des_int(n_len, len, 2);
36932        xmlResetLastError();
36933        if (mem_base != xmlMemBlocks()) {
36934            printf("Leak of %d blocks found in xmlUTF8Strsub",
36935	           xmlMemBlocks() - mem_base);
36936	    test_ret++;
36937            printf(" %d", n_utf);
36938            printf(" %d", n_start);
36939            printf(" %d", n_len);
36940            printf("\n");
36941        }
36942    }
36943    }
36944    }
36945    function_tests++;
36946
36947    return(test_ret);
36948}
36949
36950static int
36951test_xmlstring(void) {
36952    int test_ret = 0;
36953
36954    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36955    test_ret += test_xmlCharStrdup();
36956    test_ret += test_xmlCharStrndup();
36957    test_ret += test_xmlCheckUTF8();
36958    test_ret += test_xmlGetUTF8Char();
36959    test_ret += test_xmlStrEqual();
36960    test_ret += test_xmlStrPrintf();
36961    test_ret += test_xmlStrQEqual();
36962    test_ret += test_xmlStrVPrintf();
36963    test_ret += test_xmlStrcasecmp();
36964    test_ret += test_xmlStrcasestr();
36965    test_ret += test_xmlStrchr();
36966    test_ret += test_xmlStrcmp();
36967    test_ret += test_xmlStrdup();
36968    test_ret += test_xmlStrlen();
36969    test_ret += test_xmlStrncasecmp();
36970    test_ret += test_xmlStrncatNew();
36971    test_ret += test_xmlStrncmp();
36972    test_ret += test_xmlStrndup();
36973    test_ret += test_xmlStrstr();
36974    test_ret += test_xmlStrsub();
36975    test_ret += test_xmlUTF8Charcmp();
36976    test_ret += test_xmlUTF8Size();
36977    test_ret += test_xmlUTF8Strlen();
36978    test_ret += test_xmlUTF8Strloc();
36979    test_ret += test_xmlUTF8Strndup();
36980    test_ret += test_xmlUTF8Strpos();
36981    test_ret += test_xmlUTF8Strsize();
36982    test_ret += test_xmlUTF8Strsub();
36983
36984    if (test_ret != 0)
36985	printf("Module xmlstring: %d errors\n", test_ret);
36986    return(test_ret);
36987}
36988
36989static int
36990test_xmlUCSIsAegeanNumbers(void) {
36991    int test_ret = 0;
36992
36993#if defined(LIBXML_UNICODE_ENABLED)
36994    int mem_base;
36995    int ret_val;
36996    int code; /* UCS code point */
36997    int n_code;
36998
36999    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37000        mem_base = xmlMemBlocks();
37001        code = gen_int(n_code, 0);
37002
37003        ret_val = xmlUCSIsAegeanNumbers(code);
37004        desret_int(ret_val);
37005        call_tests++;
37006        des_int(n_code, code, 0);
37007        xmlResetLastError();
37008        if (mem_base != xmlMemBlocks()) {
37009            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
37010	           xmlMemBlocks() - mem_base);
37011	    test_ret++;
37012            printf(" %d", n_code);
37013            printf("\n");
37014        }
37015    }
37016    function_tests++;
37017#endif
37018
37019    return(test_ret);
37020}
37021
37022
37023static int
37024test_xmlUCSIsAlphabeticPresentationForms(void) {
37025    int test_ret = 0;
37026
37027#if defined(LIBXML_UNICODE_ENABLED)
37028    int mem_base;
37029    int ret_val;
37030    int code; /* UCS code point */
37031    int n_code;
37032
37033    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37034        mem_base = xmlMemBlocks();
37035        code = gen_int(n_code, 0);
37036
37037        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
37038        desret_int(ret_val);
37039        call_tests++;
37040        des_int(n_code, code, 0);
37041        xmlResetLastError();
37042        if (mem_base != xmlMemBlocks()) {
37043            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
37044	           xmlMemBlocks() - mem_base);
37045	    test_ret++;
37046            printf(" %d", n_code);
37047            printf("\n");
37048        }
37049    }
37050    function_tests++;
37051#endif
37052
37053    return(test_ret);
37054}
37055
37056
37057static int
37058test_xmlUCSIsArabic(void) {
37059    int test_ret = 0;
37060
37061#if defined(LIBXML_UNICODE_ENABLED)
37062    int mem_base;
37063    int ret_val;
37064    int code; /* UCS code point */
37065    int n_code;
37066
37067    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37068        mem_base = xmlMemBlocks();
37069        code = gen_int(n_code, 0);
37070
37071        ret_val = xmlUCSIsArabic(code);
37072        desret_int(ret_val);
37073        call_tests++;
37074        des_int(n_code, code, 0);
37075        xmlResetLastError();
37076        if (mem_base != xmlMemBlocks()) {
37077            printf("Leak of %d blocks found in xmlUCSIsArabic",
37078	           xmlMemBlocks() - mem_base);
37079	    test_ret++;
37080            printf(" %d", n_code);
37081            printf("\n");
37082        }
37083    }
37084    function_tests++;
37085#endif
37086
37087    return(test_ret);
37088}
37089
37090
37091static int
37092test_xmlUCSIsArabicPresentationFormsA(void) {
37093    int test_ret = 0;
37094
37095#if defined(LIBXML_UNICODE_ENABLED)
37096    int mem_base;
37097    int ret_val;
37098    int code; /* UCS code point */
37099    int n_code;
37100
37101    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37102        mem_base = xmlMemBlocks();
37103        code = gen_int(n_code, 0);
37104
37105        ret_val = xmlUCSIsArabicPresentationFormsA(code);
37106        desret_int(ret_val);
37107        call_tests++;
37108        des_int(n_code, code, 0);
37109        xmlResetLastError();
37110        if (mem_base != xmlMemBlocks()) {
37111            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
37112	           xmlMemBlocks() - mem_base);
37113	    test_ret++;
37114            printf(" %d", n_code);
37115            printf("\n");
37116        }
37117    }
37118    function_tests++;
37119#endif
37120
37121    return(test_ret);
37122}
37123
37124
37125static int
37126test_xmlUCSIsArabicPresentationFormsB(void) {
37127    int test_ret = 0;
37128
37129#if defined(LIBXML_UNICODE_ENABLED)
37130    int mem_base;
37131    int ret_val;
37132    int code; /* UCS code point */
37133    int n_code;
37134
37135    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37136        mem_base = xmlMemBlocks();
37137        code = gen_int(n_code, 0);
37138
37139        ret_val = xmlUCSIsArabicPresentationFormsB(code);
37140        desret_int(ret_val);
37141        call_tests++;
37142        des_int(n_code, code, 0);
37143        xmlResetLastError();
37144        if (mem_base != xmlMemBlocks()) {
37145            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
37146	           xmlMemBlocks() - mem_base);
37147	    test_ret++;
37148            printf(" %d", n_code);
37149            printf("\n");
37150        }
37151    }
37152    function_tests++;
37153#endif
37154
37155    return(test_ret);
37156}
37157
37158
37159static int
37160test_xmlUCSIsArmenian(void) {
37161    int test_ret = 0;
37162
37163#if defined(LIBXML_UNICODE_ENABLED)
37164    int mem_base;
37165    int ret_val;
37166    int code; /* UCS code point */
37167    int n_code;
37168
37169    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37170        mem_base = xmlMemBlocks();
37171        code = gen_int(n_code, 0);
37172
37173        ret_val = xmlUCSIsArmenian(code);
37174        desret_int(ret_val);
37175        call_tests++;
37176        des_int(n_code, code, 0);
37177        xmlResetLastError();
37178        if (mem_base != xmlMemBlocks()) {
37179            printf("Leak of %d blocks found in xmlUCSIsArmenian",
37180	           xmlMemBlocks() - mem_base);
37181	    test_ret++;
37182            printf(" %d", n_code);
37183            printf("\n");
37184        }
37185    }
37186    function_tests++;
37187#endif
37188
37189    return(test_ret);
37190}
37191
37192
37193static int
37194test_xmlUCSIsArrows(void) {
37195    int test_ret = 0;
37196
37197#if defined(LIBXML_UNICODE_ENABLED)
37198    int mem_base;
37199    int ret_val;
37200    int code; /* UCS code point */
37201    int n_code;
37202
37203    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37204        mem_base = xmlMemBlocks();
37205        code = gen_int(n_code, 0);
37206
37207        ret_val = xmlUCSIsArrows(code);
37208        desret_int(ret_val);
37209        call_tests++;
37210        des_int(n_code, code, 0);
37211        xmlResetLastError();
37212        if (mem_base != xmlMemBlocks()) {
37213            printf("Leak of %d blocks found in xmlUCSIsArrows",
37214	           xmlMemBlocks() - mem_base);
37215	    test_ret++;
37216            printf(" %d", n_code);
37217            printf("\n");
37218        }
37219    }
37220    function_tests++;
37221#endif
37222
37223    return(test_ret);
37224}
37225
37226
37227static int
37228test_xmlUCSIsBasicLatin(void) {
37229    int test_ret = 0;
37230
37231#if defined(LIBXML_UNICODE_ENABLED)
37232    int mem_base;
37233    int ret_val;
37234    int code; /* UCS code point */
37235    int n_code;
37236
37237    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37238        mem_base = xmlMemBlocks();
37239        code = gen_int(n_code, 0);
37240
37241        ret_val = xmlUCSIsBasicLatin(code);
37242        desret_int(ret_val);
37243        call_tests++;
37244        des_int(n_code, code, 0);
37245        xmlResetLastError();
37246        if (mem_base != xmlMemBlocks()) {
37247            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37248	           xmlMemBlocks() - mem_base);
37249	    test_ret++;
37250            printf(" %d", n_code);
37251            printf("\n");
37252        }
37253    }
37254    function_tests++;
37255#endif
37256
37257    return(test_ret);
37258}
37259
37260
37261static int
37262test_xmlUCSIsBengali(void) {
37263    int test_ret = 0;
37264
37265#if defined(LIBXML_UNICODE_ENABLED)
37266    int mem_base;
37267    int ret_val;
37268    int code; /* UCS code point */
37269    int n_code;
37270
37271    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37272        mem_base = xmlMemBlocks();
37273        code = gen_int(n_code, 0);
37274
37275        ret_val = xmlUCSIsBengali(code);
37276        desret_int(ret_val);
37277        call_tests++;
37278        des_int(n_code, code, 0);
37279        xmlResetLastError();
37280        if (mem_base != xmlMemBlocks()) {
37281            printf("Leak of %d blocks found in xmlUCSIsBengali",
37282	           xmlMemBlocks() - mem_base);
37283	    test_ret++;
37284            printf(" %d", n_code);
37285            printf("\n");
37286        }
37287    }
37288    function_tests++;
37289#endif
37290
37291    return(test_ret);
37292}
37293
37294
37295static int
37296test_xmlUCSIsBlock(void) {
37297    int test_ret = 0;
37298
37299#if defined(LIBXML_UNICODE_ENABLED)
37300    int mem_base;
37301    int ret_val;
37302    int code; /* UCS code point */
37303    int n_code;
37304    char * block; /* UCS block name */
37305    int n_block;
37306
37307    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37308    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37309        mem_base = xmlMemBlocks();
37310        code = gen_int(n_code, 0);
37311        block = gen_const_char_ptr(n_block, 1);
37312
37313        ret_val = xmlUCSIsBlock(code, (const char *)block);
37314        desret_int(ret_val);
37315        call_tests++;
37316        des_int(n_code, code, 0);
37317        des_const_char_ptr(n_block, (const char *)block, 1);
37318        xmlResetLastError();
37319        if (mem_base != xmlMemBlocks()) {
37320            printf("Leak of %d blocks found in xmlUCSIsBlock",
37321	           xmlMemBlocks() - mem_base);
37322	    test_ret++;
37323            printf(" %d", n_code);
37324            printf(" %d", n_block);
37325            printf("\n");
37326        }
37327    }
37328    }
37329    function_tests++;
37330#endif
37331
37332    return(test_ret);
37333}
37334
37335
37336static int
37337test_xmlUCSIsBlockElements(void) {
37338    int test_ret = 0;
37339
37340#if defined(LIBXML_UNICODE_ENABLED)
37341    int mem_base;
37342    int ret_val;
37343    int code; /* UCS code point */
37344    int n_code;
37345
37346    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37347        mem_base = xmlMemBlocks();
37348        code = gen_int(n_code, 0);
37349
37350        ret_val = xmlUCSIsBlockElements(code);
37351        desret_int(ret_val);
37352        call_tests++;
37353        des_int(n_code, code, 0);
37354        xmlResetLastError();
37355        if (mem_base != xmlMemBlocks()) {
37356            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37357	           xmlMemBlocks() - mem_base);
37358	    test_ret++;
37359            printf(" %d", n_code);
37360            printf("\n");
37361        }
37362    }
37363    function_tests++;
37364#endif
37365
37366    return(test_ret);
37367}
37368
37369
37370static int
37371test_xmlUCSIsBopomofo(void) {
37372    int test_ret = 0;
37373
37374#if defined(LIBXML_UNICODE_ENABLED)
37375    int mem_base;
37376    int ret_val;
37377    int code; /* UCS code point */
37378    int n_code;
37379
37380    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37381        mem_base = xmlMemBlocks();
37382        code = gen_int(n_code, 0);
37383
37384        ret_val = xmlUCSIsBopomofo(code);
37385        desret_int(ret_val);
37386        call_tests++;
37387        des_int(n_code, code, 0);
37388        xmlResetLastError();
37389        if (mem_base != xmlMemBlocks()) {
37390            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37391	           xmlMemBlocks() - mem_base);
37392	    test_ret++;
37393            printf(" %d", n_code);
37394            printf("\n");
37395        }
37396    }
37397    function_tests++;
37398#endif
37399
37400    return(test_ret);
37401}
37402
37403
37404static int
37405test_xmlUCSIsBopomofoExtended(void) {
37406    int test_ret = 0;
37407
37408#if defined(LIBXML_UNICODE_ENABLED)
37409    int mem_base;
37410    int ret_val;
37411    int code; /* UCS code point */
37412    int n_code;
37413
37414    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37415        mem_base = xmlMemBlocks();
37416        code = gen_int(n_code, 0);
37417
37418        ret_val = xmlUCSIsBopomofoExtended(code);
37419        desret_int(ret_val);
37420        call_tests++;
37421        des_int(n_code, code, 0);
37422        xmlResetLastError();
37423        if (mem_base != xmlMemBlocks()) {
37424            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37425	           xmlMemBlocks() - mem_base);
37426	    test_ret++;
37427            printf(" %d", n_code);
37428            printf("\n");
37429        }
37430    }
37431    function_tests++;
37432#endif
37433
37434    return(test_ret);
37435}
37436
37437
37438static int
37439test_xmlUCSIsBoxDrawing(void) {
37440    int test_ret = 0;
37441
37442#if defined(LIBXML_UNICODE_ENABLED)
37443    int mem_base;
37444    int ret_val;
37445    int code; /* UCS code point */
37446    int n_code;
37447
37448    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37449        mem_base = xmlMemBlocks();
37450        code = gen_int(n_code, 0);
37451
37452        ret_val = xmlUCSIsBoxDrawing(code);
37453        desret_int(ret_val);
37454        call_tests++;
37455        des_int(n_code, code, 0);
37456        xmlResetLastError();
37457        if (mem_base != xmlMemBlocks()) {
37458            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37459	           xmlMemBlocks() - mem_base);
37460	    test_ret++;
37461            printf(" %d", n_code);
37462            printf("\n");
37463        }
37464    }
37465    function_tests++;
37466#endif
37467
37468    return(test_ret);
37469}
37470
37471
37472static int
37473test_xmlUCSIsBraillePatterns(void) {
37474    int test_ret = 0;
37475
37476#if defined(LIBXML_UNICODE_ENABLED)
37477    int mem_base;
37478    int ret_val;
37479    int code; /* UCS code point */
37480    int n_code;
37481
37482    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37483        mem_base = xmlMemBlocks();
37484        code = gen_int(n_code, 0);
37485
37486        ret_val = xmlUCSIsBraillePatterns(code);
37487        desret_int(ret_val);
37488        call_tests++;
37489        des_int(n_code, code, 0);
37490        xmlResetLastError();
37491        if (mem_base != xmlMemBlocks()) {
37492            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37493	           xmlMemBlocks() - mem_base);
37494	    test_ret++;
37495            printf(" %d", n_code);
37496            printf("\n");
37497        }
37498    }
37499    function_tests++;
37500#endif
37501
37502    return(test_ret);
37503}
37504
37505
37506static int
37507test_xmlUCSIsBuhid(void) {
37508    int test_ret = 0;
37509
37510#if defined(LIBXML_UNICODE_ENABLED)
37511    int mem_base;
37512    int ret_val;
37513    int code; /* UCS code point */
37514    int n_code;
37515
37516    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37517        mem_base = xmlMemBlocks();
37518        code = gen_int(n_code, 0);
37519
37520        ret_val = xmlUCSIsBuhid(code);
37521        desret_int(ret_val);
37522        call_tests++;
37523        des_int(n_code, code, 0);
37524        xmlResetLastError();
37525        if (mem_base != xmlMemBlocks()) {
37526            printf("Leak of %d blocks found in xmlUCSIsBuhid",
37527	           xmlMemBlocks() - mem_base);
37528	    test_ret++;
37529            printf(" %d", n_code);
37530            printf("\n");
37531        }
37532    }
37533    function_tests++;
37534#endif
37535
37536    return(test_ret);
37537}
37538
37539
37540static int
37541test_xmlUCSIsByzantineMusicalSymbols(void) {
37542    int test_ret = 0;
37543
37544#if defined(LIBXML_UNICODE_ENABLED)
37545    int mem_base;
37546    int ret_val;
37547    int code; /* UCS code point */
37548    int n_code;
37549
37550    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37551        mem_base = xmlMemBlocks();
37552        code = gen_int(n_code, 0);
37553
37554        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37555        desret_int(ret_val);
37556        call_tests++;
37557        des_int(n_code, code, 0);
37558        xmlResetLastError();
37559        if (mem_base != xmlMemBlocks()) {
37560            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37561	           xmlMemBlocks() - mem_base);
37562	    test_ret++;
37563            printf(" %d", n_code);
37564            printf("\n");
37565        }
37566    }
37567    function_tests++;
37568#endif
37569
37570    return(test_ret);
37571}
37572
37573
37574static int
37575test_xmlUCSIsCJKCompatibility(void) {
37576    int test_ret = 0;
37577
37578#if defined(LIBXML_UNICODE_ENABLED)
37579    int mem_base;
37580    int ret_val;
37581    int code; /* UCS code point */
37582    int n_code;
37583
37584    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37585        mem_base = xmlMemBlocks();
37586        code = gen_int(n_code, 0);
37587
37588        ret_val = xmlUCSIsCJKCompatibility(code);
37589        desret_int(ret_val);
37590        call_tests++;
37591        des_int(n_code, code, 0);
37592        xmlResetLastError();
37593        if (mem_base != xmlMemBlocks()) {
37594            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37595	           xmlMemBlocks() - mem_base);
37596	    test_ret++;
37597            printf(" %d", n_code);
37598            printf("\n");
37599        }
37600    }
37601    function_tests++;
37602#endif
37603
37604    return(test_ret);
37605}
37606
37607
37608static int
37609test_xmlUCSIsCJKCompatibilityForms(void) {
37610    int test_ret = 0;
37611
37612#if defined(LIBXML_UNICODE_ENABLED)
37613    int mem_base;
37614    int ret_val;
37615    int code; /* UCS code point */
37616    int n_code;
37617
37618    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37619        mem_base = xmlMemBlocks();
37620        code = gen_int(n_code, 0);
37621
37622        ret_val = xmlUCSIsCJKCompatibilityForms(code);
37623        desret_int(ret_val);
37624        call_tests++;
37625        des_int(n_code, code, 0);
37626        xmlResetLastError();
37627        if (mem_base != xmlMemBlocks()) {
37628            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37629	           xmlMemBlocks() - mem_base);
37630	    test_ret++;
37631            printf(" %d", n_code);
37632            printf("\n");
37633        }
37634    }
37635    function_tests++;
37636#endif
37637
37638    return(test_ret);
37639}
37640
37641
37642static int
37643test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37644    int test_ret = 0;
37645
37646#if defined(LIBXML_UNICODE_ENABLED)
37647    int mem_base;
37648    int ret_val;
37649    int code; /* UCS code point */
37650    int n_code;
37651
37652    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37653        mem_base = xmlMemBlocks();
37654        code = gen_int(n_code, 0);
37655
37656        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37657        desret_int(ret_val);
37658        call_tests++;
37659        des_int(n_code, code, 0);
37660        xmlResetLastError();
37661        if (mem_base != xmlMemBlocks()) {
37662            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37663	           xmlMemBlocks() - mem_base);
37664	    test_ret++;
37665            printf(" %d", n_code);
37666            printf("\n");
37667        }
37668    }
37669    function_tests++;
37670#endif
37671
37672    return(test_ret);
37673}
37674
37675
37676static int
37677test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37678    int test_ret = 0;
37679
37680#if defined(LIBXML_UNICODE_ENABLED)
37681    int mem_base;
37682    int ret_val;
37683    int code; /* UCS code point */
37684    int n_code;
37685
37686    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37687        mem_base = xmlMemBlocks();
37688        code = gen_int(n_code, 0);
37689
37690        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37691        desret_int(ret_val);
37692        call_tests++;
37693        des_int(n_code, code, 0);
37694        xmlResetLastError();
37695        if (mem_base != xmlMemBlocks()) {
37696            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37697	           xmlMemBlocks() - mem_base);
37698	    test_ret++;
37699            printf(" %d", n_code);
37700            printf("\n");
37701        }
37702    }
37703    function_tests++;
37704#endif
37705
37706    return(test_ret);
37707}
37708
37709
37710static int
37711test_xmlUCSIsCJKRadicalsSupplement(void) {
37712    int test_ret = 0;
37713
37714#if defined(LIBXML_UNICODE_ENABLED)
37715    int mem_base;
37716    int ret_val;
37717    int code; /* UCS code point */
37718    int n_code;
37719
37720    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37721        mem_base = xmlMemBlocks();
37722        code = gen_int(n_code, 0);
37723
37724        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37725        desret_int(ret_val);
37726        call_tests++;
37727        des_int(n_code, code, 0);
37728        xmlResetLastError();
37729        if (mem_base != xmlMemBlocks()) {
37730            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37731	           xmlMemBlocks() - mem_base);
37732	    test_ret++;
37733            printf(" %d", n_code);
37734            printf("\n");
37735        }
37736    }
37737    function_tests++;
37738#endif
37739
37740    return(test_ret);
37741}
37742
37743
37744static int
37745test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37746    int test_ret = 0;
37747
37748#if defined(LIBXML_UNICODE_ENABLED)
37749    int mem_base;
37750    int ret_val;
37751    int code; /* UCS code point */
37752    int n_code;
37753
37754    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37755        mem_base = xmlMemBlocks();
37756        code = gen_int(n_code, 0);
37757
37758        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37759        desret_int(ret_val);
37760        call_tests++;
37761        des_int(n_code, code, 0);
37762        xmlResetLastError();
37763        if (mem_base != xmlMemBlocks()) {
37764            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37765	           xmlMemBlocks() - mem_base);
37766	    test_ret++;
37767            printf(" %d", n_code);
37768            printf("\n");
37769        }
37770    }
37771    function_tests++;
37772#endif
37773
37774    return(test_ret);
37775}
37776
37777
37778static int
37779test_xmlUCSIsCJKUnifiedIdeographs(void) {
37780    int test_ret = 0;
37781
37782#if defined(LIBXML_UNICODE_ENABLED)
37783    int mem_base;
37784    int ret_val;
37785    int code; /* UCS code point */
37786    int n_code;
37787
37788    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37789        mem_base = xmlMemBlocks();
37790        code = gen_int(n_code, 0);
37791
37792        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37793        desret_int(ret_val);
37794        call_tests++;
37795        des_int(n_code, code, 0);
37796        xmlResetLastError();
37797        if (mem_base != xmlMemBlocks()) {
37798            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37799	           xmlMemBlocks() - mem_base);
37800	    test_ret++;
37801            printf(" %d", n_code);
37802            printf("\n");
37803        }
37804    }
37805    function_tests++;
37806#endif
37807
37808    return(test_ret);
37809}
37810
37811
37812static int
37813test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37814    int test_ret = 0;
37815
37816#if defined(LIBXML_UNICODE_ENABLED)
37817    int mem_base;
37818    int ret_val;
37819    int code; /* UCS code point */
37820    int n_code;
37821
37822    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37823        mem_base = xmlMemBlocks();
37824        code = gen_int(n_code, 0);
37825
37826        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37827        desret_int(ret_val);
37828        call_tests++;
37829        des_int(n_code, code, 0);
37830        xmlResetLastError();
37831        if (mem_base != xmlMemBlocks()) {
37832            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37833	           xmlMemBlocks() - mem_base);
37834	    test_ret++;
37835            printf(" %d", n_code);
37836            printf("\n");
37837        }
37838    }
37839    function_tests++;
37840#endif
37841
37842    return(test_ret);
37843}
37844
37845
37846static int
37847test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37848    int test_ret = 0;
37849
37850#if defined(LIBXML_UNICODE_ENABLED)
37851    int mem_base;
37852    int ret_val;
37853    int code; /* UCS code point */
37854    int n_code;
37855
37856    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37857        mem_base = xmlMemBlocks();
37858        code = gen_int(n_code, 0);
37859
37860        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37861        desret_int(ret_val);
37862        call_tests++;
37863        des_int(n_code, code, 0);
37864        xmlResetLastError();
37865        if (mem_base != xmlMemBlocks()) {
37866            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37867	           xmlMemBlocks() - mem_base);
37868	    test_ret++;
37869            printf(" %d", n_code);
37870            printf("\n");
37871        }
37872    }
37873    function_tests++;
37874#endif
37875
37876    return(test_ret);
37877}
37878
37879
37880static int
37881test_xmlUCSIsCat(void) {
37882    int test_ret = 0;
37883
37884#if defined(LIBXML_UNICODE_ENABLED)
37885    int mem_base;
37886    int ret_val;
37887    int code; /* UCS code point */
37888    int n_code;
37889    char * cat; /* UCS Category name */
37890    int n_cat;
37891
37892    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37893    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37894        mem_base = xmlMemBlocks();
37895        code = gen_int(n_code, 0);
37896        cat = gen_const_char_ptr(n_cat, 1);
37897
37898        ret_val = xmlUCSIsCat(code, (const char *)cat);
37899        desret_int(ret_val);
37900        call_tests++;
37901        des_int(n_code, code, 0);
37902        des_const_char_ptr(n_cat, (const char *)cat, 1);
37903        xmlResetLastError();
37904        if (mem_base != xmlMemBlocks()) {
37905            printf("Leak of %d blocks found in xmlUCSIsCat",
37906	           xmlMemBlocks() - mem_base);
37907	    test_ret++;
37908            printf(" %d", n_code);
37909            printf(" %d", n_cat);
37910            printf("\n");
37911        }
37912    }
37913    }
37914    function_tests++;
37915#endif
37916
37917    return(test_ret);
37918}
37919
37920
37921static int
37922test_xmlUCSIsCatC(void) {
37923    int test_ret = 0;
37924
37925#if defined(LIBXML_UNICODE_ENABLED)
37926    int mem_base;
37927    int ret_val;
37928    int code; /* UCS code point */
37929    int n_code;
37930
37931    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37932        mem_base = xmlMemBlocks();
37933        code = gen_int(n_code, 0);
37934
37935        ret_val = xmlUCSIsCatC(code);
37936        desret_int(ret_val);
37937        call_tests++;
37938        des_int(n_code, code, 0);
37939        xmlResetLastError();
37940        if (mem_base != xmlMemBlocks()) {
37941            printf("Leak of %d blocks found in xmlUCSIsCatC",
37942	           xmlMemBlocks() - mem_base);
37943	    test_ret++;
37944            printf(" %d", n_code);
37945            printf("\n");
37946        }
37947    }
37948    function_tests++;
37949#endif
37950
37951    return(test_ret);
37952}
37953
37954
37955static int
37956test_xmlUCSIsCatCc(void) {
37957    int test_ret = 0;
37958
37959#if defined(LIBXML_UNICODE_ENABLED)
37960    int mem_base;
37961    int ret_val;
37962    int code; /* UCS code point */
37963    int n_code;
37964
37965    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37966        mem_base = xmlMemBlocks();
37967        code = gen_int(n_code, 0);
37968
37969        ret_val = xmlUCSIsCatCc(code);
37970        desret_int(ret_val);
37971        call_tests++;
37972        des_int(n_code, code, 0);
37973        xmlResetLastError();
37974        if (mem_base != xmlMemBlocks()) {
37975            printf("Leak of %d blocks found in xmlUCSIsCatCc",
37976	           xmlMemBlocks() - mem_base);
37977	    test_ret++;
37978            printf(" %d", n_code);
37979            printf("\n");
37980        }
37981    }
37982    function_tests++;
37983#endif
37984
37985    return(test_ret);
37986}
37987
37988
37989static int
37990test_xmlUCSIsCatCf(void) {
37991    int test_ret = 0;
37992
37993#if defined(LIBXML_UNICODE_ENABLED)
37994    int mem_base;
37995    int ret_val;
37996    int code; /* UCS code point */
37997    int n_code;
37998
37999    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38000        mem_base = xmlMemBlocks();
38001        code = gen_int(n_code, 0);
38002
38003        ret_val = xmlUCSIsCatCf(code);
38004        desret_int(ret_val);
38005        call_tests++;
38006        des_int(n_code, code, 0);
38007        xmlResetLastError();
38008        if (mem_base != xmlMemBlocks()) {
38009            printf("Leak of %d blocks found in xmlUCSIsCatCf",
38010	           xmlMemBlocks() - mem_base);
38011	    test_ret++;
38012            printf(" %d", n_code);
38013            printf("\n");
38014        }
38015    }
38016    function_tests++;
38017#endif
38018
38019    return(test_ret);
38020}
38021
38022
38023static int
38024test_xmlUCSIsCatCo(void) {
38025    int test_ret = 0;
38026
38027#if defined(LIBXML_UNICODE_ENABLED)
38028    int mem_base;
38029    int ret_val;
38030    int code; /* UCS code point */
38031    int n_code;
38032
38033    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38034        mem_base = xmlMemBlocks();
38035        code = gen_int(n_code, 0);
38036
38037        ret_val = xmlUCSIsCatCo(code);
38038        desret_int(ret_val);
38039        call_tests++;
38040        des_int(n_code, code, 0);
38041        xmlResetLastError();
38042        if (mem_base != xmlMemBlocks()) {
38043            printf("Leak of %d blocks found in xmlUCSIsCatCo",
38044	           xmlMemBlocks() - mem_base);
38045	    test_ret++;
38046            printf(" %d", n_code);
38047            printf("\n");
38048        }
38049    }
38050    function_tests++;
38051#endif
38052
38053    return(test_ret);
38054}
38055
38056
38057static int
38058test_xmlUCSIsCatCs(void) {
38059    int test_ret = 0;
38060
38061#if defined(LIBXML_UNICODE_ENABLED)
38062    int mem_base;
38063    int ret_val;
38064    int code; /* UCS code point */
38065    int n_code;
38066
38067    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38068        mem_base = xmlMemBlocks();
38069        code = gen_int(n_code, 0);
38070
38071        ret_val = xmlUCSIsCatCs(code);
38072        desret_int(ret_val);
38073        call_tests++;
38074        des_int(n_code, code, 0);
38075        xmlResetLastError();
38076        if (mem_base != xmlMemBlocks()) {
38077            printf("Leak of %d blocks found in xmlUCSIsCatCs",
38078	           xmlMemBlocks() - mem_base);
38079	    test_ret++;
38080            printf(" %d", n_code);
38081            printf("\n");
38082        }
38083    }
38084    function_tests++;
38085#endif
38086
38087    return(test_ret);
38088}
38089
38090
38091static int
38092test_xmlUCSIsCatL(void) {
38093    int test_ret = 0;
38094
38095#if defined(LIBXML_UNICODE_ENABLED)
38096    int mem_base;
38097    int ret_val;
38098    int code; /* UCS code point */
38099    int n_code;
38100
38101    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38102        mem_base = xmlMemBlocks();
38103        code = gen_int(n_code, 0);
38104
38105        ret_val = xmlUCSIsCatL(code);
38106        desret_int(ret_val);
38107        call_tests++;
38108        des_int(n_code, code, 0);
38109        xmlResetLastError();
38110        if (mem_base != xmlMemBlocks()) {
38111            printf("Leak of %d blocks found in xmlUCSIsCatL",
38112	           xmlMemBlocks() - mem_base);
38113	    test_ret++;
38114            printf(" %d", n_code);
38115            printf("\n");
38116        }
38117    }
38118    function_tests++;
38119#endif
38120
38121    return(test_ret);
38122}
38123
38124
38125static int
38126test_xmlUCSIsCatLl(void) {
38127    int test_ret = 0;
38128
38129#if defined(LIBXML_UNICODE_ENABLED)
38130    int mem_base;
38131    int ret_val;
38132    int code; /* UCS code point */
38133    int n_code;
38134
38135    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38136        mem_base = xmlMemBlocks();
38137        code = gen_int(n_code, 0);
38138
38139        ret_val = xmlUCSIsCatLl(code);
38140        desret_int(ret_val);
38141        call_tests++;
38142        des_int(n_code, code, 0);
38143        xmlResetLastError();
38144        if (mem_base != xmlMemBlocks()) {
38145            printf("Leak of %d blocks found in xmlUCSIsCatLl",
38146	           xmlMemBlocks() - mem_base);
38147	    test_ret++;
38148            printf(" %d", n_code);
38149            printf("\n");
38150        }
38151    }
38152    function_tests++;
38153#endif
38154
38155    return(test_ret);
38156}
38157
38158
38159static int
38160test_xmlUCSIsCatLm(void) {
38161    int test_ret = 0;
38162
38163#if defined(LIBXML_UNICODE_ENABLED)
38164    int mem_base;
38165    int ret_val;
38166    int code; /* UCS code point */
38167    int n_code;
38168
38169    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38170        mem_base = xmlMemBlocks();
38171        code = gen_int(n_code, 0);
38172
38173        ret_val = xmlUCSIsCatLm(code);
38174        desret_int(ret_val);
38175        call_tests++;
38176        des_int(n_code, code, 0);
38177        xmlResetLastError();
38178        if (mem_base != xmlMemBlocks()) {
38179            printf("Leak of %d blocks found in xmlUCSIsCatLm",
38180	           xmlMemBlocks() - mem_base);
38181	    test_ret++;
38182            printf(" %d", n_code);
38183            printf("\n");
38184        }
38185    }
38186    function_tests++;
38187#endif
38188
38189    return(test_ret);
38190}
38191
38192
38193static int
38194test_xmlUCSIsCatLo(void) {
38195    int test_ret = 0;
38196
38197#if defined(LIBXML_UNICODE_ENABLED)
38198    int mem_base;
38199    int ret_val;
38200    int code; /* UCS code point */
38201    int n_code;
38202
38203    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38204        mem_base = xmlMemBlocks();
38205        code = gen_int(n_code, 0);
38206
38207        ret_val = xmlUCSIsCatLo(code);
38208        desret_int(ret_val);
38209        call_tests++;
38210        des_int(n_code, code, 0);
38211        xmlResetLastError();
38212        if (mem_base != xmlMemBlocks()) {
38213            printf("Leak of %d blocks found in xmlUCSIsCatLo",
38214	           xmlMemBlocks() - mem_base);
38215	    test_ret++;
38216            printf(" %d", n_code);
38217            printf("\n");
38218        }
38219    }
38220    function_tests++;
38221#endif
38222
38223    return(test_ret);
38224}
38225
38226
38227static int
38228test_xmlUCSIsCatLt(void) {
38229    int test_ret = 0;
38230
38231#if defined(LIBXML_UNICODE_ENABLED)
38232    int mem_base;
38233    int ret_val;
38234    int code; /* UCS code point */
38235    int n_code;
38236
38237    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38238        mem_base = xmlMemBlocks();
38239        code = gen_int(n_code, 0);
38240
38241        ret_val = xmlUCSIsCatLt(code);
38242        desret_int(ret_val);
38243        call_tests++;
38244        des_int(n_code, code, 0);
38245        xmlResetLastError();
38246        if (mem_base != xmlMemBlocks()) {
38247            printf("Leak of %d blocks found in xmlUCSIsCatLt",
38248	           xmlMemBlocks() - mem_base);
38249	    test_ret++;
38250            printf(" %d", n_code);
38251            printf("\n");
38252        }
38253    }
38254    function_tests++;
38255#endif
38256
38257    return(test_ret);
38258}
38259
38260
38261static int
38262test_xmlUCSIsCatLu(void) {
38263    int test_ret = 0;
38264
38265#if defined(LIBXML_UNICODE_ENABLED)
38266    int mem_base;
38267    int ret_val;
38268    int code; /* UCS code point */
38269    int n_code;
38270
38271    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38272        mem_base = xmlMemBlocks();
38273        code = gen_int(n_code, 0);
38274
38275        ret_val = xmlUCSIsCatLu(code);
38276        desret_int(ret_val);
38277        call_tests++;
38278        des_int(n_code, code, 0);
38279        xmlResetLastError();
38280        if (mem_base != xmlMemBlocks()) {
38281            printf("Leak of %d blocks found in xmlUCSIsCatLu",
38282	           xmlMemBlocks() - mem_base);
38283	    test_ret++;
38284            printf(" %d", n_code);
38285            printf("\n");
38286        }
38287    }
38288    function_tests++;
38289#endif
38290
38291    return(test_ret);
38292}
38293
38294
38295static int
38296test_xmlUCSIsCatM(void) {
38297    int test_ret = 0;
38298
38299#if defined(LIBXML_UNICODE_ENABLED)
38300    int mem_base;
38301    int ret_val;
38302    int code; /* UCS code point */
38303    int n_code;
38304
38305    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38306        mem_base = xmlMemBlocks();
38307        code = gen_int(n_code, 0);
38308
38309        ret_val = xmlUCSIsCatM(code);
38310        desret_int(ret_val);
38311        call_tests++;
38312        des_int(n_code, code, 0);
38313        xmlResetLastError();
38314        if (mem_base != xmlMemBlocks()) {
38315            printf("Leak of %d blocks found in xmlUCSIsCatM",
38316	           xmlMemBlocks() - mem_base);
38317	    test_ret++;
38318            printf(" %d", n_code);
38319            printf("\n");
38320        }
38321    }
38322    function_tests++;
38323#endif
38324
38325    return(test_ret);
38326}
38327
38328
38329static int
38330test_xmlUCSIsCatMc(void) {
38331    int test_ret = 0;
38332
38333#if defined(LIBXML_UNICODE_ENABLED)
38334    int mem_base;
38335    int ret_val;
38336    int code; /* UCS code point */
38337    int n_code;
38338
38339    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38340        mem_base = xmlMemBlocks();
38341        code = gen_int(n_code, 0);
38342
38343        ret_val = xmlUCSIsCatMc(code);
38344        desret_int(ret_val);
38345        call_tests++;
38346        des_int(n_code, code, 0);
38347        xmlResetLastError();
38348        if (mem_base != xmlMemBlocks()) {
38349            printf("Leak of %d blocks found in xmlUCSIsCatMc",
38350	           xmlMemBlocks() - mem_base);
38351	    test_ret++;
38352            printf(" %d", n_code);
38353            printf("\n");
38354        }
38355    }
38356    function_tests++;
38357#endif
38358
38359    return(test_ret);
38360}
38361
38362
38363static int
38364test_xmlUCSIsCatMe(void) {
38365    int test_ret = 0;
38366
38367#if defined(LIBXML_UNICODE_ENABLED)
38368    int mem_base;
38369    int ret_val;
38370    int code; /* UCS code point */
38371    int n_code;
38372
38373    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38374        mem_base = xmlMemBlocks();
38375        code = gen_int(n_code, 0);
38376
38377        ret_val = xmlUCSIsCatMe(code);
38378        desret_int(ret_val);
38379        call_tests++;
38380        des_int(n_code, code, 0);
38381        xmlResetLastError();
38382        if (mem_base != xmlMemBlocks()) {
38383            printf("Leak of %d blocks found in xmlUCSIsCatMe",
38384	           xmlMemBlocks() - mem_base);
38385	    test_ret++;
38386            printf(" %d", n_code);
38387            printf("\n");
38388        }
38389    }
38390    function_tests++;
38391#endif
38392
38393    return(test_ret);
38394}
38395
38396
38397static int
38398test_xmlUCSIsCatMn(void) {
38399    int test_ret = 0;
38400
38401#if defined(LIBXML_UNICODE_ENABLED)
38402    int mem_base;
38403    int ret_val;
38404    int code; /* UCS code point */
38405    int n_code;
38406
38407    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38408        mem_base = xmlMemBlocks();
38409        code = gen_int(n_code, 0);
38410
38411        ret_val = xmlUCSIsCatMn(code);
38412        desret_int(ret_val);
38413        call_tests++;
38414        des_int(n_code, code, 0);
38415        xmlResetLastError();
38416        if (mem_base != xmlMemBlocks()) {
38417            printf("Leak of %d blocks found in xmlUCSIsCatMn",
38418	           xmlMemBlocks() - mem_base);
38419	    test_ret++;
38420            printf(" %d", n_code);
38421            printf("\n");
38422        }
38423    }
38424    function_tests++;
38425#endif
38426
38427    return(test_ret);
38428}
38429
38430
38431static int
38432test_xmlUCSIsCatN(void) {
38433    int test_ret = 0;
38434
38435#if defined(LIBXML_UNICODE_ENABLED)
38436    int mem_base;
38437    int ret_val;
38438    int code; /* UCS code point */
38439    int n_code;
38440
38441    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38442        mem_base = xmlMemBlocks();
38443        code = gen_int(n_code, 0);
38444
38445        ret_val = xmlUCSIsCatN(code);
38446        desret_int(ret_val);
38447        call_tests++;
38448        des_int(n_code, code, 0);
38449        xmlResetLastError();
38450        if (mem_base != xmlMemBlocks()) {
38451            printf("Leak of %d blocks found in xmlUCSIsCatN",
38452	           xmlMemBlocks() - mem_base);
38453	    test_ret++;
38454            printf(" %d", n_code);
38455            printf("\n");
38456        }
38457    }
38458    function_tests++;
38459#endif
38460
38461    return(test_ret);
38462}
38463
38464
38465static int
38466test_xmlUCSIsCatNd(void) {
38467    int test_ret = 0;
38468
38469#if defined(LIBXML_UNICODE_ENABLED)
38470    int mem_base;
38471    int ret_val;
38472    int code; /* UCS code point */
38473    int n_code;
38474
38475    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38476        mem_base = xmlMemBlocks();
38477        code = gen_int(n_code, 0);
38478
38479        ret_val = xmlUCSIsCatNd(code);
38480        desret_int(ret_val);
38481        call_tests++;
38482        des_int(n_code, code, 0);
38483        xmlResetLastError();
38484        if (mem_base != xmlMemBlocks()) {
38485            printf("Leak of %d blocks found in xmlUCSIsCatNd",
38486	           xmlMemBlocks() - mem_base);
38487	    test_ret++;
38488            printf(" %d", n_code);
38489            printf("\n");
38490        }
38491    }
38492    function_tests++;
38493#endif
38494
38495    return(test_ret);
38496}
38497
38498
38499static int
38500test_xmlUCSIsCatNl(void) {
38501    int test_ret = 0;
38502
38503#if defined(LIBXML_UNICODE_ENABLED)
38504    int mem_base;
38505    int ret_val;
38506    int code; /* UCS code point */
38507    int n_code;
38508
38509    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38510        mem_base = xmlMemBlocks();
38511        code = gen_int(n_code, 0);
38512
38513        ret_val = xmlUCSIsCatNl(code);
38514        desret_int(ret_val);
38515        call_tests++;
38516        des_int(n_code, code, 0);
38517        xmlResetLastError();
38518        if (mem_base != xmlMemBlocks()) {
38519            printf("Leak of %d blocks found in xmlUCSIsCatNl",
38520	           xmlMemBlocks() - mem_base);
38521	    test_ret++;
38522            printf(" %d", n_code);
38523            printf("\n");
38524        }
38525    }
38526    function_tests++;
38527#endif
38528
38529    return(test_ret);
38530}
38531
38532
38533static int
38534test_xmlUCSIsCatNo(void) {
38535    int test_ret = 0;
38536
38537#if defined(LIBXML_UNICODE_ENABLED)
38538    int mem_base;
38539    int ret_val;
38540    int code; /* UCS code point */
38541    int n_code;
38542
38543    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38544        mem_base = xmlMemBlocks();
38545        code = gen_int(n_code, 0);
38546
38547        ret_val = xmlUCSIsCatNo(code);
38548        desret_int(ret_val);
38549        call_tests++;
38550        des_int(n_code, code, 0);
38551        xmlResetLastError();
38552        if (mem_base != xmlMemBlocks()) {
38553            printf("Leak of %d blocks found in xmlUCSIsCatNo",
38554	           xmlMemBlocks() - mem_base);
38555	    test_ret++;
38556            printf(" %d", n_code);
38557            printf("\n");
38558        }
38559    }
38560    function_tests++;
38561#endif
38562
38563    return(test_ret);
38564}
38565
38566
38567static int
38568test_xmlUCSIsCatP(void) {
38569    int test_ret = 0;
38570
38571#if defined(LIBXML_UNICODE_ENABLED)
38572    int mem_base;
38573    int ret_val;
38574    int code; /* UCS code point */
38575    int n_code;
38576
38577    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38578        mem_base = xmlMemBlocks();
38579        code = gen_int(n_code, 0);
38580
38581        ret_val = xmlUCSIsCatP(code);
38582        desret_int(ret_val);
38583        call_tests++;
38584        des_int(n_code, code, 0);
38585        xmlResetLastError();
38586        if (mem_base != xmlMemBlocks()) {
38587            printf("Leak of %d blocks found in xmlUCSIsCatP",
38588	           xmlMemBlocks() - mem_base);
38589	    test_ret++;
38590            printf(" %d", n_code);
38591            printf("\n");
38592        }
38593    }
38594    function_tests++;
38595#endif
38596
38597    return(test_ret);
38598}
38599
38600
38601static int
38602test_xmlUCSIsCatPc(void) {
38603    int test_ret = 0;
38604
38605#if defined(LIBXML_UNICODE_ENABLED)
38606    int mem_base;
38607    int ret_val;
38608    int code; /* UCS code point */
38609    int n_code;
38610
38611    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38612        mem_base = xmlMemBlocks();
38613        code = gen_int(n_code, 0);
38614
38615        ret_val = xmlUCSIsCatPc(code);
38616        desret_int(ret_val);
38617        call_tests++;
38618        des_int(n_code, code, 0);
38619        xmlResetLastError();
38620        if (mem_base != xmlMemBlocks()) {
38621            printf("Leak of %d blocks found in xmlUCSIsCatPc",
38622	           xmlMemBlocks() - mem_base);
38623	    test_ret++;
38624            printf(" %d", n_code);
38625            printf("\n");
38626        }
38627    }
38628    function_tests++;
38629#endif
38630
38631    return(test_ret);
38632}
38633
38634
38635static int
38636test_xmlUCSIsCatPd(void) {
38637    int test_ret = 0;
38638
38639#if defined(LIBXML_UNICODE_ENABLED)
38640    int mem_base;
38641    int ret_val;
38642    int code; /* UCS code point */
38643    int n_code;
38644
38645    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38646        mem_base = xmlMemBlocks();
38647        code = gen_int(n_code, 0);
38648
38649        ret_val = xmlUCSIsCatPd(code);
38650        desret_int(ret_val);
38651        call_tests++;
38652        des_int(n_code, code, 0);
38653        xmlResetLastError();
38654        if (mem_base != xmlMemBlocks()) {
38655            printf("Leak of %d blocks found in xmlUCSIsCatPd",
38656	           xmlMemBlocks() - mem_base);
38657	    test_ret++;
38658            printf(" %d", n_code);
38659            printf("\n");
38660        }
38661    }
38662    function_tests++;
38663#endif
38664
38665    return(test_ret);
38666}
38667
38668
38669static int
38670test_xmlUCSIsCatPe(void) {
38671    int test_ret = 0;
38672
38673#if defined(LIBXML_UNICODE_ENABLED)
38674    int mem_base;
38675    int ret_val;
38676    int code; /* UCS code point */
38677    int n_code;
38678
38679    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38680        mem_base = xmlMemBlocks();
38681        code = gen_int(n_code, 0);
38682
38683        ret_val = xmlUCSIsCatPe(code);
38684        desret_int(ret_val);
38685        call_tests++;
38686        des_int(n_code, code, 0);
38687        xmlResetLastError();
38688        if (mem_base != xmlMemBlocks()) {
38689            printf("Leak of %d blocks found in xmlUCSIsCatPe",
38690	           xmlMemBlocks() - mem_base);
38691	    test_ret++;
38692            printf(" %d", n_code);
38693            printf("\n");
38694        }
38695    }
38696    function_tests++;
38697#endif
38698
38699    return(test_ret);
38700}
38701
38702
38703static int
38704test_xmlUCSIsCatPf(void) {
38705    int test_ret = 0;
38706
38707#if defined(LIBXML_UNICODE_ENABLED)
38708    int mem_base;
38709    int ret_val;
38710    int code; /* UCS code point */
38711    int n_code;
38712
38713    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38714        mem_base = xmlMemBlocks();
38715        code = gen_int(n_code, 0);
38716
38717        ret_val = xmlUCSIsCatPf(code);
38718        desret_int(ret_val);
38719        call_tests++;
38720        des_int(n_code, code, 0);
38721        xmlResetLastError();
38722        if (mem_base != xmlMemBlocks()) {
38723            printf("Leak of %d blocks found in xmlUCSIsCatPf",
38724	           xmlMemBlocks() - mem_base);
38725	    test_ret++;
38726            printf(" %d", n_code);
38727            printf("\n");
38728        }
38729    }
38730    function_tests++;
38731#endif
38732
38733    return(test_ret);
38734}
38735
38736
38737static int
38738test_xmlUCSIsCatPi(void) {
38739    int test_ret = 0;
38740
38741#if defined(LIBXML_UNICODE_ENABLED)
38742    int mem_base;
38743    int ret_val;
38744    int code; /* UCS code point */
38745    int n_code;
38746
38747    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38748        mem_base = xmlMemBlocks();
38749        code = gen_int(n_code, 0);
38750
38751        ret_val = xmlUCSIsCatPi(code);
38752        desret_int(ret_val);
38753        call_tests++;
38754        des_int(n_code, code, 0);
38755        xmlResetLastError();
38756        if (mem_base != xmlMemBlocks()) {
38757            printf("Leak of %d blocks found in xmlUCSIsCatPi",
38758	           xmlMemBlocks() - mem_base);
38759	    test_ret++;
38760            printf(" %d", n_code);
38761            printf("\n");
38762        }
38763    }
38764    function_tests++;
38765#endif
38766
38767    return(test_ret);
38768}
38769
38770
38771static int
38772test_xmlUCSIsCatPo(void) {
38773    int test_ret = 0;
38774
38775#if defined(LIBXML_UNICODE_ENABLED)
38776    int mem_base;
38777    int ret_val;
38778    int code; /* UCS code point */
38779    int n_code;
38780
38781    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38782        mem_base = xmlMemBlocks();
38783        code = gen_int(n_code, 0);
38784
38785        ret_val = xmlUCSIsCatPo(code);
38786        desret_int(ret_val);
38787        call_tests++;
38788        des_int(n_code, code, 0);
38789        xmlResetLastError();
38790        if (mem_base != xmlMemBlocks()) {
38791            printf("Leak of %d blocks found in xmlUCSIsCatPo",
38792	           xmlMemBlocks() - mem_base);
38793	    test_ret++;
38794            printf(" %d", n_code);
38795            printf("\n");
38796        }
38797    }
38798    function_tests++;
38799#endif
38800
38801    return(test_ret);
38802}
38803
38804
38805static int
38806test_xmlUCSIsCatPs(void) {
38807    int test_ret = 0;
38808
38809#if defined(LIBXML_UNICODE_ENABLED)
38810    int mem_base;
38811    int ret_val;
38812    int code; /* UCS code point */
38813    int n_code;
38814
38815    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38816        mem_base = xmlMemBlocks();
38817        code = gen_int(n_code, 0);
38818
38819        ret_val = xmlUCSIsCatPs(code);
38820        desret_int(ret_val);
38821        call_tests++;
38822        des_int(n_code, code, 0);
38823        xmlResetLastError();
38824        if (mem_base != xmlMemBlocks()) {
38825            printf("Leak of %d blocks found in xmlUCSIsCatPs",
38826	           xmlMemBlocks() - mem_base);
38827	    test_ret++;
38828            printf(" %d", n_code);
38829            printf("\n");
38830        }
38831    }
38832    function_tests++;
38833#endif
38834
38835    return(test_ret);
38836}
38837
38838
38839static int
38840test_xmlUCSIsCatS(void) {
38841    int test_ret = 0;
38842
38843#if defined(LIBXML_UNICODE_ENABLED)
38844    int mem_base;
38845    int ret_val;
38846    int code; /* UCS code point */
38847    int n_code;
38848
38849    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38850        mem_base = xmlMemBlocks();
38851        code = gen_int(n_code, 0);
38852
38853        ret_val = xmlUCSIsCatS(code);
38854        desret_int(ret_val);
38855        call_tests++;
38856        des_int(n_code, code, 0);
38857        xmlResetLastError();
38858        if (mem_base != xmlMemBlocks()) {
38859            printf("Leak of %d blocks found in xmlUCSIsCatS",
38860	           xmlMemBlocks() - mem_base);
38861	    test_ret++;
38862            printf(" %d", n_code);
38863            printf("\n");
38864        }
38865    }
38866    function_tests++;
38867#endif
38868
38869    return(test_ret);
38870}
38871
38872
38873static int
38874test_xmlUCSIsCatSc(void) {
38875    int test_ret = 0;
38876
38877#if defined(LIBXML_UNICODE_ENABLED)
38878    int mem_base;
38879    int ret_val;
38880    int code; /* UCS code point */
38881    int n_code;
38882
38883    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38884        mem_base = xmlMemBlocks();
38885        code = gen_int(n_code, 0);
38886
38887        ret_val = xmlUCSIsCatSc(code);
38888        desret_int(ret_val);
38889        call_tests++;
38890        des_int(n_code, code, 0);
38891        xmlResetLastError();
38892        if (mem_base != xmlMemBlocks()) {
38893            printf("Leak of %d blocks found in xmlUCSIsCatSc",
38894	           xmlMemBlocks() - mem_base);
38895	    test_ret++;
38896            printf(" %d", n_code);
38897            printf("\n");
38898        }
38899    }
38900    function_tests++;
38901#endif
38902
38903    return(test_ret);
38904}
38905
38906
38907static int
38908test_xmlUCSIsCatSk(void) {
38909    int test_ret = 0;
38910
38911#if defined(LIBXML_UNICODE_ENABLED)
38912    int mem_base;
38913    int ret_val;
38914    int code; /* UCS code point */
38915    int n_code;
38916
38917    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38918        mem_base = xmlMemBlocks();
38919        code = gen_int(n_code, 0);
38920
38921        ret_val = xmlUCSIsCatSk(code);
38922        desret_int(ret_val);
38923        call_tests++;
38924        des_int(n_code, code, 0);
38925        xmlResetLastError();
38926        if (mem_base != xmlMemBlocks()) {
38927            printf("Leak of %d blocks found in xmlUCSIsCatSk",
38928	           xmlMemBlocks() - mem_base);
38929	    test_ret++;
38930            printf(" %d", n_code);
38931            printf("\n");
38932        }
38933    }
38934    function_tests++;
38935#endif
38936
38937    return(test_ret);
38938}
38939
38940
38941static int
38942test_xmlUCSIsCatSm(void) {
38943    int test_ret = 0;
38944
38945#if defined(LIBXML_UNICODE_ENABLED)
38946    int mem_base;
38947    int ret_val;
38948    int code; /* UCS code point */
38949    int n_code;
38950
38951    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38952        mem_base = xmlMemBlocks();
38953        code = gen_int(n_code, 0);
38954
38955        ret_val = xmlUCSIsCatSm(code);
38956        desret_int(ret_val);
38957        call_tests++;
38958        des_int(n_code, code, 0);
38959        xmlResetLastError();
38960        if (mem_base != xmlMemBlocks()) {
38961            printf("Leak of %d blocks found in xmlUCSIsCatSm",
38962	           xmlMemBlocks() - mem_base);
38963	    test_ret++;
38964            printf(" %d", n_code);
38965            printf("\n");
38966        }
38967    }
38968    function_tests++;
38969#endif
38970
38971    return(test_ret);
38972}
38973
38974
38975static int
38976test_xmlUCSIsCatSo(void) {
38977    int test_ret = 0;
38978
38979#if defined(LIBXML_UNICODE_ENABLED)
38980    int mem_base;
38981    int ret_val;
38982    int code; /* UCS code point */
38983    int n_code;
38984
38985    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38986        mem_base = xmlMemBlocks();
38987        code = gen_int(n_code, 0);
38988
38989        ret_val = xmlUCSIsCatSo(code);
38990        desret_int(ret_val);
38991        call_tests++;
38992        des_int(n_code, code, 0);
38993        xmlResetLastError();
38994        if (mem_base != xmlMemBlocks()) {
38995            printf("Leak of %d blocks found in xmlUCSIsCatSo",
38996	           xmlMemBlocks() - mem_base);
38997	    test_ret++;
38998            printf(" %d", n_code);
38999            printf("\n");
39000        }
39001    }
39002    function_tests++;
39003#endif
39004
39005    return(test_ret);
39006}
39007
39008
39009static int
39010test_xmlUCSIsCatZ(void) {
39011    int test_ret = 0;
39012
39013#if defined(LIBXML_UNICODE_ENABLED)
39014    int mem_base;
39015    int ret_val;
39016    int code; /* UCS code point */
39017    int n_code;
39018
39019    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39020        mem_base = xmlMemBlocks();
39021        code = gen_int(n_code, 0);
39022
39023        ret_val = xmlUCSIsCatZ(code);
39024        desret_int(ret_val);
39025        call_tests++;
39026        des_int(n_code, code, 0);
39027        xmlResetLastError();
39028        if (mem_base != xmlMemBlocks()) {
39029            printf("Leak of %d blocks found in xmlUCSIsCatZ",
39030	           xmlMemBlocks() - mem_base);
39031	    test_ret++;
39032            printf(" %d", n_code);
39033            printf("\n");
39034        }
39035    }
39036    function_tests++;
39037#endif
39038
39039    return(test_ret);
39040}
39041
39042
39043static int
39044test_xmlUCSIsCatZl(void) {
39045    int test_ret = 0;
39046
39047#if defined(LIBXML_UNICODE_ENABLED)
39048    int mem_base;
39049    int ret_val;
39050    int code; /* UCS code point */
39051    int n_code;
39052
39053    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39054        mem_base = xmlMemBlocks();
39055        code = gen_int(n_code, 0);
39056
39057        ret_val = xmlUCSIsCatZl(code);
39058        desret_int(ret_val);
39059        call_tests++;
39060        des_int(n_code, code, 0);
39061        xmlResetLastError();
39062        if (mem_base != xmlMemBlocks()) {
39063            printf("Leak of %d blocks found in xmlUCSIsCatZl",
39064	           xmlMemBlocks() - mem_base);
39065	    test_ret++;
39066            printf(" %d", n_code);
39067            printf("\n");
39068        }
39069    }
39070    function_tests++;
39071#endif
39072
39073    return(test_ret);
39074}
39075
39076
39077static int
39078test_xmlUCSIsCatZp(void) {
39079    int test_ret = 0;
39080
39081#if defined(LIBXML_UNICODE_ENABLED)
39082    int mem_base;
39083    int ret_val;
39084    int code; /* UCS code point */
39085    int n_code;
39086
39087    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39088        mem_base = xmlMemBlocks();
39089        code = gen_int(n_code, 0);
39090
39091        ret_val = xmlUCSIsCatZp(code);
39092        desret_int(ret_val);
39093        call_tests++;
39094        des_int(n_code, code, 0);
39095        xmlResetLastError();
39096        if (mem_base != xmlMemBlocks()) {
39097            printf("Leak of %d blocks found in xmlUCSIsCatZp",
39098	           xmlMemBlocks() - mem_base);
39099	    test_ret++;
39100            printf(" %d", n_code);
39101            printf("\n");
39102        }
39103    }
39104    function_tests++;
39105#endif
39106
39107    return(test_ret);
39108}
39109
39110
39111static int
39112test_xmlUCSIsCatZs(void) {
39113    int test_ret = 0;
39114
39115#if defined(LIBXML_UNICODE_ENABLED)
39116    int mem_base;
39117    int ret_val;
39118    int code; /* UCS code point */
39119    int n_code;
39120
39121    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39122        mem_base = xmlMemBlocks();
39123        code = gen_int(n_code, 0);
39124
39125        ret_val = xmlUCSIsCatZs(code);
39126        desret_int(ret_val);
39127        call_tests++;
39128        des_int(n_code, code, 0);
39129        xmlResetLastError();
39130        if (mem_base != xmlMemBlocks()) {
39131            printf("Leak of %d blocks found in xmlUCSIsCatZs",
39132	           xmlMemBlocks() - mem_base);
39133	    test_ret++;
39134            printf(" %d", n_code);
39135            printf("\n");
39136        }
39137    }
39138    function_tests++;
39139#endif
39140
39141    return(test_ret);
39142}
39143
39144
39145static int
39146test_xmlUCSIsCherokee(void) {
39147    int test_ret = 0;
39148
39149#if defined(LIBXML_UNICODE_ENABLED)
39150    int mem_base;
39151    int ret_val;
39152    int code; /* UCS code point */
39153    int n_code;
39154
39155    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39156        mem_base = xmlMemBlocks();
39157        code = gen_int(n_code, 0);
39158
39159        ret_val = xmlUCSIsCherokee(code);
39160        desret_int(ret_val);
39161        call_tests++;
39162        des_int(n_code, code, 0);
39163        xmlResetLastError();
39164        if (mem_base != xmlMemBlocks()) {
39165            printf("Leak of %d blocks found in xmlUCSIsCherokee",
39166	           xmlMemBlocks() - mem_base);
39167	    test_ret++;
39168            printf(" %d", n_code);
39169            printf("\n");
39170        }
39171    }
39172    function_tests++;
39173#endif
39174
39175    return(test_ret);
39176}
39177
39178
39179static int
39180test_xmlUCSIsCombiningDiacriticalMarks(void) {
39181    int test_ret = 0;
39182
39183#if defined(LIBXML_UNICODE_ENABLED)
39184    int mem_base;
39185    int ret_val;
39186    int code; /* UCS code point */
39187    int n_code;
39188
39189    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39190        mem_base = xmlMemBlocks();
39191        code = gen_int(n_code, 0);
39192
39193        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
39194        desret_int(ret_val);
39195        call_tests++;
39196        des_int(n_code, code, 0);
39197        xmlResetLastError();
39198        if (mem_base != xmlMemBlocks()) {
39199            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
39200	           xmlMemBlocks() - mem_base);
39201	    test_ret++;
39202            printf(" %d", n_code);
39203            printf("\n");
39204        }
39205    }
39206    function_tests++;
39207#endif
39208
39209    return(test_ret);
39210}
39211
39212
39213static int
39214test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
39215    int test_ret = 0;
39216
39217#if defined(LIBXML_UNICODE_ENABLED)
39218    int mem_base;
39219    int ret_val;
39220    int code; /* UCS code point */
39221    int n_code;
39222
39223    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39224        mem_base = xmlMemBlocks();
39225        code = gen_int(n_code, 0);
39226
39227        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39228        desret_int(ret_val);
39229        call_tests++;
39230        des_int(n_code, code, 0);
39231        xmlResetLastError();
39232        if (mem_base != xmlMemBlocks()) {
39233            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39234	           xmlMemBlocks() - mem_base);
39235	    test_ret++;
39236            printf(" %d", n_code);
39237            printf("\n");
39238        }
39239    }
39240    function_tests++;
39241#endif
39242
39243    return(test_ret);
39244}
39245
39246
39247static int
39248test_xmlUCSIsCombiningHalfMarks(void) {
39249    int test_ret = 0;
39250
39251#if defined(LIBXML_UNICODE_ENABLED)
39252    int mem_base;
39253    int ret_val;
39254    int code; /* UCS code point */
39255    int n_code;
39256
39257    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39258        mem_base = xmlMemBlocks();
39259        code = gen_int(n_code, 0);
39260
39261        ret_val = xmlUCSIsCombiningHalfMarks(code);
39262        desret_int(ret_val);
39263        call_tests++;
39264        des_int(n_code, code, 0);
39265        xmlResetLastError();
39266        if (mem_base != xmlMemBlocks()) {
39267            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39268	           xmlMemBlocks() - mem_base);
39269	    test_ret++;
39270            printf(" %d", n_code);
39271            printf("\n");
39272        }
39273    }
39274    function_tests++;
39275#endif
39276
39277    return(test_ret);
39278}
39279
39280
39281static int
39282test_xmlUCSIsCombiningMarksforSymbols(void) {
39283    int test_ret = 0;
39284
39285#if defined(LIBXML_UNICODE_ENABLED)
39286    int mem_base;
39287    int ret_val;
39288    int code; /* UCS code point */
39289    int n_code;
39290
39291    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39292        mem_base = xmlMemBlocks();
39293        code = gen_int(n_code, 0);
39294
39295        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39296        desret_int(ret_val);
39297        call_tests++;
39298        des_int(n_code, code, 0);
39299        xmlResetLastError();
39300        if (mem_base != xmlMemBlocks()) {
39301            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39302	           xmlMemBlocks() - mem_base);
39303	    test_ret++;
39304            printf(" %d", n_code);
39305            printf("\n");
39306        }
39307    }
39308    function_tests++;
39309#endif
39310
39311    return(test_ret);
39312}
39313
39314
39315static int
39316test_xmlUCSIsControlPictures(void) {
39317    int test_ret = 0;
39318
39319#if defined(LIBXML_UNICODE_ENABLED)
39320    int mem_base;
39321    int ret_val;
39322    int code; /* UCS code point */
39323    int n_code;
39324
39325    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39326        mem_base = xmlMemBlocks();
39327        code = gen_int(n_code, 0);
39328
39329        ret_val = xmlUCSIsControlPictures(code);
39330        desret_int(ret_val);
39331        call_tests++;
39332        des_int(n_code, code, 0);
39333        xmlResetLastError();
39334        if (mem_base != xmlMemBlocks()) {
39335            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39336	           xmlMemBlocks() - mem_base);
39337	    test_ret++;
39338            printf(" %d", n_code);
39339            printf("\n");
39340        }
39341    }
39342    function_tests++;
39343#endif
39344
39345    return(test_ret);
39346}
39347
39348
39349static int
39350test_xmlUCSIsCurrencySymbols(void) {
39351    int test_ret = 0;
39352
39353#if defined(LIBXML_UNICODE_ENABLED)
39354    int mem_base;
39355    int ret_val;
39356    int code; /* UCS code point */
39357    int n_code;
39358
39359    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39360        mem_base = xmlMemBlocks();
39361        code = gen_int(n_code, 0);
39362
39363        ret_val = xmlUCSIsCurrencySymbols(code);
39364        desret_int(ret_val);
39365        call_tests++;
39366        des_int(n_code, code, 0);
39367        xmlResetLastError();
39368        if (mem_base != xmlMemBlocks()) {
39369            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39370	           xmlMemBlocks() - mem_base);
39371	    test_ret++;
39372            printf(" %d", n_code);
39373            printf("\n");
39374        }
39375    }
39376    function_tests++;
39377#endif
39378
39379    return(test_ret);
39380}
39381
39382
39383static int
39384test_xmlUCSIsCypriotSyllabary(void) {
39385    int test_ret = 0;
39386
39387#if defined(LIBXML_UNICODE_ENABLED)
39388    int mem_base;
39389    int ret_val;
39390    int code; /* UCS code point */
39391    int n_code;
39392
39393    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39394        mem_base = xmlMemBlocks();
39395        code = gen_int(n_code, 0);
39396
39397        ret_val = xmlUCSIsCypriotSyllabary(code);
39398        desret_int(ret_val);
39399        call_tests++;
39400        des_int(n_code, code, 0);
39401        xmlResetLastError();
39402        if (mem_base != xmlMemBlocks()) {
39403            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39404	           xmlMemBlocks() - mem_base);
39405	    test_ret++;
39406            printf(" %d", n_code);
39407            printf("\n");
39408        }
39409    }
39410    function_tests++;
39411#endif
39412
39413    return(test_ret);
39414}
39415
39416
39417static int
39418test_xmlUCSIsCyrillic(void) {
39419    int test_ret = 0;
39420
39421#if defined(LIBXML_UNICODE_ENABLED)
39422    int mem_base;
39423    int ret_val;
39424    int code; /* UCS code point */
39425    int n_code;
39426
39427    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39428        mem_base = xmlMemBlocks();
39429        code = gen_int(n_code, 0);
39430
39431        ret_val = xmlUCSIsCyrillic(code);
39432        desret_int(ret_val);
39433        call_tests++;
39434        des_int(n_code, code, 0);
39435        xmlResetLastError();
39436        if (mem_base != xmlMemBlocks()) {
39437            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39438	           xmlMemBlocks() - mem_base);
39439	    test_ret++;
39440            printf(" %d", n_code);
39441            printf("\n");
39442        }
39443    }
39444    function_tests++;
39445#endif
39446
39447    return(test_ret);
39448}
39449
39450
39451static int
39452test_xmlUCSIsCyrillicSupplement(void) {
39453    int test_ret = 0;
39454
39455#if defined(LIBXML_UNICODE_ENABLED)
39456    int mem_base;
39457    int ret_val;
39458    int code; /* UCS code point */
39459    int n_code;
39460
39461    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39462        mem_base = xmlMemBlocks();
39463        code = gen_int(n_code, 0);
39464
39465        ret_val = xmlUCSIsCyrillicSupplement(code);
39466        desret_int(ret_val);
39467        call_tests++;
39468        des_int(n_code, code, 0);
39469        xmlResetLastError();
39470        if (mem_base != xmlMemBlocks()) {
39471            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39472	           xmlMemBlocks() - mem_base);
39473	    test_ret++;
39474            printf(" %d", n_code);
39475            printf("\n");
39476        }
39477    }
39478    function_tests++;
39479#endif
39480
39481    return(test_ret);
39482}
39483
39484
39485static int
39486test_xmlUCSIsDeseret(void) {
39487    int test_ret = 0;
39488
39489#if defined(LIBXML_UNICODE_ENABLED)
39490    int mem_base;
39491    int ret_val;
39492    int code; /* UCS code point */
39493    int n_code;
39494
39495    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39496        mem_base = xmlMemBlocks();
39497        code = gen_int(n_code, 0);
39498
39499        ret_val = xmlUCSIsDeseret(code);
39500        desret_int(ret_val);
39501        call_tests++;
39502        des_int(n_code, code, 0);
39503        xmlResetLastError();
39504        if (mem_base != xmlMemBlocks()) {
39505            printf("Leak of %d blocks found in xmlUCSIsDeseret",
39506	           xmlMemBlocks() - mem_base);
39507	    test_ret++;
39508            printf(" %d", n_code);
39509            printf("\n");
39510        }
39511    }
39512    function_tests++;
39513#endif
39514
39515    return(test_ret);
39516}
39517
39518
39519static int
39520test_xmlUCSIsDevanagari(void) {
39521    int test_ret = 0;
39522
39523#if defined(LIBXML_UNICODE_ENABLED)
39524    int mem_base;
39525    int ret_val;
39526    int code; /* UCS code point */
39527    int n_code;
39528
39529    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39530        mem_base = xmlMemBlocks();
39531        code = gen_int(n_code, 0);
39532
39533        ret_val = xmlUCSIsDevanagari(code);
39534        desret_int(ret_val);
39535        call_tests++;
39536        des_int(n_code, code, 0);
39537        xmlResetLastError();
39538        if (mem_base != xmlMemBlocks()) {
39539            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39540	           xmlMemBlocks() - mem_base);
39541	    test_ret++;
39542            printf(" %d", n_code);
39543            printf("\n");
39544        }
39545    }
39546    function_tests++;
39547#endif
39548
39549    return(test_ret);
39550}
39551
39552
39553static int
39554test_xmlUCSIsDingbats(void) {
39555    int test_ret = 0;
39556
39557#if defined(LIBXML_UNICODE_ENABLED)
39558    int mem_base;
39559    int ret_val;
39560    int code; /* UCS code point */
39561    int n_code;
39562
39563    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39564        mem_base = xmlMemBlocks();
39565        code = gen_int(n_code, 0);
39566
39567        ret_val = xmlUCSIsDingbats(code);
39568        desret_int(ret_val);
39569        call_tests++;
39570        des_int(n_code, code, 0);
39571        xmlResetLastError();
39572        if (mem_base != xmlMemBlocks()) {
39573            printf("Leak of %d blocks found in xmlUCSIsDingbats",
39574	           xmlMemBlocks() - mem_base);
39575	    test_ret++;
39576            printf(" %d", n_code);
39577            printf("\n");
39578        }
39579    }
39580    function_tests++;
39581#endif
39582
39583    return(test_ret);
39584}
39585
39586
39587static int
39588test_xmlUCSIsEnclosedAlphanumerics(void) {
39589    int test_ret = 0;
39590
39591#if defined(LIBXML_UNICODE_ENABLED)
39592    int mem_base;
39593    int ret_val;
39594    int code; /* UCS code point */
39595    int n_code;
39596
39597    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39598        mem_base = xmlMemBlocks();
39599        code = gen_int(n_code, 0);
39600
39601        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39602        desret_int(ret_val);
39603        call_tests++;
39604        des_int(n_code, code, 0);
39605        xmlResetLastError();
39606        if (mem_base != xmlMemBlocks()) {
39607            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39608	           xmlMemBlocks() - mem_base);
39609	    test_ret++;
39610            printf(" %d", n_code);
39611            printf("\n");
39612        }
39613    }
39614    function_tests++;
39615#endif
39616
39617    return(test_ret);
39618}
39619
39620
39621static int
39622test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39623    int test_ret = 0;
39624
39625#if defined(LIBXML_UNICODE_ENABLED)
39626    int mem_base;
39627    int ret_val;
39628    int code; /* UCS code point */
39629    int n_code;
39630
39631    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39632        mem_base = xmlMemBlocks();
39633        code = gen_int(n_code, 0);
39634
39635        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39636        desret_int(ret_val);
39637        call_tests++;
39638        des_int(n_code, code, 0);
39639        xmlResetLastError();
39640        if (mem_base != xmlMemBlocks()) {
39641            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39642	           xmlMemBlocks() - mem_base);
39643	    test_ret++;
39644            printf(" %d", n_code);
39645            printf("\n");
39646        }
39647    }
39648    function_tests++;
39649#endif
39650
39651    return(test_ret);
39652}
39653
39654
39655static int
39656test_xmlUCSIsEthiopic(void) {
39657    int test_ret = 0;
39658
39659#if defined(LIBXML_UNICODE_ENABLED)
39660    int mem_base;
39661    int ret_val;
39662    int code; /* UCS code point */
39663    int n_code;
39664
39665    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39666        mem_base = xmlMemBlocks();
39667        code = gen_int(n_code, 0);
39668
39669        ret_val = xmlUCSIsEthiopic(code);
39670        desret_int(ret_val);
39671        call_tests++;
39672        des_int(n_code, code, 0);
39673        xmlResetLastError();
39674        if (mem_base != xmlMemBlocks()) {
39675            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39676	           xmlMemBlocks() - mem_base);
39677	    test_ret++;
39678            printf(" %d", n_code);
39679            printf("\n");
39680        }
39681    }
39682    function_tests++;
39683#endif
39684
39685    return(test_ret);
39686}
39687
39688
39689static int
39690test_xmlUCSIsGeneralPunctuation(void) {
39691    int test_ret = 0;
39692
39693#if defined(LIBXML_UNICODE_ENABLED)
39694    int mem_base;
39695    int ret_val;
39696    int code; /* UCS code point */
39697    int n_code;
39698
39699    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39700        mem_base = xmlMemBlocks();
39701        code = gen_int(n_code, 0);
39702
39703        ret_val = xmlUCSIsGeneralPunctuation(code);
39704        desret_int(ret_val);
39705        call_tests++;
39706        des_int(n_code, code, 0);
39707        xmlResetLastError();
39708        if (mem_base != xmlMemBlocks()) {
39709            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39710	           xmlMemBlocks() - mem_base);
39711	    test_ret++;
39712            printf(" %d", n_code);
39713            printf("\n");
39714        }
39715    }
39716    function_tests++;
39717#endif
39718
39719    return(test_ret);
39720}
39721
39722
39723static int
39724test_xmlUCSIsGeometricShapes(void) {
39725    int test_ret = 0;
39726
39727#if defined(LIBXML_UNICODE_ENABLED)
39728    int mem_base;
39729    int ret_val;
39730    int code; /* UCS code point */
39731    int n_code;
39732
39733    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39734        mem_base = xmlMemBlocks();
39735        code = gen_int(n_code, 0);
39736
39737        ret_val = xmlUCSIsGeometricShapes(code);
39738        desret_int(ret_val);
39739        call_tests++;
39740        des_int(n_code, code, 0);
39741        xmlResetLastError();
39742        if (mem_base != xmlMemBlocks()) {
39743            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39744	           xmlMemBlocks() - mem_base);
39745	    test_ret++;
39746            printf(" %d", n_code);
39747            printf("\n");
39748        }
39749    }
39750    function_tests++;
39751#endif
39752
39753    return(test_ret);
39754}
39755
39756
39757static int
39758test_xmlUCSIsGeorgian(void) {
39759    int test_ret = 0;
39760
39761#if defined(LIBXML_UNICODE_ENABLED)
39762    int mem_base;
39763    int ret_val;
39764    int code; /* UCS code point */
39765    int n_code;
39766
39767    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39768        mem_base = xmlMemBlocks();
39769        code = gen_int(n_code, 0);
39770
39771        ret_val = xmlUCSIsGeorgian(code);
39772        desret_int(ret_val);
39773        call_tests++;
39774        des_int(n_code, code, 0);
39775        xmlResetLastError();
39776        if (mem_base != xmlMemBlocks()) {
39777            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39778	           xmlMemBlocks() - mem_base);
39779	    test_ret++;
39780            printf(" %d", n_code);
39781            printf("\n");
39782        }
39783    }
39784    function_tests++;
39785#endif
39786
39787    return(test_ret);
39788}
39789
39790
39791static int
39792test_xmlUCSIsGothic(void) {
39793    int test_ret = 0;
39794
39795#if defined(LIBXML_UNICODE_ENABLED)
39796    int mem_base;
39797    int ret_val;
39798    int code; /* UCS code point */
39799    int n_code;
39800
39801    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39802        mem_base = xmlMemBlocks();
39803        code = gen_int(n_code, 0);
39804
39805        ret_val = xmlUCSIsGothic(code);
39806        desret_int(ret_val);
39807        call_tests++;
39808        des_int(n_code, code, 0);
39809        xmlResetLastError();
39810        if (mem_base != xmlMemBlocks()) {
39811            printf("Leak of %d blocks found in xmlUCSIsGothic",
39812	           xmlMemBlocks() - mem_base);
39813	    test_ret++;
39814            printf(" %d", n_code);
39815            printf("\n");
39816        }
39817    }
39818    function_tests++;
39819#endif
39820
39821    return(test_ret);
39822}
39823
39824
39825static int
39826test_xmlUCSIsGreek(void) {
39827    int test_ret = 0;
39828
39829#if defined(LIBXML_UNICODE_ENABLED)
39830    int mem_base;
39831    int ret_val;
39832    int code; /* UCS code point */
39833    int n_code;
39834
39835    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39836        mem_base = xmlMemBlocks();
39837        code = gen_int(n_code, 0);
39838
39839        ret_val = xmlUCSIsGreek(code);
39840        desret_int(ret_val);
39841        call_tests++;
39842        des_int(n_code, code, 0);
39843        xmlResetLastError();
39844        if (mem_base != xmlMemBlocks()) {
39845            printf("Leak of %d blocks found in xmlUCSIsGreek",
39846	           xmlMemBlocks() - mem_base);
39847	    test_ret++;
39848            printf(" %d", n_code);
39849            printf("\n");
39850        }
39851    }
39852    function_tests++;
39853#endif
39854
39855    return(test_ret);
39856}
39857
39858
39859static int
39860test_xmlUCSIsGreekExtended(void) {
39861    int test_ret = 0;
39862
39863#if defined(LIBXML_UNICODE_ENABLED)
39864    int mem_base;
39865    int ret_val;
39866    int code; /* UCS code point */
39867    int n_code;
39868
39869    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39870        mem_base = xmlMemBlocks();
39871        code = gen_int(n_code, 0);
39872
39873        ret_val = xmlUCSIsGreekExtended(code);
39874        desret_int(ret_val);
39875        call_tests++;
39876        des_int(n_code, code, 0);
39877        xmlResetLastError();
39878        if (mem_base != xmlMemBlocks()) {
39879            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39880	           xmlMemBlocks() - mem_base);
39881	    test_ret++;
39882            printf(" %d", n_code);
39883            printf("\n");
39884        }
39885    }
39886    function_tests++;
39887#endif
39888
39889    return(test_ret);
39890}
39891
39892
39893static int
39894test_xmlUCSIsGreekandCoptic(void) {
39895    int test_ret = 0;
39896
39897#if defined(LIBXML_UNICODE_ENABLED)
39898    int mem_base;
39899    int ret_val;
39900    int code; /* UCS code point */
39901    int n_code;
39902
39903    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39904        mem_base = xmlMemBlocks();
39905        code = gen_int(n_code, 0);
39906
39907        ret_val = xmlUCSIsGreekandCoptic(code);
39908        desret_int(ret_val);
39909        call_tests++;
39910        des_int(n_code, code, 0);
39911        xmlResetLastError();
39912        if (mem_base != xmlMemBlocks()) {
39913            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39914	           xmlMemBlocks() - mem_base);
39915	    test_ret++;
39916            printf(" %d", n_code);
39917            printf("\n");
39918        }
39919    }
39920    function_tests++;
39921#endif
39922
39923    return(test_ret);
39924}
39925
39926
39927static int
39928test_xmlUCSIsGujarati(void) {
39929    int test_ret = 0;
39930
39931#if defined(LIBXML_UNICODE_ENABLED)
39932    int mem_base;
39933    int ret_val;
39934    int code; /* UCS code point */
39935    int n_code;
39936
39937    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39938        mem_base = xmlMemBlocks();
39939        code = gen_int(n_code, 0);
39940
39941        ret_val = xmlUCSIsGujarati(code);
39942        desret_int(ret_val);
39943        call_tests++;
39944        des_int(n_code, code, 0);
39945        xmlResetLastError();
39946        if (mem_base != xmlMemBlocks()) {
39947            printf("Leak of %d blocks found in xmlUCSIsGujarati",
39948	           xmlMemBlocks() - mem_base);
39949	    test_ret++;
39950            printf(" %d", n_code);
39951            printf("\n");
39952        }
39953    }
39954    function_tests++;
39955#endif
39956
39957    return(test_ret);
39958}
39959
39960
39961static int
39962test_xmlUCSIsGurmukhi(void) {
39963    int test_ret = 0;
39964
39965#if defined(LIBXML_UNICODE_ENABLED)
39966    int mem_base;
39967    int ret_val;
39968    int code; /* UCS code point */
39969    int n_code;
39970
39971    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39972        mem_base = xmlMemBlocks();
39973        code = gen_int(n_code, 0);
39974
39975        ret_val = xmlUCSIsGurmukhi(code);
39976        desret_int(ret_val);
39977        call_tests++;
39978        des_int(n_code, code, 0);
39979        xmlResetLastError();
39980        if (mem_base != xmlMemBlocks()) {
39981            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39982	           xmlMemBlocks() - mem_base);
39983	    test_ret++;
39984            printf(" %d", n_code);
39985            printf("\n");
39986        }
39987    }
39988    function_tests++;
39989#endif
39990
39991    return(test_ret);
39992}
39993
39994
39995static int
39996test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39997    int test_ret = 0;
39998
39999#if defined(LIBXML_UNICODE_ENABLED)
40000    int mem_base;
40001    int ret_val;
40002    int code; /* UCS code point */
40003    int n_code;
40004
40005    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40006        mem_base = xmlMemBlocks();
40007        code = gen_int(n_code, 0);
40008
40009        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
40010        desret_int(ret_val);
40011        call_tests++;
40012        des_int(n_code, code, 0);
40013        xmlResetLastError();
40014        if (mem_base != xmlMemBlocks()) {
40015            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
40016	           xmlMemBlocks() - mem_base);
40017	    test_ret++;
40018            printf(" %d", n_code);
40019            printf("\n");
40020        }
40021    }
40022    function_tests++;
40023#endif
40024
40025    return(test_ret);
40026}
40027
40028
40029static int
40030test_xmlUCSIsHangulCompatibilityJamo(void) {
40031    int test_ret = 0;
40032
40033#if defined(LIBXML_UNICODE_ENABLED)
40034    int mem_base;
40035    int ret_val;
40036    int code; /* UCS code point */
40037    int n_code;
40038
40039    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40040        mem_base = xmlMemBlocks();
40041        code = gen_int(n_code, 0);
40042
40043        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
40044        desret_int(ret_val);
40045        call_tests++;
40046        des_int(n_code, code, 0);
40047        xmlResetLastError();
40048        if (mem_base != xmlMemBlocks()) {
40049            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
40050	           xmlMemBlocks() - mem_base);
40051	    test_ret++;
40052            printf(" %d", n_code);
40053            printf("\n");
40054        }
40055    }
40056    function_tests++;
40057#endif
40058
40059    return(test_ret);
40060}
40061
40062
40063static int
40064test_xmlUCSIsHangulJamo(void) {
40065    int test_ret = 0;
40066
40067#if defined(LIBXML_UNICODE_ENABLED)
40068    int mem_base;
40069    int ret_val;
40070    int code; /* UCS code point */
40071    int n_code;
40072
40073    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40074        mem_base = xmlMemBlocks();
40075        code = gen_int(n_code, 0);
40076
40077        ret_val = xmlUCSIsHangulJamo(code);
40078        desret_int(ret_val);
40079        call_tests++;
40080        des_int(n_code, code, 0);
40081        xmlResetLastError();
40082        if (mem_base != xmlMemBlocks()) {
40083            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
40084	           xmlMemBlocks() - mem_base);
40085	    test_ret++;
40086            printf(" %d", n_code);
40087            printf("\n");
40088        }
40089    }
40090    function_tests++;
40091#endif
40092
40093    return(test_ret);
40094}
40095
40096
40097static int
40098test_xmlUCSIsHangulSyllables(void) {
40099    int test_ret = 0;
40100
40101#if defined(LIBXML_UNICODE_ENABLED)
40102    int mem_base;
40103    int ret_val;
40104    int code; /* UCS code point */
40105    int n_code;
40106
40107    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40108        mem_base = xmlMemBlocks();
40109        code = gen_int(n_code, 0);
40110
40111        ret_val = xmlUCSIsHangulSyllables(code);
40112        desret_int(ret_val);
40113        call_tests++;
40114        des_int(n_code, code, 0);
40115        xmlResetLastError();
40116        if (mem_base != xmlMemBlocks()) {
40117            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
40118	           xmlMemBlocks() - mem_base);
40119	    test_ret++;
40120            printf(" %d", n_code);
40121            printf("\n");
40122        }
40123    }
40124    function_tests++;
40125#endif
40126
40127    return(test_ret);
40128}
40129
40130
40131static int
40132test_xmlUCSIsHanunoo(void) {
40133    int test_ret = 0;
40134
40135#if defined(LIBXML_UNICODE_ENABLED)
40136    int mem_base;
40137    int ret_val;
40138    int code; /* UCS code point */
40139    int n_code;
40140
40141    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40142        mem_base = xmlMemBlocks();
40143        code = gen_int(n_code, 0);
40144
40145        ret_val = xmlUCSIsHanunoo(code);
40146        desret_int(ret_val);
40147        call_tests++;
40148        des_int(n_code, code, 0);
40149        xmlResetLastError();
40150        if (mem_base != xmlMemBlocks()) {
40151            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
40152	           xmlMemBlocks() - mem_base);
40153	    test_ret++;
40154            printf(" %d", n_code);
40155            printf("\n");
40156        }
40157    }
40158    function_tests++;
40159#endif
40160
40161    return(test_ret);
40162}
40163
40164
40165static int
40166test_xmlUCSIsHebrew(void) {
40167    int test_ret = 0;
40168
40169#if defined(LIBXML_UNICODE_ENABLED)
40170    int mem_base;
40171    int ret_val;
40172    int code; /* UCS code point */
40173    int n_code;
40174
40175    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40176        mem_base = xmlMemBlocks();
40177        code = gen_int(n_code, 0);
40178
40179        ret_val = xmlUCSIsHebrew(code);
40180        desret_int(ret_val);
40181        call_tests++;
40182        des_int(n_code, code, 0);
40183        xmlResetLastError();
40184        if (mem_base != xmlMemBlocks()) {
40185            printf("Leak of %d blocks found in xmlUCSIsHebrew",
40186	           xmlMemBlocks() - mem_base);
40187	    test_ret++;
40188            printf(" %d", n_code);
40189            printf("\n");
40190        }
40191    }
40192    function_tests++;
40193#endif
40194
40195    return(test_ret);
40196}
40197
40198
40199static int
40200test_xmlUCSIsHighPrivateUseSurrogates(void) {
40201    int test_ret = 0;
40202
40203#if defined(LIBXML_UNICODE_ENABLED)
40204    int mem_base;
40205    int ret_val;
40206    int code; /* UCS code point */
40207    int n_code;
40208
40209    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40210        mem_base = xmlMemBlocks();
40211        code = gen_int(n_code, 0);
40212
40213        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
40214        desret_int(ret_val);
40215        call_tests++;
40216        des_int(n_code, code, 0);
40217        xmlResetLastError();
40218        if (mem_base != xmlMemBlocks()) {
40219            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
40220	           xmlMemBlocks() - mem_base);
40221	    test_ret++;
40222            printf(" %d", n_code);
40223            printf("\n");
40224        }
40225    }
40226    function_tests++;
40227#endif
40228
40229    return(test_ret);
40230}
40231
40232
40233static int
40234test_xmlUCSIsHighSurrogates(void) {
40235    int test_ret = 0;
40236
40237#if defined(LIBXML_UNICODE_ENABLED)
40238    int mem_base;
40239    int ret_val;
40240    int code; /* UCS code point */
40241    int n_code;
40242
40243    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40244        mem_base = xmlMemBlocks();
40245        code = gen_int(n_code, 0);
40246
40247        ret_val = xmlUCSIsHighSurrogates(code);
40248        desret_int(ret_val);
40249        call_tests++;
40250        des_int(n_code, code, 0);
40251        xmlResetLastError();
40252        if (mem_base != xmlMemBlocks()) {
40253            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40254	           xmlMemBlocks() - mem_base);
40255	    test_ret++;
40256            printf(" %d", n_code);
40257            printf("\n");
40258        }
40259    }
40260    function_tests++;
40261#endif
40262
40263    return(test_ret);
40264}
40265
40266
40267static int
40268test_xmlUCSIsHiragana(void) {
40269    int test_ret = 0;
40270
40271#if defined(LIBXML_UNICODE_ENABLED)
40272    int mem_base;
40273    int ret_val;
40274    int code; /* UCS code point */
40275    int n_code;
40276
40277    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40278        mem_base = xmlMemBlocks();
40279        code = gen_int(n_code, 0);
40280
40281        ret_val = xmlUCSIsHiragana(code);
40282        desret_int(ret_val);
40283        call_tests++;
40284        des_int(n_code, code, 0);
40285        xmlResetLastError();
40286        if (mem_base != xmlMemBlocks()) {
40287            printf("Leak of %d blocks found in xmlUCSIsHiragana",
40288	           xmlMemBlocks() - mem_base);
40289	    test_ret++;
40290            printf(" %d", n_code);
40291            printf("\n");
40292        }
40293    }
40294    function_tests++;
40295#endif
40296
40297    return(test_ret);
40298}
40299
40300
40301static int
40302test_xmlUCSIsIPAExtensions(void) {
40303    int test_ret = 0;
40304
40305#if defined(LIBXML_UNICODE_ENABLED)
40306    int mem_base;
40307    int ret_val;
40308    int code; /* UCS code point */
40309    int n_code;
40310
40311    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40312        mem_base = xmlMemBlocks();
40313        code = gen_int(n_code, 0);
40314
40315        ret_val = xmlUCSIsIPAExtensions(code);
40316        desret_int(ret_val);
40317        call_tests++;
40318        des_int(n_code, code, 0);
40319        xmlResetLastError();
40320        if (mem_base != xmlMemBlocks()) {
40321            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40322	           xmlMemBlocks() - mem_base);
40323	    test_ret++;
40324            printf(" %d", n_code);
40325            printf("\n");
40326        }
40327    }
40328    function_tests++;
40329#endif
40330
40331    return(test_ret);
40332}
40333
40334
40335static int
40336test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40337    int test_ret = 0;
40338
40339#if defined(LIBXML_UNICODE_ENABLED)
40340    int mem_base;
40341    int ret_val;
40342    int code; /* UCS code point */
40343    int n_code;
40344
40345    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40346        mem_base = xmlMemBlocks();
40347        code = gen_int(n_code, 0);
40348
40349        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40350        desret_int(ret_val);
40351        call_tests++;
40352        des_int(n_code, code, 0);
40353        xmlResetLastError();
40354        if (mem_base != xmlMemBlocks()) {
40355            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40356	           xmlMemBlocks() - mem_base);
40357	    test_ret++;
40358            printf(" %d", n_code);
40359            printf("\n");
40360        }
40361    }
40362    function_tests++;
40363#endif
40364
40365    return(test_ret);
40366}
40367
40368
40369static int
40370test_xmlUCSIsKanbun(void) {
40371    int test_ret = 0;
40372
40373#if defined(LIBXML_UNICODE_ENABLED)
40374    int mem_base;
40375    int ret_val;
40376    int code; /* UCS code point */
40377    int n_code;
40378
40379    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40380        mem_base = xmlMemBlocks();
40381        code = gen_int(n_code, 0);
40382
40383        ret_val = xmlUCSIsKanbun(code);
40384        desret_int(ret_val);
40385        call_tests++;
40386        des_int(n_code, code, 0);
40387        xmlResetLastError();
40388        if (mem_base != xmlMemBlocks()) {
40389            printf("Leak of %d blocks found in xmlUCSIsKanbun",
40390	           xmlMemBlocks() - mem_base);
40391	    test_ret++;
40392            printf(" %d", n_code);
40393            printf("\n");
40394        }
40395    }
40396    function_tests++;
40397#endif
40398
40399    return(test_ret);
40400}
40401
40402
40403static int
40404test_xmlUCSIsKangxiRadicals(void) {
40405    int test_ret = 0;
40406
40407#if defined(LIBXML_UNICODE_ENABLED)
40408    int mem_base;
40409    int ret_val;
40410    int code; /* UCS code point */
40411    int n_code;
40412
40413    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40414        mem_base = xmlMemBlocks();
40415        code = gen_int(n_code, 0);
40416
40417        ret_val = xmlUCSIsKangxiRadicals(code);
40418        desret_int(ret_val);
40419        call_tests++;
40420        des_int(n_code, code, 0);
40421        xmlResetLastError();
40422        if (mem_base != xmlMemBlocks()) {
40423            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40424	           xmlMemBlocks() - mem_base);
40425	    test_ret++;
40426            printf(" %d", n_code);
40427            printf("\n");
40428        }
40429    }
40430    function_tests++;
40431#endif
40432
40433    return(test_ret);
40434}
40435
40436
40437static int
40438test_xmlUCSIsKannada(void) {
40439    int test_ret = 0;
40440
40441#if defined(LIBXML_UNICODE_ENABLED)
40442    int mem_base;
40443    int ret_val;
40444    int code; /* UCS code point */
40445    int n_code;
40446
40447    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40448        mem_base = xmlMemBlocks();
40449        code = gen_int(n_code, 0);
40450
40451        ret_val = xmlUCSIsKannada(code);
40452        desret_int(ret_val);
40453        call_tests++;
40454        des_int(n_code, code, 0);
40455        xmlResetLastError();
40456        if (mem_base != xmlMemBlocks()) {
40457            printf("Leak of %d blocks found in xmlUCSIsKannada",
40458	           xmlMemBlocks() - mem_base);
40459	    test_ret++;
40460            printf(" %d", n_code);
40461            printf("\n");
40462        }
40463    }
40464    function_tests++;
40465#endif
40466
40467    return(test_ret);
40468}
40469
40470
40471static int
40472test_xmlUCSIsKatakana(void) {
40473    int test_ret = 0;
40474
40475#if defined(LIBXML_UNICODE_ENABLED)
40476    int mem_base;
40477    int ret_val;
40478    int code; /* UCS code point */
40479    int n_code;
40480
40481    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40482        mem_base = xmlMemBlocks();
40483        code = gen_int(n_code, 0);
40484
40485        ret_val = xmlUCSIsKatakana(code);
40486        desret_int(ret_val);
40487        call_tests++;
40488        des_int(n_code, code, 0);
40489        xmlResetLastError();
40490        if (mem_base != xmlMemBlocks()) {
40491            printf("Leak of %d blocks found in xmlUCSIsKatakana",
40492	           xmlMemBlocks() - mem_base);
40493	    test_ret++;
40494            printf(" %d", n_code);
40495            printf("\n");
40496        }
40497    }
40498    function_tests++;
40499#endif
40500
40501    return(test_ret);
40502}
40503
40504
40505static int
40506test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40507    int test_ret = 0;
40508
40509#if defined(LIBXML_UNICODE_ENABLED)
40510    int mem_base;
40511    int ret_val;
40512    int code; /* UCS code point */
40513    int n_code;
40514
40515    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40516        mem_base = xmlMemBlocks();
40517        code = gen_int(n_code, 0);
40518
40519        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40520        desret_int(ret_val);
40521        call_tests++;
40522        des_int(n_code, code, 0);
40523        xmlResetLastError();
40524        if (mem_base != xmlMemBlocks()) {
40525            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40526	           xmlMemBlocks() - mem_base);
40527	    test_ret++;
40528            printf(" %d", n_code);
40529            printf("\n");
40530        }
40531    }
40532    function_tests++;
40533#endif
40534
40535    return(test_ret);
40536}
40537
40538
40539static int
40540test_xmlUCSIsKhmer(void) {
40541    int test_ret = 0;
40542
40543#if defined(LIBXML_UNICODE_ENABLED)
40544    int mem_base;
40545    int ret_val;
40546    int code; /* UCS code point */
40547    int n_code;
40548
40549    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40550        mem_base = xmlMemBlocks();
40551        code = gen_int(n_code, 0);
40552
40553        ret_val = xmlUCSIsKhmer(code);
40554        desret_int(ret_val);
40555        call_tests++;
40556        des_int(n_code, code, 0);
40557        xmlResetLastError();
40558        if (mem_base != xmlMemBlocks()) {
40559            printf("Leak of %d blocks found in xmlUCSIsKhmer",
40560	           xmlMemBlocks() - mem_base);
40561	    test_ret++;
40562            printf(" %d", n_code);
40563            printf("\n");
40564        }
40565    }
40566    function_tests++;
40567#endif
40568
40569    return(test_ret);
40570}
40571
40572
40573static int
40574test_xmlUCSIsKhmerSymbols(void) {
40575    int test_ret = 0;
40576
40577#if defined(LIBXML_UNICODE_ENABLED)
40578    int mem_base;
40579    int ret_val;
40580    int code; /* UCS code point */
40581    int n_code;
40582
40583    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40584        mem_base = xmlMemBlocks();
40585        code = gen_int(n_code, 0);
40586
40587        ret_val = xmlUCSIsKhmerSymbols(code);
40588        desret_int(ret_val);
40589        call_tests++;
40590        des_int(n_code, code, 0);
40591        xmlResetLastError();
40592        if (mem_base != xmlMemBlocks()) {
40593            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40594	           xmlMemBlocks() - mem_base);
40595	    test_ret++;
40596            printf(" %d", n_code);
40597            printf("\n");
40598        }
40599    }
40600    function_tests++;
40601#endif
40602
40603    return(test_ret);
40604}
40605
40606
40607static int
40608test_xmlUCSIsLao(void) {
40609    int test_ret = 0;
40610
40611#if defined(LIBXML_UNICODE_ENABLED)
40612    int mem_base;
40613    int ret_val;
40614    int code; /* UCS code point */
40615    int n_code;
40616
40617    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40618        mem_base = xmlMemBlocks();
40619        code = gen_int(n_code, 0);
40620
40621        ret_val = xmlUCSIsLao(code);
40622        desret_int(ret_val);
40623        call_tests++;
40624        des_int(n_code, code, 0);
40625        xmlResetLastError();
40626        if (mem_base != xmlMemBlocks()) {
40627            printf("Leak of %d blocks found in xmlUCSIsLao",
40628	           xmlMemBlocks() - mem_base);
40629	    test_ret++;
40630            printf(" %d", n_code);
40631            printf("\n");
40632        }
40633    }
40634    function_tests++;
40635#endif
40636
40637    return(test_ret);
40638}
40639
40640
40641static int
40642test_xmlUCSIsLatin1Supplement(void) {
40643    int test_ret = 0;
40644
40645#if defined(LIBXML_UNICODE_ENABLED)
40646    int mem_base;
40647    int ret_val;
40648    int code; /* UCS code point */
40649    int n_code;
40650
40651    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40652        mem_base = xmlMemBlocks();
40653        code = gen_int(n_code, 0);
40654
40655        ret_val = xmlUCSIsLatin1Supplement(code);
40656        desret_int(ret_val);
40657        call_tests++;
40658        des_int(n_code, code, 0);
40659        xmlResetLastError();
40660        if (mem_base != xmlMemBlocks()) {
40661            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40662	           xmlMemBlocks() - mem_base);
40663	    test_ret++;
40664            printf(" %d", n_code);
40665            printf("\n");
40666        }
40667    }
40668    function_tests++;
40669#endif
40670
40671    return(test_ret);
40672}
40673
40674
40675static int
40676test_xmlUCSIsLatinExtendedA(void) {
40677    int test_ret = 0;
40678
40679#if defined(LIBXML_UNICODE_ENABLED)
40680    int mem_base;
40681    int ret_val;
40682    int code; /* UCS code point */
40683    int n_code;
40684
40685    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40686        mem_base = xmlMemBlocks();
40687        code = gen_int(n_code, 0);
40688
40689        ret_val = xmlUCSIsLatinExtendedA(code);
40690        desret_int(ret_val);
40691        call_tests++;
40692        des_int(n_code, code, 0);
40693        xmlResetLastError();
40694        if (mem_base != xmlMemBlocks()) {
40695            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40696	           xmlMemBlocks() - mem_base);
40697	    test_ret++;
40698            printf(" %d", n_code);
40699            printf("\n");
40700        }
40701    }
40702    function_tests++;
40703#endif
40704
40705    return(test_ret);
40706}
40707
40708
40709static int
40710test_xmlUCSIsLatinExtendedAdditional(void) {
40711    int test_ret = 0;
40712
40713#if defined(LIBXML_UNICODE_ENABLED)
40714    int mem_base;
40715    int ret_val;
40716    int code; /* UCS code point */
40717    int n_code;
40718
40719    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40720        mem_base = xmlMemBlocks();
40721        code = gen_int(n_code, 0);
40722
40723        ret_val = xmlUCSIsLatinExtendedAdditional(code);
40724        desret_int(ret_val);
40725        call_tests++;
40726        des_int(n_code, code, 0);
40727        xmlResetLastError();
40728        if (mem_base != xmlMemBlocks()) {
40729            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40730	           xmlMemBlocks() - mem_base);
40731	    test_ret++;
40732            printf(" %d", n_code);
40733            printf("\n");
40734        }
40735    }
40736    function_tests++;
40737#endif
40738
40739    return(test_ret);
40740}
40741
40742
40743static int
40744test_xmlUCSIsLatinExtendedB(void) {
40745    int test_ret = 0;
40746
40747#if defined(LIBXML_UNICODE_ENABLED)
40748    int mem_base;
40749    int ret_val;
40750    int code; /* UCS code point */
40751    int n_code;
40752
40753    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40754        mem_base = xmlMemBlocks();
40755        code = gen_int(n_code, 0);
40756
40757        ret_val = xmlUCSIsLatinExtendedB(code);
40758        desret_int(ret_val);
40759        call_tests++;
40760        des_int(n_code, code, 0);
40761        xmlResetLastError();
40762        if (mem_base != xmlMemBlocks()) {
40763            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40764	           xmlMemBlocks() - mem_base);
40765	    test_ret++;
40766            printf(" %d", n_code);
40767            printf("\n");
40768        }
40769    }
40770    function_tests++;
40771#endif
40772
40773    return(test_ret);
40774}
40775
40776
40777static int
40778test_xmlUCSIsLetterlikeSymbols(void) {
40779    int test_ret = 0;
40780
40781#if defined(LIBXML_UNICODE_ENABLED)
40782    int mem_base;
40783    int ret_val;
40784    int code; /* UCS code point */
40785    int n_code;
40786
40787    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40788        mem_base = xmlMemBlocks();
40789        code = gen_int(n_code, 0);
40790
40791        ret_val = xmlUCSIsLetterlikeSymbols(code);
40792        desret_int(ret_val);
40793        call_tests++;
40794        des_int(n_code, code, 0);
40795        xmlResetLastError();
40796        if (mem_base != xmlMemBlocks()) {
40797            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40798	           xmlMemBlocks() - mem_base);
40799	    test_ret++;
40800            printf(" %d", n_code);
40801            printf("\n");
40802        }
40803    }
40804    function_tests++;
40805#endif
40806
40807    return(test_ret);
40808}
40809
40810
40811static int
40812test_xmlUCSIsLimbu(void) {
40813    int test_ret = 0;
40814
40815#if defined(LIBXML_UNICODE_ENABLED)
40816    int mem_base;
40817    int ret_val;
40818    int code; /* UCS code point */
40819    int n_code;
40820
40821    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40822        mem_base = xmlMemBlocks();
40823        code = gen_int(n_code, 0);
40824
40825        ret_val = xmlUCSIsLimbu(code);
40826        desret_int(ret_val);
40827        call_tests++;
40828        des_int(n_code, code, 0);
40829        xmlResetLastError();
40830        if (mem_base != xmlMemBlocks()) {
40831            printf("Leak of %d blocks found in xmlUCSIsLimbu",
40832	           xmlMemBlocks() - mem_base);
40833	    test_ret++;
40834            printf(" %d", n_code);
40835            printf("\n");
40836        }
40837    }
40838    function_tests++;
40839#endif
40840
40841    return(test_ret);
40842}
40843
40844
40845static int
40846test_xmlUCSIsLinearBIdeograms(void) {
40847    int test_ret = 0;
40848
40849#if defined(LIBXML_UNICODE_ENABLED)
40850    int mem_base;
40851    int ret_val;
40852    int code; /* UCS code point */
40853    int n_code;
40854
40855    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40856        mem_base = xmlMemBlocks();
40857        code = gen_int(n_code, 0);
40858
40859        ret_val = xmlUCSIsLinearBIdeograms(code);
40860        desret_int(ret_val);
40861        call_tests++;
40862        des_int(n_code, code, 0);
40863        xmlResetLastError();
40864        if (mem_base != xmlMemBlocks()) {
40865            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40866	           xmlMemBlocks() - mem_base);
40867	    test_ret++;
40868            printf(" %d", n_code);
40869            printf("\n");
40870        }
40871    }
40872    function_tests++;
40873#endif
40874
40875    return(test_ret);
40876}
40877
40878
40879static int
40880test_xmlUCSIsLinearBSyllabary(void) {
40881    int test_ret = 0;
40882
40883#if defined(LIBXML_UNICODE_ENABLED)
40884    int mem_base;
40885    int ret_val;
40886    int code; /* UCS code point */
40887    int n_code;
40888
40889    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40890        mem_base = xmlMemBlocks();
40891        code = gen_int(n_code, 0);
40892
40893        ret_val = xmlUCSIsLinearBSyllabary(code);
40894        desret_int(ret_val);
40895        call_tests++;
40896        des_int(n_code, code, 0);
40897        xmlResetLastError();
40898        if (mem_base != xmlMemBlocks()) {
40899            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40900	           xmlMemBlocks() - mem_base);
40901	    test_ret++;
40902            printf(" %d", n_code);
40903            printf("\n");
40904        }
40905    }
40906    function_tests++;
40907#endif
40908
40909    return(test_ret);
40910}
40911
40912
40913static int
40914test_xmlUCSIsLowSurrogates(void) {
40915    int test_ret = 0;
40916
40917#if defined(LIBXML_UNICODE_ENABLED)
40918    int mem_base;
40919    int ret_val;
40920    int code; /* UCS code point */
40921    int n_code;
40922
40923    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40924        mem_base = xmlMemBlocks();
40925        code = gen_int(n_code, 0);
40926
40927        ret_val = xmlUCSIsLowSurrogates(code);
40928        desret_int(ret_val);
40929        call_tests++;
40930        des_int(n_code, code, 0);
40931        xmlResetLastError();
40932        if (mem_base != xmlMemBlocks()) {
40933            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40934	           xmlMemBlocks() - mem_base);
40935	    test_ret++;
40936            printf(" %d", n_code);
40937            printf("\n");
40938        }
40939    }
40940    function_tests++;
40941#endif
40942
40943    return(test_ret);
40944}
40945
40946
40947static int
40948test_xmlUCSIsMalayalam(void) {
40949    int test_ret = 0;
40950
40951#if defined(LIBXML_UNICODE_ENABLED)
40952    int mem_base;
40953    int ret_val;
40954    int code; /* UCS code point */
40955    int n_code;
40956
40957    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40958        mem_base = xmlMemBlocks();
40959        code = gen_int(n_code, 0);
40960
40961        ret_val = xmlUCSIsMalayalam(code);
40962        desret_int(ret_val);
40963        call_tests++;
40964        des_int(n_code, code, 0);
40965        xmlResetLastError();
40966        if (mem_base != xmlMemBlocks()) {
40967            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40968	           xmlMemBlocks() - mem_base);
40969	    test_ret++;
40970            printf(" %d", n_code);
40971            printf("\n");
40972        }
40973    }
40974    function_tests++;
40975#endif
40976
40977    return(test_ret);
40978}
40979
40980
40981static int
40982test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40983    int test_ret = 0;
40984
40985#if defined(LIBXML_UNICODE_ENABLED)
40986    int mem_base;
40987    int ret_val;
40988    int code; /* UCS code point */
40989    int n_code;
40990
40991    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40992        mem_base = xmlMemBlocks();
40993        code = gen_int(n_code, 0);
40994
40995        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40996        desret_int(ret_val);
40997        call_tests++;
40998        des_int(n_code, code, 0);
40999        xmlResetLastError();
41000        if (mem_base != xmlMemBlocks()) {
41001            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
41002	           xmlMemBlocks() - mem_base);
41003	    test_ret++;
41004            printf(" %d", n_code);
41005            printf("\n");
41006        }
41007    }
41008    function_tests++;
41009#endif
41010
41011    return(test_ret);
41012}
41013
41014
41015static int
41016test_xmlUCSIsMathematicalOperators(void) {
41017    int test_ret = 0;
41018
41019#if defined(LIBXML_UNICODE_ENABLED)
41020    int mem_base;
41021    int ret_val;
41022    int code; /* UCS code point */
41023    int n_code;
41024
41025    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41026        mem_base = xmlMemBlocks();
41027        code = gen_int(n_code, 0);
41028
41029        ret_val = xmlUCSIsMathematicalOperators(code);
41030        desret_int(ret_val);
41031        call_tests++;
41032        des_int(n_code, code, 0);
41033        xmlResetLastError();
41034        if (mem_base != xmlMemBlocks()) {
41035            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
41036	           xmlMemBlocks() - mem_base);
41037	    test_ret++;
41038            printf(" %d", n_code);
41039            printf("\n");
41040        }
41041    }
41042    function_tests++;
41043#endif
41044
41045    return(test_ret);
41046}
41047
41048
41049static int
41050test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
41051    int test_ret = 0;
41052
41053#if defined(LIBXML_UNICODE_ENABLED)
41054    int mem_base;
41055    int ret_val;
41056    int code; /* UCS code point */
41057    int n_code;
41058
41059    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41060        mem_base = xmlMemBlocks();
41061        code = gen_int(n_code, 0);
41062
41063        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
41064        desret_int(ret_val);
41065        call_tests++;
41066        des_int(n_code, code, 0);
41067        xmlResetLastError();
41068        if (mem_base != xmlMemBlocks()) {
41069            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
41070	           xmlMemBlocks() - mem_base);
41071	    test_ret++;
41072            printf(" %d", n_code);
41073            printf("\n");
41074        }
41075    }
41076    function_tests++;
41077#endif
41078
41079    return(test_ret);
41080}
41081
41082
41083static int
41084test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
41085    int test_ret = 0;
41086
41087#if defined(LIBXML_UNICODE_ENABLED)
41088    int mem_base;
41089    int ret_val;
41090    int code; /* UCS code point */
41091    int n_code;
41092
41093    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41094        mem_base = xmlMemBlocks();
41095        code = gen_int(n_code, 0);
41096
41097        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
41098        desret_int(ret_val);
41099        call_tests++;
41100        des_int(n_code, code, 0);
41101        xmlResetLastError();
41102        if (mem_base != xmlMemBlocks()) {
41103            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
41104	           xmlMemBlocks() - mem_base);
41105	    test_ret++;
41106            printf(" %d", n_code);
41107            printf("\n");
41108        }
41109    }
41110    function_tests++;
41111#endif
41112
41113    return(test_ret);
41114}
41115
41116
41117static int
41118test_xmlUCSIsMiscellaneousSymbols(void) {
41119    int test_ret = 0;
41120
41121#if defined(LIBXML_UNICODE_ENABLED)
41122    int mem_base;
41123    int ret_val;
41124    int code; /* UCS code point */
41125    int n_code;
41126
41127    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41128        mem_base = xmlMemBlocks();
41129        code = gen_int(n_code, 0);
41130
41131        ret_val = xmlUCSIsMiscellaneousSymbols(code);
41132        desret_int(ret_val);
41133        call_tests++;
41134        des_int(n_code, code, 0);
41135        xmlResetLastError();
41136        if (mem_base != xmlMemBlocks()) {
41137            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
41138	           xmlMemBlocks() - mem_base);
41139	    test_ret++;
41140            printf(" %d", n_code);
41141            printf("\n");
41142        }
41143    }
41144    function_tests++;
41145#endif
41146
41147    return(test_ret);
41148}
41149
41150
41151static int
41152test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
41153    int test_ret = 0;
41154
41155#if defined(LIBXML_UNICODE_ENABLED)
41156    int mem_base;
41157    int ret_val;
41158    int code; /* UCS code point */
41159    int n_code;
41160
41161    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41162        mem_base = xmlMemBlocks();
41163        code = gen_int(n_code, 0);
41164
41165        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
41166        desret_int(ret_val);
41167        call_tests++;
41168        des_int(n_code, code, 0);
41169        xmlResetLastError();
41170        if (mem_base != xmlMemBlocks()) {
41171            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
41172	           xmlMemBlocks() - mem_base);
41173	    test_ret++;
41174            printf(" %d", n_code);
41175            printf("\n");
41176        }
41177    }
41178    function_tests++;
41179#endif
41180
41181    return(test_ret);
41182}
41183
41184
41185static int
41186test_xmlUCSIsMiscellaneousTechnical(void) {
41187    int test_ret = 0;
41188
41189#if defined(LIBXML_UNICODE_ENABLED)
41190    int mem_base;
41191    int ret_val;
41192    int code; /* UCS code point */
41193    int n_code;
41194
41195    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41196        mem_base = xmlMemBlocks();
41197        code = gen_int(n_code, 0);
41198
41199        ret_val = xmlUCSIsMiscellaneousTechnical(code);
41200        desret_int(ret_val);
41201        call_tests++;
41202        des_int(n_code, code, 0);
41203        xmlResetLastError();
41204        if (mem_base != xmlMemBlocks()) {
41205            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
41206	           xmlMemBlocks() - mem_base);
41207	    test_ret++;
41208            printf(" %d", n_code);
41209            printf("\n");
41210        }
41211    }
41212    function_tests++;
41213#endif
41214
41215    return(test_ret);
41216}
41217
41218
41219static int
41220test_xmlUCSIsMongolian(void) {
41221    int test_ret = 0;
41222
41223#if defined(LIBXML_UNICODE_ENABLED)
41224    int mem_base;
41225    int ret_val;
41226    int code; /* UCS code point */
41227    int n_code;
41228
41229    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41230        mem_base = xmlMemBlocks();
41231        code = gen_int(n_code, 0);
41232
41233        ret_val = xmlUCSIsMongolian(code);
41234        desret_int(ret_val);
41235        call_tests++;
41236        des_int(n_code, code, 0);
41237        xmlResetLastError();
41238        if (mem_base != xmlMemBlocks()) {
41239            printf("Leak of %d blocks found in xmlUCSIsMongolian",
41240	           xmlMemBlocks() - mem_base);
41241	    test_ret++;
41242            printf(" %d", n_code);
41243            printf("\n");
41244        }
41245    }
41246    function_tests++;
41247#endif
41248
41249    return(test_ret);
41250}
41251
41252
41253static int
41254test_xmlUCSIsMusicalSymbols(void) {
41255    int test_ret = 0;
41256
41257#if defined(LIBXML_UNICODE_ENABLED)
41258    int mem_base;
41259    int ret_val;
41260    int code; /* UCS code point */
41261    int n_code;
41262
41263    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41264        mem_base = xmlMemBlocks();
41265        code = gen_int(n_code, 0);
41266
41267        ret_val = xmlUCSIsMusicalSymbols(code);
41268        desret_int(ret_val);
41269        call_tests++;
41270        des_int(n_code, code, 0);
41271        xmlResetLastError();
41272        if (mem_base != xmlMemBlocks()) {
41273            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41274	           xmlMemBlocks() - mem_base);
41275	    test_ret++;
41276            printf(" %d", n_code);
41277            printf("\n");
41278        }
41279    }
41280    function_tests++;
41281#endif
41282
41283    return(test_ret);
41284}
41285
41286
41287static int
41288test_xmlUCSIsMyanmar(void) {
41289    int test_ret = 0;
41290
41291#if defined(LIBXML_UNICODE_ENABLED)
41292    int mem_base;
41293    int ret_val;
41294    int code; /* UCS code point */
41295    int n_code;
41296
41297    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41298        mem_base = xmlMemBlocks();
41299        code = gen_int(n_code, 0);
41300
41301        ret_val = xmlUCSIsMyanmar(code);
41302        desret_int(ret_val);
41303        call_tests++;
41304        des_int(n_code, code, 0);
41305        xmlResetLastError();
41306        if (mem_base != xmlMemBlocks()) {
41307            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41308	           xmlMemBlocks() - mem_base);
41309	    test_ret++;
41310            printf(" %d", n_code);
41311            printf("\n");
41312        }
41313    }
41314    function_tests++;
41315#endif
41316
41317    return(test_ret);
41318}
41319
41320
41321static int
41322test_xmlUCSIsNumberForms(void) {
41323    int test_ret = 0;
41324
41325#if defined(LIBXML_UNICODE_ENABLED)
41326    int mem_base;
41327    int ret_val;
41328    int code; /* UCS code point */
41329    int n_code;
41330
41331    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41332        mem_base = xmlMemBlocks();
41333        code = gen_int(n_code, 0);
41334
41335        ret_val = xmlUCSIsNumberForms(code);
41336        desret_int(ret_val);
41337        call_tests++;
41338        des_int(n_code, code, 0);
41339        xmlResetLastError();
41340        if (mem_base != xmlMemBlocks()) {
41341            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41342	           xmlMemBlocks() - mem_base);
41343	    test_ret++;
41344            printf(" %d", n_code);
41345            printf("\n");
41346        }
41347    }
41348    function_tests++;
41349#endif
41350
41351    return(test_ret);
41352}
41353
41354
41355static int
41356test_xmlUCSIsOgham(void) {
41357    int test_ret = 0;
41358
41359#if defined(LIBXML_UNICODE_ENABLED)
41360    int mem_base;
41361    int ret_val;
41362    int code; /* UCS code point */
41363    int n_code;
41364
41365    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41366        mem_base = xmlMemBlocks();
41367        code = gen_int(n_code, 0);
41368
41369        ret_val = xmlUCSIsOgham(code);
41370        desret_int(ret_val);
41371        call_tests++;
41372        des_int(n_code, code, 0);
41373        xmlResetLastError();
41374        if (mem_base != xmlMemBlocks()) {
41375            printf("Leak of %d blocks found in xmlUCSIsOgham",
41376	           xmlMemBlocks() - mem_base);
41377	    test_ret++;
41378            printf(" %d", n_code);
41379            printf("\n");
41380        }
41381    }
41382    function_tests++;
41383#endif
41384
41385    return(test_ret);
41386}
41387
41388
41389static int
41390test_xmlUCSIsOldItalic(void) {
41391    int test_ret = 0;
41392
41393#if defined(LIBXML_UNICODE_ENABLED)
41394    int mem_base;
41395    int ret_val;
41396    int code; /* UCS code point */
41397    int n_code;
41398
41399    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41400        mem_base = xmlMemBlocks();
41401        code = gen_int(n_code, 0);
41402
41403        ret_val = xmlUCSIsOldItalic(code);
41404        desret_int(ret_val);
41405        call_tests++;
41406        des_int(n_code, code, 0);
41407        xmlResetLastError();
41408        if (mem_base != xmlMemBlocks()) {
41409            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41410	           xmlMemBlocks() - mem_base);
41411	    test_ret++;
41412            printf(" %d", n_code);
41413            printf("\n");
41414        }
41415    }
41416    function_tests++;
41417#endif
41418
41419    return(test_ret);
41420}
41421
41422
41423static int
41424test_xmlUCSIsOpticalCharacterRecognition(void) {
41425    int test_ret = 0;
41426
41427#if defined(LIBXML_UNICODE_ENABLED)
41428    int mem_base;
41429    int ret_val;
41430    int code; /* UCS code point */
41431    int n_code;
41432
41433    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41434        mem_base = xmlMemBlocks();
41435        code = gen_int(n_code, 0);
41436
41437        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41438        desret_int(ret_val);
41439        call_tests++;
41440        des_int(n_code, code, 0);
41441        xmlResetLastError();
41442        if (mem_base != xmlMemBlocks()) {
41443            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41444	           xmlMemBlocks() - mem_base);
41445	    test_ret++;
41446            printf(" %d", n_code);
41447            printf("\n");
41448        }
41449    }
41450    function_tests++;
41451#endif
41452
41453    return(test_ret);
41454}
41455
41456
41457static int
41458test_xmlUCSIsOriya(void) {
41459    int test_ret = 0;
41460
41461#if defined(LIBXML_UNICODE_ENABLED)
41462    int mem_base;
41463    int ret_val;
41464    int code; /* UCS code point */
41465    int n_code;
41466
41467    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41468        mem_base = xmlMemBlocks();
41469        code = gen_int(n_code, 0);
41470
41471        ret_val = xmlUCSIsOriya(code);
41472        desret_int(ret_val);
41473        call_tests++;
41474        des_int(n_code, code, 0);
41475        xmlResetLastError();
41476        if (mem_base != xmlMemBlocks()) {
41477            printf("Leak of %d blocks found in xmlUCSIsOriya",
41478	           xmlMemBlocks() - mem_base);
41479	    test_ret++;
41480            printf(" %d", n_code);
41481            printf("\n");
41482        }
41483    }
41484    function_tests++;
41485#endif
41486
41487    return(test_ret);
41488}
41489
41490
41491static int
41492test_xmlUCSIsOsmanya(void) {
41493    int test_ret = 0;
41494
41495#if defined(LIBXML_UNICODE_ENABLED)
41496    int mem_base;
41497    int ret_val;
41498    int code; /* UCS code point */
41499    int n_code;
41500
41501    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41502        mem_base = xmlMemBlocks();
41503        code = gen_int(n_code, 0);
41504
41505        ret_val = xmlUCSIsOsmanya(code);
41506        desret_int(ret_val);
41507        call_tests++;
41508        des_int(n_code, code, 0);
41509        xmlResetLastError();
41510        if (mem_base != xmlMemBlocks()) {
41511            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41512	           xmlMemBlocks() - mem_base);
41513	    test_ret++;
41514            printf(" %d", n_code);
41515            printf("\n");
41516        }
41517    }
41518    function_tests++;
41519#endif
41520
41521    return(test_ret);
41522}
41523
41524
41525static int
41526test_xmlUCSIsPhoneticExtensions(void) {
41527    int test_ret = 0;
41528
41529#if defined(LIBXML_UNICODE_ENABLED)
41530    int mem_base;
41531    int ret_val;
41532    int code; /* UCS code point */
41533    int n_code;
41534
41535    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41536        mem_base = xmlMemBlocks();
41537        code = gen_int(n_code, 0);
41538
41539        ret_val = xmlUCSIsPhoneticExtensions(code);
41540        desret_int(ret_val);
41541        call_tests++;
41542        des_int(n_code, code, 0);
41543        xmlResetLastError();
41544        if (mem_base != xmlMemBlocks()) {
41545            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41546	           xmlMemBlocks() - mem_base);
41547	    test_ret++;
41548            printf(" %d", n_code);
41549            printf("\n");
41550        }
41551    }
41552    function_tests++;
41553#endif
41554
41555    return(test_ret);
41556}
41557
41558
41559static int
41560test_xmlUCSIsPrivateUse(void) {
41561    int test_ret = 0;
41562
41563#if defined(LIBXML_UNICODE_ENABLED)
41564    int mem_base;
41565    int ret_val;
41566    int code; /* UCS code point */
41567    int n_code;
41568
41569    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41570        mem_base = xmlMemBlocks();
41571        code = gen_int(n_code, 0);
41572
41573        ret_val = xmlUCSIsPrivateUse(code);
41574        desret_int(ret_val);
41575        call_tests++;
41576        des_int(n_code, code, 0);
41577        xmlResetLastError();
41578        if (mem_base != xmlMemBlocks()) {
41579            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41580	           xmlMemBlocks() - mem_base);
41581	    test_ret++;
41582            printf(" %d", n_code);
41583            printf("\n");
41584        }
41585    }
41586    function_tests++;
41587#endif
41588
41589    return(test_ret);
41590}
41591
41592
41593static int
41594test_xmlUCSIsPrivateUseArea(void) {
41595    int test_ret = 0;
41596
41597#if defined(LIBXML_UNICODE_ENABLED)
41598    int mem_base;
41599    int ret_val;
41600    int code; /* UCS code point */
41601    int n_code;
41602
41603    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41604        mem_base = xmlMemBlocks();
41605        code = gen_int(n_code, 0);
41606
41607        ret_val = xmlUCSIsPrivateUseArea(code);
41608        desret_int(ret_val);
41609        call_tests++;
41610        des_int(n_code, code, 0);
41611        xmlResetLastError();
41612        if (mem_base != xmlMemBlocks()) {
41613            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41614	           xmlMemBlocks() - mem_base);
41615	    test_ret++;
41616            printf(" %d", n_code);
41617            printf("\n");
41618        }
41619    }
41620    function_tests++;
41621#endif
41622
41623    return(test_ret);
41624}
41625
41626
41627static int
41628test_xmlUCSIsRunic(void) {
41629    int test_ret = 0;
41630
41631#if defined(LIBXML_UNICODE_ENABLED)
41632    int mem_base;
41633    int ret_val;
41634    int code; /* UCS code point */
41635    int n_code;
41636
41637    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41638        mem_base = xmlMemBlocks();
41639        code = gen_int(n_code, 0);
41640
41641        ret_val = xmlUCSIsRunic(code);
41642        desret_int(ret_val);
41643        call_tests++;
41644        des_int(n_code, code, 0);
41645        xmlResetLastError();
41646        if (mem_base != xmlMemBlocks()) {
41647            printf("Leak of %d blocks found in xmlUCSIsRunic",
41648	           xmlMemBlocks() - mem_base);
41649	    test_ret++;
41650            printf(" %d", n_code);
41651            printf("\n");
41652        }
41653    }
41654    function_tests++;
41655#endif
41656
41657    return(test_ret);
41658}
41659
41660
41661static int
41662test_xmlUCSIsShavian(void) {
41663    int test_ret = 0;
41664
41665#if defined(LIBXML_UNICODE_ENABLED)
41666    int mem_base;
41667    int ret_val;
41668    int code; /* UCS code point */
41669    int n_code;
41670
41671    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41672        mem_base = xmlMemBlocks();
41673        code = gen_int(n_code, 0);
41674
41675        ret_val = xmlUCSIsShavian(code);
41676        desret_int(ret_val);
41677        call_tests++;
41678        des_int(n_code, code, 0);
41679        xmlResetLastError();
41680        if (mem_base != xmlMemBlocks()) {
41681            printf("Leak of %d blocks found in xmlUCSIsShavian",
41682	           xmlMemBlocks() - mem_base);
41683	    test_ret++;
41684            printf(" %d", n_code);
41685            printf("\n");
41686        }
41687    }
41688    function_tests++;
41689#endif
41690
41691    return(test_ret);
41692}
41693
41694
41695static int
41696test_xmlUCSIsSinhala(void) {
41697    int test_ret = 0;
41698
41699#if defined(LIBXML_UNICODE_ENABLED)
41700    int mem_base;
41701    int ret_val;
41702    int code; /* UCS code point */
41703    int n_code;
41704
41705    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41706        mem_base = xmlMemBlocks();
41707        code = gen_int(n_code, 0);
41708
41709        ret_val = xmlUCSIsSinhala(code);
41710        desret_int(ret_val);
41711        call_tests++;
41712        des_int(n_code, code, 0);
41713        xmlResetLastError();
41714        if (mem_base != xmlMemBlocks()) {
41715            printf("Leak of %d blocks found in xmlUCSIsSinhala",
41716	           xmlMemBlocks() - mem_base);
41717	    test_ret++;
41718            printf(" %d", n_code);
41719            printf("\n");
41720        }
41721    }
41722    function_tests++;
41723#endif
41724
41725    return(test_ret);
41726}
41727
41728
41729static int
41730test_xmlUCSIsSmallFormVariants(void) {
41731    int test_ret = 0;
41732
41733#if defined(LIBXML_UNICODE_ENABLED)
41734    int mem_base;
41735    int ret_val;
41736    int code; /* UCS code point */
41737    int n_code;
41738
41739    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41740        mem_base = xmlMemBlocks();
41741        code = gen_int(n_code, 0);
41742
41743        ret_val = xmlUCSIsSmallFormVariants(code);
41744        desret_int(ret_val);
41745        call_tests++;
41746        des_int(n_code, code, 0);
41747        xmlResetLastError();
41748        if (mem_base != xmlMemBlocks()) {
41749            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41750	           xmlMemBlocks() - mem_base);
41751	    test_ret++;
41752            printf(" %d", n_code);
41753            printf("\n");
41754        }
41755    }
41756    function_tests++;
41757#endif
41758
41759    return(test_ret);
41760}
41761
41762
41763static int
41764test_xmlUCSIsSpacingModifierLetters(void) {
41765    int test_ret = 0;
41766
41767#if defined(LIBXML_UNICODE_ENABLED)
41768    int mem_base;
41769    int ret_val;
41770    int code; /* UCS code point */
41771    int n_code;
41772
41773    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41774        mem_base = xmlMemBlocks();
41775        code = gen_int(n_code, 0);
41776
41777        ret_val = xmlUCSIsSpacingModifierLetters(code);
41778        desret_int(ret_val);
41779        call_tests++;
41780        des_int(n_code, code, 0);
41781        xmlResetLastError();
41782        if (mem_base != xmlMemBlocks()) {
41783            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41784	           xmlMemBlocks() - mem_base);
41785	    test_ret++;
41786            printf(" %d", n_code);
41787            printf("\n");
41788        }
41789    }
41790    function_tests++;
41791#endif
41792
41793    return(test_ret);
41794}
41795
41796
41797static int
41798test_xmlUCSIsSpecials(void) {
41799    int test_ret = 0;
41800
41801#if defined(LIBXML_UNICODE_ENABLED)
41802    int mem_base;
41803    int ret_val;
41804    int code; /* UCS code point */
41805    int n_code;
41806
41807    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41808        mem_base = xmlMemBlocks();
41809        code = gen_int(n_code, 0);
41810
41811        ret_val = xmlUCSIsSpecials(code);
41812        desret_int(ret_val);
41813        call_tests++;
41814        des_int(n_code, code, 0);
41815        xmlResetLastError();
41816        if (mem_base != xmlMemBlocks()) {
41817            printf("Leak of %d blocks found in xmlUCSIsSpecials",
41818	           xmlMemBlocks() - mem_base);
41819	    test_ret++;
41820            printf(" %d", n_code);
41821            printf("\n");
41822        }
41823    }
41824    function_tests++;
41825#endif
41826
41827    return(test_ret);
41828}
41829
41830
41831static int
41832test_xmlUCSIsSuperscriptsandSubscripts(void) {
41833    int test_ret = 0;
41834
41835#if defined(LIBXML_UNICODE_ENABLED)
41836    int mem_base;
41837    int ret_val;
41838    int code; /* UCS code point */
41839    int n_code;
41840
41841    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41842        mem_base = xmlMemBlocks();
41843        code = gen_int(n_code, 0);
41844
41845        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41846        desret_int(ret_val);
41847        call_tests++;
41848        des_int(n_code, code, 0);
41849        xmlResetLastError();
41850        if (mem_base != xmlMemBlocks()) {
41851            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41852	           xmlMemBlocks() - mem_base);
41853	    test_ret++;
41854            printf(" %d", n_code);
41855            printf("\n");
41856        }
41857    }
41858    function_tests++;
41859#endif
41860
41861    return(test_ret);
41862}
41863
41864
41865static int
41866test_xmlUCSIsSupplementalArrowsA(void) {
41867    int test_ret = 0;
41868
41869#if defined(LIBXML_UNICODE_ENABLED)
41870    int mem_base;
41871    int ret_val;
41872    int code; /* UCS code point */
41873    int n_code;
41874
41875    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41876        mem_base = xmlMemBlocks();
41877        code = gen_int(n_code, 0);
41878
41879        ret_val = xmlUCSIsSupplementalArrowsA(code);
41880        desret_int(ret_val);
41881        call_tests++;
41882        des_int(n_code, code, 0);
41883        xmlResetLastError();
41884        if (mem_base != xmlMemBlocks()) {
41885            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41886	           xmlMemBlocks() - mem_base);
41887	    test_ret++;
41888            printf(" %d", n_code);
41889            printf("\n");
41890        }
41891    }
41892    function_tests++;
41893#endif
41894
41895    return(test_ret);
41896}
41897
41898
41899static int
41900test_xmlUCSIsSupplementalArrowsB(void) {
41901    int test_ret = 0;
41902
41903#if defined(LIBXML_UNICODE_ENABLED)
41904    int mem_base;
41905    int ret_val;
41906    int code; /* UCS code point */
41907    int n_code;
41908
41909    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41910        mem_base = xmlMemBlocks();
41911        code = gen_int(n_code, 0);
41912
41913        ret_val = xmlUCSIsSupplementalArrowsB(code);
41914        desret_int(ret_val);
41915        call_tests++;
41916        des_int(n_code, code, 0);
41917        xmlResetLastError();
41918        if (mem_base != xmlMemBlocks()) {
41919            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41920	           xmlMemBlocks() - mem_base);
41921	    test_ret++;
41922            printf(" %d", n_code);
41923            printf("\n");
41924        }
41925    }
41926    function_tests++;
41927#endif
41928
41929    return(test_ret);
41930}
41931
41932
41933static int
41934test_xmlUCSIsSupplementalMathematicalOperators(void) {
41935    int test_ret = 0;
41936
41937#if defined(LIBXML_UNICODE_ENABLED)
41938    int mem_base;
41939    int ret_val;
41940    int code; /* UCS code point */
41941    int n_code;
41942
41943    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41944        mem_base = xmlMemBlocks();
41945        code = gen_int(n_code, 0);
41946
41947        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41948        desret_int(ret_val);
41949        call_tests++;
41950        des_int(n_code, code, 0);
41951        xmlResetLastError();
41952        if (mem_base != xmlMemBlocks()) {
41953            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41954	           xmlMemBlocks() - mem_base);
41955	    test_ret++;
41956            printf(" %d", n_code);
41957            printf("\n");
41958        }
41959    }
41960    function_tests++;
41961#endif
41962
41963    return(test_ret);
41964}
41965
41966
41967static int
41968test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41969    int test_ret = 0;
41970
41971#if defined(LIBXML_UNICODE_ENABLED)
41972    int mem_base;
41973    int ret_val;
41974    int code; /* UCS code point */
41975    int n_code;
41976
41977    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41978        mem_base = xmlMemBlocks();
41979        code = gen_int(n_code, 0);
41980
41981        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41982        desret_int(ret_val);
41983        call_tests++;
41984        des_int(n_code, code, 0);
41985        xmlResetLastError();
41986        if (mem_base != xmlMemBlocks()) {
41987            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41988	           xmlMemBlocks() - mem_base);
41989	    test_ret++;
41990            printf(" %d", n_code);
41991            printf("\n");
41992        }
41993    }
41994    function_tests++;
41995#endif
41996
41997    return(test_ret);
41998}
41999
42000
42001static int
42002test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
42003    int test_ret = 0;
42004
42005#if defined(LIBXML_UNICODE_ENABLED)
42006    int mem_base;
42007    int ret_val;
42008    int code; /* UCS code point */
42009    int n_code;
42010
42011    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42012        mem_base = xmlMemBlocks();
42013        code = gen_int(n_code, 0);
42014
42015        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
42016        desret_int(ret_val);
42017        call_tests++;
42018        des_int(n_code, code, 0);
42019        xmlResetLastError();
42020        if (mem_base != xmlMemBlocks()) {
42021            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
42022	           xmlMemBlocks() - mem_base);
42023	    test_ret++;
42024            printf(" %d", n_code);
42025            printf("\n");
42026        }
42027    }
42028    function_tests++;
42029#endif
42030
42031    return(test_ret);
42032}
42033
42034
42035static int
42036test_xmlUCSIsSyriac(void) {
42037    int test_ret = 0;
42038
42039#if defined(LIBXML_UNICODE_ENABLED)
42040    int mem_base;
42041    int ret_val;
42042    int code; /* UCS code point */
42043    int n_code;
42044
42045    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42046        mem_base = xmlMemBlocks();
42047        code = gen_int(n_code, 0);
42048
42049        ret_val = xmlUCSIsSyriac(code);
42050        desret_int(ret_val);
42051        call_tests++;
42052        des_int(n_code, code, 0);
42053        xmlResetLastError();
42054        if (mem_base != xmlMemBlocks()) {
42055            printf("Leak of %d blocks found in xmlUCSIsSyriac",
42056	           xmlMemBlocks() - mem_base);
42057	    test_ret++;
42058            printf(" %d", n_code);
42059            printf("\n");
42060        }
42061    }
42062    function_tests++;
42063#endif
42064
42065    return(test_ret);
42066}
42067
42068
42069static int
42070test_xmlUCSIsTagalog(void) {
42071    int test_ret = 0;
42072
42073#if defined(LIBXML_UNICODE_ENABLED)
42074    int mem_base;
42075    int ret_val;
42076    int code; /* UCS code point */
42077    int n_code;
42078
42079    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42080        mem_base = xmlMemBlocks();
42081        code = gen_int(n_code, 0);
42082
42083        ret_val = xmlUCSIsTagalog(code);
42084        desret_int(ret_val);
42085        call_tests++;
42086        des_int(n_code, code, 0);
42087        xmlResetLastError();
42088        if (mem_base != xmlMemBlocks()) {
42089            printf("Leak of %d blocks found in xmlUCSIsTagalog",
42090	           xmlMemBlocks() - mem_base);
42091	    test_ret++;
42092            printf(" %d", n_code);
42093            printf("\n");
42094        }
42095    }
42096    function_tests++;
42097#endif
42098
42099    return(test_ret);
42100}
42101
42102
42103static int
42104test_xmlUCSIsTagbanwa(void) {
42105    int test_ret = 0;
42106
42107#if defined(LIBXML_UNICODE_ENABLED)
42108    int mem_base;
42109    int ret_val;
42110    int code; /* UCS code point */
42111    int n_code;
42112
42113    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42114        mem_base = xmlMemBlocks();
42115        code = gen_int(n_code, 0);
42116
42117        ret_val = xmlUCSIsTagbanwa(code);
42118        desret_int(ret_val);
42119        call_tests++;
42120        des_int(n_code, code, 0);
42121        xmlResetLastError();
42122        if (mem_base != xmlMemBlocks()) {
42123            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
42124	           xmlMemBlocks() - mem_base);
42125	    test_ret++;
42126            printf(" %d", n_code);
42127            printf("\n");
42128        }
42129    }
42130    function_tests++;
42131#endif
42132
42133    return(test_ret);
42134}
42135
42136
42137static int
42138test_xmlUCSIsTags(void) {
42139    int test_ret = 0;
42140
42141#if defined(LIBXML_UNICODE_ENABLED)
42142    int mem_base;
42143    int ret_val;
42144    int code; /* UCS code point */
42145    int n_code;
42146
42147    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42148        mem_base = xmlMemBlocks();
42149        code = gen_int(n_code, 0);
42150
42151        ret_val = xmlUCSIsTags(code);
42152        desret_int(ret_val);
42153        call_tests++;
42154        des_int(n_code, code, 0);
42155        xmlResetLastError();
42156        if (mem_base != xmlMemBlocks()) {
42157            printf("Leak of %d blocks found in xmlUCSIsTags",
42158	           xmlMemBlocks() - mem_base);
42159	    test_ret++;
42160            printf(" %d", n_code);
42161            printf("\n");
42162        }
42163    }
42164    function_tests++;
42165#endif
42166
42167    return(test_ret);
42168}
42169
42170
42171static int
42172test_xmlUCSIsTaiLe(void) {
42173    int test_ret = 0;
42174
42175#if defined(LIBXML_UNICODE_ENABLED)
42176    int mem_base;
42177    int ret_val;
42178    int code; /* UCS code point */
42179    int n_code;
42180
42181    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42182        mem_base = xmlMemBlocks();
42183        code = gen_int(n_code, 0);
42184
42185        ret_val = xmlUCSIsTaiLe(code);
42186        desret_int(ret_val);
42187        call_tests++;
42188        des_int(n_code, code, 0);
42189        xmlResetLastError();
42190        if (mem_base != xmlMemBlocks()) {
42191            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
42192	           xmlMemBlocks() - mem_base);
42193	    test_ret++;
42194            printf(" %d", n_code);
42195            printf("\n");
42196        }
42197    }
42198    function_tests++;
42199#endif
42200
42201    return(test_ret);
42202}
42203
42204
42205static int
42206test_xmlUCSIsTaiXuanJingSymbols(void) {
42207    int test_ret = 0;
42208
42209#if defined(LIBXML_UNICODE_ENABLED)
42210    int mem_base;
42211    int ret_val;
42212    int code; /* UCS code point */
42213    int n_code;
42214
42215    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42216        mem_base = xmlMemBlocks();
42217        code = gen_int(n_code, 0);
42218
42219        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
42220        desret_int(ret_val);
42221        call_tests++;
42222        des_int(n_code, code, 0);
42223        xmlResetLastError();
42224        if (mem_base != xmlMemBlocks()) {
42225            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42226	           xmlMemBlocks() - mem_base);
42227	    test_ret++;
42228            printf(" %d", n_code);
42229            printf("\n");
42230        }
42231    }
42232    function_tests++;
42233#endif
42234
42235    return(test_ret);
42236}
42237
42238
42239static int
42240test_xmlUCSIsTamil(void) {
42241    int test_ret = 0;
42242
42243#if defined(LIBXML_UNICODE_ENABLED)
42244    int mem_base;
42245    int ret_val;
42246    int code; /* UCS code point */
42247    int n_code;
42248
42249    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42250        mem_base = xmlMemBlocks();
42251        code = gen_int(n_code, 0);
42252
42253        ret_val = xmlUCSIsTamil(code);
42254        desret_int(ret_val);
42255        call_tests++;
42256        des_int(n_code, code, 0);
42257        xmlResetLastError();
42258        if (mem_base != xmlMemBlocks()) {
42259            printf("Leak of %d blocks found in xmlUCSIsTamil",
42260	           xmlMemBlocks() - mem_base);
42261	    test_ret++;
42262            printf(" %d", n_code);
42263            printf("\n");
42264        }
42265    }
42266    function_tests++;
42267#endif
42268
42269    return(test_ret);
42270}
42271
42272
42273static int
42274test_xmlUCSIsTelugu(void) {
42275    int test_ret = 0;
42276
42277#if defined(LIBXML_UNICODE_ENABLED)
42278    int mem_base;
42279    int ret_val;
42280    int code; /* UCS code point */
42281    int n_code;
42282
42283    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42284        mem_base = xmlMemBlocks();
42285        code = gen_int(n_code, 0);
42286
42287        ret_val = xmlUCSIsTelugu(code);
42288        desret_int(ret_val);
42289        call_tests++;
42290        des_int(n_code, code, 0);
42291        xmlResetLastError();
42292        if (mem_base != xmlMemBlocks()) {
42293            printf("Leak of %d blocks found in xmlUCSIsTelugu",
42294	           xmlMemBlocks() - mem_base);
42295	    test_ret++;
42296            printf(" %d", n_code);
42297            printf("\n");
42298        }
42299    }
42300    function_tests++;
42301#endif
42302
42303    return(test_ret);
42304}
42305
42306
42307static int
42308test_xmlUCSIsThaana(void) {
42309    int test_ret = 0;
42310
42311#if defined(LIBXML_UNICODE_ENABLED)
42312    int mem_base;
42313    int ret_val;
42314    int code; /* UCS code point */
42315    int n_code;
42316
42317    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42318        mem_base = xmlMemBlocks();
42319        code = gen_int(n_code, 0);
42320
42321        ret_val = xmlUCSIsThaana(code);
42322        desret_int(ret_val);
42323        call_tests++;
42324        des_int(n_code, code, 0);
42325        xmlResetLastError();
42326        if (mem_base != xmlMemBlocks()) {
42327            printf("Leak of %d blocks found in xmlUCSIsThaana",
42328	           xmlMemBlocks() - mem_base);
42329	    test_ret++;
42330            printf(" %d", n_code);
42331            printf("\n");
42332        }
42333    }
42334    function_tests++;
42335#endif
42336
42337    return(test_ret);
42338}
42339
42340
42341static int
42342test_xmlUCSIsThai(void) {
42343    int test_ret = 0;
42344
42345#if defined(LIBXML_UNICODE_ENABLED)
42346    int mem_base;
42347    int ret_val;
42348    int code; /* UCS code point */
42349    int n_code;
42350
42351    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42352        mem_base = xmlMemBlocks();
42353        code = gen_int(n_code, 0);
42354
42355        ret_val = xmlUCSIsThai(code);
42356        desret_int(ret_val);
42357        call_tests++;
42358        des_int(n_code, code, 0);
42359        xmlResetLastError();
42360        if (mem_base != xmlMemBlocks()) {
42361            printf("Leak of %d blocks found in xmlUCSIsThai",
42362	           xmlMemBlocks() - mem_base);
42363	    test_ret++;
42364            printf(" %d", n_code);
42365            printf("\n");
42366        }
42367    }
42368    function_tests++;
42369#endif
42370
42371    return(test_ret);
42372}
42373
42374
42375static int
42376test_xmlUCSIsTibetan(void) {
42377    int test_ret = 0;
42378
42379#if defined(LIBXML_UNICODE_ENABLED)
42380    int mem_base;
42381    int ret_val;
42382    int code; /* UCS code point */
42383    int n_code;
42384
42385    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42386        mem_base = xmlMemBlocks();
42387        code = gen_int(n_code, 0);
42388
42389        ret_val = xmlUCSIsTibetan(code);
42390        desret_int(ret_val);
42391        call_tests++;
42392        des_int(n_code, code, 0);
42393        xmlResetLastError();
42394        if (mem_base != xmlMemBlocks()) {
42395            printf("Leak of %d blocks found in xmlUCSIsTibetan",
42396	           xmlMemBlocks() - mem_base);
42397	    test_ret++;
42398            printf(" %d", n_code);
42399            printf("\n");
42400        }
42401    }
42402    function_tests++;
42403#endif
42404
42405    return(test_ret);
42406}
42407
42408
42409static int
42410test_xmlUCSIsUgaritic(void) {
42411    int test_ret = 0;
42412
42413#if defined(LIBXML_UNICODE_ENABLED)
42414    int mem_base;
42415    int ret_val;
42416    int code; /* UCS code point */
42417    int n_code;
42418
42419    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42420        mem_base = xmlMemBlocks();
42421        code = gen_int(n_code, 0);
42422
42423        ret_val = xmlUCSIsUgaritic(code);
42424        desret_int(ret_val);
42425        call_tests++;
42426        des_int(n_code, code, 0);
42427        xmlResetLastError();
42428        if (mem_base != xmlMemBlocks()) {
42429            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42430	           xmlMemBlocks() - mem_base);
42431	    test_ret++;
42432            printf(" %d", n_code);
42433            printf("\n");
42434        }
42435    }
42436    function_tests++;
42437#endif
42438
42439    return(test_ret);
42440}
42441
42442
42443static int
42444test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42445    int test_ret = 0;
42446
42447#if defined(LIBXML_UNICODE_ENABLED)
42448    int mem_base;
42449    int ret_val;
42450    int code; /* UCS code point */
42451    int n_code;
42452
42453    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42454        mem_base = xmlMemBlocks();
42455        code = gen_int(n_code, 0);
42456
42457        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42458        desret_int(ret_val);
42459        call_tests++;
42460        des_int(n_code, code, 0);
42461        xmlResetLastError();
42462        if (mem_base != xmlMemBlocks()) {
42463            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42464	           xmlMemBlocks() - mem_base);
42465	    test_ret++;
42466            printf(" %d", n_code);
42467            printf("\n");
42468        }
42469    }
42470    function_tests++;
42471#endif
42472
42473    return(test_ret);
42474}
42475
42476
42477static int
42478test_xmlUCSIsVariationSelectors(void) {
42479    int test_ret = 0;
42480
42481#if defined(LIBXML_UNICODE_ENABLED)
42482    int mem_base;
42483    int ret_val;
42484    int code; /* UCS code point */
42485    int n_code;
42486
42487    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42488        mem_base = xmlMemBlocks();
42489        code = gen_int(n_code, 0);
42490
42491        ret_val = xmlUCSIsVariationSelectors(code);
42492        desret_int(ret_val);
42493        call_tests++;
42494        des_int(n_code, code, 0);
42495        xmlResetLastError();
42496        if (mem_base != xmlMemBlocks()) {
42497            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42498	           xmlMemBlocks() - mem_base);
42499	    test_ret++;
42500            printf(" %d", n_code);
42501            printf("\n");
42502        }
42503    }
42504    function_tests++;
42505#endif
42506
42507    return(test_ret);
42508}
42509
42510
42511static int
42512test_xmlUCSIsVariationSelectorsSupplement(void) {
42513    int test_ret = 0;
42514
42515#if defined(LIBXML_UNICODE_ENABLED)
42516    int mem_base;
42517    int ret_val;
42518    int code; /* UCS code point */
42519    int n_code;
42520
42521    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42522        mem_base = xmlMemBlocks();
42523        code = gen_int(n_code, 0);
42524
42525        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42526        desret_int(ret_val);
42527        call_tests++;
42528        des_int(n_code, code, 0);
42529        xmlResetLastError();
42530        if (mem_base != xmlMemBlocks()) {
42531            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42532	           xmlMemBlocks() - mem_base);
42533	    test_ret++;
42534            printf(" %d", n_code);
42535            printf("\n");
42536        }
42537    }
42538    function_tests++;
42539#endif
42540
42541    return(test_ret);
42542}
42543
42544
42545static int
42546test_xmlUCSIsYiRadicals(void) {
42547    int test_ret = 0;
42548
42549#if defined(LIBXML_UNICODE_ENABLED)
42550    int mem_base;
42551    int ret_val;
42552    int code; /* UCS code point */
42553    int n_code;
42554
42555    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42556        mem_base = xmlMemBlocks();
42557        code = gen_int(n_code, 0);
42558
42559        ret_val = xmlUCSIsYiRadicals(code);
42560        desret_int(ret_val);
42561        call_tests++;
42562        des_int(n_code, code, 0);
42563        xmlResetLastError();
42564        if (mem_base != xmlMemBlocks()) {
42565            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42566	           xmlMemBlocks() - mem_base);
42567	    test_ret++;
42568            printf(" %d", n_code);
42569            printf("\n");
42570        }
42571    }
42572    function_tests++;
42573#endif
42574
42575    return(test_ret);
42576}
42577
42578
42579static int
42580test_xmlUCSIsYiSyllables(void) {
42581    int test_ret = 0;
42582
42583#if defined(LIBXML_UNICODE_ENABLED)
42584    int mem_base;
42585    int ret_val;
42586    int code; /* UCS code point */
42587    int n_code;
42588
42589    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42590        mem_base = xmlMemBlocks();
42591        code = gen_int(n_code, 0);
42592
42593        ret_val = xmlUCSIsYiSyllables(code);
42594        desret_int(ret_val);
42595        call_tests++;
42596        des_int(n_code, code, 0);
42597        xmlResetLastError();
42598        if (mem_base != xmlMemBlocks()) {
42599            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42600	           xmlMemBlocks() - mem_base);
42601	    test_ret++;
42602            printf(" %d", n_code);
42603            printf("\n");
42604        }
42605    }
42606    function_tests++;
42607#endif
42608
42609    return(test_ret);
42610}
42611
42612
42613static int
42614test_xmlUCSIsYijingHexagramSymbols(void) {
42615    int test_ret = 0;
42616
42617#if defined(LIBXML_UNICODE_ENABLED)
42618    int mem_base;
42619    int ret_val;
42620    int code; /* UCS code point */
42621    int n_code;
42622
42623    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42624        mem_base = xmlMemBlocks();
42625        code = gen_int(n_code, 0);
42626
42627        ret_val = xmlUCSIsYijingHexagramSymbols(code);
42628        desret_int(ret_val);
42629        call_tests++;
42630        des_int(n_code, code, 0);
42631        xmlResetLastError();
42632        if (mem_base != xmlMemBlocks()) {
42633            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42634	           xmlMemBlocks() - mem_base);
42635	    test_ret++;
42636            printf(" %d", n_code);
42637            printf("\n");
42638        }
42639    }
42640    function_tests++;
42641#endif
42642
42643    return(test_ret);
42644}
42645
42646static int
42647test_xmlunicode(void) {
42648    int test_ret = 0;
42649
42650    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42651    test_ret += test_xmlUCSIsAegeanNumbers();
42652    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42653    test_ret += test_xmlUCSIsArabic();
42654    test_ret += test_xmlUCSIsArabicPresentationFormsA();
42655    test_ret += test_xmlUCSIsArabicPresentationFormsB();
42656    test_ret += test_xmlUCSIsArmenian();
42657    test_ret += test_xmlUCSIsArrows();
42658    test_ret += test_xmlUCSIsBasicLatin();
42659    test_ret += test_xmlUCSIsBengali();
42660    test_ret += test_xmlUCSIsBlock();
42661    test_ret += test_xmlUCSIsBlockElements();
42662    test_ret += test_xmlUCSIsBopomofo();
42663    test_ret += test_xmlUCSIsBopomofoExtended();
42664    test_ret += test_xmlUCSIsBoxDrawing();
42665    test_ret += test_xmlUCSIsBraillePatterns();
42666    test_ret += test_xmlUCSIsBuhid();
42667    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42668    test_ret += test_xmlUCSIsCJKCompatibility();
42669    test_ret += test_xmlUCSIsCJKCompatibilityForms();
42670    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42671    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42672    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42673    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42674    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42675    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42676    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42677    test_ret += test_xmlUCSIsCat();
42678    test_ret += test_xmlUCSIsCatC();
42679    test_ret += test_xmlUCSIsCatCc();
42680    test_ret += test_xmlUCSIsCatCf();
42681    test_ret += test_xmlUCSIsCatCo();
42682    test_ret += test_xmlUCSIsCatCs();
42683    test_ret += test_xmlUCSIsCatL();
42684    test_ret += test_xmlUCSIsCatLl();
42685    test_ret += test_xmlUCSIsCatLm();
42686    test_ret += test_xmlUCSIsCatLo();
42687    test_ret += test_xmlUCSIsCatLt();
42688    test_ret += test_xmlUCSIsCatLu();
42689    test_ret += test_xmlUCSIsCatM();
42690    test_ret += test_xmlUCSIsCatMc();
42691    test_ret += test_xmlUCSIsCatMe();
42692    test_ret += test_xmlUCSIsCatMn();
42693    test_ret += test_xmlUCSIsCatN();
42694    test_ret += test_xmlUCSIsCatNd();
42695    test_ret += test_xmlUCSIsCatNl();
42696    test_ret += test_xmlUCSIsCatNo();
42697    test_ret += test_xmlUCSIsCatP();
42698    test_ret += test_xmlUCSIsCatPc();
42699    test_ret += test_xmlUCSIsCatPd();
42700    test_ret += test_xmlUCSIsCatPe();
42701    test_ret += test_xmlUCSIsCatPf();
42702    test_ret += test_xmlUCSIsCatPi();
42703    test_ret += test_xmlUCSIsCatPo();
42704    test_ret += test_xmlUCSIsCatPs();
42705    test_ret += test_xmlUCSIsCatS();
42706    test_ret += test_xmlUCSIsCatSc();
42707    test_ret += test_xmlUCSIsCatSk();
42708    test_ret += test_xmlUCSIsCatSm();
42709    test_ret += test_xmlUCSIsCatSo();
42710    test_ret += test_xmlUCSIsCatZ();
42711    test_ret += test_xmlUCSIsCatZl();
42712    test_ret += test_xmlUCSIsCatZp();
42713    test_ret += test_xmlUCSIsCatZs();
42714    test_ret += test_xmlUCSIsCherokee();
42715    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42716    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42717    test_ret += test_xmlUCSIsCombiningHalfMarks();
42718    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42719    test_ret += test_xmlUCSIsControlPictures();
42720    test_ret += test_xmlUCSIsCurrencySymbols();
42721    test_ret += test_xmlUCSIsCypriotSyllabary();
42722    test_ret += test_xmlUCSIsCyrillic();
42723    test_ret += test_xmlUCSIsCyrillicSupplement();
42724    test_ret += test_xmlUCSIsDeseret();
42725    test_ret += test_xmlUCSIsDevanagari();
42726    test_ret += test_xmlUCSIsDingbats();
42727    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42728    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42729    test_ret += test_xmlUCSIsEthiopic();
42730    test_ret += test_xmlUCSIsGeneralPunctuation();
42731    test_ret += test_xmlUCSIsGeometricShapes();
42732    test_ret += test_xmlUCSIsGeorgian();
42733    test_ret += test_xmlUCSIsGothic();
42734    test_ret += test_xmlUCSIsGreek();
42735    test_ret += test_xmlUCSIsGreekExtended();
42736    test_ret += test_xmlUCSIsGreekandCoptic();
42737    test_ret += test_xmlUCSIsGujarati();
42738    test_ret += test_xmlUCSIsGurmukhi();
42739    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42740    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42741    test_ret += test_xmlUCSIsHangulJamo();
42742    test_ret += test_xmlUCSIsHangulSyllables();
42743    test_ret += test_xmlUCSIsHanunoo();
42744    test_ret += test_xmlUCSIsHebrew();
42745    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42746    test_ret += test_xmlUCSIsHighSurrogates();
42747    test_ret += test_xmlUCSIsHiragana();
42748    test_ret += test_xmlUCSIsIPAExtensions();
42749    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42750    test_ret += test_xmlUCSIsKanbun();
42751    test_ret += test_xmlUCSIsKangxiRadicals();
42752    test_ret += test_xmlUCSIsKannada();
42753    test_ret += test_xmlUCSIsKatakana();
42754    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42755    test_ret += test_xmlUCSIsKhmer();
42756    test_ret += test_xmlUCSIsKhmerSymbols();
42757    test_ret += test_xmlUCSIsLao();
42758    test_ret += test_xmlUCSIsLatin1Supplement();
42759    test_ret += test_xmlUCSIsLatinExtendedA();
42760    test_ret += test_xmlUCSIsLatinExtendedAdditional();
42761    test_ret += test_xmlUCSIsLatinExtendedB();
42762    test_ret += test_xmlUCSIsLetterlikeSymbols();
42763    test_ret += test_xmlUCSIsLimbu();
42764    test_ret += test_xmlUCSIsLinearBIdeograms();
42765    test_ret += test_xmlUCSIsLinearBSyllabary();
42766    test_ret += test_xmlUCSIsLowSurrogates();
42767    test_ret += test_xmlUCSIsMalayalam();
42768    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42769    test_ret += test_xmlUCSIsMathematicalOperators();
42770    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42771    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42772    test_ret += test_xmlUCSIsMiscellaneousSymbols();
42773    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42774    test_ret += test_xmlUCSIsMiscellaneousTechnical();
42775    test_ret += test_xmlUCSIsMongolian();
42776    test_ret += test_xmlUCSIsMusicalSymbols();
42777    test_ret += test_xmlUCSIsMyanmar();
42778    test_ret += test_xmlUCSIsNumberForms();
42779    test_ret += test_xmlUCSIsOgham();
42780    test_ret += test_xmlUCSIsOldItalic();
42781    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42782    test_ret += test_xmlUCSIsOriya();
42783    test_ret += test_xmlUCSIsOsmanya();
42784    test_ret += test_xmlUCSIsPhoneticExtensions();
42785    test_ret += test_xmlUCSIsPrivateUse();
42786    test_ret += test_xmlUCSIsPrivateUseArea();
42787    test_ret += test_xmlUCSIsRunic();
42788    test_ret += test_xmlUCSIsShavian();
42789    test_ret += test_xmlUCSIsSinhala();
42790    test_ret += test_xmlUCSIsSmallFormVariants();
42791    test_ret += test_xmlUCSIsSpacingModifierLetters();
42792    test_ret += test_xmlUCSIsSpecials();
42793    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42794    test_ret += test_xmlUCSIsSupplementalArrowsA();
42795    test_ret += test_xmlUCSIsSupplementalArrowsB();
42796    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42797    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42798    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42799    test_ret += test_xmlUCSIsSyriac();
42800    test_ret += test_xmlUCSIsTagalog();
42801    test_ret += test_xmlUCSIsTagbanwa();
42802    test_ret += test_xmlUCSIsTags();
42803    test_ret += test_xmlUCSIsTaiLe();
42804    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42805    test_ret += test_xmlUCSIsTamil();
42806    test_ret += test_xmlUCSIsTelugu();
42807    test_ret += test_xmlUCSIsThaana();
42808    test_ret += test_xmlUCSIsThai();
42809    test_ret += test_xmlUCSIsTibetan();
42810    test_ret += test_xmlUCSIsUgaritic();
42811    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42812    test_ret += test_xmlUCSIsVariationSelectors();
42813    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42814    test_ret += test_xmlUCSIsYiRadicals();
42815    test_ret += test_xmlUCSIsYiSyllables();
42816    test_ret += test_xmlUCSIsYijingHexagramSymbols();
42817
42818    if (test_ret != 0)
42819	printf("Module xmlunicode: %d errors\n", test_ret);
42820    return(test_ret);
42821}
42822
42823static int
42824test_xmlNewTextWriter(void) {
42825    int test_ret = 0;
42826
42827#if defined(LIBXML_WRITER_ENABLED)
42828    int mem_base;
42829    xmlTextWriterPtr ret_val;
42830    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42831    int n_out;
42832
42833    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42834        mem_base = xmlMemBlocks();
42835        out = gen_xmlOutputBufferPtr(n_out, 0);
42836
42837        ret_val = xmlNewTextWriter(out);
42838        if (ret_val != NULL) out = NULL;
42839        desret_xmlTextWriterPtr(ret_val);
42840        call_tests++;
42841        des_xmlOutputBufferPtr(n_out, out, 0);
42842        xmlResetLastError();
42843        if (mem_base != xmlMemBlocks()) {
42844            printf("Leak of %d blocks found in xmlNewTextWriter",
42845	           xmlMemBlocks() - mem_base);
42846	    test_ret++;
42847            printf(" %d", n_out);
42848            printf("\n");
42849        }
42850    }
42851    function_tests++;
42852#endif
42853
42854    return(test_ret);
42855}
42856
42857
42858static int
42859test_xmlNewTextWriterFilename(void) {
42860    int test_ret = 0;
42861
42862#if defined(LIBXML_WRITER_ENABLED)
42863    int mem_base;
42864    xmlTextWriterPtr ret_val;
42865    const char * uri; /* the URI of the resource for the output */
42866    int n_uri;
42867    int compression; /* compress the output? */
42868    int n_compression;
42869
42870    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42871    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42872        mem_base = xmlMemBlocks();
42873        uri = gen_fileoutput(n_uri, 0);
42874        compression = gen_int(n_compression, 1);
42875
42876        ret_val = xmlNewTextWriterFilename(uri, compression);
42877        desret_xmlTextWriterPtr(ret_val);
42878        call_tests++;
42879        des_fileoutput(n_uri, uri, 0);
42880        des_int(n_compression, compression, 1);
42881        xmlResetLastError();
42882        if (mem_base != xmlMemBlocks()) {
42883            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42884	           xmlMemBlocks() - mem_base);
42885	    test_ret++;
42886            printf(" %d", n_uri);
42887            printf(" %d", n_compression);
42888            printf("\n");
42889        }
42890    }
42891    }
42892    function_tests++;
42893#endif
42894
42895    return(test_ret);
42896}
42897
42898
42899static int
42900test_xmlNewTextWriterMemory(void) {
42901    int test_ret = 0;
42902
42903#if defined(LIBXML_WRITER_ENABLED)
42904    int mem_base;
42905    xmlTextWriterPtr ret_val;
42906    xmlBufferPtr buf; /* xmlBufferPtr */
42907    int n_buf;
42908    int compression; /* compress the output? */
42909    int n_compression;
42910
42911    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42912    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42913        mem_base = xmlMemBlocks();
42914        buf = gen_xmlBufferPtr(n_buf, 0);
42915        compression = gen_int(n_compression, 1);
42916
42917        ret_val = xmlNewTextWriterMemory(buf, compression);
42918        desret_xmlTextWriterPtr(ret_val);
42919        call_tests++;
42920        des_xmlBufferPtr(n_buf, buf, 0);
42921        des_int(n_compression, compression, 1);
42922        xmlResetLastError();
42923        if (mem_base != xmlMemBlocks()) {
42924            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42925	           xmlMemBlocks() - mem_base);
42926	    test_ret++;
42927            printf(" %d", n_buf);
42928            printf(" %d", n_compression);
42929            printf("\n");
42930        }
42931    }
42932    }
42933    function_tests++;
42934#endif
42935
42936    return(test_ret);
42937}
42938
42939
42940static int
42941test_xmlNewTextWriterPushParser(void) {
42942    int test_ret = 0;
42943
42944#if defined(LIBXML_WRITER_ENABLED)
42945    int mem_base;
42946    xmlTextWriterPtr ret_val;
42947    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42948    int n_ctxt;
42949    int compression; /* compress the output? */
42950    int n_compression;
42951
42952    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42953    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42954        mem_base = xmlMemBlocks();
42955        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42956        compression = gen_int(n_compression, 1);
42957
42958        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42959        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42960        desret_xmlTextWriterPtr(ret_val);
42961        call_tests++;
42962        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42963        des_int(n_compression, compression, 1);
42964        xmlResetLastError();
42965        if (mem_base != xmlMemBlocks()) {
42966            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42967	           xmlMemBlocks() - mem_base);
42968	    test_ret++;
42969            printf(" %d", n_ctxt);
42970            printf(" %d", n_compression);
42971            printf("\n");
42972        }
42973    }
42974    }
42975    function_tests++;
42976#endif
42977
42978    return(test_ret);
42979}
42980
42981
42982static int
42983test_xmlNewTextWriterTree(void) {
42984    int test_ret = 0;
42985
42986#if defined(LIBXML_WRITER_ENABLED)
42987    int mem_base;
42988    xmlTextWriterPtr ret_val;
42989    xmlDocPtr doc; /* xmlDocPtr */
42990    int n_doc;
42991    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42992    int n_node;
42993    int compression; /* compress the output? */
42994    int n_compression;
42995
42996    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42997    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42998    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42999        mem_base = xmlMemBlocks();
43000        doc = gen_xmlDocPtr(n_doc, 0);
43001        node = gen_xmlNodePtr(n_node, 1);
43002        compression = gen_int(n_compression, 2);
43003
43004        ret_val = xmlNewTextWriterTree(doc, node, compression);
43005        desret_xmlTextWriterPtr(ret_val);
43006        call_tests++;
43007        des_xmlDocPtr(n_doc, doc, 0);
43008        des_xmlNodePtr(n_node, node, 1);
43009        des_int(n_compression, compression, 2);
43010        xmlResetLastError();
43011        if (mem_base != xmlMemBlocks()) {
43012            printf("Leak of %d blocks found in xmlNewTextWriterTree",
43013	           xmlMemBlocks() - mem_base);
43014	    test_ret++;
43015            printf(" %d", n_doc);
43016            printf(" %d", n_node);
43017            printf(" %d", n_compression);
43018            printf("\n");
43019        }
43020    }
43021    }
43022    }
43023    function_tests++;
43024#endif
43025
43026    return(test_ret);
43027}
43028
43029
43030static int
43031test_xmlTextWriterEndAttribute(void) {
43032    int test_ret = 0;
43033
43034#if defined(LIBXML_WRITER_ENABLED)
43035    int mem_base;
43036    int ret_val;
43037    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43038    int n_writer;
43039
43040    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43041        mem_base = xmlMemBlocks();
43042        writer = gen_xmlTextWriterPtr(n_writer, 0);
43043
43044        ret_val = xmlTextWriterEndAttribute(writer);
43045        desret_int(ret_val);
43046        call_tests++;
43047        des_xmlTextWriterPtr(n_writer, writer, 0);
43048        xmlResetLastError();
43049        if (mem_base != xmlMemBlocks()) {
43050            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
43051	           xmlMemBlocks() - mem_base);
43052	    test_ret++;
43053            printf(" %d", n_writer);
43054            printf("\n");
43055        }
43056    }
43057    function_tests++;
43058#endif
43059
43060    return(test_ret);
43061}
43062
43063
43064static int
43065test_xmlTextWriterEndCDATA(void) {
43066    int test_ret = 0;
43067
43068#if defined(LIBXML_WRITER_ENABLED)
43069    int mem_base;
43070    int ret_val;
43071    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43072    int n_writer;
43073
43074    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43075        mem_base = xmlMemBlocks();
43076        writer = gen_xmlTextWriterPtr(n_writer, 0);
43077
43078        ret_val = xmlTextWriterEndCDATA(writer);
43079        desret_int(ret_val);
43080        call_tests++;
43081        des_xmlTextWriterPtr(n_writer, writer, 0);
43082        xmlResetLastError();
43083        if (mem_base != xmlMemBlocks()) {
43084            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
43085	           xmlMemBlocks() - mem_base);
43086	    test_ret++;
43087            printf(" %d", n_writer);
43088            printf("\n");
43089        }
43090    }
43091    function_tests++;
43092#endif
43093
43094    return(test_ret);
43095}
43096
43097
43098static int
43099test_xmlTextWriterEndComment(void) {
43100    int test_ret = 0;
43101
43102#if defined(LIBXML_WRITER_ENABLED)
43103    int mem_base;
43104    int ret_val;
43105    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43106    int n_writer;
43107
43108    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43109        mem_base = xmlMemBlocks();
43110        writer = gen_xmlTextWriterPtr(n_writer, 0);
43111
43112        ret_val = xmlTextWriterEndComment(writer);
43113        desret_int(ret_val);
43114        call_tests++;
43115        des_xmlTextWriterPtr(n_writer, writer, 0);
43116        xmlResetLastError();
43117        if (mem_base != xmlMemBlocks()) {
43118            printf("Leak of %d blocks found in xmlTextWriterEndComment",
43119	           xmlMemBlocks() - mem_base);
43120	    test_ret++;
43121            printf(" %d", n_writer);
43122            printf("\n");
43123        }
43124    }
43125    function_tests++;
43126#endif
43127
43128    return(test_ret);
43129}
43130
43131
43132static int
43133test_xmlTextWriterEndDTD(void) {
43134    int test_ret = 0;
43135
43136#if defined(LIBXML_WRITER_ENABLED)
43137    int mem_base;
43138    int ret_val;
43139    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43140    int n_writer;
43141
43142    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43143        mem_base = xmlMemBlocks();
43144        writer = gen_xmlTextWriterPtr(n_writer, 0);
43145
43146        ret_val = xmlTextWriterEndDTD(writer);
43147        desret_int(ret_val);
43148        call_tests++;
43149        des_xmlTextWriterPtr(n_writer, writer, 0);
43150        xmlResetLastError();
43151        if (mem_base != xmlMemBlocks()) {
43152            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
43153	           xmlMemBlocks() - mem_base);
43154	    test_ret++;
43155            printf(" %d", n_writer);
43156            printf("\n");
43157        }
43158    }
43159    function_tests++;
43160#endif
43161
43162    return(test_ret);
43163}
43164
43165
43166static int
43167test_xmlTextWriterEndDTDAttlist(void) {
43168    int test_ret = 0;
43169
43170#if defined(LIBXML_WRITER_ENABLED)
43171    int mem_base;
43172    int ret_val;
43173    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43174    int n_writer;
43175
43176    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43177        mem_base = xmlMemBlocks();
43178        writer = gen_xmlTextWriterPtr(n_writer, 0);
43179
43180        ret_val = xmlTextWriterEndDTDAttlist(writer);
43181        desret_int(ret_val);
43182        call_tests++;
43183        des_xmlTextWriterPtr(n_writer, writer, 0);
43184        xmlResetLastError();
43185        if (mem_base != xmlMemBlocks()) {
43186            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
43187	           xmlMemBlocks() - mem_base);
43188	    test_ret++;
43189            printf(" %d", n_writer);
43190            printf("\n");
43191        }
43192    }
43193    function_tests++;
43194#endif
43195
43196    return(test_ret);
43197}
43198
43199
43200static int
43201test_xmlTextWriterEndDTDElement(void) {
43202    int test_ret = 0;
43203
43204#if defined(LIBXML_WRITER_ENABLED)
43205    int mem_base;
43206    int ret_val;
43207    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43208    int n_writer;
43209
43210    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43211        mem_base = xmlMemBlocks();
43212        writer = gen_xmlTextWriterPtr(n_writer, 0);
43213
43214        ret_val = xmlTextWriterEndDTDElement(writer);
43215        desret_int(ret_val);
43216        call_tests++;
43217        des_xmlTextWriterPtr(n_writer, writer, 0);
43218        xmlResetLastError();
43219        if (mem_base != xmlMemBlocks()) {
43220            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43221	           xmlMemBlocks() - mem_base);
43222	    test_ret++;
43223            printf(" %d", n_writer);
43224            printf("\n");
43225        }
43226    }
43227    function_tests++;
43228#endif
43229
43230    return(test_ret);
43231}
43232
43233
43234static int
43235test_xmlTextWriterEndDTDEntity(void) {
43236    int test_ret = 0;
43237
43238#if defined(LIBXML_WRITER_ENABLED)
43239    int mem_base;
43240    int ret_val;
43241    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43242    int n_writer;
43243
43244    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43245        mem_base = xmlMemBlocks();
43246        writer = gen_xmlTextWriterPtr(n_writer, 0);
43247
43248        ret_val = xmlTextWriterEndDTDEntity(writer);
43249        desret_int(ret_val);
43250        call_tests++;
43251        des_xmlTextWriterPtr(n_writer, writer, 0);
43252        xmlResetLastError();
43253        if (mem_base != xmlMemBlocks()) {
43254            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43255	           xmlMemBlocks() - mem_base);
43256	    test_ret++;
43257            printf(" %d", n_writer);
43258            printf("\n");
43259        }
43260    }
43261    function_tests++;
43262#endif
43263
43264    return(test_ret);
43265}
43266
43267
43268static int
43269test_xmlTextWriterEndDocument(void) {
43270    int test_ret = 0;
43271
43272#if defined(LIBXML_WRITER_ENABLED)
43273    int mem_base;
43274    int ret_val;
43275    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43276    int n_writer;
43277
43278    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43279        mem_base = xmlMemBlocks();
43280        writer = gen_xmlTextWriterPtr(n_writer, 0);
43281
43282        ret_val = xmlTextWriterEndDocument(writer);
43283        desret_int(ret_val);
43284        call_tests++;
43285        des_xmlTextWriterPtr(n_writer, writer, 0);
43286        xmlResetLastError();
43287        if (mem_base != xmlMemBlocks()) {
43288            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43289	           xmlMemBlocks() - mem_base);
43290	    test_ret++;
43291            printf(" %d", n_writer);
43292            printf("\n");
43293        }
43294    }
43295    function_tests++;
43296#endif
43297
43298    return(test_ret);
43299}
43300
43301
43302static int
43303test_xmlTextWriterEndElement(void) {
43304    int test_ret = 0;
43305
43306#if defined(LIBXML_WRITER_ENABLED)
43307    int mem_base;
43308    int ret_val;
43309    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43310    int n_writer;
43311
43312    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43313        mem_base = xmlMemBlocks();
43314        writer = gen_xmlTextWriterPtr(n_writer, 0);
43315
43316        ret_val = xmlTextWriterEndElement(writer);
43317        desret_int(ret_val);
43318        call_tests++;
43319        des_xmlTextWriterPtr(n_writer, writer, 0);
43320        xmlResetLastError();
43321        if (mem_base != xmlMemBlocks()) {
43322            printf("Leak of %d blocks found in xmlTextWriterEndElement",
43323	           xmlMemBlocks() - mem_base);
43324	    test_ret++;
43325            printf(" %d", n_writer);
43326            printf("\n");
43327        }
43328    }
43329    function_tests++;
43330#endif
43331
43332    return(test_ret);
43333}
43334
43335
43336static int
43337test_xmlTextWriterEndPI(void) {
43338    int test_ret = 0;
43339
43340#if defined(LIBXML_WRITER_ENABLED)
43341    int mem_base;
43342    int ret_val;
43343    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43344    int n_writer;
43345
43346    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43347        mem_base = xmlMemBlocks();
43348        writer = gen_xmlTextWriterPtr(n_writer, 0);
43349
43350        ret_val = xmlTextWriterEndPI(writer);
43351        desret_int(ret_val);
43352        call_tests++;
43353        des_xmlTextWriterPtr(n_writer, writer, 0);
43354        xmlResetLastError();
43355        if (mem_base != xmlMemBlocks()) {
43356            printf("Leak of %d blocks found in xmlTextWriterEndPI",
43357	           xmlMemBlocks() - mem_base);
43358	    test_ret++;
43359            printf(" %d", n_writer);
43360            printf("\n");
43361        }
43362    }
43363    function_tests++;
43364#endif
43365
43366    return(test_ret);
43367}
43368
43369
43370static int
43371test_xmlTextWriterFlush(void) {
43372    int test_ret = 0;
43373
43374#if defined(LIBXML_WRITER_ENABLED)
43375    int mem_base;
43376    int ret_val;
43377    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43378    int n_writer;
43379
43380    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43381        mem_base = xmlMemBlocks();
43382        writer = gen_xmlTextWriterPtr(n_writer, 0);
43383
43384        ret_val = xmlTextWriterFlush(writer);
43385        desret_int(ret_val);
43386        call_tests++;
43387        des_xmlTextWriterPtr(n_writer, writer, 0);
43388        xmlResetLastError();
43389        if (mem_base != xmlMemBlocks()) {
43390            printf("Leak of %d blocks found in xmlTextWriterFlush",
43391	           xmlMemBlocks() - mem_base);
43392	    test_ret++;
43393            printf(" %d", n_writer);
43394            printf("\n");
43395        }
43396    }
43397    function_tests++;
43398#endif
43399
43400    return(test_ret);
43401}
43402
43403
43404static int
43405test_xmlTextWriterFullEndElement(void) {
43406    int test_ret = 0;
43407
43408#if defined(LIBXML_WRITER_ENABLED)
43409    int mem_base;
43410    int ret_val;
43411    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43412    int n_writer;
43413
43414    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43415        mem_base = xmlMemBlocks();
43416        writer = gen_xmlTextWriterPtr(n_writer, 0);
43417
43418        ret_val = xmlTextWriterFullEndElement(writer);
43419        desret_int(ret_val);
43420        call_tests++;
43421        des_xmlTextWriterPtr(n_writer, writer, 0);
43422        xmlResetLastError();
43423        if (mem_base != xmlMemBlocks()) {
43424            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43425	           xmlMemBlocks() - mem_base);
43426	    test_ret++;
43427            printf(" %d", n_writer);
43428            printf("\n");
43429        }
43430    }
43431    function_tests++;
43432#endif
43433
43434    return(test_ret);
43435}
43436
43437
43438static int
43439test_xmlTextWriterSetIndent(void) {
43440    int test_ret = 0;
43441
43442#if defined(LIBXML_WRITER_ENABLED)
43443    int mem_base;
43444    int ret_val;
43445    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43446    int n_writer;
43447    int indent; /* do indentation? */
43448    int n_indent;
43449
43450    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43451    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43452        mem_base = xmlMemBlocks();
43453        writer = gen_xmlTextWriterPtr(n_writer, 0);
43454        indent = gen_int(n_indent, 1);
43455
43456        ret_val = xmlTextWriterSetIndent(writer, indent);
43457        desret_int(ret_val);
43458        call_tests++;
43459        des_xmlTextWriterPtr(n_writer, writer, 0);
43460        des_int(n_indent, indent, 1);
43461        xmlResetLastError();
43462        if (mem_base != xmlMemBlocks()) {
43463            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43464	           xmlMemBlocks() - mem_base);
43465	    test_ret++;
43466            printf(" %d", n_writer);
43467            printf(" %d", n_indent);
43468            printf("\n");
43469        }
43470    }
43471    }
43472    function_tests++;
43473#endif
43474
43475    return(test_ret);
43476}
43477
43478
43479static int
43480test_xmlTextWriterSetIndentString(void) {
43481    int test_ret = 0;
43482
43483#if defined(LIBXML_WRITER_ENABLED)
43484    int mem_base;
43485    int ret_val;
43486    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43487    int n_writer;
43488    xmlChar * str; /* the xmlChar string */
43489    int n_str;
43490
43491    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43492    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43493        mem_base = xmlMemBlocks();
43494        writer = gen_xmlTextWriterPtr(n_writer, 0);
43495        str = gen_const_xmlChar_ptr(n_str, 1);
43496
43497        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43498        desret_int(ret_val);
43499        call_tests++;
43500        des_xmlTextWriterPtr(n_writer, writer, 0);
43501        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43502        xmlResetLastError();
43503        if (mem_base != xmlMemBlocks()) {
43504            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43505	           xmlMemBlocks() - mem_base);
43506	    test_ret++;
43507            printf(" %d", n_writer);
43508            printf(" %d", n_str);
43509            printf("\n");
43510        }
43511    }
43512    }
43513    function_tests++;
43514#endif
43515
43516    return(test_ret);
43517}
43518
43519
43520static int
43521test_xmlTextWriterStartAttribute(void) {
43522    int test_ret = 0;
43523
43524#if defined(LIBXML_WRITER_ENABLED)
43525    int mem_base;
43526    int ret_val;
43527    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43528    int n_writer;
43529    xmlChar * name; /* element name */
43530    int n_name;
43531
43532    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43533    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43534        mem_base = xmlMemBlocks();
43535        writer = gen_xmlTextWriterPtr(n_writer, 0);
43536        name = gen_const_xmlChar_ptr(n_name, 1);
43537
43538        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43539        desret_int(ret_val);
43540        call_tests++;
43541        des_xmlTextWriterPtr(n_writer, writer, 0);
43542        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43543        xmlResetLastError();
43544        if (mem_base != xmlMemBlocks()) {
43545            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43546	           xmlMemBlocks() - mem_base);
43547	    test_ret++;
43548            printf(" %d", n_writer);
43549            printf(" %d", n_name);
43550            printf("\n");
43551        }
43552    }
43553    }
43554    function_tests++;
43555#endif
43556
43557    return(test_ret);
43558}
43559
43560
43561static int
43562test_xmlTextWriterStartAttributeNS(void) {
43563    int test_ret = 0;
43564
43565#if defined(LIBXML_WRITER_ENABLED)
43566    int mem_base;
43567    int ret_val;
43568    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43569    int n_writer;
43570    xmlChar * prefix; /* namespace prefix or NULL */
43571    int n_prefix;
43572    xmlChar * name; /* element local name */
43573    int n_name;
43574    xmlChar * namespaceURI; /* namespace URI or NULL */
43575    int n_namespaceURI;
43576
43577    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43578    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43579    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43580    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43581        mem_base = xmlMemBlocks();
43582        writer = gen_xmlTextWriterPtr(n_writer, 0);
43583        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43584        name = gen_const_xmlChar_ptr(n_name, 2);
43585        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43586
43587        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43588        desret_int(ret_val);
43589        call_tests++;
43590        des_xmlTextWriterPtr(n_writer, writer, 0);
43591        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43592        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43593        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43594        xmlResetLastError();
43595        if (mem_base != xmlMemBlocks()) {
43596            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43597	           xmlMemBlocks() - mem_base);
43598	    test_ret++;
43599            printf(" %d", n_writer);
43600            printf(" %d", n_prefix);
43601            printf(" %d", n_name);
43602            printf(" %d", n_namespaceURI);
43603            printf("\n");
43604        }
43605    }
43606    }
43607    }
43608    }
43609    function_tests++;
43610#endif
43611
43612    return(test_ret);
43613}
43614
43615
43616static int
43617test_xmlTextWriterStartCDATA(void) {
43618    int test_ret = 0;
43619
43620#if defined(LIBXML_WRITER_ENABLED)
43621    int mem_base;
43622    int ret_val;
43623    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43624    int n_writer;
43625
43626    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43627        mem_base = xmlMemBlocks();
43628        writer = gen_xmlTextWriterPtr(n_writer, 0);
43629
43630        ret_val = xmlTextWriterStartCDATA(writer);
43631        desret_int(ret_val);
43632        call_tests++;
43633        des_xmlTextWriterPtr(n_writer, writer, 0);
43634        xmlResetLastError();
43635        if (mem_base != xmlMemBlocks()) {
43636            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43637	           xmlMemBlocks() - mem_base);
43638	    test_ret++;
43639            printf(" %d", n_writer);
43640            printf("\n");
43641        }
43642    }
43643    function_tests++;
43644#endif
43645
43646    return(test_ret);
43647}
43648
43649
43650static int
43651test_xmlTextWriterStartComment(void) {
43652    int test_ret = 0;
43653
43654#if defined(LIBXML_WRITER_ENABLED)
43655    int mem_base;
43656    int ret_val;
43657    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43658    int n_writer;
43659
43660    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43661        mem_base = xmlMemBlocks();
43662        writer = gen_xmlTextWriterPtr(n_writer, 0);
43663
43664        ret_val = xmlTextWriterStartComment(writer);
43665        desret_int(ret_val);
43666        call_tests++;
43667        des_xmlTextWriterPtr(n_writer, writer, 0);
43668        xmlResetLastError();
43669        if (mem_base != xmlMemBlocks()) {
43670            printf("Leak of %d blocks found in xmlTextWriterStartComment",
43671	           xmlMemBlocks() - mem_base);
43672	    test_ret++;
43673            printf(" %d", n_writer);
43674            printf("\n");
43675        }
43676    }
43677    function_tests++;
43678#endif
43679
43680    return(test_ret);
43681}
43682
43683
43684static int
43685test_xmlTextWriterStartDTD(void) {
43686    int test_ret = 0;
43687
43688#if defined(LIBXML_WRITER_ENABLED)
43689    int mem_base;
43690    int ret_val;
43691    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43692    int n_writer;
43693    xmlChar * name; /* the name of the DTD */
43694    int n_name;
43695    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43696    int n_pubid;
43697    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43698    int n_sysid;
43699
43700    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43701    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43702    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43703    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43704        mem_base = xmlMemBlocks();
43705        writer = gen_xmlTextWriterPtr(n_writer, 0);
43706        name = gen_const_xmlChar_ptr(n_name, 1);
43707        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43708        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43709
43710        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43711        desret_int(ret_val);
43712        call_tests++;
43713        des_xmlTextWriterPtr(n_writer, writer, 0);
43714        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43715        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43716        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43717        xmlResetLastError();
43718        if (mem_base != xmlMemBlocks()) {
43719            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43720	           xmlMemBlocks() - mem_base);
43721	    test_ret++;
43722            printf(" %d", n_writer);
43723            printf(" %d", n_name);
43724            printf(" %d", n_pubid);
43725            printf(" %d", n_sysid);
43726            printf("\n");
43727        }
43728    }
43729    }
43730    }
43731    }
43732    function_tests++;
43733#endif
43734
43735    return(test_ret);
43736}
43737
43738
43739static int
43740test_xmlTextWriterStartDTDAttlist(void) {
43741    int test_ret = 0;
43742
43743#if defined(LIBXML_WRITER_ENABLED)
43744    int mem_base;
43745    int ret_val;
43746    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43747    int n_writer;
43748    xmlChar * name; /* the name of the DTD ATTLIST */
43749    int n_name;
43750
43751    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43752    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43753        mem_base = xmlMemBlocks();
43754        writer = gen_xmlTextWriterPtr(n_writer, 0);
43755        name = gen_const_xmlChar_ptr(n_name, 1);
43756
43757        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43758        desret_int(ret_val);
43759        call_tests++;
43760        des_xmlTextWriterPtr(n_writer, writer, 0);
43761        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43762        xmlResetLastError();
43763        if (mem_base != xmlMemBlocks()) {
43764            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43765	           xmlMemBlocks() - mem_base);
43766	    test_ret++;
43767            printf(" %d", n_writer);
43768            printf(" %d", n_name);
43769            printf("\n");
43770        }
43771    }
43772    }
43773    function_tests++;
43774#endif
43775
43776    return(test_ret);
43777}
43778
43779
43780static int
43781test_xmlTextWriterStartDTDElement(void) {
43782    int test_ret = 0;
43783
43784#if defined(LIBXML_WRITER_ENABLED)
43785    int mem_base;
43786    int ret_val;
43787    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43788    int n_writer;
43789    xmlChar * name; /* the name of the DTD element */
43790    int n_name;
43791
43792    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43793    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43794        mem_base = xmlMemBlocks();
43795        writer = gen_xmlTextWriterPtr(n_writer, 0);
43796        name = gen_const_xmlChar_ptr(n_name, 1);
43797
43798        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43799        desret_int(ret_val);
43800        call_tests++;
43801        des_xmlTextWriterPtr(n_writer, writer, 0);
43802        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43803        xmlResetLastError();
43804        if (mem_base != xmlMemBlocks()) {
43805            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43806	           xmlMemBlocks() - mem_base);
43807	    test_ret++;
43808            printf(" %d", n_writer);
43809            printf(" %d", n_name);
43810            printf("\n");
43811        }
43812    }
43813    }
43814    function_tests++;
43815#endif
43816
43817    return(test_ret);
43818}
43819
43820
43821static int
43822test_xmlTextWriterStartDTDEntity(void) {
43823    int test_ret = 0;
43824
43825#if defined(LIBXML_WRITER_ENABLED)
43826    int mem_base;
43827    int ret_val;
43828    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43829    int n_writer;
43830    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43831    int n_pe;
43832    xmlChar * name; /* the name of the DTD ATTLIST */
43833    int n_name;
43834
43835    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43836    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43837    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43838        mem_base = xmlMemBlocks();
43839        writer = gen_xmlTextWriterPtr(n_writer, 0);
43840        pe = gen_int(n_pe, 1);
43841        name = gen_const_xmlChar_ptr(n_name, 2);
43842
43843        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43844        desret_int(ret_val);
43845        call_tests++;
43846        des_xmlTextWriterPtr(n_writer, writer, 0);
43847        des_int(n_pe, pe, 1);
43848        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43849        xmlResetLastError();
43850        if (mem_base != xmlMemBlocks()) {
43851            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43852	           xmlMemBlocks() - mem_base);
43853	    test_ret++;
43854            printf(" %d", n_writer);
43855            printf(" %d", n_pe);
43856            printf(" %d", n_name);
43857            printf("\n");
43858        }
43859    }
43860    }
43861    }
43862    function_tests++;
43863#endif
43864
43865    return(test_ret);
43866}
43867
43868
43869static int
43870test_xmlTextWriterStartDocument(void) {
43871    int test_ret = 0;
43872
43873#if defined(LIBXML_WRITER_ENABLED)
43874    int mem_base;
43875    int ret_val;
43876    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43877    int n_writer;
43878    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43879    int n_version;
43880    char * encoding; /* the encoding or NULL for default */
43881    int n_encoding;
43882    char * standalone; /* "yes" or "no" or NULL for default */
43883    int n_standalone;
43884
43885    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43886    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43887    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43888    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43889        mem_base = xmlMemBlocks();
43890        writer = gen_xmlTextWriterPtr(n_writer, 0);
43891        version = gen_const_char_ptr(n_version, 1);
43892        encoding = gen_const_char_ptr(n_encoding, 2);
43893        standalone = gen_const_char_ptr(n_standalone, 3);
43894
43895        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43896        desret_int(ret_val);
43897        call_tests++;
43898        des_xmlTextWriterPtr(n_writer, writer, 0);
43899        des_const_char_ptr(n_version, (const char *)version, 1);
43900        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43901        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43902        xmlResetLastError();
43903        if (mem_base != xmlMemBlocks()) {
43904            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43905	           xmlMemBlocks() - mem_base);
43906	    test_ret++;
43907            printf(" %d", n_writer);
43908            printf(" %d", n_version);
43909            printf(" %d", n_encoding);
43910            printf(" %d", n_standalone);
43911            printf("\n");
43912        }
43913    }
43914    }
43915    }
43916    }
43917    function_tests++;
43918#endif
43919
43920    return(test_ret);
43921}
43922
43923
43924static int
43925test_xmlTextWriterStartElement(void) {
43926    int test_ret = 0;
43927
43928#if defined(LIBXML_WRITER_ENABLED)
43929    int mem_base;
43930    int ret_val;
43931    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43932    int n_writer;
43933    xmlChar * name; /* element name */
43934    int n_name;
43935
43936    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43937    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43938        mem_base = xmlMemBlocks();
43939        writer = gen_xmlTextWriterPtr(n_writer, 0);
43940        name = gen_const_xmlChar_ptr(n_name, 1);
43941
43942        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43943        desret_int(ret_val);
43944        call_tests++;
43945        des_xmlTextWriterPtr(n_writer, writer, 0);
43946        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43947        xmlResetLastError();
43948        if (mem_base != xmlMemBlocks()) {
43949            printf("Leak of %d blocks found in xmlTextWriterStartElement",
43950	           xmlMemBlocks() - mem_base);
43951	    test_ret++;
43952            printf(" %d", n_writer);
43953            printf(" %d", n_name);
43954            printf("\n");
43955        }
43956    }
43957    }
43958    function_tests++;
43959#endif
43960
43961    return(test_ret);
43962}
43963
43964
43965static int
43966test_xmlTextWriterStartElementNS(void) {
43967    int test_ret = 0;
43968
43969#if defined(LIBXML_WRITER_ENABLED)
43970    int mem_base;
43971    int ret_val;
43972    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43973    int n_writer;
43974    xmlChar * prefix; /* namespace prefix or NULL */
43975    int n_prefix;
43976    xmlChar * name; /* element local name */
43977    int n_name;
43978    xmlChar * namespaceURI; /* namespace URI or NULL */
43979    int n_namespaceURI;
43980
43981    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43982    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43983    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43984    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43985        mem_base = xmlMemBlocks();
43986        writer = gen_xmlTextWriterPtr(n_writer, 0);
43987        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43988        name = gen_const_xmlChar_ptr(n_name, 2);
43989        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43990
43991        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43992        desret_int(ret_val);
43993        call_tests++;
43994        des_xmlTextWriterPtr(n_writer, writer, 0);
43995        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43996        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43997        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43998        xmlResetLastError();
43999        if (mem_base != xmlMemBlocks()) {
44000            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
44001	           xmlMemBlocks() - mem_base);
44002	    test_ret++;
44003            printf(" %d", n_writer);
44004            printf(" %d", n_prefix);
44005            printf(" %d", n_name);
44006            printf(" %d", n_namespaceURI);
44007            printf("\n");
44008        }
44009    }
44010    }
44011    }
44012    }
44013    function_tests++;
44014#endif
44015
44016    return(test_ret);
44017}
44018
44019
44020static int
44021test_xmlTextWriterStartPI(void) {
44022    int test_ret = 0;
44023
44024#if defined(LIBXML_WRITER_ENABLED)
44025    int mem_base;
44026    int ret_val;
44027    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44028    int n_writer;
44029    xmlChar * target; /* PI target */
44030    int n_target;
44031
44032    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44033    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44034        mem_base = xmlMemBlocks();
44035        writer = gen_xmlTextWriterPtr(n_writer, 0);
44036        target = gen_const_xmlChar_ptr(n_target, 1);
44037
44038        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
44039        desret_int(ret_val);
44040        call_tests++;
44041        des_xmlTextWriterPtr(n_writer, writer, 0);
44042        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44043        xmlResetLastError();
44044        if (mem_base != xmlMemBlocks()) {
44045            printf("Leak of %d blocks found in xmlTextWriterStartPI",
44046	           xmlMemBlocks() - mem_base);
44047	    test_ret++;
44048            printf(" %d", n_writer);
44049            printf(" %d", n_target);
44050            printf("\n");
44051        }
44052    }
44053    }
44054    function_tests++;
44055#endif
44056
44057    return(test_ret);
44058}
44059
44060
44061static int
44062test_xmlTextWriterWriteAttribute(void) {
44063    int test_ret = 0;
44064
44065#if defined(LIBXML_WRITER_ENABLED)
44066    int mem_base;
44067    int ret_val;
44068    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44069    int n_writer;
44070    xmlChar * name; /* attribute name */
44071    int n_name;
44072    xmlChar * content; /* attribute content */
44073    int n_content;
44074
44075    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44076    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44077    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44078        mem_base = xmlMemBlocks();
44079        writer = gen_xmlTextWriterPtr(n_writer, 0);
44080        name = gen_const_xmlChar_ptr(n_name, 1);
44081        content = gen_const_xmlChar_ptr(n_content, 2);
44082
44083        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
44084        desret_int(ret_val);
44085        call_tests++;
44086        des_xmlTextWriterPtr(n_writer, writer, 0);
44087        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44088        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44089        xmlResetLastError();
44090        if (mem_base != xmlMemBlocks()) {
44091            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
44092	           xmlMemBlocks() - mem_base);
44093	    test_ret++;
44094            printf(" %d", n_writer);
44095            printf(" %d", n_name);
44096            printf(" %d", n_content);
44097            printf("\n");
44098        }
44099    }
44100    }
44101    }
44102    function_tests++;
44103#endif
44104
44105    return(test_ret);
44106}
44107
44108
44109static int
44110test_xmlTextWriterWriteAttributeNS(void) {
44111    int test_ret = 0;
44112
44113#if defined(LIBXML_WRITER_ENABLED)
44114    int mem_base;
44115    int ret_val;
44116    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44117    int n_writer;
44118    xmlChar * prefix; /* namespace prefix */
44119    int n_prefix;
44120    xmlChar * name; /* attribute local name */
44121    int n_name;
44122    xmlChar * namespaceURI; /* namespace URI */
44123    int n_namespaceURI;
44124    xmlChar * content; /* attribute content */
44125    int n_content;
44126
44127    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44128    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44129    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44130    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44131    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44132        mem_base = xmlMemBlocks();
44133        writer = gen_xmlTextWriterPtr(n_writer, 0);
44134        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44135        name = gen_const_xmlChar_ptr(n_name, 2);
44136        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44137        content = gen_const_xmlChar_ptr(n_content, 4);
44138
44139        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44140        desret_int(ret_val);
44141        call_tests++;
44142        des_xmlTextWriterPtr(n_writer, writer, 0);
44143        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44144        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44145        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44146        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44147        xmlResetLastError();
44148        if (mem_base != xmlMemBlocks()) {
44149            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
44150	           xmlMemBlocks() - mem_base);
44151	    test_ret++;
44152            printf(" %d", n_writer);
44153            printf(" %d", n_prefix);
44154            printf(" %d", n_name);
44155            printf(" %d", n_namespaceURI);
44156            printf(" %d", n_content);
44157            printf("\n");
44158        }
44159    }
44160    }
44161    }
44162    }
44163    }
44164    function_tests++;
44165#endif
44166
44167    return(test_ret);
44168}
44169
44170
44171static int
44172test_xmlTextWriterWriteBase64(void) {
44173    int test_ret = 0;
44174
44175#if defined(LIBXML_WRITER_ENABLED)
44176    int mem_base;
44177    int ret_val;
44178    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44179    int n_writer;
44180    char * data; /* binary data */
44181    int n_data;
44182    int start; /* the position within the data of the first byte to encode */
44183    int n_start;
44184    int len; /* the number of bytes to encode */
44185    int n_len;
44186
44187    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44188    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44189    for (n_start = 0;n_start < gen_nb_int;n_start++) {
44190    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44191        mem_base = xmlMemBlocks();
44192        writer = gen_xmlTextWriterPtr(n_writer, 0);
44193        data = gen_const_char_ptr(n_data, 1);
44194        start = gen_int(n_start, 2);
44195        len = gen_int(n_len, 3);
44196
44197        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
44198        desret_int(ret_val);
44199        call_tests++;
44200        des_xmlTextWriterPtr(n_writer, writer, 0);
44201        des_const_char_ptr(n_data, (const char *)data, 1);
44202        des_int(n_start, start, 2);
44203        des_int(n_len, len, 3);
44204        xmlResetLastError();
44205        if (mem_base != xmlMemBlocks()) {
44206            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
44207	           xmlMemBlocks() - mem_base);
44208	    test_ret++;
44209            printf(" %d", n_writer);
44210            printf(" %d", n_data);
44211            printf(" %d", n_start);
44212            printf(" %d", n_len);
44213            printf("\n");
44214        }
44215    }
44216    }
44217    }
44218    }
44219    function_tests++;
44220#endif
44221
44222    return(test_ret);
44223}
44224
44225
44226static int
44227test_xmlTextWriterWriteBinHex(void) {
44228    int test_ret = 0;
44229
44230#if defined(LIBXML_WRITER_ENABLED)
44231    int mem_base;
44232    int ret_val;
44233    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44234    int n_writer;
44235    char * data; /* binary data */
44236    int n_data;
44237    int start; /* the position within the data of the first byte to encode */
44238    int n_start;
44239    int len; /* the number of bytes to encode */
44240    int n_len;
44241
44242    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44243    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44244    for (n_start = 0;n_start < gen_nb_int;n_start++) {
44245    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44246        mem_base = xmlMemBlocks();
44247        writer = gen_xmlTextWriterPtr(n_writer, 0);
44248        data = gen_const_char_ptr(n_data, 1);
44249        start = gen_int(n_start, 2);
44250        len = gen_int(n_len, 3);
44251
44252        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44253        desret_int(ret_val);
44254        call_tests++;
44255        des_xmlTextWriterPtr(n_writer, writer, 0);
44256        des_const_char_ptr(n_data, (const char *)data, 1);
44257        des_int(n_start, start, 2);
44258        des_int(n_len, len, 3);
44259        xmlResetLastError();
44260        if (mem_base != xmlMemBlocks()) {
44261            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44262	           xmlMemBlocks() - mem_base);
44263	    test_ret++;
44264            printf(" %d", n_writer);
44265            printf(" %d", n_data);
44266            printf(" %d", n_start);
44267            printf(" %d", n_len);
44268            printf("\n");
44269        }
44270    }
44271    }
44272    }
44273    }
44274    function_tests++;
44275#endif
44276
44277    return(test_ret);
44278}
44279
44280
44281static int
44282test_xmlTextWriterWriteCDATA(void) {
44283    int test_ret = 0;
44284
44285#if defined(LIBXML_WRITER_ENABLED)
44286    int mem_base;
44287    int ret_val;
44288    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44289    int n_writer;
44290    xmlChar * content; /* CDATA content */
44291    int n_content;
44292
44293    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44294    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44295        mem_base = xmlMemBlocks();
44296        writer = gen_xmlTextWriterPtr(n_writer, 0);
44297        content = gen_const_xmlChar_ptr(n_content, 1);
44298
44299        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44300        desret_int(ret_val);
44301        call_tests++;
44302        des_xmlTextWriterPtr(n_writer, writer, 0);
44303        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44304        xmlResetLastError();
44305        if (mem_base != xmlMemBlocks()) {
44306            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44307	           xmlMemBlocks() - mem_base);
44308	    test_ret++;
44309            printf(" %d", n_writer);
44310            printf(" %d", n_content);
44311            printf("\n");
44312        }
44313    }
44314    }
44315    function_tests++;
44316#endif
44317
44318    return(test_ret);
44319}
44320
44321
44322static int
44323test_xmlTextWriterWriteComment(void) {
44324    int test_ret = 0;
44325
44326#if defined(LIBXML_WRITER_ENABLED)
44327    int mem_base;
44328    int ret_val;
44329    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44330    int n_writer;
44331    xmlChar * content; /* comment string */
44332    int n_content;
44333
44334    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44335    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44336        mem_base = xmlMemBlocks();
44337        writer = gen_xmlTextWriterPtr(n_writer, 0);
44338        content = gen_const_xmlChar_ptr(n_content, 1);
44339
44340        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44341        desret_int(ret_val);
44342        call_tests++;
44343        des_xmlTextWriterPtr(n_writer, writer, 0);
44344        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44345        xmlResetLastError();
44346        if (mem_base != xmlMemBlocks()) {
44347            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44348	           xmlMemBlocks() - mem_base);
44349	    test_ret++;
44350            printf(" %d", n_writer);
44351            printf(" %d", n_content);
44352            printf("\n");
44353        }
44354    }
44355    }
44356    function_tests++;
44357#endif
44358
44359    return(test_ret);
44360}
44361
44362
44363static int
44364test_xmlTextWriterWriteDTD(void) {
44365    int test_ret = 0;
44366
44367#if defined(LIBXML_WRITER_ENABLED)
44368    int mem_base;
44369    int ret_val;
44370    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44371    int n_writer;
44372    xmlChar * name; /* the name of the DTD */
44373    int n_name;
44374    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44375    int n_pubid;
44376    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44377    int n_sysid;
44378    xmlChar * subset; /* string content of the DTD */
44379    int n_subset;
44380
44381    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44382    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44383    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44384    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44385    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44386        mem_base = xmlMemBlocks();
44387        writer = gen_xmlTextWriterPtr(n_writer, 0);
44388        name = gen_const_xmlChar_ptr(n_name, 1);
44389        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44390        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44391        subset = gen_const_xmlChar_ptr(n_subset, 4);
44392
44393        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44394        desret_int(ret_val);
44395        call_tests++;
44396        des_xmlTextWriterPtr(n_writer, writer, 0);
44397        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44398        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44399        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44400        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44401        xmlResetLastError();
44402        if (mem_base != xmlMemBlocks()) {
44403            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44404	           xmlMemBlocks() - mem_base);
44405	    test_ret++;
44406            printf(" %d", n_writer);
44407            printf(" %d", n_name);
44408            printf(" %d", n_pubid);
44409            printf(" %d", n_sysid);
44410            printf(" %d", n_subset);
44411            printf("\n");
44412        }
44413    }
44414    }
44415    }
44416    }
44417    }
44418    function_tests++;
44419#endif
44420
44421    return(test_ret);
44422}
44423
44424
44425static int
44426test_xmlTextWriterWriteDTDAttlist(void) {
44427    int test_ret = 0;
44428
44429#if defined(LIBXML_WRITER_ENABLED)
44430    int mem_base;
44431    int ret_val;
44432    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44433    int n_writer;
44434    xmlChar * name; /* the name of the DTD ATTLIST */
44435    int n_name;
44436    xmlChar * content; /* content of the ATTLIST */
44437    int n_content;
44438
44439    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44440    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44441    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44442        mem_base = xmlMemBlocks();
44443        writer = gen_xmlTextWriterPtr(n_writer, 0);
44444        name = gen_const_xmlChar_ptr(n_name, 1);
44445        content = gen_const_xmlChar_ptr(n_content, 2);
44446
44447        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44448        desret_int(ret_val);
44449        call_tests++;
44450        des_xmlTextWriterPtr(n_writer, writer, 0);
44451        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44452        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44453        xmlResetLastError();
44454        if (mem_base != xmlMemBlocks()) {
44455            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44456	           xmlMemBlocks() - mem_base);
44457	    test_ret++;
44458            printf(" %d", n_writer);
44459            printf(" %d", n_name);
44460            printf(" %d", n_content);
44461            printf("\n");
44462        }
44463    }
44464    }
44465    }
44466    function_tests++;
44467#endif
44468
44469    return(test_ret);
44470}
44471
44472
44473static int
44474test_xmlTextWriterWriteDTDElement(void) {
44475    int test_ret = 0;
44476
44477#if defined(LIBXML_WRITER_ENABLED)
44478    int mem_base;
44479    int ret_val;
44480    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44481    int n_writer;
44482    xmlChar * name; /* the name of the DTD element */
44483    int n_name;
44484    xmlChar * content; /* content of the element */
44485    int n_content;
44486
44487    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44488    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44489    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44490        mem_base = xmlMemBlocks();
44491        writer = gen_xmlTextWriterPtr(n_writer, 0);
44492        name = gen_const_xmlChar_ptr(n_name, 1);
44493        content = gen_const_xmlChar_ptr(n_content, 2);
44494
44495        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44496        desret_int(ret_val);
44497        call_tests++;
44498        des_xmlTextWriterPtr(n_writer, writer, 0);
44499        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44500        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44501        xmlResetLastError();
44502        if (mem_base != xmlMemBlocks()) {
44503            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44504	           xmlMemBlocks() - mem_base);
44505	    test_ret++;
44506            printf(" %d", n_writer);
44507            printf(" %d", n_name);
44508            printf(" %d", n_content);
44509            printf("\n");
44510        }
44511    }
44512    }
44513    }
44514    function_tests++;
44515#endif
44516
44517    return(test_ret);
44518}
44519
44520
44521static int
44522test_xmlTextWriterWriteDTDEntity(void) {
44523    int test_ret = 0;
44524
44525#if defined(LIBXML_WRITER_ENABLED)
44526    int mem_base;
44527    int ret_val;
44528    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44529    int n_writer;
44530    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44531    int n_pe;
44532    xmlChar * name; /* the name of the DTD entity */
44533    int n_name;
44534    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44535    int n_pubid;
44536    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44537    int n_sysid;
44538    xmlChar * ndataid; /* the xml notation name. */
44539    int n_ndataid;
44540    xmlChar * content; /* content of the entity */
44541    int n_content;
44542
44543    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44544    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44545    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44546    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44547    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44548    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44549    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44550        mem_base = xmlMemBlocks();
44551        writer = gen_xmlTextWriterPtr(n_writer, 0);
44552        pe = gen_int(n_pe, 1);
44553        name = gen_const_xmlChar_ptr(n_name, 2);
44554        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44555        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44556        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44557        content = gen_const_xmlChar_ptr(n_content, 6);
44558
44559        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44560        desret_int(ret_val);
44561        call_tests++;
44562        des_xmlTextWriterPtr(n_writer, writer, 0);
44563        des_int(n_pe, pe, 1);
44564        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44565        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44566        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44567        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44568        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44569        xmlResetLastError();
44570        if (mem_base != xmlMemBlocks()) {
44571            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44572	           xmlMemBlocks() - mem_base);
44573	    test_ret++;
44574            printf(" %d", n_writer);
44575            printf(" %d", n_pe);
44576            printf(" %d", n_name);
44577            printf(" %d", n_pubid);
44578            printf(" %d", n_sysid);
44579            printf(" %d", n_ndataid);
44580            printf(" %d", n_content);
44581            printf("\n");
44582        }
44583    }
44584    }
44585    }
44586    }
44587    }
44588    }
44589    }
44590    function_tests++;
44591#endif
44592
44593    return(test_ret);
44594}
44595
44596
44597static int
44598test_xmlTextWriterWriteDTDExternalEntity(void) {
44599    int test_ret = 0;
44600
44601#if defined(LIBXML_WRITER_ENABLED)
44602    int mem_base;
44603    int ret_val;
44604    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44605    int n_writer;
44606    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44607    int n_pe;
44608    xmlChar * name; /* the name of the DTD entity */
44609    int n_name;
44610    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44611    int n_pubid;
44612    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44613    int n_sysid;
44614    xmlChar * ndataid; /* the xml notation name. */
44615    int n_ndataid;
44616
44617    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44618    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44619    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44620    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44621    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44622    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44623        mem_base = xmlMemBlocks();
44624        writer = gen_xmlTextWriterPtr(n_writer, 0);
44625        pe = gen_int(n_pe, 1);
44626        name = gen_const_xmlChar_ptr(n_name, 2);
44627        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44628        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44629        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44630
44631        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44632        desret_int(ret_val);
44633        call_tests++;
44634        des_xmlTextWriterPtr(n_writer, writer, 0);
44635        des_int(n_pe, pe, 1);
44636        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44637        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44638        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44639        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44640        xmlResetLastError();
44641        if (mem_base != xmlMemBlocks()) {
44642            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44643	           xmlMemBlocks() - mem_base);
44644	    test_ret++;
44645            printf(" %d", n_writer);
44646            printf(" %d", n_pe);
44647            printf(" %d", n_name);
44648            printf(" %d", n_pubid);
44649            printf(" %d", n_sysid);
44650            printf(" %d", n_ndataid);
44651            printf("\n");
44652        }
44653    }
44654    }
44655    }
44656    }
44657    }
44658    }
44659    function_tests++;
44660#endif
44661
44662    return(test_ret);
44663}
44664
44665
44666static int
44667test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44668    int test_ret = 0;
44669
44670#if defined(LIBXML_WRITER_ENABLED)
44671    int mem_base;
44672    int ret_val;
44673    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44674    int n_writer;
44675    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44676    int n_pubid;
44677    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44678    int n_sysid;
44679    xmlChar * ndataid; /* the xml notation name. */
44680    int n_ndataid;
44681
44682    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44683    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44684    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44685    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44686        mem_base = xmlMemBlocks();
44687        writer = gen_xmlTextWriterPtr(n_writer, 0);
44688        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44689        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44690        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44691
44692        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44693        desret_int(ret_val);
44694        call_tests++;
44695        des_xmlTextWriterPtr(n_writer, writer, 0);
44696        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44697        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44698        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44699        xmlResetLastError();
44700        if (mem_base != xmlMemBlocks()) {
44701            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44702	           xmlMemBlocks() - mem_base);
44703	    test_ret++;
44704            printf(" %d", n_writer);
44705            printf(" %d", n_pubid);
44706            printf(" %d", n_sysid);
44707            printf(" %d", n_ndataid);
44708            printf("\n");
44709        }
44710    }
44711    }
44712    }
44713    }
44714    function_tests++;
44715#endif
44716
44717    return(test_ret);
44718}
44719
44720
44721static int
44722test_xmlTextWriterWriteDTDInternalEntity(void) {
44723    int test_ret = 0;
44724
44725#if defined(LIBXML_WRITER_ENABLED)
44726    int mem_base;
44727    int ret_val;
44728    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44729    int n_writer;
44730    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44731    int n_pe;
44732    xmlChar * name; /* the name of the DTD entity */
44733    int n_name;
44734    xmlChar * content; /* content of the entity */
44735    int n_content;
44736
44737    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44738    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44739    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44740    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44741        mem_base = xmlMemBlocks();
44742        writer = gen_xmlTextWriterPtr(n_writer, 0);
44743        pe = gen_int(n_pe, 1);
44744        name = gen_const_xmlChar_ptr(n_name, 2);
44745        content = gen_const_xmlChar_ptr(n_content, 3);
44746
44747        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44748        desret_int(ret_val);
44749        call_tests++;
44750        des_xmlTextWriterPtr(n_writer, writer, 0);
44751        des_int(n_pe, pe, 1);
44752        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44753        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44754        xmlResetLastError();
44755        if (mem_base != xmlMemBlocks()) {
44756            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44757	           xmlMemBlocks() - mem_base);
44758	    test_ret++;
44759            printf(" %d", n_writer);
44760            printf(" %d", n_pe);
44761            printf(" %d", n_name);
44762            printf(" %d", n_content);
44763            printf("\n");
44764        }
44765    }
44766    }
44767    }
44768    }
44769    function_tests++;
44770#endif
44771
44772    return(test_ret);
44773}
44774
44775
44776static int
44777test_xmlTextWriterWriteDTDNotation(void) {
44778    int test_ret = 0;
44779
44780#if defined(LIBXML_WRITER_ENABLED)
44781    int mem_base;
44782    int ret_val;
44783    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44784    int n_writer;
44785    xmlChar * name; /* the name of the xml notation */
44786    int n_name;
44787    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44788    int n_pubid;
44789    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44790    int n_sysid;
44791
44792    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44793    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44794    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44795    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44796        mem_base = xmlMemBlocks();
44797        writer = gen_xmlTextWriterPtr(n_writer, 0);
44798        name = gen_const_xmlChar_ptr(n_name, 1);
44799        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44800        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44801
44802        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44803        desret_int(ret_val);
44804        call_tests++;
44805        des_xmlTextWriterPtr(n_writer, writer, 0);
44806        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44807        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44808        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44809        xmlResetLastError();
44810        if (mem_base != xmlMemBlocks()) {
44811            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44812	           xmlMemBlocks() - mem_base);
44813	    test_ret++;
44814            printf(" %d", n_writer);
44815            printf(" %d", n_name);
44816            printf(" %d", n_pubid);
44817            printf(" %d", n_sysid);
44818            printf("\n");
44819        }
44820    }
44821    }
44822    }
44823    }
44824    function_tests++;
44825#endif
44826
44827    return(test_ret);
44828}
44829
44830
44831static int
44832test_xmlTextWriterWriteElement(void) {
44833    int test_ret = 0;
44834
44835#if defined(LIBXML_WRITER_ENABLED)
44836    int mem_base;
44837    int ret_val;
44838    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44839    int n_writer;
44840    xmlChar * name; /* element name */
44841    int n_name;
44842    xmlChar * content; /* element content */
44843    int n_content;
44844
44845    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44846    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44847    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44848        mem_base = xmlMemBlocks();
44849        writer = gen_xmlTextWriterPtr(n_writer, 0);
44850        name = gen_const_xmlChar_ptr(n_name, 1);
44851        content = gen_const_xmlChar_ptr(n_content, 2);
44852
44853        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44854        desret_int(ret_val);
44855        call_tests++;
44856        des_xmlTextWriterPtr(n_writer, writer, 0);
44857        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44858        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44859        xmlResetLastError();
44860        if (mem_base != xmlMemBlocks()) {
44861            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44862	           xmlMemBlocks() - mem_base);
44863	    test_ret++;
44864            printf(" %d", n_writer);
44865            printf(" %d", n_name);
44866            printf(" %d", n_content);
44867            printf("\n");
44868        }
44869    }
44870    }
44871    }
44872    function_tests++;
44873#endif
44874
44875    return(test_ret);
44876}
44877
44878
44879static int
44880test_xmlTextWriterWriteElementNS(void) {
44881    int test_ret = 0;
44882
44883#if defined(LIBXML_WRITER_ENABLED)
44884    int mem_base;
44885    int ret_val;
44886    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44887    int n_writer;
44888    xmlChar * prefix; /* namespace prefix */
44889    int n_prefix;
44890    xmlChar * name; /* element local name */
44891    int n_name;
44892    xmlChar * namespaceURI; /* namespace URI */
44893    int n_namespaceURI;
44894    xmlChar * content; /* element content */
44895    int n_content;
44896
44897    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44898    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44899    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44900    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44901    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44902        mem_base = xmlMemBlocks();
44903        writer = gen_xmlTextWriterPtr(n_writer, 0);
44904        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44905        name = gen_const_xmlChar_ptr(n_name, 2);
44906        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44907        content = gen_const_xmlChar_ptr(n_content, 4);
44908
44909        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44910        desret_int(ret_val);
44911        call_tests++;
44912        des_xmlTextWriterPtr(n_writer, writer, 0);
44913        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44914        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44915        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44916        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44917        xmlResetLastError();
44918        if (mem_base != xmlMemBlocks()) {
44919            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44920	           xmlMemBlocks() - mem_base);
44921	    test_ret++;
44922            printf(" %d", n_writer);
44923            printf(" %d", n_prefix);
44924            printf(" %d", n_name);
44925            printf(" %d", n_namespaceURI);
44926            printf(" %d", n_content);
44927            printf("\n");
44928        }
44929    }
44930    }
44931    }
44932    }
44933    }
44934    function_tests++;
44935#endif
44936
44937    return(test_ret);
44938}
44939
44940
44941static int
44942test_xmlTextWriterWriteFormatAttribute(void) {
44943    int test_ret = 0;
44944
44945
44946    /* missing type support */
44947    return(test_ret);
44948}
44949
44950
44951static int
44952test_xmlTextWriterWriteFormatAttributeNS(void) {
44953    int test_ret = 0;
44954
44955
44956    /* missing type support */
44957    return(test_ret);
44958}
44959
44960
44961static int
44962test_xmlTextWriterWriteFormatCDATA(void) {
44963    int test_ret = 0;
44964
44965
44966    /* missing type support */
44967    return(test_ret);
44968}
44969
44970
44971static int
44972test_xmlTextWriterWriteFormatComment(void) {
44973    int test_ret = 0;
44974
44975
44976    /* missing type support */
44977    return(test_ret);
44978}
44979
44980
44981static int
44982test_xmlTextWriterWriteFormatDTD(void) {
44983    int test_ret = 0;
44984
44985
44986    /* missing type support */
44987    return(test_ret);
44988}
44989
44990
44991static int
44992test_xmlTextWriterWriteFormatDTDAttlist(void) {
44993    int test_ret = 0;
44994
44995
44996    /* missing type support */
44997    return(test_ret);
44998}
44999
45000
45001static int
45002test_xmlTextWriterWriteFormatDTDElement(void) {
45003    int test_ret = 0;
45004
45005
45006    /* missing type support */
45007    return(test_ret);
45008}
45009
45010
45011static int
45012test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
45013    int test_ret = 0;
45014
45015
45016    /* missing type support */
45017    return(test_ret);
45018}
45019
45020
45021static int
45022test_xmlTextWriterWriteFormatElement(void) {
45023    int test_ret = 0;
45024
45025
45026    /* missing type support */
45027    return(test_ret);
45028}
45029
45030
45031static int
45032test_xmlTextWriterWriteFormatElementNS(void) {
45033    int test_ret = 0;
45034
45035
45036    /* missing type support */
45037    return(test_ret);
45038}
45039
45040
45041static int
45042test_xmlTextWriterWriteFormatPI(void) {
45043    int test_ret = 0;
45044
45045
45046    /* missing type support */
45047    return(test_ret);
45048}
45049
45050
45051static int
45052test_xmlTextWriterWriteFormatRaw(void) {
45053    int test_ret = 0;
45054
45055
45056    /* missing type support */
45057    return(test_ret);
45058}
45059
45060
45061static int
45062test_xmlTextWriterWriteFormatString(void) {
45063    int test_ret = 0;
45064
45065
45066    /* missing type support */
45067    return(test_ret);
45068}
45069
45070
45071static int
45072test_xmlTextWriterWritePI(void) {
45073    int test_ret = 0;
45074
45075#if defined(LIBXML_WRITER_ENABLED)
45076    int mem_base;
45077    int ret_val;
45078    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45079    int n_writer;
45080    xmlChar * target; /* PI target */
45081    int n_target;
45082    xmlChar * content; /* PI content */
45083    int n_content;
45084
45085    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45086    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
45087    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45088        mem_base = xmlMemBlocks();
45089        writer = gen_xmlTextWriterPtr(n_writer, 0);
45090        target = gen_const_xmlChar_ptr(n_target, 1);
45091        content = gen_const_xmlChar_ptr(n_content, 2);
45092
45093        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
45094        desret_int(ret_val);
45095        call_tests++;
45096        des_xmlTextWriterPtr(n_writer, writer, 0);
45097        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
45098        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
45099        xmlResetLastError();
45100        if (mem_base != xmlMemBlocks()) {
45101            printf("Leak of %d blocks found in xmlTextWriterWritePI",
45102	           xmlMemBlocks() - mem_base);
45103	    test_ret++;
45104            printf(" %d", n_writer);
45105            printf(" %d", n_target);
45106            printf(" %d", n_content);
45107            printf("\n");
45108        }
45109    }
45110    }
45111    }
45112    function_tests++;
45113#endif
45114
45115    return(test_ret);
45116}
45117
45118
45119static int
45120test_xmlTextWriterWriteRaw(void) {
45121    int test_ret = 0;
45122
45123#if defined(LIBXML_WRITER_ENABLED)
45124    int mem_base;
45125    int ret_val;
45126    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45127    int n_writer;
45128    xmlChar * content; /* text string */
45129    int n_content;
45130
45131    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45132    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45133        mem_base = xmlMemBlocks();
45134        writer = gen_xmlTextWriterPtr(n_writer, 0);
45135        content = gen_const_xmlChar_ptr(n_content, 1);
45136
45137        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
45138        desret_int(ret_val);
45139        call_tests++;
45140        des_xmlTextWriterPtr(n_writer, writer, 0);
45141        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45142        xmlResetLastError();
45143        if (mem_base != xmlMemBlocks()) {
45144            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
45145	           xmlMemBlocks() - mem_base);
45146	    test_ret++;
45147            printf(" %d", n_writer);
45148            printf(" %d", n_content);
45149            printf("\n");
45150        }
45151    }
45152    }
45153    function_tests++;
45154#endif
45155
45156    return(test_ret);
45157}
45158
45159
45160static int
45161test_xmlTextWriterWriteRawLen(void) {
45162    int test_ret = 0;
45163
45164#if defined(LIBXML_WRITER_ENABLED)
45165    int mem_base;
45166    int ret_val;
45167    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45168    int n_writer;
45169    xmlChar * content; /* text string */
45170    int n_content;
45171    int len; /* length of the text string */
45172    int n_len;
45173
45174    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45175    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45176    for (n_len = 0;n_len < gen_nb_int;n_len++) {
45177        mem_base = xmlMemBlocks();
45178        writer = gen_xmlTextWriterPtr(n_writer, 0);
45179        content = gen_const_xmlChar_ptr(n_content, 1);
45180        len = gen_int(n_len, 2);
45181
45182        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
45183        desret_int(ret_val);
45184        call_tests++;
45185        des_xmlTextWriterPtr(n_writer, writer, 0);
45186        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45187        des_int(n_len, len, 2);
45188        xmlResetLastError();
45189        if (mem_base != xmlMemBlocks()) {
45190            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
45191	           xmlMemBlocks() - mem_base);
45192	    test_ret++;
45193            printf(" %d", n_writer);
45194            printf(" %d", n_content);
45195            printf(" %d", n_len);
45196            printf("\n");
45197        }
45198    }
45199    }
45200    }
45201    function_tests++;
45202#endif
45203
45204    return(test_ret);
45205}
45206
45207
45208static int
45209test_xmlTextWriterWriteString(void) {
45210    int test_ret = 0;
45211
45212#if defined(LIBXML_WRITER_ENABLED)
45213    int mem_base;
45214    int ret_val;
45215    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
45216    int n_writer;
45217    xmlChar * content; /* text string */
45218    int n_content;
45219
45220    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45221    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45222        mem_base = xmlMemBlocks();
45223        writer = gen_xmlTextWriterPtr(n_writer, 0);
45224        content = gen_const_xmlChar_ptr(n_content, 1);
45225
45226        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45227        desret_int(ret_val);
45228        call_tests++;
45229        des_xmlTextWriterPtr(n_writer, writer, 0);
45230        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45231        xmlResetLastError();
45232        if (mem_base != xmlMemBlocks()) {
45233            printf("Leak of %d blocks found in xmlTextWriterWriteString",
45234	           xmlMemBlocks() - mem_base);
45235	    test_ret++;
45236            printf(" %d", n_writer);
45237            printf(" %d", n_content);
45238            printf("\n");
45239        }
45240    }
45241    }
45242    function_tests++;
45243#endif
45244
45245    return(test_ret);
45246}
45247
45248
45249static int
45250test_xmlTextWriterWriteVFormatAttribute(void) {
45251    int test_ret = 0;
45252
45253
45254    /* missing type support */
45255    return(test_ret);
45256}
45257
45258
45259static int
45260test_xmlTextWriterWriteVFormatAttributeNS(void) {
45261    int test_ret = 0;
45262
45263
45264    /* missing type support */
45265    return(test_ret);
45266}
45267
45268
45269static int
45270test_xmlTextWriterWriteVFormatCDATA(void) {
45271    int test_ret = 0;
45272
45273
45274    /* missing type support */
45275    return(test_ret);
45276}
45277
45278
45279static int
45280test_xmlTextWriterWriteVFormatComment(void) {
45281    int test_ret = 0;
45282
45283
45284    /* missing type support */
45285    return(test_ret);
45286}
45287
45288
45289static int
45290test_xmlTextWriterWriteVFormatDTD(void) {
45291    int test_ret = 0;
45292
45293
45294    /* missing type support */
45295    return(test_ret);
45296}
45297
45298
45299static int
45300test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45301    int test_ret = 0;
45302
45303
45304    /* missing type support */
45305    return(test_ret);
45306}
45307
45308
45309static int
45310test_xmlTextWriterWriteVFormatDTDElement(void) {
45311    int test_ret = 0;
45312
45313
45314    /* missing type support */
45315    return(test_ret);
45316}
45317
45318
45319static int
45320test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45321    int test_ret = 0;
45322
45323
45324    /* missing type support */
45325    return(test_ret);
45326}
45327
45328
45329static int
45330test_xmlTextWriterWriteVFormatElement(void) {
45331    int test_ret = 0;
45332
45333
45334    /* missing type support */
45335    return(test_ret);
45336}
45337
45338
45339static int
45340test_xmlTextWriterWriteVFormatElementNS(void) {
45341    int test_ret = 0;
45342
45343
45344    /* missing type support */
45345    return(test_ret);
45346}
45347
45348
45349static int
45350test_xmlTextWriterWriteVFormatPI(void) {
45351    int test_ret = 0;
45352
45353
45354    /* missing type support */
45355    return(test_ret);
45356}
45357
45358
45359static int
45360test_xmlTextWriterWriteVFormatRaw(void) {
45361    int test_ret = 0;
45362
45363
45364    /* missing type support */
45365    return(test_ret);
45366}
45367
45368
45369static int
45370test_xmlTextWriterWriteVFormatString(void) {
45371    int test_ret = 0;
45372
45373
45374    /* missing type support */
45375    return(test_ret);
45376}
45377
45378static int
45379test_xmlwriter(void) {
45380    int test_ret = 0;
45381
45382    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45383    test_ret += test_xmlNewTextWriter();
45384    test_ret += test_xmlNewTextWriterFilename();
45385    test_ret += test_xmlNewTextWriterMemory();
45386    test_ret += test_xmlNewTextWriterPushParser();
45387    test_ret += test_xmlNewTextWriterTree();
45388    test_ret += test_xmlTextWriterEndAttribute();
45389    test_ret += test_xmlTextWriterEndCDATA();
45390    test_ret += test_xmlTextWriterEndComment();
45391    test_ret += test_xmlTextWriterEndDTD();
45392    test_ret += test_xmlTextWriterEndDTDAttlist();
45393    test_ret += test_xmlTextWriterEndDTDElement();
45394    test_ret += test_xmlTextWriterEndDTDEntity();
45395    test_ret += test_xmlTextWriterEndDocument();
45396    test_ret += test_xmlTextWriterEndElement();
45397    test_ret += test_xmlTextWriterEndPI();
45398    test_ret += test_xmlTextWriterFlush();
45399    test_ret += test_xmlTextWriterFullEndElement();
45400    test_ret += test_xmlTextWriterSetIndent();
45401    test_ret += test_xmlTextWriterSetIndentString();
45402    test_ret += test_xmlTextWriterStartAttribute();
45403    test_ret += test_xmlTextWriterStartAttributeNS();
45404    test_ret += test_xmlTextWriterStartCDATA();
45405    test_ret += test_xmlTextWriterStartComment();
45406    test_ret += test_xmlTextWriterStartDTD();
45407    test_ret += test_xmlTextWriterStartDTDAttlist();
45408    test_ret += test_xmlTextWriterStartDTDElement();
45409    test_ret += test_xmlTextWriterStartDTDEntity();
45410    test_ret += test_xmlTextWriterStartDocument();
45411    test_ret += test_xmlTextWriterStartElement();
45412    test_ret += test_xmlTextWriterStartElementNS();
45413    test_ret += test_xmlTextWriterStartPI();
45414    test_ret += test_xmlTextWriterWriteAttribute();
45415    test_ret += test_xmlTextWriterWriteAttributeNS();
45416    test_ret += test_xmlTextWriterWriteBase64();
45417    test_ret += test_xmlTextWriterWriteBinHex();
45418    test_ret += test_xmlTextWriterWriteCDATA();
45419    test_ret += test_xmlTextWriterWriteComment();
45420    test_ret += test_xmlTextWriterWriteDTD();
45421    test_ret += test_xmlTextWriterWriteDTDAttlist();
45422    test_ret += test_xmlTextWriterWriteDTDElement();
45423    test_ret += test_xmlTextWriterWriteDTDEntity();
45424    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45425    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45426    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45427    test_ret += test_xmlTextWriterWriteDTDNotation();
45428    test_ret += test_xmlTextWriterWriteElement();
45429    test_ret += test_xmlTextWriterWriteElementNS();
45430    test_ret += test_xmlTextWriterWriteFormatAttribute();
45431    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45432    test_ret += test_xmlTextWriterWriteFormatCDATA();
45433    test_ret += test_xmlTextWriterWriteFormatComment();
45434    test_ret += test_xmlTextWriterWriteFormatDTD();
45435    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45436    test_ret += test_xmlTextWriterWriteFormatDTDElement();
45437    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45438    test_ret += test_xmlTextWriterWriteFormatElement();
45439    test_ret += test_xmlTextWriterWriteFormatElementNS();
45440    test_ret += test_xmlTextWriterWriteFormatPI();
45441    test_ret += test_xmlTextWriterWriteFormatRaw();
45442    test_ret += test_xmlTextWriterWriteFormatString();
45443    test_ret += test_xmlTextWriterWritePI();
45444    test_ret += test_xmlTextWriterWriteRaw();
45445    test_ret += test_xmlTextWriterWriteRawLen();
45446    test_ret += test_xmlTextWriterWriteString();
45447    test_ret += test_xmlTextWriterWriteVFormatAttribute();
45448    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45449    test_ret += test_xmlTextWriterWriteVFormatCDATA();
45450    test_ret += test_xmlTextWriterWriteVFormatComment();
45451    test_ret += test_xmlTextWriterWriteVFormatDTD();
45452    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45453    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45454    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45455    test_ret += test_xmlTextWriterWriteVFormatElement();
45456    test_ret += test_xmlTextWriterWriteVFormatElementNS();
45457    test_ret += test_xmlTextWriterWriteVFormatPI();
45458    test_ret += test_xmlTextWriterWriteVFormatRaw();
45459    test_ret += test_xmlTextWriterWriteVFormatString();
45460
45461    if (test_ret != 0)
45462	printf("Module xmlwriter: %d errors\n", test_ret);
45463    return(test_ret);
45464}
45465
45466static int
45467test_xmlXPathCastBooleanToNumber(void) {
45468    int test_ret = 0;
45469
45470#if defined(LIBXML_XPATH_ENABLED)
45471    int mem_base;
45472    double ret_val;
45473    int val; /* a boolean */
45474    int n_val;
45475
45476    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45477        mem_base = xmlMemBlocks();
45478        val = gen_int(n_val, 0);
45479
45480        ret_val = xmlXPathCastBooleanToNumber(val);
45481        desret_double(ret_val);
45482        call_tests++;
45483        des_int(n_val, val, 0);
45484        xmlResetLastError();
45485        if (mem_base != xmlMemBlocks()) {
45486            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45487	           xmlMemBlocks() - mem_base);
45488	    test_ret++;
45489            printf(" %d", n_val);
45490            printf("\n");
45491        }
45492    }
45493    function_tests++;
45494#endif
45495
45496    return(test_ret);
45497}
45498
45499
45500static int
45501test_xmlXPathCastBooleanToString(void) {
45502    int test_ret = 0;
45503
45504#if defined(LIBXML_XPATH_ENABLED)
45505    int mem_base;
45506    xmlChar * ret_val;
45507    int val; /* a boolean */
45508    int n_val;
45509
45510    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45511        mem_base = xmlMemBlocks();
45512        val = gen_int(n_val, 0);
45513
45514        ret_val = xmlXPathCastBooleanToString(val);
45515        desret_xmlChar_ptr(ret_val);
45516        call_tests++;
45517        des_int(n_val, val, 0);
45518        xmlResetLastError();
45519        if (mem_base != xmlMemBlocks()) {
45520            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45521	           xmlMemBlocks() - mem_base);
45522	    test_ret++;
45523            printf(" %d", n_val);
45524            printf("\n");
45525        }
45526    }
45527    function_tests++;
45528#endif
45529
45530    return(test_ret);
45531}
45532
45533
45534static int
45535test_xmlXPathCastNodeSetToBoolean(void) {
45536    int test_ret = 0;
45537
45538#if defined(LIBXML_XPATH_ENABLED)
45539    int mem_base;
45540    int ret_val;
45541    xmlNodeSetPtr ns; /* a node-set */
45542    int n_ns;
45543
45544    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45545        mem_base = xmlMemBlocks();
45546        ns = gen_xmlNodeSetPtr(n_ns, 0);
45547
45548        ret_val = xmlXPathCastNodeSetToBoolean(ns);
45549        desret_int(ret_val);
45550        call_tests++;
45551        des_xmlNodeSetPtr(n_ns, ns, 0);
45552        xmlResetLastError();
45553        if (mem_base != xmlMemBlocks()) {
45554            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45555	           xmlMemBlocks() - mem_base);
45556	    test_ret++;
45557            printf(" %d", n_ns);
45558            printf("\n");
45559        }
45560    }
45561    function_tests++;
45562#endif
45563
45564    return(test_ret);
45565}
45566
45567
45568static int
45569test_xmlXPathCastNodeSetToNumber(void) {
45570    int test_ret = 0;
45571
45572#if defined(LIBXML_XPATH_ENABLED)
45573    int mem_base;
45574    double ret_val;
45575    xmlNodeSetPtr ns; /* a node-set */
45576    int n_ns;
45577
45578    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45579        mem_base = xmlMemBlocks();
45580        ns = gen_xmlNodeSetPtr(n_ns, 0);
45581
45582        ret_val = xmlXPathCastNodeSetToNumber(ns);
45583        desret_double(ret_val);
45584        call_tests++;
45585        des_xmlNodeSetPtr(n_ns, ns, 0);
45586        xmlResetLastError();
45587        if (mem_base != xmlMemBlocks()) {
45588            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45589	           xmlMemBlocks() - mem_base);
45590	    test_ret++;
45591            printf(" %d", n_ns);
45592            printf("\n");
45593        }
45594    }
45595    function_tests++;
45596#endif
45597
45598    return(test_ret);
45599}
45600
45601
45602static int
45603test_xmlXPathCastNodeSetToString(void) {
45604    int test_ret = 0;
45605
45606#if defined(LIBXML_XPATH_ENABLED)
45607    int mem_base;
45608    xmlChar * ret_val;
45609    xmlNodeSetPtr ns; /* a node-set */
45610    int n_ns;
45611
45612    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45613        mem_base = xmlMemBlocks();
45614        ns = gen_xmlNodeSetPtr(n_ns, 0);
45615
45616        ret_val = xmlXPathCastNodeSetToString(ns);
45617        desret_xmlChar_ptr(ret_val);
45618        call_tests++;
45619        des_xmlNodeSetPtr(n_ns, ns, 0);
45620        xmlResetLastError();
45621        if (mem_base != xmlMemBlocks()) {
45622            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45623	           xmlMemBlocks() - mem_base);
45624	    test_ret++;
45625            printf(" %d", n_ns);
45626            printf("\n");
45627        }
45628    }
45629    function_tests++;
45630#endif
45631
45632    return(test_ret);
45633}
45634
45635
45636static int
45637test_xmlXPathCastNodeToNumber(void) {
45638    int test_ret = 0;
45639
45640#if defined(LIBXML_XPATH_ENABLED)
45641    int mem_base;
45642    double ret_val;
45643    xmlNodePtr node; /* a node */
45644    int n_node;
45645
45646    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45647        mem_base = xmlMemBlocks();
45648        node = gen_xmlNodePtr(n_node, 0);
45649
45650        ret_val = xmlXPathCastNodeToNumber(node);
45651        desret_double(ret_val);
45652        call_tests++;
45653        des_xmlNodePtr(n_node, node, 0);
45654        xmlResetLastError();
45655        if (mem_base != xmlMemBlocks()) {
45656            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45657	           xmlMemBlocks() - mem_base);
45658	    test_ret++;
45659            printf(" %d", n_node);
45660            printf("\n");
45661        }
45662    }
45663    function_tests++;
45664#endif
45665
45666    return(test_ret);
45667}
45668
45669
45670static int
45671test_xmlXPathCastNodeToString(void) {
45672    int test_ret = 0;
45673
45674#if defined(LIBXML_XPATH_ENABLED)
45675    int mem_base;
45676    xmlChar * ret_val;
45677    xmlNodePtr node; /* a node */
45678    int n_node;
45679
45680    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45681        mem_base = xmlMemBlocks();
45682        node = gen_xmlNodePtr(n_node, 0);
45683
45684        ret_val = xmlXPathCastNodeToString(node);
45685        desret_xmlChar_ptr(ret_val);
45686        call_tests++;
45687        des_xmlNodePtr(n_node, node, 0);
45688        xmlResetLastError();
45689        if (mem_base != xmlMemBlocks()) {
45690            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45691	           xmlMemBlocks() - mem_base);
45692	    test_ret++;
45693            printf(" %d", n_node);
45694            printf("\n");
45695        }
45696    }
45697    function_tests++;
45698#endif
45699
45700    return(test_ret);
45701}
45702
45703
45704static int
45705test_xmlXPathCastNumberToBoolean(void) {
45706    int test_ret = 0;
45707
45708#if defined(LIBXML_XPATH_ENABLED)
45709    int mem_base;
45710    int ret_val;
45711    double val; /* a number */
45712    int n_val;
45713
45714    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45715        mem_base = xmlMemBlocks();
45716        val = gen_double(n_val, 0);
45717
45718        ret_val = xmlXPathCastNumberToBoolean(val);
45719        desret_int(ret_val);
45720        call_tests++;
45721        des_double(n_val, val, 0);
45722        xmlResetLastError();
45723        if (mem_base != xmlMemBlocks()) {
45724            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45725	           xmlMemBlocks() - mem_base);
45726	    test_ret++;
45727            printf(" %d", n_val);
45728            printf("\n");
45729        }
45730    }
45731    function_tests++;
45732#endif
45733
45734    return(test_ret);
45735}
45736
45737
45738static int
45739test_xmlXPathCastNumberToString(void) {
45740    int test_ret = 0;
45741
45742#if defined(LIBXML_XPATH_ENABLED)
45743    int mem_base;
45744    xmlChar * ret_val;
45745    double val; /* a number */
45746    int n_val;
45747
45748    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45749        mem_base = xmlMemBlocks();
45750        val = gen_double(n_val, 0);
45751
45752        ret_val = xmlXPathCastNumberToString(val);
45753        desret_xmlChar_ptr(ret_val);
45754        call_tests++;
45755        des_double(n_val, val, 0);
45756        xmlResetLastError();
45757        if (mem_base != xmlMemBlocks()) {
45758            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45759	           xmlMemBlocks() - mem_base);
45760	    test_ret++;
45761            printf(" %d", n_val);
45762            printf("\n");
45763        }
45764    }
45765    function_tests++;
45766#endif
45767
45768    return(test_ret);
45769}
45770
45771
45772static int
45773test_xmlXPathCastStringToBoolean(void) {
45774    int test_ret = 0;
45775
45776#if defined(LIBXML_XPATH_ENABLED)
45777    int mem_base;
45778    int ret_val;
45779    xmlChar * val; /* a string */
45780    int n_val;
45781
45782    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45783        mem_base = xmlMemBlocks();
45784        val = gen_const_xmlChar_ptr(n_val, 0);
45785
45786        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45787        desret_int(ret_val);
45788        call_tests++;
45789        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45790        xmlResetLastError();
45791        if (mem_base != xmlMemBlocks()) {
45792            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45793	           xmlMemBlocks() - mem_base);
45794	    test_ret++;
45795            printf(" %d", n_val);
45796            printf("\n");
45797        }
45798    }
45799    function_tests++;
45800#endif
45801
45802    return(test_ret);
45803}
45804
45805
45806static int
45807test_xmlXPathCastStringToNumber(void) {
45808    int test_ret = 0;
45809
45810#if defined(LIBXML_XPATH_ENABLED)
45811    int mem_base;
45812    double ret_val;
45813    xmlChar * val; /* a string */
45814    int n_val;
45815
45816    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45817        mem_base = xmlMemBlocks();
45818        val = gen_const_xmlChar_ptr(n_val, 0);
45819
45820        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45821        desret_double(ret_val);
45822        call_tests++;
45823        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45824        xmlResetLastError();
45825        if (mem_base != xmlMemBlocks()) {
45826            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45827	           xmlMemBlocks() - mem_base);
45828	    test_ret++;
45829            printf(" %d", n_val);
45830            printf("\n");
45831        }
45832    }
45833    function_tests++;
45834#endif
45835
45836    return(test_ret);
45837}
45838
45839
45840static int
45841test_xmlXPathCastToBoolean(void) {
45842    int test_ret = 0;
45843
45844#if defined(LIBXML_XPATH_ENABLED)
45845    int mem_base;
45846    int ret_val;
45847    xmlXPathObjectPtr val; /* an XPath object */
45848    int n_val;
45849
45850    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45851        mem_base = xmlMemBlocks();
45852        val = gen_xmlXPathObjectPtr(n_val, 0);
45853
45854        ret_val = xmlXPathCastToBoolean(val);
45855        desret_int(ret_val);
45856        call_tests++;
45857        des_xmlXPathObjectPtr(n_val, val, 0);
45858        xmlResetLastError();
45859        if (mem_base != xmlMemBlocks()) {
45860            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45861	           xmlMemBlocks() - mem_base);
45862	    test_ret++;
45863            printf(" %d", n_val);
45864            printf("\n");
45865        }
45866    }
45867    function_tests++;
45868#endif
45869
45870    return(test_ret);
45871}
45872
45873
45874static int
45875test_xmlXPathCastToNumber(void) {
45876    int test_ret = 0;
45877
45878#if defined(LIBXML_XPATH_ENABLED)
45879    int mem_base;
45880    double ret_val;
45881    xmlXPathObjectPtr val; /* an XPath object */
45882    int n_val;
45883
45884    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45885        mem_base = xmlMemBlocks();
45886        val = gen_xmlXPathObjectPtr(n_val, 0);
45887
45888        ret_val = xmlXPathCastToNumber(val);
45889        desret_double(ret_val);
45890        call_tests++;
45891        des_xmlXPathObjectPtr(n_val, val, 0);
45892        xmlResetLastError();
45893        if (mem_base != xmlMemBlocks()) {
45894            printf("Leak of %d blocks found in xmlXPathCastToNumber",
45895	           xmlMemBlocks() - mem_base);
45896	    test_ret++;
45897            printf(" %d", n_val);
45898            printf("\n");
45899        }
45900    }
45901    function_tests++;
45902#endif
45903
45904    return(test_ret);
45905}
45906
45907
45908static int
45909test_xmlXPathCastToString(void) {
45910    int test_ret = 0;
45911
45912#if defined(LIBXML_XPATH_ENABLED)
45913    int mem_base;
45914    xmlChar * ret_val;
45915    xmlXPathObjectPtr val; /* an XPath object */
45916    int n_val;
45917
45918    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45919        mem_base = xmlMemBlocks();
45920        val = gen_xmlXPathObjectPtr(n_val, 0);
45921
45922        ret_val = xmlXPathCastToString(val);
45923        desret_xmlChar_ptr(ret_val);
45924        call_tests++;
45925        des_xmlXPathObjectPtr(n_val, val, 0);
45926        xmlResetLastError();
45927        if (mem_base != xmlMemBlocks()) {
45928            printf("Leak of %d blocks found in xmlXPathCastToString",
45929	           xmlMemBlocks() - mem_base);
45930	    test_ret++;
45931            printf(" %d", n_val);
45932            printf("\n");
45933        }
45934    }
45935    function_tests++;
45936#endif
45937
45938    return(test_ret);
45939}
45940
45941
45942static int
45943test_xmlXPathCmpNodes(void) {
45944    int test_ret = 0;
45945
45946#if defined(LIBXML_XPATH_ENABLED)
45947    int mem_base;
45948    int ret_val;
45949    xmlNodePtr node1; /* the first node */
45950    int n_node1;
45951    xmlNodePtr node2; /* the second node */
45952    int n_node2;
45953
45954    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45955    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45956        mem_base = xmlMemBlocks();
45957        node1 = gen_xmlNodePtr(n_node1, 0);
45958        node2 = gen_xmlNodePtr(n_node2, 1);
45959
45960        ret_val = xmlXPathCmpNodes(node1, node2);
45961        desret_int(ret_val);
45962        call_tests++;
45963        des_xmlNodePtr(n_node1, node1, 0);
45964        des_xmlNodePtr(n_node2, node2, 1);
45965        xmlResetLastError();
45966        if (mem_base != xmlMemBlocks()) {
45967            printf("Leak of %d blocks found in xmlXPathCmpNodes",
45968	           xmlMemBlocks() - mem_base);
45969	    test_ret++;
45970            printf(" %d", n_node1);
45971            printf(" %d", n_node2);
45972            printf("\n");
45973        }
45974    }
45975    }
45976    function_tests++;
45977#endif
45978
45979    return(test_ret);
45980}
45981
45982
45983static int
45984test_xmlXPathCompile(void) {
45985    int test_ret = 0;
45986
45987
45988    /* missing type support */
45989    return(test_ret);
45990}
45991
45992#ifdef LIBXML_XPATH_ENABLED
45993
45994#define gen_nb_xmlXPathCompExprPtr 1
45995static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45996    return(NULL);
45997}
45998static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45999}
46000#endif
46001
46002#ifdef LIBXML_XPATH_ENABLED
46003
46004#define gen_nb_xmlXPathContextPtr 1
46005static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46006    return(NULL);
46007}
46008static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46009}
46010#endif
46011
46012
46013static int
46014test_xmlXPathCompiledEval(void) {
46015    int test_ret = 0;
46016
46017#if defined(LIBXML_XPATH_ENABLED)
46018    int mem_base;
46019    xmlXPathObjectPtr ret_val;
46020    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46021    int n_comp;
46022    xmlXPathContextPtr ctx; /* the XPath context */
46023    int n_ctx;
46024
46025    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46026    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46027        mem_base = xmlMemBlocks();
46028        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46029        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46030
46031        ret_val = xmlXPathCompiledEval(comp, ctx);
46032        desret_xmlXPathObjectPtr(ret_val);
46033        call_tests++;
46034        des_xmlXPathCompExprPtr(n_comp, comp, 0);
46035        des_xmlXPathContextPtr(n_ctx, ctx, 1);
46036        xmlResetLastError();
46037        if (mem_base != xmlMemBlocks()) {
46038            printf("Leak of %d blocks found in xmlXPathCompiledEval",
46039	           xmlMemBlocks() - mem_base);
46040	    test_ret++;
46041            printf(" %d", n_comp);
46042            printf(" %d", n_ctx);
46043            printf("\n");
46044        }
46045    }
46046    }
46047    function_tests++;
46048#endif
46049
46050    return(test_ret);
46051}
46052
46053
46054static int
46055test_xmlXPathCompiledEvalToBoolean(void) {
46056    int test_ret = 0;
46057
46058#if defined(LIBXML_XPATH_ENABLED)
46059    int mem_base;
46060    int ret_val;
46061    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
46062    int n_comp;
46063    xmlXPathContextPtr ctxt; /* the XPath context */
46064    int n_ctxt;
46065
46066    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46067    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46068        mem_base = xmlMemBlocks();
46069        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
46070        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46071
46072        ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
46073        desret_int(ret_val);
46074        call_tests++;
46075        des_xmlXPathCompExprPtr(n_comp, comp, 0);
46076        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46077        xmlResetLastError();
46078        if (mem_base != xmlMemBlocks()) {
46079            printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
46080	           xmlMemBlocks() - mem_base);
46081	    test_ret++;
46082            printf(" %d", n_comp);
46083            printf(" %d", n_ctxt);
46084            printf("\n");
46085        }
46086    }
46087    }
46088    function_tests++;
46089#endif
46090
46091    return(test_ret);
46092}
46093
46094
46095static int
46096test_xmlXPathContextSetCache(void) {
46097    int test_ret = 0;
46098
46099#if defined(LIBXML_XPATH_ENABLED)
46100    int mem_base;
46101    int ret_val;
46102    xmlXPathContextPtr ctxt; /* the XPath context */
46103    int n_ctxt;
46104    int active; /* enables/disables (creates/frees) the cache */
46105    int n_active;
46106    int value; /* a value with semantics dependant on @options */
46107    int n_value;
46108    int options; /* options (currently only the value 0 is used) */
46109    int n_options;
46110
46111    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46112    for (n_active = 0;n_active < gen_nb_int;n_active++) {
46113    for (n_value = 0;n_value < gen_nb_int;n_value++) {
46114    for (n_options = 0;n_options < gen_nb_int;n_options++) {
46115        mem_base = xmlMemBlocks();
46116        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46117        active = gen_int(n_active, 1);
46118        value = gen_int(n_value, 2);
46119        options = gen_int(n_options, 3);
46120
46121        ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
46122        desret_int(ret_val);
46123        call_tests++;
46124        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46125        des_int(n_active, active, 1);
46126        des_int(n_value, value, 2);
46127        des_int(n_options, options, 3);
46128        xmlResetLastError();
46129        if (mem_base != xmlMemBlocks()) {
46130            printf("Leak of %d blocks found in xmlXPathContextSetCache",
46131	           xmlMemBlocks() - mem_base);
46132	    test_ret++;
46133            printf(" %d", n_ctxt);
46134            printf(" %d", n_active);
46135            printf(" %d", n_value);
46136            printf(" %d", n_options);
46137            printf("\n");
46138        }
46139    }
46140    }
46141    }
46142    }
46143    function_tests++;
46144#endif
46145
46146    return(test_ret);
46147}
46148
46149
46150static int
46151test_xmlXPathConvertBoolean(void) {
46152    int test_ret = 0;
46153
46154#if defined(LIBXML_XPATH_ENABLED)
46155    int mem_base;
46156    xmlXPathObjectPtr ret_val;
46157    xmlXPathObjectPtr val; /* an XPath object */
46158    int n_val;
46159
46160    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46161        mem_base = xmlMemBlocks();
46162        val = gen_xmlXPathObjectPtr(n_val, 0);
46163
46164        ret_val = xmlXPathConvertBoolean(val);
46165        val = NULL;
46166        desret_xmlXPathObjectPtr(ret_val);
46167        call_tests++;
46168        des_xmlXPathObjectPtr(n_val, val, 0);
46169        xmlResetLastError();
46170        if (mem_base != xmlMemBlocks()) {
46171            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
46172	           xmlMemBlocks() - mem_base);
46173	    test_ret++;
46174            printf(" %d", n_val);
46175            printf("\n");
46176        }
46177    }
46178    function_tests++;
46179#endif
46180
46181    return(test_ret);
46182}
46183
46184
46185static int
46186test_xmlXPathConvertNumber(void) {
46187    int test_ret = 0;
46188
46189#if defined(LIBXML_XPATH_ENABLED)
46190    int mem_base;
46191    xmlXPathObjectPtr ret_val;
46192    xmlXPathObjectPtr val; /* an XPath object */
46193    int n_val;
46194
46195    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46196        mem_base = xmlMemBlocks();
46197        val = gen_xmlXPathObjectPtr(n_val, 0);
46198
46199        ret_val = xmlXPathConvertNumber(val);
46200        val = NULL;
46201        desret_xmlXPathObjectPtr(ret_val);
46202        call_tests++;
46203        des_xmlXPathObjectPtr(n_val, val, 0);
46204        xmlResetLastError();
46205        if (mem_base != xmlMemBlocks()) {
46206            printf("Leak of %d blocks found in xmlXPathConvertNumber",
46207	           xmlMemBlocks() - mem_base);
46208	    test_ret++;
46209            printf(" %d", n_val);
46210            printf("\n");
46211        }
46212    }
46213    function_tests++;
46214#endif
46215
46216    return(test_ret);
46217}
46218
46219
46220static int
46221test_xmlXPathConvertString(void) {
46222    int test_ret = 0;
46223
46224#if defined(LIBXML_XPATH_ENABLED)
46225    int mem_base;
46226    xmlXPathObjectPtr ret_val;
46227    xmlXPathObjectPtr val; /* an XPath object */
46228    int n_val;
46229
46230    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46231        mem_base = xmlMemBlocks();
46232        val = gen_xmlXPathObjectPtr(n_val, 0);
46233
46234        ret_val = xmlXPathConvertString(val);
46235        val = NULL;
46236        desret_xmlXPathObjectPtr(ret_val);
46237        call_tests++;
46238        des_xmlXPathObjectPtr(n_val, val, 0);
46239        xmlResetLastError();
46240        if (mem_base != xmlMemBlocks()) {
46241            printf("Leak of %d blocks found in xmlXPathConvertString",
46242	           xmlMemBlocks() - mem_base);
46243	    test_ret++;
46244            printf(" %d", n_val);
46245            printf("\n");
46246        }
46247    }
46248    function_tests++;
46249#endif
46250
46251    return(test_ret);
46252}
46253
46254
46255static int
46256test_xmlXPathCtxtCompile(void) {
46257    int test_ret = 0;
46258
46259
46260    /* missing type support */
46261    return(test_ret);
46262}
46263
46264
46265static int
46266test_xmlXPathEval(void) {
46267    int test_ret = 0;
46268
46269#if defined(LIBXML_XPATH_ENABLED)
46270    int mem_base;
46271    xmlXPathObjectPtr ret_val;
46272    xmlChar * str; /* the XPath expression */
46273    int n_str;
46274    xmlXPathContextPtr ctx; /* the XPath context */
46275    int n_ctx;
46276
46277    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46278    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46279        mem_base = xmlMemBlocks();
46280        str = gen_const_xmlChar_ptr(n_str, 0);
46281        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46282
46283        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46284        desret_xmlXPathObjectPtr(ret_val);
46285        call_tests++;
46286        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46287        des_xmlXPathContextPtr(n_ctx, ctx, 1);
46288        xmlResetLastError();
46289        if (mem_base != xmlMemBlocks()) {
46290            printf("Leak of %d blocks found in xmlXPathEval",
46291	           xmlMemBlocks() - mem_base);
46292	    test_ret++;
46293            printf(" %d", n_str);
46294            printf(" %d", n_ctx);
46295            printf("\n");
46296        }
46297    }
46298    }
46299    function_tests++;
46300#endif
46301
46302    return(test_ret);
46303}
46304
46305
46306static int
46307test_xmlXPathEvalExpression(void) {
46308    int test_ret = 0;
46309
46310#if defined(LIBXML_XPATH_ENABLED)
46311    int mem_base;
46312    xmlXPathObjectPtr ret_val;
46313    xmlChar * str; /* the XPath expression */
46314    int n_str;
46315    xmlXPathContextPtr ctxt; /* the XPath context */
46316    int n_ctxt;
46317
46318    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46319    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46320        mem_base = xmlMemBlocks();
46321        str = gen_const_xmlChar_ptr(n_str, 0);
46322        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46323
46324        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46325        desret_xmlXPathObjectPtr(ret_val);
46326        call_tests++;
46327        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46328        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46329        xmlResetLastError();
46330        if (mem_base != xmlMemBlocks()) {
46331            printf("Leak of %d blocks found in xmlXPathEvalExpression",
46332	           xmlMemBlocks() - mem_base);
46333	    test_ret++;
46334            printf(" %d", n_str);
46335            printf(" %d", n_ctxt);
46336            printf("\n");
46337        }
46338    }
46339    }
46340    function_tests++;
46341#endif
46342
46343    return(test_ret);
46344}
46345
46346
46347static int
46348test_xmlXPathEvalPredicate(void) {
46349    int test_ret = 0;
46350
46351#if defined(LIBXML_XPATH_ENABLED)
46352    int mem_base;
46353    int ret_val;
46354    xmlXPathContextPtr ctxt; /* the XPath context */
46355    int n_ctxt;
46356    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46357    int n_res;
46358
46359    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46360    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46361        mem_base = xmlMemBlocks();
46362        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46363        res = gen_xmlXPathObjectPtr(n_res, 1);
46364
46365        ret_val = xmlXPathEvalPredicate(ctxt, res);
46366        desret_int(ret_val);
46367        call_tests++;
46368        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46369        des_xmlXPathObjectPtr(n_res, res, 1);
46370        xmlResetLastError();
46371        if (mem_base != xmlMemBlocks()) {
46372            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46373	           xmlMemBlocks() - mem_base);
46374	    test_ret++;
46375            printf(" %d", n_ctxt);
46376            printf(" %d", n_res);
46377            printf("\n");
46378        }
46379    }
46380    }
46381    function_tests++;
46382#endif
46383
46384    return(test_ret);
46385}
46386
46387
46388static int
46389test_xmlXPathInit(void) {
46390    int test_ret = 0;
46391
46392#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46393    int mem_base;
46394
46395        mem_base = xmlMemBlocks();
46396
46397        xmlXPathInit();
46398        call_tests++;
46399        xmlResetLastError();
46400        if (mem_base != xmlMemBlocks()) {
46401            printf("Leak of %d blocks found in xmlXPathInit",
46402	           xmlMemBlocks() - mem_base);
46403	    test_ret++;
46404            printf("\n");
46405        }
46406    function_tests++;
46407#endif
46408
46409    return(test_ret);
46410}
46411
46412
46413static int
46414test_xmlXPathIsInf(void) {
46415    int test_ret = 0;
46416
46417#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46418    int mem_base;
46419    int ret_val;
46420    double val; /* a double value */
46421    int n_val;
46422
46423    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46424        mem_base = xmlMemBlocks();
46425        val = gen_double(n_val, 0);
46426
46427        ret_val = xmlXPathIsInf(val);
46428        desret_int(ret_val);
46429        call_tests++;
46430        des_double(n_val, val, 0);
46431        xmlResetLastError();
46432        if (mem_base != xmlMemBlocks()) {
46433            printf("Leak of %d blocks found in xmlXPathIsInf",
46434	           xmlMemBlocks() - mem_base);
46435	    test_ret++;
46436            printf(" %d", n_val);
46437            printf("\n");
46438        }
46439    }
46440    function_tests++;
46441#endif
46442
46443    return(test_ret);
46444}
46445
46446
46447static int
46448test_xmlXPathIsNaN(void) {
46449    int test_ret = 0;
46450
46451#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46452    int mem_base;
46453    int ret_val;
46454    double val; /* a double value */
46455    int n_val;
46456
46457    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46458        mem_base = xmlMemBlocks();
46459        val = gen_double(n_val, 0);
46460
46461        ret_val = xmlXPathIsNaN(val);
46462        desret_int(ret_val);
46463        call_tests++;
46464        des_double(n_val, val, 0);
46465        xmlResetLastError();
46466        if (mem_base != xmlMemBlocks()) {
46467            printf("Leak of %d blocks found in xmlXPathIsNaN",
46468	           xmlMemBlocks() - mem_base);
46469	    test_ret++;
46470            printf(" %d", n_val);
46471            printf("\n");
46472        }
46473    }
46474    function_tests++;
46475#endif
46476
46477    return(test_ret);
46478}
46479
46480
46481static int
46482test_xmlXPathNewContext(void) {
46483    int test_ret = 0;
46484
46485
46486    /* missing type support */
46487    return(test_ret);
46488}
46489
46490
46491static int
46492test_xmlXPathNodeSetCreate(void) {
46493    int test_ret = 0;
46494
46495#if defined(LIBXML_XPATH_ENABLED)
46496    int mem_base;
46497    xmlNodeSetPtr ret_val;
46498    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46499    int n_val;
46500
46501    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46502        mem_base = xmlMemBlocks();
46503        val = gen_xmlNodePtr(n_val, 0);
46504
46505        ret_val = xmlXPathNodeSetCreate(val);
46506        desret_xmlNodeSetPtr(ret_val);
46507        call_tests++;
46508        des_xmlNodePtr(n_val, val, 0);
46509        xmlResetLastError();
46510        if (mem_base != xmlMemBlocks()) {
46511            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46512	           xmlMemBlocks() - mem_base);
46513	    test_ret++;
46514            printf(" %d", n_val);
46515            printf("\n");
46516        }
46517    }
46518    function_tests++;
46519#endif
46520
46521    return(test_ret);
46522}
46523
46524
46525static int
46526test_xmlXPathObjectCopy(void) {
46527    int test_ret = 0;
46528
46529#if defined(LIBXML_XPATH_ENABLED)
46530    int mem_base;
46531    xmlXPathObjectPtr ret_val;
46532    xmlXPathObjectPtr val; /* the original object */
46533    int n_val;
46534
46535    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46536        mem_base = xmlMemBlocks();
46537        val = gen_xmlXPathObjectPtr(n_val, 0);
46538
46539        ret_val = xmlXPathObjectCopy(val);
46540        desret_xmlXPathObjectPtr(ret_val);
46541        call_tests++;
46542        des_xmlXPathObjectPtr(n_val, val, 0);
46543        xmlResetLastError();
46544        if (mem_base != xmlMemBlocks()) {
46545            printf("Leak of %d blocks found in xmlXPathObjectCopy",
46546	           xmlMemBlocks() - mem_base);
46547	    test_ret++;
46548            printf(" %d", n_val);
46549            printf("\n");
46550        }
46551    }
46552    function_tests++;
46553#endif
46554
46555    return(test_ret);
46556}
46557
46558
46559static int
46560test_xmlXPathOrderDocElems(void) {
46561    int test_ret = 0;
46562
46563#if defined(LIBXML_XPATH_ENABLED)
46564    int mem_base;
46565    long ret_val;
46566    xmlDocPtr doc; /* an input document */
46567    int n_doc;
46568
46569    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46570        mem_base = xmlMemBlocks();
46571        doc = gen_xmlDocPtr(n_doc, 0);
46572
46573        ret_val = xmlXPathOrderDocElems(doc);
46574        desret_long(ret_val);
46575        call_tests++;
46576        des_xmlDocPtr(n_doc, doc, 0);
46577        xmlResetLastError();
46578        if (mem_base != xmlMemBlocks()) {
46579            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46580	           xmlMemBlocks() - mem_base);
46581	    test_ret++;
46582            printf(" %d", n_doc);
46583            printf("\n");
46584        }
46585    }
46586    function_tests++;
46587#endif
46588
46589    return(test_ret);
46590}
46591
46592static int
46593test_xpath(void) {
46594    int test_ret = 0;
46595
46596    if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46597    test_ret += test_xmlXPathCastBooleanToNumber();
46598    test_ret += test_xmlXPathCastBooleanToString();
46599    test_ret += test_xmlXPathCastNodeSetToBoolean();
46600    test_ret += test_xmlXPathCastNodeSetToNumber();
46601    test_ret += test_xmlXPathCastNodeSetToString();
46602    test_ret += test_xmlXPathCastNodeToNumber();
46603    test_ret += test_xmlXPathCastNodeToString();
46604    test_ret += test_xmlXPathCastNumberToBoolean();
46605    test_ret += test_xmlXPathCastNumberToString();
46606    test_ret += test_xmlXPathCastStringToBoolean();
46607    test_ret += test_xmlXPathCastStringToNumber();
46608    test_ret += test_xmlXPathCastToBoolean();
46609    test_ret += test_xmlXPathCastToNumber();
46610    test_ret += test_xmlXPathCastToString();
46611    test_ret += test_xmlXPathCmpNodes();
46612    test_ret += test_xmlXPathCompile();
46613    test_ret += test_xmlXPathCompiledEval();
46614    test_ret += test_xmlXPathCompiledEvalToBoolean();
46615    test_ret += test_xmlXPathContextSetCache();
46616    test_ret += test_xmlXPathConvertBoolean();
46617    test_ret += test_xmlXPathConvertNumber();
46618    test_ret += test_xmlXPathConvertString();
46619    test_ret += test_xmlXPathCtxtCompile();
46620    test_ret += test_xmlXPathEval();
46621    test_ret += test_xmlXPathEvalExpression();
46622    test_ret += test_xmlXPathEvalPredicate();
46623    test_ret += test_xmlXPathInit();
46624    test_ret += test_xmlXPathIsInf();
46625    test_ret += test_xmlXPathIsNaN();
46626    test_ret += test_xmlXPathNewContext();
46627    test_ret += test_xmlXPathNodeSetCreate();
46628    test_ret += test_xmlXPathObjectCopy();
46629    test_ret += test_xmlXPathOrderDocElems();
46630
46631    if (test_ret != 0)
46632	printf("Module xpath: %d errors\n", test_ret);
46633    return(test_ret);
46634}
46635#ifdef LIBXML_XPATH_ENABLED
46636
46637#define gen_nb_xmlXPathParserContextPtr 1
46638static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46639    return(NULL);
46640}
46641static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46642}
46643#endif
46644
46645
46646static int
46647test_valuePop(void) {
46648    int test_ret = 0;
46649
46650#if defined(LIBXML_XPATH_ENABLED)
46651    int mem_base;
46652    xmlXPathObjectPtr ret_val;
46653    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46654    int n_ctxt;
46655
46656    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46657        mem_base = xmlMemBlocks();
46658        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46659
46660        ret_val = valuePop(ctxt);
46661        desret_xmlXPathObjectPtr(ret_val);
46662        call_tests++;
46663        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46664        xmlResetLastError();
46665        if (mem_base != xmlMemBlocks()) {
46666            printf("Leak of %d blocks found in valuePop",
46667	           xmlMemBlocks() - mem_base);
46668	    test_ret++;
46669            printf(" %d", n_ctxt);
46670            printf("\n");
46671        }
46672    }
46673    function_tests++;
46674#endif
46675
46676    return(test_ret);
46677}
46678
46679
46680static int
46681test_valuePush(void) {
46682    int test_ret = 0;
46683
46684#if defined(LIBXML_XPATH_ENABLED)
46685    int mem_base;
46686    int ret_val;
46687    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46688    int n_ctxt;
46689    xmlXPathObjectPtr value; /* the XPath object */
46690    int n_value;
46691
46692    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46693    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46694        mem_base = xmlMemBlocks();
46695        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46696        value = gen_xmlXPathObjectPtr(n_value, 1);
46697
46698        ret_val = valuePush(ctxt, value);
46699        desret_int(ret_val);
46700        call_tests++;
46701        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46702        des_xmlXPathObjectPtr(n_value, value, 1);
46703        xmlResetLastError();
46704        if (mem_base != xmlMemBlocks()) {
46705            printf("Leak of %d blocks found in valuePush",
46706	           xmlMemBlocks() - mem_base);
46707	    test_ret++;
46708            printf(" %d", n_ctxt);
46709            printf(" %d", n_value);
46710            printf("\n");
46711        }
46712    }
46713    }
46714    function_tests++;
46715#endif
46716
46717    return(test_ret);
46718}
46719
46720
46721static int
46722test_xmlXPathAddValues(void) {
46723    int test_ret = 0;
46724
46725#if defined(LIBXML_XPATH_ENABLED)
46726    int mem_base;
46727    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46728    int n_ctxt;
46729
46730    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46731        mem_base = xmlMemBlocks();
46732        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46733
46734        xmlXPathAddValues(ctxt);
46735        call_tests++;
46736        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46737        xmlResetLastError();
46738        if (mem_base != xmlMemBlocks()) {
46739            printf("Leak of %d blocks found in xmlXPathAddValues",
46740	           xmlMemBlocks() - mem_base);
46741	    test_ret++;
46742            printf(" %d", n_ctxt);
46743            printf("\n");
46744        }
46745    }
46746    function_tests++;
46747#endif
46748
46749    return(test_ret);
46750}
46751
46752
46753static int
46754test_xmlXPathBooleanFunction(void) {
46755    int test_ret = 0;
46756
46757#if defined(LIBXML_XPATH_ENABLED)
46758    int mem_base;
46759    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46760    int n_ctxt;
46761    int nargs; /* the number of arguments */
46762    int n_nargs;
46763
46764    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46765    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46766        mem_base = xmlMemBlocks();
46767        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46768        nargs = gen_int(n_nargs, 1);
46769
46770        xmlXPathBooleanFunction(ctxt, nargs);
46771        call_tests++;
46772        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46773        des_int(n_nargs, nargs, 1);
46774        xmlResetLastError();
46775        if (mem_base != xmlMemBlocks()) {
46776            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46777	           xmlMemBlocks() - mem_base);
46778	    test_ret++;
46779            printf(" %d", n_ctxt);
46780            printf(" %d", n_nargs);
46781            printf("\n");
46782        }
46783    }
46784    }
46785    function_tests++;
46786#endif
46787
46788    return(test_ret);
46789}
46790
46791
46792static int
46793test_xmlXPathCeilingFunction(void) {
46794    int test_ret = 0;
46795
46796#if defined(LIBXML_XPATH_ENABLED)
46797    int mem_base;
46798    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46799    int n_ctxt;
46800    int nargs; /* the number of arguments */
46801    int n_nargs;
46802
46803    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46804    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46805        mem_base = xmlMemBlocks();
46806        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46807        nargs = gen_int(n_nargs, 1);
46808
46809        xmlXPathCeilingFunction(ctxt, nargs);
46810        call_tests++;
46811        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46812        des_int(n_nargs, nargs, 1);
46813        xmlResetLastError();
46814        if (mem_base != xmlMemBlocks()) {
46815            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46816	           xmlMemBlocks() - mem_base);
46817	    test_ret++;
46818            printf(" %d", n_ctxt);
46819            printf(" %d", n_nargs);
46820            printf("\n");
46821        }
46822    }
46823    }
46824    function_tests++;
46825#endif
46826
46827    return(test_ret);
46828}
46829
46830
46831static int
46832test_xmlXPathCompareValues(void) {
46833    int test_ret = 0;
46834
46835#if defined(LIBXML_XPATH_ENABLED)
46836    int mem_base;
46837    int ret_val;
46838    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46839    int n_ctxt;
46840    int inf; /* less than (1) or greater than (0) */
46841    int n_inf;
46842    int strict; /* is the comparison strict */
46843    int n_strict;
46844
46845    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46846    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46847    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46848        mem_base = xmlMemBlocks();
46849        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46850        inf = gen_int(n_inf, 1);
46851        strict = gen_int(n_strict, 2);
46852
46853        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46854        desret_int(ret_val);
46855        call_tests++;
46856        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46857        des_int(n_inf, inf, 1);
46858        des_int(n_strict, strict, 2);
46859        xmlResetLastError();
46860        if (mem_base != xmlMemBlocks()) {
46861            printf("Leak of %d blocks found in xmlXPathCompareValues",
46862	           xmlMemBlocks() - mem_base);
46863	    test_ret++;
46864            printf(" %d", n_ctxt);
46865            printf(" %d", n_inf);
46866            printf(" %d", n_strict);
46867            printf("\n");
46868        }
46869    }
46870    }
46871    }
46872    function_tests++;
46873#endif
46874
46875    return(test_ret);
46876}
46877
46878
46879static int
46880test_xmlXPathConcatFunction(void) {
46881    int test_ret = 0;
46882
46883#if defined(LIBXML_XPATH_ENABLED)
46884    int mem_base;
46885    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46886    int n_ctxt;
46887    int nargs; /* the number of arguments */
46888    int n_nargs;
46889
46890    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46891    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46892        mem_base = xmlMemBlocks();
46893        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46894        nargs = gen_int(n_nargs, 1);
46895
46896        xmlXPathConcatFunction(ctxt, nargs);
46897        call_tests++;
46898        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46899        des_int(n_nargs, nargs, 1);
46900        xmlResetLastError();
46901        if (mem_base != xmlMemBlocks()) {
46902            printf("Leak of %d blocks found in xmlXPathConcatFunction",
46903	           xmlMemBlocks() - mem_base);
46904	    test_ret++;
46905            printf(" %d", n_ctxt);
46906            printf(" %d", n_nargs);
46907            printf("\n");
46908        }
46909    }
46910    }
46911    function_tests++;
46912#endif
46913
46914    return(test_ret);
46915}
46916
46917
46918static int
46919test_xmlXPathContainsFunction(void) {
46920    int test_ret = 0;
46921
46922#if defined(LIBXML_XPATH_ENABLED)
46923    int mem_base;
46924    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46925    int n_ctxt;
46926    int nargs; /* the number of arguments */
46927    int n_nargs;
46928
46929    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46930    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46931        mem_base = xmlMemBlocks();
46932        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46933        nargs = gen_int(n_nargs, 1);
46934
46935        xmlXPathContainsFunction(ctxt, nargs);
46936        call_tests++;
46937        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46938        des_int(n_nargs, nargs, 1);
46939        xmlResetLastError();
46940        if (mem_base != xmlMemBlocks()) {
46941            printf("Leak of %d blocks found in xmlXPathContainsFunction",
46942	           xmlMemBlocks() - mem_base);
46943	    test_ret++;
46944            printf(" %d", n_ctxt);
46945            printf(" %d", n_nargs);
46946            printf("\n");
46947        }
46948    }
46949    }
46950    function_tests++;
46951#endif
46952
46953    return(test_ret);
46954}
46955
46956
46957static int
46958test_xmlXPathCountFunction(void) {
46959    int test_ret = 0;
46960
46961#if defined(LIBXML_XPATH_ENABLED)
46962    int mem_base;
46963    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46964    int n_ctxt;
46965    int nargs; /* the number of arguments */
46966    int n_nargs;
46967
46968    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46969    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46970        mem_base = xmlMemBlocks();
46971        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46972        nargs = gen_int(n_nargs, 1);
46973
46974        xmlXPathCountFunction(ctxt, nargs);
46975        call_tests++;
46976        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46977        des_int(n_nargs, nargs, 1);
46978        xmlResetLastError();
46979        if (mem_base != xmlMemBlocks()) {
46980            printf("Leak of %d blocks found in xmlXPathCountFunction",
46981	           xmlMemBlocks() - mem_base);
46982	    test_ret++;
46983            printf(" %d", n_ctxt);
46984            printf(" %d", n_nargs);
46985            printf("\n");
46986        }
46987    }
46988    }
46989    function_tests++;
46990#endif
46991
46992    return(test_ret);
46993}
46994
46995
46996static int
46997test_xmlXPathDebugDumpCompExpr(void) {
46998    int test_ret = 0;
46999
47000#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47001    int mem_base;
47002    FILE * output; /* the FILE * for the output */
47003    int n_output;
47004    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
47005    int n_comp;
47006    int depth; /* the indentation level. */
47007    int n_depth;
47008
47009    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47010    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
47011    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47012        mem_base = xmlMemBlocks();
47013        output = gen_FILE_ptr(n_output, 0);
47014        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
47015        depth = gen_int(n_depth, 2);
47016
47017        xmlXPathDebugDumpCompExpr(output, comp, depth);
47018        call_tests++;
47019        des_FILE_ptr(n_output, output, 0);
47020        des_xmlXPathCompExprPtr(n_comp, comp, 1);
47021        des_int(n_depth, depth, 2);
47022        xmlResetLastError();
47023        if (mem_base != xmlMemBlocks()) {
47024            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
47025	           xmlMemBlocks() - mem_base);
47026	    test_ret++;
47027            printf(" %d", n_output);
47028            printf(" %d", n_comp);
47029            printf(" %d", n_depth);
47030            printf("\n");
47031        }
47032    }
47033    }
47034    }
47035    function_tests++;
47036#endif
47037
47038    return(test_ret);
47039}
47040
47041
47042static int
47043test_xmlXPathDebugDumpObject(void) {
47044    int test_ret = 0;
47045
47046#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
47047    int mem_base;
47048    FILE * output; /* the FILE * to dump the output */
47049    int n_output;
47050    xmlXPathObjectPtr cur; /* the object to inspect */
47051    int n_cur;
47052    int depth; /* indentation level */
47053    int n_depth;
47054
47055    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
47056    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
47057    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
47058        mem_base = xmlMemBlocks();
47059        output = gen_FILE_ptr(n_output, 0);
47060        cur = gen_xmlXPathObjectPtr(n_cur, 1);
47061        depth = gen_int(n_depth, 2);
47062
47063        xmlXPathDebugDumpObject(output, cur, depth);
47064        call_tests++;
47065        des_FILE_ptr(n_output, output, 0);
47066        des_xmlXPathObjectPtr(n_cur, cur, 1);
47067        des_int(n_depth, depth, 2);
47068        xmlResetLastError();
47069        if (mem_base != xmlMemBlocks()) {
47070            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
47071	           xmlMemBlocks() - mem_base);
47072	    test_ret++;
47073            printf(" %d", n_output);
47074            printf(" %d", n_cur);
47075            printf(" %d", n_depth);
47076            printf("\n");
47077        }
47078    }
47079    }
47080    }
47081    function_tests++;
47082#endif
47083
47084    return(test_ret);
47085}
47086
47087
47088static int
47089test_xmlXPathDifference(void) {
47090    int test_ret = 0;
47091
47092#if defined(LIBXML_XPATH_ENABLED)
47093    int mem_base;
47094    xmlNodeSetPtr ret_val;
47095    xmlNodeSetPtr nodes1; /* a node-set */
47096    int n_nodes1;
47097    xmlNodeSetPtr nodes2; /* a node-set */
47098    int n_nodes2;
47099
47100    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47101    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47102        mem_base = xmlMemBlocks();
47103        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47104        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47105
47106        ret_val = xmlXPathDifference(nodes1, nodes2);
47107        desret_xmlNodeSetPtr(ret_val);
47108        call_tests++;
47109        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47110        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47111        xmlResetLastError();
47112        if (mem_base != xmlMemBlocks()) {
47113            printf("Leak of %d blocks found in xmlXPathDifference",
47114	           xmlMemBlocks() - mem_base);
47115	    test_ret++;
47116            printf(" %d", n_nodes1);
47117            printf(" %d", n_nodes2);
47118            printf("\n");
47119        }
47120    }
47121    }
47122    function_tests++;
47123#endif
47124
47125    return(test_ret);
47126}
47127
47128
47129static int
47130test_xmlXPathDistinct(void) {
47131    int test_ret = 0;
47132
47133#if defined(LIBXML_XPATH_ENABLED)
47134    int mem_base;
47135    xmlNodeSetPtr ret_val;
47136    xmlNodeSetPtr nodes; /* a node-set */
47137    int n_nodes;
47138
47139    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47140        mem_base = xmlMemBlocks();
47141        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47142
47143        ret_val = xmlXPathDistinct(nodes);
47144        desret_xmlNodeSetPtr(ret_val);
47145        call_tests++;
47146        des_xmlNodeSetPtr(n_nodes, nodes, 0);
47147        xmlResetLastError();
47148        if (mem_base != xmlMemBlocks()) {
47149            printf("Leak of %d blocks found in xmlXPathDistinct",
47150	           xmlMemBlocks() - mem_base);
47151	    test_ret++;
47152            printf(" %d", n_nodes);
47153            printf("\n");
47154        }
47155    }
47156    function_tests++;
47157#endif
47158
47159    return(test_ret);
47160}
47161
47162
47163static int
47164test_xmlXPathDistinctSorted(void) {
47165    int test_ret = 0;
47166
47167#if defined(LIBXML_XPATH_ENABLED)
47168    int mem_base;
47169    xmlNodeSetPtr ret_val;
47170    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
47171    int n_nodes;
47172
47173    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
47174        mem_base = xmlMemBlocks();
47175        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
47176
47177        ret_val = xmlXPathDistinctSorted(nodes);
47178        desret_xmlNodeSetPtr(ret_val);
47179        call_tests++;
47180        des_xmlNodeSetPtr(n_nodes, nodes, 0);
47181        xmlResetLastError();
47182        if (mem_base != xmlMemBlocks()) {
47183            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
47184	           xmlMemBlocks() - mem_base);
47185	    test_ret++;
47186            printf(" %d", n_nodes);
47187            printf("\n");
47188        }
47189    }
47190    function_tests++;
47191#endif
47192
47193    return(test_ret);
47194}
47195
47196
47197static int
47198test_xmlXPathDivValues(void) {
47199    int test_ret = 0;
47200
47201#if defined(LIBXML_XPATH_ENABLED)
47202    int mem_base;
47203    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47204    int n_ctxt;
47205
47206    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47207        mem_base = xmlMemBlocks();
47208        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47209
47210        xmlXPathDivValues(ctxt);
47211        call_tests++;
47212        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47213        xmlResetLastError();
47214        if (mem_base != xmlMemBlocks()) {
47215            printf("Leak of %d blocks found in xmlXPathDivValues",
47216	           xmlMemBlocks() - mem_base);
47217	    test_ret++;
47218            printf(" %d", n_ctxt);
47219            printf("\n");
47220        }
47221    }
47222    function_tests++;
47223#endif
47224
47225    return(test_ret);
47226}
47227
47228
47229static int
47230test_xmlXPathEqualValues(void) {
47231    int test_ret = 0;
47232
47233#if defined(LIBXML_XPATH_ENABLED)
47234    int mem_base;
47235    int ret_val;
47236    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47237    int n_ctxt;
47238
47239    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47240        mem_base = xmlMemBlocks();
47241        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47242
47243        ret_val = xmlXPathEqualValues(ctxt);
47244        desret_int(ret_val);
47245        call_tests++;
47246        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47247        xmlResetLastError();
47248        if (mem_base != xmlMemBlocks()) {
47249            printf("Leak of %d blocks found in xmlXPathEqualValues",
47250	           xmlMemBlocks() - mem_base);
47251	    test_ret++;
47252            printf(" %d", n_ctxt);
47253            printf("\n");
47254        }
47255    }
47256    function_tests++;
47257#endif
47258
47259    return(test_ret);
47260}
47261
47262
47263static int
47264test_xmlXPathErr(void) {
47265    int test_ret = 0;
47266
47267#if defined(LIBXML_XPATH_ENABLED)
47268    int mem_base;
47269    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47270    int n_ctxt;
47271    int error; /* the error code */
47272    int n_error;
47273
47274    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47275    for (n_error = 0;n_error < gen_nb_int;n_error++) {
47276        mem_base = xmlMemBlocks();
47277        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47278        error = gen_int(n_error, 1);
47279
47280        xmlXPathErr(ctxt, error);
47281        call_tests++;
47282        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47283        des_int(n_error, error, 1);
47284        xmlResetLastError();
47285        if (mem_base != xmlMemBlocks()) {
47286            printf("Leak of %d blocks found in xmlXPathErr",
47287	           xmlMemBlocks() - mem_base);
47288	    test_ret++;
47289            printf(" %d", n_ctxt);
47290            printf(" %d", n_error);
47291            printf("\n");
47292        }
47293    }
47294    }
47295    function_tests++;
47296#endif
47297
47298    return(test_ret);
47299}
47300
47301
47302static int
47303test_xmlXPathEvalExpr(void) {
47304    int test_ret = 0;
47305
47306#if defined(LIBXML_XPATH_ENABLED)
47307    int mem_base;
47308    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47309    int n_ctxt;
47310
47311    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47312        mem_base = xmlMemBlocks();
47313        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47314
47315        xmlXPathEvalExpr(ctxt);
47316        call_tests++;
47317        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47318        xmlResetLastError();
47319        if (mem_base != xmlMemBlocks()) {
47320            printf("Leak of %d blocks found in xmlXPathEvalExpr",
47321	           xmlMemBlocks() - mem_base);
47322	    test_ret++;
47323            printf(" %d", n_ctxt);
47324            printf("\n");
47325        }
47326    }
47327    function_tests++;
47328#endif
47329
47330    return(test_ret);
47331}
47332
47333
47334static int
47335test_xmlXPathEvaluatePredicateResult(void) {
47336    int test_ret = 0;
47337
47338#if defined(LIBXML_XPATH_ENABLED)
47339    int mem_base;
47340    int ret_val;
47341    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47342    int n_ctxt;
47343    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47344    int n_res;
47345
47346    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47347    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47348        mem_base = xmlMemBlocks();
47349        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47350        res = gen_xmlXPathObjectPtr(n_res, 1);
47351
47352        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47353        desret_int(ret_val);
47354        call_tests++;
47355        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47356        des_xmlXPathObjectPtr(n_res, res, 1);
47357        xmlResetLastError();
47358        if (mem_base != xmlMemBlocks()) {
47359            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47360	           xmlMemBlocks() - mem_base);
47361	    test_ret++;
47362            printf(" %d", n_ctxt);
47363            printf(" %d", n_res);
47364            printf("\n");
47365        }
47366    }
47367    }
47368    function_tests++;
47369#endif
47370
47371    return(test_ret);
47372}
47373
47374
47375static int
47376test_xmlXPathFalseFunction(void) {
47377    int test_ret = 0;
47378
47379#if defined(LIBXML_XPATH_ENABLED)
47380    int mem_base;
47381    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47382    int n_ctxt;
47383    int nargs; /* the number of arguments */
47384    int n_nargs;
47385
47386    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47387    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47388        mem_base = xmlMemBlocks();
47389        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47390        nargs = gen_int(n_nargs, 1);
47391
47392        xmlXPathFalseFunction(ctxt, nargs);
47393        call_tests++;
47394        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47395        des_int(n_nargs, nargs, 1);
47396        xmlResetLastError();
47397        if (mem_base != xmlMemBlocks()) {
47398            printf("Leak of %d blocks found in xmlXPathFalseFunction",
47399	           xmlMemBlocks() - mem_base);
47400	    test_ret++;
47401            printf(" %d", n_ctxt);
47402            printf(" %d", n_nargs);
47403            printf("\n");
47404        }
47405    }
47406    }
47407    function_tests++;
47408#endif
47409
47410    return(test_ret);
47411}
47412
47413
47414static int
47415test_xmlXPathFloorFunction(void) {
47416    int test_ret = 0;
47417
47418#if defined(LIBXML_XPATH_ENABLED)
47419    int mem_base;
47420    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47421    int n_ctxt;
47422    int nargs; /* the number of arguments */
47423    int n_nargs;
47424
47425    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47426    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47427        mem_base = xmlMemBlocks();
47428        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47429        nargs = gen_int(n_nargs, 1);
47430
47431        xmlXPathFloorFunction(ctxt, nargs);
47432        call_tests++;
47433        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47434        des_int(n_nargs, nargs, 1);
47435        xmlResetLastError();
47436        if (mem_base != xmlMemBlocks()) {
47437            printf("Leak of %d blocks found in xmlXPathFloorFunction",
47438	           xmlMemBlocks() - mem_base);
47439	    test_ret++;
47440            printf(" %d", n_ctxt);
47441            printf(" %d", n_nargs);
47442            printf("\n");
47443        }
47444    }
47445    }
47446    function_tests++;
47447#endif
47448
47449    return(test_ret);
47450}
47451
47452
47453static int
47454test_xmlXPathFunctionLookup(void) {
47455    int test_ret = 0;
47456
47457
47458    /* missing type support */
47459    return(test_ret);
47460}
47461
47462
47463static int
47464test_xmlXPathFunctionLookupNS(void) {
47465    int test_ret = 0;
47466
47467
47468    /* missing type support */
47469    return(test_ret);
47470}
47471
47472
47473static int
47474test_xmlXPathHasSameNodes(void) {
47475    int test_ret = 0;
47476
47477#if defined(LIBXML_XPATH_ENABLED)
47478    int mem_base;
47479    int ret_val;
47480    xmlNodeSetPtr nodes1; /* a node-set */
47481    int n_nodes1;
47482    xmlNodeSetPtr nodes2; /* a node-set */
47483    int n_nodes2;
47484
47485    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47486    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47487        mem_base = xmlMemBlocks();
47488        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47489        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47490
47491        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47492        desret_int(ret_val);
47493        call_tests++;
47494        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47495        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47496        xmlResetLastError();
47497        if (mem_base != xmlMemBlocks()) {
47498            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47499	           xmlMemBlocks() - mem_base);
47500	    test_ret++;
47501            printf(" %d", n_nodes1);
47502            printf(" %d", n_nodes2);
47503            printf("\n");
47504        }
47505    }
47506    }
47507    function_tests++;
47508#endif
47509
47510    return(test_ret);
47511}
47512
47513
47514static int
47515test_xmlXPathIdFunction(void) {
47516    int test_ret = 0;
47517
47518#if defined(LIBXML_XPATH_ENABLED)
47519    int mem_base;
47520    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47521    int n_ctxt;
47522    int nargs; /* the number of arguments */
47523    int n_nargs;
47524
47525    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47526    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47527        mem_base = xmlMemBlocks();
47528        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47529        nargs = gen_int(n_nargs, 1);
47530
47531        xmlXPathIdFunction(ctxt, nargs);
47532        call_tests++;
47533        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47534        des_int(n_nargs, nargs, 1);
47535        xmlResetLastError();
47536        if (mem_base != xmlMemBlocks()) {
47537            printf("Leak of %d blocks found in xmlXPathIdFunction",
47538	           xmlMemBlocks() - mem_base);
47539	    test_ret++;
47540            printf(" %d", n_ctxt);
47541            printf(" %d", n_nargs);
47542            printf("\n");
47543        }
47544    }
47545    }
47546    function_tests++;
47547#endif
47548
47549    return(test_ret);
47550}
47551
47552
47553static int
47554test_xmlXPathIntersection(void) {
47555    int test_ret = 0;
47556
47557#if defined(LIBXML_XPATH_ENABLED)
47558    int mem_base;
47559    xmlNodeSetPtr ret_val;
47560    xmlNodeSetPtr nodes1; /* a node-set */
47561    int n_nodes1;
47562    xmlNodeSetPtr nodes2; /* a node-set */
47563    int n_nodes2;
47564
47565    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47566    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47567        mem_base = xmlMemBlocks();
47568        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47569        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47570
47571        ret_val = xmlXPathIntersection(nodes1, nodes2);
47572        desret_xmlNodeSetPtr(ret_val);
47573        call_tests++;
47574        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47575        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47576        xmlResetLastError();
47577        if (mem_base != xmlMemBlocks()) {
47578            printf("Leak of %d blocks found in xmlXPathIntersection",
47579	           xmlMemBlocks() - mem_base);
47580	    test_ret++;
47581            printf(" %d", n_nodes1);
47582            printf(" %d", n_nodes2);
47583            printf("\n");
47584        }
47585    }
47586    }
47587    function_tests++;
47588#endif
47589
47590    return(test_ret);
47591}
47592
47593
47594static int
47595test_xmlXPathIsNodeType(void) {
47596    int test_ret = 0;
47597
47598#if defined(LIBXML_XPATH_ENABLED)
47599    int mem_base;
47600    int ret_val;
47601    xmlChar * name; /* a name string */
47602    int n_name;
47603
47604    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47605        mem_base = xmlMemBlocks();
47606        name = gen_const_xmlChar_ptr(n_name, 0);
47607
47608        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47609        desret_int(ret_val);
47610        call_tests++;
47611        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47612        xmlResetLastError();
47613        if (mem_base != xmlMemBlocks()) {
47614            printf("Leak of %d blocks found in xmlXPathIsNodeType",
47615	           xmlMemBlocks() - mem_base);
47616	    test_ret++;
47617            printf(" %d", n_name);
47618            printf("\n");
47619        }
47620    }
47621    function_tests++;
47622#endif
47623
47624    return(test_ret);
47625}
47626
47627
47628static int
47629test_xmlXPathLangFunction(void) {
47630    int test_ret = 0;
47631
47632#if defined(LIBXML_XPATH_ENABLED)
47633    int mem_base;
47634    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47635    int n_ctxt;
47636    int nargs; /* the number of arguments */
47637    int n_nargs;
47638
47639    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47640    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47641        mem_base = xmlMemBlocks();
47642        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47643        nargs = gen_int(n_nargs, 1);
47644
47645        xmlXPathLangFunction(ctxt, nargs);
47646        call_tests++;
47647        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47648        des_int(n_nargs, nargs, 1);
47649        xmlResetLastError();
47650        if (mem_base != xmlMemBlocks()) {
47651            printf("Leak of %d blocks found in xmlXPathLangFunction",
47652	           xmlMemBlocks() - mem_base);
47653	    test_ret++;
47654            printf(" %d", n_ctxt);
47655            printf(" %d", n_nargs);
47656            printf("\n");
47657        }
47658    }
47659    }
47660    function_tests++;
47661#endif
47662
47663    return(test_ret);
47664}
47665
47666
47667static int
47668test_xmlXPathLastFunction(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        xmlXPathLastFunction(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 xmlXPathLastFunction",
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_xmlXPathLeading(void) {
47708    int test_ret = 0;
47709
47710#if defined(LIBXML_XPATH_ENABLED)
47711    int mem_base;
47712    xmlNodeSetPtr ret_val;
47713    xmlNodeSetPtr nodes1; /* a node-set */
47714    int n_nodes1;
47715    xmlNodeSetPtr nodes2; /* a node-set */
47716    int n_nodes2;
47717
47718    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47719    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47720        mem_base = xmlMemBlocks();
47721        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47722        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47723
47724        ret_val = xmlXPathLeading(nodes1, nodes2);
47725        desret_xmlNodeSetPtr(ret_val);
47726        call_tests++;
47727        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47728        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47729        xmlResetLastError();
47730        if (mem_base != xmlMemBlocks()) {
47731            printf("Leak of %d blocks found in xmlXPathLeading",
47732	           xmlMemBlocks() - mem_base);
47733	    test_ret++;
47734            printf(" %d", n_nodes1);
47735            printf(" %d", n_nodes2);
47736            printf("\n");
47737        }
47738    }
47739    }
47740    function_tests++;
47741#endif
47742
47743    return(test_ret);
47744}
47745
47746
47747static int
47748test_xmlXPathLeadingSorted(void) {
47749    int test_ret = 0;
47750
47751#if defined(LIBXML_XPATH_ENABLED)
47752    int mem_base;
47753    xmlNodeSetPtr ret_val;
47754    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47755    int n_nodes1;
47756    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47757    int n_nodes2;
47758
47759    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47760    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47761        mem_base = xmlMemBlocks();
47762        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47763        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47764
47765        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47766        desret_xmlNodeSetPtr(ret_val);
47767        call_tests++;
47768        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47769        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47770        xmlResetLastError();
47771        if (mem_base != xmlMemBlocks()) {
47772            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47773	           xmlMemBlocks() - mem_base);
47774	    test_ret++;
47775            printf(" %d", n_nodes1);
47776            printf(" %d", n_nodes2);
47777            printf("\n");
47778        }
47779    }
47780    }
47781    function_tests++;
47782#endif
47783
47784    return(test_ret);
47785}
47786
47787
47788static int
47789test_xmlXPathLocalNameFunction(void) {
47790    int test_ret = 0;
47791
47792#if defined(LIBXML_XPATH_ENABLED)
47793    int mem_base;
47794    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47795    int n_ctxt;
47796    int nargs; /* the number of arguments */
47797    int n_nargs;
47798
47799    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47800    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47801        mem_base = xmlMemBlocks();
47802        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47803        nargs = gen_int(n_nargs, 1);
47804
47805        xmlXPathLocalNameFunction(ctxt, nargs);
47806        call_tests++;
47807        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47808        des_int(n_nargs, nargs, 1);
47809        xmlResetLastError();
47810        if (mem_base != xmlMemBlocks()) {
47811            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47812	           xmlMemBlocks() - mem_base);
47813	    test_ret++;
47814            printf(" %d", n_ctxt);
47815            printf(" %d", n_nargs);
47816            printf("\n");
47817        }
47818    }
47819    }
47820    function_tests++;
47821#endif
47822
47823    return(test_ret);
47824}
47825
47826
47827static int
47828test_xmlXPathModValues(void) {
47829    int test_ret = 0;
47830
47831#if defined(LIBXML_XPATH_ENABLED)
47832    int mem_base;
47833    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47834    int n_ctxt;
47835
47836    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47837        mem_base = xmlMemBlocks();
47838        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47839
47840        xmlXPathModValues(ctxt);
47841        call_tests++;
47842        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47843        xmlResetLastError();
47844        if (mem_base != xmlMemBlocks()) {
47845            printf("Leak of %d blocks found in xmlXPathModValues",
47846	           xmlMemBlocks() - mem_base);
47847	    test_ret++;
47848            printf(" %d", n_ctxt);
47849            printf("\n");
47850        }
47851    }
47852    function_tests++;
47853#endif
47854
47855    return(test_ret);
47856}
47857
47858
47859static int
47860test_xmlXPathMultValues(void) {
47861    int test_ret = 0;
47862
47863#if defined(LIBXML_XPATH_ENABLED)
47864    int mem_base;
47865    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47866    int n_ctxt;
47867
47868    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47869        mem_base = xmlMemBlocks();
47870        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47871
47872        xmlXPathMultValues(ctxt);
47873        call_tests++;
47874        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47875        xmlResetLastError();
47876        if (mem_base != xmlMemBlocks()) {
47877            printf("Leak of %d blocks found in xmlXPathMultValues",
47878	           xmlMemBlocks() - mem_base);
47879	    test_ret++;
47880            printf(" %d", n_ctxt);
47881            printf("\n");
47882        }
47883    }
47884    function_tests++;
47885#endif
47886
47887    return(test_ret);
47888}
47889
47890
47891static int
47892test_xmlXPathNamespaceURIFunction(void) {
47893    int test_ret = 0;
47894
47895#if defined(LIBXML_XPATH_ENABLED)
47896    int mem_base;
47897    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47898    int n_ctxt;
47899    int nargs; /* the number of arguments */
47900    int n_nargs;
47901
47902    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47903    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47904        mem_base = xmlMemBlocks();
47905        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47906        nargs = gen_int(n_nargs, 1);
47907
47908        xmlXPathNamespaceURIFunction(ctxt, nargs);
47909        call_tests++;
47910        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47911        des_int(n_nargs, nargs, 1);
47912        xmlResetLastError();
47913        if (mem_base != xmlMemBlocks()) {
47914            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47915	           xmlMemBlocks() - mem_base);
47916	    test_ret++;
47917            printf(" %d", n_ctxt);
47918            printf(" %d", n_nargs);
47919            printf("\n");
47920        }
47921    }
47922    }
47923    function_tests++;
47924#endif
47925
47926    return(test_ret);
47927}
47928
47929
47930static int
47931test_xmlXPathNewBoolean(void) {
47932    int test_ret = 0;
47933
47934#if defined(LIBXML_XPATH_ENABLED)
47935    int mem_base;
47936    xmlXPathObjectPtr ret_val;
47937    int val; /* the boolean value */
47938    int n_val;
47939
47940    for (n_val = 0;n_val < gen_nb_int;n_val++) {
47941        mem_base = xmlMemBlocks();
47942        val = gen_int(n_val, 0);
47943
47944        ret_val = xmlXPathNewBoolean(val);
47945        desret_xmlXPathObjectPtr(ret_val);
47946        call_tests++;
47947        des_int(n_val, val, 0);
47948        xmlResetLastError();
47949        if (mem_base != xmlMemBlocks()) {
47950            printf("Leak of %d blocks found in xmlXPathNewBoolean",
47951	           xmlMemBlocks() - mem_base);
47952	    test_ret++;
47953            printf(" %d", n_val);
47954            printf("\n");
47955        }
47956    }
47957    function_tests++;
47958#endif
47959
47960    return(test_ret);
47961}
47962
47963
47964static int
47965test_xmlXPathNewCString(void) {
47966    int test_ret = 0;
47967
47968#if defined(LIBXML_XPATH_ENABLED)
47969    int mem_base;
47970    xmlXPathObjectPtr ret_val;
47971    char * val; /* the char * value */
47972    int n_val;
47973
47974    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47975        mem_base = xmlMemBlocks();
47976        val = gen_const_char_ptr(n_val, 0);
47977
47978        ret_val = xmlXPathNewCString((const char *)val);
47979        desret_xmlXPathObjectPtr(ret_val);
47980        call_tests++;
47981        des_const_char_ptr(n_val, (const char *)val, 0);
47982        xmlResetLastError();
47983        if (mem_base != xmlMemBlocks()) {
47984            printf("Leak of %d blocks found in xmlXPathNewCString",
47985	           xmlMemBlocks() - mem_base);
47986	    test_ret++;
47987            printf(" %d", n_val);
47988            printf("\n");
47989        }
47990    }
47991    function_tests++;
47992#endif
47993
47994    return(test_ret);
47995}
47996
47997
47998static int
47999test_xmlXPathNewFloat(void) {
48000    int test_ret = 0;
48001
48002#if defined(LIBXML_XPATH_ENABLED)
48003    int mem_base;
48004    xmlXPathObjectPtr ret_val;
48005    double val; /* the double value */
48006    int n_val;
48007
48008    for (n_val = 0;n_val < gen_nb_double;n_val++) {
48009        mem_base = xmlMemBlocks();
48010        val = gen_double(n_val, 0);
48011
48012        ret_val = xmlXPathNewFloat(val);
48013        desret_xmlXPathObjectPtr(ret_val);
48014        call_tests++;
48015        des_double(n_val, val, 0);
48016        xmlResetLastError();
48017        if (mem_base != xmlMemBlocks()) {
48018            printf("Leak of %d blocks found in xmlXPathNewFloat",
48019	           xmlMemBlocks() - mem_base);
48020	    test_ret++;
48021            printf(" %d", n_val);
48022            printf("\n");
48023        }
48024    }
48025    function_tests++;
48026#endif
48027
48028    return(test_ret);
48029}
48030
48031
48032static int
48033test_xmlXPathNewNodeSet(void) {
48034    int test_ret = 0;
48035
48036#if defined(LIBXML_XPATH_ENABLED)
48037    int mem_base;
48038    xmlXPathObjectPtr ret_val;
48039    xmlNodePtr val; /* the NodePtr value */
48040    int n_val;
48041
48042    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48043        mem_base = xmlMemBlocks();
48044        val = gen_xmlNodePtr(n_val, 0);
48045
48046        ret_val = xmlXPathNewNodeSet(val);
48047        desret_xmlXPathObjectPtr(ret_val);
48048        call_tests++;
48049        des_xmlNodePtr(n_val, val, 0);
48050        xmlResetLastError();
48051        if (mem_base != xmlMemBlocks()) {
48052            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
48053	           xmlMemBlocks() - mem_base);
48054	    test_ret++;
48055            printf(" %d", n_val);
48056            printf("\n");
48057        }
48058    }
48059    function_tests++;
48060#endif
48061
48062    return(test_ret);
48063}
48064
48065
48066static int
48067test_xmlXPathNewNodeSetList(void) {
48068    int test_ret = 0;
48069
48070#if defined(LIBXML_XPATH_ENABLED)
48071    int mem_base;
48072    xmlXPathObjectPtr ret_val;
48073    xmlNodeSetPtr val; /* an existing NodeSet */
48074    int n_val;
48075
48076    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
48077        mem_base = xmlMemBlocks();
48078        val = gen_xmlNodeSetPtr(n_val, 0);
48079
48080        ret_val = xmlXPathNewNodeSetList(val);
48081        desret_xmlXPathObjectPtr(ret_val);
48082        call_tests++;
48083        des_xmlNodeSetPtr(n_val, val, 0);
48084        xmlResetLastError();
48085        if (mem_base != xmlMemBlocks()) {
48086            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
48087	           xmlMemBlocks() - mem_base);
48088	    test_ret++;
48089            printf(" %d", n_val);
48090            printf("\n");
48091        }
48092    }
48093    function_tests++;
48094#endif
48095
48096    return(test_ret);
48097}
48098
48099
48100static int
48101test_xmlXPathNewParserContext(void) {
48102    int test_ret = 0;
48103
48104
48105    /* missing type support */
48106    return(test_ret);
48107}
48108
48109
48110static int
48111test_xmlXPathNewString(void) {
48112    int test_ret = 0;
48113
48114#if defined(LIBXML_XPATH_ENABLED)
48115    int mem_base;
48116    xmlXPathObjectPtr ret_val;
48117    xmlChar * val; /* the xmlChar * value */
48118    int n_val;
48119
48120    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
48121        mem_base = xmlMemBlocks();
48122        val = gen_const_xmlChar_ptr(n_val, 0);
48123
48124        ret_val = xmlXPathNewString((const xmlChar *)val);
48125        desret_xmlXPathObjectPtr(ret_val);
48126        call_tests++;
48127        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
48128        xmlResetLastError();
48129        if (mem_base != xmlMemBlocks()) {
48130            printf("Leak of %d blocks found in xmlXPathNewString",
48131	           xmlMemBlocks() - mem_base);
48132	    test_ret++;
48133            printf(" %d", n_val);
48134            printf("\n");
48135        }
48136    }
48137    function_tests++;
48138#endif
48139
48140    return(test_ret);
48141}
48142
48143
48144static int
48145test_xmlXPathNextAncestor(void) {
48146    int test_ret = 0;
48147
48148#if defined(LIBXML_XPATH_ENABLED)
48149    int mem_base;
48150    xmlNodePtr ret_val;
48151    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48152    int n_ctxt;
48153    xmlNodePtr cur; /* the current node in the traversal */
48154    int n_cur;
48155
48156    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48157    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48158        mem_base = xmlMemBlocks();
48159        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48160        cur = gen_xmlNodePtr(n_cur, 1);
48161
48162        ret_val = xmlXPathNextAncestor(ctxt, cur);
48163        desret_xmlNodePtr(ret_val);
48164        call_tests++;
48165        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48166        des_xmlNodePtr(n_cur, cur, 1);
48167        xmlResetLastError();
48168        if (mem_base != xmlMemBlocks()) {
48169            printf("Leak of %d blocks found in xmlXPathNextAncestor",
48170	           xmlMemBlocks() - mem_base);
48171	    test_ret++;
48172            printf(" %d", n_ctxt);
48173            printf(" %d", n_cur);
48174            printf("\n");
48175        }
48176    }
48177    }
48178    function_tests++;
48179#endif
48180
48181    return(test_ret);
48182}
48183
48184
48185static int
48186test_xmlXPathNextAncestorOrSelf(void) {
48187    int test_ret = 0;
48188
48189#if defined(LIBXML_XPATH_ENABLED)
48190    int mem_base;
48191    xmlNodePtr ret_val;
48192    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48193    int n_ctxt;
48194    xmlNodePtr cur; /* the current node in the traversal */
48195    int n_cur;
48196
48197    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48198    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48199        mem_base = xmlMemBlocks();
48200        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48201        cur = gen_xmlNodePtr(n_cur, 1);
48202
48203        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
48204        desret_xmlNodePtr(ret_val);
48205        call_tests++;
48206        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48207        des_xmlNodePtr(n_cur, cur, 1);
48208        xmlResetLastError();
48209        if (mem_base != xmlMemBlocks()) {
48210            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
48211	           xmlMemBlocks() - mem_base);
48212	    test_ret++;
48213            printf(" %d", n_ctxt);
48214            printf(" %d", n_cur);
48215            printf("\n");
48216        }
48217    }
48218    }
48219    function_tests++;
48220#endif
48221
48222    return(test_ret);
48223}
48224
48225
48226static int
48227test_xmlXPathNextAttribute(void) {
48228    int test_ret = 0;
48229
48230#if defined(LIBXML_XPATH_ENABLED)
48231    int mem_base;
48232    xmlNodePtr ret_val;
48233    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48234    int n_ctxt;
48235    xmlNodePtr cur; /* the current attribute in the traversal */
48236    int n_cur;
48237
48238    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48239    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48240        mem_base = xmlMemBlocks();
48241        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48242        cur = gen_xmlNodePtr(n_cur, 1);
48243
48244        ret_val = xmlXPathNextAttribute(ctxt, cur);
48245        desret_xmlNodePtr(ret_val);
48246        call_tests++;
48247        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48248        des_xmlNodePtr(n_cur, cur, 1);
48249        xmlResetLastError();
48250        if (mem_base != xmlMemBlocks()) {
48251            printf("Leak of %d blocks found in xmlXPathNextAttribute",
48252	           xmlMemBlocks() - mem_base);
48253	    test_ret++;
48254            printf(" %d", n_ctxt);
48255            printf(" %d", n_cur);
48256            printf("\n");
48257        }
48258    }
48259    }
48260    function_tests++;
48261#endif
48262
48263    return(test_ret);
48264}
48265
48266
48267static int
48268test_xmlXPathNextChild(void) {
48269    int test_ret = 0;
48270
48271#if defined(LIBXML_XPATH_ENABLED)
48272    int mem_base;
48273    xmlNodePtr ret_val;
48274    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48275    int n_ctxt;
48276    xmlNodePtr cur; /* the current node in the traversal */
48277    int n_cur;
48278
48279    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48280    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48281        mem_base = xmlMemBlocks();
48282        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48283        cur = gen_xmlNodePtr(n_cur, 1);
48284
48285        ret_val = xmlXPathNextChild(ctxt, cur);
48286        desret_xmlNodePtr(ret_val);
48287        call_tests++;
48288        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48289        des_xmlNodePtr(n_cur, cur, 1);
48290        xmlResetLastError();
48291        if (mem_base != xmlMemBlocks()) {
48292            printf("Leak of %d blocks found in xmlXPathNextChild",
48293	           xmlMemBlocks() - mem_base);
48294	    test_ret++;
48295            printf(" %d", n_ctxt);
48296            printf(" %d", n_cur);
48297            printf("\n");
48298        }
48299    }
48300    }
48301    function_tests++;
48302#endif
48303
48304    return(test_ret);
48305}
48306
48307
48308static int
48309test_xmlXPathNextDescendant(void) {
48310    int test_ret = 0;
48311
48312#if defined(LIBXML_XPATH_ENABLED)
48313    int mem_base;
48314    xmlNodePtr ret_val;
48315    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48316    int n_ctxt;
48317    xmlNodePtr cur; /* the current node in the traversal */
48318    int n_cur;
48319
48320    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48321    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48322        mem_base = xmlMemBlocks();
48323        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48324        cur = gen_xmlNodePtr(n_cur, 1);
48325
48326        ret_val = xmlXPathNextDescendant(ctxt, cur);
48327        desret_xmlNodePtr(ret_val);
48328        call_tests++;
48329        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48330        des_xmlNodePtr(n_cur, cur, 1);
48331        xmlResetLastError();
48332        if (mem_base != xmlMemBlocks()) {
48333            printf("Leak of %d blocks found in xmlXPathNextDescendant",
48334	           xmlMemBlocks() - mem_base);
48335	    test_ret++;
48336            printf(" %d", n_ctxt);
48337            printf(" %d", n_cur);
48338            printf("\n");
48339        }
48340    }
48341    }
48342    function_tests++;
48343#endif
48344
48345    return(test_ret);
48346}
48347
48348
48349static int
48350test_xmlXPathNextDescendantOrSelf(void) {
48351    int test_ret = 0;
48352
48353#if defined(LIBXML_XPATH_ENABLED)
48354    int mem_base;
48355    xmlNodePtr ret_val;
48356    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48357    int n_ctxt;
48358    xmlNodePtr cur; /* the current node in the traversal */
48359    int n_cur;
48360
48361    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48362    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48363        mem_base = xmlMemBlocks();
48364        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48365        cur = gen_xmlNodePtr(n_cur, 1);
48366
48367        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48368        desret_xmlNodePtr(ret_val);
48369        call_tests++;
48370        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48371        des_xmlNodePtr(n_cur, cur, 1);
48372        xmlResetLastError();
48373        if (mem_base != xmlMemBlocks()) {
48374            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48375	           xmlMemBlocks() - mem_base);
48376	    test_ret++;
48377            printf(" %d", n_ctxt);
48378            printf(" %d", n_cur);
48379            printf("\n");
48380        }
48381    }
48382    }
48383    function_tests++;
48384#endif
48385
48386    return(test_ret);
48387}
48388
48389
48390static int
48391test_xmlXPathNextFollowing(void) {
48392    int test_ret = 0;
48393
48394#if defined(LIBXML_XPATH_ENABLED)
48395    int mem_base;
48396    xmlNodePtr ret_val;
48397    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48398    int n_ctxt;
48399    xmlNodePtr cur; /* the current node in the traversal */
48400    int n_cur;
48401
48402    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48403    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48404        mem_base = xmlMemBlocks();
48405        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48406        cur = gen_xmlNodePtr(n_cur, 1);
48407
48408        ret_val = xmlXPathNextFollowing(ctxt, cur);
48409        desret_xmlNodePtr(ret_val);
48410        call_tests++;
48411        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48412        des_xmlNodePtr(n_cur, cur, 1);
48413        xmlResetLastError();
48414        if (mem_base != xmlMemBlocks()) {
48415            printf("Leak of %d blocks found in xmlXPathNextFollowing",
48416	           xmlMemBlocks() - mem_base);
48417	    test_ret++;
48418            printf(" %d", n_ctxt);
48419            printf(" %d", n_cur);
48420            printf("\n");
48421        }
48422    }
48423    }
48424    function_tests++;
48425#endif
48426
48427    return(test_ret);
48428}
48429
48430
48431static int
48432test_xmlXPathNextFollowingSibling(void) {
48433    int test_ret = 0;
48434
48435#if defined(LIBXML_XPATH_ENABLED)
48436    int mem_base;
48437    xmlNodePtr ret_val;
48438    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48439    int n_ctxt;
48440    xmlNodePtr cur; /* the current node in the traversal */
48441    int n_cur;
48442
48443    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48444    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48445        mem_base = xmlMemBlocks();
48446        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48447        cur = gen_xmlNodePtr(n_cur, 1);
48448
48449        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48450        desret_xmlNodePtr(ret_val);
48451        call_tests++;
48452        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48453        des_xmlNodePtr(n_cur, cur, 1);
48454        xmlResetLastError();
48455        if (mem_base != xmlMemBlocks()) {
48456            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48457	           xmlMemBlocks() - mem_base);
48458	    test_ret++;
48459            printf(" %d", n_ctxt);
48460            printf(" %d", n_cur);
48461            printf("\n");
48462        }
48463    }
48464    }
48465    function_tests++;
48466#endif
48467
48468    return(test_ret);
48469}
48470
48471
48472static int
48473test_xmlXPathNextNamespace(void) {
48474    int test_ret = 0;
48475
48476#if defined(LIBXML_XPATH_ENABLED)
48477    int mem_base;
48478    xmlNodePtr ret_val;
48479    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48480    int n_ctxt;
48481    xmlNodePtr cur; /* the current attribute in the traversal */
48482    int n_cur;
48483
48484    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48485    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48486        mem_base = xmlMemBlocks();
48487        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48488        cur = gen_xmlNodePtr(n_cur, 1);
48489
48490        ret_val = xmlXPathNextNamespace(ctxt, cur);
48491        desret_xmlNodePtr(ret_val);
48492        call_tests++;
48493        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48494        des_xmlNodePtr(n_cur, cur, 1);
48495        xmlResetLastError();
48496        if (mem_base != xmlMemBlocks()) {
48497            printf("Leak of %d blocks found in xmlXPathNextNamespace",
48498	           xmlMemBlocks() - mem_base);
48499	    test_ret++;
48500            printf(" %d", n_ctxt);
48501            printf(" %d", n_cur);
48502            printf("\n");
48503        }
48504    }
48505    }
48506    function_tests++;
48507#endif
48508
48509    return(test_ret);
48510}
48511
48512
48513static int
48514test_xmlXPathNextParent(void) {
48515    int test_ret = 0;
48516
48517#if defined(LIBXML_XPATH_ENABLED)
48518    int mem_base;
48519    xmlNodePtr ret_val;
48520    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48521    int n_ctxt;
48522    xmlNodePtr cur; /* the current node in the traversal */
48523    int n_cur;
48524
48525    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48526    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48527        mem_base = xmlMemBlocks();
48528        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48529        cur = gen_xmlNodePtr(n_cur, 1);
48530
48531        ret_val = xmlXPathNextParent(ctxt, cur);
48532        desret_xmlNodePtr(ret_val);
48533        call_tests++;
48534        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48535        des_xmlNodePtr(n_cur, cur, 1);
48536        xmlResetLastError();
48537        if (mem_base != xmlMemBlocks()) {
48538            printf("Leak of %d blocks found in xmlXPathNextParent",
48539	           xmlMemBlocks() - mem_base);
48540	    test_ret++;
48541            printf(" %d", n_ctxt);
48542            printf(" %d", n_cur);
48543            printf("\n");
48544        }
48545    }
48546    }
48547    function_tests++;
48548#endif
48549
48550    return(test_ret);
48551}
48552
48553
48554static int
48555test_xmlXPathNextPreceding(void) {
48556    int test_ret = 0;
48557
48558#if defined(LIBXML_XPATH_ENABLED)
48559    int mem_base;
48560    xmlNodePtr ret_val;
48561    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48562    int n_ctxt;
48563    xmlNodePtr cur; /* the current node in the traversal */
48564    int n_cur;
48565
48566    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48567    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48568        mem_base = xmlMemBlocks();
48569        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48570        cur = gen_xmlNodePtr(n_cur, 1);
48571
48572        ret_val = xmlXPathNextPreceding(ctxt, cur);
48573        desret_xmlNodePtr(ret_val);
48574        call_tests++;
48575        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48576        des_xmlNodePtr(n_cur, cur, 1);
48577        xmlResetLastError();
48578        if (mem_base != xmlMemBlocks()) {
48579            printf("Leak of %d blocks found in xmlXPathNextPreceding",
48580	           xmlMemBlocks() - mem_base);
48581	    test_ret++;
48582            printf(" %d", n_ctxt);
48583            printf(" %d", n_cur);
48584            printf("\n");
48585        }
48586    }
48587    }
48588    function_tests++;
48589#endif
48590
48591    return(test_ret);
48592}
48593
48594
48595static int
48596test_xmlXPathNextPrecedingSibling(void) {
48597    int test_ret = 0;
48598
48599#if defined(LIBXML_XPATH_ENABLED)
48600    int mem_base;
48601    xmlNodePtr ret_val;
48602    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48603    int n_ctxt;
48604    xmlNodePtr cur; /* the current node in the traversal */
48605    int n_cur;
48606
48607    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48608    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48609        mem_base = xmlMemBlocks();
48610        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48611        cur = gen_xmlNodePtr(n_cur, 1);
48612
48613        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48614        desret_xmlNodePtr(ret_val);
48615        call_tests++;
48616        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48617        des_xmlNodePtr(n_cur, cur, 1);
48618        xmlResetLastError();
48619        if (mem_base != xmlMemBlocks()) {
48620            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48621	           xmlMemBlocks() - mem_base);
48622	    test_ret++;
48623            printf(" %d", n_ctxt);
48624            printf(" %d", n_cur);
48625            printf("\n");
48626        }
48627    }
48628    }
48629    function_tests++;
48630#endif
48631
48632    return(test_ret);
48633}
48634
48635
48636static int
48637test_xmlXPathNextSelf(void) {
48638    int test_ret = 0;
48639
48640#if defined(LIBXML_XPATH_ENABLED)
48641    int mem_base;
48642    xmlNodePtr ret_val;
48643    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48644    int n_ctxt;
48645    xmlNodePtr cur; /* the current node in the traversal */
48646    int n_cur;
48647
48648    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48649    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48650        mem_base = xmlMemBlocks();
48651        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48652        cur = gen_xmlNodePtr(n_cur, 1);
48653
48654        ret_val = xmlXPathNextSelf(ctxt, cur);
48655        desret_xmlNodePtr(ret_val);
48656        call_tests++;
48657        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48658        des_xmlNodePtr(n_cur, cur, 1);
48659        xmlResetLastError();
48660        if (mem_base != xmlMemBlocks()) {
48661            printf("Leak of %d blocks found in xmlXPathNextSelf",
48662	           xmlMemBlocks() - mem_base);
48663	    test_ret++;
48664            printf(" %d", n_ctxt);
48665            printf(" %d", n_cur);
48666            printf("\n");
48667        }
48668    }
48669    }
48670    function_tests++;
48671#endif
48672
48673    return(test_ret);
48674}
48675
48676
48677static int
48678test_xmlXPathNodeLeading(void) {
48679    int test_ret = 0;
48680
48681#if defined(LIBXML_XPATH_ENABLED)
48682    int mem_base;
48683    xmlNodeSetPtr ret_val;
48684    xmlNodeSetPtr nodes; /* a node-set */
48685    int n_nodes;
48686    xmlNodePtr node; /* a node */
48687    int n_node;
48688
48689    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48690    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48691        mem_base = xmlMemBlocks();
48692        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48693        node = gen_xmlNodePtr(n_node, 1);
48694
48695        ret_val = xmlXPathNodeLeading(nodes, node);
48696        desret_xmlNodeSetPtr(ret_val);
48697        call_tests++;
48698        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48699        des_xmlNodePtr(n_node, node, 1);
48700        xmlResetLastError();
48701        if (mem_base != xmlMemBlocks()) {
48702            printf("Leak of %d blocks found in xmlXPathNodeLeading",
48703	           xmlMemBlocks() - mem_base);
48704	    test_ret++;
48705            printf(" %d", n_nodes);
48706            printf(" %d", n_node);
48707            printf("\n");
48708        }
48709    }
48710    }
48711    function_tests++;
48712#endif
48713
48714    return(test_ret);
48715}
48716
48717
48718static int
48719test_xmlXPathNodeLeadingSorted(void) {
48720    int test_ret = 0;
48721
48722#if defined(LIBXML_XPATH_ENABLED)
48723    int mem_base;
48724    xmlNodeSetPtr ret_val;
48725    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48726    int n_nodes;
48727    xmlNodePtr node; /* a node */
48728    int n_node;
48729
48730    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48731    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48732        mem_base = xmlMemBlocks();
48733        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48734        node = gen_xmlNodePtr(n_node, 1);
48735
48736        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48737        desret_xmlNodeSetPtr(ret_val);
48738        call_tests++;
48739        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48740        des_xmlNodePtr(n_node, node, 1);
48741        xmlResetLastError();
48742        if (mem_base != xmlMemBlocks()) {
48743            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48744	           xmlMemBlocks() - mem_base);
48745	    test_ret++;
48746            printf(" %d", n_nodes);
48747            printf(" %d", n_node);
48748            printf("\n");
48749        }
48750    }
48751    }
48752    function_tests++;
48753#endif
48754
48755    return(test_ret);
48756}
48757
48758
48759static int
48760test_xmlXPathNodeSetAdd(void) {
48761    int test_ret = 0;
48762
48763#if defined(LIBXML_XPATH_ENABLED)
48764    int mem_base;
48765    xmlNodeSetPtr cur; /* the initial node set */
48766    int n_cur;
48767    xmlNodePtr val; /* a new xmlNodePtr */
48768    int n_val;
48769
48770    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48771    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48772        mem_base = xmlMemBlocks();
48773        cur = gen_xmlNodeSetPtr(n_cur, 0);
48774        val = gen_xmlNodePtr(n_val, 1);
48775
48776        xmlXPathNodeSetAdd(cur, val);
48777        call_tests++;
48778        des_xmlNodeSetPtr(n_cur, cur, 0);
48779        des_xmlNodePtr(n_val, val, 1);
48780        xmlResetLastError();
48781        if (mem_base != xmlMemBlocks()) {
48782            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48783	           xmlMemBlocks() - mem_base);
48784	    test_ret++;
48785            printf(" %d", n_cur);
48786            printf(" %d", n_val);
48787            printf("\n");
48788        }
48789    }
48790    }
48791    function_tests++;
48792#endif
48793
48794    return(test_ret);
48795}
48796
48797
48798static int
48799test_xmlXPathNodeSetAddNs(void) {
48800    int test_ret = 0;
48801
48802#if defined(LIBXML_XPATH_ENABLED)
48803    int mem_base;
48804    xmlNodeSetPtr cur; /* the initial node set */
48805    int n_cur;
48806    xmlNodePtr node; /* the hosting node */
48807    int n_node;
48808    xmlNsPtr ns; /* a the namespace node */
48809    int n_ns;
48810
48811    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48812    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48813    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48814        mem_base = xmlMemBlocks();
48815        cur = gen_xmlNodeSetPtr(n_cur, 0);
48816        node = gen_xmlNodePtr(n_node, 1);
48817        ns = gen_xmlNsPtr(n_ns, 2);
48818
48819        xmlXPathNodeSetAddNs(cur, node, ns);
48820        call_tests++;
48821        des_xmlNodeSetPtr(n_cur, cur, 0);
48822        des_xmlNodePtr(n_node, node, 1);
48823        des_xmlNsPtr(n_ns, ns, 2);
48824        xmlResetLastError();
48825        if (mem_base != xmlMemBlocks()) {
48826            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48827	           xmlMemBlocks() - mem_base);
48828	    test_ret++;
48829            printf(" %d", n_cur);
48830            printf(" %d", n_node);
48831            printf(" %d", n_ns);
48832            printf("\n");
48833        }
48834    }
48835    }
48836    }
48837    function_tests++;
48838#endif
48839
48840    return(test_ret);
48841}
48842
48843
48844static int
48845test_xmlXPathNodeSetAddUnique(void) {
48846    int test_ret = 0;
48847
48848#if defined(LIBXML_XPATH_ENABLED)
48849    int mem_base;
48850    xmlNodeSetPtr cur; /* the initial node set */
48851    int n_cur;
48852    xmlNodePtr val; /* a new xmlNodePtr */
48853    int n_val;
48854
48855    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48856    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48857        mem_base = xmlMemBlocks();
48858        cur = gen_xmlNodeSetPtr(n_cur, 0);
48859        val = gen_xmlNodePtr(n_val, 1);
48860
48861        xmlXPathNodeSetAddUnique(cur, val);
48862        call_tests++;
48863        des_xmlNodeSetPtr(n_cur, cur, 0);
48864        des_xmlNodePtr(n_val, val, 1);
48865        xmlResetLastError();
48866        if (mem_base != xmlMemBlocks()) {
48867            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48868	           xmlMemBlocks() - mem_base);
48869	    test_ret++;
48870            printf(" %d", n_cur);
48871            printf(" %d", n_val);
48872            printf("\n");
48873        }
48874    }
48875    }
48876    function_tests++;
48877#endif
48878
48879    return(test_ret);
48880}
48881
48882
48883static int
48884test_xmlXPathNodeSetContains(void) {
48885    int test_ret = 0;
48886
48887#if defined(LIBXML_XPATH_ENABLED)
48888    int mem_base;
48889    int ret_val;
48890    xmlNodeSetPtr cur; /* the node-set */
48891    int n_cur;
48892    xmlNodePtr val; /* the node */
48893    int n_val;
48894
48895    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48896    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48897        mem_base = xmlMemBlocks();
48898        cur = gen_xmlNodeSetPtr(n_cur, 0);
48899        val = gen_xmlNodePtr(n_val, 1);
48900
48901        ret_val = xmlXPathNodeSetContains(cur, val);
48902        desret_int(ret_val);
48903        call_tests++;
48904        des_xmlNodeSetPtr(n_cur, cur, 0);
48905        des_xmlNodePtr(n_val, val, 1);
48906        xmlResetLastError();
48907        if (mem_base != xmlMemBlocks()) {
48908            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48909	           xmlMemBlocks() - mem_base);
48910	    test_ret++;
48911            printf(" %d", n_cur);
48912            printf(" %d", n_val);
48913            printf("\n");
48914        }
48915    }
48916    }
48917    function_tests++;
48918#endif
48919
48920    return(test_ret);
48921}
48922
48923
48924static int
48925test_xmlXPathNodeSetDel(void) {
48926    int test_ret = 0;
48927
48928#if defined(LIBXML_XPATH_ENABLED)
48929    int mem_base;
48930    xmlNodeSetPtr cur; /* the initial node set */
48931    int n_cur;
48932    xmlNodePtr val; /* an xmlNodePtr */
48933    int n_val;
48934
48935    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48936    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48937        mem_base = xmlMemBlocks();
48938        cur = gen_xmlNodeSetPtr(n_cur, 0);
48939        val = gen_xmlNodePtr(n_val, 1);
48940
48941        xmlXPathNodeSetDel(cur, val);
48942        call_tests++;
48943        des_xmlNodeSetPtr(n_cur, cur, 0);
48944        des_xmlNodePtr(n_val, val, 1);
48945        xmlResetLastError();
48946        if (mem_base != xmlMemBlocks()) {
48947            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48948	           xmlMemBlocks() - mem_base);
48949	    test_ret++;
48950            printf(" %d", n_cur);
48951            printf(" %d", n_val);
48952            printf("\n");
48953        }
48954    }
48955    }
48956    function_tests++;
48957#endif
48958
48959    return(test_ret);
48960}
48961
48962
48963static int
48964test_xmlXPathNodeSetMerge(void) {
48965    int test_ret = 0;
48966
48967#if defined(LIBXML_XPATH_ENABLED)
48968    int mem_base;
48969    xmlNodeSetPtr ret_val;
48970    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48971    int n_val1;
48972    xmlNodeSetPtr val2; /* the second NodeSet */
48973    int n_val2;
48974
48975    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48976    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48977        mem_base = xmlMemBlocks();
48978        val1 = gen_xmlNodeSetPtr(n_val1, 0);
48979        val2 = gen_xmlNodeSetPtr(n_val2, 1);
48980
48981        ret_val = xmlXPathNodeSetMerge(val1, val2);
48982        desret_xmlNodeSetPtr(ret_val);
48983        call_tests++;
48984        des_xmlNodeSetPtr(n_val1, val1, 0);
48985        des_xmlNodeSetPtr(n_val2, val2, 1);
48986        xmlResetLastError();
48987        if (mem_base != xmlMemBlocks()) {
48988            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48989	           xmlMemBlocks() - mem_base);
48990	    test_ret++;
48991            printf(" %d", n_val1);
48992            printf(" %d", n_val2);
48993            printf("\n");
48994        }
48995    }
48996    }
48997    function_tests++;
48998#endif
48999
49000    return(test_ret);
49001}
49002
49003
49004static int
49005test_xmlXPathNodeSetRemove(void) {
49006    int test_ret = 0;
49007
49008#if defined(LIBXML_XPATH_ENABLED)
49009    int mem_base;
49010    xmlNodeSetPtr cur; /* the initial node set */
49011    int n_cur;
49012    int val; /* the index to remove */
49013    int n_val;
49014
49015    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
49016    for (n_val = 0;n_val < gen_nb_int;n_val++) {
49017        mem_base = xmlMemBlocks();
49018        cur = gen_xmlNodeSetPtr(n_cur, 0);
49019        val = gen_int(n_val, 1);
49020
49021        xmlXPathNodeSetRemove(cur, val);
49022        call_tests++;
49023        des_xmlNodeSetPtr(n_cur, cur, 0);
49024        des_int(n_val, val, 1);
49025        xmlResetLastError();
49026        if (mem_base != xmlMemBlocks()) {
49027            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
49028	           xmlMemBlocks() - mem_base);
49029	    test_ret++;
49030            printf(" %d", n_cur);
49031            printf(" %d", n_val);
49032            printf("\n");
49033        }
49034    }
49035    }
49036    function_tests++;
49037#endif
49038
49039    return(test_ret);
49040}
49041
49042
49043static int
49044test_xmlXPathNodeSetSort(void) {
49045    int test_ret = 0;
49046
49047#if defined(LIBXML_XPATH_ENABLED)
49048    int mem_base;
49049    xmlNodeSetPtr set; /* the node set */
49050    int n_set;
49051
49052    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
49053        mem_base = xmlMemBlocks();
49054        set = gen_xmlNodeSetPtr(n_set, 0);
49055
49056        xmlXPathNodeSetSort(set);
49057        call_tests++;
49058        des_xmlNodeSetPtr(n_set, set, 0);
49059        xmlResetLastError();
49060        if (mem_base != xmlMemBlocks()) {
49061            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
49062	           xmlMemBlocks() - mem_base);
49063	    test_ret++;
49064            printf(" %d", n_set);
49065            printf("\n");
49066        }
49067    }
49068    function_tests++;
49069#endif
49070
49071    return(test_ret);
49072}
49073
49074
49075static int
49076test_xmlXPathNodeTrailing(void) {
49077    int test_ret = 0;
49078
49079#if defined(LIBXML_XPATH_ENABLED)
49080    int mem_base;
49081    xmlNodeSetPtr ret_val;
49082    xmlNodeSetPtr nodes; /* a node-set */
49083    int n_nodes;
49084    xmlNodePtr node; /* a node */
49085    int n_node;
49086
49087    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49088    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49089        mem_base = xmlMemBlocks();
49090        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49091        node = gen_xmlNodePtr(n_node, 1);
49092
49093        ret_val = xmlXPathNodeTrailing(nodes, node);
49094        desret_xmlNodeSetPtr(ret_val);
49095        call_tests++;
49096        des_xmlNodeSetPtr(n_nodes, nodes, 0);
49097        des_xmlNodePtr(n_node, node, 1);
49098        xmlResetLastError();
49099        if (mem_base != xmlMemBlocks()) {
49100            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
49101	           xmlMemBlocks() - mem_base);
49102	    test_ret++;
49103            printf(" %d", n_nodes);
49104            printf(" %d", n_node);
49105            printf("\n");
49106        }
49107    }
49108    }
49109    function_tests++;
49110#endif
49111
49112    return(test_ret);
49113}
49114
49115
49116static int
49117test_xmlXPathNodeTrailingSorted(void) {
49118    int test_ret = 0;
49119
49120#if defined(LIBXML_XPATH_ENABLED)
49121    int mem_base;
49122    xmlNodeSetPtr ret_val;
49123    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
49124    int n_nodes;
49125    xmlNodePtr node; /* a node */
49126    int n_node;
49127
49128    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
49129    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
49130        mem_base = xmlMemBlocks();
49131        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
49132        node = gen_xmlNodePtr(n_node, 1);
49133
49134        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
49135        desret_xmlNodeSetPtr(ret_val);
49136        call_tests++;
49137        des_xmlNodeSetPtr(n_nodes, nodes, 0);
49138        des_xmlNodePtr(n_node, node, 1);
49139        xmlResetLastError();
49140        if (mem_base != xmlMemBlocks()) {
49141            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
49142	           xmlMemBlocks() - mem_base);
49143	    test_ret++;
49144            printf(" %d", n_nodes);
49145            printf(" %d", n_node);
49146            printf("\n");
49147        }
49148    }
49149    }
49150    function_tests++;
49151#endif
49152
49153    return(test_ret);
49154}
49155
49156
49157static int
49158test_xmlXPathNormalizeFunction(void) {
49159    int test_ret = 0;
49160
49161#if defined(LIBXML_XPATH_ENABLED)
49162    int mem_base;
49163    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49164    int n_ctxt;
49165    int nargs; /* the number of arguments */
49166    int n_nargs;
49167
49168    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49169    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49170        mem_base = xmlMemBlocks();
49171        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49172        nargs = gen_int(n_nargs, 1);
49173
49174        xmlXPathNormalizeFunction(ctxt, nargs);
49175        call_tests++;
49176        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49177        des_int(n_nargs, nargs, 1);
49178        xmlResetLastError();
49179        if (mem_base != xmlMemBlocks()) {
49180            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
49181	           xmlMemBlocks() - mem_base);
49182	    test_ret++;
49183            printf(" %d", n_ctxt);
49184            printf(" %d", n_nargs);
49185            printf("\n");
49186        }
49187    }
49188    }
49189    function_tests++;
49190#endif
49191
49192    return(test_ret);
49193}
49194
49195
49196static int
49197test_xmlXPathNotEqualValues(void) {
49198    int test_ret = 0;
49199
49200#if defined(LIBXML_XPATH_ENABLED)
49201    int mem_base;
49202    int ret_val;
49203    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49204    int n_ctxt;
49205
49206    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49207        mem_base = xmlMemBlocks();
49208        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49209
49210        ret_val = xmlXPathNotEqualValues(ctxt);
49211        desret_int(ret_val);
49212        call_tests++;
49213        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49214        xmlResetLastError();
49215        if (mem_base != xmlMemBlocks()) {
49216            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
49217	           xmlMemBlocks() - mem_base);
49218	    test_ret++;
49219            printf(" %d", n_ctxt);
49220            printf("\n");
49221        }
49222    }
49223    function_tests++;
49224#endif
49225
49226    return(test_ret);
49227}
49228
49229
49230static int
49231test_xmlXPathNotFunction(void) {
49232    int test_ret = 0;
49233
49234#if defined(LIBXML_XPATH_ENABLED)
49235    int mem_base;
49236    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49237    int n_ctxt;
49238    int nargs; /* the number of arguments */
49239    int n_nargs;
49240
49241    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49242    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49243        mem_base = xmlMemBlocks();
49244        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49245        nargs = gen_int(n_nargs, 1);
49246
49247        xmlXPathNotFunction(ctxt, nargs);
49248        call_tests++;
49249        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49250        des_int(n_nargs, nargs, 1);
49251        xmlResetLastError();
49252        if (mem_base != xmlMemBlocks()) {
49253            printf("Leak of %d blocks found in xmlXPathNotFunction",
49254	           xmlMemBlocks() - mem_base);
49255	    test_ret++;
49256            printf(" %d", n_ctxt);
49257            printf(" %d", n_nargs);
49258            printf("\n");
49259        }
49260    }
49261    }
49262    function_tests++;
49263#endif
49264
49265    return(test_ret);
49266}
49267
49268
49269static int
49270test_xmlXPathNsLookup(void) {
49271    int test_ret = 0;
49272
49273#if defined(LIBXML_XPATH_ENABLED)
49274    int mem_base;
49275    const xmlChar * ret_val;
49276    xmlXPathContextPtr ctxt; /* the XPath context */
49277    int n_ctxt;
49278    xmlChar * prefix; /* the namespace prefix value */
49279    int n_prefix;
49280
49281    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49282    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49283        mem_base = xmlMemBlocks();
49284        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49285        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49286
49287        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49288        desret_const_xmlChar_ptr(ret_val);
49289        call_tests++;
49290        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49291        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49292        xmlResetLastError();
49293        if (mem_base != xmlMemBlocks()) {
49294            printf("Leak of %d blocks found in xmlXPathNsLookup",
49295	           xmlMemBlocks() - mem_base);
49296	    test_ret++;
49297            printf(" %d", n_ctxt);
49298            printf(" %d", n_prefix);
49299            printf("\n");
49300        }
49301    }
49302    }
49303    function_tests++;
49304#endif
49305
49306    return(test_ret);
49307}
49308
49309
49310static int
49311test_xmlXPathNumberFunction(void) {
49312    int test_ret = 0;
49313
49314#if defined(LIBXML_XPATH_ENABLED)
49315    int mem_base;
49316    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49317    int n_ctxt;
49318    int nargs; /* the number of arguments */
49319    int n_nargs;
49320
49321    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49322    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49323        mem_base = xmlMemBlocks();
49324        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49325        nargs = gen_int(n_nargs, 1);
49326
49327        xmlXPathNumberFunction(ctxt, nargs);
49328        call_tests++;
49329        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49330        des_int(n_nargs, nargs, 1);
49331        xmlResetLastError();
49332        if (mem_base != xmlMemBlocks()) {
49333            printf("Leak of %d blocks found in xmlXPathNumberFunction",
49334	           xmlMemBlocks() - mem_base);
49335	    test_ret++;
49336            printf(" %d", n_ctxt);
49337            printf(" %d", n_nargs);
49338            printf("\n");
49339        }
49340    }
49341    }
49342    function_tests++;
49343#endif
49344
49345    return(test_ret);
49346}
49347
49348
49349static int
49350test_xmlXPathParseNCName(void) {
49351    int test_ret = 0;
49352
49353#if defined(LIBXML_XPATH_ENABLED)
49354    int mem_base;
49355    xmlChar * ret_val;
49356    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49357    int n_ctxt;
49358
49359    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49360        mem_base = xmlMemBlocks();
49361        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49362
49363        ret_val = xmlXPathParseNCName(ctxt);
49364        desret_xmlChar_ptr(ret_val);
49365        call_tests++;
49366        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49367        xmlResetLastError();
49368        if (mem_base != xmlMemBlocks()) {
49369            printf("Leak of %d blocks found in xmlXPathParseNCName",
49370	           xmlMemBlocks() - mem_base);
49371	    test_ret++;
49372            printf(" %d", n_ctxt);
49373            printf("\n");
49374        }
49375    }
49376    function_tests++;
49377#endif
49378
49379    return(test_ret);
49380}
49381
49382
49383static int
49384test_xmlXPathParseName(void) {
49385    int test_ret = 0;
49386
49387#if defined(LIBXML_XPATH_ENABLED)
49388    int mem_base;
49389    xmlChar * ret_val;
49390    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49391    int n_ctxt;
49392
49393    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49394        mem_base = xmlMemBlocks();
49395        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49396
49397        ret_val = xmlXPathParseName(ctxt);
49398        desret_xmlChar_ptr(ret_val);
49399        call_tests++;
49400        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49401        xmlResetLastError();
49402        if (mem_base != xmlMemBlocks()) {
49403            printf("Leak of %d blocks found in xmlXPathParseName",
49404	           xmlMemBlocks() - mem_base);
49405	    test_ret++;
49406            printf(" %d", n_ctxt);
49407            printf("\n");
49408        }
49409    }
49410    function_tests++;
49411#endif
49412
49413    return(test_ret);
49414}
49415
49416
49417static int
49418test_xmlXPathPopBoolean(void) {
49419    int test_ret = 0;
49420
49421#if defined(LIBXML_XPATH_ENABLED)
49422    int mem_base;
49423    int ret_val;
49424    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49425    int n_ctxt;
49426
49427    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49428        mem_base = xmlMemBlocks();
49429        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49430
49431        ret_val = xmlXPathPopBoolean(ctxt);
49432        desret_int(ret_val);
49433        call_tests++;
49434        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49435        xmlResetLastError();
49436        if (mem_base != xmlMemBlocks()) {
49437            printf("Leak of %d blocks found in xmlXPathPopBoolean",
49438	           xmlMemBlocks() - mem_base);
49439	    test_ret++;
49440            printf(" %d", n_ctxt);
49441            printf("\n");
49442        }
49443    }
49444    function_tests++;
49445#endif
49446
49447    return(test_ret);
49448}
49449
49450
49451static int
49452test_xmlXPathPopExternal(void) {
49453    int test_ret = 0;
49454
49455#if defined(LIBXML_XPATH_ENABLED)
49456    int mem_base;
49457    void * ret_val;
49458    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49459    int n_ctxt;
49460
49461    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49462        mem_base = xmlMemBlocks();
49463        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49464
49465        ret_val = xmlXPathPopExternal(ctxt);
49466        desret_void_ptr(ret_val);
49467        call_tests++;
49468        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49469        xmlResetLastError();
49470        if (mem_base != xmlMemBlocks()) {
49471            printf("Leak of %d blocks found in xmlXPathPopExternal",
49472	           xmlMemBlocks() - mem_base);
49473	    test_ret++;
49474            printf(" %d", n_ctxt);
49475            printf("\n");
49476        }
49477    }
49478    function_tests++;
49479#endif
49480
49481    return(test_ret);
49482}
49483
49484
49485static int
49486test_xmlXPathPopNodeSet(void) {
49487    int test_ret = 0;
49488
49489#if defined(LIBXML_XPATH_ENABLED)
49490    int mem_base;
49491    xmlNodeSetPtr ret_val;
49492    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49493    int n_ctxt;
49494
49495    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49496        mem_base = xmlMemBlocks();
49497        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49498
49499        ret_val = xmlXPathPopNodeSet(ctxt);
49500        desret_xmlNodeSetPtr(ret_val);
49501        call_tests++;
49502        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49503        xmlResetLastError();
49504        if (mem_base != xmlMemBlocks()) {
49505            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49506	           xmlMemBlocks() - mem_base);
49507	    test_ret++;
49508            printf(" %d", n_ctxt);
49509            printf("\n");
49510        }
49511    }
49512    function_tests++;
49513#endif
49514
49515    return(test_ret);
49516}
49517
49518
49519static int
49520test_xmlXPathPopNumber(void) {
49521    int test_ret = 0;
49522
49523#if defined(LIBXML_XPATH_ENABLED)
49524    int mem_base;
49525    double ret_val;
49526    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49527    int n_ctxt;
49528
49529    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49530        mem_base = xmlMemBlocks();
49531        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49532
49533        ret_val = xmlXPathPopNumber(ctxt);
49534        desret_double(ret_val);
49535        call_tests++;
49536        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49537        xmlResetLastError();
49538        if (mem_base != xmlMemBlocks()) {
49539            printf("Leak of %d blocks found in xmlXPathPopNumber",
49540	           xmlMemBlocks() - mem_base);
49541	    test_ret++;
49542            printf(" %d", n_ctxt);
49543            printf("\n");
49544        }
49545    }
49546    function_tests++;
49547#endif
49548
49549    return(test_ret);
49550}
49551
49552
49553static int
49554test_xmlXPathPopString(void) {
49555    int test_ret = 0;
49556
49557#if defined(LIBXML_XPATH_ENABLED)
49558    int mem_base;
49559    xmlChar * ret_val;
49560    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49561    int n_ctxt;
49562
49563    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49564        mem_base = xmlMemBlocks();
49565        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49566
49567        ret_val = xmlXPathPopString(ctxt);
49568        desret_xmlChar_ptr(ret_val);
49569        call_tests++;
49570        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49571        xmlResetLastError();
49572        if (mem_base != xmlMemBlocks()) {
49573            printf("Leak of %d blocks found in xmlXPathPopString",
49574	           xmlMemBlocks() - mem_base);
49575	    test_ret++;
49576            printf(" %d", n_ctxt);
49577            printf("\n");
49578        }
49579    }
49580    function_tests++;
49581#endif
49582
49583    return(test_ret);
49584}
49585
49586
49587static int
49588test_xmlXPathPositionFunction(void) {
49589    int test_ret = 0;
49590
49591#if defined(LIBXML_XPATH_ENABLED)
49592    int mem_base;
49593    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49594    int n_ctxt;
49595    int nargs; /* the number of arguments */
49596    int n_nargs;
49597
49598    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49599    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49600        mem_base = xmlMemBlocks();
49601        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49602        nargs = gen_int(n_nargs, 1);
49603
49604        xmlXPathPositionFunction(ctxt, nargs);
49605        call_tests++;
49606        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49607        des_int(n_nargs, nargs, 1);
49608        xmlResetLastError();
49609        if (mem_base != xmlMemBlocks()) {
49610            printf("Leak of %d blocks found in xmlXPathPositionFunction",
49611	           xmlMemBlocks() - mem_base);
49612	    test_ret++;
49613            printf(" %d", n_ctxt);
49614            printf(" %d", n_nargs);
49615            printf("\n");
49616        }
49617    }
49618    }
49619    function_tests++;
49620#endif
49621
49622    return(test_ret);
49623}
49624
49625
49626static int
49627test_xmlXPathRegisterAllFunctions(void) {
49628    int test_ret = 0;
49629
49630#if defined(LIBXML_XPATH_ENABLED)
49631    int mem_base;
49632    xmlXPathContextPtr ctxt; /* the XPath context */
49633    int n_ctxt;
49634
49635    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49636        mem_base = xmlMemBlocks();
49637        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49638
49639        xmlXPathRegisterAllFunctions(ctxt);
49640        call_tests++;
49641        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49642        xmlResetLastError();
49643        if (mem_base != xmlMemBlocks()) {
49644            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49645	           xmlMemBlocks() - mem_base);
49646	    test_ret++;
49647            printf(" %d", n_ctxt);
49648            printf("\n");
49649        }
49650    }
49651    function_tests++;
49652#endif
49653
49654    return(test_ret);
49655}
49656
49657
49658static int
49659test_xmlXPathRegisterFunc(void) {
49660    int test_ret = 0;
49661
49662
49663    /* missing type support */
49664    return(test_ret);
49665}
49666
49667
49668static int
49669test_xmlXPathRegisterFuncLookup(void) {
49670    int test_ret = 0;
49671
49672
49673    /* missing type support */
49674    return(test_ret);
49675}
49676
49677
49678static int
49679test_xmlXPathRegisterFuncNS(void) {
49680    int test_ret = 0;
49681
49682
49683    /* missing type support */
49684    return(test_ret);
49685}
49686
49687
49688static int
49689test_xmlXPathRegisterNs(void) {
49690    int test_ret = 0;
49691
49692#if defined(LIBXML_XPATH_ENABLED)
49693    int mem_base;
49694    int ret_val;
49695    xmlXPathContextPtr ctxt; /* the XPath context */
49696    int n_ctxt;
49697    xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */
49698    int n_prefix;
49699    xmlChar * ns_uri; /* the namespace name */
49700    int n_ns_uri;
49701
49702    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49703    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49704    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49705        mem_base = xmlMemBlocks();
49706        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49707        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49708        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49709
49710        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49711        desret_int(ret_val);
49712        call_tests++;
49713        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49714        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49715        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49716        xmlResetLastError();
49717        if (mem_base != xmlMemBlocks()) {
49718            printf("Leak of %d blocks found in xmlXPathRegisterNs",
49719	           xmlMemBlocks() - mem_base);
49720	    test_ret++;
49721            printf(" %d", n_ctxt);
49722            printf(" %d", n_prefix);
49723            printf(" %d", n_ns_uri);
49724            printf("\n");
49725        }
49726    }
49727    }
49728    }
49729    function_tests++;
49730#endif
49731
49732    return(test_ret);
49733}
49734
49735
49736static int
49737test_xmlXPathRegisterVariable(void) {
49738    int test_ret = 0;
49739
49740#if defined(LIBXML_XPATH_ENABLED)
49741    int mem_base;
49742    int ret_val;
49743    xmlXPathContextPtr ctxt; /* the XPath context */
49744    int n_ctxt;
49745    xmlChar * name; /* the variable name */
49746    int n_name;
49747    xmlXPathObjectPtr value; /* the variable value or NULL */
49748    int n_value;
49749
49750    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49751    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49752    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49753        mem_base = xmlMemBlocks();
49754        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49755        name = gen_const_xmlChar_ptr(n_name, 1);
49756        value = gen_xmlXPathObjectPtr(n_value, 2);
49757
49758        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49759        desret_int(ret_val);
49760        call_tests++;
49761        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49762        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49763        des_xmlXPathObjectPtr(n_value, value, 2);
49764        xmlResetLastError();
49765        if (mem_base != xmlMemBlocks()) {
49766            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49767	           xmlMemBlocks() - mem_base);
49768	    test_ret++;
49769            printf(" %d", n_ctxt);
49770            printf(" %d", n_name);
49771            printf(" %d", n_value);
49772            printf("\n");
49773        }
49774    }
49775    }
49776    }
49777    function_tests++;
49778#endif
49779
49780    return(test_ret);
49781}
49782
49783
49784static int
49785test_xmlXPathRegisterVariableLookup(void) {
49786    int test_ret = 0;
49787
49788
49789    /* missing type support */
49790    return(test_ret);
49791}
49792
49793
49794static int
49795test_xmlXPathRegisterVariableNS(void) {
49796    int test_ret = 0;
49797
49798#if defined(LIBXML_XPATH_ENABLED)
49799    int mem_base;
49800    int ret_val;
49801    xmlXPathContextPtr ctxt; /* the XPath context */
49802    int n_ctxt;
49803    xmlChar * name; /* the variable name */
49804    int n_name;
49805    xmlChar * ns_uri; /* the variable namespace URI */
49806    int n_ns_uri;
49807    xmlXPathObjectPtr value; /* the variable value or NULL */
49808    int n_value;
49809
49810    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49811    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49812    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49813    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49814        mem_base = xmlMemBlocks();
49815        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49816        name = gen_const_xmlChar_ptr(n_name, 1);
49817        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49818        value = gen_xmlXPathObjectPtr(n_value, 3);
49819
49820        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49821        desret_int(ret_val);
49822        call_tests++;
49823        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49824        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49825        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49826        des_xmlXPathObjectPtr(n_value, value, 3);
49827        xmlResetLastError();
49828        if (mem_base != xmlMemBlocks()) {
49829            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49830	           xmlMemBlocks() - mem_base);
49831	    test_ret++;
49832            printf(" %d", n_ctxt);
49833            printf(" %d", n_name);
49834            printf(" %d", n_ns_uri);
49835            printf(" %d", n_value);
49836            printf("\n");
49837        }
49838    }
49839    }
49840    }
49841    }
49842    function_tests++;
49843#endif
49844
49845    return(test_ret);
49846}
49847
49848
49849static int
49850test_xmlXPathRegisteredFuncsCleanup(void) {
49851    int test_ret = 0;
49852
49853#if defined(LIBXML_XPATH_ENABLED)
49854    int mem_base;
49855    xmlXPathContextPtr ctxt; /* the XPath context */
49856    int n_ctxt;
49857
49858    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49859        mem_base = xmlMemBlocks();
49860        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49861
49862        xmlXPathRegisteredFuncsCleanup(ctxt);
49863        call_tests++;
49864        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49865        xmlResetLastError();
49866        if (mem_base != xmlMemBlocks()) {
49867            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49868	           xmlMemBlocks() - mem_base);
49869	    test_ret++;
49870            printf(" %d", n_ctxt);
49871            printf("\n");
49872        }
49873    }
49874    function_tests++;
49875#endif
49876
49877    return(test_ret);
49878}
49879
49880
49881static int
49882test_xmlXPathRegisteredNsCleanup(void) {
49883    int test_ret = 0;
49884
49885#if defined(LIBXML_XPATH_ENABLED)
49886    int mem_base;
49887    xmlXPathContextPtr ctxt; /* the XPath context */
49888    int n_ctxt;
49889
49890    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49891        mem_base = xmlMemBlocks();
49892        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49893
49894        xmlXPathRegisteredNsCleanup(ctxt);
49895        call_tests++;
49896        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49897        xmlResetLastError();
49898        if (mem_base != xmlMemBlocks()) {
49899            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49900	           xmlMemBlocks() - mem_base);
49901	    test_ret++;
49902            printf(" %d", n_ctxt);
49903            printf("\n");
49904        }
49905    }
49906    function_tests++;
49907#endif
49908
49909    return(test_ret);
49910}
49911
49912
49913static int
49914test_xmlXPathRegisteredVariablesCleanup(void) {
49915    int test_ret = 0;
49916
49917#if defined(LIBXML_XPATH_ENABLED)
49918    int mem_base;
49919    xmlXPathContextPtr ctxt; /* the XPath context */
49920    int n_ctxt;
49921
49922    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49923        mem_base = xmlMemBlocks();
49924        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49925
49926        xmlXPathRegisteredVariablesCleanup(ctxt);
49927        call_tests++;
49928        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49929        xmlResetLastError();
49930        if (mem_base != xmlMemBlocks()) {
49931            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49932	           xmlMemBlocks() - mem_base);
49933	    test_ret++;
49934            printf(" %d", n_ctxt);
49935            printf("\n");
49936        }
49937    }
49938    function_tests++;
49939#endif
49940
49941    return(test_ret);
49942}
49943
49944
49945static int
49946test_xmlXPathRoot(void) {
49947    int test_ret = 0;
49948
49949#if defined(LIBXML_XPATH_ENABLED)
49950    int mem_base;
49951    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49952    int n_ctxt;
49953
49954    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49955        mem_base = xmlMemBlocks();
49956        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49957
49958        xmlXPathRoot(ctxt);
49959        call_tests++;
49960        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49961        xmlResetLastError();
49962        if (mem_base != xmlMemBlocks()) {
49963            printf("Leak of %d blocks found in xmlXPathRoot",
49964	           xmlMemBlocks() - mem_base);
49965	    test_ret++;
49966            printf(" %d", n_ctxt);
49967            printf("\n");
49968        }
49969    }
49970    function_tests++;
49971#endif
49972
49973    return(test_ret);
49974}
49975
49976
49977static int
49978test_xmlXPathRoundFunction(void) {
49979    int test_ret = 0;
49980
49981#if defined(LIBXML_XPATH_ENABLED)
49982    int mem_base;
49983    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49984    int n_ctxt;
49985    int nargs; /* the number of arguments */
49986    int n_nargs;
49987
49988    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49989    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49990        mem_base = xmlMemBlocks();
49991        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49992        nargs = gen_int(n_nargs, 1);
49993
49994        xmlXPathRoundFunction(ctxt, nargs);
49995        call_tests++;
49996        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49997        des_int(n_nargs, nargs, 1);
49998        xmlResetLastError();
49999        if (mem_base != xmlMemBlocks()) {
50000            printf("Leak of %d blocks found in xmlXPathRoundFunction",
50001	           xmlMemBlocks() - mem_base);
50002	    test_ret++;
50003            printf(" %d", n_ctxt);
50004            printf(" %d", n_nargs);
50005            printf("\n");
50006        }
50007    }
50008    }
50009    function_tests++;
50010#endif
50011
50012    return(test_ret);
50013}
50014
50015
50016static int
50017test_xmlXPathStartsWithFunction(void) {
50018    int test_ret = 0;
50019
50020#if defined(LIBXML_XPATH_ENABLED)
50021    int mem_base;
50022    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50023    int n_ctxt;
50024    int nargs; /* the number of arguments */
50025    int n_nargs;
50026
50027    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50028    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50029        mem_base = xmlMemBlocks();
50030        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50031        nargs = gen_int(n_nargs, 1);
50032
50033        xmlXPathStartsWithFunction(ctxt, nargs);
50034        call_tests++;
50035        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50036        des_int(n_nargs, nargs, 1);
50037        xmlResetLastError();
50038        if (mem_base != xmlMemBlocks()) {
50039            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
50040	           xmlMemBlocks() - mem_base);
50041	    test_ret++;
50042            printf(" %d", n_ctxt);
50043            printf(" %d", n_nargs);
50044            printf("\n");
50045        }
50046    }
50047    }
50048    function_tests++;
50049#endif
50050
50051    return(test_ret);
50052}
50053
50054
50055static int
50056test_xmlXPathStringEvalNumber(void) {
50057    int test_ret = 0;
50058
50059#if defined(LIBXML_XPATH_ENABLED)
50060    int mem_base;
50061    double ret_val;
50062    xmlChar * str; /* A string to scan */
50063    int n_str;
50064
50065    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50066        mem_base = xmlMemBlocks();
50067        str = gen_const_xmlChar_ptr(n_str, 0);
50068
50069        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
50070        desret_double(ret_val);
50071        call_tests++;
50072        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50073        xmlResetLastError();
50074        if (mem_base != xmlMemBlocks()) {
50075            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
50076	           xmlMemBlocks() - mem_base);
50077	    test_ret++;
50078            printf(" %d", n_str);
50079            printf("\n");
50080        }
50081    }
50082    function_tests++;
50083#endif
50084
50085    return(test_ret);
50086}
50087
50088
50089static int
50090test_xmlXPathStringFunction(void) {
50091    int test_ret = 0;
50092
50093#if defined(LIBXML_XPATH_ENABLED)
50094    int mem_base;
50095    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50096    int n_ctxt;
50097    int nargs; /* the number of arguments */
50098    int n_nargs;
50099
50100    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50101    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50102        mem_base = xmlMemBlocks();
50103        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50104        nargs = gen_int(n_nargs, 1);
50105
50106        xmlXPathStringFunction(ctxt, nargs);
50107        call_tests++;
50108        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50109        des_int(n_nargs, nargs, 1);
50110        xmlResetLastError();
50111        if (mem_base != xmlMemBlocks()) {
50112            printf("Leak of %d blocks found in xmlXPathStringFunction",
50113	           xmlMemBlocks() - mem_base);
50114	    test_ret++;
50115            printf(" %d", n_ctxt);
50116            printf(" %d", n_nargs);
50117            printf("\n");
50118        }
50119    }
50120    }
50121    function_tests++;
50122#endif
50123
50124    return(test_ret);
50125}
50126
50127
50128static int
50129test_xmlXPathStringLengthFunction(void) {
50130    int test_ret = 0;
50131
50132#if defined(LIBXML_XPATH_ENABLED)
50133    int mem_base;
50134    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50135    int n_ctxt;
50136    int nargs; /* the number of arguments */
50137    int n_nargs;
50138
50139    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50140    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50141        mem_base = xmlMemBlocks();
50142        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50143        nargs = gen_int(n_nargs, 1);
50144
50145        xmlXPathStringLengthFunction(ctxt, nargs);
50146        call_tests++;
50147        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50148        des_int(n_nargs, nargs, 1);
50149        xmlResetLastError();
50150        if (mem_base != xmlMemBlocks()) {
50151            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
50152	           xmlMemBlocks() - mem_base);
50153	    test_ret++;
50154            printf(" %d", n_ctxt);
50155            printf(" %d", n_nargs);
50156            printf("\n");
50157        }
50158    }
50159    }
50160    function_tests++;
50161#endif
50162
50163    return(test_ret);
50164}
50165
50166
50167static int
50168test_xmlXPathSubValues(void) {
50169    int test_ret = 0;
50170
50171#if defined(LIBXML_XPATH_ENABLED)
50172    int mem_base;
50173    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50174    int n_ctxt;
50175
50176    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50177        mem_base = xmlMemBlocks();
50178        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50179
50180        xmlXPathSubValues(ctxt);
50181        call_tests++;
50182        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50183        xmlResetLastError();
50184        if (mem_base != xmlMemBlocks()) {
50185            printf("Leak of %d blocks found in xmlXPathSubValues",
50186	           xmlMemBlocks() - mem_base);
50187	    test_ret++;
50188            printf(" %d", n_ctxt);
50189            printf("\n");
50190        }
50191    }
50192    function_tests++;
50193#endif
50194
50195    return(test_ret);
50196}
50197
50198
50199static int
50200test_xmlXPathSubstringAfterFunction(void) {
50201    int test_ret = 0;
50202
50203#if defined(LIBXML_XPATH_ENABLED)
50204    int mem_base;
50205    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50206    int n_ctxt;
50207    int nargs; /* the number of arguments */
50208    int n_nargs;
50209
50210    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50211    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50212        mem_base = xmlMemBlocks();
50213        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50214        nargs = gen_int(n_nargs, 1);
50215
50216        xmlXPathSubstringAfterFunction(ctxt, nargs);
50217        call_tests++;
50218        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50219        des_int(n_nargs, nargs, 1);
50220        xmlResetLastError();
50221        if (mem_base != xmlMemBlocks()) {
50222            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50223	           xmlMemBlocks() - mem_base);
50224	    test_ret++;
50225            printf(" %d", n_ctxt);
50226            printf(" %d", n_nargs);
50227            printf("\n");
50228        }
50229    }
50230    }
50231    function_tests++;
50232#endif
50233
50234    return(test_ret);
50235}
50236
50237
50238static int
50239test_xmlXPathSubstringBeforeFunction(void) {
50240    int test_ret = 0;
50241
50242#if defined(LIBXML_XPATH_ENABLED)
50243    int mem_base;
50244    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50245    int n_ctxt;
50246    int nargs; /* the number of arguments */
50247    int n_nargs;
50248
50249    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50250    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50251        mem_base = xmlMemBlocks();
50252        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50253        nargs = gen_int(n_nargs, 1);
50254
50255        xmlXPathSubstringBeforeFunction(ctxt, nargs);
50256        call_tests++;
50257        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50258        des_int(n_nargs, nargs, 1);
50259        xmlResetLastError();
50260        if (mem_base != xmlMemBlocks()) {
50261            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50262	           xmlMemBlocks() - mem_base);
50263	    test_ret++;
50264            printf(" %d", n_ctxt);
50265            printf(" %d", n_nargs);
50266            printf("\n");
50267        }
50268    }
50269    }
50270    function_tests++;
50271#endif
50272
50273    return(test_ret);
50274}
50275
50276
50277static int
50278test_xmlXPathSubstringFunction(void) {
50279    int test_ret = 0;
50280
50281#if defined(LIBXML_XPATH_ENABLED)
50282    int mem_base;
50283    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50284    int n_ctxt;
50285    int nargs; /* the number of arguments */
50286    int n_nargs;
50287
50288    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50289    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50290        mem_base = xmlMemBlocks();
50291        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50292        nargs = gen_int(n_nargs, 1);
50293
50294        xmlXPathSubstringFunction(ctxt, nargs);
50295        call_tests++;
50296        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50297        des_int(n_nargs, nargs, 1);
50298        xmlResetLastError();
50299        if (mem_base != xmlMemBlocks()) {
50300            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50301	           xmlMemBlocks() - mem_base);
50302	    test_ret++;
50303            printf(" %d", n_ctxt);
50304            printf(" %d", n_nargs);
50305            printf("\n");
50306        }
50307    }
50308    }
50309    function_tests++;
50310#endif
50311
50312    return(test_ret);
50313}
50314
50315
50316static int
50317test_xmlXPathSumFunction(void) {
50318    int test_ret = 0;
50319
50320#if defined(LIBXML_XPATH_ENABLED)
50321    int mem_base;
50322    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50323    int n_ctxt;
50324    int nargs; /* the number of arguments */
50325    int n_nargs;
50326
50327    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50328    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50329        mem_base = xmlMemBlocks();
50330        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50331        nargs = gen_int(n_nargs, 1);
50332
50333        xmlXPathSumFunction(ctxt, nargs);
50334        call_tests++;
50335        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50336        des_int(n_nargs, nargs, 1);
50337        xmlResetLastError();
50338        if (mem_base != xmlMemBlocks()) {
50339            printf("Leak of %d blocks found in xmlXPathSumFunction",
50340	           xmlMemBlocks() - mem_base);
50341	    test_ret++;
50342            printf(" %d", n_ctxt);
50343            printf(" %d", n_nargs);
50344            printf("\n");
50345        }
50346    }
50347    }
50348    function_tests++;
50349#endif
50350
50351    return(test_ret);
50352}
50353
50354
50355static int
50356test_xmlXPathTrailing(void) {
50357    int test_ret = 0;
50358
50359#if defined(LIBXML_XPATH_ENABLED)
50360    int mem_base;
50361    xmlNodeSetPtr ret_val;
50362    xmlNodeSetPtr nodes1; /* a node-set */
50363    int n_nodes1;
50364    xmlNodeSetPtr nodes2; /* a node-set */
50365    int n_nodes2;
50366
50367    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50368    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50369        mem_base = xmlMemBlocks();
50370        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50371        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50372
50373        ret_val = xmlXPathTrailing(nodes1, nodes2);
50374        desret_xmlNodeSetPtr(ret_val);
50375        call_tests++;
50376        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50377        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50378        xmlResetLastError();
50379        if (mem_base != xmlMemBlocks()) {
50380            printf("Leak of %d blocks found in xmlXPathTrailing",
50381	           xmlMemBlocks() - mem_base);
50382	    test_ret++;
50383            printf(" %d", n_nodes1);
50384            printf(" %d", n_nodes2);
50385            printf("\n");
50386        }
50387    }
50388    }
50389    function_tests++;
50390#endif
50391
50392    return(test_ret);
50393}
50394
50395
50396static int
50397test_xmlXPathTrailingSorted(void) {
50398    int test_ret = 0;
50399
50400#if defined(LIBXML_XPATH_ENABLED)
50401    int mem_base;
50402    xmlNodeSetPtr ret_val;
50403    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50404    int n_nodes1;
50405    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50406    int n_nodes2;
50407
50408    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50409    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50410        mem_base = xmlMemBlocks();
50411        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50412        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50413
50414        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50415        desret_xmlNodeSetPtr(ret_val);
50416        call_tests++;
50417        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50418        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50419        xmlResetLastError();
50420        if (mem_base != xmlMemBlocks()) {
50421            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50422	           xmlMemBlocks() - mem_base);
50423	    test_ret++;
50424            printf(" %d", n_nodes1);
50425            printf(" %d", n_nodes2);
50426            printf("\n");
50427        }
50428    }
50429    }
50430    function_tests++;
50431#endif
50432
50433    return(test_ret);
50434}
50435
50436
50437static int
50438test_xmlXPathTranslateFunction(void) {
50439    int test_ret = 0;
50440
50441#if defined(LIBXML_XPATH_ENABLED)
50442    int mem_base;
50443    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50444    int n_ctxt;
50445    int nargs; /* the number of arguments */
50446    int n_nargs;
50447
50448    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50449    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50450        mem_base = xmlMemBlocks();
50451        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50452        nargs = gen_int(n_nargs, 1);
50453
50454        xmlXPathTranslateFunction(ctxt, nargs);
50455        call_tests++;
50456        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50457        des_int(n_nargs, nargs, 1);
50458        xmlResetLastError();
50459        if (mem_base != xmlMemBlocks()) {
50460            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50461	           xmlMemBlocks() - mem_base);
50462	    test_ret++;
50463            printf(" %d", n_ctxt);
50464            printf(" %d", n_nargs);
50465            printf("\n");
50466        }
50467    }
50468    }
50469    function_tests++;
50470#endif
50471
50472    return(test_ret);
50473}
50474
50475
50476static int
50477test_xmlXPathTrueFunction(void) {
50478    int test_ret = 0;
50479
50480#if defined(LIBXML_XPATH_ENABLED)
50481    int mem_base;
50482    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50483    int n_ctxt;
50484    int nargs; /* the number of arguments */
50485    int n_nargs;
50486
50487    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50488    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50489        mem_base = xmlMemBlocks();
50490        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50491        nargs = gen_int(n_nargs, 1);
50492
50493        xmlXPathTrueFunction(ctxt, nargs);
50494        call_tests++;
50495        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50496        des_int(n_nargs, nargs, 1);
50497        xmlResetLastError();
50498        if (mem_base != xmlMemBlocks()) {
50499            printf("Leak of %d blocks found in xmlXPathTrueFunction",
50500	           xmlMemBlocks() - mem_base);
50501	    test_ret++;
50502            printf(" %d", n_ctxt);
50503            printf(" %d", n_nargs);
50504            printf("\n");
50505        }
50506    }
50507    }
50508    function_tests++;
50509#endif
50510
50511    return(test_ret);
50512}
50513
50514
50515static int
50516test_xmlXPathValueFlipSign(void) {
50517    int test_ret = 0;
50518
50519#if defined(LIBXML_XPATH_ENABLED)
50520    int mem_base;
50521    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50522    int n_ctxt;
50523
50524    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50525        mem_base = xmlMemBlocks();
50526        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50527
50528        xmlXPathValueFlipSign(ctxt);
50529        call_tests++;
50530        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50531        xmlResetLastError();
50532        if (mem_base != xmlMemBlocks()) {
50533            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50534	           xmlMemBlocks() - mem_base);
50535	    test_ret++;
50536            printf(" %d", n_ctxt);
50537            printf("\n");
50538        }
50539    }
50540    function_tests++;
50541#endif
50542
50543    return(test_ret);
50544}
50545
50546
50547static int
50548test_xmlXPathVariableLookup(void) {
50549    int test_ret = 0;
50550
50551#if defined(LIBXML_XPATH_ENABLED)
50552    int mem_base;
50553    xmlXPathObjectPtr ret_val;
50554    xmlXPathContextPtr ctxt; /* the XPath context */
50555    int n_ctxt;
50556    xmlChar * name; /* the variable name */
50557    int n_name;
50558
50559    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50560    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50561        mem_base = xmlMemBlocks();
50562        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50563        name = gen_const_xmlChar_ptr(n_name, 1);
50564
50565        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50566        desret_xmlXPathObjectPtr(ret_val);
50567        call_tests++;
50568        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50569        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50570        xmlResetLastError();
50571        if (mem_base != xmlMemBlocks()) {
50572            printf("Leak of %d blocks found in xmlXPathVariableLookup",
50573	           xmlMemBlocks() - mem_base);
50574	    test_ret++;
50575            printf(" %d", n_ctxt);
50576            printf(" %d", n_name);
50577            printf("\n");
50578        }
50579    }
50580    }
50581    function_tests++;
50582#endif
50583
50584    return(test_ret);
50585}
50586
50587
50588static int
50589test_xmlXPathVariableLookupNS(void) {
50590    int test_ret = 0;
50591
50592#if defined(LIBXML_XPATH_ENABLED)
50593    int mem_base;
50594    xmlXPathObjectPtr ret_val;
50595    xmlXPathContextPtr ctxt; /* the XPath context */
50596    int n_ctxt;
50597    xmlChar * name; /* the variable name */
50598    int n_name;
50599    xmlChar * ns_uri; /* the variable namespace URI */
50600    int n_ns_uri;
50601
50602    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50603    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50604    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50605        mem_base = xmlMemBlocks();
50606        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50607        name = gen_const_xmlChar_ptr(n_name, 1);
50608        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50609
50610        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50611        desret_xmlXPathObjectPtr(ret_val);
50612        call_tests++;
50613        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50614        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50615        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50616        xmlResetLastError();
50617        if (mem_base != xmlMemBlocks()) {
50618            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50619	           xmlMemBlocks() - mem_base);
50620	    test_ret++;
50621            printf(" %d", n_ctxt);
50622            printf(" %d", n_name);
50623            printf(" %d", n_ns_uri);
50624            printf("\n");
50625        }
50626    }
50627    }
50628    }
50629    function_tests++;
50630#endif
50631
50632    return(test_ret);
50633}
50634
50635
50636static int
50637test_xmlXPathWrapCString(void) {
50638    int test_ret = 0;
50639
50640#if defined(LIBXML_XPATH_ENABLED)
50641    int mem_base;
50642    xmlXPathObjectPtr ret_val;
50643    char * val; /* the char * value */
50644    int n_val;
50645
50646    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50647        mem_base = xmlMemBlocks();
50648        val = gen_char_ptr(n_val, 0);
50649
50650        ret_val = xmlXPathWrapCString(val);
50651        desret_xmlXPathObjectPtr(ret_val);
50652        call_tests++;
50653        des_char_ptr(n_val, val, 0);
50654        xmlResetLastError();
50655        if (mem_base != xmlMemBlocks()) {
50656            printf("Leak of %d blocks found in xmlXPathWrapCString",
50657	           xmlMemBlocks() - mem_base);
50658	    test_ret++;
50659            printf(" %d", n_val);
50660            printf("\n");
50661        }
50662    }
50663    function_tests++;
50664#endif
50665
50666    return(test_ret);
50667}
50668
50669
50670static int
50671test_xmlXPathWrapExternal(void) {
50672    int test_ret = 0;
50673
50674#if defined(LIBXML_XPATH_ENABLED)
50675    int mem_base;
50676    xmlXPathObjectPtr ret_val;
50677    void * val; /* the user data */
50678    int n_val;
50679
50680    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50681        mem_base = xmlMemBlocks();
50682        val = gen_void_ptr(n_val, 0);
50683
50684        ret_val = xmlXPathWrapExternal(val);
50685        desret_xmlXPathObjectPtr(ret_val);
50686        call_tests++;
50687        des_void_ptr(n_val, val, 0);
50688        xmlResetLastError();
50689        if (mem_base != xmlMemBlocks()) {
50690            printf("Leak of %d blocks found in xmlXPathWrapExternal",
50691	           xmlMemBlocks() - mem_base);
50692	    test_ret++;
50693            printf(" %d", n_val);
50694            printf("\n");
50695        }
50696    }
50697    function_tests++;
50698#endif
50699
50700    return(test_ret);
50701}
50702
50703
50704static int
50705test_xmlXPathWrapNodeSet(void) {
50706    int test_ret = 0;
50707
50708#if defined(LIBXML_XPATH_ENABLED)
50709    int mem_base;
50710    xmlXPathObjectPtr ret_val;
50711    xmlNodeSetPtr val; /* the NodePtr value */
50712    int n_val;
50713
50714    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50715        mem_base = xmlMemBlocks();
50716        val = gen_xmlNodeSetPtr(n_val, 0);
50717
50718        ret_val = xmlXPathWrapNodeSet(val);
50719        desret_xmlXPathObjectPtr(ret_val);
50720        call_tests++;
50721        des_xmlNodeSetPtr(n_val, val, 0);
50722        xmlResetLastError();
50723        if (mem_base != xmlMemBlocks()) {
50724            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50725	           xmlMemBlocks() - mem_base);
50726	    test_ret++;
50727            printf(" %d", n_val);
50728            printf("\n");
50729        }
50730    }
50731    function_tests++;
50732#endif
50733
50734    return(test_ret);
50735}
50736
50737
50738static int
50739test_xmlXPatherror(void) {
50740    int test_ret = 0;
50741
50742#if defined(LIBXML_XPATH_ENABLED)
50743    int mem_base;
50744    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50745    int n_ctxt;
50746    const char * file; /* the file name */
50747    int n_file;
50748    int line; /* the line number */
50749    int n_line;
50750    int no; /* the error number */
50751    int n_no;
50752
50753    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50754    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50755    for (n_line = 0;n_line < gen_nb_int;n_line++) {
50756    for (n_no = 0;n_no < gen_nb_int;n_no++) {
50757        mem_base = xmlMemBlocks();
50758        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50759        file = gen_filepath(n_file, 1);
50760        line = gen_int(n_line, 2);
50761        no = gen_int(n_no, 3);
50762
50763        xmlXPatherror(ctxt, file, line, no);
50764        call_tests++;
50765        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50766        des_filepath(n_file, file, 1);
50767        des_int(n_line, line, 2);
50768        des_int(n_no, no, 3);
50769        xmlResetLastError();
50770        if (mem_base != xmlMemBlocks()) {
50771            printf("Leak of %d blocks found in xmlXPatherror",
50772	           xmlMemBlocks() - mem_base);
50773	    test_ret++;
50774            printf(" %d", n_ctxt);
50775            printf(" %d", n_file);
50776            printf(" %d", n_line);
50777            printf(" %d", n_no);
50778            printf("\n");
50779        }
50780    }
50781    }
50782    }
50783    }
50784    function_tests++;
50785#endif
50786
50787    return(test_ret);
50788}
50789
50790static int
50791test_xpathInternals(void) {
50792    int test_ret = 0;
50793
50794    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50795    test_ret += test_valuePop();
50796    test_ret += test_valuePush();
50797    test_ret += test_xmlXPathAddValues();
50798    test_ret += test_xmlXPathBooleanFunction();
50799    test_ret += test_xmlXPathCeilingFunction();
50800    test_ret += test_xmlXPathCompareValues();
50801    test_ret += test_xmlXPathConcatFunction();
50802    test_ret += test_xmlXPathContainsFunction();
50803    test_ret += test_xmlXPathCountFunction();
50804    test_ret += test_xmlXPathDebugDumpCompExpr();
50805    test_ret += test_xmlXPathDebugDumpObject();
50806    test_ret += test_xmlXPathDifference();
50807    test_ret += test_xmlXPathDistinct();
50808    test_ret += test_xmlXPathDistinctSorted();
50809    test_ret += test_xmlXPathDivValues();
50810    test_ret += test_xmlXPathEqualValues();
50811    test_ret += test_xmlXPathErr();
50812    test_ret += test_xmlXPathEvalExpr();
50813    test_ret += test_xmlXPathEvaluatePredicateResult();
50814    test_ret += test_xmlXPathFalseFunction();
50815    test_ret += test_xmlXPathFloorFunction();
50816    test_ret += test_xmlXPathFunctionLookup();
50817    test_ret += test_xmlXPathFunctionLookupNS();
50818    test_ret += test_xmlXPathHasSameNodes();
50819    test_ret += test_xmlXPathIdFunction();
50820    test_ret += test_xmlXPathIntersection();
50821    test_ret += test_xmlXPathIsNodeType();
50822    test_ret += test_xmlXPathLangFunction();
50823    test_ret += test_xmlXPathLastFunction();
50824    test_ret += test_xmlXPathLeading();
50825    test_ret += test_xmlXPathLeadingSorted();
50826    test_ret += test_xmlXPathLocalNameFunction();
50827    test_ret += test_xmlXPathModValues();
50828    test_ret += test_xmlXPathMultValues();
50829    test_ret += test_xmlXPathNamespaceURIFunction();
50830    test_ret += test_xmlXPathNewBoolean();
50831    test_ret += test_xmlXPathNewCString();
50832    test_ret += test_xmlXPathNewFloat();
50833    test_ret += test_xmlXPathNewNodeSet();
50834    test_ret += test_xmlXPathNewNodeSetList();
50835    test_ret += test_xmlXPathNewParserContext();
50836    test_ret += test_xmlXPathNewString();
50837    test_ret += test_xmlXPathNextAncestor();
50838    test_ret += test_xmlXPathNextAncestorOrSelf();
50839    test_ret += test_xmlXPathNextAttribute();
50840    test_ret += test_xmlXPathNextChild();
50841    test_ret += test_xmlXPathNextDescendant();
50842    test_ret += test_xmlXPathNextDescendantOrSelf();
50843    test_ret += test_xmlXPathNextFollowing();
50844    test_ret += test_xmlXPathNextFollowingSibling();
50845    test_ret += test_xmlXPathNextNamespace();
50846    test_ret += test_xmlXPathNextParent();
50847    test_ret += test_xmlXPathNextPreceding();
50848    test_ret += test_xmlXPathNextPrecedingSibling();
50849    test_ret += test_xmlXPathNextSelf();
50850    test_ret += test_xmlXPathNodeLeading();
50851    test_ret += test_xmlXPathNodeLeadingSorted();
50852    test_ret += test_xmlXPathNodeSetAdd();
50853    test_ret += test_xmlXPathNodeSetAddNs();
50854    test_ret += test_xmlXPathNodeSetAddUnique();
50855    test_ret += test_xmlXPathNodeSetContains();
50856    test_ret += test_xmlXPathNodeSetDel();
50857    test_ret += test_xmlXPathNodeSetMerge();
50858    test_ret += test_xmlXPathNodeSetRemove();
50859    test_ret += test_xmlXPathNodeSetSort();
50860    test_ret += test_xmlXPathNodeTrailing();
50861    test_ret += test_xmlXPathNodeTrailingSorted();
50862    test_ret += test_xmlXPathNormalizeFunction();
50863    test_ret += test_xmlXPathNotEqualValues();
50864    test_ret += test_xmlXPathNotFunction();
50865    test_ret += test_xmlXPathNsLookup();
50866    test_ret += test_xmlXPathNumberFunction();
50867    test_ret += test_xmlXPathParseNCName();
50868    test_ret += test_xmlXPathParseName();
50869    test_ret += test_xmlXPathPopBoolean();
50870    test_ret += test_xmlXPathPopExternal();
50871    test_ret += test_xmlXPathPopNodeSet();
50872    test_ret += test_xmlXPathPopNumber();
50873    test_ret += test_xmlXPathPopString();
50874    test_ret += test_xmlXPathPositionFunction();
50875    test_ret += test_xmlXPathRegisterAllFunctions();
50876    test_ret += test_xmlXPathRegisterFunc();
50877    test_ret += test_xmlXPathRegisterFuncLookup();
50878    test_ret += test_xmlXPathRegisterFuncNS();
50879    test_ret += test_xmlXPathRegisterNs();
50880    test_ret += test_xmlXPathRegisterVariable();
50881    test_ret += test_xmlXPathRegisterVariableLookup();
50882    test_ret += test_xmlXPathRegisterVariableNS();
50883    test_ret += test_xmlXPathRegisteredFuncsCleanup();
50884    test_ret += test_xmlXPathRegisteredNsCleanup();
50885    test_ret += test_xmlXPathRegisteredVariablesCleanup();
50886    test_ret += test_xmlXPathRoot();
50887    test_ret += test_xmlXPathRoundFunction();
50888    test_ret += test_xmlXPathStartsWithFunction();
50889    test_ret += test_xmlXPathStringEvalNumber();
50890    test_ret += test_xmlXPathStringFunction();
50891    test_ret += test_xmlXPathStringLengthFunction();
50892    test_ret += test_xmlXPathSubValues();
50893    test_ret += test_xmlXPathSubstringAfterFunction();
50894    test_ret += test_xmlXPathSubstringBeforeFunction();
50895    test_ret += test_xmlXPathSubstringFunction();
50896    test_ret += test_xmlXPathSumFunction();
50897    test_ret += test_xmlXPathTrailing();
50898    test_ret += test_xmlXPathTrailingSorted();
50899    test_ret += test_xmlXPathTranslateFunction();
50900    test_ret += test_xmlXPathTrueFunction();
50901    test_ret += test_xmlXPathValueFlipSign();
50902    test_ret += test_xmlXPathVariableLookup();
50903    test_ret += test_xmlXPathVariableLookupNS();
50904    test_ret += test_xmlXPathWrapCString();
50905    test_ret += test_xmlXPathWrapExternal();
50906    test_ret += test_xmlXPathWrapNodeSet();
50907    test_ret += test_xmlXPatherror();
50908
50909    if (test_ret != 0)
50910	printf("Module xpathInternals: %d errors\n", test_ret);
50911    return(test_ret);
50912}
50913
50914static int
50915test_xmlXPtrBuildNodeList(void) {
50916    int test_ret = 0;
50917
50918#if defined(LIBXML_XPTR_ENABLED)
50919    int mem_base;
50920    xmlNodePtr ret_val;
50921    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50922    int n_obj;
50923
50924    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50925        mem_base = xmlMemBlocks();
50926        obj = gen_xmlXPathObjectPtr(n_obj, 0);
50927
50928        ret_val = xmlXPtrBuildNodeList(obj);
50929        desret_xmlNodePtr(ret_val);
50930        call_tests++;
50931        des_xmlXPathObjectPtr(n_obj, obj, 0);
50932        xmlResetLastError();
50933        if (mem_base != xmlMemBlocks()) {
50934            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50935	           xmlMemBlocks() - mem_base);
50936	    test_ret++;
50937            printf(" %d", n_obj);
50938            printf("\n");
50939        }
50940    }
50941    function_tests++;
50942#endif
50943
50944    return(test_ret);
50945}
50946
50947
50948static int
50949test_xmlXPtrEval(void) {
50950    int test_ret = 0;
50951
50952#if defined(LIBXML_XPTR_ENABLED)
50953    int mem_base;
50954    xmlXPathObjectPtr ret_val;
50955    xmlChar * str; /* the XPointer expression */
50956    int n_str;
50957    xmlXPathContextPtr ctx; /* the XPointer context */
50958    int n_ctx;
50959
50960    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50961    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50962        mem_base = xmlMemBlocks();
50963        str = gen_const_xmlChar_ptr(n_str, 0);
50964        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50965
50966        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50967        desret_xmlXPathObjectPtr(ret_val);
50968        call_tests++;
50969        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50970        des_xmlXPathContextPtr(n_ctx, ctx, 1);
50971        xmlResetLastError();
50972        if (mem_base != xmlMemBlocks()) {
50973            printf("Leak of %d blocks found in xmlXPtrEval",
50974	           xmlMemBlocks() - mem_base);
50975	    test_ret++;
50976            printf(" %d", n_str);
50977            printf(" %d", n_ctx);
50978            printf("\n");
50979        }
50980    }
50981    }
50982    function_tests++;
50983#endif
50984
50985    return(test_ret);
50986}
50987
50988
50989static int
50990test_xmlXPtrEvalRangePredicate(void) {
50991    int test_ret = 0;
50992
50993#if defined(LIBXML_XPTR_ENABLED)
50994    int mem_base;
50995    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50996    int n_ctxt;
50997
50998    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50999        mem_base = xmlMemBlocks();
51000        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51001
51002        xmlXPtrEvalRangePredicate(ctxt);
51003        call_tests++;
51004        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51005        xmlResetLastError();
51006        if (mem_base != xmlMemBlocks()) {
51007            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
51008	           xmlMemBlocks() - mem_base);
51009	    test_ret++;
51010            printf(" %d", n_ctxt);
51011            printf("\n");
51012        }
51013    }
51014    function_tests++;
51015#endif
51016
51017    return(test_ret);
51018}
51019
51020#ifdef LIBXML_XPTR_ENABLED
51021
51022#define gen_nb_xmlLocationSetPtr 1
51023static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51024    return(NULL);
51025}
51026static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
51027}
51028#endif
51029
51030
51031static int
51032test_xmlXPtrLocationSetAdd(void) {
51033    int test_ret = 0;
51034
51035#if defined(LIBXML_XPTR_ENABLED)
51036    int mem_base;
51037    xmlLocationSetPtr cur; /* the initial range set */
51038    int n_cur;
51039    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
51040    int n_val;
51041
51042    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51043    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51044        mem_base = xmlMemBlocks();
51045        cur = gen_xmlLocationSetPtr(n_cur, 0);
51046        val = gen_xmlXPathObjectPtr(n_val, 1);
51047
51048        xmlXPtrLocationSetAdd(cur, val);
51049        call_tests++;
51050        des_xmlLocationSetPtr(n_cur, cur, 0);
51051        des_xmlXPathObjectPtr(n_val, val, 1);
51052        xmlResetLastError();
51053        if (mem_base != xmlMemBlocks()) {
51054            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
51055	           xmlMemBlocks() - mem_base);
51056	    test_ret++;
51057            printf(" %d", n_cur);
51058            printf(" %d", n_val);
51059            printf("\n");
51060        }
51061    }
51062    }
51063    function_tests++;
51064#endif
51065
51066    return(test_ret);
51067}
51068
51069
51070static int
51071test_xmlXPtrLocationSetCreate(void) {
51072    int test_ret = 0;
51073
51074
51075    /* missing type support */
51076    return(test_ret);
51077}
51078
51079
51080static int
51081test_xmlXPtrLocationSetDel(void) {
51082    int test_ret = 0;
51083
51084#if defined(LIBXML_XPTR_ENABLED)
51085    int mem_base;
51086    xmlLocationSetPtr cur; /* the initial range set */
51087    int n_cur;
51088    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
51089    int n_val;
51090
51091    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51092    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
51093        mem_base = xmlMemBlocks();
51094        cur = gen_xmlLocationSetPtr(n_cur, 0);
51095        val = gen_xmlXPathObjectPtr(n_val, 1);
51096
51097        xmlXPtrLocationSetDel(cur, val);
51098        call_tests++;
51099        des_xmlLocationSetPtr(n_cur, cur, 0);
51100        des_xmlXPathObjectPtr(n_val, val, 1);
51101        xmlResetLastError();
51102        if (mem_base != xmlMemBlocks()) {
51103            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
51104	           xmlMemBlocks() - mem_base);
51105	    test_ret++;
51106            printf(" %d", n_cur);
51107            printf(" %d", n_val);
51108            printf("\n");
51109        }
51110    }
51111    }
51112    function_tests++;
51113#endif
51114
51115    return(test_ret);
51116}
51117
51118
51119static int
51120test_xmlXPtrLocationSetMerge(void) {
51121    int test_ret = 0;
51122
51123
51124    /* missing type support */
51125    return(test_ret);
51126}
51127
51128
51129static int
51130test_xmlXPtrLocationSetRemove(void) {
51131    int test_ret = 0;
51132
51133#if defined(LIBXML_XPTR_ENABLED)
51134    int mem_base;
51135    xmlLocationSetPtr cur; /* the initial range set */
51136    int n_cur;
51137    int val; /* the index to remove */
51138    int n_val;
51139
51140    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
51141    for (n_val = 0;n_val < gen_nb_int;n_val++) {
51142        mem_base = xmlMemBlocks();
51143        cur = gen_xmlLocationSetPtr(n_cur, 0);
51144        val = gen_int(n_val, 1);
51145
51146        xmlXPtrLocationSetRemove(cur, val);
51147        call_tests++;
51148        des_xmlLocationSetPtr(n_cur, cur, 0);
51149        des_int(n_val, val, 1);
51150        xmlResetLastError();
51151        if (mem_base != xmlMemBlocks()) {
51152            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
51153	           xmlMemBlocks() - mem_base);
51154	    test_ret++;
51155            printf(" %d", n_cur);
51156            printf(" %d", n_val);
51157            printf("\n");
51158        }
51159    }
51160    }
51161    function_tests++;
51162#endif
51163
51164    return(test_ret);
51165}
51166
51167
51168static int
51169test_xmlXPtrNewCollapsedRange(void) {
51170    int test_ret = 0;
51171
51172#if defined(LIBXML_XPTR_ENABLED)
51173    int mem_base;
51174    xmlXPathObjectPtr ret_val;
51175    xmlNodePtr start; /* the starting and ending node */
51176    int n_start;
51177
51178    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51179        mem_base = xmlMemBlocks();
51180        start = gen_xmlNodePtr(n_start, 0);
51181
51182        ret_val = xmlXPtrNewCollapsedRange(start);
51183        desret_xmlXPathObjectPtr(ret_val);
51184        call_tests++;
51185        des_xmlNodePtr(n_start, start, 0);
51186        xmlResetLastError();
51187        if (mem_base != xmlMemBlocks()) {
51188            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
51189	           xmlMemBlocks() - mem_base);
51190	    test_ret++;
51191            printf(" %d", n_start);
51192            printf("\n");
51193        }
51194    }
51195    function_tests++;
51196#endif
51197
51198    return(test_ret);
51199}
51200
51201
51202static int
51203test_xmlXPtrNewContext(void) {
51204    int test_ret = 0;
51205
51206
51207    /* missing type support */
51208    return(test_ret);
51209}
51210
51211
51212static int
51213test_xmlXPtrNewLocationSetNodeSet(void) {
51214    int test_ret = 0;
51215
51216#if defined(LIBXML_XPTR_ENABLED)
51217    int mem_base;
51218    xmlXPathObjectPtr ret_val;
51219    xmlNodeSetPtr set; /* a node set */
51220    int n_set;
51221
51222    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51223        mem_base = xmlMemBlocks();
51224        set = gen_xmlNodeSetPtr(n_set, 0);
51225
51226        ret_val = xmlXPtrNewLocationSetNodeSet(set);
51227        desret_xmlXPathObjectPtr(ret_val);
51228        call_tests++;
51229        des_xmlNodeSetPtr(n_set, set, 0);
51230        xmlResetLastError();
51231        if (mem_base != xmlMemBlocks()) {
51232            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51233	           xmlMemBlocks() - mem_base);
51234	    test_ret++;
51235            printf(" %d", n_set);
51236            printf("\n");
51237        }
51238    }
51239    function_tests++;
51240#endif
51241
51242    return(test_ret);
51243}
51244
51245
51246static int
51247test_xmlXPtrNewLocationSetNodes(void) {
51248    int test_ret = 0;
51249
51250#if defined(LIBXML_XPTR_ENABLED)
51251    int mem_base;
51252    xmlXPathObjectPtr ret_val;
51253    xmlNodePtr start; /* the start NodePtr value */
51254    int n_start;
51255    xmlNodePtr end; /* the end NodePtr value or NULL */
51256    int n_end;
51257
51258    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51259    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51260        mem_base = xmlMemBlocks();
51261        start = gen_xmlNodePtr(n_start, 0);
51262        end = gen_xmlNodePtr(n_end, 1);
51263
51264        ret_val = xmlXPtrNewLocationSetNodes(start, end);
51265        desret_xmlXPathObjectPtr(ret_val);
51266        call_tests++;
51267        des_xmlNodePtr(n_start, start, 0);
51268        des_xmlNodePtr(n_end, end, 1);
51269        xmlResetLastError();
51270        if (mem_base != xmlMemBlocks()) {
51271            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51272	           xmlMemBlocks() - mem_base);
51273	    test_ret++;
51274            printf(" %d", n_start);
51275            printf(" %d", n_end);
51276            printf("\n");
51277        }
51278    }
51279    }
51280    function_tests++;
51281#endif
51282
51283    return(test_ret);
51284}
51285
51286
51287static int
51288test_xmlXPtrNewRange(void) {
51289    int test_ret = 0;
51290
51291#if defined(LIBXML_XPTR_ENABLED)
51292    int mem_base;
51293    xmlXPathObjectPtr ret_val;
51294    xmlNodePtr start; /* the starting node */
51295    int n_start;
51296    int startindex; /* the start index */
51297    int n_startindex;
51298    xmlNodePtr end; /* the ending point */
51299    int n_end;
51300    int endindex; /* the ending index */
51301    int n_endindex;
51302
51303    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51304    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51305    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51306    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51307        mem_base = xmlMemBlocks();
51308        start = gen_xmlNodePtr(n_start, 0);
51309        startindex = gen_int(n_startindex, 1);
51310        end = gen_xmlNodePtr(n_end, 2);
51311        endindex = gen_int(n_endindex, 3);
51312
51313        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51314        desret_xmlXPathObjectPtr(ret_val);
51315        call_tests++;
51316        des_xmlNodePtr(n_start, start, 0);
51317        des_int(n_startindex, startindex, 1);
51318        des_xmlNodePtr(n_end, end, 2);
51319        des_int(n_endindex, endindex, 3);
51320        xmlResetLastError();
51321        if (mem_base != xmlMemBlocks()) {
51322            printf("Leak of %d blocks found in xmlXPtrNewRange",
51323	           xmlMemBlocks() - mem_base);
51324	    test_ret++;
51325            printf(" %d", n_start);
51326            printf(" %d", n_startindex);
51327            printf(" %d", n_end);
51328            printf(" %d", n_endindex);
51329            printf("\n");
51330        }
51331    }
51332    }
51333    }
51334    }
51335    function_tests++;
51336#endif
51337
51338    return(test_ret);
51339}
51340
51341
51342static int
51343test_xmlXPtrNewRangeNodeObject(void) {
51344    int test_ret = 0;
51345
51346#if defined(LIBXML_XPTR_ENABLED)
51347    int mem_base;
51348    xmlXPathObjectPtr ret_val;
51349    xmlNodePtr start; /* the starting node */
51350    int n_start;
51351    xmlXPathObjectPtr end; /* the ending object */
51352    int n_end;
51353
51354    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51355    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51356        mem_base = xmlMemBlocks();
51357        start = gen_xmlNodePtr(n_start, 0);
51358        end = gen_xmlXPathObjectPtr(n_end, 1);
51359
51360        ret_val = xmlXPtrNewRangeNodeObject(start, end);
51361        desret_xmlXPathObjectPtr(ret_val);
51362        call_tests++;
51363        des_xmlNodePtr(n_start, start, 0);
51364        des_xmlXPathObjectPtr(n_end, end, 1);
51365        xmlResetLastError();
51366        if (mem_base != xmlMemBlocks()) {
51367            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51368	           xmlMemBlocks() - mem_base);
51369	    test_ret++;
51370            printf(" %d", n_start);
51371            printf(" %d", n_end);
51372            printf("\n");
51373        }
51374    }
51375    }
51376    function_tests++;
51377#endif
51378
51379    return(test_ret);
51380}
51381
51382
51383static int
51384test_xmlXPtrNewRangeNodePoint(void) {
51385    int test_ret = 0;
51386
51387#if defined(LIBXML_XPTR_ENABLED)
51388    int mem_base;
51389    xmlXPathObjectPtr ret_val;
51390    xmlNodePtr start; /* the starting node */
51391    int n_start;
51392    xmlXPathObjectPtr end; /* the ending point */
51393    int n_end;
51394
51395    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51396    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51397        mem_base = xmlMemBlocks();
51398        start = gen_xmlNodePtr(n_start, 0);
51399        end = gen_xmlXPathObjectPtr(n_end, 1);
51400
51401        ret_val = xmlXPtrNewRangeNodePoint(start, end);
51402        desret_xmlXPathObjectPtr(ret_val);
51403        call_tests++;
51404        des_xmlNodePtr(n_start, start, 0);
51405        des_xmlXPathObjectPtr(n_end, end, 1);
51406        xmlResetLastError();
51407        if (mem_base != xmlMemBlocks()) {
51408            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51409	           xmlMemBlocks() - mem_base);
51410	    test_ret++;
51411            printf(" %d", n_start);
51412            printf(" %d", n_end);
51413            printf("\n");
51414        }
51415    }
51416    }
51417    function_tests++;
51418#endif
51419
51420    return(test_ret);
51421}
51422
51423
51424static int
51425test_xmlXPtrNewRangeNodes(void) {
51426    int test_ret = 0;
51427
51428#if defined(LIBXML_XPTR_ENABLED)
51429    int mem_base;
51430    xmlXPathObjectPtr ret_val;
51431    xmlNodePtr start; /* the starting node */
51432    int n_start;
51433    xmlNodePtr end; /* the ending node */
51434    int n_end;
51435
51436    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51437    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51438        mem_base = xmlMemBlocks();
51439        start = gen_xmlNodePtr(n_start, 0);
51440        end = gen_xmlNodePtr(n_end, 1);
51441
51442        ret_val = xmlXPtrNewRangeNodes(start, end);
51443        desret_xmlXPathObjectPtr(ret_val);
51444        call_tests++;
51445        des_xmlNodePtr(n_start, start, 0);
51446        des_xmlNodePtr(n_end, end, 1);
51447        xmlResetLastError();
51448        if (mem_base != xmlMemBlocks()) {
51449            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51450	           xmlMemBlocks() - mem_base);
51451	    test_ret++;
51452            printf(" %d", n_start);
51453            printf(" %d", n_end);
51454            printf("\n");
51455        }
51456    }
51457    }
51458    function_tests++;
51459#endif
51460
51461    return(test_ret);
51462}
51463
51464
51465static int
51466test_xmlXPtrNewRangePointNode(void) {
51467    int test_ret = 0;
51468
51469#if defined(LIBXML_XPTR_ENABLED)
51470    int mem_base;
51471    xmlXPathObjectPtr ret_val;
51472    xmlXPathObjectPtr start; /* the starting point */
51473    int n_start;
51474    xmlNodePtr end; /* the ending node */
51475    int n_end;
51476
51477    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51478    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51479        mem_base = xmlMemBlocks();
51480        start = gen_xmlXPathObjectPtr(n_start, 0);
51481        end = gen_xmlNodePtr(n_end, 1);
51482
51483        ret_val = xmlXPtrNewRangePointNode(start, end);
51484        desret_xmlXPathObjectPtr(ret_val);
51485        call_tests++;
51486        des_xmlXPathObjectPtr(n_start, start, 0);
51487        des_xmlNodePtr(n_end, end, 1);
51488        xmlResetLastError();
51489        if (mem_base != xmlMemBlocks()) {
51490            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51491	           xmlMemBlocks() - mem_base);
51492	    test_ret++;
51493            printf(" %d", n_start);
51494            printf(" %d", n_end);
51495            printf("\n");
51496        }
51497    }
51498    }
51499    function_tests++;
51500#endif
51501
51502    return(test_ret);
51503}
51504
51505
51506static int
51507test_xmlXPtrNewRangePoints(void) {
51508    int test_ret = 0;
51509
51510#if defined(LIBXML_XPTR_ENABLED)
51511    int mem_base;
51512    xmlXPathObjectPtr ret_val;
51513    xmlXPathObjectPtr start; /* the starting point */
51514    int n_start;
51515    xmlXPathObjectPtr end; /* the ending point */
51516    int n_end;
51517
51518    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51519    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51520        mem_base = xmlMemBlocks();
51521        start = gen_xmlXPathObjectPtr(n_start, 0);
51522        end = gen_xmlXPathObjectPtr(n_end, 1);
51523
51524        ret_val = xmlXPtrNewRangePoints(start, end);
51525        desret_xmlXPathObjectPtr(ret_val);
51526        call_tests++;
51527        des_xmlXPathObjectPtr(n_start, start, 0);
51528        des_xmlXPathObjectPtr(n_end, end, 1);
51529        xmlResetLastError();
51530        if (mem_base != xmlMemBlocks()) {
51531            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51532	           xmlMemBlocks() - mem_base);
51533	    test_ret++;
51534            printf(" %d", n_start);
51535            printf(" %d", n_end);
51536            printf("\n");
51537        }
51538    }
51539    }
51540    function_tests++;
51541#endif
51542
51543    return(test_ret);
51544}
51545
51546
51547static int
51548test_xmlXPtrRangeToFunction(void) {
51549    int test_ret = 0;
51550
51551#if defined(LIBXML_XPTR_ENABLED)
51552    int mem_base;
51553    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51554    int n_ctxt;
51555    int nargs; /* the number of args */
51556    int n_nargs;
51557
51558    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51559    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51560        mem_base = xmlMemBlocks();
51561        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51562        nargs = gen_int(n_nargs, 1);
51563
51564        xmlXPtrRangeToFunction(ctxt, nargs);
51565        call_tests++;
51566        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51567        des_int(n_nargs, nargs, 1);
51568        xmlResetLastError();
51569        if (mem_base != xmlMemBlocks()) {
51570            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51571	           xmlMemBlocks() - mem_base);
51572	    test_ret++;
51573            printf(" %d", n_ctxt);
51574            printf(" %d", n_nargs);
51575            printf("\n");
51576        }
51577    }
51578    }
51579    function_tests++;
51580#endif
51581
51582    return(test_ret);
51583}
51584
51585
51586static int
51587test_xmlXPtrWrapLocationSet(void) {
51588    int test_ret = 0;
51589
51590#if defined(LIBXML_XPTR_ENABLED)
51591    int mem_base;
51592    xmlXPathObjectPtr ret_val;
51593    xmlLocationSetPtr val; /* the LocationSet value */
51594    int n_val;
51595
51596    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51597        mem_base = xmlMemBlocks();
51598        val = gen_xmlLocationSetPtr(n_val, 0);
51599
51600        ret_val = xmlXPtrWrapLocationSet(val);
51601        desret_xmlXPathObjectPtr(ret_val);
51602        call_tests++;
51603        des_xmlLocationSetPtr(n_val, val, 0);
51604        xmlResetLastError();
51605        if (mem_base != xmlMemBlocks()) {
51606            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51607	           xmlMemBlocks() - mem_base);
51608	    test_ret++;
51609            printf(" %d", n_val);
51610            printf("\n");
51611        }
51612    }
51613    function_tests++;
51614#endif
51615
51616    return(test_ret);
51617}
51618
51619static int
51620test_xpointer(void) {
51621    int test_ret = 0;
51622
51623    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51624    test_ret += test_xmlXPtrBuildNodeList();
51625    test_ret += test_xmlXPtrEval();
51626    test_ret += test_xmlXPtrEvalRangePredicate();
51627    test_ret += test_xmlXPtrLocationSetAdd();
51628    test_ret += test_xmlXPtrLocationSetCreate();
51629    test_ret += test_xmlXPtrLocationSetDel();
51630    test_ret += test_xmlXPtrLocationSetMerge();
51631    test_ret += test_xmlXPtrLocationSetRemove();
51632    test_ret += test_xmlXPtrNewCollapsedRange();
51633    test_ret += test_xmlXPtrNewContext();
51634    test_ret += test_xmlXPtrNewLocationSetNodeSet();
51635    test_ret += test_xmlXPtrNewLocationSetNodes();
51636    test_ret += test_xmlXPtrNewRange();
51637    test_ret += test_xmlXPtrNewRangeNodeObject();
51638    test_ret += test_xmlXPtrNewRangeNodePoint();
51639    test_ret += test_xmlXPtrNewRangeNodes();
51640    test_ret += test_xmlXPtrNewRangePointNode();
51641    test_ret += test_xmlXPtrNewRangePoints();
51642    test_ret += test_xmlXPtrRangeToFunction();
51643    test_ret += test_xmlXPtrWrapLocationSet();
51644
51645    if (test_ret != 0)
51646	printf("Module xpointer: %d errors\n", test_ret);
51647    return(test_ret);
51648}
51649static int
51650test_module(const char *module) {
51651    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51652    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51653    if (!strcmp(module, "SAX2")) return(test_SAX2());
51654    if (!strcmp(module, "c14n")) return(test_c14n());
51655    if (!strcmp(module, "catalog")) return(test_catalog());
51656    if (!strcmp(module, "chvalid")) return(test_chvalid());
51657    if (!strcmp(module, "debugXML")) return(test_debugXML());
51658    if (!strcmp(module, "dict")) return(test_dict());
51659    if (!strcmp(module, "encoding")) return(test_encoding());
51660    if (!strcmp(module, "entities")) return(test_entities());
51661    if (!strcmp(module, "hash")) return(test_hash());
51662    if (!strcmp(module, "list")) return(test_list());
51663    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51664    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51665    if (!strcmp(module, "parser")) return(test_parser());
51666    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51667    if (!strcmp(module, "pattern")) return(test_pattern());
51668    if (!strcmp(module, "relaxng")) return(test_relaxng());
51669    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51670    if (!strcmp(module, "schematron")) return(test_schematron());
51671    if (!strcmp(module, "tree")) return(test_tree());
51672    if (!strcmp(module, "uri")) return(test_uri());
51673    if (!strcmp(module, "valid")) return(test_valid());
51674    if (!strcmp(module, "xinclude")) return(test_xinclude());
51675    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51676    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51677    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51678    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51679    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51680    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51681    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51682    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51683    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51684    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51685    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51686    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51687    if (!strcmp(module, "xpath")) return(test_xpath());
51688    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51689    if (!strcmp(module, "xpointer")) return(test_xpointer());
51690    return(0);
51691}
51692