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/************************************************************************
995 *									*
996 *   WARNING: end of the manually maintained part of the test code	*
997 *            do not remove or alter the CUT HERE line			*
998 *									*
999 ************************************************************************/
1000
1001/* CUT HERE: everything below that line is generated */
1002#ifdef LIBXML_HTML_ENABLED
1003static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) {
1004}
1005
1006#endif
1007
1008#define gen_nb_xmlAttributeDefault 4
1009static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) {
1010    if (no == 1) return(XML_ATTRIBUTE_FIXED);
1011    if (no == 2) return(XML_ATTRIBUTE_IMPLIED);
1012    if (no == 3) return(XML_ATTRIBUTE_NONE);
1013    if (no == 4) return(XML_ATTRIBUTE_REQUIRED);
1014    return(0);
1015}
1016
1017static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1018}
1019
1020#define gen_nb_xmlAttributeType 4
1021static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
1022    if (no == 1) return(XML_ATTRIBUTE_CDATA);
1023    if (no == 2) return(XML_ATTRIBUTE_ENTITIES);
1024    if (no == 3) return(XML_ATTRIBUTE_ENTITY);
1025    if (no == 4) return(XML_ATTRIBUTE_ENUMERATION);
1026    return(0);
1027}
1028
1029static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1030}
1031
1032#define gen_nb_xmlBufferAllocationScheme 4
1033static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
1034    if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
1035    if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
1036    if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
1037    if (no == 4) return(XML_BUFFER_ALLOC_IO);
1038    return(0);
1039}
1040
1041static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1042}
1043
1044static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) {
1045}
1046
1047#ifdef LIBXML_CATALOG_ENABLED
1048#define gen_nb_xmlCatalogAllow 4
1049static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) {
1050    if (no == 1) return(XML_CATA_ALLOW_ALL);
1051    if (no == 2) return(XML_CATA_ALLOW_DOCUMENT);
1052    if (no == 3) return(XML_CATA_ALLOW_GLOBAL);
1053    if (no == 4) return(XML_CATA_ALLOW_NONE);
1054    return(0);
1055}
1056
1057static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1058}
1059
1060static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) {
1061}
1062
1063#endif
1064
1065#ifdef LIBXML_CATALOG_ENABLED
1066#define gen_nb_xmlCatalogPrefer 3
1067static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) {
1068    if (no == 1) return(XML_CATA_PREFER_NONE);
1069    if (no == 2) return(XML_CATA_PREFER_PUBLIC);
1070    if (no == 3) return(XML_CATA_PREFER_SYSTEM);
1071    return(0);
1072}
1073
1074static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1075}
1076
1077static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) {
1078}
1079
1080#endif
1081
1082#define gen_nb_xmlElementContentType 4
1083static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) {
1084    if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT);
1085    if (no == 2) return(XML_ELEMENT_CONTENT_OR);
1086    if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA);
1087    if (no == 4) return(XML_ELEMENT_CONTENT_SEQ);
1088    return(0);
1089}
1090
1091static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1092}
1093
1094#define gen_nb_xmlElementTypeVal 4
1095static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) {
1096    if (no == 1) return(XML_ELEMENT_TYPE_ANY);
1097    if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT);
1098    if (no == 3) return(XML_ELEMENT_TYPE_EMPTY);
1099    if (no == 4) return(XML_ELEMENT_TYPE_MIXED);
1100    return(0);
1101}
1102
1103static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1104}
1105
1106#define gen_nb_xmlFeature 4
1107static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) {
1108    if (no == 1) return(XML_WITH_AUTOMATA);
1109    if (no == 2) return(XML_WITH_C14N);
1110    if (no == 3) return(XML_WITH_CATALOG);
1111    if (no == 4) return(XML_WITH_DEBUG);
1112    return(0);
1113}
1114
1115static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1116}
1117
1118static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) {
1119}
1120
1121#ifdef LIBXML_SCHEMAS_ENABLED
1122#define gen_nb_xmlSchemaValType 4
1123static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) {
1124    if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE);
1125    if (no == 2) return(XML_SCHEMAS_ANYTYPE);
1126    if (no == 3) return(XML_SCHEMAS_ANYURI);
1127    if (no == 4) return(XML_SCHEMAS_BASE64BINARY);
1128    return(0);
1129}
1130
1131static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1132}
1133
1134static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) {
1135}
1136
1137#endif
1138
1139#ifdef LIBXML_SCHEMAS_ENABLED
1140#define gen_nb_xmlSchemaWhitespaceValueType 4
1141static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) {
1142    if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE);
1143    if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE);
1144    if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE);
1145    if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN);
1146    return(0);
1147}
1148
1149static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1150}
1151
1152#endif
1153
1154#include <libxml/HTMLparser.h>
1155#include <libxml/HTMLtree.h>
1156#include <libxml/SAX2.h>
1157#include <libxml/c14n.h>
1158#include <libxml/catalog.h>
1159#include <libxml/chvalid.h>
1160#include <libxml/debugXML.h>
1161#include <libxml/dict.h>
1162#include <libxml/encoding.h>
1163#include <libxml/entities.h>
1164#include <libxml/hash.h>
1165#include <libxml/list.h>
1166#include <libxml/nanoftp.h>
1167#include <libxml/nanohttp.h>
1168#include <libxml/parser.h>
1169#include <libxml/parserInternals.h>
1170#include <libxml/pattern.h>
1171#include <libxml/relaxng.h>
1172#include <libxml/schemasInternals.h>
1173#include <libxml/schematron.h>
1174#include <libxml/tree.h>
1175#include <libxml/uri.h>
1176#include <libxml/valid.h>
1177#include <libxml/xinclude.h>
1178#include <libxml/xmlIO.h>
1179#include <libxml/xmlautomata.h>
1180#include <libxml/xmlerror.h>
1181#include <libxml/xmlmodule.h>
1182#include <libxml/xmlreader.h>
1183#include <libxml/xmlregexp.h>
1184#include <libxml/xmlsave.h>
1185#include <libxml/xmlschemas.h>
1186#include <libxml/xmlschemastypes.h>
1187#include <libxml/xmlstring.h>
1188#include <libxml/xmlunicode.h>
1189#include <libxml/xmlwriter.h>
1190#include <libxml/xpath.h>
1191#include <libxml/xpathInternals.h>
1192#include <libxml/xpointer.h>
1193static int test_HTMLparser(void);
1194static int test_HTMLtree(void);
1195static int test_SAX2(void);
1196static int test_c14n(void);
1197static int test_catalog(void);
1198static int test_chvalid(void);
1199static int test_debugXML(void);
1200static int test_dict(void);
1201static int test_encoding(void);
1202static int test_entities(void);
1203static int test_hash(void);
1204static int test_list(void);
1205static int test_nanoftp(void);
1206static int test_nanohttp(void);
1207static int test_parser(void);
1208static int test_parserInternals(void);
1209static int test_pattern(void);
1210static int test_relaxng(void);
1211static int test_schemasInternals(void);
1212static int test_schematron(void);
1213static int test_tree(void);
1214static int test_uri(void);
1215static int test_valid(void);
1216static int test_xinclude(void);
1217static int test_xmlIO(void);
1218static int test_xmlautomata(void);
1219static int test_xmlerror(void);
1220static int test_xmlmodule(void);
1221static int test_xmlreader(void);
1222static int test_xmlregexp(void);
1223static int test_xmlsave(void);
1224static int test_xmlschemas(void);
1225static int test_xmlschemastypes(void);
1226static int test_xmlstring(void);
1227static int test_xmlunicode(void);
1228static int test_xmlwriter(void);
1229static int test_xpath(void);
1230static int test_xpathInternals(void);
1231static int test_xpointer(void);
1232
1233/**
1234 * testlibxml2:
1235 *
1236 * Main entry point of the tester for the full libxml2 module,
1237 * it calls all the tester entry point for each module.
1238 *
1239 * Returns the number of error found
1240 */
1241static int
1242testlibxml2(void)
1243{
1244    int test_ret = 0;
1245
1246    test_ret += test_HTMLparser();
1247    test_ret += test_HTMLtree();
1248    test_ret += test_SAX2();
1249    test_ret += test_c14n();
1250    test_ret += test_catalog();
1251    test_ret += test_chvalid();
1252    test_ret += test_debugXML();
1253    test_ret += test_dict();
1254    test_ret += test_encoding();
1255    test_ret += test_entities();
1256    test_ret += test_hash();
1257    test_ret += test_list();
1258    test_ret += test_nanoftp();
1259    test_ret += test_nanohttp();
1260    test_ret += test_parser();
1261    test_ret += test_parserInternals();
1262    test_ret += test_pattern();
1263    test_ret += test_relaxng();
1264    test_ret += test_schemasInternals();
1265    test_ret += test_schematron();
1266    test_ret += test_tree();
1267    test_ret += test_uri();
1268    test_ret += test_valid();
1269    test_ret += test_xinclude();
1270    test_ret += test_xmlIO();
1271    test_ret += test_xmlautomata();
1272    test_ret += test_xmlerror();
1273    test_ret += test_xmlmodule();
1274    test_ret += test_xmlreader();
1275    test_ret += test_xmlregexp();
1276    test_ret += test_xmlsave();
1277    test_ret += test_xmlschemas();
1278    test_ret += test_xmlschemastypes();
1279    test_ret += test_xmlstring();
1280    test_ret += test_xmlunicode();
1281    test_ret += test_xmlwriter();
1282    test_ret += test_xpath();
1283    test_ret += test_xpathInternals();
1284    test_ret += test_xpointer();
1285
1286    printf("Total: %d functions, %d tests, %d errors\n",
1287           function_tests, call_tests, test_ret);
1288    return(test_ret);
1289}
1290
1291
1292static int
1293test_UTF8ToHtml(void) {
1294    int test_ret = 0;
1295
1296#if defined(LIBXML_HTML_ENABLED)
1297    int mem_base;
1298    int ret_val;
1299    unsigned char * out; /* a pointer to an array of bytes to store the result */
1300    int n_out;
1301    int * outlen; /* the length of @out */
1302    int n_outlen;
1303    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1304    int n_in;
1305    int * inlen; /* the length of @in */
1306    int n_inlen;
1307
1308    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1309    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1310    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1311    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1312        mem_base = xmlMemBlocks();
1313        out = gen_unsigned_char_ptr(n_out, 0);
1314        outlen = gen_int_ptr(n_outlen, 1);
1315        in = gen_const_unsigned_char_ptr(n_in, 2);
1316        inlen = gen_int_ptr(n_inlen, 3);
1317
1318        ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen);
1319        desret_int(ret_val);
1320        call_tests++;
1321        des_unsigned_char_ptr(n_out, out, 0);
1322        des_int_ptr(n_outlen, outlen, 1);
1323        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1324        des_int_ptr(n_inlen, inlen, 3);
1325        xmlResetLastError();
1326        if (mem_base != xmlMemBlocks()) {
1327            printf("Leak of %d blocks found in UTF8ToHtml",
1328	           xmlMemBlocks() - mem_base);
1329	    test_ret++;
1330            printf(" %d", n_out);
1331            printf(" %d", n_outlen);
1332            printf(" %d", n_in);
1333            printf(" %d", n_inlen);
1334            printf("\n");
1335        }
1336    }
1337    }
1338    }
1339    }
1340    function_tests++;
1341#endif
1342
1343    return(test_ret);
1344}
1345
1346#ifdef LIBXML_HTML_ENABLED
1347
1348#define gen_nb_const_htmlElemDesc_ptr 1
1349static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1350    return(NULL);
1351}
1352static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1353}
1354#endif
1355
1356
1357static int
1358test_htmlAttrAllowed(void) {
1359    int test_ret = 0;
1360
1361#if defined(LIBXML_HTML_ENABLED)
1362    int mem_base;
1363    htmlStatus ret_val;
1364    htmlElemDesc * elt; /* HTML element */
1365    int n_elt;
1366    xmlChar * attr; /* HTML attribute */
1367    int n_attr;
1368    int legacy; /* whether to allow deprecated attributes */
1369    int n_legacy;
1370
1371    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1372    for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) {
1373    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
1374        mem_base = xmlMemBlocks();
1375        elt = gen_const_htmlElemDesc_ptr(n_elt, 0);
1376        attr = gen_const_xmlChar_ptr(n_attr, 1);
1377        legacy = gen_int(n_legacy, 2);
1378
1379        ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy);
1380        desret_htmlStatus(ret_val);
1381        call_tests++;
1382        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0);
1383        des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1);
1384        des_int(n_legacy, legacy, 2);
1385        xmlResetLastError();
1386        if (mem_base != xmlMemBlocks()) {
1387            printf("Leak of %d blocks found in htmlAttrAllowed",
1388	           xmlMemBlocks() - mem_base);
1389	    test_ret++;
1390            printf(" %d", n_elt);
1391            printf(" %d", n_attr);
1392            printf(" %d", n_legacy);
1393            printf("\n");
1394        }
1395    }
1396    }
1397    }
1398    function_tests++;
1399#endif
1400
1401    return(test_ret);
1402}
1403
1404#ifdef LIBXML_HTML_ENABLED
1405
1406#define gen_nb_htmlNodePtr 1
1407static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1408    return(NULL);
1409}
1410static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1411}
1412#endif
1413
1414
1415static int
1416test_htmlAutoCloseTag(void) {
1417    int test_ret = 0;
1418
1419#if defined(LIBXML_HTML_ENABLED)
1420    int mem_base;
1421    int ret_val;
1422    htmlDocPtr doc; /* the HTML document */
1423    int n_doc;
1424    xmlChar * name; /* The tag name */
1425    int n_name;
1426    htmlNodePtr elem; /* the HTML element */
1427    int n_elem;
1428
1429    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
1430    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1431    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
1432        mem_base = xmlMemBlocks();
1433        doc = gen_htmlDocPtr(n_doc, 0);
1434        name = gen_const_xmlChar_ptr(n_name, 1);
1435        elem = gen_htmlNodePtr(n_elem, 2);
1436
1437        ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem);
1438        desret_int(ret_val);
1439        call_tests++;
1440        des_htmlDocPtr(n_doc, doc, 0);
1441        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
1442        des_htmlNodePtr(n_elem, elem, 2);
1443        xmlResetLastError();
1444        if (mem_base != xmlMemBlocks()) {
1445            printf("Leak of %d blocks found in htmlAutoCloseTag",
1446	           xmlMemBlocks() - mem_base);
1447	    test_ret++;
1448            printf(" %d", n_doc);
1449            printf(" %d", n_name);
1450            printf(" %d", n_elem);
1451            printf("\n");
1452        }
1453    }
1454    }
1455    }
1456    function_tests++;
1457#endif
1458
1459    return(test_ret);
1460}
1461
1462
1463static int
1464test_htmlCreateMemoryParserCtxt(void) {
1465    int test_ret = 0;
1466
1467#if defined(LIBXML_HTML_ENABLED)
1468    int mem_base;
1469    htmlParserCtxtPtr ret_val;
1470    char * buffer; /* a pointer to a char array */
1471    int n_buffer;
1472    int size; /* the size of the array */
1473    int n_size;
1474
1475    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1476    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1477        mem_base = xmlMemBlocks();
1478        buffer = gen_const_char_ptr(n_buffer, 0);
1479        size = gen_int(n_size, 1);
1480
1481        ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size);
1482        desret_htmlParserCtxtPtr(ret_val);
1483        call_tests++;
1484        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
1485        des_int(n_size, size, 1);
1486        xmlResetLastError();
1487        if (mem_base != xmlMemBlocks()) {
1488            printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt",
1489	           xmlMemBlocks() - mem_base);
1490	    test_ret++;
1491            printf(" %d", n_buffer);
1492            printf(" %d", n_size);
1493            printf("\n");
1494        }
1495    }
1496    }
1497    function_tests++;
1498#endif
1499
1500    return(test_ret);
1501}
1502
1503#ifdef LIBXML_HTML_ENABLED
1504
1505#define gen_nb_htmlSAXHandlerPtr 1
1506static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1507    return(NULL);
1508}
1509static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
1510}
1511#endif
1512
1513
1514static int
1515test_htmlCreatePushParserCtxt(void) {
1516    int test_ret = 0;
1517
1518#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
1519    int mem_base;
1520    htmlParserCtxtPtr ret_val;
1521    htmlSAXHandlerPtr sax; /* a SAX handler */
1522    int n_sax;
1523    void * user_data; /* The user data returned on SAX callbacks */
1524    int n_user_data;
1525    char * chunk; /* a pointer to an array of chars */
1526    int n_chunk;
1527    int size; /* number of chars in the array */
1528    int n_size;
1529    const char * filename; /* an optional file name or URI */
1530    int n_filename;
1531    xmlCharEncoding enc; /* an optional encoding */
1532    int n_enc;
1533
1534    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
1535    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
1536    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
1537    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1538    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
1539    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
1540        mem_base = xmlMemBlocks();
1541        sax = gen_htmlSAXHandlerPtr(n_sax, 0);
1542        user_data = gen_userdata(n_user_data, 1);
1543        chunk = gen_const_char_ptr(n_chunk, 2);
1544        size = gen_int(n_size, 3);
1545        filename = gen_fileoutput(n_filename, 4);
1546        enc = gen_xmlCharEncoding(n_enc, 5);
1547
1548        ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc);
1549        desret_htmlParserCtxtPtr(ret_val);
1550        call_tests++;
1551        des_htmlSAXHandlerPtr(n_sax, sax, 0);
1552        des_userdata(n_user_data, user_data, 1);
1553        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
1554        des_int(n_size, size, 3);
1555        des_fileoutput(n_filename, filename, 4);
1556        des_xmlCharEncoding(n_enc, enc, 5);
1557        xmlResetLastError();
1558        if (mem_base != xmlMemBlocks()) {
1559            printf("Leak of %d blocks found in htmlCreatePushParserCtxt",
1560	           xmlMemBlocks() - mem_base);
1561	    test_ret++;
1562            printf(" %d", n_sax);
1563            printf(" %d", n_user_data);
1564            printf(" %d", n_chunk);
1565            printf(" %d", n_size);
1566            printf(" %d", n_filename);
1567            printf(" %d", n_enc);
1568            printf("\n");
1569        }
1570    }
1571    }
1572    }
1573    }
1574    }
1575    }
1576    function_tests++;
1577#endif
1578
1579    return(test_ret);
1580}
1581
1582
1583static int
1584test_htmlCtxtReadDoc(void) {
1585    int test_ret = 0;
1586
1587#if defined(LIBXML_HTML_ENABLED)
1588    int mem_base;
1589    htmlDocPtr ret_val;
1590    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1591    int n_ctxt;
1592    xmlChar * cur; /* a pointer to a zero terminated string */
1593    int n_cur;
1594    const char * URL; /* the base URL to use for the document */
1595    int n_URL;
1596    char * encoding; /* the document encoding, or NULL */
1597    int n_encoding;
1598    int options; /* a combination of htmlParserOption(s) */
1599    int n_options;
1600
1601    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1602    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
1603    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1604    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1605    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1606        mem_base = xmlMemBlocks();
1607        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1608        cur = gen_const_xmlChar_ptr(n_cur, 1);
1609        URL = gen_filepath(n_URL, 2);
1610        encoding = gen_const_char_ptr(n_encoding, 3);
1611        options = gen_int(n_options, 4);
1612
1613        ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
1614        desret_htmlDocPtr(ret_val);
1615        call_tests++;
1616        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1617        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
1618        des_filepath(n_URL, URL, 2);
1619        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
1620        des_int(n_options, options, 4);
1621        xmlResetLastError();
1622        if (mem_base != xmlMemBlocks()) {
1623            printf("Leak of %d blocks found in htmlCtxtReadDoc",
1624	           xmlMemBlocks() - mem_base);
1625	    test_ret++;
1626            printf(" %d", n_ctxt);
1627            printf(" %d", n_cur);
1628            printf(" %d", n_URL);
1629            printf(" %d", n_encoding);
1630            printf(" %d", n_options);
1631            printf("\n");
1632        }
1633    }
1634    }
1635    }
1636    }
1637    }
1638    function_tests++;
1639#endif
1640
1641    return(test_ret);
1642}
1643
1644
1645static int
1646test_htmlCtxtReadFile(void) {
1647    int test_ret = 0;
1648
1649#if defined(LIBXML_HTML_ENABLED)
1650    htmlDocPtr ret_val;
1651    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1652    int n_ctxt;
1653    const char * filename; /* a file or URL */
1654    int n_filename;
1655    char * encoding; /* the document encoding, or NULL */
1656    int n_encoding;
1657    int options; /* a combination of htmlParserOption(s) */
1658    int n_options;
1659
1660    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1661    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
1662    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1663    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1664        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1665        filename = gen_filepath(n_filename, 1);
1666        encoding = gen_const_char_ptr(n_encoding, 2);
1667        options = gen_int(n_options, 3);
1668
1669        ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
1670        desret_htmlDocPtr(ret_val);
1671        call_tests++;
1672        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1673        des_filepath(n_filename, filename, 1);
1674        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
1675        des_int(n_options, options, 3);
1676        xmlResetLastError();
1677    }
1678    }
1679    }
1680    }
1681    function_tests++;
1682#endif
1683
1684    return(test_ret);
1685}
1686
1687
1688static int
1689test_htmlCtxtReadMemory(void) {
1690    int test_ret = 0;
1691
1692#if defined(LIBXML_HTML_ENABLED)
1693    int mem_base;
1694    htmlDocPtr ret_val;
1695    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1696    int n_ctxt;
1697    char * buffer; /* a pointer to a char array */
1698    int n_buffer;
1699    int size; /* the size of the array */
1700    int n_size;
1701    const char * URL; /* the base URL to use for the document */
1702    int n_URL;
1703    char * encoding; /* the document encoding, or NULL */
1704    int n_encoding;
1705    int options; /* a combination of htmlParserOption(s) */
1706    int n_options;
1707
1708    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1709    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
1710    for (n_size = 0;n_size < gen_nb_int;n_size++) {
1711    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
1712    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
1713    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1714        mem_base = xmlMemBlocks();
1715        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1716        buffer = gen_const_char_ptr(n_buffer, 1);
1717        size = gen_int(n_size, 2);
1718        URL = gen_filepath(n_URL, 3);
1719        encoding = gen_const_char_ptr(n_encoding, 4);
1720        options = gen_int(n_options, 5);
1721
1722        ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
1723        desret_htmlDocPtr(ret_val);
1724        call_tests++;
1725        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1726        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
1727        des_int(n_size, size, 2);
1728        des_filepath(n_URL, URL, 3);
1729        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
1730        des_int(n_options, options, 5);
1731        xmlResetLastError();
1732        if (mem_base != xmlMemBlocks()) {
1733            printf("Leak of %d blocks found in htmlCtxtReadMemory",
1734	           xmlMemBlocks() - mem_base);
1735	    test_ret++;
1736            printf(" %d", n_ctxt);
1737            printf(" %d", n_buffer);
1738            printf(" %d", n_size);
1739            printf(" %d", n_URL);
1740            printf(" %d", n_encoding);
1741            printf(" %d", n_options);
1742            printf("\n");
1743        }
1744    }
1745    }
1746    }
1747    }
1748    }
1749    }
1750    function_tests++;
1751#endif
1752
1753    return(test_ret);
1754}
1755
1756
1757static int
1758test_htmlCtxtReset(void) {
1759    int test_ret = 0;
1760
1761#if defined(LIBXML_HTML_ENABLED)
1762    int mem_base;
1763    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1764    int n_ctxt;
1765
1766    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1767        mem_base = xmlMemBlocks();
1768        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1769
1770        htmlCtxtReset(ctxt);
1771        call_tests++;
1772        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1773        xmlResetLastError();
1774        if (mem_base != xmlMemBlocks()) {
1775            printf("Leak of %d blocks found in htmlCtxtReset",
1776	           xmlMemBlocks() - mem_base);
1777	    test_ret++;
1778            printf(" %d", n_ctxt);
1779            printf("\n");
1780        }
1781    }
1782    function_tests++;
1783#endif
1784
1785    return(test_ret);
1786}
1787
1788
1789static int
1790test_htmlCtxtUseOptions(void) {
1791    int test_ret = 0;
1792
1793#if defined(LIBXML_HTML_ENABLED)
1794    int mem_base;
1795    int ret_val;
1796    htmlParserCtxtPtr ctxt; /* an HTML parser context */
1797    int n_ctxt;
1798    int options; /* a combination of htmlParserOption(s) */
1799    int n_options;
1800
1801    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
1802    for (n_options = 0;n_options < gen_nb_int;n_options++) {
1803        mem_base = xmlMemBlocks();
1804        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
1805        options = gen_int(n_options, 1);
1806
1807        ret_val = htmlCtxtUseOptions(ctxt, options);
1808        desret_int(ret_val);
1809        call_tests++;
1810        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
1811        des_int(n_options, options, 1);
1812        xmlResetLastError();
1813        if (mem_base != xmlMemBlocks()) {
1814            printf("Leak of %d blocks found in htmlCtxtUseOptions",
1815	           xmlMemBlocks() - mem_base);
1816	    test_ret++;
1817            printf(" %d", n_ctxt);
1818            printf(" %d", n_options);
1819            printf("\n");
1820        }
1821    }
1822    }
1823    function_tests++;
1824#endif
1825
1826    return(test_ret);
1827}
1828
1829
1830static int
1831test_htmlElementAllowedHere(void) {
1832    int test_ret = 0;
1833
1834#if defined(LIBXML_HTML_ENABLED)
1835    int mem_base;
1836    int ret_val;
1837    htmlElemDesc * parent; /* HTML parent element */
1838    int n_parent;
1839    xmlChar * elt; /* HTML element */
1840    int n_elt;
1841
1842    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1843    for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) {
1844        mem_base = xmlMemBlocks();
1845        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1846        elt = gen_const_xmlChar_ptr(n_elt, 1);
1847
1848        ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt);
1849        desret_int(ret_val);
1850        call_tests++;
1851        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1852        des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1);
1853        xmlResetLastError();
1854        if (mem_base != xmlMemBlocks()) {
1855            printf("Leak of %d blocks found in htmlElementAllowedHere",
1856	           xmlMemBlocks() - mem_base);
1857	    test_ret++;
1858            printf(" %d", n_parent);
1859            printf(" %d", n_elt);
1860            printf("\n");
1861        }
1862    }
1863    }
1864    function_tests++;
1865#endif
1866
1867    return(test_ret);
1868}
1869
1870
1871static int
1872test_htmlElementStatusHere(void) {
1873    int test_ret = 0;
1874
1875#if defined(LIBXML_HTML_ENABLED)
1876    int mem_base;
1877    htmlStatus ret_val;
1878    htmlElemDesc * parent; /* HTML parent element */
1879    int n_parent;
1880    htmlElemDesc * elt; /* HTML element */
1881    int n_elt;
1882
1883    for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) {
1884    for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) {
1885        mem_base = xmlMemBlocks();
1886        parent = gen_const_htmlElemDesc_ptr(n_parent, 0);
1887        elt = gen_const_htmlElemDesc_ptr(n_elt, 1);
1888
1889        ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt);
1890        desret_htmlStatus(ret_val);
1891        call_tests++;
1892        des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0);
1893        des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1);
1894        xmlResetLastError();
1895        if (mem_base != xmlMemBlocks()) {
1896            printf("Leak of %d blocks found in htmlElementStatusHere",
1897	           xmlMemBlocks() - mem_base);
1898	    test_ret++;
1899            printf(" %d", n_parent);
1900            printf(" %d", n_elt);
1901            printf("\n");
1902        }
1903    }
1904    }
1905    function_tests++;
1906#endif
1907
1908    return(test_ret);
1909}
1910
1911
1912static int
1913test_htmlEncodeEntities(void) {
1914    int test_ret = 0;
1915
1916#if defined(LIBXML_HTML_ENABLED)
1917    int mem_base;
1918    int ret_val;
1919    unsigned char * out; /* a pointer to an array of bytes to store the result */
1920    int n_out;
1921    int * outlen; /* the length of @out */
1922    int n_outlen;
1923    unsigned char * in; /* a pointer to an array of UTF-8 chars */
1924    int n_in;
1925    int * inlen; /* the length of @in */
1926    int n_inlen;
1927    int quoteChar; /* the quote character to escape (' or ") or zero. */
1928    int n_quoteChar;
1929
1930    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
1931    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
1932    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
1933    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
1934    for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) {
1935        mem_base = xmlMemBlocks();
1936        out = gen_unsigned_char_ptr(n_out, 0);
1937        outlen = gen_int_ptr(n_outlen, 1);
1938        in = gen_const_unsigned_char_ptr(n_in, 2);
1939        inlen = gen_int_ptr(n_inlen, 3);
1940        quoteChar = gen_int(n_quoteChar, 4);
1941
1942        ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar);
1943        desret_int(ret_val);
1944        call_tests++;
1945        des_unsigned_char_ptr(n_out, out, 0);
1946        des_int_ptr(n_outlen, outlen, 1);
1947        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
1948        des_int_ptr(n_inlen, inlen, 3);
1949        des_int(n_quoteChar, quoteChar, 4);
1950        xmlResetLastError();
1951        if (mem_base != xmlMemBlocks()) {
1952            printf("Leak of %d blocks found in htmlEncodeEntities",
1953	           xmlMemBlocks() - mem_base);
1954	    test_ret++;
1955            printf(" %d", n_out);
1956            printf(" %d", n_outlen);
1957            printf(" %d", n_in);
1958            printf(" %d", n_inlen);
1959            printf(" %d", n_quoteChar);
1960            printf("\n");
1961        }
1962    }
1963    }
1964    }
1965    }
1966    }
1967    function_tests++;
1968#endif
1969
1970    return(test_ret);
1971}
1972
1973
1974static int
1975test_htmlEntityLookup(void) {
1976    int test_ret = 0;
1977
1978#if defined(LIBXML_HTML_ENABLED)
1979    int mem_base;
1980    const htmlEntityDesc * ret_val;
1981    xmlChar * name; /* the entity name */
1982    int n_name;
1983
1984    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
1985        mem_base = xmlMemBlocks();
1986        name = gen_const_xmlChar_ptr(n_name, 0);
1987
1988        ret_val = htmlEntityLookup((const xmlChar *)name);
1989        desret_const_htmlEntityDesc_ptr(ret_val);
1990        call_tests++;
1991        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
1992        xmlResetLastError();
1993        if (mem_base != xmlMemBlocks()) {
1994            printf("Leak of %d blocks found in htmlEntityLookup",
1995	           xmlMemBlocks() - mem_base);
1996	    test_ret++;
1997            printf(" %d", n_name);
1998            printf("\n");
1999        }
2000    }
2001    function_tests++;
2002#endif
2003
2004    return(test_ret);
2005}
2006
2007
2008static int
2009test_htmlEntityValueLookup(void) {
2010    int test_ret = 0;
2011
2012#if defined(LIBXML_HTML_ENABLED)
2013    int mem_base;
2014    const htmlEntityDesc * ret_val;
2015    unsigned int value; /* the entity's unicode value */
2016    int n_value;
2017
2018    for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) {
2019        mem_base = xmlMemBlocks();
2020        value = gen_unsigned_int(n_value, 0);
2021
2022        ret_val = htmlEntityValueLookup(value);
2023        desret_const_htmlEntityDesc_ptr(ret_val);
2024        call_tests++;
2025        des_unsigned_int(n_value, value, 0);
2026        xmlResetLastError();
2027        if (mem_base != xmlMemBlocks()) {
2028            printf("Leak of %d blocks found in htmlEntityValueLookup",
2029	           xmlMemBlocks() - mem_base);
2030	    test_ret++;
2031            printf(" %d", n_value);
2032            printf("\n");
2033        }
2034    }
2035    function_tests++;
2036#endif
2037
2038    return(test_ret);
2039}
2040
2041
2042static int
2043test_htmlHandleOmittedElem(void) {
2044    int test_ret = 0;
2045
2046#if defined(LIBXML_HTML_ENABLED)
2047    int mem_base;
2048    int ret_val;
2049    int val; /* int 0 or 1 */
2050    int n_val;
2051
2052    for (n_val = 0;n_val < gen_nb_int;n_val++) {
2053        mem_base = xmlMemBlocks();
2054        val = gen_int(n_val, 0);
2055
2056        ret_val = htmlHandleOmittedElem(val);
2057        desret_int(ret_val);
2058        call_tests++;
2059        des_int(n_val, val, 0);
2060        xmlResetLastError();
2061        if (mem_base != xmlMemBlocks()) {
2062            printf("Leak of %d blocks found in htmlHandleOmittedElem",
2063	           xmlMemBlocks() - mem_base);
2064	    test_ret++;
2065            printf(" %d", n_val);
2066            printf("\n");
2067        }
2068    }
2069    function_tests++;
2070#endif
2071
2072    return(test_ret);
2073}
2074
2075
2076static int
2077test_htmlIsAutoClosed(void) {
2078    int test_ret = 0;
2079
2080#if defined(LIBXML_HTML_ENABLED)
2081    int mem_base;
2082    int ret_val;
2083    htmlDocPtr doc; /* the HTML document */
2084    int n_doc;
2085    htmlNodePtr elem; /* the HTML element */
2086    int n_elem;
2087
2088    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
2089    for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) {
2090        mem_base = xmlMemBlocks();
2091        doc = gen_htmlDocPtr(n_doc, 0);
2092        elem = gen_htmlNodePtr(n_elem, 1);
2093
2094        ret_val = htmlIsAutoClosed(doc, elem);
2095        desret_int(ret_val);
2096        call_tests++;
2097        des_htmlDocPtr(n_doc, doc, 0);
2098        des_htmlNodePtr(n_elem, elem, 1);
2099        xmlResetLastError();
2100        if (mem_base != xmlMemBlocks()) {
2101            printf("Leak of %d blocks found in htmlIsAutoClosed",
2102	           xmlMemBlocks() - mem_base);
2103	    test_ret++;
2104            printf(" %d", n_doc);
2105            printf(" %d", n_elem);
2106            printf("\n");
2107        }
2108    }
2109    }
2110    function_tests++;
2111#endif
2112
2113    return(test_ret);
2114}
2115
2116
2117static int
2118test_htmlIsScriptAttribute(void) {
2119    int test_ret = 0;
2120
2121#if defined(LIBXML_HTML_ENABLED)
2122    int mem_base;
2123    int ret_val;
2124    xmlChar * name; /* an attribute name */
2125    int n_name;
2126
2127    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
2128        mem_base = xmlMemBlocks();
2129        name = gen_const_xmlChar_ptr(n_name, 0);
2130
2131        ret_val = htmlIsScriptAttribute((const xmlChar *)name);
2132        desret_int(ret_val);
2133        call_tests++;
2134        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
2135        xmlResetLastError();
2136        if (mem_base != xmlMemBlocks()) {
2137            printf("Leak of %d blocks found in htmlIsScriptAttribute",
2138	           xmlMemBlocks() - mem_base);
2139	    test_ret++;
2140            printf(" %d", n_name);
2141            printf("\n");
2142        }
2143    }
2144    function_tests++;
2145#endif
2146
2147    return(test_ret);
2148}
2149
2150
2151static int
2152test_htmlNewParserCtxt(void) {
2153    int test_ret = 0;
2154
2155#if defined(LIBXML_HTML_ENABLED)
2156    int mem_base;
2157    htmlParserCtxtPtr ret_val;
2158
2159        mem_base = xmlMemBlocks();
2160
2161        ret_val = htmlNewParserCtxt();
2162        desret_htmlParserCtxtPtr(ret_val);
2163        call_tests++;
2164        xmlResetLastError();
2165        if (mem_base != xmlMemBlocks()) {
2166            printf("Leak of %d blocks found in htmlNewParserCtxt",
2167	           xmlMemBlocks() - mem_base);
2168	    test_ret++;
2169            printf("\n");
2170        }
2171    function_tests++;
2172#endif
2173
2174    return(test_ret);
2175}
2176
2177
2178static int
2179test_htmlNodeStatus(void) {
2180    int test_ret = 0;
2181
2182#if defined(LIBXML_HTML_ENABLED)
2183    int mem_base;
2184    htmlStatus ret_val;
2185    htmlNodePtr node; /* an htmlNodePtr in a tree */
2186    int n_node;
2187    int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */
2188    int n_legacy;
2189
2190    for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) {
2191    for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) {
2192        mem_base = xmlMemBlocks();
2193        node = gen_const_htmlNodePtr(n_node, 0);
2194        legacy = gen_int(n_legacy, 1);
2195
2196        ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy);
2197        desret_htmlStatus(ret_val);
2198        call_tests++;
2199        des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0);
2200        des_int(n_legacy, legacy, 1);
2201        xmlResetLastError();
2202        if (mem_base != xmlMemBlocks()) {
2203            printf("Leak of %d blocks found in htmlNodeStatus",
2204	           xmlMemBlocks() - mem_base);
2205	    test_ret++;
2206            printf(" %d", n_node);
2207            printf(" %d", n_legacy);
2208            printf("\n");
2209        }
2210    }
2211    }
2212    function_tests++;
2213#endif
2214
2215    return(test_ret);
2216}
2217
2218
2219static int
2220test_htmlParseCharRef(void) {
2221    int test_ret = 0;
2222
2223#if defined(LIBXML_HTML_ENABLED)
2224    int mem_base;
2225    int ret_val;
2226    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2227    int n_ctxt;
2228
2229    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2230        mem_base = xmlMemBlocks();
2231        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2232
2233        ret_val = htmlParseCharRef(ctxt);
2234        desret_int(ret_val);
2235        call_tests++;
2236        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2237        xmlResetLastError();
2238        if (mem_base != xmlMemBlocks()) {
2239            printf("Leak of %d blocks found in htmlParseCharRef",
2240	           xmlMemBlocks() - mem_base);
2241	    test_ret++;
2242            printf(" %d", n_ctxt);
2243            printf("\n");
2244        }
2245    }
2246    function_tests++;
2247#endif
2248
2249    return(test_ret);
2250}
2251
2252
2253static int
2254test_htmlParseChunk(void) {
2255    int test_ret = 0;
2256
2257#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED)
2258    int mem_base;
2259    int ret_val;
2260    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2261    int n_ctxt;
2262    char * chunk; /* an char array */
2263    int n_chunk;
2264    int size; /* the size in byte of the chunk */
2265    int n_size;
2266    int terminate; /* last chunk indicator */
2267    int n_terminate;
2268
2269    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2270    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
2271    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2272    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
2273        mem_base = xmlMemBlocks();
2274        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2275        chunk = gen_const_char_ptr(n_chunk, 1);
2276        size = gen_int(n_size, 2);
2277        terminate = gen_int(n_terminate, 3);
2278
2279        ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate);
2280        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2281        desret_int(ret_val);
2282        call_tests++;
2283        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2284        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
2285        des_int(n_size, size, 2);
2286        des_int(n_terminate, terminate, 3);
2287        xmlResetLastError();
2288        if (mem_base != xmlMemBlocks()) {
2289            printf("Leak of %d blocks found in htmlParseChunk",
2290	           xmlMemBlocks() - mem_base);
2291	    test_ret++;
2292            printf(" %d", n_ctxt);
2293            printf(" %d", n_chunk);
2294            printf(" %d", n_size);
2295            printf(" %d", n_terminate);
2296            printf("\n");
2297        }
2298    }
2299    }
2300    }
2301    }
2302    function_tests++;
2303#endif
2304
2305    return(test_ret);
2306}
2307
2308
2309static int
2310test_htmlParseDoc(void) {
2311    int test_ret = 0;
2312
2313#if defined(LIBXML_HTML_ENABLED)
2314    int mem_base;
2315    htmlDocPtr ret_val;
2316    xmlChar * cur; /* a pointer to an array of xmlChar */
2317    int n_cur;
2318    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2319    int n_encoding;
2320
2321    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2322    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2323        mem_base = xmlMemBlocks();
2324        cur = gen_xmlChar_ptr(n_cur, 0);
2325        encoding = gen_const_char_ptr(n_encoding, 1);
2326
2327        ret_val = htmlParseDoc(cur, (const char *)encoding);
2328        desret_htmlDocPtr(ret_val);
2329        call_tests++;
2330        des_xmlChar_ptr(n_cur, cur, 0);
2331        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2332        xmlResetLastError();
2333        if (mem_base != xmlMemBlocks()) {
2334            printf("Leak of %d blocks found in htmlParseDoc",
2335	           xmlMemBlocks() - mem_base);
2336	    test_ret++;
2337            printf(" %d", n_cur);
2338            printf(" %d", n_encoding);
2339            printf("\n");
2340        }
2341    }
2342    }
2343    function_tests++;
2344#endif
2345
2346    return(test_ret);
2347}
2348
2349
2350static int
2351test_htmlParseDocument(void) {
2352    int test_ret = 0;
2353
2354#if defined(LIBXML_HTML_ENABLED)
2355    int mem_base;
2356    int ret_val;
2357    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2358    int n_ctxt;
2359
2360    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2361        mem_base = xmlMemBlocks();
2362        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2363
2364        ret_val = htmlParseDocument(ctxt);
2365        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
2366        desret_int(ret_val);
2367        call_tests++;
2368        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2369        xmlResetLastError();
2370        if (mem_base != xmlMemBlocks()) {
2371            printf("Leak of %d blocks found in htmlParseDocument",
2372	           xmlMemBlocks() - mem_base);
2373	    test_ret++;
2374            printf(" %d", n_ctxt);
2375            printf("\n");
2376        }
2377    }
2378    function_tests++;
2379#endif
2380
2381    return(test_ret);
2382}
2383
2384
2385static int
2386test_htmlParseElement(void) {
2387    int test_ret = 0;
2388
2389#if defined(LIBXML_HTML_ENABLED)
2390    int mem_base;
2391    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2392    int n_ctxt;
2393
2394    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2395        mem_base = xmlMemBlocks();
2396        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2397
2398        htmlParseElement(ctxt);
2399        call_tests++;
2400        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2401        xmlResetLastError();
2402        if (mem_base != xmlMemBlocks()) {
2403            printf("Leak of %d blocks found in htmlParseElement",
2404	           xmlMemBlocks() - mem_base);
2405	    test_ret++;
2406            printf(" %d", n_ctxt);
2407            printf("\n");
2408        }
2409    }
2410    function_tests++;
2411#endif
2412
2413    return(test_ret);
2414}
2415
2416
2417static int
2418test_htmlParseEntityRef(void) {
2419    int test_ret = 0;
2420
2421#if defined(LIBXML_HTML_ENABLED)
2422    int mem_base;
2423    const htmlEntityDesc * ret_val;
2424    htmlParserCtxtPtr ctxt; /* an HTML parser context */
2425    int n_ctxt;
2426    xmlChar ** str; /* location to store the entity name */
2427    int n_str;
2428
2429    for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) {
2430    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) {
2431        mem_base = xmlMemBlocks();
2432        ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0);
2433        str = gen_const_xmlChar_ptr_ptr(n_str, 1);
2434
2435        ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str);
2436        desret_const_htmlEntityDesc_ptr(ret_val);
2437        call_tests++;
2438        des_htmlParserCtxtPtr(n_ctxt, ctxt, 0);
2439        des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1);
2440        xmlResetLastError();
2441        if (mem_base != xmlMemBlocks()) {
2442            printf("Leak of %d blocks found in htmlParseEntityRef",
2443	           xmlMemBlocks() - mem_base);
2444	    test_ret++;
2445            printf(" %d", n_ctxt);
2446            printf(" %d", n_str);
2447            printf("\n");
2448        }
2449    }
2450    }
2451    function_tests++;
2452#endif
2453
2454    return(test_ret);
2455}
2456
2457
2458static int
2459test_htmlParseFile(void) {
2460    int test_ret = 0;
2461
2462#if defined(LIBXML_HTML_ENABLED)
2463    htmlDocPtr ret_val;
2464    const char * filename; /* the filename */
2465    int n_filename;
2466    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2467    int n_encoding;
2468
2469    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2470    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2471        filename = gen_filepath(n_filename, 0);
2472        encoding = gen_const_char_ptr(n_encoding, 1);
2473
2474        ret_val = htmlParseFile(filename, (const char *)encoding);
2475        desret_htmlDocPtr(ret_val);
2476        call_tests++;
2477        des_filepath(n_filename, filename, 0);
2478        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2479        xmlResetLastError();
2480    }
2481    }
2482    function_tests++;
2483#endif
2484
2485    return(test_ret);
2486}
2487
2488
2489static int
2490test_htmlReadDoc(void) {
2491    int test_ret = 0;
2492
2493#if defined(LIBXML_HTML_ENABLED)
2494    int mem_base;
2495    htmlDocPtr ret_val;
2496    xmlChar * cur; /* a pointer to a zero terminated string */
2497    int n_cur;
2498    const char * URL; /* the base URL to use for the document */
2499    int n_URL;
2500    char * encoding; /* the document encoding, or NULL */
2501    int n_encoding;
2502    int options; /* a combination of htmlParserOption(s) */
2503    int n_options;
2504
2505    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
2506    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2507    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2508    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2509        mem_base = xmlMemBlocks();
2510        cur = gen_const_xmlChar_ptr(n_cur, 0);
2511        URL = gen_filepath(n_URL, 1);
2512        encoding = gen_const_char_ptr(n_encoding, 2);
2513        options = gen_int(n_options, 3);
2514
2515        ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
2516        desret_htmlDocPtr(ret_val);
2517        call_tests++;
2518        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
2519        des_filepath(n_URL, URL, 1);
2520        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2521        des_int(n_options, options, 3);
2522        xmlResetLastError();
2523        if (mem_base != xmlMemBlocks()) {
2524            printf("Leak of %d blocks found in htmlReadDoc",
2525	           xmlMemBlocks() - mem_base);
2526	    test_ret++;
2527            printf(" %d", n_cur);
2528            printf(" %d", n_URL);
2529            printf(" %d", n_encoding);
2530            printf(" %d", n_options);
2531            printf("\n");
2532        }
2533    }
2534    }
2535    }
2536    }
2537    function_tests++;
2538#endif
2539
2540    return(test_ret);
2541}
2542
2543
2544static int
2545test_htmlReadFile(void) {
2546    int test_ret = 0;
2547
2548#if defined(LIBXML_HTML_ENABLED)
2549    int mem_base;
2550    htmlDocPtr ret_val;
2551    const char * filename; /* a file or URL */
2552    int n_filename;
2553    char * encoding; /* the document encoding, or NULL */
2554    int n_encoding;
2555    int options; /* a combination of htmlParserOption(s) */
2556    int n_options;
2557
2558    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2559    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2560    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2561        mem_base = xmlMemBlocks();
2562        filename = gen_filepath(n_filename, 0);
2563        encoding = gen_const_char_ptr(n_encoding, 1);
2564        options = gen_int(n_options, 2);
2565
2566        ret_val = htmlReadFile(filename, (const char *)encoding, options);
2567        desret_htmlDocPtr(ret_val);
2568        call_tests++;
2569        des_filepath(n_filename, filename, 0);
2570        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2571        des_int(n_options, options, 2);
2572        xmlResetLastError();
2573        if (mem_base != xmlMemBlocks()) {
2574            printf("Leak of %d blocks found in htmlReadFile",
2575	           xmlMemBlocks() - mem_base);
2576	    test_ret++;
2577            printf(" %d", n_filename);
2578            printf(" %d", n_encoding);
2579            printf(" %d", n_options);
2580            printf("\n");
2581        }
2582    }
2583    }
2584    }
2585    function_tests++;
2586#endif
2587
2588    return(test_ret);
2589}
2590
2591
2592static int
2593test_htmlReadMemory(void) {
2594    int test_ret = 0;
2595
2596#if defined(LIBXML_HTML_ENABLED)
2597    int mem_base;
2598    htmlDocPtr ret_val;
2599    char * buffer; /* a pointer to a char array */
2600    int n_buffer;
2601    int size; /* the size of the array */
2602    int n_size;
2603    const char * URL; /* the base URL to use for the document */
2604    int n_URL;
2605    char * encoding; /* the document encoding, or NULL */
2606    int n_encoding;
2607    int options; /* a combination of htmlParserOption(s) */
2608    int n_options;
2609
2610    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
2611    for (n_size = 0;n_size < gen_nb_int;n_size++) {
2612    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
2613    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2614    for (n_options = 0;n_options < gen_nb_int;n_options++) {
2615        mem_base = xmlMemBlocks();
2616        buffer = gen_const_char_ptr(n_buffer, 0);
2617        size = gen_int(n_size, 1);
2618        URL = gen_filepath(n_URL, 2);
2619        encoding = gen_const_char_ptr(n_encoding, 3);
2620        options = gen_int(n_options, 4);
2621
2622        ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
2623        desret_htmlDocPtr(ret_val);
2624        call_tests++;
2625        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
2626        des_int(n_size, size, 1);
2627        des_filepath(n_URL, URL, 2);
2628        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
2629        des_int(n_options, options, 4);
2630        xmlResetLastError();
2631        if (mem_base != xmlMemBlocks()) {
2632            printf("Leak of %d blocks found in htmlReadMemory",
2633	           xmlMemBlocks() - mem_base);
2634	    test_ret++;
2635            printf(" %d", n_buffer);
2636            printf(" %d", n_size);
2637            printf(" %d", n_URL);
2638            printf(" %d", n_encoding);
2639            printf(" %d", n_options);
2640            printf("\n");
2641        }
2642    }
2643    }
2644    }
2645    }
2646    }
2647    function_tests++;
2648#endif
2649
2650    return(test_ret);
2651}
2652
2653
2654static int
2655test_htmlSAXParseDoc(void) {
2656    int test_ret = 0;
2657
2658#if defined(LIBXML_HTML_ENABLED)
2659    int mem_base;
2660    htmlDocPtr ret_val;
2661    xmlChar * cur; /* a pointer to an array of xmlChar */
2662    int n_cur;
2663    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2664    int n_encoding;
2665    htmlSAXHandlerPtr sax; /* the SAX handler block */
2666    int n_sax;
2667    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2668    int n_userData;
2669
2670    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
2671    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2672    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2673    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2674        mem_base = xmlMemBlocks();
2675        cur = gen_xmlChar_ptr(n_cur, 0);
2676        encoding = gen_const_char_ptr(n_encoding, 1);
2677        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2678        userData = gen_userdata(n_userData, 3);
2679
2680        ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData);
2681        desret_htmlDocPtr(ret_val);
2682        call_tests++;
2683        des_xmlChar_ptr(n_cur, cur, 0);
2684        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2685        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2686        des_userdata(n_userData, userData, 3);
2687        xmlResetLastError();
2688        if (mem_base != xmlMemBlocks()) {
2689            printf("Leak of %d blocks found in htmlSAXParseDoc",
2690	           xmlMemBlocks() - mem_base);
2691	    test_ret++;
2692            printf(" %d", n_cur);
2693            printf(" %d", n_encoding);
2694            printf(" %d", n_sax);
2695            printf(" %d", n_userData);
2696            printf("\n");
2697        }
2698    }
2699    }
2700    }
2701    }
2702    function_tests++;
2703#endif
2704
2705    return(test_ret);
2706}
2707
2708
2709static int
2710test_htmlSAXParseFile(void) {
2711    int test_ret = 0;
2712
2713#if defined(LIBXML_HTML_ENABLED)
2714    int mem_base;
2715    htmlDocPtr ret_val;
2716    const char * filename; /* the filename */
2717    int n_filename;
2718    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
2719    int n_encoding;
2720    htmlSAXHandlerPtr sax; /* the SAX handler block */
2721    int n_sax;
2722    void * userData; /* if using SAX, this pointer will be provided on callbacks. */
2723    int n_userData;
2724
2725    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
2726    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2727    for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) {
2728    for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) {
2729        mem_base = xmlMemBlocks();
2730        filename = gen_filepath(n_filename, 0);
2731        encoding = gen_const_char_ptr(n_encoding, 1);
2732        sax = gen_htmlSAXHandlerPtr(n_sax, 2);
2733        userData = gen_userdata(n_userData, 3);
2734
2735        ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData);
2736        desret_htmlDocPtr(ret_val);
2737        call_tests++;
2738        des_filepath(n_filename, filename, 0);
2739        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
2740        des_htmlSAXHandlerPtr(n_sax, sax, 2);
2741        des_userdata(n_userData, userData, 3);
2742        xmlResetLastError();
2743        if (mem_base != xmlMemBlocks()) {
2744            printf("Leak of %d blocks found in htmlSAXParseFile",
2745	           xmlMemBlocks() - mem_base);
2746	    test_ret++;
2747            printf(" %d", n_filename);
2748            printf(" %d", n_encoding);
2749            printf(" %d", n_sax);
2750            printf(" %d", n_userData);
2751            printf("\n");
2752        }
2753    }
2754    }
2755    }
2756    }
2757    function_tests++;
2758#endif
2759
2760    return(test_ret);
2761}
2762
2763
2764static int
2765test_htmlTagLookup(void) {
2766    int test_ret = 0;
2767
2768
2769    /* missing type support */
2770    return(test_ret);
2771}
2772
2773static int
2774test_HTMLparser(void) {
2775    int test_ret = 0;
2776
2777    if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n");
2778    test_ret += test_UTF8ToHtml();
2779    test_ret += test_htmlAttrAllowed();
2780    test_ret += test_htmlAutoCloseTag();
2781    test_ret += test_htmlCreateMemoryParserCtxt();
2782    test_ret += test_htmlCreatePushParserCtxt();
2783    test_ret += test_htmlCtxtReadDoc();
2784    test_ret += test_htmlCtxtReadFile();
2785    test_ret += test_htmlCtxtReadMemory();
2786    test_ret += test_htmlCtxtReset();
2787    test_ret += test_htmlCtxtUseOptions();
2788    test_ret += test_htmlElementAllowedHere();
2789    test_ret += test_htmlElementStatusHere();
2790    test_ret += test_htmlEncodeEntities();
2791    test_ret += test_htmlEntityLookup();
2792    test_ret += test_htmlEntityValueLookup();
2793    test_ret += test_htmlHandleOmittedElem();
2794    test_ret += test_htmlIsAutoClosed();
2795    test_ret += test_htmlIsScriptAttribute();
2796    test_ret += test_htmlNewParserCtxt();
2797    test_ret += test_htmlNodeStatus();
2798    test_ret += test_htmlParseCharRef();
2799    test_ret += test_htmlParseChunk();
2800    test_ret += test_htmlParseDoc();
2801    test_ret += test_htmlParseDocument();
2802    test_ret += test_htmlParseElement();
2803    test_ret += test_htmlParseEntityRef();
2804    test_ret += test_htmlParseFile();
2805    test_ret += test_htmlReadDoc();
2806    test_ret += test_htmlReadFile();
2807    test_ret += test_htmlReadMemory();
2808    test_ret += test_htmlSAXParseDoc();
2809    test_ret += test_htmlSAXParseFile();
2810    test_ret += test_htmlTagLookup();
2811
2812    if (test_ret != 0)
2813	printf("Module HTMLparser: %d errors\n", test_ret);
2814    return(test_ret);
2815}
2816
2817static int
2818test_htmlDocContentDumpFormatOutput(void) {
2819    int test_ret = 0;
2820
2821#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2822    int mem_base;
2823    xmlOutputBufferPtr buf; /* the HTML buffer output */
2824    int n_buf;
2825    xmlDocPtr cur; /* the document */
2826    int n_cur;
2827    char * encoding; /* the encoding string */
2828    int n_encoding;
2829    int format; /* should formatting spaces been added */
2830    int n_format;
2831
2832    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2833    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2834    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2835    for (n_format = 0;n_format < gen_nb_int;n_format++) {
2836        mem_base = xmlMemBlocks();
2837        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2838        cur = gen_xmlDocPtr(n_cur, 1);
2839        encoding = gen_const_char_ptr(n_encoding, 2);
2840        format = gen_int(n_format, 3);
2841
2842        htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format);
2843        call_tests++;
2844        des_xmlOutputBufferPtr(n_buf, buf, 0);
2845        des_xmlDocPtr(n_cur, cur, 1);
2846        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2847        des_int(n_format, format, 3);
2848        xmlResetLastError();
2849        if (mem_base != xmlMemBlocks()) {
2850            printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput",
2851	           xmlMemBlocks() - mem_base);
2852	    test_ret++;
2853            printf(" %d", n_buf);
2854            printf(" %d", n_cur);
2855            printf(" %d", n_encoding);
2856            printf(" %d", n_format);
2857            printf("\n");
2858        }
2859    }
2860    }
2861    }
2862    }
2863    function_tests++;
2864#endif
2865
2866    return(test_ret);
2867}
2868
2869
2870static int
2871test_htmlDocContentDumpOutput(void) {
2872    int test_ret = 0;
2873
2874#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2875    int mem_base;
2876    xmlOutputBufferPtr buf; /* the HTML buffer output */
2877    int n_buf;
2878    xmlDocPtr cur; /* the document */
2879    int n_cur;
2880    char * encoding; /* the encoding string */
2881    int n_encoding;
2882
2883    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
2884    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2885    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
2886        mem_base = xmlMemBlocks();
2887        buf = gen_xmlOutputBufferPtr(n_buf, 0);
2888        cur = gen_xmlDocPtr(n_cur, 1);
2889        encoding = gen_const_char_ptr(n_encoding, 2);
2890
2891        htmlDocContentDumpOutput(buf, cur, (const char *)encoding);
2892        call_tests++;
2893        des_xmlOutputBufferPtr(n_buf, buf, 0);
2894        des_xmlDocPtr(n_cur, cur, 1);
2895        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
2896        xmlResetLastError();
2897        if (mem_base != xmlMemBlocks()) {
2898            printf("Leak of %d blocks found in htmlDocContentDumpOutput",
2899	           xmlMemBlocks() - mem_base);
2900	    test_ret++;
2901            printf(" %d", n_buf);
2902            printf(" %d", n_cur);
2903            printf(" %d", n_encoding);
2904            printf("\n");
2905        }
2906    }
2907    }
2908    }
2909    function_tests++;
2910#endif
2911
2912    return(test_ret);
2913}
2914
2915
2916static int
2917test_htmlDocDump(void) {
2918    int test_ret = 0;
2919
2920#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2921    int mem_base;
2922    int ret_val;
2923    FILE * f; /* the FILE* */
2924    int n_f;
2925    xmlDocPtr cur; /* the document */
2926    int n_cur;
2927
2928    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
2929    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2930        mem_base = xmlMemBlocks();
2931        f = gen_FILE_ptr(n_f, 0);
2932        cur = gen_xmlDocPtr(n_cur, 1);
2933
2934        ret_val = htmlDocDump(f, cur);
2935        desret_int(ret_val);
2936        call_tests++;
2937        des_FILE_ptr(n_f, f, 0);
2938        des_xmlDocPtr(n_cur, cur, 1);
2939        xmlResetLastError();
2940        if (mem_base != xmlMemBlocks()) {
2941            printf("Leak of %d blocks found in htmlDocDump",
2942	           xmlMemBlocks() - mem_base);
2943	    test_ret++;
2944            printf(" %d", n_f);
2945            printf(" %d", n_cur);
2946            printf("\n");
2947        }
2948    }
2949    }
2950    function_tests++;
2951#endif
2952
2953    return(test_ret);
2954}
2955
2956
2957#define gen_nb_xmlChar_ptr_ptr 1
2958static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2959    return(NULL);
2960}
2961static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
2962}
2963
2964static int
2965test_htmlDocDumpMemory(void) {
2966    int test_ret = 0;
2967
2968#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
2969    int mem_base;
2970    xmlDocPtr cur; /* the document */
2971    int n_cur;
2972    xmlChar ** mem; /* OUT: the memory pointer */
2973    int n_mem;
2974    int * size; /* OUT: the memory length */
2975    int n_size;
2976
2977    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
2978    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
2979    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
2980        mem_base = xmlMemBlocks();
2981        cur = gen_xmlDocPtr(n_cur, 0);
2982        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
2983        size = gen_int_ptr(n_size, 2);
2984
2985        htmlDocDumpMemory(cur, mem, size);
2986        call_tests++;
2987        des_xmlDocPtr(n_cur, cur, 0);
2988        des_xmlChar_ptr_ptr(n_mem, mem, 1);
2989        des_int_ptr(n_size, size, 2);
2990        xmlResetLastError();
2991        if (mem_base != xmlMemBlocks()) {
2992            printf("Leak of %d blocks found in htmlDocDumpMemory",
2993	           xmlMemBlocks() - mem_base);
2994	    test_ret++;
2995            printf(" %d", n_cur);
2996            printf(" %d", n_mem);
2997            printf(" %d", n_size);
2998            printf("\n");
2999        }
3000    }
3001    }
3002    }
3003    function_tests++;
3004#endif
3005
3006    return(test_ret);
3007}
3008
3009
3010static int
3011test_htmlDocDumpMemoryFormat(void) {
3012    int test_ret = 0;
3013
3014#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3015    int mem_base;
3016    xmlDocPtr cur; /* the document */
3017    int n_cur;
3018    xmlChar ** mem; /* OUT: the memory pointer */
3019    int n_mem;
3020    int * size; /* OUT: the memory length */
3021    int n_size;
3022    int format; /* should formatting spaces been added */
3023    int n_format;
3024
3025    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3026    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
3027    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
3028    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3029        mem_base = xmlMemBlocks();
3030        cur = gen_xmlDocPtr(n_cur, 0);
3031        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
3032        size = gen_int_ptr(n_size, 2);
3033        format = gen_int(n_format, 3);
3034
3035        htmlDocDumpMemoryFormat(cur, mem, size, format);
3036        call_tests++;
3037        des_xmlDocPtr(n_cur, cur, 0);
3038        des_xmlChar_ptr_ptr(n_mem, mem, 1);
3039        des_int_ptr(n_size, size, 2);
3040        des_int(n_format, format, 3);
3041        xmlResetLastError();
3042        if (mem_base != xmlMemBlocks()) {
3043            printf("Leak of %d blocks found in htmlDocDumpMemoryFormat",
3044	           xmlMemBlocks() - mem_base);
3045	    test_ret++;
3046            printf(" %d", n_cur);
3047            printf(" %d", n_mem);
3048            printf(" %d", n_size);
3049            printf(" %d", n_format);
3050            printf("\n");
3051        }
3052    }
3053    }
3054    }
3055    }
3056    function_tests++;
3057#endif
3058
3059    return(test_ret);
3060}
3061
3062
3063static int
3064test_htmlGetMetaEncoding(void) {
3065    int test_ret = 0;
3066
3067#if defined(LIBXML_HTML_ENABLED)
3068    int mem_base;
3069    const xmlChar * ret_val;
3070    htmlDocPtr doc; /* the document */
3071    int n_doc;
3072
3073    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3074        mem_base = xmlMemBlocks();
3075        doc = gen_htmlDocPtr(n_doc, 0);
3076
3077        ret_val = htmlGetMetaEncoding(doc);
3078        desret_const_xmlChar_ptr(ret_val);
3079        call_tests++;
3080        des_htmlDocPtr(n_doc, doc, 0);
3081        xmlResetLastError();
3082        if (mem_base != xmlMemBlocks()) {
3083            printf("Leak of %d blocks found in htmlGetMetaEncoding",
3084	           xmlMemBlocks() - mem_base);
3085	    test_ret++;
3086            printf(" %d", n_doc);
3087            printf("\n");
3088        }
3089    }
3090    function_tests++;
3091#endif
3092
3093    return(test_ret);
3094}
3095
3096
3097static int
3098test_htmlIsBooleanAttr(void) {
3099    int test_ret = 0;
3100
3101#if defined(LIBXML_HTML_ENABLED)
3102    int mem_base;
3103    int ret_val;
3104    xmlChar * name; /* the name of the attribute to check */
3105    int n_name;
3106
3107    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3108        mem_base = xmlMemBlocks();
3109        name = gen_const_xmlChar_ptr(n_name, 0);
3110
3111        ret_val = htmlIsBooleanAttr((const xmlChar *)name);
3112        desret_int(ret_val);
3113        call_tests++;
3114        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
3115        xmlResetLastError();
3116        if (mem_base != xmlMemBlocks()) {
3117            printf("Leak of %d blocks found in htmlIsBooleanAttr",
3118	           xmlMemBlocks() - mem_base);
3119	    test_ret++;
3120            printf(" %d", n_name);
3121            printf("\n");
3122        }
3123    }
3124    function_tests++;
3125#endif
3126
3127    return(test_ret);
3128}
3129
3130
3131static int
3132test_htmlNewDoc(void) {
3133    int test_ret = 0;
3134
3135#if defined(LIBXML_HTML_ENABLED)
3136    int mem_base;
3137    htmlDocPtr ret_val;
3138    xmlChar * URI; /* URI for the dtd, or NULL */
3139    int n_URI;
3140    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3141    int n_ExternalID;
3142
3143    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3144    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3145        mem_base = xmlMemBlocks();
3146        URI = gen_const_xmlChar_ptr(n_URI, 0);
3147        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3148
3149        ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID);
3150        desret_htmlDocPtr(ret_val);
3151        call_tests++;
3152        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3153        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3154        xmlResetLastError();
3155        if (mem_base != xmlMemBlocks()) {
3156            printf("Leak of %d blocks found in htmlNewDoc",
3157	           xmlMemBlocks() - mem_base);
3158	    test_ret++;
3159            printf(" %d", n_URI);
3160            printf(" %d", n_ExternalID);
3161            printf("\n");
3162        }
3163    }
3164    }
3165    function_tests++;
3166#endif
3167
3168    return(test_ret);
3169}
3170
3171
3172static int
3173test_htmlNewDocNoDtD(void) {
3174    int test_ret = 0;
3175
3176#if defined(LIBXML_HTML_ENABLED)
3177    int mem_base;
3178    htmlDocPtr ret_val;
3179    xmlChar * URI; /* URI for the dtd, or NULL */
3180    int n_URI;
3181    xmlChar * ExternalID; /* the external ID of the DTD, or NULL */
3182    int n_ExternalID;
3183
3184    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
3185    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
3186        mem_base = xmlMemBlocks();
3187        URI = gen_const_xmlChar_ptr(n_URI, 0);
3188        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
3189
3190        ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID);
3191        desret_htmlDocPtr(ret_val);
3192        call_tests++;
3193        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
3194        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
3195        xmlResetLastError();
3196        if (mem_base != xmlMemBlocks()) {
3197            printf("Leak of %d blocks found in htmlNewDocNoDtD",
3198	           xmlMemBlocks() - mem_base);
3199	    test_ret++;
3200            printf(" %d", n_URI);
3201            printf(" %d", n_ExternalID);
3202            printf("\n");
3203        }
3204    }
3205    }
3206    function_tests++;
3207#endif
3208
3209    return(test_ret);
3210}
3211
3212
3213static int
3214test_htmlNodeDump(void) {
3215    int test_ret = 0;
3216
3217#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3218    int mem_base;
3219    int ret_val;
3220    xmlBufferPtr buf; /* the HTML buffer output */
3221    int n_buf;
3222    xmlDocPtr doc; /* the document */
3223    int n_doc;
3224    xmlNodePtr cur; /* the current node */
3225    int n_cur;
3226
3227    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
3228    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3229    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3230        mem_base = xmlMemBlocks();
3231        buf = gen_xmlBufferPtr(n_buf, 0);
3232        doc = gen_xmlDocPtr(n_doc, 1);
3233        cur = gen_xmlNodePtr(n_cur, 2);
3234
3235        ret_val = htmlNodeDump(buf, doc, cur);
3236        desret_int(ret_val);
3237        call_tests++;
3238        des_xmlBufferPtr(n_buf, buf, 0);
3239        des_xmlDocPtr(n_doc, doc, 1);
3240        des_xmlNodePtr(n_cur, cur, 2);
3241        xmlResetLastError();
3242        if (mem_base != xmlMemBlocks()) {
3243            printf("Leak of %d blocks found in htmlNodeDump",
3244	           xmlMemBlocks() - mem_base);
3245	    test_ret++;
3246            printf(" %d", n_buf);
3247            printf(" %d", n_doc);
3248            printf(" %d", n_cur);
3249            printf("\n");
3250        }
3251    }
3252    }
3253    }
3254    function_tests++;
3255#endif
3256
3257    return(test_ret);
3258}
3259
3260
3261static int
3262test_htmlNodeDumpFile(void) {
3263    int test_ret = 0;
3264
3265#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3266    int mem_base;
3267    FILE * out; /* the FILE pointer */
3268    int n_out;
3269    xmlDocPtr doc; /* the document */
3270    int n_doc;
3271    xmlNodePtr cur; /* the current node */
3272    int n_cur;
3273
3274    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3275    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3276    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3277        mem_base = xmlMemBlocks();
3278        out = gen_FILE_ptr(n_out, 0);
3279        doc = gen_xmlDocPtr(n_doc, 1);
3280        cur = gen_xmlNodePtr(n_cur, 2);
3281
3282        htmlNodeDumpFile(out, doc, cur);
3283        call_tests++;
3284        des_FILE_ptr(n_out, out, 0);
3285        des_xmlDocPtr(n_doc, doc, 1);
3286        des_xmlNodePtr(n_cur, cur, 2);
3287        xmlResetLastError();
3288        if (mem_base != xmlMemBlocks()) {
3289            printf("Leak of %d blocks found in htmlNodeDumpFile",
3290	           xmlMemBlocks() - mem_base);
3291	    test_ret++;
3292            printf(" %d", n_out);
3293            printf(" %d", n_doc);
3294            printf(" %d", n_cur);
3295            printf("\n");
3296        }
3297    }
3298    }
3299    }
3300    function_tests++;
3301#endif
3302
3303    return(test_ret);
3304}
3305
3306
3307static int
3308test_htmlNodeDumpFileFormat(void) {
3309    int test_ret = 0;
3310
3311#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3312    int mem_base;
3313    int ret_val;
3314    FILE * out; /* the FILE pointer */
3315    int n_out;
3316    xmlDocPtr doc; /* the document */
3317    int n_doc;
3318    xmlNodePtr cur; /* the current node */
3319    int n_cur;
3320    char * encoding; /* the document encoding */
3321    int n_encoding;
3322    int format; /* should formatting spaces been added */
3323    int n_format;
3324
3325    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
3326    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3327    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3328    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3329    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3330        mem_base = xmlMemBlocks();
3331        out = gen_FILE_ptr(n_out, 0);
3332        doc = gen_xmlDocPtr(n_doc, 1);
3333        cur = gen_xmlNodePtr(n_cur, 2);
3334        encoding = gen_const_char_ptr(n_encoding, 3);
3335        format = gen_int(n_format, 4);
3336
3337        ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format);
3338        desret_int(ret_val);
3339        call_tests++;
3340        des_FILE_ptr(n_out, out, 0);
3341        des_xmlDocPtr(n_doc, doc, 1);
3342        des_xmlNodePtr(n_cur, cur, 2);
3343        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3344        des_int(n_format, format, 4);
3345        xmlResetLastError();
3346        if (mem_base != xmlMemBlocks()) {
3347            printf("Leak of %d blocks found in htmlNodeDumpFileFormat",
3348	           xmlMemBlocks() - mem_base);
3349	    test_ret++;
3350            printf(" %d", n_out);
3351            printf(" %d", n_doc);
3352            printf(" %d", n_cur);
3353            printf(" %d", n_encoding);
3354            printf(" %d", n_format);
3355            printf("\n");
3356        }
3357    }
3358    }
3359    }
3360    }
3361    }
3362    function_tests++;
3363#endif
3364
3365    return(test_ret);
3366}
3367
3368
3369static int
3370test_htmlNodeDumpFormatOutput(void) {
3371    int test_ret = 0;
3372
3373#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3374    int mem_base;
3375    xmlOutputBufferPtr buf; /* the HTML buffer output */
3376    int n_buf;
3377    xmlDocPtr doc; /* the document */
3378    int n_doc;
3379    xmlNodePtr cur; /* the current node */
3380    int n_cur;
3381    char * encoding; /* the encoding string */
3382    int n_encoding;
3383    int format; /* should formatting spaces been added */
3384    int n_format;
3385
3386    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3387    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3388    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3389    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3390    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3391        mem_base = xmlMemBlocks();
3392        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3393        doc = gen_xmlDocPtr(n_doc, 1);
3394        cur = gen_xmlNodePtr(n_cur, 2);
3395        encoding = gen_const_char_ptr(n_encoding, 3);
3396        format = gen_int(n_format, 4);
3397
3398        htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format);
3399        call_tests++;
3400        des_xmlOutputBufferPtr(n_buf, buf, 0);
3401        des_xmlDocPtr(n_doc, doc, 1);
3402        des_xmlNodePtr(n_cur, cur, 2);
3403        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3404        des_int(n_format, format, 4);
3405        xmlResetLastError();
3406        if (mem_base != xmlMemBlocks()) {
3407            printf("Leak of %d blocks found in htmlNodeDumpFormatOutput",
3408	           xmlMemBlocks() - mem_base);
3409	    test_ret++;
3410            printf(" %d", n_buf);
3411            printf(" %d", n_doc);
3412            printf(" %d", n_cur);
3413            printf(" %d", n_encoding);
3414            printf(" %d", n_format);
3415            printf("\n");
3416        }
3417    }
3418    }
3419    }
3420    }
3421    }
3422    function_tests++;
3423#endif
3424
3425    return(test_ret);
3426}
3427
3428
3429static int
3430test_htmlNodeDumpOutput(void) {
3431    int test_ret = 0;
3432
3433#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3434    int mem_base;
3435    xmlOutputBufferPtr buf; /* the HTML buffer output */
3436    int n_buf;
3437    xmlDocPtr doc; /* the document */
3438    int n_doc;
3439    xmlNodePtr cur; /* the current node */
3440    int n_cur;
3441    char * encoding; /* the encoding string */
3442    int n_encoding;
3443
3444    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
3445    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
3446    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
3447    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3448        mem_base = xmlMemBlocks();
3449        buf = gen_xmlOutputBufferPtr(n_buf, 0);
3450        doc = gen_xmlDocPtr(n_doc, 1);
3451        cur = gen_xmlNodePtr(n_cur, 2);
3452        encoding = gen_const_char_ptr(n_encoding, 3);
3453
3454        htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding);
3455        call_tests++;
3456        des_xmlOutputBufferPtr(n_buf, buf, 0);
3457        des_xmlDocPtr(n_doc, doc, 1);
3458        des_xmlNodePtr(n_cur, cur, 2);
3459        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
3460        xmlResetLastError();
3461        if (mem_base != xmlMemBlocks()) {
3462            printf("Leak of %d blocks found in htmlNodeDumpOutput",
3463	           xmlMemBlocks() - mem_base);
3464	    test_ret++;
3465            printf(" %d", n_buf);
3466            printf(" %d", n_doc);
3467            printf(" %d", n_cur);
3468            printf(" %d", n_encoding);
3469            printf("\n");
3470        }
3471    }
3472    }
3473    }
3474    }
3475    function_tests++;
3476#endif
3477
3478    return(test_ret);
3479}
3480
3481
3482static int
3483test_htmlSaveFile(void) {
3484    int test_ret = 0;
3485
3486#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3487    int mem_base;
3488    int ret_val;
3489    const char * filename; /* the filename (or URL) */
3490    int n_filename;
3491    xmlDocPtr cur; /* the document */
3492    int n_cur;
3493
3494    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3495    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3496        mem_base = xmlMemBlocks();
3497        filename = gen_fileoutput(n_filename, 0);
3498        cur = gen_xmlDocPtr(n_cur, 1);
3499
3500        ret_val = htmlSaveFile(filename, cur);
3501        desret_int(ret_val);
3502        call_tests++;
3503        des_fileoutput(n_filename, filename, 0);
3504        des_xmlDocPtr(n_cur, cur, 1);
3505        xmlResetLastError();
3506        if (mem_base != xmlMemBlocks()) {
3507            printf("Leak of %d blocks found in htmlSaveFile",
3508	           xmlMemBlocks() - mem_base);
3509	    test_ret++;
3510            printf(" %d", n_filename);
3511            printf(" %d", n_cur);
3512            printf("\n");
3513        }
3514    }
3515    }
3516    function_tests++;
3517#endif
3518
3519    return(test_ret);
3520}
3521
3522
3523static int
3524test_htmlSaveFileEnc(void) {
3525    int test_ret = 0;
3526
3527#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3528    int mem_base;
3529    int ret_val;
3530    const char * filename; /* the filename */
3531    int n_filename;
3532    xmlDocPtr cur; /* the document */
3533    int n_cur;
3534    char * encoding; /* the document encoding */
3535    int n_encoding;
3536
3537    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3538    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3539    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3540        mem_base = xmlMemBlocks();
3541        filename = gen_fileoutput(n_filename, 0);
3542        cur = gen_xmlDocPtr(n_cur, 1);
3543        encoding = gen_const_char_ptr(n_encoding, 2);
3544
3545        ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding);
3546        desret_int(ret_val);
3547        call_tests++;
3548        des_fileoutput(n_filename, filename, 0);
3549        des_xmlDocPtr(n_cur, cur, 1);
3550        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3551        xmlResetLastError();
3552        if (mem_base != xmlMemBlocks()) {
3553            printf("Leak of %d blocks found in htmlSaveFileEnc",
3554	           xmlMemBlocks() - mem_base);
3555	    test_ret++;
3556            printf(" %d", n_filename);
3557            printf(" %d", n_cur);
3558            printf(" %d", n_encoding);
3559            printf("\n");
3560        }
3561    }
3562    }
3563    }
3564    function_tests++;
3565#endif
3566
3567    return(test_ret);
3568}
3569
3570
3571static int
3572test_htmlSaveFileFormat(void) {
3573    int test_ret = 0;
3574
3575#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
3576    int mem_base;
3577    int ret_val;
3578    const char * filename; /* the filename */
3579    int n_filename;
3580    xmlDocPtr cur; /* the document */
3581    int n_cur;
3582    char * encoding; /* the document encoding */
3583    int n_encoding;
3584    int format; /* should formatting spaces been added */
3585    int n_format;
3586
3587    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
3588    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
3589    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
3590    for (n_format = 0;n_format < gen_nb_int;n_format++) {
3591        mem_base = xmlMemBlocks();
3592        filename = gen_fileoutput(n_filename, 0);
3593        cur = gen_xmlDocPtr(n_cur, 1);
3594        encoding = gen_const_char_ptr(n_encoding, 2);
3595        format = gen_int(n_format, 3);
3596
3597        ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format);
3598        desret_int(ret_val);
3599        call_tests++;
3600        des_fileoutput(n_filename, filename, 0);
3601        des_xmlDocPtr(n_cur, cur, 1);
3602        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
3603        des_int(n_format, format, 3);
3604        xmlResetLastError();
3605        if (mem_base != xmlMemBlocks()) {
3606            printf("Leak of %d blocks found in htmlSaveFileFormat",
3607	           xmlMemBlocks() - mem_base);
3608	    test_ret++;
3609            printf(" %d", n_filename);
3610            printf(" %d", n_cur);
3611            printf(" %d", n_encoding);
3612            printf(" %d", n_format);
3613            printf("\n");
3614        }
3615    }
3616    }
3617    }
3618    }
3619    function_tests++;
3620#endif
3621
3622    return(test_ret);
3623}
3624
3625
3626static int
3627test_htmlSetMetaEncoding(void) {
3628    int test_ret = 0;
3629
3630#if defined(LIBXML_HTML_ENABLED)
3631    int mem_base;
3632    int ret_val;
3633    htmlDocPtr doc; /* the document */
3634    int n_doc;
3635    xmlChar * encoding; /* the encoding string */
3636    int n_encoding;
3637
3638    for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) {
3639    for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) {
3640        mem_base = xmlMemBlocks();
3641        doc = gen_htmlDocPtr(n_doc, 0);
3642        encoding = gen_const_xmlChar_ptr(n_encoding, 1);
3643
3644        ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding);
3645        desret_int(ret_val);
3646        call_tests++;
3647        des_htmlDocPtr(n_doc, doc, 0);
3648        des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1);
3649        xmlResetLastError();
3650        if (mem_base != xmlMemBlocks()) {
3651            printf("Leak of %d blocks found in htmlSetMetaEncoding",
3652	           xmlMemBlocks() - mem_base);
3653	    test_ret++;
3654            printf(" %d", n_doc);
3655            printf(" %d", n_encoding);
3656            printf("\n");
3657        }
3658    }
3659    }
3660    function_tests++;
3661#endif
3662
3663    return(test_ret);
3664}
3665
3666static int
3667test_HTMLtree(void) {
3668    int test_ret = 0;
3669
3670    if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n");
3671    test_ret += test_htmlDocContentDumpFormatOutput();
3672    test_ret += test_htmlDocContentDumpOutput();
3673    test_ret += test_htmlDocDump();
3674    test_ret += test_htmlDocDumpMemory();
3675    test_ret += test_htmlDocDumpMemoryFormat();
3676    test_ret += test_htmlGetMetaEncoding();
3677    test_ret += test_htmlIsBooleanAttr();
3678    test_ret += test_htmlNewDoc();
3679    test_ret += test_htmlNewDocNoDtD();
3680    test_ret += test_htmlNodeDump();
3681    test_ret += test_htmlNodeDumpFile();
3682    test_ret += test_htmlNodeDumpFileFormat();
3683    test_ret += test_htmlNodeDumpFormatOutput();
3684    test_ret += test_htmlNodeDumpOutput();
3685    test_ret += test_htmlSaveFile();
3686    test_ret += test_htmlSaveFileEnc();
3687    test_ret += test_htmlSaveFileFormat();
3688    test_ret += test_htmlSetMetaEncoding();
3689
3690    if (test_ret != 0)
3691	printf("Module HTMLtree: %d errors\n", test_ret);
3692    return(test_ret);
3693}
3694
3695static int
3696test_docbDefaultSAXHandlerInit(void) {
3697    int test_ret = 0;
3698
3699#if defined(LIBXML_DOCB_ENABLED)
3700#ifdef LIBXML_DOCB_ENABLED
3701    int mem_base;
3702
3703        mem_base = xmlMemBlocks();
3704
3705        docbDefaultSAXHandlerInit();
3706        call_tests++;
3707        xmlResetLastError();
3708        if (mem_base != xmlMemBlocks()) {
3709            printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
3710	           xmlMemBlocks() - mem_base);
3711	    test_ret++;
3712            printf("\n");
3713        }
3714    function_tests++;
3715#endif
3716#endif
3717
3718    return(test_ret);
3719}
3720
3721
3722static int
3723test_htmlDefaultSAXHandlerInit(void) {
3724    int test_ret = 0;
3725
3726#if defined(LIBXML_HTML_ENABLED)
3727#ifdef LIBXML_HTML_ENABLED
3728    int mem_base;
3729
3730        mem_base = xmlMemBlocks();
3731
3732        htmlDefaultSAXHandlerInit();
3733        call_tests++;
3734        xmlResetLastError();
3735        if (mem_base != xmlMemBlocks()) {
3736            printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit",
3737	           xmlMemBlocks() - mem_base);
3738	    test_ret++;
3739            printf("\n");
3740        }
3741    function_tests++;
3742#endif
3743#endif
3744
3745    return(test_ret);
3746}
3747
3748
3749static int
3750test_xmlDefaultSAXHandlerInit(void) {
3751    int test_ret = 0;
3752
3753    int mem_base;
3754
3755        mem_base = xmlMemBlocks();
3756
3757        xmlDefaultSAXHandlerInit();
3758        call_tests++;
3759        xmlResetLastError();
3760        if (mem_base != xmlMemBlocks()) {
3761            printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit",
3762	           xmlMemBlocks() - mem_base);
3763	    test_ret++;
3764            printf("\n");
3765        }
3766    function_tests++;
3767
3768    return(test_ret);
3769}
3770
3771
3772#define gen_nb_xmlEnumerationPtr 1
3773static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3774    return(NULL);
3775}
3776static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
3777}
3778
3779static int
3780test_xmlSAX2AttributeDecl(void) {
3781    int test_ret = 0;
3782
3783    int mem_base;
3784    void * ctx; /* the user data (XML parser context) */
3785    int n_ctx;
3786    xmlChar * elem; /* the name of the element */
3787    int n_elem;
3788    xmlChar * fullname; /* the attribute name */
3789    int n_fullname;
3790    int type; /* the attribute type */
3791    int n_type;
3792    int def; /* the type of default value */
3793    int n_def;
3794    xmlChar * defaultValue; /* the attribute default value */
3795    int n_defaultValue;
3796    xmlEnumerationPtr tree; /* the tree of enumerated value set */
3797    int n_tree;
3798
3799    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3800    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
3801    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
3802    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3803    for (n_def = 0;n_def < gen_nb_int;n_def++) {
3804    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
3805    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
3806        mem_base = xmlMemBlocks();
3807        ctx = gen_void_ptr(n_ctx, 0);
3808        elem = gen_const_xmlChar_ptr(n_elem, 1);
3809        fullname = gen_const_xmlChar_ptr(n_fullname, 2);
3810        type = gen_int(n_type, 3);
3811        def = gen_int(n_def, 4);
3812        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5);
3813        tree = gen_xmlEnumerationPtr(n_tree, 6);
3814
3815        xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree);
3816        call_tests++;
3817        des_void_ptr(n_ctx, ctx, 0);
3818        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
3819        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2);
3820        des_int(n_type, type, 3);
3821        des_int(n_def, def, 4);
3822        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5);
3823        des_xmlEnumerationPtr(n_tree, tree, 6);
3824        xmlResetLastError();
3825        if (mem_base != xmlMemBlocks()) {
3826            printf("Leak of %d blocks found in xmlSAX2AttributeDecl",
3827	           xmlMemBlocks() - mem_base);
3828	    test_ret++;
3829            printf(" %d", n_ctx);
3830            printf(" %d", n_elem);
3831            printf(" %d", n_fullname);
3832            printf(" %d", n_type);
3833            printf(" %d", n_def);
3834            printf(" %d", n_defaultValue);
3835            printf(" %d", n_tree);
3836            printf("\n");
3837        }
3838    }
3839    }
3840    }
3841    }
3842    }
3843    }
3844    }
3845    function_tests++;
3846
3847    return(test_ret);
3848}
3849
3850
3851static int
3852test_xmlSAX2CDataBlock(void) {
3853    int test_ret = 0;
3854
3855    int mem_base;
3856    void * ctx; /* the user data (XML parser context) */
3857    int n_ctx;
3858    xmlChar * value; /* The pcdata content */
3859    int n_value;
3860    int len; /* the block length */
3861    int n_len;
3862
3863    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3864    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3865    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3866        mem_base = xmlMemBlocks();
3867        ctx = gen_void_ptr(n_ctx, 0);
3868        value = gen_const_xmlChar_ptr(n_value, 1);
3869        len = gen_int(n_len, 2);
3870
3871        xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len);
3872        call_tests++;
3873        des_void_ptr(n_ctx, ctx, 0);
3874        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3875        des_int(n_len, len, 2);
3876        xmlResetLastError();
3877        if (mem_base != xmlMemBlocks()) {
3878            printf("Leak of %d blocks found in xmlSAX2CDataBlock",
3879	           xmlMemBlocks() - mem_base);
3880	    test_ret++;
3881            printf(" %d", n_ctx);
3882            printf(" %d", n_value);
3883            printf(" %d", n_len);
3884            printf("\n");
3885        }
3886    }
3887    }
3888    }
3889    function_tests++;
3890
3891    return(test_ret);
3892}
3893
3894
3895static int
3896test_xmlSAX2Characters(void) {
3897    int test_ret = 0;
3898
3899    int mem_base;
3900    void * ctx; /* the user data (XML parser context) */
3901    int n_ctx;
3902    xmlChar * ch; /* a xmlChar string */
3903    int n_ch;
3904    int len; /* the number of xmlChar */
3905    int n_len;
3906
3907    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3908    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
3909    for (n_len = 0;n_len < gen_nb_int;n_len++) {
3910        mem_base = xmlMemBlocks();
3911        ctx = gen_void_ptr(n_ctx, 0);
3912        ch = gen_const_xmlChar_ptr(n_ch, 1);
3913        len = gen_int(n_len, 2);
3914
3915        xmlSAX2Characters(ctx, (const xmlChar *)ch, len);
3916        call_tests++;
3917        des_void_ptr(n_ctx, ctx, 0);
3918        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
3919        des_int(n_len, len, 2);
3920        xmlResetLastError();
3921        if (mem_base != xmlMemBlocks()) {
3922            printf("Leak of %d blocks found in xmlSAX2Characters",
3923	           xmlMemBlocks() - mem_base);
3924	    test_ret++;
3925            printf(" %d", n_ctx);
3926            printf(" %d", n_ch);
3927            printf(" %d", n_len);
3928            printf("\n");
3929        }
3930    }
3931    }
3932    }
3933    function_tests++;
3934
3935    return(test_ret);
3936}
3937
3938
3939static int
3940test_xmlSAX2Comment(void) {
3941    int test_ret = 0;
3942
3943    int mem_base;
3944    void * ctx; /* the user data (XML parser context) */
3945    int n_ctx;
3946    xmlChar * value; /* the xmlSAX2Comment content */
3947    int n_value;
3948
3949    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3950    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
3951        mem_base = xmlMemBlocks();
3952        ctx = gen_void_ptr(n_ctx, 0);
3953        value = gen_const_xmlChar_ptr(n_value, 1);
3954
3955        xmlSAX2Comment(ctx, (const xmlChar *)value);
3956        call_tests++;
3957        des_void_ptr(n_ctx, ctx, 0);
3958        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
3959        xmlResetLastError();
3960        if (mem_base != xmlMemBlocks()) {
3961            printf("Leak of %d blocks found in xmlSAX2Comment",
3962	           xmlMemBlocks() - mem_base);
3963	    test_ret++;
3964            printf(" %d", n_ctx);
3965            printf(" %d", n_value);
3966            printf("\n");
3967        }
3968    }
3969    }
3970    function_tests++;
3971
3972    return(test_ret);
3973}
3974
3975
3976static int
3977test_xmlSAX2ElementDecl(void) {
3978    int test_ret = 0;
3979
3980    int mem_base;
3981    void * ctx; /* the user data (XML parser context) */
3982    int n_ctx;
3983    xmlChar * name; /* the element name */
3984    int n_name;
3985    int type; /* the element type */
3986    int n_type;
3987    xmlElementContentPtr content; /* the element value tree */
3988    int n_content;
3989
3990    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
3991    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
3992    for (n_type = 0;n_type < gen_nb_int;n_type++) {
3993    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
3994        mem_base = xmlMemBlocks();
3995        ctx = gen_void_ptr(n_ctx, 0);
3996        name = gen_const_xmlChar_ptr(n_name, 1);
3997        type = gen_int(n_type, 2);
3998        content = gen_xmlElementContentPtr(n_content, 3);
3999
4000        xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content);
4001        call_tests++;
4002        des_void_ptr(n_ctx, ctx, 0);
4003        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4004        des_int(n_type, type, 2);
4005        des_xmlElementContentPtr(n_content, content, 3);
4006        xmlResetLastError();
4007        if (mem_base != xmlMemBlocks()) {
4008            printf("Leak of %d blocks found in xmlSAX2ElementDecl",
4009	           xmlMemBlocks() - mem_base);
4010	    test_ret++;
4011            printf(" %d", n_ctx);
4012            printf(" %d", n_name);
4013            printf(" %d", n_type);
4014            printf(" %d", n_content);
4015            printf("\n");
4016        }
4017    }
4018    }
4019    }
4020    }
4021    function_tests++;
4022
4023    return(test_ret);
4024}
4025
4026
4027static int
4028test_xmlSAX2EndDocument(void) {
4029    int test_ret = 0;
4030
4031    int mem_base;
4032    void * ctx; /* the user data (XML parser context) */
4033    int n_ctx;
4034
4035    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4036        mem_base = xmlMemBlocks();
4037        ctx = gen_void_ptr(n_ctx, 0);
4038
4039        xmlSAX2EndDocument(ctx);
4040        call_tests++;
4041        des_void_ptr(n_ctx, ctx, 0);
4042        xmlResetLastError();
4043        if (mem_base != xmlMemBlocks()) {
4044            printf("Leak of %d blocks found in xmlSAX2EndDocument",
4045	           xmlMemBlocks() - mem_base);
4046	    test_ret++;
4047            printf(" %d", n_ctx);
4048            printf("\n");
4049        }
4050    }
4051    function_tests++;
4052
4053    return(test_ret);
4054}
4055
4056
4057static int
4058test_xmlSAX2EndElement(void) {
4059    int test_ret = 0;
4060
4061#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
4062#ifdef LIBXML_SAX1_ENABLED
4063    int mem_base;
4064    void * ctx; /* the user data (XML parser context) */
4065    int n_ctx;
4066    xmlChar * name; /* The element name */
4067    int n_name;
4068
4069    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4070    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4071        mem_base = xmlMemBlocks();
4072        ctx = gen_void_ptr(n_ctx, 0);
4073        name = gen_const_xmlChar_ptr(n_name, 1);
4074
4075        xmlSAX2EndElement(ctx, (const xmlChar *)name);
4076        call_tests++;
4077        des_void_ptr(n_ctx, ctx, 0);
4078        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4079        xmlResetLastError();
4080        if (mem_base != xmlMemBlocks()) {
4081            printf("Leak of %d blocks found in xmlSAX2EndElement",
4082	           xmlMemBlocks() - mem_base);
4083	    test_ret++;
4084            printf(" %d", n_ctx);
4085            printf(" %d", n_name);
4086            printf("\n");
4087        }
4088    }
4089    }
4090    function_tests++;
4091#endif
4092#endif
4093
4094    return(test_ret);
4095}
4096
4097
4098static int
4099test_xmlSAX2EndElementNs(void) {
4100    int test_ret = 0;
4101
4102    int mem_base;
4103    void * ctx; /* the user data (XML parser context) */
4104    int n_ctx;
4105    xmlChar * localname; /* the local name of the element */
4106    int n_localname;
4107    xmlChar * prefix; /* the element namespace prefix if available */
4108    int n_prefix;
4109    xmlChar * URI; /* the element namespace name if available */
4110    int n_URI;
4111
4112    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4113    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
4114    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
4115    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
4116        mem_base = xmlMemBlocks();
4117        ctx = gen_void_ptr(n_ctx, 0);
4118        localname = gen_const_xmlChar_ptr(n_localname, 1);
4119        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
4120        URI = gen_const_xmlChar_ptr(n_URI, 3);
4121
4122        xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI);
4123        call_tests++;
4124        des_void_ptr(n_ctx, ctx, 0);
4125        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
4126        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
4127        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
4128        xmlResetLastError();
4129        if (mem_base != xmlMemBlocks()) {
4130            printf("Leak of %d blocks found in xmlSAX2EndElementNs",
4131	           xmlMemBlocks() - mem_base);
4132	    test_ret++;
4133            printf(" %d", n_ctx);
4134            printf(" %d", n_localname);
4135            printf(" %d", n_prefix);
4136            printf(" %d", n_URI);
4137            printf("\n");
4138        }
4139    }
4140    }
4141    }
4142    }
4143    function_tests++;
4144
4145    return(test_ret);
4146}
4147
4148
4149static int
4150test_xmlSAX2EntityDecl(void) {
4151    int test_ret = 0;
4152
4153    int mem_base;
4154    void * ctx; /* the user data (XML parser context) */
4155    int n_ctx;
4156    xmlChar * name; /* the entity name */
4157    int n_name;
4158    int type; /* the entity type */
4159    int n_type;
4160    xmlChar * publicId; /* The public ID of the entity */
4161    int n_publicId;
4162    xmlChar * systemId; /* The system ID of the entity */
4163    int n_systemId;
4164    xmlChar * content; /* the entity value (without processing). */
4165    int n_content;
4166
4167    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4168    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4169    for (n_type = 0;n_type < gen_nb_int;n_type++) {
4170    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4171    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4172    for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) {
4173        mem_base = xmlMemBlocks();
4174        ctx = gen_void_ptr(n_ctx, 0);
4175        name = gen_const_xmlChar_ptr(n_name, 1);
4176        type = gen_int(n_type, 2);
4177        publicId = gen_const_xmlChar_ptr(n_publicId, 3);
4178        systemId = gen_const_xmlChar_ptr(n_systemId, 4);
4179        content = gen_xmlChar_ptr(n_content, 5);
4180
4181        xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content);
4182        call_tests++;
4183        des_void_ptr(n_ctx, ctx, 0);
4184        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4185        des_int(n_type, type, 2);
4186        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3);
4187        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4);
4188        des_xmlChar_ptr(n_content, content, 5);
4189        xmlResetLastError();
4190        if (mem_base != xmlMemBlocks()) {
4191            printf("Leak of %d blocks found in xmlSAX2EntityDecl",
4192	           xmlMemBlocks() - mem_base);
4193	    test_ret++;
4194            printf(" %d", n_ctx);
4195            printf(" %d", n_name);
4196            printf(" %d", n_type);
4197            printf(" %d", n_publicId);
4198            printf(" %d", n_systemId);
4199            printf(" %d", n_content);
4200            printf("\n");
4201        }
4202    }
4203    }
4204    }
4205    }
4206    }
4207    }
4208    function_tests++;
4209
4210    return(test_ret);
4211}
4212
4213
4214static int
4215test_xmlSAX2ExternalSubset(void) {
4216    int test_ret = 0;
4217
4218    int mem_base;
4219    void * ctx; /* the user data (XML parser context) */
4220    int n_ctx;
4221    xmlChar * name; /* the root element name */
4222    int n_name;
4223    xmlChar * ExternalID; /* the external ID */
4224    int n_ExternalID;
4225    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4226    int n_SystemID;
4227
4228    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4229    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4230    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4231    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4232        mem_base = xmlMemBlocks();
4233        ctx = gen_void_ptr(n_ctx, 0);
4234        name = gen_const_xmlChar_ptr(n_name, 1);
4235        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4236        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4237
4238        xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4239        call_tests++;
4240        des_void_ptr(n_ctx, ctx, 0);
4241        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4242        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4243        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4244        xmlResetLastError();
4245        if (mem_base != xmlMemBlocks()) {
4246            printf("Leak of %d blocks found in xmlSAX2ExternalSubset",
4247	           xmlMemBlocks() - mem_base);
4248	    test_ret++;
4249            printf(" %d", n_ctx);
4250            printf(" %d", n_name);
4251            printf(" %d", n_ExternalID);
4252            printf(" %d", n_SystemID);
4253            printf("\n");
4254        }
4255    }
4256    }
4257    }
4258    }
4259    function_tests++;
4260
4261    return(test_ret);
4262}
4263
4264
4265static int
4266test_xmlSAX2GetColumnNumber(void) {
4267    int test_ret = 0;
4268
4269    int mem_base;
4270    int ret_val;
4271    void * ctx; /* the user data (XML parser context) */
4272    int n_ctx;
4273
4274    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4275        mem_base = xmlMemBlocks();
4276        ctx = gen_void_ptr(n_ctx, 0);
4277
4278        ret_val = xmlSAX2GetColumnNumber(ctx);
4279        desret_int(ret_val);
4280        call_tests++;
4281        des_void_ptr(n_ctx, ctx, 0);
4282        xmlResetLastError();
4283        if (mem_base != xmlMemBlocks()) {
4284            printf("Leak of %d blocks found in xmlSAX2GetColumnNumber",
4285	           xmlMemBlocks() - mem_base);
4286	    test_ret++;
4287            printf(" %d", n_ctx);
4288            printf("\n");
4289        }
4290    }
4291    function_tests++;
4292
4293    return(test_ret);
4294}
4295
4296
4297static int
4298test_xmlSAX2GetEntity(void) {
4299    int test_ret = 0;
4300
4301    int mem_base;
4302    xmlEntityPtr ret_val;
4303    void * ctx; /* the user data (XML parser context) */
4304    int n_ctx;
4305    xmlChar * name; /* The entity name */
4306    int n_name;
4307
4308    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4309    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4310        mem_base = xmlMemBlocks();
4311        ctx = gen_void_ptr(n_ctx, 0);
4312        name = gen_const_xmlChar_ptr(n_name, 1);
4313
4314        ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name);
4315        desret_xmlEntityPtr(ret_val);
4316        call_tests++;
4317        des_void_ptr(n_ctx, ctx, 0);
4318        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4319        xmlResetLastError();
4320        if (mem_base != xmlMemBlocks()) {
4321            printf("Leak of %d blocks found in xmlSAX2GetEntity",
4322	           xmlMemBlocks() - mem_base);
4323	    test_ret++;
4324            printf(" %d", n_ctx);
4325            printf(" %d", n_name);
4326            printf("\n");
4327        }
4328    }
4329    }
4330    function_tests++;
4331
4332    return(test_ret);
4333}
4334
4335
4336static int
4337test_xmlSAX2GetLineNumber(void) {
4338    int test_ret = 0;
4339
4340    int mem_base;
4341    int ret_val;
4342    void * ctx; /* the user data (XML parser context) */
4343    int n_ctx;
4344
4345    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4346        mem_base = xmlMemBlocks();
4347        ctx = gen_void_ptr(n_ctx, 0);
4348
4349        ret_val = xmlSAX2GetLineNumber(ctx);
4350        desret_int(ret_val);
4351        call_tests++;
4352        des_void_ptr(n_ctx, ctx, 0);
4353        xmlResetLastError();
4354        if (mem_base != xmlMemBlocks()) {
4355            printf("Leak of %d blocks found in xmlSAX2GetLineNumber",
4356	           xmlMemBlocks() - mem_base);
4357	    test_ret++;
4358            printf(" %d", n_ctx);
4359            printf("\n");
4360        }
4361    }
4362    function_tests++;
4363
4364    return(test_ret);
4365}
4366
4367
4368static int
4369test_xmlSAX2GetParameterEntity(void) {
4370    int test_ret = 0;
4371
4372    int mem_base;
4373    xmlEntityPtr ret_val;
4374    void * ctx; /* the user data (XML parser context) */
4375    int n_ctx;
4376    xmlChar * name; /* The entity name */
4377    int n_name;
4378
4379    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4380    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4381        mem_base = xmlMemBlocks();
4382        ctx = gen_void_ptr(n_ctx, 0);
4383        name = gen_const_xmlChar_ptr(n_name, 1);
4384
4385        ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name);
4386        desret_xmlEntityPtr(ret_val);
4387        call_tests++;
4388        des_void_ptr(n_ctx, ctx, 0);
4389        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4390        xmlResetLastError();
4391        if (mem_base != xmlMemBlocks()) {
4392            printf("Leak of %d blocks found in xmlSAX2GetParameterEntity",
4393	           xmlMemBlocks() - mem_base);
4394	    test_ret++;
4395            printf(" %d", n_ctx);
4396            printf(" %d", n_name);
4397            printf("\n");
4398        }
4399    }
4400    }
4401    function_tests++;
4402
4403    return(test_ret);
4404}
4405
4406
4407static int
4408test_xmlSAX2GetPublicId(void) {
4409    int test_ret = 0;
4410
4411    int mem_base;
4412    const xmlChar * ret_val;
4413    void * ctx; /* the user data (XML parser context) */
4414    int n_ctx;
4415
4416    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4417        mem_base = xmlMemBlocks();
4418        ctx = gen_void_ptr(n_ctx, 0);
4419
4420        ret_val = xmlSAX2GetPublicId(ctx);
4421        desret_const_xmlChar_ptr(ret_val);
4422        call_tests++;
4423        des_void_ptr(n_ctx, ctx, 0);
4424        xmlResetLastError();
4425        if (mem_base != xmlMemBlocks()) {
4426            printf("Leak of %d blocks found in xmlSAX2GetPublicId",
4427	           xmlMemBlocks() - mem_base);
4428	    test_ret++;
4429            printf(" %d", n_ctx);
4430            printf("\n");
4431        }
4432    }
4433    function_tests++;
4434
4435    return(test_ret);
4436}
4437
4438
4439static int
4440test_xmlSAX2GetSystemId(void) {
4441    int test_ret = 0;
4442
4443    int mem_base;
4444    const xmlChar * ret_val;
4445    void * ctx; /* the user data (XML parser context) */
4446    int n_ctx;
4447
4448    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4449        mem_base = xmlMemBlocks();
4450        ctx = gen_void_ptr(n_ctx, 0);
4451
4452        ret_val = xmlSAX2GetSystemId(ctx);
4453        desret_const_xmlChar_ptr(ret_val);
4454        call_tests++;
4455        des_void_ptr(n_ctx, ctx, 0);
4456        xmlResetLastError();
4457        if (mem_base != xmlMemBlocks()) {
4458            printf("Leak of %d blocks found in xmlSAX2GetSystemId",
4459	           xmlMemBlocks() - mem_base);
4460	    test_ret++;
4461            printf(" %d", n_ctx);
4462            printf("\n");
4463        }
4464    }
4465    function_tests++;
4466
4467    return(test_ret);
4468}
4469
4470
4471static int
4472test_xmlSAX2HasExternalSubset(void) {
4473    int test_ret = 0;
4474
4475    int mem_base;
4476    int ret_val;
4477    void * ctx; /* the user data (XML parser context) */
4478    int n_ctx;
4479
4480    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4481        mem_base = xmlMemBlocks();
4482        ctx = gen_void_ptr(n_ctx, 0);
4483
4484        ret_val = xmlSAX2HasExternalSubset(ctx);
4485        desret_int(ret_val);
4486        call_tests++;
4487        des_void_ptr(n_ctx, ctx, 0);
4488        xmlResetLastError();
4489        if (mem_base != xmlMemBlocks()) {
4490            printf("Leak of %d blocks found in xmlSAX2HasExternalSubset",
4491	           xmlMemBlocks() - mem_base);
4492	    test_ret++;
4493            printf(" %d", n_ctx);
4494            printf("\n");
4495        }
4496    }
4497    function_tests++;
4498
4499    return(test_ret);
4500}
4501
4502
4503static int
4504test_xmlSAX2HasInternalSubset(void) {
4505    int test_ret = 0;
4506
4507    int mem_base;
4508    int ret_val;
4509    void * ctx; /* the user data (XML parser context) */
4510    int n_ctx;
4511
4512    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4513        mem_base = xmlMemBlocks();
4514        ctx = gen_void_ptr(n_ctx, 0);
4515
4516        ret_val = xmlSAX2HasInternalSubset(ctx);
4517        desret_int(ret_val);
4518        call_tests++;
4519        des_void_ptr(n_ctx, ctx, 0);
4520        xmlResetLastError();
4521        if (mem_base != xmlMemBlocks()) {
4522            printf("Leak of %d blocks found in xmlSAX2HasInternalSubset",
4523	           xmlMemBlocks() - mem_base);
4524	    test_ret++;
4525            printf(" %d", n_ctx);
4526            printf("\n");
4527        }
4528    }
4529    function_tests++;
4530
4531    return(test_ret);
4532}
4533
4534
4535static int
4536test_xmlSAX2IgnorableWhitespace(void) {
4537    int test_ret = 0;
4538
4539    int mem_base;
4540    void * ctx; /* the user data (XML parser context) */
4541    int n_ctx;
4542    xmlChar * ch; /* a xmlChar string */
4543    int n_ch;
4544    int len; /* the number of xmlChar */
4545    int n_len;
4546
4547    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4548    for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) {
4549    for (n_len = 0;n_len < gen_nb_int;n_len++) {
4550        mem_base = xmlMemBlocks();
4551        ctx = gen_void_ptr(n_ctx, 0);
4552        ch = gen_const_xmlChar_ptr(n_ch, 1);
4553        len = gen_int(n_len, 2);
4554
4555        xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len);
4556        call_tests++;
4557        des_void_ptr(n_ctx, ctx, 0);
4558        des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1);
4559        des_int(n_len, len, 2);
4560        xmlResetLastError();
4561        if (mem_base != xmlMemBlocks()) {
4562            printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace",
4563	           xmlMemBlocks() - mem_base);
4564	    test_ret++;
4565            printf(" %d", n_ctx);
4566            printf(" %d", n_ch);
4567            printf(" %d", n_len);
4568            printf("\n");
4569        }
4570    }
4571    }
4572    }
4573    function_tests++;
4574
4575    return(test_ret);
4576}
4577
4578
4579#define gen_nb_xmlSAXHandler_ptr 1
4580static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4581    return(NULL);
4582}
4583static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4584}
4585
4586static int
4587test_xmlSAX2InitDefaultSAXHandler(void) {
4588    int test_ret = 0;
4589
4590    int mem_base;
4591    xmlSAXHandler * hdlr; /* the SAX handler */
4592    int n_hdlr;
4593    int warning; /* flag if non-zero sets the handler warning procedure */
4594    int n_warning;
4595
4596    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4597    for (n_warning = 0;n_warning < gen_nb_int;n_warning++) {
4598        mem_base = xmlMemBlocks();
4599        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4600        warning = gen_int(n_warning, 1);
4601
4602        xmlSAX2InitDefaultSAXHandler(hdlr, warning);
4603        call_tests++;
4604        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4605        des_int(n_warning, warning, 1);
4606        xmlResetLastError();
4607        if (mem_base != xmlMemBlocks()) {
4608            printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler",
4609	           xmlMemBlocks() - mem_base);
4610	    test_ret++;
4611            printf(" %d", n_hdlr);
4612            printf(" %d", n_warning);
4613            printf("\n");
4614        }
4615    }
4616    }
4617    function_tests++;
4618
4619    return(test_ret);
4620}
4621
4622
4623static int
4624test_xmlSAX2InitDocbDefaultSAXHandler(void) {
4625    int test_ret = 0;
4626
4627#if defined(LIBXML_DOCB_ENABLED)
4628    int mem_base;
4629    xmlSAXHandler * hdlr; /* the SAX handler */
4630    int n_hdlr;
4631
4632    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4633        mem_base = xmlMemBlocks();
4634        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4635
4636        xmlSAX2InitDocbDefaultSAXHandler(hdlr);
4637        call_tests++;
4638        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4639        xmlResetLastError();
4640        if (mem_base != xmlMemBlocks()) {
4641            printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
4642	           xmlMemBlocks() - mem_base);
4643	    test_ret++;
4644            printf(" %d", n_hdlr);
4645            printf("\n");
4646        }
4647    }
4648    function_tests++;
4649#endif
4650
4651    return(test_ret);
4652}
4653
4654
4655static int
4656test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
4657    int test_ret = 0;
4658
4659#if defined(LIBXML_HTML_ENABLED)
4660    int mem_base;
4661    xmlSAXHandler * hdlr; /* the SAX handler */
4662    int n_hdlr;
4663
4664    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
4665        mem_base = xmlMemBlocks();
4666        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
4667
4668        xmlSAX2InitHtmlDefaultSAXHandler(hdlr);
4669        call_tests++;
4670        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
4671        xmlResetLastError();
4672        if (mem_base != xmlMemBlocks()) {
4673            printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler",
4674	           xmlMemBlocks() - mem_base);
4675	    test_ret++;
4676            printf(" %d", n_hdlr);
4677            printf("\n");
4678        }
4679    }
4680    function_tests++;
4681#endif
4682
4683    return(test_ret);
4684}
4685
4686
4687static int
4688test_xmlSAX2InternalSubset(void) {
4689    int test_ret = 0;
4690
4691    int mem_base;
4692    void * ctx; /* the user data (XML parser context) */
4693    int n_ctx;
4694    xmlChar * name; /* the root element name */
4695    int n_name;
4696    xmlChar * ExternalID; /* the external ID */
4697    int n_ExternalID;
4698    xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */
4699    int n_SystemID;
4700
4701    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4702    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4703    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
4704    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
4705        mem_base = xmlMemBlocks();
4706        ctx = gen_void_ptr(n_ctx, 0);
4707        name = gen_const_xmlChar_ptr(n_name, 1);
4708        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
4709        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
4710
4711        xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
4712        call_tests++;
4713        des_void_ptr(n_ctx, ctx, 0);
4714        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4715        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
4716        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
4717        xmlResetLastError();
4718        if (mem_base != xmlMemBlocks()) {
4719            printf("Leak of %d blocks found in xmlSAX2InternalSubset",
4720	           xmlMemBlocks() - mem_base);
4721	    test_ret++;
4722            printf(" %d", n_ctx);
4723            printf(" %d", n_name);
4724            printf(" %d", n_ExternalID);
4725            printf(" %d", n_SystemID);
4726            printf("\n");
4727        }
4728    }
4729    }
4730    }
4731    }
4732    function_tests++;
4733
4734    return(test_ret);
4735}
4736
4737
4738static int
4739test_xmlSAX2IsStandalone(void) {
4740    int test_ret = 0;
4741
4742    int mem_base;
4743    int ret_val;
4744    void * ctx; /* the user data (XML parser context) */
4745    int n_ctx;
4746
4747    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4748        mem_base = xmlMemBlocks();
4749        ctx = gen_void_ptr(n_ctx, 0);
4750
4751        ret_val = xmlSAX2IsStandalone(ctx);
4752        desret_int(ret_val);
4753        call_tests++;
4754        des_void_ptr(n_ctx, ctx, 0);
4755        xmlResetLastError();
4756        if (mem_base != xmlMemBlocks()) {
4757            printf("Leak of %d blocks found in xmlSAX2IsStandalone",
4758	           xmlMemBlocks() - mem_base);
4759	    test_ret++;
4760            printf(" %d", n_ctx);
4761            printf("\n");
4762        }
4763    }
4764    function_tests++;
4765
4766    return(test_ret);
4767}
4768
4769
4770static int
4771test_xmlSAX2NotationDecl(void) {
4772    int test_ret = 0;
4773
4774    int mem_base;
4775    void * ctx; /* the user data (XML parser context) */
4776    int n_ctx;
4777    xmlChar * name; /* The name of the notation */
4778    int n_name;
4779    xmlChar * publicId; /* The public ID of the entity */
4780    int n_publicId;
4781    xmlChar * systemId; /* The system ID of the entity */
4782    int n_systemId;
4783
4784    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4785    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4786    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4787    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4788        mem_base = xmlMemBlocks();
4789        ctx = gen_void_ptr(n_ctx, 0);
4790        name = gen_const_xmlChar_ptr(n_name, 1);
4791        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
4792        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
4793
4794        xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId);
4795        call_tests++;
4796        des_void_ptr(n_ctx, ctx, 0);
4797        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4798        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
4799        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
4800        xmlResetLastError();
4801        if (mem_base != xmlMemBlocks()) {
4802            printf("Leak of %d blocks found in xmlSAX2NotationDecl",
4803	           xmlMemBlocks() - mem_base);
4804	    test_ret++;
4805            printf(" %d", n_ctx);
4806            printf(" %d", n_name);
4807            printf(" %d", n_publicId);
4808            printf(" %d", n_systemId);
4809            printf("\n");
4810        }
4811    }
4812    }
4813    }
4814    }
4815    function_tests++;
4816
4817    return(test_ret);
4818}
4819
4820
4821static int
4822test_xmlSAX2ProcessingInstruction(void) {
4823    int test_ret = 0;
4824
4825    int mem_base;
4826    void * ctx; /* the user data (XML parser context) */
4827    int n_ctx;
4828    xmlChar * target; /* the target name */
4829    int n_target;
4830    xmlChar * data; /* the PI data's */
4831    int n_data;
4832
4833    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4834    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
4835    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
4836        mem_base = xmlMemBlocks();
4837        ctx = gen_void_ptr(n_ctx, 0);
4838        target = gen_const_xmlChar_ptr(n_target, 1);
4839        data = gen_const_xmlChar_ptr(n_data, 2);
4840
4841        xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data);
4842        call_tests++;
4843        des_void_ptr(n_ctx, ctx, 0);
4844        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
4845        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2);
4846        xmlResetLastError();
4847        if (mem_base != xmlMemBlocks()) {
4848            printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction",
4849	           xmlMemBlocks() - mem_base);
4850	    test_ret++;
4851            printf(" %d", n_ctx);
4852            printf(" %d", n_target);
4853            printf(" %d", n_data);
4854            printf("\n");
4855        }
4856    }
4857    }
4858    }
4859    function_tests++;
4860
4861    return(test_ret);
4862}
4863
4864
4865static int
4866test_xmlSAX2Reference(void) {
4867    int test_ret = 0;
4868
4869    int mem_base;
4870    void * ctx; /* the user data (XML parser context) */
4871    int n_ctx;
4872    xmlChar * name; /* The entity name */
4873    int n_name;
4874
4875    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4876    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
4877        mem_base = xmlMemBlocks();
4878        ctx = gen_void_ptr(n_ctx, 0);
4879        name = gen_const_xmlChar_ptr(n_name, 1);
4880
4881        xmlSAX2Reference(ctx, (const xmlChar *)name);
4882        call_tests++;
4883        des_void_ptr(n_ctx, ctx, 0);
4884        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
4885        xmlResetLastError();
4886        if (mem_base != xmlMemBlocks()) {
4887            printf("Leak of %d blocks found in xmlSAX2Reference",
4888	           xmlMemBlocks() - mem_base);
4889	    test_ret++;
4890            printf(" %d", n_ctx);
4891            printf(" %d", n_name);
4892            printf("\n");
4893        }
4894    }
4895    }
4896    function_tests++;
4897
4898    return(test_ret);
4899}
4900
4901
4902static int
4903test_xmlSAX2ResolveEntity(void) {
4904    int test_ret = 0;
4905
4906    int mem_base;
4907    xmlParserInputPtr ret_val;
4908    void * ctx; /* the user data (XML parser context) */
4909    int n_ctx;
4910    xmlChar * publicId; /* The public ID of the entity */
4911    int n_publicId;
4912    xmlChar * systemId; /* The system ID of the entity */
4913    int n_systemId;
4914
4915    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4916    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
4917    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
4918        mem_base = xmlMemBlocks();
4919        ctx = gen_void_ptr(n_ctx, 0);
4920        publicId = gen_const_xmlChar_ptr(n_publicId, 1);
4921        systemId = gen_const_xmlChar_ptr(n_systemId, 2);
4922
4923        ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId);
4924        desret_xmlParserInputPtr(ret_val);
4925        call_tests++;
4926        des_void_ptr(n_ctx, ctx, 0);
4927        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1);
4928        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2);
4929        xmlResetLastError();
4930        if (mem_base != xmlMemBlocks()) {
4931            printf("Leak of %d blocks found in xmlSAX2ResolveEntity",
4932	           xmlMemBlocks() - mem_base);
4933	    test_ret++;
4934            printf(" %d", n_ctx);
4935            printf(" %d", n_publicId);
4936            printf(" %d", n_systemId);
4937            printf("\n");
4938        }
4939    }
4940    }
4941    }
4942    function_tests++;
4943
4944    return(test_ret);
4945}
4946
4947
4948#define gen_nb_xmlSAXLocatorPtr 1
4949static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4950    return(NULL);
4951}
4952static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
4953}
4954
4955static int
4956test_xmlSAX2SetDocumentLocator(void) {
4957    int test_ret = 0;
4958
4959    int mem_base;
4960    void * ctx; /* the user data (XML parser context) */
4961    int n_ctx;
4962    xmlSAXLocatorPtr loc; /* A SAX Locator */
4963    int n_loc;
4964
4965    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
4966    for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) {
4967        mem_base = xmlMemBlocks();
4968        ctx = gen_void_ptr(n_ctx, 0);
4969        loc = gen_xmlSAXLocatorPtr(n_loc, 1);
4970
4971        xmlSAX2SetDocumentLocator(ctx, loc);
4972        call_tests++;
4973        des_void_ptr(n_ctx, ctx, 0);
4974        des_xmlSAXLocatorPtr(n_loc, loc, 1);
4975        xmlResetLastError();
4976        if (mem_base != xmlMemBlocks()) {
4977            printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator",
4978	           xmlMemBlocks() - mem_base);
4979	    test_ret++;
4980            printf(" %d", n_ctx);
4981            printf(" %d", n_loc);
4982            printf("\n");
4983        }
4984    }
4985    }
4986    function_tests++;
4987
4988    return(test_ret);
4989}
4990
4991
4992static int
4993test_xmlSAX2StartDocument(void) {
4994    int test_ret = 0;
4995
4996    int mem_base;
4997    void * ctx; /* the user data (XML parser context) */
4998    int n_ctx;
4999
5000    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5001        mem_base = xmlMemBlocks();
5002        ctx = gen_void_ptr(n_ctx, 0);
5003
5004        xmlSAX2StartDocument(ctx);
5005        call_tests++;
5006        des_void_ptr(n_ctx, ctx, 0);
5007        xmlResetLastError();
5008        if (mem_base != xmlMemBlocks()) {
5009            printf("Leak of %d blocks found in xmlSAX2StartDocument",
5010	           xmlMemBlocks() - mem_base);
5011	    test_ret++;
5012            printf(" %d", n_ctx);
5013            printf("\n");
5014        }
5015    }
5016    function_tests++;
5017
5018    return(test_ret);
5019}
5020
5021
5022static int
5023test_xmlSAX2StartElement(void) {
5024    int test_ret = 0;
5025
5026#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
5027#ifdef LIBXML_SAX1_ENABLED
5028    int mem_base;
5029    void * ctx; /* the user data (XML parser context) */
5030    int n_ctx;
5031    xmlChar * fullname; /* The element name, including namespace prefix */
5032    int n_fullname;
5033    xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */
5034    int n_atts;
5035
5036    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5037    for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) {
5038    for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) {
5039        mem_base = xmlMemBlocks();
5040        ctx = gen_void_ptr(n_ctx, 0);
5041        fullname = gen_const_xmlChar_ptr(n_fullname, 1);
5042        atts = gen_const_xmlChar_ptr_ptr(n_atts, 2);
5043
5044        xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts);
5045        call_tests++;
5046        des_void_ptr(n_ctx, ctx, 0);
5047        des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1);
5048        des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2);
5049        xmlResetLastError();
5050        if (mem_base != xmlMemBlocks()) {
5051            printf("Leak of %d blocks found in xmlSAX2StartElement",
5052	           xmlMemBlocks() - mem_base);
5053	    test_ret++;
5054            printf(" %d", n_ctx);
5055            printf(" %d", n_fullname);
5056            printf(" %d", n_atts);
5057            printf("\n");
5058        }
5059    }
5060    }
5061    }
5062    function_tests++;
5063#endif
5064#endif
5065
5066    return(test_ret);
5067}
5068
5069
5070static int
5071test_xmlSAX2StartElementNs(void) {
5072    int test_ret = 0;
5073
5074    int mem_base;
5075    void * ctx; /* the user data (XML parser context) */
5076    int n_ctx;
5077    xmlChar * localname; /* the local name of the element */
5078    int n_localname;
5079    xmlChar * prefix; /* the element namespace prefix if available */
5080    int n_prefix;
5081    xmlChar * URI; /* the element namespace name if available */
5082    int n_URI;
5083    int nb_namespaces; /* number of namespace definitions on that node */
5084    int n_nb_namespaces;
5085    xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */
5086    int n_namespaces;
5087    int nb_attributes; /* the number of attributes on that node */
5088    int n_nb_attributes;
5089    int nb_defaulted; /* the number of defaulted attributes. */
5090    int n_nb_defaulted;
5091    xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */
5092    int n_attributes;
5093
5094    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5095    for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) {
5096    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
5097    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5098    for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) {
5099    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
5100    for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) {
5101    for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) {
5102    for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) {
5103        mem_base = xmlMemBlocks();
5104        ctx = gen_void_ptr(n_ctx, 0);
5105        localname = gen_const_xmlChar_ptr(n_localname, 1);
5106        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
5107        URI = gen_const_xmlChar_ptr(n_URI, 3);
5108        nb_namespaces = gen_int(n_nb_namespaces, 4);
5109        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5);
5110        nb_attributes = gen_int(n_nb_attributes, 6);
5111        nb_defaulted = gen_int(n_nb_defaulted, 7);
5112        attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8);
5113
5114        xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes);
5115        call_tests++;
5116        des_void_ptr(n_ctx, ctx, 0);
5117        des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1);
5118        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
5119        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3);
5120        des_int(n_nb_namespaces, nb_namespaces, 4);
5121        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5);
5122        des_int(n_nb_attributes, nb_attributes, 6);
5123        des_int(n_nb_defaulted, nb_defaulted, 7);
5124        des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8);
5125        xmlResetLastError();
5126        if (mem_base != xmlMemBlocks()) {
5127            printf("Leak of %d blocks found in xmlSAX2StartElementNs",
5128	           xmlMemBlocks() - mem_base);
5129	    test_ret++;
5130            printf(" %d", n_ctx);
5131            printf(" %d", n_localname);
5132            printf(" %d", n_prefix);
5133            printf(" %d", n_URI);
5134            printf(" %d", n_nb_namespaces);
5135            printf(" %d", n_namespaces);
5136            printf(" %d", n_nb_attributes);
5137            printf(" %d", n_nb_defaulted);
5138            printf(" %d", n_attributes);
5139            printf("\n");
5140        }
5141    }
5142    }
5143    }
5144    }
5145    }
5146    }
5147    }
5148    }
5149    }
5150    function_tests++;
5151
5152    return(test_ret);
5153}
5154
5155
5156static int
5157test_xmlSAX2UnparsedEntityDecl(void) {
5158    int test_ret = 0;
5159
5160    int mem_base;
5161    void * ctx; /* the user data (XML parser context) */
5162    int n_ctx;
5163    xmlChar * name; /* The name of the entity */
5164    int n_name;
5165    xmlChar * publicId; /* The public ID of the entity */
5166    int n_publicId;
5167    xmlChar * systemId; /* The system ID of the entity */
5168    int n_systemId;
5169    xmlChar * notationName; /* the name of the notation */
5170    int n_notationName;
5171
5172    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
5173    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
5174    for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) {
5175    for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) {
5176    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
5177        mem_base = xmlMemBlocks();
5178        ctx = gen_void_ptr(n_ctx, 0);
5179        name = gen_const_xmlChar_ptr(n_name, 1);
5180        publicId = gen_const_xmlChar_ptr(n_publicId, 2);
5181        systemId = gen_const_xmlChar_ptr(n_systemId, 3);
5182        notationName = gen_const_xmlChar_ptr(n_notationName, 4);
5183
5184        xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName);
5185        call_tests++;
5186        des_void_ptr(n_ctx, ctx, 0);
5187        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
5188        des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2);
5189        des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3);
5190        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4);
5191        xmlResetLastError();
5192        if (mem_base != xmlMemBlocks()) {
5193            printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl",
5194	           xmlMemBlocks() - mem_base);
5195	    test_ret++;
5196            printf(" %d", n_ctx);
5197            printf(" %d", n_name);
5198            printf(" %d", n_publicId);
5199            printf(" %d", n_systemId);
5200            printf(" %d", n_notationName);
5201            printf("\n");
5202        }
5203    }
5204    }
5205    }
5206    }
5207    }
5208    function_tests++;
5209
5210    return(test_ret);
5211}
5212
5213
5214static int
5215test_xmlSAXDefaultVersion(void) {
5216    int test_ret = 0;
5217
5218#if defined(LIBXML_SAX1_ENABLED)
5219#ifdef LIBXML_SAX1_ENABLED
5220    int mem_base;
5221    int ret_val;
5222    int version; /* the version, 1 or 2 */
5223    int n_version;
5224
5225    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5226        mem_base = xmlMemBlocks();
5227        version = gen_int(n_version, 0);
5228
5229        ret_val = xmlSAXDefaultVersion(version);
5230        desret_int(ret_val);
5231        call_tests++;
5232        des_int(n_version, version, 0);
5233        xmlResetLastError();
5234        if (mem_base != xmlMemBlocks()) {
5235            printf("Leak of %d blocks found in xmlSAXDefaultVersion",
5236	           xmlMemBlocks() - mem_base);
5237	    test_ret++;
5238            printf(" %d", n_version);
5239            printf("\n");
5240        }
5241    }
5242    function_tests++;
5243#endif
5244#endif
5245
5246    return(test_ret);
5247}
5248
5249
5250static int
5251test_xmlSAXVersion(void) {
5252    int test_ret = 0;
5253
5254    int mem_base;
5255    int ret_val;
5256    xmlSAXHandler * hdlr; /* the SAX handler */
5257    int n_hdlr;
5258    int version; /* the version, 1 or 2 */
5259    int n_version;
5260
5261    for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
5262    for (n_version = 0;n_version < gen_nb_int;n_version++) {
5263        mem_base = xmlMemBlocks();
5264        hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
5265        version = gen_int(n_version, 1);
5266
5267        ret_val = xmlSAXVersion(hdlr, version);
5268        desret_int(ret_val);
5269        call_tests++;
5270        des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
5271        des_int(n_version, version, 1);
5272        xmlResetLastError();
5273        if (mem_base != xmlMemBlocks()) {
5274            printf("Leak of %d blocks found in xmlSAXVersion",
5275	           xmlMemBlocks() - mem_base);
5276	    test_ret++;
5277            printf(" %d", n_hdlr);
5278            printf(" %d", n_version);
5279            printf("\n");
5280        }
5281    }
5282    }
5283    function_tests++;
5284
5285    return(test_ret);
5286}
5287
5288static int
5289test_SAX2(void) {
5290    int test_ret = 0;
5291
5292    if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
5293    test_ret += test_docbDefaultSAXHandlerInit();
5294    test_ret += test_htmlDefaultSAXHandlerInit();
5295    test_ret += test_xmlDefaultSAXHandlerInit();
5296    test_ret += test_xmlSAX2AttributeDecl();
5297    test_ret += test_xmlSAX2CDataBlock();
5298    test_ret += test_xmlSAX2Characters();
5299    test_ret += test_xmlSAX2Comment();
5300    test_ret += test_xmlSAX2ElementDecl();
5301    test_ret += test_xmlSAX2EndDocument();
5302    test_ret += test_xmlSAX2EndElement();
5303    test_ret += test_xmlSAX2EndElementNs();
5304    test_ret += test_xmlSAX2EntityDecl();
5305    test_ret += test_xmlSAX2ExternalSubset();
5306    test_ret += test_xmlSAX2GetColumnNumber();
5307    test_ret += test_xmlSAX2GetEntity();
5308    test_ret += test_xmlSAX2GetLineNumber();
5309    test_ret += test_xmlSAX2GetParameterEntity();
5310    test_ret += test_xmlSAX2GetPublicId();
5311    test_ret += test_xmlSAX2GetSystemId();
5312    test_ret += test_xmlSAX2HasExternalSubset();
5313    test_ret += test_xmlSAX2HasInternalSubset();
5314    test_ret += test_xmlSAX2IgnorableWhitespace();
5315    test_ret += test_xmlSAX2InitDefaultSAXHandler();
5316    test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
5317    test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
5318    test_ret += test_xmlSAX2InternalSubset();
5319    test_ret += test_xmlSAX2IsStandalone();
5320    test_ret += test_xmlSAX2NotationDecl();
5321    test_ret += test_xmlSAX2ProcessingInstruction();
5322    test_ret += test_xmlSAX2Reference();
5323    test_ret += test_xmlSAX2ResolveEntity();
5324    test_ret += test_xmlSAX2SetDocumentLocator();
5325    test_ret += test_xmlSAX2StartDocument();
5326    test_ret += test_xmlSAX2StartElement();
5327    test_ret += test_xmlSAX2StartElementNs();
5328    test_ret += test_xmlSAX2UnparsedEntityDecl();
5329    test_ret += test_xmlSAXDefaultVersion();
5330    test_ret += test_xmlSAXVersion();
5331
5332    if (test_ret != 0)
5333	printf("Module SAX2: %d errors\n", test_ret);
5334    return(test_ret);
5335}
5336
5337static int
5338test_xmlC14NDocDumpMemory(void) {
5339    int test_ret = 0;
5340
5341#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5342    int mem_base;
5343    int ret_val;
5344    xmlDocPtr doc; /* the XML document for canonization */
5345    int n_doc;
5346    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5347    int n_nodes;
5348    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5349    int n_exclusive;
5350    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) */
5351    int n_inclusive_ns_prefixes;
5352    int with_comments; /* include comments in the result (!=0) or not (==0) */
5353    int n_with_comments;
5354    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 */
5355    int n_doc_txt_ptr;
5356
5357    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5358    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5359    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5360    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5361    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5362    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
5363        mem_base = xmlMemBlocks();
5364        doc = gen_xmlDocPtr(n_doc, 0);
5365        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5366        exclusive = gen_int(n_exclusive, 2);
5367        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5368        with_comments = gen_int(n_with_comments, 4);
5369        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5);
5370
5371        ret_val = xmlC14NDocDumpMemory(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, doc_txt_ptr);
5372        desret_int(ret_val);
5373        call_tests++;
5374        des_xmlDocPtr(n_doc, doc, 0);
5375        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5376        des_int(n_exclusive, exclusive, 2);
5377        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5378        des_int(n_with_comments, with_comments, 4);
5379        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5);
5380        xmlResetLastError();
5381        if (mem_base != xmlMemBlocks()) {
5382            printf("Leak of %d blocks found in xmlC14NDocDumpMemory",
5383	           xmlMemBlocks() - mem_base);
5384	    test_ret++;
5385            printf(" %d", n_doc);
5386            printf(" %d", n_nodes);
5387            printf(" %d", n_exclusive);
5388            printf(" %d", n_inclusive_ns_prefixes);
5389            printf(" %d", n_with_comments);
5390            printf(" %d", n_doc_txt_ptr);
5391            printf("\n");
5392        }
5393    }
5394    }
5395    }
5396    }
5397    }
5398    }
5399    function_tests++;
5400#endif
5401
5402    return(test_ret);
5403}
5404
5405
5406static int
5407test_xmlC14NDocSave(void) {
5408    int test_ret = 0;
5409
5410#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5411    int mem_base;
5412    int ret_val;
5413    xmlDocPtr doc; /* the XML document for canonization */
5414    int n_doc;
5415    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5416    int n_nodes;
5417    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5418    int n_exclusive;
5419    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) */
5420    int n_inclusive_ns_prefixes;
5421    int with_comments; /* include comments in the result (!=0) or not (==0) */
5422    int n_with_comments;
5423    const char * filename; /* the filename to store canonical XML image */
5424    int n_filename;
5425    int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */
5426    int n_compression;
5427
5428    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5429    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5430    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5431    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5432    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5433    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
5434    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
5435        mem_base = xmlMemBlocks();
5436        doc = gen_xmlDocPtr(n_doc, 0);
5437        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5438        exclusive = gen_int(n_exclusive, 2);
5439        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5440        with_comments = gen_int(n_with_comments, 4);
5441        filename = gen_fileoutput(n_filename, 5);
5442        compression = gen_int(n_compression, 6);
5443
5444        ret_val = xmlC14NDocSave(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, filename, compression);
5445        desret_int(ret_val);
5446        call_tests++;
5447        des_xmlDocPtr(n_doc, doc, 0);
5448        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5449        des_int(n_exclusive, exclusive, 2);
5450        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5451        des_int(n_with_comments, with_comments, 4);
5452        des_fileoutput(n_filename, filename, 5);
5453        des_int(n_compression, compression, 6);
5454        xmlResetLastError();
5455        if (mem_base != xmlMemBlocks()) {
5456            printf("Leak of %d blocks found in xmlC14NDocSave",
5457	           xmlMemBlocks() - mem_base);
5458	    test_ret++;
5459            printf(" %d", n_doc);
5460            printf(" %d", n_nodes);
5461            printf(" %d", n_exclusive);
5462            printf(" %d", n_inclusive_ns_prefixes);
5463            printf(" %d", n_with_comments);
5464            printf(" %d", n_filename);
5465            printf(" %d", n_compression);
5466            printf("\n");
5467        }
5468    }
5469    }
5470    }
5471    }
5472    }
5473    }
5474    }
5475    function_tests++;
5476#endif
5477
5478    return(test_ret);
5479}
5480
5481
5482static int
5483test_xmlC14NDocSaveTo(void) {
5484    int test_ret = 0;
5485
5486#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5487    int mem_base;
5488    int ret_val;
5489    xmlDocPtr doc; /* the XML document for canonization */
5490    int n_doc;
5491    xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */
5492    int n_nodes;
5493    int exclusive; /* the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization) */
5494    int n_exclusive;
5495    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) */
5496    int n_inclusive_ns_prefixes;
5497    int with_comments; /* include comments in the result (!=0) or not (==0) */
5498    int n_with_comments;
5499    xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */
5500    int n_buf;
5501
5502    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
5503    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
5504    for (n_exclusive = 0;n_exclusive < gen_nb_int;n_exclusive++) {
5505    for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) {
5506    for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) {
5507    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
5508        mem_base = xmlMemBlocks();
5509        doc = gen_xmlDocPtr(n_doc, 0);
5510        nodes = gen_xmlNodeSetPtr(n_nodes, 1);
5511        exclusive = gen_int(n_exclusive, 2);
5512        inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3);
5513        with_comments = gen_int(n_with_comments, 4);
5514        buf = gen_xmlOutputBufferPtr(n_buf, 5);
5515
5516        ret_val = xmlC14NDocSaveTo(doc, nodes, exclusive, inclusive_ns_prefixes, with_comments, buf);
5517        desret_int(ret_val);
5518        call_tests++;
5519        des_xmlDocPtr(n_doc, doc, 0);
5520        des_xmlNodeSetPtr(n_nodes, nodes, 1);
5521        des_int(n_exclusive, exclusive, 2);
5522        des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3);
5523        des_int(n_with_comments, with_comments, 4);
5524        des_xmlOutputBufferPtr(n_buf, buf, 5);
5525        xmlResetLastError();
5526        if (mem_base != xmlMemBlocks()) {
5527            printf("Leak of %d blocks found in xmlC14NDocSaveTo",
5528	           xmlMemBlocks() - mem_base);
5529	    test_ret++;
5530            printf(" %d", n_doc);
5531            printf(" %d", n_nodes);
5532            printf(" %d", n_exclusive);
5533            printf(" %d", n_inclusive_ns_prefixes);
5534            printf(" %d", n_with_comments);
5535            printf(" %d", n_buf);
5536            printf("\n");
5537        }
5538    }
5539    }
5540    }
5541    }
5542    }
5543    }
5544    function_tests++;
5545#endif
5546
5547    return(test_ret);
5548}
5549
5550
5551static int
5552test_xmlC14NExecute(void) {
5553    int test_ret = 0;
5554
5555
5556    /* missing type support */
5557    return(test_ret);
5558}
5559
5560static int
5561test_c14n(void) {
5562    int test_ret = 0;
5563
5564    if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n");
5565    test_ret += test_xmlC14NDocDumpMemory();
5566    test_ret += test_xmlC14NDocSave();
5567    test_ret += test_xmlC14NDocSaveTo();
5568    test_ret += test_xmlC14NExecute();
5569
5570    if (test_ret != 0)
5571	printf("Module c14n: %d errors\n", test_ret);
5572    return(test_ret);
5573}
5574#ifdef LIBXML_CATALOG_ENABLED
5575
5576#define gen_nb_xmlCatalogPtr 1
5577static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5578    return(NULL);
5579}
5580static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
5581}
5582#endif
5583
5584
5585static int
5586test_xmlACatalogAdd(void) {
5587    int test_ret = 0;
5588
5589#if defined(LIBXML_CATALOG_ENABLED)
5590    int mem_base;
5591    int ret_val;
5592    xmlCatalogPtr catal; /* a Catalog */
5593    int n_catal;
5594    xmlChar * type; /* the type of record to add to the catalog */
5595    int n_type;
5596    xmlChar * orig; /* the system, public or prefix to match */
5597    int n_orig;
5598    xmlChar * replace; /* the replacement value for the match */
5599    int n_replace;
5600
5601    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5602    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5603    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5604    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5605        mem_base = xmlMemBlocks();
5606        catal = gen_xmlCatalogPtr(n_catal, 0);
5607        type = gen_const_xmlChar_ptr(n_type, 1);
5608        orig = gen_const_xmlChar_ptr(n_orig, 2);
5609        replace = gen_const_xmlChar_ptr(n_replace, 3);
5610
5611        ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5612        desret_int(ret_val);
5613        call_tests++;
5614        des_xmlCatalogPtr(n_catal, catal, 0);
5615        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1);
5616        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2);
5617        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3);
5618        xmlResetLastError();
5619        if (mem_base != xmlMemBlocks()) {
5620            printf("Leak of %d blocks found in xmlACatalogAdd",
5621	           xmlMemBlocks() - mem_base);
5622	    test_ret++;
5623            printf(" %d", n_catal);
5624            printf(" %d", n_type);
5625            printf(" %d", n_orig);
5626            printf(" %d", n_replace);
5627            printf("\n");
5628        }
5629    }
5630    }
5631    }
5632    }
5633    function_tests++;
5634#endif
5635
5636    return(test_ret);
5637}
5638
5639
5640static int
5641test_xmlACatalogDump(void) {
5642    int test_ret = 0;
5643
5644#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5645    int mem_base;
5646    xmlCatalogPtr catal; /* a Catalog */
5647    int n_catal;
5648    FILE * out; /* the file. */
5649    int n_out;
5650
5651    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5652    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5653        mem_base = xmlMemBlocks();
5654        catal = gen_xmlCatalogPtr(n_catal, 0);
5655        out = gen_FILE_ptr(n_out, 1);
5656
5657        xmlACatalogDump(catal, out);
5658        call_tests++;
5659        des_xmlCatalogPtr(n_catal, catal, 0);
5660        des_FILE_ptr(n_out, out, 1);
5661        xmlResetLastError();
5662        if (mem_base != xmlMemBlocks()) {
5663            printf("Leak of %d blocks found in xmlACatalogDump",
5664	           xmlMemBlocks() - mem_base);
5665	    test_ret++;
5666            printf(" %d", n_catal);
5667            printf(" %d", n_out);
5668            printf("\n");
5669        }
5670    }
5671    }
5672    function_tests++;
5673#endif
5674
5675    return(test_ret);
5676}
5677
5678
5679static int
5680test_xmlACatalogRemove(void) {
5681    int test_ret = 0;
5682
5683#if defined(LIBXML_CATALOG_ENABLED)
5684    int mem_base;
5685    int ret_val;
5686    xmlCatalogPtr catal; /* a Catalog */
5687    int n_catal;
5688    xmlChar * value; /* the value to remove */
5689    int n_value;
5690
5691    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5692    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
5693        mem_base = xmlMemBlocks();
5694        catal = gen_xmlCatalogPtr(n_catal, 0);
5695        value = gen_const_xmlChar_ptr(n_value, 1);
5696
5697        ret_val = xmlACatalogRemove(catal, (const xmlChar *)value);
5698        desret_int(ret_val);
5699        call_tests++;
5700        des_xmlCatalogPtr(n_catal, catal, 0);
5701        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
5702        xmlResetLastError();
5703        if (mem_base != xmlMemBlocks()) {
5704            printf("Leak of %d blocks found in xmlACatalogRemove",
5705	           xmlMemBlocks() - mem_base);
5706	    test_ret++;
5707            printf(" %d", n_catal);
5708            printf(" %d", n_value);
5709            printf("\n");
5710        }
5711    }
5712    }
5713    function_tests++;
5714#endif
5715
5716    return(test_ret);
5717}
5718
5719
5720static int
5721test_xmlACatalogResolve(void) {
5722    int test_ret = 0;
5723
5724#if defined(LIBXML_CATALOG_ENABLED)
5725    int mem_base;
5726    xmlChar * ret_val;
5727    xmlCatalogPtr catal; /* a Catalog */
5728    int n_catal;
5729    xmlChar * pubID; /* the public ID string */
5730    int n_pubID;
5731    xmlChar * sysID; /* the system ID string */
5732    int n_sysID;
5733
5734    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5735    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5736    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5737        mem_base = xmlMemBlocks();
5738        catal = gen_xmlCatalogPtr(n_catal, 0);
5739        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5740        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
5741
5742        ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID);
5743        desret_xmlChar_ptr(ret_val);
5744        call_tests++;
5745        des_xmlCatalogPtr(n_catal, catal, 0);
5746        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5747        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
5748        xmlResetLastError();
5749        if (mem_base != xmlMemBlocks()) {
5750            printf("Leak of %d blocks found in xmlACatalogResolve",
5751	           xmlMemBlocks() - mem_base);
5752	    test_ret++;
5753            printf(" %d", n_catal);
5754            printf(" %d", n_pubID);
5755            printf(" %d", n_sysID);
5756            printf("\n");
5757        }
5758    }
5759    }
5760    }
5761    function_tests++;
5762#endif
5763
5764    return(test_ret);
5765}
5766
5767
5768static int
5769test_xmlACatalogResolvePublic(void) {
5770    int test_ret = 0;
5771
5772#if defined(LIBXML_CATALOG_ENABLED)
5773    int mem_base;
5774    xmlChar * ret_val;
5775    xmlCatalogPtr catal; /* a Catalog */
5776    int n_catal;
5777    xmlChar * pubID; /* the public ID string */
5778    int n_pubID;
5779
5780    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5781    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
5782        mem_base = xmlMemBlocks();
5783        catal = gen_xmlCatalogPtr(n_catal, 0);
5784        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
5785
5786        ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID);
5787        desret_xmlChar_ptr(ret_val);
5788        call_tests++;
5789        des_xmlCatalogPtr(n_catal, catal, 0);
5790        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
5791        xmlResetLastError();
5792        if (mem_base != xmlMemBlocks()) {
5793            printf("Leak of %d blocks found in xmlACatalogResolvePublic",
5794	           xmlMemBlocks() - mem_base);
5795	    test_ret++;
5796            printf(" %d", n_catal);
5797            printf(" %d", n_pubID);
5798            printf("\n");
5799        }
5800    }
5801    }
5802    function_tests++;
5803#endif
5804
5805    return(test_ret);
5806}
5807
5808
5809static int
5810test_xmlACatalogResolveSystem(void) {
5811    int test_ret = 0;
5812
5813#if defined(LIBXML_CATALOG_ENABLED)
5814    int mem_base;
5815    xmlChar * ret_val;
5816    xmlCatalogPtr catal; /* a Catalog */
5817    int n_catal;
5818    xmlChar * sysID; /* the system ID string */
5819    int n_sysID;
5820
5821    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5822    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
5823        mem_base = xmlMemBlocks();
5824        catal = gen_xmlCatalogPtr(n_catal, 0);
5825        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
5826
5827        ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID);
5828        desret_xmlChar_ptr(ret_val);
5829        call_tests++;
5830        des_xmlCatalogPtr(n_catal, catal, 0);
5831        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
5832        xmlResetLastError();
5833        if (mem_base != xmlMemBlocks()) {
5834            printf("Leak of %d blocks found in xmlACatalogResolveSystem",
5835	           xmlMemBlocks() - mem_base);
5836	    test_ret++;
5837            printf(" %d", n_catal);
5838            printf(" %d", n_sysID);
5839            printf("\n");
5840        }
5841    }
5842    }
5843    function_tests++;
5844#endif
5845
5846    return(test_ret);
5847}
5848
5849
5850static int
5851test_xmlACatalogResolveURI(void) {
5852    int test_ret = 0;
5853
5854#if defined(LIBXML_CATALOG_ENABLED)
5855    int mem_base;
5856    xmlChar * ret_val;
5857    xmlCatalogPtr catal; /* a Catalog */
5858    int n_catal;
5859    xmlChar * URI; /* the URI */
5860    int n_URI;
5861
5862    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
5863    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
5864        mem_base = xmlMemBlocks();
5865        catal = gen_xmlCatalogPtr(n_catal, 0);
5866        URI = gen_const_xmlChar_ptr(n_URI, 1);
5867
5868        ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI);
5869        desret_xmlChar_ptr(ret_val);
5870        call_tests++;
5871        des_xmlCatalogPtr(n_catal, catal, 0);
5872        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
5873        xmlResetLastError();
5874        if (mem_base != xmlMemBlocks()) {
5875            printf("Leak of %d blocks found in xmlACatalogResolveURI",
5876	           xmlMemBlocks() - mem_base);
5877	    test_ret++;
5878            printf(" %d", n_catal);
5879            printf(" %d", n_URI);
5880            printf("\n");
5881        }
5882    }
5883    }
5884    function_tests++;
5885#endif
5886
5887    return(test_ret);
5888}
5889
5890
5891static int
5892test_xmlCatalogAdd(void) {
5893    int test_ret = 0;
5894
5895#if defined(LIBXML_CATALOG_ENABLED)
5896    int mem_base;
5897    int ret_val;
5898    xmlChar * type; /* the type of record to add to the catalog */
5899    int n_type;
5900    xmlChar * orig; /* the system, public or prefix to match */
5901    int n_orig;
5902    xmlChar * replace; /* the replacement value for the match */
5903    int n_replace;
5904
5905    for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) {
5906    for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) {
5907    for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) {
5908        mem_base = xmlMemBlocks();
5909        type = gen_const_xmlChar_ptr(n_type, 0);
5910        orig = gen_const_xmlChar_ptr(n_orig, 1);
5911        replace = gen_const_xmlChar_ptr(n_replace, 2);
5912
5913        ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace);
5914        desret_int(ret_val);
5915        call_tests++;
5916        des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0);
5917        des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1);
5918        des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2);
5919        xmlResetLastError();
5920        if (mem_base != xmlMemBlocks()) {
5921            printf("Leak of %d blocks found in xmlCatalogAdd",
5922	           xmlMemBlocks() - mem_base);
5923	    test_ret++;
5924            printf(" %d", n_type);
5925            printf(" %d", n_orig);
5926            printf(" %d", n_replace);
5927            printf("\n");
5928        }
5929    }
5930    }
5931    }
5932    function_tests++;
5933#endif
5934
5935    return(test_ret);
5936}
5937
5938
5939static int
5940test_xmlCatalogCleanup(void) {
5941    int test_ret = 0;
5942
5943#if defined(LIBXML_CATALOG_ENABLED)
5944
5945
5946        xmlCatalogCleanup();
5947        call_tests++;
5948        xmlResetLastError();
5949    function_tests++;
5950#endif
5951
5952    return(test_ret);
5953}
5954
5955
5956static int
5957test_xmlCatalogConvert(void) {
5958    int test_ret = 0;
5959
5960#if defined(LIBXML_CATALOG_ENABLED)
5961    int ret_val;
5962
5963
5964        ret_val = xmlCatalogConvert();
5965        desret_int(ret_val);
5966        call_tests++;
5967        xmlResetLastError();
5968    function_tests++;
5969#endif
5970
5971    return(test_ret);
5972}
5973
5974
5975static int
5976test_xmlCatalogDump(void) {
5977    int test_ret = 0;
5978
5979#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
5980    int mem_base;
5981    FILE * out; /* the file. */
5982    int n_out;
5983
5984    for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) {
5985        mem_base = xmlMemBlocks();
5986        out = gen_FILE_ptr(n_out, 0);
5987
5988        xmlCatalogDump(out);
5989        call_tests++;
5990        des_FILE_ptr(n_out, out, 0);
5991        xmlResetLastError();
5992        if (mem_base != xmlMemBlocks()) {
5993            printf("Leak of %d blocks found in xmlCatalogDump",
5994	           xmlMemBlocks() - mem_base);
5995	    test_ret++;
5996            printf(" %d", n_out);
5997            printf("\n");
5998        }
5999    }
6000    function_tests++;
6001#endif
6002
6003    return(test_ret);
6004}
6005
6006
6007static int
6008test_xmlCatalogGetDefaults(void) {
6009    int test_ret = 0;
6010
6011#if defined(LIBXML_CATALOG_ENABLED)
6012    int mem_base;
6013    xmlCatalogAllow ret_val;
6014
6015        mem_base = xmlMemBlocks();
6016
6017        ret_val = xmlCatalogGetDefaults();
6018        desret_xmlCatalogAllow(ret_val);
6019        call_tests++;
6020        xmlResetLastError();
6021        if (mem_base != xmlMemBlocks()) {
6022            printf("Leak of %d blocks found in xmlCatalogGetDefaults",
6023	           xmlMemBlocks() - mem_base);
6024	    test_ret++;
6025            printf("\n");
6026        }
6027    function_tests++;
6028#endif
6029
6030    return(test_ret);
6031}
6032
6033
6034static int
6035test_xmlCatalogIsEmpty(void) {
6036    int test_ret = 0;
6037
6038#if defined(LIBXML_CATALOG_ENABLED)
6039    int mem_base;
6040    int ret_val;
6041    xmlCatalogPtr catal; /* should this create an SGML catalog */
6042    int n_catal;
6043
6044    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6045        mem_base = xmlMemBlocks();
6046        catal = gen_xmlCatalogPtr(n_catal, 0);
6047
6048        ret_val = xmlCatalogIsEmpty(catal);
6049        desret_int(ret_val);
6050        call_tests++;
6051        des_xmlCatalogPtr(n_catal, catal, 0);
6052        xmlResetLastError();
6053        if (mem_base != xmlMemBlocks()) {
6054            printf("Leak of %d blocks found in xmlCatalogIsEmpty",
6055	           xmlMemBlocks() - mem_base);
6056	    test_ret++;
6057            printf(" %d", n_catal);
6058            printf("\n");
6059        }
6060    }
6061    function_tests++;
6062#endif
6063
6064    return(test_ret);
6065}
6066
6067
6068static int
6069test_xmlCatalogLocalResolve(void) {
6070    int test_ret = 0;
6071
6072#if defined(LIBXML_CATALOG_ENABLED)
6073    int mem_base;
6074    xmlChar * ret_val;
6075    void * catalogs; /* a document's list of catalogs */
6076    int n_catalogs;
6077    xmlChar * pubID; /* the public ID string */
6078    int n_pubID;
6079    xmlChar * sysID; /* the system ID string */
6080    int n_sysID;
6081
6082    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6083    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6084    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6085        mem_base = xmlMemBlocks();
6086        catalogs = gen_void_ptr(n_catalogs, 0);
6087        pubID = gen_const_xmlChar_ptr(n_pubID, 1);
6088        sysID = gen_const_xmlChar_ptr(n_sysID, 2);
6089
6090        ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID);
6091        desret_xmlChar_ptr(ret_val);
6092        call_tests++;
6093        des_void_ptr(n_catalogs, catalogs, 0);
6094        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1);
6095        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2);
6096        xmlResetLastError();
6097        if (mem_base != xmlMemBlocks()) {
6098            printf("Leak of %d blocks found in xmlCatalogLocalResolve",
6099	           xmlMemBlocks() - mem_base);
6100	    test_ret++;
6101            printf(" %d", n_catalogs);
6102            printf(" %d", n_pubID);
6103            printf(" %d", n_sysID);
6104            printf("\n");
6105        }
6106    }
6107    }
6108    }
6109    function_tests++;
6110#endif
6111
6112    return(test_ret);
6113}
6114
6115
6116static int
6117test_xmlCatalogLocalResolveURI(void) {
6118    int test_ret = 0;
6119
6120#if defined(LIBXML_CATALOG_ENABLED)
6121    int mem_base;
6122    xmlChar * ret_val;
6123    void * catalogs; /* a document's list of catalogs */
6124    int n_catalogs;
6125    xmlChar * URI; /* the URI */
6126    int n_URI;
6127
6128    for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) {
6129    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6130        mem_base = xmlMemBlocks();
6131        catalogs = gen_void_ptr(n_catalogs, 0);
6132        URI = gen_const_xmlChar_ptr(n_URI, 1);
6133
6134        ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI);
6135        desret_xmlChar_ptr(ret_val);
6136        call_tests++;
6137        des_void_ptr(n_catalogs, catalogs, 0);
6138        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1);
6139        xmlResetLastError();
6140        if (mem_base != xmlMemBlocks()) {
6141            printf("Leak of %d blocks found in xmlCatalogLocalResolveURI",
6142	           xmlMemBlocks() - mem_base);
6143	    test_ret++;
6144            printf(" %d", n_catalogs);
6145            printf(" %d", n_URI);
6146            printf("\n");
6147        }
6148    }
6149    }
6150    function_tests++;
6151#endif
6152
6153    return(test_ret);
6154}
6155
6156
6157static int
6158test_xmlCatalogRemove(void) {
6159    int test_ret = 0;
6160
6161#if defined(LIBXML_CATALOG_ENABLED)
6162    int ret_val;
6163    xmlChar * value; /* the value to remove */
6164    int n_value;
6165
6166    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
6167        value = gen_const_xmlChar_ptr(n_value, 0);
6168
6169        ret_val = xmlCatalogRemove((const xmlChar *)value);
6170        desret_int(ret_val);
6171        call_tests++;
6172        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
6173        xmlResetLastError();
6174    }
6175    function_tests++;
6176#endif
6177
6178    return(test_ret);
6179}
6180
6181
6182static int
6183test_xmlCatalogResolve(void) {
6184    int test_ret = 0;
6185
6186#if defined(LIBXML_CATALOG_ENABLED)
6187    xmlChar * ret_val;
6188    xmlChar * pubID; /* the public ID string */
6189    int n_pubID;
6190    xmlChar * sysID; /* the system ID string */
6191    int n_sysID;
6192
6193    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6194    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6195        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6196        sysID = gen_const_xmlChar_ptr(n_sysID, 1);
6197
6198        ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID);
6199        desret_xmlChar_ptr(ret_val);
6200        call_tests++;
6201        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6202        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
6203        xmlResetLastError();
6204    }
6205    }
6206    function_tests++;
6207#endif
6208
6209    return(test_ret);
6210}
6211
6212
6213static int
6214test_xmlCatalogResolvePublic(void) {
6215    int test_ret = 0;
6216
6217#if defined(LIBXML_CATALOG_ENABLED)
6218    int mem_base;
6219    xmlChar * ret_val;
6220    xmlChar * pubID; /* the public ID string */
6221    int n_pubID;
6222
6223    for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
6224        mem_base = xmlMemBlocks();
6225        pubID = gen_const_xmlChar_ptr(n_pubID, 0);
6226
6227        ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID);
6228        desret_xmlChar_ptr(ret_val);
6229        call_tests++;
6230        des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
6231        xmlResetLastError();
6232        if (mem_base != xmlMemBlocks()) {
6233            printf("Leak of %d blocks found in xmlCatalogResolvePublic",
6234	           xmlMemBlocks() - mem_base);
6235	    test_ret++;
6236            printf(" %d", n_pubID);
6237            printf("\n");
6238        }
6239    }
6240    function_tests++;
6241#endif
6242
6243    return(test_ret);
6244}
6245
6246
6247static int
6248test_xmlCatalogResolveSystem(void) {
6249    int test_ret = 0;
6250
6251#if defined(LIBXML_CATALOG_ENABLED)
6252    int mem_base;
6253    xmlChar * ret_val;
6254    xmlChar * sysID; /* the system ID string */
6255    int n_sysID;
6256
6257    for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
6258        mem_base = xmlMemBlocks();
6259        sysID = gen_const_xmlChar_ptr(n_sysID, 0);
6260
6261        ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID);
6262        desret_xmlChar_ptr(ret_val);
6263        call_tests++;
6264        des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0);
6265        xmlResetLastError();
6266        if (mem_base != xmlMemBlocks()) {
6267            printf("Leak of %d blocks found in xmlCatalogResolveSystem",
6268	           xmlMemBlocks() - mem_base);
6269	    test_ret++;
6270            printf(" %d", n_sysID);
6271            printf("\n");
6272        }
6273    }
6274    function_tests++;
6275#endif
6276
6277    return(test_ret);
6278}
6279
6280
6281static int
6282test_xmlCatalogResolveURI(void) {
6283    int test_ret = 0;
6284
6285#if defined(LIBXML_CATALOG_ENABLED)
6286    int mem_base;
6287    xmlChar * ret_val;
6288    xmlChar * URI; /* the URI */
6289    int n_URI;
6290
6291    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
6292        mem_base = xmlMemBlocks();
6293        URI = gen_const_xmlChar_ptr(n_URI, 0);
6294
6295        ret_val = xmlCatalogResolveURI((const xmlChar *)URI);
6296        desret_xmlChar_ptr(ret_val);
6297        call_tests++;
6298        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
6299        xmlResetLastError();
6300        if (mem_base != xmlMemBlocks()) {
6301            printf("Leak of %d blocks found in xmlCatalogResolveURI",
6302	           xmlMemBlocks() - mem_base);
6303	    test_ret++;
6304            printf(" %d", n_URI);
6305            printf("\n");
6306        }
6307    }
6308    function_tests++;
6309#endif
6310
6311    return(test_ret);
6312}
6313
6314
6315static int
6316test_xmlCatalogSetDefaultPrefer(void) {
6317    int test_ret = 0;
6318
6319#if defined(LIBXML_CATALOG_ENABLED)
6320    int mem_base;
6321    xmlCatalogPrefer ret_val;
6322    xmlCatalogPrefer prefer; /* the default preference for delegation */
6323    int n_prefer;
6324
6325    for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) {
6326        mem_base = xmlMemBlocks();
6327        prefer = gen_xmlCatalogPrefer(n_prefer, 0);
6328
6329        ret_val = xmlCatalogSetDefaultPrefer(prefer);
6330        desret_xmlCatalogPrefer(ret_val);
6331        call_tests++;
6332        des_xmlCatalogPrefer(n_prefer, prefer, 0);
6333        xmlResetLastError();
6334        if (mem_base != xmlMemBlocks()) {
6335            printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer",
6336	           xmlMemBlocks() - mem_base);
6337	    test_ret++;
6338            printf(" %d", n_prefer);
6339            printf("\n");
6340        }
6341    }
6342    function_tests++;
6343#endif
6344
6345    return(test_ret);
6346}
6347
6348
6349static int
6350test_xmlCatalogSetDefaults(void) {
6351    int test_ret = 0;
6352
6353#if defined(LIBXML_CATALOG_ENABLED)
6354    int mem_base;
6355    xmlCatalogAllow allow; /* what catalogs should be accepted */
6356    int n_allow;
6357
6358    for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) {
6359        mem_base = xmlMemBlocks();
6360        allow = gen_xmlCatalogAllow(n_allow, 0);
6361
6362        xmlCatalogSetDefaults(allow);
6363        call_tests++;
6364        des_xmlCatalogAllow(n_allow, allow, 0);
6365        xmlResetLastError();
6366        if (mem_base != xmlMemBlocks()) {
6367            printf("Leak of %d blocks found in xmlCatalogSetDefaults",
6368	           xmlMemBlocks() - mem_base);
6369	    test_ret++;
6370            printf(" %d", n_allow);
6371            printf("\n");
6372        }
6373    }
6374    function_tests++;
6375#endif
6376
6377    return(test_ret);
6378}
6379
6380
6381static int
6382test_xmlConvertSGMLCatalog(void) {
6383    int test_ret = 0;
6384
6385#if defined(LIBXML_CATALOG_ENABLED)
6386    int mem_base;
6387    int ret_val;
6388    xmlCatalogPtr catal; /* the catalog */
6389    int n_catal;
6390
6391    for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) {
6392        mem_base = xmlMemBlocks();
6393        catal = gen_xmlCatalogPtr(n_catal, 0);
6394
6395        ret_val = xmlConvertSGMLCatalog(catal);
6396        desret_int(ret_val);
6397        call_tests++;
6398        des_xmlCatalogPtr(n_catal, catal, 0);
6399        xmlResetLastError();
6400        if (mem_base != xmlMemBlocks()) {
6401            printf("Leak of %d blocks found in xmlConvertSGMLCatalog",
6402	           xmlMemBlocks() - mem_base);
6403	    test_ret++;
6404            printf(" %d", n_catal);
6405            printf("\n");
6406        }
6407    }
6408    function_tests++;
6409#endif
6410
6411    return(test_ret);
6412}
6413
6414
6415static int
6416test_xmlInitializeCatalog(void) {
6417    int test_ret = 0;
6418
6419#if defined(LIBXML_CATALOG_ENABLED)
6420    int mem_base;
6421
6422        mem_base = xmlMemBlocks();
6423
6424        xmlInitializeCatalog();
6425        call_tests++;
6426        xmlResetLastError();
6427        if (mem_base != xmlMemBlocks()) {
6428            printf("Leak of %d blocks found in xmlInitializeCatalog",
6429	           xmlMemBlocks() - mem_base);
6430	    test_ret++;
6431            printf("\n");
6432        }
6433    function_tests++;
6434#endif
6435
6436    return(test_ret);
6437}
6438
6439
6440static int
6441test_xmlLoadACatalog(void) {
6442    int test_ret = 0;
6443
6444
6445    /* missing type support */
6446    return(test_ret);
6447}
6448
6449
6450static int
6451test_xmlLoadCatalog(void) {
6452    int test_ret = 0;
6453
6454#if defined(LIBXML_CATALOG_ENABLED)
6455    int ret_val;
6456    const char * filename; /* a file path */
6457    int n_filename;
6458
6459    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6460        filename = gen_filepath(n_filename, 0);
6461
6462        ret_val = xmlLoadCatalog(filename);
6463        desret_int(ret_val);
6464        call_tests++;
6465        des_filepath(n_filename, filename, 0);
6466        xmlResetLastError();
6467    }
6468    function_tests++;
6469#endif
6470
6471    return(test_ret);
6472}
6473
6474
6475static int
6476test_xmlLoadCatalogs(void) {
6477    int test_ret = 0;
6478
6479#if defined(LIBXML_CATALOG_ENABLED)
6480    char * pathss; /* a list of directories separated by a colon or a space. */
6481    int n_pathss;
6482
6483    for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) {
6484        pathss = gen_const_char_ptr(n_pathss, 0);
6485
6486        xmlLoadCatalogs((const char *)pathss);
6487        call_tests++;
6488        des_const_char_ptr(n_pathss, (const char *)pathss, 0);
6489        xmlResetLastError();
6490    }
6491    function_tests++;
6492#endif
6493
6494    return(test_ret);
6495}
6496
6497
6498static int
6499test_xmlLoadSGMLSuperCatalog(void) {
6500    int test_ret = 0;
6501
6502
6503    /* missing type support */
6504    return(test_ret);
6505}
6506
6507
6508static int
6509test_xmlNewCatalog(void) {
6510    int test_ret = 0;
6511
6512
6513    /* missing type support */
6514    return(test_ret);
6515}
6516
6517
6518static int
6519test_xmlParseCatalogFile(void) {
6520    int test_ret = 0;
6521
6522#if defined(LIBXML_CATALOG_ENABLED)
6523    int mem_base;
6524    xmlDocPtr ret_val;
6525    const char * filename; /* the filename */
6526    int n_filename;
6527
6528    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
6529        mem_base = xmlMemBlocks();
6530        filename = gen_filepath(n_filename, 0);
6531
6532        ret_val = xmlParseCatalogFile(filename);
6533        desret_xmlDocPtr(ret_val);
6534        call_tests++;
6535        des_filepath(n_filename, filename, 0);
6536        xmlResetLastError();
6537        if (mem_base != xmlMemBlocks()) {
6538            printf("Leak of %d blocks found in xmlParseCatalogFile",
6539	           xmlMemBlocks() - mem_base);
6540	    test_ret++;
6541            printf(" %d", n_filename);
6542            printf("\n");
6543        }
6544    }
6545    function_tests++;
6546#endif
6547
6548    return(test_ret);
6549}
6550
6551static int
6552test_catalog(void) {
6553    int test_ret = 0;
6554
6555    if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n");
6556    test_ret += test_xmlACatalogAdd();
6557    test_ret += test_xmlACatalogDump();
6558    test_ret += test_xmlACatalogRemove();
6559    test_ret += test_xmlACatalogResolve();
6560    test_ret += test_xmlACatalogResolvePublic();
6561    test_ret += test_xmlACatalogResolveSystem();
6562    test_ret += test_xmlACatalogResolveURI();
6563    test_ret += test_xmlCatalogAdd();
6564    test_ret += test_xmlCatalogCleanup();
6565    test_ret += test_xmlCatalogConvert();
6566    test_ret += test_xmlCatalogDump();
6567    test_ret += test_xmlCatalogGetDefaults();
6568    test_ret += test_xmlCatalogIsEmpty();
6569    test_ret += test_xmlCatalogLocalResolve();
6570    test_ret += test_xmlCatalogLocalResolveURI();
6571    test_ret += test_xmlCatalogRemove();
6572    test_ret += test_xmlCatalogResolve();
6573    test_ret += test_xmlCatalogResolvePublic();
6574    test_ret += test_xmlCatalogResolveSystem();
6575    test_ret += test_xmlCatalogResolveURI();
6576    test_ret += test_xmlCatalogSetDefaultPrefer();
6577    test_ret += test_xmlCatalogSetDefaults();
6578    test_ret += test_xmlConvertSGMLCatalog();
6579    test_ret += test_xmlInitializeCatalog();
6580    test_ret += test_xmlLoadACatalog();
6581    test_ret += test_xmlLoadCatalog();
6582    test_ret += test_xmlLoadCatalogs();
6583    test_ret += test_xmlLoadSGMLSuperCatalog();
6584    test_ret += test_xmlNewCatalog();
6585    test_ret += test_xmlParseCatalogFile();
6586
6587    if (test_ret != 0)
6588	printf("Module catalog: %d errors\n", test_ret);
6589    return(test_ret);
6590}
6591
6592#define gen_nb_const_xmlChRangeGroup_ptr 1
6593static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6594    return(NULL);
6595}
6596static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
6597}
6598
6599static int
6600test_xmlCharInRange(void) {
6601    int test_ret = 0;
6602
6603    int mem_base;
6604    int ret_val;
6605    unsigned int val; /* character to be validated */
6606    int n_val;
6607    xmlChRangeGroup * rptr; /* pointer to range to be used to validate */
6608    int n_rptr;
6609
6610    for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) {
6611    for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) {
6612        mem_base = xmlMemBlocks();
6613        val = gen_unsigned_int(n_val, 0);
6614        rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1);
6615
6616        ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr);
6617        desret_int(ret_val);
6618        call_tests++;
6619        des_unsigned_int(n_val, val, 0);
6620        des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1);
6621        xmlResetLastError();
6622        if (mem_base != xmlMemBlocks()) {
6623            printf("Leak of %d blocks found in xmlCharInRange",
6624	           xmlMemBlocks() - mem_base);
6625	    test_ret++;
6626            printf(" %d", n_val);
6627            printf(" %d", n_rptr);
6628            printf("\n");
6629        }
6630    }
6631    }
6632    function_tests++;
6633
6634    return(test_ret);
6635}
6636
6637
6638static int
6639test_xmlIsBaseChar(void) {
6640    int test_ret = 0;
6641
6642    int mem_base;
6643    int ret_val;
6644    unsigned int ch; /* character to validate */
6645    int n_ch;
6646
6647    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6648        mem_base = xmlMemBlocks();
6649        ch = gen_unsigned_int(n_ch, 0);
6650
6651        ret_val = xmlIsBaseChar(ch);
6652        desret_int(ret_val);
6653        call_tests++;
6654        des_unsigned_int(n_ch, ch, 0);
6655        xmlResetLastError();
6656        if (mem_base != xmlMemBlocks()) {
6657            printf("Leak of %d blocks found in xmlIsBaseChar",
6658	           xmlMemBlocks() - mem_base);
6659	    test_ret++;
6660            printf(" %d", n_ch);
6661            printf("\n");
6662        }
6663    }
6664    function_tests++;
6665
6666    return(test_ret);
6667}
6668
6669
6670static int
6671test_xmlIsBlank(void) {
6672    int test_ret = 0;
6673
6674    int mem_base;
6675    int ret_val;
6676    unsigned int ch; /* character to validate */
6677    int n_ch;
6678
6679    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6680        mem_base = xmlMemBlocks();
6681        ch = gen_unsigned_int(n_ch, 0);
6682
6683        ret_val = xmlIsBlank(ch);
6684        desret_int(ret_val);
6685        call_tests++;
6686        des_unsigned_int(n_ch, ch, 0);
6687        xmlResetLastError();
6688        if (mem_base != xmlMemBlocks()) {
6689            printf("Leak of %d blocks found in xmlIsBlank",
6690	           xmlMemBlocks() - mem_base);
6691	    test_ret++;
6692            printf(" %d", n_ch);
6693            printf("\n");
6694        }
6695    }
6696    function_tests++;
6697
6698    return(test_ret);
6699}
6700
6701
6702static int
6703test_xmlIsChar(void) {
6704    int test_ret = 0;
6705
6706    int mem_base;
6707    int ret_val;
6708    unsigned int ch; /* character to validate */
6709    int n_ch;
6710
6711    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6712        mem_base = xmlMemBlocks();
6713        ch = gen_unsigned_int(n_ch, 0);
6714
6715        ret_val = xmlIsChar(ch);
6716        desret_int(ret_val);
6717        call_tests++;
6718        des_unsigned_int(n_ch, ch, 0);
6719        xmlResetLastError();
6720        if (mem_base != xmlMemBlocks()) {
6721            printf("Leak of %d blocks found in xmlIsChar",
6722	           xmlMemBlocks() - mem_base);
6723	    test_ret++;
6724            printf(" %d", n_ch);
6725            printf("\n");
6726        }
6727    }
6728    function_tests++;
6729
6730    return(test_ret);
6731}
6732
6733
6734static int
6735test_xmlIsCombining(void) {
6736    int test_ret = 0;
6737
6738    int mem_base;
6739    int ret_val;
6740    unsigned int ch; /* character to validate */
6741    int n_ch;
6742
6743    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6744        mem_base = xmlMemBlocks();
6745        ch = gen_unsigned_int(n_ch, 0);
6746
6747        ret_val = xmlIsCombining(ch);
6748        desret_int(ret_val);
6749        call_tests++;
6750        des_unsigned_int(n_ch, ch, 0);
6751        xmlResetLastError();
6752        if (mem_base != xmlMemBlocks()) {
6753            printf("Leak of %d blocks found in xmlIsCombining",
6754	           xmlMemBlocks() - mem_base);
6755	    test_ret++;
6756            printf(" %d", n_ch);
6757            printf("\n");
6758        }
6759    }
6760    function_tests++;
6761
6762    return(test_ret);
6763}
6764
6765
6766static int
6767test_xmlIsDigit(void) {
6768    int test_ret = 0;
6769
6770    int mem_base;
6771    int ret_val;
6772    unsigned int ch; /* character to validate */
6773    int n_ch;
6774
6775    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6776        mem_base = xmlMemBlocks();
6777        ch = gen_unsigned_int(n_ch, 0);
6778
6779        ret_val = xmlIsDigit(ch);
6780        desret_int(ret_val);
6781        call_tests++;
6782        des_unsigned_int(n_ch, ch, 0);
6783        xmlResetLastError();
6784        if (mem_base != xmlMemBlocks()) {
6785            printf("Leak of %d blocks found in xmlIsDigit",
6786	           xmlMemBlocks() - mem_base);
6787	    test_ret++;
6788            printf(" %d", n_ch);
6789            printf("\n");
6790        }
6791    }
6792    function_tests++;
6793
6794    return(test_ret);
6795}
6796
6797
6798static int
6799test_xmlIsExtender(void) {
6800    int test_ret = 0;
6801
6802    int mem_base;
6803    int ret_val;
6804    unsigned int ch; /* character to validate */
6805    int n_ch;
6806
6807    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6808        mem_base = xmlMemBlocks();
6809        ch = gen_unsigned_int(n_ch, 0);
6810
6811        ret_val = xmlIsExtender(ch);
6812        desret_int(ret_val);
6813        call_tests++;
6814        des_unsigned_int(n_ch, ch, 0);
6815        xmlResetLastError();
6816        if (mem_base != xmlMemBlocks()) {
6817            printf("Leak of %d blocks found in xmlIsExtender",
6818	           xmlMemBlocks() - mem_base);
6819	    test_ret++;
6820            printf(" %d", n_ch);
6821            printf("\n");
6822        }
6823    }
6824    function_tests++;
6825
6826    return(test_ret);
6827}
6828
6829
6830static int
6831test_xmlIsIdeographic(void) {
6832    int test_ret = 0;
6833
6834    int mem_base;
6835    int ret_val;
6836    unsigned int ch; /* character to validate */
6837    int n_ch;
6838
6839    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6840        mem_base = xmlMemBlocks();
6841        ch = gen_unsigned_int(n_ch, 0);
6842
6843        ret_val = xmlIsIdeographic(ch);
6844        desret_int(ret_val);
6845        call_tests++;
6846        des_unsigned_int(n_ch, ch, 0);
6847        xmlResetLastError();
6848        if (mem_base != xmlMemBlocks()) {
6849            printf("Leak of %d blocks found in xmlIsIdeographic",
6850	           xmlMemBlocks() - mem_base);
6851	    test_ret++;
6852            printf(" %d", n_ch);
6853            printf("\n");
6854        }
6855    }
6856    function_tests++;
6857
6858    return(test_ret);
6859}
6860
6861
6862static int
6863test_xmlIsPubidChar(void) {
6864    int test_ret = 0;
6865
6866    int mem_base;
6867    int ret_val;
6868    unsigned int ch; /* character to validate */
6869    int n_ch;
6870
6871    for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) {
6872        mem_base = xmlMemBlocks();
6873        ch = gen_unsigned_int(n_ch, 0);
6874
6875        ret_val = xmlIsPubidChar(ch);
6876        desret_int(ret_val);
6877        call_tests++;
6878        des_unsigned_int(n_ch, ch, 0);
6879        xmlResetLastError();
6880        if (mem_base != xmlMemBlocks()) {
6881            printf("Leak of %d blocks found in xmlIsPubidChar",
6882	           xmlMemBlocks() - mem_base);
6883	    test_ret++;
6884            printf(" %d", n_ch);
6885            printf("\n");
6886        }
6887    }
6888    function_tests++;
6889
6890    return(test_ret);
6891}
6892
6893static int
6894test_chvalid(void) {
6895    int test_ret = 0;
6896
6897    if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n");
6898    test_ret += test_xmlCharInRange();
6899    test_ret += test_xmlIsBaseChar();
6900    test_ret += test_xmlIsBlank();
6901    test_ret += test_xmlIsChar();
6902    test_ret += test_xmlIsCombining();
6903    test_ret += test_xmlIsDigit();
6904    test_ret += test_xmlIsExtender();
6905    test_ret += test_xmlIsIdeographic();
6906    test_ret += test_xmlIsPubidChar();
6907
6908    if (test_ret != 0)
6909	printf("Module chvalid: %d errors\n", test_ret);
6910    return(test_ret);
6911}
6912
6913static int
6914test_xmlBoolToText(void) {
6915    int test_ret = 0;
6916
6917#if defined(LIBXML_DEBUG_ENABLED)
6918    int mem_base;
6919    const char * ret_val;
6920    int boolval; /* a bool to turn into text */
6921    int n_boolval;
6922
6923    for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) {
6924        mem_base = xmlMemBlocks();
6925        boolval = gen_int(n_boolval, 0);
6926
6927        ret_val = xmlBoolToText(boolval);
6928        desret_const_char_ptr(ret_val);
6929        call_tests++;
6930        des_int(n_boolval, boolval, 0);
6931        xmlResetLastError();
6932        if (mem_base != xmlMemBlocks()) {
6933            printf("Leak of %d blocks found in xmlBoolToText",
6934	           xmlMemBlocks() - mem_base);
6935	    test_ret++;
6936            printf(" %d", n_boolval);
6937            printf("\n");
6938        }
6939    }
6940    function_tests++;
6941#endif
6942
6943    return(test_ret);
6944}
6945
6946
6947static int
6948test_xmlDebugCheckDocument(void) {
6949    int test_ret = 0;
6950
6951#if defined(LIBXML_DEBUG_ENABLED)
6952    int mem_base;
6953    int ret_val;
6954    FILE * output; /* the FILE * for the output */
6955    int n_output;
6956    xmlDocPtr doc; /* the document */
6957    int n_doc;
6958
6959    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
6960    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
6961        mem_base = xmlMemBlocks();
6962        output = gen_debug_FILE_ptr(n_output, 0);
6963        doc = gen_xmlDocPtr(n_doc, 1);
6964
6965        ret_val = xmlDebugCheckDocument(output, doc);
6966        desret_int(ret_val);
6967        call_tests++;
6968        des_debug_FILE_ptr(n_output, output, 0);
6969        des_xmlDocPtr(n_doc, doc, 1);
6970        xmlResetLastError();
6971        if (mem_base != xmlMemBlocks()) {
6972            printf("Leak of %d blocks found in xmlDebugCheckDocument",
6973	           xmlMemBlocks() - mem_base);
6974	    test_ret++;
6975            printf(" %d", n_output);
6976            printf(" %d", n_doc);
6977            printf("\n");
6978        }
6979    }
6980    }
6981    function_tests++;
6982#endif
6983
6984    return(test_ret);
6985}
6986
6987
6988static int
6989test_xmlDebugDumpAttr(void) {
6990    int test_ret = 0;
6991
6992#if defined(LIBXML_DEBUG_ENABLED)
6993    int mem_base;
6994    FILE * output; /* the FILE * for the output */
6995    int n_output;
6996    xmlAttrPtr attr; /* the attribute */
6997    int n_attr;
6998    int depth; /* the indentation level. */
6999    int n_depth;
7000
7001    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7002    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7003    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7004        mem_base = xmlMemBlocks();
7005        output = gen_debug_FILE_ptr(n_output, 0);
7006        attr = gen_xmlAttrPtr(n_attr, 1);
7007        depth = gen_int(n_depth, 2);
7008
7009        xmlDebugDumpAttr(output, attr, depth);
7010        call_tests++;
7011        des_debug_FILE_ptr(n_output, output, 0);
7012        des_xmlAttrPtr(n_attr, attr, 1);
7013        des_int(n_depth, depth, 2);
7014        xmlResetLastError();
7015        if (mem_base != xmlMemBlocks()) {
7016            printf("Leak of %d blocks found in xmlDebugDumpAttr",
7017	           xmlMemBlocks() - mem_base);
7018	    test_ret++;
7019            printf(" %d", n_output);
7020            printf(" %d", n_attr);
7021            printf(" %d", n_depth);
7022            printf("\n");
7023        }
7024    }
7025    }
7026    }
7027    function_tests++;
7028#endif
7029
7030    return(test_ret);
7031}
7032
7033
7034static int
7035test_xmlDebugDumpAttrList(void) {
7036    int test_ret = 0;
7037
7038#if defined(LIBXML_DEBUG_ENABLED)
7039    int mem_base;
7040    FILE * output; /* the FILE * for the output */
7041    int n_output;
7042    xmlAttrPtr attr; /* the attribute list */
7043    int n_attr;
7044    int depth; /* the indentation level. */
7045    int n_depth;
7046
7047    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7048    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
7049    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7050        mem_base = xmlMemBlocks();
7051        output = gen_debug_FILE_ptr(n_output, 0);
7052        attr = gen_xmlAttrPtr(n_attr, 1);
7053        depth = gen_int(n_depth, 2);
7054
7055        xmlDebugDumpAttrList(output, attr, depth);
7056        call_tests++;
7057        des_debug_FILE_ptr(n_output, output, 0);
7058        des_xmlAttrPtr(n_attr, attr, 1);
7059        des_int(n_depth, depth, 2);
7060        xmlResetLastError();
7061        if (mem_base != xmlMemBlocks()) {
7062            printf("Leak of %d blocks found in xmlDebugDumpAttrList",
7063	           xmlMemBlocks() - mem_base);
7064	    test_ret++;
7065            printf(" %d", n_output);
7066            printf(" %d", n_attr);
7067            printf(" %d", n_depth);
7068            printf("\n");
7069        }
7070    }
7071    }
7072    }
7073    function_tests++;
7074#endif
7075
7076    return(test_ret);
7077}
7078
7079
7080static int
7081test_xmlDebugDumpDTD(void) {
7082    int test_ret = 0;
7083
7084#if defined(LIBXML_DEBUG_ENABLED)
7085    int mem_base;
7086    FILE * output; /* the FILE * for the output */
7087    int n_output;
7088    xmlDtdPtr dtd; /* the DTD */
7089    int n_dtd;
7090
7091    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7092    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
7093        mem_base = xmlMemBlocks();
7094        output = gen_debug_FILE_ptr(n_output, 0);
7095        dtd = gen_xmlDtdPtr(n_dtd, 1);
7096
7097        xmlDebugDumpDTD(output, dtd);
7098        call_tests++;
7099        des_debug_FILE_ptr(n_output, output, 0);
7100        des_xmlDtdPtr(n_dtd, dtd, 1);
7101        xmlResetLastError();
7102        if (mem_base != xmlMemBlocks()) {
7103            printf("Leak of %d blocks found in xmlDebugDumpDTD",
7104	           xmlMemBlocks() - mem_base);
7105	    test_ret++;
7106            printf(" %d", n_output);
7107            printf(" %d", n_dtd);
7108            printf("\n");
7109        }
7110    }
7111    }
7112    function_tests++;
7113#endif
7114
7115    return(test_ret);
7116}
7117
7118
7119static int
7120test_xmlDebugDumpDocument(void) {
7121    int test_ret = 0;
7122
7123#if defined(LIBXML_DEBUG_ENABLED)
7124    int mem_base;
7125    FILE * output; /* the FILE * for the output */
7126    int n_output;
7127    xmlDocPtr doc; /* the document */
7128    int n_doc;
7129
7130    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7131    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7132        mem_base = xmlMemBlocks();
7133        output = gen_debug_FILE_ptr(n_output, 0);
7134        doc = gen_xmlDocPtr(n_doc, 1);
7135
7136        xmlDebugDumpDocument(output, doc);
7137        call_tests++;
7138        des_debug_FILE_ptr(n_output, output, 0);
7139        des_xmlDocPtr(n_doc, doc, 1);
7140        xmlResetLastError();
7141        if (mem_base != xmlMemBlocks()) {
7142            printf("Leak of %d blocks found in xmlDebugDumpDocument",
7143	           xmlMemBlocks() - mem_base);
7144	    test_ret++;
7145            printf(" %d", n_output);
7146            printf(" %d", n_doc);
7147            printf("\n");
7148        }
7149    }
7150    }
7151    function_tests++;
7152#endif
7153
7154    return(test_ret);
7155}
7156
7157
7158static int
7159test_xmlDebugDumpDocumentHead(void) {
7160    int test_ret = 0;
7161
7162#if defined(LIBXML_DEBUG_ENABLED)
7163    int mem_base;
7164    FILE * output; /* the FILE * for the output */
7165    int n_output;
7166    xmlDocPtr doc; /* the document */
7167    int n_doc;
7168
7169    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7170    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7171        mem_base = xmlMemBlocks();
7172        output = gen_debug_FILE_ptr(n_output, 0);
7173        doc = gen_xmlDocPtr(n_doc, 1);
7174
7175        xmlDebugDumpDocumentHead(output, doc);
7176        call_tests++;
7177        des_debug_FILE_ptr(n_output, output, 0);
7178        des_xmlDocPtr(n_doc, doc, 1);
7179        xmlResetLastError();
7180        if (mem_base != xmlMemBlocks()) {
7181            printf("Leak of %d blocks found in xmlDebugDumpDocumentHead",
7182	           xmlMemBlocks() - mem_base);
7183	    test_ret++;
7184            printf(" %d", n_output);
7185            printf(" %d", n_doc);
7186            printf("\n");
7187        }
7188    }
7189    }
7190    function_tests++;
7191#endif
7192
7193    return(test_ret);
7194}
7195
7196
7197static int
7198test_xmlDebugDumpEntities(void) {
7199    int test_ret = 0;
7200
7201#if defined(LIBXML_DEBUG_ENABLED)
7202    int mem_base;
7203    FILE * output; /* the FILE * for the output */
7204    int n_output;
7205    xmlDocPtr doc; /* the document */
7206    int n_doc;
7207
7208    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7209    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
7210        mem_base = xmlMemBlocks();
7211        output = gen_debug_FILE_ptr(n_output, 0);
7212        doc = gen_xmlDocPtr(n_doc, 1);
7213
7214        xmlDebugDumpEntities(output, doc);
7215        call_tests++;
7216        des_debug_FILE_ptr(n_output, output, 0);
7217        des_xmlDocPtr(n_doc, doc, 1);
7218        xmlResetLastError();
7219        if (mem_base != xmlMemBlocks()) {
7220            printf("Leak of %d blocks found in xmlDebugDumpEntities",
7221	           xmlMemBlocks() - mem_base);
7222	    test_ret++;
7223            printf(" %d", n_output);
7224            printf(" %d", n_doc);
7225            printf("\n");
7226        }
7227    }
7228    }
7229    function_tests++;
7230#endif
7231
7232    return(test_ret);
7233}
7234
7235
7236static int
7237test_xmlDebugDumpNode(void) {
7238    int test_ret = 0;
7239
7240#if defined(LIBXML_DEBUG_ENABLED)
7241    int mem_base;
7242    FILE * output; /* the FILE * for the output */
7243    int n_output;
7244    xmlNodePtr node; /* the node */
7245    int n_node;
7246    int depth; /* the indentation level. */
7247    int n_depth;
7248
7249    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7250    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7251    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7252        mem_base = xmlMemBlocks();
7253        output = gen_debug_FILE_ptr(n_output, 0);
7254        node = gen_xmlNodePtr(n_node, 1);
7255        depth = gen_int(n_depth, 2);
7256
7257        xmlDebugDumpNode(output, node, depth);
7258        call_tests++;
7259        des_debug_FILE_ptr(n_output, output, 0);
7260        des_xmlNodePtr(n_node, node, 1);
7261        des_int(n_depth, depth, 2);
7262        xmlResetLastError();
7263        if (mem_base != xmlMemBlocks()) {
7264            printf("Leak of %d blocks found in xmlDebugDumpNode",
7265	           xmlMemBlocks() - mem_base);
7266	    test_ret++;
7267            printf(" %d", n_output);
7268            printf(" %d", n_node);
7269            printf(" %d", n_depth);
7270            printf("\n");
7271        }
7272    }
7273    }
7274    }
7275    function_tests++;
7276#endif
7277
7278    return(test_ret);
7279}
7280
7281
7282static int
7283test_xmlDebugDumpNodeList(void) {
7284    int test_ret = 0;
7285
7286#if defined(LIBXML_DEBUG_ENABLED)
7287    int mem_base;
7288    FILE * output; /* the FILE * for the output */
7289    int n_output;
7290    xmlNodePtr node; /* the node list */
7291    int n_node;
7292    int depth; /* the indentation level. */
7293    int n_depth;
7294
7295    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7296    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7297    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7298        mem_base = xmlMemBlocks();
7299        output = gen_debug_FILE_ptr(n_output, 0);
7300        node = gen_xmlNodePtr(n_node, 1);
7301        depth = gen_int(n_depth, 2);
7302
7303        xmlDebugDumpNodeList(output, node, depth);
7304        call_tests++;
7305        des_debug_FILE_ptr(n_output, output, 0);
7306        des_xmlNodePtr(n_node, node, 1);
7307        des_int(n_depth, depth, 2);
7308        xmlResetLastError();
7309        if (mem_base != xmlMemBlocks()) {
7310            printf("Leak of %d blocks found in xmlDebugDumpNodeList",
7311	           xmlMemBlocks() - mem_base);
7312	    test_ret++;
7313            printf(" %d", n_output);
7314            printf(" %d", n_node);
7315            printf(" %d", n_depth);
7316            printf("\n");
7317        }
7318    }
7319    }
7320    }
7321    function_tests++;
7322#endif
7323
7324    return(test_ret);
7325}
7326
7327
7328static int
7329test_xmlDebugDumpOneNode(void) {
7330    int test_ret = 0;
7331
7332#if defined(LIBXML_DEBUG_ENABLED)
7333    int mem_base;
7334    FILE * output; /* the FILE * for the output */
7335    int n_output;
7336    xmlNodePtr node; /* the node */
7337    int n_node;
7338    int depth; /* the indentation level. */
7339    int n_depth;
7340
7341    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7342    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7343    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
7344        mem_base = xmlMemBlocks();
7345        output = gen_debug_FILE_ptr(n_output, 0);
7346        node = gen_xmlNodePtr(n_node, 1);
7347        depth = gen_int(n_depth, 2);
7348
7349        xmlDebugDumpOneNode(output, node, depth);
7350        call_tests++;
7351        des_debug_FILE_ptr(n_output, output, 0);
7352        des_xmlNodePtr(n_node, node, 1);
7353        des_int(n_depth, depth, 2);
7354        xmlResetLastError();
7355        if (mem_base != xmlMemBlocks()) {
7356            printf("Leak of %d blocks found in xmlDebugDumpOneNode",
7357	           xmlMemBlocks() - mem_base);
7358	    test_ret++;
7359            printf(" %d", n_output);
7360            printf(" %d", n_node);
7361            printf(" %d", n_depth);
7362            printf("\n");
7363        }
7364    }
7365    }
7366    }
7367    function_tests++;
7368#endif
7369
7370    return(test_ret);
7371}
7372
7373
7374static int
7375test_xmlDebugDumpString(void) {
7376    int test_ret = 0;
7377
7378#if defined(LIBXML_DEBUG_ENABLED)
7379    int mem_base;
7380    FILE * output; /* the FILE * for the output */
7381    int n_output;
7382    xmlChar * str; /* the string */
7383    int n_str;
7384
7385    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7386    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
7387        mem_base = xmlMemBlocks();
7388        output = gen_debug_FILE_ptr(n_output, 0);
7389        str = gen_const_xmlChar_ptr(n_str, 1);
7390
7391        xmlDebugDumpString(output, (const xmlChar *)str);
7392        call_tests++;
7393        des_debug_FILE_ptr(n_output, output, 0);
7394        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
7395        xmlResetLastError();
7396        if (mem_base != xmlMemBlocks()) {
7397            printf("Leak of %d blocks found in xmlDebugDumpString",
7398	           xmlMemBlocks() - mem_base);
7399	    test_ret++;
7400            printf(" %d", n_output);
7401            printf(" %d", n_str);
7402            printf("\n");
7403        }
7404    }
7405    }
7406    function_tests++;
7407#endif
7408
7409    return(test_ret);
7410}
7411
7412
7413static int
7414test_xmlLsCountNode(void) {
7415    int test_ret = 0;
7416
7417#if defined(LIBXML_DEBUG_ENABLED)
7418    int mem_base;
7419    int ret_val;
7420    xmlNodePtr node; /* the node to count */
7421    int n_node;
7422
7423    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7424        mem_base = xmlMemBlocks();
7425        node = gen_xmlNodePtr(n_node, 0);
7426
7427        ret_val = xmlLsCountNode(node);
7428        desret_int(ret_val);
7429        call_tests++;
7430        des_xmlNodePtr(n_node, node, 0);
7431        xmlResetLastError();
7432        if (mem_base != xmlMemBlocks()) {
7433            printf("Leak of %d blocks found in xmlLsCountNode",
7434	           xmlMemBlocks() - mem_base);
7435	    test_ret++;
7436            printf(" %d", n_node);
7437            printf("\n");
7438        }
7439    }
7440    function_tests++;
7441#endif
7442
7443    return(test_ret);
7444}
7445
7446
7447static int
7448test_xmlLsOneNode(void) {
7449    int test_ret = 0;
7450
7451#if defined(LIBXML_DEBUG_ENABLED)
7452    int mem_base;
7453    FILE * output; /* the FILE * for the output */
7454    int n_output;
7455    xmlNodePtr node; /* the node to dump */
7456    int n_node;
7457
7458    for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) {
7459    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7460        mem_base = xmlMemBlocks();
7461        output = gen_debug_FILE_ptr(n_output, 0);
7462        node = gen_xmlNodePtr(n_node, 1);
7463
7464        xmlLsOneNode(output, node);
7465        call_tests++;
7466        des_debug_FILE_ptr(n_output, output, 0);
7467        des_xmlNodePtr(n_node, node, 1);
7468        xmlResetLastError();
7469        if (mem_base != xmlMemBlocks()) {
7470            printf("Leak of %d blocks found in xmlLsOneNode",
7471	           xmlMemBlocks() - mem_base);
7472	    test_ret++;
7473            printf(" %d", n_output);
7474            printf(" %d", n_node);
7475            printf("\n");
7476        }
7477    }
7478    }
7479    function_tests++;
7480#endif
7481
7482    return(test_ret);
7483}
7484
7485
7486#define gen_nb_char_ptr 1
7487static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7488    return(NULL);
7489}
7490static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
7491}
7492
7493static int
7494test_xmlShell(void) {
7495    int test_ret = 0;
7496
7497
7498    /* missing type support */
7499    return(test_ret);
7500}
7501
7502
7503static int
7504test_xmlShellBase(void) {
7505    int test_ret = 0;
7506
7507#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7508    int mem_base;
7509    int ret_val;
7510    xmlShellCtxtPtr ctxt; /* the shell context */
7511    int n_ctxt;
7512    char * arg; /* unused */
7513    int n_arg;
7514    xmlNodePtr node; /* a node */
7515    int n_node;
7516    xmlNodePtr node2; /* unused */
7517    int n_node2;
7518
7519    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7520    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7521    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7522    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7523        mem_base = xmlMemBlocks();
7524        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7525        arg = gen_char_ptr(n_arg, 1);
7526        node = gen_xmlNodePtr(n_node, 2);
7527        node2 = gen_xmlNodePtr(n_node2, 3);
7528
7529        ret_val = xmlShellBase(ctxt, arg, node, node2);
7530        desret_int(ret_val);
7531        call_tests++;
7532        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7533        des_char_ptr(n_arg, arg, 1);
7534        des_xmlNodePtr(n_node, node, 2);
7535        des_xmlNodePtr(n_node2, node2, 3);
7536        xmlResetLastError();
7537        if (mem_base != xmlMemBlocks()) {
7538            printf("Leak of %d blocks found in xmlShellBase",
7539	           xmlMemBlocks() - mem_base);
7540	    test_ret++;
7541            printf(" %d", n_ctxt);
7542            printf(" %d", n_arg);
7543            printf(" %d", n_node);
7544            printf(" %d", n_node2);
7545            printf("\n");
7546        }
7547    }
7548    }
7549    }
7550    }
7551    function_tests++;
7552#endif
7553
7554    return(test_ret);
7555}
7556
7557
7558static int
7559test_xmlShellCat(void) {
7560    int test_ret = 0;
7561
7562#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7563    int mem_base;
7564    int ret_val;
7565    xmlShellCtxtPtr ctxt; /* the shell context */
7566    int n_ctxt;
7567    char * arg; /* unused */
7568    int n_arg;
7569    xmlNodePtr node; /* a node */
7570    int n_node;
7571    xmlNodePtr node2; /* unused */
7572    int n_node2;
7573
7574    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7575    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7576    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7577    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7578        mem_base = xmlMemBlocks();
7579        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7580        arg = gen_char_ptr(n_arg, 1);
7581        node = gen_xmlNodePtr(n_node, 2);
7582        node2 = gen_xmlNodePtr(n_node2, 3);
7583
7584        ret_val = xmlShellCat(ctxt, arg, node, node2);
7585        desret_int(ret_val);
7586        call_tests++;
7587        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7588        des_char_ptr(n_arg, arg, 1);
7589        des_xmlNodePtr(n_node, node, 2);
7590        des_xmlNodePtr(n_node2, node2, 3);
7591        xmlResetLastError();
7592        if (mem_base != xmlMemBlocks()) {
7593            printf("Leak of %d blocks found in xmlShellCat",
7594	           xmlMemBlocks() - mem_base);
7595	    test_ret++;
7596            printf(" %d", n_ctxt);
7597            printf(" %d", n_arg);
7598            printf(" %d", n_node);
7599            printf(" %d", n_node2);
7600            printf("\n");
7601        }
7602    }
7603    }
7604    }
7605    }
7606    function_tests++;
7607#endif
7608
7609    return(test_ret);
7610}
7611
7612
7613static int
7614test_xmlShellDir(void) {
7615    int test_ret = 0;
7616
7617#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7618    int mem_base;
7619    int ret_val;
7620    xmlShellCtxtPtr ctxt; /* the shell context */
7621    int n_ctxt;
7622    char * arg; /* unused */
7623    int n_arg;
7624    xmlNodePtr node; /* a node */
7625    int n_node;
7626    xmlNodePtr node2; /* unused */
7627    int n_node2;
7628
7629    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7630    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7631    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7632    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7633        mem_base = xmlMemBlocks();
7634        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7635        arg = gen_char_ptr(n_arg, 1);
7636        node = gen_xmlNodePtr(n_node, 2);
7637        node2 = gen_xmlNodePtr(n_node2, 3);
7638
7639        ret_val = xmlShellDir(ctxt, arg, node, node2);
7640        desret_int(ret_val);
7641        call_tests++;
7642        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7643        des_char_ptr(n_arg, arg, 1);
7644        des_xmlNodePtr(n_node, node, 2);
7645        des_xmlNodePtr(n_node2, node2, 3);
7646        xmlResetLastError();
7647        if (mem_base != xmlMemBlocks()) {
7648            printf("Leak of %d blocks found in xmlShellDir",
7649	           xmlMemBlocks() - mem_base);
7650	    test_ret++;
7651            printf(" %d", n_ctxt);
7652            printf(" %d", n_arg);
7653            printf(" %d", n_node);
7654            printf(" %d", n_node2);
7655            printf("\n");
7656        }
7657    }
7658    }
7659    }
7660    }
7661    function_tests++;
7662#endif
7663
7664    return(test_ret);
7665}
7666
7667
7668static int
7669test_xmlShellDu(void) {
7670    int test_ret = 0;
7671
7672#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7673    int mem_base;
7674    int ret_val;
7675    xmlShellCtxtPtr ctxt; /* the shell context */
7676    int n_ctxt;
7677    char * arg; /* unused */
7678    int n_arg;
7679    xmlNodePtr tree; /* a node defining a subtree */
7680    int n_tree;
7681    xmlNodePtr node2; /* unused */
7682    int n_node2;
7683
7684    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7685    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7686    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
7687    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7688        mem_base = xmlMemBlocks();
7689        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7690        arg = gen_char_ptr(n_arg, 1);
7691        tree = gen_xmlNodePtr(n_tree, 2);
7692        node2 = gen_xmlNodePtr(n_node2, 3);
7693
7694        ret_val = xmlShellDu(ctxt, arg, tree, node2);
7695        desret_int(ret_val);
7696        call_tests++;
7697        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7698        des_char_ptr(n_arg, arg, 1);
7699        des_xmlNodePtr(n_tree, tree, 2);
7700        des_xmlNodePtr(n_node2, node2, 3);
7701        xmlResetLastError();
7702        if (mem_base != xmlMemBlocks()) {
7703            printf("Leak of %d blocks found in xmlShellDu",
7704	           xmlMemBlocks() - mem_base);
7705	    test_ret++;
7706            printf(" %d", n_ctxt);
7707            printf(" %d", n_arg);
7708            printf(" %d", n_tree);
7709            printf(" %d", n_node2);
7710            printf("\n");
7711        }
7712    }
7713    }
7714    }
7715    }
7716    function_tests++;
7717#endif
7718
7719    return(test_ret);
7720}
7721
7722
7723static int
7724test_xmlShellList(void) {
7725    int test_ret = 0;
7726
7727#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7728    int mem_base;
7729    int ret_val;
7730    xmlShellCtxtPtr ctxt; /* the shell context */
7731    int n_ctxt;
7732    char * arg; /* unused */
7733    int n_arg;
7734    xmlNodePtr node; /* a node */
7735    int n_node;
7736    xmlNodePtr node2; /* unused */
7737    int n_node2;
7738
7739    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7740    for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) {
7741    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7742    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7743        mem_base = xmlMemBlocks();
7744        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7745        arg = gen_char_ptr(n_arg, 1);
7746        node = gen_xmlNodePtr(n_node, 2);
7747        node2 = gen_xmlNodePtr(n_node2, 3);
7748
7749        ret_val = xmlShellList(ctxt, arg, node, node2);
7750        desret_int(ret_val);
7751        call_tests++;
7752        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7753        des_char_ptr(n_arg, arg, 1);
7754        des_xmlNodePtr(n_node, node, 2);
7755        des_xmlNodePtr(n_node2, node2, 3);
7756        xmlResetLastError();
7757        if (mem_base != xmlMemBlocks()) {
7758            printf("Leak of %d blocks found in xmlShellList",
7759	           xmlMemBlocks() - mem_base);
7760	    test_ret++;
7761            printf(" %d", n_ctxt);
7762            printf(" %d", n_arg);
7763            printf(" %d", n_node);
7764            printf(" %d", n_node2);
7765            printf("\n");
7766        }
7767    }
7768    }
7769    }
7770    }
7771    function_tests++;
7772#endif
7773
7774    return(test_ret);
7775}
7776
7777
7778static int
7779test_xmlShellLoad(void) {
7780    int test_ret = 0;
7781
7782#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7783    int mem_base;
7784    int ret_val;
7785    xmlShellCtxtPtr ctxt; /* the shell context */
7786    int n_ctxt;
7787    char * filename; /* the file name */
7788    int n_filename;
7789    xmlNodePtr node; /* unused */
7790    int n_node;
7791    xmlNodePtr node2; /* unused */
7792    int n_node2;
7793
7794    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7795    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7796    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7797    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7798        mem_base = xmlMemBlocks();
7799        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7800        filename = gen_char_ptr(n_filename, 1);
7801        node = gen_xmlNodePtr(n_node, 2);
7802        node2 = gen_xmlNodePtr(n_node2, 3);
7803
7804        ret_val = xmlShellLoad(ctxt, filename, node, node2);
7805        desret_int(ret_val);
7806        call_tests++;
7807        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7808        des_char_ptr(n_filename, filename, 1);
7809        des_xmlNodePtr(n_node, node, 2);
7810        des_xmlNodePtr(n_node2, node2, 3);
7811        xmlResetLastError();
7812        if (mem_base != xmlMemBlocks()) {
7813            printf("Leak of %d blocks found in xmlShellLoad",
7814	           xmlMemBlocks() - mem_base);
7815	    test_ret++;
7816            printf(" %d", n_ctxt);
7817            printf(" %d", n_filename);
7818            printf(" %d", n_node);
7819            printf(" %d", n_node2);
7820            printf("\n");
7821        }
7822    }
7823    }
7824    }
7825    }
7826    function_tests++;
7827#endif
7828
7829    return(test_ret);
7830}
7831
7832
7833static int
7834test_xmlShellPrintXPathResult(void) {
7835    int test_ret = 0;
7836
7837#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7838    int mem_base;
7839    xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */
7840    int n_list;
7841
7842    for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) {
7843        mem_base = xmlMemBlocks();
7844        list = gen_xmlXPathObjectPtr(n_list, 0);
7845
7846        xmlShellPrintXPathResult(list);
7847        call_tests++;
7848        des_xmlXPathObjectPtr(n_list, list, 0);
7849        xmlResetLastError();
7850        if (mem_base != xmlMemBlocks()) {
7851            printf("Leak of %d blocks found in xmlShellPrintXPathResult",
7852	           xmlMemBlocks() - mem_base);
7853	    test_ret++;
7854            printf(" %d", n_list);
7855            printf("\n");
7856        }
7857    }
7858    function_tests++;
7859#endif
7860
7861    return(test_ret);
7862}
7863
7864
7865static int
7866test_xmlShellPwd(void) {
7867    int test_ret = 0;
7868
7869#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
7870    int mem_base;
7871    int ret_val;
7872    xmlShellCtxtPtr ctxt; /* the shell context */
7873    int n_ctxt;
7874    char * buffer; /* the output buffer */
7875    int n_buffer;
7876    xmlNodePtr node; /* a node */
7877    int n_node;
7878    xmlNodePtr node2; /* unused */
7879    int n_node2;
7880
7881    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7882    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
7883    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7884    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7885        mem_base = xmlMemBlocks();
7886        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7887        buffer = gen_char_ptr(n_buffer, 1);
7888        node = gen_xmlNodePtr(n_node, 2);
7889        node2 = gen_xmlNodePtr(n_node2, 3);
7890
7891        ret_val = xmlShellPwd(ctxt, buffer, node, node2);
7892        desret_int(ret_val);
7893        call_tests++;
7894        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7895        des_char_ptr(n_buffer, buffer, 1);
7896        des_xmlNodePtr(n_node, node, 2);
7897        des_xmlNodePtr(n_node2, node2, 3);
7898        xmlResetLastError();
7899        if (mem_base != xmlMemBlocks()) {
7900            printf("Leak of %d blocks found in xmlShellPwd",
7901	           xmlMemBlocks() - mem_base);
7902	    test_ret++;
7903            printf(" %d", n_ctxt);
7904            printf(" %d", n_buffer);
7905            printf(" %d", n_node);
7906            printf(" %d", n_node2);
7907            printf("\n");
7908        }
7909    }
7910    }
7911    }
7912    }
7913    function_tests++;
7914#endif
7915
7916    return(test_ret);
7917}
7918
7919
7920static int
7921test_xmlShellSave(void) {
7922    int test_ret = 0;
7923
7924#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
7925    int mem_base;
7926    int ret_val;
7927    xmlShellCtxtPtr ctxt; /* the shell context */
7928    int n_ctxt;
7929    char * filename; /* the file name (optional) */
7930    int n_filename;
7931    xmlNodePtr node; /* unused */
7932    int n_node;
7933    xmlNodePtr node2; /* unused */
7934    int n_node2;
7935
7936    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7937    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
7938    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7939    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7940        mem_base = xmlMemBlocks();
7941        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7942        filename = gen_char_ptr(n_filename, 1);
7943        node = gen_xmlNodePtr(n_node, 2);
7944        node2 = gen_xmlNodePtr(n_node2, 3);
7945
7946        ret_val = xmlShellSave(ctxt, filename, node, node2);
7947        desret_int(ret_val);
7948        call_tests++;
7949        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
7950        des_char_ptr(n_filename, filename, 1);
7951        des_xmlNodePtr(n_node, node, 2);
7952        des_xmlNodePtr(n_node2, node2, 3);
7953        xmlResetLastError();
7954        if (mem_base != xmlMemBlocks()) {
7955            printf("Leak of %d blocks found in xmlShellSave",
7956	           xmlMemBlocks() - mem_base);
7957	    test_ret++;
7958            printf(" %d", n_ctxt);
7959            printf(" %d", n_filename);
7960            printf(" %d", n_node);
7961            printf(" %d", n_node2);
7962            printf("\n");
7963        }
7964    }
7965    }
7966    }
7967    }
7968    function_tests++;
7969#endif
7970
7971    return(test_ret);
7972}
7973
7974
7975static int
7976test_xmlShellValidate(void) {
7977    int test_ret = 0;
7978
7979#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
7980    int mem_base;
7981    int ret_val;
7982    xmlShellCtxtPtr ctxt; /* the shell context */
7983    int n_ctxt;
7984    char * dtd; /* the DTD URI (optional) */
7985    int n_dtd;
7986    xmlNodePtr node; /* unused */
7987    int n_node;
7988    xmlNodePtr node2; /* unused */
7989    int n_node2;
7990
7991    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
7992    for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) {
7993    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
7994    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
7995        mem_base = xmlMemBlocks();
7996        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
7997        dtd = gen_char_ptr(n_dtd, 1);
7998        node = gen_xmlNodePtr(n_node, 2);
7999        node2 = gen_xmlNodePtr(n_node2, 3);
8000
8001        ret_val = xmlShellValidate(ctxt, dtd, node, node2);
8002        desret_int(ret_val);
8003        call_tests++;
8004        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8005        des_char_ptr(n_dtd, dtd, 1);
8006        des_xmlNodePtr(n_node, node, 2);
8007        des_xmlNodePtr(n_node2, node2, 3);
8008        xmlResetLastError();
8009        if (mem_base != xmlMemBlocks()) {
8010            printf("Leak of %d blocks found in xmlShellValidate",
8011	           xmlMemBlocks() - mem_base);
8012	    test_ret++;
8013            printf(" %d", n_ctxt);
8014            printf(" %d", n_dtd);
8015            printf(" %d", n_node);
8016            printf(" %d", n_node2);
8017            printf("\n");
8018        }
8019    }
8020    }
8021    }
8022    }
8023    function_tests++;
8024#endif
8025
8026    return(test_ret);
8027}
8028
8029
8030static int
8031test_xmlShellWrite(void) {
8032    int test_ret = 0;
8033
8034#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
8035    int mem_base;
8036    int ret_val;
8037    xmlShellCtxtPtr ctxt; /* the shell context */
8038    int n_ctxt;
8039    char * filename; /* the file name */
8040    int n_filename;
8041    xmlNodePtr node; /* a node in the tree */
8042    int n_node;
8043    xmlNodePtr node2; /* unused */
8044    int n_node2;
8045
8046    for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) {
8047    for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) {
8048    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
8049    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
8050        mem_base = xmlMemBlocks();
8051        ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0);
8052        filename = gen_char_ptr(n_filename, 1);
8053        node = gen_xmlNodePtr(n_node, 2);
8054        node2 = gen_xmlNodePtr(n_node2, 3);
8055
8056        ret_val = xmlShellWrite(ctxt, filename, node, node2);
8057        desret_int(ret_val);
8058        call_tests++;
8059        des_xmlShellCtxtPtr(n_ctxt, ctxt, 0);
8060        des_char_ptr(n_filename, filename, 1);
8061        des_xmlNodePtr(n_node, node, 2);
8062        des_xmlNodePtr(n_node2, node2, 3);
8063        xmlResetLastError();
8064        if (mem_base != xmlMemBlocks()) {
8065            printf("Leak of %d blocks found in xmlShellWrite",
8066	           xmlMemBlocks() - mem_base);
8067	    test_ret++;
8068            printf(" %d", n_ctxt);
8069            printf(" %d", n_filename);
8070            printf(" %d", n_node);
8071            printf(" %d", n_node2);
8072            printf("\n");
8073        }
8074    }
8075    }
8076    }
8077    }
8078    function_tests++;
8079#endif
8080
8081    return(test_ret);
8082}
8083
8084static int
8085test_debugXML(void) {
8086    int test_ret = 0;
8087
8088    if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n");
8089    test_ret += test_xmlBoolToText();
8090    test_ret += test_xmlDebugCheckDocument();
8091    test_ret += test_xmlDebugDumpAttr();
8092    test_ret += test_xmlDebugDumpAttrList();
8093    test_ret += test_xmlDebugDumpDTD();
8094    test_ret += test_xmlDebugDumpDocument();
8095    test_ret += test_xmlDebugDumpDocumentHead();
8096    test_ret += test_xmlDebugDumpEntities();
8097    test_ret += test_xmlDebugDumpNode();
8098    test_ret += test_xmlDebugDumpNodeList();
8099    test_ret += test_xmlDebugDumpOneNode();
8100    test_ret += test_xmlDebugDumpString();
8101    test_ret += test_xmlLsCountNode();
8102    test_ret += test_xmlLsOneNode();
8103    test_ret += test_xmlShell();
8104    test_ret += test_xmlShellBase();
8105    test_ret += test_xmlShellCat();
8106    test_ret += test_xmlShellDir();
8107    test_ret += test_xmlShellDu();
8108    test_ret += test_xmlShellList();
8109    test_ret += test_xmlShellLoad();
8110    test_ret += test_xmlShellPrintXPathResult();
8111    test_ret += test_xmlShellPwd();
8112    test_ret += test_xmlShellSave();
8113    test_ret += test_xmlShellValidate();
8114    test_ret += test_xmlShellWrite();
8115
8116    if (test_ret != 0)
8117	printf("Module debugXML: %d errors\n", test_ret);
8118    return(test_ret);
8119}
8120
8121static int
8122test_xmlDictCleanup(void) {
8123    int test_ret = 0;
8124
8125    int mem_base;
8126
8127        mem_base = xmlMemBlocks();
8128
8129        xmlDictCleanup();
8130        call_tests++;
8131        xmlResetLastError();
8132        if (mem_base != xmlMemBlocks()) {
8133            printf("Leak of %d blocks found in xmlDictCleanup",
8134	           xmlMemBlocks() - mem_base);
8135	    test_ret++;
8136            printf("\n");
8137        }
8138    function_tests++;
8139
8140    return(test_ret);
8141}
8142
8143
8144static int
8145test_xmlDictCreate(void) {
8146    int test_ret = 0;
8147
8148    int mem_base;
8149    xmlDictPtr ret_val;
8150
8151        mem_base = xmlMemBlocks();
8152
8153        ret_val = xmlDictCreate();
8154        desret_xmlDictPtr(ret_val);
8155        call_tests++;
8156        xmlResetLastError();
8157        if (mem_base != xmlMemBlocks()) {
8158            printf("Leak of %d blocks found in xmlDictCreate",
8159	           xmlMemBlocks() - mem_base);
8160	    test_ret++;
8161            printf("\n");
8162        }
8163    function_tests++;
8164
8165    return(test_ret);
8166}
8167
8168
8169static int
8170test_xmlDictCreateSub(void) {
8171    int test_ret = 0;
8172
8173    int mem_base;
8174    xmlDictPtr ret_val;
8175    xmlDictPtr sub; /* an existing dictionnary */
8176    int n_sub;
8177
8178    for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) {
8179        mem_base = xmlMemBlocks();
8180        sub = gen_xmlDictPtr(n_sub, 0);
8181
8182        ret_val = xmlDictCreateSub(sub);
8183        desret_xmlDictPtr(ret_val);
8184        call_tests++;
8185        des_xmlDictPtr(n_sub, sub, 0);
8186        xmlResetLastError();
8187        if (mem_base != xmlMemBlocks()) {
8188            printf("Leak of %d blocks found in xmlDictCreateSub",
8189	           xmlMemBlocks() - mem_base);
8190	    test_ret++;
8191            printf(" %d", n_sub);
8192            printf("\n");
8193        }
8194    }
8195    function_tests++;
8196
8197    return(test_ret);
8198}
8199
8200
8201static int
8202test_xmlDictExists(void) {
8203    int test_ret = 0;
8204
8205    int mem_base;
8206    const xmlChar * ret_val;
8207    xmlDictPtr dict; /* the dictionnary */
8208    int n_dict;
8209    xmlChar * name; /* the name of the userdata */
8210    int n_name;
8211    int len; /* the length of the name, if -1 it is recomputed */
8212    int n_len;
8213
8214    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8215    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8216    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8217        mem_base = xmlMemBlocks();
8218        dict = gen_xmlDictPtr(n_dict, 0);
8219        name = gen_const_xmlChar_ptr(n_name, 1);
8220        len = gen_int(n_len, 2);
8221
8222        ret_val = xmlDictExists(dict, (const xmlChar *)name, len);
8223        desret_const_xmlChar_ptr(ret_val);
8224        call_tests++;
8225        des_xmlDictPtr(n_dict, dict, 0);
8226        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8227        des_int(n_len, len, 2);
8228        xmlResetLastError();
8229        if (mem_base != xmlMemBlocks()) {
8230            printf("Leak of %d blocks found in xmlDictExists",
8231	           xmlMemBlocks() - mem_base);
8232	    test_ret++;
8233            printf(" %d", n_dict);
8234            printf(" %d", n_name);
8235            printf(" %d", n_len);
8236            printf("\n");
8237        }
8238    }
8239    }
8240    }
8241    function_tests++;
8242
8243    return(test_ret);
8244}
8245
8246
8247static int
8248test_xmlDictLookup(void) {
8249    int test_ret = 0;
8250
8251    int mem_base;
8252    const xmlChar * ret_val;
8253    xmlDictPtr dict; /* the dictionnary */
8254    int n_dict;
8255    xmlChar * name; /* the name of the userdata */
8256    int n_name;
8257    int len; /* the length of the name, if -1 it is recomputed */
8258    int n_len;
8259
8260    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8261    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8262    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8263        mem_base = xmlMemBlocks();
8264        dict = gen_xmlDictPtr(n_dict, 0);
8265        name = gen_const_xmlChar_ptr(n_name, 1);
8266        len = gen_int(n_len, 2);
8267
8268        ret_val = xmlDictLookup(dict, (const xmlChar *)name, len);
8269        desret_const_xmlChar_ptr(ret_val);
8270        call_tests++;
8271        des_xmlDictPtr(n_dict, dict, 0);
8272        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
8273        des_int(n_len, len, 2);
8274        xmlResetLastError();
8275        if (mem_base != xmlMemBlocks()) {
8276            printf("Leak of %d blocks found in xmlDictLookup",
8277	           xmlMemBlocks() - mem_base);
8278	    test_ret++;
8279            printf(" %d", n_dict);
8280            printf(" %d", n_name);
8281            printf(" %d", n_len);
8282            printf("\n");
8283        }
8284    }
8285    }
8286    }
8287    function_tests++;
8288
8289    return(test_ret);
8290}
8291
8292
8293static int
8294test_xmlDictOwns(void) {
8295    int test_ret = 0;
8296
8297    int mem_base;
8298    int ret_val;
8299    xmlDictPtr dict; /* the dictionnary */
8300    int n_dict;
8301    xmlChar * str; /* the string */
8302    int n_str;
8303
8304    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8305    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
8306        mem_base = xmlMemBlocks();
8307        dict = gen_xmlDictPtr(n_dict, 0);
8308        str = gen_const_xmlChar_ptr(n_str, 1);
8309
8310        ret_val = xmlDictOwns(dict, (const xmlChar *)str);
8311        desret_int(ret_val);
8312        call_tests++;
8313        des_xmlDictPtr(n_dict, dict, 0);
8314        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
8315        xmlResetLastError();
8316        if (mem_base != xmlMemBlocks()) {
8317            printf("Leak of %d blocks found in xmlDictOwns",
8318	           xmlMemBlocks() - mem_base);
8319	    test_ret++;
8320            printf(" %d", n_dict);
8321            printf(" %d", n_str);
8322            printf("\n");
8323        }
8324    }
8325    }
8326    function_tests++;
8327
8328    return(test_ret);
8329}
8330
8331
8332static int
8333test_xmlDictQLookup(void) {
8334    int test_ret = 0;
8335
8336    int mem_base;
8337    const xmlChar * ret_val;
8338    xmlDictPtr dict; /* the dictionnary */
8339    int n_dict;
8340    xmlChar * prefix; /* the prefix */
8341    int n_prefix;
8342    xmlChar * name; /* the name */
8343    int n_name;
8344
8345    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8346    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
8347    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
8348        mem_base = xmlMemBlocks();
8349        dict = gen_xmlDictPtr(n_dict, 0);
8350        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
8351        name = gen_const_xmlChar_ptr(n_name, 2);
8352
8353        ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name);
8354        desret_const_xmlChar_ptr(ret_val);
8355        call_tests++;
8356        des_xmlDictPtr(n_dict, dict, 0);
8357        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
8358        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
8359        xmlResetLastError();
8360        if (mem_base != xmlMemBlocks()) {
8361            printf("Leak of %d blocks found in xmlDictQLookup",
8362	           xmlMemBlocks() - mem_base);
8363	    test_ret++;
8364            printf(" %d", n_dict);
8365            printf(" %d", n_prefix);
8366            printf(" %d", n_name);
8367            printf("\n");
8368        }
8369    }
8370    }
8371    }
8372    function_tests++;
8373
8374    return(test_ret);
8375}
8376
8377
8378static int
8379test_xmlDictReference(void) {
8380    int test_ret = 0;
8381
8382    int mem_base;
8383    int ret_val;
8384    xmlDictPtr dict; /* the dictionnary */
8385    int n_dict;
8386
8387    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8388        mem_base = xmlMemBlocks();
8389        dict = gen_xmlDictPtr(n_dict, 0);
8390
8391        ret_val = xmlDictReference(dict);
8392        xmlDictFree(dict);
8393        desret_int(ret_val);
8394        call_tests++;
8395        des_xmlDictPtr(n_dict, dict, 0);
8396        xmlResetLastError();
8397        if (mem_base != xmlMemBlocks()) {
8398            printf("Leak of %d blocks found in xmlDictReference",
8399	           xmlMemBlocks() - mem_base);
8400	    test_ret++;
8401            printf(" %d", n_dict);
8402            printf("\n");
8403        }
8404    }
8405    function_tests++;
8406
8407    return(test_ret);
8408}
8409
8410
8411static int
8412test_xmlDictSize(void) {
8413    int test_ret = 0;
8414
8415    int mem_base;
8416    int ret_val;
8417    xmlDictPtr dict; /* the dictionnary */
8418    int n_dict;
8419
8420    for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) {
8421        mem_base = xmlMemBlocks();
8422        dict = gen_xmlDictPtr(n_dict, 0);
8423
8424        ret_val = xmlDictSize(dict);
8425        desret_int(ret_val);
8426        call_tests++;
8427        des_xmlDictPtr(n_dict, dict, 0);
8428        xmlResetLastError();
8429        if (mem_base != xmlMemBlocks()) {
8430            printf("Leak of %d blocks found in xmlDictSize",
8431	           xmlMemBlocks() - mem_base);
8432	    test_ret++;
8433            printf(" %d", n_dict);
8434            printf("\n");
8435        }
8436    }
8437    function_tests++;
8438
8439    return(test_ret);
8440}
8441
8442static int
8443test_dict(void) {
8444    int test_ret = 0;
8445
8446    if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n");
8447    test_ret += test_xmlDictCleanup();
8448    test_ret += test_xmlDictCreate();
8449    test_ret += test_xmlDictCreateSub();
8450    test_ret += test_xmlDictExists();
8451    test_ret += test_xmlDictLookup();
8452    test_ret += test_xmlDictOwns();
8453    test_ret += test_xmlDictQLookup();
8454    test_ret += test_xmlDictReference();
8455    test_ret += test_xmlDictSize();
8456
8457    if (test_ret != 0)
8458	printf("Module dict: %d errors\n", test_ret);
8459    return(test_ret);
8460}
8461
8462static int
8463test_UTF8Toisolat1(void) {
8464    int test_ret = 0;
8465
8466#if defined(LIBXML_OUTPUT_ENABLED)
8467#ifdef LIBXML_OUTPUT_ENABLED
8468    int mem_base;
8469    int ret_val;
8470    unsigned char * out; /* a pointer to an array of bytes to store the result */
8471    int n_out;
8472    int * outlen; /* the length of @out */
8473    int n_outlen;
8474    unsigned char * in; /* a pointer to an array of UTF-8 chars */
8475    int n_in;
8476    int * inlen; /* the length of @in */
8477    int n_inlen;
8478
8479    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8480    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8481    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8482    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8483        mem_base = xmlMemBlocks();
8484        out = gen_unsigned_char_ptr(n_out, 0);
8485        outlen = gen_int_ptr(n_outlen, 1);
8486        in = gen_const_unsigned_char_ptr(n_in, 2);
8487        inlen = gen_int_ptr(n_inlen, 3);
8488
8489        ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen);
8490        desret_int(ret_val);
8491        call_tests++;
8492        des_unsigned_char_ptr(n_out, out, 0);
8493        des_int_ptr(n_outlen, outlen, 1);
8494        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8495        des_int_ptr(n_inlen, inlen, 3);
8496        xmlResetLastError();
8497        if (mem_base != xmlMemBlocks()) {
8498            printf("Leak of %d blocks found in UTF8Toisolat1",
8499	           xmlMemBlocks() - mem_base);
8500	    test_ret++;
8501            printf(" %d", n_out);
8502            printf(" %d", n_outlen);
8503            printf(" %d", n_in);
8504            printf(" %d", n_inlen);
8505            printf("\n");
8506        }
8507    }
8508    }
8509    }
8510    }
8511    function_tests++;
8512#endif
8513#endif
8514
8515    return(test_ret);
8516}
8517
8518
8519static int
8520test_isolat1ToUTF8(void) {
8521    int test_ret = 0;
8522
8523    int mem_base;
8524    int ret_val;
8525    unsigned char * out; /* a pointer to an array of bytes to store the result */
8526    int n_out;
8527    int * outlen; /* the length of @out */
8528    int n_outlen;
8529    unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */
8530    int n_in;
8531    int * inlen; /* the length of @in */
8532    int n_inlen;
8533
8534    for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) {
8535    for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) {
8536    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8537    for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) {
8538        mem_base = xmlMemBlocks();
8539        out = gen_unsigned_char_ptr(n_out, 0);
8540        outlen = gen_int_ptr(n_outlen, 1);
8541        in = gen_const_unsigned_char_ptr(n_in, 2);
8542        inlen = gen_int_ptr(n_inlen, 3);
8543
8544        ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen);
8545        desret_int(ret_val);
8546        call_tests++;
8547        des_unsigned_char_ptr(n_out, out, 0);
8548        des_int_ptr(n_outlen, outlen, 1);
8549        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2);
8550        des_int_ptr(n_inlen, inlen, 3);
8551        xmlResetLastError();
8552        if (mem_base != xmlMemBlocks()) {
8553            printf("Leak of %d blocks found in isolat1ToUTF8",
8554	           xmlMemBlocks() - mem_base);
8555	    test_ret++;
8556            printf(" %d", n_out);
8557            printf(" %d", n_outlen);
8558            printf(" %d", n_in);
8559            printf(" %d", n_inlen);
8560            printf("\n");
8561        }
8562    }
8563    }
8564    }
8565    }
8566    function_tests++;
8567
8568    return(test_ret);
8569}
8570
8571
8572static int
8573test_xmlAddEncodingAlias(void) {
8574    int test_ret = 0;
8575
8576    int ret_val;
8577    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
8578    int n_name;
8579    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8580    int n_alias;
8581
8582    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
8583    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8584        name = gen_const_char_ptr(n_name, 0);
8585        alias = gen_const_char_ptr(n_alias, 1);
8586
8587        ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias);
8588        desret_int(ret_val);
8589        call_tests++;
8590        des_const_char_ptr(n_name, (const char *)name, 0);
8591        des_const_char_ptr(n_alias, (const char *)alias, 1);
8592        xmlResetLastError();
8593    }
8594    }
8595    function_tests++;
8596
8597    return(test_ret);
8598}
8599
8600
8601#define gen_nb_xmlCharEncodingHandler_ptr 1
8602static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8603    return(NULL);
8604}
8605static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
8606}
8607
8608static int
8609test_xmlCharEncCloseFunc(void) {
8610    int test_ret = 0;
8611
8612    int mem_base;
8613    int ret_val;
8614    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8615    int n_handler;
8616
8617    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8618        mem_base = xmlMemBlocks();
8619        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8620
8621        ret_val = xmlCharEncCloseFunc(handler);
8622        desret_int(ret_val);
8623        call_tests++;
8624        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8625        xmlResetLastError();
8626        if (mem_base != xmlMemBlocks()) {
8627            printf("Leak of %d blocks found in xmlCharEncCloseFunc",
8628	           xmlMemBlocks() - mem_base);
8629	    test_ret++;
8630            printf(" %d", n_handler);
8631            printf("\n");
8632        }
8633    }
8634    function_tests++;
8635
8636    return(test_ret);
8637}
8638
8639
8640static int
8641test_xmlCharEncFirstLine(void) {
8642    int test_ret = 0;
8643
8644    int mem_base;
8645    int ret_val;
8646    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8647    int n_handler;
8648    xmlBufferPtr out; /* an xmlBuffer for the output. */
8649    int n_out;
8650    xmlBufferPtr in; /* an xmlBuffer for the input */
8651    int n_in;
8652
8653    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8654    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8655    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8656        mem_base = xmlMemBlocks();
8657        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8658        out = gen_xmlBufferPtr(n_out, 1);
8659        in = gen_xmlBufferPtr(n_in, 2);
8660
8661        ret_val = xmlCharEncFirstLine(handler, out, in);
8662        desret_int(ret_val);
8663        call_tests++;
8664        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8665        des_xmlBufferPtr(n_out, out, 1);
8666        des_xmlBufferPtr(n_in, in, 2);
8667        xmlResetLastError();
8668        if (mem_base != xmlMemBlocks()) {
8669            printf("Leak of %d blocks found in xmlCharEncFirstLine",
8670	           xmlMemBlocks() - mem_base);
8671	    test_ret++;
8672            printf(" %d", n_handler);
8673            printf(" %d", n_out);
8674            printf(" %d", n_in);
8675            printf("\n");
8676        }
8677    }
8678    }
8679    }
8680    function_tests++;
8681
8682    return(test_ret);
8683}
8684
8685
8686static int
8687test_xmlCharEncInFunc(void) {
8688    int test_ret = 0;
8689
8690    int mem_base;
8691    int ret_val;
8692    xmlCharEncodingHandler * handler; /* char encoding transformation data structure */
8693    int n_handler;
8694    xmlBufferPtr out; /* an xmlBuffer for the output. */
8695    int n_out;
8696    xmlBufferPtr in; /* an xmlBuffer for the input */
8697    int n_in;
8698
8699    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8700    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8701    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8702        mem_base = xmlMemBlocks();
8703        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8704        out = gen_xmlBufferPtr(n_out, 1);
8705        in = gen_xmlBufferPtr(n_in, 2);
8706
8707        ret_val = xmlCharEncInFunc(handler, out, in);
8708        desret_int(ret_val);
8709        call_tests++;
8710        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8711        des_xmlBufferPtr(n_out, out, 1);
8712        des_xmlBufferPtr(n_in, in, 2);
8713        xmlResetLastError();
8714        if (mem_base != xmlMemBlocks()) {
8715            printf("Leak of %d blocks found in xmlCharEncInFunc",
8716	           xmlMemBlocks() - mem_base);
8717	    test_ret++;
8718            printf(" %d", n_handler);
8719            printf(" %d", n_out);
8720            printf(" %d", n_in);
8721            printf("\n");
8722        }
8723    }
8724    }
8725    }
8726    function_tests++;
8727
8728    return(test_ret);
8729}
8730
8731
8732static int
8733test_xmlCharEncOutFunc(void) {
8734    int test_ret = 0;
8735
8736    int mem_base;
8737    int ret_val;
8738    xmlCharEncodingHandler * handler; /* char enconding transformation data structure */
8739    int n_handler;
8740    xmlBufferPtr out; /* an xmlBuffer for the output. */
8741    int n_out;
8742    xmlBufferPtr in; /* an xmlBuffer for the input */
8743    int n_in;
8744
8745    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) {
8746    for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) {
8747    for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) {
8748        mem_base = xmlMemBlocks();
8749        handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0);
8750        out = gen_xmlBufferPtr(n_out, 1);
8751        in = gen_xmlBufferPtr(n_in, 2);
8752
8753        ret_val = xmlCharEncOutFunc(handler, out, in);
8754        desret_int(ret_val);
8755        call_tests++;
8756        des_xmlCharEncodingHandler_ptr(n_handler, handler, 0);
8757        des_xmlBufferPtr(n_out, out, 1);
8758        des_xmlBufferPtr(n_in, in, 2);
8759        xmlResetLastError();
8760        if (mem_base != xmlMemBlocks()) {
8761            printf("Leak of %d blocks found in xmlCharEncOutFunc",
8762	           xmlMemBlocks() - mem_base);
8763	    test_ret++;
8764            printf(" %d", n_handler);
8765            printf(" %d", n_out);
8766            printf(" %d", n_in);
8767            printf("\n");
8768        }
8769    }
8770    }
8771    }
8772    function_tests++;
8773
8774    return(test_ret);
8775}
8776
8777
8778static int
8779test_xmlCleanupCharEncodingHandlers(void) {
8780    int test_ret = 0;
8781
8782
8783
8784        xmlCleanupCharEncodingHandlers();
8785        call_tests++;
8786        xmlResetLastError();
8787    function_tests++;
8788
8789    return(test_ret);
8790}
8791
8792
8793static int
8794test_xmlCleanupEncodingAliases(void) {
8795    int test_ret = 0;
8796
8797    int mem_base;
8798
8799        mem_base = xmlMemBlocks();
8800
8801        xmlCleanupEncodingAliases();
8802        call_tests++;
8803        xmlResetLastError();
8804        if (mem_base != xmlMemBlocks()) {
8805            printf("Leak of %d blocks found in xmlCleanupEncodingAliases",
8806	           xmlMemBlocks() - mem_base);
8807	    test_ret++;
8808            printf("\n");
8809        }
8810    function_tests++;
8811
8812    return(test_ret);
8813}
8814
8815
8816static int
8817test_xmlDelEncodingAlias(void) {
8818    int test_ret = 0;
8819
8820    int mem_base;
8821    int ret_val;
8822    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8823    int n_alias;
8824
8825    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8826        mem_base = xmlMemBlocks();
8827        alias = gen_const_char_ptr(n_alias, 0);
8828
8829        ret_val = xmlDelEncodingAlias((const char *)alias);
8830        desret_int(ret_val);
8831        call_tests++;
8832        des_const_char_ptr(n_alias, (const char *)alias, 0);
8833        xmlResetLastError();
8834        if (mem_base != xmlMemBlocks()) {
8835            printf("Leak of %d blocks found in xmlDelEncodingAlias",
8836	           xmlMemBlocks() - mem_base);
8837	    test_ret++;
8838            printf(" %d", n_alias);
8839            printf("\n");
8840        }
8841    }
8842    function_tests++;
8843
8844    return(test_ret);
8845}
8846
8847
8848static int
8849test_xmlDetectCharEncoding(void) {
8850    int test_ret = 0;
8851
8852    int mem_base;
8853    xmlCharEncoding ret_val;
8854    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). */
8855    int n_in;
8856    int len; /* pointer to the length of the buffer */
8857    int n_len;
8858
8859    for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) {
8860    for (n_len = 0;n_len < gen_nb_int;n_len++) {
8861        mem_base = xmlMemBlocks();
8862        in = gen_const_unsigned_char_ptr(n_in, 0);
8863        len = gen_int(n_len, 1);
8864
8865        ret_val = xmlDetectCharEncoding((const unsigned char *)in, len);
8866        desret_xmlCharEncoding(ret_val);
8867        call_tests++;
8868        des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0);
8869        des_int(n_len, len, 1);
8870        xmlResetLastError();
8871        if (mem_base != xmlMemBlocks()) {
8872            printf("Leak of %d blocks found in xmlDetectCharEncoding",
8873	           xmlMemBlocks() - mem_base);
8874	    test_ret++;
8875            printf(" %d", n_in);
8876            printf(" %d", n_len);
8877            printf("\n");
8878        }
8879    }
8880    }
8881    function_tests++;
8882
8883    return(test_ret);
8884}
8885
8886
8887static int
8888test_xmlFindCharEncodingHandler(void) {
8889    int test_ret = 0;
8890
8891
8892    /* missing type support */
8893    return(test_ret);
8894}
8895
8896
8897static int
8898test_xmlGetCharEncodingHandler(void) {
8899    int test_ret = 0;
8900
8901
8902    /* missing type support */
8903    return(test_ret);
8904}
8905
8906
8907static int
8908test_xmlGetCharEncodingName(void) {
8909    int test_ret = 0;
8910
8911    int mem_base;
8912    const char * ret_val;
8913    xmlCharEncoding enc; /* the encoding */
8914    int n_enc;
8915
8916    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
8917        mem_base = xmlMemBlocks();
8918        enc = gen_xmlCharEncoding(n_enc, 0);
8919
8920        ret_val = xmlGetCharEncodingName(enc);
8921        desret_const_char_ptr(ret_val);
8922        call_tests++;
8923        des_xmlCharEncoding(n_enc, enc, 0);
8924        xmlResetLastError();
8925        if (mem_base != xmlMemBlocks()) {
8926            printf("Leak of %d blocks found in xmlGetCharEncodingName",
8927	           xmlMemBlocks() - mem_base);
8928	    test_ret++;
8929            printf(" %d", n_enc);
8930            printf("\n");
8931        }
8932    }
8933    function_tests++;
8934
8935    return(test_ret);
8936}
8937
8938
8939static int
8940test_xmlGetEncodingAlias(void) {
8941    int test_ret = 0;
8942
8943    int mem_base;
8944    const char * ret_val;
8945    char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */
8946    int n_alias;
8947
8948    for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) {
8949        mem_base = xmlMemBlocks();
8950        alias = gen_const_char_ptr(n_alias, 0);
8951
8952        ret_val = xmlGetEncodingAlias((const char *)alias);
8953        desret_const_char_ptr(ret_val);
8954        call_tests++;
8955        des_const_char_ptr(n_alias, (const char *)alias, 0);
8956        xmlResetLastError();
8957        if (mem_base != xmlMemBlocks()) {
8958            printf("Leak of %d blocks found in xmlGetEncodingAlias",
8959	           xmlMemBlocks() - mem_base);
8960	    test_ret++;
8961            printf(" %d", n_alias);
8962            printf("\n");
8963        }
8964    }
8965    function_tests++;
8966
8967    return(test_ret);
8968}
8969
8970
8971static int
8972test_xmlInitCharEncodingHandlers(void) {
8973    int test_ret = 0;
8974
8975
8976
8977        xmlInitCharEncodingHandlers();
8978        call_tests++;
8979        xmlResetLastError();
8980    function_tests++;
8981
8982    return(test_ret);
8983}
8984
8985
8986static int
8987test_xmlNewCharEncodingHandler(void) {
8988    int test_ret = 0;
8989
8990
8991    /* missing type support */
8992    return(test_ret);
8993}
8994
8995
8996static int
8997test_xmlParseCharEncoding(void) {
8998    int test_ret = 0;
8999
9000    int mem_base;
9001    xmlCharEncoding ret_val;
9002    char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */
9003    int n_name;
9004
9005    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
9006        mem_base = xmlMemBlocks();
9007        name = gen_const_char_ptr(n_name, 0);
9008
9009        ret_val = xmlParseCharEncoding((const char *)name);
9010        desret_xmlCharEncoding(ret_val);
9011        call_tests++;
9012        des_const_char_ptr(n_name, (const char *)name, 0);
9013        xmlResetLastError();
9014        if (mem_base != xmlMemBlocks()) {
9015            printf("Leak of %d blocks found in xmlParseCharEncoding",
9016	           xmlMemBlocks() - mem_base);
9017	    test_ret++;
9018            printf(" %d", n_name);
9019            printf("\n");
9020        }
9021    }
9022    function_tests++;
9023
9024    return(test_ret);
9025}
9026
9027
9028#define gen_nb_xmlCharEncodingHandlerPtr 1
9029static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9030    return(NULL);
9031}
9032static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9033}
9034
9035static int
9036test_xmlRegisterCharEncodingHandler(void) {
9037    int test_ret = 0;
9038
9039    int mem_base;
9040    xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */
9041    int n_handler;
9042
9043    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
9044        mem_base = xmlMemBlocks();
9045        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0);
9046
9047        xmlRegisterCharEncodingHandler(handler);
9048        call_tests++;
9049        des_xmlCharEncodingHandlerPtr(n_handler, handler, 0);
9050        xmlResetLastError();
9051        if (mem_base != xmlMemBlocks()) {
9052            printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler",
9053	           xmlMemBlocks() - mem_base);
9054	    test_ret++;
9055            printf(" %d", n_handler);
9056            printf("\n");
9057        }
9058    }
9059    function_tests++;
9060
9061    return(test_ret);
9062}
9063
9064static int
9065test_encoding(void) {
9066    int test_ret = 0;
9067
9068    if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n");
9069    test_ret += test_UTF8Toisolat1();
9070    test_ret += test_isolat1ToUTF8();
9071    test_ret += test_xmlAddEncodingAlias();
9072    test_ret += test_xmlCharEncCloseFunc();
9073    test_ret += test_xmlCharEncFirstLine();
9074    test_ret += test_xmlCharEncInFunc();
9075    test_ret += test_xmlCharEncOutFunc();
9076    test_ret += test_xmlCleanupCharEncodingHandlers();
9077    test_ret += test_xmlCleanupEncodingAliases();
9078    test_ret += test_xmlDelEncodingAlias();
9079    test_ret += test_xmlDetectCharEncoding();
9080    test_ret += test_xmlFindCharEncodingHandler();
9081    test_ret += test_xmlGetCharEncodingHandler();
9082    test_ret += test_xmlGetCharEncodingName();
9083    test_ret += test_xmlGetEncodingAlias();
9084    test_ret += test_xmlInitCharEncodingHandlers();
9085    test_ret += test_xmlNewCharEncodingHandler();
9086    test_ret += test_xmlParseCharEncoding();
9087    test_ret += test_xmlRegisterCharEncodingHandler();
9088
9089    if (test_ret != 0)
9090	printf("Module encoding: %d errors\n", test_ret);
9091    return(test_ret);
9092}
9093
9094static int
9095test_xmlAddDocEntity(void) {
9096    int test_ret = 0;
9097
9098    int mem_base;
9099    xmlEntityPtr ret_val;
9100    xmlDocPtr doc; /* the document */
9101    int n_doc;
9102    xmlChar * name; /* the entity name */
9103    int n_name;
9104    int type; /* the entity type XML_xxx_yyy_ENTITY */
9105    int n_type;
9106    xmlChar * ExternalID; /* the entity external ID if available */
9107    int n_ExternalID;
9108    xmlChar * SystemID; /* the entity system ID if available */
9109    int n_SystemID;
9110    xmlChar * content; /* the entity content */
9111    int n_content;
9112
9113    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9114    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9115    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9116    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9117    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9118    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9119        mem_base = xmlMemBlocks();
9120        doc = gen_xmlDocPtr(n_doc, 0);
9121        name = gen_const_xmlChar_ptr(n_name, 1);
9122        type = gen_int(n_type, 2);
9123        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9124        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9125        content = gen_const_xmlChar_ptr(n_content, 5);
9126
9127        ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9128        desret_xmlEntityPtr(ret_val);
9129        call_tests++;
9130        des_xmlDocPtr(n_doc, doc, 0);
9131        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9132        des_int(n_type, type, 2);
9133        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9134        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9135        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9136        xmlResetLastError();
9137        if (mem_base != xmlMemBlocks()) {
9138            printf("Leak of %d blocks found in xmlAddDocEntity",
9139	           xmlMemBlocks() - mem_base);
9140	    test_ret++;
9141            printf(" %d", n_doc);
9142            printf(" %d", n_name);
9143            printf(" %d", n_type);
9144            printf(" %d", n_ExternalID);
9145            printf(" %d", n_SystemID);
9146            printf(" %d", n_content);
9147            printf("\n");
9148        }
9149    }
9150    }
9151    }
9152    }
9153    }
9154    }
9155    function_tests++;
9156
9157    return(test_ret);
9158}
9159
9160
9161static int
9162test_xmlAddDtdEntity(void) {
9163    int test_ret = 0;
9164
9165    int mem_base;
9166    xmlEntityPtr ret_val;
9167    xmlDocPtr doc; /* the document */
9168    int n_doc;
9169    xmlChar * name; /* the entity name */
9170    int n_name;
9171    int type; /* the entity type XML_xxx_yyy_ENTITY */
9172    int n_type;
9173    xmlChar * ExternalID; /* the entity external ID if available */
9174    int n_ExternalID;
9175    xmlChar * SystemID; /* the entity system ID if available */
9176    int n_SystemID;
9177    xmlChar * content; /* the entity content */
9178    int n_content;
9179
9180    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9181    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9182    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9183    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9184    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9185    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9186        mem_base = xmlMemBlocks();
9187        doc = gen_xmlDocPtr(n_doc, 0);
9188        name = gen_const_xmlChar_ptr(n_name, 1);
9189        type = gen_int(n_type, 2);
9190        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9191        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9192        content = gen_const_xmlChar_ptr(n_content, 5);
9193
9194        ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9195        desret_xmlEntityPtr(ret_val);
9196        call_tests++;
9197        des_xmlDocPtr(n_doc, doc, 0);
9198        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9199        des_int(n_type, type, 2);
9200        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9201        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9202        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9203        xmlResetLastError();
9204        if (mem_base != xmlMemBlocks()) {
9205            printf("Leak of %d blocks found in xmlAddDtdEntity",
9206	           xmlMemBlocks() - mem_base);
9207	    test_ret++;
9208            printf(" %d", n_doc);
9209            printf(" %d", n_name);
9210            printf(" %d", n_type);
9211            printf(" %d", n_ExternalID);
9212            printf(" %d", n_SystemID);
9213            printf(" %d", n_content);
9214            printf("\n");
9215        }
9216    }
9217    }
9218    }
9219    }
9220    }
9221    }
9222    function_tests++;
9223
9224    return(test_ret);
9225}
9226
9227
9228static int
9229test_xmlCleanupPredefinedEntities(void) {
9230    int test_ret = 0;
9231
9232#if defined(LIBXML_LEGACY_ENABLED)
9233#ifdef LIBXML_LEGACY_ENABLED
9234    int mem_base;
9235
9236        mem_base = xmlMemBlocks();
9237
9238        xmlCleanupPredefinedEntities();
9239        call_tests++;
9240        xmlResetLastError();
9241        if (mem_base != xmlMemBlocks()) {
9242            printf("Leak of %d blocks found in xmlCleanupPredefinedEntities",
9243	           xmlMemBlocks() - mem_base);
9244	    test_ret++;
9245            printf("\n");
9246        }
9247    function_tests++;
9248#endif
9249#endif
9250
9251    return(test_ret);
9252}
9253
9254
9255#define gen_nb_xmlEntitiesTablePtr 1
9256static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9257    return(NULL);
9258}
9259static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9260}
9261
9262static int
9263test_xmlCopyEntitiesTable(void) {
9264    int test_ret = 0;
9265
9266
9267    /* missing type support */
9268    return(test_ret);
9269}
9270
9271
9272static int
9273test_xmlCreateEntitiesTable(void) {
9274    int test_ret = 0;
9275
9276
9277    /* missing type support */
9278    return(test_ret);
9279}
9280
9281
9282static int
9283test_xmlDumpEntitiesTable(void) {
9284    int test_ret = 0;
9285
9286#if defined(LIBXML_OUTPUT_ENABLED)
9287    int mem_base;
9288    xmlBufferPtr buf; /* An XML buffer. */
9289    int n_buf;
9290    xmlEntitiesTablePtr table; /* An entity table */
9291    int n_table;
9292
9293    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9294    for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) {
9295        mem_base = xmlMemBlocks();
9296        buf = gen_xmlBufferPtr(n_buf, 0);
9297        table = gen_xmlEntitiesTablePtr(n_table, 1);
9298
9299        xmlDumpEntitiesTable(buf, table);
9300        call_tests++;
9301        des_xmlBufferPtr(n_buf, buf, 0);
9302        des_xmlEntitiesTablePtr(n_table, table, 1);
9303        xmlResetLastError();
9304        if (mem_base != xmlMemBlocks()) {
9305            printf("Leak of %d blocks found in xmlDumpEntitiesTable",
9306	           xmlMemBlocks() - mem_base);
9307	    test_ret++;
9308            printf(" %d", n_buf);
9309            printf(" %d", n_table);
9310            printf("\n");
9311        }
9312    }
9313    }
9314    function_tests++;
9315#endif
9316
9317    return(test_ret);
9318}
9319
9320
9321#define gen_nb_xmlEntityPtr 1
9322static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9323    return(NULL);
9324}
9325static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
9326}
9327
9328static int
9329test_xmlDumpEntityDecl(void) {
9330    int test_ret = 0;
9331
9332#if defined(LIBXML_OUTPUT_ENABLED)
9333    int mem_base;
9334    xmlBufferPtr buf; /* An XML buffer. */
9335    int n_buf;
9336    xmlEntityPtr ent; /* An entity table */
9337    int n_ent;
9338
9339    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
9340    for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) {
9341        mem_base = xmlMemBlocks();
9342        buf = gen_xmlBufferPtr(n_buf, 0);
9343        ent = gen_xmlEntityPtr(n_ent, 1);
9344
9345        xmlDumpEntityDecl(buf, ent);
9346        call_tests++;
9347        des_xmlBufferPtr(n_buf, buf, 0);
9348        des_xmlEntityPtr(n_ent, ent, 1);
9349        xmlResetLastError();
9350        if (mem_base != xmlMemBlocks()) {
9351            printf("Leak of %d blocks found in xmlDumpEntityDecl",
9352	           xmlMemBlocks() - mem_base);
9353	    test_ret++;
9354            printf(" %d", n_buf);
9355            printf(" %d", n_ent);
9356            printf("\n");
9357        }
9358    }
9359    }
9360    function_tests++;
9361#endif
9362
9363    return(test_ret);
9364}
9365
9366
9367static int
9368test_xmlEncodeEntitiesReentrant(void) {
9369    int test_ret = 0;
9370
9371    int mem_base;
9372    xmlChar * ret_val;
9373    xmlDocPtr doc; /* the document containing the string */
9374    int n_doc;
9375    xmlChar * input; /* A string to convert to XML. */
9376    int n_input;
9377
9378    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9379    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9380        mem_base = xmlMemBlocks();
9381        doc = gen_xmlDocPtr(n_doc, 0);
9382        input = gen_const_xmlChar_ptr(n_input, 1);
9383
9384        ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input);
9385        desret_xmlChar_ptr(ret_val);
9386        call_tests++;
9387        des_xmlDocPtr(n_doc, doc, 0);
9388        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9389        xmlResetLastError();
9390        if (mem_base != xmlMemBlocks()) {
9391            printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant",
9392	           xmlMemBlocks() - mem_base);
9393	    test_ret++;
9394            printf(" %d", n_doc);
9395            printf(" %d", n_input);
9396            printf("\n");
9397        }
9398    }
9399    }
9400    function_tests++;
9401
9402    return(test_ret);
9403}
9404
9405
9406static int
9407test_xmlEncodeSpecialChars(void) {
9408    int test_ret = 0;
9409
9410    int mem_base;
9411    xmlChar * ret_val;
9412    xmlDocPtr doc; /* the document containing the string */
9413    int n_doc;
9414    xmlChar * input; /* A string to convert to XML. */
9415    int n_input;
9416
9417    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9418    for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) {
9419        mem_base = xmlMemBlocks();
9420        doc = gen_xmlDocPtr(n_doc, 0);
9421        input = gen_const_xmlChar_ptr(n_input, 1);
9422
9423        ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input);
9424        desret_xmlChar_ptr(ret_val);
9425        call_tests++;
9426        des_xmlDocPtr(n_doc, doc, 0);
9427        des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1);
9428        xmlResetLastError();
9429        if (mem_base != xmlMemBlocks()) {
9430            printf("Leak of %d blocks found in xmlEncodeSpecialChars",
9431	           xmlMemBlocks() - mem_base);
9432	    test_ret++;
9433            printf(" %d", n_doc);
9434            printf(" %d", n_input);
9435            printf("\n");
9436        }
9437    }
9438    }
9439    function_tests++;
9440
9441    return(test_ret);
9442}
9443
9444
9445static int
9446test_xmlGetDocEntity(void) {
9447    int test_ret = 0;
9448
9449    int mem_base;
9450    xmlEntityPtr ret_val;
9451    xmlDocPtr doc; /* the document referencing the entity */
9452    int n_doc;
9453    xmlChar * name; /* the entity name */
9454    int n_name;
9455
9456    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9457    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9458        mem_base = xmlMemBlocks();
9459        doc = gen_xmlDocPtr(n_doc, 0);
9460        name = gen_const_xmlChar_ptr(n_name, 1);
9461
9462        ret_val = xmlGetDocEntity(doc, (const xmlChar *)name);
9463        desret_xmlEntityPtr(ret_val);
9464        call_tests++;
9465        des_xmlDocPtr(n_doc, doc, 0);
9466        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9467        xmlResetLastError();
9468        if (mem_base != xmlMemBlocks()) {
9469            printf("Leak of %d blocks found in xmlGetDocEntity",
9470	           xmlMemBlocks() - mem_base);
9471	    test_ret++;
9472            printf(" %d", n_doc);
9473            printf(" %d", n_name);
9474            printf("\n");
9475        }
9476    }
9477    }
9478    function_tests++;
9479
9480    return(test_ret);
9481}
9482
9483
9484static int
9485test_xmlGetDtdEntity(void) {
9486    int test_ret = 0;
9487
9488    int mem_base;
9489    xmlEntityPtr ret_val;
9490    xmlDocPtr doc; /* the document referencing the entity */
9491    int n_doc;
9492    xmlChar * name; /* the entity name */
9493    int n_name;
9494
9495    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9496    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9497        mem_base = xmlMemBlocks();
9498        doc = gen_xmlDocPtr(n_doc, 0);
9499        name = gen_const_xmlChar_ptr(n_name, 1);
9500
9501        ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name);
9502        desret_xmlEntityPtr(ret_val);
9503        call_tests++;
9504        des_xmlDocPtr(n_doc, doc, 0);
9505        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9506        xmlResetLastError();
9507        if (mem_base != xmlMemBlocks()) {
9508            printf("Leak of %d blocks found in xmlGetDtdEntity",
9509	           xmlMemBlocks() - mem_base);
9510	    test_ret++;
9511            printf(" %d", n_doc);
9512            printf(" %d", n_name);
9513            printf("\n");
9514        }
9515    }
9516    }
9517    function_tests++;
9518
9519    return(test_ret);
9520}
9521
9522
9523static int
9524test_xmlGetParameterEntity(void) {
9525    int test_ret = 0;
9526
9527    int mem_base;
9528    xmlEntityPtr ret_val;
9529    xmlDocPtr doc; /* the document referencing the entity */
9530    int n_doc;
9531    xmlChar * name; /* the entity name */
9532    int n_name;
9533
9534    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9535    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9536        mem_base = xmlMemBlocks();
9537        doc = gen_xmlDocPtr(n_doc, 0);
9538        name = gen_const_xmlChar_ptr(n_name, 1);
9539
9540        ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name);
9541        desret_xmlEntityPtr(ret_val);
9542        call_tests++;
9543        des_xmlDocPtr(n_doc, doc, 0);
9544        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9545        xmlResetLastError();
9546        if (mem_base != xmlMemBlocks()) {
9547            printf("Leak of %d blocks found in xmlGetParameterEntity",
9548	           xmlMemBlocks() - mem_base);
9549	    test_ret++;
9550            printf(" %d", n_doc);
9551            printf(" %d", n_name);
9552            printf("\n");
9553        }
9554    }
9555    }
9556    function_tests++;
9557
9558    return(test_ret);
9559}
9560
9561
9562static int
9563test_xmlGetPredefinedEntity(void) {
9564    int test_ret = 0;
9565
9566    int mem_base;
9567    xmlEntityPtr ret_val;
9568    xmlChar * name; /* the entity name */
9569    int n_name;
9570
9571    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9572        mem_base = xmlMemBlocks();
9573        name = gen_const_xmlChar_ptr(n_name, 0);
9574
9575        ret_val = xmlGetPredefinedEntity((const xmlChar *)name);
9576        desret_xmlEntityPtr(ret_val);
9577        call_tests++;
9578        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
9579        xmlResetLastError();
9580        if (mem_base != xmlMemBlocks()) {
9581            printf("Leak of %d blocks found in xmlGetPredefinedEntity",
9582	           xmlMemBlocks() - mem_base);
9583	    test_ret++;
9584            printf(" %d", n_name);
9585            printf("\n");
9586        }
9587    }
9588    function_tests++;
9589
9590    return(test_ret);
9591}
9592
9593
9594static int
9595test_xmlInitializePredefinedEntities(void) {
9596    int test_ret = 0;
9597
9598#if defined(LIBXML_LEGACY_ENABLED)
9599#ifdef LIBXML_LEGACY_ENABLED
9600    int mem_base;
9601
9602        mem_base = xmlMemBlocks();
9603
9604        xmlInitializePredefinedEntities();
9605        call_tests++;
9606        xmlResetLastError();
9607        if (mem_base != xmlMemBlocks()) {
9608            printf("Leak of %d blocks found in xmlInitializePredefinedEntities",
9609	           xmlMemBlocks() - mem_base);
9610	    test_ret++;
9611            printf("\n");
9612        }
9613    function_tests++;
9614#endif
9615#endif
9616
9617    return(test_ret);
9618}
9619
9620
9621static int
9622test_xmlNewEntity(void) {
9623    int test_ret = 0;
9624
9625    int mem_base;
9626    xmlEntityPtr ret_val;
9627    xmlDocPtr doc; /* the document */
9628    int n_doc;
9629    xmlChar * name; /* the entity name */
9630    int n_name;
9631    int type; /* the entity type XML_xxx_yyy_ENTITY */
9632    int n_type;
9633    xmlChar * ExternalID; /* the entity external ID if available */
9634    int n_ExternalID;
9635    xmlChar * SystemID; /* the entity system ID if available */
9636    int n_SystemID;
9637    xmlChar * content; /* the entity content */
9638    int n_content;
9639
9640    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
9641    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9642    for (n_type = 0;n_type < gen_nb_int;n_type++) {
9643    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
9644    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
9645    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
9646        mem_base = xmlMemBlocks();
9647        doc = gen_xmlDocPtr(n_doc, 0);
9648        name = gen_const_xmlChar_ptr(n_name, 1);
9649        type = gen_int(n_type, 2);
9650        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
9651        SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
9652        content = gen_const_xmlChar_ptr(n_content, 5);
9653
9654        ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
9655        desret_xmlEntityPtr(ret_val);
9656        call_tests++;
9657        des_xmlDocPtr(n_doc, doc, 0);
9658        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9659        des_int(n_type, type, 2);
9660        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
9661        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
9662        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
9663        xmlResetLastError();
9664        if (mem_base != xmlMemBlocks()) {
9665            printf("Leak of %d blocks found in xmlNewEntity",
9666	           xmlMemBlocks() - mem_base);
9667	    test_ret++;
9668            printf(" %d", n_doc);
9669            printf(" %d", n_name);
9670            printf(" %d", n_type);
9671            printf(" %d", n_ExternalID);
9672            printf(" %d", n_SystemID);
9673            printf(" %d", n_content);
9674            printf("\n");
9675        }
9676    }
9677    }
9678    }
9679    }
9680    }
9681    }
9682    function_tests++;
9683
9684    return(test_ret);
9685}
9686
9687static int
9688test_entities(void) {
9689    int test_ret = 0;
9690
9691    if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
9692    test_ret += test_xmlAddDocEntity();
9693    test_ret += test_xmlAddDtdEntity();
9694    test_ret += test_xmlCleanupPredefinedEntities();
9695    test_ret += test_xmlCopyEntitiesTable();
9696    test_ret += test_xmlCreateEntitiesTable();
9697    test_ret += test_xmlDumpEntitiesTable();
9698    test_ret += test_xmlDumpEntityDecl();
9699    test_ret += test_xmlEncodeEntitiesReentrant();
9700    test_ret += test_xmlEncodeSpecialChars();
9701    test_ret += test_xmlGetDocEntity();
9702    test_ret += test_xmlGetDtdEntity();
9703    test_ret += test_xmlGetParameterEntity();
9704    test_ret += test_xmlGetPredefinedEntity();
9705    test_ret += test_xmlInitializePredefinedEntities();
9706    test_ret += test_xmlNewEntity();
9707
9708    if (test_ret != 0)
9709	printf("Module entities: %d errors\n", test_ret);
9710    return(test_ret);
9711}
9712
9713static int
9714test_xmlHashAddEntry(void) {
9715    int test_ret = 0;
9716
9717    int mem_base;
9718    int ret_val;
9719    xmlHashTablePtr table; /* the hash table */
9720    int n_table;
9721    xmlChar * name; /* the name of the userdata */
9722    int n_name;
9723    void * userdata; /* a pointer to the userdata */
9724    int n_userdata;
9725
9726    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9727    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9728    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9729        mem_base = xmlMemBlocks();
9730        table = gen_xmlHashTablePtr(n_table, 0);
9731        name = gen_const_xmlChar_ptr(n_name, 1);
9732        userdata = gen_userdata(n_userdata, 2);
9733
9734        ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata);
9735        desret_int(ret_val);
9736        call_tests++;
9737        des_xmlHashTablePtr(n_table, table, 0);
9738        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9739        des_userdata(n_userdata, userdata, 2);
9740        xmlResetLastError();
9741        if (mem_base != xmlMemBlocks()) {
9742            printf("Leak of %d blocks found in xmlHashAddEntry",
9743	           xmlMemBlocks() - mem_base);
9744	    test_ret++;
9745            printf(" %d", n_table);
9746            printf(" %d", n_name);
9747            printf(" %d", n_userdata);
9748            printf("\n");
9749        }
9750    }
9751    }
9752    }
9753    function_tests++;
9754
9755    return(test_ret);
9756}
9757
9758
9759static int
9760test_xmlHashAddEntry2(void) {
9761    int test_ret = 0;
9762
9763    int mem_base;
9764    int ret_val;
9765    xmlHashTablePtr table; /* the hash table */
9766    int n_table;
9767    xmlChar * name; /* the name of the userdata */
9768    int n_name;
9769    xmlChar * name2; /* a second name of the userdata */
9770    int n_name2;
9771    void * userdata; /* a pointer to the userdata */
9772    int n_userdata;
9773
9774    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9775    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9776    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9777    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9778        mem_base = xmlMemBlocks();
9779        table = gen_xmlHashTablePtr(n_table, 0);
9780        name = gen_const_xmlChar_ptr(n_name, 1);
9781        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9782        userdata = gen_userdata(n_userdata, 3);
9783
9784        ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata);
9785        desret_int(ret_val);
9786        call_tests++;
9787        des_xmlHashTablePtr(n_table, table, 0);
9788        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9789        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9790        des_userdata(n_userdata, userdata, 3);
9791        xmlResetLastError();
9792        if (mem_base != xmlMemBlocks()) {
9793            printf("Leak of %d blocks found in xmlHashAddEntry2",
9794	           xmlMemBlocks() - mem_base);
9795	    test_ret++;
9796            printf(" %d", n_table);
9797            printf(" %d", n_name);
9798            printf(" %d", n_name2);
9799            printf(" %d", n_userdata);
9800            printf("\n");
9801        }
9802    }
9803    }
9804    }
9805    }
9806    function_tests++;
9807
9808    return(test_ret);
9809}
9810
9811
9812static int
9813test_xmlHashAddEntry3(void) {
9814    int test_ret = 0;
9815
9816    int mem_base;
9817    int ret_val;
9818    xmlHashTablePtr table; /* the hash table */
9819    int n_table;
9820    xmlChar * name; /* the name of the userdata */
9821    int n_name;
9822    xmlChar * name2; /* a second name of the userdata */
9823    int n_name2;
9824    xmlChar * name3; /* a third name of the userdata */
9825    int n_name3;
9826    void * userdata; /* a pointer to the userdata */
9827    int n_userdata;
9828
9829    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9830    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9831    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9832    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
9833    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
9834        mem_base = xmlMemBlocks();
9835        table = gen_xmlHashTablePtr(n_table, 0);
9836        name = gen_const_xmlChar_ptr(n_name, 1);
9837        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9838        name3 = gen_const_xmlChar_ptr(n_name3, 3);
9839        userdata = gen_userdata(n_userdata, 4);
9840
9841        ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata);
9842        desret_int(ret_val);
9843        call_tests++;
9844        des_xmlHashTablePtr(n_table, table, 0);
9845        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9846        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9847        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
9848        des_userdata(n_userdata, userdata, 4);
9849        xmlResetLastError();
9850        if (mem_base != xmlMemBlocks()) {
9851            printf("Leak of %d blocks found in xmlHashAddEntry3",
9852	           xmlMemBlocks() - mem_base);
9853	    test_ret++;
9854            printf(" %d", n_table);
9855            printf(" %d", n_name);
9856            printf(" %d", n_name2);
9857            printf(" %d", n_name3);
9858            printf(" %d", n_userdata);
9859            printf("\n");
9860        }
9861    }
9862    }
9863    }
9864    }
9865    }
9866    function_tests++;
9867
9868    return(test_ret);
9869}
9870
9871
9872static int
9873test_xmlHashCopy(void) {
9874    int test_ret = 0;
9875
9876
9877    /* missing type support */
9878    return(test_ret);
9879}
9880
9881
9882static int
9883test_xmlHashCreate(void) {
9884    int test_ret = 0;
9885
9886
9887    /* missing type support */
9888    return(test_ret);
9889}
9890
9891
9892static int
9893test_xmlHashCreateDict(void) {
9894    int test_ret = 0;
9895
9896
9897    /* missing type support */
9898    return(test_ret);
9899}
9900
9901
9902static int
9903test_xmlHashLookup(void) {
9904    int test_ret = 0;
9905
9906    int mem_base;
9907    void * ret_val;
9908    xmlHashTablePtr table; /* the hash table */
9909    int n_table;
9910    xmlChar * name; /* the name of the userdata */
9911    int n_name;
9912
9913    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9914    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9915        mem_base = xmlMemBlocks();
9916        table = gen_xmlHashTablePtr(n_table, 0);
9917        name = gen_const_xmlChar_ptr(n_name, 1);
9918
9919        ret_val = xmlHashLookup(table, (const xmlChar *)name);
9920        desret_void_ptr(ret_val);
9921        call_tests++;
9922        des_xmlHashTablePtr(n_table, table, 0);
9923        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9924        xmlResetLastError();
9925        if (mem_base != xmlMemBlocks()) {
9926            printf("Leak of %d blocks found in xmlHashLookup",
9927	           xmlMemBlocks() - mem_base);
9928	    test_ret++;
9929            printf(" %d", n_table);
9930            printf(" %d", n_name);
9931            printf("\n");
9932        }
9933    }
9934    }
9935    function_tests++;
9936
9937    return(test_ret);
9938}
9939
9940
9941static int
9942test_xmlHashLookup2(void) {
9943    int test_ret = 0;
9944
9945    int mem_base;
9946    void * ret_val;
9947    xmlHashTablePtr table; /* the hash table */
9948    int n_table;
9949    xmlChar * name; /* the name of the userdata */
9950    int n_name;
9951    xmlChar * name2; /* a second name of the userdata */
9952    int n_name2;
9953
9954    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
9955    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
9956    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
9957        mem_base = xmlMemBlocks();
9958        table = gen_xmlHashTablePtr(n_table, 0);
9959        name = gen_const_xmlChar_ptr(n_name, 1);
9960        name2 = gen_const_xmlChar_ptr(n_name2, 2);
9961
9962        ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2);
9963        desret_void_ptr(ret_val);
9964        call_tests++;
9965        des_xmlHashTablePtr(n_table, table, 0);
9966        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
9967        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
9968        xmlResetLastError();
9969        if (mem_base != xmlMemBlocks()) {
9970            printf("Leak of %d blocks found in xmlHashLookup2",
9971	           xmlMemBlocks() - mem_base);
9972	    test_ret++;
9973            printf(" %d", n_table);
9974            printf(" %d", n_name);
9975            printf(" %d", n_name2);
9976            printf("\n");
9977        }
9978    }
9979    }
9980    }
9981    function_tests++;
9982
9983    return(test_ret);
9984}
9985
9986
9987static int
9988test_xmlHashLookup3(void) {
9989    int test_ret = 0;
9990
9991    int mem_base;
9992    void * ret_val;
9993    xmlHashTablePtr table; /* the hash table */
9994    int n_table;
9995    xmlChar * name; /* the name of the userdata */
9996    int n_name;
9997    xmlChar * name2; /* a second name of the userdata */
9998    int n_name2;
9999    xmlChar * name3; /* a third name of the userdata */
10000    int n_name3;
10001
10002    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10003    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10004    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10005    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10006        mem_base = xmlMemBlocks();
10007        table = gen_xmlHashTablePtr(n_table, 0);
10008        name = gen_const_xmlChar_ptr(n_name, 1);
10009        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10010        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10011
10012        ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3);
10013        desret_void_ptr(ret_val);
10014        call_tests++;
10015        des_xmlHashTablePtr(n_table, table, 0);
10016        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10017        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10018        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10019        xmlResetLastError();
10020        if (mem_base != xmlMemBlocks()) {
10021            printf("Leak of %d blocks found in xmlHashLookup3",
10022	           xmlMemBlocks() - mem_base);
10023	    test_ret++;
10024            printf(" %d", n_table);
10025            printf(" %d", n_name);
10026            printf(" %d", n_name2);
10027            printf(" %d", n_name3);
10028            printf("\n");
10029        }
10030    }
10031    }
10032    }
10033    }
10034    function_tests++;
10035
10036    return(test_ret);
10037}
10038
10039
10040static int
10041test_xmlHashQLookup(void) {
10042    int test_ret = 0;
10043
10044    int mem_base;
10045    void * ret_val;
10046    xmlHashTablePtr table; /* the hash table */
10047    int n_table;
10048    xmlChar * prefix; /* the prefix of the userdata */
10049    int n_prefix;
10050    xmlChar * name; /* the name of the userdata */
10051    int n_name;
10052
10053    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10054    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10055    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10056        mem_base = xmlMemBlocks();
10057        table = gen_xmlHashTablePtr(n_table, 0);
10058        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10059        name = gen_const_xmlChar_ptr(n_name, 2);
10060
10061        ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name);
10062        desret_void_ptr(ret_val);
10063        call_tests++;
10064        des_xmlHashTablePtr(n_table, table, 0);
10065        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10066        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10067        xmlResetLastError();
10068        if (mem_base != xmlMemBlocks()) {
10069            printf("Leak of %d blocks found in xmlHashQLookup",
10070	           xmlMemBlocks() - mem_base);
10071	    test_ret++;
10072            printf(" %d", n_table);
10073            printf(" %d", n_prefix);
10074            printf(" %d", n_name);
10075            printf("\n");
10076        }
10077    }
10078    }
10079    }
10080    function_tests++;
10081
10082    return(test_ret);
10083}
10084
10085
10086static int
10087test_xmlHashQLookup2(void) {
10088    int test_ret = 0;
10089
10090    int mem_base;
10091    void * ret_val;
10092    xmlHashTablePtr table; /* the hash table */
10093    int n_table;
10094    xmlChar * prefix; /* the prefix of the userdata */
10095    int n_prefix;
10096    xmlChar * name; /* the name of the userdata */
10097    int n_name;
10098    xmlChar * prefix2; /* the second prefix of the userdata */
10099    int n_prefix2;
10100    xmlChar * name2; /* a second name of the userdata */
10101    int n_name2;
10102
10103    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10104    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10105    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10106    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10107    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10108        mem_base = xmlMemBlocks();
10109        table = gen_xmlHashTablePtr(n_table, 0);
10110        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10111        name = gen_const_xmlChar_ptr(n_name, 2);
10112        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10113        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10114
10115        ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2);
10116        desret_void_ptr(ret_val);
10117        call_tests++;
10118        des_xmlHashTablePtr(n_table, table, 0);
10119        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10120        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10121        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10122        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10123        xmlResetLastError();
10124        if (mem_base != xmlMemBlocks()) {
10125            printf("Leak of %d blocks found in xmlHashQLookup2",
10126	           xmlMemBlocks() - mem_base);
10127	    test_ret++;
10128            printf(" %d", n_table);
10129            printf(" %d", n_prefix);
10130            printf(" %d", n_name);
10131            printf(" %d", n_prefix2);
10132            printf(" %d", n_name2);
10133            printf("\n");
10134        }
10135    }
10136    }
10137    }
10138    }
10139    }
10140    function_tests++;
10141
10142    return(test_ret);
10143}
10144
10145
10146static int
10147test_xmlHashQLookup3(void) {
10148    int test_ret = 0;
10149
10150    int mem_base;
10151    void * ret_val;
10152    xmlHashTablePtr table; /* the hash table */
10153    int n_table;
10154    xmlChar * prefix; /* the prefix of the userdata */
10155    int n_prefix;
10156    xmlChar * name; /* the name of the userdata */
10157    int n_name;
10158    xmlChar * prefix2; /* the second prefix of the userdata */
10159    int n_prefix2;
10160    xmlChar * name2; /* a second name of the userdata */
10161    int n_name2;
10162    xmlChar * prefix3; /* the third prefix of the userdata */
10163    int n_prefix3;
10164    xmlChar * name3; /* a third name of the userdata */
10165    int n_name3;
10166
10167    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10168    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
10169    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10170    for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) {
10171    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10172    for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) {
10173    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10174        mem_base = xmlMemBlocks();
10175        table = gen_xmlHashTablePtr(n_table, 0);
10176        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
10177        name = gen_const_xmlChar_ptr(n_name, 2);
10178        prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3);
10179        name2 = gen_const_xmlChar_ptr(n_name2, 4);
10180        prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5);
10181        name3 = gen_const_xmlChar_ptr(n_name3, 6);
10182
10183        ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3);
10184        desret_void_ptr(ret_val);
10185        call_tests++;
10186        des_xmlHashTablePtr(n_table, table, 0);
10187        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
10188        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
10189        des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3);
10190        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4);
10191        des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5);
10192        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6);
10193        xmlResetLastError();
10194        if (mem_base != xmlMemBlocks()) {
10195            printf("Leak of %d blocks found in xmlHashQLookup3",
10196	           xmlMemBlocks() - mem_base);
10197	    test_ret++;
10198            printf(" %d", n_table);
10199            printf(" %d", n_prefix);
10200            printf(" %d", n_name);
10201            printf(" %d", n_prefix2);
10202            printf(" %d", n_name2);
10203            printf(" %d", n_prefix3);
10204            printf(" %d", n_name3);
10205            printf("\n");
10206        }
10207    }
10208    }
10209    }
10210    }
10211    }
10212    }
10213    }
10214    function_tests++;
10215
10216    return(test_ret);
10217}
10218
10219
10220static int
10221test_xmlHashRemoveEntry(void) {
10222    int test_ret = 0;
10223
10224    int mem_base;
10225    int ret_val;
10226    xmlHashTablePtr table; /* the hash table */
10227    int n_table;
10228    xmlChar * name; /* the name of the userdata */
10229    int n_name;
10230    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10231    int n_f;
10232
10233    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10234    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10235    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10236        mem_base = xmlMemBlocks();
10237        table = gen_xmlHashTablePtr(n_table, 0);
10238        name = gen_const_xmlChar_ptr(n_name, 1);
10239        f = gen_xmlHashDeallocator(n_f, 2);
10240
10241        ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f);
10242        desret_int(ret_val);
10243        call_tests++;
10244        des_xmlHashTablePtr(n_table, table, 0);
10245        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10246        des_xmlHashDeallocator(n_f, f, 2);
10247        xmlResetLastError();
10248        if (mem_base != xmlMemBlocks()) {
10249            printf("Leak of %d blocks found in xmlHashRemoveEntry",
10250	           xmlMemBlocks() - mem_base);
10251	    test_ret++;
10252            printf(" %d", n_table);
10253            printf(" %d", n_name);
10254            printf(" %d", n_f);
10255            printf("\n");
10256        }
10257    }
10258    }
10259    }
10260    function_tests++;
10261
10262    return(test_ret);
10263}
10264
10265
10266static int
10267test_xmlHashRemoveEntry2(void) {
10268    int test_ret = 0;
10269
10270    int mem_base;
10271    int ret_val;
10272    xmlHashTablePtr table; /* the hash table */
10273    int n_table;
10274    xmlChar * name; /* the name of the userdata */
10275    int n_name;
10276    xmlChar * name2; /* a second name of the userdata */
10277    int n_name2;
10278    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10279    int n_f;
10280
10281    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10282    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10283    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10284    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10285        mem_base = xmlMemBlocks();
10286        table = gen_xmlHashTablePtr(n_table, 0);
10287        name = gen_const_xmlChar_ptr(n_name, 1);
10288        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10289        f = gen_xmlHashDeallocator(n_f, 3);
10290
10291        ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f);
10292        desret_int(ret_val);
10293        call_tests++;
10294        des_xmlHashTablePtr(n_table, table, 0);
10295        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10296        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10297        des_xmlHashDeallocator(n_f, f, 3);
10298        xmlResetLastError();
10299        if (mem_base != xmlMemBlocks()) {
10300            printf("Leak of %d blocks found in xmlHashRemoveEntry2",
10301	           xmlMemBlocks() - mem_base);
10302	    test_ret++;
10303            printf(" %d", n_table);
10304            printf(" %d", n_name);
10305            printf(" %d", n_name2);
10306            printf(" %d", n_f);
10307            printf("\n");
10308        }
10309    }
10310    }
10311    }
10312    }
10313    function_tests++;
10314
10315    return(test_ret);
10316}
10317
10318
10319static int
10320test_xmlHashRemoveEntry3(void) {
10321    int test_ret = 0;
10322
10323    int mem_base;
10324    int ret_val;
10325    xmlHashTablePtr table; /* the hash table */
10326    int n_table;
10327    xmlChar * name; /* the name of the userdata */
10328    int n_name;
10329    xmlChar * name2; /* a second name of the userdata */
10330    int n_name2;
10331    xmlChar * name3; /* a third name of the userdata */
10332    int n_name3;
10333    xmlHashDeallocator f; /* the deallocator function for removed item (if any) */
10334    int n_f;
10335
10336    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10337    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10338    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10339    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10340    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10341        mem_base = xmlMemBlocks();
10342        table = gen_xmlHashTablePtr(n_table, 0);
10343        name = gen_const_xmlChar_ptr(n_name, 1);
10344        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10345        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10346        f = gen_xmlHashDeallocator(n_f, 4);
10347
10348        ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f);
10349        desret_int(ret_val);
10350        call_tests++;
10351        des_xmlHashTablePtr(n_table, table, 0);
10352        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10353        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10354        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10355        des_xmlHashDeallocator(n_f, f, 4);
10356        xmlResetLastError();
10357        if (mem_base != xmlMemBlocks()) {
10358            printf("Leak of %d blocks found in xmlHashRemoveEntry3",
10359	           xmlMemBlocks() - mem_base);
10360	    test_ret++;
10361            printf(" %d", n_table);
10362            printf(" %d", n_name);
10363            printf(" %d", n_name2);
10364            printf(" %d", n_name3);
10365            printf(" %d", n_f);
10366            printf("\n");
10367        }
10368    }
10369    }
10370    }
10371    }
10372    }
10373    function_tests++;
10374
10375    return(test_ret);
10376}
10377
10378
10379static int
10380test_xmlHashScan(void) {
10381    int test_ret = 0;
10382
10383
10384    /* missing type support */
10385    return(test_ret);
10386}
10387
10388
10389static int
10390test_xmlHashScan3(void) {
10391    int test_ret = 0;
10392
10393
10394    /* missing type support */
10395    return(test_ret);
10396}
10397
10398
10399static int
10400test_xmlHashScanFull(void) {
10401    int test_ret = 0;
10402
10403
10404    /* missing type support */
10405    return(test_ret);
10406}
10407
10408
10409static int
10410test_xmlHashScanFull3(void) {
10411    int test_ret = 0;
10412
10413
10414    /* missing type support */
10415    return(test_ret);
10416}
10417
10418
10419static int
10420test_xmlHashSize(void) {
10421    int test_ret = 0;
10422
10423    int mem_base;
10424    int ret_val;
10425    xmlHashTablePtr table; /* the hash table */
10426    int n_table;
10427
10428    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10429        mem_base = xmlMemBlocks();
10430        table = gen_xmlHashTablePtr(n_table, 0);
10431
10432        ret_val = xmlHashSize(table);
10433        desret_int(ret_val);
10434        call_tests++;
10435        des_xmlHashTablePtr(n_table, table, 0);
10436        xmlResetLastError();
10437        if (mem_base != xmlMemBlocks()) {
10438            printf("Leak of %d blocks found in xmlHashSize",
10439	           xmlMemBlocks() - mem_base);
10440	    test_ret++;
10441            printf(" %d", n_table);
10442            printf("\n");
10443        }
10444    }
10445    function_tests++;
10446
10447    return(test_ret);
10448}
10449
10450
10451static int
10452test_xmlHashUpdateEntry(void) {
10453    int test_ret = 0;
10454
10455    int mem_base;
10456    int ret_val;
10457    xmlHashTablePtr table; /* the hash table */
10458    int n_table;
10459    xmlChar * name; /* the name of the userdata */
10460    int n_name;
10461    void * userdata; /* a pointer to the userdata */
10462    int n_userdata;
10463    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10464    int n_f;
10465
10466    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10467    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10468    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10469    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10470        mem_base = xmlMemBlocks();
10471        table = gen_xmlHashTablePtr(n_table, 0);
10472        name = gen_const_xmlChar_ptr(n_name, 1);
10473        userdata = gen_userdata(n_userdata, 2);
10474        f = gen_xmlHashDeallocator(n_f, 3);
10475
10476        ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f);
10477        desret_int(ret_val);
10478        call_tests++;
10479        des_xmlHashTablePtr(n_table, table, 0);
10480        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10481        des_userdata(n_userdata, userdata, 2);
10482        des_xmlHashDeallocator(n_f, f, 3);
10483        xmlResetLastError();
10484        if (mem_base != xmlMemBlocks()) {
10485            printf("Leak of %d blocks found in xmlHashUpdateEntry",
10486	           xmlMemBlocks() - mem_base);
10487	    test_ret++;
10488            printf(" %d", n_table);
10489            printf(" %d", n_name);
10490            printf(" %d", n_userdata);
10491            printf(" %d", n_f);
10492            printf("\n");
10493        }
10494    }
10495    }
10496    }
10497    }
10498    function_tests++;
10499
10500    return(test_ret);
10501}
10502
10503
10504static int
10505test_xmlHashUpdateEntry2(void) {
10506    int test_ret = 0;
10507
10508    int mem_base;
10509    int ret_val;
10510    xmlHashTablePtr table; /* the hash table */
10511    int n_table;
10512    xmlChar * name; /* the name of the userdata */
10513    int n_name;
10514    xmlChar * name2; /* a second name of the userdata */
10515    int n_name2;
10516    void * userdata; /* a pointer to the userdata */
10517    int n_userdata;
10518    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10519    int n_f;
10520
10521    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10522    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10523    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10524    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10525    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10526        mem_base = xmlMemBlocks();
10527        table = gen_xmlHashTablePtr(n_table, 0);
10528        name = gen_const_xmlChar_ptr(n_name, 1);
10529        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10530        userdata = gen_userdata(n_userdata, 3);
10531        f = gen_xmlHashDeallocator(n_f, 4);
10532
10533        ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f);
10534        desret_int(ret_val);
10535        call_tests++;
10536        des_xmlHashTablePtr(n_table, table, 0);
10537        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10538        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10539        des_userdata(n_userdata, userdata, 3);
10540        des_xmlHashDeallocator(n_f, f, 4);
10541        xmlResetLastError();
10542        if (mem_base != xmlMemBlocks()) {
10543            printf("Leak of %d blocks found in xmlHashUpdateEntry2",
10544	           xmlMemBlocks() - mem_base);
10545	    test_ret++;
10546            printf(" %d", n_table);
10547            printf(" %d", n_name);
10548            printf(" %d", n_name2);
10549            printf(" %d", n_userdata);
10550            printf(" %d", n_f);
10551            printf("\n");
10552        }
10553    }
10554    }
10555    }
10556    }
10557    }
10558    function_tests++;
10559
10560    return(test_ret);
10561}
10562
10563
10564static int
10565test_xmlHashUpdateEntry3(void) {
10566    int test_ret = 0;
10567
10568    int mem_base;
10569    int ret_val;
10570    xmlHashTablePtr table; /* the hash table */
10571    int n_table;
10572    xmlChar * name; /* the name of the userdata */
10573    int n_name;
10574    xmlChar * name2; /* a second name of the userdata */
10575    int n_name2;
10576    xmlChar * name3; /* a third name of the userdata */
10577    int n_name3;
10578    void * userdata; /* a pointer to the userdata */
10579    int n_userdata;
10580    xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */
10581    int n_f;
10582
10583    for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) {
10584    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
10585    for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) {
10586    for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) {
10587    for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) {
10588    for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) {
10589        mem_base = xmlMemBlocks();
10590        table = gen_xmlHashTablePtr(n_table, 0);
10591        name = gen_const_xmlChar_ptr(n_name, 1);
10592        name2 = gen_const_xmlChar_ptr(n_name2, 2);
10593        name3 = gen_const_xmlChar_ptr(n_name3, 3);
10594        userdata = gen_userdata(n_userdata, 4);
10595        f = gen_xmlHashDeallocator(n_f, 5);
10596
10597        ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f);
10598        desret_int(ret_val);
10599        call_tests++;
10600        des_xmlHashTablePtr(n_table, table, 0);
10601        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
10602        des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2);
10603        des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3);
10604        des_userdata(n_userdata, userdata, 4);
10605        des_xmlHashDeallocator(n_f, f, 5);
10606        xmlResetLastError();
10607        if (mem_base != xmlMemBlocks()) {
10608            printf("Leak of %d blocks found in xmlHashUpdateEntry3",
10609	           xmlMemBlocks() - mem_base);
10610	    test_ret++;
10611            printf(" %d", n_table);
10612            printf(" %d", n_name);
10613            printf(" %d", n_name2);
10614            printf(" %d", n_name3);
10615            printf(" %d", n_userdata);
10616            printf(" %d", n_f);
10617            printf("\n");
10618        }
10619    }
10620    }
10621    }
10622    }
10623    }
10624    }
10625    function_tests++;
10626
10627    return(test_ret);
10628}
10629
10630static int
10631test_hash(void) {
10632    int test_ret = 0;
10633
10634    if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n");
10635    test_ret += test_xmlHashAddEntry();
10636    test_ret += test_xmlHashAddEntry2();
10637    test_ret += test_xmlHashAddEntry3();
10638    test_ret += test_xmlHashCopy();
10639    test_ret += test_xmlHashCreate();
10640    test_ret += test_xmlHashCreateDict();
10641    test_ret += test_xmlHashLookup();
10642    test_ret += test_xmlHashLookup2();
10643    test_ret += test_xmlHashLookup3();
10644    test_ret += test_xmlHashQLookup();
10645    test_ret += test_xmlHashQLookup2();
10646    test_ret += test_xmlHashQLookup3();
10647    test_ret += test_xmlHashRemoveEntry();
10648    test_ret += test_xmlHashRemoveEntry2();
10649    test_ret += test_xmlHashRemoveEntry3();
10650    test_ret += test_xmlHashScan();
10651    test_ret += test_xmlHashScan3();
10652    test_ret += test_xmlHashScanFull();
10653    test_ret += test_xmlHashScanFull3();
10654    test_ret += test_xmlHashSize();
10655    test_ret += test_xmlHashUpdateEntry();
10656    test_ret += test_xmlHashUpdateEntry2();
10657    test_ret += test_xmlHashUpdateEntry3();
10658
10659    if (test_ret != 0)
10660	printf("Module hash: %d errors\n", test_ret);
10661    return(test_ret);
10662}
10663
10664#define gen_nb_xmlLinkPtr 1
10665static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10666    return(NULL);
10667}
10668static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10669}
10670
10671static int
10672test_xmlLinkGetData(void) {
10673    int test_ret = 0;
10674
10675    int mem_base;
10676    void * ret_val;
10677    xmlLinkPtr lk; /* a link */
10678    int n_lk;
10679
10680    for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) {
10681        mem_base = xmlMemBlocks();
10682        lk = gen_xmlLinkPtr(n_lk, 0);
10683
10684        ret_val = xmlLinkGetData(lk);
10685        desret_void_ptr(ret_val);
10686        call_tests++;
10687        des_xmlLinkPtr(n_lk, lk, 0);
10688        xmlResetLastError();
10689        if (mem_base != xmlMemBlocks()) {
10690            printf("Leak of %d blocks found in xmlLinkGetData",
10691	           xmlMemBlocks() - mem_base);
10692	    test_ret++;
10693            printf(" %d", n_lk);
10694            printf("\n");
10695        }
10696    }
10697    function_tests++;
10698
10699    return(test_ret);
10700}
10701
10702
10703static int
10704test_xmlListAppend(void) {
10705    int test_ret = 0;
10706
10707    int mem_base;
10708    int ret_val;
10709    xmlListPtr l; /* a list */
10710    int n_l;
10711    void * data; /* the data */
10712    int n_data;
10713
10714    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10715    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10716        mem_base = xmlMemBlocks();
10717        l = gen_xmlListPtr(n_l, 0);
10718        data = gen_userdata(n_data, 1);
10719
10720        ret_val = xmlListAppend(l, data);
10721        desret_int(ret_val);
10722        call_tests++;
10723        des_xmlListPtr(n_l, l, 0);
10724        des_userdata(n_data, data, 1);
10725        xmlResetLastError();
10726        if (mem_base != xmlMemBlocks()) {
10727            printf("Leak of %d blocks found in xmlListAppend",
10728	           xmlMemBlocks() - mem_base);
10729	    test_ret++;
10730            printf(" %d", n_l);
10731            printf(" %d", n_data);
10732            printf("\n");
10733        }
10734    }
10735    }
10736    function_tests++;
10737
10738    return(test_ret);
10739}
10740
10741
10742static int
10743test_xmlListClear(void) {
10744    int test_ret = 0;
10745
10746    int mem_base;
10747    xmlListPtr l; /* a list */
10748    int n_l;
10749
10750    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10751        mem_base = xmlMemBlocks();
10752        l = gen_xmlListPtr(n_l, 0);
10753
10754        xmlListClear(l);
10755        call_tests++;
10756        des_xmlListPtr(n_l, l, 0);
10757        xmlResetLastError();
10758        if (mem_base != xmlMemBlocks()) {
10759            printf("Leak of %d blocks found in xmlListClear",
10760	           xmlMemBlocks() - mem_base);
10761	    test_ret++;
10762            printf(" %d", n_l);
10763            printf("\n");
10764        }
10765    }
10766    function_tests++;
10767
10768    return(test_ret);
10769}
10770
10771
10772#define gen_nb_const_xmlListPtr 1
10773static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10774    return(NULL);
10775}
10776static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
10777}
10778
10779static int
10780test_xmlListCopy(void) {
10781    int test_ret = 0;
10782
10783    int mem_base;
10784    int ret_val;
10785    xmlListPtr cur; /* the new list */
10786    int n_cur;
10787    xmlListPtr old; /* the old list */
10788    int n_old;
10789
10790    for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) {
10791    for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) {
10792        mem_base = xmlMemBlocks();
10793        cur = gen_xmlListPtr(n_cur, 0);
10794        old = gen_const_xmlListPtr(n_old, 1);
10795
10796        ret_val = xmlListCopy(cur, (const xmlListPtr)old);
10797        desret_int(ret_val);
10798        call_tests++;
10799        des_xmlListPtr(n_cur, cur, 0);
10800        des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1);
10801        xmlResetLastError();
10802        if (mem_base != xmlMemBlocks()) {
10803            printf("Leak of %d blocks found in xmlListCopy",
10804	           xmlMemBlocks() - mem_base);
10805	    test_ret++;
10806            printf(" %d", n_cur);
10807            printf(" %d", n_old);
10808            printf("\n");
10809        }
10810    }
10811    }
10812    function_tests++;
10813
10814    return(test_ret);
10815}
10816
10817
10818static int
10819test_xmlListCreate(void) {
10820    int test_ret = 0;
10821
10822
10823    /* missing type support */
10824    return(test_ret);
10825}
10826
10827
10828static int
10829test_xmlListDup(void) {
10830    int test_ret = 0;
10831
10832
10833    /* missing type support */
10834    return(test_ret);
10835}
10836
10837
10838static int
10839test_xmlListEmpty(void) {
10840    int test_ret = 0;
10841
10842    int mem_base;
10843    int ret_val;
10844    xmlListPtr l; /* a list */
10845    int n_l;
10846
10847    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10848        mem_base = xmlMemBlocks();
10849        l = gen_xmlListPtr(n_l, 0);
10850
10851        ret_val = xmlListEmpty(l);
10852        desret_int(ret_val);
10853        call_tests++;
10854        des_xmlListPtr(n_l, l, 0);
10855        xmlResetLastError();
10856        if (mem_base != xmlMemBlocks()) {
10857            printf("Leak of %d blocks found in xmlListEmpty",
10858	           xmlMemBlocks() - mem_base);
10859	    test_ret++;
10860            printf(" %d", n_l);
10861            printf("\n");
10862        }
10863    }
10864    function_tests++;
10865
10866    return(test_ret);
10867}
10868
10869
10870static int
10871test_xmlListEnd(void) {
10872    int test_ret = 0;
10873
10874
10875    /* missing type support */
10876    return(test_ret);
10877}
10878
10879
10880static int
10881test_xmlListFront(void) {
10882    int test_ret = 0;
10883
10884
10885    /* missing type support */
10886    return(test_ret);
10887}
10888
10889
10890static int
10891test_xmlListInsert(void) {
10892    int test_ret = 0;
10893
10894    int mem_base;
10895    int ret_val;
10896    xmlListPtr l; /* a list */
10897    int n_l;
10898    void * data; /* the data */
10899    int n_data;
10900
10901    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10902    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
10903        mem_base = xmlMemBlocks();
10904        l = gen_xmlListPtr(n_l, 0);
10905        data = gen_userdata(n_data, 1);
10906
10907        ret_val = xmlListInsert(l, data);
10908        desret_int(ret_val);
10909        call_tests++;
10910        des_xmlListPtr(n_l, l, 0);
10911        des_userdata(n_data, data, 1);
10912        xmlResetLastError();
10913        if (mem_base != xmlMemBlocks()) {
10914            printf("Leak of %d blocks found in xmlListInsert",
10915	           xmlMemBlocks() - mem_base);
10916	    test_ret++;
10917            printf(" %d", n_l);
10918            printf(" %d", n_data);
10919            printf("\n");
10920        }
10921    }
10922    }
10923    function_tests++;
10924
10925    return(test_ret);
10926}
10927
10928
10929static int
10930test_xmlListMerge(void) {
10931    int test_ret = 0;
10932
10933    int mem_base;
10934    xmlListPtr l1; /* the original list */
10935    int n_l1;
10936    xmlListPtr l2; /* the new list */
10937    int n_l2;
10938
10939    for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) {
10940    for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) {
10941        mem_base = xmlMemBlocks();
10942        l1 = gen_xmlListPtr(n_l1, 0);
10943        l2 = gen_xmlListPtr(n_l2, 1);
10944
10945        xmlListMerge(l1, l2);
10946        call_tests++;
10947        des_xmlListPtr(n_l1, l1, 0);
10948        des_xmlListPtr(n_l2, l2, 1);
10949        xmlResetLastError();
10950        if (mem_base != xmlMemBlocks()) {
10951            printf("Leak of %d blocks found in xmlListMerge",
10952	           xmlMemBlocks() - mem_base);
10953	    test_ret++;
10954            printf(" %d", n_l1);
10955            printf(" %d", n_l2);
10956            printf("\n");
10957        }
10958    }
10959    }
10960    function_tests++;
10961
10962    return(test_ret);
10963}
10964
10965
10966static int
10967test_xmlListPopBack(void) {
10968    int test_ret = 0;
10969
10970    int mem_base;
10971    xmlListPtr l; /* a list */
10972    int n_l;
10973
10974    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
10975        mem_base = xmlMemBlocks();
10976        l = gen_xmlListPtr(n_l, 0);
10977
10978        xmlListPopBack(l);
10979        call_tests++;
10980        des_xmlListPtr(n_l, l, 0);
10981        xmlResetLastError();
10982        if (mem_base != xmlMemBlocks()) {
10983            printf("Leak of %d blocks found in xmlListPopBack",
10984	           xmlMemBlocks() - mem_base);
10985	    test_ret++;
10986            printf(" %d", n_l);
10987            printf("\n");
10988        }
10989    }
10990    function_tests++;
10991
10992    return(test_ret);
10993}
10994
10995
10996static int
10997test_xmlListPopFront(void) {
10998    int test_ret = 0;
10999
11000    int mem_base;
11001    xmlListPtr l; /* a list */
11002    int n_l;
11003
11004    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11005        mem_base = xmlMemBlocks();
11006        l = gen_xmlListPtr(n_l, 0);
11007
11008        xmlListPopFront(l);
11009        call_tests++;
11010        des_xmlListPtr(n_l, l, 0);
11011        xmlResetLastError();
11012        if (mem_base != xmlMemBlocks()) {
11013            printf("Leak of %d blocks found in xmlListPopFront",
11014	           xmlMemBlocks() - mem_base);
11015	    test_ret++;
11016            printf(" %d", n_l);
11017            printf("\n");
11018        }
11019    }
11020    function_tests++;
11021
11022    return(test_ret);
11023}
11024
11025
11026static int
11027test_xmlListPushBack(void) {
11028    int test_ret = 0;
11029
11030    int mem_base;
11031    int ret_val;
11032    xmlListPtr l; /* a list */
11033    int n_l;
11034    void * data; /* new data */
11035    int n_data;
11036
11037    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11038    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11039        mem_base = xmlMemBlocks();
11040        l = gen_xmlListPtr(n_l, 0);
11041        data = gen_userdata(n_data, 1);
11042
11043        ret_val = xmlListPushBack(l, data);
11044        desret_int(ret_val);
11045        call_tests++;
11046        des_xmlListPtr(n_l, l, 0);
11047        des_userdata(n_data, data, 1);
11048        xmlResetLastError();
11049        if (mem_base != xmlMemBlocks()) {
11050            printf("Leak of %d blocks found in xmlListPushBack",
11051	           xmlMemBlocks() - mem_base);
11052	    test_ret++;
11053            printf(" %d", n_l);
11054            printf(" %d", n_data);
11055            printf("\n");
11056        }
11057    }
11058    }
11059    function_tests++;
11060
11061    return(test_ret);
11062}
11063
11064
11065static int
11066test_xmlListPushFront(void) {
11067    int test_ret = 0;
11068
11069    int mem_base;
11070    int ret_val;
11071    xmlListPtr l; /* a list */
11072    int n_l;
11073    void * data; /* new data */
11074    int n_data;
11075
11076    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11077    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11078        mem_base = xmlMemBlocks();
11079        l = gen_xmlListPtr(n_l, 0);
11080        data = gen_userdata(n_data, 1);
11081
11082        ret_val = xmlListPushFront(l, data);
11083        desret_int(ret_val);
11084        call_tests++;
11085        des_xmlListPtr(n_l, l, 0);
11086        des_userdata(n_data, data, 1);
11087        xmlResetLastError();
11088        if (mem_base != xmlMemBlocks()) {
11089            printf("Leak of %d blocks found in xmlListPushFront",
11090	           xmlMemBlocks() - mem_base);
11091	    test_ret++;
11092            printf(" %d", n_l);
11093            printf(" %d", n_data);
11094            printf("\n");
11095        }
11096    }
11097    }
11098    function_tests++;
11099
11100    return(test_ret);
11101}
11102
11103
11104static int
11105test_xmlListRemoveAll(void) {
11106    int test_ret = 0;
11107
11108    int mem_base;
11109    int ret_val;
11110    xmlListPtr l; /* a list */
11111    int n_l;
11112    void * data; /* list data */
11113    int n_data;
11114
11115    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11116    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11117        mem_base = xmlMemBlocks();
11118        l = gen_xmlListPtr(n_l, 0);
11119        data = gen_userdata(n_data, 1);
11120
11121        ret_val = xmlListRemoveAll(l, data);
11122        desret_int(ret_val);
11123        call_tests++;
11124        des_xmlListPtr(n_l, l, 0);
11125        des_userdata(n_data, data, 1);
11126        xmlResetLastError();
11127        if (mem_base != xmlMemBlocks()) {
11128            printf("Leak of %d blocks found in xmlListRemoveAll",
11129	           xmlMemBlocks() - mem_base);
11130	    test_ret++;
11131            printf(" %d", n_l);
11132            printf(" %d", n_data);
11133            printf("\n");
11134        }
11135    }
11136    }
11137    function_tests++;
11138
11139    return(test_ret);
11140}
11141
11142
11143static int
11144test_xmlListRemoveFirst(void) {
11145    int test_ret = 0;
11146
11147    int mem_base;
11148    int ret_val;
11149    xmlListPtr l; /* a list */
11150    int n_l;
11151    void * data; /* list data */
11152    int n_data;
11153
11154    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11155    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11156        mem_base = xmlMemBlocks();
11157        l = gen_xmlListPtr(n_l, 0);
11158        data = gen_userdata(n_data, 1);
11159
11160        ret_val = xmlListRemoveFirst(l, data);
11161        desret_int(ret_val);
11162        call_tests++;
11163        des_xmlListPtr(n_l, l, 0);
11164        des_userdata(n_data, data, 1);
11165        xmlResetLastError();
11166        if (mem_base != xmlMemBlocks()) {
11167            printf("Leak of %d blocks found in xmlListRemoveFirst",
11168	           xmlMemBlocks() - mem_base);
11169	    test_ret++;
11170            printf(" %d", n_l);
11171            printf(" %d", n_data);
11172            printf("\n");
11173        }
11174    }
11175    }
11176    function_tests++;
11177
11178    return(test_ret);
11179}
11180
11181
11182static int
11183test_xmlListRemoveLast(void) {
11184    int test_ret = 0;
11185
11186    int mem_base;
11187    int ret_val;
11188    xmlListPtr l; /* a list */
11189    int n_l;
11190    void * data; /* list data */
11191    int n_data;
11192
11193    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11194    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11195        mem_base = xmlMemBlocks();
11196        l = gen_xmlListPtr(n_l, 0);
11197        data = gen_userdata(n_data, 1);
11198
11199        ret_val = xmlListRemoveLast(l, data);
11200        desret_int(ret_val);
11201        call_tests++;
11202        des_xmlListPtr(n_l, l, 0);
11203        des_userdata(n_data, data, 1);
11204        xmlResetLastError();
11205        if (mem_base != xmlMemBlocks()) {
11206            printf("Leak of %d blocks found in xmlListRemoveLast",
11207	           xmlMemBlocks() - mem_base);
11208	    test_ret++;
11209            printf(" %d", n_l);
11210            printf(" %d", n_data);
11211            printf("\n");
11212        }
11213    }
11214    }
11215    function_tests++;
11216
11217    return(test_ret);
11218}
11219
11220
11221static int
11222test_xmlListReverse(void) {
11223    int test_ret = 0;
11224
11225    int mem_base;
11226    xmlListPtr l; /* a list */
11227    int n_l;
11228
11229    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11230        mem_base = xmlMemBlocks();
11231        l = gen_xmlListPtr(n_l, 0);
11232
11233        xmlListReverse(l);
11234        call_tests++;
11235        des_xmlListPtr(n_l, l, 0);
11236        xmlResetLastError();
11237        if (mem_base != xmlMemBlocks()) {
11238            printf("Leak of %d blocks found in xmlListReverse",
11239	           xmlMemBlocks() - mem_base);
11240	    test_ret++;
11241            printf(" %d", n_l);
11242            printf("\n");
11243        }
11244    }
11245    function_tests++;
11246
11247    return(test_ret);
11248}
11249
11250
11251static int
11252test_xmlListReverseSearch(void) {
11253    int test_ret = 0;
11254
11255    int mem_base;
11256    void * ret_val;
11257    xmlListPtr l; /* a list */
11258    int n_l;
11259    void * data; /* a search value */
11260    int n_data;
11261
11262    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11263    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11264        mem_base = xmlMemBlocks();
11265        l = gen_xmlListPtr(n_l, 0);
11266        data = gen_userdata(n_data, 1);
11267
11268        ret_val = xmlListReverseSearch(l, data);
11269        desret_void_ptr(ret_val);
11270        call_tests++;
11271        des_xmlListPtr(n_l, l, 0);
11272        des_userdata(n_data, data, 1);
11273        xmlResetLastError();
11274        if (mem_base != xmlMemBlocks()) {
11275            printf("Leak of %d blocks found in xmlListReverseSearch",
11276	           xmlMemBlocks() - mem_base);
11277	    test_ret++;
11278            printf(" %d", n_l);
11279            printf(" %d", n_data);
11280            printf("\n");
11281        }
11282    }
11283    }
11284    function_tests++;
11285
11286    return(test_ret);
11287}
11288
11289
11290static int
11291test_xmlListReverseWalk(void) {
11292    int test_ret = 0;
11293
11294
11295    /* missing type support */
11296    return(test_ret);
11297}
11298
11299
11300static int
11301test_xmlListSearch(void) {
11302    int test_ret = 0;
11303
11304    int mem_base;
11305    void * ret_val;
11306    xmlListPtr l; /* a list */
11307    int n_l;
11308    void * data; /* a search value */
11309    int n_data;
11310
11311    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11312    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
11313        mem_base = xmlMemBlocks();
11314        l = gen_xmlListPtr(n_l, 0);
11315        data = gen_userdata(n_data, 1);
11316
11317        ret_val = xmlListSearch(l, data);
11318        desret_void_ptr(ret_val);
11319        call_tests++;
11320        des_xmlListPtr(n_l, l, 0);
11321        des_userdata(n_data, data, 1);
11322        xmlResetLastError();
11323        if (mem_base != xmlMemBlocks()) {
11324            printf("Leak of %d blocks found in xmlListSearch",
11325	           xmlMemBlocks() - mem_base);
11326	    test_ret++;
11327            printf(" %d", n_l);
11328            printf(" %d", n_data);
11329            printf("\n");
11330        }
11331    }
11332    }
11333    function_tests++;
11334
11335    return(test_ret);
11336}
11337
11338
11339static int
11340test_xmlListSize(void) {
11341    int test_ret = 0;
11342
11343    int mem_base;
11344    int ret_val;
11345    xmlListPtr l; /* a list */
11346    int n_l;
11347
11348    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11349        mem_base = xmlMemBlocks();
11350        l = gen_xmlListPtr(n_l, 0);
11351
11352        ret_val = xmlListSize(l);
11353        desret_int(ret_val);
11354        call_tests++;
11355        des_xmlListPtr(n_l, l, 0);
11356        xmlResetLastError();
11357        if (mem_base != xmlMemBlocks()) {
11358            printf("Leak of %d blocks found in xmlListSize",
11359	           xmlMemBlocks() - mem_base);
11360	    test_ret++;
11361            printf(" %d", n_l);
11362            printf("\n");
11363        }
11364    }
11365    function_tests++;
11366
11367    return(test_ret);
11368}
11369
11370
11371static int
11372test_xmlListSort(void) {
11373    int test_ret = 0;
11374
11375    int mem_base;
11376    xmlListPtr l; /* a list */
11377    int n_l;
11378
11379    for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) {
11380        mem_base = xmlMemBlocks();
11381        l = gen_xmlListPtr(n_l, 0);
11382
11383        xmlListSort(l);
11384        call_tests++;
11385        des_xmlListPtr(n_l, l, 0);
11386        xmlResetLastError();
11387        if (mem_base != xmlMemBlocks()) {
11388            printf("Leak of %d blocks found in xmlListSort",
11389	           xmlMemBlocks() - mem_base);
11390	    test_ret++;
11391            printf(" %d", n_l);
11392            printf("\n");
11393        }
11394    }
11395    function_tests++;
11396
11397    return(test_ret);
11398}
11399
11400
11401static int
11402test_xmlListWalk(void) {
11403    int test_ret = 0;
11404
11405
11406    /* missing type support */
11407    return(test_ret);
11408}
11409
11410static int
11411test_list(void) {
11412    int test_ret = 0;
11413
11414    if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n");
11415    test_ret += test_xmlLinkGetData();
11416    test_ret += test_xmlListAppend();
11417    test_ret += test_xmlListClear();
11418    test_ret += test_xmlListCopy();
11419    test_ret += test_xmlListCreate();
11420    test_ret += test_xmlListDup();
11421    test_ret += test_xmlListEmpty();
11422    test_ret += test_xmlListEnd();
11423    test_ret += test_xmlListFront();
11424    test_ret += test_xmlListInsert();
11425    test_ret += test_xmlListMerge();
11426    test_ret += test_xmlListPopBack();
11427    test_ret += test_xmlListPopFront();
11428    test_ret += test_xmlListPushBack();
11429    test_ret += test_xmlListPushFront();
11430    test_ret += test_xmlListRemoveAll();
11431    test_ret += test_xmlListRemoveFirst();
11432    test_ret += test_xmlListRemoveLast();
11433    test_ret += test_xmlListReverse();
11434    test_ret += test_xmlListReverseSearch();
11435    test_ret += test_xmlListReverseWalk();
11436    test_ret += test_xmlListSearch();
11437    test_ret += test_xmlListSize();
11438    test_ret += test_xmlListSort();
11439    test_ret += test_xmlListWalk();
11440
11441    if (test_ret != 0)
11442	printf("Module list: %d errors\n", test_ret);
11443    return(test_ret);
11444}
11445
11446static int
11447test_xmlNanoFTPCheckResponse(void) {
11448    int test_ret = 0;
11449
11450#if defined(LIBXML_FTP_ENABLED)
11451    int mem_base;
11452    int ret_val;
11453    void * ctx; /* an FTP context */
11454    int n_ctx;
11455
11456    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11457        mem_base = xmlMemBlocks();
11458        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11459
11460        ret_val = xmlNanoFTPCheckResponse(ctx);
11461        desret_int(ret_val);
11462        call_tests++;
11463        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11464        xmlResetLastError();
11465        if (mem_base != xmlMemBlocks()) {
11466            printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
11467	           xmlMemBlocks() - mem_base);
11468	    test_ret++;
11469            printf(" %d", n_ctx);
11470            printf("\n");
11471        }
11472    }
11473    function_tests++;
11474#endif
11475
11476    return(test_ret);
11477}
11478
11479
11480static int
11481test_xmlNanoFTPCleanup(void) {
11482    int test_ret = 0;
11483
11484#if defined(LIBXML_FTP_ENABLED)
11485    int mem_base;
11486
11487        mem_base = xmlMemBlocks();
11488
11489        xmlNanoFTPCleanup();
11490        call_tests++;
11491        xmlResetLastError();
11492        if (mem_base != xmlMemBlocks()) {
11493            printf("Leak of %d blocks found in xmlNanoFTPCleanup",
11494	           xmlMemBlocks() - mem_base);
11495	    test_ret++;
11496            printf("\n");
11497        }
11498    function_tests++;
11499#endif
11500
11501    return(test_ret);
11502}
11503
11504
11505static int
11506test_xmlNanoFTPCloseConnection(void) {
11507    int test_ret = 0;
11508
11509#if defined(LIBXML_FTP_ENABLED)
11510    int mem_base;
11511    int ret_val;
11512    void * ctx; /* an FTP context */
11513    int n_ctx;
11514
11515    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11516        mem_base = xmlMemBlocks();
11517        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11518
11519        ret_val = xmlNanoFTPCloseConnection(ctx);
11520        desret_int(ret_val);
11521        call_tests++;
11522        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11523        xmlResetLastError();
11524        if (mem_base != xmlMemBlocks()) {
11525            printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
11526	           xmlMemBlocks() - mem_base);
11527	    test_ret++;
11528            printf(" %d", n_ctx);
11529            printf("\n");
11530        }
11531    }
11532    function_tests++;
11533#endif
11534
11535    return(test_ret);
11536}
11537
11538
11539static int
11540test_xmlNanoFTPCwd(void) {
11541    int test_ret = 0;
11542
11543#if defined(LIBXML_FTP_ENABLED)
11544    int mem_base;
11545    int ret_val;
11546    void * ctx; /* an FTP context */
11547    int n_ctx;
11548    char * directory; /* a directory on the server */
11549    int n_directory;
11550
11551    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11552    for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
11553        mem_base = xmlMemBlocks();
11554        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11555        directory = gen_const_char_ptr(n_directory, 1);
11556
11557        ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
11558        desret_int(ret_val);
11559        call_tests++;
11560        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11561        des_const_char_ptr(n_directory, (const char *)directory, 1);
11562        xmlResetLastError();
11563        if (mem_base != xmlMemBlocks()) {
11564            printf("Leak of %d blocks found in xmlNanoFTPCwd",
11565	           xmlMemBlocks() - mem_base);
11566	    test_ret++;
11567            printf(" %d", n_ctx);
11568            printf(" %d", n_directory);
11569            printf("\n");
11570        }
11571    }
11572    }
11573    function_tests++;
11574#endif
11575
11576    return(test_ret);
11577}
11578
11579
11580static int
11581test_xmlNanoFTPDele(void) {
11582    int test_ret = 0;
11583
11584#if defined(LIBXML_FTP_ENABLED)
11585    int mem_base;
11586    int ret_val;
11587    void * ctx; /* an FTP context */
11588    int n_ctx;
11589    const char * file; /* a file or directory on the server */
11590    int n_file;
11591
11592    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11593    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
11594        mem_base = xmlMemBlocks();
11595        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11596        file = gen_filepath(n_file, 1);
11597
11598        ret_val = xmlNanoFTPDele(ctx, file);
11599        desret_int(ret_val);
11600        call_tests++;
11601        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11602        des_filepath(n_file, file, 1);
11603        xmlResetLastError();
11604        if (mem_base != xmlMemBlocks()) {
11605            printf("Leak of %d blocks found in xmlNanoFTPDele",
11606	           xmlMemBlocks() - mem_base);
11607	    test_ret++;
11608            printf(" %d", n_ctx);
11609            printf(" %d", n_file);
11610            printf("\n");
11611        }
11612    }
11613    }
11614    function_tests++;
11615#endif
11616
11617    return(test_ret);
11618}
11619
11620
11621static int
11622test_xmlNanoFTPGet(void) {
11623    int test_ret = 0;
11624
11625
11626    /* missing type support */
11627    return(test_ret);
11628}
11629
11630
11631static int
11632test_xmlNanoFTPGetConnection(void) {
11633    int test_ret = 0;
11634
11635#if defined(LIBXML_FTP_ENABLED)
11636    int mem_base;
11637    int ret_val;
11638    void * ctx; /* an FTP context */
11639    int n_ctx;
11640
11641    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11642        mem_base = xmlMemBlocks();
11643        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11644
11645        ret_val = xmlNanoFTPGetConnection(ctx);
11646        desret_int(ret_val);
11647        call_tests++;
11648        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11649        xmlResetLastError();
11650        if (mem_base != xmlMemBlocks()) {
11651            printf("Leak of %d blocks found in xmlNanoFTPGetConnection",
11652	           xmlMemBlocks() - mem_base);
11653	    test_ret++;
11654            printf(" %d", n_ctx);
11655            printf("\n");
11656        }
11657    }
11658    function_tests++;
11659#endif
11660
11661    return(test_ret);
11662}
11663
11664
11665static int
11666test_xmlNanoFTPGetResponse(void) {
11667    int test_ret = 0;
11668
11669#if defined(LIBXML_FTP_ENABLED)
11670    int mem_base;
11671    int ret_val;
11672    void * ctx; /* an FTP context */
11673    int n_ctx;
11674
11675    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11676        mem_base = xmlMemBlocks();
11677        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11678
11679        ret_val = xmlNanoFTPGetResponse(ctx);
11680        desret_int(ret_val);
11681        call_tests++;
11682        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11683        xmlResetLastError();
11684        if (mem_base != xmlMemBlocks()) {
11685            printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
11686	           xmlMemBlocks() - mem_base);
11687	    test_ret++;
11688            printf(" %d", n_ctx);
11689            printf("\n");
11690        }
11691    }
11692    function_tests++;
11693#endif
11694
11695    return(test_ret);
11696}
11697
11698
11699static int
11700test_xmlNanoFTPGetSocket(void) {
11701    int test_ret = 0;
11702
11703#if defined(LIBXML_FTP_ENABLED)
11704    int mem_base;
11705    int ret_val;
11706    void * ctx; /* an FTP context */
11707    int n_ctx;
11708    const char * filename; /* the file to retrieve (or NULL if path is in context). */
11709    int n_filename;
11710
11711    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11712    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
11713        mem_base = xmlMemBlocks();
11714        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11715        filename = gen_filepath(n_filename, 1);
11716
11717        ret_val = xmlNanoFTPGetSocket(ctx, filename);
11718        desret_int(ret_val);
11719        call_tests++;
11720        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11721        des_filepath(n_filename, filename, 1);
11722        xmlResetLastError();
11723        if (mem_base != xmlMemBlocks()) {
11724            printf("Leak of %d blocks found in xmlNanoFTPGetSocket",
11725	           xmlMemBlocks() - mem_base);
11726	    test_ret++;
11727            printf(" %d", n_ctx);
11728            printf(" %d", n_filename);
11729            printf("\n");
11730        }
11731    }
11732    }
11733    function_tests++;
11734#endif
11735
11736    return(test_ret);
11737}
11738
11739
11740static int
11741test_xmlNanoFTPInit(void) {
11742    int test_ret = 0;
11743
11744#if defined(LIBXML_FTP_ENABLED)
11745    int mem_base;
11746
11747        mem_base = xmlMemBlocks();
11748
11749        xmlNanoFTPInit();
11750        call_tests++;
11751        xmlResetLastError();
11752        if (mem_base != xmlMemBlocks()) {
11753            printf("Leak of %d blocks found in xmlNanoFTPInit",
11754	           xmlMemBlocks() - mem_base);
11755	    test_ret++;
11756            printf("\n");
11757        }
11758    function_tests++;
11759#endif
11760
11761    return(test_ret);
11762}
11763
11764
11765static int
11766test_xmlNanoFTPList(void) {
11767    int test_ret = 0;
11768
11769
11770    /* missing type support */
11771    return(test_ret);
11772}
11773
11774
11775static int
11776test_xmlNanoFTPNewCtxt(void) {
11777    int test_ret = 0;
11778
11779#if defined(LIBXML_FTP_ENABLED)
11780    int mem_base;
11781    void * ret_val;
11782    const char * URL; /* The URL used to initialize the context */
11783    int n_URL;
11784
11785    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11786        mem_base = xmlMemBlocks();
11787        URL = gen_filepath(n_URL, 0);
11788
11789        ret_val = xmlNanoFTPNewCtxt(URL);
11790        desret_xmlNanoFTPCtxtPtr(ret_val);
11791        call_tests++;
11792        des_filepath(n_URL, URL, 0);
11793        xmlResetLastError();
11794        if (mem_base != xmlMemBlocks()) {
11795            printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
11796	           xmlMemBlocks() - mem_base);
11797	    test_ret++;
11798            printf(" %d", n_URL);
11799            printf("\n");
11800        }
11801    }
11802    function_tests++;
11803#endif
11804
11805    return(test_ret);
11806}
11807
11808
11809static int
11810test_xmlNanoFTPOpen(void) {
11811    int test_ret = 0;
11812
11813#if defined(LIBXML_FTP_ENABLED)
11814    int mem_base;
11815    void * ret_val;
11816    const char * URL; /* the URL to the resource */
11817    int n_URL;
11818
11819    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11820        mem_base = xmlMemBlocks();
11821        URL = gen_filepath(n_URL, 0);
11822
11823        ret_val = xmlNanoFTPOpen(URL);
11824        desret_xmlNanoFTPCtxtPtr(ret_val);
11825        call_tests++;
11826        des_filepath(n_URL, URL, 0);
11827        xmlResetLastError();
11828        if (mem_base != xmlMemBlocks()) {
11829            printf("Leak of %d blocks found in xmlNanoFTPOpen",
11830	           xmlMemBlocks() - mem_base);
11831	    test_ret++;
11832            printf(" %d", n_URL);
11833            printf("\n");
11834        }
11835    }
11836    function_tests++;
11837#endif
11838
11839    return(test_ret);
11840}
11841
11842
11843static int
11844test_xmlNanoFTPProxy(void) {
11845    int test_ret = 0;
11846
11847#if defined(LIBXML_FTP_ENABLED)
11848    char * host; /* the proxy host name */
11849    int n_host;
11850    int port; /* the proxy port */
11851    int n_port;
11852    char * user; /* the proxy user name */
11853    int n_user;
11854    char * passwd; /* the proxy password */
11855    int n_passwd;
11856    int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
11857    int n_type;
11858
11859    for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
11860    for (n_port = 0;n_port < gen_nb_int;n_port++) {
11861    for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
11862    for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
11863    for (n_type = 0;n_type < gen_nb_int;n_type++) {
11864        host = gen_const_char_ptr(n_host, 0);
11865        port = gen_int(n_port, 1);
11866        user = gen_const_char_ptr(n_user, 2);
11867        passwd = gen_const_char_ptr(n_passwd, 3);
11868        type = gen_int(n_type, 4);
11869
11870        xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
11871        call_tests++;
11872        des_const_char_ptr(n_host, (const char *)host, 0);
11873        des_int(n_port, port, 1);
11874        des_const_char_ptr(n_user, (const char *)user, 2);
11875        des_const_char_ptr(n_passwd, (const char *)passwd, 3);
11876        des_int(n_type, type, 4);
11877        xmlResetLastError();
11878    }
11879    }
11880    }
11881    }
11882    }
11883    function_tests++;
11884#endif
11885
11886    return(test_ret);
11887}
11888
11889
11890static int
11891test_xmlNanoFTPQuit(void) {
11892    int test_ret = 0;
11893
11894#if defined(LIBXML_FTP_ENABLED)
11895    int mem_base;
11896    int ret_val;
11897    void * ctx; /* an FTP context */
11898    int n_ctx;
11899
11900    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11901        mem_base = xmlMemBlocks();
11902        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11903
11904        ret_val = xmlNanoFTPQuit(ctx);
11905        desret_int(ret_val);
11906        call_tests++;
11907        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11908        xmlResetLastError();
11909        if (mem_base != xmlMemBlocks()) {
11910            printf("Leak of %d blocks found in xmlNanoFTPQuit",
11911	           xmlMemBlocks() - mem_base);
11912	    test_ret++;
11913            printf(" %d", n_ctx);
11914            printf("\n");
11915        }
11916    }
11917    function_tests++;
11918#endif
11919
11920    return(test_ret);
11921}
11922
11923
11924static int
11925test_xmlNanoFTPRead(void) {
11926    int test_ret = 0;
11927
11928#if defined(LIBXML_FTP_ENABLED)
11929    int mem_base;
11930    int ret_val;
11931    void * ctx; /* the FTP context */
11932    int n_ctx;
11933    void * dest; /* a buffer */
11934    int n_dest;
11935    int len; /* the buffer length */
11936    int n_len;
11937
11938    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
11939    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
11940    for (n_len = 0;n_len < gen_nb_int;n_len++) {
11941        mem_base = xmlMemBlocks();
11942        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
11943        dest = gen_void_ptr(n_dest, 1);
11944        len = gen_int(n_len, 2);
11945
11946        ret_val = xmlNanoFTPRead(ctx, dest, len);
11947        desret_int(ret_val);
11948        call_tests++;
11949        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
11950        des_void_ptr(n_dest, dest, 1);
11951        des_int(n_len, len, 2);
11952        xmlResetLastError();
11953        if (mem_base != xmlMemBlocks()) {
11954            printf("Leak of %d blocks found in xmlNanoFTPRead",
11955	           xmlMemBlocks() - mem_base);
11956	    test_ret++;
11957            printf(" %d", n_ctx);
11958            printf(" %d", n_dest);
11959            printf(" %d", n_len);
11960            printf("\n");
11961        }
11962    }
11963    }
11964    }
11965    function_tests++;
11966#endif
11967
11968    return(test_ret);
11969}
11970
11971
11972static int
11973test_xmlNanoFTPScanProxy(void) {
11974    int test_ret = 0;
11975
11976#if defined(LIBXML_FTP_ENABLED)
11977    const char * URL; /* The proxy URL used to initialize the proxy context */
11978    int n_URL;
11979
11980    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
11981        URL = gen_filepath(n_URL, 0);
11982
11983        xmlNanoFTPScanProxy(URL);
11984        call_tests++;
11985        des_filepath(n_URL, URL, 0);
11986        xmlResetLastError();
11987    }
11988    function_tests++;
11989#endif
11990
11991    return(test_ret);
11992}
11993
11994
11995static int
11996test_xmlNanoFTPUpdateURL(void) {
11997    int test_ret = 0;
11998
11999#if defined(LIBXML_FTP_ENABLED)
12000    int mem_base;
12001    int ret_val;
12002    void * ctx; /* an FTP context */
12003    int n_ctx;
12004    const char * URL; /* The URL used to update the context */
12005    int n_URL;
12006
12007    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
12008    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12009        mem_base = xmlMemBlocks();
12010        ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
12011        URL = gen_filepath(n_URL, 1);
12012
12013        ret_val = xmlNanoFTPUpdateURL(ctx, URL);
12014        desret_int(ret_val);
12015        call_tests++;
12016        des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
12017        des_filepath(n_URL, URL, 1);
12018        xmlResetLastError();
12019        if (mem_base != xmlMemBlocks()) {
12020            printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
12021	           xmlMemBlocks() - mem_base);
12022	    test_ret++;
12023            printf(" %d", n_ctx);
12024            printf(" %d", n_URL);
12025            printf("\n");
12026        }
12027    }
12028    }
12029    function_tests++;
12030#endif
12031
12032    return(test_ret);
12033}
12034
12035static int
12036test_nanoftp(void) {
12037    int test_ret = 0;
12038
12039    if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n");
12040    test_ret += test_xmlNanoFTPCheckResponse();
12041    test_ret += test_xmlNanoFTPCleanup();
12042    test_ret += test_xmlNanoFTPCloseConnection();
12043    test_ret += test_xmlNanoFTPCwd();
12044    test_ret += test_xmlNanoFTPDele();
12045    test_ret += test_xmlNanoFTPGet();
12046    test_ret += test_xmlNanoFTPGetConnection();
12047    test_ret += test_xmlNanoFTPGetResponse();
12048    test_ret += test_xmlNanoFTPGetSocket();
12049    test_ret += test_xmlNanoFTPInit();
12050    test_ret += test_xmlNanoFTPList();
12051    test_ret += test_xmlNanoFTPNewCtxt();
12052    test_ret += test_xmlNanoFTPOpen();
12053    test_ret += test_xmlNanoFTPProxy();
12054    test_ret += test_xmlNanoFTPQuit();
12055    test_ret += test_xmlNanoFTPRead();
12056    test_ret += test_xmlNanoFTPScanProxy();
12057    test_ret += test_xmlNanoFTPUpdateURL();
12058
12059    if (test_ret != 0)
12060	printf("Module nanoftp: %d errors\n", test_ret);
12061    return(test_ret);
12062}
12063
12064static int
12065test_xmlNanoHTTPAuthHeader(void) {
12066    int test_ret = 0;
12067
12068#if defined(LIBXML_HTTP_ENABLED)
12069    int mem_base;
12070    const char * ret_val;
12071    void * ctx; /* the HTTP context */
12072    int n_ctx;
12073
12074    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12075        mem_base = xmlMemBlocks();
12076        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12077
12078        ret_val = xmlNanoHTTPAuthHeader(ctx);
12079        desret_const_char_ptr(ret_val);
12080        call_tests++;
12081        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12082        xmlResetLastError();
12083        if (mem_base != xmlMemBlocks()) {
12084            printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader",
12085	           xmlMemBlocks() - mem_base);
12086	    test_ret++;
12087            printf(" %d", n_ctx);
12088            printf("\n");
12089        }
12090    }
12091    function_tests++;
12092#endif
12093
12094    return(test_ret);
12095}
12096
12097
12098static int
12099test_xmlNanoHTTPCleanup(void) {
12100    int test_ret = 0;
12101
12102#if defined(LIBXML_HTTP_ENABLED)
12103    int mem_base;
12104
12105        mem_base = xmlMemBlocks();
12106
12107        xmlNanoHTTPCleanup();
12108        call_tests++;
12109        xmlResetLastError();
12110        if (mem_base != xmlMemBlocks()) {
12111            printf("Leak of %d blocks found in xmlNanoHTTPCleanup",
12112	           xmlMemBlocks() - mem_base);
12113	    test_ret++;
12114            printf("\n");
12115        }
12116    function_tests++;
12117#endif
12118
12119    return(test_ret);
12120}
12121
12122
12123static int
12124test_xmlNanoHTTPContentLength(void) {
12125    int test_ret = 0;
12126
12127#if defined(LIBXML_HTTP_ENABLED)
12128    int mem_base;
12129    int ret_val;
12130    void * ctx; /* the HTTP context */
12131    int n_ctx;
12132
12133    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12134        mem_base = xmlMemBlocks();
12135        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12136
12137        ret_val = xmlNanoHTTPContentLength(ctx);
12138        desret_int(ret_val);
12139        call_tests++;
12140        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12141        xmlResetLastError();
12142        if (mem_base != xmlMemBlocks()) {
12143            printf("Leak of %d blocks found in xmlNanoHTTPContentLength",
12144	           xmlMemBlocks() - mem_base);
12145	    test_ret++;
12146            printf(" %d", n_ctx);
12147            printf("\n");
12148        }
12149    }
12150    function_tests++;
12151#endif
12152
12153    return(test_ret);
12154}
12155
12156
12157static int
12158test_xmlNanoHTTPEncoding(void) {
12159    int test_ret = 0;
12160
12161#if defined(LIBXML_HTTP_ENABLED)
12162    int mem_base;
12163    const char * ret_val;
12164    void * ctx; /* the HTTP context */
12165    int n_ctx;
12166
12167    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12168        mem_base = xmlMemBlocks();
12169        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12170
12171        ret_val = xmlNanoHTTPEncoding(ctx);
12172        desret_const_char_ptr(ret_val);
12173        call_tests++;
12174        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12175        xmlResetLastError();
12176        if (mem_base != xmlMemBlocks()) {
12177            printf("Leak of %d blocks found in xmlNanoHTTPEncoding",
12178	           xmlMemBlocks() - mem_base);
12179	    test_ret++;
12180            printf(" %d", n_ctx);
12181            printf("\n");
12182        }
12183    }
12184    function_tests++;
12185#endif
12186
12187    return(test_ret);
12188}
12189
12190
12191#define gen_nb_char_ptr_ptr 1
12192static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12193    return(NULL);
12194}
12195static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
12196}
12197
12198static int
12199test_xmlNanoHTTPFetch(void) {
12200    int test_ret = 0;
12201
12202#if defined(LIBXML_HTTP_ENABLED)
12203    int mem_base;
12204    int ret_val;
12205    const char * URL; /* The URL to load */
12206    int n_URL;
12207    const char * filename; /* the filename where the content should be saved */
12208    int n_filename;
12209    char ** contentType; /* if available the Content-Type information will be returned at that location */
12210    int n_contentType;
12211
12212    for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) {
12213    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12214    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12215        mem_base = xmlMemBlocks();
12216        URL = gen_fileoutput(n_URL, 0);
12217        filename = gen_fileoutput(n_filename, 1);
12218        contentType = gen_char_ptr_ptr(n_contentType, 2);
12219
12220        ret_val = xmlNanoHTTPFetch(URL, filename, contentType);
12221        desret_int(ret_val);
12222        call_tests++;
12223        des_fileoutput(n_URL, URL, 0);
12224        des_fileoutput(n_filename, filename, 1);
12225        des_char_ptr_ptr(n_contentType, contentType, 2);
12226        xmlResetLastError();
12227        if (mem_base != xmlMemBlocks()) {
12228            printf("Leak of %d blocks found in xmlNanoHTTPFetch",
12229	           xmlMemBlocks() - mem_base);
12230	    test_ret++;
12231            printf(" %d", n_URL);
12232            printf(" %d", n_filename);
12233            printf(" %d", n_contentType);
12234            printf("\n");
12235        }
12236    }
12237    }
12238    }
12239    function_tests++;
12240#endif
12241
12242    return(test_ret);
12243}
12244
12245
12246static int
12247test_xmlNanoHTTPInit(void) {
12248    int test_ret = 0;
12249
12250#if defined(LIBXML_HTTP_ENABLED)
12251    int mem_base;
12252
12253        mem_base = xmlMemBlocks();
12254
12255        xmlNanoHTTPInit();
12256        call_tests++;
12257        xmlResetLastError();
12258        if (mem_base != xmlMemBlocks()) {
12259            printf("Leak of %d blocks found in xmlNanoHTTPInit",
12260	           xmlMemBlocks() - mem_base);
12261	    test_ret++;
12262            printf("\n");
12263        }
12264    function_tests++;
12265#endif
12266
12267    return(test_ret);
12268}
12269
12270
12271static int
12272test_xmlNanoHTTPMimeType(void) {
12273    int test_ret = 0;
12274
12275#if defined(LIBXML_HTTP_ENABLED)
12276    int mem_base;
12277    const char * ret_val;
12278    void * ctx; /* the HTTP context */
12279    int n_ctx;
12280
12281    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12282        mem_base = xmlMemBlocks();
12283        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12284
12285        ret_val = xmlNanoHTTPMimeType(ctx);
12286        desret_const_char_ptr(ret_val);
12287        call_tests++;
12288        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12289        xmlResetLastError();
12290        if (mem_base != xmlMemBlocks()) {
12291            printf("Leak of %d blocks found in xmlNanoHTTPMimeType",
12292	           xmlMemBlocks() - mem_base);
12293	    test_ret++;
12294            printf(" %d", n_ctx);
12295            printf("\n");
12296        }
12297    }
12298    function_tests++;
12299#endif
12300
12301    return(test_ret);
12302}
12303
12304
12305static int
12306test_xmlNanoHTTPOpen(void) {
12307    int test_ret = 0;
12308
12309#if defined(LIBXML_HTTP_ENABLED)
12310    int mem_base;
12311    void * ret_val;
12312    const char * URL; /* The URL to load */
12313    int n_URL;
12314    char ** contentType; /* if available the Content-Type information will be returned at that location */
12315    int n_contentType;
12316
12317    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12318    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12319        mem_base = xmlMemBlocks();
12320        URL = gen_filepath(n_URL, 0);
12321        contentType = gen_char_ptr_ptr(n_contentType, 1);
12322
12323        ret_val = xmlNanoHTTPOpen(URL, contentType);
12324        desret_xmlNanoHTTPCtxtPtr(ret_val);
12325        call_tests++;
12326        des_filepath(n_URL, URL, 0);
12327        des_char_ptr_ptr(n_contentType, contentType, 1);
12328        xmlResetLastError();
12329        if (mem_base != xmlMemBlocks()) {
12330            printf("Leak of %d blocks found in xmlNanoHTTPOpen",
12331	           xmlMemBlocks() - mem_base);
12332	    test_ret++;
12333            printf(" %d", n_URL);
12334            printf(" %d", n_contentType);
12335            printf("\n");
12336        }
12337    }
12338    }
12339    function_tests++;
12340#endif
12341
12342    return(test_ret);
12343}
12344
12345
12346static int
12347test_xmlNanoHTTPOpenRedir(void) {
12348    int test_ret = 0;
12349
12350#if defined(LIBXML_HTTP_ENABLED)
12351    int mem_base;
12352    void * ret_val;
12353    const char * URL; /* The URL to load */
12354    int n_URL;
12355    char ** contentType; /* if available the Content-Type information will be returned at that location */
12356    int n_contentType;
12357    char ** redir; /* if available the redirected URL will be returned */
12358    int n_redir;
12359
12360    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12361    for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) {
12362    for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) {
12363        mem_base = xmlMemBlocks();
12364        URL = gen_filepath(n_URL, 0);
12365        contentType = gen_char_ptr_ptr(n_contentType, 1);
12366        redir = gen_char_ptr_ptr(n_redir, 2);
12367
12368        ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir);
12369        desret_xmlNanoHTTPCtxtPtr(ret_val);
12370        call_tests++;
12371        des_filepath(n_URL, URL, 0);
12372        des_char_ptr_ptr(n_contentType, contentType, 1);
12373        des_char_ptr_ptr(n_redir, redir, 2);
12374        xmlResetLastError();
12375        if (mem_base != xmlMemBlocks()) {
12376            printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir",
12377	           xmlMemBlocks() - mem_base);
12378	    test_ret++;
12379            printf(" %d", n_URL);
12380            printf(" %d", n_contentType);
12381            printf(" %d", n_redir);
12382            printf("\n");
12383        }
12384    }
12385    }
12386    }
12387    function_tests++;
12388#endif
12389
12390    return(test_ret);
12391}
12392
12393
12394static int
12395test_xmlNanoHTTPRead(void) {
12396    int test_ret = 0;
12397
12398#if defined(LIBXML_HTTP_ENABLED)
12399    int mem_base;
12400    int ret_val;
12401    void * ctx; /* the HTTP context */
12402    int n_ctx;
12403    void * dest; /* a buffer */
12404    int n_dest;
12405    int len; /* the buffer length */
12406    int n_len;
12407
12408    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12409    for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
12410    for (n_len = 0;n_len < gen_nb_int;n_len++) {
12411        mem_base = xmlMemBlocks();
12412        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12413        dest = gen_void_ptr(n_dest, 1);
12414        len = gen_int(n_len, 2);
12415
12416        ret_val = xmlNanoHTTPRead(ctx, dest, len);
12417        desret_int(ret_val);
12418        call_tests++;
12419        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12420        des_void_ptr(n_dest, dest, 1);
12421        des_int(n_len, len, 2);
12422        xmlResetLastError();
12423        if (mem_base != xmlMemBlocks()) {
12424            printf("Leak of %d blocks found in xmlNanoHTTPRead",
12425	           xmlMemBlocks() - mem_base);
12426	    test_ret++;
12427            printf(" %d", n_ctx);
12428            printf(" %d", n_dest);
12429            printf(" %d", n_len);
12430            printf("\n");
12431        }
12432    }
12433    }
12434    }
12435    function_tests++;
12436#endif
12437
12438    return(test_ret);
12439}
12440
12441
12442static int
12443test_xmlNanoHTTPRedir(void) {
12444    int test_ret = 0;
12445
12446
12447    /* missing type support */
12448    return(test_ret);
12449}
12450
12451
12452static int
12453test_xmlNanoHTTPReturnCode(void) {
12454    int test_ret = 0;
12455
12456#if defined(LIBXML_HTTP_ENABLED)
12457    int mem_base;
12458    int ret_val;
12459    void * ctx; /* the HTTP context */
12460    int n_ctx;
12461
12462    for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) {
12463        mem_base = xmlMemBlocks();
12464        ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0);
12465
12466        ret_val = xmlNanoHTTPReturnCode(ctx);
12467        desret_int(ret_val);
12468        call_tests++;
12469        des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0);
12470        xmlResetLastError();
12471        if (mem_base != xmlMemBlocks()) {
12472            printf("Leak of %d blocks found in xmlNanoHTTPReturnCode",
12473	           xmlMemBlocks() - mem_base);
12474	    test_ret++;
12475            printf(" %d", n_ctx);
12476            printf("\n");
12477        }
12478    }
12479    function_tests++;
12480#endif
12481
12482    return(test_ret);
12483}
12484
12485
12486static int
12487test_xmlNanoHTTPSave(void) {
12488    int test_ret = 0;
12489
12490#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
12491    int mem_base;
12492    int ret_val;
12493    void * ctxt; /* the HTTP context */
12494    int n_ctxt;
12495    const char * filename; /* the filename where the content should be saved */
12496    int n_filename;
12497
12498    for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) {
12499    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12500        mem_base = xmlMemBlocks();
12501        ctxt = gen_void_ptr(n_ctxt, 0);
12502        filename = gen_fileoutput(n_filename, 1);
12503
12504        ret_val = xmlNanoHTTPSave(ctxt, filename);
12505        desret_int(ret_val);
12506        call_tests++;
12507        des_void_ptr(n_ctxt, ctxt, 0);
12508        des_fileoutput(n_filename, filename, 1);
12509        xmlResetLastError();
12510        if (mem_base != xmlMemBlocks()) {
12511            printf("Leak of %d blocks found in xmlNanoHTTPSave",
12512	           xmlMemBlocks() - mem_base);
12513	    test_ret++;
12514            printf(" %d", n_ctxt);
12515            printf(" %d", n_filename);
12516            printf("\n");
12517        }
12518    }
12519    }
12520    function_tests++;
12521#endif
12522
12523    return(test_ret);
12524}
12525
12526
12527static int
12528test_xmlNanoHTTPScanProxy(void) {
12529    int test_ret = 0;
12530
12531#if defined(LIBXML_HTTP_ENABLED)
12532    const char * URL; /* The proxy URL used to initialize the proxy context */
12533    int n_URL;
12534
12535    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12536        URL = gen_filepath(n_URL, 0);
12537
12538        xmlNanoHTTPScanProxy(URL);
12539        call_tests++;
12540        des_filepath(n_URL, URL, 0);
12541        xmlResetLastError();
12542    }
12543    function_tests++;
12544#endif
12545
12546    return(test_ret);
12547}
12548
12549static int
12550test_nanohttp(void) {
12551    int test_ret = 0;
12552
12553    if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n");
12554    test_ret += test_xmlNanoHTTPAuthHeader();
12555    test_ret += test_xmlNanoHTTPCleanup();
12556    test_ret += test_xmlNanoHTTPContentLength();
12557    test_ret += test_xmlNanoHTTPEncoding();
12558    test_ret += test_xmlNanoHTTPFetch();
12559    test_ret += test_xmlNanoHTTPInit();
12560    test_ret += test_xmlNanoHTTPMimeType();
12561    test_ret += test_xmlNanoHTTPOpen();
12562    test_ret += test_xmlNanoHTTPOpenRedir();
12563    test_ret += test_xmlNanoHTTPRead();
12564    test_ret += test_xmlNanoHTTPRedir();
12565    test_ret += test_xmlNanoHTTPReturnCode();
12566    test_ret += test_xmlNanoHTTPSave();
12567    test_ret += test_xmlNanoHTTPScanProxy();
12568
12569    if (test_ret != 0)
12570	printf("Module nanohttp: %d errors\n", test_ret);
12571    return(test_ret);
12572}
12573
12574static int
12575test_xmlByteConsumed(void) {
12576    int test_ret = 0;
12577
12578    int mem_base;
12579    long ret_val;
12580    xmlParserCtxtPtr ctxt; /* an XML parser context */
12581    int n_ctxt;
12582
12583    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12584        mem_base = xmlMemBlocks();
12585        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12586
12587        ret_val = xmlByteConsumed(ctxt);
12588        desret_long(ret_val);
12589        call_tests++;
12590        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12591        xmlResetLastError();
12592        if (mem_base != xmlMemBlocks()) {
12593            printf("Leak of %d blocks found in xmlByteConsumed",
12594	           xmlMemBlocks() - mem_base);
12595	    test_ret++;
12596            printf(" %d", n_ctxt);
12597            printf("\n");
12598        }
12599    }
12600    function_tests++;
12601
12602    return(test_ret);
12603}
12604
12605
12606static int
12607test_xmlClearNodeInfoSeq(void) {
12608    int test_ret = 0;
12609
12610    int mem_base;
12611    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
12612    int n_seq;
12613
12614    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
12615        mem_base = xmlMemBlocks();
12616        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
12617
12618        xmlClearNodeInfoSeq(seq);
12619        call_tests++;
12620        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
12621        xmlResetLastError();
12622        if (mem_base != xmlMemBlocks()) {
12623            printf("Leak of %d blocks found in xmlClearNodeInfoSeq",
12624	           xmlMemBlocks() - mem_base);
12625	    test_ret++;
12626            printf(" %d", n_seq);
12627            printf("\n");
12628        }
12629    }
12630    function_tests++;
12631
12632    return(test_ret);
12633}
12634
12635
12636static int
12637test_xmlClearParserCtxt(void) {
12638    int test_ret = 0;
12639
12640    int mem_base;
12641    xmlParserCtxtPtr ctxt; /* an XML parser context */
12642    int n_ctxt;
12643
12644    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12645        mem_base = xmlMemBlocks();
12646        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12647
12648        xmlClearParserCtxt(ctxt);
12649        call_tests++;
12650        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12651        xmlResetLastError();
12652        if (mem_base != xmlMemBlocks()) {
12653            printf("Leak of %d blocks found in xmlClearParserCtxt",
12654	           xmlMemBlocks() - mem_base);
12655	    test_ret++;
12656            printf(" %d", n_ctxt);
12657            printf("\n");
12658        }
12659    }
12660    function_tests++;
12661
12662    return(test_ret);
12663}
12664
12665
12666static int
12667test_xmlCreateDocParserCtxt(void) {
12668    int test_ret = 0;
12669
12670    int mem_base;
12671    xmlParserCtxtPtr ret_val;
12672    xmlChar * cur; /* a pointer to an array of xmlChar */
12673    int n_cur;
12674
12675    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12676        mem_base = xmlMemBlocks();
12677        cur = gen_const_xmlChar_ptr(n_cur, 0);
12678
12679        ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur);
12680        desret_xmlParserCtxtPtr(ret_val);
12681        call_tests++;
12682        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
12683        xmlResetLastError();
12684        if (mem_base != xmlMemBlocks()) {
12685            printf("Leak of %d blocks found in xmlCreateDocParserCtxt",
12686	           xmlMemBlocks() - mem_base);
12687	    test_ret++;
12688            printf(" %d", n_cur);
12689            printf("\n");
12690        }
12691    }
12692    function_tests++;
12693
12694    return(test_ret);
12695}
12696
12697
12698static int
12699test_xmlCreatePushParserCtxt(void) {
12700    int test_ret = 0;
12701
12702#if defined(LIBXML_PUSH_ENABLED)
12703    int mem_base;
12704    xmlParserCtxtPtr ret_val;
12705    xmlSAXHandlerPtr sax; /* a SAX handler */
12706    int n_sax;
12707    void * user_data; /* The user data returned on SAX callbacks */
12708    int n_user_data;
12709    char * chunk; /* a pointer to an array of chars */
12710    int n_chunk;
12711    int size; /* number of chars in the array */
12712    int n_size;
12713    const char * filename; /* an optional file name or URI */
12714    int n_filename;
12715
12716    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
12717    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
12718    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12719    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12720    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
12721        mem_base = xmlMemBlocks();
12722        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
12723        user_data = gen_userdata(n_user_data, 1);
12724        chunk = gen_const_char_ptr(n_chunk, 2);
12725        size = gen_int(n_size, 3);
12726        filename = gen_fileoutput(n_filename, 4);
12727
12728        ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename);
12729        desret_xmlParserCtxtPtr(ret_val);
12730        call_tests++;
12731        des_xmlSAXHandlerPtr(n_sax, sax, 0);
12732        des_userdata(n_user_data, user_data, 1);
12733        des_const_char_ptr(n_chunk, (const char *)chunk, 2);
12734        des_int(n_size, size, 3);
12735        des_fileoutput(n_filename, filename, 4);
12736        xmlResetLastError();
12737        if (mem_base != xmlMemBlocks()) {
12738            printf("Leak of %d blocks found in xmlCreatePushParserCtxt",
12739	           xmlMemBlocks() - mem_base);
12740	    test_ret++;
12741            printf(" %d", n_sax);
12742            printf(" %d", n_user_data);
12743            printf(" %d", n_chunk);
12744            printf(" %d", n_size);
12745            printf(" %d", n_filename);
12746            printf("\n");
12747        }
12748    }
12749    }
12750    }
12751    }
12752    }
12753    function_tests++;
12754#endif
12755
12756    return(test_ret);
12757}
12758
12759
12760static int
12761test_xmlCtxtReadDoc(void) {
12762    int test_ret = 0;
12763
12764    int mem_base;
12765    xmlDocPtr ret_val;
12766    xmlParserCtxtPtr ctxt; /* an XML parser context */
12767    int n_ctxt;
12768    xmlChar * cur; /* a pointer to a zero terminated string */
12769    int n_cur;
12770    const char * URL; /* the base URL to use for the document */
12771    int n_URL;
12772    char * encoding; /* the document encoding, or NULL */
12773    int n_encoding;
12774    int options; /* a combination of xmlParserOption */
12775    int n_options;
12776
12777    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12778    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
12779    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12780    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12781    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12782        mem_base = xmlMemBlocks();
12783        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12784        cur = gen_const_xmlChar_ptr(n_cur, 1);
12785        URL = gen_filepath(n_URL, 2);
12786        encoding = gen_const_char_ptr(n_encoding, 3);
12787        options = gen_parseroptions(n_options, 4);
12788
12789        ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options);
12790        desret_xmlDocPtr(ret_val);
12791        call_tests++;
12792        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12793        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
12794        des_filepath(n_URL, URL, 2);
12795        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
12796        des_parseroptions(n_options, options, 4);
12797        xmlResetLastError();
12798        if (mem_base != xmlMemBlocks()) {
12799            printf("Leak of %d blocks found in xmlCtxtReadDoc",
12800	           xmlMemBlocks() - mem_base);
12801	    test_ret++;
12802            printf(" %d", n_ctxt);
12803            printf(" %d", n_cur);
12804            printf(" %d", n_URL);
12805            printf(" %d", n_encoding);
12806            printf(" %d", n_options);
12807            printf("\n");
12808        }
12809    }
12810    }
12811    }
12812    }
12813    }
12814    function_tests++;
12815
12816    return(test_ret);
12817}
12818
12819
12820static int
12821test_xmlCtxtReadFile(void) {
12822    int test_ret = 0;
12823
12824    int mem_base;
12825    xmlDocPtr ret_val;
12826    xmlParserCtxtPtr ctxt; /* an XML parser context */
12827    int n_ctxt;
12828    const char * filename; /* a file or URL */
12829    int n_filename;
12830    char * encoding; /* the document encoding, or NULL */
12831    int n_encoding;
12832    int options; /* a combination of xmlParserOption */
12833    int n_options;
12834
12835    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12836    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12837    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12838    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12839        mem_base = xmlMemBlocks();
12840        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12841        filename = gen_filepath(n_filename, 1);
12842        encoding = gen_const_char_ptr(n_encoding, 2);
12843        options = gen_parseroptions(n_options, 3);
12844
12845        ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options);
12846        desret_xmlDocPtr(ret_val);
12847        call_tests++;
12848        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12849        des_filepath(n_filename, filename, 1);
12850        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
12851        des_parseroptions(n_options, options, 3);
12852        xmlResetLastError();
12853        if (mem_base != xmlMemBlocks()) {
12854            printf("Leak of %d blocks found in xmlCtxtReadFile",
12855	           xmlMemBlocks() - mem_base);
12856	    test_ret++;
12857            printf(" %d", n_ctxt);
12858            printf(" %d", n_filename);
12859            printf(" %d", n_encoding);
12860            printf(" %d", n_options);
12861            printf("\n");
12862        }
12863    }
12864    }
12865    }
12866    }
12867    function_tests++;
12868
12869    return(test_ret);
12870}
12871
12872
12873static int
12874test_xmlCtxtReadMemory(void) {
12875    int test_ret = 0;
12876
12877    int mem_base;
12878    xmlDocPtr ret_val;
12879    xmlParserCtxtPtr ctxt; /* an XML parser context */
12880    int n_ctxt;
12881    char * buffer; /* a pointer to a char array */
12882    int n_buffer;
12883    int size; /* the size of the array */
12884    int n_size;
12885    const char * URL; /* the base URL to use for the document */
12886    int n_URL;
12887    char * encoding; /* the document encoding, or NULL */
12888    int n_encoding;
12889    int options; /* a combination of xmlParserOption */
12890    int n_options;
12891
12892    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12893    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
12894    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12895    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
12896    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12897    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
12898        mem_base = xmlMemBlocks();
12899        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12900        buffer = gen_const_char_ptr(n_buffer, 1);
12901        size = gen_int(n_size, 2);
12902        URL = gen_filepath(n_URL, 3);
12903        encoding = gen_const_char_ptr(n_encoding, 4);
12904        options = gen_parseroptions(n_options, 5);
12905
12906        ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options);
12907        desret_xmlDocPtr(ret_val);
12908        call_tests++;
12909        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12910        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
12911        des_int(n_size, size, 2);
12912        des_filepath(n_URL, URL, 3);
12913        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
12914        des_parseroptions(n_options, options, 5);
12915        xmlResetLastError();
12916        if (mem_base != xmlMemBlocks()) {
12917            printf("Leak of %d blocks found in xmlCtxtReadMemory",
12918	           xmlMemBlocks() - mem_base);
12919	    test_ret++;
12920            printf(" %d", n_ctxt);
12921            printf(" %d", n_buffer);
12922            printf(" %d", n_size);
12923            printf(" %d", n_URL);
12924            printf(" %d", n_encoding);
12925            printf(" %d", n_options);
12926            printf("\n");
12927        }
12928    }
12929    }
12930    }
12931    }
12932    }
12933    }
12934    function_tests++;
12935
12936    return(test_ret);
12937}
12938
12939
12940static int
12941test_xmlCtxtReset(void) {
12942    int test_ret = 0;
12943
12944    int mem_base;
12945    xmlParserCtxtPtr ctxt; /* an XML parser context */
12946    int n_ctxt;
12947
12948    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12949        mem_base = xmlMemBlocks();
12950        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12951
12952        xmlCtxtReset(ctxt);
12953        call_tests++;
12954        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
12955        xmlResetLastError();
12956        if (mem_base != xmlMemBlocks()) {
12957            printf("Leak of %d blocks found in xmlCtxtReset",
12958	           xmlMemBlocks() - mem_base);
12959	    test_ret++;
12960            printf(" %d", n_ctxt);
12961            printf("\n");
12962        }
12963    }
12964    function_tests++;
12965
12966    return(test_ret);
12967}
12968
12969
12970static int
12971test_xmlCtxtResetPush(void) {
12972    int test_ret = 0;
12973
12974    int mem_base;
12975    int ret_val;
12976    xmlParserCtxtPtr ctxt; /* an XML parser context */
12977    int n_ctxt;
12978    char * chunk; /* a pointer to an array of chars */
12979    int n_chunk;
12980    int size; /* number of chars in the array */
12981    int n_size;
12982    const char * filename; /* an optional file name or URI */
12983    int n_filename;
12984    char * encoding; /* the document encoding, or NULL */
12985    int n_encoding;
12986
12987    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
12988    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
12989    for (n_size = 0;n_size < gen_nb_int;n_size++) {
12990    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
12991    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
12992        mem_base = xmlMemBlocks();
12993        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
12994        chunk = gen_const_char_ptr(n_chunk, 1);
12995        size = gen_int(n_size, 2);
12996        filename = gen_filepath(n_filename, 3);
12997        encoding = gen_const_char_ptr(n_encoding, 4);
12998
12999        ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding);
13000        desret_int(ret_val);
13001        call_tests++;
13002        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13003        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13004        des_int(n_size, size, 2);
13005        des_filepath(n_filename, filename, 3);
13006        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
13007        xmlResetLastError();
13008        if (mem_base != xmlMemBlocks()) {
13009            printf("Leak of %d blocks found in xmlCtxtResetPush",
13010	           xmlMemBlocks() - mem_base);
13011	    test_ret++;
13012            printf(" %d", n_ctxt);
13013            printf(" %d", n_chunk);
13014            printf(" %d", n_size);
13015            printf(" %d", n_filename);
13016            printf(" %d", n_encoding);
13017            printf("\n");
13018        }
13019    }
13020    }
13021    }
13022    }
13023    }
13024    function_tests++;
13025
13026    return(test_ret);
13027}
13028
13029
13030static int
13031test_xmlCtxtUseOptions(void) {
13032    int test_ret = 0;
13033
13034    int mem_base;
13035    int ret_val;
13036    xmlParserCtxtPtr ctxt; /* an XML parser context */
13037    int n_ctxt;
13038    int options; /* a combination of xmlParserOption */
13039    int n_options;
13040
13041    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13042    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
13043        mem_base = xmlMemBlocks();
13044        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13045        options = gen_parseroptions(n_options, 1);
13046
13047        ret_val = xmlCtxtUseOptions(ctxt, options);
13048        desret_int(ret_val);
13049        call_tests++;
13050        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13051        des_parseroptions(n_options, options, 1);
13052        xmlResetLastError();
13053        if (mem_base != xmlMemBlocks()) {
13054            printf("Leak of %d blocks found in xmlCtxtUseOptions",
13055	           xmlMemBlocks() - mem_base);
13056	    test_ret++;
13057            printf(" %d", n_ctxt);
13058            printf(" %d", n_options);
13059            printf("\n");
13060        }
13061    }
13062    }
13063    function_tests++;
13064
13065    return(test_ret);
13066}
13067
13068
13069static int
13070test_xmlGetExternalEntityLoader(void) {
13071    int test_ret = 0;
13072
13073
13074    /* missing type support */
13075    return(test_ret);
13076}
13077
13078
13079static int
13080test_xmlGetFeature(void) {
13081    int test_ret = 0;
13082
13083#if defined(LIBXML_LEGACY_ENABLED)
13084#ifdef LIBXML_LEGACY_ENABLED
13085    int mem_base;
13086    int ret_val;
13087    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
13088    int n_ctxt;
13089    char * name; /* the feature name */
13090    int n_name;
13091    void * result; /* location to store the result */
13092    int n_result;
13093
13094    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13095    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
13096    for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) {
13097        mem_base = xmlMemBlocks();
13098        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13099        name = gen_const_char_ptr(n_name, 1);
13100        result = gen_void_ptr(n_result, 2);
13101
13102        ret_val = xmlGetFeature(ctxt, (const char *)name, result);
13103        desret_int(ret_val);
13104        call_tests++;
13105        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13106        des_const_char_ptr(n_name, (const char *)name, 1);
13107        des_void_ptr(n_result, result, 2);
13108        xmlResetLastError();
13109        if (mem_base != xmlMemBlocks()) {
13110            printf("Leak of %d blocks found in xmlGetFeature",
13111	           xmlMemBlocks() - mem_base);
13112	    test_ret++;
13113            printf(" %d", n_ctxt);
13114            printf(" %d", n_name);
13115            printf(" %d", n_result);
13116            printf("\n");
13117        }
13118    }
13119    }
13120    }
13121    function_tests++;
13122#endif
13123#endif
13124
13125    return(test_ret);
13126}
13127
13128
13129#define gen_nb_const_char_ptr_ptr 1
13130static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13131    return(NULL);
13132}
13133static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13134}
13135
13136static int
13137test_xmlGetFeaturesList(void) {
13138    int test_ret = 0;
13139
13140#if defined(LIBXML_LEGACY_ENABLED)
13141#ifdef LIBXML_LEGACY_ENABLED
13142    int mem_base;
13143    int ret_val;
13144    int * len; /* the length of the features name array (input/output) */
13145    int n_len;
13146    char ** result; /* an array of string to be filled with the features name. */
13147    int n_result;
13148
13149    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
13150    for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) {
13151        mem_base = xmlMemBlocks();
13152        len = gen_int_ptr(n_len, 0);
13153        result = gen_const_char_ptr_ptr(n_result, 1);
13154
13155        ret_val = xmlGetFeaturesList(len, (const char **)result);
13156        desret_int(ret_val);
13157        call_tests++;
13158        des_int_ptr(n_len, len, 0);
13159        des_const_char_ptr_ptr(n_result, (const char **)result, 1);
13160        xmlResetLastError();
13161        if (mem_base != xmlMemBlocks()) {
13162            printf("Leak of %d blocks found in xmlGetFeaturesList",
13163	           xmlMemBlocks() - mem_base);
13164	    test_ret++;
13165            printf(" %d", n_len);
13166            printf(" %d", n_result);
13167            printf("\n");
13168        }
13169    }
13170    }
13171    function_tests++;
13172#endif
13173#endif
13174
13175    return(test_ret);
13176}
13177
13178
13179static int
13180test_xmlHasFeature(void) {
13181    int test_ret = 0;
13182
13183    int mem_base;
13184    int ret_val;
13185    xmlFeature feature; /* the feature to be examined */
13186    int n_feature;
13187
13188    for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) {
13189        mem_base = xmlMemBlocks();
13190        feature = gen_xmlFeature(n_feature, 0);
13191
13192        ret_val = xmlHasFeature(feature);
13193        desret_int(ret_val);
13194        call_tests++;
13195        des_xmlFeature(n_feature, feature, 0);
13196        xmlResetLastError();
13197        if (mem_base != xmlMemBlocks()) {
13198            printf("Leak of %d blocks found in xmlHasFeature",
13199	           xmlMemBlocks() - mem_base);
13200	    test_ret++;
13201            printf(" %d", n_feature);
13202            printf("\n");
13203        }
13204    }
13205    function_tests++;
13206
13207    return(test_ret);
13208}
13209
13210
13211static int
13212test_xmlIOParseDTD(void) {
13213    int test_ret = 0;
13214
13215#if defined(LIBXML_VALID_ENABLED)
13216#ifdef LIBXML_VALID_ENABLED
13217    xmlDtdPtr ret_val;
13218    xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
13219    int n_sax;
13220    xmlParserInputBufferPtr input; /* an Input Buffer */
13221    int n_input;
13222    xmlCharEncoding enc; /* the charset encoding if known */
13223    int n_enc;
13224
13225    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13226    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13227    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13228        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
13229        input = gen_xmlParserInputBufferPtr(n_input, 1);
13230        enc = gen_xmlCharEncoding(n_enc, 2);
13231
13232        ret_val = xmlIOParseDTD(sax, input, enc);
13233        input = NULL;
13234        desret_xmlDtdPtr(ret_val);
13235        call_tests++;
13236        des_xmlSAXHandlerPtr(n_sax, sax, 0);
13237        des_xmlParserInputBufferPtr(n_input, input, 1);
13238        des_xmlCharEncoding(n_enc, enc, 2);
13239        xmlResetLastError();
13240    }
13241    }
13242    }
13243    function_tests++;
13244#endif
13245#endif
13246
13247    return(test_ret);
13248}
13249
13250
13251static int
13252test_xmlInitNodeInfoSeq(void) {
13253    int test_ret = 0;
13254
13255    int mem_base;
13256    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
13257    int n_seq;
13258
13259    for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) {
13260        mem_base = xmlMemBlocks();
13261        seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0);
13262
13263        xmlInitNodeInfoSeq(seq);
13264        call_tests++;
13265        des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0);
13266        xmlResetLastError();
13267        if (mem_base != xmlMemBlocks()) {
13268            printf("Leak of %d blocks found in xmlInitNodeInfoSeq",
13269	           xmlMemBlocks() - mem_base);
13270	    test_ret++;
13271            printf(" %d", n_seq);
13272            printf("\n");
13273        }
13274    }
13275    function_tests++;
13276
13277    return(test_ret);
13278}
13279
13280
13281static int
13282test_xmlInitParser(void) {
13283    int test_ret = 0;
13284
13285    int mem_base;
13286
13287        mem_base = xmlMemBlocks();
13288
13289        xmlInitParser();
13290        call_tests++;
13291        xmlResetLastError();
13292        if (mem_base != xmlMemBlocks()) {
13293            printf("Leak of %d blocks found in xmlInitParser",
13294	           xmlMemBlocks() - mem_base);
13295	    test_ret++;
13296            printf("\n");
13297        }
13298    function_tests++;
13299
13300    return(test_ret);
13301}
13302
13303
13304static int
13305test_xmlInitParserCtxt(void) {
13306    int test_ret = 0;
13307
13308    int mem_base;
13309    int ret_val;
13310    xmlParserCtxtPtr ctxt; /* an XML parser context */
13311    int n_ctxt;
13312
13313    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13314        mem_base = xmlMemBlocks();
13315        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13316
13317        ret_val = xmlInitParserCtxt(ctxt);
13318        desret_int(ret_val);
13319        call_tests++;
13320        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13321        xmlResetLastError();
13322        if (mem_base != xmlMemBlocks()) {
13323            printf("Leak of %d blocks found in xmlInitParserCtxt",
13324	           xmlMemBlocks() - mem_base);
13325	    test_ret++;
13326            printf(" %d", n_ctxt);
13327            printf("\n");
13328        }
13329    }
13330    function_tests++;
13331
13332    return(test_ret);
13333}
13334
13335
13336static int
13337test_xmlKeepBlanksDefault(void) {
13338    int test_ret = 0;
13339
13340    int mem_base;
13341    int ret_val;
13342    int val; /* int 0 or 1 */
13343    int n_val;
13344
13345    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13346        mem_base = xmlMemBlocks();
13347        val = gen_int(n_val, 0);
13348
13349        ret_val = xmlKeepBlanksDefault(val);
13350        desret_int(ret_val);
13351        call_tests++;
13352        des_int(n_val, val, 0);
13353        xmlResetLastError();
13354        if (mem_base != xmlMemBlocks()) {
13355            printf("Leak of %d blocks found in xmlKeepBlanksDefault",
13356	           xmlMemBlocks() - mem_base);
13357	    test_ret++;
13358            printf(" %d", n_val);
13359            printf("\n");
13360        }
13361    }
13362    function_tests++;
13363
13364    return(test_ret);
13365}
13366
13367
13368static int
13369test_xmlLineNumbersDefault(void) {
13370    int test_ret = 0;
13371
13372    int mem_base;
13373    int ret_val;
13374    int val; /* int 0 or 1 */
13375    int n_val;
13376
13377    for (n_val = 0;n_val < gen_nb_int;n_val++) {
13378        mem_base = xmlMemBlocks();
13379        val = gen_int(n_val, 0);
13380
13381        ret_val = xmlLineNumbersDefault(val);
13382        desret_int(ret_val);
13383        call_tests++;
13384        des_int(n_val, val, 0);
13385        xmlResetLastError();
13386        if (mem_base != xmlMemBlocks()) {
13387            printf("Leak of %d blocks found in xmlLineNumbersDefault",
13388	           xmlMemBlocks() - mem_base);
13389	    test_ret++;
13390            printf(" %d", n_val);
13391            printf("\n");
13392        }
13393    }
13394    function_tests++;
13395
13396    return(test_ret);
13397}
13398
13399
13400static int
13401test_xmlLoadExternalEntity(void) {
13402    int test_ret = 0;
13403
13404    int mem_base;
13405    xmlParserInputPtr ret_val;
13406    const char * URL; /* the URL for the entity to load */
13407    int n_URL;
13408    char * ID; /* the Public ID for the entity to load */
13409    int n_ID;
13410    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
13411    int n_ctxt;
13412
13413    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
13414    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
13415    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13416        mem_base = xmlMemBlocks();
13417        URL = gen_filepath(n_URL, 0);
13418        ID = gen_const_char_ptr(n_ID, 1);
13419        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
13420
13421        ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt);
13422        desret_xmlParserInputPtr(ret_val);
13423        call_tests++;
13424        des_filepath(n_URL, URL, 0);
13425        des_const_char_ptr(n_ID, (const char *)ID, 1);
13426        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
13427        xmlResetLastError();
13428        if (mem_base != xmlMemBlocks()) {
13429            printf("Leak of %d blocks found in xmlLoadExternalEntity",
13430	           xmlMemBlocks() - mem_base);
13431	    test_ret++;
13432            printf(" %d", n_URL);
13433            printf(" %d", n_ID);
13434            printf(" %d", n_ctxt);
13435            printf("\n");
13436        }
13437    }
13438    }
13439    }
13440    function_tests++;
13441
13442    return(test_ret);
13443}
13444
13445
13446static int
13447test_xmlNewIOInputStream(void) {
13448    int test_ret = 0;
13449
13450    int mem_base;
13451    xmlParserInputPtr ret_val;
13452    xmlParserCtxtPtr ctxt; /* an XML parser context */
13453    int n_ctxt;
13454    xmlParserInputBufferPtr input; /* an I/O Input */
13455    int n_input;
13456    xmlCharEncoding enc; /* the charset encoding if known */
13457    int n_enc;
13458
13459    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13460    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
13461    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
13462        mem_base = xmlMemBlocks();
13463        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13464        input = gen_xmlParserInputBufferPtr(n_input, 1);
13465        enc = gen_xmlCharEncoding(n_enc, 2);
13466
13467        ret_val = xmlNewIOInputStream(ctxt, input, enc);
13468        if (ret_val != NULL) input = NULL;
13469        desret_xmlParserInputPtr(ret_val);
13470        call_tests++;
13471        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13472        des_xmlParserInputBufferPtr(n_input, input, 1);
13473        des_xmlCharEncoding(n_enc, enc, 2);
13474        xmlResetLastError();
13475        if (mem_base != xmlMemBlocks()) {
13476            printf("Leak of %d blocks found in xmlNewIOInputStream",
13477	           xmlMemBlocks() - mem_base);
13478	    test_ret++;
13479            printf(" %d", n_ctxt);
13480            printf(" %d", n_input);
13481            printf(" %d", n_enc);
13482            printf("\n");
13483        }
13484    }
13485    }
13486    }
13487    function_tests++;
13488
13489    return(test_ret);
13490}
13491
13492
13493static int
13494test_xmlNewParserCtxt(void) {
13495    int test_ret = 0;
13496
13497    int mem_base;
13498    xmlParserCtxtPtr ret_val;
13499
13500        mem_base = xmlMemBlocks();
13501
13502        ret_val = xmlNewParserCtxt();
13503        desret_xmlParserCtxtPtr(ret_val);
13504        call_tests++;
13505        xmlResetLastError();
13506        if (mem_base != xmlMemBlocks()) {
13507            printf("Leak of %d blocks found in xmlNewParserCtxt",
13508	           xmlMemBlocks() - mem_base);
13509	    test_ret++;
13510            printf("\n");
13511        }
13512    function_tests++;
13513
13514    return(test_ret);
13515}
13516
13517
13518#define gen_nb_xmlNodePtr_ptr 1
13519static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13520    return(NULL);
13521}
13522static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
13523}
13524
13525static int
13526test_xmlParseBalancedChunkMemory(void) {
13527    int test_ret = 0;
13528
13529#if defined(LIBXML_SAX1_ENABLED)
13530#ifdef LIBXML_SAX1_ENABLED
13531    int mem_base;
13532    int ret_val;
13533    xmlDocPtr doc; /* the document the chunk pertains to */
13534    int n_doc;
13535    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13536    int n_sax;
13537    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13538    int n_user_data;
13539    int depth; /* Used for loop detection, use 0 */
13540    int n_depth;
13541    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13542    int n_string;
13543    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13544    int n_lst;
13545
13546    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13547    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13548    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13549    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13550    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13551    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13552        mem_base = xmlMemBlocks();
13553        doc = gen_xmlDocPtr(n_doc, 0);
13554        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13555        user_data = gen_userdata(n_user_data, 2);
13556        depth = gen_int(n_depth, 3);
13557        string = gen_const_xmlChar_ptr(n_string, 4);
13558        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13559
13560#ifdef LIBXML_SAX1_ENABLED
13561        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13562#endif
13563
13564
13565        ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst);
13566        desret_int(ret_val);
13567        call_tests++;
13568        des_xmlDocPtr(n_doc, doc, 0);
13569        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13570        des_userdata(n_user_data, user_data, 2);
13571        des_int(n_depth, depth, 3);
13572        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13573        des_xmlNodePtr_ptr(n_lst, lst, 5);
13574        xmlResetLastError();
13575        if (mem_base != xmlMemBlocks()) {
13576            printf("Leak of %d blocks found in xmlParseBalancedChunkMemory",
13577	           xmlMemBlocks() - mem_base);
13578	    test_ret++;
13579            printf(" %d", n_doc);
13580            printf(" %d", n_sax);
13581            printf(" %d", n_user_data);
13582            printf(" %d", n_depth);
13583            printf(" %d", n_string);
13584            printf(" %d", n_lst);
13585            printf("\n");
13586        }
13587    }
13588    }
13589    }
13590    }
13591    }
13592    }
13593    function_tests++;
13594#endif
13595#endif
13596
13597    return(test_ret);
13598}
13599
13600
13601static int
13602test_xmlParseBalancedChunkMemoryRecover(void) {
13603    int test_ret = 0;
13604
13605#if defined(LIBXML_SAX1_ENABLED)
13606#ifdef LIBXML_SAX1_ENABLED
13607    int mem_base;
13608    int ret_val;
13609    xmlDocPtr doc; /* the document the chunk pertains to */
13610    int n_doc;
13611    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13612    int n_sax;
13613    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13614    int n_user_data;
13615    int depth; /* Used for loop detection, use 0 */
13616    int n_depth;
13617    xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */
13618    int n_string;
13619    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13620    int n_lst;
13621    int recover; /* return nodes even if the data is broken (use 0) */
13622    int n_recover;
13623
13624    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13625    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13626    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
13627    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
13628    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
13629    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13630    for (n_recover = 0;n_recover < gen_nb_int;n_recover++) {
13631        mem_base = xmlMemBlocks();
13632        doc = gen_xmlDocPtr(n_doc, 0);
13633        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
13634        user_data = gen_userdata(n_user_data, 2);
13635        depth = gen_int(n_depth, 3);
13636        string = gen_const_xmlChar_ptr(n_string, 4);
13637        lst = gen_xmlNodePtr_ptr(n_lst, 5);
13638        recover = gen_int(n_recover, 6);
13639
13640#ifdef LIBXML_SAX1_ENABLED
13641        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
13642#endif
13643
13644
13645        ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover);
13646        desret_int(ret_val);
13647        call_tests++;
13648        des_xmlDocPtr(n_doc, doc, 0);
13649        des_xmlSAXHandlerPtr(n_sax, sax, 1);
13650        des_userdata(n_user_data, user_data, 2);
13651        des_int(n_depth, depth, 3);
13652        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4);
13653        des_xmlNodePtr_ptr(n_lst, lst, 5);
13654        des_int(n_recover, recover, 6);
13655        xmlResetLastError();
13656        if (mem_base != xmlMemBlocks()) {
13657            printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover",
13658	           xmlMemBlocks() - mem_base);
13659	    test_ret++;
13660            printf(" %d", n_doc);
13661            printf(" %d", n_sax);
13662            printf(" %d", n_user_data);
13663            printf(" %d", n_depth);
13664            printf(" %d", n_string);
13665            printf(" %d", n_lst);
13666            printf(" %d", n_recover);
13667            printf("\n");
13668        }
13669    }
13670    }
13671    }
13672    }
13673    }
13674    }
13675    }
13676    function_tests++;
13677#endif
13678#endif
13679
13680    return(test_ret);
13681}
13682
13683
13684static int
13685test_xmlParseChunk(void) {
13686    int test_ret = 0;
13687
13688#if defined(LIBXML_PUSH_ENABLED)
13689    int mem_base;
13690    int ret_val;
13691    xmlParserCtxtPtr ctxt; /* an XML parser context */
13692    int n_ctxt;
13693    char * chunk; /* an char array */
13694    int n_chunk;
13695    int size; /* the size in byte of the chunk */
13696    int n_size;
13697    int terminate; /* last chunk indicator */
13698    int n_terminate;
13699
13700    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13701    for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) {
13702    for (n_size = 0;n_size < gen_nb_int;n_size++) {
13703    for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) {
13704        mem_base = xmlMemBlocks();
13705        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13706        chunk = gen_const_char_ptr(n_chunk, 1);
13707        size = gen_int(n_size, 2);
13708        terminate = gen_int(n_terminate, 3);
13709
13710        ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate);
13711        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13712        desret_int(ret_val);
13713        call_tests++;
13714        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13715        des_const_char_ptr(n_chunk, (const char *)chunk, 1);
13716        des_int(n_size, size, 2);
13717        des_int(n_terminate, terminate, 3);
13718        xmlResetLastError();
13719        if (mem_base != xmlMemBlocks()) {
13720            printf("Leak of %d blocks found in xmlParseChunk",
13721	           xmlMemBlocks() - mem_base);
13722	    test_ret++;
13723            printf(" %d", n_ctxt);
13724            printf(" %d", n_chunk);
13725            printf(" %d", n_size);
13726            printf(" %d", n_terminate);
13727            printf("\n");
13728        }
13729    }
13730    }
13731    }
13732    }
13733    function_tests++;
13734#endif
13735
13736    return(test_ret);
13737}
13738
13739
13740static int
13741test_xmlParseCtxtExternalEntity(void) {
13742    int test_ret = 0;
13743
13744    int mem_base;
13745    int ret_val;
13746    xmlParserCtxtPtr ctx; /* the existing parsing context */
13747    int n_ctx;
13748    xmlChar * URL; /* the URL for the entity to load */
13749    int n_URL;
13750    xmlChar * ID; /* the System ID for the entity to load */
13751    int n_ID;
13752    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13753    int n_lst;
13754
13755    for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) {
13756    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
13757    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
13758    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
13759        mem_base = xmlMemBlocks();
13760        ctx = gen_xmlParserCtxtPtr(n_ctx, 0);
13761        URL = gen_const_xmlChar_ptr(n_URL, 1);
13762        ID = gen_const_xmlChar_ptr(n_ID, 2);
13763        lst = gen_xmlNodePtr_ptr(n_lst, 3);
13764
13765        ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst);
13766        desret_int(ret_val);
13767        call_tests++;
13768        des_xmlParserCtxtPtr(n_ctx, ctx, 0);
13769        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1);
13770        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2);
13771        des_xmlNodePtr_ptr(n_lst, lst, 3);
13772        xmlResetLastError();
13773        if (mem_base != xmlMemBlocks()) {
13774            printf("Leak of %d blocks found in xmlParseCtxtExternalEntity",
13775	           xmlMemBlocks() - mem_base);
13776	    test_ret++;
13777            printf(" %d", n_ctx);
13778            printf(" %d", n_URL);
13779            printf(" %d", n_ID);
13780            printf(" %d", n_lst);
13781            printf("\n");
13782        }
13783    }
13784    }
13785    }
13786    }
13787    function_tests++;
13788
13789    return(test_ret);
13790}
13791
13792
13793static int
13794test_xmlParseDTD(void) {
13795    int test_ret = 0;
13796
13797#if defined(LIBXML_VALID_ENABLED)
13798#ifdef LIBXML_VALID_ENABLED
13799    int mem_base;
13800    xmlDtdPtr ret_val;
13801    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
13802    int n_ExternalID;
13803    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
13804    int n_SystemID;
13805
13806    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
13807    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
13808        mem_base = xmlMemBlocks();
13809        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0);
13810        SystemID = gen_const_xmlChar_ptr(n_SystemID, 1);
13811
13812        ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID);
13813        desret_xmlDtdPtr(ret_val);
13814        call_tests++;
13815        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0);
13816        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1);
13817        xmlResetLastError();
13818        if (mem_base != xmlMemBlocks()) {
13819            printf("Leak of %d blocks found in xmlParseDTD",
13820	           xmlMemBlocks() - mem_base);
13821	    test_ret++;
13822            printf(" %d", n_ExternalID);
13823            printf(" %d", n_SystemID);
13824            printf("\n");
13825        }
13826    }
13827    }
13828    function_tests++;
13829#endif
13830#endif
13831
13832    return(test_ret);
13833}
13834
13835
13836static int
13837test_xmlParseDoc(void) {
13838    int test_ret = 0;
13839
13840#if defined(LIBXML_SAX1_ENABLED)
13841#ifdef LIBXML_SAX1_ENABLED
13842    int mem_base;
13843    xmlDocPtr ret_val;
13844    xmlChar * cur; /* a pointer to an array of xmlChar */
13845    int n_cur;
13846
13847    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
13848        mem_base = xmlMemBlocks();
13849        cur = gen_const_xmlChar_ptr(n_cur, 0);
13850
13851        ret_val = xmlParseDoc((const xmlChar *)cur);
13852        desret_xmlDocPtr(ret_val);
13853        call_tests++;
13854        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
13855        xmlResetLastError();
13856        if (mem_base != xmlMemBlocks()) {
13857            printf("Leak of %d blocks found in xmlParseDoc",
13858	           xmlMemBlocks() - mem_base);
13859	    test_ret++;
13860            printf(" %d", n_cur);
13861            printf("\n");
13862        }
13863    }
13864    function_tests++;
13865#endif
13866#endif
13867
13868    return(test_ret);
13869}
13870
13871
13872static int
13873test_xmlParseDocument(void) {
13874    int test_ret = 0;
13875
13876    int mem_base;
13877    int ret_val;
13878    xmlParserCtxtPtr ctxt; /* an XML parser context */
13879    int n_ctxt;
13880
13881    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13882        mem_base = xmlMemBlocks();
13883        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13884
13885        ret_val = xmlParseDocument(ctxt);
13886        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13887        desret_int(ret_val);
13888        call_tests++;
13889        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13890        xmlResetLastError();
13891        if (mem_base != xmlMemBlocks()) {
13892            printf("Leak of %d blocks found in xmlParseDocument",
13893	           xmlMemBlocks() - mem_base);
13894	    test_ret++;
13895            printf(" %d", n_ctxt);
13896            printf("\n");
13897        }
13898    }
13899    function_tests++;
13900
13901    return(test_ret);
13902}
13903
13904
13905static int
13906test_xmlParseEntity(void) {
13907    int test_ret = 0;
13908
13909#if defined(LIBXML_SAX1_ENABLED)
13910#ifdef LIBXML_SAX1_ENABLED
13911    int mem_base;
13912    xmlDocPtr ret_val;
13913    const char * filename; /* the filename */
13914    int n_filename;
13915
13916    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
13917        mem_base = xmlMemBlocks();
13918        filename = gen_filepath(n_filename, 0);
13919
13920        ret_val = xmlParseEntity(filename);
13921        desret_xmlDocPtr(ret_val);
13922        call_tests++;
13923        des_filepath(n_filename, filename, 0);
13924        xmlResetLastError();
13925        if (mem_base != xmlMemBlocks()) {
13926            printf("Leak of %d blocks found in xmlParseEntity",
13927	           xmlMemBlocks() - mem_base);
13928	    test_ret++;
13929            printf(" %d", n_filename);
13930            printf("\n");
13931        }
13932    }
13933    function_tests++;
13934#endif
13935#endif
13936
13937    return(test_ret);
13938}
13939
13940
13941static int
13942test_xmlParseExtParsedEnt(void) {
13943    int test_ret = 0;
13944
13945    int mem_base;
13946    int ret_val;
13947    xmlParserCtxtPtr ctxt; /* an XML parser context */
13948    int n_ctxt;
13949
13950    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
13951        mem_base = xmlMemBlocks();
13952        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
13953
13954        ret_val = xmlParseExtParsedEnt(ctxt);
13955        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}
13956        desret_int(ret_val);
13957        call_tests++;
13958        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
13959        xmlResetLastError();
13960        if (mem_base != xmlMemBlocks()) {
13961            printf("Leak of %d blocks found in xmlParseExtParsedEnt",
13962	           xmlMemBlocks() - mem_base);
13963	    test_ret++;
13964            printf(" %d", n_ctxt);
13965            printf("\n");
13966        }
13967    }
13968    function_tests++;
13969
13970    return(test_ret);
13971}
13972
13973
13974static int
13975test_xmlParseExternalEntity(void) {
13976    int test_ret = 0;
13977
13978#if defined(LIBXML_SAX1_ENABLED)
13979#ifdef LIBXML_SAX1_ENABLED
13980    int mem_base;
13981    int ret_val;
13982    xmlDocPtr doc; /* the document the chunk pertains to */
13983    int n_doc;
13984    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
13985    int n_sax;
13986    void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
13987    int n_user_data;
13988    int depth; /* Used for loop detection, use 0 */
13989    int n_depth;
13990    xmlChar * URL; /* the URL for the entity to load */
13991    int n_URL;
13992    xmlChar * ID; /* the System ID for the entity to load */
13993    int n_ID;
13994    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
13995    int n_lst;
13996
13997    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
13998    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
13999    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
14000    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
14001    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
14002    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
14003    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14004        mem_base = xmlMemBlocks();
14005        doc = gen_xmlDocPtr(n_doc, 0);
14006        sax = gen_xmlSAXHandlerPtr(n_sax, 1);
14007        user_data = gen_userdata(n_user_data, 2);
14008        depth = gen_int(n_depth, 3);
14009        URL = gen_const_xmlChar_ptr(n_URL, 4);
14010        ID = gen_const_xmlChar_ptr(n_ID, 5);
14011        lst = gen_xmlNodePtr_ptr(n_lst, 6);
14012
14013        ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst);
14014        desret_int(ret_val);
14015        call_tests++;
14016        des_xmlDocPtr(n_doc, doc, 0);
14017        des_xmlSAXHandlerPtr(n_sax, sax, 1);
14018        des_userdata(n_user_data, user_data, 2);
14019        des_int(n_depth, depth, 3);
14020        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4);
14021        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5);
14022        des_xmlNodePtr_ptr(n_lst, lst, 6);
14023        xmlResetLastError();
14024        if (mem_base != xmlMemBlocks()) {
14025            printf("Leak of %d blocks found in xmlParseExternalEntity",
14026	           xmlMemBlocks() - mem_base);
14027	    test_ret++;
14028            printf(" %d", n_doc);
14029            printf(" %d", n_sax);
14030            printf(" %d", n_user_data);
14031            printf(" %d", n_depth);
14032            printf(" %d", n_URL);
14033            printf(" %d", n_ID);
14034            printf(" %d", n_lst);
14035            printf("\n");
14036        }
14037    }
14038    }
14039    }
14040    }
14041    }
14042    }
14043    }
14044    function_tests++;
14045#endif
14046#endif
14047
14048    return(test_ret);
14049}
14050
14051
14052static int
14053test_xmlParseFile(void) {
14054    int test_ret = 0;
14055
14056#if defined(LIBXML_SAX1_ENABLED)
14057#ifdef LIBXML_SAX1_ENABLED
14058    int mem_base;
14059    xmlDocPtr ret_val;
14060    const char * filename; /* the filename */
14061    int n_filename;
14062
14063    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14064        mem_base = xmlMemBlocks();
14065        filename = gen_filepath(n_filename, 0);
14066
14067        ret_val = xmlParseFile(filename);
14068        desret_xmlDocPtr(ret_val);
14069        call_tests++;
14070        des_filepath(n_filename, filename, 0);
14071        xmlResetLastError();
14072        if (mem_base != xmlMemBlocks()) {
14073            printf("Leak of %d blocks found in xmlParseFile",
14074	           xmlMemBlocks() - mem_base);
14075	    test_ret++;
14076            printf(" %d", n_filename);
14077            printf("\n");
14078        }
14079    }
14080    function_tests++;
14081#endif
14082#endif
14083
14084    return(test_ret);
14085}
14086
14087
14088static int
14089test_xmlParseInNodeContext(void) {
14090    int test_ret = 0;
14091
14092    int mem_base;
14093    xmlParserErrors ret_val;
14094    xmlNodePtr node; /* the context node */
14095    int n_node;
14096    char * data; /* the input string */
14097    int n_data;
14098    int datalen; /* the input string length in bytes */
14099    int n_datalen;
14100    int options; /* a combination of xmlParserOption */
14101    int n_options;
14102    xmlNodePtr * lst; /* the return value for the set of parsed nodes */
14103    int n_lst;
14104
14105    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
14106    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
14107    for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) {
14108    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14109    for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) {
14110        mem_base = xmlMemBlocks();
14111        node = gen_xmlNodePtr(n_node, 0);
14112        data = gen_const_char_ptr(n_data, 1);
14113        datalen = gen_int(n_datalen, 2);
14114        options = gen_parseroptions(n_options, 3);
14115        lst = gen_xmlNodePtr_ptr(n_lst, 4);
14116
14117        ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst);
14118        desret_xmlParserErrors(ret_val);
14119        call_tests++;
14120        des_xmlNodePtr(n_node, node, 0);
14121        des_const_char_ptr(n_data, (const char *)data, 1);
14122        des_int(n_datalen, datalen, 2);
14123        des_parseroptions(n_options, options, 3);
14124        des_xmlNodePtr_ptr(n_lst, lst, 4);
14125        xmlResetLastError();
14126        if (mem_base != xmlMemBlocks()) {
14127            printf("Leak of %d blocks found in xmlParseInNodeContext",
14128	           xmlMemBlocks() - mem_base);
14129	    test_ret++;
14130            printf(" %d", n_node);
14131            printf(" %d", n_data);
14132            printf(" %d", n_datalen);
14133            printf(" %d", n_options);
14134            printf(" %d", n_lst);
14135            printf("\n");
14136        }
14137    }
14138    }
14139    }
14140    }
14141    }
14142    function_tests++;
14143
14144    return(test_ret);
14145}
14146
14147
14148static int
14149test_xmlParseMemory(void) {
14150    int test_ret = 0;
14151
14152#if defined(LIBXML_SAX1_ENABLED)
14153#ifdef LIBXML_SAX1_ENABLED
14154    int mem_base;
14155    xmlDocPtr ret_val;
14156    char * buffer; /* an pointer to a char array */
14157    int n_buffer;
14158    int size; /* the size of the array */
14159    int n_size;
14160
14161    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14162    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14163        mem_base = xmlMemBlocks();
14164        buffer = gen_const_char_ptr(n_buffer, 0);
14165        size = gen_int(n_size, 1);
14166
14167        ret_val = xmlParseMemory((const char *)buffer, size);
14168        desret_xmlDocPtr(ret_val);
14169        call_tests++;
14170        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14171        des_int(n_size, size, 1);
14172        xmlResetLastError();
14173        if (mem_base != xmlMemBlocks()) {
14174            printf("Leak of %d blocks found in xmlParseMemory",
14175	           xmlMemBlocks() - mem_base);
14176	    test_ret++;
14177            printf(" %d", n_buffer);
14178            printf(" %d", n_size);
14179            printf("\n");
14180        }
14181    }
14182    }
14183    function_tests++;
14184#endif
14185#endif
14186
14187    return(test_ret);
14188}
14189
14190
14191#define gen_nb_const_xmlParserNodeInfoPtr 1
14192static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14193    return(NULL);
14194}
14195static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14196}
14197
14198static int
14199test_xmlParserAddNodeInfo(void) {
14200    int test_ret = 0;
14201
14202    int mem_base;
14203    xmlParserCtxtPtr ctxt; /* an XML parser context */
14204    int n_ctxt;
14205    xmlParserNodeInfoPtr info; /* a node info sequence pointer */
14206    int n_info;
14207
14208    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
14209    for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) {
14210        mem_base = xmlMemBlocks();
14211        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
14212        info = gen_const_xmlParserNodeInfoPtr(n_info, 1);
14213
14214        xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info);
14215        call_tests++;
14216        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
14217        des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1);
14218        xmlResetLastError();
14219        if (mem_base != xmlMemBlocks()) {
14220            printf("Leak of %d blocks found in xmlParserAddNodeInfo",
14221	           xmlMemBlocks() - mem_base);
14222	    test_ret++;
14223            printf(" %d", n_ctxt);
14224            printf(" %d", n_info);
14225            printf("\n");
14226        }
14227    }
14228    }
14229    function_tests++;
14230
14231    return(test_ret);
14232}
14233
14234
14235#define gen_nb_const_xmlParserCtxtPtr 1
14236static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14237    return(NULL);
14238}
14239static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14240}
14241
14242#define gen_nb_const_xmlNodePtr 1
14243static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14244    return(NULL);
14245}
14246static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14247}
14248
14249static int
14250test_xmlParserFindNodeInfo(void) {
14251    int test_ret = 0;
14252
14253    int mem_base;
14254    const xmlParserNodeInfo * ret_val;
14255    xmlParserCtxtPtr ctx; /* an XML parser context */
14256    int n_ctx;
14257    xmlNodePtr node; /* an XML node within the tree */
14258    int n_node;
14259
14260    for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) {
14261    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14262        mem_base = xmlMemBlocks();
14263        ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0);
14264        node = gen_const_xmlNodePtr(n_node, 1);
14265
14266        ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node);
14267        desret_const_xmlParserNodeInfo_ptr(ret_val);
14268        call_tests++;
14269        des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0);
14270        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14271        xmlResetLastError();
14272        if (mem_base != xmlMemBlocks()) {
14273            printf("Leak of %d blocks found in xmlParserFindNodeInfo",
14274	           xmlMemBlocks() - mem_base);
14275	    test_ret++;
14276            printf(" %d", n_ctx);
14277            printf(" %d", n_node);
14278            printf("\n");
14279        }
14280    }
14281    }
14282    function_tests++;
14283
14284    return(test_ret);
14285}
14286
14287
14288#define gen_nb_const_xmlParserNodeInfoSeqPtr 1
14289static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14290    return(NULL);
14291}
14292static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14293}
14294
14295static int
14296test_xmlParserFindNodeInfoIndex(void) {
14297    int test_ret = 0;
14298
14299    int mem_base;
14300    unsigned long ret_val;
14301    xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */
14302    int n_seq;
14303    xmlNodePtr node; /* an XML node pointer */
14304    int n_node;
14305
14306    for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) {
14307    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
14308        mem_base = xmlMemBlocks();
14309        seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0);
14310        node = gen_const_xmlNodePtr(n_node, 1);
14311
14312        ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node);
14313        desret_unsigned_long(ret_val);
14314        call_tests++;
14315        des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0);
14316        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
14317        xmlResetLastError();
14318        if (mem_base != xmlMemBlocks()) {
14319            printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex",
14320	           xmlMemBlocks() - mem_base);
14321	    test_ret++;
14322            printf(" %d", n_seq);
14323            printf(" %d", n_node);
14324            printf("\n");
14325        }
14326    }
14327    }
14328    function_tests++;
14329
14330    return(test_ret);
14331}
14332
14333
14334#define gen_nb_xmlParserInputPtr 1
14335static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14336    return(NULL);
14337}
14338static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
14339}
14340
14341static int
14342test_xmlParserInputGrow(void) {
14343    int test_ret = 0;
14344
14345    int mem_base;
14346    int ret_val;
14347    xmlParserInputPtr in; /* an XML parser input */
14348    int n_in;
14349    int len; /* an indicative size for the lookahead */
14350    int n_len;
14351
14352    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14353    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14354        mem_base = xmlMemBlocks();
14355        in = gen_xmlParserInputPtr(n_in, 0);
14356        len = gen_int(n_len, 1);
14357
14358        ret_val = xmlParserInputGrow(in, len);
14359        desret_int(ret_val);
14360        call_tests++;
14361        des_xmlParserInputPtr(n_in, in, 0);
14362        des_int(n_len, len, 1);
14363        xmlResetLastError();
14364        if (mem_base != xmlMemBlocks()) {
14365            printf("Leak of %d blocks found in xmlParserInputGrow",
14366	           xmlMemBlocks() - mem_base);
14367	    test_ret++;
14368            printf(" %d", n_in);
14369            printf(" %d", n_len);
14370            printf("\n");
14371        }
14372    }
14373    }
14374    function_tests++;
14375
14376    return(test_ret);
14377}
14378
14379
14380static int
14381test_xmlParserInputRead(void) {
14382    int test_ret = 0;
14383
14384    int mem_base;
14385    int ret_val;
14386    xmlParserInputPtr in; /* an XML parser input */
14387    int n_in;
14388    int len; /* an indicative size for the lookahead */
14389    int n_len;
14390
14391    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
14392    for (n_len = 0;n_len < gen_nb_int;n_len++) {
14393        mem_base = xmlMemBlocks();
14394        in = gen_xmlParserInputPtr(n_in, 0);
14395        len = gen_int(n_len, 1);
14396
14397        ret_val = xmlParserInputRead(in, len);
14398        desret_int(ret_val);
14399        call_tests++;
14400        des_xmlParserInputPtr(n_in, in, 0);
14401        des_int(n_len, len, 1);
14402        xmlResetLastError();
14403        if (mem_base != xmlMemBlocks()) {
14404            printf("Leak of %d blocks found in xmlParserInputRead",
14405	           xmlMemBlocks() - mem_base);
14406	    test_ret++;
14407            printf(" %d", n_in);
14408            printf(" %d", n_len);
14409            printf("\n");
14410        }
14411    }
14412    }
14413    function_tests++;
14414
14415    return(test_ret);
14416}
14417
14418
14419static int
14420test_xmlPedanticParserDefault(void) {
14421    int test_ret = 0;
14422
14423    int mem_base;
14424    int ret_val;
14425    int val; /* int 0 or 1 */
14426    int n_val;
14427
14428    for (n_val = 0;n_val < gen_nb_int;n_val++) {
14429        mem_base = xmlMemBlocks();
14430        val = gen_int(n_val, 0);
14431
14432        ret_val = xmlPedanticParserDefault(val);
14433        desret_int(ret_val);
14434        call_tests++;
14435        des_int(n_val, val, 0);
14436        xmlResetLastError();
14437        if (mem_base != xmlMemBlocks()) {
14438            printf("Leak of %d blocks found in xmlPedanticParserDefault",
14439	           xmlMemBlocks() - mem_base);
14440	    test_ret++;
14441            printf(" %d", n_val);
14442            printf("\n");
14443        }
14444    }
14445    function_tests++;
14446
14447    return(test_ret);
14448}
14449
14450
14451static int
14452test_xmlReadDoc(void) {
14453    int test_ret = 0;
14454
14455    int mem_base;
14456    xmlDocPtr ret_val;
14457    xmlChar * cur; /* a pointer to a zero terminated string */
14458    int n_cur;
14459    const char * URL; /* the base URL to use for the document */
14460    int n_URL;
14461    char * encoding; /* the document encoding, or NULL */
14462    int n_encoding;
14463    int options; /* a combination of xmlParserOption */
14464    int n_options;
14465
14466    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14467    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14468    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14469    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14470        mem_base = xmlMemBlocks();
14471        cur = gen_const_xmlChar_ptr(n_cur, 0);
14472        URL = gen_filepath(n_URL, 1);
14473        encoding = gen_const_char_ptr(n_encoding, 2);
14474        options = gen_parseroptions(n_options, 3);
14475
14476        ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
14477        desret_xmlDocPtr(ret_val);
14478        call_tests++;
14479        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
14480        des_filepath(n_URL, URL, 1);
14481        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
14482        des_parseroptions(n_options, options, 3);
14483        xmlResetLastError();
14484        if (mem_base != xmlMemBlocks()) {
14485            printf("Leak of %d blocks found in xmlReadDoc",
14486	           xmlMemBlocks() - mem_base);
14487	    test_ret++;
14488            printf(" %d", n_cur);
14489            printf(" %d", n_URL);
14490            printf(" %d", n_encoding);
14491            printf(" %d", n_options);
14492            printf("\n");
14493        }
14494    }
14495    }
14496    }
14497    }
14498    function_tests++;
14499
14500    return(test_ret);
14501}
14502
14503
14504static int
14505test_xmlReadFile(void) {
14506    int test_ret = 0;
14507
14508    int mem_base;
14509    xmlDocPtr ret_val;
14510    const char * filename; /* a file or URL */
14511    int n_filename;
14512    char * encoding; /* the document encoding, or NULL */
14513    int n_encoding;
14514    int options; /* a combination of xmlParserOption */
14515    int n_options;
14516
14517    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14518    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14519    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14520        mem_base = xmlMemBlocks();
14521        filename = gen_filepath(n_filename, 0);
14522        encoding = gen_const_char_ptr(n_encoding, 1);
14523        options = gen_parseroptions(n_options, 2);
14524
14525        ret_val = xmlReadFile(filename, (const char *)encoding, options);
14526        desret_xmlDocPtr(ret_val);
14527        call_tests++;
14528        des_filepath(n_filename, filename, 0);
14529        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
14530        des_parseroptions(n_options, options, 2);
14531        xmlResetLastError();
14532        if (mem_base != xmlMemBlocks()) {
14533            printf("Leak of %d blocks found in xmlReadFile",
14534	           xmlMemBlocks() - mem_base);
14535	    test_ret++;
14536            printf(" %d", n_filename);
14537            printf(" %d", n_encoding);
14538            printf(" %d", n_options);
14539            printf("\n");
14540        }
14541    }
14542    }
14543    }
14544    function_tests++;
14545
14546    return(test_ret);
14547}
14548
14549
14550static int
14551test_xmlReadMemory(void) {
14552    int test_ret = 0;
14553
14554    int mem_base;
14555    xmlDocPtr ret_val;
14556    char * buffer; /* a pointer to a char array */
14557    int n_buffer;
14558    int size; /* the size of the array */
14559    int n_size;
14560    const char * URL; /* the base URL to use for the document */
14561    int n_URL;
14562    char * encoding; /* the document encoding, or NULL */
14563    int n_encoding;
14564    int options; /* a combination of xmlParserOption */
14565    int n_options;
14566
14567    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14568    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14569    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
14570    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
14571    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
14572        mem_base = xmlMemBlocks();
14573        buffer = gen_const_char_ptr(n_buffer, 0);
14574        size = gen_int(n_size, 1);
14575        URL = gen_filepath(n_URL, 2);
14576        encoding = gen_const_char_ptr(n_encoding, 3);
14577        options = gen_parseroptions(n_options, 4);
14578
14579        ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options);
14580        desret_xmlDocPtr(ret_val);
14581        call_tests++;
14582        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14583        des_int(n_size, size, 1);
14584        des_filepath(n_URL, URL, 2);
14585        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
14586        des_parseroptions(n_options, options, 4);
14587        xmlResetLastError();
14588        if (mem_base != xmlMemBlocks()) {
14589            printf("Leak of %d blocks found in xmlReadMemory",
14590	           xmlMemBlocks() - mem_base);
14591	    test_ret++;
14592            printf(" %d", n_buffer);
14593            printf(" %d", n_size);
14594            printf(" %d", n_URL);
14595            printf(" %d", n_encoding);
14596            printf(" %d", n_options);
14597            printf("\n");
14598        }
14599    }
14600    }
14601    }
14602    }
14603    }
14604    function_tests++;
14605
14606    return(test_ret);
14607}
14608
14609
14610static int
14611test_xmlRecoverDoc(void) {
14612    int test_ret = 0;
14613
14614#if defined(LIBXML_SAX1_ENABLED)
14615#ifdef LIBXML_SAX1_ENABLED
14616    int mem_base;
14617    xmlDocPtr ret_val;
14618    xmlChar * cur; /* a pointer to an array of xmlChar */
14619    int n_cur;
14620
14621    for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) {
14622        mem_base = xmlMemBlocks();
14623        cur = gen_xmlChar_ptr(n_cur, 0);
14624
14625        ret_val = xmlRecoverDoc(cur);
14626        desret_xmlDocPtr(ret_val);
14627        call_tests++;
14628        des_xmlChar_ptr(n_cur, cur, 0);
14629        xmlResetLastError();
14630        if (mem_base != xmlMemBlocks()) {
14631            printf("Leak of %d blocks found in xmlRecoverDoc",
14632	           xmlMemBlocks() - mem_base);
14633	    test_ret++;
14634            printf(" %d", n_cur);
14635            printf("\n");
14636        }
14637    }
14638    function_tests++;
14639#endif
14640#endif
14641
14642    return(test_ret);
14643}
14644
14645
14646static int
14647test_xmlRecoverFile(void) {
14648    int test_ret = 0;
14649
14650#if defined(LIBXML_SAX1_ENABLED)
14651#ifdef LIBXML_SAX1_ENABLED
14652    int mem_base;
14653    xmlDocPtr ret_val;
14654    const char * filename; /* the filename */
14655    int n_filename;
14656
14657    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14658        mem_base = xmlMemBlocks();
14659        filename = gen_filepath(n_filename, 0);
14660
14661        ret_val = xmlRecoverFile(filename);
14662        desret_xmlDocPtr(ret_val);
14663        call_tests++;
14664        des_filepath(n_filename, filename, 0);
14665        xmlResetLastError();
14666        if (mem_base != xmlMemBlocks()) {
14667            printf("Leak of %d blocks found in xmlRecoverFile",
14668	           xmlMemBlocks() - mem_base);
14669	    test_ret++;
14670            printf(" %d", n_filename);
14671            printf("\n");
14672        }
14673    }
14674    function_tests++;
14675#endif
14676#endif
14677
14678    return(test_ret);
14679}
14680
14681
14682static int
14683test_xmlRecoverMemory(void) {
14684    int test_ret = 0;
14685
14686#if defined(LIBXML_SAX1_ENABLED)
14687#ifdef LIBXML_SAX1_ENABLED
14688    int mem_base;
14689    xmlDocPtr ret_val;
14690    char * buffer; /* an pointer to a char array */
14691    int n_buffer;
14692    int size; /* the size of the array */
14693    int n_size;
14694
14695    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14696    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14697        mem_base = xmlMemBlocks();
14698        buffer = gen_const_char_ptr(n_buffer, 0);
14699        size = gen_int(n_size, 1);
14700
14701        ret_val = xmlRecoverMemory((const char *)buffer, size);
14702        desret_xmlDocPtr(ret_val);
14703        call_tests++;
14704        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
14705        des_int(n_size, size, 1);
14706        xmlResetLastError();
14707        if (mem_base != xmlMemBlocks()) {
14708            printf("Leak of %d blocks found in xmlRecoverMemory",
14709	           xmlMemBlocks() - mem_base);
14710	    test_ret++;
14711            printf(" %d", n_buffer);
14712            printf(" %d", n_size);
14713            printf("\n");
14714        }
14715    }
14716    }
14717    function_tests++;
14718#endif
14719#endif
14720
14721    return(test_ret);
14722}
14723
14724
14725static int
14726test_xmlSAXParseDTD(void) {
14727    int test_ret = 0;
14728
14729#if defined(LIBXML_VALID_ENABLED)
14730#ifdef LIBXML_SAX1_ENABLED
14731    int mem_base;
14732    xmlDtdPtr ret_val;
14733    xmlSAXHandlerPtr sax; /* the SAX handler block */
14734    int n_sax;
14735    xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */
14736    int n_ExternalID;
14737    xmlChar * SystemID; /* a NAME* containing the URL to the DTD */
14738    int n_SystemID;
14739
14740    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14741    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
14742    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
14743        mem_base = xmlMemBlocks();
14744        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14745        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1);
14746        SystemID = gen_const_xmlChar_ptr(n_SystemID, 2);
14747
14748        ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
14749        desret_xmlDtdPtr(ret_val);
14750        call_tests++;
14751        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14752        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1);
14753        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2);
14754        xmlResetLastError();
14755        if (mem_base != xmlMemBlocks()) {
14756            printf("Leak of %d blocks found in xmlSAXParseDTD",
14757	           xmlMemBlocks() - mem_base);
14758	    test_ret++;
14759            printf(" %d", n_sax);
14760            printf(" %d", n_ExternalID);
14761            printf(" %d", n_SystemID);
14762            printf("\n");
14763        }
14764    }
14765    }
14766    }
14767    function_tests++;
14768#endif
14769#endif
14770
14771    return(test_ret);
14772}
14773
14774
14775static int
14776test_xmlSAXParseDoc(void) {
14777    int test_ret = 0;
14778
14779#if defined(LIBXML_SAX1_ENABLED)
14780#ifdef LIBXML_SAX1_ENABLED
14781    int mem_base;
14782    xmlDocPtr ret_val;
14783    xmlSAXHandlerPtr sax; /* the SAX handler block */
14784    int n_sax;
14785    xmlChar * cur; /* a pointer to an array of xmlChar */
14786    int n_cur;
14787    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14788    int n_recovery;
14789
14790    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14791    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
14792    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14793        mem_base = xmlMemBlocks();
14794        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14795        cur = gen_const_xmlChar_ptr(n_cur, 1);
14796        recovery = gen_int(n_recovery, 2);
14797
14798        ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery);
14799        desret_xmlDocPtr(ret_val);
14800        call_tests++;
14801        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14802        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
14803        des_int(n_recovery, recovery, 2);
14804        xmlResetLastError();
14805        if (mem_base != xmlMemBlocks()) {
14806            printf("Leak of %d blocks found in xmlSAXParseDoc",
14807	           xmlMemBlocks() - mem_base);
14808	    test_ret++;
14809            printf(" %d", n_sax);
14810            printf(" %d", n_cur);
14811            printf(" %d", n_recovery);
14812            printf("\n");
14813        }
14814    }
14815    }
14816    }
14817    function_tests++;
14818#endif
14819#endif
14820
14821    return(test_ret);
14822}
14823
14824
14825static int
14826test_xmlSAXParseEntity(void) {
14827    int test_ret = 0;
14828
14829#if defined(LIBXML_SAX1_ENABLED)
14830#ifdef LIBXML_SAX1_ENABLED
14831    int mem_base;
14832    xmlDocPtr ret_val;
14833    xmlSAXHandlerPtr sax; /* the SAX handler block */
14834    int n_sax;
14835    const char * filename; /* the filename */
14836    int n_filename;
14837
14838    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14839    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14840        mem_base = xmlMemBlocks();
14841        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14842        filename = gen_filepath(n_filename, 1);
14843
14844        ret_val = xmlSAXParseEntity(sax, filename);
14845        desret_xmlDocPtr(ret_val);
14846        call_tests++;
14847        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14848        des_filepath(n_filename, filename, 1);
14849        xmlResetLastError();
14850        if (mem_base != xmlMemBlocks()) {
14851            printf("Leak of %d blocks found in xmlSAXParseEntity",
14852	           xmlMemBlocks() - mem_base);
14853	    test_ret++;
14854            printf(" %d", n_sax);
14855            printf(" %d", n_filename);
14856            printf("\n");
14857        }
14858    }
14859    }
14860    function_tests++;
14861#endif
14862#endif
14863
14864    return(test_ret);
14865}
14866
14867
14868static int
14869test_xmlSAXParseFile(void) {
14870    int test_ret = 0;
14871
14872#if defined(LIBXML_SAX1_ENABLED)
14873#ifdef LIBXML_SAX1_ENABLED
14874    int mem_base;
14875    xmlDocPtr ret_val;
14876    xmlSAXHandlerPtr sax; /* the SAX handler block */
14877    int n_sax;
14878    const char * filename; /* the filename */
14879    int n_filename;
14880    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14881    int n_recovery;
14882
14883    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14884    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14885    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14886        mem_base = xmlMemBlocks();
14887        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14888        filename = gen_filepath(n_filename, 1);
14889        recovery = gen_int(n_recovery, 2);
14890
14891        ret_val = xmlSAXParseFile(sax, filename, recovery);
14892        desret_xmlDocPtr(ret_val);
14893        call_tests++;
14894        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14895        des_filepath(n_filename, filename, 1);
14896        des_int(n_recovery, recovery, 2);
14897        xmlResetLastError();
14898        if (mem_base != xmlMemBlocks()) {
14899            printf("Leak of %d blocks found in xmlSAXParseFile",
14900	           xmlMemBlocks() - mem_base);
14901	    test_ret++;
14902            printf(" %d", n_sax);
14903            printf(" %d", n_filename);
14904            printf(" %d", n_recovery);
14905            printf("\n");
14906        }
14907    }
14908    }
14909    }
14910    function_tests++;
14911#endif
14912#endif
14913
14914    return(test_ret);
14915}
14916
14917
14918static int
14919test_xmlSAXParseFileWithData(void) {
14920    int test_ret = 0;
14921
14922#if defined(LIBXML_SAX1_ENABLED)
14923#ifdef LIBXML_SAX1_ENABLED
14924    int mem_base;
14925    xmlDocPtr ret_val;
14926    xmlSAXHandlerPtr sax; /* the SAX handler block */
14927    int n_sax;
14928    const char * filename; /* the filename */
14929    int n_filename;
14930    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
14931    int n_recovery;
14932    void * data; /* the userdata */
14933    int n_data;
14934
14935    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14936    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
14937    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14938    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
14939        mem_base = xmlMemBlocks();
14940        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14941        filename = gen_filepath(n_filename, 1);
14942        recovery = gen_int(n_recovery, 2);
14943        data = gen_userdata(n_data, 3);
14944
14945        ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data);
14946        desret_xmlDocPtr(ret_val);
14947        call_tests++;
14948        des_xmlSAXHandlerPtr(n_sax, sax, 0);
14949        des_filepath(n_filename, filename, 1);
14950        des_int(n_recovery, recovery, 2);
14951        des_userdata(n_data, data, 3);
14952        xmlResetLastError();
14953        if (mem_base != xmlMemBlocks()) {
14954            printf("Leak of %d blocks found in xmlSAXParseFileWithData",
14955	           xmlMemBlocks() - mem_base);
14956	    test_ret++;
14957            printf(" %d", n_sax);
14958            printf(" %d", n_filename);
14959            printf(" %d", n_recovery);
14960            printf(" %d", n_data);
14961            printf("\n");
14962        }
14963    }
14964    }
14965    }
14966    }
14967    function_tests++;
14968#endif
14969#endif
14970
14971    return(test_ret);
14972}
14973
14974
14975static int
14976test_xmlSAXParseMemory(void) {
14977    int test_ret = 0;
14978
14979#if defined(LIBXML_SAX1_ENABLED)
14980#ifdef LIBXML_SAX1_ENABLED
14981    int mem_base;
14982    xmlDocPtr ret_val;
14983    xmlSAXHandlerPtr sax; /* the SAX handler block */
14984    int n_sax;
14985    char * buffer; /* an pointer to a char array */
14986    int n_buffer;
14987    int size; /* the size of the array */
14988    int n_size;
14989    int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */
14990    int n_recovery;
14991
14992    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
14993    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
14994    for (n_size = 0;n_size < gen_nb_int;n_size++) {
14995    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
14996        mem_base = xmlMemBlocks();
14997        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
14998        buffer = gen_const_char_ptr(n_buffer, 1);
14999        size = gen_int(n_size, 2);
15000        recovery = gen_int(n_recovery, 3);
15001
15002        ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery);
15003        desret_xmlDocPtr(ret_val);
15004        call_tests++;
15005        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15006        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15007        des_int(n_size, size, 2);
15008        des_int(n_recovery, recovery, 3);
15009        xmlResetLastError();
15010        if (mem_base != xmlMemBlocks()) {
15011            printf("Leak of %d blocks found in xmlSAXParseMemory",
15012	           xmlMemBlocks() - mem_base);
15013	    test_ret++;
15014            printf(" %d", n_sax);
15015            printf(" %d", n_buffer);
15016            printf(" %d", n_size);
15017            printf(" %d", n_recovery);
15018            printf("\n");
15019        }
15020    }
15021    }
15022    }
15023    }
15024    function_tests++;
15025#endif
15026#endif
15027
15028    return(test_ret);
15029}
15030
15031
15032static int
15033test_xmlSAXParseMemoryWithData(void) {
15034    int test_ret = 0;
15035
15036#if defined(LIBXML_SAX1_ENABLED)
15037#ifdef LIBXML_SAX1_ENABLED
15038    int mem_base;
15039    xmlDocPtr ret_val;
15040    xmlSAXHandlerPtr sax; /* the SAX handler block */
15041    int n_sax;
15042    char * buffer; /* an pointer to a char array */
15043    int n_buffer;
15044    int size; /* the size of the array */
15045    int n_size;
15046    int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */
15047    int n_recovery;
15048    void * data; /* the userdata */
15049    int n_data;
15050
15051    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15052    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15053    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15054    for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) {
15055    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
15056        mem_base = xmlMemBlocks();
15057        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15058        buffer = gen_const_char_ptr(n_buffer, 1);
15059        size = gen_int(n_size, 2);
15060        recovery = gen_int(n_recovery, 3);
15061        data = gen_userdata(n_data, 4);
15062
15063        ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data);
15064        desret_xmlDocPtr(ret_val);
15065        call_tests++;
15066        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15067        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
15068        des_int(n_size, size, 2);
15069        des_int(n_recovery, recovery, 3);
15070        des_userdata(n_data, data, 4);
15071        xmlResetLastError();
15072        if (mem_base != xmlMemBlocks()) {
15073            printf("Leak of %d blocks found in xmlSAXParseMemoryWithData",
15074	           xmlMemBlocks() - mem_base);
15075	    test_ret++;
15076            printf(" %d", n_sax);
15077            printf(" %d", n_buffer);
15078            printf(" %d", n_size);
15079            printf(" %d", n_recovery);
15080            printf(" %d", n_data);
15081            printf("\n");
15082        }
15083    }
15084    }
15085    }
15086    }
15087    }
15088    function_tests++;
15089#endif
15090#endif
15091
15092    return(test_ret);
15093}
15094
15095
15096static int
15097test_xmlSAXUserParseFile(void) {
15098    int test_ret = 0;
15099
15100#if defined(LIBXML_SAX1_ENABLED)
15101#ifdef LIBXML_SAX1_ENABLED
15102    int mem_base;
15103    int ret_val;
15104    xmlSAXHandlerPtr sax; /* a SAX handler */
15105    int n_sax;
15106    void * user_data; /* The user data returned on SAX callbacks */
15107    int n_user_data;
15108    const char * filename; /* a file name */
15109    int n_filename;
15110
15111    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15112    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15113    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15114        mem_base = xmlMemBlocks();
15115        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15116        user_data = gen_userdata(n_user_data, 1);
15117        filename = gen_filepath(n_filename, 2);
15118
15119#ifdef LIBXML_SAX1_ENABLED
15120        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15121#endif
15122
15123
15124        ret_val = xmlSAXUserParseFile(sax, user_data, filename);
15125        desret_int(ret_val);
15126        call_tests++;
15127        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15128        des_userdata(n_user_data, user_data, 1);
15129        des_filepath(n_filename, filename, 2);
15130        xmlResetLastError();
15131        if (mem_base != xmlMemBlocks()) {
15132            printf("Leak of %d blocks found in xmlSAXUserParseFile",
15133	           xmlMemBlocks() - mem_base);
15134	    test_ret++;
15135            printf(" %d", n_sax);
15136            printf(" %d", n_user_data);
15137            printf(" %d", n_filename);
15138            printf("\n");
15139        }
15140    }
15141    }
15142    }
15143    function_tests++;
15144#endif
15145#endif
15146
15147    return(test_ret);
15148}
15149
15150
15151static int
15152test_xmlSAXUserParseMemory(void) {
15153    int test_ret = 0;
15154
15155#if defined(LIBXML_SAX1_ENABLED)
15156#ifdef LIBXML_SAX1_ENABLED
15157    int mem_base;
15158    int ret_val;
15159    xmlSAXHandlerPtr sax; /* a SAX handler */
15160    int n_sax;
15161    void * user_data; /* The user data returned on SAX callbacks */
15162    int n_user_data;
15163    char * buffer; /* an in-memory XML document input */
15164    int n_buffer;
15165    int size; /* the length of the XML document in bytes */
15166    int n_size;
15167
15168    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
15169    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
15170    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15171    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15172        mem_base = xmlMemBlocks();
15173        sax = gen_xmlSAXHandlerPtr(n_sax, 0);
15174        user_data = gen_userdata(n_user_data, 1);
15175        buffer = gen_const_char_ptr(n_buffer, 2);
15176        size = gen_int(n_size, 3);
15177
15178#ifdef LIBXML_SAX1_ENABLED
15179        if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL;
15180#endif
15181
15182
15183        ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size);
15184        desret_int(ret_val);
15185        call_tests++;
15186        des_xmlSAXHandlerPtr(n_sax, sax, 0);
15187        des_userdata(n_user_data, user_data, 1);
15188        des_const_char_ptr(n_buffer, (const char *)buffer, 2);
15189        des_int(n_size, size, 3);
15190        xmlResetLastError();
15191        if (mem_base != xmlMemBlocks()) {
15192            printf("Leak of %d blocks found in xmlSAXUserParseMemory",
15193	           xmlMemBlocks() - mem_base);
15194	    test_ret++;
15195            printf(" %d", n_sax);
15196            printf(" %d", n_user_data);
15197            printf(" %d", n_buffer);
15198            printf(" %d", n_size);
15199            printf("\n");
15200        }
15201    }
15202    }
15203    }
15204    }
15205    function_tests++;
15206#endif
15207#endif
15208
15209    return(test_ret);
15210}
15211
15212
15213static int
15214test_xmlSetExternalEntityLoader(void) {
15215    int test_ret = 0;
15216
15217
15218    /* missing type support */
15219    return(test_ret);
15220}
15221
15222
15223static int
15224test_xmlSetFeature(void) {
15225    int test_ret = 0;
15226
15227#if defined(LIBXML_LEGACY_ENABLED)
15228#ifdef LIBXML_LEGACY_ENABLED
15229    int mem_base;
15230    int ret_val;
15231    xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */
15232    int n_ctxt;
15233    char * name; /* the feature name */
15234    int n_name;
15235    void * value; /* pointer to the location of the new value */
15236    int n_value;
15237
15238    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15239    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
15240    for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) {
15241        mem_base = xmlMemBlocks();
15242        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15243        name = gen_const_char_ptr(n_name, 1);
15244        value = gen_void_ptr(n_value, 2);
15245
15246        ret_val = xmlSetFeature(ctxt, (const char *)name, value);
15247        desret_int(ret_val);
15248        call_tests++;
15249        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15250        des_const_char_ptr(n_name, (const char *)name, 1);
15251        des_void_ptr(n_value, value, 2);
15252        xmlResetLastError();
15253        if (mem_base != xmlMemBlocks()) {
15254            printf("Leak of %d blocks found in xmlSetFeature",
15255	           xmlMemBlocks() - mem_base);
15256	    test_ret++;
15257            printf(" %d", n_ctxt);
15258            printf(" %d", n_name);
15259            printf(" %d", n_value);
15260            printf("\n");
15261        }
15262    }
15263    }
15264    }
15265    function_tests++;
15266#endif
15267#endif
15268
15269    return(test_ret);
15270}
15271
15272
15273static int
15274test_xmlSetupParserForBuffer(void) {
15275    int test_ret = 0;
15276
15277#if defined(LIBXML_SAX1_ENABLED)
15278#ifdef LIBXML_SAX1_ENABLED
15279    int mem_base;
15280    xmlParserCtxtPtr ctxt; /* an XML parser context */
15281    int n_ctxt;
15282    xmlChar * buffer; /* a xmlChar * buffer */
15283    int n_buffer;
15284    const char * filename; /* a file name */
15285    int n_filename;
15286
15287    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15288    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
15289    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
15290        mem_base = xmlMemBlocks();
15291        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15292        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
15293        filename = gen_filepath(n_filename, 2);
15294
15295        xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename);
15296        call_tests++;
15297        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15298        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
15299        des_filepath(n_filename, filename, 2);
15300        xmlResetLastError();
15301        if (mem_base != xmlMemBlocks()) {
15302            printf("Leak of %d blocks found in xmlSetupParserForBuffer",
15303	           xmlMemBlocks() - mem_base);
15304	    test_ret++;
15305            printf(" %d", n_ctxt);
15306            printf(" %d", n_buffer);
15307            printf(" %d", n_filename);
15308            printf("\n");
15309        }
15310    }
15311    }
15312    }
15313    function_tests++;
15314#endif
15315#endif
15316
15317    return(test_ret);
15318}
15319
15320
15321static int
15322test_xmlStopParser(void) {
15323    int test_ret = 0;
15324
15325#ifdef LIBXML_PUSH_ENABLED
15326    int mem_base;
15327    xmlParserCtxtPtr ctxt; /* an XML parser context */
15328    int n_ctxt;
15329
15330    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15331        mem_base = xmlMemBlocks();
15332        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15333
15334        xmlStopParser(ctxt);
15335        call_tests++;
15336        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15337        xmlResetLastError();
15338        if (mem_base != xmlMemBlocks()) {
15339            printf("Leak of %d blocks found in xmlStopParser",
15340	           xmlMemBlocks() - mem_base);
15341	    test_ret++;
15342            printf(" %d", n_ctxt);
15343            printf("\n");
15344        }
15345    }
15346    function_tests++;
15347#endif
15348
15349    return(test_ret);
15350}
15351
15352
15353static int
15354test_xmlSubstituteEntitiesDefault(void) {
15355    int test_ret = 0;
15356
15357    int mem_base;
15358    int ret_val;
15359    int val; /* int 0 or 1 */
15360    int n_val;
15361
15362    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15363        mem_base = xmlMemBlocks();
15364        val = gen_int(n_val, 0);
15365
15366        ret_val = xmlSubstituteEntitiesDefault(val);
15367        desret_int(ret_val);
15368        call_tests++;
15369        des_int(n_val, val, 0);
15370        xmlResetLastError();
15371        if (mem_base != xmlMemBlocks()) {
15372            printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault",
15373	           xmlMemBlocks() - mem_base);
15374	    test_ret++;
15375            printf(" %d", n_val);
15376            printf("\n");
15377        }
15378    }
15379    function_tests++;
15380
15381    return(test_ret);
15382}
15383
15384static int
15385test_parser(void) {
15386    int test_ret = 0;
15387
15388    if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n");
15389    test_ret += test_xmlByteConsumed();
15390    test_ret += test_xmlClearNodeInfoSeq();
15391    test_ret += test_xmlClearParserCtxt();
15392    test_ret += test_xmlCreateDocParserCtxt();
15393    test_ret += test_xmlCreatePushParserCtxt();
15394    test_ret += test_xmlCtxtReadDoc();
15395    test_ret += test_xmlCtxtReadFile();
15396    test_ret += test_xmlCtxtReadMemory();
15397    test_ret += test_xmlCtxtReset();
15398    test_ret += test_xmlCtxtResetPush();
15399    test_ret += test_xmlCtxtUseOptions();
15400    test_ret += test_xmlGetExternalEntityLoader();
15401    test_ret += test_xmlGetFeature();
15402    test_ret += test_xmlGetFeaturesList();
15403    test_ret += test_xmlHasFeature();
15404    test_ret += test_xmlIOParseDTD();
15405    test_ret += test_xmlInitNodeInfoSeq();
15406    test_ret += test_xmlInitParser();
15407    test_ret += test_xmlInitParserCtxt();
15408    test_ret += test_xmlKeepBlanksDefault();
15409    test_ret += test_xmlLineNumbersDefault();
15410    test_ret += test_xmlLoadExternalEntity();
15411    test_ret += test_xmlNewIOInputStream();
15412    test_ret += test_xmlNewParserCtxt();
15413    test_ret += test_xmlParseBalancedChunkMemory();
15414    test_ret += test_xmlParseBalancedChunkMemoryRecover();
15415    test_ret += test_xmlParseChunk();
15416    test_ret += test_xmlParseCtxtExternalEntity();
15417    test_ret += test_xmlParseDTD();
15418    test_ret += test_xmlParseDoc();
15419    test_ret += test_xmlParseDocument();
15420    test_ret += test_xmlParseEntity();
15421    test_ret += test_xmlParseExtParsedEnt();
15422    test_ret += test_xmlParseExternalEntity();
15423    test_ret += test_xmlParseFile();
15424    test_ret += test_xmlParseInNodeContext();
15425    test_ret += test_xmlParseMemory();
15426    test_ret += test_xmlParserAddNodeInfo();
15427    test_ret += test_xmlParserFindNodeInfo();
15428    test_ret += test_xmlParserFindNodeInfoIndex();
15429    test_ret += test_xmlParserInputGrow();
15430    test_ret += test_xmlParserInputRead();
15431    test_ret += test_xmlPedanticParserDefault();
15432    test_ret += test_xmlReadDoc();
15433    test_ret += test_xmlReadFile();
15434    test_ret += test_xmlReadMemory();
15435    test_ret += test_xmlRecoverDoc();
15436    test_ret += test_xmlRecoverFile();
15437    test_ret += test_xmlRecoverMemory();
15438    test_ret += test_xmlSAXParseDTD();
15439    test_ret += test_xmlSAXParseDoc();
15440    test_ret += test_xmlSAXParseEntity();
15441    test_ret += test_xmlSAXParseFile();
15442    test_ret += test_xmlSAXParseFileWithData();
15443    test_ret += test_xmlSAXParseMemory();
15444    test_ret += test_xmlSAXParseMemoryWithData();
15445    test_ret += test_xmlSAXUserParseFile();
15446    test_ret += test_xmlSAXUserParseMemory();
15447    test_ret += test_xmlSetExternalEntityLoader();
15448    test_ret += test_xmlSetFeature();
15449    test_ret += test_xmlSetupParserForBuffer();
15450    test_ret += test_xmlStopParser();
15451    test_ret += test_xmlSubstituteEntitiesDefault();
15452
15453    if (test_ret != 0)
15454	printf("Module parser: %d errors\n", test_ret);
15455    return(test_ret);
15456}
15457
15458static int
15459test_htmlCreateFileParserCtxt(void) {
15460    int test_ret = 0;
15461
15462#if defined(LIBXML_HTML_ENABLED)
15463    int mem_base;
15464    htmlParserCtxtPtr ret_val;
15465    const char * filename; /* the filename */
15466    int n_filename;
15467    char * encoding; /* a free form C string describing the HTML document encoding, or NULL */
15468    int n_encoding;
15469
15470    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15471    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
15472        mem_base = xmlMemBlocks();
15473        filename = gen_fileoutput(n_filename, 0);
15474        encoding = gen_const_char_ptr(n_encoding, 1);
15475
15476        ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding);
15477        desret_htmlParserCtxtPtr(ret_val);
15478        call_tests++;
15479        des_fileoutput(n_filename, filename, 0);
15480        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
15481        xmlResetLastError();
15482        if (mem_base != xmlMemBlocks()) {
15483            printf("Leak of %d blocks found in htmlCreateFileParserCtxt",
15484	           xmlMemBlocks() - mem_base);
15485	    test_ret++;
15486            printf(" %d", n_filename);
15487            printf(" %d", n_encoding);
15488            printf("\n");
15489        }
15490    }
15491    }
15492    function_tests++;
15493#endif
15494
15495    return(test_ret);
15496}
15497
15498
15499static int
15500test_htmlInitAutoClose(void) {
15501    int test_ret = 0;
15502
15503#if defined(LIBXML_HTML_ENABLED)
15504    int mem_base;
15505
15506        mem_base = xmlMemBlocks();
15507
15508        htmlInitAutoClose();
15509        call_tests++;
15510        xmlResetLastError();
15511        if (mem_base != xmlMemBlocks()) {
15512            printf("Leak of %d blocks found in htmlInitAutoClose",
15513	           xmlMemBlocks() - mem_base);
15514	    test_ret++;
15515            printf("\n");
15516        }
15517    function_tests++;
15518#endif
15519
15520    return(test_ret);
15521}
15522
15523
15524static int
15525test_inputPop(void) {
15526    int test_ret = 0;
15527
15528    int mem_base;
15529    xmlParserInputPtr ret_val;
15530    xmlParserCtxtPtr ctxt; /* an XML parser context */
15531    int n_ctxt;
15532
15533    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15534        mem_base = xmlMemBlocks();
15535        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15536
15537        ret_val = inputPop(ctxt);
15538        desret_xmlParserInputPtr(ret_val);
15539        call_tests++;
15540        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15541        xmlResetLastError();
15542        if (mem_base != xmlMemBlocks()) {
15543            printf("Leak of %d blocks found in inputPop",
15544	           xmlMemBlocks() - mem_base);
15545	    test_ret++;
15546            printf(" %d", n_ctxt);
15547            printf("\n");
15548        }
15549    }
15550    function_tests++;
15551
15552    return(test_ret);
15553}
15554
15555
15556static int
15557test_inputPush(void) {
15558    int test_ret = 0;
15559
15560    int mem_base;
15561    int ret_val;
15562    xmlParserCtxtPtr ctxt; /* an XML parser context */
15563    int n_ctxt;
15564    xmlParserInputPtr value; /* the parser input */
15565    int n_value;
15566
15567    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15568    for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) {
15569        mem_base = xmlMemBlocks();
15570        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15571        value = gen_xmlParserInputPtr(n_value, 1);
15572
15573        ret_val = inputPush(ctxt, value);
15574        desret_int(ret_val);
15575        call_tests++;
15576        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15577        des_xmlParserInputPtr(n_value, value, 1);
15578        xmlResetLastError();
15579        if (mem_base != xmlMemBlocks()) {
15580            printf("Leak of %d blocks found in inputPush",
15581	           xmlMemBlocks() - mem_base);
15582	    test_ret++;
15583            printf(" %d", n_ctxt);
15584            printf(" %d", n_value);
15585            printf("\n");
15586        }
15587    }
15588    }
15589    function_tests++;
15590
15591    return(test_ret);
15592}
15593
15594
15595static int
15596test_namePop(void) {
15597    int test_ret = 0;
15598
15599    int mem_base;
15600    const xmlChar * ret_val;
15601    xmlParserCtxtPtr ctxt; /* an XML parser context */
15602    int n_ctxt;
15603
15604    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15605        mem_base = xmlMemBlocks();
15606        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15607
15608        ret_val = namePop(ctxt);
15609        desret_const_xmlChar_ptr(ret_val);
15610        call_tests++;
15611        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15612        xmlResetLastError();
15613        if (mem_base != xmlMemBlocks()) {
15614            printf("Leak of %d blocks found in namePop",
15615	           xmlMemBlocks() - mem_base);
15616	    test_ret++;
15617            printf(" %d", n_ctxt);
15618            printf("\n");
15619        }
15620    }
15621    function_tests++;
15622
15623    return(test_ret);
15624}
15625
15626
15627static int
15628test_namePush(void) {
15629    int test_ret = 0;
15630
15631    int mem_base;
15632    int ret_val;
15633    xmlParserCtxtPtr ctxt; /* an XML parser context */
15634    int n_ctxt;
15635    xmlChar * value; /* the element name */
15636    int n_value;
15637
15638    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15639    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
15640        mem_base = xmlMemBlocks();
15641        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15642        value = gen_const_xmlChar_ptr(n_value, 1);
15643
15644        ret_val = namePush(ctxt, (const xmlChar *)value);
15645        desret_int(ret_val);
15646        call_tests++;
15647        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15648        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
15649        xmlResetLastError();
15650        if (mem_base != xmlMemBlocks()) {
15651            printf("Leak of %d blocks found in namePush",
15652	           xmlMemBlocks() - mem_base);
15653	    test_ret++;
15654            printf(" %d", n_ctxt);
15655            printf(" %d", n_value);
15656            printf("\n");
15657        }
15658    }
15659    }
15660    function_tests++;
15661
15662    return(test_ret);
15663}
15664
15665
15666static int
15667test_nodePop(void) {
15668    int test_ret = 0;
15669
15670    int mem_base;
15671    xmlNodePtr ret_val;
15672    xmlParserCtxtPtr ctxt; /* an XML parser context */
15673    int n_ctxt;
15674
15675    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15676        mem_base = xmlMemBlocks();
15677        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15678
15679        ret_val = nodePop(ctxt);
15680        desret_xmlNodePtr(ret_val);
15681        call_tests++;
15682        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15683        xmlResetLastError();
15684        if (mem_base != xmlMemBlocks()) {
15685            printf("Leak of %d blocks found in nodePop",
15686	           xmlMemBlocks() - mem_base);
15687	    test_ret++;
15688            printf(" %d", n_ctxt);
15689            printf("\n");
15690        }
15691    }
15692    function_tests++;
15693
15694    return(test_ret);
15695}
15696
15697
15698static int
15699test_nodePush(void) {
15700    int test_ret = 0;
15701
15702    int mem_base;
15703    int ret_val;
15704    xmlParserCtxtPtr ctxt; /* an XML parser context */
15705    int n_ctxt;
15706    xmlNodePtr value; /* the element node */
15707    int n_value;
15708
15709    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
15710    for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
15711        mem_base = xmlMemBlocks();
15712        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
15713        value = gen_xmlNodePtr(n_value, 1);
15714
15715        ret_val = nodePush(ctxt, value);
15716        desret_int(ret_val);
15717        call_tests++;
15718        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
15719        des_xmlNodePtr(n_value, value, 1);
15720        xmlResetLastError();
15721        if (mem_base != xmlMemBlocks()) {
15722            printf("Leak of %d blocks found in nodePush",
15723	           xmlMemBlocks() - mem_base);
15724	    test_ret++;
15725            printf(" %d", n_ctxt);
15726            printf(" %d", n_value);
15727            printf("\n");
15728        }
15729    }
15730    }
15731    function_tests++;
15732
15733    return(test_ret);
15734}
15735
15736
15737static int
15738test_xmlCheckLanguageID(void) {
15739    int test_ret = 0;
15740
15741    int mem_base;
15742    int ret_val;
15743    xmlChar * lang; /* pointer to the string value */
15744    int n_lang;
15745
15746    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
15747        mem_base = xmlMemBlocks();
15748        lang = gen_const_xmlChar_ptr(n_lang, 0);
15749
15750        ret_val = xmlCheckLanguageID((const xmlChar *)lang);
15751        desret_int(ret_val);
15752        call_tests++;
15753        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0);
15754        xmlResetLastError();
15755        if (mem_base != xmlMemBlocks()) {
15756            printf("Leak of %d blocks found in xmlCheckLanguageID",
15757	           xmlMemBlocks() - mem_base);
15758	    test_ret++;
15759            printf(" %d", n_lang);
15760            printf("\n");
15761        }
15762    }
15763    function_tests++;
15764
15765    return(test_ret);
15766}
15767
15768
15769static int
15770test_xmlCopyChar(void) {
15771    int test_ret = 0;
15772
15773    int mem_base;
15774    int ret_val;
15775    int len; /* Ignored, compatibility */
15776    int n_len;
15777    xmlChar * out; /* pointer to an array of xmlChar */
15778    int n_out;
15779    int val; /* the char value */
15780    int n_val;
15781
15782    for (n_len = 0;n_len < gen_nb_int;n_len++) {
15783    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15784    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15785        mem_base = xmlMemBlocks();
15786        len = gen_int(n_len, 0);
15787        out = gen_xmlChar_ptr(n_out, 1);
15788        val = gen_int(n_val, 2);
15789
15790        ret_val = xmlCopyChar(len, out, val);
15791        desret_int(ret_val);
15792        call_tests++;
15793        des_int(n_len, len, 0);
15794        des_xmlChar_ptr(n_out, out, 1);
15795        des_int(n_val, val, 2);
15796        xmlResetLastError();
15797        if (mem_base != xmlMemBlocks()) {
15798            printf("Leak of %d blocks found in xmlCopyChar",
15799	           xmlMemBlocks() - mem_base);
15800	    test_ret++;
15801            printf(" %d", n_len);
15802            printf(" %d", n_out);
15803            printf(" %d", n_val);
15804            printf("\n");
15805        }
15806    }
15807    }
15808    }
15809    function_tests++;
15810
15811    return(test_ret);
15812}
15813
15814
15815static int
15816test_xmlCopyCharMultiByte(void) {
15817    int test_ret = 0;
15818
15819    int mem_base;
15820    int ret_val;
15821    xmlChar * out; /* pointer to an array of xmlChar */
15822    int n_out;
15823    int val; /* the char value */
15824    int n_val;
15825
15826    for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) {
15827    for (n_val = 0;n_val < gen_nb_int;n_val++) {
15828        mem_base = xmlMemBlocks();
15829        out = gen_xmlChar_ptr(n_out, 0);
15830        val = gen_int(n_val, 1);
15831
15832        ret_val = xmlCopyCharMultiByte(out, val);
15833        desret_int(ret_val);
15834        call_tests++;
15835        des_xmlChar_ptr(n_out, out, 0);
15836        des_int(n_val, val, 1);
15837        xmlResetLastError();
15838        if (mem_base != xmlMemBlocks()) {
15839            printf("Leak of %d blocks found in xmlCopyCharMultiByte",
15840	           xmlMemBlocks() - mem_base);
15841	    test_ret++;
15842            printf(" %d", n_out);
15843            printf(" %d", n_val);
15844            printf("\n");
15845        }
15846    }
15847    }
15848    function_tests++;
15849
15850    return(test_ret);
15851}
15852
15853
15854static int
15855test_xmlCreateEntityParserCtxt(void) {
15856    int test_ret = 0;
15857
15858    int mem_base;
15859    xmlParserCtxtPtr ret_val;
15860    xmlChar * URL; /* the entity URL */
15861    int n_URL;
15862    xmlChar * ID; /* the entity PUBLIC ID */
15863    int n_ID;
15864    xmlChar * base; /* a possible base for the target URI */
15865    int n_base;
15866
15867    for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) {
15868    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
15869    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
15870        mem_base = xmlMemBlocks();
15871        URL = gen_const_xmlChar_ptr(n_URL, 0);
15872        ID = gen_const_xmlChar_ptr(n_ID, 1);
15873        base = gen_const_xmlChar_ptr(n_base, 2);
15874
15875        ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base);
15876        desret_xmlParserCtxtPtr(ret_val);
15877        call_tests++;
15878        des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0);
15879        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
15880        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2);
15881        xmlResetLastError();
15882        if (mem_base != xmlMemBlocks()) {
15883            printf("Leak of %d blocks found in xmlCreateEntityParserCtxt",
15884	           xmlMemBlocks() - mem_base);
15885	    test_ret++;
15886            printf(" %d", n_URL);
15887            printf(" %d", n_ID);
15888            printf(" %d", n_base);
15889            printf("\n");
15890        }
15891    }
15892    }
15893    }
15894    function_tests++;
15895
15896    return(test_ret);
15897}
15898
15899
15900static int
15901test_xmlCreateFileParserCtxt(void) {
15902    int test_ret = 0;
15903
15904    int mem_base;
15905    xmlParserCtxtPtr ret_val;
15906    const char * filename; /* the filename */
15907    int n_filename;
15908
15909    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15910        mem_base = xmlMemBlocks();
15911        filename = gen_fileoutput(n_filename, 0);
15912
15913        ret_val = xmlCreateFileParserCtxt(filename);
15914        desret_xmlParserCtxtPtr(ret_val);
15915        call_tests++;
15916        des_fileoutput(n_filename, filename, 0);
15917        xmlResetLastError();
15918        if (mem_base != xmlMemBlocks()) {
15919            printf("Leak of %d blocks found in xmlCreateFileParserCtxt",
15920	           xmlMemBlocks() - mem_base);
15921	    test_ret++;
15922            printf(" %d", n_filename);
15923            printf("\n");
15924        }
15925    }
15926    function_tests++;
15927
15928    return(test_ret);
15929}
15930
15931
15932static int
15933test_xmlCreateMemoryParserCtxt(void) {
15934    int test_ret = 0;
15935
15936    int mem_base;
15937    xmlParserCtxtPtr ret_val;
15938    char * buffer; /* a pointer to a char array */
15939    int n_buffer;
15940    int size; /* the size of the array */
15941    int n_size;
15942
15943    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
15944    for (n_size = 0;n_size < gen_nb_int;n_size++) {
15945        mem_base = xmlMemBlocks();
15946        buffer = gen_const_char_ptr(n_buffer, 0);
15947        size = gen_int(n_size, 1);
15948
15949        ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size);
15950        desret_xmlParserCtxtPtr(ret_val);
15951        call_tests++;
15952        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
15953        des_int(n_size, size, 1);
15954        xmlResetLastError();
15955        if (mem_base != xmlMemBlocks()) {
15956            printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt",
15957	           xmlMemBlocks() - mem_base);
15958	    test_ret++;
15959            printf(" %d", n_buffer);
15960            printf(" %d", n_size);
15961            printf("\n");
15962        }
15963    }
15964    }
15965    function_tests++;
15966
15967    return(test_ret);
15968}
15969
15970
15971static int
15972test_xmlCreateURLParserCtxt(void) {
15973    int test_ret = 0;
15974
15975    int mem_base;
15976    xmlParserCtxtPtr ret_val;
15977    const char * filename; /* the filename or URL */
15978    int n_filename;
15979    int options; /* a combination of xmlParserOption */
15980    int n_options;
15981
15982    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
15983    for (n_options = 0;n_options < gen_nb_int;n_options++) {
15984        mem_base = xmlMemBlocks();
15985        filename = gen_fileoutput(n_filename, 0);
15986        options = gen_int(n_options, 1);
15987
15988        ret_val = xmlCreateURLParserCtxt(filename, options);
15989        desret_xmlParserCtxtPtr(ret_val);
15990        call_tests++;
15991        des_fileoutput(n_filename, filename, 0);
15992        des_int(n_options, options, 1);
15993        xmlResetLastError();
15994        if (mem_base != xmlMemBlocks()) {
15995            printf("Leak of %d blocks found in xmlCreateURLParserCtxt",
15996	           xmlMemBlocks() - mem_base);
15997	    test_ret++;
15998            printf(" %d", n_filename);
15999            printf(" %d", n_options);
16000            printf("\n");
16001        }
16002    }
16003    }
16004    function_tests++;
16005
16006    return(test_ret);
16007}
16008
16009
16010static int
16011test_xmlCurrentChar(void) {
16012    int test_ret = 0;
16013
16014    int mem_base;
16015    int ret_val;
16016    xmlParserCtxtPtr ctxt; /* the XML parser context */
16017    int n_ctxt;
16018    int * len; /* pointer to the length of the char read */
16019    int n_len;
16020
16021    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16022    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16023        mem_base = xmlMemBlocks();
16024        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16025        len = gen_int_ptr(n_len, 1);
16026
16027        ret_val = xmlCurrentChar(ctxt, len);
16028        desret_int(ret_val);
16029        call_tests++;
16030        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16031        des_int_ptr(n_len, len, 1);
16032        xmlResetLastError();
16033        if (mem_base != xmlMemBlocks()) {
16034            printf("Leak of %d blocks found in xmlCurrentChar",
16035	           xmlMemBlocks() - mem_base);
16036	    test_ret++;
16037            printf(" %d", n_ctxt);
16038            printf(" %d", n_len);
16039            printf("\n");
16040        }
16041    }
16042    }
16043    function_tests++;
16044
16045    return(test_ret);
16046}
16047
16048
16049static int
16050test_xmlErrMemory(void) {
16051    int test_ret = 0;
16052
16053    int mem_base;
16054    xmlParserCtxtPtr ctxt; /* an XML parser context */
16055    int n_ctxt;
16056    char * extra; /* extra informations */
16057    int n_extra;
16058
16059    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16060    for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) {
16061        mem_base = xmlMemBlocks();
16062        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16063        extra = gen_const_char_ptr(n_extra, 1);
16064
16065        xmlErrMemory(ctxt, (const char *)extra);
16066        call_tests++;
16067        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16068        des_const_char_ptr(n_extra, (const char *)extra, 1);
16069        xmlResetLastError();
16070        if (mem_base != xmlMemBlocks()) {
16071            printf("Leak of %d blocks found in xmlErrMemory",
16072	           xmlMemBlocks() - mem_base);
16073	    test_ret++;
16074            printf(" %d", n_ctxt);
16075            printf(" %d", n_extra);
16076            printf("\n");
16077        }
16078    }
16079    }
16080    function_tests++;
16081
16082    return(test_ret);
16083}
16084
16085
16086static int
16087test_xmlIsLetter(void) {
16088    int test_ret = 0;
16089
16090    int mem_base;
16091    int ret_val;
16092    int c; /* an unicode character (int) */
16093    int n_c;
16094
16095    for (n_c = 0;n_c < gen_nb_int;n_c++) {
16096        mem_base = xmlMemBlocks();
16097        c = gen_int(n_c, 0);
16098
16099        ret_val = xmlIsLetter(c);
16100        desret_int(ret_val);
16101        call_tests++;
16102        des_int(n_c, c, 0);
16103        xmlResetLastError();
16104        if (mem_base != xmlMemBlocks()) {
16105            printf("Leak of %d blocks found in xmlIsLetter",
16106	           xmlMemBlocks() - mem_base);
16107	    test_ret++;
16108            printf(" %d", n_c);
16109            printf("\n");
16110        }
16111    }
16112    function_tests++;
16113
16114    return(test_ret);
16115}
16116
16117
16118static int
16119test_xmlNewEntityInputStream(void) {
16120    int test_ret = 0;
16121
16122    int mem_base;
16123    xmlParserInputPtr ret_val;
16124    xmlParserCtxtPtr ctxt; /* an XML parser context */
16125    int n_ctxt;
16126    xmlEntityPtr entity; /* an Entity pointer */
16127    int n_entity;
16128
16129    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16130    for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) {
16131        mem_base = xmlMemBlocks();
16132        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16133        entity = gen_xmlEntityPtr(n_entity, 1);
16134
16135        ret_val = xmlNewEntityInputStream(ctxt, entity);
16136        desret_xmlParserInputPtr(ret_val);
16137        call_tests++;
16138        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16139        des_xmlEntityPtr(n_entity, entity, 1);
16140        xmlResetLastError();
16141        if (mem_base != xmlMemBlocks()) {
16142            printf("Leak of %d blocks found in xmlNewEntityInputStream",
16143	           xmlMemBlocks() - mem_base);
16144	    test_ret++;
16145            printf(" %d", n_ctxt);
16146            printf(" %d", n_entity);
16147            printf("\n");
16148        }
16149    }
16150    }
16151    function_tests++;
16152
16153    return(test_ret);
16154}
16155
16156
16157static int
16158test_xmlNewInputFromFile(void) {
16159    int test_ret = 0;
16160
16161    int mem_base;
16162    xmlParserInputPtr ret_val;
16163    xmlParserCtxtPtr ctxt; /* an XML parser context */
16164    int n_ctxt;
16165    const char * filename; /* the filename to use as entity */
16166    int n_filename;
16167
16168    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16169    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16170        mem_base = xmlMemBlocks();
16171        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16172        filename = gen_filepath(n_filename, 1);
16173
16174        ret_val = xmlNewInputFromFile(ctxt, filename);
16175        desret_xmlParserInputPtr(ret_val);
16176        call_tests++;
16177        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16178        des_filepath(n_filename, filename, 1);
16179        xmlResetLastError();
16180        if (mem_base != xmlMemBlocks()) {
16181            printf("Leak of %d blocks found in xmlNewInputFromFile",
16182	           xmlMemBlocks() - mem_base);
16183	    test_ret++;
16184            printf(" %d", n_ctxt);
16185            printf(" %d", n_filename);
16186            printf("\n");
16187        }
16188    }
16189    }
16190    function_tests++;
16191
16192    return(test_ret);
16193}
16194
16195
16196static int
16197test_xmlNewInputStream(void) {
16198    int test_ret = 0;
16199
16200    int mem_base;
16201    xmlParserInputPtr ret_val;
16202    xmlParserCtxtPtr ctxt; /* an XML parser context */
16203    int n_ctxt;
16204
16205    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16206        mem_base = xmlMemBlocks();
16207        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16208
16209        ret_val = xmlNewInputStream(ctxt);
16210        desret_xmlParserInputPtr(ret_val);
16211        call_tests++;
16212        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16213        xmlResetLastError();
16214        if (mem_base != xmlMemBlocks()) {
16215            printf("Leak of %d blocks found in xmlNewInputStream",
16216	           xmlMemBlocks() - mem_base);
16217	    test_ret++;
16218            printf(" %d", n_ctxt);
16219            printf("\n");
16220        }
16221    }
16222    function_tests++;
16223
16224    return(test_ret);
16225}
16226
16227
16228static int
16229test_xmlNewStringInputStream(void) {
16230    int test_ret = 0;
16231
16232    int mem_base;
16233    xmlParserInputPtr ret_val;
16234    xmlParserCtxtPtr ctxt; /* an XML parser context */
16235    int n_ctxt;
16236    xmlChar * buffer; /* an memory buffer */
16237    int n_buffer;
16238
16239    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16240    for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) {
16241        mem_base = xmlMemBlocks();
16242        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16243        buffer = gen_const_xmlChar_ptr(n_buffer, 1);
16244
16245        ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer);
16246        desret_xmlParserInputPtr(ret_val);
16247        call_tests++;
16248        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16249        des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1);
16250        xmlResetLastError();
16251        if (mem_base != xmlMemBlocks()) {
16252            printf("Leak of %d blocks found in xmlNewStringInputStream",
16253	           xmlMemBlocks() - mem_base);
16254	    test_ret++;
16255            printf(" %d", n_ctxt);
16256            printf(" %d", n_buffer);
16257            printf("\n");
16258        }
16259    }
16260    }
16261    function_tests++;
16262
16263    return(test_ret);
16264}
16265
16266
16267static int
16268test_xmlNextChar(void) {
16269    int test_ret = 0;
16270
16271    int mem_base;
16272    xmlParserCtxtPtr ctxt; /* the XML parser context */
16273    int n_ctxt;
16274
16275    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16276        mem_base = xmlMemBlocks();
16277        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16278
16279        xmlNextChar(ctxt);
16280        call_tests++;
16281        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16282        xmlResetLastError();
16283        if (mem_base != xmlMemBlocks()) {
16284            printf("Leak of %d blocks found in xmlNextChar",
16285	           xmlMemBlocks() - mem_base);
16286	    test_ret++;
16287            printf(" %d", n_ctxt);
16288            printf("\n");
16289        }
16290    }
16291    function_tests++;
16292
16293    return(test_ret);
16294}
16295
16296
16297static int
16298test_xmlParserInputShrink(void) {
16299    int test_ret = 0;
16300
16301    int mem_base;
16302    xmlParserInputPtr in; /* an XML parser input */
16303    int n_in;
16304
16305    for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) {
16306        mem_base = xmlMemBlocks();
16307        in = gen_xmlParserInputPtr(n_in, 0);
16308
16309        xmlParserInputShrink(in);
16310        call_tests++;
16311        des_xmlParserInputPtr(n_in, in, 0);
16312        xmlResetLastError();
16313        if (mem_base != xmlMemBlocks()) {
16314            printf("Leak of %d blocks found in xmlParserInputShrink",
16315	           xmlMemBlocks() - mem_base);
16316	    test_ret++;
16317            printf(" %d", n_in);
16318            printf("\n");
16319        }
16320    }
16321    function_tests++;
16322
16323    return(test_ret);
16324}
16325
16326
16327static int
16328test_xmlPopInput(void) {
16329    int test_ret = 0;
16330
16331    int mem_base;
16332    xmlChar ret_val;
16333    xmlParserCtxtPtr ctxt; /* an XML parser context */
16334    int n_ctxt;
16335
16336    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16337        mem_base = xmlMemBlocks();
16338        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16339
16340        ret_val = xmlPopInput(ctxt);
16341        desret_xmlChar(ret_val);
16342        call_tests++;
16343        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16344        xmlResetLastError();
16345        if (mem_base != xmlMemBlocks()) {
16346            printf("Leak of %d blocks found in xmlPopInput",
16347	           xmlMemBlocks() - mem_base);
16348	    test_ret++;
16349            printf(" %d", n_ctxt);
16350            printf("\n");
16351        }
16352    }
16353    function_tests++;
16354
16355    return(test_ret);
16356}
16357
16358
16359static int
16360test_xmlPushInput(void) {
16361    int test_ret = 0;
16362
16363    int mem_base;
16364    int ret_val;
16365    xmlParserCtxtPtr ctxt; /* an XML parser context */
16366    int n_ctxt;
16367    xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
16368    int n_input;
16369
16370    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16371    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16372        mem_base = xmlMemBlocks();
16373        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16374        input = gen_xmlParserInputPtr(n_input, 1);
16375
16376        ret_val = xmlPushInput(ctxt, input);
16377        desret_int(ret_val);
16378        call_tests++;
16379        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16380        des_xmlParserInputPtr(n_input, input, 1);
16381        xmlResetLastError();
16382        if (mem_base != xmlMemBlocks()) {
16383            printf("Leak of %d blocks found in xmlPushInput",
16384	           xmlMemBlocks() - mem_base);
16385	    test_ret++;
16386            printf(" %d", n_ctxt);
16387            printf(" %d", n_input);
16388            printf("\n");
16389        }
16390    }
16391    }
16392    function_tests++;
16393
16394    return(test_ret);
16395}
16396
16397
16398static int
16399test_xmlSetEntityReferenceFunc(void) {
16400    int test_ret = 0;
16401
16402
16403    /* missing type support */
16404    return(test_ret);
16405}
16406
16407
16408static int
16409test_xmlSplitQName(void) {
16410    int test_ret = 0;
16411
16412    int mem_base;
16413    xmlChar * ret_val;
16414    xmlParserCtxtPtr ctxt; /* an XML parser context */
16415    int n_ctxt;
16416    xmlChar * name; /* an XML parser context */
16417    int n_name;
16418    xmlChar ** prefix; /* a xmlChar ** */
16419    int n_prefix;
16420
16421    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16422    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
16423    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
16424        mem_base = xmlMemBlocks();
16425        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16426        name = gen_const_xmlChar_ptr(n_name, 1);
16427        prefix = gen_xmlChar_ptr_ptr(n_prefix, 2);
16428
16429        ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix);
16430        desret_xmlChar_ptr(ret_val);
16431        call_tests++;
16432        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16433        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
16434        des_xmlChar_ptr_ptr(n_prefix, prefix, 2);
16435        xmlResetLastError();
16436        if (mem_base != xmlMemBlocks()) {
16437            printf("Leak of %d blocks found in xmlSplitQName",
16438	           xmlMemBlocks() - mem_base);
16439	    test_ret++;
16440            printf(" %d", n_ctxt);
16441            printf(" %d", n_name);
16442            printf(" %d", n_prefix);
16443            printf("\n");
16444        }
16445    }
16446    }
16447    }
16448    function_tests++;
16449
16450    return(test_ret);
16451}
16452
16453
16454static int
16455test_xmlStringCurrentChar(void) {
16456    int test_ret = 0;
16457
16458    int mem_base;
16459    int ret_val;
16460    xmlParserCtxtPtr ctxt; /* the XML parser context */
16461    int n_ctxt;
16462    xmlChar * cur; /* pointer to the beginning of the char */
16463    int n_cur;
16464    int * len; /* pointer to the length of the char read */
16465    int n_len;
16466
16467    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16468    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
16469    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
16470        mem_base = xmlMemBlocks();
16471        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16472        cur = gen_const_xmlChar_ptr(n_cur, 1);
16473        len = gen_int_ptr(n_len, 2);
16474
16475        ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len);
16476        desret_int(ret_val);
16477        call_tests++;
16478        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16479        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
16480        des_int_ptr(n_len, len, 2);
16481        xmlResetLastError();
16482        if (mem_base != xmlMemBlocks()) {
16483            printf("Leak of %d blocks found in xmlStringCurrentChar",
16484	           xmlMemBlocks() - mem_base);
16485	    test_ret++;
16486            printf(" %d", n_ctxt);
16487            printf(" %d", n_cur);
16488            printf(" %d", n_len);
16489            printf("\n");
16490        }
16491    }
16492    }
16493    }
16494    function_tests++;
16495
16496    return(test_ret);
16497}
16498
16499
16500static int
16501test_xmlStringDecodeEntities(void) {
16502    int test_ret = 0;
16503
16504    int mem_base;
16505    xmlChar * ret_val;
16506    xmlParserCtxtPtr ctxt; /* the parser context */
16507    int n_ctxt;
16508    xmlChar * str; /* the input string */
16509    int n_str;
16510    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16511    int n_what;
16512    xmlChar end; /* an end marker xmlChar, 0 if none */
16513    int n_end;
16514    xmlChar end2; /* an end marker xmlChar, 0 if none */
16515    int n_end2;
16516    xmlChar end3; /* an end marker xmlChar, 0 if none */
16517    int n_end3;
16518
16519    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16520    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16521    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16522    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16523    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16524    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16525        mem_base = xmlMemBlocks();
16526        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16527        str = gen_const_xmlChar_ptr(n_str, 1);
16528        what = gen_int(n_what, 2);
16529        end = gen_xmlChar(n_end, 3);
16530        end2 = gen_xmlChar(n_end2, 4);
16531        end3 = gen_xmlChar(n_end3, 5);
16532
16533        ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3);
16534        desret_xmlChar_ptr(ret_val);
16535        call_tests++;
16536        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16537        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16538        des_int(n_what, what, 2);
16539        des_xmlChar(n_end, end, 3);
16540        des_xmlChar(n_end2, end2, 4);
16541        des_xmlChar(n_end3, end3, 5);
16542        xmlResetLastError();
16543        if (mem_base != xmlMemBlocks()) {
16544            printf("Leak of %d blocks found in xmlStringDecodeEntities",
16545	           xmlMemBlocks() - mem_base);
16546	    test_ret++;
16547            printf(" %d", n_ctxt);
16548            printf(" %d", n_str);
16549            printf(" %d", n_what);
16550            printf(" %d", n_end);
16551            printf(" %d", n_end2);
16552            printf(" %d", n_end3);
16553            printf("\n");
16554        }
16555    }
16556    }
16557    }
16558    }
16559    }
16560    }
16561    function_tests++;
16562
16563    return(test_ret);
16564}
16565
16566
16567static int
16568test_xmlStringLenDecodeEntities(void) {
16569    int test_ret = 0;
16570
16571    int mem_base;
16572    xmlChar * ret_val;
16573    xmlParserCtxtPtr ctxt; /* the parser context */
16574    int n_ctxt;
16575    xmlChar * str; /* the input string */
16576    int n_str;
16577    int len; /* the string length */
16578    int n_len;
16579    int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */
16580    int n_what;
16581    xmlChar end; /* an end marker xmlChar, 0 if none */
16582    int n_end;
16583    xmlChar end2; /* an end marker xmlChar, 0 if none */
16584    int n_end2;
16585    xmlChar end3; /* an end marker xmlChar, 0 if none */
16586    int n_end3;
16587
16588    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16589    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
16590    for (n_len = 0;n_len < gen_nb_int;n_len++) {
16591    for (n_what = 0;n_what < gen_nb_int;n_what++) {
16592    for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) {
16593    for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) {
16594    for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) {
16595        mem_base = xmlMemBlocks();
16596        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16597        str = gen_const_xmlChar_ptr(n_str, 1);
16598        len = gen_int(n_len, 2);
16599        what = gen_int(n_what, 3);
16600        end = gen_xmlChar(n_end, 4);
16601        end2 = gen_xmlChar(n_end2, 5);
16602        end3 = gen_xmlChar(n_end3, 6);
16603
16604        ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3);
16605        desret_xmlChar_ptr(ret_val);
16606        call_tests++;
16607        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16608        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
16609        des_int(n_len, len, 2);
16610        des_int(n_what, what, 3);
16611        des_xmlChar(n_end, end, 4);
16612        des_xmlChar(n_end2, end2, 5);
16613        des_xmlChar(n_end3, end3, 6);
16614        xmlResetLastError();
16615        if (mem_base != xmlMemBlocks()) {
16616            printf("Leak of %d blocks found in xmlStringLenDecodeEntities",
16617	           xmlMemBlocks() - mem_base);
16618	    test_ret++;
16619            printf(" %d", n_ctxt);
16620            printf(" %d", n_str);
16621            printf(" %d", n_len);
16622            printf(" %d", n_what);
16623            printf(" %d", n_end);
16624            printf(" %d", n_end2);
16625            printf(" %d", n_end3);
16626            printf("\n");
16627        }
16628    }
16629    }
16630    }
16631    }
16632    }
16633    }
16634    }
16635    function_tests++;
16636
16637    return(test_ret);
16638}
16639
16640
16641static int
16642test_xmlSwitchEncoding(void) {
16643    int test_ret = 0;
16644
16645    int mem_base;
16646    int ret_val;
16647    xmlParserCtxtPtr ctxt; /* the parser context */
16648    int n_ctxt;
16649    xmlCharEncoding enc; /* the encoding value (number) */
16650    int n_enc;
16651
16652    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16653    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
16654        mem_base = xmlMemBlocks();
16655        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16656        enc = gen_xmlCharEncoding(n_enc, 1);
16657
16658        ret_val = xmlSwitchEncoding(ctxt, enc);
16659        desret_int(ret_val);
16660        call_tests++;
16661        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16662        des_xmlCharEncoding(n_enc, enc, 1);
16663        xmlResetLastError();
16664        if (mem_base != xmlMemBlocks()) {
16665            printf("Leak of %d blocks found in xmlSwitchEncoding",
16666	           xmlMemBlocks() - mem_base);
16667	    test_ret++;
16668            printf(" %d", n_ctxt);
16669            printf(" %d", n_enc);
16670            printf("\n");
16671        }
16672    }
16673    }
16674    function_tests++;
16675
16676    return(test_ret);
16677}
16678
16679
16680static int
16681test_xmlSwitchInputEncoding(void) {
16682    int test_ret = 0;
16683
16684    int mem_base;
16685    int ret_val;
16686    xmlParserCtxtPtr ctxt; /* the parser context */
16687    int n_ctxt;
16688    xmlParserInputPtr input; /* the input stream */
16689    int n_input;
16690    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16691    int n_handler;
16692
16693    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16694    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
16695    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16696        mem_base = xmlMemBlocks();
16697        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16698        input = gen_xmlParserInputPtr(n_input, 1);
16699        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2);
16700
16701        ret_val = xmlSwitchInputEncoding(ctxt, input, handler);
16702        desret_int(ret_val);
16703        call_tests++;
16704        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16705        des_xmlParserInputPtr(n_input, input, 1);
16706        des_xmlCharEncodingHandlerPtr(n_handler, handler, 2);
16707        xmlResetLastError();
16708        if (mem_base != xmlMemBlocks()) {
16709            printf("Leak of %d blocks found in xmlSwitchInputEncoding",
16710	           xmlMemBlocks() - mem_base);
16711	    test_ret++;
16712            printf(" %d", n_ctxt);
16713            printf(" %d", n_input);
16714            printf(" %d", n_handler);
16715            printf("\n");
16716        }
16717    }
16718    }
16719    }
16720    function_tests++;
16721
16722    return(test_ret);
16723}
16724
16725
16726static int
16727test_xmlSwitchToEncoding(void) {
16728    int test_ret = 0;
16729
16730    int mem_base;
16731    int ret_val;
16732    xmlParserCtxtPtr ctxt; /* the parser context */
16733    int n_ctxt;
16734    xmlCharEncodingHandlerPtr handler; /* the encoding handler */
16735    int n_handler;
16736
16737    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16738    for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) {
16739        mem_base = xmlMemBlocks();
16740        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16741        handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1);
16742
16743        ret_val = xmlSwitchToEncoding(ctxt, handler);
16744        desret_int(ret_val);
16745        call_tests++;
16746        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16747        des_xmlCharEncodingHandlerPtr(n_handler, handler, 1);
16748        xmlResetLastError();
16749        if (mem_base != xmlMemBlocks()) {
16750            printf("Leak of %d blocks found in xmlSwitchToEncoding",
16751	           xmlMemBlocks() - mem_base);
16752	    test_ret++;
16753            printf(" %d", n_ctxt);
16754            printf(" %d", n_handler);
16755            printf("\n");
16756        }
16757    }
16758    }
16759    function_tests++;
16760
16761    return(test_ret);
16762}
16763
16764static int
16765test_parserInternals(void) {
16766    int test_ret = 0;
16767
16768    if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n");
16769    test_ret += test_htmlCreateFileParserCtxt();
16770    test_ret += test_htmlInitAutoClose();
16771    test_ret += test_inputPop();
16772    test_ret += test_inputPush();
16773    test_ret += test_namePop();
16774    test_ret += test_namePush();
16775    test_ret += test_nodePop();
16776    test_ret += test_nodePush();
16777    test_ret += test_xmlCheckLanguageID();
16778    test_ret += test_xmlCopyChar();
16779    test_ret += test_xmlCopyCharMultiByte();
16780    test_ret += test_xmlCreateEntityParserCtxt();
16781    test_ret += test_xmlCreateFileParserCtxt();
16782    test_ret += test_xmlCreateMemoryParserCtxt();
16783    test_ret += test_xmlCreateURLParserCtxt();
16784    test_ret += test_xmlCurrentChar();
16785    test_ret += test_xmlErrMemory();
16786    test_ret += test_xmlIsLetter();
16787    test_ret += test_xmlNewEntityInputStream();
16788    test_ret += test_xmlNewInputFromFile();
16789    test_ret += test_xmlNewInputStream();
16790    test_ret += test_xmlNewStringInputStream();
16791    test_ret += test_xmlNextChar();
16792    test_ret += test_xmlParserInputShrink();
16793    test_ret += test_xmlPopInput();
16794    test_ret += test_xmlPushInput();
16795    test_ret += test_xmlSetEntityReferenceFunc();
16796    test_ret += test_xmlSplitQName();
16797    test_ret += test_xmlStringCurrentChar();
16798    test_ret += test_xmlStringDecodeEntities();
16799    test_ret += test_xmlStringLenDecodeEntities();
16800    test_ret += test_xmlSwitchEncoding();
16801    test_ret += test_xmlSwitchInputEncoding();
16802    test_ret += test_xmlSwitchToEncoding();
16803
16804    if (test_ret != 0)
16805	printf("Module parserInternals: %d errors\n", test_ret);
16806    return(test_ret);
16807}
16808
16809static int
16810test_xmlPatternFromRoot(void) {
16811    int test_ret = 0;
16812
16813#if defined(LIBXML_PATTERN_ENABLED)
16814    int mem_base;
16815    int ret_val;
16816    xmlPatternPtr comp; /* the precompiled pattern */
16817    int n_comp;
16818
16819    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16820        mem_base = xmlMemBlocks();
16821        comp = gen_xmlPatternPtr(n_comp, 0);
16822
16823        ret_val = xmlPatternFromRoot(comp);
16824        desret_int(ret_val);
16825        call_tests++;
16826        des_xmlPatternPtr(n_comp, comp, 0);
16827        xmlResetLastError();
16828        if (mem_base != xmlMemBlocks()) {
16829            printf("Leak of %d blocks found in xmlPatternFromRoot",
16830	           xmlMemBlocks() - mem_base);
16831	    test_ret++;
16832            printf(" %d", n_comp);
16833            printf("\n");
16834        }
16835    }
16836    function_tests++;
16837#endif
16838
16839    return(test_ret);
16840}
16841
16842
16843static int
16844test_xmlPatternGetStreamCtxt(void) {
16845    int test_ret = 0;
16846
16847
16848    /* missing type support */
16849    return(test_ret);
16850}
16851
16852
16853static int
16854test_xmlPatternMatch(void) {
16855    int test_ret = 0;
16856
16857#if defined(LIBXML_PATTERN_ENABLED)
16858    int mem_base;
16859    int ret_val;
16860    xmlPatternPtr comp; /* the precompiled pattern */
16861    int n_comp;
16862    xmlNodePtr node; /* a node */
16863    int n_node;
16864
16865    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16866    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
16867        mem_base = xmlMemBlocks();
16868        comp = gen_xmlPatternPtr(n_comp, 0);
16869        node = gen_xmlNodePtr(n_node, 1);
16870
16871        ret_val = xmlPatternMatch(comp, node);
16872        desret_int(ret_val);
16873        call_tests++;
16874        des_xmlPatternPtr(n_comp, comp, 0);
16875        des_xmlNodePtr(n_node, node, 1);
16876        xmlResetLastError();
16877        if (mem_base != xmlMemBlocks()) {
16878            printf("Leak of %d blocks found in xmlPatternMatch",
16879	           xmlMemBlocks() - mem_base);
16880	    test_ret++;
16881            printf(" %d", n_comp);
16882            printf(" %d", n_node);
16883            printf("\n");
16884        }
16885    }
16886    }
16887    function_tests++;
16888#endif
16889
16890    return(test_ret);
16891}
16892
16893
16894static int
16895test_xmlPatternMaxDepth(void) {
16896    int test_ret = 0;
16897
16898#if defined(LIBXML_PATTERN_ENABLED)
16899    int mem_base;
16900    int ret_val;
16901    xmlPatternPtr comp; /* the precompiled pattern */
16902    int n_comp;
16903
16904    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16905        mem_base = xmlMemBlocks();
16906        comp = gen_xmlPatternPtr(n_comp, 0);
16907
16908        ret_val = xmlPatternMaxDepth(comp);
16909        desret_int(ret_val);
16910        call_tests++;
16911        des_xmlPatternPtr(n_comp, comp, 0);
16912        xmlResetLastError();
16913        if (mem_base != xmlMemBlocks()) {
16914            printf("Leak of %d blocks found in xmlPatternMaxDepth",
16915	           xmlMemBlocks() - mem_base);
16916	    test_ret++;
16917            printf(" %d", n_comp);
16918            printf("\n");
16919        }
16920    }
16921    function_tests++;
16922#endif
16923
16924    return(test_ret);
16925}
16926
16927
16928static int
16929test_xmlPatternMinDepth(void) {
16930    int test_ret = 0;
16931
16932#if defined(LIBXML_PATTERN_ENABLED)
16933    int mem_base;
16934    int ret_val;
16935    xmlPatternPtr comp; /* the precompiled pattern */
16936    int n_comp;
16937
16938    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16939        mem_base = xmlMemBlocks();
16940        comp = gen_xmlPatternPtr(n_comp, 0);
16941
16942        ret_val = xmlPatternMinDepth(comp);
16943        desret_int(ret_val);
16944        call_tests++;
16945        des_xmlPatternPtr(n_comp, comp, 0);
16946        xmlResetLastError();
16947        if (mem_base != xmlMemBlocks()) {
16948            printf("Leak of %d blocks found in xmlPatternMinDepth",
16949	           xmlMemBlocks() - mem_base);
16950	    test_ret++;
16951            printf(" %d", n_comp);
16952            printf("\n");
16953        }
16954    }
16955    function_tests++;
16956#endif
16957
16958    return(test_ret);
16959}
16960
16961
16962static int
16963test_xmlPatternStreamable(void) {
16964    int test_ret = 0;
16965
16966#if defined(LIBXML_PATTERN_ENABLED)
16967    int mem_base;
16968    int ret_val;
16969    xmlPatternPtr comp; /* the precompiled pattern */
16970    int n_comp;
16971
16972    for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) {
16973        mem_base = xmlMemBlocks();
16974        comp = gen_xmlPatternPtr(n_comp, 0);
16975
16976        ret_val = xmlPatternStreamable(comp);
16977        desret_int(ret_val);
16978        call_tests++;
16979        des_xmlPatternPtr(n_comp, comp, 0);
16980        xmlResetLastError();
16981        if (mem_base != xmlMemBlocks()) {
16982            printf("Leak of %d blocks found in xmlPatternStreamable",
16983	           xmlMemBlocks() - mem_base);
16984	    test_ret++;
16985            printf(" %d", n_comp);
16986            printf("\n");
16987        }
16988    }
16989    function_tests++;
16990#endif
16991
16992    return(test_ret);
16993}
16994
16995
16996static int
16997test_xmlPatterncompile(void) {
16998    int test_ret = 0;
16999
17000
17001    /* missing type support */
17002    return(test_ret);
17003}
17004
17005#ifdef LIBXML_PATTERN_ENABLED
17006
17007#define gen_nb_xmlStreamCtxtPtr 1
17008static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17009    return(NULL);
17010}
17011static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17012}
17013#endif
17014
17015
17016static int
17017test_xmlStreamPop(void) {
17018    int test_ret = 0;
17019
17020#if defined(LIBXML_PATTERN_ENABLED)
17021    int mem_base;
17022    int ret_val;
17023    xmlStreamCtxtPtr stream; /* the stream context */
17024    int n_stream;
17025
17026    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17027        mem_base = xmlMemBlocks();
17028        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17029
17030        ret_val = xmlStreamPop(stream);
17031        desret_int(ret_val);
17032        call_tests++;
17033        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17034        xmlResetLastError();
17035        if (mem_base != xmlMemBlocks()) {
17036            printf("Leak of %d blocks found in xmlStreamPop",
17037	           xmlMemBlocks() - mem_base);
17038	    test_ret++;
17039            printf(" %d", n_stream);
17040            printf("\n");
17041        }
17042    }
17043    function_tests++;
17044#endif
17045
17046    return(test_ret);
17047}
17048
17049
17050static int
17051test_xmlStreamPush(void) {
17052    int test_ret = 0;
17053
17054#if defined(LIBXML_PATTERN_ENABLED)
17055    int mem_base;
17056    int ret_val;
17057    xmlStreamCtxtPtr stream; /* the stream context */
17058    int n_stream;
17059    xmlChar * name; /* the current name */
17060    int n_name;
17061    xmlChar * ns; /* the namespace name */
17062    int n_ns;
17063
17064    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17065    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17066    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17067        mem_base = xmlMemBlocks();
17068        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17069        name = gen_const_xmlChar_ptr(n_name, 1);
17070        ns = gen_const_xmlChar_ptr(n_ns, 2);
17071
17072        ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns);
17073        desret_int(ret_val);
17074        call_tests++;
17075        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17076        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17077        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17078        xmlResetLastError();
17079        if (mem_base != xmlMemBlocks()) {
17080            printf("Leak of %d blocks found in xmlStreamPush",
17081	           xmlMemBlocks() - mem_base);
17082	    test_ret++;
17083            printf(" %d", n_stream);
17084            printf(" %d", n_name);
17085            printf(" %d", n_ns);
17086            printf("\n");
17087        }
17088    }
17089    }
17090    }
17091    function_tests++;
17092#endif
17093
17094    return(test_ret);
17095}
17096
17097
17098static int
17099test_xmlStreamPushAttr(void) {
17100    int test_ret = 0;
17101
17102#if defined(LIBXML_PATTERN_ENABLED)
17103    int mem_base;
17104    int ret_val;
17105    xmlStreamCtxtPtr stream; /* the stream context */
17106    int n_stream;
17107    xmlChar * name; /* the current name */
17108    int n_name;
17109    xmlChar * ns; /* the namespace name */
17110    int n_ns;
17111
17112    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17113    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17114    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17115        mem_base = xmlMemBlocks();
17116        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17117        name = gen_const_xmlChar_ptr(n_name, 1);
17118        ns = gen_const_xmlChar_ptr(n_ns, 2);
17119
17120        ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns);
17121        desret_int(ret_val);
17122        call_tests++;
17123        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17124        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17125        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17126        xmlResetLastError();
17127        if (mem_base != xmlMemBlocks()) {
17128            printf("Leak of %d blocks found in xmlStreamPushAttr",
17129	           xmlMemBlocks() - mem_base);
17130	    test_ret++;
17131            printf(" %d", n_stream);
17132            printf(" %d", n_name);
17133            printf(" %d", n_ns);
17134            printf("\n");
17135        }
17136    }
17137    }
17138    }
17139    function_tests++;
17140#endif
17141
17142    return(test_ret);
17143}
17144
17145
17146static int
17147test_xmlStreamPushNode(void) {
17148    int test_ret = 0;
17149
17150#if defined(LIBXML_PATTERN_ENABLED)
17151    int mem_base;
17152    int ret_val;
17153    xmlStreamCtxtPtr stream; /* the stream context */
17154    int n_stream;
17155    xmlChar * name; /* the current name */
17156    int n_name;
17157    xmlChar * ns; /* the namespace name */
17158    int n_ns;
17159    int nodeType; /* the type of the node being pushed */
17160    int n_nodeType;
17161
17162    for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) {
17163    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
17164    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
17165    for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) {
17166        mem_base = xmlMemBlocks();
17167        stream = gen_xmlStreamCtxtPtr(n_stream, 0);
17168        name = gen_const_xmlChar_ptr(n_name, 1);
17169        ns = gen_const_xmlChar_ptr(n_ns, 2);
17170        nodeType = gen_int(n_nodeType, 3);
17171
17172        ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType);
17173        desret_int(ret_val);
17174        call_tests++;
17175        des_xmlStreamCtxtPtr(n_stream, stream, 0);
17176        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
17177        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2);
17178        des_int(n_nodeType, nodeType, 3);
17179        xmlResetLastError();
17180        if (mem_base != xmlMemBlocks()) {
17181            printf("Leak of %d blocks found in xmlStreamPushNode",
17182	           xmlMemBlocks() - mem_base);
17183	    test_ret++;
17184            printf(" %d", n_stream);
17185            printf(" %d", n_name);
17186            printf(" %d", n_ns);
17187            printf(" %d", n_nodeType);
17188            printf("\n");
17189        }
17190    }
17191    }
17192    }
17193    }
17194    function_tests++;
17195#endif
17196
17197    return(test_ret);
17198}
17199
17200
17201static int
17202test_xmlStreamWantsAnyNode(void) {
17203    int test_ret = 0;
17204
17205#if defined(LIBXML_PATTERN_ENABLED)
17206    int mem_base;
17207    int ret_val;
17208    xmlStreamCtxtPtr streamCtxt; /* the stream context */
17209    int n_streamCtxt;
17210
17211    for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) {
17212        mem_base = xmlMemBlocks();
17213        streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0);
17214
17215        ret_val = xmlStreamWantsAnyNode(streamCtxt);
17216        desret_int(ret_val);
17217        call_tests++;
17218        des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0);
17219        xmlResetLastError();
17220        if (mem_base != xmlMemBlocks()) {
17221            printf("Leak of %d blocks found in xmlStreamWantsAnyNode",
17222	           xmlMemBlocks() - mem_base);
17223	    test_ret++;
17224            printf(" %d", n_streamCtxt);
17225            printf("\n");
17226        }
17227    }
17228    function_tests++;
17229#endif
17230
17231    return(test_ret);
17232}
17233
17234static int
17235test_pattern(void) {
17236    int test_ret = 0;
17237
17238    if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n");
17239    test_ret += test_xmlPatternFromRoot();
17240    test_ret += test_xmlPatternGetStreamCtxt();
17241    test_ret += test_xmlPatternMatch();
17242    test_ret += test_xmlPatternMaxDepth();
17243    test_ret += test_xmlPatternMinDepth();
17244    test_ret += test_xmlPatternStreamable();
17245    test_ret += test_xmlPatterncompile();
17246    test_ret += test_xmlStreamPop();
17247    test_ret += test_xmlStreamPush();
17248    test_ret += test_xmlStreamPushAttr();
17249    test_ret += test_xmlStreamPushNode();
17250    test_ret += test_xmlStreamWantsAnyNode();
17251
17252    if (test_ret != 0)
17253	printf("Module pattern: %d errors\n", test_ret);
17254    return(test_ret);
17255}
17256#ifdef LIBXML_SCHEMAS_ENABLED
17257
17258#define gen_nb_xmlRelaxNGPtr 1
17259static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17260    return(NULL);
17261}
17262static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17263}
17264#endif
17265
17266
17267static int
17268test_xmlRelaxNGDump(void) {
17269    int test_ret = 0;
17270
17271#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17272    int mem_base;
17273    FILE * output; /* the file output */
17274    int n_output;
17275    xmlRelaxNGPtr schema; /* a schema structure */
17276    int n_schema;
17277
17278    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17279    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17280        mem_base = xmlMemBlocks();
17281        output = gen_FILE_ptr(n_output, 0);
17282        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17283
17284        xmlRelaxNGDump(output, schema);
17285        call_tests++;
17286        des_FILE_ptr(n_output, output, 0);
17287        des_xmlRelaxNGPtr(n_schema, schema, 1);
17288        xmlResetLastError();
17289        if (mem_base != xmlMemBlocks()) {
17290            printf("Leak of %d blocks found in xmlRelaxNGDump",
17291	           xmlMemBlocks() - mem_base);
17292	    test_ret++;
17293            printf(" %d", n_output);
17294            printf(" %d", n_schema);
17295            printf("\n");
17296        }
17297    }
17298    }
17299    function_tests++;
17300#endif
17301
17302    return(test_ret);
17303}
17304
17305
17306static int
17307test_xmlRelaxNGDumpTree(void) {
17308    int test_ret = 0;
17309
17310#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
17311    int mem_base;
17312    FILE * output; /* the file output */
17313    int n_output;
17314    xmlRelaxNGPtr schema; /* a schema structure */
17315    int n_schema;
17316
17317    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
17318    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
17319        mem_base = xmlMemBlocks();
17320        output = gen_FILE_ptr(n_output, 0);
17321        schema = gen_xmlRelaxNGPtr(n_schema, 1);
17322
17323        xmlRelaxNGDumpTree(output, schema);
17324        call_tests++;
17325        des_FILE_ptr(n_output, output, 0);
17326        des_xmlRelaxNGPtr(n_schema, schema, 1);
17327        xmlResetLastError();
17328        if (mem_base != xmlMemBlocks()) {
17329            printf("Leak of %d blocks found in xmlRelaxNGDumpTree",
17330	           xmlMemBlocks() - mem_base);
17331	    test_ret++;
17332            printf(" %d", n_output);
17333            printf(" %d", n_schema);
17334            printf("\n");
17335        }
17336    }
17337    }
17338    function_tests++;
17339#endif
17340
17341    return(test_ret);
17342}
17343
17344#ifdef LIBXML_SCHEMAS_ENABLED
17345
17346#define gen_nb_xmlRelaxNGParserCtxtPtr 1
17347static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17348    return(NULL);
17349}
17350static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17351}
17352#endif
17353
17354#ifdef LIBXML_SCHEMAS_ENABLED
17355
17356#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1
17357static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17358    return(NULL);
17359}
17360static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17361}
17362#endif
17363
17364#ifdef LIBXML_SCHEMAS_ENABLED
17365
17366#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1
17367static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17368    return(NULL);
17369}
17370static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17371}
17372#endif
17373
17374#ifdef LIBXML_SCHEMAS_ENABLED
17375
17376#define gen_nb_void_ptr_ptr 1
17377static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17378    return(NULL);
17379}
17380static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17381}
17382#endif
17383
17384
17385static int
17386test_xmlRelaxNGGetParserErrors(void) {
17387    int test_ret = 0;
17388
17389#if defined(LIBXML_SCHEMAS_ENABLED)
17390    int mem_base;
17391    int ret_val;
17392    xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */
17393    int n_ctxt;
17394    xmlRelaxNGValidityErrorFunc * err; /* the error callback result */
17395    int n_err;
17396    xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */
17397    int n_warn;
17398    void ** ctx; /* contextual data for the callbacks result */
17399    int n_ctx;
17400
17401    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17402    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17403    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17404    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17405        mem_base = xmlMemBlocks();
17406        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17407        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17408        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17409        ctx = gen_void_ptr_ptr(n_ctx, 3);
17410
17411        ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx);
17412        desret_int(ret_val);
17413        call_tests++;
17414        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17415        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17416        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17417        des_void_ptr_ptr(n_ctx, ctx, 3);
17418        xmlResetLastError();
17419        if (mem_base != xmlMemBlocks()) {
17420            printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors",
17421	           xmlMemBlocks() - mem_base);
17422	    test_ret++;
17423            printf(" %d", n_ctxt);
17424            printf(" %d", n_err);
17425            printf(" %d", n_warn);
17426            printf(" %d", n_ctx);
17427            printf("\n");
17428        }
17429    }
17430    }
17431    }
17432    }
17433    function_tests++;
17434#endif
17435
17436    return(test_ret);
17437}
17438
17439#ifdef LIBXML_SCHEMAS_ENABLED
17440
17441#define gen_nb_xmlRelaxNGValidCtxtPtr 1
17442static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17443    return(NULL);
17444}
17445static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
17446}
17447#endif
17448
17449
17450static int
17451test_xmlRelaxNGGetValidErrors(void) {
17452    int test_ret = 0;
17453
17454#if defined(LIBXML_SCHEMAS_ENABLED)
17455    int mem_base;
17456    int ret_val;
17457    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17458    int n_ctxt;
17459    xmlRelaxNGValidityErrorFunc * err; /* the error function result */
17460    int n_err;
17461    xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */
17462    int n_warn;
17463    void ** ctx; /* the functions context result */
17464    int n_ctx;
17465
17466    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17467    for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) {
17468    for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) {
17469    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
17470        mem_base = xmlMemBlocks();
17471        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17472        err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1);
17473        warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2);
17474        ctx = gen_void_ptr_ptr(n_ctx, 3);
17475
17476        ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx);
17477        desret_int(ret_val);
17478        call_tests++;
17479        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17480        des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1);
17481        des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2);
17482        des_void_ptr_ptr(n_ctx, ctx, 3);
17483        xmlResetLastError();
17484        if (mem_base != xmlMemBlocks()) {
17485            printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors",
17486	           xmlMemBlocks() - mem_base);
17487	    test_ret++;
17488            printf(" %d", n_ctxt);
17489            printf(" %d", n_err);
17490            printf(" %d", n_warn);
17491            printf(" %d", n_ctx);
17492            printf("\n");
17493        }
17494    }
17495    }
17496    }
17497    }
17498    function_tests++;
17499#endif
17500
17501    return(test_ret);
17502}
17503
17504
17505static int
17506test_xmlRelaxNGInitTypes(void) {
17507    int test_ret = 0;
17508
17509#if defined(LIBXML_SCHEMAS_ENABLED)
17510    int mem_base;
17511    int ret_val;
17512
17513        mem_base = xmlMemBlocks();
17514
17515        ret_val = xmlRelaxNGInitTypes();
17516        desret_int(ret_val);
17517        call_tests++;
17518        xmlResetLastError();
17519        if (mem_base != xmlMemBlocks()) {
17520            printf("Leak of %d blocks found in xmlRelaxNGInitTypes",
17521	           xmlMemBlocks() - mem_base);
17522	    test_ret++;
17523            printf("\n");
17524        }
17525    function_tests++;
17526#endif
17527
17528    return(test_ret);
17529}
17530
17531
17532static int
17533test_xmlRelaxNGNewDocParserCtxt(void) {
17534    int test_ret = 0;
17535
17536#if defined(LIBXML_SCHEMAS_ENABLED)
17537    int mem_base;
17538    xmlRelaxNGParserCtxtPtr ret_val;
17539    xmlDocPtr doc; /* a preparsed document tree */
17540    int n_doc;
17541
17542    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17543        mem_base = xmlMemBlocks();
17544        doc = gen_xmlDocPtr(n_doc, 0);
17545
17546        ret_val = xmlRelaxNGNewDocParserCtxt(doc);
17547        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17548        call_tests++;
17549        des_xmlDocPtr(n_doc, doc, 0);
17550        xmlResetLastError();
17551        if (mem_base != xmlMemBlocks()) {
17552            printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt",
17553	           xmlMemBlocks() - mem_base);
17554	    test_ret++;
17555            printf(" %d", n_doc);
17556            printf("\n");
17557        }
17558    }
17559    function_tests++;
17560#endif
17561
17562    return(test_ret);
17563}
17564
17565
17566static int
17567test_xmlRelaxNGNewMemParserCtxt(void) {
17568    int test_ret = 0;
17569
17570#if defined(LIBXML_SCHEMAS_ENABLED)
17571    int mem_base;
17572    xmlRelaxNGParserCtxtPtr ret_val;
17573    char * buffer; /* a pointer to a char array containing the schemas */
17574    int n_buffer;
17575    int size; /* the size of the array */
17576    int n_size;
17577
17578    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
17579    for (n_size = 0;n_size < gen_nb_int;n_size++) {
17580        mem_base = xmlMemBlocks();
17581        buffer = gen_const_char_ptr(n_buffer, 0);
17582        size = gen_int(n_size, 1);
17583
17584        ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size);
17585        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17586        call_tests++;
17587        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
17588        des_int(n_size, size, 1);
17589        xmlResetLastError();
17590        if (mem_base != xmlMemBlocks()) {
17591            printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt",
17592	           xmlMemBlocks() - mem_base);
17593	    test_ret++;
17594            printf(" %d", n_buffer);
17595            printf(" %d", n_size);
17596            printf("\n");
17597        }
17598    }
17599    }
17600    function_tests++;
17601#endif
17602
17603    return(test_ret);
17604}
17605
17606
17607static int
17608test_xmlRelaxNGNewParserCtxt(void) {
17609    int test_ret = 0;
17610
17611#if defined(LIBXML_SCHEMAS_ENABLED)
17612    int mem_base;
17613    xmlRelaxNGParserCtxtPtr ret_val;
17614    char * URL; /* the location of the schema */
17615    int n_URL;
17616
17617    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
17618        mem_base = xmlMemBlocks();
17619        URL = gen_const_char_ptr(n_URL, 0);
17620
17621        ret_val = xmlRelaxNGNewParserCtxt((const char *)URL);
17622        desret_xmlRelaxNGParserCtxtPtr(ret_val);
17623        call_tests++;
17624        des_const_char_ptr(n_URL, (const char *)URL, 0);
17625        xmlResetLastError();
17626        if (mem_base != xmlMemBlocks()) {
17627            printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt",
17628	           xmlMemBlocks() - mem_base);
17629	    test_ret++;
17630            printf(" %d", n_URL);
17631            printf("\n");
17632        }
17633    }
17634    function_tests++;
17635#endif
17636
17637    return(test_ret);
17638}
17639
17640
17641static int
17642test_xmlRelaxNGNewValidCtxt(void) {
17643    int test_ret = 0;
17644
17645
17646    /* missing type support */
17647    return(test_ret);
17648}
17649
17650
17651static int
17652test_xmlRelaxNGParse(void) {
17653    int test_ret = 0;
17654
17655
17656    /* missing type support */
17657    return(test_ret);
17658}
17659
17660
17661static int
17662test_xmlRelaxNGSetParserErrors(void) {
17663    int test_ret = 0;
17664
17665
17666    /* missing type support */
17667    return(test_ret);
17668}
17669
17670
17671static int
17672test_xmlRelaxNGSetParserStructuredErrors(void) {
17673    int test_ret = 0;
17674
17675
17676    /* missing type support */
17677    return(test_ret);
17678}
17679
17680
17681static int
17682test_xmlRelaxNGSetValidErrors(void) {
17683    int test_ret = 0;
17684
17685
17686    /* missing type support */
17687    return(test_ret);
17688}
17689
17690
17691static int
17692test_xmlRelaxNGSetValidStructuredErrors(void) {
17693    int test_ret = 0;
17694
17695
17696    /* missing type support */
17697    return(test_ret);
17698}
17699
17700
17701static int
17702test_xmlRelaxNGValidateDoc(void) {
17703    int test_ret = 0;
17704
17705#if defined(LIBXML_SCHEMAS_ENABLED)
17706    int mem_base;
17707    int ret_val;
17708    xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */
17709    int n_ctxt;
17710    xmlDocPtr doc; /* a parsed document tree */
17711    int n_doc;
17712
17713    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17714    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17715        mem_base = xmlMemBlocks();
17716        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17717        doc = gen_xmlDocPtr(n_doc, 1);
17718
17719        ret_val = xmlRelaxNGValidateDoc(ctxt, doc);
17720        desret_int(ret_val);
17721        call_tests++;
17722        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17723        des_xmlDocPtr(n_doc, doc, 1);
17724        xmlResetLastError();
17725        if (mem_base != xmlMemBlocks()) {
17726            printf("Leak of %d blocks found in xmlRelaxNGValidateDoc",
17727	           xmlMemBlocks() - mem_base);
17728	    test_ret++;
17729            printf(" %d", n_ctxt);
17730            printf(" %d", n_doc);
17731            printf("\n");
17732        }
17733    }
17734    }
17735    function_tests++;
17736#endif
17737
17738    return(test_ret);
17739}
17740
17741
17742static int
17743test_xmlRelaxNGValidateFullElement(void) {
17744    int test_ret = 0;
17745
17746#if defined(LIBXML_SCHEMAS_ENABLED)
17747    int mem_base;
17748    int ret_val;
17749    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17750    int n_ctxt;
17751    xmlDocPtr doc; /* a document instance */
17752    int n_doc;
17753    xmlNodePtr elem; /* an element instance */
17754    int n_elem;
17755
17756    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17757    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17758    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17759        mem_base = xmlMemBlocks();
17760        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17761        doc = gen_xmlDocPtr(n_doc, 1);
17762        elem = gen_xmlNodePtr(n_elem, 2);
17763
17764        ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem);
17765        desret_int(ret_val);
17766        call_tests++;
17767        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17768        des_xmlDocPtr(n_doc, doc, 1);
17769        des_xmlNodePtr(n_elem, elem, 2);
17770        xmlResetLastError();
17771        if (mem_base != xmlMemBlocks()) {
17772            printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement",
17773	           xmlMemBlocks() - mem_base);
17774	    test_ret++;
17775            printf(" %d", n_ctxt);
17776            printf(" %d", n_doc);
17777            printf(" %d", n_elem);
17778            printf("\n");
17779        }
17780    }
17781    }
17782    }
17783    function_tests++;
17784#endif
17785
17786    return(test_ret);
17787}
17788
17789
17790static int
17791test_xmlRelaxNGValidatePopElement(void) {
17792    int test_ret = 0;
17793
17794#if defined(LIBXML_SCHEMAS_ENABLED)
17795    int mem_base;
17796    int ret_val;
17797    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17798    int n_ctxt;
17799    xmlDocPtr doc; /* a document instance */
17800    int n_doc;
17801    xmlNodePtr elem; /* an element instance */
17802    int n_elem;
17803
17804    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17805    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17806    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17807        mem_base = xmlMemBlocks();
17808        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17809        doc = gen_xmlDocPtr(n_doc, 1);
17810        elem = gen_xmlNodePtr(n_elem, 2);
17811
17812        ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem);
17813        desret_int(ret_val);
17814        call_tests++;
17815        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17816        des_xmlDocPtr(n_doc, doc, 1);
17817        des_xmlNodePtr(n_elem, elem, 2);
17818        xmlResetLastError();
17819        if (mem_base != xmlMemBlocks()) {
17820            printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement",
17821	           xmlMemBlocks() - mem_base);
17822	    test_ret++;
17823            printf(" %d", n_ctxt);
17824            printf(" %d", n_doc);
17825            printf(" %d", n_elem);
17826            printf("\n");
17827        }
17828    }
17829    }
17830    }
17831    function_tests++;
17832#endif
17833
17834    return(test_ret);
17835}
17836
17837
17838static int
17839test_xmlRelaxNGValidatePushCData(void) {
17840    int test_ret = 0;
17841
17842#if defined(LIBXML_SCHEMAS_ENABLED)
17843    int mem_base;
17844    int ret_val;
17845    xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */
17846    int n_ctxt;
17847    xmlChar * data; /* some character data read */
17848    int n_data;
17849    int len; /* the lenght of the data */
17850    int n_len;
17851
17852    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17853    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
17854    for (n_len = 0;n_len < gen_nb_int;n_len++) {
17855        mem_base = xmlMemBlocks();
17856        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17857        data = gen_const_xmlChar_ptr(n_data, 1);
17858        len = gen_int(n_len, 2);
17859
17860        ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len);
17861        desret_int(ret_val);
17862        call_tests++;
17863        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17864        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
17865        des_int(n_len, len, 2);
17866        xmlResetLastError();
17867        if (mem_base != xmlMemBlocks()) {
17868            printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData",
17869	           xmlMemBlocks() - mem_base);
17870	    test_ret++;
17871            printf(" %d", n_ctxt);
17872            printf(" %d", n_data);
17873            printf(" %d", n_len);
17874            printf("\n");
17875        }
17876    }
17877    }
17878    }
17879    function_tests++;
17880#endif
17881
17882    return(test_ret);
17883}
17884
17885
17886static int
17887test_xmlRelaxNGValidatePushElement(void) {
17888    int test_ret = 0;
17889
17890#if defined(LIBXML_SCHEMAS_ENABLED)
17891    int mem_base;
17892    int ret_val;
17893    xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */
17894    int n_ctxt;
17895    xmlDocPtr doc; /* a document instance */
17896    int n_doc;
17897    xmlNodePtr elem; /* an element instance */
17898    int n_elem;
17899
17900    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) {
17901    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
17902    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
17903        mem_base = xmlMemBlocks();
17904        ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0);
17905        doc = gen_xmlDocPtr(n_doc, 1);
17906        elem = gen_xmlNodePtr(n_elem, 2);
17907
17908        ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem);
17909        desret_int(ret_val);
17910        call_tests++;
17911        des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0);
17912        des_xmlDocPtr(n_doc, doc, 1);
17913        des_xmlNodePtr(n_elem, elem, 2);
17914        xmlResetLastError();
17915        if (mem_base != xmlMemBlocks()) {
17916            printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement",
17917	           xmlMemBlocks() - mem_base);
17918	    test_ret++;
17919            printf(" %d", n_ctxt);
17920            printf(" %d", n_doc);
17921            printf(" %d", n_elem);
17922            printf("\n");
17923        }
17924    }
17925    }
17926    }
17927    function_tests++;
17928#endif
17929
17930    return(test_ret);
17931}
17932
17933
17934static int
17935test_xmlRelaxParserSetFlag(void) {
17936    int test_ret = 0;
17937
17938#if defined(LIBXML_SCHEMAS_ENABLED)
17939    int mem_base;
17940    int ret_val;
17941    xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */
17942    int n_ctxt;
17943    int flags; /* a set of flags values */
17944    int n_flags;
17945
17946    for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) {
17947    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
17948        mem_base = xmlMemBlocks();
17949        ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0);
17950        flags = gen_int(n_flags, 1);
17951
17952        ret_val = xmlRelaxParserSetFlag(ctxt, flags);
17953        desret_int(ret_val);
17954        call_tests++;
17955        des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0);
17956        des_int(n_flags, flags, 1);
17957        xmlResetLastError();
17958        if (mem_base != xmlMemBlocks()) {
17959            printf("Leak of %d blocks found in xmlRelaxParserSetFlag",
17960	           xmlMemBlocks() - mem_base);
17961	    test_ret++;
17962            printf(" %d", n_ctxt);
17963            printf(" %d", n_flags);
17964            printf("\n");
17965        }
17966    }
17967    }
17968    function_tests++;
17969#endif
17970
17971    return(test_ret);
17972}
17973
17974static int
17975test_relaxng(void) {
17976    int test_ret = 0;
17977
17978    if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n");
17979    test_ret += test_xmlRelaxNGDump();
17980    test_ret += test_xmlRelaxNGDumpTree();
17981    test_ret += test_xmlRelaxNGGetParserErrors();
17982    test_ret += test_xmlRelaxNGGetValidErrors();
17983    test_ret += test_xmlRelaxNGInitTypes();
17984    test_ret += test_xmlRelaxNGNewDocParserCtxt();
17985    test_ret += test_xmlRelaxNGNewMemParserCtxt();
17986    test_ret += test_xmlRelaxNGNewParserCtxt();
17987    test_ret += test_xmlRelaxNGNewValidCtxt();
17988    test_ret += test_xmlRelaxNGParse();
17989    test_ret += test_xmlRelaxNGSetParserErrors();
17990    test_ret += test_xmlRelaxNGSetParserStructuredErrors();
17991    test_ret += test_xmlRelaxNGSetValidErrors();
17992    test_ret += test_xmlRelaxNGSetValidStructuredErrors();
17993    test_ret += test_xmlRelaxNGValidateDoc();
17994    test_ret += test_xmlRelaxNGValidateFullElement();
17995    test_ret += test_xmlRelaxNGValidatePopElement();
17996    test_ret += test_xmlRelaxNGValidatePushCData();
17997    test_ret += test_xmlRelaxNGValidatePushElement();
17998    test_ret += test_xmlRelaxParserSetFlag();
17999
18000    if (test_ret != 0)
18001	printf("Module relaxng: %d errors\n", test_ret);
18002    return(test_ret);
18003}
18004static int
18005test_schemasInternals(void) {
18006    int test_ret = 0;
18007
18008    if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n");
18009
18010    if (test_ret != 0)
18011	printf("Module schemasInternals: %d errors\n", test_ret);
18012    return(test_ret);
18013}
18014
18015static int
18016test_xmlSchematronNewDocParserCtxt(void) {
18017    int test_ret = 0;
18018
18019
18020    /* missing type support */
18021    return(test_ret);
18022}
18023
18024
18025static int
18026test_xmlSchematronNewMemParserCtxt(void) {
18027    int test_ret = 0;
18028
18029
18030    /* missing type support */
18031    return(test_ret);
18032}
18033
18034
18035static int
18036test_xmlSchematronNewParserCtxt(void) {
18037    int test_ret = 0;
18038
18039
18040    /* missing type support */
18041    return(test_ret);
18042}
18043
18044#ifdef LIBXML_SCHEMATRON_ENABLED
18045
18046#define gen_nb_xmlSchematronPtr 1
18047static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18048    return(NULL);
18049}
18050static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18051}
18052#endif
18053
18054
18055static int
18056test_xmlSchematronNewValidCtxt(void) {
18057    int test_ret = 0;
18058
18059
18060    /* missing type support */
18061    return(test_ret);
18062}
18063
18064#ifdef LIBXML_SCHEMATRON_ENABLED
18065
18066#define gen_nb_xmlSchematronParserCtxtPtr 1
18067static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18068    return(NULL);
18069}
18070static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18071}
18072#endif
18073
18074
18075static int
18076test_xmlSchematronParse(void) {
18077    int test_ret = 0;
18078
18079
18080    /* missing type support */
18081    return(test_ret);
18082}
18083
18084#ifdef LIBXML_SCHEMATRON_ENABLED
18085
18086#define gen_nb_xmlSchematronValidCtxtPtr 1
18087static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18088    return(NULL);
18089}
18090static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18091}
18092#endif
18093
18094
18095static int
18096test_xmlSchematronSetValidStructuredErrors(void) {
18097    int test_ret = 0;
18098
18099
18100    /* missing type support */
18101    return(test_ret);
18102}
18103
18104
18105static int
18106test_xmlSchematronValidateDoc(void) {
18107    int test_ret = 0;
18108
18109#if defined(LIBXML_SCHEMATRON_ENABLED)
18110    int mem_base;
18111    int ret_val;
18112    xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */
18113    int n_ctxt;
18114    xmlDocPtr instance; /* the document instace tree */
18115    int n_instance;
18116
18117    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) {
18118    for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
18119        mem_base = xmlMemBlocks();
18120        ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0);
18121        instance = gen_xmlDocPtr(n_instance, 1);
18122
18123        ret_val = xmlSchematronValidateDoc(ctxt, instance);
18124        desret_int(ret_val);
18125        call_tests++;
18126        des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0);
18127        des_xmlDocPtr(n_instance, instance, 1);
18128        xmlResetLastError();
18129        if (mem_base != xmlMemBlocks()) {
18130            printf("Leak of %d blocks found in xmlSchematronValidateDoc",
18131	           xmlMemBlocks() - mem_base);
18132	    test_ret++;
18133            printf(" %d", n_ctxt);
18134            printf(" %d", n_instance);
18135            printf("\n");
18136        }
18137    }
18138    }
18139    function_tests++;
18140#endif
18141
18142    return(test_ret);
18143}
18144
18145static int
18146test_schematron(void) {
18147    int test_ret = 0;
18148
18149    if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n");
18150    test_ret += test_xmlSchematronNewDocParserCtxt();
18151    test_ret += test_xmlSchematronNewMemParserCtxt();
18152    test_ret += test_xmlSchematronNewParserCtxt();
18153    test_ret += test_xmlSchematronNewValidCtxt();
18154    test_ret += test_xmlSchematronParse();
18155    test_ret += test_xmlSchematronSetValidStructuredErrors();
18156    test_ret += test_xmlSchematronValidateDoc();
18157
18158    if (test_ret != 0)
18159	printf("Module schematron: %d errors\n", test_ret);
18160    return(test_ret);
18161}
18162
18163static int
18164test_xmlAddChild(void) {
18165    int test_ret = 0;
18166
18167    int mem_base;
18168    xmlNodePtr ret_val;
18169    xmlNodePtr parent; /* the parent node */
18170    int n_parent;
18171    xmlNodePtr cur; /* the child node */
18172    int n_cur;
18173
18174    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18175    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18176        mem_base = xmlMemBlocks();
18177        parent = gen_xmlNodePtr(n_parent, 0);
18178        cur = gen_xmlNodePtr_in(n_cur, 1);
18179
18180        ret_val = xmlAddChild(parent, cur);
18181        if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }
18182        desret_xmlNodePtr(ret_val);
18183        call_tests++;
18184        des_xmlNodePtr(n_parent, parent, 0);
18185        des_xmlNodePtr_in(n_cur, cur, 1);
18186        xmlResetLastError();
18187        if (mem_base != xmlMemBlocks()) {
18188            printf("Leak of %d blocks found in xmlAddChild",
18189	           xmlMemBlocks() - mem_base);
18190	    test_ret++;
18191            printf(" %d", n_parent);
18192            printf(" %d", n_cur);
18193            printf("\n");
18194        }
18195    }
18196    }
18197    function_tests++;
18198
18199    return(test_ret);
18200}
18201
18202
18203static int
18204test_xmlAddChildList(void) {
18205    int test_ret = 0;
18206
18207    int mem_base;
18208    xmlNodePtr ret_val;
18209    xmlNodePtr parent; /* the parent node */
18210    int n_parent;
18211    xmlNodePtr cur; /* the first node in the list */
18212    int n_cur;
18213
18214    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
18215    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
18216        mem_base = xmlMemBlocks();
18217        parent = gen_xmlNodePtr(n_parent, 0);
18218        cur = gen_xmlNodePtr_in(n_cur, 1);
18219
18220        ret_val = xmlAddChildList(parent, cur);
18221        if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }
18222        desret_xmlNodePtr(ret_val);
18223        call_tests++;
18224        des_xmlNodePtr(n_parent, parent, 0);
18225        des_xmlNodePtr_in(n_cur, cur, 1);
18226        xmlResetLastError();
18227        if (mem_base != xmlMemBlocks()) {
18228            printf("Leak of %d blocks found in xmlAddChildList",
18229	           xmlMemBlocks() - mem_base);
18230	    test_ret++;
18231            printf(" %d", n_parent);
18232            printf(" %d", n_cur);
18233            printf("\n");
18234        }
18235    }
18236    }
18237    function_tests++;
18238
18239    return(test_ret);
18240}
18241
18242
18243static int
18244test_xmlAddNextSibling(void) {
18245    int test_ret = 0;
18246
18247    int mem_base;
18248    xmlNodePtr ret_val;
18249    xmlNodePtr cur; /* the child node */
18250    int n_cur;
18251    xmlNodePtr elem; /* the new node */
18252    int n_elem;
18253
18254    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18255    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18256        mem_base = xmlMemBlocks();
18257        cur = gen_xmlNodePtr(n_cur, 0);
18258        elem = gen_xmlNodePtr_in(n_elem, 1);
18259
18260        ret_val = xmlAddNextSibling(cur, elem);
18261        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18262        desret_xmlNodePtr(ret_val);
18263        call_tests++;
18264        des_xmlNodePtr(n_cur, cur, 0);
18265        des_xmlNodePtr_in(n_elem, elem, 1);
18266        xmlResetLastError();
18267        if (mem_base != xmlMemBlocks()) {
18268            printf("Leak of %d blocks found in xmlAddNextSibling",
18269	           xmlMemBlocks() - mem_base);
18270	    test_ret++;
18271            printf(" %d", n_cur);
18272            printf(" %d", n_elem);
18273            printf("\n");
18274        }
18275    }
18276    }
18277    function_tests++;
18278
18279    return(test_ret);
18280}
18281
18282
18283static int
18284test_xmlAddPrevSibling(void) {
18285    int test_ret = 0;
18286
18287#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
18288    int mem_base;
18289    xmlNodePtr ret_val;
18290    xmlNodePtr cur; /* the child node */
18291    int n_cur;
18292    xmlNodePtr elem; /* the new node */
18293    int n_elem;
18294
18295    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18296    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18297        mem_base = xmlMemBlocks();
18298        cur = gen_xmlNodePtr(n_cur, 0);
18299        elem = gen_xmlNodePtr_in(n_elem, 1);
18300
18301        ret_val = xmlAddPrevSibling(cur, elem);
18302        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18303        desret_xmlNodePtr(ret_val);
18304        call_tests++;
18305        des_xmlNodePtr(n_cur, cur, 0);
18306        des_xmlNodePtr_in(n_elem, elem, 1);
18307        xmlResetLastError();
18308        if (mem_base != xmlMemBlocks()) {
18309            printf("Leak of %d blocks found in xmlAddPrevSibling",
18310	           xmlMemBlocks() - mem_base);
18311	    test_ret++;
18312            printf(" %d", n_cur);
18313            printf(" %d", n_elem);
18314            printf("\n");
18315        }
18316    }
18317    }
18318    function_tests++;
18319#endif
18320
18321    return(test_ret);
18322}
18323
18324
18325static int
18326test_xmlAddSibling(void) {
18327    int test_ret = 0;
18328
18329    int mem_base;
18330    xmlNodePtr ret_val;
18331    xmlNodePtr cur; /* the child node */
18332    int n_cur;
18333    xmlNodePtr elem; /* the new node */
18334    int n_elem;
18335
18336    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
18337    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) {
18338        mem_base = xmlMemBlocks();
18339        cur = gen_xmlNodePtr(n_cur, 0);
18340        elem = gen_xmlNodePtr_in(n_elem, 1);
18341
18342        ret_val = xmlAddSibling(cur, elem);
18343        if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }
18344        desret_xmlNodePtr(ret_val);
18345        call_tests++;
18346        des_xmlNodePtr(n_cur, cur, 0);
18347        des_xmlNodePtr_in(n_elem, elem, 1);
18348        xmlResetLastError();
18349        if (mem_base != xmlMemBlocks()) {
18350            printf("Leak of %d blocks found in xmlAddSibling",
18351	           xmlMemBlocks() - mem_base);
18352	    test_ret++;
18353            printf(" %d", n_cur);
18354            printf(" %d", n_elem);
18355            printf("\n");
18356        }
18357    }
18358    }
18359    function_tests++;
18360
18361    return(test_ret);
18362}
18363
18364
18365static int
18366test_xmlAttrSerializeTxtContent(void) {
18367    int test_ret = 0;
18368
18369#if defined(LIBXML_OUTPUT_ENABLED)
18370#ifdef LIBXML_OUTPUT_ENABLED
18371    int mem_base;
18372    xmlBufferPtr buf; /* the XML buffer output */
18373    int n_buf;
18374    xmlDocPtr doc; /* the document */
18375    int n_doc;
18376    xmlAttrPtr attr; /* the attribute node */
18377    int n_attr;
18378    xmlChar * string; /* the text content */
18379    int n_string;
18380
18381    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18382    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
18383    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
18384    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18385        mem_base = xmlMemBlocks();
18386        buf = gen_xmlBufferPtr(n_buf, 0);
18387        doc = gen_xmlDocPtr(n_doc, 1);
18388        attr = gen_xmlAttrPtr(n_attr, 2);
18389        string = gen_const_xmlChar_ptr(n_string, 3);
18390
18391        xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string);
18392        call_tests++;
18393        des_xmlBufferPtr(n_buf, buf, 0);
18394        des_xmlDocPtr(n_doc, doc, 1);
18395        des_xmlAttrPtr(n_attr, attr, 2);
18396        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3);
18397        xmlResetLastError();
18398        if (mem_base != xmlMemBlocks()) {
18399            printf("Leak of %d blocks found in xmlAttrSerializeTxtContent",
18400	           xmlMemBlocks() - mem_base);
18401	    test_ret++;
18402            printf(" %d", n_buf);
18403            printf(" %d", n_doc);
18404            printf(" %d", n_attr);
18405            printf(" %d", n_string);
18406            printf("\n");
18407        }
18408    }
18409    }
18410    }
18411    }
18412    function_tests++;
18413#endif
18414#endif
18415
18416    return(test_ret);
18417}
18418
18419
18420static int
18421test_xmlBufferAdd(void) {
18422    int test_ret = 0;
18423
18424    int mem_base;
18425    int ret_val;
18426    xmlBufferPtr buf; /* the buffer to dump */
18427    int n_buf;
18428    xmlChar * str; /* the #xmlChar string */
18429    int n_str;
18430    int len; /* the number of #xmlChar to add */
18431    int n_len;
18432
18433    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18434    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18435    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18436        mem_base = xmlMemBlocks();
18437        buf = gen_xmlBufferPtr(n_buf, 0);
18438        str = gen_const_xmlChar_ptr(n_str, 1);
18439        len = gen_int(n_len, 2);
18440
18441        ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len);
18442        desret_int(ret_val);
18443        call_tests++;
18444        des_xmlBufferPtr(n_buf, buf, 0);
18445        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18446        des_int(n_len, len, 2);
18447        xmlResetLastError();
18448        if (mem_base != xmlMemBlocks()) {
18449            printf("Leak of %d blocks found in xmlBufferAdd",
18450	           xmlMemBlocks() - mem_base);
18451	    test_ret++;
18452            printf(" %d", n_buf);
18453            printf(" %d", n_str);
18454            printf(" %d", n_len);
18455            printf("\n");
18456        }
18457    }
18458    }
18459    }
18460    function_tests++;
18461
18462    return(test_ret);
18463}
18464
18465
18466static int
18467test_xmlBufferAddHead(void) {
18468    int test_ret = 0;
18469
18470    int mem_base;
18471    int ret_val;
18472    xmlBufferPtr buf; /* the buffer */
18473    int n_buf;
18474    xmlChar * str; /* the #xmlChar string */
18475    int n_str;
18476    int len; /* the number of #xmlChar to add */
18477    int n_len;
18478
18479    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18480    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18481    for (n_len = 0;n_len < gen_nb_int;n_len++) {
18482        mem_base = xmlMemBlocks();
18483        buf = gen_xmlBufferPtr(n_buf, 0);
18484        str = gen_const_xmlChar_ptr(n_str, 1);
18485        len = gen_int(n_len, 2);
18486
18487        ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len);
18488        desret_int(ret_val);
18489        call_tests++;
18490        des_xmlBufferPtr(n_buf, buf, 0);
18491        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18492        des_int(n_len, len, 2);
18493        xmlResetLastError();
18494        if (mem_base != xmlMemBlocks()) {
18495            printf("Leak of %d blocks found in xmlBufferAddHead",
18496	           xmlMemBlocks() - mem_base);
18497	    test_ret++;
18498            printf(" %d", n_buf);
18499            printf(" %d", n_str);
18500            printf(" %d", n_len);
18501            printf("\n");
18502        }
18503    }
18504    }
18505    }
18506    function_tests++;
18507
18508    return(test_ret);
18509}
18510
18511
18512static int
18513test_xmlBufferCCat(void) {
18514    int test_ret = 0;
18515
18516    int mem_base;
18517    int ret_val;
18518    xmlBufferPtr buf; /* the buffer to dump */
18519    int n_buf;
18520    char * str; /* the C char string */
18521    int n_str;
18522
18523    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18524    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
18525        mem_base = xmlMemBlocks();
18526        buf = gen_xmlBufferPtr(n_buf, 0);
18527        str = gen_const_char_ptr(n_str, 1);
18528
18529        ret_val = xmlBufferCCat(buf, (const char *)str);
18530        desret_int(ret_val);
18531        call_tests++;
18532        des_xmlBufferPtr(n_buf, buf, 0);
18533        des_const_char_ptr(n_str, (const char *)str, 1);
18534        xmlResetLastError();
18535        if (mem_base != xmlMemBlocks()) {
18536            printf("Leak of %d blocks found in xmlBufferCCat",
18537	           xmlMemBlocks() - mem_base);
18538	    test_ret++;
18539            printf(" %d", n_buf);
18540            printf(" %d", n_str);
18541            printf("\n");
18542        }
18543    }
18544    }
18545    function_tests++;
18546
18547    return(test_ret);
18548}
18549
18550
18551static int
18552test_xmlBufferCat(void) {
18553    int test_ret = 0;
18554
18555    int mem_base;
18556    int ret_val;
18557    xmlBufferPtr buf; /* the buffer to add to */
18558    int n_buf;
18559    xmlChar * str; /* the #xmlChar string */
18560    int n_str;
18561
18562    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18563    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
18564        mem_base = xmlMemBlocks();
18565        buf = gen_xmlBufferPtr(n_buf, 0);
18566        str = gen_const_xmlChar_ptr(n_str, 1);
18567
18568        ret_val = xmlBufferCat(buf, (const xmlChar *)str);
18569        desret_int(ret_val);
18570        call_tests++;
18571        des_xmlBufferPtr(n_buf, buf, 0);
18572        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
18573        xmlResetLastError();
18574        if (mem_base != xmlMemBlocks()) {
18575            printf("Leak of %d blocks found in xmlBufferCat",
18576	           xmlMemBlocks() - mem_base);
18577	    test_ret++;
18578            printf(" %d", n_buf);
18579            printf(" %d", n_str);
18580            printf("\n");
18581        }
18582    }
18583    }
18584    function_tests++;
18585
18586    return(test_ret);
18587}
18588
18589
18590#define gen_nb_const_xmlBufferPtr 1
18591static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18592    return(NULL);
18593}
18594static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
18595}
18596
18597static int
18598test_xmlBufferContent(void) {
18599    int test_ret = 0;
18600
18601    int mem_base;
18602    const xmlChar * ret_val;
18603    xmlBufferPtr buf; /* the buffer */
18604    int n_buf;
18605
18606    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18607        mem_base = xmlMemBlocks();
18608        buf = gen_const_xmlBufferPtr(n_buf, 0);
18609
18610        ret_val = xmlBufferContent((const xmlBufferPtr)buf);
18611        desret_const_xmlChar_ptr(ret_val);
18612        call_tests++;
18613        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18614        xmlResetLastError();
18615        if (mem_base != xmlMemBlocks()) {
18616            printf("Leak of %d blocks found in xmlBufferContent",
18617	           xmlMemBlocks() - mem_base);
18618	    test_ret++;
18619            printf(" %d", n_buf);
18620            printf("\n");
18621        }
18622    }
18623    function_tests++;
18624
18625    return(test_ret);
18626}
18627
18628
18629static int
18630test_xmlBufferCreate(void) {
18631    int test_ret = 0;
18632
18633    int mem_base;
18634    xmlBufferPtr ret_val;
18635
18636        mem_base = xmlMemBlocks();
18637
18638        ret_val = xmlBufferCreate();
18639        desret_xmlBufferPtr(ret_val);
18640        call_tests++;
18641        xmlResetLastError();
18642        if (mem_base != xmlMemBlocks()) {
18643            printf("Leak of %d blocks found in xmlBufferCreate",
18644	           xmlMemBlocks() - mem_base);
18645	    test_ret++;
18646            printf("\n");
18647        }
18648    function_tests++;
18649
18650    return(test_ret);
18651}
18652
18653
18654static int
18655test_xmlBufferCreateSize(void) {
18656    int test_ret = 0;
18657
18658
18659    /* missing type support */
18660    return(test_ret);
18661}
18662
18663
18664static int
18665test_xmlBufferCreateStatic(void) {
18666    int test_ret = 0;
18667
18668
18669    /* missing type support */
18670    return(test_ret);
18671}
18672
18673
18674static int
18675test_xmlBufferEmpty(void) {
18676    int test_ret = 0;
18677
18678    int mem_base;
18679    xmlBufferPtr buf; /* the buffer */
18680    int n_buf;
18681
18682    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18683        mem_base = xmlMemBlocks();
18684        buf = gen_xmlBufferPtr(n_buf, 0);
18685
18686        xmlBufferEmpty(buf);
18687        call_tests++;
18688        des_xmlBufferPtr(n_buf, buf, 0);
18689        xmlResetLastError();
18690        if (mem_base != xmlMemBlocks()) {
18691            printf("Leak of %d blocks found in xmlBufferEmpty",
18692	           xmlMemBlocks() - mem_base);
18693	    test_ret++;
18694            printf(" %d", n_buf);
18695            printf("\n");
18696        }
18697    }
18698    function_tests++;
18699
18700    return(test_ret);
18701}
18702
18703
18704static int
18705test_xmlBufferGrow(void) {
18706    int test_ret = 0;
18707
18708    int mem_base;
18709    int ret_val;
18710    xmlBufferPtr buf; /* the buffer */
18711    int n_buf;
18712    unsigned int len; /* the minimum free size to allocate */
18713    int n_len;
18714
18715    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18716    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18717        mem_base = xmlMemBlocks();
18718        buf = gen_xmlBufferPtr(n_buf, 0);
18719        len = gen_unsigned_int(n_len, 1);
18720
18721        ret_val = xmlBufferGrow(buf, len);
18722        desret_int(ret_val);
18723        call_tests++;
18724        des_xmlBufferPtr(n_buf, buf, 0);
18725        des_unsigned_int(n_len, len, 1);
18726        xmlResetLastError();
18727        if (mem_base != xmlMemBlocks()) {
18728            printf("Leak of %d blocks found in xmlBufferGrow",
18729	           xmlMemBlocks() - mem_base);
18730	    test_ret++;
18731            printf(" %d", n_buf);
18732            printf(" %d", n_len);
18733            printf("\n");
18734        }
18735    }
18736    }
18737    function_tests++;
18738
18739    return(test_ret);
18740}
18741
18742
18743static int
18744test_xmlBufferLength(void) {
18745    int test_ret = 0;
18746
18747    int mem_base;
18748    int ret_val;
18749    xmlBufferPtr buf; /* the buffer */
18750    int n_buf;
18751
18752    for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) {
18753        mem_base = xmlMemBlocks();
18754        buf = gen_const_xmlBufferPtr(n_buf, 0);
18755
18756        ret_val = xmlBufferLength((const xmlBufferPtr)buf);
18757        desret_int(ret_val);
18758        call_tests++;
18759        des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0);
18760        xmlResetLastError();
18761        if (mem_base != xmlMemBlocks()) {
18762            printf("Leak of %d blocks found in xmlBufferLength",
18763	           xmlMemBlocks() - mem_base);
18764	    test_ret++;
18765            printf(" %d", n_buf);
18766            printf("\n");
18767        }
18768    }
18769    function_tests++;
18770
18771    return(test_ret);
18772}
18773
18774
18775static int
18776test_xmlBufferResize(void) {
18777    int test_ret = 0;
18778
18779    int mem_base;
18780    int ret_val;
18781    xmlBufferPtr buf; /* the buffer to resize */
18782    int n_buf;
18783    unsigned int size; /* the desired size */
18784    int n_size;
18785
18786    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18787    for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) {
18788        mem_base = xmlMemBlocks();
18789        buf = gen_xmlBufferPtr(n_buf, 0);
18790        size = gen_unsigned_int(n_size, 1);
18791
18792        ret_val = xmlBufferResize(buf, size);
18793        desret_int(ret_val);
18794        call_tests++;
18795        des_xmlBufferPtr(n_buf, buf, 0);
18796        des_unsigned_int(n_size, size, 1);
18797        xmlResetLastError();
18798        if (mem_base != xmlMemBlocks()) {
18799            printf("Leak of %d blocks found in xmlBufferResize",
18800	           xmlMemBlocks() - mem_base);
18801	    test_ret++;
18802            printf(" %d", n_buf);
18803            printf(" %d", n_size);
18804            printf("\n");
18805        }
18806    }
18807    }
18808    function_tests++;
18809
18810    return(test_ret);
18811}
18812
18813
18814static int
18815test_xmlBufferSetAllocationScheme(void) {
18816    int test_ret = 0;
18817
18818    int mem_base;
18819    xmlBufferPtr buf; /* the buffer to tune */
18820    int n_buf;
18821    xmlBufferAllocationScheme scheme; /* allocation scheme to use */
18822    int n_scheme;
18823
18824    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18825    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
18826        mem_base = xmlMemBlocks();
18827        buf = gen_xmlBufferPtr(n_buf, 0);
18828        scheme = gen_xmlBufferAllocationScheme(n_scheme, 1);
18829
18830        xmlBufferSetAllocationScheme(buf, scheme);
18831        if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}
18832        call_tests++;
18833        des_xmlBufferPtr(n_buf, buf, 0);
18834        des_xmlBufferAllocationScheme(n_scheme, scheme, 1);
18835        xmlResetLastError();
18836        if (mem_base != xmlMemBlocks()) {
18837            printf("Leak of %d blocks found in xmlBufferSetAllocationScheme",
18838	           xmlMemBlocks() - mem_base);
18839	    test_ret++;
18840            printf(" %d", n_buf);
18841            printf(" %d", n_scheme);
18842            printf("\n");
18843        }
18844    }
18845    }
18846    function_tests++;
18847
18848    return(test_ret);
18849}
18850
18851
18852static int
18853test_xmlBufferShrink(void) {
18854    int test_ret = 0;
18855
18856    int mem_base;
18857    int ret_val;
18858    xmlBufferPtr buf; /* the buffer to dump */
18859    int n_buf;
18860    unsigned int len; /* the number of xmlChar to remove */
18861    int n_len;
18862
18863    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18864    for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) {
18865        mem_base = xmlMemBlocks();
18866        buf = gen_xmlBufferPtr(n_buf, 0);
18867        len = gen_unsigned_int(n_len, 1);
18868
18869        ret_val = xmlBufferShrink(buf, len);
18870        desret_int(ret_val);
18871        call_tests++;
18872        des_xmlBufferPtr(n_buf, buf, 0);
18873        des_unsigned_int(n_len, len, 1);
18874        xmlResetLastError();
18875        if (mem_base != xmlMemBlocks()) {
18876            printf("Leak of %d blocks found in xmlBufferShrink",
18877	           xmlMemBlocks() - mem_base);
18878	    test_ret++;
18879            printf(" %d", n_buf);
18880            printf(" %d", n_len);
18881            printf("\n");
18882        }
18883    }
18884    }
18885    function_tests++;
18886
18887    return(test_ret);
18888}
18889
18890
18891static int
18892test_xmlBufferWriteCHAR(void) {
18893    int test_ret = 0;
18894
18895    int mem_base;
18896    xmlBufferPtr buf; /* the XML buffer */
18897    int n_buf;
18898    xmlChar * string; /* the string to add */
18899    int n_string;
18900
18901    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18902    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18903        mem_base = xmlMemBlocks();
18904        buf = gen_xmlBufferPtr(n_buf, 0);
18905        string = gen_const_xmlChar_ptr(n_string, 1);
18906
18907        xmlBufferWriteCHAR(buf, (const xmlChar *)string);
18908        call_tests++;
18909        des_xmlBufferPtr(n_buf, buf, 0);
18910        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18911        xmlResetLastError();
18912        if (mem_base != xmlMemBlocks()) {
18913            printf("Leak of %d blocks found in xmlBufferWriteCHAR",
18914	           xmlMemBlocks() - mem_base);
18915	    test_ret++;
18916            printf(" %d", n_buf);
18917            printf(" %d", n_string);
18918            printf("\n");
18919        }
18920    }
18921    }
18922    function_tests++;
18923
18924    return(test_ret);
18925}
18926
18927
18928static int
18929test_xmlBufferWriteChar(void) {
18930    int test_ret = 0;
18931
18932    int mem_base;
18933    xmlBufferPtr buf; /* the XML buffer output */
18934    int n_buf;
18935    char * string; /* the string to add */
18936    int n_string;
18937
18938    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18939    for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) {
18940        mem_base = xmlMemBlocks();
18941        buf = gen_xmlBufferPtr(n_buf, 0);
18942        string = gen_const_char_ptr(n_string, 1);
18943
18944        xmlBufferWriteChar(buf, (const char *)string);
18945        call_tests++;
18946        des_xmlBufferPtr(n_buf, buf, 0);
18947        des_const_char_ptr(n_string, (const char *)string, 1);
18948        xmlResetLastError();
18949        if (mem_base != xmlMemBlocks()) {
18950            printf("Leak of %d blocks found in xmlBufferWriteChar",
18951	           xmlMemBlocks() - mem_base);
18952	    test_ret++;
18953            printf(" %d", n_buf);
18954            printf(" %d", n_string);
18955            printf("\n");
18956        }
18957    }
18958    }
18959    function_tests++;
18960
18961    return(test_ret);
18962}
18963
18964
18965static int
18966test_xmlBufferWriteQuotedString(void) {
18967    int test_ret = 0;
18968
18969    int mem_base;
18970    xmlBufferPtr buf; /* the XML buffer output */
18971    int n_buf;
18972    xmlChar * string; /* the string to add */
18973    int n_string;
18974
18975    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
18976    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) {
18977        mem_base = xmlMemBlocks();
18978        buf = gen_xmlBufferPtr(n_buf, 0);
18979        string = gen_const_xmlChar_ptr(n_string, 1);
18980
18981        xmlBufferWriteQuotedString(buf, (const xmlChar *)string);
18982        call_tests++;
18983        des_xmlBufferPtr(n_buf, buf, 0);
18984        des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1);
18985        xmlResetLastError();
18986        if (mem_base != xmlMemBlocks()) {
18987            printf("Leak of %d blocks found in xmlBufferWriteQuotedString",
18988	           xmlMemBlocks() - mem_base);
18989	    test_ret++;
18990            printf(" %d", n_buf);
18991            printf(" %d", n_string);
18992            printf("\n");
18993        }
18994    }
18995    }
18996    function_tests++;
18997
18998    return(test_ret);
18999}
19000
19001
19002static int
19003test_xmlBuildQName(void) {
19004    int test_ret = 0;
19005
19006    int mem_base;
19007    xmlChar * ret_val;
19008    xmlChar * ncname; /* the Name */
19009    int n_ncname;
19010    xmlChar * prefix; /* the prefix */
19011    int n_prefix;
19012    xmlChar * memory; /* preallocated memory */
19013    int n_memory;
19014    int len; /* preallocated memory length */
19015    int n_len;
19016
19017    for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) {
19018    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
19019    for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) {
19020    for (n_len = 0;n_len < gen_nb_int;n_len++) {
19021        mem_base = xmlMemBlocks();
19022        ncname = gen_const_xmlChar_ptr(n_ncname, 0);
19023        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
19024        memory = gen_xmlChar_ptr(n_memory, 2);
19025        len = gen_int(n_len, 3);
19026
19027        ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len);
19028        if ((ret_val != NULL) && (ret_val != ncname) &&
19029              (ret_val != prefix) && (ret_val != memory))
19030              xmlFree(ret_val);
19031	  ret_val = NULL;
19032        desret_xmlChar_ptr(ret_val);
19033        call_tests++;
19034        des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0);
19035        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
19036        des_xmlChar_ptr(n_memory, memory, 2);
19037        des_int(n_len, len, 3);
19038        xmlResetLastError();
19039        if (mem_base != xmlMemBlocks()) {
19040            printf("Leak of %d blocks found in xmlBuildQName",
19041	           xmlMemBlocks() - mem_base);
19042	    test_ret++;
19043            printf(" %d", n_ncname);
19044            printf(" %d", n_prefix);
19045            printf(" %d", n_memory);
19046            printf(" %d", n_len);
19047            printf("\n");
19048        }
19049    }
19050    }
19051    }
19052    }
19053    function_tests++;
19054
19055    return(test_ret);
19056}
19057
19058
19059static int
19060test_xmlCopyDoc(void) {
19061    int test_ret = 0;
19062
19063#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
19064    int mem_base;
19065    xmlDocPtr ret_val;
19066    xmlDocPtr doc; /* the document */
19067    int n_doc;
19068    int recursive; /* if not zero do a recursive copy. */
19069    int n_recursive;
19070
19071    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19072    for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) {
19073        mem_base = xmlMemBlocks();
19074        doc = gen_xmlDocPtr(n_doc, 0);
19075        recursive = gen_int(n_recursive, 1);
19076
19077        ret_val = xmlCopyDoc(doc, recursive);
19078        desret_xmlDocPtr(ret_val);
19079        call_tests++;
19080        des_xmlDocPtr(n_doc, doc, 0);
19081        des_int(n_recursive, recursive, 1);
19082        xmlResetLastError();
19083        if (mem_base != xmlMemBlocks()) {
19084            printf("Leak of %d blocks found in xmlCopyDoc",
19085	           xmlMemBlocks() - mem_base);
19086	    test_ret++;
19087            printf(" %d", n_doc);
19088            printf(" %d", n_recursive);
19089            printf("\n");
19090        }
19091    }
19092    }
19093    function_tests++;
19094#endif
19095
19096    return(test_ret);
19097}
19098
19099
19100static int
19101test_xmlCopyDtd(void) {
19102    int test_ret = 0;
19103
19104#if defined(LIBXML_TREE_ENABLED)
19105    int mem_base;
19106    xmlDtdPtr ret_val;
19107    xmlDtdPtr dtd; /* the dtd */
19108    int n_dtd;
19109
19110    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
19111        mem_base = xmlMemBlocks();
19112        dtd = gen_xmlDtdPtr(n_dtd, 0);
19113
19114        ret_val = xmlCopyDtd(dtd);
19115        desret_xmlDtdPtr(ret_val);
19116        call_tests++;
19117        des_xmlDtdPtr(n_dtd, dtd, 0);
19118        xmlResetLastError();
19119        if (mem_base != xmlMemBlocks()) {
19120            printf("Leak of %d blocks found in xmlCopyDtd",
19121	           xmlMemBlocks() - mem_base);
19122	    test_ret++;
19123            printf(" %d", n_dtd);
19124            printf("\n");
19125        }
19126    }
19127    function_tests++;
19128#endif
19129
19130    return(test_ret);
19131}
19132
19133
19134static int
19135test_xmlCopyNamespace(void) {
19136    int test_ret = 0;
19137
19138    int mem_base;
19139    xmlNsPtr ret_val;
19140    xmlNsPtr cur; /* the namespace */
19141    int n_cur;
19142
19143    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19144        mem_base = xmlMemBlocks();
19145        cur = gen_xmlNsPtr(n_cur, 0);
19146
19147        ret_val = xmlCopyNamespace(cur);
19148        if (ret_val != NULL) xmlFreeNs(ret_val);
19149        desret_xmlNsPtr(ret_val);
19150        call_tests++;
19151        des_xmlNsPtr(n_cur, cur, 0);
19152        xmlResetLastError();
19153        if (mem_base != xmlMemBlocks()) {
19154            printf("Leak of %d blocks found in xmlCopyNamespace",
19155	           xmlMemBlocks() - mem_base);
19156	    test_ret++;
19157            printf(" %d", n_cur);
19158            printf("\n");
19159        }
19160    }
19161    function_tests++;
19162
19163    return(test_ret);
19164}
19165
19166
19167static int
19168test_xmlCopyNamespaceList(void) {
19169    int test_ret = 0;
19170
19171    int mem_base;
19172    xmlNsPtr ret_val;
19173    xmlNsPtr cur; /* the first namespace */
19174    int n_cur;
19175
19176    for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) {
19177        mem_base = xmlMemBlocks();
19178        cur = gen_xmlNsPtr(n_cur, 0);
19179
19180        ret_val = xmlCopyNamespaceList(cur);
19181        if (ret_val != NULL) xmlFreeNsList(ret_val);
19182        desret_xmlNsPtr(ret_val);
19183        call_tests++;
19184        des_xmlNsPtr(n_cur, cur, 0);
19185        xmlResetLastError();
19186        if (mem_base != xmlMemBlocks()) {
19187            printf("Leak of %d blocks found in xmlCopyNamespaceList",
19188	           xmlMemBlocks() - mem_base);
19189	    test_ret++;
19190            printf(" %d", n_cur);
19191            printf("\n");
19192        }
19193    }
19194    function_tests++;
19195
19196    return(test_ret);
19197}
19198
19199
19200static int
19201test_xmlCopyNode(void) {
19202    int test_ret = 0;
19203
19204    int mem_base;
19205    xmlNodePtr ret_val;
19206    xmlNodePtr node; /* the node */
19207    int n_node;
19208    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19209    int n_extended;
19210
19211    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19212    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19213        mem_base = xmlMemBlocks();
19214        node = gen_const_xmlNodePtr(n_node, 0);
19215        extended = gen_int(n_extended, 1);
19216
19217        ret_val = xmlCopyNode((const xmlNodePtr)node, extended);
19218        desret_xmlNodePtr(ret_val);
19219        call_tests++;
19220        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19221        des_int(n_extended, extended, 1);
19222        xmlResetLastError();
19223        if (mem_base != xmlMemBlocks()) {
19224            printf("Leak of %d blocks found in xmlCopyNode",
19225	           xmlMemBlocks() - mem_base);
19226	    test_ret++;
19227            printf(" %d", n_node);
19228            printf(" %d", n_extended);
19229            printf("\n");
19230        }
19231    }
19232    }
19233    function_tests++;
19234
19235    return(test_ret);
19236}
19237
19238
19239static int
19240test_xmlCopyNodeList(void) {
19241    int test_ret = 0;
19242
19243    int mem_base;
19244    xmlNodePtr ret_val;
19245    xmlNodePtr node; /* the first node in the list. */
19246    int n_node;
19247
19248    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19249        mem_base = xmlMemBlocks();
19250        node = gen_const_xmlNodePtr(n_node, 0);
19251
19252        ret_val = xmlCopyNodeList((const xmlNodePtr)node);
19253        desret_xmlNodePtr(ret_val);
19254        call_tests++;
19255        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19256        xmlResetLastError();
19257        if (mem_base != xmlMemBlocks()) {
19258            printf("Leak of %d blocks found in xmlCopyNodeList",
19259	           xmlMemBlocks() - mem_base);
19260	    test_ret++;
19261            printf(" %d", n_node);
19262            printf("\n");
19263        }
19264    }
19265    function_tests++;
19266
19267    return(test_ret);
19268}
19269
19270
19271static int
19272test_xmlCopyProp(void) {
19273    int test_ret = 0;
19274
19275    int mem_base;
19276    xmlAttrPtr ret_val;
19277    xmlNodePtr target; /* the element where the attribute will be grafted */
19278    int n_target;
19279    xmlAttrPtr cur; /* the attribute */
19280    int n_cur;
19281
19282    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19283    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19284        mem_base = xmlMemBlocks();
19285        target = gen_xmlNodePtr(n_target, 0);
19286        cur = gen_xmlAttrPtr(n_cur, 1);
19287
19288        ret_val = xmlCopyProp(target, cur);
19289        desret_xmlAttrPtr(ret_val);
19290        call_tests++;
19291        des_xmlNodePtr(n_target, target, 0);
19292        des_xmlAttrPtr(n_cur, cur, 1);
19293        xmlResetLastError();
19294        if (mem_base != xmlMemBlocks()) {
19295            printf("Leak of %d blocks found in xmlCopyProp",
19296	           xmlMemBlocks() - mem_base);
19297	    test_ret++;
19298            printf(" %d", n_target);
19299            printf(" %d", n_cur);
19300            printf("\n");
19301        }
19302    }
19303    }
19304    function_tests++;
19305
19306    return(test_ret);
19307}
19308
19309
19310static int
19311test_xmlCopyPropList(void) {
19312    int test_ret = 0;
19313
19314    int mem_base;
19315    xmlAttrPtr ret_val;
19316    xmlNodePtr target; /* the element where the attributes will be grafted */
19317    int n_target;
19318    xmlAttrPtr cur; /* the first attribute */
19319    int n_cur;
19320
19321    for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) {
19322    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
19323        mem_base = xmlMemBlocks();
19324        target = gen_xmlNodePtr(n_target, 0);
19325        cur = gen_xmlAttrPtr(n_cur, 1);
19326
19327        ret_val = xmlCopyPropList(target, cur);
19328        desret_xmlAttrPtr(ret_val);
19329        call_tests++;
19330        des_xmlNodePtr(n_target, target, 0);
19331        des_xmlAttrPtr(n_cur, cur, 1);
19332        xmlResetLastError();
19333        if (mem_base != xmlMemBlocks()) {
19334            printf("Leak of %d blocks found in xmlCopyPropList",
19335	           xmlMemBlocks() - mem_base);
19336	    test_ret++;
19337            printf(" %d", n_target);
19338            printf(" %d", n_cur);
19339            printf("\n");
19340        }
19341    }
19342    }
19343    function_tests++;
19344
19345    return(test_ret);
19346}
19347
19348
19349static int
19350test_xmlCreateIntSubset(void) {
19351    int test_ret = 0;
19352
19353    int mem_base;
19354    xmlDtdPtr ret_val;
19355    xmlDocPtr doc; /* the document pointer */
19356    int n_doc;
19357    xmlChar * name; /* the DTD name */
19358    int n_name;
19359    xmlChar * ExternalID; /* the external (PUBLIC) ID */
19360    int n_ExternalID;
19361    xmlChar * SystemID; /* the system ID */
19362    int n_SystemID;
19363
19364    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19365    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
19366    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
19367    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
19368        mem_base = xmlMemBlocks();
19369        doc = gen_xmlDocPtr(n_doc, 0);
19370        name = gen_const_xmlChar_ptr(n_name, 1);
19371        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
19372        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
19373
19374        ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
19375        desret_xmlDtdPtr(ret_val);
19376        call_tests++;
19377        des_xmlDocPtr(n_doc, doc, 0);
19378        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
19379        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
19380        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
19381        xmlResetLastError();
19382        if (mem_base != xmlMemBlocks()) {
19383            printf("Leak of %d blocks found in xmlCreateIntSubset",
19384	           xmlMemBlocks() - mem_base);
19385	    test_ret++;
19386            printf(" %d", n_doc);
19387            printf(" %d", n_name);
19388            printf(" %d", n_ExternalID);
19389            printf(" %d", n_SystemID);
19390            printf("\n");
19391        }
19392    }
19393    }
19394    }
19395    }
19396    function_tests++;
19397
19398    return(test_ret);
19399}
19400
19401
19402#define gen_nb_xmlDOMWrapCtxtPtr 1
19403static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19404    return(NULL);
19405}
19406static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
19407}
19408
19409static int
19410test_xmlDOMWrapAdoptNode(void) {
19411    int test_ret = 0;
19412
19413    int mem_base;
19414    int ret_val;
19415    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19416    int n_ctxt;
19417    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19418    int n_sourceDoc;
19419    xmlNodePtr node; /* the node to start with */
19420    int n_node;
19421    xmlDocPtr destDoc; /* the destination doc */
19422    int n_destDoc;
19423    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19424    int n_destParent;
19425    int options; /* option flags */
19426    int n_options;
19427
19428    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19429    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19430    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19431    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19432    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19433    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19434        mem_base = xmlMemBlocks();
19435        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19436        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19437        node = gen_xmlNodePtr(n_node, 2);
19438        destDoc = gen_xmlDocPtr(n_destDoc, 3);
19439        destParent = gen_xmlNodePtr(n_destParent, 4);
19440        options = gen_int(n_options, 5);
19441
19442        ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
19443        if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
19444        desret_int(ret_val);
19445        call_tests++;
19446        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19447        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19448        des_xmlNodePtr(n_node, node, 2);
19449        des_xmlDocPtr(n_destDoc, destDoc, 3);
19450        des_xmlNodePtr(n_destParent, destParent, 4);
19451        des_int(n_options, options, 5);
19452        xmlResetLastError();
19453        if (mem_base != xmlMemBlocks()) {
19454            printf("Leak of %d blocks found in xmlDOMWrapAdoptNode",
19455	           xmlMemBlocks() - mem_base);
19456	    test_ret++;
19457            printf(" %d", n_ctxt);
19458            printf(" %d", n_sourceDoc);
19459            printf(" %d", n_node);
19460            printf(" %d", n_destDoc);
19461            printf(" %d", n_destParent);
19462            printf(" %d", n_options);
19463            printf("\n");
19464        }
19465    }
19466    }
19467    }
19468    }
19469    }
19470    }
19471    function_tests++;
19472
19473    return(test_ret);
19474}
19475
19476
19477static int
19478test_xmlDOMWrapCloneNode(void) {
19479    int test_ret = 0;
19480
19481    int mem_base;
19482    int ret_val;
19483    xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */
19484    int n_ctxt;
19485    xmlDocPtr sourceDoc; /* the optional sourceDoc */
19486    int n_sourceDoc;
19487    xmlNodePtr node; /* the node to start with */
19488    int n_node;
19489    xmlNodePtr * resNode; /* the clone of the given @node */
19490    int n_resNode;
19491    xmlDocPtr destDoc; /* the destination doc */
19492    int n_destDoc;
19493    xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */
19494    int n_destParent;
19495    int deep; /* descend into child if set */
19496    int n_deep;
19497    int options; /* option flags */
19498    int n_options;
19499
19500    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19501    for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) {
19502    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19503    for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) {
19504    for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) {
19505    for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) {
19506    for (n_deep = 0;n_deep < gen_nb_int;n_deep++) {
19507    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19508        mem_base = xmlMemBlocks();
19509        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19510        sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1);
19511        node = gen_xmlNodePtr(n_node, 2);
19512        resNode = gen_xmlNodePtr_ptr(n_resNode, 3);
19513        destDoc = gen_xmlDocPtr(n_destDoc, 4);
19514        destParent = gen_xmlNodePtr(n_destParent, 5);
19515        deep = gen_int(n_deep, 6);
19516        options = gen_int(n_options, 7);
19517
19518        ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options);
19519        desret_int(ret_val);
19520        call_tests++;
19521        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19522        des_xmlDocPtr(n_sourceDoc, sourceDoc, 1);
19523        des_xmlNodePtr(n_node, node, 2);
19524        des_xmlNodePtr_ptr(n_resNode, resNode, 3);
19525        des_xmlDocPtr(n_destDoc, destDoc, 4);
19526        des_xmlNodePtr(n_destParent, destParent, 5);
19527        des_int(n_deep, deep, 6);
19528        des_int(n_options, options, 7);
19529        xmlResetLastError();
19530        if (mem_base != xmlMemBlocks()) {
19531            printf("Leak of %d blocks found in xmlDOMWrapCloneNode",
19532	           xmlMemBlocks() - mem_base);
19533	    test_ret++;
19534            printf(" %d", n_ctxt);
19535            printf(" %d", n_sourceDoc);
19536            printf(" %d", n_node);
19537            printf(" %d", n_resNode);
19538            printf(" %d", n_destDoc);
19539            printf(" %d", n_destParent);
19540            printf(" %d", n_deep);
19541            printf(" %d", n_options);
19542            printf("\n");
19543        }
19544    }
19545    }
19546    }
19547    }
19548    }
19549    }
19550    }
19551    }
19552    function_tests++;
19553
19554    return(test_ret);
19555}
19556
19557
19558static int
19559test_xmlDOMWrapNewCtxt(void) {
19560    int test_ret = 0;
19561
19562
19563    /* missing type support */
19564    return(test_ret);
19565}
19566
19567
19568static int
19569test_xmlDOMWrapReconcileNamespaces(void) {
19570    int test_ret = 0;
19571
19572    int mem_base;
19573    int ret_val;
19574    xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */
19575    int n_ctxt;
19576    xmlNodePtr elem; /* the element-node */
19577    int n_elem;
19578    int options; /* option flags */
19579    int n_options;
19580
19581    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19582    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
19583    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19584        mem_base = xmlMemBlocks();
19585        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19586        elem = gen_xmlNodePtr(n_elem, 1);
19587        options = gen_int(n_options, 2);
19588
19589        ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options);
19590        desret_int(ret_val);
19591        call_tests++;
19592        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19593        des_xmlNodePtr(n_elem, elem, 1);
19594        des_int(n_options, options, 2);
19595        xmlResetLastError();
19596        if (mem_base != xmlMemBlocks()) {
19597            printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces",
19598	           xmlMemBlocks() - mem_base);
19599	    test_ret++;
19600            printf(" %d", n_ctxt);
19601            printf(" %d", n_elem);
19602            printf(" %d", n_options);
19603            printf("\n");
19604        }
19605    }
19606    }
19607    }
19608    function_tests++;
19609
19610    return(test_ret);
19611}
19612
19613
19614static int
19615test_xmlDOMWrapRemoveNode(void) {
19616    int test_ret = 0;
19617
19618    int mem_base;
19619    int ret_val;
19620    xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */
19621    int n_ctxt;
19622    xmlDocPtr doc; /* the doc */
19623    int n_doc;
19624    xmlNodePtr node; /* the node to be removed. */
19625    int n_node;
19626    int options; /* set of options, unused at the moment */
19627    int n_options;
19628
19629    for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) {
19630    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19631    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
19632    for (n_options = 0;n_options < gen_nb_int;n_options++) {
19633        mem_base = xmlMemBlocks();
19634        ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0);
19635        doc = gen_xmlDocPtr(n_doc, 1);
19636        node = gen_xmlNodePtr(n_node, 2);
19637        options = gen_int(n_options, 3);
19638
19639        ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options);
19640        desret_int(ret_val);
19641        call_tests++;
19642        des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);
19643        des_xmlDocPtr(n_doc, doc, 1);
19644        des_xmlNodePtr(n_node, node, 2);
19645        des_int(n_options, options, 3);
19646        xmlResetLastError();
19647        if (mem_base != xmlMemBlocks()) {
19648            printf("Leak of %d blocks found in xmlDOMWrapRemoveNode",
19649	           xmlMemBlocks() - mem_base);
19650	    test_ret++;
19651            printf(" %d", n_ctxt);
19652            printf(" %d", n_doc);
19653            printf(" %d", n_node);
19654            printf(" %d", n_options);
19655            printf("\n");
19656        }
19657    }
19658    }
19659    }
19660    }
19661    function_tests++;
19662
19663    return(test_ret);
19664}
19665
19666
19667static int
19668test_xmlDocCopyNode(void) {
19669    int test_ret = 0;
19670
19671    int mem_base;
19672    xmlNodePtr ret_val;
19673    xmlNodePtr node; /* the node */
19674    int n_node;
19675    xmlDocPtr doc; /* the document */
19676    int n_doc;
19677    int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */
19678    int n_extended;
19679
19680    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19681    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19682    for (n_extended = 0;n_extended < gen_nb_int;n_extended++) {
19683        mem_base = xmlMemBlocks();
19684        node = gen_const_xmlNodePtr(n_node, 0);
19685        doc = gen_xmlDocPtr(n_doc, 1);
19686        extended = gen_int(n_extended, 2);
19687
19688        ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended);
19689        desret_xmlNodePtr(ret_val);
19690        call_tests++;
19691        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0);
19692        des_xmlDocPtr(n_doc, doc, 1);
19693        des_int(n_extended, extended, 2);
19694        xmlResetLastError();
19695        if (mem_base != xmlMemBlocks()) {
19696            printf("Leak of %d blocks found in xmlDocCopyNode",
19697	           xmlMemBlocks() - mem_base);
19698	    test_ret++;
19699            printf(" %d", n_node);
19700            printf(" %d", n_doc);
19701            printf(" %d", n_extended);
19702            printf("\n");
19703        }
19704    }
19705    }
19706    }
19707    function_tests++;
19708
19709    return(test_ret);
19710}
19711
19712
19713static int
19714test_xmlDocCopyNodeList(void) {
19715    int test_ret = 0;
19716
19717    int mem_base;
19718    xmlNodePtr ret_val;
19719    xmlDocPtr doc; /* the target document */
19720    int n_doc;
19721    xmlNodePtr node; /* the first node in the list. */
19722    int n_node;
19723
19724    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
19725    for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) {
19726        mem_base = xmlMemBlocks();
19727        doc = gen_xmlDocPtr(n_doc, 0);
19728        node = gen_const_xmlNodePtr(n_node, 1);
19729
19730        ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node);
19731        desret_xmlNodePtr(ret_val);
19732        call_tests++;
19733        des_xmlDocPtr(n_doc, doc, 0);
19734        des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1);
19735        xmlResetLastError();
19736        if (mem_base != xmlMemBlocks()) {
19737            printf("Leak of %d blocks found in xmlDocCopyNodeList",
19738	           xmlMemBlocks() - mem_base);
19739	    test_ret++;
19740            printf(" %d", n_doc);
19741            printf(" %d", n_node);
19742            printf("\n");
19743        }
19744    }
19745    }
19746    function_tests++;
19747
19748    return(test_ret);
19749}
19750
19751
19752static int
19753test_xmlDocDump(void) {
19754    int test_ret = 0;
19755
19756#if defined(LIBXML_OUTPUT_ENABLED)
19757    int mem_base;
19758    int ret_val;
19759    FILE * f; /* the FILE* */
19760    int n_f;
19761    xmlDocPtr cur; /* the document */
19762    int n_cur;
19763
19764    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
19765    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19766        mem_base = xmlMemBlocks();
19767        f = gen_FILE_ptr(n_f, 0);
19768        cur = gen_xmlDocPtr(n_cur, 1);
19769
19770        ret_val = xmlDocDump(f, cur);
19771        desret_int(ret_val);
19772        call_tests++;
19773        des_FILE_ptr(n_f, f, 0);
19774        des_xmlDocPtr(n_cur, cur, 1);
19775        xmlResetLastError();
19776        if (mem_base != xmlMemBlocks()) {
19777            printf("Leak of %d blocks found in xmlDocDump",
19778	           xmlMemBlocks() - mem_base);
19779	    test_ret++;
19780            printf(" %d", n_f);
19781            printf(" %d", n_cur);
19782            printf("\n");
19783        }
19784    }
19785    }
19786    function_tests++;
19787#endif
19788
19789    return(test_ret);
19790}
19791
19792
19793static int
19794test_xmlDocDumpFormatMemory(void) {
19795    int test_ret = 0;
19796
19797#if defined(LIBXML_OUTPUT_ENABLED)
19798    int mem_base;
19799    xmlDocPtr cur; /* the document */
19800    int n_cur;
19801    xmlChar ** mem; /* OUT: the memory pointer */
19802    int n_mem;
19803    int * size; /* OUT: the memory length */
19804    int n_size;
19805    int format; /* should formatting spaces been added */
19806    int n_format;
19807
19808    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19809    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19810    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19811    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19812        mem_base = xmlMemBlocks();
19813        cur = gen_xmlDocPtr(n_cur, 0);
19814        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19815        size = gen_int_ptr(n_size, 2);
19816        format = gen_int(n_format, 3);
19817
19818        xmlDocDumpFormatMemory(cur, mem, size, format);
19819        call_tests++;
19820        des_xmlDocPtr(n_cur, cur, 0);
19821        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19822        des_int_ptr(n_size, size, 2);
19823        des_int(n_format, format, 3);
19824        xmlResetLastError();
19825        if (mem_base != xmlMemBlocks()) {
19826            printf("Leak of %d blocks found in xmlDocDumpFormatMemory",
19827	           xmlMemBlocks() - mem_base);
19828	    test_ret++;
19829            printf(" %d", n_cur);
19830            printf(" %d", n_mem);
19831            printf(" %d", n_size);
19832            printf(" %d", n_format);
19833            printf("\n");
19834        }
19835    }
19836    }
19837    }
19838    }
19839    function_tests++;
19840#endif
19841
19842    return(test_ret);
19843}
19844
19845
19846static int
19847test_xmlDocDumpFormatMemoryEnc(void) {
19848    int test_ret = 0;
19849
19850#if defined(LIBXML_OUTPUT_ENABLED)
19851    int mem_base;
19852    xmlDocPtr out_doc; /* Document to generate XML text from */
19853    int n_out_doc;
19854    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19855    int n_doc_txt_ptr;
19856    int * doc_txt_len; /* Length of the generated XML text */
19857    int n_doc_txt_len;
19858    char * txt_encoding; /* Character encoding to use when generating XML text */
19859    int n_txt_encoding;
19860    int format; /* should formatting spaces been added */
19861    int n_format;
19862
19863    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19864    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19865    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19866    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19867    for (n_format = 0;n_format < gen_nb_int;n_format++) {
19868        mem_base = xmlMemBlocks();
19869        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19870        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19871        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19872        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19873        format = gen_int(n_format, 4);
19874
19875        xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format);
19876        call_tests++;
19877        des_xmlDocPtr(n_out_doc, out_doc, 0);
19878        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19879        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19880        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19881        des_int(n_format, format, 4);
19882        xmlResetLastError();
19883        if (mem_base != xmlMemBlocks()) {
19884            printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc",
19885	           xmlMemBlocks() - mem_base);
19886	    test_ret++;
19887            printf(" %d", n_out_doc);
19888            printf(" %d", n_doc_txt_ptr);
19889            printf(" %d", n_doc_txt_len);
19890            printf(" %d", n_txt_encoding);
19891            printf(" %d", n_format);
19892            printf("\n");
19893        }
19894    }
19895    }
19896    }
19897    }
19898    }
19899    function_tests++;
19900#endif
19901
19902    return(test_ret);
19903}
19904
19905
19906static int
19907test_xmlDocDumpMemory(void) {
19908    int test_ret = 0;
19909
19910#if defined(LIBXML_OUTPUT_ENABLED)
19911    int mem_base;
19912    xmlDocPtr cur; /* the document */
19913    int n_cur;
19914    xmlChar ** mem; /* OUT: the memory pointer */
19915    int n_mem;
19916    int * size; /* OUT: the memory length */
19917    int n_size;
19918
19919    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
19920    for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) {
19921    for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) {
19922        mem_base = xmlMemBlocks();
19923        cur = gen_xmlDocPtr(n_cur, 0);
19924        mem = gen_xmlChar_ptr_ptr(n_mem, 1);
19925        size = gen_int_ptr(n_size, 2);
19926
19927        xmlDocDumpMemory(cur, mem, size);
19928        call_tests++;
19929        des_xmlDocPtr(n_cur, cur, 0);
19930        des_xmlChar_ptr_ptr(n_mem, mem, 1);
19931        des_int_ptr(n_size, size, 2);
19932        xmlResetLastError();
19933        if (mem_base != xmlMemBlocks()) {
19934            printf("Leak of %d blocks found in xmlDocDumpMemory",
19935	           xmlMemBlocks() - mem_base);
19936	    test_ret++;
19937            printf(" %d", n_cur);
19938            printf(" %d", n_mem);
19939            printf(" %d", n_size);
19940            printf("\n");
19941        }
19942    }
19943    }
19944    }
19945    function_tests++;
19946#endif
19947
19948    return(test_ret);
19949}
19950
19951
19952static int
19953test_xmlDocDumpMemoryEnc(void) {
19954    int test_ret = 0;
19955
19956#if defined(LIBXML_OUTPUT_ENABLED)
19957    int mem_base;
19958    xmlDocPtr out_doc; /* Document to generate XML text from */
19959    int n_out_doc;
19960    xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */
19961    int n_doc_txt_ptr;
19962    int * doc_txt_len; /* Length of the generated XML text */
19963    int n_doc_txt_len;
19964    char * txt_encoding; /* Character encoding to use when generating XML text */
19965    int n_txt_encoding;
19966
19967    for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) {
19968    for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) {
19969    for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) {
19970    for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) {
19971        mem_base = xmlMemBlocks();
19972        out_doc = gen_xmlDocPtr(n_out_doc, 0);
19973        doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1);
19974        doc_txt_len = gen_int_ptr(n_doc_txt_len, 2);
19975        txt_encoding = gen_const_char_ptr(n_txt_encoding, 3);
19976
19977        xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding);
19978        call_tests++;
19979        des_xmlDocPtr(n_out_doc, out_doc, 0);
19980        des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1);
19981        des_int_ptr(n_doc_txt_len, doc_txt_len, 2);
19982        des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3);
19983        xmlResetLastError();
19984        if (mem_base != xmlMemBlocks()) {
19985            printf("Leak of %d blocks found in xmlDocDumpMemoryEnc",
19986	           xmlMemBlocks() - mem_base);
19987	    test_ret++;
19988            printf(" %d", n_out_doc);
19989            printf(" %d", n_doc_txt_ptr);
19990            printf(" %d", n_doc_txt_len);
19991            printf(" %d", n_txt_encoding);
19992            printf("\n");
19993        }
19994    }
19995    }
19996    }
19997    }
19998    function_tests++;
19999#endif
20000
20001    return(test_ret);
20002}
20003
20004
20005static int
20006test_xmlDocFormatDump(void) {
20007    int test_ret = 0;
20008
20009#if defined(LIBXML_OUTPUT_ENABLED)
20010    int mem_base;
20011    int ret_val;
20012    FILE * f; /* the FILE* */
20013    int n_f;
20014    xmlDocPtr cur; /* the document */
20015    int n_cur;
20016    int format; /* should formatting spaces been added */
20017    int n_format;
20018
20019    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20020    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
20021    for (n_format = 0;n_format < gen_nb_int;n_format++) {
20022        mem_base = xmlMemBlocks();
20023        f = gen_FILE_ptr(n_f, 0);
20024        cur = gen_xmlDocPtr(n_cur, 1);
20025        format = gen_int(n_format, 2);
20026
20027        ret_val = xmlDocFormatDump(f, cur, format);
20028        desret_int(ret_val);
20029        call_tests++;
20030        des_FILE_ptr(n_f, f, 0);
20031        des_xmlDocPtr(n_cur, cur, 1);
20032        des_int(n_format, format, 2);
20033        xmlResetLastError();
20034        if (mem_base != xmlMemBlocks()) {
20035            printf("Leak of %d blocks found in xmlDocFormatDump",
20036	           xmlMemBlocks() - mem_base);
20037	    test_ret++;
20038            printf(" %d", n_f);
20039            printf(" %d", n_cur);
20040            printf(" %d", n_format);
20041            printf("\n");
20042        }
20043    }
20044    }
20045    }
20046    function_tests++;
20047#endif
20048
20049    return(test_ret);
20050}
20051
20052
20053static int
20054test_xmlDocGetRootElement(void) {
20055    int test_ret = 0;
20056
20057    int mem_base;
20058    xmlNodePtr ret_val;
20059    xmlDocPtr doc; /* the document */
20060    int n_doc;
20061
20062    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20063        mem_base = xmlMemBlocks();
20064        doc = gen_xmlDocPtr(n_doc, 0);
20065
20066        ret_val = xmlDocGetRootElement(doc);
20067        desret_xmlNodePtr(ret_val);
20068        call_tests++;
20069        des_xmlDocPtr(n_doc, doc, 0);
20070        xmlResetLastError();
20071        if (mem_base != xmlMemBlocks()) {
20072            printf("Leak of %d blocks found in xmlDocGetRootElement",
20073	           xmlMemBlocks() - mem_base);
20074	    test_ret++;
20075            printf(" %d", n_doc);
20076            printf("\n");
20077        }
20078    }
20079    function_tests++;
20080
20081    return(test_ret);
20082}
20083
20084
20085static int
20086test_xmlDocSetRootElement(void) {
20087    int test_ret = 0;
20088
20089#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
20090    int mem_base;
20091    xmlNodePtr ret_val;
20092    xmlDocPtr doc; /* the document */
20093    int n_doc;
20094    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. */
20095    int n_root;
20096
20097    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20098    for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) {
20099        mem_base = xmlMemBlocks();
20100        doc = gen_xmlDocPtr(n_doc, 0);
20101        root = gen_xmlNodePtr_in(n_root, 1);
20102
20103        ret_val = xmlDocSetRootElement(doc, root);
20104        if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }
20105        desret_xmlNodePtr(ret_val);
20106        call_tests++;
20107        des_xmlDocPtr(n_doc, doc, 0);
20108        des_xmlNodePtr_in(n_root, root, 1);
20109        xmlResetLastError();
20110        if (mem_base != xmlMemBlocks()) {
20111            printf("Leak of %d blocks found in xmlDocSetRootElement",
20112	           xmlMemBlocks() - mem_base);
20113	    test_ret++;
20114            printf(" %d", n_doc);
20115            printf(" %d", n_root);
20116            printf("\n");
20117        }
20118    }
20119    }
20120    function_tests++;
20121#endif
20122
20123    return(test_ret);
20124}
20125
20126
20127static int
20128test_xmlElemDump(void) {
20129    int test_ret = 0;
20130
20131#if defined(LIBXML_OUTPUT_ENABLED)
20132    int mem_base;
20133    FILE * f; /* the FILE * for the output */
20134    int n_f;
20135    xmlDocPtr doc; /* the document */
20136    int n_doc;
20137    xmlNodePtr cur; /* the current node */
20138    int n_cur;
20139
20140    for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) {
20141    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20142    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
20143        mem_base = xmlMemBlocks();
20144        f = gen_FILE_ptr(n_f, 0);
20145        doc = gen_xmlDocPtr(n_doc, 1);
20146        cur = gen_xmlNodePtr(n_cur, 2);
20147
20148        xmlElemDump(f, doc, cur);
20149        call_tests++;
20150        des_FILE_ptr(n_f, f, 0);
20151        des_xmlDocPtr(n_doc, doc, 1);
20152        des_xmlNodePtr(n_cur, cur, 2);
20153        xmlResetLastError();
20154        if (mem_base != xmlMemBlocks()) {
20155            printf("Leak of %d blocks found in xmlElemDump",
20156	           xmlMemBlocks() - mem_base);
20157	    test_ret++;
20158            printf(" %d", n_f);
20159            printf(" %d", n_doc);
20160            printf(" %d", n_cur);
20161            printf("\n");
20162        }
20163    }
20164    }
20165    }
20166    function_tests++;
20167#endif
20168
20169    return(test_ret);
20170}
20171
20172
20173static int
20174test_xmlGetBufferAllocationScheme(void) {
20175    int test_ret = 0;
20176
20177    int mem_base;
20178    xmlBufferAllocationScheme ret_val;
20179
20180        mem_base = xmlMemBlocks();
20181
20182        ret_val = xmlGetBufferAllocationScheme();
20183        desret_xmlBufferAllocationScheme(ret_val);
20184        call_tests++;
20185        xmlResetLastError();
20186        if (mem_base != xmlMemBlocks()) {
20187            printf("Leak of %d blocks found in xmlGetBufferAllocationScheme",
20188	           xmlMemBlocks() - mem_base);
20189	    test_ret++;
20190            printf("\n");
20191        }
20192    function_tests++;
20193
20194    return(test_ret);
20195}
20196
20197
20198static int
20199test_xmlGetCompressMode(void) {
20200    int test_ret = 0;
20201
20202    int mem_base;
20203    int ret_val;
20204
20205        mem_base = xmlMemBlocks();
20206
20207        ret_val = xmlGetCompressMode();
20208        desret_int(ret_val);
20209        call_tests++;
20210        xmlResetLastError();
20211        if (mem_base != xmlMemBlocks()) {
20212            printf("Leak of %d blocks found in xmlGetCompressMode",
20213	           xmlMemBlocks() - mem_base);
20214	    test_ret++;
20215            printf("\n");
20216        }
20217    function_tests++;
20218
20219    return(test_ret);
20220}
20221
20222
20223static int
20224test_xmlGetDocCompressMode(void) {
20225    int test_ret = 0;
20226
20227    int mem_base;
20228    int ret_val;
20229    xmlDocPtr doc; /* the document */
20230    int n_doc;
20231
20232    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20233        mem_base = xmlMemBlocks();
20234        doc = gen_xmlDocPtr(n_doc, 0);
20235
20236        ret_val = xmlGetDocCompressMode(doc);
20237        desret_int(ret_val);
20238        call_tests++;
20239        des_xmlDocPtr(n_doc, doc, 0);
20240        xmlResetLastError();
20241        if (mem_base != xmlMemBlocks()) {
20242            printf("Leak of %d blocks found in xmlGetDocCompressMode",
20243	           xmlMemBlocks() - mem_base);
20244	    test_ret++;
20245            printf(" %d", n_doc);
20246            printf("\n");
20247        }
20248    }
20249    function_tests++;
20250
20251    return(test_ret);
20252}
20253
20254
20255static int
20256test_xmlGetIntSubset(void) {
20257    int test_ret = 0;
20258
20259    int mem_base;
20260    xmlDtdPtr ret_val;
20261    xmlDocPtr doc; /* the document pointer */
20262    int n_doc;
20263
20264    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20265        mem_base = xmlMemBlocks();
20266        doc = gen_xmlDocPtr(n_doc, 0);
20267
20268        ret_val = xmlGetIntSubset(doc);
20269        desret_xmlDtdPtr(ret_val);
20270        call_tests++;
20271        des_xmlDocPtr(n_doc, doc, 0);
20272        xmlResetLastError();
20273        if (mem_base != xmlMemBlocks()) {
20274            printf("Leak of %d blocks found in xmlGetIntSubset",
20275	           xmlMemBlocks() - mem_base);
20276	    test_ret++;
20277            printf(" %d", n_doc);
20278            printf("\n");
20279        }
20280    }
20281    function_tests++;
20282
20283    return(test_ret);
20284}
20285
20286
20287static int
20288test_xmlGetLastChild(void) {
20289    int test_ret = 0;
20290
20291    int mem_base;
20292    xmlNodePtr ret_val;
20293    xmlNodePtr parent; /* the parent node */
20294    int n_parent;
20295
20296    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20297        mem_base = xmlMemBlocks();
20298        parent = gen_xmlNodePtr(n_parent, 0);
20299
20300        ret_val = xmlGetLastChild(parent);
20301        desret_xmlNodePtr(ret_val);
20302        call_tests++;
20303        des_xmlNodePtr(n_parent, parent, 0);
20304        xmlResetLastError();
20305        if (mem_base != xmlMemBlocks()) {
20306            printf("Leak of %d blocks found in xmlGetLastChild",
20307	           xmlMemBlocks() - mem_base);
20308	    test_ret++;
20309            printf(" %d", n_parent);
20310            printf("\n");
20311        }
20312    }
20313    function_tests++;
20314
20315    return(test_ret);
20316}
20317
20318
20319static int
20320test_xmlGetLineNo(void) {
20321    int test_ret = 0;
20322
20323    int mem_base;
20324    long ret_val;
20325    xmlNodePtr node; /* valid node */
20326    int n_node;
20327
20328    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20329        mem_base = xmlMemBlocks();
20330        node = gen_xmlNodePtr(n_node, 0);
20331
20332        ret_val = xmlGetLineNo(node);
20333        desret_long(ret_val);
20334        call_tests++;
20335        des_xmlNodePtr(n_node, node, 0);
20336        xmlResetLastError();
20337        if (mem_base != xmlMemBlocks()) {
20338            printf("Leak of %d blocks found in xmlGetLineNo",
20339	           xmlMemBlocks() - mem_base);
20340	    test_ret++;
20341            printf(" %d", n_node);
20342            printf("\n");
20343        }
20344    }
20345    function_tests++;
20346
20347    return(test_ret);
20348}
20349
20350
20351static int
20352test_xmlGetNoNsProp(void) {
20353    int test_ret = 0;
20354
20355    int mem_base;
20356    xmlChar * ret_val;
20357    xmlNodePtr node; /* the node */
20358    int n_node;
20359    xmlChar * name; /* the attribute name */
20360    int n_name;
20361
20362    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20363    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20364        mem_base = xmlMemBlocks();
20365        node = gen_xmlNodePtr(n_node, 0);
20366        name = gen_const_xmlChar_ptr(n_name, 1);
20367
20368        ret_val = xmlGetNoNsProp(node, (const xmlChar *)name);
20369        desret_xmlChar_ptr(ret_val);
20370        call_tests++;
20371        des_xmlNodePtr(n_node, node, 0);
20372        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20373        xmlResetLastError();
20374        if (mem_base != xmlMemBlocks()) {
20375            printf("Leak of %d blocks found in xmlGetNoNsProp",
20376	           xmlMemBlocks() - mem_base);
20377	    test_ret++;
20378            printf(" %d", n_node);
20379            printf(" %d", n_name);
20380            printf("\n");
20381        }
20382    }
20383    }
20384    function_tests++;
20385
20386    return(test_ret);
20387}
20388
20389
20390static int
20391test_xmlGetNodePath(void) {
20392    int test_ret = 0;
20393
20394#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
20395    int mem_base;
20396    xmlChar * ret_val;
20397    xmlNodePtr node; /* a node */
20398    int n_node;
20399
20400    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20401        mem_base = xmlMemBlocks();
20402        node = gen_xmlNodePtr(n_node, 0);
20403
20404        ret_val = xmlGetNodePath(node);
20405        desret_xmlChar_ptr(ret_val);
20406        call_tests++;
20407        des_xmlNodePtr(n_node, node, 0);
20408        xmlResetLastError();
20409        if (mem_base != xmlMemBlocks()) {
20410            printf("Leak of %d blocks found in xmlGetNodePath",
20411	           xmlMemBlocks() - mem_base);
20412	    test_ret++;
20413            printf(" %d", n_node);
20414            printf("\n");
20415        }
20416    }
20417    function_tests++;
20418#endif
20419
20420    return(test_ret);
20421}
20422
20423
20424static int
20425test_xmlGetNsList(void) {
20426    int test_ret = 0;
20427
20428
20429    /* missing type support */
20430    return(test_ret);
20431}
20432
20433
20434static int
20435test_xmlGetNsProp(void) {
20436    int test_ret = 0;
20437
20438    int mem_base;
20439    xmlChar * ret_val;
20440    xmlNodePtr node; /* the node */
20441    int n_node;
20442    xmlChar * name; /* the attribute name */
20443    int n_name;
20444    xmlChar * nameSpace; /* the URI of the namespace */
20445    int n_nameSpace;
20446
20447    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20448    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20449    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20450        mem_base = xmlMemBlocks();
20451        node = gen_xmlNodePtr(n_node, 0);
20452        name = gen_const_xmlChar_ptr(n_name, 1);
20453        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20454
20455        ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20456        desret_xmlChar_ptr(ret_val);
20457        call_tests++;
20458        des_xmlNodePtr(n_node, node, 0);
20459        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20460        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20461        xmlResetLastError();
20462        if (mem_base != xmlMemBlocks()) {
20463            printf("Leak of %d blocks found in xmlGetNsProp",
20464	           xmlMemBlocks() - mem_base);
20465	    test_ret++;
20466            printf(" %d", n_node);
20467            printf(" %d", n_name);
20468            printf(" %d", n_nameSpace);
20469            printf("\n");
20470        }
20471    }
20472    }
20473    }
20474    function_tests++;
20475
20476    return(test_ret);
20477}
20478
20479
20480static int
20481test_xmlGetProp(void) {
20482    int test_ret = 0;
20483
20484    int mem_base;
20485    xmlChar * ret_val;
20486    xmlNodePtr node; /* the node */
20487    int n_node;
20488    xmlChar * name; /* the attribute name */
20489    int n_name;
20490
20491    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20492    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20493        mem_base = xmlMemBlocks();
20494        node = gen_xmlNodePtr(n_node, 0);
20495        name = gen_const_xmlChar_ptr(n_name, 1);
20496
20497        ret_val = xmlGetProp(node, (const xmlChar *)name);
20498        desret_xmlChar_ptr(ret_val);
20499        call_tests++;
20500        des_xmlNodePtr(n_node, node, 0);
20501        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20502        xmlResetLastError();
20503        if (mem_base != xmlMemBlocks()) {
20504            printf("Leak of %d blocks found in xmlGetProp",
20505	           xmlMemBlocks() - mem_base);
20506	    test_ret++;
20507            printf(" %d", n_node);
20508            printf(" %d", n_name);
20509            printf("\n");
20510        }
20511    }
20512    }
20513    function_tests++;
20514
20515    return(test_ret);
20516}
20517
20518
20519static int
20520test_xmlHasNsProp(void) {
20521    int test_ret = 0;
20522
20523    int mem_base;
20524    xmlAttrPtr ret_val;
20525    xmlNodePtr node; /* the node */
20526    int n_node;
20527    xmlChar * name; /* the attribute name */
20528    int n_name;
20529    xmlChar * nameSpace; /* the URI of the namespace */
20530    int n_nameSpace;
20531
20532    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20533    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20534    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
20535        mem_base = xmlMemBlocks();
20536        node = gen_xmlNodePtr(n_node, 0);
20537        name = gen_const_xmlChar_ptr(n_name, 1);
20538        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
20539
20540        ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace);
20541        desret_xmlAttrPtr(ret_val);
20542        call_tests++;
20543        des_xmlNodePtr(n_node, node, 0);
20544        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20545        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
20546        xmlResetLastError();
20547        if (mem_base != xmlMemBlocks()) {
20548            printf("Leak of %d blocks found in xmlHasNsProp",
20549	           xmlMemBlocks() - mem_base);
20550	    test_ret++;
20551            printf(" %d", n_node);
20552            printf(" %d", n_name);
20553            printf(" %d", n_nameSpace);
20554            printf("\n");
20555        }
20556    }
20557    }
20558    }
20559    function_tests++;
20560
20561    return(test_ret);
20562}
20563
20564
20565static int
20566test_xmlHasProp(void) {
20567    int test_ret = 0;
20568
20569    int mem_base;
20570    xmlAttrPtr ret_val;
20571    xmlNodePtr node; /* the node */
20572    int n_node;
20573    xmlChar * name; /* the attribute name */
20574    int n_name;
20575
20576    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20577    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20578        mem_base = xmlMemBlocks();
20579        node = gen_xmlNodePtr(n_node, 0);
20580        name = gen_const_xmlChar_ptr(n_name, 1);
20581
20582        ret_val = xmlHasProp(node, (const xmlChar *)name);
20583        desret_xmlAttrPtr(ret_val);
20584        call_tests++;
20585        des_xmlNodePtr(n_node, node, 0);
20586        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20587        xmlResetLastError();
20588        if (mem_base != xmlMemBlocks()) {
20589            printf("Leak of %d blocks found in xmlHasProp",
20590	           xmlMemBlocks() - mem_base);
20591	    test_ret++;
20592            printf(" %d", n_node);
20593            printf(" %d", n_name);
20594            printf("\n");
20595        }
20596    }
20597    }
20598    function_tests++;
20599
20600    return(test_ret);
20601}
20602
20603
20604static int
20605test_xmlIsBlankNode(void) {
20606    int test_ret = 0;
20607
20608    int mem_base;
20609    int ret_val;
20610    xmlNodePtr node; /* the node */
20611    int n_node;
20612
20613    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
20614        mem_base = xmlMemBlocks();
20615        node = gen_xmlNodePtr(n_node, 0);
20616
20617        ret_val = xmlIsBlankNode(node);
20618        desret_int(ret_val);
20619        call_tests++;
20620        des_xmlNodePtr(n_node, node, 0);
20621        xmlResetLastError();
20622        if (mem_base != xmlMemBlocks()) {
20623            printf("Leak of %d blocks found in xmlIsBlankNode",
20624	           xmlMemBlocks() - mem_base);
20625	    test_ret++;
20626            printf(" %d", n_node);
20627            printf("\n");
20628        }
20629    }
20630    function_tests++;
20631
20632    return(test_ret);
20633}
20634
20635
20636static int
20637test_xmlIsXHTML(void) {
20638    int test_ret = 0;
20639
20640    int mem_base;
20641    int ret_val;
20642    xmlChar * systemID; /* the system identifier */
20643    int n_systemID;
20644    xmlChar * publicID; /* the public identifier */
20645    int n_publicID;
20646
20647    for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) {
20648    for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) {
20649        mem_base = xmlMemBlocks();
20650        systemID = gen_const_xmlChar_ptr(n_systemID, 0);
20651        publicID = gen_const_xmlChar_ptr(n_publicID, 1);
20652
20653        ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID);
20654        desret_int(ret_val);
20655        call_tests++;
20656        des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0);
20657        des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1);
20658        xmlResetLastError();
20659        if (mem_base != xmlMemBlocks()) {
20660            printf("Leak of %d blocks found in xmlIsXHTML",
20661	           xmlMemBlocks() - mem_base);
20662	    test_ret++;
20663            printf(" %d", n_systemID);
20664            printf(" %d", n_publicID);
20665            printf("\n");
20666        }
20667    }
20668    }
20669    function_tests++;
20670
20671    return(test_ret);
20672}
20673
20674
20675static int
20676test_xmlNewCDataBlock(void) {
20677    int test_ret = 0;
20678
20679    int mem_base;
20680    xmlNodePtr ret_val;
20681    xmlDocPtr doc; /* the document */
20682    int n_doc;
20683    xmlChar * content; /* the CDATA block content content */
20684    int n_content;
20685    int len; /* the length of the block */
20686    int n_len;
20687
20688    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20689    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20690    for (n_len = 0;n_len < gen_nb_int;n_len++) {
20691        mem_base = xmlMemBlocks();
20692        doc = gen_xmlDocPtr(n_doc, 0);
20693        content = gen_const_xmlChar_ptr(n_content, 1);
20694        len = gen_int(n_len, 2);
20695
20696        ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len);
20697        desret_xmlNodePtr(ret_val);
20698        call_tests++;
20699        des_xmlDocPtr(n_doc, doc, 0);
20700        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20701        des_int(n_len, len, 2);
20702        xmlResetLastError();
20703        if (mem_base != xmlMemBlocks()) {
20704            printf("Leak of %d blocks found in xmlNewCDataBlock",
20705	           xmlMemBlocks() - mem_base);
20706	    test_ret++;
20707            printf(" %d", n_doc);
20708            printf(" %d", n_content);
20709            printf(" %d", n_len);
20710            printf("\n");
20711        }
20712    }
20713    }
20714    }
20715    function_tests++;
20716
20717    return(test_ret);
20718}
20719
20720
20721static int
20722test_xmlNewCharRef(void) {
20723    int test_ret = 0;
20724
20725    int mem_base;
20726    xmlNodePtr ret_val;
20727    xmlDocPtr doc; /* the document */
20728    int n_doc;
20729    xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */
20730    int n_name;
20731
20732    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20733    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20734        mem_base = xmlMemBlocks();
20735        doc = gen_xmlDocPtr(n_doc, 0);
20736        name = gen_const_xmlChar_ptr(n_name, 1);
20737
20738        ret_val = xmlNewCharRef(doc, (const xmlChar *)name);
20739        desret_xmlNodePtr(ret_val);
20740        call_tests++;
20741        des_xmlDocPtr(n_doc, doc, 0);
20742        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
20743        xmlResetLastError();
20744        if (mem_base != xmlMemBlocks()) {
20745            printf("Leak of %d blocks found in xmlNewCharRef",
20746	           xmlMemBlocks() - mem_base);
20747	    test_ret++;
20748            printf(" %d", n_doc);
20749            printf(" %d", n_name);
20750            printf("\n");
20751        }
20752    }
20753    }
20754    function_tests++;
20755
20756    return(test_ret);
20757}
20758
20759
20760static int
20761test_xmlNewChild(void) {
20762    int test_ret = 0;
20763
20764#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
20765#ifdef LIBXML_TREE_ENABLED
20766    int mem_base;
20767    xmlNodePtr ret_val;
20768    xmlNodePtr parent; /* the parent node */
20769    int n_parent;
20770    xmlNsPtr ns; /* a namespace if any */
20771    int n_ns;
20772    xmlChar * name; /* the name of the child */
20773    int n_name;
20774    xmlChar * content; /* the XML content of the child if any. */
20775    int n_content;
20776
20777    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
20778    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20779    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20780    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20781        mem_base = xmlMemBlocks();
20782        parent = gen_xmlNodePtr(n_parent, 0);
20783        ns = gen_xmlNsPtr(n_ns, 1);
20784        name = gen_const_xmlChar_ptr(n_name, 2);
20785        content = gen_const_xmlChar_ptr(n_content, 3);
20786
20787        ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
20788        desret_xmlNodePtr(ret_val);
20789        call_tests++;
20790        des_xmlNodePtr(n_parent, parent, 0);
20791        des_xmlNsPtr(n_ns, ns, 1);
20792        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20793        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20794        xmlResetLastError();
20795        if (mem_base != xmlMemBlocks()) {
20796            printf("Leak of %d blocks found in xmlNewChild",
20797	           xmlMemBlocks() - mem_base);
20798	    test_ret++;
20799            printf(" %d", n_parent);
20800            printf(" %d", n_ns);
20801            printf(" %d", n_name);
20802            printf(" %d", n_content);
20803            printf("\n");
20804        }
20805    }
20806    }
20807    }
20808    }
20809    function_tests++;
20810#endif
20811#endif
20812
20813    return(test_ret);
20814}
20815
20816
20817static int
20818test_xmlNewComment(void) {
20819    int test_ret = 0;
20820
20821    int mem_base;
20822    xmlNodePtr ret_val;
20823    xmlChar * content; /* the comment content */
20824    int n_content;
20825
20826    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20827        mem_base = xmlMemBlocks();
20828        content = gen_const_xmlChar_ptr(n_content, 0);
20829
20830        ret_val = xmlNewComment((const xmlChar *)content);
20831        desret_xmlNodePtr(ret_val);
20832        call_tests++;
20833        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
20834        xmlResetLastError();
20835        if (mem_base != xmlMemBlocks()) {
20836            printf("Leak of %d blocks found in xmlNewComment",
20837	           xmlMemBlocks() - mem_base);
20838	    test_ret++;
20839            printf(" %d", n_content);
20840            printf("\n");
20841        }
20842    }
20843    function_tests++;
20844
20845    return(test_ret);
20846}
20847
20848
20849static int
20850test_xmlNewDoc(void) {
20851    int test_ret = 0;
20852
20853    int mem_base;
20854    xmlDocPtr ret_val;
20855    xmlChar * version; /* xmlChar string giving the version of XML "1.0" */
20856    int n_version;
20857
20858    for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) {
20859        mem_base = xmlMemBlocks();
20860        version = gen_const_xmlChar_ptr(n_version, 0);
20861
20862        ret_val = xmlNewDoc((const xmlChar *)version);
20863        desret_xmlDocPtr(ret_val);
20864        call_tests++;
20865        des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0);
20866        xmlResetLastError();
20867        if (mem_base != xmlMemBlocks()) {
20868            printf("Leak of %d blocks found in xmlNewDoc",
20869	           xmlMemBlocks() - mem_base);
20870	    test_ret++;
20871            printf(" %d", n_version);
20872            printf("\n");
20873        }
20874    }
20875    function_tests++;
20876
20877    return(test_ret);
20878}
20879
20880
20881static int
20882test_xmlNewDocComment(void) {
20883    int test_ret = 0;
20884
20885    int mem_base;
20886    xmlNodePtr ret_val;
20887    xmlDocPtr doc; /* the document */
20888    int n_doc;
20889    xmlChar * content; /* the comment content */
20890    int n_content;
20891
20892    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20893    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20894        mem_base = xmlMemBlocks();
20895        doc = gen_xmlDocPtr(n_doc, 0);
20896        content = gen_const_xmlChar_ptr(n_content, 1);
20897
20898        ret_val = xmlNewDocComment(doc, (const xmlChar *)content);
20899        desret_xmlNodePtr(ret_val);
20900        call_tests++;
20901        des_xmlDocPtr(n_doc, doc, 0);
20902        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
20903        xmlResetLastError();
20904        if (mem_base != xmlMemBlocks()) {
20905            printf("Leak of %d blocks found in xmlNewDocComment",
20906	           xmlMemBlocks() - mem_base);
20907	    test_ret++;
20908            printf(" %d", n_doc);
20909            printf(" %d", n_content);
20910            printf("\n");
20911        }
20912    }
20913    }
20914    function_tests++;
20915
20916    return(test_ret);
20917}
20918
20919
20920static int
20921test_xmlNewDocFragment(void) {
20922    int test_ret = 0;
20923
20924#if defined(LIBXML_TREE_ENABLED)
20925    int mem_base;
20926    xmlNodePtr ret_val;
20927    xmlDocPtr doc; /* the document owning the fragment */
20928    int n_doc;
20929
20930    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20931        mem_base = xmlMemBlocks();
20932        doc = gen_xmlDocPtr(n_doc, 0);
20933
20934        ret_val = xmlNewDocFragment(doc);
20935        desret_xmlNodePtr(ret_val);
20936        call_tests++;
20937        des_xmlDocPtr(n_doc, doc, 0);
20938        xmlResetLastError();
20939        if (mem_base != xmlMemBlocks()) {
20940            printf("Leak of %d blocks found in xmlNewDocFragment",
20941	           xmlMemBlocks() - mem_base);
20942	    test_ret++;
20943            printf(" %d", n_doc);
20944            printf("\n");
20945        }
20946    }
20947    function_tests++;
20948#endif
20949
20950    return(test_ret);
20951}
20952
20953
20954static int
20955test_xmlNewDocNode(void) {
20956    int test_ret = 0;
20957
20958    int mem_base;
20959    xmlNodePtr ret_val;
20960    xmlDocPtr doc; /* the document */
20961    int n_doc;
20962    xmlNsPtr ns; /* namespace if any */
20963    int n_ns;
20964    xmlChar * name; /* the node name */
20965    int n_name;
20966    xmlChar * content; /* the XML text content if any */
20967    int n_content;
20968
20969    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
20970    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
20971    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
20972    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
20973        mem_base = xmlMemBlocks();
20974        doc = gen_xmlDocPtr(n_doc, 0);
20975        ns = gen_xmlNsPtr(n_ns, 1);
20976        name = gen_const_xmlChar_ptr(n_name, 2);
20977        content = gen_const_xmlChar_ptr(n_content, 3);
20978
20979        ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
20980        desret_xmlNodePtr(ret_val);
20981        call_tests++;
20982        des_xmlDocPtr(n_doc, doc, 0);
20983        des_xmlNsPtr(n_ns, ns, 1);
20984        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
20985        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
20986        xmlResetLastError();
20987        if (mem_base != xmlMemBlocks()) {
20988            printf("Leak of %d blocks found in xmlNewDocNode",
20989	           xmlMemBlocks() - mem_base);
20990	    test_ret++;
20991            printf(" %d", n_doc);
20992            printf(" %d", n_ns);
20993            printf(" %d", n_name);
20994            printf(" %d", n_content);
20995            printf("\n");
20996        }
20997    }
20998    }
20999    }
21000    }
21001    function_tests++;
21002
21003    return(test_ret);
21004}
21005
21006
21007static int
21008test_xmlNewDocNodeEatName(void) {
21009    int test_ret = 0;
21010
21011    int mem_base;
21012    xmlNodePtr ret_val;
21013    xmlDocPtr doc; /* the document */
21014    int n_doc;
21015    xmlNsPtr ns; /* namespace if any */
21016    int n_ns;
21017    xmlChar * name; /* the node name */
21018    int n_name;
21019    xmlChar * content; /* the XML text content if any */
21020    int n_content;
21021
21022    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21023    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21024    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21025    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21026        mem_base = xmlMemBlocks();
21027        doc = gen_xmlDocPtr(n_doc, 0);
21028        ns = gen_xmlNsPtr(n_ns, 1);
21029        name = gen_eaten_name(n_name, 2);
21030        content = gen_const_xmlChar_ptr(n_content, 3);
21031
21032        ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content);
21033        desret_xmlNodePtr(ret_val);
21034        call_tests++;
21035        des_xmlDocPtr(n_doc, doc, 0);
21036        des_xmlNsPtr(n_ns, ns, 1);
21037        des_eaten_name(n_name, name, 2);
21038        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21039        xmlResetLastError();
21040        if (mem_base != xmlMemBlocks()) {
21041            printf("Leak of %d blocks found in xmlNewDocNodeEatName",
21042	           xmlMemBlocks() - mem_base);
21043	    test_ret++;
21044            printf(" %d", n_doc);
21045            printf(" %d", n_ns);
21046            printf(" %d", n_name);
21047            printf(" %d", n_content);
21048            printf("\n");
21049        }
21050    }
21051    }
21052    }
21053    }
21054    function_tests++;
21055
21056    return(test_ret);
21057}
21058
21059
21060static int
21061test_xmlNewDocPI(void) {
21062    int test_ret = 0;
21063
21064    int mem_base;
21065    xmlNodePtr ret_val;
21066    xmlDocPtr doc; /* the target document */
21067    int n_doc;
21068    xmlChar * name; /* the processing instruction name */
21069    int n_name;
21070    xmlChar * content; /* the PI content */
21071    int n_content;
21072
21073    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21074    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21075    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21076        mem_base = xmlMemBlocks();
21077        doc = gen_xmlDocPtr(n_doc, 0);
21078        name = gen_const_xmlChar_ptr(n_name, 1);
21079        content = gen_const_xmlChar_ptr(n_content, 2);
21080
21081        ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content);
21082        desret_xmlNodePtr(ret_val);
21083        call_tests++;
21084        des_xmlDocPtr(n_doc, doc, 0);
21085        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21086        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
21087        xmlResetLastError();
21088        if (mem_base != xmlMemBlocks()) {
21089            printf("Leak of %d blocks found in xmlNewDocPI",
21090	           xmlMemBlocks() - mem_base);
21091	    test_ret++;
21092            printf(" %d", n_doc);
21093            printf(" %d", n_name);
21094            printf(" %d", n_content);
21095            printf("\n");
21096        }
21097    }
21098    }
21099    }
21100    function_tests++;
21101
21102    return(test_ret);
21103}
21104
21105
21106static int
21107test_xmlNewDocProp(void) {
21108    int test_ret = 0;
21109
21110    int mem_base;
21111    xmlAttrPtr ret_val;
21112    xmlDocPtr doc; /* the document */
21113    int n_doc;
21114    xmlChar * name; /* the name of the attribute */
21115    int n_name;
21116    xmlChar * value; /* the value of the attribute */
21117    int n_value;
21118
21119    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21120    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21121    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21122        mem_base = xmlMemBlocks();
21123        doc = gen_xmlDocPtr(n_doc, 0);
21124        name = gen_const_xmlChar_ptr(n_name, 1);
21125        value = gen_const_xmlChar_ptr(n_value, 2);
21126
21127        ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value);
21128        desret_xmlAttrPtr(ret_val);
21129        call_tests++;
21130        des_xmlDocPtr(n_doc, doc, 0);
21131        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21132        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21133        xmlResetLastError();
21134        if (mem_base != xmlMemBlocks()) {
21135            printf("Leak of %d blocks found in xmlNewDocProp",
21136	           xmlMemBlocks() - mem_base);
21137	    test_ret++;
21138            printf(" %d", n_doc);
21139            printf(" %d", n_name);
21140            printf(" %d", n_value);
21141            printf("\n");
21142        }
21143    }
21144    }
21145    }
21146    function_tests++;
21147
21148    return(test_ret);
21149}
21150
21151
21152static int
21153test_xmlNewDocRawNode(void) {
21154    int test_ret = 0;
21155
21156#if defined(LIBXML_TREE_ENABLED)
21157#ifdef LIBXML_TREE_ENABLED
21158    int mem_base;
21159    xmlNodePtr ret_val;
21160    xmlDocPtr doc; /* the document */
21161    int n_doc;
21162    xmlNsPtr ns; /* namespace if any */
21163    int n_ns;
21164    xmlChar * name; /* the node name */
21165    int n_name;
21166    xmlChar * content; /* the text content if any */
21167    int n_content;
21168
21169    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21170    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21171    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21172    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21173        mem_base = xmlMemBlocks();
21174        doc = gen_xmlDocPtr(n_doc, 0);
21175        ns = gen_xmlNsPtr(n_ns, 1);
21176        name = gen_const_xmlChar_ptr(n_name, 2);
21177        content = gen_const_xmlChar_ptr(n_content, 3);
21178
21179        ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content);
21180        desret_xmlNodePtr(ret_val);
21181        call_tests++;
21182        des_xmlDocPtr(n_doc, doc, 0);
21183        des_xmlNsPtr(n_ns, ns, 1);
21184        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21185        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21186        xmlResetLastError();
21187        if (mem_base != xmlMemBlocks()) {
21188            printf("Leak of %d blocks found in xmlNewDocRawNode",
21189	           xmlMemBlocks() - mem_base);
21190	    test_ret++;
21191            printf(" %d", n_doc);
21192            printf(" %d", n_ns);
21193            printf(" %d", n_name);
21194            printf(" %d", n_content);
21195            printf("\n");
21196        }
21197    }
21198    }
21199    }
21200    }
21201    function_tests++;
21202#endif
21203#endif
21204
21205    return(test_ret);
21206}
21207
21208
21209static int
21210test_xmlNewDocText(void) {
21211    int test_ret = 0;
21212
21213    int mem_base;
21214    xmlNodePtr ret_val;
21215    xmlDocPtr doc; /* the document */
21216    int n_doc;
21217    xmlChar * content; /* the text content */
21218    int n_content;
21219
21220    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21221    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21222        mem_base = xmlMemBlocks();
21223        doc = gen_xmlDocPtr(n_doc, 0);
21224        content = gen_const_xmlChar_ptr(n_content, 1);
21225
21226        ret_val = xmlNewDocText(doc, (const xmlChar *)content);
21227        desret_xmlNodePtr(ret_val);
21228        call_tests++;
21229        des_xmlDocPtr(n_doc, doc, 0);
21230        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21231        xmlResetLastError();
21232        if (mem_base != xmlMemBlocks()) {
21233            printf("Leak of %d blocks found in xmlNewDocText",
21234	           xmlMemBlocks() - mem_base);
21235	    test_ret++;
21236            printf(" %d", n_doc);
21237            printf(" %d", n_content);
21238            printf("\n");
21239        }
21240    }
21241    }
21242    function_tests++;
21243
21244    return(test_ret);
21245}
21246
21247
21248static int
21249test_xmlNewDocTextLen(void) {
21250    int test_ret = 0;
21251
21252    int mem_base;
21253    xmlNodePtr ret_val;
21254    xmlDocPtr doc; /* the document */
21255    int n_doc;
21256    xmlChar * content; /* the text content */
21257    int n_content;
21258    int len; /* the text len. */
21259    int n_len;
21260
21261    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21262    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21263    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21264        mem_base = xmlMemBlocks();
21265        doc = gen_xmlDocPtr(n_doc, 0);
21266        content = gen_const_xmlChar_ptr(n_content, 1);
21267        len = gen_int(n_len, 2);
21268
21269        ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len);
21270        desret_xmlNodePtr(ret_val);
21271        call_tests++;
21272        des_xmlDocPtr(n_doc, doc, 0);
21273        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21274        des_int(n_len, len, 2);
21275        xmlResetLastError();
21276        if (mem_base != xmlMemBlocks()) {
21277            printf("Leak of %d blocks found in xmlNewDocTextLen",
21278	           xmlMemBlocks() - mem_base);
21279	    test_ret++;
21280            printf(" %d", n_doc);
21281            printf(" %d", n_content);
21282            printf(" %d", n_len);
21283            printf("\n");
21284        }
21285    }
21286    }
21287    }
21288    function_tests++;
21289
21290    return(test_ret);
21291}
21292
21293
21294static int
21295test_xmlNewDtd(void) {
21296    int test_ret = 0;
21297
21298    int mem_base;
21299    xmlDtdPtr ret_val;
21300    xmlDocPtr doc; /* the document pointer */
21301    int n_doc;
21302    xmlChar * name; /* the DTD name */
21303    int n_name;
21304    xmlChar * ExternalID; /* the external ID */
21305    int n_ExternalID;
21306    xmlChar * SystemID; /* the system ID */
21307    int n_SystemID;
21308
21309    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21310    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21311    for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
21312    for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
21313        mem_base = xmlMemBlocks();
21314        doc = gen_xmlDocPtr(n_doc, 0);
21315        name = gen_const_xmlChar_ptr(n_name, 1);
21316        ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2);
21317        SystemID = gen_const_xmlChar_ptr(n_SystemID, 3);
21318
21319        ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID);
21320        desret_xmlDtdPtr(ret_val);
21321        call_tests++;
21322        des_xmlDocPtr(n_doc, doc, 0);
21323        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21324        des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2);
21325        des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3);
21326        xmlResetLastError();
21327        if (mem_base != xmlMemBlocks()) {
21328            printf("Leak of %d blocks found in xmlNewDtd",
21329	           xmlMemBlocks() - mem_base);
21330	    test_ret++;
21331            printf(" %d", n_doc);
21332            printf(" %d", n_name);
21333            printf(" %d", n_ExternalID);
21334            printf(" %d", n_SystemID);
21335            printf("\n");
21336        }
21337    }
21338    }
21339    }
21340    }
21341    function_tests++;
21342
21343    return(test_ret);
21344}
21345
21346
21347static int
21348test_xmlNewNode(void) {
21349    int test_ret = 0;
21350
21351    int mem_base;
21352    xmlNodePtr ret_val;
21353    xmlNsPtr ns; /* namespace if any */
21354    int n_ns;
21355    xmlChar * name; /* the node name */
21356    int n_name;
21357
21358    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21359    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21360        mem_base = xmlMemBlocks();
21361        ns = gen_xmlNsPtr(n_ns, 0);
21362        name = gen_const_xmlChar_ptr(n_name, 1);
21363
21364        ret_val = xmlNewNode(ns, (const xmlChar *)name);
21365        desret_xmlNodePtr(ret_val);
21366        call_tests++;
21367        des_xmlNsPtr(n_ns, ns, 0);
21368        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21369        xmlResetLastError();
21370        if (mem_base != xmlMemBlocks()) {
21371            printf("Leak of %d blocks found in xmlNewNode",
21372	           xmlMemBlocks() - mem_base);
21373	    test_ret++;
21374            printf(" %d", n_ns);
21375            printf(" %d", n_name);
21376            printf("\n");
21377        }
21378    }
21379    }
21380    function_tests++;
21381
21382    return(test_ret);
21383}
21384
21385
21386static int
21387test_xmlNewNodeEatName(void) {
21388    int test_ret = 0;
21389
21390    int mem_base;
21391    xmlNodePtr ret_val;
21392    xmlNsPtr ns; /* namespace if any */
21393    int n_ns;
21394    xmlChar * name; /* the node name */
21395    int n_name;
21396
21397    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21398    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21399        mem_base = xmlMemBlocks();
21400        ns = gen_xmlNsPtr(n_ns, 0);
21401        name = gen_eaten_name(n_name, 1);
21402
21403        ret_val = xmlNewNodeEatName(ns, name);
21404        desret_xmlNodePtr(ret_val);
21405        call_tests++;
21406        des_xmlNsPtr(n_ns, ns, 0);
21407        des_eaten_name(n_name, name, 1);
21408        xmlResetLastError();
21409        if (mem_base != xmlMemBlocks()) {
21410            printf("Leak of %d blocks found in xmlNewNodeEatName",
21411	           xmlMemBlocks() - mem_base);
21412	    test_ret++;
21413            printf(" %d", n_ns);
21414            printf(" %d", n_name);
21415            printf("\n");
21416        }
21417    }
21418    }
21419    function_tests++;
21420
21421    return(test_ret);
21422}
21423
21424
21425static int
21426test_xmlNewNs(void) {
21427    int test_ret = 0;
21428
21429    int mem_base;
21430    xmlNsPtr ret_val;
21431    xmlNodePtr node; /* the element carrying the namespace */
21432    int n_node;
21433    xmlChar * href; /* the URI associated */
21434    int n_href;
21435    xmlChar * prefix; /* the prefix for the namespace */
21436    int n_prefix;
21437
21438    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21439    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
21440    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
21441        mem_base = xmlMemBlocks();
21442        node = gen_xmlNodePtr(n_node, 0);
21443        href = gen_const_xmlChar_ptr(n_href, 1);
21444        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
21445
21446        ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix);
21447        if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);
21448        desret_xmlNsPtr(ret_val);
21449        call_tests++;
21450        des_xmlNodePtr(n_node, node, 0);
21451        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1);
21452        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
21453        xmlResetLastError();
21454        if (mem_base != xmlMemBlocks()) {
21455            printf("Leak of %d blocks found in xmlNewNs",
21456	           xmlMemBlocks() - mem_base);
21457	    test_ret++;
21458            printf(" %d", n_node);
21459            printf(" %d", n_href);
21460            printf(" %d", n_prefix);
21461            printf("\n");
21462        }
21463    }
21464    }
21465    }
21466    function_tests++;
21467
21468    return(test_ret);
21469}
21470
21471
21472static int
21473test_xmlNewNsProp(void) {
21474    int test_ret = 0;
21475
21476    int mem_base;
21477    xmlAttrPtr ret_val;
21478    xmlNodePtr node; /* the holding node */
21479    int n_node;
21480    xmlNsPtr ns; /* the namespace */
21481    int n_ns;
21482    xmlChar * name; /* the name of the attribute */
21483    int n_name;
21484    xmlChar * value; /* the value of the attribute */
21485    int n_value;
21486
21487    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21488    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21489    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21490    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21491        mem_base = xmlMemBlocks();
21492        node = gen_xmlNodePtr(n_node, 0);
21493        ns = gen_xmlNsPtr(n_ns, 1);
21494        name = gen_const_xmlChar_ptr(n_name, 2);
21495        value = gen_const_xmlChar_ptr(n_value, 3);
21496
21497        ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
21498        desret_xmlAttrPtr(ret_val);
21499        call_tests++;
21500        des_xmlNodePtr(n_node, node, 0);
21501        des_xmlNsPtr(n_ns, ns, 1);
21502        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21503        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21504        xmlResetLastError();
21505        if (mem_base != xmlMemBlocks()) {
21506            printf("Leak of %d blocks found in xmlNewNsProp",
21507	           xmlMemBlocks() - mem_base);
21508	    test_ret++;
21509            printf(" %d", n_node);
21510            printf(" %d", n_ns);
21511            printf(" %d", n_name);
21512            printf(" %d", n_value);
21513            printf("\n");
21514        }
21515    }
21516    }
21517    }
21518    }
21519    function_tests++;
21520
21521    return(test_ret);
21522}
21523
21524
21525static int
21526test_xmlNewNsPropEatName(void) {
21527    int test_ret = 0;
21528
21529    int mem_base;
21530    xmlAttrPtr ret_val;
21531    xmlNodePtr node; /* the holding node */
21532    int n_node;
21533    xmlNsPtr ns; /* the namespace */
21534    int n_ns;
21535    xmlChar * name; /* the name of the attribute */
21536    int n_name;
21537    xmlChar * value; /* the value of the attribute */
21538    int n_value;
21539
21540    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21541    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21542    for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) {
21543    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21544        mem_base = xmlMemBlocks();
21545        node = gen_xmlNodePtr(n_node, 0);
21546        ns = gen_xmlNsPtr(n_ns, 1);
21547        name = gen_eaten_name(n_name, 2);
21548        value = gen_const_xmlChar_ptr(n_value, 3);
21549
21550        ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value);
21551        desret_xmlAttrPtr(ret_val);
21552        call_tests++;
21553        des_xmlNodePtr(n_node, node, 0);
21554        des_xmlNsPtr(n_ns, ns, 1);
21555        des_eaten_name(n_name, name, 2);
21556        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
21557        xmlResetLastError();
21558        if (mem_base != xmlMemBlocks()) {
21559            printf("Leak of %d blocks found in xmlNewNsPropEatName",
21560	           xmlMemBlocks() - mem_base);
21561	    test_ret++;
21562            printf(" %d", n_node);
21563            printf(" %d", n_ns);
21564            printf(" %d", n_name);
21565            printf(" %d", n_value);
21566            printf("\n");
21567        }
21568    }
21569    }
21570    }
21571    }
21572    function_tests++;
21573
21574    return(test_ret);
21575}
21576
21577
21578static int
21579test_xmlNewPI(void) {
21580    int test_ret = 0;
21581
21582    int mem_base;
21583    xmlNodePtr ret_val;
21584    xmlChar * name; /* the processing instruction name */
21585    int n_name;
21586    xmlChar * content; /* the PI content */
21587    int n_content;
21588
21589    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21590    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21591        mem_base = xmlMemBlocks();
21592        name = gen_const_xmlChar_ptr(n_name, 0);
21593        content = gen_const_xmlChar_ptr(n_content, 1);
21594
21595        ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content);
21596        desret_xmlNodePtr(ret_val);
21597        call_tests++;
21598        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
21599        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21600        xmlResetLastError();
21601        if (mem_base != xmlMemBlocks()) {
21602            printf("Leak of %d blocks found in xmlNewPI",
21603	           xmlMemBlocks() - mem_base);
21604	    test_ret++;
21605            printf(" %d", n_name);
21606            printf(" %d", n_content);
21607            printf("\n");
21608        }
21609    }
21610    }
21611    function_tests++;
21612
21613    return(test_ret);
21614}
21615
21616
21617static int
21618test_xmlNewProp(void) {
21619    int test_ret = 0;
21620
21621#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
21622#ifdef LIBXML_TREE_ENABLED
21623    int mem_base;
21624    xmlAttrPtr ret_val;
21625    xmlNodePtr node; /* the holding node */
21626    int n_node;
21627    xmlChar * name; /* the name of the attribute */
21628    int n_name;
21629    xmlChar * value; /* the value of the attribute */
21630    int n_value;
21631
21632    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
21633    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21634    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
21635        mem_base = xmlMemBlocks();
21636        node = gen_xmlNodePtr(n_node, 0);
21637        name = gen_const_xmlChar_ptr(n_name, 1);
21638        value = gen_const_xmlChar_ptr(n_value, 2);
21639
21640        ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value);
21641        desret_xmlAttrPtr(ret_val);
21642        call_tests++;
21643        des_xmlNodePtr(n_node, node, 0);
21644        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21645        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
21646        xmlResetLastError();
21647        if (mem_base != xmlMemBlocks()) {
21648            printf("Leak of %d blocks found in xmlNewProp",
21649	           xmlMemBlocks() - mem_base);
21650	    test_ret++;
21651            printf(" %d", n_node);
21652            printf(" %d", n_name);
21653            printf(" %d", n_value);
21654            printf("\n");
21655        }
21656    }
21657    }
21658    }
21659    function_tests++;
21660#endif
21661#endif
21662
21663    return(test_ret);
21664}
21665
21666
21667static int
21668test_xmlNewReference(void) {
21669    int test_ret = 0;
21670
21671    int mem_base;
21672    xmlNodePtr ret_val;
21673    xmlDocPtr doc; /* the document */
21674    int n_doc;
21675    xmlChar * name; /* the reference name, or the reference string with & and ; */
21676    int n_name;
21677
21678    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21679    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21680        mem_base = xmlMemBlocks();
21681        doc = gen_xmlDocPtr(n_doc, 0);
21682        name = gen_const_xmlChar_ptr(n_name, 1);
21683
21684        ret_val = xmlNewReference(doc, (const xmlChar *)name);
21685        desret_xmlNodePtr(ret_val);
21686        call_tests++;
21687        des_xmlDocPtr(n_doc, doc, 0);
21688        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
21689        xmlResetLastError();
21690        if (mem_base != xmlMemBlocks()) {
21691            printf("Leak of %d blocks found in xmlNewReference",
21692	           xmlMemBlocks() - mem_base);
21693	    test_ret++;
21694            printf(" %d", n_doc);
21695            printf(" %d", n_name);
21696            printf("\n");
21697        }
21698    }
21699    }
21700    function_tests++;
21701
21702    return(test_ret);
21703}
21704
21705
21706static int
21707test_xmlNewText(void) {
21708    int test_ret = 0;
21709
21710    int mem_base;
21711    xmlNodePtr ret_val;
21712    xmlChar * content; /* the text content */
21713    int n_content;
21714
21715    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21716        mem_base = xmlMemBlocks();
21717        content = gen_const_xmlChar_ptr(n_content, 0);
21718
21719        ret_val = xmlNewText((const xmlChar *)content);
21720        desret_xmlNodePtr(ret_val);
21721        call_tests++;
21722        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21723        xmlResetLastError();
21724        if (mem_base != xmlMemBlocks()) {
21725            printf("Leak of %d blocks found in xmlNewText",
21726	           xmlMemBlocks() - mem_base);
21727	    test_ret++;
21728            printf(" %d", n_content);
21729            printf("\n");
21730        }
21731    }
21732    function_tests++;
21733
21734    return(test_ret);
21735}
21736
21737
21738static int
21739test_xmlNewTextChild(void) {
21740    int test_ret = 0;
21741
21742#if defined(LIBXML_TREE_ENABLED)
21743#ifdef LIBXML_TREE_ENABLED
21744    int mem_base;
21745    xmlNodePtr ret_val;
21746    xmlNodePtr parent; /* the parent node */
21747    int n_parent;
21748    xmlNsPtr ns; /* a namespace if any */
21749    int n_ns;
21750    xmlChar * name; /* the name of the child */
21751    int n_name;
21752    xmlChar * content; /* the text content of the child if any. */
21753    int n_content;
21754
21755    for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) {
21756    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
21757    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
21758    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21759        mem_base = xmlMemBlocks();
21760        parent = gen_xmlNodePtr(n_parent, 0);
21761        ns = gen_xmlNsPtr(n_ns, 1);
21762        name = gen_const_xmlChar_ptr(n_name, 2);
21763        content = gen_const_xmlChar_ptr(n_content, 3);
21764
21765        ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content);
21766        desret_xmlNodePtr(ret_val);
21767        call_tests++;
21768        des_xmlNodePtr(n_parent, parent, 0);
21769        des_xmlNsPtr(n_ns, ns, 1);
21770        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
21771        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
21772        xmlResetLastError();
21773        if (mem_base != xmlMemBlocks()) {
21774            printf("Leak of %d blocks found in xmlNewTextChild",
21775	           xmlMemBlocks() - mem_base);
21776	    test_ret++;
21777            printf(" %d", n_parent);
21778            printf(" %d", n_ns);
21779            printf(" %d", n_name);
21780            printf(" %d", n_content);
21781            printf("\n");
21782        }
21783    }
21784    }
21785    }
21786    }
21787    function_tests++;
21788#endif
21789#endif
21790
21791    return(test_ret);
21792}
21793
21794
21795static int
21796test_xmlNewTextLen(void) {
21797    int test_ret = 0;
21798
21799    int mem_base;
21800    xmlNodePtr ret_val;
21801    xmlChar * content; /* the text content */
21802    int n_content;
21803    int len; /* the text len. */
21804    int n_len;
21805
21806    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21807    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21808        mem_base = xmlMemBlocks();
21809        content = gen_const_xmlChar_ptr(n_content, 0);
21810        len = gen_int(n_len, 1);
21811
21812        ret_val = xmlNewTextLen((const xmlChar *)content, len);
21813        desret_xmlNodePtr(ret_val);
21814        call_tests++;
21815        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0);
21816        des_int(n_len, len, 1);
21817        xmlResetLastError();
21818        if (mem_base != xmlMemBlocks()) {
21819            printf("Leak of %d blocks found in xmlNewTextLen",
21820	           xmlMemBlocks() - mem_base);
21821	    test_ret++;
21822            printf(" %d", n_content);
21823            printf(" %d", n_len);
21824            printf("\n");
21825        }
21826    }
21827    }
21828    function_tests++;
21829
21830    return(test_ret);
21831}
21832
21833
21834static int
21835test_xmlNodeAddContent(void) {
21836    int test_ret = 0;
21837
21838    int mem_base;
21839    xmlNodePtr cur; /* the node being modified */
21840    int n_cur;
21841    xmlChar * content; /* extra content */
21842    int n_content;
21843
21844    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21845    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21846        mem_base = xmlMemBlocks();
21847        cur = gen_xmlNodePtr(n_cur, 0);
21848        content = gen_const_xmlChar_ptr(n_content, 1);
21849
21850        xmlNodeAddContent(cur, (const xmlChar *)content);
21851        call_tests++;
21852        des_xmlNodePtr(n_cur, cur, 0);
21853        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21854        xmlResetLastError();
21855        if (mem_base != xmlMemBlocks()) {
21856            printf("Leak of %d blocks found in xmlNodeAddContent",
21857	           xmlMemBlocks() - mem_base);
21858	    test_ret++;
21859            printf(" %d", n_cur);
21860            printf(" %d", n_content);
21861            printf("\n");
21862        }
21863    }
21864    }
21865    function_tests++;
21866
21867    return(test_ret);
21868}
21869
21870
21871static int
21872test_xmlNodeAddContentLen(void) {
21873    int test_ret = 0;
21874
21875    int mem_base;
21876    xmlNodePtr cur; /* the node being modified */
21877    int n_cur;
21878    xmlChar * content; /* extra content */
21879    int n_content;
21880    int len; /* the size of @content */
21881    int n_len;
21882
21883    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21884    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
21885    for (n_len = 0;n_len < gen_nb_int;n_len++) {
21886        mem_base = xmlMemBlocks();
21887        cur = gen_xmlNodePtr(n_cur, 0);
21888        content = gen_const_xmlChar_ptr(n_content, 1);
21889        len = gen_int(n_len, 2);
21890
21891        xmlNodeAddContentLen(cur, (const xmlChar *)content, len);
21892        call_tests++;
21893        des_xmlNodePtr(n_cur, cur, 0);
21894        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
21895        des_int(n_len, len, 2);
21896        xmlResetLastError();
21897        if (mem_base != xmlMemBlocks()) {
21898            printf("Leak of %d blocks found in xmlNodeAddContentLen",
21899	           xmlMemBlocks() - mem_base);
21900	    test_ret++;
21901            printf(" %d", n_cur);
21902            printf(" %d", n_content);
21903            printf(" %d", n_len);
21904            printf("\n");
21905        }
21906    }
21907    }
21908    }
21909    function_tests++;
21910
21911    return(test_ret);
21912}
21913
21914
21915static int
21916test_xmlNodeBufGetContent(void) {
21917    int test_ret = 0;
21918
21919    int mem_base;
21920    int ret_val;
21921    xmlBufferPtr buffer; /* a buffer */
21922    int n_buffer;
21923    xmlNodePtr cur; /* the node being read */
21924    int n_cur;
21925
21926    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
21927    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21928        mem_base = xmlMemBlocks();
21929        buffer = gen_xmlBufferPtr(n_buffer, 0);
21930        cur = gen_xmlNodePtr(n_cur, 1);
21931
21932        ret_val = xmlNodeBufGetContent(buffer, cur);
21933        desret_int(ret_val);
21934        call_tests++;
21935        des_xmlBufferPtr(n_buffer, buffer, 0);
21936        des_xmlNodePtr(n_cur, cur, 1);
21937        xmlResetLastError();
21938        if (mem_base != xmlMemBlocks()) {
21939            printf("Leak of %d blocks found in xmlNodeBufGetContent",
21940	           xmlMemBlocks() - mem_base);
21941	    test_ret++;
21942            printf(" %d", n_buffer);
21943            printf(" %d", n_cur);
21944            printf("\n");
21945        }
21946    }
21947    }
21948    function_tests++;
21949
21950    return(test_ret);
21951}
21952
21953
21954static int
21955test_xmlNodeDump(void) {
21956    int test_ret = 0;
21957
21958#if defined(LIBXML_OUTPUT_ENABLED)
21959    int mem_base;
21960    int ret_val;
21961    xmlBufferPtr buf; /* the XML buffer output */
21962    int n_buf;
21963    xmlDocPtr doc; /* the document */
21964    int n_doc;
21965    xmlNodePtr cur; /* the current node */
21966    int n_cur;
21967    int level; /* the imbrication level for indenting */
21968    int n_level;
21969    int format; /* is formatting allowed */
21970    int n_format;
21971
21972    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
21973    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
21974    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
21975    for (n_level = 0;n_level < gen_nb_int;n_level++) {
21976    for (n_format = 0;n_format < gen_nb_int;n_format++) {
21977        mem_base = xmlMemBlocks();
21978        buf = gen_xmlBufferPtr(n_buf, 0);
21979        doc = gen_xmlDocPtr(n_doc, 1);
21980        cur = gen_xmlNodePtr(n_cur, 2);
21981        level = gen_int(n_level, 3);
21982        format = gen_int(n_format, 4);
21983
21984        ret_val = xmlNodeDump(buf, doc, cur, level, format);
21985        desret_int(ret_val);
21986        call_tests++;
21987        des_xmlBufferPtr(n_buf, buf, 0);
21988        des_xmlDocPtr(n_doc, doc, 1);
21989        des_xmlNodePtr(n_cur, cur, 2);
21990        des_int(n_level, level, 3);
21991        des_int(n_format, format, 4);
21992        xmlResetLastError();
21993        if (mem_base != xmlMemBlocks()) {
21994            printf("Leak of %d blocks found in xmlNodeDump",
21995	           xmlMemBlocks() - mem_base);
21996	    test_ret++;
21997            printf(" %d", n_buf);
21998            printf(" %d", n_doc);
21999            printf(" %d", n_cur);
22000            printf(" %d", n_level);
22001            printf(" %d", n_format);
22002            printf("\n");
22003        }
22004    }
22005    }
22006    }
22007    }
22008    }
22009    function_tests++;
22010#endif
22011
22012    return(test_ret);
22013}
22014
22015
22016static int
22017test_xmlNodeDumpOutput(void) {
22018    int test_ret = 0;
22019
22020#if defined(LIBXML_OUTPUT_ENABLED)
22021    int mem_base;
22022    xmlOutputBufferPtr buf; /* the XML buffer output */
22023    int n_buf;
22024    xmlDocPtr doc; /* the document */
22025    int n_doc;
22026    xmlNodePtr cur; /* the current node */
22027    int n_cur;
22028    int level; /* the imbrication level for indenting */
22029    int n_level;
22030    int format; /* is formatting allowed */
22031    int n_format;
22032    char * encoding; /* an optional encoding string */
22033    int n_encoding;
22034
22035    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22036    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22037    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22038    for (n_level = 0;n_level < gen_nb_int;n_level++) {
22039    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22040    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22041        mem_base = xmlMemBlocks();
22042        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22043        doc = gen_xmlDocPtr(n_doc, 1);
22044        cur = gen_xmlNodePtr(n_cur, 2);
22045        level = gen_int(n_level, 3);
22046        format = gen_int(n_format, 4);
22047        encoding = gen_const_char_ptr(n_encoding, 5);
22048
22049        xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding);
22050        call_tests++;
22051        des_xmlOutputBufferPtr(n_buf, buf, 0);
22052        des_xmlDocPtr(n_doc, doc, 1);
22053        des_xmlNodePtr(n_cur, cur, 2);
22054        des_int(n_level, level, 3);
22055        des_int(n_format, format, 4);
22056        des_const_char_ptr(n_encoding, (const char *)encoding, 5);
22057        xmlResetLastError();
22058        if (mem_base != xmlMemBlocks()) {
22059            printf("Leak of %d blocks found in xmlNodeDumpOutput",
22060	           xmlMemBlocks() - mem_base);
22061	    test_ret++;
22062            printf(" %d", n_buf);
22063            printf(" %d", n_doc);
22064            printf(" %d", n_cur);
22065            printf(" %d", n_level);
22066            printf(" %d", n_format);
22067            printf(" %d", n_encoding);
22068            printf("\n");
22069        }
22070    }
22071    }
22072    }
22073    }
22074    }
22075    }
22076    function_tests++;
22077#endif
22078
22079    return(test_ret);
22080}
22081
22082
22083static int
22084test_xmlNodeGetBase(void) {
22085    int test_ret = 0;
22086
22087    int mem_base;
22088    xmlChar * ret_val;
22089    xmlDocPtr doc; /* the document the node pertains to */
22090    int n_doc;
22091    xmlNodePtr cur; /* the node being checked */
22092    int n_cur;
22093
22094    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22095    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22096        mem_base = xmlMemBlocks();
22097        doc = gen_xmlDocPtr(n_doc, 0);
22098        cur = gen_xmlNodePtr(n_cur, 1);
22099
22100        ret_val = xmlNodeGetBase(doc, cur);
22101        desret_xmlChar_ptr(ret_val);
22102        call_tests++;
22103        des_xmlDocPtr(n_doc, doc, 0);
22104        des_xmlNodePtr(n_cur, cur, 1);
22105        xmlResetLastError();
22106        if (mem_base != xmlMemBlocks()) {
22107            printf("Leak of %d blocks found in xmlNodeGetBase",
22108	           xmlMemBlocks() - mem_base);
22109	    test_ret++;
22110            printf(" %d", n_doc);
22111            printf(" %d", n_cur);
22112            printf("\n");
22113        }
22114    }
22115    }
22116    function_tests++;
22117
22118    return(test_ret);
22119}
22120
22121
22122static int
22123test_xmlNodeGetContent(void) {
22124    int test_ret = 0;
22125
22126    int mem_base;
22127    xmlChar * ret_val;
22128    xmlNodePtr cur; /* the node being read */
22129    int n_cur;
22130
22131    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22132        mem_base = xmlMemBlocks();
22133        cur = gen_xmlNodePtr(n_cur, 0);
22134
22135        ret_val = xmlNodeGetContent(cur);
22136        desret_xmlChar_ptr(ret_val);
22137        call_tests++;
22138        des_xmlNodePtr(n_cur, cur, 0);
22139        xmlResetLastError();
22140        if (mem_base != xmlMemBlocks()) {
22141            printf("Leak of %d blocks found in xmlNodeGetContent",
22142	           xmlMemBlocks() - mem_base);
22143	    test_ret++;
22144            printf(" %d", n_cur);
22145            printf("\n");
22146        }
22147    }
22148    function_tests++;
22149
22150    return(test_ret);
22151}
22152
22153
22154static int
22155test_xmlNodeGetLang(void) {
22156    int test_ret = 0;
22157
22158    int mem_base;
22159    xmlChar * ret_val;
22160    xmlNodePtr cur; /* the node being checked */
22161    int n_cur;
22162
22163    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22164        mem_base = xmlMemBlocks();
22165        cur = gen_xmlNodePtr(n_cur, 0);
22166
22167        ret_val = xmlNodeGetLang(cur);
22168        desret_xmlChar_ptr(ret_val);
22169        call_tests++;
22170        des_xmlNodePtr(n_cur, cur, 0);
22171        xmlResetLastError();
22172        if (mem_base != xmlMemBlocks()) {
22173            printf("Leak of %d blocks found in xmlNodeGetLang",
22174	           xmlMemBlocks() - mem_base);
22175	    test_ret++;
22176            printf(" %d", n_cur);
22177            printf("\n");
22178        }
22179    }
22180    function_tests++;
22181
22182    return(test_ret);
22183}
22184
22185
22186static int
22187test_xmlNodeGetSpacePreserve(void) {
22188    int test_ret = 0;
22189
22190    int mem_base;
22191    int ret_val;
22192    xmlNodePtr cur; /* the node being checked */
22193    int n_cur;
22194
22195    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22196        mem_base = xmlMemBlocks();
22197        cur = gen_xmlNodePtr(n_cur, 0);
22198
22199        ret_val = xmlNodeGetSpacePreserve(cur);
22200        desret_int(ret_val);
22201        call_tests++;
22202        des_xmlNodePtr(n_cur, cur, 0);
22203        xmlResetLastError();
22204        if (mem_base != xmlMemBlocks()) {
22205            printf("Leak of %d blocks found in xmlNodeGetSpacePreserve",
22206	           xmlMemBlocks() - mem_base);
22207	    test_ret++;
22208            printf(" %d", n_cur);
22209            printf("\n");
22210        }
22211    }
22212    function_tests++;
22213
22214    return(test_ret);
22215}
22216
22217
22218static int
22219test_xmlNodeIsText(void) {
22220    int test_ret = 0;
22221
22222    int mem_base;
22223    int ret_val;
22224    xmlNodePtr node; /* the node */
22225    int n_node;
22226
22227    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
22228        mem_base = xmlMemBlocks();
22229        node = gen_xmlNodePtr(n_node, 0);
22230
22231        ret_val = xmlNodeIsText(node);
22232        desret_int(ret_val);
22233        call_tests++;
22234        des_xmlNodePtr(n_node, node, 0);
22235        xmlResetLastError();
22236        if (mem_base != xmlMemBlocks()) {
22237            printf("Leak of %d blocks found in xmlNodeIsText",
22238	           xmlMemBlocks() - mem_base);
22239	    test_ret++;
22240            printf(" %d", n_node);
22241            printf("\n");
22242        }
22243    }
22244    function_tests++;
22245
22246    return(test_ret);
22247}
22248
22249
22250static int
22251test_xmlNodeListGetRawString(void) {
22252    int test_ret = 0;
22253
22254#if defined(LIBXML_TREE_ENABLED)
22255    int mem_base;
22256    xmlChar * ret_val;
22257    xmlDocPtr doc; /* the document */
22258    int n_doc;
22259    xmlNodePtr list; /* a Node list */
22260    int n_list;
22261    int inLine; /* should we replace entity contents or show their external form */
22262    int n_inLine;
22263
22264    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22265    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22266    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22267        mem_base = xmlMemBlocks();
22268        doc = gen_xmlDocPtr(n_doc, 0);
22269        list = gen_xmlNodePtr(n_list, 1);
22270        inLine = gen_int(n_inLine, 2);
22271
22272        ret_val = xmlNodeListGetRawString(doc, list, inLine);
22273        desret_xmlChar_ptr(ret_val);
22274        call_tests++;
22275        des_xmlDocPtr(n_doc, doc, 0);
22276        des_xmlNodePtr(n_list, list, 1);
22277        des_int(n_inLine, inLine, 2);
22278        xmlResetLastError();
22279        if (mem_base != xmlMemBlocks()) {
22280            printf("Leak of %d blocks found in xmlNodeListGetRawString",
22281	           xmlMemBlocks() - mem_base);
22282	    test_ret++;
22283            printf(" %d", n_doc);
22284            printf(" %d", n_list);
22285            printf(" %d", n_inLine);
22286            printf("\n");
22287        }
22288    }
22289    }
22290    }
22291    function_tests++;
22292#endif
22293
22294    return(test_ret);
22295}
22296
22297
22298static int
22299test_xmlNodeListGetString(void) {
22300    int test_ret = 0;
22301
22302    int mem_base;
22303    xmlChar * ret_val;
22304    xmlDocPtr doc; /* the document */
22305    int n_doc;
22306    xmlNodePtr list; /* a Node list */
22307    int n_list;
22308    int inLine; /* should we replace entity contents or show their external form */
22309    int n_inLine;
22310
22311    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22312    for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) {
22313    for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) {
22314        mem_base = xmlMemBlocks();
22315        doc = gen_xmlDocPtr(n_doc, 0);
22316        list = gen_xmlNodePtr(n_list, 1);
22317        inLine = gen_int(n_inLine, 2);
22318
22319        ret_val = xmlNodeListGetString(doc, list, inLine);
22320        desret_xmlChar_ptr(ret_val);
22321        call_tests++;
22322        des_xmlDocPtr(n_doc, doc, 0);
22323        des_xmlNodePtr(n_list, list, 1);
22324        des_int(n_inLine, inLine, 2);
22325        xmlResetLastError();
22326        if (mem_base != xmlMemBlocks()) {
22327            printf("Leak of %d blocks found in xmlNodeListGetString",
22328	           xmlMemBlocks() - mem_base);
22329	    test_ret++;
22330            printf(" %d", n_doc);
22331            printf(" %d", n_list);
22332            printf(" %d", n_inLine);
22333            printf("\n");
22334        }
22335    }
22336    }
22337    }
22338    function_tests++;
22339
22340    return(test_ret);
22341}
22342
22343
22344static int
22345test_xmlNodeSetBase(void) {
22346    int test_ret = 0;
22347
22348#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
22349    int mem_base;
22350    xmlNodePtr cur; /* the node being changed */
22351    int n_cur;
22352    xmlChar * uri; /* the new base URI */
22353    int n_uri;
22354
22355    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22356    for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) {
22357        mem_base = xmlMemBlocks();
22358        cur = gen_xmlNodePtr(n_cur, 0);
22359        uri = gen_const_xmlChar_ptr(n_uri, 1);
22360
22361        xmlNodeSetBase(cur, (const xmlChar *)uri);
22362        call_tests++;
22363        des_xmlNodePtr(n_cur, cur, 0);
22364        des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1);
22365        xmlResetLastError();
22366        if (mem_base != xmlMemBlocks()) {
22367            printf("Leak of %d blocks found in xmlNodeSetBase",
22368	           xmlMemBlocks() - mem_base);
22369	    test_ret++;
22370            printf(" %d", n_cur);
22371            printf(" %d", n_uri);
22372            printf("\n");
22373        }
22374    }
22375    }
22376    function_tests++;
22377#endif
22378
22379    return(test_ret);
22380}
22381
22382
22383static int
22384test_xmlNodeSetContent(void) {
22385    int test_ret = 0;
22386
22387    int mem_base;
22388    xmlNodePtr cur; /* the node being modified */
22389    int n_cur;
22390    xmlChar * content; /* the new value of the content */
22391    int n_content;
22392
22393    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22394    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22395        mem_base = xmlMemBlocks();
22396        cur = gen_xmlNodePtr(n_cur, 0);
22397        content = gen_const_xmlChar_ptr(n_content, 1);
22398
22399        xmlNodeSetContent(cur, (const xmlChar *)content);
22400        call_tests++;
22401        des_xmlNodePtr(n_cur, cur, 0);
22402        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22403        xmlResetLastError();
22404        if (mem_base != xmlMemBlocks()) {
22405            printf("Leak of %d blocks found in xmlNodeSetContent",
22406	           xmlMemBlocks() - mem_base);
22407	    test_ret++;
22408            printf(" %d", n_cur);
22409            printf(" %d", n_content);
22410            printf("\n");
22411        }
22412    }
22413    }
22414    function_tests++;
22415
22416    return(test_ret);
22417}
22418
22419
22420static int
22421test_xmlNodeSetContentLen(void) {
22422    int test_ret = 0;
22423
22424#if defined(LIBXML_TREE_ENABLED)
22425    int mem_base;
22426    xmlNodePtr cur; /* the node being modified */
22427    int n_cur;
22428    xmlChar * content; /* the new value of the content */
22429    int n_content;
22430    int len; /* the size of @content */
22431    int n_len;
22432
22433    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22434    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
22435    for (n_len = 0;n_len < gen_nb_int;n_len++) {
22436        mem_base = xmlMemBlocks();
22437        cur = gen_xmlNodePtr(n_cur, 0);
22438        content = gen_const_xmlChar_ptr(n_content, 1);
22439        len = gen_int(n_len, 2);
22440
22441        xmlNodeSetContentLen(cur, (const xmlChar *)content, len);
22442        call_tests++;
22443        des_xmlNodePtr(n_cur, cur, 0);
22444        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
22445        des_int(n_len, len, 2);
22446        xmlResetLastError();
22447        if (mem_base != xmlMemBlocks()) {
22448            printf("Leak of %d blocks found in xmlNodeSetContentLen",
22449	           xmlMemBlocks() - mem_base);
22450	    test_ret++;
22451            printf(" %d", n_cur);
22452            printf(" %d", n_content);
22453            printf(" %d", n_len);
22454            printf("\n");
22455        }
22456    }
22457    }
22458    }
22459    function_tests++;
22460#endif
22461
22462    return(test_ret);
22463}
22464
22465
22466static int
22467test_xmlNodeSetLang(void) {
22468    int test_ret = 0;
22469
22470#if defined(LIBXML_TREE_ENABLED)
22471    int mem_base;
22472    xmlNodePtr cur; /* the node being changed */
22473    int n_cur;
22474    xmlChar * lang; /* the language description */
22475    int n_lang;
22476
22477    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22478    for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) {
22479        mem_base = xmlMemBlocks();
22480        cur = gen_xmlNodePtr(n_cur, 0);
22481        lang = gen_const_xmlChar_ptr(n_lang, 1);
22482
22483        xmlNodeSetLang(cur, (const xmlChar *)lang);
22484        call_tests++;
22485        des_xmlNodePtr(n_cur, cur, 0);
22486        des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1);
22487        xmlResetLastError();
22488        if (mem_base != xmlMemBlocks()) {
22489            printf("Leak of %d blocks found in xmlNodeSetLang",
22490	           xmlMemBlocks() - mem_base);
22491	    test_ret++;
22492            printf(" %d", n_cur);
22493            printf(" %d", n_lang);
22494            printf("\n");
22495        }
22496    }
22497    }
22498    function_tests++;
22499#endif
22500
22501    return(test_ret);
22502}
22503
22504
22505static int
22506test_xmlNodeSetName(void) {
22507    int test_ret = 0;
22508
22509#if defined(LIBXML_TREE_ENABLED)
22510    int mem_base;
22511    xmlNodePtr cur; /* the node being changed */
22512    int n_cur;
22513    xmlChar * name; /* the new tag name */
22514    int n_name;
22515
22516    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22517    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
22518        mem_base = xmlMemBlocks();
22519        cur = gen_xmlNodePtr(n_cur, 0);
22520        name = gen_const_xmlChar_ptr(n_name, 1);
22521
22522        xmlNodeSetName(cur, (const xmlChar *)name);
22523        call_tests++;
22524        des_xmlNodePtr(n_cur, cur, 0);
22525        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
22526        xmlResetLastError();
22527        if (mem_base != xmlMemBlocks()) {
22528            printf("Leak of %d blocks found in xmlNodeSetName",
22529	           xmlMemBlocks() - mem_base);
22530	    test_ret++;
22531            printf(" %d", n_cur);
22532            printf(" %d", n_name);
22533            printf("\n");
22534        }
22535    }
22536    }
22537    function_tests++;
22538#endif
22539
22540    return(test_ret);
22541}
22542
22543
22544static int
22545test_xmlNodeSetSpacePreserve(void) {
22546    int test_ret = 0;
22547
22548#if defined(LIBXML_TREE_ENABLED)
22549    int mem_base;
22550    xmlNodePtr cur; /* the node being changed */
22551    int n_cur;
22552    int val; /* the xml:space value ("0": default, 1: "preserve") */
22553    int n_val;
22554
22555    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
22556    for (n_val = 0;n_val < gen_nb_int;n_val++) {
22557        mem_base = xmlMemBlocks();
22558        cur = gen_xmlNodePtr(n_cur, 0);
22559        val = gen_int(n_val, 1);
22560
22561        xmlNodeSetSpacePreserve(cur, val);
22562        call_tests++;
22563        des_xmlNodePtr(n_cur, cur, 0);
22564        des_int(n_val, val, 1);
22565        xmlResetLastError();
22566        if (mem_base != xmlMemBlocks()) {
22567            printf("Leak of %d blocks found in xmlNodeSetSpacePreserve",
22568	           xmlMemBlocks() - mem_base);
22569	    test_ret++;
22570            printf(" %d", n_cur);
22571            printf(" %d", n_val);
22572            printf("\n");
22573        }
22574    }
22575    }
22576    function_tests++;
22577#endif
22578
22579    return(test_ret);
22580}
22581
22582
22583static int
22584test_xmlReconciliateNs(void) {
22585    int test_ret = 0;
22586
22587#if defined(LIBXML_TREE_ENABLED)
22588#ifdef LIBXML_TREE_ENABLED
22589    int mem_base;
22590    int ret_val;
22591    xmlDocPtr doc; /* the document */
22592    int n_doc;
22593    xmlNodePtr tree; /* a node defining the subtree to reconciliate */
22594    int n_tree;
22595
22596    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
22597    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
22598        mem_base = xmlMemBlocks();
22599        doc = gen_xmlDocPtr(n_doc, 0);
22600        tree = gen_xmlNodePtr(n_tree, 1);
22601
22602        ret_val = xmlReconciliateNs(doc, tree);
22603        desret_int(ret_val);
22604        call_tests++;
22605        des_xmlDocPtr(n_doc, doc, 0);
22606        des_xmlNodePtr(n_tree, tree, 1);
22607        xmlResetLastError();
22608        if (mem_base != xmlMemBlocks()) {
22609            printf("Leak of %d blocks found in xmlReconciliateNs",
22610	           xmlMemBlocks() - mem_base);
22611	    test_ret++;
22612            printf(" %d", n_doc);
22613            printf(" %d", n_tree);
22614            printf("\n");
22615        }
22616    }
22617    }
22618    function_tests++;
22619#endif
22620#endif
22621
22622    return(test_ret);
22623}
22624
22625
22626static int
22627test_xmlRemoveProp(void) {
22628    int test_ret = 0;
22629
22630    int mem_base;
22631    int ret_val;
22632    xmlAttrPtr cur; /* an attribute */
22633    int n_cur;
22634
22635    for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) {
22636        mem_base = xmlMemBlocks();
22637        cur = gen_xmlAttrPtr(n_cur, 0);
22638
22639        ret_val = xmlRemoveProp(cur);
22640        cur = NULL;
22641        desret_int(ret_val);
22642        call_tests++;
22643        des_xmlAttrPtr(n_cur, cur, 0);
22644        xmlResetLastError();
22645        if (mem_base != xmlMemBlocks()) {
22646            printf("Leak of %d blocks found in xmlRemoveProp",
22647	           xmlMemBlocks() - mem_base);
22648	    test_ret++;
22649            printf(" %d", n_cur);
22650            printf("\n");
22651        }
22652    }
22653    function_tests++;
22654
22655    return(test_ret);
22656}
22657
22658
22659static int
22660test_xmlReplaceNode(void) {
22661    int test_ret = 0;
22662
22663#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
22664    int mem_base;
22665    xmlNodePtr ret_val;
22666    xmlNodePtr old; /* the old node */
22667    int n_old;
22668    xmlNodePtr cur; /* the node */
22669    int n_cur;
22670
22671    for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) {
22672    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) {
22673        mem_base = xmlMemBlocks();
22674        old = gen_xmlNodePtr(n_old, 0);
22675        cur = gen_xmlNodePtr_in(n_cur, 1);
22676
22677        ret_val = xmlReplaceNode(old, cur);
22678        if (cur != NULL) {
22679              xmlUnlinkNode(cur);
22680              xmlFreeNode(cur) ; cur = NULL ; }
22681          if (old != NULL) {
22682              xmlUnlinkNode(old);
22683              xmlFreeNode(old) ; old = NULL ; }
22684	  ret_val = NULL;
22685        desret_xmlNodePtr(ret_val);
22686        call_tests++;
22687        des_xmlNodePtr(n_old, old, 0);
22688        des_xmlNodePtr_in(n_cur, cur, 1);
22689        xmlResetLastError();
22690        if (mem_base != xmlMemBlocks()) {
22691            printf("Leak of %d blocks found in xmlReplaceNode",
22692	           xmlMemBlocks() - mem_base);
22693	    test_ret++;
22694            printf(" %d", n_old);
22695            printf(" %d", n_cur);
22696            printf("\n");
22697        }
22698    }
22699    }
22700    function_tests++;
22701#endif
22702
22703    return(test_ret);
22704}
22705
22706
22707static int
22708test_xmlSaveFile(void) {
22709    int test_ret = 0;
22710
22711#if defined(LIBXML_OUTPUT_ENABLED)
22712    int mem_base;
22713    int ret_val;
22714    const char * filename; /* the filename (or URL) */
22715    int n_filename;
22716    xmlDocPtr cur; /* the document */
22717    int n_cur;
22718
22719    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22720    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22721        mem_base = xmlMemBlocks();
22722        filename = gen_fileoutput(n_filename, 0);
22723        cur = gen_xmlDocPtr(n_cur, 1);
22724
22725        ret_val = xmlSaveFile(filename, cur);
22726        desret_int(ret_val);
22727        call_tests++;
22728        des_fileoutput(n_filename, filename, 0);
22729        des_xmlDocPtr(n_cur, cur, 1);
22730        xmlResetLastError();
22731        if (mem_base != xmlMemBlocks()) {
22732            printf("Leak of %d blocks found in xmlSaveFile",
22733	           xmlMemBlocks() - mem_base);
22734	    test_ret++;
22735            printf(" %d", n_filename);
22736            printf(" %d", n_cur);
22737            printf("\n");
22738        }
22739    }
22740    }
22741    function_tests++;
22742#endif
22743
22744    return(test_ret);
22745}
22746
22747
22748static int
22749test_xmlSaveFileEnc(void) {
22750    int test_ret = 0;
22751
22752#if defined(LIBXML_OUTPUT_ENABLED)
22753    int mem_base;
22754    int ret_val;
22755    const char * filename; /* the filename (or URL) */
22756    int n_filename;
22757    xmlDocPtr cur; /* the document */
22758    int n_cur;
22759    char * encoding; /* the name of an encoding (or NULL) */
22760    int n_encoding;
22761
22762    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22763    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22764    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22765        mem_base = xmlMemBlocks();
22766        filename = gen_fileoutput(n_filename, 0);
22767        cur = gen_xmlDocPtr(n_cur, 1);
22768        encoding = gen_const_char_ptr(n_encoding, 2);
22769
22770        ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding);
22771        desret_int(ret_val);
22772        call_tests++;
22773        des_fileoutput(n_filename, filename, 0);
22774        des_xmlDocPtr(n_cur, cur, 1);
22775        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22776        xmlResetLastError();
22777        if (mem_base != xmlMemBlocks()) {
22778            printf("Leak of %d blocks found in xmlSaveFileEnc",
22779	           xmlMemBlocks() - mem_base);
22780	    test_ret++;
22781            printf(" %d", n_filename);
22782            printf(" %d", n_cur);
22783            printf(" %d", n_encoding);
22784            printf("\n");
22785        }
22786    }
22787    }
22788    }
22789    function_tests++;
22790#endif
22791
22792    return(test_ret);
22793}
22794
22795
22796static int
22797test_xmlSaveFileTo(void) {
22798    int test_ret = 0;
22799
22800#if defined(LIBXML_OUTPUT_ENABLED)
22801    int mem_base;
22802    int ret_val;
22803    xmlOutputBufferPtr buf; /* an output I/O buffer */
22804    int n_buf;
22805    xmlDocPtr cur; /* the document */
22806    int n_cur;
22807    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22808    int n_encoding;
22809
22810    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22811    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22812    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22813        mem_base = xmlMemBlocks();
22814        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22815        cur = gen_xmlDocPtr(n_cur, 1);
22816        encoding = gen_const_char_ptr(n_encoding, 2);
22817
22818        ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding);
22819        buf = NULL;
22820        desret_int(ret_val);
22821        call_tests++;
22822        des_xmlOutputBufferPtr(n_buf, buf, 0);
22823        des_xmlDocPtr(n_cur, cur, 1);
22824        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22825        xmlResetLastError();
22826        if (mem_base != xmlMemBlocks()) {
22827            printf("Leak of %d blocks found in xmlSaveFileTo",
22828	           xmlMemBlocks() - mem_base);
22829	    test_ret++;
22830            printf(" %d", n_buf);
22831            printf(" %d", n_cur);
22832            printf(" %d", n_encoding);
22833            printf("\n");
22834        }
22835    }
22836    }
22837    }
22838    function_tests++;
22839#endif
22840
22841    return(test_ret);
22842}
22843
22844
22845static int
22846test_xmlSaveFormatFile(void) {
22847    int test_ret = 0;
22848
22849#if defined(LIBXML_OUTPUT_ENABLED)
22850    int mem_base;
22851    int ret_val;
22852    const char * filename; /* the filename (or URL) */
22853    int n_filename;
22854    xmlDocPtr cur; /* the document */
22855    int n_cur;
22856    int format; /* should formatting spaces been added */
22857    int n_format;
22858
22859    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22860    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22861    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22862        mem_base = xmlMemBlocks();
22863        filename = gen_fileoutput(n_filename, 0);
22864        cur = gen_xmlDocPtr(n_cur, 1);
22865        format = gen_int(n_format, 2);
22866
22867        ret_val = xmlSaveFormatFile(filename, cur, format);
22868        desret_int(ret_val);
22869        call_tests++;
22870        des_fileoutput(n_filename, filename, 0);
22871        des_xmlDocPtr(n_cur, cur, 1);
22872        des_int(n_format, format, 2);
22873        xmlResetLastError();
22874        if (mem_base != xmlMemBlocks()) {
22875            printf("Leak of %d blocks found in xmlSaveFormatFile",
22876	           xmlMemBlocks() - mem_base);
22877	    test_ret++;
22878            printf(" %d", n_filename);
22879            printf(" %d", n_cur);
22880            printf(" %d", n_format);
22881            printf("\n");
22882        }
22883    }
22884    }
22885    }
22886    function_tests++;
22887#endif
22888
22889    return(test_ret);
22890}
22891
22892
22893static int
22894test_xmlSaveFormatFileEnc(void) {
22895    int test_ret = 0;
22896
22897#if defined(LIBXML_OUTPUT_ENABLED)
22898    int mem_base;
22899    int ret_val;
22900    const char * filename; /* the filename or URL to output */
22901    int n_filename;
22902    xmlDocPtr cur; /* the document being saved */
22903    int n_cur;
22904    char * encoding; /* the name of the encoding to use or NULL. */
22905    int n_encoding;
22906    int format; /* should formatting spaces be added. */
22907    int n_format;
22908
22909    for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) {
22910    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22911    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22912    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22913        mem_base = xmlMemBlocks();
22914        filename = gen_fileoutput(n_filename, 0);
22915        cur = gen_xmlDocPtr(n_cur, 1);
22916        encoding = gen_const_char_ptr(n_encoding, 2);
22917        format = gen_int(n_format, 3);
22918
22919        ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format);
22920        desret_int(ret_val);
22921        call_tests++;
22922        des_fileoutput(n_filename, filename, 0);
22923        des_xmlDocPtr(n_cur, cur, 1);
22924        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22925        des_int(n_format, format, 3);
22926        xmlResetLastError();
22927        if (mem_base != xmlMemBlocks()) {
22928            printf("Leak of %d blocks found in xmlSaveFormatFileEnc",
22929	           xmlMemBlocks() - mem_base);
22930	    test_ret++;
22931            printf(" %d", n_filename);
22932            printf(" %d", n_cur);
22933            printf(" %d", n_encoding);
22934            printf(" %d", n_format);
22935            printf("\n");
22936        }
22937    }
22938    }
22939    }
22940    }
22941    function_tests++;
22942#endif
22943
22944    return(test_ret);
22945}
22946
22947
22948static int
22949test_xmlSaveFormatFileTo(void) {
22950    int test_ret = 0;
22951
22952#if defined(LIBXML_OUTPUT_ENABLED)
22953    int mem_base;
22954    int ret_val;
22955    xmlOutputBufferPtr buf; /* an output I/O buffer */
22956    int n_buf;
22957    xmlDocPtr cur; /* the document */
22958    int n_cur;
22959    char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */
22960    int n_encoding;
22961    int format; /* should formatting spaces been added */
22962    int n_format;
22963
22964    for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
22965    for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) {
22966    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
22967    for (n_format = 0;n_format < gen_nb_int;n_format++) {
22968        mem_base = xmlMemBlocks();
22969        buf = gen_xmlOutputBufferPtr(n_buf, 0);
22970        cur = gen_xmlDocPtr(n_cur, 1);
22971        encoding = gen_const_char_ptr(n_encoding, 2);
22972        format = gen_int(n_format, 3);
22973
22974        ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format);
22975        buf = NULL;
22976        desret_int(ret_val);
22977        call_tests++;
22978        des_xmlOutputBufferPtr(n_buf, buf, 0);
22979        des_xmlDocPtr(n_cur, cur, 1);
22980        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
22981        des_int(n_format, format, 3);
22982        xmlResetLastError();
22983        if (mem_base != xmlMemBlocks()) {
22984            printf("Leak of %d blocks found in xmlSaveFormatFileTo",
22985	           xmlMemBlocks() - mem_base);
22986	    test_ret++;
22987            printf(" %d", n_buf);
22988            printf(" %d", n_cur);
22989            printf(" %d", n_encoding);
22990            printf(" %d", n_format);
22991            printf("\n");
22992        }
22993    }
22994    }
22995    }
22996    }
22997    function_tests++;
22998#endif
22999
23000    return(test_ret);
23001}
23002
23003
23004static int
23005test_xmlSearchNs(void) {
23006    int test_ret = 0;
23007
23008    int mem_base;
23009    xmlNsPtr ret_val;
23010    xmlDocPtr doc; /* the document */
23011    int n_doc;
23012    xmlNodePtr node; /* the current node */
23013    int n_node;
23014    xmlChar * nameSpace; /* the namespace prefix */
23015    int n_nameSpace;
23016
23017    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23018    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23019    for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) {
23020        mem_base = xmlMemBlocks();
23021        doc = gen_xmlDocPtr(n_doc, 0);
23022        node = gen_xmlNodePtr(n_node, 1);
23023        nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2);
23024
23025        ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace);
23026        desret_xmlNsPtr(ret_val);
23027        call_tests++;
23028        des_xmlDocPtr(n_doc, doc, 0);
23029        des_xmlNodePtr(n_node, node, 1);
23030        des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2);
23031        xmlResetLastError();
23032        if (mem_base != xmlMemBlocks()) {
23033            printf("Leak of %d blocks found in xmlSearchNs",
23034	           xmlMemBlocks() - mem_base);
23035	    test_ret++;
23036            printf(" %d", n_doc);
23037            printf(" %d", n_node);
23038            printf(" %d", n_nameSpace);
23039            printf("\n");
23040        }
23041    }
23042    }
23043    }
23044    function_tests++;
23045
23046    return(test_ret);
23047}
23048
23049
23050static int
23051test_xmlSearchNsByHref(void) {
23052    int test_ret = 0;
23053
23054    int mem_base;
23055    xmlNsPtr ret_val;
23056    xmlDocPtr doc; /* the document */
23057    int n_doc;
23058    xmlNodePtr node; /* the current node */
23059    int n_node;
23060    xmlChar * href; /* the namespace value */
23061    int n_href;
23062
23063    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23064    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23065    for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) {
23066        mem_base = xmlMemBlocks();
23067        doc = gen_xmlDocPtr(n_doc, 0);
23068        node = gen_xmlNodePtr(n_node, 1);
23069        href = gen_const_xmlChar_ptr(n_href, 2);
23070
23071        ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href);
23072        desret_xmlNsPtr(ret_val);
23073        call_tests++;
23074        des_xmlDocPtr(n_doc, doc, 0);
23075        des_xmlNodePtr(n_node, node, 1);
23076        des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2);
23077        xmlResetLastError();
23078        if (mem_base != xmlMemBlocks()) {
23079            printf("Leak of %d blocks found in xmlSearchNsByHref",
23080	           xmlMemBlocks() - mem_base);
23081	    test_ret++;
23082            printf(" %d", n_doc);
23083            printf(" %d", n_node);
23084            printf(" %d", n_href);
23085            printf("\n");
23086        }
23087    }
23088    }
23089    }
23090    function_tests++;
23091
23092    return(test_ret);
23093}
23094
23095
23096static int
23097test_xmlSetBufferAllocationScheme(void) {
23098    int test_ret = 0;
23099
23100    int mem_base;
23101    xmlBufferAllocationScheme scheme; /* allocation method to use */
23102    int n_scheme;
23103
23104    for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) {
23105        mem_base = xmlMemBlocks();
23106        scheme = gen_xmlBufferAllocationScheme(n_scheme, 0);
23107
23108        xmlSetBufferAllocationScheme(scheme);
23109        call_tests++;
23110        des_xmlBufferAllocationScheme(n_scheme, scheme, 0);
23111        xmlResetLastError();
23112        if (mem_base != xmlMemBlocks()) {
23113            printf("Leak of %d blocks found in xmlSetBufferAllocationScheme",
23114	           xmlMemBlocks() - mem_base);
23115	    test_ret++;
23116            printf(" %d", n_scheme);
23117            printf("\n");
23118        }
23119    }
23120    function_tests++;
23121
23122    return(test_ret);
23123}
23124
23125
23126static int
23127test_xmlSetCompressMode(void) {
23128    int test_ret = 0;
23129
23130    int mem_base;
23131    int mode; /* the compression ratio */
23132    int n_mode;
23133
23134    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23135        mem_base = xmlMemBlocks();
23136        mode = gen_int(n_mode, 0);
23137
23138        xmlSetCompressMode(mode);
23139        call_tests++;
23140        des_int(n_mode, mode, 0);
23141        xmlResetLastError();
23142        if (mem_base != xmlMemBlocks()) {
23143            printf("Leak of %d blocks found in xmlSetCompressMode",
23144	           xmlMemBlocks() - mem_base);
23145	    test_ret++;
23146            printf(" %d", n_mode);
23147            printf("\n");
23148        }
23149    }
23150    function_tests++;
23151
23152    return(test_ret);
23153}
23154
23155
23156static int
23157test_xmlSetDocCompressMode(void) {
23158    int test_ret = 0;
23159
23160    int mem_base;
23161    xmlDocPtr doc; /* the document */
23162    int n_doc;
23163    int mode; /* the compression ratio */
23164    int n_mode;
23165
23166    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23167    for (n_mode = 0;n_mode < gen_nb_int;n_mode++) {
23168        mem_base = xmlMemBlocks();
23169        doc = gen_xmlDocPtr(n_doc, 0);
23170        mode = gen_int(n_mode, 1);
23171
23172        xmlSetDocCompressMode(doc, mode);
23173        call_tests++;
23174        des_xmlDocPtr(n_doc, doc, 0);
23175        des_int(n_mode, mode, 1);
23176        xmlResetLastError();
23177        if (mem_base != xmlMemBlocks()) {
23178            printf("Leak of %d blocks found in xmlSetDocCompressMode",
23179	           xmlMemBlocks() - mem_base);
23180	    test_ret++;
23181            printf(" %d", n_doc);
23182            printf(" %d", n_mode);
23183            printf("\n");
23184        }
23185    }
23186    }
23187    function_tests++;
23188
23189    return(test_ret);
23190}
23191
23192
23193static int
23194test_xmlSetNs(void) {
23195    int test_ret = 0;
23196
23197    int mem_base;
23198    xmlNodePtr node; /* a node in the document */
23199    int n_node;
23200    xmlNsPtr ns; /* a namespace pointer */
23201    int n_ns;
23202
23203    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23204    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23205        mem_base = xmlMemBlocks();
23206        node = gen_xmlNodePtr(n_node, 0);
23207        ns = gen_xmlNsPtr(n_ns, 1);
23208
23209        xmlSetNs(node, ns);
23210        call_tests++;
23211        des_xmlNodePtr(n_node, node, 0);
23212        des_xmlNsPtr(n_ns, ns, 1);
23213        xmlResetLastError();
23214        if (mem_base != xmlMemBlocks()) {
23215            printf("Leak of %d blocks found in xmlSetNs",
23216	           xmlMemBlocks() - mem_base);
23217	    test_ret++;
23218            printf(" %d", n_node);
23219            printf(" %d", n_ns);
23220            printf("\n");
23221        }
23222    }
23223    }
23224    function_tests++;
23225
23226    return(test_ret);
23227}
23228
23229
23230static int
23231test_xmlSetNsProp(void) {
23232    int test_ret = 0;
23233
23234#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23235    int mem_base;
23236    xmlAttrPtr ret_val;
23237    xmlNodePtr node; /* the node */
23238    int n_node;
23239    xmlNsPtr ns; /* the namespace definition */
23240    int n_ns;
23241    xmlChar * name; /* the attribute name */
23242    int n_name;
23243    xmlChar * value; /* the attribute value */
23244    int n_value;
23245
23246    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23247    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23248    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23249    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23250        mem_base = xmlMemBlocks();
23251        node = gen_xmlNodePtr(n_node, 0);
23252        ns = gen_xmlNsPtr(n_ns, 1);
23253        name = gen_const_xmlChar_ptr(n_name, 2);
23254        value = gen_const_xmlChar_ptr(n_value, 3);
23255
23256        ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value);
23257        desret_xmlAttrPtr(ret_val);
23258        call_tests++;
23259        des_xmlNodePtr(n_node, node, 0);
23260        des_xmlNsPtr(n_ns, ns, 1);
23261        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23262        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
23263        xmlResetLastError();
23264        if (mem_base != xmlMemBlocks()) {
23265            printf("Leak of %d blocks found in xmlSetNsProp",
23266	           xmlMemBlocks() - mem_base);
23267	    test_ret++;
23268            printf(" %d", n_node);
23269            printf(" %d", n_ns);
23270            printf(" %d", n_name);
23271            printf(" %d", n_value);
23272            printf("\n");
23273        }
23274    }
23275    }
23276    }
23277    }
23278    function_tests++;
23279#endif
23280
23281    return(test_ret);
23282}
23283
23284
23285static int
23286test_xmlSetProp(void) {
23287    int test_ret = 0;
23288
23289#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
23290    int mem_base;
23291    xmlAttrPtr ret_val;
23292    xmlNodePtr node; /* the node */
23293    int n_node;
23294    xmlChar * name; /* the attribute name (a QName) */
23295    int n_name;
23296    xmlChar * value; /* the attribute value */
23297    int n_value;
23298
23299    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23300    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23301    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23302        mem_base = xmlMemBlocks();
23303        node = gen_xmlNodePtr(n_node, 0);
23304        name = gen_const_xmlChar_ptr(n_name, 1);
23305        value = gen_const_xmlChar_ptr(n_value, 2);
23306
23307        ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value);
23308        desret_xmlAttrPtr(ret_val);
23309        call_tests++;
23310        des_xmlNodePtr(n_node, node, 0);
23311        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23312        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
23313        xmlResetLastError();
23314        if (mem_base != xmlMemBlocks()) {
23315            printf("Leak of %d blocks found in xmlSetProp",
23316	           xmlMemBlocks() - mem_base);
23317	    test_ret++;
23318            printf(" %d", n_node);
23319            printf(" %d", n_name);
23320            printf(" %d", n_value);
23321            printf("\n");
23322        }
23323    }
23324    }
23325    }
23326    function_tests++;
23327#endif
23328
23329    return(test_ret);
23330}
23331
23332
23333static int
23334test_xmlSplitQName2(void) {
23335    int test_ret = 0;
23336
23337    int mem_base;
23338    xmlChar * ret_val;
23339    xmlChar * name; /* the full QName */
23340    int n_name;
23341    xmlChar ** prefix; /* a xmlChar ** */
23342    int n_prefix;
23343
23344    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23345    for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) {
23346        mem_base = xmlMemBlocks();
23347        name = gen_const_xmlChar_ptr(n_name, 0);
23348        prefix = gen_xmlChar_ptr_ptr(n_prefix, 1);
23349
23350        ret_val = xmlSplitQName2((const xmlChar *)name, prefix);
23351        desret_xmlChar_ptr(ret_val);
23352        call_tests++;
23353        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23354        des_xmlChar_ptr_ptr(n_prefix, prefix, 1);
23355        xmlResetLastError();
23356        if (mem_base != xmlMemBlocks()) {
23357            printf("Leak of %d blocks found in xmlSplitQName2",
23358	           xmlMemBlocks() - mem_base);
23359	    test_ret++;
23360            printf(" %d", n_name);
23361            printf(" %d", n_prefix);
23362            printf("\n");
23363        }
23364    }
23365    }
23366    function_tests++;
23367
23368    return(test_ret);
23369}
23370
23371
23372static int
23373test_xmlSplitQName3(void) {
23374    int test_ret = 0;
23375
23376    int mem_base;
23377    const xmlChar * ret_val;
23378    xmlChar * name; /* the full QName */
23379    int n_name;
23380    int * len; /* an int * */
23381    int n_len;
23382
23383    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23384    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
23385        mem_base = xmlMemBlocks();
23386        name = gen_const_xmlChar_ptr(n_name, 0);
23387        len = gen_int_ptr(n_len, 1);
23388
23389        ret_val = xmlSplitQName3((const xmlChar *)name, len);
23390        desret_const_xmlChar_ptr(ret_val);
23391        call_tests++;
23392        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
23393        des_int_ptr(n_len, len, 1);
23394        xmlResetLastError();
23395        if (mem_base != xmlMemBlocks()) {
23396            printf("Leak of %d blocks found in xmlSplitQName3",
23397	           xmlMemBlocks() - mem_base);
23398	    test_ret++;
23399            printf(" %d", n_name);
23400            printf(" %d", n_len);
23401            printf("\n");
23402        }
23403    }
23404    }
23405    function_tests++;
23406
23407    return(test_ret);
23408}
23409
23410
23411static int
23412test_xmlStringGetNodeList(void) {
23413    int test_ret = 0;
23414
23415    int mem_base;
23416    xmlNodePtr ret_val;
23417    xmlDocPtr doc; /* the document */
23418    int n_doc;
23419    xmlChar * value; /* the value of the attribute */
23420    int n_value;
23421
23422    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23423    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23424        mem_base = xmlMemBlocks();
23425        doc = gen_xmlDocPtr(n_doc, 0);
23426        value = gen_const_xmlChar_ptr(n_value, 1);
23427
23428        ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value);
23429        desret_xmlNodePtr(ret_val);
23430        call_tests++;
23431        des_xmlDocPtr(n_doc, doc, 0);
23432        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23433        xmlResetLastError();
23434        if (mem_base != xmlMemBlocks()) {
23435            printf("Leak of %d blocks found in xmlStringGetNodeList",
23436	           xmlMemBlocks() - mem_base);
23437	    test_ret++;
23438            printf(" %d", n_doc);
23439            printf(" %d", n_value);
23440            printf("\n");
23441        }
23442    }
23443    }
23444    function_tests++;
23445
23446    return(test_ret);
23447}
23448
23449
23450static int
23451test_xmlStringLenGetNodeList(void) {
23452    int test_ret = 0;
23453
23454    int mem_base;
23455    xmlNodePtr ret_val;
23456    xmlDocPtr doc; /* the document */
23457    int n_doc;
23458    xmlChar * value; /* the value of the text */
23459    int n_value;
23460    int len; /* the length of the string value */
23461    int n_len;
23462
23463    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
23464    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23465    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23466        mem_base = xmlMemBlocks();
23467        doc = gen_xmlDocPtr(n_doc, 0);
23468        value = gen_const_xmlChar_ptr(n_value, 1);
23469        len = gen_int(n_len, 2);
23470
23471        ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len);
23472        desret_xmlNodePtr(ret_val);
23473        call_tests++;
23474        des_xmlDocPtr(n_doc, doc, 0);
23475        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
23476        des_int(n_len, len, 2);
23477        xmlResetLastError();
23478        if (mem_base != xmlMemBlocks()) {
23479            printf("Leak of %d blocks found in xmlStringLenGetNodeList",
23480	           xmlMemBlocks() - mem_base);
23481	    test_ret++;
23482            printf(" %d", n_doc);
23483            printf(" %d", n_value);
23484            printf(" %d", n_len);
23485            printf("\n");
23486        }
23487    }
23488    }
23489    }
23490    function_tests++;
23491
23492    return(test_ret);
23493}
23494
23495
23496static int
23497test_xmlTextConcat(void) {
23498    int test_ret = 0;
23499
23500    int mem_base;
23501    int ret_val;
23502    xmlNodePtr node; /* the node */
23503    int n_node;
23504    xmlChar * content; /* the content */
23505    int n_content;
23506    int len; /* @content length */
23507    int n_len;
23508
23509    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23510    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
23511    for (n_len = 0;n_len < gen_nb_int;n_len++) {
23512        mem_base = xmlMemBlocks();
23513        node = gen_xmlNodePtr(n_node, 0);
23514        content = gen_const_xmlChar_ptr(n_content, 1);
23515        len = gen_int(n_len, 2);
23516
23517        ret_val = xmlTextConcat(node, (const xmlChar *)content, len);
23518        desret_int(ret_val);
23519        call_tests++;
23520        des_xmlNodePtr(n_node, node, 0);
23521        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
23522        des_int(n_len, len, 2);
23523        xmlResetLastError();
23524        if (mem_base != xmlMemBlocks()) {
23525            printf("Leak of %d blocks found in xmlTextConcat",
23526	           xmlMemBlocks() - mem_base);
23527	    test_ret++;
23528            printf(" %d", n_node);
23529            printf(" %d", n_content);
23530            printf(" %d", n_len);
23531            printf("\n");
23532        }
23533    }
23534    }
23535    }
23536    function_tests++;
23537
23538    return(test_ret);
23539}
23540
23541
23542static int
23543test_xmlTextMerge(void) {
23544    int test_ret = 0;
23545
23546    int mem_base;
23547    xmlNodePtr ret_val;
23548    xmlNodePtr first; /* the first text node */
23549    int n_first;
23550    xmlNodePtr second; /* the second text node being merged */
23551    int n_second;
23552
23553    for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) {
23554    for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) {
23555        mem_base = xmlMemBlocks();
23556        first = gen_xmlNodePtr_in(n_first, 0);
23557        second = gen_xmlNodePtr_in(n_second, 1);
23558
23559        ret_val = xmlTextMerge(first, second);
23560        if ((first != NULL) && (first->type != XML_TEXT_NODE)) {
23561              xmlUnlinkNode(second);
23562              xmlFreeNode(second) ; second = NULL ; }
23563        desret_xmlNodePtr(ret_val);
23564        call_tests++;
23565        des_xmlNodePtr_in(n_first, first, 0);
23566        des_xmlNodePtr_in(n_second, second, 1);
23567        xmlResetLastError();
23568        if (mem_base != xmlMemBlocks()) {
23569            printf("Leak of %d blocks found in xmlTextMerge",
23570	           xmlMemBlocks() - mem_base);
23571	    test_ret++;
23572            printf(" %d", n_first);
23573            printf(" %d", n_second);
23574            printf("\n");
23575        }
23576    }
23577    }
23578    function_tests++;
23579
23580    return(test_ret);
23581}
23582
23583
23584static int
23585test_xmlUnsetNsProp(void) {
23586    int test_ret = 0;
23587
23588#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23589    int mem_base;
23590    int ret_val;
23591    xmlNodePtr node; /* the node */
23592    int n_node;
23593    xmlNsPtr ns; /* the namespace definition */
23594    int n_ns;
23595    xmlChar * name; /* the attribute name */
23596    int n_name;
23597
23598    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23599    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
23600    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23601        mem_base = xmlMemBlocks();
23602        node = gen_xmlNodePtr(n_node, 0);
23603        ns = gen_xmlNsPtr(n_ns, 1);
23604        name = gen_const_xmlChar_ptr(n_name, 2);
23605
23606        ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name);
23607        desret_int(ret_val);
23608        call_tests++;
23609        des_xmlNodePtr(n_node, node, 0);
23610        des_xmlNsPtr(n_ns, ns, 1);
23611        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
23612        xmlResetLastError();
23613        if (mem_base != xmlMemBlocks()) {
23614            printf("Leak of %d blocks found in xmlUnsetNsProp",
23615	           xmlMemBlocks() - mem_base);
23616	    test_ret++;
23617            printf(" %d", n_node);
23618            printf(" %d", n_ns);
23619            printf(" %d", n_name);
23620            printf("\n");
23621        }
23622    }
23623    }
23624    }
23625    function_tests++;
23626#endif
23627
23628    return(test_ret);
23629}
23630
23631
23632static int
23633test_xmlUnsetProp(void) {
23634    int test_ret = 0;
23635
23636#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23637    int mem_base;
23638    int ret_val;
23639    xmlNodePtr node; /* the node */
23640    int n_node;
23641    xmlChar * name; /* the attribute name */
23642    int n_name;
23643
23644    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
23645    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
23646        mem_base = xmlMemBlocks();
23647        node = gen_xmlNodePtr(n_node, 0);
23648        name = gen_const_xmlChar_ptr(n_name, 1);
23649
23650        ret_val = xmlUnsetProp(node, (const xmlChar *)name);
23651        desret_int(ret_val);
23652        call_tests++;
23653        des_xmlNodePtr(n_node, node, 0);
23654        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
23655        xmlResetLastError();
23656        if (mem_base != xmlMemBlocks()) {
23657            printf("Leak of %d blocks found in xmlUnsetProp",
23658	           xmlMemBlocks() - mem_base);
23659	    test_ret++;
23660            printf(" %d", n_node);
23661            printf(" %d", n_name);
23662            printf("\n");
23663        }
23664    }
23665    }
23666    function_tests++;
23667#endif
23668
23669    return(test_ret);
23670}
23671
23672
23673static int
23674test_xmlValidateNCName(void) {
23675    int test_ret = 0;
23676
23677#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)
23678#ifdef LIBXML_TREE_ENABLED
23679    int mem_base;
23680    int ret_val;
23681    xmlChar * value; /* the value to check */
23682    int n_value;
23683    int space; /* allow spaces in front and end of the string */
23684    int n_space;
23685
23686    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23687    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23688        mem_base = xmlMemBlocks();
23689        value = gen_const_xmlChar_ptr(n_value, 0);
23690        space = gen_int(n_space, 1);
23691
23692        ret_val = xmlValidateNCName((const xmlChar *)value, space);
23693        desret_int(ret_val);
23694        call_tests++;
23695        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23696        des_int(n_space, space, 1);
23697        xmlResetLastError();
23698        if (mem_base != xmlMemBlocks()) {
23699            printf("Leak of %d blocks found in xmlValidateNCName",
23700	           xmlMemBlocks() - mem_base);
23701	    test_ret++;
23702            printf(" %d", n_value);
23703            printf(" %d", n_space);
23704            printf("\n");
23705        }
23706    }
23707    }
23708    function_tests++;
23709#endif
23710#endif
23711
23712    return(test_ret);
23713}
23714
23715
23716static int
23717test_xmlValidateNMToken(void) {
23718    int test_ret = 0;
23719
23720#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23721#ifdef LIBXML_TREE_ENABLED
23722    int mem_base;
23723    int ret_val;
23724    xmlChar * value; /* the value to check */
23725    int n_value;
23726    int space; /* allow spaces in front and end of the string */
23727    int n_space;
23728
23729    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23730    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23731        mem_base = xmlMemBlocks();
23732        value = gen_const_xmlChar_ptr(n_value, 0);
23733        space = gen_int(n_space, 1);
23734
23735        ret_val = xmlValidateNMToken((const xmlChar *)value, space);
23736        desret_int(ret_val);
23737        call_tests++;
23738        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23739        des_int(n_space, space, 1);
23740        xmlResetLastError();
23741        if (mem_base != xmlMemBlocks()) {
23742            printf("Leak of %d blocks found in xmlValidateNMToken",
23743	           xmlMemBlocks() - mem_base);
23744	    test_ret++;
23745            printf(" %d", n_value);
23746            printf(" %d", n_space);
23747            printf("\n");
23748        }
23749    }
23750    }
23751    function_tests++;
23752#endif
23753#endif
23754
23755    return(test_ret);
23756}
23757
23758
23759static int
23760test_xmlValidateName(void) {
23761    int test_ret = 0;
23762
23763#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23764#ifdef LIBXML_TREE_ENABLED
23765    int mem_base;
23766    int ret_val;
23767    xmlChar * value; /* the value to check */
23768    int n_value;
23769    int space; /* allow spaces in front and end of the string */
23770    int n_space;
23771
23772    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23773    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23774        mem_base = xmlMemBlocks();
23775        value = gen_const_xmlChar_ptr(n_value, 0);
23776        space = gen_int(n_space, 1);
23777
23778        ret_val = xmlValidateName((const xmlChar *)value, space);
23779        desret_int(ret_val);
23780        call_tests++;
23781        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23782        des_int(n_space, space, 1);
23783        xmlResetLastError();
23784        if (mem_base != xmlMemBlocks()) {
23785            printf("Leak of %d blocks found in xmlValidateName",
23786	           xmlMemBlocks() - mem_base);
23787	    test_ret++;
23788            printf(" %d", n_value);
23789            printf(" %d", n_space);
23790            printf("\n");
23791        }
23792    }
23793    }
23794    function_tests++;
23795#endif
23796#endif
23797
23798    return(test_ret);
23799}
23800
23801
23802static int
23803test_xmlValidateQName(void) {
23804    int test_ret = 0;
23805
23806#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
23807#ifdef LIBXML_TREE_ENABLED
23808    int mem_base;
23809    int ret_val;
23810    xmlChar * value; /* the value to check */
23811    int n_value;
23812    int space; /* allow spaces in front and end of the string */
23813    int n_space;
23814
23815    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
23816    for (n_space = 0;n_space < gen_nb_int;n_space++) {
23817        mem_base = xmlMemBlocks();
23818        value = gen_const_xmlChar_ptr(n_value, 0);
23819        space = gen_int(n_space, 1);
23820
23821        ret_val = xmlValidateQName((const xmlChar *)value, space);
23822        desret_int(ret_val);
23823        call_tests++;
23824        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
23825        des_int(n_space, space, 1);
23826        xmlResetLastError();
23827        if (mem_base != xmlMemBlocks()) {
23828            printf("Leak of %d blocks found in xmlValidateQName",
23829	           xmlMemBlocks() - mem_base);
23830	    test_ret++;
23831            printf(" %d", n_value);
23832            printf(" %d", n_space);
23833            printf("\n");
23834        }
23835    }
23836    }
23837    function_tests++;
23838#endif
23839#endif
23840
23841    return(test_ret);
23842}
23843
23844static int
23845test_tree(void) {
23846    int test_ret = 0;
23847
23848    if (quiet == 0) printf("Testing tree : 133 of 152 functions ...\n");
23849    test_ret += test_xmlAddChild();
23850    test_ret += test_xmlAddChildList();
23851    test_ret += test_xmlAddNextSibling();
23852    test_ret += test_xmlAddPrevSibling();
23853    test_ret += test_xmlAddSibling();
23854    test_ret += test_xmlAttrSerializeTxtContent();
23855    test_ret += test_xmlBufferAdd();
23856    test_ret += test_xmlBufferAddHead();
23857    test_ret += test_xmlBufferCCat();
23858    test_ret += test_xmlBufferCat();
23859    test_ret += test_xmlBufferContent();
23860    test_ret += test_xmlBufferCreate();
23861    test_ret += test_xmlBufferCreateSize();
23862    test_ret += test_xmlBufferCreateStatic();
23863    test_ret += test_xmlBufferEmpty();
23864    test_ret += test_xmlBufferGrow();
23865    test_ret += test_xmlBufferLength();
23866    test_ret += test_xmlBufferResize();
23867    test_ret += test_xmlBufferSetAllocationScheme();
23868    test_ret += test_xmlBufferShrink();
23869    test_ret += test_xmlBufferWriteCHAR();
23870    test_ret += test_xmlBufferWriteChar();
23871    test_ret += test_xmlBufferWriteQuotedString();
23872    test_ret += test_xmlBuildQName();
23873    test_ret += test_xmlCopyDoc();
23874    test_ret += test_xmlCopyDtd();
23875    test_ret += test_xmlCopyNamespace();
23876    test_ret += test_xmlCopyNamespaceList();
23877    test_ret += test_xmlCopyNode();
23878    test_ret += test_xmlCopyNodeList();
23879    test_ret += test_xmlCopyProp();
23880    test_ret += test_xmlCopyPropList();
23881    test_ret += test_xmlCreateIntSubset();
23882    test_ret += test_xmlDOMWrapAdoptNode();
23883    test_ret += test_xmlDOMWrapCloneNode();
23884    test_ret += test_xmlDOMWrapNewCtxt();
23885    test_ret += test_xmlDOMWrapReconcileNamespaces();
23886    test_ret += test_xmlDOMWrapRemoveNode();
23887    test_ret += test_xmlDocCopyNode();
23888    test_ret += test_xmlDocCopyNodeList();
23889    test_ret += test_xmlDocDump();
23890    test_ret += test_xmlDocDumpFormatMemory();
23891    test_ret += test_xmlDocDumpFormatMemoryEnc();
23892    test_ret += test_xmlDocDumpMemory();
23893    test_ret += test_xmlDocDumpMemoryEnc();
23894    test_ret += test_xmlDocFormatDump();
23895    test_ret += test_xmlDocGetRootElement();
23896    test_ret += test_xmlDocSetRootElement();
23897    test_ret += test_xmlElemDump();
23898    test_ret += test_xmlGetBufferAllocationScheme();
23899    test_ret += test_xmlGetCompressMode();
23900    test_ret += test_xmlGetDocCompressMode();
23901    test_ret += test_xmlGetIntSubset();
23902    test_ret += test_xmlGetLastChild();
23903    test_ret += test_xmlGetLineNo();
23904    test_ret += test_xmlGetNoNsProp();
23905    test_ret += test_xmlGetNodePath();
23906    test_ret += test_xmlGetNsList();
23907    test_ret += test_xmlGetNsProp();
23908    test_ret += test_xmlGetProp();
23909    test_ret += test_xmlHasNsProp();
23910    test_ret += test_xmlHasProp();
23911    test_ret += test_xmlIsBlankNode();
23912    test_ret += test_xmlIsXHTML();
23913    test_ret += test_xmlNewCDataBlock();
23914    test_ret += test_xmlNewCharRef();
23915    test_ret += test_xmlNewChild();
23916    test_ret += test_xmlNewComment();
23917    test_ret += test_xmlNewDoc();
23918    test_ret += test_xmlNewDocComment();
23919    test_ret += test_xmlNewDocFragment();
23920    test_ret += test_xmlNewDocNode();
23921    test_ret += test_xmlNewDocNodeEatName();
23922    test_ret += test_xmlNewDocPI();
23923    test_ret += test_xmlNewDocProp();
23924    test_ret += test_xmlNewDocRawNode();
23925    test_ret += test_xmlNewDocText();
23926    test_ret += test_xmlNewDocTextLen();
23927    test_ret += test_xmlNewDtd();
23928    test_ret += test_xmlNewNode();
23929    test_ret += test_xmlNewNodeEatName();
23930    test_ret += test_xmlNewNs();
23931    test_ret += test_xmlNewNsProp();
23932    test_ret += test_xmlNewNsPropEatName();
23933    test_ret += test_xmlNewPI();
23934    test_ret += test_xmlNewProp();
23935    test_ret += test_xmlNewReference();
23936    test_ret += test_xmlNewText();
23937    test_ret += test_xmlNewTextChild();
23938    test_ret += test_xmlNewTextLen();
23939    test_ret += test_xmlNodeAddContent();
23940    test_ret += test_xmlNodeAddContentLen();
23941    test_ret += test_xmlNodeBufGetContent();
23942    test_ret += test_xmlNodeDump();
23943    test_ret += test_xmlNodeDumpOutput();
23944    test_ret += test_xmlNodeGetBase();
23945    test_ret += test_xmlNodeGetContent();
23946    test_ret += test_xmlNodeGetLang();
23947    test_ret += test_xmlNodeGetSpacePreserve();
23948    test_ret += test_xmlNodeIsText();
23949    test_ret += test_xmlNodeListGetRawString();
23950    test_ret += test_xmlNodeListGetString();
23951    test_ret += test_xmlNodeSetBase();
23952    test_ret += test_xmlNodeSetContent();
23953    test_ret += test_xmlNodeSetContentLen();
23954    test_ret += test_xmlNodeSetLang();
23955    test_ret += test_xmlNodeSetName();
23956    test_ret += test_xmlNodeSetSpacePreserve();
23957    test_ret += test_xmlReconciliateNs();
23958    test_ret += test_xmlRemoveProp();
23959    test_ret += test_xmlReplaceNode();
23960    test_ret += test_xmlSaveFile();
23961    test_ret += test_xmlSaveFileEnc();
23962    test_ret += test_xmlSaveFileTo();
23963    test_ret += test_xmlSaveFormatFile();
23964    test_ret += test_xmlSaveFormatFileEnc();
23965    test_ret += test_xmlSaveFormatFileTo();
23966    test_ret += test_xmlSearchNs();
23967    test_ret += test_xmlSearchNsByHref();
23968    test_ret += test_xmlSetBufferAllocationScheme();
23969    test_ret += test_xmlSetCompressMode();
23970    test_ret += test_xmlSetDocCompressMode();
23971    test_ret += test_xmlSetNs();
23972    test_ret += test_xmlSetNsProp();
23973    test_ret += test_xmlSetProp();
23974    test_ret += test_xmlSplitQName2();
23975    test_ret += test_xmlSplitQName3();
23976    test_ret += test_xmlStringGetNodeList();
23977    test_ret += test_xmlStringLenGetNodeList();
23978    test_ret += test_xmlTextConcat();
23979    test_ret += test_xmlTextMerge();
23980    test_ret += test_xmlUnsetNsProp();
23981    test_ret += test_xmlUnsetProp();
23982    test_ret += test_xmlValidateNCName();
23983    test_ret += test_xmlValidateNMToken();
23984    test_ret += test_xmlValidateName();
23985    test_ret += test_xmlValidateQName();
23986
23987    if (test_ret != 0)
23988	printf("Module tree: %d errors\n", test_ret);
23989    return(test_ret);
23990}
23991
23992static int
23993test_xmlBuildRelativeURI(void) {
23994    int test_ret = 0;
23995
23996    int mem_base;
23997    xmlChar * ret_val;
23998    xmlChar * URI; /* the URI reference under consideration */
23999    int n_URI;
24000    xmlChar * base; /* the base value */
24001    int n_base;
24002
24003    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24004    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24005        mem_base = xmlMemBlocks();
24006        URI = gen_const_xmlChar_ptr(n_URI, 0);
24007        base = gen_const_xmlChar_ptr(n_base, 1);
24008
24009        ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base);
24010        desret_xmlChar_ptr(ret_val);
24011        call_tests++;
24012        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24013        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24014        xmlResetLastError();
24015        if (mem_base != xmlMemBlocks()) {
24016            printf("Leak of %d blocks found in xmlBuildRelativeURI",
24017	           xmlMemBlocks() - mem_base);
24018	    test_ret++;
24019            printf(" %d", n_URI);
24020            printf(" %d", n_base);
24021            printf("\n");
24022        }
24023    }
24024    }
24025    function_tests++;
24026
24027    return(test_ret);
24028}
24029
24030
24031static int
24032test_xmlBuildURI(void) {
24033    int test_ret = 0;
24034
24035    int mem_base;
24036    xmlChar * ret_val;
24037    xmlChar * URI; /* the URI instance found in the document */
24038    int n_URI;
24039    xmlChar * base; /* the base value */
24040    int n_base;
24041
24042    for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) {
24043    for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) {
24044        mem_base = xmlMemBlocks();
24045        URI = gen_const_xmlChar_ptr(n_URI, 0);
24046        base = gen_const_xmlChar_ptr(n_base, 1);
24047
24048        ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base);
24049        desret_xmlChar_ptr(ret_val);
24050        call_tests++;
24051        des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0);
24052        des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1);
24053        xmlResetLastError();
24054        if (mem_base != xmlMemBlocks()) {
24055            printf("Leak of %d blocks found in xmlBuildURI",
24056	           xmlMemBlocks() - mem_base);
24057	    test_ret++;
24058            printf(" %d", n_URI);
24059            printf(" %d", n_base);
24060            printf("\n");
24061        }
24062    }
24063    }
24064    function_tests++;
24065
24066    return(test_ret);
24067}
24068
24069
24070static int
24071test_xmlCanonicPath(void) {
24072    int test_ret = 0;
24073
24074    int mem_base;
24075    xmlChar * ret_val;
24076    xmlChar * path; /* the resource locator in a filesystem notation */
24077    int n_path;
24078
24079    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24080        mem_base = xmlMemBlocks();
24081        path = gen_const_xmlChar_ptr(n_path, 0);
24082
24083        ret_val = xmlCanonicPath((const xmlChar *)path);
24084        desret_xmlChar_ptr(ret_val);
24085        call_tests++;
24086        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24087        xmlResetLastError();
24088        if (mem_base != xmlMemBlocks()) {
24089            printf("Leak of %d blocks found in xmlCanonicPath",
24090	           xmlMemBlocks() - mem_base);
24091	    test_ret++;
24092            printf(" %d", n_path);
24093            printf("\n");
24094        }
24095    }
24096    function_tests++;
24097
24098    return(test_ret);
24099}
24100
24101
24102static int
24103test_xmlCreateURI(void) {
24104    int test_ret = 0;
24105
24106
24107    /* missing type support */
24108    return(test_ret);
24109}
24110
24111
24112static int
24113test_xmlNormalizeURIPath(void) {
24114    int test_ret = 0;
24115
24116    int mem_base;
24117    int ret_val;
24118    char * path; /* pointer to the path string */
24119    int n_path;
24120
24121    for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) {
24122        mem_base = xmlMemBlocks();
24123        path = gen_char_ptr(n_path, 0);
24124
24125        ret_val = xmlNormalizeURIPath(path);
24126        desret_int(ret_val);
24127        call_tests++;
24128        des_char_ptr(n_path, path, 0);
24129        xmlResetLastError();
24130        if (mem_base != xmlMemBlocks()) {
24131            printf("Leak of %d blocks found in xmlNormalizeURIPath",
24132	           xmlMemBlocks() - mem_base);
24133	    test_ret++;
24134            printf(" %d", n_path);
24135            printf("\n");
24136        }
24137    }
24138    function_tests++;
24139
24140    return(test_ret);
24141}
24142
24143
24144static int
24145test_xmlParseURI(void) {
24146    int test_ret = 0;
24147
24148
24149    /* missing type support */
24150    return(test_ret);
24151}
24152
24153
24154static int
24155test_xmlParseURIRaw(void) {
24156    int test_ret = 0;
24157
24158
24159    /* missing type support */
24160    return(test_ret);
24161}
24162
24163
24164#define gen_nb_xmlURIPtr 1
24165static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24166    return(NULL);
24167}
24168static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24169}
24170
24171static int
24172test_xmlParseURIReference(void) {
24173    int test_ret = 0;
24174
24175    int mem_base;
24176    int ret_val;
24177    xmlURIPtr uri; /* pointer to an URI structure */
24178    int n_uri;
24179    char * str; /* the string to analyze */
24180    int n_str;
24181
24182    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24183    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
24184        mem_base = xmlMemBlocks();
24185        uri = gen_xmlURIPtr(n_uri, 0);
24186        str = gen_const_char_ptr(n_str, 1);
24187
24188        ret_val = xmlParseURIReference(uri, (const char *)str);
24189        desret_int(ret_val);
24190        call_tests++;
24191        des_xmlURIPtr(n_uri, uri, 0);
24192        des_const_char_ptr(n_str, (const char *)str, 1);
24193        xmlResetLastError();
24194        if (mem_base != xmlMemBlocks()) {
24195            printf("Leak of %d blocks found in xmlParseURIReference",
24196	           xmlMemBlocks() - mem_base);
24197	    test_ret++;
24198            printf(" %d", n_uri);
24199            printf(" %d", n_str);
24200            printf("\n");
24201        }
24202    }
24203    }
24204    function_tests++;
24205
24206    return(test_ret);
24207}
24208
24209
24210static int
24211test_xmlPathToURI(void) {
24212    int test_ret = 0;
24213
24214    int mem_base;
24215    xmlChar * ret_val;
24216    xmlChar * path; /* the resource locator in a filesystem notation */
24217    int n_path;
24218
24219    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
24220        mem_base = xmlMemBlocks();
24221        path = gen_const_xmlChar_ptr(n_path, 0);
24222
24223        ret_val = xmlPathToURI((const xmlChar *)path);
24224        desret_xmlChar_ptr(ret_val);
24225        call_tests++;
24226        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
24227        xmlResetLastError();
24228        if (mem_base != xmlMemBlocks()) {
24229            printf("Leak of %d blocks found in xmlPathToURI",
24230	           xmlMemBlocks() - mem_base);
24231	    test_ret++;
24232            printf(" %d", n_path);
24233            printf("\n");
24234        }
24235    }
24236    function_tests++;
24237
24238    return(test_ret);
24239}
24240
24241
24242static int
24243test_xmlPrintURI(void) {
24244    int test_ret = 0;
24245
24246    int mem_base;
24247    FILE * stream; /* a FILE* for the output */
24248    int n_stream;
24249    xmlURIPtr uri; /* pointer to an xmlURI */
24250    int n_uri;
24251
24252    for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) {
24253    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24254        mem_base = xmlMemBlocks();
24255        stream = gen_FILE_ptr(n_stream, 0);
24256        uri = gen_xmlURIPtr(n_uri, 1);
24257
24258        xmlPrintURI(stream, uri);
24259        call_tests++;
24260        des_FILE_ptr(n_stream, stream, 0);
24261        des_xmlURIPtr(n_uri, uri, 1);
24262        xmlResetLastError();
24263        if (mem_base != xmlMemBlocks()) {
24264            printf("Leak of %d blocks found in xmlPrintURI",
24265	           xmlMemBlocks() - mem_base);
24266	    test_ret++;
24267            printf(" %d", n_stream);
24268            printf(" %d", n_uri);
24269            printf("\n");
24270        }
24271    }
24272    }
24273    function_tests++;
24274
24275    return(test_ret);
24276}
24277
24278
24279static int
24280test_xmlSaveUri(void) {
24281    int test_ret = 0;
24282
24283    int mem_base;
24284    xmlChar * ret_val;
24285    xmlURIPtr uri; /* pointer to an xmlURI */
24286    int n_uri;
24287
24288    for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) {
24289        mem_base = xmlMemBlocks();
24290        uri = gen_xmlURIPtr(n_uri, 0);
24291
24292        ret_val = xmlSaveUri(uri);
24293        desret_xmlChar_ptr(ret_val);
24294        call_tests++;
24295        des_xmlURIPtr(n_uri, uri, 0);
24296        xmlResetLastError();
24297        if (mem_base != xmlMemBlocks()) {
24298            printf("Leak of %d blocks found in xmlSaveUri",
24299	           xmlMemBlocks() - mem_base);
24300	    test_ret++;
24301            printf(" %d", n_uri);
24302            printf("\n");
24303        }
24304    }
24305    function_tests++;
24306
24307    return(test_ret);
24308}
24309
24310
24311static int
24312test_xmlURIEscape(void) {
24313    int test_ret = 0;
24314
24315    int mem_base;
24316    xmlChar * ret_val;
24317    xmlChar * str; /* the string of the URI to escape */
24318    int n_str;
24319
24320    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24321        mem_base = xmlMemBlocks();
24322        str = gen_const_xmlChar_ptr(n_str, 0);
24323
24324        ret_val = xmlURIEscape((const xmlChar *)str);
24325        desret_xmlChar_ptr(ret_val);
24326        call_tests++;
24327        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24328        xmlResetLastError();
24329        if (mem_base != xmlMemBlocks()) {
24330            printf("Leak of %d blocks found in xmlURIEscape",
24331	           xmlMemBlocks() - mem_base);
24332	    test_ret++;
24333            printf(" %d", n_str);
24334            printf("\n");
24335        }
24336    }
24337    function_tests++;
24338
24339    return(test_ret);
24340}
24341
24342
24343static int
24344test_xmlURIEscapeStr(void) {
24345    int test_ret = 0;
24346
24347    int mem_base;
24348    xmlChar * ret_val;
24349    xmlChar * str; /* string to escape */
24350    int n_str;
24351    xmlChar * list; /* exception list string of chars not to escape */
24352    int n_list;
24353
24354    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
24355    for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) {
24356        mem_base = xmlMemBlocks();
24357        str = gen_const_xmlChar_ptr(n_str, 0);
24358        list = gen_const_xmlChar_ptr(n_list, 1);
24359
24360        ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list);
24361        desret_xmlChar_ptr(ret_val);
24362        call_tests++;
24363        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
24364        des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1);
24365        xmlResetLastError();
24366        if (mem_base != xmlMemBlocks()) {
24367            printf("Leak of %d blocks found in xmlURIEscapeStr",
24368	           xmlMemBlocks() - mem_base);
24369	    test_ret++;
24370            printf(" %d", n_str);
24371            printf(" %d", n_list);
24372            printf("\n");
24373        }
24374    }
24375    }
24376    function_tests++;
24377
24378    return(test_ret);
24379}
24380
24381
24382static int
24383test_xmlURIUnescapeString(void) {
24384    int test_ret = 0;
24385
24386
24387    /* missing type support */
24388    return(test_ret);
24389}
24390
24391static int
24392test_uri(void) {
24393    int test_ret = 0;
24394
24395    if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n");
24396    test_ret += test_xmlBuildRelativeURI();
24397    test_ret += test_xmlBuildURI();
24398    test_ret += test_xmlCanonicPath();
24399    test_ret += test_xmlCreateURI();
24400    test_ret += test_xmlNormalizeURIPath();
24401    test_ret += test_xmlParseURI();
24402    test_ret += test_xmlParseURIRaw();
24403    test_ret += test_xmlParseURIReference();
24404    test_ret += test_xmlPathToURI();
24405    test_ret += test_xmlPrintURI();
24406    test_ret += test_xmlSaveUri();
24407    test_ret += test_xmlURIEscape();
24408    test_ret += test_xmlURIEscapeStr();
24409    test_ret += test_xmlURIUnescapeString();
24410
24411    if (test_ret != 0)
24412	printf("Module uri: %d errors\n", test_ret);
24413    return(test_ret);
24414}
24415
24416static int
24417test_xmlAddAttributeDecl(void) {
24418    int test_ret = 0;
24419
24420    int mem_base;
24421    xmlAttributePtr ret_val;
24422    xmlValidCtxtPtr ctxt; /* the validation context */
24423    int n_ctxt;
24424    xmlDtdPtr dtd; /* pointer to the DTD */
24425    int n_dtd;
24426    xmlChar * elem; /* the element name */
24427    int n_elem;
24428    xmlChar * name; /* the attribute name */
24429    int n_name;
24430    xmlChar * ns; /* the attribute namespace prefix */
24431    int n_ns;
24432    xmlAttributeType type; /* the attribute type */
24433    int n_type;
24434    xmlAttributeDefault def; /* the attribute default type */
24435    int n_def;
24436    xmlChar * defaultValue; /* the attribute default value */
24437    int n_defaultValue;
24438    xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */
24439    int n_tree;
24440
24441    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24442    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24443    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
24444    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24445    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
24446    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
24447    for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) {
24448    for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) {
24449    for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) {
24450        mem_base = xmlMemBlocks();
24451        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24452        dtd = gen_xmlDtdPtr(n_dtd, 1);
24453        elem = gen_const_xmlChar_ptr(n_elem, 2);
24454        name = gen_const_xmlChar_ptr(n_name, 3);
24455        ns = gen_const_xmlChar_ptr(n_ns, 4);
24456        type = gen_xmlAttributeType(n_type, 5);
24457        def = gen_xmlAttributeDefault(n_def, 6);
24458        defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7);
24459        tree = gen_xmlEnumerationPtr(n_tree, 8);
24460
24461        ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree);
24462        desret_xmlAttributePtr(ret_val);
24463        call_tests++;
24464        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24465        des_xmlDtdPtr(n_dtd, dtd, 1);
24466        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2);
24467        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
24468        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4);
24469        des_xmlAttributeType(n_type, type, 5);
24470        des_xmlAttributeDefault(n_def, def, 6);
24471        des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7);
24472        des_xmlEnumerationPtr(n_tree, tree, 8);
24473        xmlResetLastError();
24474        if (mem_base != xmlMemBlocks()) {
24475            printf("Leak of %d blocks found in xmlAddAttributeDecl",
24476	           xmlMemBlocks() - mem_base);
24477	    test_ret++;
24478            printf(" %d", n_ctxt);
24479            printf(" %d", n_dtd);
24480            printf(" %d", n_elem);
24481            printf(" %d", n_name);
24482            printf(" %d", n_ns);
24483            printf(" %d", n_type);
24484            printf(" %d", n_def);
24485            printf(" %d", n_defaultValue);
24486            printf(" %d", n_tree);
24487            printf("\n");
24488        }
24489    }
24490    }
24491    }
24492    }
24493    }
24494    }
24495    }
24496    }
24497    }
24498    function_tests++;
24499
24500    return(test_ret);
24501}
24502
24503
24504static int
24505test_xmlAddElementDecl(void) {
24506    int test_ret = 0;
24507
24508    int mem_base;
24509    xmlElementPtr ret_val;
24510    xmlValidCtxtPtr ctxt; /* the validation context */
24511    int n_ctxt;
24512    xmlDtdPtr dtd; /* pointer to the DTD */
24513    int n_dtd;
24514    xmlChar * name; /* the entity name */
24515    int n_name;
24516    xmlElementTypeVal type; /* the element type */
24517    int n_type;
24518    xmlElementContentPtr content; /* the element content tree or NULL */
24519    int n_content;
24520
24521    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
24522    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
24523    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
24524    for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) {
24525    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
24526        mem_base = xmlMemBlocks();
24527        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
24528        dtd = gen_xmlDtdPtr(n_dtd, 1);
24529        name = gen_const_xmlChar_ptr(n_name, 2);
24530        type = gen_xmlElementTypeVal(n_type, 3);
24531        content = gen_xmlElementContentPtr(n_content, 4);
24532
24533        ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content);
24534        desret_xmlElementPtr(ret_val);
24535        call_tests++;
24536        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
24537        des_xmlDtdPtr(n_dtd, dtd, 1);
24538        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
24539        des_xmlElementTypeVal(n_type, type, 3);
24540        des_xmlElementContentPtr(n_content, content, 4);
24541        xmlResetLastError();
24542        if (mem_base != xmlMemBlocks()) {
24543            printf("Leak of %d blocks found in xmlAddElementDecl",
24544	           xmlMemBlocks() - mem_base);
24545	    test_ret++;
24546            printf(" %d", n_ctxt);
24547            printf(" %d", n_dtd);
24548            printf(" %d", n_name);
24549            printf(" %d", n_type);
24550            printf(" %d", n_content);
24551            printf("\n");
24552        }
24553    }
24554    }
24555    }
24556    }
24557    }
24558    function_tests++;
24559
24560    return(test_ret);
24561}
24562
24563
24564static int
24565test_xmlAddID(void) {
24566    int test_ret = 0;
24567
24568
24569    /* missing type support */
24570    return(test_ret);
24571}
24572
24573
24574static int
24575test_xmlAddNotationDecl(void) {
24576    int test_ret = 0;
24577
24578
24579    /* missing type support */
24580    return(test_ret);
24581}
24582
24583
24584static int
24585test_xmlAddRef(void) {
24586    int test_ret = 0;
24587
24588
24589    /* missing type support */
24590    return(test_ret);
24591}
24592
24593
24594#define gen_nb_xmlAttributeTablePtr 1
24595static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24596    return(NULL);
24597}
24598static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24599}
24600
24601static int
24602test_xmlCopyAttributeTable(void) {
24603    int test_ret = 0;
24604
24605
24606    /* missing type support */
24607    return(test_ret);
24608}
24609
24610
24611static int
24612test_xmlCopyDocElementContent(void) {
24613    int test_ret = 0;
24614
24615    int mem_base;
24616    xmlElementContentPtr ret_val;
24617    xmlDocPtr doc; /* the document owning the element declaration */
24618    int n_doc;
24619    xmlElementContentPtr cur; /* An element content pointer. */
24620    int n_cur;
24621
24622    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
24623    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24624        mem_base = xmlMemBlocks();
24625        doc = gen_xmlDocPtr(n_doc, 0);
24626        cur = gen_xmlElementContentPtr(n_cur, 1);
24627
24628        ret_val = xmlCopyDocElementContent(doc, cur);
24629        desret_xmlElementContentPtr(ret_val);
24630        call_tests++;
24631        des_xmlDocPtr(n_doc, doc, 0);
24632        des_xmlElementContentPtr(n_cur, cur, 1);
24633        xmlResetLastError();
24634        if (mem_base != xmlMemBlocks()) {
24635            printf("Leak of %d blocks found in xmlCopyDocElementContent",
24636	           xmlMemBlocks() - mem_base);
24637	    test_ret++;
24638            printf(" %d", n_doc);
24639            printf(" %d", n_cur);
24640            printf("\n");
24641        }
24642    }
24643    }
24644    function_tests++;
24645
24646    return(test_ret);
24647}
24648
24649
24650static int
24651test_xmlCopyElementContent(void) {
24652    int test_ret = 0;
24653
24654    int mem_base;
24655    xmlElementContentPtr ret_val;
24656    xmlElementContentPtr cur; /* An element content pointer. */
24657    int n_cur;
24658
24659    for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) {
24660        mem_base = xmlMemBlocks();
24661        cur = gen_xmlElementContentPtr(n_cur, 0);
24662
24663        ret_val = xmlCopyElementContent(cur);
24664        desret_xmlElementContentPtr(ret_val);
24665        call_tests++;
24666        des_xmlElementContentPtr(n_cur, cur, 0);
24667        xmlResetLastError();
24668        if (mem_base != xmlMemBlocks()) {
24669            printf("Leak of %d blocks found in xmlCopyElementContent",
24670	           xmlMemBlocks() - mem_base);
24671	    test_ret++;
24672            printf(" %d", n_cur);
24673            printf("\n");
24674        }
24675    }
24676    function_tests++;
24677
24678    return(test_ret);
24679}
24680
24681
24682#define gen_nb_xmlElementTablePtr 1
24683static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24684    return(NULL);
24685}
24686static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24687}
24688
24689static int
24690test_xmlCopyElementTable(void) {
24691    int test_ret = 0;
24692
24693
24694    /* missing type support */
24695    return(test_ret);
24696}
24697
24698
24699static int
24700test_xmlCopyEnumeration(void) {
24701    int test_ret = 0;
24702
24703
24704    /* missing type support */
24705    return(test_ret);
24706}
24707
24708
24709#define gen_nb_xmlNotationTablePtr 1
24710static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24711    return(NULL);
24712}
24713static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24714}
24715
24716static int
24717test_xmlCopyNotationTable(void) {
24718    int test_ret = 0;
24719
24720
24721    /* missing type support */
24722    return(test_ret);
24723}
24724
24725
24726static int
24727test_xmlCreateEnumeration(void) {
24728    int test_ret = 0;
24729
24730
24731    /* missing type support */
24732    return(test_ret);
24733}
24734
24735
24736#define gen_nb_xmlAttributePtr 1
24737static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24738    return(NULL);
24739}
24740static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24741}
24742
24743static int
24744test_xmlDumpAttributeDecl(void) {
24745    int test_ret = 0;
24746
24747#if defined(LIBXML_OUTPUT_ENABLED)
24748    int mem_base;
24749    xmlBufferPtr buf; /* the XML buffer output */
24750    int n_buf;
24751    xmlAttributePtr attr; /* An attribute declaration */
24752    int n_attr;
24753
24754    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24755    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
24756        mem_base = xmlMemBlocks();
24757        buf = gen_xmlBufferPtr(n_buf, 0);
24758        attr = gen_xmlAttributePtr(n_attr, 1);
24759
24760        xmlDumpAttributeDecl(buf, attr);
24761        call_tests++;
24762        des_xmlBufferPtr(n_buf, buf, 0);
24763        des_xmlAttributePtr(n_attr, attr, 1);
24764        xmlResetLastError();
24765        if (mem_base != xmlMemBlocks()) {
24766            printf("Leak of %d blocks found in xmlDumpAttributeDecl",
24767	           xmlMemBlocks() - mem_base);
24768	    test_ret++;
24769            printf(" %d", n_buf);
24770            printf(" %d", n_attr);
24771            printf("\n");
24772        }
24773    }
24774    }
24775    function_tests++;
24776#endif
24777
24778    return(test_ret);
24779}
24780
24781
24782static int
24783test_xmlDumpAttributeTable(void) {
24784    int test_ret = 0;
24785
24786#if defined(LIBXML_OUTPUT_ENABLED)
24787    int mem_base;
24788    xmlBufferPtr buf; /* the XML buffer output */
24789    int n_buf;
24790    xmlAttributeTablePtr table; /* An attribute table */
24791    int n_table;
24792
24793    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24794    for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) {
24795        mem_base = xmlMemBlocks();
24796        buf = gen_xmlBufferPtr(n_buf, 0);
24797        table = gen_xmlAttributeTablePtr(n_table, 1);
24798
24799        xmlDumpAttributeTable(buf, table);
24800        call_tests++;
24801        des_xmlBufferPtr(n_buf, buf, 0);
24802        des_xmlAttributeTablePtr(n_table, table, 1);
24803        xmlResetLastError();
24804        if (mem_base != xmlMemBlocks()) {
24805            printf("Leak of %d blocks found in xmlDumpAttributeTable",
24806	           xmlMemBlocks() - mem_base);
24807	    test_ret++;
24808            printf(" %d", n_buf);
24809            printf(" %d", n_table);
24810            printf("\n");
24811        }
24812    }
24813    }
24814    function_tests++;
24815#endif
24816
24817    return(test_ret);
24818}
24819
24820
24821#define gen_nb_xmlElementPtr 1
24822static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24823    return(NULL);
24824}
24825static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24826}
24827
24828static int
24829test_xmlDumpElementDecl(void) {
24830    int test_ret = 0;
24831
24832#if defined(LIBXML_OUTPUT_ENABLED)
24833    int mem_base;
24834    xmlBufferPtr buf; /* the XML buffer output */
24835    int n_buf;
24836    xmlElementPtr elem; /* An element table */
24837    int n_elem;
24838
24839    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24840    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
24841        mem_base = xmlMemBlocks();
24842        buf = gen_xmlBufferPtr(n_buf, 0);
24843        elem = gen_xmlElementPtr(n_elem, 1);
24844
24845        xmlDumpElementDecl(buf, elem);
24846        call_tests++;
24847        des_xmlBufferPtr(n_buf, buf, 0);
24848        des_xmlElementPtr(n_elem, elem, 1);
24849        xmlResetLastError();
24850        if (mem_base != xmlMemBlocks()) {
24851            printf("Leak of %d blocks found in xmlDumpElementDecl",
24852	           xmlMemBlocks() - mem_base);
24853	    test_ret++;
24854            printf(" %d", n_buf);
24855            printf(" %d", n_elem);
24856            printf("\n");
24857        }
24858    }
24859    }
24860    function_tests++;
24861#endif
24862
24863    return(test_ret);
24864}
24865
24866
24867static int
24868test_xmlDumpElementTable(void) {
24869    int test_ret = 0;
24870
24871#if defined(LIBXML_OUTPUT_ENABLED)
24872    int mem_base;
24873    xmlBufferPtr buf; /* the XML buffer output */
24874    int n_buf;
24875    xmlElementTablePtr table; /* An element table */
24876    int n_table;
24877
24878    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24879    for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) {
24880        mem_base = xmlMemBlocks();
24881        buf = gen_xmlBufferPtr(n_buf, 0);
24882        table = gen_xmlElementTablePtr(n_table, 1);
24883
24884        xmlDumpElementTable(buf, table);
24885        call_tests++;
24886        des_xmlBufferPtr(n_buf, buf, 0);
24887        des_xmlElementTablePtr(n_table, table, 1);
24888        xmlResetLastError();
24889        if (mem_base != xmlMemBlocks()) {
24890            printf("Leak of %d blocks found in xmlDumpElementTable",
24891	           xmlMemBlocks() - mem_base);
24892	    test_ret++;
24893            printf(" %d", n_buf);
24894            printf(" %d", n_table);
24895            printf("\n");
24896        }
24897    }
24898    }
24899    function_tests++;
24900#endif
24901
24902    return(test_ret);
24903}
24904
24905
24906#define gen_nb_xmlNotationPtr 1
24907static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24908    return(NULL);
24909}
24910static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
24911}
24912
24913static int
24914test_xmlDumpNotationDecl(void) {
24915    int test_ret = 0;
24916
24917#if defined(LIBXML_OUTPUT_ENABLED)
24918    int mem_base;
24919    xmlBufferPtr buf; /* the XML buffer output */
24920    int n_buf;
24921    xmlNotationPtr nota; /* A notation declaration */
24922    int n_nota;
24923
24924    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24925    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
24926        mem_base = xmlMemBlocks();
24927        buf = gen_xmlBufferPtr(n_buf, 0);
24928        nota = gen_xmlNotationPtr(n_nota, 1);
24929
24930        xmlDumpNotationDecl(buf, nota);
24931        call_tests++;
24932        des_xmlBufferPtr(n_buf, buf, 0);
24933        des_xmlNotationPtr(n_nota, nota, 1);
24934        xmlResetLastError();
24935        if (mem_base != xmlMemBlocks()) {
24936            printf("Leak of %d blocks found in xmlDumpNotationDecl",
24937	           xmlMemBlocks() - mem_base);
24938	    test_ret++;
24939            printf(" %d", n_buf);
24940            printf(" %d", n_nota);
24941            printf("\n");
24942        }
24943    }
24944    }
24945    function_tests++;
24946#endif
24947
24948    return(test_ret);
24949}
24950
24951
24952static int
24953test_xmlDumpNotationTable(void) {
24954    int test_ret = 0;
24955
24956#if defined(LIBXML_OUTPUT_ENABLED)
24957    int mem_base;
24958    xmlBufferPtr buf; /* the XML buffer output */
24959    int n_buf;
24960    xmlNotationTablePtr table; /* A notation table */
24961    int n_table;
24962
24963    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
24964    for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) {
24965        mem_base = xmlMemBlocks();
24966        buf = gen_xmlBufferPtr(n_buf, 0);
24967        table = gen_xmlNotationTablePtr(n_table, 1);
24968
24969        xmlDumpNotationTable(buf, table);
24970        call_tests++;
24971        des_xmlBufferPtr(n_buf, buf, 0);
24972        des_xmlNotationTablePtr(n_table, table, 1);
24973        xmlResetLastError();
24974        if (mem_base != xmlMemBlocks()) {
24975            printf("Leak of %d blocks found in xmlDumpNotationTable",
24976	           xmlMemBlocks() - mem_base);
24977	    test_ret++;
24978            printf(" %d", n_buf);
24979            printf(" %d", n_table);
24980            printf("\n");
24981        }
24982    }
24983    }
24984    function_tests++;
24985#endif
24986
24987    return(test_ret);
24988}
24989
24990
24991static int
24992test_xmlGetDtdAttrDesc(void) {
24993    int test_ret = 0;
24994
24995    int mem_base;
24996    xmlAttributePtr ret_val;
24997    xmlDtdPtr dtd; /* a pointer to the DtD to search */
24998    int n_dtd;
24999    xmlChar * elem; /* the element name */
25000    int n_elem;
25001    xmlChar * name; /* the attribute name */
25002    int n_name;
25003
25004    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25005    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25006    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25007        mem_base = xmlMemBlocks();
25008        dtd = gen_xmlDtdPtr(n_dtd, 0);
25009        elem = gen_const_xmlChar_ptr(n_elem, 1);
25010        name = gen_const_xmlChar_ptr(n_name, 2);
25011
25012        ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name);
25013        desret_xmlAttributePtr(ret_val);
25014        call_tests++;
25015        des_xmlDtdPtr(n_dtd, dtd, 0);
25016        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25017        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25018        xmlResetLastError();
25019        if (mem_base != xmlMemBlocks()) {
25020            printf("Leak of %d blocks found in xmlGetDtdAttrDesc",
25021	           xmlMemBlocks() - mem_base);
25022	    test_ret++;
25023            printf(" %d", n_dtd);
25024            printf(" %d", n_elem);
25025            printf(" %d", n_name);
25026            printf("\n");
25027        }
25028    }
25029    }
25030    }
25031    function_tests++;
25032
25033    return(test_ret);
25034}
25035
25036
25037static int
25038test_xmlGetDtdElementDesc(void) {
25039    int test_ret = 0;
25040
25041    int mem_base;
25042    xmlElementPtr ret_val;
25043    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25044    int n_dtd;
25045    xmlChar * name; /* the element name */
25046    int n_name;
25047
25048    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25049    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25050        mem_base = xmlMemBlocks();
25051        dtd = gen_xmlDtdPtr(n_dtd, 0);
25052        name = gen_const_xmlChar_ptr(n_name, 1);
25053
25054        ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name);
25055        desret_xmlElementPtr(ret_val);
25056        call_tests++;
25057        des_xmlDtdPtr(n_dtd, dtd, 0);
25058        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25059        xmlResetLastError();
25060        if (mem_base != xmlMemBlocks()) {
25061            printf("Leak of %d blocks found in xmlGetDtdElementDesc",
25062	           xmlMemBlocks() - mem_base);
25063	    test_ret++;
25064            printf(" %d", n_dtd);
25065            printf(" %d", n_name);
25066            printf("\n");
25067        }
25068    }
25069    }
25070    function_tests++;
25071
25072    return(test_ret);
25073}
25074
25075
25076static int
25077test_xmlGetDtdNotationDesc(void) {
25078    int test_ret = 0;
25079
25080
25081    /* missing type support */
25082    return(test_ret);
25083}
25084
25085
25086static int
25087test_xmlGetDtdQAttrDesc(void) {
25088    int test_ret = 0;
25089
25090    int mem_base;
25091    xmlAttributePtr ret_val;
25092    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25093    int n_dtd;
25094    xmlChar * elem; /* the element name */
25095    int n_elem;
25096    xmlChar * name; /* the attribute name */
25097    int n_name;
25098    xmlChar * prefix; /* the attribute namespace prefix */
25099    int n_prefix;
25100
25101    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25102    for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) {
25103    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25104    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25105        mem_base = xmlMemBlocks();
25106        dtd = gen_xmlDtdPtr(n_dtd, 0);
25107        elem = gen_const_xmlChar_ptr(n_elem, 1);
25108        name = gen_const_xmlChar_ptr(n_name, 2);
25109        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
25110
25111        ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix);
25112        desret_xmlAttributePtr(ret_val);
25113        call_tests++;
25114        des_xmlDtdPtr(n_dtd, dtd, 0);
25115        des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1);
25116        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25117        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
25118        xmlResetLastError();
25119        if (mem_base != xmlMemBlocks()) {
25120            printf("Leak of %d blocks found in xmlGetDtdQAttrDesc",
25121	           xmlMemBlocks() - mem_base);
25122	    test_ret++;
25123            printf(" %d", n_dtd);
25124            printf(" %d", n_elem);
25125            printf(" %d", n_name);
25126            printf(" %d", n_prefix);
25127            printf("\n");
25128        }
25129    }
25130    }
25131    }
25132    }
25133    function_tests++;
25134
25135    return(test_ret);
25136}
25137
25138
25139static int
25140test_xmlGetDtdQElementDesc(void) {
25141    int test_ret = 0;
25142
25143    int mem_base;
25144    xmlElementPtr ret_val;
25145    xmlDtdPtr dtd; /* a pointer to the DtD to search */
25146    int n_dtd;
25147    xmlChar * name; /* the element name */
25148    int n_name;
25149    xmlChar * prefix; /* the element namespace prefix */
25150    int n_prefix;
25151
25152    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
25153    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25154    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
25155        mem_base = xmlMemBlocks();
25156        dtd = gen_xmlDtdPtr(n_dtd, 0);
25157        name = gen_const_xmlChar_ptr(n_name, 1);
25158        prefix = gen_const_xmlChar_ptr(n_prefix, 2);
25159
25160        ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix);
25161        desret_xmlElementPtr(ret_val);
25162        call_tests++;
25163        des_xmlDtdPtr(n_dtd, dtd, 0);
25164        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25165        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2);
25166        xmlResetLastError();
25167        if (mem_base != xmlMemBlocks()) {
25168            printf("Leak of %d blocks found in xmlGetDtdQElementDesc",
25169	           xmlMemBlocks() - mem_base);
25170	    test_ret++;
25171            printf(" %d", n_dtd);
25172            printf(" %d", n_name);
25173            printf(" %d", n_prefix);
25174            printf("\n");
25175        }
25176    }
25177    }
25178    }
25179    function_tests++;
25180
25181    return(test_ret);
25182}
25183
25184
25185static int
25186test_xmlGetID(void) {
25187    int test_ret = 0;
25188
25189    int mem_base;
25190    xmlAttrPtr ret_val;
25191    xmlDocPtr doc; /* pointer to the document */
25192    int n_doc;
25193    xmlChar * ID; /* the ID value */
25194    int n_ID;
25195
25196    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25197    for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) {
25198        mem_base = xmlMemBlocks();
25199        doc = gen_xmlDocPtr(n_doc, 0);
25200        ID = gen_const_xmlChar_ptr(n_ID, 1);
25201
25202        ret_val = xmlGetID(doc, (const xmlChar *)ID);
25203        desret_xmlAttrPtr(ret_val);
25204        call_tests++;
25205        des_xmlDocPtr(n_doc, doc, 0);
25206        des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1);
25207        xmlResetLastError();
25208        if (mem_base != xmlMemBlocks()) {
25209            printf("Leak of %d blocks found in xmlGetID",
25210	           xmlMemBlocks() - mem_base);
25211	    test_ret++;
25212            printf(" %d", n_doc);
25213            printf(" %d", n_ID);
25214            printf("\n");
25215        }
25216    }
25217    }
25218    function_tests++;
25219
25220    return(test_ret);
25221}
25222
25223
25224static int
25225test_xmlGetRefs(void) {
25226    int test_ret = 0;
25227
25228
25229    /* missing type support */
25230    return(test_ret);
25231}
25232
25233
25234static int
25235test_xmlIsID(void) {
25236    int test_ret = 0;
25237
25238    int mem_base;
25239    int ret_val;
25240    xmlDocPtr doc; /* the document */
25241    int n_doc;
25242    xmlNodePtr elem; /* the element carrying the attribute */
25243    int n_elem;
25244    xmlAttrPtr attr; /* the attribute */
25245    int n_attr;
25246
25247    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25248    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25249    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25250        mem_base = xmlMemBlocks();
25251        doc = gen_xmlDocPtr(n_doc, 0);
25252        elem = gen_xmlNodePtr(n_elem, 1);
25253        attr = gen_xmlAttrPtr(n_attr, 2);
25254
25255        ret_val = xmlIsID(doc, elem, attr);
25256        desret_int(ret_val);
25257        call_tests++;
25258        des_xmlDocPtr(n_doc, doc, 0);
25259        des_xmlNodePtr(n_elem, elem, 1);
25260        des_xmlAttrPtr(n_attr, attr, 2);
25261        xmlResetLastError();
25262        if (mem_base != xmlMemBlocks()) {
25263            printf("Leak of %d blocks found in xmlIsID",
25264	           xmlMemBlocks() - mem_base);
25265	    test_ret++;
25266            printf(" %d", n_doc);
25267            printf(" %d", n_elem);
25268            printf(" %d", n_attr);
25269            printf("\n");
25270        }
25271    }
25272    }
25273    }
25274    function_tests++;
25275
25276    return(test_ret);
25277}
25278
25279
25280static int
25281test_xmlIsMixedElement(void) {
25282    int test_ret = 0;
25283
25284    int mem_base;
25285    int ret_val;
25286    xmlDocPtr doc; /* the document */
25287    int n_doc;
25288    xmlChar * name; /* the element name */
25289    int n_name;
25290
25291    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25292    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25293        mem_base = xmlMemBlocks();
25294        doc = gen_xmlDocPtr(n_doc, 0);
25295        name = gen_const_xmlChar_ptr(n_name, 1);
25296
25297        ret_val = xmlIsMixedElement(doc, (const xmlChar *)name);
25298        desret_int(ret_val);
25299        call_tests++;
25300        des_xmlDocPtr(n_doc, doc, 0);
25301        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25302        xmlResetLastError();
25303        if (mem_base != xmlMemBlocks()) {
25304            printf("Leak of %d blocks found in xmlIsMixedElement",
25305	           xmlMemBlocks() - mem_base);
25306	    test_ret++;
25307            printf(" %d", n_doc);
25308            printf(" %d", n_name);
25309            printf("\n");
25310        }
25311    }
25312    }
25313    function_tests++;
25314
25315    return(test_ret);
25316}
25317
25318
25319static int
25320test_xmlIsRef(void) {
25321    int test_ret = 0;
25322
25323    int mem_base;
25324    int ret_val;
25325    xmlDocPtr doc; /* the document */
25326    int n_doc;
25327    xmlNodePtr elem; /* the element carrying the attribute */
25328    int n_elem;
25329    xmlAttrPtr attr; /* the attribute */
25330    int n_attr;
25331
25332    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25333    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25334    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25335        mem_base = xmlMemBlocks();
25336        doc = gen_xmlDocPtr(n_doc, 0);
25337        elem = gen_xmlNodePtr(n_elem, 1);
25338        attr = gen_xmlAttrPtr(n_attr, 2);
25339
25340        ret_val = xmlIsRef(doc, elem, attr);
25341        desret_int(ret_val);
25342        call_tests++;
25343        des_xmlDocPtr(n_doc, doc, 0);
25344        des_xmlNodePtr(n_elem, elem, 1);
25345        des_xmlAttrPtr(n_attr, attr, 2);
25346        xmlResetLastError();
25347        if (mem_base != xmlMemBlocks()) {
25348            printf("Leak of %d blocks found in xmlIsRef",
25349	           xmlMemBlocks() - mem_base);
25350	    test_ret++;
25351            printf(" %d", n_doc);
25352            printf(" %d", n_elem);
25353            printf(" %d", n_attr);
25354            printf("\n");
25355        }
25356    }
25357    }
25358    }
25359    function_tests++;
25360
25361    return(test_ret);
25362}
25363
25364
25365static int
25366test_xmlNewDocElementContent(void) {
25367    int test_ret = 0;
25368
25369    int mem_base;
25370    xmlElementContentPtr ret_val;
25371    xmlDocPtr doc; /* the document */
25372    int n_doc;
25373    xmlChar * name; /* the subelement name or NULL */
25374    int n_name;
25375    xmlElementContentType type; /* the type of element content decl */
25376    int n_type;
25377
25378    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25379    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25380    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25381        mem_base = xmlMemBlocks();
25382        doc = gen_xmlDocPtr(n_doc, 0);
25383        name = gen_const_xmlChar_ptr(n_name, 1);
25384        type = gen_xmlElementContentType(n_type, 2);
25385
25386        ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
25387        xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
25388        desret_xmlElementContentPtr(ret_val);
25389        call_tests++;
25390        des_xmlDocPtr(n_doc, doc, 0);
25391        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
25392        des_xmlElementContentType(n_type, type, 2);
25393        xmlResetLastError();
25394        if (mem_base != xmlMemBlocks()) {
25395            printf("Leak of %d blocks found in xmlNewDocElementContent",
25396	           xmlMemBlocks() - mem_base);
25397	    test_ret++;
25398            printf(" %d", n_doc);
25399            printf(" %d", n_name);
25400            printf(" %d", n_type);
25401            printf("\n");
25402        }
25403    }
25404    }
25405    }
25406    function_tests++;
25407
25408    return(test_ret);
25409}
25410
25411
25412static int
25413test_xmlNewElementContent(void) {
25414    int test_ret = 0;
25415
25416    int mem_base;
25417    xmlElementContentPtr ret_val;
25418    xmlChar * name; /* the subelement name or NULL */
25419    int n_name;
25420    xmlElementContentType type; /* the type of element content decl */
25421    int n_type;
25422
25423    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25424    for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) {
25425        mem_base = xmlMemBlocks();
25426        name = gen_const_xmlChar_ptr(n_name, 0);
25427        type = gen_xmlElementContentType(n_type, 1);
25428
25429        ret_val = xmlNewElementContent((const xmlChar *)name, type);
25430        desret_xmlElementContentPtr(ret_val);
25431        call_tests++;
25432        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
25433        des_xmlElementContentType(n_type, type, 1);
25434        xmlResetLastError();
25435        if (mem_base != xmlMemBlocks()) {
25436            printf("Leak of %d blocks found in xmlNewElementContent",
25437	           xmlMemBlocks() - mem_base);
25438	    test_ret++;
25439            printf(" %d", n_name);
25440            printf(" %d", n_type);
25441            printf("\n");
25442        }
25443    }
25444    }
25445    function_tests++;
25446
25447    return(test_ret);
25448}
25449
25450
25451static int
25452test_xmlNewValidCtxt(void) {
25453    int test_ret = 0;
25454
25455
25456    /* missing type support */
25457    return(test_ret);
25458}
25459
25460
25461static int
25462test_xmlRemoveID(void) {
25463    int test_ret = 0;
25464
25465    int mem_base;
25466    int ret_val;
25467    xmlDocPtr doc; /* the document */
25468    int n_doc;
25469    xmlAttrPtr attr; /* the attribute */
25470    int n_attr;
25471
25472    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25473    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25474        mem_base = xmlMemBlocks();
25475        doc = gen_xmlDocPtr(n_doc, 0);
25476        attr = gen_xmlAttrPtr(n_attr, 1);
25477
25478        ret_val = xmlRemoveID(doc, attr);
25479        desret_int(ret_val);
25480        call_tests++;
25481        des_xmlDocPtr(n_doc, doc, 0);
25482        des_xmlAttrPtr(n_attr, attr, 1);
25483        xmlResetLastError();
25484        if (mem_base != xmlMemBlocks()) {
25485            printf("Leak of %d blocks found in xmlRemoveID",
25486	           xmlMemBlocks() - mem_base);
25487	    test_ret++;
25488            printf(" %d", n_doc);
25489            printf(" %d", n_attr);
25490            printf("\n");
25491        }
25492    }
25493    }
25494    function_tests++;
25495
25496    return(test_ret);
25497}
25498
25499
25500static int
25501test_xmlRemoveRef(void) {
25502    int test_ret = 0;
25503
25504    int mem_base;
25505    int ret_val;
25506    xmlDocPtr doc; /* the document */
25507    int n_doc;
25508    xmlAttrPtr attr; /* the attribute */
25509    int n_attr;
25510
25511    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25512    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
25513        mem_base = xmlMemBlocks();
25514        doc = gen_xmlDocPtr(n_doc, 0);
25515        attr = gen_xmlAttrPtr(n_attr, 1);
25516
25517        ret_val = xmlRemoveRef(doc, attr);
25518        desret_int(ret_val);
25519        call_tests++;
25520        des_xmlDocPtr(n_doc, doc, 0);
25521        des_xmlAttrPtr(n_attr, attr, 1);
25522        xmlResetLastError();
25523        if (mem_base != xmlMemBlocks()) {
25524            printf("Leak of %d blocks found in xmlRemoveRef",
25525	           xmlMemBlocks() - mem_base);
25526	    test_ret++;
25527            printf(" %d", n_doc);
25528            printf(" %d", n_attr);
25529            printf("\n");
25530        }
25531    }
25532    }
25533    function_tests++;
25534
25535    return(test_ret);
25536}
25537
25538
25539static int
25540test_xmlSnprintfElementContent(void) {
25541    int test_ret = 0;
25542
25543    int mem_base;
25544    char * buf; /* an output buffer */
25545    int n_buf;
25546    int size; /* the buffer size */
25547    int n_size;
25548    xmlElementContentPtr content; /* An element table */
25549    int n_content;
25550    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25551    int n_englob;
25552
25553    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25554    for (n_size = 0;n_size < gen_nb_int;n_size++) {
25555    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25556    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25557        mem_base = xmlMemBlocks();
25558        buf = gen_char_ptr(n_buf, 0);
25559        size = gen_int(n_size, 1);
25560        content = gen_xmlElementContentPtr(n_content, 2);
25561        englob = gen_int(n_englob, 3);
25562
25563        xmlSnprintfElementContent(buf, size, content, englob);
25564        call_tests++;
25565        des_char_ptr(n_buf, buf, 0);
25566        des_int(n_size, size, 1);
25567        des_xmlElementContentPtr(n_content, content, 2);
25568        des_int(n_englob, englob, 3);
25569        xmlResetLastError();
25570        if (mem_base != xmlMemBlocks()) {
25571            printf("Leak of %d blocks found in xmlSnprintfElementContent",
25572	           xmlMemBlocks() - mem_base);
25573	    test_ret++;
25574            printf(" %d", n_buf);
25575            printf(" %d", n_size);
25576            printf(" %d", n_content);
25577            printf(" %d", n_englob);
25578            printf("\n");
25579        }
25580    }
25581    }
25582    }
25583    }
25584    function_tests++;
25585
25586    return(test_ret);
25587}
25588
25589
25590static int
25591test_xmlSprintfElementContent(void) {
25592    int test_ret = 0;
25593
25594#if defined(LIBXML_OUTPUT_ENABLED)
25595#ifdef LIBXML_OUTPUT_ENABLED
25596    int mem_base;
25597    char * buf; /* an output buffer */
25598    int n_buf;
25599    xmlElementContentPtr content; /* An element table */
25600    int n_content;
25601    int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */
25602    int n_englob;
25603
25604    for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) {
25605    for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) {
25606    for (n_englob = 0;n_englob < gen_nb_int;n_englob++) {
25607        mem_base = xmlMemBlocks();
25608        buf = gen_char_ptr(n_buf, 0);
25609        content = gen_xmlElementContentPtr(n_content, 1);
25610        englob = gen_int(n_englob, 2);
25611
25612        xmlSprintfElementContent(buf, content, englob);
25613        call_tests++;
25614        des_char_ptr(n_buf, buf, 0);
25615        des_xmlElementContentPtr(n_content, content, 1);
25616        des_int(n_englob, englob, 2);
25617        xmlResetLastError();
25618        if (mem_base != xmlMemBlocks()) {
25619            printf("Leak of %d blocks found in xmlSprintfElementContent",
25620	           xmlMemBlocks() - mem_base);
25621	    test_ret++;
25622            printf(" %d", n_buf);
25623            printf(" %d", n_content);
25624            printf(" %d", n_englob);
25625            printf("\n");
25626        }
25627    }
25628    }
25629    }
25630    function_tests++;
25631#endif
25632#endif
25633
25634    return(test_ret);
25635}
25636
25637
25638static int
25639test_xmlValidBuildContentModel(void) {
25640    int test_ret = 0;
25641
25642#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
25643    int mem_base;
25644    int ret_val;
25645    xmlValidCtxtPtr ctxt; /* a validation context */
25646    int n_ctxt;
25647    xmlElementPtr elem; /* an element declaration node */
25648    int n_elem;
25649
25650    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25651    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
25652        mem_base = xmlMemBlocks();
25653        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25654        elem = gen_xmlElementPtr(n_elem, 1);
25655
25656        ret_val = xmlValidBuildContentModel(ctxt, elem);
25657        desret_int(ret_val);
25658        call_tests++;
25659        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25660        des_xmlElementPtr(n_elem, elem, 1);
25661        xmlResetLastError();
25662        if (mem_base != xmlMemBlocks()) {
25663            printf("Leak of %d blocks found in xmlValidBuildContentModel",
25664	           xmlMemBlocks() - mem_base);
25665	    test_ret++;
25666            printf(" %d", n_ctxt);
25667            printf(" %d", n_elem);
25668            printf("\n");
25669        }
25670    }
25671    }
25672    function_tests++;
25673#endif
25674
25675    return(test_ret);
25676}
25677
25678
25679static int
25680test_xmlValidCtxtNormalizeAttributeValue(void) {
25681    int test_ret = 0;
25682
25683#if defined(LIBXML_VALID_ENABLED)
25684    int mem_base;
25685    xmlChar * ret_val;
25686    xmlValidCtxtPtr ctxt; /* the validation context or NULL */
25687    int n_ctxt;
25688    xmlDocPtr doc; /* the document */
25689    int n_doc;
25690    xmlNodePtr elem; /* the parent */
25691    int n_elem;
25692    xmlChar * name; /* the attribute name */
25693    int n_name;
25694    xmlChar * value; /* the attribute value */
25695    int n_value;
25696
25697    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25698    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25699    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25700    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25701    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25702        mem_base = xmlMemBlocks();
25703        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25704        doc = gen_xmlDocPtr(n_doc, 1);
25705        elem = gen_xmlNodePtr(n_elem, 2);
25706        name = gen_const_xmlChar_ptr(n_name, 3);
25707        value = gen_const_xmlChar_ptr(n_value, 4);
25708
25709        ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25710        desret_xmlChar_ptr(ret_val);
25711        call_tests++;
25712        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25713        des_xmlDocPtr(n_doc, doc, 1);
25714        des_xmlNodePtr(n_elem, elem, 2);
25715        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
25716        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
25717        xmlResetLastError();
25718        if (mem_base != xmlMemBlocks()) {
25719            printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue",
25720	           xmlMemBlocks() - mem_base);
25721	    test_ret++;
25722            printf(" %d", n_ctxt);
25723            printf(" %d", n_doc);
25724            printf(" %d", n_elem);
25725            printf(" %d", n_name);
25726            printf(" %d", n_value);
25727            printf("\n");
25728        }
25729    }
25730    }
25731    }
25732    }
25733    }
25734    function_tests++;
25735#endif
25736
25737    return(test_ret);
25738}
25739
25740
25741#define gen_nb_xmlElementContent_ptr 1
25742static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25743    return(NULL);
25744}
25745static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
25746}
25747
25748static int
25749test_xmlValidGetPotentialChildren(void) {
25750    int test_ret = 0;
25751
25752#if defined(LIBXML_VALID_ENABLED)
25753#ifdef LIBXML_VALID_ENABLED
25754    int mem_base;
25755    int ret_val;
25756    xmlElementContent * ctree; /* an element content tree */
25757    int n_ctree;
25758    xmlChar ** names; /* an array to store the list of child names */
25759    int n_names;
25760    int * len; /* a pointer to the number of element in the list */
25761    int n_len;
25762    int max; /* the size of the array */
25763    int n_max;
25764
25765    for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) {
25766    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25767    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
25768    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25769        mem_base = xmlMemBlocks();
25770        ctree = gen_xmlElementContent_ptr(n_ctree, 0);
25771        names = gen_const_xmlChar_ptr_ptr(n_names, 1);
25772        len = gen_int_ptr(n_len, 2);
25773        max = gen_int(n_max, 3);
25774
25775        ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max);
25776        desret_int(ret_val);
25777        call_tests++;
25778        des_xmlElementContent_ptr(n_ctree, ctree, 0);
25779        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1);
25780        des_int_ptr(n_len, len, 2);
25781        des_int(n_max, max, 3);
25782        xmlResetLastError();
25783        if (mem_base != xmlMemBlocks()) {
25784            printf("Leak of %d blocks found in xmlValidGetPotentialChildren",
25785	           xmlMemBlocks() - mem_base);
25786	    test_ret++;
25787            printf(" %d", n_ctree);
25788            printf(" %d", n_names);
25789            printf(" %d", n_len);
25790            printf(" %d", n_max);
25791            printf("\n");
25792        }
25793    }
25794    }
25795    }
25796    }
25797    function_tests++;
25798#endif
25799#endif
25800
25801    return(test_ret);
25802}
25803
25804
25805static int
25806test_xmlValidGetValidElements(void) {
25807    int test_ret = 0;
25808
25809#if defined(LIBXML_VALID_ENABLED)
25810#ifdef LIBXML_VALID_ENABLED
25811    int mem_base;
25812    int ret_val;
25813    xmlNode * prev; /* an element to insert after */
25814    int n_prev;
25815    xmlNode * next; /* an element to insert next */
25816    int n_next;
25817    xmlChar ** names; /* an array to store the list of child names */
25818    int n_names;
25819    int max; /* the size of the array */
25820    int n_max;
25821
25822    for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) {
25823    for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) {
25824    for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) {
25825    for (n_max = 0;n_max < gen_nb_int;n_max++) {
25826        mem_base = xmlMemBlocks();
25827        prev = gen_xmlNodePtr(n_prev, 0);
25828        next = gen_xmlNodePtr(n_next, 1);
25829        names = gen_const_xmlChar_ptr_ptr(n_names, 2);
25830        max = gen_int(n_max, 3);
25831
25832        ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max);
25833        desret_int(ret_val);
25834        call_tests++;
25835        des_xmlNodePtr(n_prev, prev, 0);
25836        des_xmlNodePtr(n_next, next, 1);
25837        des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2);
25838        des_int(n_max, max, 3);
25839        xmlResetLastError();
25840        if (mem_base != xmlMemBlocks()) {
25841            printf("Leak of %d blocks found in xmlValidGetValidElements",
25842	           xmlMemBlocks() - mem_base);
25843	    test_ret++;
25844            printf(" %d", n_prev);
25845            printf(" %d", n_next);
25846            printf(" %d", n_names);
25847            printf(" %d", n_max);
25848            printf("\n");
25849        }
25850    }
25851    }
25852    }
25853    }
25854    function_tests++;
25855#endif
25856#endif
25857
25858    return(test_ret);
25859}
25860
25861
25862static int
25863test_xmlValidNormalizeAttributeValue(void) {
25864    int test_ret = 0;
25865
25866#if defined(LIBXML_VALID_ENABLED)
25867    int mem_base;
25868    xmlChar * ret_val;
25869    xmlDocPtr doc; /* the document */
25870    int n_doc;
25871    xmlNodePtr elem; /* the parent */
25872    int n_elem;
25873    xmlChar * name; /* the attribute name */
25874    int n_name;
25875    xmlChar * value; /* the attribute value */
25876    int n_value;
25877
25878    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25879    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
25880    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
25881    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25882        mem_base = xmlMemBlocks();
25883        doc = gen_xmlDocPtr(n_doc, 0);
25884        elem = gen_xmlNodePtr(n_elem, 1);
25885        name = gen_const_xmlChar_ptr(n_name, 2);
25886        value = gen_const_xmlChar_ptr(n_value, 3);
25887
25888        ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value);
25889        desret_xmlChar_ptr(ret_val);
25890        call_tests++;
25891        des_xmlDocPtr(n_doc, doc, 0);
25892        des_xmlNodePtr(n_elem, elem, 1);
25893        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
25894        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
25895        xmlResetLastError();
25896        if (mem_base != xmlMemBlocks()) {
25897            printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue",
25898	           xmlMemBlocks() - mem_base);
25899	    test_ret++;
25900            printf(" %d", n_doc);
25901            printf(" %d", n_elem);
25902            printf(" %d", n_name);
25903            printf(" %d", n_value);
25904            printf("\n");
25905        }
25906    }
25907    }
25908    }
25909    }
25910    function_tests++;
25911#endif
25912
25913    return(test_ret);
25914}
25915
25916
25917static int
25918test_xmlValidateAttributeDecl(void) {
25919    int test_ret = 0;
25920
25921#if defined(LIBXML_VALID_ENABLED)
25922    int mem_base;
25923    int ret_val;
25924    xmlValidCtxtPtr ctxt; /* the validation context */
25925    int n_ctxt;
25926    xmlDocPtr doc; /* a document instance */
25927    int n_doc;
25928    xmlAttributePtr attr; /* an attribute definition */
25929    int n_attr;
25930
25931    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
25932    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
25933    for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) {
25934        mem_base = xmlMemBlocks();
25935        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
25936        doc = gen_xmlDocPtr(n_doc, 1);
25937        attr = gen_xmlAttributePtr(n_attr, 2);
25938
25939        ret_val = xmlValidateAttributeDecl(ctxt, doc, attr);
25940        desret_int(ret_val);
25941        call_tests++;
25942        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
25943        des_xmlDocPtr(n_doc, doc, 1);
25944        des_xmlAttributePtr(n_attr, attr, 2);
25945        xmlResetLastError();
25946        if (mem_base != xmlMemBlocks()) {
25947            printf("Leak of %d blocks found in xmlValidateAttributeDecl",
25948	           xmlMemBlocks() - mem_base);
25949	    test_ret++;
25950            printf(" %d", n_ctxt);
25951            printf(" %d", n_doc);
25952            printf(" %d", n_attr);
25953            printf("\n");
25954        }
25955    }
25956    }
25957    }
25958    function_tests++;
25959#endif
25960
25961    return(test_ret);
25962}
25963
25964
25965static int
25966test_xmlValidateAttributeValue(void) {
25967    int test_ret = 0;
25968
25969#if defined(LIBXML_VALID_ENABLED)
25970    int mem_base;
25971    int ret_val;
25972    xmlAttributeType type; /*  */
25973    int n_type;
25974    xmlChar * value; /*  */
25975    int n_value;
25976
25977    for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
25978    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
25979        mem_base = xmlMemBlocks();
25980        type = gen_xmlAttributeType(n_type, 0);
25981        value = gen_const_xmlChar_ptr(n_value, 1);
25982
25983        ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value);
25984        desret_int(ret_val);
25985        call_tests++;
25986        des_xmlAttributeType(n_type, type, 0);
25987        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
25988        xmlResetLastError();
25989        if (mem_base != xmlMemBlocks()) {
25990            printf("Leak of %d blocks found in xmlValidateAttributeValue",
25991	           xmlMemBlocks() - mem_base);
25992	    test_ret++;
25993            printf(" %d", n_type);
25994            printf(" %d", n_value);
25995            printf("\n");
25996        }
25997    }
25998    }
25999    function_tests++;
26000#endif
26001
26002    return(test_ret);
26003}
26004
26005
26006static int
26007test_xmlValidateDocument(void) {
26008    int test_ret = 0;
26009
26010#if defined(LIBXML_VALID_ENABLED)
26011    int mem_base;
26012    int ret_val;
26013    xmlValidCtxtPtr ctxt; /* the validation context */
26014    int n_ctxt;
26015    xmlDocPtr doc; /* a document instance */
26016    int n_doc;
26017
26018    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26019    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26020        mem_base = xmlMemBlocks();
26021        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26022        doc = gen_xmlDocPtr(n_doc, 1);
26023
26024        ret_val = xmlValidateDocument(ctxt, doc);
26025        desret_int(ret_val);
26026        call_tests++;
26027        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26028        des_xmlDocPtr(n_doc, doc, 1);
26029        xmlResetLastError();
26030        if (mem_base != xmlMemBlocks()) {
26031            printf("Leak of %d blocks found in xmlValidateDocument",
26032	           xmlMemBlocks() - mem_base);
26033	    test_ret++;
26034            printf(" %d", n_ctxt);
26035            printf(" %d", n_doc);
26036            printf("\n");
26037        }
26038    }
26039    }
26040    function_tests++;
26041#endif
26042
26043    return(test_ret);
26044}
26045
26046
26047static int
26048test_xmlValidateDocumentFinal(void) {
26049    int test_ret = 0;
26050
26051#if defined(LIBXML_VALID_ENABLED)
26052    int mem_base;
26053    int ret_val;
26054    xmlValidCtxtPtr ctxt; /* the validation context */
26055    int n_ctxt;
26056    xmlDocPtr doc; /* a document instance */
26057    int n_doc;
26058
26059    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26060    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26061        mem_base = xmlMemBlocks();
26062        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26063        doc = gen_xmlDocPtr(n_doc, 1);
26064
26065        ret_val = xmlValidateDocumentFinal(ctxt, doc);
26066        desret_int(ret_val);
26067        call_tests++;
26068        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26069        des_xmlDocPtr(n_doc, doc, 1);
26070        xmlResetLastError();
26071        if (mem_base != xmlMemBlocks()) {
26072            printf("Leak of %d blocks found in xmlValidateDocumentFinal",
26073	           xmlMemBlocks() - mem_base);
26074	    test_ret++;
26075            printf(" %d", n_ctxt);
26076            printf(" %d", n_doc);
26077            printf("\n");
26078        }
26079    }
26080    }
26081    function_tests++;
26082#endif
26083
26084    return(test_ret);
26085}
26086
26087
26088static int
26089test_xmlValidateDtd(void) {
26090    int test_ret = 0;
26091
26092#if defined(LIBXML_VALID_ENABLED)
26093    int mem_base;
26094    int ret_val;
26095    xmlValidCtxtPtr ctxt; /* the validation context */
26096    int n_ctxt;
26097    xmlDocPtr doc; /* a document instance */
26098    int n_doc;
26099    xmlDtdPtr dtd; /* a dtd instance */
26100    int n_dtd;
26101
26102    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26103    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26104    for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) {
26105        mem_base = xmlMemBlocks();
26106        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26107        doc = gen_xmlDocPtr(n_doc, 1);
26108        dtd = gen_xmlDtdPtr(n_dtd, 2);
26109
26110        ret_val = xmlValidateDtd(ctxt, doc, dtd);
26111        desret_int(ret_val);
26112        call_tests++;
26113        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26114        des_xmlDocPtr(n_doc, doc, 1);
26115        des_xmlDtdPtr(n_dtd, dtd, 2);
26116        xmlResetLastError();
26117        if (mem_base != xmlMemBlocks()) {
26118            printf("Leak of %d blocks found in xmlValidateDtd",
26119	           xmlMemBlocks() - mem_base);
26120	    test_ret++;
26121            printf(" %d", n_ctxt);
26122            printf(" %d", n_doc);
26123            printf(" %d", n_dtd);
26124            printf("\n");
26125        }
26126    }
26127    }
26128    }
26129    function_tests++;
26130#endif
26131
26132    return(test_ret);
26133}
26134
26135
26136static int
26137test_xmlValidateDtdFinal(void) {
26138    int test_ret = 0;
26139
26140#if defined(LIBXML_VALID_ENABLED)
26141    int mem_base;
26142    int ret_val;
26143    xmlValidCtxtPtr ctxt; /* the validation context */
26144    int n_ctxt;
26145    xmlDocPtr doc; /* a document instance */
26146    int n_doc;
26147
26148    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26149    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26150        mem_base = xmlMemBlocks();
26151        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26152        doc = gen_xmlDocPtr(n_doc, 1);
26153
26154        ret_val = xmlValidateDtdFinal(ctxt, doc);
26155        desret_int(ret_val);
26156        call_tests++;
26157        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26158        des_xmlDocPtr(n_doc, doc, 1);
26159        xmlResetLastError();
26160        if (mem_base != xmlMemBlocks()) {
26161            printf("Leak of %d blocks found in xmlValidateDtdFinal",
26162	           xmlMemBlocks() - mem_base);
26163	    test_ret++;
26164            printf(" %d", n_ctxt);
26165            printf(" %d", n_doc);
26166            printf("\n");
26167        }
26168    }
26169    }
26170    function_tests++;
26171#endif
26172
26173    return(test_ret);
26174}
26175
26176
26177static int
26178test_xmlValidateElement(void) {
26179    int test_ret = 0;
26180
26181#if defined(LIBXML_VALID_ENABLED)
26182    int mem_base;
26183    int ret_val;
26184    xmlValidCtxtPtr ctxt; /* the validation context */
26185    int n_ctxt;
26186    xmlDocPtr doc; /* a document instance */
26187    int n_doc;
26188    xmlNodePtr elem; /* an element instance */
26189    int n_elem;
26190
26191    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26192    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26193    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26194        mem_base = xmlMemBlocks();
26195        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26196        doc = gen_xmlDocPtr(n_doc, 1);
26197        elem = gen_xmlNodePtr(n_elem, 2);
26198
26199        ret_val = xmlValidateElement(ctxt, doc, elem);
26200        desret_int(ret_val);
26201        call_tests++;
26202        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26203        des_xmlDocPtr(n_doc, doc, 1);
26204        des_xmlNodePtr(n_elem, elem, 2);
26205        xmlResetLastError();
26206        if (mem_base != xmlMemBlocks()) {
26207            printf("Leak of %d blocks found in xmlValidateElement",
26208	           xmlMemBlocks() - mem_base);
26209	    test_ret++;
26210            printf(" %d", n_ctxt);
26211            printf(" %d", n_doc);
26212            printf(" %d", n_elem);
26213            printf("\n");
26214        }
26215    }
26216    }
26217    }
26218    function_tests++;
26219#endif
26220
26221    return(test_ret);
26222}
26223
26224
26225static int
26226test_xmlValidateElementDecl(void) {
26227    int test_ret = 0;
26228
26229#if defined(LIBXML_VALID_ENABLED)
26230    int mem_base;
26231    int ret_val;
26232    xmlValidCtxtPtr ctxt; /* the validation context */
26233    int n_ctxt;
26234    xmlDocPtr doc; /* a document instance */
26235    int n_doc;
26236    xmlElementPtr elem; /* an element definition */
26237    int n_elem;
26238
26239    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26240    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26241    for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) {
26242        mem_base = xmlMemBlocks();
26243        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26244        doc = gen_xmlDocPtr(n_doc, 1);
26245        elem = gen_xmlElementPtr(n_elem, 2);
26246
26247        ret_val = xmlValidateElementDecl(ctxt, doc, elem);
26248        desret_int(ret_val);
26249        call_tests++;
26250        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26251        des_xmlDocPtr(n_doc, doc, 1);
26252        des_xmlElementPtr(n_elem, elem, 2);
26253        xmlResetLastError();
26254        if (mem_base != xmlMemBlocks()) {
26255            printf("Leak of %d blocks found in xmlValidateElementDecl",
26256	           xmlMemBlocks() - mem_base);
26257	    test_ret++;
26258            printf(" %d", n_ctxt);
26259            printf(" %d", n_doc);
26260            printf(" %d", n_elem);
26261            printf("\n");
26262        }
26263    }
26264    }
26265    }
26266    function_tests++;
26267#endif
26268
26269    return(test_ret);
26270}
26271
26272
26273static int
26274test_xmlValidateNameValue(void) {
26275    int test_ret = 0;
26276
26277#if defined(LIBXML_VALID_ENABLED)
26278    int mem_base;
26279    int ret_val;
26280    xmlChar * value; /* an Name value */
26281    int n_value;
26282
26283    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26284        mem_base = xmlMemBlocks();
26285        value = gen_const_xmlChar_ptr(n_value, 0);
26286
26287        ret_val = xmlValidateNameValue((const xmlChar *)value);
26288        desret_int(ret_val);
26289        call_tests++;
26290        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26291        xmlResetLastError();
26292        if (mem_base != xmlMemBlocks()) {
26293            printf("Leak of %d blocks found in xmlValidateNameValue",
26294	           xmlMemBlocks() - mem_base);
26295	    test_ret++;
26296            printf(" %d", n_value);
26297            printf("\n");
26298        }
26299    }
26300    function_tests++;
26301#endif
26302
26303    return(test_ret);
26304}
26305
26306
26307static int
26308test_xmlValidateNamesValue(void) {
26309    int test_ret = 0;
26310
26311#if defined(LIBXML_VALID_ENABLED)
26312    int mem_base;
26313    int ret_val;
26314    xmlChar * value; /* an Names value */
26315    int n_value;
26316
26317    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26318        mem_base = xmlMemBlocks();
26319        value = gen_const_xmlChar_ptr(n_value, 0);
26320
26321        ret_val = xmlValidateNamesValue((const xmlChar *)value);
26322        desret_int(ret_val);
26323        call_tests++;
26324        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26325        xmlResetLastError();
26326        if (mem_base != xmlMemBlocks()) {
26327            printf("Leak of %d blocks found in xmlValidateNamesValue",
26328	           xmlMemBlocks() - mem_base);
26329	    test_ret++;
26330            printf(" %d", n_value);
26331            printf("\n");
26332        }
26333    }
26334    function_tests++;
26335#endif
26336
26337    return(test_ret);
26338}
26339
26340
26341static int
26342test_xmlValidateNmtokenValue(void) {
26343    int test_ret = 0;
26344
26345#if defined(LIBXML_VALID_ENABLED)
26346    int mem_base;
26347    int ret_val;
26348    xmlChar * value; /* an Nmtoken value */
26349    int n_value;
26350
26351    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26352        mem_base = xmlMemBlocks();
26353        value = gen_const_xmlChar_ptr(n_value, 0);
26354
26355        ret_val = xmlValidateNmtokenValue((const xmlChar *)value);
26356        desret_int(ret_val);
26357        call_tests++;
26358        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26359        xmlResetLastError();
26360        if (mem_base != xmlMemBlocks()) {
26361            printf("Leak of %d blocks found in xmlValidateNmtokenValue",
26362	           xmlMemBlocks() - mem_base);
26363	    test_ret++;
26364            printf(" %d", n_value);
26365            printf("\n");
26366        }
26367    }
26368    function_tests++;
26369#endif
26370
26371    return(test_ret);
26372}
26373
26374
26375static int
26376test_xmlValidateNmtokensValue(void) {
26377    int test_ret = 0;
26378
26379#if defined(LIBXML_VALID_ENABLED)
26380    int mem_base;
26381    int ret_val;
26382    xmlChar * value; /* an Nmtokens value */
26383    int n_value;
26384
26385    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26386        mem_base = xmlMemBlocks();
26387        value = gen_const_xmlChar_ptr(n_value, 0);
26388
26389        ret_val = xmlValidateNmtokensValue((const xmlChar *)value);
26390        desret_int(ret_val);
26391        call_tests++;
26392        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
26393        xmlResetLastError();
26394        if (mem_base != xmlMemBlocks()) {
26395            printf("Leak of %d blocks found in xmlValidateNmtokensValue",
26396	           xmlMemBlocks() - mem_base);
26397	    test_ret++;
26398            printf(" %d", n_value);
26399            printf("\n");
26400        }
26401    }
26402    function_tests++;
26403#endif
26404
26405    return(test_ret);
26406}
26407
26408
26409static int
26410test_xmlValidateNotationDecl(void) {
26411    int test_ret = 0;
26412
26413#if defined(LIBXML_VALID_ENABLED)
26414    int mem_base;
26415    int ret_val;
26416    xmlValidCtxtPtr ctxt; /* the validation context */
26417    int n_ctxt;
26418    xmlDocPtr doc; /* a document instance */
26419    int n_doc;
26420    xmlNotationPtr nota; /* a notation definition */
26421    int n_nota;
26422
26423    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26424    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26425    for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) {
26426        mem_base = xmlMemBlocks();
26427        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26428        doc = gen_xmlDocPtr(n_doc, 1);
26429        nota = gen_xmlNotationPtr(n_nota, 2);
26430
26431        ret_val = xmlValidateNotationDecl(ctxt, doc, nota);
26432        desret_int(ret_val);
26433        call_tests++;
26434        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26435        des_xmlDocPtr(n_doc, doc, 1);
26436        des_xmlNotationPtr(n_nota, nota, 2);
26437        xmlResetLastError();
26438        if (mem_base != xmlMemBlocks()) {
26439            printf("Leak of %d blocks found in xmlValidateNotationDecl",
26440	           xmlMemBlocks() - mem_base);
26441	    test_ret++;
26442            printf(" %d", n_ctxt);
26443            printf(" %d", n_doc);
26444            printf(" %d", n_nota);
26445            printf("\n");
26446        }
26447    }
26448    }
26449    }
26450    function_tests++;
26451#endif
26452
26453    return(test_ret);
26454}
26455
26456
26457static int
26458test_xmlValidateNotationUse(void) {
26459    int test_ret = 0;
26460
26461#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
26462    int mem_base;
26463    int ret_val;
26464    xmlValidCtxtPtr ctxt; /* the validation context */
26465    int n_ctxt;
26466    xmlDocPtr doc; /* the document */
26467    int n_doc;
26468    xmlChar * notationName; /* the notation name to check */
26469    int n_notationName;
26470
26471    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26472    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26473    for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) {
26474        mem_base = xmlMemBlocks();
26475        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26476        doc = gen_xmlDocPtr(n_doc, 1);
26477        notationName = gen_const_xmlChar_ptr(n_notationName, 2);
26478
26479        ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName);
26480        desret_int(ret_val);
26481        call_tests++;
26482        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26483        des_xmlDocPtr(n_doc, doc, 1);
26484        des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2);
26485        xmlResetLastError();
26486        if (mem_base != xmlMemBlocks()) {
26487            printf("Leak of %d blocks found in xmlValidateNotationUse",
26488	           xmlMemBlocks() - mem_base);
26489	    test_ret++;
26490            printf(" %d", n_ctxt);
26491            printf(" %d", n_doc);
26492            printf(" %d", n_notationName);
26493            printf("\n");
26494        }
26495    }
26496    }
26497    }
26498    function_tests++;
26499#endif
26500
26501    return(test_ret);
26502}
26503
26504
26505static int
26506test_xmlValidateOneAttribute(void) {
26507    int test_ret = 0;
26508
26509#if defined(LIBXML_VALID_ENABLED)
26510    int mem_base;
26511    int ret_val;
26512    xmlValidCtxtPtr ctxt; /* the validation context */
26513    int n_ctxt;
26514    xmlDocPtr doc; /* a document instance */
26515    int n_doc;
26516    xmlNodePtr elem; /* an element instance */
26517    int n_elem;
26518    xmlAttrPtr attr; /* an attribute instance */
26519    int n_attr;
26520    xmlChar * value; /* the attribute value (without entities processing) */
26521    int n_value;
26522
26523    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26524    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26525    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26526    for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) {
26527    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26528        mem_base = xmlMemBlocks();
26529        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26530        doc = gen_xmlDocPtr(n_doc, 1);
26531        elem = gen_xmlNodePtr(n_elem, 2);
26532        attr = gen_xmlAttrPtr(n_attr, 3);
26533        value = gen_const_xmlChar_ptr(n_value, 4);
26534
26535        ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value);
26536        desret_int(ret_val);
26537        call_tests++;
26538        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26539        des_xmlDocPtr(n_doc, doc, 1);
26540        des_xmlNodePtr(n_elem, elem, 2);
26541        des_xmlAttrPtr(n_attr, attr, 3);
26542        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4);
26543        xmlResetLastError();
26544        if (mem_base != xmlMemBlocks()) {
26545            printf("Leak of %d blocks found in xmlValidateOneAttribute",
26546	           xmlMemBlocks() - mem_base);
26547	    test_ret++;
26548            printf(" %d", n_ctxt);
26549            printf(" %d", n_doc);
26550            printf(" %d", n_elem);
26551            printf(" %d", n_attr);
26552            printf(" %d", n_value);
26553            printf("\n");
26554        }
26555    }
26556    }
26557    }
26558    }
26559    }
26560    function_tests++;
26561#endif
26562
26563    return(test_ret);
26564}
26565
26566
26567static int
26568test_xmlValidateOneElement(void) {
26569    int test_ret = 0;
26570
26571#if defined(LIBXML_VALID_ENABLED)
26572    int mem_base;
26573    int ret_val;
26574    xmlValidCtxtPtr ctxt; /* the validation context */
26575    int n_ctxt;
26576    xmlDocPtr doc; /* a document instance */
26577    int n_doc;
26578    xmlNodePtr elem; /* an element instance */
26579    int n_elem;
26580
26581    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26582    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26583    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26584        mem_base = xmlMemBlocks();
26585        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26586        doc = gen_xmlDocPtr(n_doc, 1);
26587        elem = gen_xmlNodePtr(n_elem, 2);
26588
26589        ret_val = xmlValidateOneElement(ctxt, doc, elem);
26590        desret_int(ret_val);
26591        call_tests++;
26592        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26593        des_xmlDocPtr(n_doc, doc, 1);
26594        des_xmlNodePtr(n_elem, elem, 2);
26595        xmlResetLastError();
26596        if (mem_base != xmlMemBlocks()) {
26597            printf("Leak of %d blocks found in xmlValidateOneElement",
26598	           xmlMemBlocks() - mem_base);
26599	    test_ret++;
26600            printf(" %d", n_ctxt);
26601            printf(" %d", n_doc);
26602            printf(" %d", n_elem);
26603            printf("\n");
26604        }
26605    }
26606    }
26607    }
26608    function_tests++;
26609#endif
26610
26611    return(test_ret);
26612}
26613
26614
26615static int
26616test_xmlValidateOneNamespace(void) {
26617    int test_ret = 0;
26618
26619#if defined(LIBXML_VALID_ENABLED)
26620    int mem_base;
26621    int ret_val;
26622    xmlValidCtxtPtr ctxt; /* the validation context */
26623    int n_ctxt;
26624    xmlDocPtr doc; /* a document instance */
26625    int n_doc;
26626    xmlNodePtr elem; /* an element instance */
26627    int n_elem;
26628    xmlChar * prefix; /* the namespace prefix */
26629    int n_prefix;
26630    xmlNsPtr ns; /* an namespace declaration instance */
26631    int n_ns;
26632    xmlChar * value; /* the attribute value (without entities processing) */
26633    int n_value;
26634
26635    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26636    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26637    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26638    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
26639    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
26640    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
26641        mem_base = xmlMemBlocks();
26642        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26643        doc = gen_xmlDocPtr(n_doc, 1);
26644        elem = gen_xmlNodePtr(n_elem, 2);
26645        prefix = gen_const_xmlChar_ptr(n_prefix, 3);
26646        ns = gen_xmlNsPtr(n_ns, 4);
26647        value = gen_const_xmlChar_ptr(n_value, 5);
26648
26649        ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value);
26650        desret_int(ret_val);
26651        call_tests++;
26652        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26653        des_xmlDocPtr(n_doc, doc, 1);
26654        des_xmlNodePtr(n_elem, elem, 2);
26655        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3);
26656        des_xmlNsPtr(n_ns, ns, 4);
26657        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5);
26658        xmlResetLastError();
26659        if (mem_base != xmlMemBlocks()) {
26660            printf("Leak of %d blocks found in xmlValidateOneNamespace",
26661	           xmlMemBlocks() - mem_base);
26662	    test_ret++;
26663            printf(" %d", n_ctxt);
26664            printf(" %d", n_doc);
26665            printf(" %d", n_elem);
26666            printf(" %d", n_prefix);
26667            printf(" %d", n_ns);
26668            printf(" %d", n_value);
26669            printf("\n");
26670        }
26671    }
26672    }
26673    }
26674    }
26675    }
26676    }
26677    function_tests++;
26678#endif
26679
26680    return(test_ret);
26681}
26682
26683
26684static int
26685test_xmlValidatePopElement(void) {
26686    int test_ret = 0;
26687
26688#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26689    int mem_base;
26690    int ret_val;
26691    xmlValidCtxtPtr ctxt; /* the validation context */
26692    int n_ctxt;
26693    xmlDocPtr doc; /* a document instance */
26694    int n_doc;
26695    xmlNodePtr elem; /* an element instance */
26696    int n_elem;
26697    xmlChar * qname; /* the qualified name as appearing in the serialization */
26698    int n_qname;
26699
26700    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26701    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26702    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26703    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26704        mem_base = xmlMemBlocks();
26705        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26706        doc = gen_xmlDocPtr(n_doc, 1);
26707        elem = gen_xmlNodePtr(n_elem, 2);
26708        qname = gen_const_xmlChar_ptr(n_qname, 3);
26709
26710        ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname);
26711        desret_int(ret_val);
26712        call_tests++;
26713        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26714        des_xmlDocPtr(n_doc, doc, 1);
26715        des_xmlNodePtr(n_elem, elem, 2);
26716        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26717        xmlResetLastError();
26718        if (mem_base != xmlMemBlocks()) {
26719            printf("Leak of %d blocks found in xmlValidatePopElement",
26720	           xmlMemBlocks() - mem_base);
26721	    test_ret++;
26722            printf(" %d", n_ctxt);
26723            printf(" %d", n_doc);
26724            printf(" %d", n_elem);
26725            printf(" %d", n_qname);
26726            printf("\n");
26727        }
26728    }
26729    }
26730    }
26731    }
26732    function_tests++;
26733#endif
26734
26735    return(test_ret);
26736}
26737
26738
26739static int
26740test_xmlValidatePushCData(void) {
26741    int test_ret = 0;
26742
26743#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED)
26744    int mem_base;
26745    int ret_val;
26746    xmlValidCtxtPtr ctxt; /* the validation context */
26747    int n_ctxt;
26748    xmlChar * data; /* some character data read */
26749    int n_data;
26750    int len; /* the lenght of the data */
26751    int n_len;
26752
26753    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26754    for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) {
26755    for (n_len = 0;n_len < gen_nb_int;n_len++) {
26756        mem_base = xmlMemBlocks();
26757        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26758        data = gen_const_xmlChar_ptr(n_data, 1);
26759        len = gen_int(n_len, 2);
26760
26761        ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len);
26762        desret_int(ret_val);
26763        call_tests++;
26764        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26765        des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1);
26766        des_int(n_len, len, 2);
26767        xmlResetLastError();
26768        if (mem_base != xmlMemBlocks()) {
26769            printf("Leak of %d blocks found in xmlValidatePushCData",
26770	           xmlMemBlocks() - mem_base);
26771	    test_ret++;
26772            printf(" %d", n_ctxt);
26773            printf(" %d", n_data);
26774            printf(" %d", n_len);
26775            printf("\n");
26776        }
26777    }
26778    }
26779    }
26780    function_tests++;
26781#endif
26782
26783    return(test_ret);
26784}
26785
26786
26787static int
26788test_xmlValidatePushElement(void) {
26789    int test_ret = 0;
26790
26791#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_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 * qname; /* the qualified name as appearing in the serialization */
26801    int n_qname;
26802
26803    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26804    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26805    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
26806    for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) {
26807        mem_base = xmlMemBlocks();
26808        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26809        doc = gen_xmlDocPtr(n_doc, 1);
26810        elem = gen_xmlNodePtr(n_elem, 2);
26811        qname = gen_const_xmlChar_ptr(n_qname, 3);
26812
26813        ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname);
26814        desret_int(ret_val);
26815        call_tests++;
26816        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26817        des_xmlDocPtr(n_doc, doc, 1);
26818        des_xmlNodePtr(n_elem, elem, 2);
26819        des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3);
26820        xmlResetLastError();
26821        if (mem_base != xmlMemBlocks()) {
26822            printf("Leak of %d blocks found in xmlValidatePushElement",
26823	           xmlMemBlocks() - mem_base);
26824	    test_ret++;
26825            printf(" %d", n_ctxt);
26826            printf(" %d", n_doc);
26827            printf(" %d", n_elem);
26828            printf(" %d", n_qname);
26829            printf("\n");
26830        }
26831    }
26832    }
26833    }
26834    }
26835    function_tests++;
26836#endif
26837
26838    return(test_ret);
26839}
26840
26841
26842static int
26843test_xmlValidateRoot(void) {
26844    int test_ret = 0;
26845
26846#if defined(LIBXML_VALID_ENABLED)
26847    int mem_base;
26848    int ret_val;
26849    xmlValidCtxtPtr ctxt; /* the validation context */
26850    int n_ctxt;
26851    xmlDocPtr doc; /* a document instance */
26852    int n_doc;
26853
26854    for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
26855    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26856        mem_base = xmlMemBlocks();
26857        ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
26858        doc = gen_xmlDocPtr(n_doc, 1);
26859
26860        ret_val = xmlValidateRoot(ctxt, doc);
26861        desret_int(ret_val);
26862        call_tests++;
26863        des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
26864        des_xmlDocPtr(n_doc, doc, 1);
26865        xmlResetLastError();
26866        if (mem_base != xmlMemBlocks()) {
26867            printf("Leak of %d blocks found in xmlValidateRoot",
26868	           xmlMemBlocks() - mem_base);
26869	    test_ret++;
26870            printf(" %d", n_ctxt);
26871            printf(" %d", n_doc);
26872            printf("\n");
26873        }
26874    }
26875    }
26876    function_tests++;
26877#endif
26878
26879    return(test_ret);
26880}
26881
26882static int
26883test_valid(void) {
26884    int test_ret = 0;
26885
26886    if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n");
26887    test_ret += test_xmlAddAttributeDecl();
26888    test_ret += test_xmlAddElementDecl();
26889    test_ret += test_xmlAddID();
26890    test_ret += test_xmlAddNotationDecl();
26891    test_ret += test_xmlAddRef();
26892    test_ret += test_xmlCopyAttributeTable();
26893    test_ret += test_xmlCopyDocElementContent();
26894    test_ret += test_xmlCopyElementContent();
26895    test_ret += test_xmlCopyElementTable();
26896    test_ret += test_xmlCopyEnumeration();
26897    test_ret += test_xmlCopyNotationTable();
26898    test_ret += test_xmlCreateEnumeration();
26899    test_ret += test_xmlDumpAttributeDecl();
26900    test_ret += test_xmlDumpAttributeTable();
26901    test_ret += test_xmlDumpElementDecl();
26902    test_ret += test_xmlDumpElementTable();
26903    test_ret += test_xmlDumpNotationDecl();
26904    test_ret += test_xmlDumpNotationTable();
26905    test_ret += test_xmlGetDtdAttrDesc();
26906    test_ret += test_xmlGetDtdElementDesc();
26907    test_ret += test_xmlGetDtdNotationDesc();
26908    test_ret += test_xmlGetDtdQAttrDesc();
26909    test_ret += test_xmlGetDtdQElementDesc();
26910    test_ret += test_xmlGetID();
26911    test_ret += test_xmlGetRefs();
26912    test_ret += test_xmlIsID();
26913    test_ret += test_xmlIsMixedElement();
26914    test_ret += test_xmlIsRef();
26915    test_ret += test_xmlNewDocElementContent();
26916    test_ret += test_xmlNewElementContent();
26917    test_ret += test_xmlNewValidCtxt();
26918    test_ret += test_xmlRemoveID();
26919    test_ret += test_xmlRemoveRef();
26920    test_ret += test_xmlSnprintfElementContent();
26921    test_ret += test_xmlSprintfElementContent();
26922    test_ret += test_xmlValidBuildContentModel();
26923    test_ret += test_xmlValidCtxtNormalizeAttributeValue();
26924    test_ret += test_xmlValidGetPotentialChildren();
26925    test_ret += test_xmlValidGetValidElements();
26926    test_ret += test_xmlValidNormalizeAttributeValue();
26927    test_ret += test_xmlValidateAttributeDecl();
26928    test_ret += test_xmlValidateAttributeValue();
26929    test_ret += test_xmlValidateDocument();
26930    test_ret += test_xmlValidateDocumentFinal();
26931    test_ret += test_xmlValidateDtd();
26932    test_ret += test_xmlValidateDtdFinal();
26933    test_ret += test_xmlValidateElement();
26934    test_ret += test_xmlValidateElementDecl();
26935    test_ret += test_xmlValidateNameValue();
26936    test_ret += test_xmlValidateNamesValue();
26937    test_ret += test_xmlValidateNmtokenValue();
26938    test_ret += test_xmlValidateNmtokensValue();
26939    test_ret += test_xmlValidateNotationDecl();
26940    test_ret += test_xmlValidateNotationUse();
26941    test_ret += test_xmlValidateOneAttribute();
26942    test_ret += test_xmlValidateOneElement();
26943    test_ret += test_xmlValidateOneNamespace();
26944    test_ret += test_xmlValidatePopElement();
26945    test_ret += test_xmlValidatePushCData();
26946    test_ret += test_xmlValidatePushElement();
26947    test_ret += test_xmlValidateRoot();
26948
26949    if (test_ret != 0)
26950	printf("Module valid: %d errors\n", test_ret);
26951    return(test_ret);
26952}
26953
26954static int
26955test_xmlXIncludeNewContext(void) {
26956    int test_ret = 0;
26957
26958
26959    /* missing type support */
26960    return(test_ret);
26961}
26962
26963
26964static int
26965test_xmlXIncludeProcess(void) {
26966    int test_ret = 0;
26967
26968#if defined(LIBXML_XINCLUDE_ENABLED)
26969    int mem_base;
26970    int ret_val;
26971    xmlDocPtr doc; /* an XML document */
26972    int n_doc;
26973
26974    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
26975        mem_base = xmlMemBlocks();
26976        doc = gen_xmlDocPtr(n_doc, 0);
26977
26978        ret_val = xmlXIncludeProcess(doc);
26979        desret_int(ret_val);
26980        call_tests++;
26981        des_xmlDocPtr(n_doc, doc, 0);
26982        xmlResetLastError();
26983        if (mem_base != xmlMemBlocks()) {
26984            printf("Leak of %d blocks found in xmlXIncludeProcess",
26985	           xmlMemBlocks() - mem_base);
26986	    test_ret++;
26987            printf(" %d", n_doc);
26988            printf("\n");
26989        }
26990    }
26991    function_tests++;
26992#endif
26993
26994    return(test_ret);
26995}
26996
26997
26998static int
26999test_xmlXIncludeProcessFlags(void) {
27000    int test_ret = 0;
27001
27002#if defined(LIBXML_XINCLUDE_ENABLED)
27003    int mem_base;
27004    int ret_val;
27005    xmlDocPtr doc; /* an XML document */
27006    int n_doc;
27007    int flags; /* a set of xmlParserOption used for parsing XML includes */
27008    int n_flags;
27009
27010    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27011    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27012        mem_base = xmlMemBlocks();
27013        doc = gen_xmlDocPtr(n_doc, 0);
27014        flags = gen_int(n_flags, 1);
27015
27016        ret_val = xmlXIncludeProcessFlags(doc, flags);
27017        desret_int(ret_val);
27018        call_tests++;
27019        des_xmlDocPtr(n_doc, doc, 0);
27020        des_int(n_flags, flags, 1);
27021        xmlResetLastError();
27022        if (mem_base != xmlMemBlocks()) {
27023            printf("Leak of %d blocks found in xmlXIncludeProcessFlags",
27024	           xmlMemBlocks() - mem_base);
27025	    test_ret++;
27026            printf(" %d", n_doc);
27027            printf(" %d", n_flags);
27028            printf("\n");
27029        }
27030    }
27031    }
27032    function_tests++;
27033#endif
27034
27035    return(test_ret);
27036}
27037
27038
27039static int
27040test_xmlXIncludeProcessFlagsData(void) {
27041    int test_ret = 0;
27042
27043#if defined(LIBXML_XINCLUDE_ENABLED)
27044    int mem_base;
27045    int ret_val;
27046    xmlDocPtr doc; /* an XML document */
27047    int n_doc;
27048    int flags; /* a set of xmlParserOption used for parsing XML includes */
27049    int n_flags;
27050    void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */
27051    int n_data;
27052
27053    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
27054    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27055    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
27056        mem_base = xmlMemBlocks();
27057        doc = gen_xmlDocPtr(n_doc, 0);
27058        flags = gen_int(n_flags, 1);
27059        data = gen_userdata(n_data, 2);
27060
27061        ret_val = xmlXIncludeProcessFlagsData(doc, flags, data);
27062        desret_int(ret_val);
27063        call_tests++;
27064        des_xmlDocPtr(n_doc, doc, 0);
27065        des_int(n_flags, flags, 1);
27066        des_userdata(n_data, data, 2);
27067        xmlResetLastError();
27068        if (mem_base != xmlMemBlocks()) {
27069            printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData",
27070	           xmlMemBlocks() - mem_base);
27071	    test_ret++;
27072            printf(" %d", n_doc);
27073            printf(" %d", n_flags);
27074            printf(" %d", n_data);
27075            printf("\n");
27076        }
27077    }
27078    }
27079    }
27080    function_tests++;
27081#endif
27082
27083    return(test_ret);
27084}
27085
27086#ifdef LIBXML_XINCLUDE_ENABLED
27087
27088#define gen_nb_xmlXIncludeCtxtPtr 1
27089static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27090    return(NULL);
27091}
27092static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
27093}
27094#endif
27095
27096
27097static int
27098test_xmlXIncludeProcessNode(void) {
27099    int test_ret = 0;
27100
27101#if defined(LIBXML_XINCLUDE_ENABLED)
27102    int mem_base;
27103    int ret_val;
27104    xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */
27105    int n_ctxt;
27106    xmlNodePtr node; /* a node in an XML document */
27107    int n_node;
27108
27109    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27110    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
27111        mem_base = xmlMemBlocks();
27112        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27113        node = gen_xmlNodePtr(n_node, 1);
27114
27115        ret_val = xmlXIncludeProcessNode(ctxt, node);
27116        desret_int(ret_val);
27117        call_tests++;
27118        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27119        des_xmlNodePtr(n_node, node, 1);
27120        xmlResetLastError();
27121        if (mem_base != xmlMemBlocks()) {
27122            printf("Leak of %d blocks found in xmlXIncludeProcessNode",
27123	           xmlMemBlocks() - mem_base);
27124	    test_ret++;
27125            printf(" %d", n_ctxt);
27126            printf(" %d", n_node);
27127            printf("\n");
27128        }
27129    }
27130    }
27131    function_tests++;
27132#endif
27133
27134    return(test_ret);
27135}
27136
27137
27138static int
27139test_xmlXIncludeProcessTree(void) {
27140    int test_ret = 0;
27141
27142#if defined(LIBXML_XINCLUDE_ENABLED)
27143    int mem_base;
27144    int ret_val;
27145    xmlNodePtr tree; /* a node in an XML document */
27146    int n_tree;
27147
27148    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27149        mem_base = xmlMemBlocks();
27150        tree = gen_xmlNodePtr(n_tree, 0);
27151
27152        ret_val = xmlXIncludeProcessTree(tree);
27153        desret_int(ret_val);
27154        call_tests++;
27155        des_xmlNodePtr(n_tree, tree, 0);
27156        xmlResetLastError();
27157        if (mem_base != xmlMemBlocks()) {
27158            printf("Leak of %d blocks found in xmlXIncludeProcessTree",
27159	           xmlMemBlocks() - mem_base);
27160	    test_ret++;
27161            printf(" %d", n_tree);
27162            printf("\n");
27163        }
27164    }
27165    function_tests++;
27166#endif
27167
27168    return(test_ret);
27169}
27170
27171
27172static int
27173test_xmlXIncludeProcessTreeFlags(void) {
27174    int test_ret = 0;
27175
27176#if defined(LIBXML_XINCLUDE_ENABLED)
27177    int mem_base;
27178    int ret_val;
27179    xmlNodePtr tree; /* a node in an XML document */
27180    int n_tree;
27181    int flags; /* a set of xmlParserOption used for parsing XML includes */
27182    int n_flags;
27183
27184    for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) {
27185    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27186        mem_base = xmlMemBlocks();
27187        tree = gen_xmlNodePtr(n_tree, 0);
27188        flags = gen_int(n_flags, 1);
27189
27190        ret_val = xmlXIncludeProcessTreeFlags(tree, flags);
27191        desret_int(ret_val);
27192        call_tests++;
27193        des_xmlNodePtr(n_tree, tree, 0);
27194        des_int(n_flags, flags, 1);
27195        xmlResetLastError();
27196        if (mem_base != xmlMemBlocks()) {
27197            printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags",
27198	           xmlMemBlocks() - mem_base);
27199	    test_ret++;
27200            printf(" %d", n_tree);
27201            printf(" %d", n_flags);
27202            printf("\n");
27203        }
27204    }
27205    }
27206    function_tests++;
27207#endif
27208
27209    return(test_ret);
27210}
27211
27212
27213static int
27214test_xmlXIncludeSetFlags(void) {
27215    int test_ret = 0;
27216
27217#if defined(LIBXML_XINCLUDE_ENABLED)
27218    int mem_base;
27219    int ret_val;
27220    xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */
27221    int n_ctxt;
27222    int flags; /* a set of xmlParserOption used for parsing XML includes */
27223    int n_flags;
27224
27225    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) {
27226    for (n_flags = 0;n_flags < gen_nb_int;n_flags++) {
27227        mem_base = xmlMemBlocks();
27228        ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0);
27229        flags = gen_int(n_flags, 1);
27230
27231        ret_val = xmlXIncludeSetFlags(ctxt, flags);
27232        desret_int(ret_val);
27233        call_tests++;
27234        des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0);
27235        des_int(n_flags, flags, 1);
27236        xmlResetLastError();
27237        if (mem_base != xmlMemBlocks()) {
27238            printf("Leak of %d blocks found in xmlXIncludeSetFlags",
27239	           xmlMemBlocks() - mem_base);
27240	    test_ret++;
27241            printf(" %d", n_ctxt);
27242            printf(" %d", n_flags);
27243            printf("\n");
27244        }
27245    }
27246    }
27247    function_tests++;
27248#endif
27249
27250    return(test_ret);
27251}
27252
27253static int
27254test_xinclude(void) {
27255    int test_ret = 0;
27256
27257    if (quiet == 0) printf("Testing xinclude : 7 of 9 functions ...\n");
27258    test_ret += test_xmlXIncludeNewContext();
27259    test_ret += test_xmlXIncludeProcess();
27260    test_ret += test_xmlXIncludeProcessFlags();
27261    test_ret += test_xmlXIncludeProcessFlagsData();
27262    test_ret += test_xmlXIncludeProcessNode();
27263    test_ret += test_xmlXIncludeProcessTree();
27264    test_ret += test_xmlXIncludeProcessTreeFlags();
27265    test_ret += test_xmlXIncludeSetFlags();
27266
27267    if (test_ret != 0)
27268	printf("Module xinclude: %d errors\n", test_ret);
27269    return(test_ret);
27270}
27271
27272static int
27273test_xmlAllocOutputBuffer(void) {
27274    int test_ret = 0;
27275
27276#if defined(LIBXML_OUTPUT_ENABLED)
27277    int mem_base;
27278    xmlOutputBufferPtr ret_val;
27279    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27280    int n_encoder;
27281
27282    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27283        mem_base = xmlMemBlocks();
27284        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0);
27285
27286        ret_val = xmlAllocOutputBuffer(encoder);
27287        desret_xmlOutputBufferPtr(ret_val);
27288        call_tests++;
27289        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0);
27290        xmlResetLastError();
27291        if (mem_base != xmlMemBlocks()) {
27292            printf("Leak of %d blocks found in xmlAllocOutputBuffer",
27293	           xmlMemBlocks() - mem_base);
27294	    test_ret++;
27295            printf(" %d", n_encoder);
27296            printf("\n");
27297        }
27298    }
27299    function_tests++;
27300#endif
27301
27302    return(test_ret);
27303}
27304
27305
27306static int
27307test_xmlAllocParserInputBuffer(void) {
27308    int test_ret = 0;
27309
27310    int mem_base;
27311    xmlParserInputBufferPtr ret_val;
27312    xmlCharEncoding enc; /* the charset encoding if known */
27313    int n_enc;
27314
27315    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
27316        mem_base = xmlMemBlocks();
27317        enc = gen_xmlCharEncoding(n_enc, 0);
27318
27319        ret_val = xmlAllocParserInputBuffer(enc);
27320        desret_xmlParserInputBufferPtr(ret_val);
27321        call_tests++;
27322        des_xmlCharEncoding(n_enc, enc, 0);
27323        xmlResetLastError();
27324        if (mem_base != xmlMemBlocks()) {
27325            printf("Leak of %d blocks found in xmlAllocParserInputBuffer",
27326	           xmlMemBlocks() - mem_base);
27327	    test_ret++;
27328            printf(" %d", n_enc);
27329            printf("\n");
27330        }
27331    }
27332    function_tests++;
27333
27334    return(test_ret);
27335}
27336
27337
27338static int
27339test_xmlCheckFilename(void) {
27340    int test_ret = 0;
27341
27342    int mem_base;
27343    int ret_val;
27344    char * path; /* the path to check */
27345    int n_path;
27346
27347    for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) {
27348        mem_base = xmlMemBlocks();
27349        path = gen_const_char_ptr(n_path, 0);
27350
27351        ret_val = xmlCheckFilename((const char *)path);
27352        desret_int(ret_val);
27353        call_tests++;
27354        des_const_char_ptr(n_path, (const char *)path, 0);
27355        xmlResetLastError();
27356        if (mem_base != xmlMemBlocks()) {
27357            printf("Leak of %d blocks found in xmlCheckFilename",
27358	           xmlMemBlocks() - mem_base);
27359	    test_ret++;
27360            printf(" %d", n_path);
27361            printf("\n");
27362        }
27363    }
27364    function_tests++;
27365
27366    return(test_ret);
27367}
27368
27369
27370static int
27371test_xmlCheckHTTPInput(void) {
27372    int test_ret = 0;
27373
27374    int mem_base;
27375    xmlParserInputPtr ret_val;
27376    xmlParserCtxtPtr ctxt; /* an XML parser context */
27377    int n_ctxt;
27378    xmlParserInputPtr ret; /* an XML parser input */
27379    int n_ret;
27380
27381    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27382    for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) {
27383        mem_base = xmlMemBlocks();
27384        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
27385        ret = gen_xmlParserInputPtr(n_ret, 1);
27386
27387        ret_val = xmlCheckHTTPInput(ctxt, ret);
27388        desret_xmlParserInputPtr(ret_val);
27389        call_tests++;
27390        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
27391        des_xmlParserInputPtr(n_ret, ret, 1);
27392        xmlResetLastError();
27393        if (mem_base != xmlMemBlocks()) {
27394            printf("Leak of %d blocks found in xmlCheckHTTPInput",
27395	           xmlMemBlocks() - mem_base);
27396	    test_ret++;
27397            printf(" %d", n_ctxt);
27398            printf(" %d", n_ret);
27399            printf("\n");
27400        }
27401    }
27402    }
27403    function_tests++;
27404
27405    return(test_ret);
27406}
27407
27408
27409static int
27410test_xmlCleanupInputCallbacks(void) {
27411    int test_ret = 0;
27412
27413    int mem_base;
27414
27415        mem_base = xmlMemBlocks();
27416
27417        xmlCleanupInputCallbacks();
27418        call_tests++;
27419        xmlResetLastError();
27420        if (mem_base != xmlMemBlocks()) {
27421            printf("Leak of %d blocks found in xmlCleanupInputCallbacks",
27422	           xmlMemBlocks() - mem_base);
27423	    test_ret++;
27424            printf("\n");
27425        }
27426    function_tests++;
27427
27428    return(test_ret);
27429}
27430
27431
27432static int
27433test_xmlCleanupOutputCallbacks(void) {
27434    int test_ret = 0;
27435
27436#if defined(LIBXML_OUTPUT_ENABLED)
27437    int mem_base;
27438
27439        mem_base = xmlMemBlocks();
27440
27441        xmlCleanupOutputCallbacks();
27442        call_tests++;
27443        xmlResetLastError();
27444        if (mem_base != xmlMemBlocks()) {
27445            printf("Leak of %d blocks found in xmlCleanupOutputCallbacks",
27446	           xmlMemBlocks() - mem_base);
27447	    test_ret++;
27448            printf("\n");
27449        }
27450    function_tests++;
27451#endif
27452
27453    return(test_ret);
27454}
27455
27456
27457static int
27458test_xmlFileClose(void) {
27459    int test_ret = 0;
27460
27461    int mem_base;
27462    int ret_val;
27463    void * context; /* the I/O context */
27464    int n_context;
27465
27466    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27467        mem_base = xmlMemBlocks();
27468        context = gen_void_ptr(n_context, 0);
27469
27470        ret_val = xmlFileClose(context);
27471        desret_int(ret_val);
27472        call_tests++;
27473        des_void_ptr(n_context, context, 0);
27474        xmlResetLastError();
27475        if (mem_base != xmlMemBlocks()) {
27476            printf("Leak of %d blocks found in xmlFileClose",
27477	           xmlMemBlocks() - mem_base);
27478	    test_ret++;
27479            printf(" %d", n_context);
27480            printf("\n");
27481        }
27482    }
27483    function_tests++;
27484
27485    return(test_ret);
27486}
27487
27488
27489static int
27490test_xmlFileMatch(void) {
27491    int test_ret = 0;
27492
27493    int mem_base;
27494    int ret_val;
27495    const char * filename; /* the URI for matching */
27496    int n_filename;
27497
27498    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27499        mem_base = xmlMemBlocks();
27500        filename = gen_filepath(n_filename, 0);
27501
27502        ret_val = xmlFileMatch(filename);
27503        desret_int(ret_val);
27504        call_tests++;
27505        des_filepath(n_filename, filename, 0);
27506        xmlResetLastError();
27507        if (mem_base != xmlMemBlocks()) {
27508            printf("Leak of %d blocks found in xmlFileMatch",
27509	           xmlMemBlocks() - mem_base);
27510	    test_ret++;
27511            printf(" %d", n_filename);
27512            printf("\n");
27513        }
27514    }
27515    function_tests++;
27516
27517    return(test_ret);
27518}
27519
27520
27521static int
27522test_xmlFileOpen(void) {
27523    int test_ret = 0;
27524
27525    int mem_base;
27526    void * ret_val;
27527    const char * filename; /* the URI for matching */
27528    int n_filename;
27529
27530    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27531        mem_base = xmlMemBlocks();
27532        filename = gen_filepath(n_filename, 0);
27533
27534        ret_val = xmlFileOpen(filename);
27535        desret_void_ptr(ret_val);
27536        call_tests++;
27537        des_filepath(n_filename, filename, 0);
27538        xmlResetLastError();
27539        if (mem_base != xmlMemBlocks()) {
27540            printf("Leak of %d blocks found in xmlFileOpen",
27541	           xmlMemBlocks() - mem_base);
27542	    test_ret++;
27543            printf(" %d", n_filename);
27544            printf("\n");
27545        }
27546    }
27547    function_tests++;
27548
27549    return(test_ret);
27550}
27551
27552
27553static int
27554test_xmlFileRead(void) {
27555    int test_ret = 0;
27556
27557    int mem_base;
27558    int ret_val;
27559    void * context; /* the I/O context */
27560    int n_context;
27561    char * buffer; /* where to drop data */
27562    int n_buffer;
27563    int len; /* number of bytes to write */
27564    int n_len;
27565
27566    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27567    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27568    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27569        mem_base = xmlMemBlocks();
27570        context = gen_void_ptr(n_context, 0);
27571        buffer = gen_char_ptr(n_buffer, 1);
27572        len = gen_int(n_len, 2);
27573
27574        ret_val = xmlFileRead(context, buffer, len);
27575        desret_int(ret_val);
27576        call_tests++;
27577        des_void_ptr(n_context, context, 0);
27578        des_char_ptr(n_buffer, buffer, 1);
27579        des_int(n_len, len, 2);
27580        xmlResetLastError();
27581        if (mem_base != xmlMemBlocks()) {
27582            printf("Leak of %d blocks found in xmlFileRead",
27583	           xmlMemBlocks() - mem_base);
27584	    test_ret++;
27585            printf(" %d", n_context);
27586            printf(" %d", n_buffer);
27587            printf(" %d", n_len);
27588            printf("\n");
27589        }
27590    }
27591    }
27592    }
27593    function_tests++;
27594
27595    return(test_ret);
27596}
27597
27598
27599static int
27600test_xmlIOFTPClose(void) {
27601    int test_ret = 0;
27602
27603#if defined(LIBXML_FTP_ENABLED)
27604    int mem_base;
27605    int ret_val;
27606    void * context; /* the I/O context */
27607    int n_context;
27608
27609    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27610        mem_base = xmlMemBlocks();
27611        context = gen_void_ptr(n_context, 0);
27612
27613        ret_val = xmlIOFTPClose(context);
27614        desret_int(ret_val);
27615        call_tests++;
27616        des_void_ptr(n_context, context, 0);
27617        xmlResetLastError();
27618        if (mem_base != xmlMemBlocks()) {
27619            printf("Leak of %d blocks found in xmlIOFTPClose",
27620	           xmlMemBlocks() - mem_base);
27621	    test_ret++;
27622            printf(" %d", n_context);
27623            printf("\n");
27624        }
27625    }
27626    function_tests++;
27627#endif
27628
27629    return(test_ret);
27630}
27631
27632
27633static int
27634test_xmlIOFTPMatch(void) {
27635    int test_ret = 0;
27636
27637#if defined(LIBXML_FTP_ENABLED)
27638    int mem_base;
27639    int ret_val;
27640    const char * filename; /* the URI for matching */
27641    int n_filename;
27642
27643    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27644        mem_base = xmlMemBlocks();
27645        filename = gen_filepath(n_filename, 0);
27646
27647        ret_val = xmlIOFTPMatch(filename);
27648        desret_int(ret_val);
27649        call_tests++;
27650        des_filepath(n_filename, filename, 0);
27651        xmlResetLastError();
27652        if (mem_base != xmlMemBlocks()) {
27653            printf("Leak of %d blocks found in xmlIOFTPMatch",
27654	           xmlMemBlocks() - mem_base);
27655	    test_ret++;
27656            printf(" %d", n_filename);
27657            printf("\n");
27658        }
27659    }
27660    function_tests++;
27661#endif
27662
27663    return(test_ret);
27664}
27665
27666
27667static int
27668test_xmlIOFTPOpen(void) {
27669    int test_ret = 0;
27670
27671#if defined(LIBXML_FTP_ENABLED)
27672    int mem_base;
27673    void * ret_val;
27674    const char * filename; /* the URI for matching */
27675    int n_filename;
27676
27677    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27678        mem_base = xmlMemBlocks();
27679        filename = gen_filepath(n_filename, 0);
27680
27681        ret_val = xmlIOFTPOpen(filename);
27682        desret_void_ptr(ret_val);
27683        call_tests++;
27684        des_filepath(n_filename, filename, 0);
27685        xmlResetLastError();
27686        if (mem_base != xmlMemBlocks()) {
27687            printf("Leak of %d blocks found in xmlIOFTPOpen",
27688	           xmlMemBlocks() - mem_base);
27689	    test_ret++;
27690            printf(" %d", n_filename);
27691            printf("\n");
27692        }
27693    }
27694    function_tests++;
27695#endif
27696
27697    return(test_ret);
27698}
27699
27700
27701static int
27702test_xmlIOFTPRead(void) {
27703    int test_ret = 0;
27704
27705#if defined(LIBXML_FTP_ENABLED)
27706    int mem_base;
27707    int ret_val;
27708    void * context; /* the I/O context */
27709    int n_context;
27710    char * buffer; /* where to drop data */
27711    int n_buffer;
27712    int len; /* number of bytes to write */
27713    int n_len;
27714
27715    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27716    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27717    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27718        mem_base = xmlMemBlocks();
27719        context = gen_void_ptr(n_context, 0);
27720        buffer = gen_char_ptr(n_buffer, 1);
27721        len = gen_int(n_len, 2);
27722
27723        ret_val = xmlIOFTPRead(context, buffer, len);
27724        desret_int(ret_val);
27725        call_tests++;
27726        des_void_ptr(n_context, context, 0);
27727        des_char_ptr(n_buffer, buffer, 1);
27728        des_int(n_len, len, 2);
27729        xmlResetLastError();
27730        if (mem_base != xmlMemBlocks()) {
27731            printf("Leak of %d blocks found in xmlIOFTPRead",
27732	           xmlMemBlocks() - mem_base);
27733	    test_ret++;
27734            printf(" %d", n_context);
27735            printf(" %d", n_buffer);
27736            printf(" %d", n_len);
27737            printf("\n");
27738        }
27739    }
27740    }
27741    }
27742    function_tests++;
27743#endif
27744
27745    return(test_ret);
27746}
27747
27748
27749static int
27750test_xmlIOHTTPClose(void) {
27751    int test_ret = 0;
27752
27753#if defined(LIBXML_HTTP_ENABLED)
27754    int mem_base;
27755    int ret_val;
27756    void * context; /* the I/O context */
27757    int n_context;
27758
27759    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27760        mem_base = xmlMemBlocks();
27761        context = gen_void_ptr(n_context, 0);
27762
27763        ret_val = xmlIOHTTPClose(context);
27764        desret_int(ret_val);
27765        call_tests++;
27766        des_void_ptr(n_context, context, 0);
27767        xmlResetLastError();
27768        if (mem_base != xmlMemBlocks()) {
27769            printf("Leak of %d blocks found in xmlIOHTTPClose",
27770	           xmlMemBlocks() - mem_base);
27771	    test_ret++;
27772            printf(" %d", n_context);
27773            printf("\n");
27774        }
27775    }
27776    function_tests++;
27777#endif
27778
27779    return(test_ret);
27780}
27781
27782
27783static int
27784test_xmlIOHTTPMatch(void) {
27785    int test_ret = 0;
27786
27787#if defined(LIBXML_HTTP_ENABLED)
27788    int mem_base;
27789    int ret_val;
27790    const char * filename; /* the URI for matching */
27791    int n_filename;
27792
27793    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27794        mem_base = xmlMemBlocks();
27795        filename = gen_filepath(n_filename, 0);
27796
27797        ret_val = xmlIOHTTPMatch(filename);
27798        desret_int(ret_val);
27799        call_tests++;
27800        des_filepath(n_filename, filename, 0);
27801        xmlResetLastError();
27802        if (mem_base != xmlMemBlocks()) {
27803            printf("Leak of %d blocks found in xmlIOHTTPMatch",
27804	           xmlMemBlocks() - mem_base);
27805	    test_ret++;
27806            printf(" %d", n_filename);
27807            printf("\n");
27808        }
27809    }
27810    function_tests++;
27811#endif
27812
27813    return(test_ret);
27814}
27815
27816
27817static int
27818test_xmlIOHTTPOpen(void) {
27819    int test_ret = 0;
27820
27821#if defined(LIBXML_HTTP_ENABLED)
27822    int mem_base;
27823    void * ret_val;
27824    const char * filename; /* the URI for matching */
27825    int n_filename;
27826
27827    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
27828        mem_base = xmlMemBlocks();
27829        filename = gen_filepath(n_filename, 0);
27830
27831        ret_val = xmlIOHTTPOpen(filename);
27832        desret_xmlNanoHTTPCtxtPtr(ret_val);
27833        call_tests++;
27834        des_filepath(n_filename, filename, 0);
27835        xmlResetLastError();
27836        if (mem_base != xmlMemBlocks()) {
27837            printf("Leak of %d blocks found in xmlIOHTTPOpen",
27838	           xmlMemBlocks() - mem_base);
27839	    test_ret++;
27840            printf(" %d", n_filename);
27841            printf("\n");
27842        }
27843    }
27844    function_tests++;
27845#endif
27846
27847    return(test_ret);
27848}
27849
27850
27851static int
27852test_xmlIOHTTPRead(void) {
27853    int test_ret = 0;
27854
27855#if defined(LIBXML_HTTP_ENABLED)
27856    int mem_base;
27857    int ret_val;
27858    void * context; /* the I/O context */
27859    int n_context;
27860    char * buffer; /* where to drop data */
27861    int n_buffer;
27862    int len; /* number of bytes to write */
27863    int n_len;
27864
27865    for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) {
27866    for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) {
27867    for (n_len = 0;n_len < gen_nb_int;n_len++) {
27868        mem_base = xmlMemBlocks();
27869        context = gen_void_ptr(n_context, 0);
27870        buffer = gen_char_ptr(n_buffer, 1);
27871        len = gen_int(n_len, 2);
27872
27873        ret_val = xmlIOHTTPRead(context, buffer, len);
27874        desret_int(ret_val);
27875        call_tests++;
27876        des_void_ptr(n_context, context, 0);
27877        des_char_ptr(n_buffer, buffer, 1);
27878        des_int(n_len, len, 2);
27879        xmlResetLastError();
27880        if (mem_base != xmlMemBlocks()) {
27881            printf("Leak of %d blocks found in xmlIOHTTPRead",
27882	           xmlMemBlocks() - mem_base);
27883	    test_ret++;
27884            printf(" %d", n_context);
27885            printf(" %d", n_buffer);
27886            printf(" %d", n_len);
27887            printf("\n");
27888        }
27889    }
27890    }
27891    }
27892    function_tests++;
27893#endif
27894
27895    return(test_ret);
27896}
27897
27898
27899static int
27900test_xmlNoNetExternalEntityLoader(void) {
27901    int test_ret = 0;
27902
27903    int mem_base;
27904    xmlParserInputPtr ret_val;
27905    const char * URL; /* the URL for the entity to load */
27906    int n_URL;
27907    char * ID; /* the System ID for the entity to load */
27908    int n_ID;
27909    xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */
27910    int n_ctxt;
27911
27912    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
27913    for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) {
27914    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
27915        mem_base = xmlMemBlocks();
27916        URL = gen_filepath(n_URL, 0);
27917        ID = gen_const_char_ptr(n_ID, 1);
27918        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2);
27919
27920        ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt);
27921        desret_xmlParserInputPtr(ret_val);
27922        call_tests++;
27923        des_filepath(n_URL, URL, 0);
27924        des_const_char_ptr(n_ID, (const char *)ID, 1);
27925        des_xmlParserCtxtPtr(n_ctxt, ctxt, 2);
27926        xmlResetLastError();
27927        if (mem_base != xmlMemBlocks()) {
27928            printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader",
27929	           xmlMemBlocks() - mem_base);
27930	    test_ret++;
27931            printf(" %d", n_URL);
27932            printf(" %d", n_ID);
27933            printf(" %d", n_ctxt);
27934            printf("\n");
27935        }
27936    }
27937    }
27938    }
27939    function_tests++;
27940
27941    return(test_ret);
27942}
27943
27944
27945static int
27946test_xmlNormalizeWindowsPath(void) {
27947    int test_ret = 0;
27948
27949    int mem_base;
27950    xmlChar * ret_val;
27951    xmlChar * path; /* the input file path */
27952    int n_path;
27953
27954    for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) {
27955        mem_base = xmlMemBlocks();
27956        path = gen_const_xmlChar_ptr(n_path, 0);
27957
27958        ret_val = xmlNormalizeWindowsPath((const xmlChar *)path);
27959        desret_xmlChar_ptr(ret_val);
27960        call_tests++;
27961        des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0);
27962        xmlResetLastError();
27963        if (mem_base != xmlMemBlocks()) {
27964            printf("Leak of %d blocks found in xmlNormalizeWindowsPath",
27965	           xmlMemBlocks() - mem_base);
27966	    test_ret++;
27967            printf(" %d", n_path);
27968            printf("\n");
27969        }
27970    }
27971    function_tests++;
27972
27973    return(test_ret);
27974}
27975
27976
27977static int
27978test_xmlOutputBufferCreateBuffer(void) {
27979    int test_ret = 0;
27980
27981#if defined(LIBXML_OUTPUT_ENABLED)
27982    int mem_base;
27983    xmlOutputBufferPtr ret_val;
27984    xmlBufferPtr buffer; /* a xmlBufferPtr */
27985    int n_buffer;
27986    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
27987    int n_encoder;
27988
27989    for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) {
27990    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
27991        mem_base = xmlMemBlocks();
27992        buffer = gen_xmlBufferPtr(n_buffer, 0);
27993        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
27994
27995        ret_val = xmlOutputBufferCreateBuffer(buffer, encoder);
27996        desret_xmlOutputBufferPtr(ret_val);
27997        call_tests++;
27998        des_xmlBufferPtr(n_buffer, buffer, 0);
27999        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28000        xmlResetLastError();
28001        if (mem_base != xmlMemBlocks()) {
28002            printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer",
28003	           xmlMemBlocks() - mem_base);
28004	    test_ret++;
28005            printf(" %d", n_buffer);
28006            printf(" %d", n_encoder);
28007            printf("\n");
28008        }
28009    }
28010    }
28011    function_tests++;
28012#endif
28013
28014    return(test_ret);
28015}
28016
28017
28018static int
28019test_xmlOutputBufferCreateFd(void) {
28020    int test_ret = 0;
28021
28022#if defined(LIBXML_OUTPUT_ENABLED)
28023    int mem_base;
28024    xmlOutputBufferPtr ret_val;
28025    int fd; /* a file descriptor number */
28026    int n_fd;
28027    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28028    int n_encoder;
28029
28030    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28031    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28032        mem_base = xmlMemBlocks();
28033        fd = gen_int(n_fd, 0);
28034        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28035
28036        ret_val = xmlOutputBufferCreateFd(fd, encoder);
28037        desret_xmlOutputBufferPtr(ret_val);
28038        call_tests++;
28039        des_int(n_fd, fd, 0);
28040        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28041        xmlResetLastError();
28042        if (mem_base != xmlMemBlocks()) {
28043            printf("Leak of %d blocks found in xmlOutputBufferCreateFd",
28044	           xmlMemBlocks() - mem_base);
28045	    test_ret++;
28046            printf(" %d", n_fd);
28047            printf(" %d", n_encoder);
28048            printf("\n");
28049        }
28050    }
28051    }
28052    function_tests++;
28053#endif
28054
28055    return(test_ret);
28056}
28057
28058
28059static int
28060test_xmlOutputBufferCreateFile(void) {
28061    int test_ret = 0;
28062
28063#if defined(LIBXML_OUTPUT_ENABLED)
28064    int mem_base;
28065    xmlOutputBufferPtr ret_val;
28066    FILE * file; /* a FILE* */
28067    int n_file;
28068    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28069    int n_encoder;
28070
28071    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28072    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28073        mem_base = xmlMemBlocks();
28074        file = gen_FILE_ptr(n_file, 0);
28075        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28076
28077        ret_val = xmlOutputBufferCreateFile(file, encoder);
28078        desret_xmlOutputBufferPtr(ret_val);
28079        call_tests++;
28080        des_FILE_ptr(n_file, file, 0);
28081        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28082        xmlResetLastError();
28083        if (mem_base != xmlMemBlocks()) {
28084            printf("Leak of %d blocks found in xmlOutputBufferCreateFile",
28085	           xmlMemBlocks() - mem_base);
28086	    test_ret++;
28087            printf(" %d", n_file);
28088            printf(" %d", n_encoder);
28089            printf("\n");
28090        }
28091    }
28092    }
28093    function_tests++;
28094#endif
28095
28096    return(test_ret);
28097}
28098
28099
28100static int
28101test_xmlOutputBufferCreateFilename(void) {
28102    int test_ret = 0;
28103
28104#if defined(LIBXML_OUTPUT_ENABLED)
28105    int mem_base;
28106    xmlOutputBufferPtr ret_val;
28107    const char * URI; /* a C string containing the URI or filename */
28108    int n_URI;
28109    xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */
28110    int n_encoder;
28111    int compression; /* the compression ration (0 none, 9 max). */
28112    int n_compression;
28113
28114    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28115    for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) {
28116    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
28117        mem_base = xmlMemBlocks();
28118        URI = gen_fileoutput(n_URI, 0);
28119        encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1);
28120        compression = gen_int(n_compression, 2);
28121
28122        ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression);
28123        desret_xmlOutputBufferPtr(ret_val);
28124        call_tests++;
28125        des_fileoutput(n_URI, URI, 0);
28126        des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1);
28127        des_int(n_compression, compression, 2);
28128        xmlResetLastError();
28129        if (mem_base != xmlMemBlocks()) {
28130            printf("Leak of %d blocks found in xmlOutputBufferCreateFilename",
28131	           xmlMemBlocks() - mem_base);
28132	    test_ret++;
28133            printf(" %d", n_URI);
28134            printf(" %d", n_encoder);
28135            printf(" %d", n_compression);
28136            printf("\n");
28137        }
28138    }
28139    }
28140    }
28141    function_tests++;
28142#endif
28143
28144    return(test_ret);
28145}
28146
28147
28148static int
28149test_xmlOutputBufferFlush(void) {
28150    int test_ret = 0;
28151
28152#if defined(LIBXML_OUTPUT_ENABLED)
28153    int mem_base;
28154    int ret_val;
28155    xmlOutputBufferPtr out; /* a buffered output */
28156    int n_out;
28157
28158    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28159        mem_base = xmlMemBlocks();
28160        out = gen_xmlOutputBufferPtr(n_out, 0);
28161
28162        ret_val = xmlOutputBufferFlush(out);
28163        desret_int(ret_val);
28164        call_tests++;
28165        des_xmlOutputBufferPtr(n_out, out, 0);
28166        xmlResetLastError();
28167        if (mem_base != xmlMemBlocks()) {
28168            printf("Leak of %d blocks found in xmlOutputBufferFlush",
28169	           xmlMemBlocks() - mem_base);
28170	    test_ret++;
28171            printf(" %d", n_out);
28172            printf("\n");
28173        }
28174    }
28175    function_tests++;
28176#endif
28177
28178    return(test_ret);
28179}
28180
28181
28182static int
28183test_xmlOutputBufferWrite(void) {
28184    int test_ret = 0;
28185
28186#if defined(LIBXML_OUTPUT_ENABLED)
28187    int mem_base;
28188    int ret_val;
28189    xmlOutputBufferPtr out; /* a buffered parser output */
28190    int n_out;
28191    int len; /* the size in bytes of the array. */
28192    int n_len;
28193    char * buf; /* an char array */
28194    int n_buf;
28195
28196    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28197    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28198    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28199        mem_base = xmlMemBlocks();
28200        out = gen_xmlOutputBufferPtr(n_out, 0);
28201        len = gen_int(n_len, 1);
28202        buf = gen_const_char_ptr(n_buf, 2);
28203
28204        ret_val = xmlOutputBufferWrite(out, len, (const char *)buf);
28205        desret_int(ret_val);
28206        call_tests++;
28207        des_xmlOutputBufferPtr(n_out, out, 0);
28208        des_int(n_len, len, 1);
28209        des_const_char_ptr(n_buf, (const char *)buf, 2);
28210        xmlResetLastError();
28211        if (mem_base != xmlMemBlocks()) {
28212            printf("Leak of %d blocks found in xmlOutputBufferWrite",
28213	           xmlMemBlocks() - mem_base);
28214	    test_ret++;
28215            printf(" %d", n_out);
28216            printf(" %d", n_len);
28217            printf(" %d", n_buf);
28218            printf("\n");
28219        }
28220    }
28221    }
28222    }
28223    function_tests++;
28224#endif
28225
28226    return(test_ret);
28227}
28228
28229
28230static int
28231test_xmlOutputBufferWriteEscape(void) {
28232    int test_ret = 0;
28233
28234
28235    /* missing type support */
28236    return(test_ret);
28237}
28238
28239
28240static int
28241test_xmlOutputBufferWriteString(void) {
28242    int test_ret = 0;
28243
28244#if defined(LIBXML_OUTPUT_ENABLED)
28245    int mem_base;
28246    int ret_val;
28247    xmlOutputBufferPtr out; /* a buffered parser output */
28248    int n_out;
28249    char * str; /* a zero terminated C string */
28250    int n_str;
28251
28252    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
28253    for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) {
28254        mem_base = xmlMemBlocks();
28255        out = gen_xmlOutputBufferPtr(n_out, 0);
28256        str = gen_const_char_ptr(n_str, 1);
28257
28258        ret_val = xmlOutputBufferWriteString(out, (const char *)str);
28259        desret_int(ret_val);
28260        call_tests++;
28261        des_xmlOutputBufferPtr(n_out, out, 0);
28262        des_const_char_ptr(n_str, (const char *)str, 1);
28263        xmlResetLastError();
28264        if (mem_base != xmlMemBlocks()) {
28265            printf("Leak of %d blocks found in xmlOutputBufferWriteString",
28266	           xmlMemBlocks() - mem_base);
28267	    test_ret++;
28268            printf(" %d", n_out);
28269            printf(" %d", n_str);
28270            printf("\n");
28271        }
28272    }
28273    }
28274    function_tests++;
28275#endif
28276
28277    return(test_ret);
28278}
28279
28280
28281static int
28282test_xmlParserGetDirectory(void) {
28283    int test_ret = 0;
28284
28285
28286    /* missing type support */
28287    return(test_ret);
28288}
28289
28290
28291static int
28292test_xmlParserInputBufferCreateFd(void) {
28293    int test_ret = 0;
28294
28295    int mem_base;
28296    xmlParserInputBufferPtr ret_val;
28297    int fd; /* a file descriptor number */
28298    int n_fd;
28299    xmlCharEncoding enc; /* the charset encoding if known */
28300    int n_enc;
28301
28302    for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28303    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28304        mem_base = xmlMemBlocks();
28305        fd = gen_int(n_fd, 0);
28306        enc = gen_xmlCharEncoding(n_enc, 1);
28307        if (fd >= 0) fd = -1;
28308
28309        ret_val = xmlParserInputBufferCreateFd(fd, enc);
28310        desret_xmlParserInputBufferPtr(ret_val);
28311        call_tests++;
28312        des_int(n_fd, fd, 0);
28313        des_xmlCharEncoding(n_enc, enc, 1);
28314        xmlResetLastError();
28315        if (mem_base != xmlMemBlocks()) {
28316            printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28317	           xmlMemBlocks() - mem_base);
28318	    test_ret++;
28319            printf(" %d", n_fd);
28320            printf(" %d", n_enc);
28321            printf("\n");
28322        }
28323    }
28324    }
28325    function_tests++;
28326
28327    return(test_ret);
28328}
28329
28330
28331static int
28332test_xmlParserInputBufferCreateFile(void) {
28333    int test_ret = 0;
28334
28335    int mem_base;
28336    xmlParserInputBufferPtr ret_val;
28337    FILE * file; /* a FILE* */
28338    int n_file;
28339    xmlCharEncoding enc; /* the charset encoding if known */
28340    int n_enc;
28341
28342    for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) {
28343    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28344        mem_base = xmlMemBlocks();
28345        file = gen_FILE_ptr(n_file, 0);
28346        enc = gen_xmlCharEncoding(n_enc, 1);
28347
28348        ret_val = xmlParserInputBufferCreateFile(file, enc);
28349        desret_xmlParserInputBufferPtr(ret_val);
28350        call_tests++;
28351        des_FILE_ptr(n_file, file, 0);
28352        des_xmlCharEncoding(n_enc, enc, 1);
28353        xmlResetLastError();
28354        if (mem_base != xmlMemBlocks()) {
28355            printf("Leak of %d blocks found in xmlParserInputBufferCreateFile",
28356	           xmlMemBlocks() - mem_base);
28357	    test_ret++;
28358            printf(" %d", n_file);
28359            printf(" %d", n_enc);
28360            printf("\n");
28361        }
28362    }
28363    }
28364    function_tests++;
28365
28366    return(test_ret);
28367}
28368
28369
28370static int
28371test_xmlParserInputBufferCreateFilename(void) {
28372    int test_ret = 0;
28373
28374    int mem_base;
28375    xmlParserInputBufferPtr ret_val;
28376    const char * URI; /* a C string containing the URI or filename */
28377    int n_URI;
28378    xmlCharEncoding enc; /* the charset encoding if known */
28379    int n_enc;
28380
28381    for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) {
28382    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28383        mem_base = xmlMemBlocks();
28384        URI = gen_fileoutput(n_URI, 0);
28385        enc = gen_xmlCharEncoding(n_enc, 1);
28386
28387        ret_val = xmlParserInputBufferCreateFilename(URI, enc);
28388        desret_xmlParserInputBufferPtr(ret_val);
28389        call_tests++;
28390        des_fileoutput(n_URI, URI, 0);
28391        des_xmlCharEncoding(n_enc, enc, 1);
28392        xmlResetLastError();
28393        if (mem_base != xmlMemBlocks()) {
28394            printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename",
28395	           xmlMemBlocks() - mem_base);
28396	    test_ret++;
28397            printf(" %d", n_URI);
28398            printf(" %d", n_enc);
28399            printf("\n");
28400        }
28401    }
28402    }
28403    function_tests++;
28404
28405    return(test_ret);
28406}
28407
28408
28409static int
28410test_xmlParserInputBufferCreateMem(void) {
28411    int test_ret = 0;
28412
28413    int mem_base;
28414    xmlParserInputBufferPtr ret_val;
28415    char * mem; /* the memory input */
28416    int n_mem;
28417    int size; /* the length of the memory block */
28418    int n_size;
28419    xmlCharEncoding enc; /* the charset encoding if known */
28420    int n_enc;
28421
28422    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28423    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28424    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28425        mem_base = xmlMemBlocks();
28426        mem = gen_const_char_ptr(n_mem, 0);
28427        size = gen_int(n_size, 1);
28428        enc = gen_xmlCharEncoding(n_enc, 2);
28429
28430        ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc);
28431        desret_xmlParserInputBufferPtr(ret_val);
28432        call_tests++;
28433        des_const_char_ptr(n_mem, (const char *)mem, 0);
28434        des_int(n_size, size, 1);
28435        des_xmlCharEncoding(n_enc, enc, 2);
28436        xmlResetLastError();
28437        if (mem_base != xmlMemBlocks()) {
28438            printf("Leak of %d blocks found in xmlParserInputBufferCreateMem",
28439	           xmlMemBlocks() - mem_base);
28440	    test_ret++;
28441            printf(" %d", n_mem);
28442            printf(" %d", n_size);
28443            printf(" %d", n_enc);
28444            printf("\n");
28445        }
28446    }
28447    }
28448    }
28449    function_tests++;
28450
28451    return(test_ret);
28452}
28453
28454
28455static int
28456test_xmlParserInputBufferCreateStatic(void) {
28457    int test_ret = 0;
28458
28459    int mem_base;
28460    xmlParserInputBufferPtr ret_val;
28461    char * mem; /* the memory input */
28462    int n_mem;
28463    int size; /* the length of the memory block */
28464    int n_size;
28465    xmlCharEncoding enc; /* the charset encoding if known */
28466    int n_enc;
28467
28468    for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) {
28469    for (n_size = 0;n_size < gen_nb_int;n_size++) {
28470    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28471        mem_base = xmlMemBlocks();
28472        mem = gen_const_char_ptr(n_mem, 0);
28473        size = gen_int(n_size, 1);
28474        enc = gen_xmlCharEncoding(n_enc, 2);
28475
28476        ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc);
28477        desret_xmlParserInputBufferPtr(ret_val);
28478        call_tests++;
28479        des_const_char_ptr(n_mem, (const char *)mem, 0);
28480        des_int(n_size, size, 1);
28481        des_xmlCharEncoding(n_enc, enc, 2);
28482        xmlResetLastError();
28483        if (mem_base != xmlMemBlocks()) {
28484            printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic",
28485	           xmlMemBlocks() - mem_base);
28486	    test_ret++;
28487            printf(" %d", n_mem);
28488            printf(" %d", n_size);
28489            printf(" %d", n_enc);
28490            printf("\n");
28491        }
28492    }
28493    }
28494    }
28495    function_tests++;
28496
28497    return(test_ret);
28498}
28499
28500
28501static int
28502test_xmlParserInputBufferGrow(void) {
28503    int test_ret = 0;
28504
28505    int mem_base;
28506    int ret_val;
28507    xmlParserInputBufferPtr in; /* a buffered parser input */
28508    int n_in;
28509    int len; /* indicative value of the amount of chars to read */
28510    int n_len;
28511
28512    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28513    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28514        mem_base = xmlMemBlocks();
28515        in = gen_xmlParserInputBufferPtr(n_in, 0);
28516        len = gen_int(n_len, 1);
28517
28518        ret_val = xmlParserInputBufferGrow(in, len);
28519        desret_int(ret_val);
28520        call_tests++;
28521        des_xmlParserInputBufferPtr(n_in, in, 0);
28522        des_int(n_len, len, 1);
28523        xmlResetLastError();
28524        if (mem_base != xmlMemBlocks()) {
28525            printf("Leak of %d blocks found in xmlParserInputBufferGrow",
28526	           xmlMemBlocks() - mem_base);
28527	    test_ret++;
28528            printf(" %d", n_in);
28529            printf(" %d", n_len);
28530            printf("\n");
28531        }
28532    }
28533    }
28534    function_tests++;
28535
28536    return(test_ret);
28537}
28538
28539
28540static int
28541test_xmlParserInputBufferPush(void) {
28542    int test_ret = 0;
28543
28544    int mem_base;
28545    int ret_val;
28546    xmlParserInputBufferPtr in; /* a buffered parser input */
28547    int n_in;
28548    int len; /* the size in bytes of the array. */
28549    int n_len;
28550    char * buf; /* an char array */
28551    int n_buf;
28552
28553    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28554    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28555    for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) {
28556        mem_base = xmlMemBlocks();
28557        in = gen_xmlParserInputBufferPtr(n_in, 0);
28558        len = gen_int(n_len, 1);
28559        buf = gen_const_char_ptr(n_buf, 2);
28560
28561        ret_val = xmlParserInputBufferPush(in, len, (const char *)buf);
28562        desret_int(ret_val);
28563        call_tests++;
28564        des_xmlParserInputBufferPtr(n_in, in, 0);
28565        des_int(n_len, len, 1);
28566        des_const_char_ptr(n_buf, (const char *)buf, 2);
28567        xmlResetLastError();
28568        if (mem_base != xmlMemBlocks()) {
28569            printf("Leak of %d blocks found in xmlParserInputBufferPush",
28570	           xmlMemBlocks() - mem_base);
28571	    test_ret++;
28572            printf(" %d", n_in);
28573            printf(" %d", n_len);
28574            printf(" %d", n_buf);
28575            printf("\n");
28576        }
28577    }
28578    }
28579    }
28580    function_tests++;
28581
28582    return(test_ret);
28583}
28584
28585
28586static int
28587test_xmlParserInputBufferRead(void) {
28588    int test_ret = 0;
28589
28590    int mem_base;
28591    int ret_val;
28592    xmlParserInputBufferPtr in; /* a buffered parser input */
28593    int n_in;
28594    int len; /* indicative value of the amount of chars to read */
28595    int n_len;
28596
28597    for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) {
28598    for (n_len = 0;n_len < gen_nb_int;n_len++) {
28599        mem_base = xmlMemBlocks();
28600        in = gen_xmlParserInputBufferPtr(n_in, 0);
28601        len = gen_int(n_len, 1);
28602
28603        ret_val = xmlParserInputBufferRead(in, len);
28604        desret_int(ret_val);
28605        call_tests++;
28606        des_xmlParserInputBufferPtr(n_in, in, 0);
28607        des_int(n_len, len, 1);
28608        xmlResetLastError();
28609        if (mem_base != xmlMemBlocks()) {
28610            printf("Leak of %d blocks found in xmlParserInputBufferRead",
28611	           xmlMemBlocks() - mem_base);
28612	    test_ret++;
28613            printf(" %d", n_in);
28614            printf(" %d", n_len);
28615            printf("\n");
28616        }
28617    }
28618    }
28619    function_tests++;
28620
28621    return(test_ret);
28622}
28623
28624
28625static int
28626test_xmlPopInputCallbacks(void) {
28627    int test_ret = 0;
28628
28629    int mem_base;
28630    int ret_val;
28631
28632        mem_base = xmlMemBlocks();
28633
28634        ret_val = xmlPopInputCallbacks();
28635        desret_int(ret_val);
28636        call_tests++;
28637        xmlResetLastError();
28638        if (mem_base != xmlMemBlocks()) {
28639            printf("Leak of %d blocks found in xmlPopInputCallbacks",
28640	           xmlMemBlocks() - mem_base);
28641	    test_ret++;
28642            printf("\n");
28643        }
28644    function_tests++;
28645
28646    return(test_ret);
28647}
28648
28649
28650static int
28651test_xmlRegisterDefaultInputCallbacks(void) {
28652    int test_ret = 0;
28653
28654    int mem_base;
28655
28656        mem_base = xmlMemBlocks();
28657
28658        xmlRegisterDefaultInputCallbacks();
28659        call_tests++;
28660        xmlResetLastError();
28661        if (mem_base != xmlMemBlocks()) {
28662            printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks",
28663	           xmlMemBlocks() - mem_base);
28664	    test_ret++;
28665            printf("\n");
28666        }
28667    function_tests++;
28668
28669    return(test_ret);
28670}
28671
28672
28673static int
28674test_xmlRegisterDefaultOutputCallbacks(void) {
28675    int test_ret = 0;
28676
28677#if defined(LIBXML_OUTPUT_ENABLED)
28678    int mem_base;
28679
28680        mem_base = xmlMemBlocks();
28681
28682        xmlRegisterDefaultOutputCallbacks();
28683        call_tests++;
28684        xmlResetLastError();
28685        if (mem_base != xmlMemBlocks()) {
28686            printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks",
28687	           xmlMemBlocks() - mem_base);
28688	    test_ret++;
28689            printf("\n");
28690        }
28691    function_tests++;
28692#endif
28693
28694    return(test_ret);
28695}
28696
28697
28698static int
28699test_xmlRegisterHTTPPostCallbacks(void) {
28700    int test_ret = 0;
28701
28702#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED)
28703    int mem_base;
28704
28705        mem_base = xmlMemBlocks();
28706
28707        xmlRegisterHTTPPostCallbacks();
28708        call_tests++;
28709        xmlResetLastError();
28710        if (mem_base != xmlMemBlocks()) {
28711            printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks",
28712	           xmlMemBlocks() - mem_base);
28713	    test_ret++;
28714            printf("\n");
28715        }
28716    function_tests++;
28717#endif
28718
28719    return(test_ret);
28720}
28721
28722static int
28723test_xmlIO(void) {
28724    int test_ret = 0;
28725
28726    if (quiet == 0) printf("Testing xmlIO : 39 of 48 functions ...\n");
28727    test_ret += test_xmlAllocOutputBuffer();
28728    test_ret += test_xmlAllocParserInputBuffer();
28729    test_ret += test_xmlCheckFilename();
28730    test_ret += test_xmlCheckHTTPInput();
28731    test_ret += test_xmlCleanupInputCallbacks();
28732    test_ret += test_xmlCleanupOutputCallbacks();
28733    test_ret += test_xmlFileClose();
28734    test_ret += test_xmlFileMatch();
28735    test_ret += test_xmlFileOpen();
28736    test_ret += test_xmlFileRead();
28737    test_ret += test_xmlIOFTPClose();
28738    test_ret += test_xmlIOFTPMatch();
28739    test_ret += test_xmlIOFTPOpen();
28740    test_ret += test_xmlIOFTPRead();
28741    test_ret += test_xmlIOHTTPClose();
28742    test_ret += test_xmlIOHTTPMatch();
28743    test_ret += test_xmlIOHTTPOpen();
28744    test_ret += test_xmlIOHTTPRead();
28745    test_ret += test_xmlNoNetExternalEntityLoader();
28746    test_ret += test_xmlNormalizeWindowsPath();
28747    test_ret += test_xmlOutputBufferCreateBuffer();
28748    test_ret += test_xmlOutputBufferCreateFd();
28749    test_ret += test_xmlOutputBufferCreateFile();
28750    test_ret += test_xmlOutputBufferCreateFilename();
28751    test_ret += test_xmlOutputBufferFlush();
28752    test_ret += test_xmlOutputBufferWrite();
28753    test_ret += test_xmlOutputBufferWriteEscape();
28754    test_ret += test_xmlOutputBufferWriteString();
28755    test_ret += test_xmlParserGetDirectory();
28756    test_ret += test_xmlParserInputBufferCreateFd();
28757    test_ret += test_xmlParserInputBufferCreateFile();
28758    test_ret += test_xmlParserInputBufferCreateFilename();
28759    test_ret += test_xmlParserInputBufferCreateMem();
28760    test_ret += test_xmlParserInputBufferCreateStatic();
28761    test_ret += test_xmlParserInputBufferGrow();
28762    test_ret += test_xmlParserInputBufferPush();
28763    test_ret += test_xmlParserInputBufferRead();
28764    test_ret += test_xmlPopInputCallbacks();
28765    test_ret += test_xmlRegisterDefaultInputCallbacks();
28766    test_ret += test_xmlRegisterDefaultOutputCallbacks();
28767    test_ret += test_xmlRegisterHTTPPostCallbacks();
28768
28769    if (test_ret != 0)
28770	printf("Module xmlIO: %d errors\n", test_ret);
28771    return(test_ret);
28772}
28773#ifdef LIBXML_AUTOMATA_ENABLED
28774
28775#define gen_nb_xmlAutomataPtr 1
28776static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28777    return(NULL);
28778}
28779static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28780}
28781#endif
28782
28783
28784static int
28785test_xmlAutomataCompile(void) {
28786    int test_ret = 0;
28787
28788
28789    /* missing type support */
28790    return(test_ret);
28791}
28792
28793
28794static int
28795test_xmlAutomataGetInitState(void) {
28796    int test_ret = 0;
28797
28798
28799    /* missing type support */
28800    return(test_ret);
28801}
28802
28803
28804static int
28805test_xmlAutomataIsDeterminist(void) {
28806    int test_ret = 0;
28807
28808#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28809    int mem_base;
28810    int ret_val;
28811    xmlAutomataPtr am; /* an automata */
28812    int n_am;
28813
28814    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28815        mem_base = xmlMemBlocks();
28816        am = gen_xmlAutomataPtr(n_am, 0);
28817
28818        ret_val = xmlAutomataIsDeterminist(am);
28819        desret_int(ret_val);
28820        call_tests++;
28821        des_xmlAutomataPtr(n_am, am, 0);
28822        xmlResetLastError();
28823        if (mem_base != xmlMemBlocks()) {
28824            printf("Leak of %d blocks found in xmlAutomataIsDeterminist",
28825	           xmlMemBlocks() - mem_base);
28826	    test_ret++;
28827            printf(" %d", n_am);
28828            printf("\n");
28829        }
28830    }
28831    function_tests++;
28832#endif
28833
28834    return(test_ret);
28835}
28836
28837#ifdef LIBXML_AUTOMATA_ENABLED
28838
28839#define gen_nb_xmlAutomataStatePtr 1
28840static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28841    return(NULL);
28842}
28843static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
28844}
28845#endif
28846
28847
28848static int
28849test_xmlAutomataNewAllTrans(void) {
28850    int test_ret = 0;
28851
28852
28853    /* missing type support */
28854    return(test_ret);
28855}
28856
28857
28858static int
28859test_xmlAutomataNewCountTrans(void) {
28860    int test_ret = 0;
28861
28862
28863    /* missing type support */
28864    return(test_ret);
28865}
28866
28867
28868static int
28869test_xmlAutomataNewCountTrans2(void) {
28870    int test_ret = 0;
28871
28872
28873    /* missing type support */
28874    return(test_ret);
28875}
28876
28877
28878static int
28879test_xmlAutomataNewCountedTrans(void) {
28880    int test_ret = 0;
28881
28882
28883    /* missing type support */
28884    return(test_ret);
28885}
28886
28887
28888static int
28889test_xmlAutomataNewCounter(void) {
28890    int test_ret = 0;
28891
28892#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
28893    int mem_base;
28894    int ret_val;
28895    xmlAutomataPtr am; /* an automata */
28896    int n_am;
28897    int min; /* the minimal value on the counter */
28898    int n_min;
28899    int max; /* the maximal value on the counter */
28900    int n_max;
28901
28902    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
28903    for (n_min = 0;n_min < gen_nb_int;n_min++) {
28904    for (n_max = 0;n_max < gen_nb_int;n_max++) {
28905        mem_base = xmlMemBlocks();
28906        am = gen_xmlAutomataPtr(n_am, 0);
28907        min = gen_int(n_min, 1);
28908        max = gen_int(n_max, 2);
28909
28910        ret_val = xmlAutomataNewCounter(am, min, max);
28911        desret_int(ret_val);
28912        call_tests++;
28913        des_xmlAutomataPtr(n_am, am, 0);
28914        des_int(n_min, min, 1);
28915        des_int(n_max, max, 2);
28916        xmlResetLastError();
28917        if (mem_base != xmlMemBlocks()) {
28918            printf("Leak of %d blocks found in xmlAutomataNewCounter",
28919	           xmlMemBlocks() - mem_base);
28920	    test_ret++;
28921            printf(" %d", n_am);
28922            printf(" %d", n_min);
28923            printf(" %d", n_max);
28924            printf("\n");
28925        }
28926    }
28927    }
28928    }
28929    function_tests++;
28930#endif
28931
28932    return(test_ret);
28933}
28934
28935
28936static int
28937test_xmlAutomataNewCounterTrans(void) {
28938    int test_ret = 0;
28939
28940
28941    /* missing type support */
28942    return(test_ret);
28943}
28944
28945
28946static int
28947test_xmlAutomataNewEpsilon(void) {
28948    int test_ret = 0;
28949
28950
28951    /* missing type support */
28952    return(test_ret);
28953}
28954
28955
28956static int
28957test_xmlAutomataNewNegTrans(void) {
28958    int test_ret = 0;
28959
28960
28961    /* missing type support */
28962    return(test_ret);
28963}
28964
28965
28966static int
28967test_xmlAutomataNewOnceTrans(void) {
28968    int test_ret = 0;
28969
28970
28971    /* missing type support */
28972    return(test_ret);
28973}
28974
28975
28976static int
28977test_xmlAutomataNewOnceTrans2(void) {
28978    int test_ret = 0;
28979
28980
28981    /* missing type support */
28982    return(test_ret);
28983}
28984
28985
28986static int
28987test_xmlAutomataNewState(void) {
28988    int test_ret = 0;
28989
28990
28991    /* missing type support */
28992    return(test_ret);
28993}
28994
28995
28996static int
28997test_xmlAutomataNewTransition(void) {
28998    int test_ret = 0;
28999
29000
29001    /* missing type support */
29002    return(test_ret);
29003}
29004
29005
29006static int
29007test_xmlAutomataNewTransition2(void) {
29008    int test_ret = 0;
29009
29010
29011    /* missing type support */
29012    return(test_ret);
29013}
29014
29015
29016static int
29017test_xmlAutomataSetFinalState(void) {
29018    int test_ret = 0;
29019
29020#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED)
29021    int mem_base;
29022    int ret_val;
29023    xmlAutomataPtr am; /* an automata */
29024    int n_am;
29025    xmlAutomataStatePtr state; /* a state in this automata */
29026    int n_state;
29027
29028    for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) {
29029    for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) {
29030        mem_base = xmlMemBlocks();
29031        am = gen_xmlAutomataPtr(n_am, 0);
29032        state = gen_xmlAutomataStatePtr(n_state, 1);
29033
29034        ret_val = xmlAutomataSetFinalState(am, state);
29035        desret_int(ret_val);
29036        call_tests++;
29037        des_xmlAutomataPtr(n_am, am, 0);
29038        des_xmlAutomataStatePtr(n_state, state, 1);
29039        xmlResetLastError();
29040        if (mem_base != xmlMemBlocks()) {
29041            printf("Leak of %d blocks found in xmlAutomataSetFinalState",
29042	           xmlMemBlocks() - mem_base);
29043	    test_ret++;
29044            printf(" %d", n_am);
29045            printf(" %d", n_state);
29046            printf("\n");
29047        }
29048    }
29049    }
29050    function_tests++;
29051#endif
29052
29053    return(test_ret);
29054}
29055
29056
29057static int
29058test_xmlNewAutomata(void) {
29059    int test_ret = 0;
29060
29061
29062    /* missing type support */
29063    return(test_ret);
29064}
29065
29066static int
29067test_xmlautomata(void) {
29068    int test_ret = 0;
29069
29070    if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n");
29071    test_ret += test_xmlAutomataCompile();
29072    test_ret += test_xmlAutomataGetInitState();
29073    test_ret += test_xmlAutomataIsDeterminist();
29074    test_ret += test_xmlAutomataNewAllTrans();
29075    test_ret += test_xmlAutomataNewCountTrans();
29076    test_ret += test_xmlAutomataNewCountTrans2();
29077    test_ret += test_xmlAutomataNewCountedTrans();
29078    test_ret += test_xmlAutomataNewCounter();
29079    test_ret += test_xmlAutomataNewCounterTrans();
29080    test_ret += test_xmlAutomataNewEpsilon();
29081    test_ret += test_xmlAutomataNewNegTrans();
29082    test_ret += test_xmlAutomataNewOnceTrans();
29083    test_ret += test_xmlAutomataNewOnceTrans2();
29084    test_ret += test_xmlAutomataNewState();
29085    test_ret += test_xmlAutomataNewTransition();
29086    test_ret += test_xmlAutomataNewTransition2();
29087    test_ret += test_xmlAutomataSetFinalState();
29088    test_ret += test_xmlNewAutomata();
29089
29090    if (test_ret != 0)
29091	printf("Module xmlautomata: %d errors\n", test_ret);
29092    return(test_ret);
29093}
29094
29095#define gen_nb_xmlGenericErrorFunc_ptr 1
29096static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29097    return(NULL);
29098}
29099static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29100}
29101
29102static int
29103test_initGenericErrorDefaultFunc(void) {
29104    int test_ret = 0;
29105
29106    int mem_base;
29107    xmlGenericErrorFunc * handler; /* the handler */
29108    int n_handler;
29109
29110    for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) {
29111        mem_base = xmlMemBlocks();
29112        handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0);
29113
29114        initGenericErrorDefaultFunc(handler);
29115        call_tests++;
29116        des_xmlGenericErrorFunc_ptr(n_handler, handler, 0);
29117        xmlResetLastError();
29118        if (mem_base != xmlMemBlocks()) {
29119            printf("Leak of %d blocks found in initGenericErrorDefaultFunc",
29120	           xmlMemBlocks() - mem_base);
29121	    test_ret++;
29122            printf(" %d", n_handler);
29123            printf("\n");
29124        }
29125    }
29126    function_tests++;
29127
29128    return(test_ret);
29129}
29130
29131
29132#define gen_nb_xmlErrorPtr 1
29133static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29134    return(NULL);
29135}
29136static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29137}
29138
29139static int
29140test_xmlCopyError(void) {
29141    int test_ret = 0;
29142
29143    int mem_base;
29144    int ret_val;
29145    xmlErrorPtr from; /* a source error */
29146    int n_from;
29147    xmlErrorPtr to; /* a target error */
29148    int n_to;
29149
29150    for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) {
29151    for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) {
29152        mem_base = xmlMemBlocks();
29153        from = gen_xmlErrorPtr(n_from, 0);
29154        to = gen_xmlErrorPtr(n_to, 1);
29155
29156        ret_val = xmlCopyError(from, to);
29157        desret_int(ret_val);
29158        call_tests++;
29159        des_xmlErrorPtr(n_from, from, 0);
29160        des_xmlErrorPtr(n_to, to, 1);
29161        xmlResetLastError();
29162        if (mem_base != xmlMemBlocks()) {
29163            printf("Leak of %d blocks found in xmlCopyError",
29164	           xmlMemBlocks() - mem_base);
29165	    test_ret++;
29166            printf(" %d", n_from);
29167            printf(" %d", n_to);
29168            printf("\n");
29169        }
29170    }
29171    }
29172    function_tests++;
29173
29174    return(test_ret);
29175}
29176
29177
29178static int
29179test_xmlCtxtGetLastError(void) {
29180    int test_ret = 0;
29181
29182
29183    /* missing type support */
29184    return(test_ret);
29185}
29186
29187
29188static int
29189test_xmlCtxtResetLastError(void) {
29190    int test_ret = 0;
29191
29192    int mem_base;
29193    void * ctx; /* an XML parser context */
29194    int n_ctx;
29195
29196    for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) {
29197        mem_base = xmlMemBlocks();
29198        ctx = gen_void_ptr(n_ctx, 0);
29199
29200        xmlCtxtResetLastError(ctx);
29201        call_tests++;
29202        des_void_ptr(n_ctx, ctx, 0);
29203        xmlResetLastError();
29204        if (mem_base != xmlMemBlocks()) {
29205            printf("Leak of %d blocks found in xmlCtxtResetLastError",
29206	           xmlMemBlocks() - mem_base);
29207	    test_ret++;
29208            printf(" %d", n_ctx);
29209            printf("\n");
29210        }
29211    }
29212    function_tests++;
29213
29214    return(test_ret);
29215}
29216
29217
29218static int
29219test_xmlGetLastError(void) {
29220    int test_ret = 0;
29221
29222
29223    /* missing type support */
29224    return(test_ret);
29225}
29226
29227
29228static int
29229test_xmlParserError(void) {
29230    int test_ret = 0;
29231
29232
29233    /* missing type support */
29234    return(test_ret);
29235}
29236
29237
29238static int
29239test_xmlParserPrintFileContext(void) {
29240    int test_ret = 0;
29241
29242    int mem_base;
29243    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29244    int n_input;
29245
29246    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29247        mem_base = xmlMemBlocks();
29248        input = gen_xmlParserInputPtr(n_input, 0);
29249
29250        xmlParserPrintFileContext(input);
29251        call_tests++;
29252        des_xmlParserInputPtr(n_input, input, 0);
29253        xmlResetLastError();
29254        if (mem_base != xmlMemBlocks()) {
29255            printf("Leak of %d blocks found in xmlParserPrintFileContext",
29256	           xmlMemBlocks() - mem_base);
29257	    test_ret++;
29258            printf(" %d", n_input);
29259            printf("\n");
29260        }
29261    }
29262    function_tests++;
29263
29264    return(test_ret);
29265}
29266
29267
29268static int
29269test_xmlParserPrintFileInfo(void) {
29270    int test_ret = 0;
29271
29272    int mem_base;
29273    xmlParserInputPtr input; /* an xmlParserInputPtr input */
29274    int n_input;
29275
29276    for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) {
29277        mem_base = xmlMemBlocks();
29278        input = gen_xmlParserInputPtr(n_input, 0);
29279
29280        xmlParserPrintFileInfo(input);
29281        call_tests++;
29282        des_xmlParserInputPtr(n_input, input, 0);
29283        xmlResetLastError();
29284        if (mem_base != xmlMemBlocks()) {
29285            printf("Leak of %d blocks found in xmlParserPrintFileInfo",
29286	           xmlMemBlocks() - mem_base);
29287	    test_ret++;
29288            printf(" %d", n_input);
29289            printf("\n");
29290        }
29291    }
29292    function_tests++;
29293
29294    return(test_ret);
29295}
29296
29297
29298static int
29299test_xmlParserValidityError(void) {
29300    int test_ret = 0;
29301
29302
29303    /* missing type support */
29304    return(test_ret);
29305}
29306
29307
29308static int
29309test_xmlParserValidityWarning(void) {
29310    int test_ret = 0;
29311
29312
29313    /* missing type support */
29314    return(test_ret);
29315}
29316
29317
29318static int
29319test_xmlParserWarning(void) {
29320    int test_ret = 0;
29321
29322
29323    /* missing type support */
29324    return(test_ret);
29325}
29326
29327
29328static int
29329test_xmlResetError(void) {
29330    int test_ret = 0;
29331
29332    int mem_base;
29333    xmlErrorPtr err; /* pointer to the error. */
29334    int n_err;
29335
29336    for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) {
29337        mem_base = xmlMemBlocks();
29338        err = gen_xmlErrorPtr(n_err, 0);
29339
29340        xmlResetError(err);
29341        call_tests++;
29342        des_xmlErrorPtr(n_err, err, 0);
29343        xmlResetLastError();
29344        if (mem_base != xmlMemBlocks()) {
29345            printf("Leak of %d blocks found in xmlResetError",
29346	           xmlMemBlocks() - mem_base);
29347	    test_ret++;
29348            printf(" %d", n_err);
29349            printf("\n");
29350        }
29351    }
29352    function_tests++;
29353
29354    return(test_ret);
29355}
29356
29357
29358static int
29359test_xmlResetLastError(void) {
29360    int test_ret = 0;
29361
29362
29363
29364        xmlResetLastError();
29365        call_tests++;
29366        xmlResetLastError();
29367    function_tests++;
29368
29369    return(test_ret);
29370}
29371
29372
29373static int
29374test_xmlSetGenericErrorFunc(void) {
29375    int test_ret = 0;
29376
29377
29378    /* missing type support */
29379    return(test_ret);
29380}
29381
29382
29383static int
29384test_xmlSetStructuredErrorFunc(void) {
29385    int test_ret = 0;
29386
29387
29388    /* missing type support */
29389    return(test_ret);
29390}
29391
29392static int
29393test_xmlerror(void) {
29394    int test_ret = 0;
29395
29396    if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n");
29397    test_ret += test_initGenericErrorDefaultFunc();
29398    test_ret += test_xmlCopyError();
29399    test_ret += test_xmlCtxtGetLastError();
29400    test_ret += test_xmlCtxtResetLastError();
29401    test_ret += test_xmlGetLastError();
29402    test_ret += test_xmlParserError();
29403    test_ret += test_xmlParserPrintFileContext();
29404    test_ret += test_xmlParserPrintFileInfo();
29405    test_ret += test_xmlParserValidityError();
29406    test_ret += test_xmlParserValidityWarning();
29407    test_ret += test_xmlParserWarning();
29408    test_ret += test_xmlResetError();
29409    test_ret += test_xmlResetLastError();
29410    test_ret += test_xmlSetGenericErrorFunc();
29411    test_ret += test_xmlSetStructuredErrorFunc();
29412
29413    if (test_ret != 0)
29414	printf("Module xmlerror: %d errors\n", test_ret);
29415    return(test_ret);
29416}
29417#ifdef LIBXML_MODULES_ENABLED
29418
29419#define gen_nb_xmlModulePtr 1
29420static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29421    return(NULL);
29422}
29423static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
29424}
29425#endif
29426
29427
29428static int
29429test_xmlModuleClose(void) {
29430    int test_ret = 0;
29431
29432#if defined(LIBXML_MODULES_ENABLED)
29433    int mem_base;
29434    int ret_val;
29435    xmlModulePtr module; /* the module handle */
29436    int n_module;
29437
29438    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29439        mem_base = xmlMemBlocks();
29440        module = gen_xmlModulePtr(n_module, 0);
29441
29442        ret_val = xmlModuleClose(module);
29443        desret_int(ret_val);
29444        call_tests++;
29445        des_xmlModulePtr(n_module, module, 0);
29446        xmlResetLastError();
29447        if (mem_base != xmlMemBlocks()) {
29448            printf("Leak of %d blocks found in xmlModuleClose",
29449	           xmlMemBlocks() - mem_base);
29450	    test_ret++;
29451            printf(" %d", n_module);
29452            printf("\n");
29453        }
29454    }
29455    function_tests++;
29456#endif
29457
29458    return(test_ret);
29459}
29460
29461
29462static int
29463test_xmlModuleOpen(void) {
29464    int test_ret = 0;
29465
29466
29467    /* missing type support */
29468    return(test_ret);
29469}
29470
29471
29472static int
29473test_xmlModuleSymbol(void) {
29474    int test_ret = 0;
29475
29476#if defined(LIBXML_MODULES_ENABLED)
29477    int mem_base;
29478    int ret_val;
29479    xmlModulePtr module; /* the module */
29480    int n_module;
29481    char * name; /* the name of the symbol */
29482    int n_name;
29483    void ** symbol; /* the resulting symbol address */
29484    int n_symbol;
29485
29486    for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) {
29487    for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) {
29488    for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) {
29489        mem_base = xmlMemBlocks();
29490        module = gen_xmlModulePtr(n_module, 0);
29491        name = gen_const_char_ptr(n_name, 1);
29492        symbol = gen_void_ptr_ptr(n_symbol, 2);
29493
29494        ret_val = xmlModuleSymbol(module, (const char *)name, symbol);
29495        desret_int(ret_val);
29496        call_tests++;
29497        des_xmlModulePtr(n_module, module, 0);
29498        des_const_char_ptr(n_name, (const char *)name, 1);
29499        des_void_ptr_ptr(n_symbol, symbol, 2);
29500        xmlResetLastError();
29501        if (mem_base != xmlMemBlocks()) {
29502            printf("Leak of %d blocks found in xmlModuleSymbol",
29503	           xmlMemBlocks() - mem_base);
29504	    test_ret++;
29505            printf(" %d", n_module);
29506            printf(" %d", n_name);
29507            printf(" %d", n_symbol);
29508            printf("\n");
29509        }
29510    }
29511    }
29512    }
29513    function_tests++;
29514#endif
29515
29516    return(test_ret);
29517}
29518
29519static int
29520test_xmlmodule(void) {
29521    int test_ret = 0;
29522
29523    if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n");
29524    test_ret += test_xmlModuleClose();
29525    test_ret += test_xmlModuleOpen();
29526    test_ret += test_xmlModuleSymbol();
29527
29528    if (test_ret != 0)
29529	printf("Module xmlmodule: %d errors\n", test_ret);
29530    return(test_ret);
29531}
29532
29533static int
29534test_xmlNewTextReader(void) {
29535    int test_ret = 0;
29536
29537#if defined(LIBXML_READER_ENABLED)
29538    int mem_base;
29539    xmlTextReaderPtr ret_val;
29540    xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */
29541    int n_input;
29542    const char * URI; /* the URI information for the source if available */
29543    int n_URI;
29544
29545    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
29546    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29547        mem_base = xmlMemBlocks();
29548        input = gen_xmlParserInputBufferPtr(n_input, 0);
29549        URI = gen_filepath(n_URI, 1);
29550
29551        ret_val = xmlNewTextReader(input, URI);
29552        desret_xmlTextReaderPtr(ret_val);
29553        call_tests++;
29554        des_xmlParserInputBufferPtr(n_input, input, 0);
29555        des_filepath(n_URI, URI, 1);
29556        xmlResetLastError();
29557        if (mem_base != xmlMemBlocks()) {
29558            printf("Leak of %d blocks found in xmlNewTextReader",
29559	           xmlMemBlocks() - mem_base);
29560	    test_ret++;
29561            printf(" %d", n_input);
29562            printf(" %d", n_URI);
29563            printf("\n");
29564        }
29565    }
29566    }
29567    function_tests++;
29568#endif
29569
29570    return(test_ret);
29571}
29572
29573
29574static int
29575test_xmlNewTextReaderFilename(void) {
29576    int test_ret = 0;
29577
29578#if defined(LIBXML_READER_ENABLED)
29579    int mem_base;
29580    xmlTextReaderPtr ret_val;
29581    const char * URI; /* the URI of the resource to process */
29582    int n_URI;
29583
29584    for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) {
29585        mem_base = xmlMemBlocks();
29586        URI = gen_filepath(n_URI, 0);
29587
29588        ret_val = xmlNewTextReaderFilename(URI);
29589        desret_xmlTextReaderPtr(ret_val);
29590        call_tests++;
29591        des_filepath(n_URI, URI, 0);
29592        xmlResetLastError();
29593        if (mem_base != xmlMemBlocks()) {
29594            printf("Leak of %d blocks found in xmlNewTextReaderFilename",
29595	           xmlMemBlocks() - mem_base);
29596	    test_ret++;
29597            printf(" %d", n_URI);
29598            printf("\n");
29599        }
29600    }
29601    function_tests++;
29602#endif
29603
29604    return(test_ret);
29605}
29606
29607
29608static int
29609test_xmlReaderForDoc(void) {
29610    int test_ret = 0;
29611
29612#if defined(LIBXML_READER_ENABLED)
29613    int mem_base;
29614    xmlTextReaderPtr ret_val;
29615    xmlChar * cur; /* a pointer to a zero terminated string */
29616    int n_cur;
29617    const char * URL; /* the base URL to use for the document */
29618    int n_URL;
29619    char * encoding; /* the document encoding, or NULL */
29620    int n_encoding;
29621    int options; /* a combination of xmlParserOption */
29622    int n_options;
29623
29624    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29625    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29626    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29627    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29628        mem_base = xmlMemBlocks();
29629        cur = gen_const_xmlChar_ptr(n_cur, 0);
29630        URL = gen_filepath(n_URL, 1);
29631        encoding = gen_const_char_ptr(n_encoding, 2);
29632        options = gen_parseroptions(n_options, 3);
29633
29634        ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options);
29635        desret_xmlTextReaderPtr(ret_val);
29636        call_tests++;
29637        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
29638        des_filepath(n_URL, URL, 1);
29639        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29640        des_parseroptions(n_options, options, 3);
29641        xmlResetLastError();
29642        if (mem_base != xmlMemBlocks()) {
29643            printf("Leak of %d blocks found in xmlReaderForDoc",
29644	           xmlMemBlocks() - mem_base);
29645	    test_ret++;
29646            printf(" %d", n_cur);
29647            printf(" %d", n_URL);
29648            printf(" %d", n_encoding);
29649            printf(" %d", n_options);
29650            printf("\n");
29651        }
29652    }
29653    }
29654    }
29655    }
29656    function_tests++;
29657#endif
29658
29659    return(test_ret);
29660}
29661
29662
29663static int
29664test_xmlReaderForFile(void) {
29665    int test_ret = 0;
29666
29667#if defined(LIBXML_READER_ENABLED)
29668    int mem_base;
29669    xmlTextReaderPtr ret_val;
29670    const char * filename; /* a file or URL */
29671    int n_filename;
29672    char * encoding; /* the document encoding, or NULL */
29673    int n_encoding;
29674    int options; /* a combination of xmlParserOption */
29675    int n_options;
29676
29677    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29678    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29679    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29680        mem_base = xmlMemBlocks();
29681        filename = gen_filepath(n_filename, 0);
29682        encoding = gen_const_char_ptr(n_encoding, 1);
29683        options = gen_parseroptions(n_options, 2);
29684
29685        ret_val = xmlReaderForFile(filename, (const char *)encoding, options);
29686        desret_xmlTextReaderPtr(ret_val);
29687        call_tests++;
29688        des_filepath(n_filename, filename, 0);
29689        des_const_char_ptr(n_encoding, (const char *)encoding, 1);
29690        des_parseroptions(n_options, options, 2);
29691        xmlResetLastError();
29692        if (mem_base != xmlMemBlocks()) {
29693            printf("Leak of %d blocks found in xmlReaderForFile",
29694	           xmlMemBlocks() - mem_base);
29695	    test_ret++;
29696            printf(" %d", n_filename);
29697            printf(" %d", n_encoding);
29698            printf(" %d", n_options);
29699            printf("\n");
29700        }
29701    }
29702    }
29703    }
29704    function_tests++;
29705#endif
29706
29707    return(test_ret);
29708}
29709
29710
29711static int
29712test_xmlReaderForMemory(void) {
29713    int test_ret = 0;
29714
29715#if defined(LIBXML_READER_ENABLED)
29716    int mem_base;
29717    xmlTextReaderPtr ret_val;
29718    char * buffer; /* a pointer to a char array */
29719    int n_buffer;
29720    int size; /* the size of the array */
29721    int n_size;
29722    const char * URL; /* the base URL to use for the document */
29723    int n_URL;
29724    char * encoding; /* the document encoding, or NULL */
29725    int n_encoding;
29726    int options; /* a combination of xmlParserOption */
29727    int n_options;
29728
29729    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29730    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29731    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29732    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29733    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29734        mem_base = xmlMemBlocks();
29735        buffer = gen_const_char_ptr(n_buffer, 0);
29736        size = gen_int(n_size, 1);
29737        URL = gen_filepath(n_URL, 2);
29738        encoding = gen_const_char_ptr(n_encoding, 3);
29739        options = gen_parseroptions(n_options, 4);
29740
29741        ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options);
29742        desret_xmlTextReaderPtr(ret_val);
29743        call_tests++;
29744        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
29745        des_int(n_size, size, 1);
29746        des_filepath(n_URL, URL, 2);
29747        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29748        des_parseroptions(n_options, options, 4);
29749        xmlResetLastError();
29750        if (mem_base != xmlMemBlocks()) {
29751            printf("Leak of %d blocks found in xmlReaderForMemory",
29752	           xmlMemBlocks() - mem_base);
29753	    test_ret++;
29754            printf(" %d", n_buffer);
29755            printf(" %d", n_size);
29756            printf(" %d", n_URL);
29757            printf(" %d", n_encoding);
29758            printf(" %d", n_options);
29759            printf("\n");
29760        }
29761    }
29762    }
29763    }
29764    }
29765    }
29766    function_tests++;
29767#endif
29768
29769    return(test_ret);
29770}
29771
29772
29773static int
29774test_xmlReaderNewDoc(void) {
29775    int test_ret = 0;
29776
29777#if defined(LIBXML_READER_ENABLED)
29778    int mem_base;
29779    int ret_val;
29780    xmlTextReaderPtr reader; /* an XML reader */
29781    int n_reader;
29782    xmlChar * cur; /* a pointer to a zero terminated string */
29783    int n_cur;
29784    const char * URL; /* the base URL to use for the document */
29785    int n_URL;
29786    char * encoding; /* the document encoding, or NULL */
29787    int n_encoding;
29788    int options; /* a combination of xmlParserOption */
29789    int n_options;
29790
29791    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29792    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
29793    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29794    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29795    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29796        mem_base = xmlMemBlocks();
29797        reader = gen_xmlTextReaderPtr(n_reader, 0);
29798        cur = gen_const_xmlChar_ptr(n_cur, 1);
29799        URL = gen_filepath(n_URL, 2);
29800        encoding = gen_const_char_ptr(n_encoding, 3);
29801        options = gen_parseroptions(n_options, 4);
29802
29803        ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options);
29804        desret_int(ret_val);
29805        call_tests++;
29806        des_xmlTextReaderPtr(n_reader, reader, 0);
29807        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1);
29808        des_filepath(n_URL, URL, 2);
29809        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
29810        des_parseroptions(n_options, options, 4);
29811        xmlResetLastError();
29812        if (mem_base != xmlMemBlocks()) {
29813            printf("Leak of %d blocks found in xmlReaderNewDoc",
29814	           xmlMemBlocks() - mem_base);
29815	    test_ret++;
29816            printf(" %d", n_reader);
29817            printf(" %d", n_cur);
29818            printf(" %d", n_URL);
29819            printf(" %d", n_encoding);
29820            printf(" %d", n_options);
29821            printf("\n");
29822        }
29823    }
29824    }
29825    }
29826    }
29827    }
29828    function_tests++;
29829#endif
29830
29831    return(test_ret);
29832}
29833
29834
29835static int
29836test_xmlReaderNewFile(void) {
29837    int test_ret = 0;
29838
29839#if defined(LIBXML_READER_ENABLED)
29840    int mem_base;
29841    int ret_val;
29842    xmlTextReaderPtr reader; /* an XML reader */
29843    int n_reader;
29844    const char * filename; /* a file or URL */
29845    int n_filename;
29846    char * encoding; /* the document encoding, or NULL */
29847    int n_encoding;
29848    int options; /* a combination of xmlParserOption */
29849    int n_options;
29850
29851    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29852    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
29853    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29854    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29855        mem_base = xmlMemBlocks();
29856        reader = gen_xmlTextReaderPtr(n_reader, 0);
29857        filename = gen_filepath(n_filename, 1);
29858        encoding = gen_const_char_ptr(n_encoding, 2);
29859        options = gen_parseroptions(n_options, 3);
29860
29861        ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options);
29862        desret_int(ret_val);
29863        call_tests++;
29864        des_xmlTextReaderPtr(n_reader, reader, 0);
29865        des_filepath(n_filename, filename, 1);
29866        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
29867        des_parseroptions(n_options, options, 3);
29868        xmlResetLastError();
29869        if (mem_base != xmlMemBlocks()) {
29870            printf("Leak of %d blocks found in xmlReaderNewFile",
29871	           xmlMemBlocks() - mem_base);
29872	    test_ret++;
29873            printf(" %d", n_reader);
29874            printf(" %d", n_filename);
29875            printf(" %d", n_encoding);
29876            printf(" %d", n_options);
29877            printf("\n");
29878        }
29879    }
29880    }
29881    }
29882    }
29883    function_tests++;
29884#endif
29885
29886    return(test_ret);
29887}
29888
29889
29890static int
29891test_xmlReaderNewMemory(void) {
29892    int test_ret = 0;
29893
29894#if defined(LIBXML_READER_ENABLED)
29895    int mem_base;
29896    int ret_val;
29897    xmlTextReaderPtr reader; /* an XML reader */
29898    int n_reader;
29899    char * buffer; /* a pointer to a char array */
29900    int n_buffer;
29901    int size; /* the size of the array */
29902    int n_size;
29903    const char * URL; /* the base URL to use for the document */
29904    int n_URL;
29905    char * encoding; /* the document encoding, or NULL */
29906    int n_encoding;
29907    int options; /* a combination of xmlParserOption */
29908    int n_options;
29909
29910    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29911    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
29912    for (n_size = 0;n_size < gen_nb_int;n_size++) {
29913    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
29914    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
29915    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
29916        mem_base = xmlMemBlocks();
29917        reader = gen_xmlTextReaderPtr(n_reader, 0);
29918        buffer = gen_const_char_ptr(n_buffer, 1);
29919        size = gen_int(n_size, 2);
29920        URL = gen_filepath(n_URL, 3);
29921        encoding = gen_const_char_ptr(n_encoding, 4);
29922        options = gen_parseroptions(n_options, 5);
29923
29924        ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options);
29925        desret_int(ret_val);
29926        call_tests++;
29927        des_xmlTextReaderPtr(n_reader, reader, 0);
29928        des_const_char_ptr(n_buffer, (const char *)buffer, 1);
29929        des_int(n_size, size, 2);
29930        des_filepath(n_URL, URL, 3);
29931        des_const_char_ptr(n_encoding, (const char *)encoding, 4);
29932        des_parseroptions(n_options, options, 5);
29933        xmlResetLastError();
29934        if (mem_base != xmlMemBlocks()) {
29935            printf("Leak of %d blocks found in xmlReaderNewMemory",
29936	           xmlMemBlocks() - mem_base);
29937	    test_ret++;
29938            printf(" %d", n_reader);
29939            printf(" %d", n_buffer);
29940            printf(" %d", n_size);
29941            printf(" %d", n_URL);
29942            printf(" %d", n_encoding);
29943            printf(" %d", n_options);
29944            printf("\n");
29945        }
29946    }
29947    }
29948    }
29949    }
29950    }
29951    }
29952    function_tests++;
29953#endif
29954
29955    return(test_ret);
29956}
29957
29958
29959static int
29960test_xmlReaderNewWalker(void) {
29961    int test_ret = 0;
29962
29963#if defined(LIBXML_READER_ENABLED)
29964    int mem_base;
29965    int ret_val;
29966    xmlTextReaderPtr reader; /* an XML reader */
29967    int n_reader;
29968    xmlDocPtr doc; /* a preparsed document */
29969    int n_doc;
29970
29971    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
29972    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
29973        mem_base = xmlMemBlocks();
29974        reader = gen_xmlTextReaderPtr(n_reader, 0);
29975        doc = gen_xmlDocPtr(n_doc, 1);
29976
29977        ret_val = xmlReaderNewWalker(reader, doc);
29978        desret_int(ret_val);
29979        call_tests++;
29980        des_xmlTextReaderPtr(n_reader, reader, 0);
29981        des_xmlDocPtr(n_doc, doc, 1);
29982        xmlResetLastError();
29983        if (mem_base != xmlMemBlocks()) {
29984            printf("Leak of %d blocks found in xmlReaderNewWalker",
29985	           xmlMemBlocks() - mem_base);
29986	    test_ret++;
29987            printf(" %d", n_reader);
29988            printf(" %d", n_doc);
29989            printf("\n");
29990        }
29991    }
29992    }
29993    function_tests++;
29994#endif
29995
29996    return(test_ret);
29997}
29998
29999
30000static int
30001test_xmlReaderWalker(void) {
30002    int test_ret = 0;
30003
30004#if defined(LIBXML_READER_ENABLED)
30005    int mem_base;
30006    xmlTextReaderPtr ret_val;
30007    xmlDocPtr doc; /* a preparsed document */
30008    int n_doc;
30009
30010    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
30011        mem_base = xmlMemBlocks();
30012        doc = gen_xmlDocPtr(n_doc, 0);
30013
30014        ret_val = xmlReaderWalker(doc);
30015        desret_xmlTextReaderPtr(ret_val);
30016        call_tests++;
30017        des_xmlDocPtr(n_doc, doc, 0);
30018        xmlResetLastError();
30019        if (mem_base != xmlMemBlocks()) {
30020            printf("Leak of %d blocks found in xmlReaderWalker",
30021	           xmlMemBlocks() - mem_base);
30022	    test_ret++;
30023            printf(" %d", n_doc);
30024            printf("\n");
30025        }
30026    }
30027    function_tests++;
30028#endif
30029
30030    return(test_ret);
30031}
30032
30033
30034static int
30035test_xmlTextReaderAttributeCount(void) {
30036    int test_ret = 0;
30037
30038#if defined(LIBXML_READER_ENABLED)
30039    int mem_base;
30040    int ret_val;
30041    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30042    int n_reader;
30043
30044    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30045        mem_base = xmlMemBlocks();
30046        reader = gen_xmlTextReaderPtr(n_reader, 0);
30047
30048        ret_val = xmlTextReaderAttributeCount(reader);
30049        desret_int(ret_val);
30050        call_tests++;
30051        des_xmlTextReaderPtr(n_reader, reader, 0);
30052        xmlResetLastError();
30053        if (mem_base != xmlMemBlocks()) {
30054            printf("Leak of %d blocks found in xmlTextReaderAttributeCount",
30055	           xmlMemBlocks() - mem_base);
30056	    test_ret++;
30057            printf(" %d", n_reader);
30058            printf("\n");
30059        }
30060    }
30061    function_tests++;
30062#endif
30063
30064    return(test_ret);
30065}
30066
30067
30068static int
30069test_xmlTextReaderBaseUri(void) {
30070    int test_ret = 0;
30071
30072#if defined(LIBXML_READER_ENABLED)
30073    int mem_base;
30074    xmlChar * ret_val;
30075    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30076    int n_reader;
30077
30078    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30079        mem_base = xmlMemBlocks();
30080        reader = gen_xmlTextReaderPtr(n_reader, 0);
30081
30082        ret_val = xmlTextReaderBaseUri(reader);
30083        desret_xmlChar_ptr(ret_val);
30084        call_tests++;
30085        des_xmlTextReaderPtr(n_reader, reader, 0);
30086        xmlResetLastError();
30087        if (mem_base != xmlMemBlocks()) {
30088            printf("Leak of %d blocks found in xmlTextReaderBaseUri",
30089	           xmlMemBlocks() - mem_base);
30090	    test_ret++;
30091            printf(" %d", n_reader);
30092            printf("\n");
30093        }
30094    }
30095    function_tests++;
30096#endif
30097
30098    return(test_ret);
30099}
30100
30101
30102static int
30103test_xmlTextReaderByteConsumed(void) {
30104    int test_ret = 0;
30105
30106#if defined(LIBXML_READER_ENABLED)
30107    int mem_base;
30108    long ret_val;
30109    xmlTextReaderPtr reader; /* an XML reader */
30110    int n_reader;
30111
30112    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30113        mem_base = xmlMemBlocks();
30114        reader = gen_xmlTextReaderPtr(n_reader, 0);
30115
30116        ret_val = xmlTextReaderByteConsumed(reader);
30117        desret_long(ret_val);
30118        call_tests++;
30119        des_xmlTextReaderPtr(n_reader, reader, 0);
30120        xmlResetLastError();
30121        if (mem_base != xmlMemBlocks()) {
30122            printf("Leak of %d blocks found in xmlTextReaderByteConsumed",
30123	           xmlMemBlocks() - mem_base);
30124	    test_ret++;
30125            printf(" %d", n_reader);
30126            printf("\n");
30127        }
30128    }
30129    function_tests++;
30130#endif
30131
30132    return(test_ret);
30133}
30134
30135
30136static int
30137test_xmlTextReaderClose(void) {
30138    int test_ret = 0;
30139
30140#if defined(LIBXML_READER_ENABLED)
30141    int mem_base;
30142    int ret_val;
30143    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30144    int n_reader;
30145
30146    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30147        mem_base = xmlMemBlocks();
30148        reader = gen_xmlTextReaderPtr(n_reader, 0);
30149
30150        ret_val = xmlTextReaderClose(reader);
30151        desret_int(ret_val);
30152        call_tests++;
30153        des_xmlTextReaderPtr(n_reader, reader, 0);
30154        xmlResetLastError();
30155        if (mem_base != xmlMemBlocks()) {
30156            printf("Leak of %d blocks found in xmlTextReaderClose",
30157	           xmlMemBlocks() - mem_base);
30158	    test_ret++;
30159            printf(" %d", n_reader);
30160            printf("\n");
30161        }
30162    }
30163    function_tests++;
30164#endif
30165
30166    return(test_ret);
30167}
30168
30169
30170static int
30171test_xmlTextReaderConstBaseUri(void) {
30172    int test_ret = 0;
30173
30174#if defined(LIBXML_READER_ENABLED)
30175    int mem_base;
30176    const xmlChar * ret_val;
30177    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30178    int n_reader;
30179
30180    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30181        mem_base = xmlMemBlocks();
30182        reader = gen_xmlTextReaderPtr(n_reader, 0);
30183
30184        ret_val = xmlTextReaderConstBaseUri(reader);
30185        desret_const_xmlChar_ptr(ret_val);
30186        call_tests++;
30187        des_xmlTextReaderPtr(n_reader, reader, 0);
30188        xmlResetLastError();
30189        if (mem_base != xmlMemBlocks()) {
30190            printf("Leak of %d blocks found in xmlTextReaderConstBaseUri",
30191	           xmlMemBlocks() - mem_base);
30192	    test_ret++;
30193            printf(" %d", n_reader);
30194            printf("\n");
30195        }
30196    }
30197    function_tests++;
30198#endif
30199
30200    return(test_ret);
30201}
30202
30203
30204static int
30205test_xmlTextReaderConstEncoding(void) {
30206    int test_ret = 0;
30207
30208#if defined(LIBXML_READER_ENABLED)
30209    int mem_base;
30210    const xmlChar * ret_val;
30211    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30212    int n_reader;
30213
30214    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30215        mem_base = xmlMemBlocks();
30216        reader = gen_xmlTextReaderPtr(n_reader, 0);
30217
30218        ret_val = xmlTextReaderConstEncoding(reader);
30219        desret_const_xmlChar_ptr(ret_val);
30220        call_tests++;
30221        des_xmlTextReaderPtr(n_reader, reader, 0);
30222        xmlResetLastError();
30223        if (mem_base != xmlMemBlocks()) {
30224            printf("Leak of %d blocks found in xmlTextReaderConstEncoding",
30225	           xmlMemBlocks() - mem_base);
30226	    test_ret++;
30227            printf(" %d", n_reader);
30228            printf("\n");
30229        }
30230    }
30231    function_tests++;
30232#endif
30233
30234    return(test_ret);
30235}
30236
30237
30238static int
30239test_xmlTextReaderConstLocalName(void) {
30240    int test_ret = 0;
30241
30242#if defined(LIBXML_READER_ENABLED)
30243    int mem_base;
30244    const xmlChar * ret_val;
30245    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30246    int n_reader;
30247
30248    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30249        mem_base = xmlMemBlocks();
30250        reader = gen_xmlTextReaderPtr(n_reader, 0);
30251
30252        ret_val = xmlTextReaderConstLocalName(reader);
30253        desret_const_xmlChar_ptr(ret_val);
30254        call_tests++;
30255        des_xmlTextReaderPtr(n_reader, reader, 0);
30256        xmlResetLastError();
30257        if (mem_base != xmlMemBlocks()) {
30258            printf("Leak of %d blocks found in xmlTextReaderConstLocalName",
30259	           xmlMemBlocks() - mem_base);
30260	    test_ret++;
30261            printf(" %d", n_reader);
30262            printf("\n");
30263        }
30264    }
30265    function_tests++;
30266#endif
30267
30268    return(test_ret);
30269}
30270
30271
30272static int
30273test_xmlTextReaderConstName(void) {
30274    int test_ret = 0;
30275
30276#if defined(LIBXML_READER_ENABLED)
30277    int mem_base;
30278    const xmlChar * ret_val;
30279    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30280    int n_reader;
30281
30282    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30283        mem_base = xmlMemBlocks();
30284        reader = gen_xmlTextReaderPtr(n_reader, 0);
30285
30286        ret_val = xmlTextReaderConstName(reader);
30287        desret_const_xmlChar_ptr(ret_val);
30288        call_tests++;
30289        des_xmlTextReaderPtr(n_reader, reader, 0);
30290        xmlResetLastError();
30291        if (mem_base != xmlMemBlocks()) {
30292            printf("Leak of %d blocks found in xmlTextReaderConstName",
30293	           xmlMemBlocks() - mem_base);
30294	    test_ret++;
30295            printf(" %d", n_reader);
30296            printf("\n");
30297        }
30298    }
30299    function_tests++;
30300#endif
30301
30302    return(test_ret);
30303}
30304
30305
30306static int
30307test_xmlTextReaderConstNamespaceUri(void) {
30308    int test_ret = 0;
30309
30310#if defined(LIBXML_READER_ENABLED)
30311    int mem_base;
30312    const xmlChar * ret_val;
30313    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30314    int n_reader;
30315
30316    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30317        mem_base = xmlMemBlocks();
30318        reader = gen_xmlTextReaderPtr(n_reader, 0);
30319
30320        ret_val = xmlTextReaderConstNamespaceUri(reader);
30321        desret_const_xmlChar_ptr(ret_val);
30322        call_tests++;
30323        des_xmlTextReaderPtr(n_reader, reader, 0);
30324        xmlResetLastError();
30325        if (mem_base != xmlMemBlocks()) {
30326            printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri",
30327	           xmlMemBlocks() - mem_base);
30328	    test_ret++;
30329            printf(" %d", n_reader);
30330            printf("\n");
30331        }
30332    }
30333    function_tests++;
30334#endif
30335
30336    return(test_ret);
30337}
30338
30339
30340static int
30341test_xmlTextReaderConstPrefix(void) {
30342    int test_ret = 0;
30343
30344#if defined(LIBXML_READER_ENABLED)
30345    int mem_base;
30346    const xmlChar * ret_val;
30347    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30348    int n_reader;
30349
30350    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30351        mem_base = xmlMemBlocks();
30352        reader = gen_xmlTextReaderPtr(n_reader, 0);
30353
30354        ret_val = xmlTextReaderConstPrefix(reader);
30355        desret_const_xmlChar_ptr(ret_val);
30356        call_tests++;
30357        des_xmlTextReaderPtr(n_reader, reader, 0);
30358        xmlResetLastError();
30359        if (mem_base != xmlMemBlocks()) {
30360            printf("Leak of %d blocks found in xmlTextReaderConstPrefix",
30361	           xmlMemBlocks() - mem_base);
30362	    test_ret++;
30363            printf(" %d", n_reader);
30364            printf("\n");
30365        }
30366    }
30367    function_tests++;
30368#endif
30369
30370    return(test_ret);
30371}
30372
30373
30374static int
30375test_xmlTextReaderConstString(void) {
30376    int test_ret = 0;
30377
30378#if defined(LIBXML_READER_ENABLED)
30379    int mem_base;
30380    const xmlChar * ret_val;
30381    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30382    int n_reader;
30383    xmlChar * str; /* the string to intern. */
30384    int n_str;
30385
30386    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30387    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
30388        mem_base = xmlMemBlocks();
30389        reader = gen_xmlTextReaderPtr(n_reader, 0);
30390        str = gen_const_xmlChar_ptr(n_str, 1);
30391
30392        ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str);
30393        desret_const_xmlChar_ptr(ret_val);
30394        call_tests++;
30395        des_xmlTextReaderPtr(n_reader, reader, 0);
30396        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
30397        xmlResetLastError();
30398        if (mem_base != xmlMemBlocks()) {
30399            printf("Leak of %d blocks found in xmlTextReaderConstString",
30400	           xmlMemBlocks() - mem_base);
30401	    test_ret++;
30402            printf(" %d", n_reader);
30403            printf(" %d", n_str);
30404            printf("\n");
30405        }
30406    }
30407    }
30408    function_tests++;
30409#endif
30410
30411    return(test_ret);
30412}
30413
30414
30415static int
30416test_xmlTextReaderConstValue(void) {
30417    int test_ret = 0;
30418
30419#if defined(LIBXML_READER_ENABLED)
30420    int mem_base;
30421    const xmlChar * ret_val;
30422    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30423    int n_reader;
30424
30425    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30426        mem_base = xmlMemBlocks();
30427        reader = gen_xmlTextReaderPtr(n_reader, 0);
30428
30429        ret_val = xmlTextReaderConstValue(reader);
30430        desret_const_xmlChar_ptr(ret_val);
30431        call_tests++;
30432        des_xmlTextReaderPtr(n_reader, reader, 0);
30433        xmlResetLastError();
30434        if (mem_base != xmlMemBlocks()) {
30435            printf("Leak of %d blocks found in xmlTextReaderConstValue",
30436	           xmlMemBlocks() - mem_base);
30437	    test_ret++;
30438            printf(" %d", n_reader);
30439            printf("\n");
30440        }
30441    }
30442    function_tests++;
30443#endif
30444
30445    return(test_ret);
30446}
30447
30448
30449static int
30450test_xmlTextReaderConstXmlLang(void) {
30451    int test_ret = 0;
30452
30453#if defined(LIBXML_READER_ENABLED)
30454    int mem_base;
30455    const xmlChar * ret_val;
30456    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30457    int n_reader;
30458
30459    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30460        mem_base = xmlMemBlocks();
30461        reader = gen_xmlTextReaderPtr(n_reader, 0);
30462
30463        ret_val = xmlTextReaderConstXmlLang(reader);
30464        desret_const_xmlChar_ptr(ret_val);
30465        call_tests++;
30466        des_xmlTextReaderPtr(n_reader, reader, 0);
30467        xmlResetLastError();
30468        if (mem_base != xmlMemBlocks()) {
30469            printf("Leak of %d blocks found in xmlTextReaderConstXmlLang",
30470	           xmlMemBlocks() - mem_base);
30471	    test_ret++;
30472            printf(" %d", n_reader);
30473            printf("\n");
30474        }
30475    }
30476    function_tests++;
30477#endif
30478
30479    return(test_ret);
30480}
30481
30482
30483static int
30484test_xmlTextReaderConstXmlVersion(void) {
30485    int test_ret = 0;
30486
30487#if defined(LIBXML_READER_ENABLED)
30488    int mem_base;
30489    const xmlChar * ret_val;
30490    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30491    int n_reader;
30492
30493    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30494        mem_base = xmlMemBlocks();
30495        reader = gen_xmlTextReaderPtr(n_reader, 0);
30496
30497        ret_val = xmlTextReaderConstXmlVersion(reader);
30498        desret_const_xmlChar_ptr(ret_val);
30499        call_tests++;
30500        des_xmlTextReaderPtr(n_reader, reader, 0);
30501        xmlResetLastError();
30502        if (mem_base != xmlMemBlocks()) {
30503            printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion",
30504	           xmlMemBlocks() - mem_base);
30505	    test_ret++;
30506            printf(" %d", n_reader);
30507            printf("\n");
30508        }
30509    }
30510    function_tests++;
30511#endif
30512
30513    return(test_ret);
30514}
30515
30516
30517static int
30518test_xmlTextReaderCurrentDoc(void) {
30519    int test_ret = 0;
30520
30521#if defined(LIBXML_READER_ENABLED)
30522    int mem_base;
30523    xmlDocPtr ret_val;
30524    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30525    int n_reader;
30526
30527    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30528        mem_base = xmlMemBlocks();
30529        reader = gen_xmlTextReaderPtr(n_reader, 0);
30530
30531        ret_val = xmlTextReaderCurrentDoc(reader);
30532        desret_xmlDocPtr(ret_val);
30533        call_tests++;
30534        des_xmlTextReaderPtr(n_reader, reader, 0);
30535        xmlResetLastError();
30536        if (mem_base != xmlMemBlocks()) {
30537            printf("Leak of %d blocks found in xmlTextReaderCurrentDoc",
30538	           xmlMemBlocks() - mem_base);
30539	    test_ret++;
30540            printf(" %d", n_reader);
30541            printf("\n");
30542        }
30543    }
30544    function_tests++;
30545#endif
30546
30547    return(test_ret);
30548}
30549
30550
30551static int
30552test_xmlTextReaderCurrentNode(void) {
30553    int test_ret = 0;
30554
30555#if defined(LIBXML_READER_ENABLED)
30556    int mem_base;
30557    xmlNodePtr ret_val;
30558    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30559    int n_reader;
30560
30561    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30562        mem_base = xmlMemBlocks();
30563        reader = gen_xmlTextReaderPtr(n_reader, 0);
30564
30565        ret_val = xmlTextReaderCurrentNode(reader);
30566        desret_xmlNodePtr(ret_val);
30567        call_tests++;
30568        des_xmlTextReaderPtr(n_reader, reader, 0);
30569        xmlResetLastError();
30570        if (mem_base != xmlMemBlocks()) {
30571            printf("Leak of %d blocks found in xmlTextReaderCurrentNode",
30572	           xmlMemBlocks() - mem_base);
30573	    test_ret++;
30574            printf(" %d", n_reader);
30575            printf("\n");
30576        }
30577    }
30578    function_tests++;
30579#endif
30580
30581    return(test_ret);
30582}
30583
30584
30585static int
30586test_xmlTextReaderDepth(void) {
30587    int test_ret = 0;
30588
30589#if defined(LIBXML_READER_ENABLED)
30590    int mem_base;
30591    int ret_val;
30592    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30593    int n_reader;
30594
30595    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30596        mem_base = xmlMemBlocks();
30597        reader = gen_xmlTextReaderPtr(n_reader, 0);
30598
30599        ret_val = xmlTextReaderDepth(reader);
30600        desret_int(ret_val);
30601        call_tests++;
30602        des_xmlTextReaderPtr(n_reader, reader, 0);
30603        xmlResetLastError();
30604        if (mem_base != xmlMemBlocks()) {
30605            printf("Leak of %d blocks found in xmlTextReaderDepth",
30606	           xmlMemBlocks() - mem_base);
30607	    test_ret++;
30608            printf(" %d", n_reader);
30609            printf("\n");
30610        }
30611    }
30612    function_tests++;
30613#endif
30614
30615    return(test_ret);
30616}
30617
30618
30619static int
30620test_xmlTextReaderExpand(void) {
30621    int test_ret = 0;
30622
30623#if defined(LIBXML_READER_ENABLED)
30624    int mem_base;
30625    xmlNodePtr ret_val;
30626    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30627    int n_reader;
30628
30629    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30630        mem_base = xmlMemBlocks();
30631        reader = gen_xmlTextReaderPtr(n_reader, 0);
30632
30633        ret_val = xmlTextReaderExpand(reader);
30634        desret_xmlNodePtr(ret_val);
30635        call_tests++;
30636        des_xmlTextReaderPtr(n_reader, reader, 0);
30637        xmlResetLastError();
30638        if (mem_base != xmlMemBlocks()) {
30639            printf("Leak of %d blocks found in xmlTextReaderExpand",
30640	           xmlMemBlocks() - mem_base);
30641	    test_ret++;
30642            printf(" %d", n_reader);
30643            printf("\n");
30644        }
30645    }
30646    function_tests++;
30647#endif
30648
30649    return(test_ret);
30650}
30651
30652
30653static int
30654test_xmlTextReaderGetAttribute(void) {
30655    int test_ret = 0;
30656
30657#if defined(LIBXML_READER_ENABLED)
30658    int mem_base;
30659    xmlChar * ret_val;
30660    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30661    int n_reader;
30662    xmlChar * name; /* the qualified name of the attribute. */
30663    int n_name;
30664
30665    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30666    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
30667        mem_base = xmlMemBlocks();
30668        reader = gen_xmlTextReaderPtr(n_reader, 0);
30669        name = gen_const_xmlChar_ptr(n_name, 1);
30670
30671        ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name);
30672        desret_xmlChar_ptr(ret_val);
30673        call_tests++;
30674        des_xmlTextReaderPtr(n_reader, reader, 0);
30675        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
30676        xmlResetLastError();
30677        if (mem_base != xmlMemBlocks()) {
30678            printf("Leak of %d blocks found in xmlTextReaderGetAttribute",
30679	           xmlMemBlocks() - mem_base);
30680	    test_ret++;
30681            printf(" %d", n_reader);
30682            printf(" %d", n_name);
30683            printf("\n");
30684        }
30685    }
30686    }
30687    function_tests++;
30688#endif
30689
30690    return(test_ret);
30691}
30692
30693
30694static int
30695test_xmlTextReaderGetAttributeNo(void) {
30696    int test_ret = 0;
30697
30698#if defined(LIBXML_READER_ENABLED)
30699    int mem_base;
30700    xmlChar * ret_val;
30701    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30702    int n_reader;
30703    int no; /* the zero-based index of the attribute relative to the containing element */
30704    int n_no;
30705
30706    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30707    for (n_no = 0;n_no < gen_nb_int;n_no++) {
30708        mem_base = xmlMemBlocks();
30709        reader = gen_xmlTextReaderPtr(n_reader, 0);
30710        no = gen_int(n_no, 1);
30711
30712        ret_val = xmlTextReaderGetAttributeNo(reader, no);
30713        desret_xmlChar_ptr(ret_val);
30714        call_tests++;
30715        des_xmlTextReaderPtr(n_reader, reader, 0);
30716        des_int(n_no, no, 1);
30717        xmlResetLastError();
30718        if (mem_base != xmlMemBlocks()) {
30719            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo",
30720	           xmlMemBlocks() - mem_base);
30721	    test_ret++;
30722            printf(" %d", n_reader);
30723            printf(" %d", n_no);
30724            printf("\n");
30725        }
30726    }
30727    }
30728    function_tests++;
30729#endif
30730
30731    return(test_ret);
30732}
30733
30734
30735static int
30736test_xmlTextReaderGetAttributeNs(void) {
30737    int test_ret = 0;
30738
30739#if defined(LIBXML_READER_ENABLED)
30740    int mem_base;
30741    xmlChar * ret_val;
30742    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30743    int n_reader;
30744    xmlChar * localName; /* the local name of the attribute. */
30745    int n_localName;
30746    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
30747    int n_namespaceURI;
30748
30749    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30750    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
30751    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
30752        mem_base = xmlMemBlocks();
30753        reader = gen_xmlTextReaderPtr(n_reader, 0);
30754        localName = gen_const_xmlChar_ptr(n_localName, 1);
30755        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
30756
30757        ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
30758        desret_xmlChar_ptr(ret_val);
30759        call_tests++;
30760        des_xmlTextReaderPtr(n_reader, reader, 0);
30761        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
30762        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
30763        xmlResetLastError();
30764        if (mem_base != xmlMemBlocks()) {
30765            printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs",
30766	           xmlMemBlocks() - mem_base);
30767	    test_ret++;
30768            printf(" %d", n_reader);
30769            printf(" %d", n_localName);
30770            printf(" %d", n_namespaceURI);
30771            printf("\n");
30772        }
30773    }
30774    }
30775    }
30776    function_tests++;
30777#endif
30778
30779    return(test_ret);
30780}
30781
30782#ifdef LIBXML_READER_ENABLED
30783
30784#define gen_nb_xmlTextReaderErrorFunc_ptr 1
30785static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30786    return(NULL);
30787}
30788static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
30789}
30790#endif
30791
30792
30793static int
30794test_xmlTextReaderGetErrorHandler(void) {
30795    int test_ret = 0;
30796
30797#if defined(LIBXML_READER_ENABLED)
30798    int mem_base;
30799    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30800    int n_reader;
30801    xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */
30802    int n_f;
30803    void ** arg; /* a user argument */
30804    int n_arg;
30805
30806    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30807    for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) {
30808    for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) {
30809        mem_base = xmlMemBlocks();
30810        reader = gen_xmlTextReaderPtr(n_reader, 0);
30811        f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1);
30812        arg = gen_void_ptr_ptr(n_arg, 2);
30813
30814        xmlTextReaderGetErrorHandler(reader, f, arg);
30815        call_tests++;
30816        des_xmlTextReaderPtr(n_reader, reader, 0);
30817        des_xmlTextReaderErrorFunc_ptr(n_f, f, 1);
30818        des_void_ptr_ptr(n_arg, arg, 2);
30819        xmlResetLastError();
30820        if (mem_base != xmlMemBlocks()) {
30821            printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler",
30822	           xmlMemBlocks() - mem_base);
30823	    test_ret++;
30824            printf(" %d", n_reader);
30825            printf(" %d", n_f);
30826            printf(" %d", n_arg);
30827            printf("\n");
30828        }
30829    }
30830    }
30831    }
30832    function_tests++;
30833#endif
30834
30835    return(test_ret);
30836}
30837
30838
30839static int
30840test_xmlTextReaderGetParserColumnNumber(void) {
30841    int test_ret = 0;
30842
30843#if defined(LIBXML_READER_ENABLED)
30844    int mem_base;
30845    int ret_val;
30846    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30847    int n_reader;
30848
30849    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30850        mem_base = xmlMemBlocks();
30851        reader = gen_xmlTextReaderPtr(n_reader, 0);
30852
30853        ret_val = xmlTextReaderGetParserColumnNumber(reader);
30854        desret_int(ret_val);
30855        call_tests++;
30856        des_xmlTextReaderPtr(n_reader, reader, 0);
30857        xmlResetLastError();
30858        if (mem_base != xmlMemBlocks()) {
30859            printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber",
30860	           xmlMemBlocks() - mem_base);
30861	    test_ret++;
30862            printf(" %d", n_reader);
30863            printf("\n");
30864        }
30865    }
30866    function_tests++;
30867#endif
30868
30869    return(test_ret);
30870}
30871
30872
30873static int
30874test_xmlTextReaderGetParserLineNumber(void) {
30875    int test_ret = 0;
30876
30877#if defined(LIBXML_READER_ENABLED)
30878    int mem_base;
30879    int ret_val;
30880    xmlTextReaderPtr reader; /* the user data (XML reader context) */
30881    int n_reader;
30882
30883    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30884        mem_base = xmlMemBlocks();
30885        reader = gen_xmlTextReaderPtr(n_reader, 0);
30886
30887        ret_val = xmlTextReaderGetParserLineNumber(reader);
30888        desret_int(ret_val);
30889        call_tests++;
30890        des_xmlTextReaderPtr(n_reader, reader, 0);
30891        xmlResetLastError();
30892        if (mem_base != xmlMemBlocks()) {
30893            printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber",
30894	           xmlMemBlocks() - mem_base);
30895	    test_ret++;
30896            printf(" %d", n_reader);
30897            printf("\n");
30898        }
30899    }
30900    function_tests++;
30901#endif
30902
30903    return(test_ret);
30904}
30905
30906
30907static int
30908test_xmlTextReaderGetParserProp(void) {
30909    int test_ret = 0;
30910
30911#if defined(LIBXML_READER_ENABLED)
30912    int mem_base;
30913    int ret_val;
30914    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30915    int n_reader;
30916    int prop; /* the xmlParserProperties to get */
30917    int n_prop;
30918
30919    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30920    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
30921        mem_base = xmlMemBlocks();
30922        reader = gen_xmlTextReaderPtr(n_reader, 0);
30923        prop = gen_int(n_prop, 1);
30924
30925        ret_val = xmlTextReaderGetParserProp(reader, prop);
30926        desret_int(ret_val);
30927        call_tests++;
30928        des_xmlTextReaderPtr(n_reader, reader, 0);
30929        des_int(n_prop, prop, 1);
30930        xmlResetLastError();
30931        if (mem_base != xmlMemBlocks()) {
30932            printf("Leak of %d blocks found in xmlTextReaderGetParserProp",
30933	           xmlMemBlocks() - mem_base);
30934	    test_ret++;
30935            printf(" %d", n_reader);
30936            printf(" %d", n_prop);
30937            printf("\n");
30938        }
30939    }
30940    }
30941    function_tests++;
30942#endif
30943
30944    return(test_ret);
30945}
30946
30947
30948static int
30949test_xmlTextReaderGetRemainder(void) {
30950    int test_ret = 0;
30951
30952#if defined(LIBXML_READER_ENABLED)
30953    int mem_base;
30954    xmlParserInputBufferPtr ret_val;
30955    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30956    int n_reader;
30957
30958    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30959        mem_base = xmlMemBlocks();
30960        reader = gen_xmlTextReaderPtr(n_reader, 0);
30961
30962        ret_val = xmlTextReaderGetRemainder(reader);
30963        desret_xmlParserInputBufferPtr(ret_val);
30964        call_tests++;
30965        des_xmlTextReaderPtr(n_reader, reader, 0);
30966        xmlResetLastError();
30967        if (mem_base != xmlMemBlocks()) {
30968            printf("Leak of %d blocks found in xmlTextReaderGetRemainder",
30969	           xmlMemBlocks() - mem_base);
30970	    test_ret++;
30971            printf(" %d", n_reader);
30972            printf("\n");
30973        }
30974    }
30975    function_tests++;
30976#endif
30977
30978    return(test_ret);
30979}
30980
30981
30982static int
30983test_xmlTextReaderHasAttributes(void) {
30984    int test_ret = 0;
30985
30986#if defined(LIBXML_READER_ENABLED)
30987    int mem_base;
30988    int ret_val;
30989    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
30990    int n_reader;
30991
30992    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
30993        mem_base = xmlMemBlocks();
30994        reader = gen_xmlTextReaderPtr(n_reader, 0);
30995
30996        ret_val = xmlTextReaderHasAttributes(reader);
30997        desret_int(ret_val);
30998        call_tests++;
30999        des_xmlTextReaderPtr(n_reader, reader, 0);
31000        xmlResetLastError();
31001        if (mem_base != xmlMemBlocks()) {
31002            printf("Leak of %d blocks found in xmlTextReaderHasAttributes",
31003	           xmlMemBlocks() - mem_base);
31004	    test_ret++;
31005            printf(" %d", n_reader);
31006            printf("\n");
31007        }
31008    }
31009    function_tests++;
31010#endif
31011
31012    return(test_ret);
31013}
31014
31015
31016static int
31017test_xmlTextReaderHasValue(void) {
31018    int test_ret = 0;
31019
31020#if defined(LIBXML_READER_ENABLED)
31021    int mem_base;
31022    int ret_val;
31023    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31024    int n_reader;
31025
31026    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31027        mem_base = xmlMemBlocks();
31028        reader = gen_xmlTextReaderPtr(n_reader, 0);
31029
31030        ret_val = xmlTextReaderHasValue(reader);
31031        desret_int(ret_val);
31032        call_tests++;
31033        des_xmlTextReaderPtr(n_reader, reader, 0);
31034        xmlResetLastError();
31035        if (mem_base != xmlMemBlocks()) {
31036            printf("Leak of %d blocks found in xmlTextReaderHasValue",
31037	           xmlMemBlocks() - mem_base);
31038	    test_ret++;
31039            printf(" %d", n_reader);
31040            printf("\n");
31041        }
31042    }
31043    function_tests++;
31044#endif
31045
31046    return(test_ret);
31047}
31048
31049
31050static int
31051test_xmlTextReaderIsDefault(void) {
31052    int test_ret = 0;
31053
31054#if defined(LIBXML_READER_ENABLED)
31055    int mem_base;
31056    int ret_val;
31057    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31058    int n_reader;
31059
31060    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31061        mem_base = xmlMemBlocks();
31062        reader = gen_xmlTextReaderPtr(n_reader, 0);
31063
31064        ret_val = xmlTextReaderIsDefault(reader);
31065        desret_int(ret_val);
31066        call_tests++;
31067        des_xmlTextReaderPtr(n_reader, reader, 0);
31068        xmlResetLastError();
31069        if (mem_base != xmlMemBlocks()) {
31070            printf("Leak of %d blocks found in xmlTextReaderIsDefault",
31071	           xmlMemBlocks() - mem_base);
31072	    test_ret++;
31073            printf(" %d", n_reader);
31074            printf("\n");
31075        }
31076    }
31077    function_tests++;
31078#endif
31079
31080    return(test_ret);
31081}
31082
31083
31084static int
31085test_xmlTextReaderIsEmptyElement(void) {
31086    int test_ret = 0;
31087
31088#if defined(LIBXML_READER_ENABLED)
31089    int mem_base;
31090    int ret_val;
31091    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31092    int n_reader;
31093
31094    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31095        mem_base = xmlMemBlocks();
31096        reader = gen_xmlTextReaderPtr(n_reader, 0);
31097
31098        ret_val = xmlTextReaderIsEmptyElement(reader);
31099        desret_int(ret_val);
31100        call_tests++;
31101        des_xmlTextReaderPtr(n_reader, reader, 0);
31102        xmlResetLastError();
31103        if (mem_base != xmlMemBlocks()) {
31104            printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement",
31105	           xmlMemBlocks() - mem_base);
31106	    test_ret++;
31107            printf(" %d", n_reader);
31108            printf("\n");
31109        }
31110    }
31111    function_tests++;
31112#endif
31113
31114    return(test_ret);
31115}
31116
31117
31118static int
31119test_xmlTextReaderIsNamespaceDecl(void) {
31120    int test_ret = 0;
31121
31122#if defined(LIBXML_READER_ENABLED)
31123    int mem_base;
31124    int ret_val;
31125    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31126    int n_reader;
31127
31128    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31129        mem_base = xmlMemBlocks();
31130        reader = gen_xmlTextReaderPtr(n_reader, 0);
31131
31132        ret_val = xmlTextReaderIsNamespaceDecl(reader);
31133        desret_int(ret_val);
31134        call_tests++;
31135        des_xmlTextReaderPtr(n_reader, reader, 0);
31136        xmlResetLastError();
31137        if (mem_base != xmlMemBlocks()) {
31138            printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl",
31139	           xmlMemBlocks() - mem_base);
31140	    test_ret++;
31141            printf(" %d", n_reader);
31142            printf("\n");
31143        }
31144    }
31145    function_tests++;
31146#endif
31147
31148    return(test_ret);
31149}
31150
31151
31152static int
31153test_xmlTextReaderIsValid(void) {
31154    int test_ret = 0;
31155
31156#if defined(LIBXML_READER_ENABLED)
31157    int mem_base;
31158    int ret_val;
31159    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31160    int n_reader;
31161
31162    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31163        mem_base = xmlMemBlocks();
31164        reader = gen_xmlTextReaderPtr(n_reader, 0);
31165
31166        ret_val = xmlTextReaderIsValid(reader);
31167        desret_int(ret_val);
31168        call_tests++;
31169        des_xmlTextReaderPtr(n_reader, reader, 0);
31170        xmlResetLastError();
31171        if (mem_base != xmlMemBlocks()) {
31172            printf("Leak of %d blocks found in xmlTextReaderIsValid",
31173	           xmlMemBlocks() - mem_base);
31174	    test_ret++;
31175            printf(" %d", n_reader);
31176            printf("\n");
31177        }
31178    }
31179    function_tests++;
31180#endif
31181
31182    return(test_ret);
31183}
31184
31185
31186static int
31187test_xmlTextReaderLocalName(void) {
31188    int test_ret = 0;
31189
31190#if defined(LIBXML_READER_ENABLED)
31191    int mem_base;
31192    xmlChar * ret_val;
31193    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31194    int n_reader;
31195
31196    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31197        mem_base = xmlMemBlocks();
31198        reader = gen_xmlTextReaderPtr(n_reader, 0);
31199
31200        ret_val = xmlTextReaderLocalName(reader);
31201        desret_xmlChar_ptr(ret_val);
31202        call_tests++;
31203        des_xmlTextReaderPtr(n_reader, reader, 0);
31204        xmlResetLastError();
31205        if (mem_base != xmlMemBlocks()) {
31206            printf("Leak of %d blocks found in xmlTextReaderLocalName",
31207	           xmlMemBlocks() - mem_base);
31208	    test_ret++;
31209            printf(" %d", n_reader);
31210            printf("\n");
31211        }
31212    }
31213    function_tests++;
31214#endif
31215
31216    return(test_ret);
31217}
31218
31219#ifdef LIBXML_READER_ENABLED
31220
31221#define gen_nb_xmlTextReaderLocatorPtr 1
31222static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31223    return(NULL);
31224}
31225static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
31226}
31227#endif
31228
31229
31230static int
31231test_xmlTextReaderLocatorBaseURI(void) {
31232    int test_ret = 0;
31233
31234#if defined(LIBXML_READER_ENABLED)
31235    int mem_base;
31236    xmlChar * ret_val;
31237    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31238    int n_locator;
31239
31240    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31241        mem_base = xmlMemBlocks();
31242        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31243
31244        ret_val = xmlTextReaderLocatorBaseURI(locator);
31245        desret_xmlChar_ptr(ret_val);
31246        call_tests++;
31247        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31248        xmlResetLastError();
31249        if (mem_base != xmlMemBlocks()) {
31250            printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI",
31251	           xmlMemBlocks() - mem_base);
31252	    test_ret++;
31253            printf(" %d", n_locator);
31254            printf("\n");
31255        }
31256    }
31257    function_tests++;
31258#endif
31259
31260    return(test_ret);
31261}
31262
31263
31264static int
31265test_xmlTextReaderLocatorLineNumber(void) {
31266    int test_ret = 0;
31267
31268#if defined(LIBXML_READER_ENABLED)
31269    int mem_base;
31270    int ret_val;
31271    xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */
31272    int n_locator;
31273
31274    for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) {
31275        mem_base = xmlMemBlocks();
31276        locator = gen_xmlTextReaderLocatorPtr(n_locator, 0);
31277
31278        ret_val = xmlTextReaderLocatorLineNumber(locator);
31279        desret_int(ret_val);
31280        call_tests++;
31281        des_xmlTextReaderLocatorPtr(n_locator, locator, 0);
31282        xmlResetLastError();
31283        if (mem_base != xmlMemBlocks()) {
31284            printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber",
31285	           xmlMemBlocks() - mem_base);
31286	    test_ret++;
31287            printf(" %d", n_locator);
31288            printf("\n");
31289        }
31290    }
31291    function_tests++;
31292#endif
31293
31294    return(test_ret);
31295}
31296
31297
31298static int
31299test_xmlTextReaderLookupNamespace(void) {
31300    int test_ret = 0;
31301
31302#if defined(LIBXML_READER_ENABLED)
31303    int mem_base;
31304    xmlChar * ret_val;
31305    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31306    int n_reader;
31307    xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */
31308    int n_prefix;
31309
31310    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31311    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
31312        mem_base = xmlMemBlocks();
31313        reader = gen_xmlTextReaderPtr(n_reader, 0);
31314        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
31315
31316        ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix);
31317        desret_xmlChar_ptr(ret_val);
31318        call_tests++;
31319        des_xmlTextReaderPtr(n_reader, reader, 0);
31320        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
31321        xmlResetLastError();
31322        if (mem_base != xmlMemBlocks()) {
31323            printf("Leak of %d blocks found in xmlTextReaderLookupNamespace",
31324	           xmlMemBlocks() - mem_base);
31325	    test_ret++;
31326            printf(" %d", n_reader);
31327            printf(" %d", n_prefix);
31328            printf("\n");
31329        }
31330    }
31331    }
31332    function_tests++;
31333#endif
31334
31335    return(test_ret);
31336}
31337
31338
31339static int
31340test_xmlTextReaderMoveToAttribute(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    xmlChar * name; /* the qualified name of the attribute. */
31349    int n_name;
31350
31351    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31352    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
31353        mem_base = xmlMemBlocks();
31354        reader = gen_xmlTextReaderPtr(n_reader, 0);
31355        name = gen_const_xmlChar_ptr(n_name, 1);
31356
31357        ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name);
31358        desret_int(ret_val);
31359        call_tests++;
31360        des_xmlTextReaderPtr(n_reader, reader, 0);
31361        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
31362        xmlResetLastError();
31363        if (mem_base != xmlMemBlocks()) {
31364            printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute",
31365	           xmlMemBlocks() - mem_base);
31366	    test_ret++;
31367            printf(" %d", n_reader);
31368            printf(" %d", n_name);
31369            printf("\n");
31370        }
31371    }
31372    }
31373    function_tests++;
31374#endif
31375
31376    return(test_ret);
31377}
31378
31379
31380static int
31381test_xmlTextReaderMoveToAttributeNo(void) {
31382    int test_ret = 0;
31383
31384#if defined(LIBXML_READER_ENABLED)
31385    int mem_base;
31386    int ret_val;
31387    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31388    int n_reader;
31389    int no; /* the zero-based index of the attribute relative to the containing element. */
31390    int n_no;
31391
31392    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31393    for (n_no = 0;n_no < gen_nb_int;n_no++) {
31394        mem_base = xmlMemBlocks();
31395        reader = gen_xmlTextReaderPtr(n_reader, 0);
31396        no = gen_int(n_no, 1);
31397
31398        ret_val = xmlTextReaderMoveToAttributeNo(reader, no);
31399        desret_int(ret_val);
31400        call_tests++;
31401        des_xmlTextReaderPtr(n_reader, reader, 0);
31402        des_int(n_no, no, 1);
31403        xmlResetLastError();
31404        if (mem_base != xmlMemBlocks()) {
31405            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo",
31406	           xmlMemBlocks() - mem_base);
31407	    test_ret++;
31408            printf(" %d", n_reader);
31409            printf(" %d", n_no);
31410            printf("\n");
31411        }
31412    }
31413    }
31414    function_tests++;
31415#endif
31416
31417    return(test_ret);
31418}
31419
31420
31421static int
31422test_xmlTextReaderMoveToAttributeNs(void) {
31423    int test_ret = 0;
31424
31425#if defined(LIBXML_READER_ENABLED)
31426    int mem_base;
31427    int ret_val;
31428    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31429    int n_reader;
31430    xmlChar * localName; /* the local name of the attribute. */
31431    int n_localName;
31432    xmlChar * namespaceURI; /* the namespace URI of the attribute. */
31433    int n_namespaceURI;
31434
31435    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31436    for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) {
31437    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
31438        mem_base = xmlMemBlocks();
31439        reader = gen_xmlTextReaderPtr(n_reader, 0);
31440        localName = gen_const_xmlChar_ptr(n_localName, 1);
31441        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2);
31442
31443        ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI);
31444        desret_int(ret_val);
31445        call_tests++;
31446        des_xmlTextReaderPtr(n_reader, reader, 0);
31447        des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1);
31448        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2);
31449        xmlResetLastError();
31450        if (mem_base != xmlMemBlocks()) {
31451            printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs",
31452	           xmlMemBlocks() - mem_base);
31453	    test_ret++;
31454            printf(" %d", n_reader);
31455            printf(" %d", n_localName);
31456            printf(" %d", n_namespaceURI);
31457            printf("\n");
31458        }
31459    }
31460    }
31461    }
31462    function_tests++;
31463#endif
31464
31465    return(test_ret);
31466}
31467
31468
31469static int
31470test_xmlTextReaderMoveToElement(void) {
31471    int test_ret = 0;
31472
31473#if defined(LIBXML_READER_ENABLED)
31474    int mem_base;
31475    int ret_val;
31476    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31477    int n_reader;
31478
31479    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31480        mem_base = xmlMemBlocks();
31481        reader = gen_xmlTextReaderPtr(n_reader, 0);
31482
31483        ret_val = xmlTextReaderMoveToElement(reader);
31484        desret_int(ret_val);
31485        call_tests++;
31486        des_xmlTextReaderPtr(n_reader, reader, 0);
31487        xmlResetLastError();
31488        if (mem_base != xmlMemBlocks()) {
31489            printf("Leak of %d blocks found in xmlTextReaderMoveToElement",
31490	           xmlMemBlocks() - mem_base);
31491	    test_ret++;
31492            printf(" %d", n_reader);
31493            printf("\n");
31494        }
31495    }
31496    function_tests++;
31497#endif
31498
31499    return(test_ret);
31500}
31501
31502
31503static int
31504test_xmlTextReaderMoveToFirstAttribute(void) {
31505    int test_ret = 0;
31506
31507#if defined(LIBXML_READER_ENABLED)
31508    int mem_base;
31509    int ret_val;
31510    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31511    int n_reader;
31512
31513    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31514        mem_base = xmlMemBlocks();
31515        reader = gen_xmlTextReaderPtr(n_reader, 0);
31516
31517        ret_val = xmlTextReaderMoveToFirstAttribute(reader);
31518        desret_int(ret_val);
31519        call_tests++;
31520        des_xmlTextReaderPtr(n_reader, reader, 0);
31521        xmlResetLastError();
31522        if (mem_base != xmlMemBlocks()) {
31523            printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute",
31524	           xmlMemBlocks() - mem_base);
31525	    test_ret++;
31526            printf(" %d", n_reader);
31527            printf("\n");
31528        }
31529    }
31530    function_tests++;
31531#endif
31532
31533    return(test_ret);
31534}
31535
31536
31537static int
31538test_xmlTextReaderMoveToNextAttribute(void) {
31539    int test_ret = 0;
31540
31541#if defined(LIBXML_READER_ENABLED)
31542    int mem_base;
31543    int ret_val;
31544    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31545    int n_reader;
31546
31547    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31548        mem_base = xmlMemBlocks();
31549        reader = gen_xmlTextReaderPtr(n_reader, 0);
31550
31551        ret_val = xmlTextReaderMoveToNextAttribute(reader);
31552        desret_int(ret_val);
31553        call_tests++;
31554        des_xmlTextReaderPtr(n_reader, reader, 0);
31555        xmlResetLastError();
31556        if (mem_base != xmlMemBlocks()) {
31557            printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute",
31558	           xmlMemBlocks() - mem_base);
31559	    test_ret++;
31560            printf(" %d", n_reader);
31561            printf("\n");
31562        }
31563    }
31564    function_tests++;
31565#endif
31566
31567    return(test_ret);
31568}
31569
31570
31571static int
31572test_xmlTextReaderName(void) {
31573    int test_ret = 0;
31574
31575#if defined(LIBXML_READER_ENABLED)
31576    int mem_base;
31577    xmlChar * ret_val;
31578    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31579    int n_reader;
31580
31581    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31582        mem_base = xmlMemBlocks();
31583        reader = gen_xmlTextReaderPtr(n_reader, 0);
31584
31585        ret_val = xmlTextReaderName(reader);
31586        desret_xmlChar_ptr(ret_val);
31587        call_tests++;
31588        des_xmlTextReaderPtr(n_reader, reader, 0);
31589        xmlResetLastError();
31590        if (mem_base != xmlMemBlocks()) {
31591            printf("Leak of %d blocks found in xmlTextReaderName",
31592	           xmlMemBlocks() - mem_base);
31593	    test_ret++;
31594            printf(" %d", n_reader);
31595            printf("\n");
31596        }
31597    }
31598    function_tests++;
31599#endif
31600
31601    return(test_ret);
31602}
31603
31604
31605static int
31606test_xmlTextReaderNamespaceUri(void) {
31607    int test_ret = 0;
31608
31609#if defined(LIBXML_READER_ENABLED)
31610    int mem_base;
31611    xmlChar * ret_val;
31612    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31613    int n_reader;
31614
31615    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31616        mem_base = xmlMemBlocks();
31617        reader = gen_xmlTextReaderPtr(n_reader, 0);
31618
31619        ret_val = xmlTextReaderNamespaceUri(reader);
31620        desret_xmlChar_ptr(ret_val);
31621        call_tests++;
31622        des_xmlTextReaderPtr(n_reader, reader, 0);
31623        xmlResetLastError();
31624        if (mem_base != xmlMemBlocks()) {
31625            printf("Leak of %d blocks found in xmlTextReaderNamespaceUri",
31626	           xmlMemBlocks() - mem_base);
31627	    test_ret++;
31628            printf(" %d", n_reader);
31629            printf("\n");
31630        }
31631    }
31632    function_tests++;
31633#endif
31634
31635    return(test_ret);
31636}
31637
31638
31639static int
31640test_xmlTextReaderNext(void) {
31641    int test_ret = 0;
31642
31643#if defined(LIBXML_READER_ENABLED)
31644    int mem_base;
31645    int ret_val;
31646    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31647    int n_reader;
31648
31649    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31650        mem_base = xmlMemBlocks();
31651        reader = gen_xmlTextReaderPtr(n_reader, 0);
31652
31653        ret_val = xmlTextReaderNext(reader);
31654        desret_int(ret_val);
31655        call_tests++;
31656        des_xmlTextReaderPtr(n_reader, reader, 0);
31657        xmlResetLastError();
31658        if (mem_base != xmlMemBlocks()) {
31659            printf("Leak of %d blocks found in xmlTextReaderNext",
31660	           xmlMemBlocks() - mem_base);
31661	    test_ret++;
31662            printf(" %d", n_reader);
31663            printf("\n");
31664        }
31665    }
31666    function_tests++;
31667#endif
31668
31669    return(test_ret);
31670}
31671
31672
31673static int
31674test_xmlTextReaderNextSibling(void) {
31675    int test_ret = 0;
31676
31677#if defined(LIBXML_READER_ENABLED)
31678    int mem_base;
31679    int ret_val;
31680    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31681    int n_reader;
31682
31683    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31684        mem_base = xmlMemBlocks();
31685        reader = gen_xmlTextReaderPtr(n_reader, 0);
31686
31687        ret_val = xmlTextReaderNextSibling(reader);
31688        desret_int(ret_val);
31689        call_tests++;
31690        des_xmlTextReaderPtr(n_reader, reader, 0);
31691        xmlResetLastError();
31692        if (mem_base != xmlMemBlocks()) {
31693            printf("Leak of %d blocks found in xmlTextReaderNextSibling",
31694	           xmlMemBlocks() - mem_base);
31695	    test_ret++;
31696            printf(" %d", n_reader);
31697            printf("\n");
31698        }
31699    }
31700    function_tests++;
31701#endif
31702
31703    return(test_ret);
31704}
31705
31706
31707static int
31708test_xmlTextReaderNodeType(void) {
31709    int test_ret = 0;
31710
31711#if defined(LIBXML_READER_ENABLED)
31712    int mem_base;
31713    int ret_val;
31714    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31715    int n_reader;
31716
31717    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31718        mem_base = xmlMemBlocks();
31719        reader = gen_xmlTextReaderPtr(n_reader, 0);
31720
31721        ret_val = xmlTextReaderNodeType(reader);
31722        desret_int(ret_val);
31723        call_tests++;
31724        des_xmlTextReaderPtr(n_reader, reader, 0);
31725        xmlResetLastError();
31726        if (mem_base != xmlMemBlocks()) {
31727            printf("Leak of %d blocks found in xmlTextReaderNodeType",
31728	           xmlMemBlocks() - mem_base);
31729	    test_ret++;
31730            printf(" %d", n_reader);
31731            printf("\n");
31732        }
31733    }
31734    function_tests++;
31735#endif
31736
31737    return(test_ret);
31738}
31739
31740
31741static int
31742test_xmlTextReaderNormalization(void) {
31743    int test_ret = 0;
31744
31745#if defined(LIBXML_READER_ENABLED)
31746    int mem_base;
31747    int ret_val;
31748    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31749    int n_reader;
31750
31751    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31752        mem_base = xmlMemBlocks();
31753        reader = gen_xmlTextReaderPtr(n_reader, 0);
31754
31755        ret_val = xmlTextReaderNormalization(reader);
31756        desret_int(ret_val);
31757        call_tests++;
31758        des_xmlTextReaderPtr(n_reader, reader, 0);
31759        xmlResetLastError();
31760        if (mem_base != xmlMemBlocks()) {
31761            printf("Leak of %d blocks found in xmlTextReaderNormalization",
31762	           xmlMemBlocks() - mem_base);
31763	    test_ret++;
31764            printf(" %d", n_reader);
31765            printf("\n");
31766        }
31767    }
31768    function_tests++;
31769#endif
31770
31771    return(test_ret);
31772}
31773
31774
31775static int
31776test_xmlTextReaderPrefix(void) {
31777    int test_ret = 0;
31778
31779#if defined(LIBXML_READER_ENABLED)
31780    int mem_base;
31781    xmlChar * ret_val;
31782    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31783    int n_reader;
31784
31785    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31786        mem_base = xmlMemBlocks();
31787        reader = gen_xmlTextReaderPtr(n_reader, 0);
31788
31789        ret_val = xmlTextReaderPrefix(reader);
31790        desret_xmlChar_ptr(ret_val);
31791        call_tests++;
31792        des_xmlTextReaderPtr(n_reader, reader, 0);
31793        xmlResetLastError();
31794        if (mem_base != xmlMemBlocks()) {
31795            printf("Leak of %d blocks found in xmlTextReaderPrefix",
31796	           xmlMemBlocks() - mem_base);
31797	    test_ret++;
31798            printf(" %d", n_reader);
31799            printf("\n");
31800        }
31801    }
31802    function_tests++;
31803#endif
31804
31805    return(test_ret);
31806}
31807
31808
31809static int
31810test_xmlTextReaderPreserve(void) {
31811    int test_ret = 0;
31812
31813#if defined(LIBXML_READER_ENABLED)
31814    int mem_base;
31815    xmlNodePtr ret_val;
31816    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31817    int n_reader;
31818
31819    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31820        mem_base = xmlMemBlocks();
31821        reader = gen_xmlTextReaderPtr(n_reader, 0);
31822
31823        ret_val = xmlTextReaderPreserve(reader);
31824        desret_xmlNodePtr(ret_val);
31825        call_tests++;
31826        des_xmlTextReaderPtr(n_reader, reader, 0);
31827        xmlResetLastError();
31828        if (mem_base != xmlMemBlocks()) {
31829            printf("Leak of %d blocks found in xmlTextReaderPreserve",
31830	           xmlMemBlocks() - mem_base);
31831	    test_ret++;
31832            printf(" %d", n_reader);
31833            printf("\n");
31834        }
31835    }
31836    function_tests++;
31837#endif
31838
31839    return(test_ret);
31840}
31841
31842
31843static int
31844test_xmlTextReaderPreservePattern(void) {
31845    int test_ret = 0;
31846
31847#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
31848#ifdef LIBXML_PATTERN_ENABLED
31849    int mem_base;
31850    int ret_val;
31851    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31852    int n_reader;
31853    xmlChar * pattern; /* an XPath subset pattern */
31854    int n_pattern;
31855    xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */
31856    int n_namespaces;
31857
31858    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31859    for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) {
31860    for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) {
31861        mem_base = xmlMemBlocks();
31862        reader = gen_xmlTextReaderPtr(n_reader, 0);
31863        pattern = gen_const_xmlChar_ptr(n_pattern, 1);
31864        namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2);
31865
31866        ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces);
31867        desret_int(ret_val);
31868        call_tests++;
31869        des_xmlTextReaderPtr(n_reader, reader, 0);
31870        des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1);
31871        des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2);
31872        xmlResetLastError();
31873        if (mem_base != xmlMemBlocks()) {
31874            printf("Leak of %d blocks found in xmlTextReaderPreservePattern",
31875	           xmlMemBlocks() - mem_base);
31876	    test_ret++;
31877            printf(" %d", n_reader);
31878            printf(" %d", n_pattern);
31879            printf(" %d", n_namespaces);
31880            printf("\n");
31881        }
31882    }
31883    }
31884    }
31885    function_tests++;
31886#endif
31887#endif
31888
31889    return(test_ret);
31890}
31891
31892
31893static int
31894test_xmlTextReaderQuoteChar(void) {
31895    int test_ret = 0;
31896
31897#if defined(LIBXML_READER_ENABLED)
31898    int mem_base;
31899    int ret_val;
31900    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31901    int n_reader;
31902
31903    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31904        mem_base = xmlMemBlocks();
31905        reader = gen_xmlTextReaderPtr(n_reader, 0);
31906
31907        ret_val = xmlTextReaderQuoteChar(reader);
31908        desret_int(ret_val);
31909        call_tests++;
31910        des_xmlTextReaderPtr(n_reader, reader, 0);
31911        xmlResetLastError();
31912        if (mem_base != xmlMemBlocks()) {
31913            printf("Leak of %d blocks found in xmlTextReaderQuoteChar",
31914	           xmlMemBlocks() - mem_base);
31915	    test_ret++;
31916            printf(" %d", n_reader);
31917            printf("\n");
31918        }
31919    }
31920    function_tests++;
31921#endif
31922
31923    return(test_ret);
31924}
31925
31926
31927static int
31928test_xmlTextReaderRead(void) {
31929    int test_ret = 0;
31930
31931#if defined(LIBXML_READER_ENABLED)
31932    int mem_base;
31933    int ret_val;
31934    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31935    int n_reader;
31936
31937    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31938        mem_base = xmlMemBlocks();
31939        reader = gen_xmlTextReaderPtr(n_reader, 0);
31940
31941        ret_val = xmlTextReaderRead(reader);
31942        desret_int(ret_val);
31943        call_tests++;
31944        des_xmlTextReaderPtr(n_reader, reader, 0);
31945        xmlResetLastError();
31946        if (mem_base != xmlMemBlocks()) {
31947            printf("Leak of %d blocks found in xmlTextReaderRead",
31948	           xmlMemBlocks() - mem_base);
31949	    test_ret++;
31950            printf(" %d", n_reader);
31951            printf("\n");
31952        }
31953    }
31954    function_tests++;
31955#endif
31956
31957    return(test_ret);
31958}
31959
31960
31961static int
31962test_xmlTextReaderReadAttributeValue(void) {
31963    int test_ret = 0;
31964
31965#if defined(LIBXML_READER_ENABLED)
31966    int mem_base;
31967    int ret_val;
31968    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
31969    int n_reader;
31970
31971    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
31972        mem_base = xmlMemBlocks();
31973        reader = gen_xmlTextReaderPtr(n_reader, 0);
31974
31975        ret_val = xmlTextReaderReadAttributeValue(reader);
31976        desret_int(ret_val);
31977        call_tests++;
31978        des_xmlTextReaderPtr(n_reader, reader, 0);
31979        xmlResetLastError();
31980        if (mem_base != xmlMemBlocks()) {
31981            printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue",
31982	           xmlMemBlocks() - mem_base);
31983	    test_ret++;
31984            printf(" %d", n_reader);
31985            printf("\n");
31986        }
31987    }
31988    function_tests++;
31989#endif
31990
31991    return(test_ret);
31992}
31993
31994
31995static int
31996test_xmlTextReaderReadState(void) {
31997    int test_ret = 0;
31998
31999#if defined(LIBXML_READER_ENABLED)
32000    int mem_base;
32001    int ret_val;
32002    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32003    int n_reader;
32004
32005    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32006        mem_base = xmlMemBlocks();
32007        reader = gen_xmlTextReaderPtr(n_reader, 0);
32008
32009        ret_val = xmlTextReaderReadState(reader);
32010        desret_int(ret_val);
32011        call_tests++;
32012        des_xmlTextReaderPtr(n_reader, reader, 0);
32013        xmlResetLastError();
32014        if (mem_base != xmlMemBlocks()) {
32015            printf("Leak of %d blocks found in xmlTextReaderReadState",
32016	           xmlMemBlocks() - mem_base);
32017	    test_ret++;
32018            printf(" %d", n_reader);
32019            printf("\n");
32020        }
32021    }
32022    function_tests++;
32023#endif
32024
32025    return(test_ret);
32026}
32027
32028
32029static int
32030test_xmlTextReaderRelaxNGSetSchema(void) {
32031    int test_ret = 0;
32032
32033#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32034    int mem_base;
32035    int ret_val;
32036    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32037    int n_reader;
32038    xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */
32039    int n_schema;
32040
32041    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32042    for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) {
32043        mem_base = xmlMemBlocks();
32044        reader = gen_xmlTextReaderPtr(n_reader, 0);
32045        schema = gen_xmlRelaxNGPtr(n_schema, 1);
32046
32047        ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema);
32048        desret_int(ret_val);
32049        call_tests++;
32050        des_xmlTextReaderPtr(n_reader, reader, 0);
32051        des_xmlRelaxNGPtr(n_schema, schema, 1);
32052        xmlResetLastError();
32053        if (mem_base != xmlMemBlocks()) {
32054            printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema",
32055	           xmlMemBlocks() - mem_base);
32056	    test_ret++;
32057            printf(" %d", n_reader);
32058            printf(" %d", n_schema);
32059            printf("\n");
32060        }
32061    }
32062    }
32063    function_tests++;
32064#endif
32065
32066    return(test_ret);
32067}
32068
32069
32070static int
32071test_xmlTextReaderRelaxNGValidate(void) {
32072    int test_ret = 0;
32073
32074#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32075    int mem_base;
32076    int ret_val;
32077    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32078    int n_reader;
32079    char * rng; /* the path to a RelaxNG schema or NULL */
32080    int n_rng;
32081
32082    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32083    for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) {
32084        mem_base = xmlMemBlocks();
32085        reader = gen_xmlTextReaderPtr(n_reader, 0);
32086        rng = gen_const_char_ptr(n_rng, 1);
32087
32088        ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng);
32089        desret_int(ret_val);
32090        call_tests++;
32091        des_xmlTextReaderPtr(n_reader, reader, 0);
32092        des_const_char_ptr(n_rng, (const char *)rng, 1);
32093        xmlResetLastError();
32094        if (mem_base != xmlMemBlocks()) {
32095            printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate",
32096	           xmlMemBlocks() - mem_base);
32097	    test_ret++;
32098            printf(" %d", n_reader);
32099            printf(" %d", n_rng);
32100            printf("\n");
32101        }
32102    }
32103    }
32104    function_tests++;
32105#endif
32106
32107    return(test_ret);
32108}
32109
32110
32111static int
32112test_xmlTextReaderSchemaValidate(void) {
32113    int test_ret = 0;
32114
32115#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32116    int ret_val;
32117    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32118    int n_reader;
32119    char * xsd; /* the path to a W3C XSD schema or NULL */
32120    int n_xsd;
32121
32122    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32123    for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) {
32124        reader = gen_xmlTextReaderPtr(n_reader, 0);
32125        xsd = gen_const_char_ptr(n_xsd, 1);
32126
32127        ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd);
32128        desret_int(ret_val);
32129        call_tests++;
32130        des_xmlTextReaderPtr(n_reader, reader, 0);
32131        des_const_char_ptr(n_xsd, (const char *)xsd, 1);
32132        xmlResetLastError();
32133    }
32134    }
32135    function_tests++;
32136#endif
32137
32138    return(test_ret);
32139}
32140
32141
32142static int
32143test_xmlTextReaderSchemaValidateCtxt(void) {
32144    int test_ret = 0;
32145
32146#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32147    int mem_base;
32148    int ret_val;
32149    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32150    int n_reader;
32151    xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */
32152    int n_ctxt;
32153    int options; /* options (not used yet) */
32154    int n_options;
32155
32156    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32157    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
32158    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32159        mem_base = xmlMemBlocks();
32160        reader = gen_xmlTextReaderPtr(n_reader, 0);
32161        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1);
32162        options = gen_parseroptions(n_options, 2);
32163
32164        ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options);
32165        desret_int(ret_val);
32166        call_tests++;
32167        des_xmlTextReaderPtr(n_reader, reader, 0);
32168        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1);
32169        des_parseroptions(n_options, options, 2);
32170        xmlResetLastError();
32171        if (mem_base != xmlMemBlocks()) {
32172            printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt",
32173	           xmlMemBlocks() - mem_base);
32174	    test_ret++;
32175            printf(" %d", n_reader);
32176            printf(" %d", n_ctxt);
32177            printf(" %d", n_options);
32178            printf("\n");
32179        }
32180    }
32181    }
32182    }
32183    function_tests++;
32184#endif
32185
32186    return(test_ret);
32187}
32188
32189
32190static int
32191test_xmlTextReaderSetErrorHandler(void) {
32192    int test_ret = 0;
32193
32194
32195    /* missing type support */
32196    return(test_ret);
32197}
32198
32199
32200static int
32201test_xmlTextReaderSetParserProp(void) {
32202    int test_ret = 0;
32203
32204#if defined(LIBXML_READER_ENABLED)
32205    int mem_base;
32206    int ret_val;
32207    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32208    int n_reader;
32209    int prop; /* the xmlParserProperties to set */
32210    int n_prop;
32211    int value; /* usually 0 or 1 to (de)activate it */
32212    int n_value;
32213
32214    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32215    for (n_prop = 0;n_prop < gen_nb_int;n_prop++) {
32216    for (n_value = 0;n_value < gen_nb_int;n_value++) {
32217        mem_base = xmlMemBlocks();
32218        reader = gen_xmlTextReaderPtr(n_reader, 0);
32219        prop = gen_int(n_prop, 1);
32220        value = gen_int(n_value, 2);
32221
32222        ret_val = xmlTextReaderSetParserProp(reader, prop, value);
32223        desret_int(ret_val);
32224        call_tests++;
32225        des_xmlTextReaderPtr(n_reader, reader, 0);
32226        des_int(n_prop, prop, 1);
32227        des_int(n_value, value, 2);
32228        xmlResetLastError();
32229        if (mem_base != xmlMemBlocks()) {
32230            printf("Leak of %d blocks found in xmlTextReaderSetParserProp",
32231	           xmlMemBlocks() - mem_base);
32232	    test_ret++;
32233            printf(" %d", n_reader);
32234            printf(" %d", n_prop);
32235            printf(" %d", n_value);
32236            printf("\n");
32237        }
32238    }
32239    }
32240    }
32241    function_tests++;
32242#endif
32243
32244    return(test_ret);
32245}
32246
32247
32248static int
32249test_xmlTextReaderSetSchema(void) {
32250    int test_ret = 0;
32251
32252#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED)
32253    int mem_base;
32254    int ret_val;
32255    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32256    int n_reader;
32257    xmlSchemaPtr schema; /* a precompiled Schema schema */
32258    int n_schema;
32259
32260    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32261    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
32262        mem_base = xmlMemBlocks();
32263        reader = gen_xmlTextReaderPtr(n_reader, 0);
32264        schema = gen_xmlSchemaPtr(n_schema, 1);
32265
32266        ret_val = xmlTextReaderSetSchema(reader, schema);
32267        desret_int(ret_val);
32268        call_tests++;
32269        des_xmlTextReaderPtr(n_reader, reader, 0);
32270        des_xmlSchemaPtr(n_schema, schema, 1);
32271        xmlResetLastError();
32272        if (mem_base != xmlMemBlocks()) {
32273            printf("Leak of %d blocks found in xmlTextReaderSetSchema",
32274	           xmlMemBlocks() - mem_base);
32275	    test_ret++;
32276            printf(" %d", n_reader);
32277            printf(" %d", n_schema);
32278            printf("\n");
32279        }
32280    }
32281    }
32282    function_tests++;
32283#endif
32284
32285    return(test_ret);
32286}
32287
32288
32289static int
32290test_xmlTextReaderSetStructuredErrorHandler(void) {
32291    int test_ret = 0;
32292
32293
32294    /* missing type support */
32295    return(test_ret);
32296}
32297
32298
32299static int
32300test_xmlTextReaderSetup(void) {
32301    int test_ret = 0;
32302
32303#if defined(LIBXML_READER_ENABLED)
32304    int mem_base;
32305    int ret_val;
32306    xmlTextReaderPtr reader; /* an XML reader */
32307    int n_reader;
32308    xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */
32309    int n_input;
32310    const char * URL; /* the base URL to use for the document */
32311    int n_URL;
32312    char * encoding; /* the document encoding, or NULL */
32313    int n_encoding;
32314    int options; /* a combination of xmlParserOption */
32315    int n_options;
32316
32317    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32318    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
32319    for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
32320    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
32321    for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) {
32322        mem_base = xmlMemBlocks();
32323        reader = gen_xmlTextReaderPtr(n_reader, 0);
32324        input = gen_xmlParserInputBufferPtr(n_input, 1);
32325        URL = gen_filepath(n_URL, 2);
32326        encoding = gen_const_char_ptr(n_encoding, 3);
32327        options = gen_parseroptions(n_options, 4);
32328
32329        ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options);
32330        desret_int(ret_val);
32331        call_tests++;
32332        des_xmlTextReaderPtr(n_reader, reader, 0);
32333        des_filepath(n_URL, URL, 2);
32334        des_const_char_ptr(n_encoding, (const char *)encoding, 3);
32335        des_parseroptions(n_options, options, 4);
32336        xmlResetLastError();
32337        if (mem_base != xmlMemBlocks()) {
32338            printf("Leak of %d blocks found in xmlTextReaderSetup",
32339	           xmlMemBlocks() - mem_base);
32340	    test_ret++;
32341            printf(" %d", n_reader);
32342            printf(" %d", n_input);
32343            printf(" %d", n_URL);
32344            printf(" %d", n_encoding);
32345            printf(" %d", n_options);
32346            printf("\n");
32347        }
32348    }
32349    }
32350    }
32351    }
32352    }
32353    function_tests++;
32354#endif
32355
32356    return(test_ret);
32357}
32358
32359
32360static int
32361test_xmlTextReaderStandalone(void) {
32362    int test_ret = 0;
32363
32364#if defined(LIBXML_READER_ENABLED)
32365    int mem_base;
32366    int ret_val;
32367    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32368    int n_reader;
32369
32370    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32371        mem_base = xmlMemBlocks();
32372        reader = gen_xmlTextReaderPtr(n_reader, 0);
32373
32374        ret_val = xmlTextReaderStandalone(reader);
32375        desret_int(ret_val);
32376        call_tests++;
32377        des_xmlTextReaderPtr(n_reader, reader, 0);
32378        xmlResetLastError();
32379        if (mem_base != xmlMemBlocks()) {
32380            printf("Leak of %d blocks found in xmlTextReaderStandalone",
32381	           xmlMemBlocks() - mem_base);
32382	    test_ret++;
32383            printf(" %d", n_reader);
32384            printf("\n");
32385        }
32386    }
32387    function_tests++;
32388#endif
32389
32390    return(test_ret);
32391}
32392
32393
32394static int
32395test_xmlTextReaderValue(void) {
32396    int test_ret = 0;
32397
32398#if defined(LIBXML_READER_ENABLED)
32399    int mem_base;
32400    xmlChar * ret_val;
32401    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32402    int n_reader;
32403
32404    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32405        mem_base = xmlMemBlocks();
32406        reader = gen_xmlTextReaderPtr(n_reader, 0);
32407
32408        ret_val = xmlTextReaderValue(reader);
32409        desret_xmlChar_ptr(ret_val);
32410        call_tests++;
32411        des_xmlTextReaderPtr(n_reader, reader, 0);
32412        xmlResetLastError();
32413        if (mem_base != xmlMemBlocks()) {
32414            printf("Leak of %d blocks found in xmlTextReaderValue",
32415	           xmlMemBlocks() - mem_base);
32416	    test_ret++;
32417            printf(" %d", n_reader);
32418            printf("\n");
32419        }
32420    }
32421    function_tests++;
32422#endif
32423
32424    return(test_ret);
32425}
32426
32427
32428static int
32429test_xmlTextReaderXmlLang(void) {
32430    int test_ret = 0;
32431
32432#if defined(LIBXML_READER_ENABLED)
32433    int mem_base;
32434    xmlChar * ret_val;
32435    xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */
32436    int n_reader;
32437
32438    for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) {
32439        mem_base = xmlMemBlocks();
32440        reader = gen_xmlTextReaderPtr(n_reader, 0);
32441
32442        ret_val = xmlTextReaderXmlLang(reader);
32443        desret_xmlChar_ptr(ret_val);
32444        call_tests++;
32445        des_xmlTextReaderPtr(n_reader, reader, 0);
32446        xmlResetLastError();
32447        if (mem_base != xmlMemBlocks()) {
32448            printf("Leak of %d blocks found in xmlTextReaderXmlLang",
32449	           xmlMemBlocks() - mem_base);
32450	    test_ret++;
32451            printf(" %d", n_reader);
32452            printf("\n");
32453        }
32454    }
32455    function_tests++;
32456#endif
32457
32458    return(test_ret);
32459}
32460
32461static int
32462test_xmlreader(void) {
32463    int test_ret = 0;
32464
32465    if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n");
32466    test_ret += test_xmlNewTextReader();
32467    test_ret += test_xmlNewTextReaderFilename();
32468    test_ret += test_xmlReaderForDoc();
32469    test_ret += test_xmlReaderForFile();
32470    test_ret += test_xmlReaderForMemory();
32471    test_ret += test_xmlReaderNewDoc();
32472    test_ret += test_xmlReaderNewFile();
32473    test_ret += test_xmlReaderNewMemory();
32474    test_ret += test_xmlReaderNewWalker();
32475    test_ret += test_xmlReaderWalker();
32476    test_ret += test_xmlTextReaderAttributeCount();
32477    test_ret += test_xmlTextReaderBaseUri();
32478    test_ret += test_xmlTextReaderByteConsumed();
32479    test_ret += test_xmlTextReaderClose();
32480    test_ret += test_xmlTextReaderConstBaseUri();
32481    test_ret += test_xmlTextReaderConstEncoding();
32482    test_ret += test_xmlTextReaderConstLocalName();
32483    test_ret += test_xmlTextReaderConstName();
32484    test_ret += test_xmlTextReaderConstNamespaceUri();
32485    test_ret += test_xmlTextReaderConstPrefix();
32486    test_ret += test_xmlTextReaderConstString();
32487    test_ret += test_xmlTextReaderConstValue();
32488    test_ret += test_xmlTextReaderConstXmlLang();
32489    test_ret += test_xmlTextReaderConstXmlVersion();
32490    test_ret += test_xmlTextReaderCurrentDoc();
32491    test_ret += test_xmlTextReaderCurrentNode();
32492    test_ret += test_xmlTextReaderDepth();
32493    test_ret += test_xmlTextReaderExpand();
32494    test_ret += test_xmlTextReaderGetAttribute();
32495    test_ret += test_xmlTextReaderGetAttributeNo();
32496    test_ret += test_xmlTextReaderGetAttributeNs();
32497    test_ret += test_xmlTextReaderGetErrorHandler();
32498    test_ret += test_xmlTextReaderGetParserColumnNumber();
32499    test_ret += test_xmlTextReaderGetParserLineNumber();
32500    test_ret += test_xmlTextReaderGetParserProp();
32501    test_ret += test_xmlTextReaderGetRemainder();
32502    test_ret += test_xmlTextReaderHasAttributes();
32503    test_ret += test_xmlTextReaderHasValue();
32504    test_ret += test_xmlTextReaderIsDefault();
32505    test_ret += test_xmlTextReaderIsEmptyElement();
32506    test_ret += test_xmlTextReaderIsNamespaceDecl();
32507    test_ret += test_xmlTextReaderIsValid();
32508    test_ret += test_xmlTextReaderLocalName();
32509    test_ret += test_xmlTextReaderLocatorBaseURI();
32510    test_ret += test_xmlTextReaderLocatorLineNumber();
32511    test_ret += test_xmlTextReaderLookupNamespace();
32512    test_ret += test_xmlTextReaderMoveToAttribute();
32513    test_ret += test_xmlTextReaderMoveToAttributeNo();
32514    test_ret += test_xmlTextReaderMoveToAttributeNs();
32515    test_ret += test_xmlTextReaderMoveToElement();
32516    test_ret += test_xmlTextReaderMoveToFirstAttribute();
32517    test_ret += test_xmlTextReaderMoveToNextAttribute();
32518    test_ret += test_xmlTextReaderName();
32519    test_ret += test_xmlTextReaderNamespaceUri();
32520    test_ret += test_xmlTextReaderNext();
32521    test_ret += test_xmlTextReaderNextSibling();
32522    test_ret += test_xmlTextReaderNodeType();
32523    test_ret += test_xmlTextReaderNormalization();
32524    test_ret += test_xmlTextReaderPrefix();
32525    test_ret += test_xmlTextReaderPreserve();
32526    test_ret += test_xmlTextReaderPreservePattern();
32527    test_ret += test_xmlTextReaderQuoteChar();
32528    test_ret += test_xmlTextReaderRead();
32529    test_ret += test_xmlTextReaderReadAttributeValue();
32530    test_ret += test_xmlTextReaderReadState();
32531    test_ret += test_xmlTextReaderRelaxNGSetSchema();
32532    test_ret += test_xmlTextReaderRelaxNGValidate();
32533    test_ret += test_xmlTextReaderSchemaValidate();
32534    test_ret += test_xmlTextReaderSchemaValidateCtxt();
32535    test_ret += test_xmlTextReaderSetErrorHandler();
32536    test_ret += test_xmlTextReaderSetParserProp();
32537    test_ret += test_xmlTextReaderSetSchema();
32538    test_ret += test_xmlTextReaderSetStructuredErrorHandler();
32539    test_ret += test_xmlTextReaderSetup();
32540    test_ret += test_xmlTextReaderStandalone();
32541    test_ret += test_xmlTextReaderValue();
32542    test_ret += test_xmlTextReaderXmlLang();
32543
32544    if (test_ret != 0)
32545	printf("Module xmlreader: %d errors\n", test_ret);
32546    return(test_ret);
32547}
32548
32549static int
32550test_xmlExpCtxtNbCons(void) {
32551    int test_ret = 0;
32552
32553#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32554    int mem_base;
32555    int ret_val;
32556    xmlExpCtxtPtr ctxt; /* an expression context */
32557    int n_ctxt;
32558
32559    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32560        mem_base = xmlMemBlocks();
32561        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32562
32563        ret_val = xmlExpCtxtNbCons(ctxt);
32564        desret_int(ret_val);
32565        call_tests++;
32566        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32567        xmlResetLastError();
32568        if (mem_base != xmlMemBlocks()) {
32569            printf("Leak of %d blocks found in xmlExpCtxtNbCons",
32570	           xmlMemBlocks() - mem_base);
32571	    test_ret++;
32572            printf(" %d", n_ctxt);
32573            printf("\n");
32574        }
32575    }
32576    function_tests++;
32577#endif
32578
32579    return(test_ret);
32580}
32581
32582
32583static int
32584test_xmlExpCtxtNbNodes(void) {
32585    int test_ret = 0;
32586
32587#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32588    int mem_base;
32589    int ret_val;
32590    xmlExpCtxtPtr ctxt; /* an expression context */
32591    int n_ctxt;
32592
32593    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32594        mem_base = xmlMemBlocks();
32595        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32596
32597        ret_val = xmlExpCtxtNbNodes(ctxt);
32598        desret_int(ret_val);
32599        call_tests++;
32600        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32601        xmlResetLastError();
32602        if (mem_base != xmlMemBlocks()) {
32603            printf("Leak of %d blocks found in xmlExpCtxtNbNodes",
32604	           xmlMemBlocks() - mem_base);
32605	    test_ret++;
32606            printf(" %d", n_ctxt);
32607            printf("\n");
32608        }
32609    }
32610    function_tests++;
32611#endif
32612
32613    return(test_ret);
32614}
32615
32616
32617static int
32618test_xmlExpDump(void) {
32619    int test_ret = 0;
32620
32621#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32622    int mem_base;
32623    xmlBufferPtr buf; /* a buffer to receive the output */
32624    int n_buf;
32625    xmlExpNodePtr expr; /* the compiled expression */
32626    int n_expr;
32627
32628    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
32629    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32630        mem_base = xmlMemBlocks();
32631        buf = gen_xmlBufferPtr(n_buf, 0);
32632        expr = gen_xmlExpNodePtr(n_expr, 1);
32633
32634        xmlExpDump(buf, expr);
32635        call_tests++;
32636        des_xmlBufferPtr(n_buf, buf, 0);
32637        des_xmlExpNodePtr(n_expr, expr, 1);
32638        xmlResetLastError();
32639        if (mem_base != xmlMemBlocks()) {
32640            printf("Leak of %d blocks found in xmlExpDump",
32641	           xmlMemBlocks() - mem_base);
32642	    test_ret++;
32643            printf(" %d", n_buf);
32644            printf(" %d", n_expr);
32645            printf("\n");
32646        }
32647    }
32648    }
32649    function_tests++;
32650#endif
32651
32652    return(test_ret);
32653}
32654
32655
32656static int
32657test_xmlExpExpDerive(void) {
32658    int test_ret = 0;
32659
32660
32661    /* missing type support */
32662    return(test_ret);
32663}
32664
32665
32666static int
32667test_xmlExpGetLanguage(void) {
32668    int test_ret = 0;
32669
32670#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32671    int mem_base;
32672    int ret_val;
32673    xmlExpCtxtPtr ctxt; /* the expression context */
32674    int n_ctxt;
32675    xmlExpNodePtr exp; /* the expression */
32676    int n_exp;
32677    xmlChar ** langList; /* where to store the tokens */
32678    int n_langList;
32679    int len; /* the allocated lenght of @list */
32680    int n_len;
32681
32682    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32683    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32684    for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) {
32685    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32686        mem_base = xmlMemBlocks();
32687        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32688        exp = gen_xmlExpNodePtr(n_exp, 1);
32689        langList = gen_const_xmlChar_ptr_ptr(n_langList, 2);
32690        len = gen_int(n_len, 3);
32691
32692        ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len);
32693        desret_int(ret_val);
32694        call_tests++;
32695        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32696        des_xmlExpNodePtr(n_exp, exp, 1);
32697        des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2);
32698        des_int(n_len, len, 3);
32699        xmlResetLastError();
32700        if (mem_base != xmlMemBlocks()) {
32701            printf("Leak of %d blocks found in xmlExpGetLanguage",
32702	           xmlMemBlocks() - mem_base);
32703	    test_ret++;
32704            printf(" %d", n_ctxt);
32705            printf(" %d", n_exp);
32706            printf(" %d", n_langList);
32707            printf(" %d", n_len);
32708            printf("\n");
32709        }
32710    }
32711    }
32712    }
32713    }
32714    function_tests++;
32715#endif
32716
32717    return(test_ret);
32718}
32719
32720
32721static int
32722test_xmlExpGetStart(void) {
32723    int test_ret = 0;
32724
32725#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32726    int mem_base;
32727    int ret_val;
32728    xmlExpCtxtPtr ctxt; /* the expression context */
32729    int n_ctxt;
32730    xmlExpNodePtr exp; /* the expression */
32731    int n_exp;
32732    xmlChar ** tokList; /* where to store the tokens */
32733    int n_tokList;
32734    int len; /* the allocated lenght of @list */
32735    int n_len;
32736
32737    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32738    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32739    for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) {
32740    for (n_len = 0;n_len < gen_nb_int;n_len++) {
32741        mem_base = xmlMemBlocks();
32742        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32743        exp = gen_xmlExpNodePtr(n_exp, 1);
32744        tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2);
32745        len = gen_int(n_len, 3);
32746
32747        ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len);
32748        desret_int(ret_val);
32749        call_tests++;
32750        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32751        des_xmlExpNodePtr(n_exp, exp, 1);
32752        des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2);
32753        des_int(n_len, len, 3);
32754        xmlResetLastError();
32755        if (mem_base != xmlMemBlocks()) {
32756            printf("Leak of %d blocks found in xmlExpGetStart",
32757	           xmlMemBlocks() - mem_base);
32758	    test_ret++;
32759            printf(" %d", n_ctxt);
32760            printf(" %d", n_exp);
32761            printf(" %d", n_tokList);
32762            printf(" %d", n_len);
32763            printf("\n");
32764        }
32765    }
32766    }
32767    }
32768    }
32769    function_tests++;
32770#endif
32771
32772    return(test_ret);
32773}
32774
32775
32776static int
32777test_xmlExpIsNillable(void) {
32778    int test_ret = 0;
32779
32780#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32781    int mem_base;
32782    int ret_val;
32783    xmlExpNodePtr exp; /* the expression */
32784    int n_exp;
32785
32786    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32787        mem_base = xmlMemBlocks();
32788        exp = gen_xmlExpNodePtr(n_exp, 0);
32789
32790        ret_val = xmlExpIsNillable(exp);
32791        desret_int(ret_val);
32792        call_tests++;
32793        des_xmlExpNodePtr(n_exp, exp, 0);
32794        xmlResetLastError();
32795        if (mem_base != xmlMemBlocks()) {
32796            printf("Leak of %d blocks found in xmlExpIsNillable",
32797	           xmlMemBlocks() - mem_base);
32798	    test_ret++;
32799            printf(" %d", n_exp);
32800            printf("\n");
32801        }
32802    }
32803    function_tests++;
32804#endif
32805
32806    return(test_ret);
32807}
32808
32809
32810static int
32811test_xmlExpMaxToken(void) {
32812    int test_ret = 0;
32813
32814#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32815    int mem_base;
32816    int ret_val;
32817    xmlExpNodePtr expr; /* a compiled expression */
32818    int n_expr;
32819
32820    for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) {
32821        mem_base = xmlMemBlocks();
32822        expr = gen_xmlExpNodePtr(n_expr, 0);
32823
32824        ret_val = xmlExpMaxToken(expr);
32825        desret_int(ret_val);
32826        call_tests++;
32827        des_xmlExpNodePtr(n_expr, expr, 0);
32828        xmlResetLastError();
32829        if (mem_base != xmlMemBlocks()) {
32830            printf("Leak of %d blocks found in xmlExpMaxToken",
32831	           xmlMemBlocks() - mem_base);
32832	    test_ret++;
32833            printf(" %d", n_expr);
32834            printf("\n");
32835        }
32836    }
32837    function_tests++;
32838#endif
32839
32840    return(test_ret);
32841}
32842
32843
32844static int
32845test_xmlExpNewAtom(void) {
32846    int test_ret = 0;
32847
32848
32849    /* missing type support */
32850    return(test_ret);
32851}
32852
32853
32854static int
32855test_xmlExpNewCtxt(void) {
32856    int test_ret = 0;
32857
32858
32859    /* missing type support */
32860    return(test_ret);
32861}
32862
32863
32864static int
32865test_xmlExpNewOr(void) {
32866    int test_ret = 0;
32867
32868
32869    /* missing type support */
32870    return(test_ret);
32871}
32872
32873
32874static int
32875test_xmlExpNewRange(void) {
32876    int test_ret = 0;
32877
32878
32879    /* missing type support */
32880    return(test_ret);
32881}
32882
32883
32884static int
32885test_xmlExpNewSeq(void) {
32886    int test_ret = 0;
32887
32888
32889    /* missing type support */
32890    return(test_ret);
32891}
32892
32893
32894static int
32895test_xmlExpParse(void) {
32896    int test_ret = 0;
32897
32898
32899    /* missing type support */
32900    return(test_ret);
32901}
32902
32903
32904static int
32905test_xmlExpRef(void) {
32906    int test_ret = 0;
32907
32908#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32909    int mem_base;
32910    xmlExpNodePtr exp; /* the expression */
32911    int n_exp;
32912
32913    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32914        mem_base = xmlMemBlocks();
32915        exp = gen_xmlExpNodePtr(n_exp, 0);
32916
32917        xmlExpRef(exp);
32918        call_tests++;
32919        des_xmlExpNodePtr(n_exp, exp, 0);
32920        xmlResetLastError();
32921        if (mem_base != xmlMemBlocks()) {
32922            printf("Leak of %d blocks found in xmlExpRef",
32923	           xmlMemBlocks() - mem_base);
32924	    test_ret++;
32925            printf(" %d", n_exp);
32926            printf("\n");
32927        }
32928    }
32929    function_tests++;
32930#endif
32931
32932    return(test_ret);
32933}
32934
32935
32936static int
32937test_xmlExpStringDerive(void) {
32938    int test_ret = 0;
32939
32940
32941    /* missing type support */
32942    return(test_ret);
32943}
32944
32945
32946static int
32947test_xmlExpSubsume(void) {
32948    int test_ret = 0;
32949
32950#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED)
32951    int mem_base;
32952    int ret_val;
32953    xmlExpCtxtPtr ctxt; /* the expressions context */
32954    int n_ctxt;
32955    xmlExpNodePtr exp; /* the englobing expression */
32956    int n_exp;
32957    xmlExpNodePtr sub; /* the subexpression */
32958    int n_sub;
32959
32960    for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) {
32961    for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) {
32962    for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) {
32963        mem_base = xmlMemBlocks();
32964        ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0);
32965        exp = gen_xmlExpNodePtr(n_exp, 1);
32966        sub = gen_xmlExpNodePtr(n_sub, 2);
32967
32968        ret_val = xmlExpSubsume(ctxt, exp, sub);
32969        desret_int(ret_val);
32970        call_tests++;
32971        des_xmlExpCtxtPtr(n_ctxt, ctxt, 0);
32972        des_xmlExpNodePtr(n_exp, exp, 1);
32973        des_xmlExpNodePtr(n_sub, sub, 2);
32974        xmlResetLastError();
32975        if (mem_base != xmlMemBlocks()) {
32976            printf("Leak of %d blocks found in xmlExpSubsume",
32977	           xmlMemBlocks() - mem_base);
32978	    test_ret++;
32979            printf(" %d", n_ctxt);
32980            printf(" %d", n_exp);
32981            printf(" %d", n_sub);
32982            printf("\n");
32983        }
32984    }
32985    }
32986    }
32987    function_tests++;
32988#endif
32989
32990    return(test_ret);
32991}
32992
32993#ifdef LIBXML_REGEXP_ENABLED
32994
32995#define gen_nb_xmlRegExecCtxtPtr 1
32996static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
32997    return(NULL);
32998}
32999static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33000}
33001#endif
33002
33003
33004static int
33005test_xmlRegExecErrInfo(void) {
33006    int test_ret = 0;
33007
33008#if defined(LIBXML_REGEXP_ENABLED)
33009    int mem_base;
33010    int ret_val;
33011    xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */
33012    int n_exec;
33013    xmlChar ** string; /* return value for the error string */
33014    int n_string;
33015    int * nbval; /* pointer to the number of accepted values IN/OUT */
33016    int n_nbval;
33017    int * nbneg; /* return number of negative transitions */
33018    int n_nbneg;
33019    xmlChar ** values; /* pointer to the array of acceptable values */
33020    int n_values;
33021    int * terminal; /* return value if this was a terminal state */
33022    int n_terminal;
33023
33024    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33025    for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) {
33026    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33027    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33028    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33029    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33030        mem_base = xmlMemBlocks();
33031        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33032        string = gen_const_xmlChar_ptr_ptr(n_string, 1);
33033        nbval = gen_int_ptr(n_nbval, 2);
33034        nbneg = gen_int_ptr(n_nbneg, 3);
33035        values = gen_xmlChar_ptr_ptr(n_values, 4);
33036        terminal = gen_int_ptr(n_terminal, 5);
33037
33038        ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal);
33039        desret_int(ret_val);
33040        call_tests++;
33041        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33042        des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1);
33043        des_int_ptr(n_nbval, nbval, 2);
33044        des_int_ptr(n_nbneg, nbneg, 3);
33045        des_xmlChar_ptr_ptr(n_values, values, 4);
33046        des_int_ptr(n_terminal, terminal, 5);
33047        xmlResetLastError();
33048        if (mem_base != xmlMemBlocks()) {
33049            printf("Leak of %d blocks found in xmlRegExecErrInfo",
33050	           xmlMemBlocks() - mem_base);
33051	    test_ret++;
33052            printf(" %d", n_exec);
33053            printf(" %d", n_string);
33054            printf(" %d", n_nbval);
33055            printf(" %d", n_nbneg);
33056            printf(" %d", n_values);
33057            printf(" %d", n_terminal);
33058            printf("\n");
33059        }
33060    }
33061    }
33062    }
33063    }
33064    }
33065    }
33066    function_tests++;
33067#endif
33068
33069    return(test_ret);
33070}
33071
33072
33073static int
33074test_xmlRegExecNextValues(void) {
33075    int test_ret = 0;
33076
33077#if defined(LIBXML_REGEXP_ENABLED)
33078    int mem_base;
33079    int ret_val;
33080    xmlRegExecCtxtPtr exec; /* a regexp execution context */
33081    int n_exec;
33082    int * nbval; /* pointer to the number of accepted values IN/OUT */
33083    int n_nbval;
33084    int * nbneg; /* return number of negative transitions */
33085    int n_nbneg;
33086    xmlChar ** values; /* pointer to the array of acceptable values */
33087    int n_values;
33088    int * terminal; /* return value if this was a terminal state */
33089    int n_terminal;
33090
33091    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33092    for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) {
33093    for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) {
33094    for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) {
33095    for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) {
33096        mem_base = xmlMemBlocks();
33097        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33098        nbval = gen_int_ptr(n_nbval, 1);
33099        nbneg = gen_int_ptr(n_nbneg, 2);
33100        values = gen_xmlChar_ptr_ptr(n_values, 3);
33101        terminal = gen_int_ptr(n_terminal, 4);
33102
33103        ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal);
33104        desret_int(ret_val);
33105        call_tests++;
33106        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33107        des_int_ptr(n_nbval, nbval, 1);
33108        des_int_ptr(n_nbneg, nbneg, 2);
33109        des_xmlChar_ptr_ptr(n_values, values, 3);
33110        des_int_ptr(n_terminal, terminal, 4);
33111        xmlResetLastError();
33112        if (mem_base != xmlMemBlocks()) {
33113            printf("Leak of %d blocks found in xmlRegExecNextValues",
33114	           xmlMemBlocks() - mem_base);
33115	    test_ret++;
33116            printf(" %d", n_exec);
33117            printf(" %d", n_nbval);
33118            printf(" %d", n_nbneg);
33119            printf(" %d", n_values);
33120            printf(" %d", n_terminal);
33121            printf("\n");
33122        }
33123    }
33124    }
33125    }
33126    }
33127    }
33128    function_tests++;
33129#endif
33130
33131    return(test_ret);
33132}
33133
33134
33135static int
33136test_xmlRegExecPushString(void) {
33137    int test_ret = 0;
33138
33139#if defined(LIBXML_REGEXP_ENABLED)
33140    int mem_base;
33141    int ret_val;
33142    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33143    int n_exec;
33144    xmlChar * value; /* a string token input */
33145    int n_value;
33146    void * data; /* data associated to the token to reuse in callbacks */
33147    int n_data;
33148
33149    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33150    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33151    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33152        mem_base = xmlMemBlocks();
33153        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33154        value = gen_const_xmlChar_ptr(n_value, 1);
33155        data = gen_userdata(n_data, 2);
33156
33157        ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data);
33158        desret_int(ret_val);
33159        call_tests++;
33160        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33161        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33162        des_userdata(n_data, data, 2);
33163        xmlResetLastError();
33164        if (mem_base != xmlMemBlocks()) {
33165            printf("Leak of %d blocks found in xmlRegExecPushString",
33166	           xmlMemBlocks() - mem_base);
33167	    test_ret++;
33168            printf(" %d", n_exec);
33169            printf(" %d", n_value);
33170            printf(" %d", n_data);
33171            printf("\n");
33172        }
33173    }
33174    }
33175    }
33176    function_tests++;
33177#endif
33178
33179    return(test_ret);
33180}
33181
33182
33183static int
33184test_xmlRegExecPushString2(void) {
33185    int test_ret = 0;
33186
33187#if defined(LIBXML_REGEXP_ENABLED)
33188    int mem_base;
33189    int ret_val;
33190    xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */
33191    int n_exec;
33192    xmlChar * value; /* the first string token input */
33193    int n_value;
33194    xmlChar * value2; /* the second string token input */
33195    int n_value2;
33196    void * data; /* data associated to the token to reuse in callbacks */
33197    int n_data;
33198
33199    for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) {
33200    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
33201    for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) {
33202    for (n_data = 0;n_data < gen_nb_userdata;n_data++) {
33203        mem_base = xmlMemBlocks();
33204        exec = gen_xmlRegExecCtxtPtr(n_exec, 0);
33205        value = gen_const_xmlChar_ptr(n_value, 1);
33206        value2 = gen_const_xmlChar_ptr(n_value2, 2);
33207        data = gen_userdata(n_data, 3);
33208
33209        ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data);
33210        desret_int(ret_val);
33211        call_tests++;
33212        des_xmlRegExecCtxtPtr(n_exec, exec, 0);
33213        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
33214        des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2);
33215        des_userdata(n_data, data, 3);
33216        xmlResetLastError();
33217        if (mem_base != xmlMemBlocks()) {
33218            printf("Leak of %d blocks found in xmlRegExecPushString2",
33219	           xmlMemBlocks() - mem_base);
33220	    test_ret++;
33221            printf(" %d", n_exec);
33222            printf(" %d", n_value);
33223            printf(" %d", n_value2);
33224            printf(" %d", n_data);
33225            printf("\n");
33226        }
33227    }
33228    }
33229    }
33230    }
33231    function_tests++;
33232#endif
33233
33234    return(test_ret);
33235}
33236
33237#ifdef LIBXML_REGEXP_ENABLED
33238
33239#define gen_nb_xmlRegexpPtr 1
33240static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33241    return(NULL);
33242}
33243static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33244}
33245#endif
33246
33247
33248static int
33249test_xmlRegNewExecCtxt(void) {
33250    int test_ret = 0;
33251
33252
33253    /* missing type support */
33254    return(test_ret);
33255}
33256
33257
33258static int
33259test_xmlRegexpCompile(void) {
33260    int test_ret = 0;
33261
33262
33263    /* missing type support */
33264    return(test_ret);
33265}
33266
33267
33268static int
33269test_xmlRegexpExec(void) {
33270    int test_ret = 0;
33271
33272#if defined(LIBXML_REGEXP_ENABLED)
33273    int mem_base;
33274    int ret_val;
33275    xmlRegexpPtr comp; /* the compiled regular expression */
33276    int n_comp;
33277    xmlChar * content; /* the value to check against the regular expression */
33278    int n_content;
33279
33280    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33281    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
33282        mem_base = xmlMemBlocks();
33283        comp = gen_xmlRegexpPtr(n_comp, 0);
33284        content = gen_const_xmlChar_ptr(n_content, 1);
33285
33286        ret_val = xmlRegexpExec(comp, (const xmlChar *)content);
33287        desret_int(ret_val);
33288        call_tests++;
33289        des_xmlRegexpPtr(n_comp, comp, 0);
33290        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
33291        xmlResetLastError();
33292        if (mem_base != xmlMemBlocks()) {
33293            printf("Leak of %d blocks found in xmlRegexpExec",
33294	           xmlMemBlocks() - mem_base);
33295	    test_ret++;
33296            printf(" %d", n_comp);
33297            printf(" %d", n_content);
33298            printf("\n");
33299        }
33300    }
33301    }
33302    function_tests++;
33303#endif
33304
33305    return(test_ret);
33306}
33307
33308
33309static int
33310test_xmlRegexpIsDeterminist(void) {
33311    int test_ret = 0;
33312
33313#if defined(LIBXML_REGEXP_ENABLED)
33314    int mem_base;
33315    int ret_val;
33316    xmlRegexpPtr comp; /* the compiled regular expression */
33317    int n_comp;
33318
33319    for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) {
33320        mem_base = xmlMemBlocks();
33321        comp = gen_xmlRegexpPtr(n_comp, 0);
33322
33323        ret_val = xmlRegexpIsDeterminist(comp);
33324        desret_int(ret_val);
33325        call_tests++;
33326        des_xmlRegexpPtr(n_comp, comp, 0);
33327        xmlResetLastError();
33328        if (mem_base != xmlMemBlocks()) {
33329            printf("Leak of %d blocks found in xmlRegexpIsDeterminist",
33330	           xmlMemBlocks() - mem_base);
33331	    test_ret++;
33332            printf(" %d", n_comp);
33333            printf("\n");
33334        }
33335    }
33336    function_tests++;
33337#endif
33338
33339    return(test_ret);
33340}
33341
33342
33343static int
33344test_xmlRegexpPrint(void) {
33345    int test_ret = 0;
33346
33347#if defined(LIBXML_REGEXP_ENABLED)
33348    int mem_base;
33349    FILE * output; /* the file for the output debug */
33350    int n_output;
33351    xmlRegexpPtr regexp; /* the compiled regexp */
33352    int n_regexp;
33353
33354    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33355    for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) {
33356        mem_base = xmlMemBlocks();
33357        output = gen_FILE_ptr(n_output, 0);
33358        regexp = gen_xmlRegexpPtr(n_regexp, 1);
33359
33360        xmlRegexpPrint(output, regexp);
33361        call_tests++;
33362        des_FILE_ptr(n_output, output, 0);
33363        des_xmlRegexpPtr(n_regexp, regexp, 1);
33364        xmlResetLastError();
33365        if (mem_base != xmlMemBlocks()) {
33366            printf("Leak of %d blocks found in xmlRegexpPrint",
33367	           xmlMemBlocks() - mem_base);
33368	    test_ret++;
33369            printf(" %d", n_output);
33370            printf(" %d", n_regexp);
33371            printf("\n");
33372        }
33373    }
33374    }
33375    function_tests++;
33376#endif
33377
33378    return(test_ret);
33379}
33380
33381static int
33382test_xmlregexp(void) {
33383    int test_ret = 0;
33384
33385    if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n");
33386    test_ret += test_xmlExpCtxtNbCons();
33387    test_ret += test_xmlExpCtxtNbNodes();
33388    test_ret += test_xmlExpDump();
33389    test_ret += test_xmlExpExpDerive();
33390    test_ret += test_xmlExpGetLanguage();
33391    test_ret += test_xmlExpGetStart();
33392    test_ret += test_xmlExpIsNillable();
33393    test_ret += test_xmlExpMaxToken();
33394    test_ret += test_xmlExpNewAtom();
33395    test_ret += test_xmlExpNewCtxt();
33396    test_ret += test_xmlExpNewOr();
33397    test_ret += test_xmlExpNewRange();
33398    test_ret += test_xmlExpNewSeq();
33399    test_ret += test_xmlExpParse();
33400    test_ret += test_xmlExpRef();
33401    test_ret += test_xmlExpStringDerive();
33402    test_ret += test_xmlExpSubsume();
33403    test_ret += test_xmlRegExecErrInfo();
33404    test_ret += test_xmlRegExecNextValues();
33405    test_ret += test_xmlRegExecPushString();
33406    test_ret += test_xmlRegExecPushString2();
33407    test_ret += test_xmlRegNewExecCtxt();
33408    test_ret += test_xmlRegexpCompile();
33409    test_ret += test_xmlRegexpExec();
33410    test_ret += test_xmlRegexpIsDeterminist();
33411    test_ret += test_xmlRegexpPrint();
33412
33413    if (test_ret != 0)
33414	printf("Module xmlregexp: %d errors\n", test_ret);
33415    return(test_ret);
33416}
33417#ifdef LIBXML_OUTPUT_ENABLED
33418
33419#define gen_nb_xmlSaveCtxtPtr 1
33420static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33421    return(NULL);
33422}
33423static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33424}
33425#endif
33426
33427
33428static int
33429test_xmlSaveClose(void) {
33430    int test_ret = 0;
33431
33432#if defined(LIBXML_OUTPUT_ENABLED)
33433    int mem_base;
33434    int ret_val;
33435    xmlSaveCtxtPtr ctxt; /* a document saving context */
33436    int n_ctxt;
33437
33438    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33439        mem_base = xmlMemBlocks();
33440        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33441
33442        ret_val = xmlSaveClose(ctxt);
33443        desret_int(ret_val);
33444        call_tests++;
33445        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33446        xmlResetLastError();
33447        if (mem_base != xmlMemBlocks()) {
33448            printf("Leak of %d blocks found in xmlSaveClose",
33449	           xmlMemBlocks() - mem_base);
33450	    test_ret++;
33451            printf(" %d", n_ctxt);
33452            printf("\n");
33453        }
33454    }
33455    function_tests++;
33456#endif
33457
33458    return(test_ret);
33459}
33460
33461
33462static int
33463test_xmlSaveDoc(void) {
33464    int test_ret = 0;
33465
33466#if defined(LIBXML_OUTPUT_ENABLED)
33467    int mem_base;
33468    long ret_val;
33469    xmlSaveCtxtPtr ctxt; /* a document saving context */
33470    int n_ctxt;
33471    xmlDocPtr doc; /* a document */
33472    int n_doc;
33473
33474    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33475    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33476        mem_base = xmlMemBlocks();
33477        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33478        doc = gen_xmlDocPtr(n_doc, 1);
33479
33480        ret_val = xmlSaveDoc(ctxt, doc);
33481        desret_long(ret_val);
33482        call_tests++;
33483        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33484        des_xmlDocPtr(n_doc, doc, 1);
33485        xmlResetLastError();
33486        if (mem_base != xmlMemBlocks()) {
33487            printf("Leak of %d blocks found in xmlSaveDoc",
33488	           xmlMemBlocks() - mem_base);
33489	    test_ret++;
33490            printf(" %d", n_ctxt);
33491            printf(" %d", n_doc);
33492            printf("\n");
33493        }
33494    }
33495    }
33496    function_tests++;
33497#endif
33498
33499    return(test_ret);
33500}
33501
33502
33503static int
33504test_xmlSaveFlush(void) {
33505    int test_ret = 0;
33506
33507#if defined(LIBXML_OUTPUT_ENABLED)
33508    int mem_base;
33509    int ret_val;
33510    xmlSaveCtxtPtr ctxt; /* a document saving context */
33511    int n_ctxt;
33512
33513    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33514        mem_base = xmlMemBlocks();
33515        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33516
33517        ret_val = xmlSaveFlush(ctxt);
33518        desret_int(ret_val);
33519        call_tests++;
33520        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33521        xmlResetLastError();
33522        if (mem_base != xmlMemBlocks()) {
33523            printf("Leak of %d blocks found in xmlSaveFlush",
33524	           xmlMemBlocks() - mem_base);
33525	    test_ret++;
33526            printf(" %d", n_ctxt);
33527            printf("\n");
33528        }
33529    }
33530    function_tests++;
33531#endif
33532
33533    return(test_ret);
33534}
33535
33536
33537static int
33538test_xmlSaveSetAttrEscape(void) {
33539    int test_ret = 0;
33540
33541
33542    /* missing type support */
33543    return(test_ret);
33544}
33545
33546
33547static int
33548test_xmlSaveSetEscape(void) {
33549    int test_ret = 0;
33550
33551
33552    /* missing type support */
33553    return(test_ret);
33554}
33555
33556
33557static int
33558test_xmlSaveToBuffer(void) {
33559    int test_ret = 0;
33560
33561
33562    /* missing type support */
33563    return(test_ret);
33564}
33565
33566
33567static int
33568test_xmlSaveToFd(void) {
33569    int test_ret = 0;
33570
33571
33572    /* missing type support */
33573    return(test_ret);
33574}
33575
33576
33577static int
33578test_xmlSaveToFilename(void) {
33579    int test_ret = 0;
33580
33581
33582    /* missing type support */
33583    return(test_ret);
33584}
33585
33586
33587static int
33588test_xmlSaveTree(void) {
33589    int test_ret = 0;
33590
33591#if defined(LIBXML_OUTPUT_ENABLED)
33592    int mem_base;
33593    long ret_val;
33594    xmlSaveCtxtPtr ctxt; /* a document saving context */
33595    int n_ctxt;
33596    xmlNodePtr node; /* the top node of the subtree to save */
33597    int n_node;
33598
33599    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
33600    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
33601        mem_base = xmlMemBlocks();
33602        ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
33603        node = gen_xmlNodePtr(n_node, 1);
33604
33605        ret_val = xmlSaveTree(ctxt, node);
33606        desret_long(ret_val);
33607        call_tests++;
33608        des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
33609        des_xmlNodePtr(n_node, node, 1);
33610        xmlResetLastError();
33611        if (mem_base != xmlMemBlocks()) {
33612            printf("Leak of %d blocks found in xmlSaveTree",
33613	           xmlMemBlocks() - mem_base);
33614	    test_ret++;
33615            printf(" %d", n_ctxt);
33616            printf(" %d", n_node);
33617            printf("\n");
33618        }
33619    }
33620    }
33621    function_tests++;
33622#endif
33623
33624    return(test_ret);
33625}
33626
33627static int
33628test_xmlsave(void) {
33629    int test_ret = 0;
33630
33631    if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n");
33632    test_ret += test_xmlSaveClose();
33633    test_ret += test_xmlSaveDoc();
33634    test_ret += test_xmlSaveFlush();
33635    test_ret += test_xmlSaveSetAttrEscape();
33636    test_ret += test_xmlSaveSetEscape();
33637    test_ret += test_xmlSaveToBuffer();
33638    test_ret += test_xmlSaveToFd();
33639    test_ret += test_xmlSaveToFilename();
33640    test_ret += test_xmlSaveTree();
33641
33642    if (test_ret != 0)
33643	printf("Module xmlsave: %d errors\n", test_ret);
33644    return(test_ret);
33645}
33646
33647static int
33648test_xmlSchemaDump(void) {
33649    int test_ret = 0;
33650
33651#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
33652    int mem_base;
33653    FILE * output; /* the file output */
33654    int n_output;
33655    xmlSchemaPtr schema; /* a schema structure */
33656    int n_schema;
33657
33658    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
33659    for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) {
33660        mem_base = xmlMemBlocks();
33661        output = gen_FILE_ptr(n_output, 0);
33662        schema = gen_xmlSchemaPtr(n_schema, 1);
33663
33664        xmlSchemaDump(output, schema);
33665        call_tests++;
33666        des_FILE_ptr(n_output, output, 0);
33667        des_xmlSchemaPtr(n_schema, schema, 1);
33668        xmlResetLastError();
33669        if (mem_base != xmlMemBlocks()) {
33670            printf("Leak of %d blocks found in xmlSchemaDump",
33671	           xmlMemBlocks() - mem_base);
33672	    test_ret++;
33673            printf(" %d", n_output);
33674            printf(" %d", n_schema);
33675            printf("\n");
33676        }
33677    }
33678    }
33679    function_tests++;
33680#endif
33681
33682    return(test_ret);
33683}
33684
33685#ifdef LIBXML_SCHEMAS_ENABLED
33686
33687#define gen_nb_xmlSchemaParserCtxtPtr 1
33688static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33689    return(NULL);
33690}
33691static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33692}
33693#endif
33694
33695#ifdef LIBXML_SCHEMAS_ENABLED
33696
33697#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1
33698static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33699    return(NULL);
33700}
33701static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33702}
33703#endif
33704
33705#ifdef LIBXML_SCHEMAS_ENABLED
33706
33707#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1
33708static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33709    return(NULL);
33710}
33711static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33712}
33713#endif
33714
33715
33716static int
33717test_xmlSchemaGetParserErrors(void) {
33718    int test_ret = 0;
33719
33720#if defined(LIBXML_SCHEMAS_ENABLED)
33721    int mem_base;
33722    int ret_val;
33723    xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */
33724    int n_ctxt;
33725    xmlSchemaValidityErrorFunc * err; /* the error callback result */
33726    int n_err;
33727    xmlSchemaValidityWarningFunc * warn; /* the warning callback result */
33728    int n_warn;
33729    void ** ctx; /* contextual data for the callbacks result */
33730    int n_ctx;
33731
33732    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) {
33733    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33734    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33735    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33736        mem_base = xmlMemBlocks();
33737        ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0);
33738        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33739        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33740        ctx = gen_void_ptr_ptr(n_ctx, 3);
33741
33742        ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx);
33743        desret_int(ret_val);
33744        call_tests++;
33745        des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0);
33746        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33747        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33748        des_void_ptr_ptr(n_ctx, ctx, 3);
33749        xmlResetLastError();
33750        if (mem_base != xmlMemBlocks()) {
33751            printf("Leak of %d blocks found in xmlSchemaGetParserErrors",
33752	           xmlMemBlocks() - mem_base);
33753	    test_ret++;
33754            printf(" %d", n_ctxt);
33755            printf(" %d", n_err);
33756            printf(" %d", n_warn);
33757            printf(" %d", n_ctx);
33758            printf("\n");
33759        }
33760    }
33761    }
33762    }
33763    }
33764    function_tests++;
33765#endif
33766
33767    return(test_ret);
33768}
33769
33770
33771static int
33772test_xmlSchemaGetValidErrors(void) {
33773    int test_ret = 0;
33774
33775#if defined(LIBXML_SCHEMAS_ENABLED)
33776    int mem_base;
33777    int ret_val;
33778    xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
33779    int n_ctxt;
33780    xmlSchemaValidityErrorFunc * err; /* the error function result */
33781    int n_err;
33782    xmlSchemaValidityWarningFunc * warn; /* the warning function result */
33783    int n_warn;
33784    void ** ctx; /* the functions context result */
33785    int n_ctx;
33786
33787    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33788    for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) {
33789    for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) {
33790    for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) {
33791        mem_base = xmlMemBlocks();
33792        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33793        err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1);
33794        warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2);
33795        ctx = gen_void_ptr_ptr(n_ctx, 3);
33796
33797        ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx);
33798        desret_int(ret_val);
33799        call_tests++;
33800        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33801        des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1);
33802        des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2);
33803        des_void_ptr_ptr(n_ctx, ctx, 3);
33804        xmlResetLastError();
33805        if (mem_base != xmlMemBlocks()) {
33806            printf("Leak of %d blocks found in xmlSchemaGetValidErrors",
33807	           xmlMemBlocks() - mem_base);
33808	    test_ret++;
33809            printf(" %d", n_ctxt);
33810            printf(" %d", n_err);
33811            printf(" %d", n_warn);
33812            printf(" %d", n_ctx);
33813            printf("\n");
33814        }
33815    }
33816    }
33817    }
33818    }
33819    function_tests++;
33820#endif
33821
33822    return(test_ret);
33823}
33824
33825
33826static int
33827test_xmlSchemaIsValid(void) {
33828    int test_ret = 0;
33829
33830#if defined(LIBXML_SCHEMAS_ENABLED)
33831    int mem_base;
33832    int ret_val;
33833    xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
33834    int n_ctxt;
33835
33836    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
33837        mem_base = xmlMemBlocks();
33838        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
33839
33840        ret_val = xmlSchemaIsValid(ctxt);
33841        desret_int(ret_val);
33842        call_tests++;
33843        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
33844        xmlResetLastError();
33845        if (mem_base != xmlMemBlocks()) {
33846            printf("Leak of %d blocks found in xmlSchemaIsValid",
33847	           xmlMemBlocks() - mem_base);
33848	    test_ret++;
33849            printf(" %d", n_ctxt);
33850            printf("\n");
33851        }
33852    }
33853    function_tests++;
33854#endif
33855
33856    return(test_ret);
33857}
33858
33859
33860static int
33861test_xmlSchemaNewDocParserCtxt(void) {
33862    int test_ret = 0;
33863
33864#if defined(LIBXML_SCHEMAS_ENABLED)
33865    int mem_base;
33866    xmlSchemaParserCtxtPtr ret_val;
33867    xmlDocPtr doc; /* a preparsed document tree */
33868    int n_doc;
33869
33870    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
33871        mem_base = xmlMemBlocks();
33872        doc = gen_xmlDocPtr(n_doc, 0);
33873
33874        ret_val = xmlSchemaNewDocParserCtxt(doc);
33875        desret_xmlSchemaParserCtxtPtr(ret_val);
33876        call_tests++;
33877        des_xmlDocPtr(n_doc, doc, 0);
33878        xmlResetLastError();
33879        if (mem_base != xmlMemBlocks()) {
33880            printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt",
33881	           xmlMemBlocks() - mem_base);
33882	    test_ret++;
33883            printf(" %d", n_doc);
33884            printf("\n");
33885        }
33886    }
33887    function_tests++;
33888#endif
33889
33890    return(test_ret);
33891}
33892
33893
33894static int
33895test_xmlSchemaNewMemParserCtxt(void) {
33896    int test_ret = 0;
33897
33898#if defined(LIBXML_SCHEMAS_ENABLED)
33899    int mem_base;
33900    xmlSchemaParserCtxtPtr ret_val;
33901    char * buffer; /* a pointer to a char array containing the schemas */
33902    int n_buffer;
33903    int size; /* the size of the array */
33904    int n_size;
33905
33906    for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) {
33907    for (n_size = 0;n_size < gen_nb_int;n_size++) {
33908        mem_base = xmlMemBlocks();
33909        buffer = gen_const_char_ptr(n_buffer, 0);
33910        size = gen_int(n_size, 1);
33911
33912        ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size);
33913        desret_xmlSchemaParserCtxtPtr(ret_val);
33914        call_tests++;
33915        des_const_char_ptr(n_buffer, (const char *)buffer, 0);
33916        des_int(n_size, size, 1);
33917        xmlResetLastError();
33918        if (mem_base != xmlMemBlocks()) {
33919            printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt",
33920	           xmlMemBlocks() - mem_base);
33921	    test_ret++;
33922            printf(" %d", n_buffer);
33923            printf(" %d", n_size);
33924            printf("\n");
33925        }
33926    }
33927    }
33928    function_tests++;
33929#endif
33930
33931    return(test_ret);
33932}
33933
33934
33935static int
33936test_xmlSchemaNewParserCtxt(void) {
33937    int test_ret = 0;
33938
33939#if defined(LIBXML_SCHEMAS_ENABLED)
33940    int mem_base;
33941    xmlSchemaParserCtxtPtr ret_val;
33942    char * URL; /* the location of the schema */
33943    int n_URL;
33944
33945    for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) {
33946        mem_base = xmlMemBlocks();
33947        URL = gen_const_char_ptr(n_URL, 0);
33948
33949        ret_val = xmlSchemaNewParserCtxt((const char *)URL);
33950        desret_xmlSchemaParserCtxtPtr(ret_val);
33951        call_tests++;
33952        des_const_char_ptr(n_URL, (const char *)URL, 0);
33953        xmlResetLastError();
33954        if (mem_base != xmlMemBlocks()) {
33955            printf("Leak of %d blocks found in xmlSchemaNewParserCtxt",
33956	           xmlMemBlocks() - mem_base);
33957	    test_ret++;
33958            printf(" %d", n_URL);
33959            printf("\n");
33960        }
33961    }
33962    function_tests++;
33963#endif
33964
33965    return(test_ret);
33966}
33967
33968
33969static int
33970test_xmlSchemaNewValidCtxt(void) {
33971    int test_ret = 0;
33972
33973
33974    /* missing type support */
33975    return(test_ret);
33976}
33977
33978
33979static int
33980test_xmlSchemaParse(void) {
33981    int test_ret = 0;
33982
33983
33984    /* missing type support */
33985    return(test_ret);
33986}
33987
33988#ifdef LIBXML_SCHEMAS_ENABLED
33989
33990#define gen_nb_xmlSAXHandlerPtr_ptr 1
33991static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33992    return(NULL);
33993}
33994static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
33995}
33996#endif
33997
33998
33999static int
34000test_xmlSchemaSAXPlug(void) {
34001    int test_ret = 0;
34002
34003
34004    /* missing type support */
34005    return(test_ret);
34006}
34007
34008#ifdef LIBXML_SCHEMAS_ENABLED
34009
34010#define gen_nb_xmlSchemaSAXPlugPtr 1
34011static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34012    return(NULL);
34013}
34014static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34015}
34016#endif
34017
34018
34019static int
34020test_xmlSchemaSAXUnplug(void) {
34021    int test_ret = 0;
34022
34023#if defined(LIBXML_SCHEMAS_ENABLED)
34024    int mem_base;
34025    int ret_val;
34026    xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
34027    int n_plug;
34028
34029    for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
34030        mem_base = xmlMemBlocks();
34031        plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0);
34032
34033        ret_val = xmlSchemaSAXUnplug(plug);
34034        desret_int(ret_val);
34035        call_tests++;
34036        des_xmlSchemaSAXPlugPtr(n_plug, plug, 0);
34037        xmlResetLastError();
34038        if (mem_base != xmlMemBlocks()) {
34039            printf("Leak of %d blocks found in xmlSchemaSAXUnplug",
34040	           xmlMemBlocks() - mem_base);
34041	    test_ret++;
34042            printf(" %d", n_plug);
34043            printf("\n");
34044        }
34045    }
34046    function_tests++;
34047#endif
34048
34049    return(test_ret);
34050}
34051
34052
34053static int
34054test_xmlSchemaSetParserErrors(void) {
34055    int test_ret = 0;
34056
34057
34058    /* missing type support */
34059    return(test_ret);
34060}
34061
34062
34063static int
34064test_xmlSchemaSetParserStructuredErrors(void) {
34065    int test_ret = 0;
34066
34067
34068    /* missing type support */
34069    return(test_ret);
34070}
34071
34072
34073static int
34074test_xmlSchemaSetValidErrors(void) {
34075    int test_ret = 0;
34076
34077
34078    /* missing type support */
34079    return(test_ret);
34080}
34081
34082
34083static int
34084test_xmlSchemaSetValidOptions(void) {
34085    int test_ret = 0;
34086
34087#if defined(LIBXML_SCHEMAS_ENABLED)
34088    int mem_base;
34089    int ret_val;
34090    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34091    int n_ctxt;
34092    int options; /* a combination of xmlSchemaValidOption */
34093    int n_options;
34094
34095    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34096    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34097        mem_base = xmlMemBlocks();
34098        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34099        options = gen_int(n_options, 1);
34100
34101        ret_val = xmlSchemaSetValidOptions(ctxt, options);
34102        desret_int(ret_val);
34103        call_tests++;
34104        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34105        des_int(n_options, options, 1);
34106        xmlResetLastError();
34107        if (mem_base != xmlMemBlocks()) {
34108            printf("Leak of %d blocks found in xmlSchemaSetValidOptions",
34109	           xmlMemBlocks() - mem_base);
34110	    test_ret++;
34111            printf(" %d", n_ctxt);
34112            printf(" %d", n_options);
34113            printf("\n");
34114        }
34115    }
34116    }
34117    function_tests++;
34118#endif
34119
34120    return(test_ret);
34121}
34122
34123
34124static int
34125test_xmlSchemaSetValidStructuredErrors(void) {
34126    int test_ret = 0;
34127
34128
34129    /* missing type support */
34130    return(test_ret);
34131}
34132
34133
34134static int
34135test_xmlSchemaValidCtxtGetOptions(void) {
34136    int test_ret = 0;
34137
34138#if defined(LIBXML_SCHEMAS_ENABLED)
34139    int mem_base;
34140    int ret_val;
34141    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34142    int n_ctxt;
34143
34144    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34145        mem_base = xmlMemBlocks();
34146        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34147
34148        ret_val = xmlSchemaValidCtxtGetOptions(ctxt);
34149        desret_int(ret_val);
34150        call_tests++;
34151        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34152        xmlResetLastError();
34153        if (mem_base != xmlMemBlocks()) {
34154            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions",
34155	           xmlMemBlocks() - mem_base);
34156	    test_ret++;
34157            printf(" %d", n_ctxt);
34158            printf("\n");
34159        }
34160    }
34161    function_tests++;
34162#endif
34163
34164    return(test_ret);
34165}
34166
34167
34168static int
34169test_xmlSchemaValidCtxtGetParserCtxt(void) {
34170    int test_ret = 0;
34171
34172#if defined(LIBXML_SCHEMAS_ENABLED)
34173    int mem_base;
34174    xmlParserCtxtPtr ret_val;
34175    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34176    int n_ctxt;
34177
34178    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34179        mem_base = xmlMemBlocks();
34180        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34181
34182        ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
34183        desret_xmlParserCtxtPtr(ret_val);
34184        call_tests++;
34185        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34186        xmlResetLastError();
34187        if (mem_base != xmlMemBlocks()) {
34188            printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
34189	           xmlMemBlocks() - mem_base);
34190	    test_ret++;
34191            printf(" %d", n_ctxt);
34192            printf("\n");
34193        }
34194    }
34195    function_tests++;
34196#endif
34197
34198    return(test_ret);
34199}
34200
34201
34202static int
34203test_xmlSchemaValidateDoc(void) {
34204    int test_ret = 0;
34205
34206#if defined(LIBXML_SCHEMAS_ENABLED)
34207    int mem_base;
34208    int ret_val;
34209    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34210    int n_ctxt;
34211    xmlDocPtr doc; /* a parsed document tree */
34212    int n_doc;
34213
34214    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34215    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
34216        mem_base = xmlMemBlocks();
34217        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34218        doc = gen_xmlDocPtr(n_doc, 1);
34219
34220        ret_val = xmlSchemaValidateDoc(ctxt, doc);
34221        desret_int(ret_val);
34222        call_tests++;
34223        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34224        des_xmlDocPtr(n_doc, doc, 1);
34225        xmlResetLastError();
34226        if (mem_base != xmlMemBlocks()) {
34227            printf("Leak of %d blocks found in xmlSchemaValidateDoc",
34228	           xmlMemBlocks() - mem_base);
34229	    test_ret++;
34230            printf(" %d", n_ctxt);
34231            printf(" %d", n_doc);
34232            printf("\n");
34233        }
34234    }
34235    }
34236    function_tests++;
34237#endif
34238
34239    return(test_ret);
34240}
34241
34242
34243static int
34244test_xmlSchemaValidateFile(void) {
34245    int test_ret = 0;
34246
34247#if defined(LIBXML_SCHEMAS_ENABLED)
34248    int mem_base;
34249    int ret_val;
34250    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34251    int n_ctxt;
34252    const char * filename; /* the URI of the instance */
34253    int n_filename;
34254    int options; /* a future set of options, currently unused */
34255    int n_options;
34256
34257    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34258    for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
34259    for (n_options = 0;n_options < gen_nb_int;n_options++) {
34260        mem_base = xmlMemBlocks();
34261        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34262        filename = gen_filepath(n_filename, 1);
34263        options = gen_int(n_options, 2);
34264
34265        ret_val = xmlSchemaValidateFile(ctxt, filename, options);
34266        desret_int(ret_val);
34267        call_tests++;
34268        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34269        des_filepath(n_filename, filename, 1);
34270        des_int(n_options, options, 2);
34271        xmlResetLastError();
34272        if (mem_base != xmlMemBlocks()) {
34273            printf("Leak of %d blocks found in xmlSchemaValidateFile",
34274	           xmlMemBlocks() - mem_base);
34275	    test_ret++;
34276            printf(" %d", n_ctxt);
34277            printf(" %d", n_filename);
34278            printf(" %d", n_options);
34279            printf("\n");
34280        }
34281    }
34282    }
34283    }
34284    function_tests++;
34285#endif
34286
34287    return(test_ret);
34288}
34289
34290
34291static int
34292test_xmlSchemaValidateOneElement(void) {
34293    int test_ret = 0;
34294
34295#if defined(LIBXML_SCHEMAS_ENABLED)
34296    int mem_base;
34297    int ret_val;
34298    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34299    int n_ctxt;
34300    xmlNodePtr elem; /* an element node */
34301    int n_elem;
34302
34303    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34304    for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
34305        mem_base = xmlMemBlocks();
34306        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34307        elem = gen_xmlNodePtr(n_elem, 1);
34308
34309        ret_val = xmlSchemaValidateOneElement(ctxt, elem);
34310        desret_int(ret_val);
34311        call_tests++;
34312        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34313        des_xmlNodePtr(n_elem, elem, 1);
34314        xmlResetLastError();
34315        if (mem_base != xmlMemBlocks()) {
34316            printf("Leak of %d blocks found in xmlSchemaValidateOneElement",
34317	           xmlMemBlocks() - mem_base);
34318	    test_ret++;
34319            printf(" %d", n_ctxt);
34320            printf(" %d", n_elem);
34321            printf("\n");
34322        }
34323    }
34324    }
34325    function_tests++;
34326#endif
34327
34328    return(test_ret);
34329}
34330
34331
34332static int
34333test_xmlSchemaValidateStream(void) {
34334    int test_ret = 0;
34335
34336#if defined(LIBXML_SCHEMAS_ENABLED)
34337    int mem_base;
34338    int ret_val;
34339    xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
34340    int n_ctxt;
34341    xmlParserInputBufferPtr input; /* the input to use for reading the data */
34342    int n_input;
34343    xmlCharEncoding enc; /* an optional encoding information */
34344    int n_enc;
34345    xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
34346    int n_sax;
34347    void * user_data; /* the context to provide to the SAX handler. */
34348    int n_user_data;
34349
34350    for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
34351    for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
34352    for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
34353    for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
34354    for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) {
34355        mem_base = xmlMemBlocks();
34356        ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
34357        input = gen_xmlParserInputBufferPtr(n_input, 1);
34358        enc = gen_xmlCharEncoding(n_enc, 2);
34359        sax = gen_xmlSAXHandlerPtr(n_sax, 3);
34360        user_data = gen_userdata(n_user_data, 4);
34361
34362        ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data);
34363        desret_int(ret_val);
34364        call_tests++;
34365        des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
34366        des_xmlParserInputBufferPtr(n_input, input, 1);
34367        des_xmlCharEncoding(n_enc, enc, 2);
34368        des_xmlSAXHandlerPtr(n_sax, sax, 3);
34369        des_userdata(n_user_data, user_data, 4);
34370        xmlResetLastError();
34371        if (mem_base != xmlMemBlocks()) {
34372            printf("Leak of %d blocks found in xmlSchemaValidateStream",
34373	           xmlMemBlocks() - mem_base);
34374	    test_ret++;
34375            printf(" %d", n_ctxt);
34376            printf(" %d", n_input);
34377            printf(" %d", n_enc);
34378            printf(" %d", n_sax);
34379            printf(" %d", n_user_data);
34380            printf("\n");
34381        }
34382    }
34383    }
34384    }
34385    }
34386    }
34387    function_tests++;
34388#endif
34389
34390    return(test_ret);
34391}
34392
34393static int
34394test_xmlschemas(void) {
34395    int test_ret = 0;
34396
34397    if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
34398    test_ret += test_xmlSchemaDump();
34399    test_ret += test_xmlSchemaGetParserErrors();
34400    test_ret += test_xmlSchemaGetValidErrors();
34401    test_ret += test_xmlSchemaIsValid();
34402    test_ret += test_xmlSchemaNewDocParserCtxt();
34403    test_ret += test_xmlSchemaNewMemParserCtxt();
34404    test_ret += test_xmlSchemaNewParserCtxt();
34405    test_ret += test_xmlSchemaNewValidCtxt();
34406    test_ret += test_xmlSchemaParse();
34407    test_ret += test_xmlSchemaSAXPlug();
34408    test_ret += test_xmlSchemaSAXUnplug();
34409    test_ret += test_xmlSchemaSetParserErrors();
34410    test_ret += test_xmlSchemaSetParserStructuredErrors();
34411    test_ret += test_xmlSchemaSetValidErrors();
34412    test_ret += test_xmlSchemaSetValidOptions();
34413    test_ret += test_xmlSchemaSetValidStructuredErrors();
34414    test_ret += test_xmlSchemaValidCtxtGetOptions();
34415    test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
34416    test_ret += test_xmlSchemaValidateDoc();
34417    test_ret += test_xmlSchemaValidateFile();
34418    test_ret += test_xmlSchemaValidateOneElement();
34419    test_ret += test_xmlSchemaValidateStream();
34420
34421    if (test_ret != 0)
34422	printf("Module xmlschemas: %d errors\n", test_ret);
34423    return(test_ret);
34424}
34425#ifdef LIBXML_SCHEMAS_ENABLED
34426
34427#define gen_nb_xmlSchemaFacetPtr 1
34428static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34429    return(NULL);
34430}
34431static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34432}
34433#endif
34434
34435#ifdef LIBXML_SCHEMAS_ENABLED
34436
34437#define gen_nb_xmlSchemaTypePtr 1
34438static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34439    return(NULL);
34440}
34441static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34442}
34443#endif
34444
34445
34446static int
34447test_xmlSchemaCheckFacet(void) {
34448    int test_ret = 0;
34449
34450#if defined(LIBXML_SCHEMAS_ENABLED)
34451    int mem_base;
34452    int ret_val;
34453    xmlSchemaFacetPtr facet; /* the facet */
34454    int n_facet;
34455    xmlSchemaTypePtr typeDecl; /* the schema type definition */
34456    int n_typeDecl;
34457    xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */
34458    int n_pctxt;
34459    xmlChar * name; /* the optional name of the type */
34460    int n_name;
34461
34462    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34463    for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) {
34464    for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) {
34465    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34466        mem_base = xmlMemBlocks();
34467        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34468        typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1);
34469        pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2);
34470        name = gen_const_xmlChar_ptr(n_name, 3);
34471
34472        ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name);
34473        desret_int(ret_val);
34474        call_tests++;
34475        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34476        des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1);
34477        des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2);
34478        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3);
34479        xmlResetLastError();
34480        if (mem_base != xmlMemBlocks()) {
34481            printf("Leak of %d blocks found in xmlSchemaCheckFacet",
34482	           xmlMemBlocks() - mem_base);
34483	    test_ret++;
34484            printf(" %d", n_facet);
34485            printf(" %d", n_typeDecl);
34486            printf(" %d", n_pctxt);
34487            printf(" %d", n_name);
34488            printf("\n");
34489        }
34490    }
34491    }
34492    }
34493    }
34494    function_tests++;
34495#endif
34496
34497    return(test_ret);
34498}
34499
34500
34501static int
34502test_xmlSchemaCleanupTypes(void) {
34503    int test_ret = 0;
34504
34505#if defined(LIBXML_SCHEMAS_ENABLED)
34506
34507
34508        xmlSchemaCleanupTypes();
34509        call_tests++;
34510        xmlResetLastError();
34511    function_tests++;
34512#endif
34513
34514    return(test_ret);
34515}
34516
34517
34518static int
34519test_xmlSchemaCollapseString(void) {
34520    int test_ret = 0;
34521
34522#if defined(LIBXML_SCHEMAS_ENABLED)
34523    int mem_base;
34524    xmlChar * ret_val;
34525    xmlChar * value; /* a value */
34526    int n_value;
34527
34528    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
34529        mem_base = xmlMemBlocks();
34530        value = gen_const_xmlChar_ptr(n_value, 0);
34531
34532        ret_val = xmlSchemaCollapseString((const xmlChar *)value);
34533        desret_xmlChar_ptr(ret_val);
34534        call_tests++;
34535        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
34536        xmlResetLastError();
34537        if (mem_base != xmlMemBlocks()) {
34538            printf("Leak of %d blocks found in xmlSchemaCollapseString",
34539	           xmlMemBlocks() - mem_base);
34540	    test_ret++;
34541            printf(" %d", n_value);
34542            printf("\n");
34543        }
34544    }
34545    function_tests++;
34546#endif
34547
34548    return(test_ret);
34549}
34550
34551#ifdef LIBXML_SCHEMAS_ENABLED
34552
34553#define gen_nb_xmlSchemaValPtr 1
34554static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34555    return(NULL);
34556}
34557static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
34558}
34559#endif
34560
34561
34562static int
34563test_xmlSchemaCompareValues(void) {
34564    int test_ret = 0;
34565
34566#if defined(LIBXML_SCHEMAS_ENABLED)
34567    int mem_base;
34568    int ret_val;
34569    xmlSchemaValPtr x; /* a first value */
34570    int n_x;
34571    xmlSchemaValPtr y; /* a second value */
34572    int n_y;
34573
34574    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34575    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34576        mem_base = xmlMemBlocks();
34577        x = gen_xmlSchemaValPtr(n_x, 0);
34578        y = gen_xmlSchemaValPtr(n_y, 1);
34579
34580        ret_val = xmlSchemaCompareValues(x, y);
34581        desret_int(ret_val);
34582        call_tests++;
34583        des_xmlSchemaValPtr(n_x, x, 0);
34584        des_xmlSchemaValPtr(n_y, y, 1);
34585        xmlResetLastError();
34586        if (mem_base != xmlMemBlocks()) {
34587            printf("Leak of %d blocks found in xmlSchemaCompareValues",
34588	           xmlMemBlocks() - mem_base);
34589	    test_ret++;
34590            printf(" %d", n_x);
34591            printf(" %d", n_y);
34592            printf("\n");
34593        }
34594    }
34595    }
34596    function_tests++;
34597#endif
34598
34599    return(test_ret);
34600}
34601
34602
34603static int
34604test_xmlSchemaCompareValuesWhtsp(void) {
34605    int test_ret = 0;
34606
34607#if defined(LIBXML_SCHEMAS_ENABLED)
34608    int mem_base;
34609    int ret_val;
34610    xmlSchemaValPtr x; /* a first value */
34611    int n_x;
34612    xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */
34613    int n_xws;
34614    xmlSchemaValPtr y; /* a second value */
34615    int n_y;
34616    xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */
34617    int n_yws;
34618
34619    for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) {
34620    for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) {
34621    for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) {
34622    for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) {
34623        mem_base = xmlMemBlocks();
34624        x = gen_xmlSchemaValPtr(n_x, 0);
34625        xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1);
34626        y = gen_xmlSchemaValPtr(n_y, 2);
34627        yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3);
34628
34629        ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws);
34630        desret_int(ret_val);
34631        call_tests++;
34632        des_xmlSchemaValPtr(n_x, x, 0);
34633        des_xmlSchemaWhitespaceValueType(n_xws, xws, 1);
34634        des_xmlSchemaValPtr(n_y, y, 2);
34635        des_xmlSchemaWhitespaceValueType(n_yws, yws, 3);
34636        xmlResetLastError();
34637        if (mem_base != xmlMemBlocks()) {
34638            printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp",
34639	           xmlMemBlocks() - mem_base);
34640	    test_ret++;
34641            printf(" %d", n_x);
34642            printf(" %d", n_xws);
34643            printf(" %d", n_y);
34644            printf(" %d", n_yws);
34645            printf("\n");
34646        }
34647    }
34648    }
34649    }
34650    }
34651    function_tests++;
34652#endif
34653
34654    return(test_ret);
34655}
34656
34657
34658static int
34659test_xmlSchemaCopyValue(void) {
34660    int test_ret = 0;
34661
34662
34663    /* missing type support */
34664    return(test_ret);
34665}
34666
34667
34668static int
34669test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) {
34670    int test_ret = 0;
34671
34672#if defined(LIBXML_SCHEMAS_ENABLED)
34673    int mem_base;
34674    xmlSchemaTypePtr ret_val;
34675    xmlSchemaTypePtr type; /* the built-in simple type. */
34676    int n_type;
34677
34678    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34679        mem_base = xmlMemBlocks();
34680        type = gen_xmlSchemaTypePtr(n_type, 0);
34681
34682        ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type);
34683        desret_xmlSchemaTypePtr(ret_val);
34684        call_tests++;
34685        des_xmlSchemaTypePtr(n_type, type, 0);
34686        xmlResetLastError();
34687        if (mem_base != xmlMemBlocks()) {
34688            printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType",
34689	           xmlMemBlocks() - mem_base);
34690	    test_ret++;
34691            printf(" %d", n_type);
34692            printf("\n");
34693        }
34694    }
34695    function_tests++;
34696#endif
34697
34698    return(test_ret);
34699}
34700
34701
34702static int
34703test_xmlSchemaGetBuiltInType(void) {
34704    int test_ret = 0;
34705
34706#if defined(LIBXML_SCHEMAS_ENABLED)
34707    xmlSchemaTypePtr ret_val;
34708    xmlSchemaValType type; /* the type of the built in type */
34709    int n_type;
34710
34711    for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) {
34712        type = gen_xmlSchemaValType(n_type, 0);
34713
34714        ret_val = xmlSchemaGetBuiltInType(type);
34715        desret_xmlSchemaTypePtr(ret_val);
34716        call_tests++;
34717        des_xmlSchemaValType(n_type, type, 0);
34718        xmlResetLastError();
34719    }
34720    function_tests++;
34721#endif
34722
34723    return(test_ret);
34724}
34725
34726
34727static int
34728test_xmlSchemaGetCanonValue(void) {
34729    int test_ret = 0;
34730
34731#if defined(LIBXML_SCHEMAS_ENABLED)
34732    int mem_base;
34733    int ret_val;
34734    xmlSchemaValPtr val; /* the precomputed value */
34735    int n_val;
34736    xmlChar ** retValue; /* the returned value */
34737    int n_retValue;
34738
34739    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34740    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34741        mem_base = xmlMemBlocks();
34742        val = gen_xmlSchemaValPtr(n_val, 0);
34743        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34744
34745        ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue);
34746        desret_int(ret_val);
34747        call_tests++;
34748        des_xmlSchemaValPtr(n_val, val, 0);
34749        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34750        xmlResetLastError();
34751        if (mem_base != xmlMemBlocks()) {
34752            printf("Leak of %d blocks found in xmlSchemaGetCanonValue",
34753	           xmlMemBlocks() - mem_base);
34754	    test_ret++;
34755            printf(" %d", n_val);
34756            printf(" %d", n_retValue);
34757            printf("\n");
34758        }
34759    }
34760    }
34761    function_tests++;
34762#endif
34763
34764    return(test_ret);
34765}
34766
34767
34768static int
34769test_xmlSchemaGetCanonValueWhtsp(void) {
34770    int test_ret = 0;
34771
34772#if defined(LIBXML_SCHEMAS_ENABLED)
34773    int mem_base;
34774    int ret_val;
34775    xmlSchemaValPtr val; /* the precomputed value */
34776    int n_val;
34777    xmlChar ** retValue; /* the returned value */
34778    int n_retValue;
34779    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
34780    int n_ws;
34781
34782    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34783    for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) {
34784    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
34785        mem_base = xmlMemBlocks();
34786        val = gen_xmlSchemaValPtr(n_val, 0);
34787        retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1);
34788        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2);
34789
34790        ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws);
34791        desret_int(ret_val);
34792        call_tests++;
34793        des_xmlSchemaValPtr(n_val, val, 0);
34794        des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1);
34795        des_xmlSchemaWhitespaceValueType(n_ws, ws, 2);
34796        xmlResetLastError();
34797        if (mem_base != xmlMemBlocks()) {
34798            printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp",
34799	           xmlMemBlocks() - mem_base);
34800	    test_ret++;
34801            printf(" %d", n_val);
34802            printf(" %d", n_retValue);
34803            printf(" %d", n_ws);
34804            printf("\n");
34805        }
34806    }
34807    }
34808    }
34809    function_tests++;
34810#endif
34811
34812    return(test_ret);
34813}
34814
34815
34816static int
34817test_xmlSchemaGetFacetValueAsULong(void) {
34818    int test_ret = 0;
34819
34820#if defined(LIBXML_SCHEMAS_ENABLED)
34821    int mem_base;
34822    unsigned long ret_val;
34823    xmlSchemaFacetPtr facet; /* an schemas type facet */
34824    int n_facet;
34825
34826    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
34827        mem_base = xmlMemBlocks();
34828        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
34829
34830        ret_val = xmlSchemaGetFacetValueAsULong(facet);
34831        desret_unsigned_long(ret_val);
34832        call_tests++;
34833        des_xmlSchemaFacetPtr(n_facet, facet, 0);
34834        xmlResetLastError();
34835        if (mem_base != xmlMemBlocks()) {
34836            printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong",
34837	           xmlMemBlocks() - mem_base);
34838	    test_ret++;
34839            printf(" %d", n_facet);
34840            printf("\n");
34841        }
34842    }
34843    function_tests++;
34844#endif
34845
34846    return(test_ret);
34847}
34848
34849
34850static int
34851test_xmlSchemaGetPredefinedType(void) {
34852    int test_ret = 0;
34853
34854#if defined(LIBXML_SCHEMAS_ENABLED)
34855    int mem_base;
34856    xmlSchemaTypePtr ret_val;
34857    xmlChar * name; /* the type name */
34858    int n_name;
34859    xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */
34860    int n_ns;
34861
34862    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
34863    for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) {
34864        mem_base = xmlMemBlocks();
34865        name = gen_const_xmlChar_ptr(n_name, 0);
34866        ns = gen_const_xmlChar_ptr(n_ns, 1);
34867
34868        ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns);
34869        desret_xmlSchemaTypePtr(ret_val);
34870        call_tests++;
34871        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
34872        des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1);
34873        xmlResetLastError();
34874        if (mem_base != xmlMemBlocks()) {
34875            printf("Leak of %d blocks found in xmlSchemaGetPredefinedType",
34876	           xmlMemBlocks() - mem_base);
34877	    test_ret++;
34878            printf(" %d", n_name);
34879            printf(" %d", n_ns);
34880            printf("\n");
34881        }
34882    }
34883    }
34884    function_tests++;
34885#endif
34886
34887    return(test_ret);
34888}
34889
34890
34891static int
34892test_xmlSchemaGetValType(void) {
34893    int test_ret = 0;
34894
34895#if defined(LIBXML_SCHEMAS_ENABLED)
34896    int mem_base;
34897    xmlSchemaValType ret_val;
34898    xmlSchemaValPtr val; /* a schemas value */
34899    int n_val;
34900
34901    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
34902        mem_base = xmlMemBlocks();
34903        val = gen_xmlSchemaValPtr(n_val, 0);
34904
34905        ret_val = xmlSchemaGetValType(val);
34906        desret_xmlSchemaValType(ret_val);
34907        call_tests++;
34908        des_xmlSchemaValPtr(n_val, val, 0);
34909        xmlResetLastError();
34910        if (mem_base != xmlMemBlocks()) {
34911            printf("Leak of %d blocks found in xmlSchemaGetValType",
34912	           xmlMemBlocks() - mem_base);
34913	    test_ret++;
34914            printf(" %d", n_val);
34915            printf("\n");
34916        }
34917    }
34918    function_tests++;
34919#endif
34920
34921    return(test_ret);
34922}
34923
34924
34925static int
34926test_xmlSchemaInitTypes(void) {
34927    int test_ret = 0;
34928
34929#if defined(LIBXML_SCHEMAS_ENABLED)
34930
34931
34932        xmlSchemaInitTypes();
34933        call_tests++;
34934        xmlResetLastError();
34935    function_tests++;
34936#endif
34937
34938    return(test_ret);
34939}
34940
34941
34942static int
34943test_xmlSchemaIsBuiltInTypeFacet(void) {
34944    int test_ret = 0;
34945
34946#if defined(LIBXML_SCHEMAS_ENABLED)
34947    int mem_base;
34948    int ret_val;
34949    xmlSchemaTypePtr type; /* the built-in type */
34950    int n_type;
34951    int facetType; /* the facet type */
34952    int n_facetType;
34953
34954    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
34955    for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) {
34956        mem_base = xmlMemBlocks();
34957        type = gen_xmlSchemaTypePtr(n_type, 0);
34958        facetType = gen_int(n_facetType, 1);
34959
34960        ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType);
34961        desret_int(ret_val);
34962        call_tests++;
34963        des_xmlSchemaTypePtr(n_type, type, 0);
34964        des_int(n_facetType, facetType, 1);
34965        xmlResetLastError();
34966        if (mem_base != xmlMemBlocks()) {
34967            printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet",
34968	           xmlMemBlocks() - mem_base);
34969	    test_ret++;
34970            printf(" %d", n_type);
34971            printf(" %d", n_facetType);
34972            printf("\n");
34973        }
34974    }
34975    }
34976    function_tests++;
34977#endif
34978
34979    return(test_ret);
34980}
34981
34982
34983static int
34984test_xmlSchemaNewFacet(void) {
34985    int test_ret = 0;
34986
34987
34988    /* missing type support */
34989    return(test_ret);
34990}
34991
34992
34993static int
34994test_xmlSchemaNewNOTATIONValue(void) {
34995    int test_ret = 0;
34996
34997
34998    /* missing type support */
34999    return(test_ret);
35000}
35001
35002
35003static int
35004test_xmlSchemaNewQNameValue(void) {
35005    int test_ret = 0;
35006
35007
35008    /* missing type support */
35009    return(test_ret);
35010}
35011
35012
35013static int
35014test_xmlSchemaNewStringValue(void) {
35015    int test_ret = 0;
35016
35017
35018    /* missing type support */
35019    return(test_ret);
35020}
35021
35022#ifdef LIBXML_SCHEMAS_ENABLED
35023
35024#define gen_nb_xmlSchemaValPtr_ptr 1
35025static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35026    return(NULL);
35027}
35028static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
35029}
35030#endif
35031
35032
35033static int
35034test_xmlSchemaValPredefTypeNode(void) {
35035    int test_ret = 0;
35036
35037#if defined(LIBXML_SCHEMAS_ENABLED)
35038    int mem_base;
35039    int ret_val;
35040    xmlSchemaTypePtr type; /* the predefined type */
35041    int n_type;
35042    xmlChar * value; /* the value to check */
35043    int n_value;
35044    xmlSchemaValPtr * val; /* the return computed value */
35045    int n_val;
35046    xmlNodePtr node; /* the node containing the value */
35047    int n_node;
35048
35049    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35050    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35051    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35052    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35053        mem_base = xmlMemBlocks();
35054        type = gen_xmlSchemaTypePtr(n_type, 0);
35055        value = gen_const_xmlChar_ptr(n_value, 1);
35056        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35057        node = gen_xmlNodePtr(n_node, 3);
35058
35059        ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node);
35060        desret_int(ret_val);
35061        call_tests++;
35062        des_xmlSchemaTypePtr(n_type, type, 0);
35063        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35064        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35065        des_xmlNodePtr(n_node, node, 3);
35066        xmlResetLastError();
35067        if (mem_base != xmlMemBlocks()) {
35068            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode",
35069	           xmlMemBlocks() - mem_base);
35070	    test_ret++;
35071            printf(" %d", n_type);
35072            printf(" %d", n_value);
35073            printf(" %d", n_val);
35074            printf(" %d", n_node);
35075            printf("\n");
35076        }
35077    }
35078    }
35079    }
35080    }
35081    function_tests++;
35082#endif
35083
35084    return(test_ret);
35085}
35086
35087
35088static int
35089test_xmlSchemaValPredefTypeNodeNoNorm(void) {
35090    int test_ret = 0;
35091
35092#if defined(LIBXML_SCHEMAS_ENABLED)
35093    int mem_base;
35094    int ret_val;
35095    xmlSchemaTypePtr type; /* the predefined type */
35096    int n_type;
35097    xmlChar * value; /* the value to check */
35098    int n_value;
35099    xmlSchemaValPtr * val; /* the return computed value */
35100    int n_val;
35101    xmlNodePtr node; /* the node containing the value */
35102    int n_node;
35103
35104    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35105    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35106    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35107    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
35108        mem_base = xmlMemBlocks();
35109        type = gen_xmlSchemaTypePtr(n_type, 0);
35110        value = gen_const_xmlChar_ptr(n_value, 1);
35111        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35112        node = gen_xmlNodePtr(n_node, 3);
35113
35114        ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node);
35115        desret_int(ret_val);
35116        call_tests++;
35117        des_xmlSchemaTypePtr(n_type, type, 0);
35118        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35119        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35120        des_xmlNodePtr(n_node, node, 3);
35121        xmlResetLastError();
35122        if (mem_base != xmlMemBlocks()) {
35123            printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm",
35124	           xmlMemBlocks() - mem_base);
35125	    test_ret++;
35126            printf(" %d", n_type);
35127            printf(" %d", n_value);
35128            printf(" %d", n_val);
35129            printf(" %d", n_node);
35130            printf("\n");
35131        }
35132    }
35133    }
35134    }
35135    }
35136    function_tests++;
35137#endif
35138
35139    return(test_ret);
35140}
35141
35142
35143static int
35144test_xmlSchemaValidateFacet(void) {
35145    int test_ret = 0;
35146
35147#if defined(LIBXML_SCHEMAS_ENABLED)
35148    int mem_base;
35149    int ret_val;
35150    xmlSchemaTypePtr base; /* the base type */
35151    int n_base;
35152    xmlSchemaFacetPtr facet; /* the facet to check */
35153    int n_facet;
35154    xmlChar * value; /* the lexical repr of the value to validate */
35155    int n_value;
35156    xmlSchemaValPtr val; /* the precomputed value */
35157    int n_val;
35158
35159    for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) {
35160    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35161    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35162    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35163        mem_base = xmlMemBlocks();
35164        base = gen_xmlSchemaTypePtr(n_base, 0);
35165        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35166        value = gen_const_xmlChar_ptr(n_value, 2);
35167        val = gen_xmlSchemaValPtr(n_val, 3);
35168
35169        ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val);
35170        desret_int(ret_val);
35171        call_tests++;
35172        des_xmlSchemaTypePtr(n_base, base, 0);
35173        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35174        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35175        des_xmlSchemaValPtr(n_val, val, 3);
35176        xmlResetLastError();
35177        if (mem_base != xmlMemBlocks()) {
35178            printf("Leak of %d blocks found in xmlSchemaValidateFacet",
35179	           xmlMemBlocks() - mem_base);
35180	    test_ret++;
35181            printf(" %d", n_base);
35182            printf(" %d", n_facet);
35183            printf(" %d", n_value);
35184            printf(" %d", n_val);
35185            printf("\n");
35186        }
35187    }
35188    }
35189    }
35190    }
35191    function_tests++;
35192#endif
35193
35194    return(test_ret);
35195}
35196
35197
35198static int
35199test_xmlSchemaValidateFacetWhtsp(void) {
35200    int test_ret = 0;
35201
35202#if defined(LIBXML_SCHEMAS_ENABLED)
35203    int mem_base;
35204    int ret_val;
35205    xmlSchemaFacetPtr facet; /* the facet to check */
35206    int n_facet;
35207    xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */
35208    int n_fws;
35209    xmlSchemaValType valType; /* the built-in type of the value */
35210    int n_valType;
35211    xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */
35212    int n_value;
35213    xmlSchemaValPtr val; /* the precomputed value */
35214    int n_val;
35215    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35216    int n_ws;
35217
35218    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35219    for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) {
35220    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35221    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35222    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35223    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35224        mem_base = xmlMemBlocks();
35225        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35226        fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1);
35227        valType = gen_xmlSchemaValType(n_valType, 2);
35228        value = gen_const_xmlChar_ptr(n_value, 3);
35229        val = gen_xmlSchemaValPtr(n_val, 4);
35230        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35231
35232        ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws);
35233        desret_int(ret_val);
35234        call_tests++;
35235        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35236        des_xmlSchemaWhitespaceValueType(n_fws, fws, 1);
35237        des_xmlSchemaValType(n_valType, valType, 2);
35238        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3);
35239        des_xmlSchemaValPtr(n_val, val, 4);
35240        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35241        xmlResetLastError();
35242        if (mem_base != xmlMemBlocks()) {
35243            printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp",
35244	           xmlMemBlocks() - mem_base);
35245	    test_ret++;
35246            printf(" %d", n_facet);
35247            printf(" %d", n_fws);
35248            printf(" %d", n_valType);
35249            printf(" %d", n_value);
35250            printf(" %d", n_val);
35251            printf(" %d", n_ws);
35252            printf("\n");
35253        }
35254    }
35255    }
35256    }
35257    }
35258    }
35259    }
35260    function_tests++;
35261#endif
35262
35263    return(test_ret);
35264}
35265
35266
35267static int
35268test_xmlSchemaValidateLengthFacet(void) {
35269    int test_ret = 0;
35270
35271#if defined(LIBXML_SCHEMAS_ENABLED)
35272    int mem_base;
35273    int ret_val;
35274    xmlSchemaTypePtr type; /* the built-in type */
35275    int n_type;
35276    xmlSchemaFacetPtr facet; /* the facet to check */
35277    int n_facet;
35278    xmlChar * value; /* the lexical repr. of the value to be validated */
35279    int n_value;
35280    xmlSchemaValPtr val; /* the precomputed value */
35281    int n_val;
35282    unsigned long * length; /* the actual length of the value */
35283    int n_length;
35284
35285    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35286    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35287    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35288    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35289    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35290        mem_base = xmlMemBlocks();
35291        type = gen_xmlSchemaTypePtr(n_type, 0);
35292        facet = gen_xmlSchemaFacetPtr(n_facet, 1);
35293        value = gen_const_xmlChar_ptr(n_value, 2);
35294        val = gen_xmlSchemaValPtr(n_val, 3);
35295        length = gen_unsigned_long_ptr(n_length, 4);
35296
35297        ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length);
35298        desret_int(ret_val);
35299        call_tests++;
35300        des_xmlSchemaTypePtr(n_type, type, 0);
35301        des_xmlSchemaFacetPtr(n_facet, facet, 1);
35302        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35303        des_xmlSchemaValPtr(n_val, val, 3);
35304        des_unsigned_long_ptr(n_length, length, 4);
35305        xmlResetLastError();
35306        if (mem_base != xmlMemBlocks()) {
35307            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet",
35308	           xmlMemBlocks() - mem_base);
35309	    test_ret++;
35310            printf(" %d", n_type);
35311            printf(" %d", n_facet);
35312            printf(" %d", n_value);
35313            printf(" %d", n_val);
35314            printf(" %d", n_length);
35315            printf("\n");
35316        }
35317    }
35318    }
35319    }
35320    }
35321    }
35322    function_tests++;
35323#endif
35324
35325    return(test_ret);
35326}
35327
35328
35329static int
35330test_xmlSchemaValidateLengthFacetWhtsp(void) {
35331    int test_ret = 0;
35332
35333#if defined(LIBXML_SCHEMAS_ENABLED)
35334    int mem_base;
35335    int ret_val;
35336    xmlSchemaFacetPtr facet; /* the facet to check */
35337    int n_facet;
35338    xmlSchemaValType valType; /* the built-in type */
35339    int n_valType;
35340    xmlChar * value; /* the lexical repr. of the value to be validated */
35341    int n_value;
35342    xmlSchemaValPtr val; /* the precomputed value */
35343    int n_val;
35344    unsigned long * length; /* the actual length of the value */
35345    int n_length;
35346    xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */
35347    int n_ws;
35348
35349    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35350    for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) {
35351    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35352    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35353    for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) {
35354    for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) {
35355        mem_base = xmlMemBlocks();
35356        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35357        valType = gen_xmlSchemaValType(n_valType, 1);
35358        value = gen_const_xmlChar_ptr(n_value, 2);
35359        val = gen_xmlSchemaValPtr(n_val, 3);
35360        length = gen_unsigned_long_ptr(n_length, 4);
35361        ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5);
35362
35363        ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws);
35364        desret_int(ret_val);
35365        call_tests++;
35366        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35367        des_xmlSchemaValType(n_valType, valType, 1);
35368        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2);
35369        des_xmlSchemaValPtr(n_val, val, 3);
35370        des_unsigned_long_ptr(n_length, length, 4);
35371        des_xmlSchemaWhitespaceValueType(n_ws, ws, 5);
35372        xmlResetLastError();
35373        if (mem_base != xmlMemBlocks()) {
35374            printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp",
35375	           xmlMemBlocks() - mem_base);
35376	    test_ret++;
35377            printf(" %d", n_facet);
35378            printf(" %d", n_valType);
35379            printf(" %d", n_value);
35380            printf(" %d", n_val);
35381            printf(" %d", n_length);
35382            printf(" %d", n_ws);
35383            printf("\n");
35384        }
35385    }
35386    }
35387    }
35388    }
35389    }
35390    }
35391    function_tests++;
35392#endif
35393
35394    return(test_ret);
35395}
35396
35397
35398static int
35399test_xmlSchemaValidateListSimpleTypeFacet(void) {
35400    int test_ret = 0;
35401
35402#if defined(LIBXML_SCHEMAS_ENABLED)
35403    int mem_base;
35404    int ret_val;
35405    xmlSchemaFacetPtr facet; /* the facet to check */
35406    int n_facet;
35407    xmlChar * value; /* the lexical repr of the value to validate */
35408    int n_value;
35409    unsigned long actualLen; /* the number of list items */
35410    int n_actualLen;
35411    unsigned long * expectedLen; /* the resulting expected number of list items */
35412    int n_expectedLen;
35413
35414    for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) {
35415    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35416    for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) {
35417    for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) {
35418        mem_base = xmlMemBlocks();
35419        facet = gen_xmlSchemaFacetPtr(n_facet, 0);
35420        value = gen_const_xmlChar_ptr(n_value, 1);
35421        actualLen = gen_unsigned_long(n_actualLen, 2);
35422        expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3);
35423
35424        ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen);
35425        desret_int(ret_val);
35426        call_tests++;
35427        des_xmlSchemaFacetPtr(n_facet, facet, 0);
35428        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35429        des_unsigned_long(n_actualLen, actualLen, 2);
35430        des_unsigned_long_ptr(n_expectedLen, expectedLen, 3);
35431        xmlResetLastError();
35432        if (mem_base != xmlMemBlocks()) {
35433            printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet",
35434	           xmlMemBlocks() - mem_base);
35435	    test_ret++;
35436            printf(" %d", n_facet);
35437            printf(" %d", n_value);
35438            printf(" %d", n_actualLen);
35439            printf(" %d", n_expectedLen);
35440            printf("\n");
35441        }
35442    }
35443    }
35444    }
35445    }
35446    function_tests++;
35447#endif
35448
35449    return(test_ret);
35450}
35451
35452
35453static int
35454test_xmlSchemaValidatePredefinedType(void) {
35455    int test_ret = 0;
35456
35457#if defined(LIBXML_SCHEMAS_ENABLED)
35458    int mem_base;
35459    int ret_val;
35460    xmlSchemaTypePtr type; /* the predefined type */
35461    int n_type;
35462    xmlChar * value; /* the value to check */
35463    int n_value;
35464    xmlSchemaValPtr * val; /* the return computed value */
35465    int n_val;
35466
35467    for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) {
35468    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35469    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) {
35470        mem_base = xmlMemBlocks();
35471        type = gen_xmlSchemaTypePtr(n_type, 0);
35472        value = gen_const_xmlChar_ptr(n_value, 1);
35473        val = gen_xmlSchemaValPtr_ptr(n_val, 2);
35474
35475        ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val);
35476        desret_int(ret_val);
35477        call_tests++;
35478        des_xmlSchemaTypePtr(n_type, type, 0);
35479        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1);
35480        des_xmlSchemaValPtr_ptr(n_val, val, 2);
35481        xmlResetLastError();
35482        if (mem_base != xmlMemBlocks()) {
35483            printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType",
35484	           xmlMemBlocks() - mem_base);
35485	    test_ret++;
35486            printf(" %d", n_type);
35487            printf(" %d", n_value);
35488            printf(" %d", n_val);
35489            printf("\n");
35490        }
35491    }
35492    }
35493    }
35494    function_tests++;
35495#endif
35496
35497    return(test_ret);
35498}
35499
35500
35501static int
35502test_xmlSchemaValueAppend(void) {
35503    int test_ret = 0;
35504
35505#if defined(LIBXML_SCHEMAS_ENABLED)
35506    int mem_base;
35507    int ret_val;
35508    xmlSchemaValPtr prev; /* the value */
35509    int n_prev;
35510    xmlSchemaValPtr cur; /* the value to be appended */
35511    int n_cur;
35512
35513    for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) {
35514    for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) {
35515        mem_base = xmlMemBlocks();
35516        prev = gen_xmlSchemaValPtr(n_prev, 0);
35517        cur = gen_xmlSchemaValPtr(n_cur, 1);
35518
35519        ret_val = xmlSchemaValueAppend(prev, cur);
35520        desret_int(ret_val);
35521        call_tests++;
35522        des_xmlSchemaValPtr(n_prev, prev, 0);
35523        des_xmlSchemaValPtr(n_cur, cur, 1);
35524        xmlResetLastError();
35525        if (mem_base != xmlMemBlocks()) {
35526            printf("Leak of %d blocks found in xmlSchemaValueAppend",
35527	           xmlMemBlocks() - mem_base);
35528	    test_ret++;
35529            printf(" %d", n_prev);
35530            printf(" %d", n_cur);
35531            printf("\n");
35532        }
35533    }
35534    }
35535    function_tests++;
35536#endif
35537
35538    return(test_ret);
35539}
35540
35541
35542static int
35543test_xmlSchemaValueGetAsBoolean(void) {
35544    int test_ret = 0;
35545
35546#if defined(LIBXML_SCHEMAS_ENABLED)
35547    int mem_base;
35548    int ret_val;
35549    xmlSchemaValPtr val; /* the value */
35550    int n_val;
35551
35552    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35553        mem_base = xmlMemBlocks();
35554        val = gen_xmlSchemaValPtr(n_val, 0);
35555
35556        ret_val = xmlSchemaValueGetAsBoolean(val);
35557        desret_int(ret_val);
35558        call_tests++;
35559        des_xmlSchemaValPtr(n_val, val, 0);
35560        xmlResetLastError();
35561        if (mem_base != xmlMemBlocks()) {
35562            printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean",
35563	           xmlMemBlocks() - mem_base);
35564	    test_ret++;
35565            printf(" %d", n_val);
35566            printf("\n");
35567        }
35568    }
35569    function_tests++;
35570#endif
35571
35572    return(test_ret);
35573}
35574
35575
35576static int
35577test_xmlSchemaValueGetAsString(void) {
35578    int test_ret = 0;
35579
35580#if defined(LIBXML_SCHEMAS_ENABLED)
35581    int mem_base;
35582    const xmlChar * ret_val;
35583    xmlSchemaValPtr val; /* the value */
35584    int n_val;
35585
35586    for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) {
35587        mem_base = xmlMemBlocks();
35588        val = gen_xmlSchemaValPtr(n_val, 0);
35589
35590        ret_val = xmlSchemaValueGetAsString(val);
35591        desret_const_xmlChar_ptr(ret_val);
35592        call_tests++;
35593        des_xmlSchemaValPtr(n_val, val, 0);
35594        xmlResetLastError();
35595        if (mem_base != xmlMemBlocks()) {
35596            printf("Leak of %d blocks found in xmlSchemaValueGetAsString",
35597	           xmlMemBlocks() - mem_base);
35598	    test_ret++;
35599            printf(" %d", n_val);
35600            printf("\n");
35601        }
35602    }
35603    function_tests++;
35604#endif
35605
35606    return(test_ret);
35607}
35608
35609
35610static int
35611test_xmlSchemaValueGetNext(void) {
35612    int test_ret = 0;
35613
35614
35615    /* missing type support */
35616    return(test_ret);
35617}
35618
35619
35620static int
35621test_xmlSchemaWhiteSpaceReplace(void) {
35622    int test_ret = 0;
35623
35624#if defined(LIBXML_SCHEMAS_ENABLED)
35625    int mem_base;
35626    xmlChar * ret_val;
35627    xmlChar * value; /* a value */
35628    int n_value;
35629
35630    for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
35631        mem_base = xmlMemBlocks();
35632        value = gen_const_xmlChar_ptr(n_value, 0);
35633
35634        ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value);
35635        desret_xmlChar_ptr(ret_val);
35636        call_tests++;
35637        des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0);
35638        xmlResetLastError();
35639        if (mem_base != xmlMemBlocks()) {
35640            printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace",
35641	           xmlMemBlocks() - mem_base);
35642	    test_ret++;
35643            printf(" %d", n_value);
35644            printf("\n");
35645        }
35646    }
35647    function_tests++;
35648#endif
35649
35650    return(test_ret);
35651}
35652
35653static int
35654test_xmlschemastypes(void) {
35655    int test_ret = 0;
35656
35657    if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n");
35658    test_ret += test_xmlSchemaCheckFacet();
35659    test_ret += test_xmlSchemaCleanupTypes();
35660    test_ret += test_xmlSchemaCollapseString();
35661    test_ret += test_xmlSchemaCompareValues();
35662    test_ret += test_xmlSchemaCompareValuesWhtsp();
35663    test_ret += test_xmlSchemaCopyValue();
35664    test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType();
35665    test_ret += test_xmlSchemaGetBuiltInType();
35666    test_ret += test_xmlSchemaGetCanonValue();
35667    test_ret += test_xmlSchemaGetCanonValueWhtsp();
35668    test_ret += test_xmlSchemaGetFacetValueAsULong();
35669    test_ret += test_xmlSchemaGetPredefinedType();
35670    test_ret += test_xmlSchemaGetValType();
35671    test_ret += test_xmlSchemaInitTypes();
35672    test_ret += test_xmlSchemaIsBuiltInTypeFacet();
35673    test_ret += test_xmlSchemaNewFacet();
35674    test_ret += test_xmlSchemaNewNOTATIONValue();
35675    test_ret += test_xmlSchemaNewQNameValue();
35676    test_ret += test_xmlSchemaNewStringValue();
35677    test_ret += test_xmlSchemaValPredefTypeNode();
35678    test_ret += test_xmlSchemaValPredefTypeNodeNoNorm();
35679    test_ret += test_xmlSchemaValidateFacet();
35680    test_ret += test_xmlSchemaValidateFacetWhtsp();
35681    test_ret += test_xmlSchemaValidateLengthFacet();
35682    test_ret += test_xmlSchemaValidateLengthFacetWhtsp();
35683    test_ret += test_xmlSchemaValidateListSimpleTypeFacet();
35684    test_ret += test_xmlSchemaValidatePredefinedType();
35685    test_ret += test_xmlSchemaValueAppend();
35686    test_ret += test_xmlSchemaValueGetAsBoolean();
35687    test_ret += test_xmlSchemaValueGetAsString();
35688    test_ret += test_xmlSchemaValueGetNext();
35689    test_ret += test_xmlSchemaWhiteSpaceReplace();
35690
35691    if (test_ret != 0)
35692	printf("Module xmlschemastypes: %d errors\n", test_ret);
35693    return(test_ret);
35694}
35695
35696static int
35697test_xmlCharStrdup(void) {
35698    int test_ret = 0;
35699
35700    int mem_base;
35701    xmlChar * ret_val;
35702    char * cur; /* the input char * */
35703    int n_cur;
35704
35705    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35706        mem_base = xmlMemBlocks();
35707        cur = gen_const_char_ptr(n_cur, 0);
35708
35709        ret_val = xmlCharStrdup((const char *)cur);
35710        desret_xmlChar_ptr(ret_val);
35711        call_tests++;
35712        des_const_char_ptr(n_cur, (const char *)cur, 0);
35713        xmlResetLastError();
35714        if (mem_base != xmlMemBlocks()) {
35715            printf("Leak of %d blocks found in xmlCharStrdup",
35716	           xmlMemBlocks() - mem_base);
35717	    test_ret++;
35718            printf(" %d", n_cur);
35719            printf("\n");
35720        }
35721    }
35722    function_tests++;
35723
35724    return(test_ret);
35725}
35726
35727
35728static int
35729test_xmlCharStrndup(void) {
35730    int test_ret = 0;
35731
35732    int mem_base;
35733    xmlChar * ret_val;
35734    char * cur; /* the input char * */
35735    int n_cur;
35736    int len; /* the len of @cur */
35737    int n_len;
35738
35739    for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) {
35740    for (n_len = 0;n_len < gen_nb_int;n_len++) {
35741        mem_base = xmlMemBlocks();
35742        cur = gen_const_char_ptr(n_cur, 0);
35743        len = gen_int(n_len, 1);
35744
35745        ret_val = xmlCharStrndup((const char *)cur, len);
35746        desret_xmlChar_ptr(ret_val);
35747        call_tests++;
35748        des_const_char_ptr(n_cur, (const char *)cur, 0);
35749        des_int(n_len, len, 1);
35750        xmlResetLastError();
35751        if (mem_base != xmlMemBlocks()) {
35752            printf("Leak of %d blocks found in xmlCharStrndup",
35753	           xmlMemBlocks() - mem_base);
35754	    test_ret++;
35755            printf(" %d", n_cur);
35756            printf(" %d", n_len);
35757            printf("\n");
35758        }
35759    }
35760    }
35761    function_tests++;
35762
35763    return(test_ret);
35764}
35765
35766
35767static int
35768test_xmlCheckUTF8(void) {
35769    int test_ret = 0;
35770
35771    int mem_base;
35772    int ret_val;
35773    unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */
35774    int n_utf;
35775
35776    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35777        mem_base = xmlMemBlocks();
35778        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35779
35780        ret_val = xmlCheckUTF8((const unsigned char *)utf);
35781        desret_int(ret_val);
35782        call_tests++;
35783        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35784        xmlResetLastError();
35785        if (mem_base != xmlMemBlocks()) {
35786            printf("Leak of %d blocks found in xmlCheckUTF8",
35787	           xmlMemBlocks() - mem_base);
35788	    test_ret++;
35789            printf(" %d", n_utf);
35790            printf("\n");
35791        }
35792    }
35793    function_tests++;
35794
35795    return(test_ret);
35796}
35797
35798
35799static int
35800test_xmlGetUTF8Char(void) {
35801    int test_ret = 0;
35802
35803    int mem_base;
35804    int ret_val;
35805    unsigned char * utf; /* a sequence of UTF-8 encoded bytes */
35806    int n_utf;
35807    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. */
35808    int n_len;
35809
35810    for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) {
35811    for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) {
35812        mem_base = xmlMemBlocks();
35813        utf = gen_const_unsigned_char_ptr(n_utf, 0);
35814        len = gen_int_ptr(n_len, 1);
35815
35816        ret_val = xmlGetUTF8Char((const unsigned char *)utf, len);
35817        desret_int(ret_val);
35818        call_tests++;
35819        des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0);
35820        des_int_ptr(n_len, len, 1);
35821        xmlResetLastError();
35822        if (mem_base != xmlMemBlocks()) {
35823            printf("Leak of %d blocks found in xmlGetUTF8Char",
35824	           xmlMemBlocks() - mem_base);
35825	    test_ret++;
35826            printf(" %d", n_utf);
35827            printf(" %d", n_len);
35828            printf("\n");
35829        }
35830    }
35831    }
35832    function_tests++;
35833
35834    return(test_ret);
35835}
35836
35837
35838static int
35839test_xmlStrEqual(void) {
35840    int test_ret = 0;
35841
35842    int mem_base;
35843    int ret_val;
35844    xmlChar * str1; /* the first xmlChar * */
35845    int n_str1;
35846    xmlChar * str2; /* the second xmlChar * */
35847    int n_str2;
35848
35849    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35850    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35851        mem_base = xmlMemBlocks();
35852        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35853        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35854
35855        ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2);
35856        desret_int(ret_val);
35857        call_tests++;
35858        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35859        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35860        xmlResetLastError();
35861        if (mem_base != xmlMemBlocks()) {
35862            printf("Leak of %d blocks found in xmlStrEqual",
35863	           xmlMemBlocks() - mem_base);
35864	    test_ret++;
35865            printf(" %d", n_str1);
35866            printf(" %d", n_str2);
35867            printf("\n");
35868        }
35869    }
35870    }
35871    function_tests++;
35872
35873    return(test_ret);
35874}
35875
35876
35877static int
35878test_xmlStrPrintf(void) {
35879    int test_ret = 0;
35880
35881
35882    /* missing type support */
35883    return(test_ret);
35884}
35885
35886
35887static int
35888test_xmlStrQEqual(void) {
35889    int test_ret = 0;
35890
35891    int mem_base;
35892    int ret_val;
35893    xmlChar * pref; /* the prefix of the QName */
35894    int n_pref;
35895    xmlChar * name; /* the localname of the QName */
35896    int n_name;
35897    xmlChar * str; /* the second xmlChar * */
35898    int n_str;
35899
35900    for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) {
35901    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
35902    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35903        mem_base = xmlMemBlocks();
35904        pref = gen_const_xmlChar_ptr(n_pref, 0);
35905        name = gen_const_xmlChar_ptr(n_name, 1);
35906        str = gen_const_xmlChar_ptr(n_str, 2);
35907
35908        ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str);
35909        desret_int(ret_val);
35910        call_tests++;
35911        des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0);
35912        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
35913        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2);
35914        xmlResetLastError();
35915        if (mem_base != xmlMemBlocks()) {
35916            printf("Leak of %d blocks found in xmlStrQEqual",
35917	           xmlMemBlocks() - mem_base);
35918	    test_ret++;
35919            printf(" %d", n_pref);
35920            printf(" %d", n_name);
35921            printf(" %d", n_str);
35922            printf("\n");
35923        }
35924    }
35925    }
35926    }
35927    function_tests++;
35928
35929    return(test_ret);
35930}
35931
35932
35933static int
35934test_xmlStrVPrintf(void) {
35935    int test_ret = 0;
35936
35937
35938    /* missing type support */
35939    return(test_ret);
35940}
35941
35942
35943static int
35944test_xmlStrcasecmp(void) {
35945    int test_ret = 0;
35946
35947    int mem_base;
35948    int ret_val;
35949    xmlChar * str1; /* the first xmlChar * */
35950    int n_str1;
35951    xmlChar * str2; /* the second xmlChar * */
35952    int n_str2;
35953
35954    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
35955    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
35956        mem_base = xmlMemBlocks();
35957        str1 = gen_const_xmlChar_ptr(n_str1, 0);
35958        str2 = gen_const_xmlChar_ptr(n_str2, 1);
35959
35960        ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2);
35961        desret_int(ret_val);
35962        call_tests++;
35963        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
35964        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
35965        xmlResetLastError();
35966        if (mem_base != xmlMemBlocks()) {
35967            printf("Leak of %d blocks found in xmlStrcasecmp",
35968	           xmlMemBlocks() - mem_base);
35969	    test_ret++;
35970            printf(" %d", n_str1);
35971            printf(" %d", n_str2);
35972            printf("\n");
35973        }
35974    }
35975    }
35976    function_tests++;
35977
35978    return(test_ret);
35979}
35980
35981
35982static int
35983test_xmlStrcasestr(void) {
35984    int test_ret = 0;
35985
35986    int mem_base;
35987    const xmlChar * ret_val;
35988    xmlChar * str; /* the xmlChar * array (haystack) */
35989    int n_str;
35990    xmlChar * val; /* the xmlChar to search (needle) */
35991    int n_val;
35992
35993    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
35994    for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) {
35995        mem_base = xmlMemBlocks();
35996        str = gen_const_xmlChar_ptr(n_str, 0);
35997        val = gen_xmlChar_ptr(n_val, 1);
35998
35999        ret_val = xmlStrcasestr((const xmlChar *)str, val);
36000        desret_const_xmlChar_ptr(ret_val);
36001        call_tests++;
36002        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36003        des_xmlChar_ptr(n_val, val, 1);
36004        xmlResetLastError();
36005        if (mem_base != xmlMemBlocks()) {
36006            printf("Leak of %d blocks found in xmlStrcasestr",
36007	           xmlMemBlocks() - mem_base);
36008	    test_ret++;
36009            printf(" %d", n_str);
36010            printf(" %d", n_val);
36011            printf("\n");
36012        }
36013    }
36014    }
36015    function_tests++;
36016
36017    return(test_ret);
36018}
36019
36020
36021static int
36022test_xmlStrchr(void) {
36023    int test_ret = 0;
36024
36025    int mem_base;
36026    const xmlChar * ret_val;
36027    xmlChar * str; /* the xmlChar * array */
36028    int n_str;
36029    xmlChar val; /* the xmlChar to search */
36030    int n_val;
36031
36032    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36033    for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) {
36034        mem_base = xmlMemBlocks();
36035        str = gen_const_xmlChar_ptr(n_str, 0);
36036        val = gen_xmlChar(n_val, 1);
36037
36038        ret_val = xmlStrchr((const xmlChar *)str, val);
36039        desret_const_xmlChar_ptr(ret_val);
36040        call_tests++;
36041        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36042        des_xmlChar(n_val, val, 1);
36043        xmlResetLastError();
36044        if (mem_base != xmlMemBlocks()) {
36045            printf("Leak of %d blocks found in xmlStrchr",
36046	           xmlMemBlocks() - mem_base);
36047	    test_ret++;
36048            printf(" %d", n_str);
36049            printf(" %d", n_val);
36050            printf("\n");
36051        }
36052    }
36053    }
36054    function_tests++;
36055
36056    return(test_ret);
36057}
36058
36059
36060static int
36061test_xmlStrcmp(void) {
36062    int test_ret = 0;
36063
36064    int mem_base;
36065    int ret_val;
36066    xmlChar * str1; /* the first xmlChar * */
36067    int n_str1;
36068    xmlChar * str2; /* the second xmlChar * */
36069    int n_str2;
36070
36071    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36072    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36073        mem_base = xmlMemBlocks();
36074        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36075        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36076
36077        ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2);
36078        desret_int(ret_val);
36079        call_tests++;
36080        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36081        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36082        xmlResetLastError();
36083        if (mem_base != xmlMemBlocks()) {
36084            printf("Leak of %d blocks found in xmlStrcmp",
36085	           xmlMemBlocks() - mem_base);
36086	    test_ret++;
36087            printf(" %d", n_str1);
36088            printf(" %d", n_str2);
36089            printf("\n");
36090        }
36091    }
36092    }
36093    function_tests++;
36094
36095    return(test_ret);
36096}
36097
36098
36099static int
36100test_xmlStrdup(void) {
36101    int test_ret = 0;
36102
36103    int mem_base;
36104    xmlChar * ret_val;
36105    xmlChar * cur; /* the input xmlChar * */
36106    int n_cur;
36107
36108    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36109        mem_base = xmlMemBlocks();
36110        cur = gen_const_xmlChar_ptr(n_cur, 0);
36111
36112        ret_val = xmlStrdup((const xmlChar *)cur);
36113        desret_xmlChar_ptr(ret_val);
36114        call_tests++;
36115        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36116        xmlResetLastError();
36117        if (mem_base != xmlMemBlocks()) {
36118            printf("Leak of %d blocks found in xmlStrdup",
36119	           xmlMemBlocks() - mem_base);
36120	    test_ret++;
36121            printf(" %d", n_cur);
36122            printf("\n");
36123        }
36124    }
36125    function_tests++;
36126
36127    return(test_ret);
36128}
36129
36130
36131static int
36132test_xmlStrlen(void) {
36133    int test_ret = 0;
36134
36135    int mem_base;
36136    int ret_val;
36137    xmlChar * str; /* the xmlChar * array */
36138    int n_str;
36139
36140    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36141        mem_base = xmlMemBlocks();
36142        str = gen_const_xmlChar_ptr(n_str, 0);
36143
36144        ret_val = xmlStrlen((const xmlChar *)str);
36145        desret_int(ret_val);
36146        call_tests++;
36147        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36148        xmlResetLastError();
36149        if (mem_base != xmlMemBlocks()) {
36150            printf("Leak of %d blocks found in xmlStrlen",
36151	           xmlMemBlocks() - mem_base);
36152	    test_ret++;
36153            printf(" %d", n_str);
36154            printf("\n");
36155        }
36156    }
36157    function_tests++;
36158
36159    return(test_ret);
36160}
36161
36162
36163static int
36164test_xmlStrncasecmp(void) {
36165    int test_ret = 0;
36166
36167    int mem_base;
36168    int ret_val;
36169    xmlChar * str1; /* the first xmlChar * */
36170    int n_str1;
36171    xmlChar * str2; /* the second xmlChar * */
36172    int n_str2;
36173    int len; /* the max comparison length */
36174    int n_len;
36175
36176    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36177    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36178    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36179        mem_base = xmlMemBlocks();
36180        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36181        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36182        len = gen_int(n_len, 2);
36183
36184        ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36185        desret_int(ret_val);
36186        call_tests++;
36187        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36188        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36189        des_int(n_len, len, 2);
36190        xmlResetLastError();
36191        if (mem_base != xmlMemBlocks()) {
36192            printf("Leak of %d blocks found in xmlStrncasecmp",
36193	           xmlMemBlocks() - mem_base);
36194	    test_ret++;
36195            printf(" %d", n_str1);
36196            printf(" %d", n_str2);
36197            printf(" %d", n_len);
36198            printf("\n");
36199        }
36200    }
36201    }
36202    }
36203    function_tests++;
36204
36205    return(test_ret);
36206}
36207
36208
36209static int
36210test_xmlStrncatNew(void) {
36211    int test_ret = 0;
36212
36213    int mem_base;
36214    xmlChar * ret_val;
36215    xmlChar * str1; /* first xmlChar string */
36216    int n_str1;
36217    xmlChar * str2; /* second xmlChar string */
36218    int n_str2;
36219    int len; /* the len of @str2 or < 0 */
36220    int n_len;
36221
36222    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36223    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36224    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36225        mem_base = xmlMemBlocks();
36226        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36227        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36228        len = gen_int(n_len, 2);
36229
36230        ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len);
36231        desret_xmlChar_ptr(ret_val);
36232        call_tests++;
36233        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36234        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36235        des_int(n_len, len, 2);
36236        xmlResetLastError();
36237        if (mem_base != xmlMemBlocks()) {
36238            printf("Leak of %d blocks found in xmlStrncatNew",
36239	           xmlMemBlocks() - mem_base);
36240	    test_ret++;
36241            printf(" %d", n_str1);
36242            printf(" %d", n_str2);
36243            printf(" %d", n_len);
36244            printf("\n");
36245        }
36246    }
36247    }
36248    }
36249    function_tests++;
36250
36251    return(test_ret);
36252}
36253
36254
36255static int
36256test_xmlStrncmp(void) {
36257    int test_ret = 0;
36258
36259    int mem_base;
36260    int ret_val;
36261    xmlChar * str1; /* the first xmlChar * */
36262    int n_str1;
36263    xmlChar * str2; /* the second xmlChar * */
36264    int n_str2;
36265    int len; /* the max comparison length */
36266    int n_len;
36267
36268    for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) {
36269    for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) {
36270    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36271        mem_base = xmlMemBlocks();
36272        str1 = gen_const_xmlChar_ptr(n_str1, 0);
36273        str2 = gen_const_xmlChar_ptr(n_str2, 1);
36274        len = gen_int(n_len, 2);
36275
36276        ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len);
36277        desret_int(ret_val);
36278        call_tests++;
36279        des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0);
36280        des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1);
36281        des_int(n_len, len, 2);
36282        xmlResetLastError();
36283        if (mem_base != xmlMemBlocks()) {
36284            printf("Leak of %d blocks found in xmlStrncmp",
36285	           xmlMemBlocks() - mem_base);
36286	    test_ret++;
36287            printf(" %d", n_str1);
36288            printf(" %d", n_str2);
36289            printf(" %d", n_len);
36290            printf("\n");
36291        }
36292    }
36293    }
36294    }
36295    function_tests++;
36296
36297    return(test_ret);
36298}
36299
36300
36301static int
36302test_xmlStrndup(void) {
36303    int test_ret = 0;
36304
36305    int mem_base;
36306    xmlChar * ret_val;
36307    xmlChar * cur; /* the input xmlChar * */
36308    int n_cur;
36309    int len; /* the len of @cur */
36310    int n_len;
36311
36312    for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) {
36313    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36314        mem_base = xmlMemBlocks();
36315        cur = gen_const_xmlChar_ptr(n_cur, 0);
36316        len = gen_int(n_len, 1);
36317
36318        ret_val = xmlStrndup((const xmlChar *)cur, len);
36319        desret_xmlChar_ptr(ret_val);
36320        call_tests++;
36321        des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0);
36322        des_int(n_len, len, 1);
36323        xmlResetLastError();
36324        if (mem_base != xmlMemBlocks()) {
36325            printf("Leak of %d blocks found in xmlStrndup",
36326	           xmlMemBlocks() - mem_base);
36327	    test_ret++;
36328            printf(" %d", n_cur);
36329            printf(" %d", n_len);
36330            printf("\n");
36331        }
36332    }
36333    }
36334    function_tests++;
36335
36336    return(test_ret);
36337}
36338
36339
36340static int
36341test_xmlStrstr(void) {
36342    int test_ret = 0;
36343
36344    int mem_base;
36345    const xmlChar * ret_val;
36346    xmlChar * str; /* the xmlChar * array (haystack) */
36347    int n_str;
36348    xmlChar * val; /* the xmlChar to search (needle) */
36349    int n_val;
36350
36351    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36352    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
36353        mem_base = xmlMemBlocks();
36354        str = gen_const_xmlChar_ptr(n_str, 0);
36355        val = gen_const_xmlChar_ptr(n_val, 1);
36356
36357        ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val);
36358        desret_const_xmlChar_ptr(ret_val);
36359        call_tests++;
36360        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36361        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1);
36362        xmlResetLastError();
36363        if (mem_base != xmlMemBlocks()) {
36364            printf("Leak of %d blocks found in xmlStrstr",
36365	           xmlMemBlocks() - mem_base);
36366	    test_ret++;
36367            printf(" %d", n_str);
36368            printf(" %d", n_val);
36369            printf("\n");
36370        }
36371    }
36372    }
36373    function_tests++;
36374
36375    return(test_ret);
36376}
36377
36378
36379static int
36380test_xmlStrsub(void) {
36381    int test_ret = 0;
36382
36383    int mem_base;
36384    xmlChar * ret_val;
36385    xmlChar * str; /* the xmlChar * array (haystack) */
36386    int n_str;
36387    int start; /* the index of the first char (zero based) */
36388    int n_start;
36389    int len; /* the length of the substring */
36390    int n_len;
36391
36392    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
36393    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36394    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36395        mem_base = xmlMemBlocks();
36396        str = gen_const_xmlChar_ptr(n_str, 0);
36397        start = gen_int(n_start, 1);
36398        len = gen_int(n_len, 2);
36399
36400        ret_val = xmlStrsub((const xmlChar *)str, start, len);
36401        desret_xmlChar_ptr(ret_val);
36402        call_tests++;
36403        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
36404        des_int(n_start, start, 1);
36405        des_int(n_len, len, 2);
36406        xmlResetLastError();
36407        if (mem_base != xmlMemBlocks()) {
36408            printf("Leak of %d blocks found in xmlStrsub",
36409	           xmlMemBlocks() - mem_base);
36410	    test_ret++;
36411            printf(" %d", n_str);
36412            printf(" %d", n_start);
36413            printf(" %d", n_len);
36414            printf("\n");
36415        }
36416    }
36417    }
36418    }
36419    function_tests++;
36420
36421    return(test_ret);
36422}
36423
36424
36425static int
36426test_xmlUTF8Charcmp(void) {
36427    int test_ret = 0;
36428
36429    int mem_base;
36430    int ret_val;
36431    xmlChar * utf1; /* pointer to first UTF8 char */
36432    int n_utf1;
36433    xmlChar * utf2; /* pointer to second UTF8 char */
36434    int n_utf2;
36435
36436    for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) {
36437    for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) {
36438        mem_base = xmlMemBlocks();
36439        utf1 = gen_const_xmlChar_ptr(n_utf1, 0);
36440        utf2 = gen_const_xmlChar_ptr(n_utf2, 1);
36441
36442        ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2);
36443        desret_int(ret_val);
36444        call_tests++;
36445        des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0);
36446        des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1);
36447        xmlResetLastError();
36448        if (mem_base != xmlMemBlocks()) {
36449            printf("Leak of %d blocks found in xmlUTF8Charcmp",
36450	           xmlMemBlocks() - mem_base);
36451	    test_ret++;
36452            printf(" %d", n_utf1);
36453            printf(" %d", n_utf2);
36454            printf("\n");
36455        }
36456    }
36457    }
36458    function_tests++;
36459
36460    return(test_ret);
36461}
36462
36463
36464static int
36465test_xmlUTF8Size(void) {
36466    int test_ret = 0;
36467
36468    int mem_base;
36469    int ret_val;
36470    xmlChar * utf; /* pointer to the UTF8 character */
36471    int n_utf;
36472
36473    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36474        mem_base = xmlMemBlocks();
36475        utf = gen_const_xmlChar_ptr(n_utf, 0);
36476
36477        ret_val = xmlUTF8Size((const xmlChar *)utf);
36478        desret_int(ret_val);
36479        call_tests++;
36480        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36481        xmlResetLastError();
36482        if (mem_base != xmlMemBlocks()) {
36483            printf("Leak of %d blocks found in xmlUTF8Size",
36484	           xmlMemBlocks() - mem_base);
36485	    test_ret++;
36486            printf(" %d", n_utf);
36487            printf("\n");
36488        }
36489    }
36490    function_tests++;
36491
36492    return(test_ret);
36493}
36494
36495
36496static int
36497test_xmlUTF8Strlen(void) {
36498    int test_ret = 0;
36499
36500    int mem_base;
36501    int ret_val;
36502    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36503    int n_utf;
36504
36505    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36506        mem_base = xmlMemBlocks();
36507        utf = gen_const_xmlChar_ptr(n_utf, 0);
36508
36509        ret_val = xmlUTF8Strlen((const xmlChar *)utf);
36510        desret_int(ret_val);
36511        call_tests++;
36512        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36513        xmlResetLastError();
36514        if (mem_base != xmlMemBlocks()) {
36515            printf("Leak of %d blocks found in xmlUTF8Strlen",
36516	           xmlMemBlocks() - mem_base);
36517	    test_ret++;
36518            printf(" %d", n_utf);
36519            printf("\n");
36520        }
36521    }
36522    function_tests++;
36523
36524    return(test_ret);
36525}
36526
36527
36528static int
36529test_xmlUTF8Strloc(void) {
36530    int test_ret = 0;
36531
36532    int mem_base;
36533    int ret_val;
36534    xmlChar * utf; /* the input UTF8 * */
36535    int n_utf;
36536    xmlChar * utfchar; /* the UTF8 character to be found */
36537    int n_utfchar;
36538
36539    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36540    for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) {
36541        mem_base = xmlMemBlocks();
36542        utf = gen_const_xmlChar_ptr(n_utf, 0);
36543        utfchar = gen_const_xmlChar_ptr(n_utfchar, 1);
36544
36545        ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar);
36546        desret_int(ret_val);
36547        call_tests++;
36548        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36549        des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1);
36550        xmlResetLastError();
36551        if (mem_base != xmlMemBlocks()) {
36552            printf("Leak of %d blocks found in xmlUTF8Strloc",
36553	           xmlMemBlocks() - mem_base);
36554	    test_ret++;
36555            printf(" %d", n_utf);
36556            printf(" %d", n_utfchar);
36557            printf("\n");
36558        }
36559    }
36560    }
36561    function_tests++;
36562
36563    return(test_ret);
36564}
36565
36566
36567static int
36568test_xmlUTF8Strndup(void) {
36569    int test_ret = 0;
36570
36571    int mem_base;
36572    xmlChar * ret_val;
36573    xmlChar * utf; /* the input UTF8 * */
36574    int n_utf;
36575    int len; /* the len of @utf (in chars) */
36576    int n_len;
36577
36578    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36579    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36580        mem_base = xmlMemBlocks();
36581        utf = gen_const_xmlChar_ptr(n_utf, 0);
36582        len = gen_int(n_len, 1);
36583
36584        ret_val = xmlUTF8Strndup((const xmlChar *)utf, len);
36585        desret_xmlChar_ptr(ret_val);
36586        call_tests++;
36587        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36588        des_int(n_len, len, 1);
36589        xmlResetLastError();
36590        if (mem_base != xmlMemBlocks()) {
36591            printf("Leak of %d blocks found in xmlUTF8Strndup",
36592	           xmlMemBlocks() - mem_base);
36593	    test_ret++;
36594            printf(" %d", n_utf);
36595            printf(" %d", n_len);
36596            printf("\n");
36597        }
36598    }
36599    }
36600    function_tests++;
36601
36602    return(test_ret);
36603}
36604
36605
36606static int
36607test_xmlUTF8Strpos(void) {
36608    int test_ret = 0;
36609
36610    int mem_base;
36611    const xmlChar * ret_val;
36612    xmlChar * utf; /* the input UTF8 * */
36613    int n_utf;
36614    int pos; /* the position of the desired UTF8 char (in chars) */
36615    int n_pos;
36616
36617    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36618    for (n_pos = 0;n_pos < gen_nb_int;n_pos++) {
36619        mem_base = xmlMemBlocks();
36620        utf = gen_const_xmlChar_ptr(n_utf, 0);
36621        pos = gen_int(n_pos, 1);
36622
36623        ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos);
36624        desret_const_xmlChar_ptr(ret_val);
36625        call_tests++;
36626        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36627        des_int(n_pos, pos, 1);
36628        xmlResetLastError();
36629        if (mem_base != xmlMemBlocks()) {
36630            printf("Leak of %d blocks found in xmlUTF8Strpos",
36631	           xmlMemBlocks() - mem_base);
36632	    test_ret++;
36633            printf(" %d", n_utf);
36634            printf(" %d", n_pos);
36635            printf("\n");
36636        }
36637    }
36638    }
36639    function_tests++;
36640
36641    return(test_ret);
36642}
36643
36644
36645static int
36646test_xmlUTF8Strsize(void) {
36647    int test_ret = 0;
36648
36649    int mem_base;
36650    int ret_val;
36651    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36652    int n_utf;
36653    int len; /* the number of characters in the array */
36654    int n_len;
36655
36656    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36657    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36658        mem_base = xmlMemBlocks();
36659        utf = gen_const_xmlChar_ptr(n_utf, 0);
36660        len = gen_int(n_len, 1);
36661
36662        ret_val = xmlUTF8Strsize((const xmlChar *)utf, len);
36663        desret_int(ret_val);
36664        call_tests++;
36665        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36666        des_int(n_len, len, 1);
36667        xmlResetLastError();
36668        if (mem_base != xmlMemBlocks()) {
36669            printf("Leak of %d blocks found in xmlUTF8Strsize",
36670	           xmlMemBlocks() - mem_base);
36671	    test_ret++;
36672            printf(" %d", n_utf);
36673            printf(" %d", n_len);
36674            printf("\n");
36675        }
36676    }
36677    }
36678    function_tests++;
36679
36680    return(test_ret);
36681}
36682
36683
36684static int
36685test_xmlUTF8Strsub(void) {
36686    int test_ret = 0;
36687
36688    int mem_base;
36689    xmlChar * ret_val;
36690    xmlChar * utf; /* a sequence of UTF-8 encoded bytes */
36691    int n_utf;
36692    int start; /* relative pos of first char */
36693    int n_start;
36694    int len; /* total number to copy */
36695    int n_len;
36696
36697    for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) {
36698    for (n_start = 0;n_start < gen_nb_int;n_start++) {
36699    for (n_len = 0;n_len < gen_nb_int;n_len++) {
36700        mem_base = xmlMemBlocks();
36701        utf = gen_const_xmlChar_ptr(n_utf, 0);
36702        start = gen_int(n_start, 1);
36703        len = gen_int(n_len, 2);
36704
36705        ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len);
36706        desret_xmlChar_ptr(ret_val);
36707        call_tests++;
36708        des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0);
36709        des_int(n_start, start, 1);
36710        des_int(n_len, len, 2);
36711        xmlResetLastError();
36712        if (mem_base != xmlMemBlocks()) {
36713            printf("Leak of %d blocks found in xmlUTF8Strsub",
36714	           xmlMemBlocks() - mem_base);
36715	    test_ret++;
36716            printf(" %d", n_utf);
36717            printf(" %d", n_start);
36718            printf(" %d", n_len);
36719            printf("\n");
36720        }
36721    }
36722    }
36723    }
36724    function_tests++;
36725
36726    return(test_ret);
36727}
36728
36729static int
36730test_xmlstring(void) {
36731    int test_ret = 0;
36732
36733    if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n");
36734    test_ret += test_xmlCharStrdup();
36735    test_ret += test_xmlCharStrndup();
36736    test_ret += test_xmlCheckUTF8();
36737    test_ret += test_xmlGetUTF8Char();
36738    test_ret += test_xmlStrEqual();
36739    test_ret += test_xmlStrPrintf();
36740    test_ret += test_xmlStrQEqual();
36741    test_ret += test_xmlStrVPrintf();
36742    test_ret += test_xmlStrcasecmp();
36743    test_ret += test_xmlStrcasestr();
36744    test_ret += test_xmlStrchr();
36745    test_ret += test_xmlStrcmp();
36746    test_ret += test_xmlStrdup();
36747    test_ret += test_xmlStrlen();
36748    test_ret += test_xmlStrncasecmp();
36749    test_ret += test_xmlStrncatNew();
36750    test_ret += test_xmlStrncmp();
36751    test_ret += test_xmlStrndup();
36752    test_ret += test_xmlStrstr();
36753    test_ret += test_xmlStrsub();
36754    test_ret += test_xmlUTF8Charcmp();
36755    test_ret += test_xmlUTF8Size();
36756    test_ret += test_xmlUTF8Strlen();
36757    test_ret += test_xmlUTF8Strloc();
36758    test_ret += test_xmlUTF8Strndup();
36759    test_ret += test_xmlUTF8Strpos();
36760    test_ret += test_xmlUTF8Strsize();
36761    test_ret += test_xmlUTF8Strsub();
36762
36763    if (test_ret != 0)
36764	printf("Module xmlstring: %d errors\n", test_ret);
36765    return(test_ret);
36766}
36767
36768static int
36769test_xmlUCSIsAegeanNumbers(void) {
36770    int test_ret = 0;
36771
36772#if defined(LIBXML_UNICODE_ENABLED)
36773    int mem_base;
36774    int ret_val;
36775    int code; /* UCS code point */
36776    int n_code;
36777
36778    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36779        mem_base = xmlMemBlocks();
36780        code = gen_int(n_code, 0);
36781
36782        ret_val = xmlUCSIsAegeanNumbers(code);
36783        desret_int(ret_val);
36784        call_tests++;
36785        des_int(n_code, code, 0);
36786        xmlResetLastError();
36787        if (mem_base != xmlMemBlocks()) {
36788            printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers",
36789	           xmlMemBlocks() - mem_base);
36790	    test_ret++;
36791            printf(" %d", n_code);
36792            printf("\n");
36793        }
36794    }
36795    function_tests++;
36796#endif
36797
36798    return(test_ret);
36799}
36800
36801
36802static int
36803test_xmlUCSIsAlphabeticPresentationForms(void) {
36804    int test_ret = 0;
36805
36806#if defined(LIBXML_UNICODE_ENABLED)
36807    int mem_base;
36808    int ret_val;
36809    int code; /* UCS code point */
36810    int n_code;
36811
36812    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36813        mem_base = xmlMemBlocks();
36814        code = gen_int(n_code, 0);
36815
36816        ret_val = xmlUCSIsAlphabeticPresentationForms(code);
36817        desret_int(ret_val);
36818        call_tests++;
36819        des_int(n_code, code, 0);
36820        xmlResetLastError();
36821        if (mem_base != xmlMemBlocks()) {
36822            printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms",
36823	           xmlMemBlocks() - mem_base);
36824	    test_ret++;
36825            printf(" %d", n_code);
36826            printf("\n");
36827        }
36828    }
36829    function_tests++;
36830#endif
36831
36832    return(test_ret);
36833}
36834
36835
36836static int
36837test_xmlUCSIsArabic(void) {
36838    int test_ret = 0;
36839
36840#if defined(LIBXML_UNICODE_ENABLED)
36841    int mem_base;
36842    int ret_val;
36843    int code; /* UCS code point */
36844    int n_code;
36845
36846    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36847        mem_base = xmlMemBlocks();
36848        code = gen_int(n_code, 0);
36849
36850        ret_val = xmlUCSIsArabic(code);
36851        desret_int(ret_val);
36852        call_tests++;
36853        des_int(n_code, code, 0);
36854        xmlResetLastError();
36855        if (mem_base != xmlMemBlocks()) {
36856            printf("Leak of %d blocks found in xmlUCSIsArabic",
36857	           xmlMemBlocks() - mem_base);
36858	    test_ret++;
36859            printf(" %d", n_code);
36860            printf("\n");
36861        }
36862    }
36863    function_tests++;
36864#endif
36865
36866    return(test_ret);
36867}
36868
36869
36870static int
36871test_xmlUCSIsArabicPresentationFormsA(void) {
36872    int test_ret = 0;
36873
36874#if defined(LIBXML_UNICODE_ENABLED)
36875    int mem_base;
36876    int ret_val;
36877    int code; /* UCS code point */
36878    int n_code;
36879
36880    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36881        mem_base = xmlMemBlocks();
36882        code = gen_int(n_code, 0);
36883
36884        ret_val = xmlUCSIsArabicPresentationFormsA(code);
36885        desret_int(ret_val);
36886        call_tests++;
36887        des_int(n_code, code, 0);
36888        xmlResetLastError();
36889        if (mem_base != xmlMemBlocks()) {
36890            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA",
36891	           xmlMemBlocks() - mem_base);
36892	    test_ret++;
36893            printf(" %d", n_code);
36894            printf("\n");
36895        }
36896    }
36897    function_tests++;
36898#endif
36899
36900    return(test_ret);
36901}
36902
36903
36904static int
36905test_xmlUCSIsArabicPresentationFormsB(void) {
36906    int test_ret = 0;
36907
36908#if defined(LIBXML_UNICODE_ENABLED)
36909    int mem_base;
36910    int ret_val;
36911    int code; /* UCS code point */
36912    int n_code;
36913
36914    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36915        mem_base = xmlMemBlocks();
36916        code = gen_int(n_code, 0);
36917
36918        ret_val = xmlUCSIsArabicPresentationFormsB(code);
36919        desret_int(ret_val);
36920        call_tests++;
36921        des_int(n_code, code, 0);
36922        xmlResetLastError();
36923        if (mem_base != xmlMemBlocks()) {
36924            printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB",
36925	           xmlMemBlocks() - mem_base);
36926	    test_ret++;
36927            printf(" %d", n_code);
36928            printf("\n");
36929        }
36930    }
36931    function_tests++;
36932#endif
36933
36934    return(test_ret);
36935}
36936
36937
36938static int
36939test_xmlUCSIsArmenian(void) {
36940    int test_ret = 0;
36941
36942#if defined(LIBXML_UNICODE_ENABLED)
36943    int mem_base;
36944    int ret_val;
36945    int code; /* UCS code point */
36946    int n_code;
36947
36948    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36949        mem_base = xmlMemBlocks();
36950        code = gen_int(n_code, 0);
36951
36952        ret_val = xmlUCSIsArmenian(code);
36953        desret_int(ret_val);
36954        call_tests++;
36955        des_int(n_code, code, 0);
36956        xmlResetLastError();
36957        if (mem_base != xmlMemBlocks()) {
36958            printf("Leak of %d blocks found in xmlUCSIsArmenian",
36959	           xmlMemBlocks() - mem_base);
36960	    test_ret++;
36961            printf(" %d", n_code);
36962            printf("\n");
36963        }
36964    }
36965    function_tests++;
36966#endif
36967
36968    return(test_ret);
36969}
36970
36971
36972static int
36973test_xmlUCSIsArrows(void) {
36974    int test_ret = 0;
36975
36976#if defined(LIBXML_UNICODE_ENABLED)
36977    int mem_base;
36978    int ret_val;
36979    int code; /* UCS code point */
36980    int n_code;
36981
36982    for (n_code = 0;n_code < gen_nb_int;n_code++) {
36983        mem_base = xmlMemBlocks();
36984        code = gen_int(n_code, 0);
36985
36986        ret_val = xmlUCSIsArrows(code);
36987        desret_int(ret_val);
36988        call_tests++;
36989        des_int(n_code, code, 0);
36990        xmlResetLastError();
36991        if (mem_base != xmlMemBlocks()) {
36992            printf("Leak of %d blocks found in xmlUCSIsArrows",
36993	           xmlMemBlocks() - mem_base);
36994	    test_ret++;
36995            printf(" %d", n_code);
36996            printf("\n");
36997        }
36998    }
36999    function_tests++;
37000#endif
37001
37002    return(test_ret);
37003}
37004
37005
37006static int
37007test_xmlUCSIsBasicLatin(void) {
37008    int test_ret = 0;
37009
37010#if defined(LIBXML_UNICODE_ENABLED)
37011    int mem_base;
37012    int ret_val;
37013    int code; /* UCS code point */
37014    int n_code;
37015
37016    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37017        mem_base = xmlMemBlocks();
37018        code = gen_int(n_code, 0);
37019
37020        ret_val = xmlUCSIsBasicLatin(code);
37021        desret_int(ret_val);
37022        call_tests++;
37023        des_int(n_code, code, 0);
37024        xmlResetLastError();
37025        if (mem_base != xmlMemBlocks()) {
37026            printf("Leak of %d blocks found in xmlUCSIsBasicLatin",
37027	           xmlMemBlocks() - mem_base);
37028	    test_ret++;
37029            printf(" %d", n_code);
37030            printf("\n");
37031        }
37032    }
37033    function_tests++;
37034#endif
37035
37036    return(test_ret);
37037}
37038
37039
37040static int
37041test_xmlUCSIsBengali(void) {
37042    int test_ret = 0;
37043
37044#if defined(LIBXML_UNICODE_ENABLED)
37045    int mem_base;
37046    int ret_val;
37047    int code; /* UCS code point */
37048    int n_code;
37049
37050    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37051        mem_base = xmlMemBlocks();
37052        code = gen_int(n_code, 0);
37053
37054        ret_val = xmlUCSIsBengali(code);
37055        desret_int(ret_val);
37056        call_tests++;
37057        des_int(n_code, code, 0);
37058        xmlResetLastError();
37059        if (mem_base != xmlMemBlocks()) {
37060            printf("Leak of %d blocks found in xmlUCSIsBengali",
37061	           xmlMemBlocks() - mem_base);
37062	    test_ret++;
37063            printf(" %d", n_code);
37064            printf("\n");
37065        }
37066    }
37067    function_tests++;
37068#endif
37069
37070    return(test_ret);
37071}
37072
37073
37074static int
37075test_xmlUCSIsBlock(void) {
37076    int test_ret = 0;
37077
37078#if defined(LIBXML_UNICODE_ENABLED)
37079    int mem_base;
37080    int ret_val;
37081    int code; /* UCS code point */
37082    int n_code;
37083    char * block; /* UCS block name */
37084    int n_block;
37085
37086    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37087    for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) {
37088        mem_base = xmlMemBlocks();
37089        code = gen_int(n_code, 0);
37090        block = gen_const_char_ptr(n_block, 1);
37091
37092        ret_val = xmlUCSIsBlock(code, (const char *)block);
37093        desret_int(ret_val);
37094        call_tests++;
37095        des_int(n_code, code, 0);
37096        des_const_char_ptr(n_block, (const char *)block, 1);
37097        xmlResetLastError();
37098        if (mem_base != xmlMemBlocks()) {
37099            printf("Leak of %d blocks found in xmlUCSIsBlock",
37100	           xmlMemBlocks() - mem_base);
37101	    test_ret++;
37102            printf(" %d", n_code);
37103            printf(" %d", n_block);
37104            printf("\n");
37105        }
37106    }
37107    }
37108    function_tests++;
37109#endif
37110
37111    return(test_ret);
37112}
37113
37114
37115static int
37116test_xmlUCSIsBlockElements(void) {
37117    int test_ret = 0;
37118
37119#if defined(LIBXML_UNICODE_ENABLED)
37120    int mem_base;
37121    int ret_val;
37122    int code; /* UCS code point */
37123    int n_code;
37124
37125    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37126        mem_base = xmlMemBlocks();
37127        code = gen_int(n_code, 0);
37128
37129        ret_val = xmlUCSIsBlockElements(code);
37130        desret_int(ret_val);
37131        call_tests++;
37132        des_int(n_code, code, 0);
37133        xmlResetLastError();
37134        if (mem_base != xmlMemBlocks()) {
37135            printf("Leak of %d blocks found in xmlUCSIsBlockElements",
37136	           xmlMemBlocks() - mem_base);
37137	    test_ret++;
37138            printf(" %d", n_code);
37139            printf("\n");
37140        }
37141    }
37142    function_tests++;
37143#endif
37144
37145    return(test_ret);
37146}
37147
37148
37149static int
37150test_xmlUCSIsBopomofo(void) {
37151    int test_ret = 0;
37152
37153#if defined(LIBXML_UNICODE_ENABLED)
37154    int mem_base;
37155    int ret_val;
37156    int code; /* UCS code point */
37157    int n_code;
37158
37159    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37160        mem_base = xmlMemBlocks();
37161        code = gen_int(n_code, 0);
37162
37163        ret_val = xmlUCSIsBopomofo(code);
37164        desret_int(ret_val);
37165        call_tests++;
37166        des_int(n_code, code, 0);
37167        xmlResetLastError();
37168        if (mem_base != xmlMemBlocks()) {
37169            printf("Leak of %d blocks found in xmlUCSIsBopomofo",
37170	           xmlMemBlocks() - mem_base);
37171	    test_ret++;
37172            printf(" %d", n_code);
37173            printf("\n");
37174        }
37175    }
37176    function_tests++;
37177#endif
37178
37179    return(test_ret);
37180}
37181
37182
37183static int
37184test_xmlUCSIsBopomofoExtended(void) {
37185    int test_ret = 0;
37186
37187#if defined(LIBXML_UNICODE_ENABLED)
37188    int mem_base;
37189    int ret_val;
37190    int code; /* UCS code point */
37191    int n_code;
37192
37193    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37194        mem_base = xmlMemBlocks();
37195        code = gen_int(n_code, 0);
37196
37197        ret_val = xmlUCSIsBopomofoExtended(code);
37198        desret_int(ret_val);
37199        call_tests++;
37200        des_int(n_code, code, 0);
37201        xmlResetLastError();
37202        if (mem_base != xmlMemBlocks()) {
37203            printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended",
37204	           xmlMemBlocks() - mem_base);
37205	    test_ret++;
37206            printf(" %d", n_code);
37207            printf("\n");
37208        }
37209    }
37210    function_tests++;
37211#endif
37212
37213    return(test_ret);
37214}
37215
37216
37217static int
37218test_xmlUCSIsBoxDrawing(void) {
37219    int test_ret = 0;
37220
37221#if defined(LIBXML_UNICODE_ENABLED)
37222    int mem_base;
37223    int ret_val;
37224    int code; /* UCS code point */
37225    int n_code;
37226
37227    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37228        mem_base = xmlMemBlocks();
37229        code = gen_int(n_code, 0);
37230
37231        ret_val = xmlUCSIsBoxDrawing(code);
37232        desret_int(ret_val);
37233        call_tests++;
37234        des_int(n_code, code, 0);
37235        xmlResetLastError();
37236        if (mem_base != xmlMemBlocks()) {
37237            printf("Leak of %d blocks found in xmlUCSIsBoxDrawing",
37238	           xmlMemBlocks() - mem_base);
37239	    test_ret++;
37240            printf(" %d", n_code);
37241            printf("\n");
37242        }
37243    }
37244    function_tests++;
37245#endif
37246
37247    return(test_ret);
37248}
37249
37250
37251static int
37252test_xmlUCSIsBraillePatterns(void) {
37253    int test_ret = 0;
37254
37255#if defined(LIBXML_UNICODE_ENABLED)
37256    int mem_base;
37257    int ret_val;
37258    int code; /* UCS code point */
37259    int n_code;
37260
37261    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37262        mem_base = xmlMemBlocks();
37263        code = gen_int(n_code, 0);
37264
37265        ret_val = xmlUCSIsBraillePatterns(code);
37266        desret_int(ret_val);
37267        call_tests++;
37268        des_int(n_code, code, 0);
37269        xmlResetLastError();
37270        if (mem_base != xmlMemBlocks()) {
37271            printf("Leak of %d blocks found in xmlUCSIsBraillePatterns",
37272	           xmlMemBlocks() - mem_base);
37273	    test_ret++;
37274            printf(" %d", n_code);
37275            printf("\n");
37276        }
37277    }
37278    function_tests++;
37279#endif
37280
37281    return(test_ret);
37282}
37283
37284
37285static int
37286test_xmlUCSIsBuhid(void) {
37287    int test_ret = 0;
37288
37289#if defined(LIBXML_UNICODE_ENABLED)
37290    int mem_base;
37291    int ret_val;
37292    int code; /* UCS code point */
37293    int n_code;
37294
37295    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37296        mem_base = xmlMemBlocks();
37297        code = gen_int(n_code, 0);
37298
37299        ret_val = xmlUCSIsBuhid(code);
37300        desret_int(ret_val);
37301        call_tests++;
37302        des_int(n_code, code, 0);
37303        xmlResetLastError();
37304        if (mem_base != xmlMemBlocks()) {
37305            printf("Leak of %d blocks found in xmlUCSIsBuhid",
37306	           xmlMemBlocks() - mem_base);
37307	    test_ret++;
37308            printf(" %d", n_code);
37309            printf("\n");
37310        }
37311    }
37312    function_tests++;
37313#endif
37314
37315    return(test_ret);
37316}
37317
37318
37319static int
37320test_xmlUCSIsByzantineMusicalSymbols(void) {
37321    int test_ret = 0;
37322
37323#if defined(LIBXML_UNICODE_ENABLED)
37324    int mem_base;
37325    int ret_val;
37326    int code; /* UCS code point */
37327    int n_code;
37328
37329    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37330        mem_base = xmlMemBlocks();
37331        code = gen_int(n_code, 0);
37332
37333        ret_val = xmlUCSIsByzantineMusicalSymbols(code);
37334        desret_int(ret_val);
37335        call_tests++;
37336        des_int(n_code, code, 0);
37337        xmlResetLastError();
37338        if (mem_base != xmlMemBlocks()) {
37339            printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols",
37340	           xmlMemBlocks() - mem_base);
37341	    test_ret++;
37342            printf(" %d", n_code);
37343            printf("\n");
37344        }
37345    }
37346    function_tests++;
37347#endif
37348
37349    return(test_ret);
37350}
37351
37352
37353static int
37354test_xmlUCSIsCJKCompatibility(void) {
37355    int test_ret = 0;
37356
37357#if defined(LIBXML_UNICODE_ENABLED)
37358    int mem_base;
37359    int ret_val;
37360    int code; /* UCS code point */
37361    int n_code;
37362
37363    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37364        mem_base = xmlMemBlocks();
37365        code = gen_int(n_code, 0);
37366
37367        ret_val = xmlUCSIsCJKCompatibility(code);
37368        desret_int(ret_val);
37369        call_tests++;
37370        des_int(n_code, code, 0);
37371        xmlResetLastError();
37372        if (mem_base != xmlMemBlocks()) {
37373            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility",
37374	           xmlMemBlocks() - mem_base);
37375	    test_ret++;
37376            printf(" %d", n_code);
37377            printf("\n");
37378        }
37379    }
37380    function_tests++;
37381#endif
37382
37383    return(test_ret);
37384}
37385
37386
37387static int
37388test_xmlUCSIsCJKCompatibilityForms(void) {
37389    int test_ret = 0;
37390
37391#if defined(LIBXML_UNICODE_ENABLED)
37392    int mem_base;
37393    int ret_val;
37394    int code; /* UCS code point */
37395    int n_code;
37396
37397    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37398        mem_base = xmlMemBlocks();
37399        code = gen_int(n_code, 0);
37400
37401        ret_val = xmlUCSIsCJKCompatibilityForms(code);
37402        desret_int(ret_val);
37403        call_tests++;
37404        des_int(n_code, code, 0);
37405        xmlResetLastError();
37406        if (mem_base != xmlMemBlocks()) {
37407            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms",
37408	           xmlMemBlocks() - mem_base);
37409	    test_ret++;
37410            printf(" %d", n_code);
37411            printf("\n");
37412        }
37413    }
37414    function_tests++;
37415#endif
37416
37417    return(test_ret);
37418}
37419
37420
37421static int
37422test_xmlUCSIsCJKCompatibilityIdeographs(void) {
37423    int test_ret = 0;
37424
37425#if defined(LIBXML_UNICODE_ENABLED)
37426    int mem_base;
37427    int ret_val;
37428    int code; /* UCS code point */
37429    int n_code;
37430
37431    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37432        mem_base = xmlMemBlocks();
37433        code = gen_int(n_code, 0);
37434
37435        ret_val = xmlUCSIsCJKCompatibilityIdeographs(code);
37436        desret_int(ret_val);
37437        call_tests++;
37438        des_int(n_code, code, 0);
37439        xmlResetLastError();
37440        if (mem_base != xmlMemBlocks()) {
37441            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs",
37442	           xmlMemBlocks() - mem_base);
37443	    test_ret++;
37444            printf(" %d", n_code);
37445            printf("\n");
37446        }
37447    }
37448    function_tests++;
37449#endif
37450
37451    return(test_ret);
37452}
37453
37454
37455static int
37456test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) {
37457    int test_ret = 0;
37458
37459#if defined(LIBXML_UNICODE_ENABLED)
37460    int mem_base;
37461    int ret_val;
37462    int code; /* UCS code point */
37463    int n_code;
37464
37465    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37466        mem_base = xmlMemBlocks();
37467        code = gen_int(n_code, 0);
37468
37469        ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code);
37470        desret_int(ret_val);
37471        call_tests++;
37472        des_int(n_code, code, 0);
37473        xmlResetLastError();
37474        if (mem_base != xmlMemBlocks()) {
37475            printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement",
37476	           xmlMemBlocks() - mem_base);
37477	    test_ret++;
37478            printf(" %d", n_code);
37479            printf("\n");
37480        }
37481    }
37482    function_tests++;
37483#endif
37484
37485    return(test_ret);
37486}
37487
37488
37489static int
37490test_xmlUCSIsCJKRadicalsSupplement(void) {
37491    int test_ret = 0;
37492
37493#if defined(LIBXML_UNICODE_ENABLED)
37494    int mem_base;
37495    int ret_val;
37496    int code; /* UCS code point */
37497    int n_code;
37498
37499    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37500        mem_base = xmlMemBlocks();
37501        code = gen_int(n_code, 0);
37502
37503        ret_val = xmlUCSIsCJKRadicalsSupplement(code);
37504        desret_int(ret_val);
37505        call_tests++;
37506        des_int(n_code, code, 0);
37507        xmlResetLastError();
37508        if (mem_base != xmlMemBlocks()) {
37509            printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement",
37510	           xmlMemBlocks() - mem_base);
37511	    test_ret++;
37512            printf(" %d", n_code);
37513            printf("\n");
37514        }
37515    }
37516    function_tests++;
37517#endif
37518
37519    return(test_ret);
37520}
37521
37522
37523static int
37524test_xmlUCSIsCJKSymbolsandPunctuation(void) {
37525    int test_ret = 0;
37526
37527#if defined(LIBXML_UNICODE_ENABLED)
37528    int mem_base;
37529    int ret_val;
37530    int code; /* UCS code point */
37531    int n_code;
37532
37533    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37534        mem_base = xmlMemBlocks();
37535        code = gen_int(n_code, 0);
37536
37537        ret_val = xmlUCSIsCJKSymbolsandPunctuation(code);
37538        desret_int(ret_val);
37539        call_tests++;
37540        des_int(n_code, code, 0);
37541        xmlResetLastError();
37542        if (mem_base != xmlMemBlocks()) {
37543            printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation",
37544	           xmlMemBlocks() - mem_base);
37545	    test_ret++;
37546            printf(" %d", n_code);
37547            printf("\n");
37548        }
37549    }
37550    function_tests++;
37551#endif
37552
37553    return(test_ret);
37554}
37555
37556
37557static int
37558test_xmlUCSIsCJKUnifiedIdeographs(void) {
37559    int test_ret = 0;
37560
37561#if defined(LIBXML_UNICODE_ENABLED)
37562    int mem_base;
37563    int ret_val;
37564    int code; /* UCS code point */
37565    int n_code;
37566
37567    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37568        mem_base = xmlMemBlocks();
37569        code = gen_int(n_code, 0);
37570
37571        ret_val = xmlUCSIsCJKUnifiedIdeographs(code);
37572        desret_int(ret_val);
37573        call_tests++;
37574        des_int(n_code, code, 0);
37575        xmlResetLastError();
37576        if (mem_base != xmlMemBlocks()) {
37577            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs",
37578	           xmlMemBlocks() - mem_base);
37579	    test_ret++;
37580            printf(" %d", n_code);
37581            printf("\n");
37582        }
37583    }
37584    function_tests++;
37585#endif
37586
37587    return(test_ret);
37588}
37589
37590
37591static int
37592test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) {
37593    int test_ret = 0;
37594
37595#if defined(LIBXML_UNICODE_ENABLED)
37596    int mem_base;
37597    int ret_val;
37598    int code; /* UCS code point */
37599    int n_code;
37600
37601    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37602        mem_base = xmlMemBlocks();
37603        code = gen_int(n_code, 0);
37604
37605        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code);
37606        desret_int(ret_val);
37607        call_tests++;
37608        des_int(n_code, code, 0);
37609        xmlResetLastError();
37610        if (mem_base != xmlMemBlocks()) {
37611            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA",
37612	           xmlMemBlocks() - mem_base);
37613	    test_ret++;
37614            printf(" %d", n_code);
37615            printf("\n");
37616        }
37617    }
37618    function_tests++;
37619#endif
37620
37621    return(test_ret);
37622}
37623
37624
37625static int
37626test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) {
37627    int test_ret = 0;
37628
37629#if defined(LIBXML_UNICODE_ENABLED)
37630    int mem_base;
37631    int ret_val;
37632    int code; /* UCS code point */
37633    int n_code;
37634
37635    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37636        mem_base = xmlMemBlocks();
37637        code = gen_int(n_code, 0);
37638
37639        ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code);
37640        desret_int(ret_val);
37641        call_tests++;
37642        des_int(n_code, code, 0);
37643        xmlResetLastError();
37644        if (mem_base != xmlMemBlocks()) {
37645            printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB",
37646	           xmlMemBlocks() - mem_base);
37647	    test_ret++;
37648            printf(" %d", n_code);
37649            printf("\n");
37650        }
37651    }
37652    function_tests++;
37653#endif
37654
37655    return(test_ret);
37656}
37657
37658
37659static int
37660test_xmlUCSIsCat(void) {
37661    int test_ret = 0;
37662
37663#if defined(LIBXML_UNICODE_ENABLED)
37664    int mem_base;
37665    int ret_val;
37666    int code; /* UCS code point */
37667    int n_code;
37668    char * cat; /* UCS Category name */
37669    int n_cat;
37670
37671    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37672    for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) {
37673        mem_base = xmlMemBlocks();
37674        code = gen_int(n_code, 0);
37675        cat = gen_const_char_ptr(n_cat, 1);
37676
37677        ret_val = xmlUCSIsCat(code, (const char *)cat);
37678        desret_int(ret_val);
37679        call_tests++;
37680        des_int(n_code, code, 0);
37681        des_const_char_ptr(n_cat, (const char *)cat, 1);
37682        xmlResetLastError();
37683        if (mem_base != xmlMemBlocks()) {
37684            printf("Leak of %d blocks found in xmlUCSIsCat",
37685	           xmlMemBlocks() - mem_base);
37686	    test_ret++;
37687            printf(" %d", n_code);
37688            printf(" %d", n_cat);
37689            printf("\n");
37690        }
37691    }
37692    }
37693    function_tests++;
37694#endif
37695
37696    return(test_ret);
37697}
37698
37699
37700static int
37701test_xmlUCSIsCatC(void) {
37702    int test_ret = 0;
37703
37704#if defined(LIBXML_UNICODE_ENABLED)
37705    int mem_base;
37706    int ret_val;
37707    int code; /* UCS code point */
37708    int n_code;
37709
37710    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37711        mem_base = xmlMemBlocks();
37712        code = gen_int(n_code, 0);
37713
37714        ret_val = xmlUCSIsCatC(code);
37715        desret_int(ret_val);
37716        call_tests++;
37717        des_int(n_code, code, 0);
37718        xmlResetLastError();
37719        if (mem_base != xmlMemBlocks()) {
37720            printf("Leak of %d blocks found in xmlUCSIsCatC",
37721	           xmlMemBlocks() - mem_base);
37722	    test_ret++;
37723            printf(" %d", n_code);
37724            printf("\n");
37725        }
37726    }
37727    function_tests++;
37728#endif
37729
37730    return(test_ret);
37731}
37732
37733
37734static int
37735test_xmlUCSIsCatCc(void) {
37736    int test_ret = 0;
37737
37738#if defined(LIBXML_UNICODE_ENABLED)
37739    int mem_base;
37740    int ret_val;
37741    int code; /* UCS code point */
37742    int n_code;
37743
37744    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37745        mem_base = xmlMemBlocks();
37746        code = gen_int(n_code, 0);
37747
37748        ret_val = xmlUCSIsCatCc(code);
37749        desret_int(ret_val);
37750        call_tests++;
37751        des_int(n_code, code, 0);
37752        xmlResetLastError();
37753        if (mem_base != xmlMemBlocks()) {
37754            printf("Leak of %d blocks found in xmlUCSIsCatCc",
37755	           xmlMemBlocks() - mem_base);
37756	    test_ret++;
37757            printf(" %d", n_code);
37758            printf("\n");
37759        }
37760    }
37761    function_tests++;
37762#endif
37763
37764    return(test_ret);
37765}
37766
37767
37768static int
37769test_xmlUCSIsCatCf(void) {
37770    int test_ret = 0;
37771
37772#if defined(LIBXML_UNICODE_ENABLED)
37773    int mem_base;
37774    int ret_val;
37775    int code; /* UCS code point */
37776    int n_code;
37777
37778    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37779        mem_base = xmlMemBlocks();
37780        code = gen_int(n_code, 0);
37781
37782        ret_val = xmlUCSIsCatCf(code);
37783        desret_int(ret_val);
37784        call_tests++;
37785        des_int(n_code, code, 0);
37786        xmlResetLastError();
37787        if (mem_base != xmlMemBlocks()) {
37788            printf("Leak of %d blocks found in xmlUCSIsCatCf",
37789	           xmlMemBlocks() - mem_base);
37790	    test_ret++;
37791            printf(" %d", n_code);
37792            printf("\n");
37793        }
37794    }
37795    function_tests++;
37796#endif
37797
37798    return(test_ret);
37799}
37800
37801
37802static int
37803test_xmlUCSIsCatCo(void) {
37804    int test_ret = 0;
37805
37806#if defined(LIBXML_UNICODE_ENABLED)
37807    int mem_base;
37808    int ret_val;
37809    int code; /* UCS code point */
37810    int n_code;
37811
37812    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37813        mem_base = xmlMemBlocks();
37814        code = gen_int(n_code, 0);
37815
37816        ret_val = xmlUCSIsCatCo(code);
37817        desret_int(ret_val);
37818        call_tests++;
37819        des_int(n_code, code, 0);
37820        xmlResetLastError();
37821        if (mem_base != xmlMemBlocks()) {
37822            printf("Leak of %d blocks found in xmlUCSIsCatCo",
37823	           xmlMemBlocks() - mem_base);
37824	    test_ret++;
37825            printf(" %d", n_code);
37826            printf("\n");
37827        }
37828    }
37829    function_tests++;
37830#endif
37831
37832    return(test_ret);
37833}
37834
37835
37836static int
37837test_xmlUCSIsCatCs(void) {
37838    int test_ret = 0;
37839
37840#if defined(LIBXML_UNICODE_ENABLED)
37841    int mem_base;
37842    int ret_val;
37843    int code; /* UCS code point */
37844    int n_code;
37845
37846    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37847        mem_base = xmlMemBlocks();
37848        code = gen_int(n_code, 0);
37849
37850        ret_val = xmlUCSIsCatCs(code);
37851        desret_int(ret_val);
37852        call_tests++;
37853        des_int(n_code, code, 0);
37854        xmlResetLastError();
37855        if (mem_base != xmlMemBlocks()) {
37856            printf("Leak of %d blocks found in xmlUCSIsCatCs",
37857	           xmlMemBlocks() - mem_base);
37858	    test_ret++;
37859            printf(" %d", n_code);
37860            printf("\n");
37861        }
37862    }
37863    function_tests++;
37864#endif
37865
37866    return(test_ret);
37867}
37868
37869
37870static int
37871test_xmlUCSIsCatL(void) {
37872    int test_ret = 0;
37873
37874#if defined(LIBXML_UNICODE_ENABLED)
37875    int mem_base;
37876    int ret_val;
37877    int code; /* UCS code point */
37878    int n_code;
37879
37880    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37881        mem_base = xmlMemBlocks();
37882        code = gen_int(n_code, 0);
37883
37884        ret_val = xmlUCSIsCatL(code);
37885        desret_int(ret_val);
37886        call_tests++;
37887        des_int(n_code, code, 0);
37888        xmlResetLastError();
37889        if (mem_base != xmlMemBlocks()) {
37890            printf("Leak of %d blocks found in xmlUCSIsCatL",
37891	           xmlMemBlocks() - mem_base);
37892	    test_ret++;
37893            printf(" %d", n_code);
37894            printf("\n");
37895        }
37896    }
37897    function_tests++;
37898#endif
37899
37900    return(test_ret);
37901}
37902
37903
37904static int
37905test_xmlUCSIsCatLl(void) {
37906    int test_ret = 0;
37907
37908#if defined(LIBXML_UNICODE_ENABLED)
37909    int mem_base;
37910    int ret_val;
37911    int code; /* UCS code point */
37912    int n_code;
37913
37914    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37915        mem_base = xmlMemBlocks();
37916        code = gen_int(n_code, 0);
37917
37918        ret_val = xmlUCSIsCatLl(code);
37919        desret_int(ret_val);
37920        call_tests++;
37921        des_int(n_code, code, 0);
37922        xmlResetLastError();
37923        if (mem_base != xmlMemBlocks()) {
37924            printf("Leak of %d blocks found in xmlUCSIsCatLl",
37925	           xmlMemBlocks() - mem_base);
37926	    test_ret++;
37927            printf(" %d", n_code);
37928            printf("\n");
37929        }
37930    }
37931    function_tests++;
37932#endif
37933
37934    return(test_ret);
37935}
37936
37937
37938static int
37939test_xmlUCSIsCatLm(void) {
37940    int test_ret = 0;
37941
37942#if defined(LIBXML_UNICODE_ENABLED)
37943    int mem_base;
37944    int ret_val;
37945    int code; /* UCS code point */
37946    int n_code;
37947
37948    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37949        mem_base = xmlMemBlocks();
37950        code = gen_int(n_code, 0);
37951
37952        ret_val = xmlUCSIsCatLm(code);
37953        desret_int(ret_val);
37954        call_tests++;
37955        des_int(n_code, code, 0);
37956        xmlResetLastError();
37957        if (mem_base != xmlMemBlocks()) {
37958            printf("Leak of %d blocks found in xmlUCSIsCatLm",
37959	           xmlMemBlocks() - mem_base);
37960	    test_ret++;
37961            printf(" %d", n_code);
37962            printf("\n");
37963        }
37964    }
37965    function_tests++;
37966#endif
37967
37968    return(test_ret);
37969}
37970
37971
37972static int
37973test_xmlUCSIsCatLo(void) {
37974    int test_ret = 0;
37975
37976#if defined(LIBXML_UNICODE_ENABLED)
37977    int mem_base;
37978    int ret_val;
37979    int code; /* UCS code point */
37980    int n_code;
37981
37982    for (n_code = 0;n_code < gen_nb_int;n_code++) {
37983        mem_base = xmlMemBlocks();
37984        code = gen_int(n_code, 0);
37985
37986        ret_val = xmlUCSIsCatLo(code);
37987        desret_int(ret_val);
37988        call_tests++;
37989        des_int(n_code, code, 0);
37990        xmlResetLastError();
37991        if (mem_base != xmlMemBlocks()) {
37992            printf("Leak of %d blocks found in xmlUCSIsCatLo",
37993	           xmlMemBlocks() - mem_base);
37994	    test_ret++;
37995            printf(" %d", n_code);
37996            printf("\n");
37997        }
37998    }
37999    function_tests++;
38000#endif
38001
38002    return(test_ret);
38003}
38004
38005
38006static int
38007test_xmlUCSIsCatLt(void) {
38008    int test_ret = 0;
38009
38010#if defined(LIBXML_UNICODE_ENABLED)
38011    int mem_base;
38012    int ret_val;
38013    int code; /* UCS code point */
38014    int n_code;
38015
38016    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38017        mem_base = xmlMemBlocks();
38018        code = gen_int(n_code, 0);
38019
38020        ret_val = xmlUCSIsCatLt(code);
38021        desret_int(ret_val);
38022        call_tests++;
38023        des_int(n_code, code, 0);
38024        xmlResetLastError();
38025        if (mem_base != xmlMemBlocks()) {
38026            printf("Leak of %d blocks found in xmlUCSIsCatLt",
38027	           xmlMemBlocks() - mem_base);
38028	    test_ret++;
38029            printf(" %d", n_code);
38030            printf("\n");
38031        }
38032    }
38033    function_tests++;
38034#endif
38035
38036    return(test_ret);
38037}
38038
38039
38040static int
38041test_xmlUCSIsCatLu(void) {
38042    int test_ret = 0;
38043
38044#if defined(LIBXML_UNICODE_ENABLED)
38045    int mem_base;
38046    int ret_val;
38047    int code; /* UCS code point */
38048    int n_code;
38049
38050    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38051        mem_base = xmlMemBlocks();
38052        code = gen_int(n_code, 0);
38053
38054        ret_val = xmlUCSIsCatLu(code);
38055        desret_int(ret_val);
38056        call_tests++;
38057        des_int(n_code, code, 0);
38058        xmlResetLastError();
38059        if (mem_base != xmlMemBlocks()) {
38060            printf("Leak of %d blocks found in xmlUCSIsCatLu",
38061	           xmlMemBlocks() - mem_base);
38062	    test_ret++;
38063            printf(" %d", n_code);
38064            printf("\n");
38065        }
38066    }
38067    function_tests++;
38068#endif
38069
38070    return(test_ret);
38071}
38072
38073
38074static int
38075test_xmlUCSIsCatM(void) {
38076    int test_ret = 0;
38077
38078#if defined(LIBXML_UNICODE_ENABLED)
38079    int mem_base;
38080    int ret_val;
38081    int code; /* UCS code point */
38082    int n_code;
38083
38084    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38085        mem_base = xmlMemBlocks();
38086        code = gen_int(n_code, 0);
38087
38088        ret_val = xmlUCSIsCatM(code);
38089        desret_int(ret_val);
38090        call_tests++;
38091        des_int(n_code, code, 0);
38092        xmlResetLastError();
38093        if (mem_base != xmlMemBlocks()) {
38094            printf("Leak of %d blocks found in xmlUCSIsCatM",
38095	           xmlMemBlocks() - mem_base);
38096	    test_ret++;
38097            printf(" %d", n_code);
38098            printf("\n");
38099        }
38100    }
38101    function_tests++;
38102#endif
38103
38104    return(test_ret);
38105}
38106
38107
38108static int
38109test_xmlUCSIsCatMc(void) {
38110    int test_ret = 0;
38111
38112#if defined(LIBXML_UNICODE_ENABLED)
38113    int mem_base;
38114    int ret_val;
38115    int code; /* UCS code point */
38116    int n_code;
38117
38118    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38119        mem_base = xmlMemBlocks();
38120        code = gen_int(n_code, 0);
38121
38122        ret_val = xmlUCSIsCatMc(code);
38123        desret_int(ret_val);
38124        call_tests++;
38125        des_int(n_code, code, 0);
38126        xmlResetLastError();
38127        if (mem_base != xmlMemBlocks()) {
38128            printf("Leak of %d blocks found in xmlUCSIsCatMc",
38129	           xmlMemBlocks() - mem_base);
38130	    test_ret++;
38131            printf(" %d", n_code);
38132            printf("\n");
38133        }
38134    }
38135    function_tests++;
38136#endif
38137
38138    return(test_ret);
38139}
38140
38141
38142static int
38143test_xmlUCSIsCatMe(void) {
38144    int test_ret = 0;
38145
38146#if defined(LIBXML_UNICODE_ENABLED)
38147    int mem_base;
38148    int ret_val;
38149    int code; /* UCS code point */
38150    int n_code;
38151
38152    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38153        mem_base = xmlMemBlocks();
38154        code = gen_int(n_code, 0);
38155
38156        ret_val = xmlUCSIsCatMe(code);
38157        desret_int(ret_val);
38158        call_tests++;
38159        des_int(n_code, code, 0);
38160        xmlResetLastError();
38161        if (mem_base != xmlMemBlocks()) {
38162            printf("Leak of %d blocks found in xmlUCSIsCatMe",
38163	           xmlMemBlocks() - mem_base);
38164	    test_ret++;
38165            printf(" %d", n_code);
38166            printf("\n");
38167        }
38168    }
38169    function_tests++;
38170#endif
38171
38172    return(test_ret);
38173}
38174
38175
38176static int
38177test_xmlUCSIsCatMn(void) {
38178    int test_ret = 0;
38179
38180#if defined(LIBXML_UNICODE_ENABLED)
38181    int mem_base;
38182    int ret_val;
38183    int code; /* UCS code point */
38184    int n_code;
38185
38186    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38187        mem_base = xmlMemBlocks();
38188        code = gen_int(n_code, 0);
38189
38190        ret_val = xmlUCSIsCatMn(code);
38191        desret_int(ret_val);
38192        call_tests++;
38193        des_int(n_code, code, 0);
38194        xmlResetLastError();
38195        if (mem_base != xmlMemBlocks()) {
38196            printf("Leak of %d blocks found in xmlUCSIsCatMn",
38197	           xmlMemBlocks() - mem_base);
38198	    test_ret++;
38199            printf(" %d", n_code);
38200            printf("\n");
38201        }
38202    }
38203    function_tests++;
38204#endif
38205
38206    return(test_ret);
38207}
38208
38209
38210static int
38211test_xmlUCSIsCatN(void) {
38212    int test_ret = 0;
38213
38214#if defined(LIBXML_UNICODE_ENABLED)
38215    int mem_base;
38216    int ret_val;
38217    int code; /* UCS code point */
38218    int n_code;
38219
38220    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38221        mem_base = xmlMemBlocks();
38222        code = gen_int(n_code, 0);
38223
38224        ret_val = xmlUCSIsCatN(code);
38225        desret_int(ret_val);
38226        call_tests++;
38227        des_int(n_code, code, 0);
38228        xmlResetLastError();
38229        if (mem_base != xmlMemBlocks()) {
38230            printf("Leak of %d blocks found in xmlUCSIsCatN",
38231	           xmlMemBlocks() - mem_base);
38232	    test_ret++;
38233            printf(" %d", n_code);
38234            printf("\n");
38235        }
38236    }
38237    function_tests++;
38238#endif
38239
38240    return(test_ret);
38241}
38242
38243
38244static int
38245test_xmlUCSIsCatNd(void) {
38246    int test_ret = 0;
38247
38248#if defined(LIBXML_UNICODE_ENABLED)
38249    int mem_base;
38250    int ret_val;
38251    int code; /* UCS code point */
38252    int n_code;
38253
38254    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38255        mem_base = xmlMemBlocks();
38256        code = gen_int(n_code, 0);
38257
38258        ret_val = xmlUCSIsCatNd(code);
38259        desret_int(ret_val);
38260        call_tests++;
38261        des_int(n_code, code, 0);
38262        xmlResetLastError();
38263        if (mem_base != xmlMemBlocks()) {
38264            printf("Leak of %d blocks found in xmlUCSIsCatNd",
38265	           xmlMemBlocks() - mem_base);
38266	    test_ret++;
38267            printf(" %d", n_code);
38268            printf("\n");
38269        }
38270    }
38271    function_tests++;
38272#endif
38273
38274    return(test_ret);
38275}
38276
38277
38278static int
38279test_xmlUCSIsCatNl(void) {
38280    int test_ret = 0;
38281
38282#if defined(LIBXML_UNICODE_ENABLED)
38283    int mem_base;
38284    int ret_val;
38285    int code; /* UCS code point */
38286    int n_code;
38287
38288    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38289        mem_base = xmlMemBlocks();
38290        code = gen_int(n_code, 0);
38291
38292        ret_val = xmlUCSIsCatNl(code);
38293        desret_int(ret_val);
38294        call_tests++;
38295        des_int(n_code, code, 0);
38296        xmlResetLastError();
38297        if (mem_base != xmlMemBlocks()) {
38298            printf("Leak of %d blocks found in xmlUCSIsCatNl",
38299	           xmlMemBlocks() - mem_base);
38300	    test_ret++;
38301            printf(" %d", n_code);
38302            printf("\n");
38303        }
38304    }
38305    function_tests++;
38306#endif
38307
38308    return(test_ret);
38309}
38310
38311
38312static int
38313test_xmlUCSIsCatNo(void) {
38314    int test_ret = 0;
38315
38316#if defined(LIBXML_UNICODE_ENABLED)
38317    int mem_base;
38318    int ret_val;
38319    int code; /* UCS code point */
38320    int n_code;
38321
38322    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38323        mem_base = xmlMemBlocks();
38324        code = gen_int(n_code, 0);
38325
38326        ret_val = xmlUCSIsCatNo(code);
38327        desret_int(ret_val);
38328        call_tests++;
38329        des_int(n_code, code, 0);
38330        xmlResetLastError();
38331        if (mem_base != xmlMemBlocks()) {
38332            printf("Leak of %d blocks found in xmlUCSIsCatNo",
38333	           xmlMemBlocks() - mem_base);
38334	    test_ret++;
38335            printf(" %d", n_code);
38336            printf("\n");
38337        }
38338    }
38339    function_tests++;
38340#endif
38341
38342    return(test_ret);
38343}
38344
38345
38346static int
38347test_xmlUCSIsCatP(void) {
38348    int test_ret = 0;
38349
38350#if defined(LIBXML_UNICODE_ENABLED)
38351    int mem_base;
38352    int ret_val;
38353    int code; /* UCS code point */
38354    int n_code;
38355
38356    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38357        mem_base = xmlMemBlocks();
38358        code = gen_int(n_code, 0);
38359
38360        ret_val = xmlUCSIsCatP(code);
38361        desret_int(ret_val);
38362        call_tests++;
38363        des_int(n_code, code, 0);
38364        xmlResetLastError();
38365        if (mem_base != xmlMemBlocks()) {
38366            printf("Leak of %d blocks found in xmlUCSIsCatP",
38367	           xmlMemBlocks() - mem_base);
38368	    test_ret++;
38369            printf(" %d", n_code);
38370            printf("\n");
38371        }
38372    }
38373    function_tests++;
38374#endif
38375
38376    return(test_ret);
38377}
38378
38379
38380static int
38381test_xmlUCSIsCatPc(void) {
38382    int test_ret = 0;
38383
38384#if defined(LIBXML_UNICODE_ENABLED)
38385    int mem_base;
38386    int ret_val;
38387    int code; /* UCS code point */
38388    int n_code;
38389
38390    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38391        mem_base = xmlMemBlocks();
38392        code = gen_int(n_code, 0);
38393
38394        ret_val = xmlUCSIsCatPc(code);
38395        desret_int(ret_val);
38396        call_tests++;
38397        des_int(n_code, code, 0);
38398        xmlResetLastError();
38399        if (mem_base != xmlMemBlocks()) {
38400            printf("Leak of %d blocks found in xmlUCSIsCatPc",
38401	           xmlMemBlocks() - mem_base);
38402	    test_ret++;
38403            printf(" %d", n_code);
38404            printf("\n");
38405        }
38406    }
38407    function_tests++;
38408#endif
38409
38410    return(test_ret);
38411}
38412
38413
38414static int
38415test_xmlUCSIsCatPd(void) {
38416    int test_ret = 0;
38417
38418#if defined(LIBXML_UNICODE_ENABLED)
38419    int mem_base;
38420    int ret_val;
38421    int code; /* UCS code point */
38422    int n_code;
38423
38424    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38425        mem_base = xmlMemBlocks();
38426        code = gen_int(n_code, 0);
38427
38428        ret_val = xmlUCSIsCatPd(code);
38429        desret_int(ret_val);
38430        call_tests++;
38431        des_int(n_code, code, 0);
38432        xmlResetLastError();
38433        if (mem_base != xmlMemBlocks()) {
38434            printf("Leak of %d blocks found in xmlUCSIsCatPd",
38435	           xmlMemBlocks() - mem_base);
38436	    test_ret++;
38437            printf(" %d", n_code);
38438            printf("\n");
38439        }
38440    }
38441    function_tests++;
38442#endif
38443
38444    return(test_ret);
38445}
38446
38447
38448static int
38449test_xmlUCSIsCatPe(void) {
38450    int test_ret = 0;
38451
38452#if defined(LIBXML_UNICODE_ENABLED)
38453    int mem_base;
38454    int ret_val;
38455    int code; /* UCS code point */
38456    int n_code;
38457
38458    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38459        mem_base = xmlMemBlocks();
38460        code = gen_int(n_code, 0);
38461
38462        ret_val = xmlUCSIsCatPe(code);
38463        desret_int(ret_val);
38464        call_tests++;
38465        des_int(n_code, code, 0);
38466        xmlResetLastError();
38467        if (mem_base != xmlMemBlocks()) {
38468            printf("Leak of %d blocks found in xmlUCSIsCatPe",
38469	           xmlMemBlocks() - mem_base);
38470	    test_ret++;
38471            printf(" %d", n_code);
38472            printf("\n");
38473        }
38474    }
38475    function_tests++;
38476#endif
38477
38478    return(test_ret);
38479}
38480
38481
38482static int
38483test_xmlUCSIsCatPf(void) {
38484    int test_ret = 0;
38485
38486#if defined(LIBXML_UNICODE_ENABLED)
38487    int mem_base;
38488    int ret_val;
38489    int code; /* UCS code point */
38490    int n_code;
38491
38492    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38493        mem_base = xmlMemBlocks();
38494        code = gen_int(n_code, 0);
38495
38496        ret_val = xmlUCSIsCatPf(code);
38497        desret_int(ret_val);
38498        call_tests++;
38499        des_int(n_code, code, 0);
38500        xmlResetLastError();
38501        if (mem_base != xmlMemBlocks()) {
38502            printf("Leak of %d blocks found in xmlUCSIsCatPf",
38503	           xmlMemBlocks() - mem_base);
38504	    test_ret++;
38505            printf(" %d", n_code);
38506            printf("\n");
38507        }
38508    }
38509    function_tests++;
38510#endif
38511
38512    return(test_ret);
38513}
38514
38515
38516static int
38517test_xmlUCSIsCatPi(void) {
38518    int test_ret = 0;
38519
38520#if defined(LIBXML_UNICODE_ENABLED)
38521    int mem_base;
38522    int ret_val;
38523    int code; /* UCS code point */
38524    int n_code;
38525
38526    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38527        mem_base = xmlMemBlocks();
38528        code = gen_int(n_code, 0);
38529
38530        ret_val = xmlUCSIsCatPi(code);
38531        desret_int(ret_val);
38532        call_tests++;
38533        des_int(n_code, code, 0);
38534        xmlResetLastError();
38535        if (mem_base != xmlMemBlocks()) {
38536            printf("Leak of %d blocks found in xmlUCSIsCatPi",
38537	           xmlMemBlocks() - mem_base);
38538	    test_ret++;
38539            printf(" %d", n_code);
38540            printf("\n");
38541        }
38542    }
38543    function_tests++;
38544#endif
38545
38546    return(test_ret);
38547}
38548
38549
38550static int
38551test_xmlUCSIsCatPo(void) {
38552    int test_ret = 0;
38553
38554#if defined(LIBXML_UNICODE_ENABLED)
38555    int mem_base;
38556    int ret_val;
38557    int code; /* UCS code point */
38558    int n_code;
38559
38560    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38561        mem_base = xmlMemBlocks();
38562        code = gen_int(n_code, 0);
38563
38564        ret_val = xmlUCSIsCatPo(code);
38565        desret_int(ret_val);
38566        call_tests++;
38567        des_int(n_code, code, 0);
38568        xmlResetLastError();
38569        if (mem_base != xmlMemBlocks()) {
38570            printf("Leak of %d blocks found in xmlUCSIsCatPo",
38571	           xmlMemBlocks() - mem_base);
38572	    test_ret++;
38573            printf(" %d", n_code);
38574            printf("\n");
38575        }
38576    }
38577    function_tests++;
38578#endif
38579
38580    return(test_ret);
38581}
38582
38583
38584static int
38585test_xmlUCSIsCatPs(void) {
38586    int test_ret = 0;
38587
38588#if defined(LIBXML_UNICODE_ENABLED)
38589    int mem_base;
38590    int ret_val;
38591    int code; /* UCS code point */
38592    int n_code;
38593
38594    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38595        mem_base = xmlMemBlocks();
38596        code = gen_int(n_code, 0);
38597
38598        ret_val = xmlUCSIsCatPs(code);
38599        desret_int(ret_val);
38600        call_tests++;
38601        des_int(n_code, code, 0);
38602        xmlResetLastError();
38603        if (mem_base != xmlMemBlocks()) {
38604            printf("Leak of %d blocks found in xmlUCSIsCatPs",
38605	           xmlMemBlocks() - mem_base);
38606	    test_ret++;
38607            printf(" %d", n_code);
38608            printf("\n");
38609        }
38610    }
38611    function_tests++;
38612#endif
38613
38614    return(test_ret);
38615}
38616
38617
38618static int
38619test_xmlUCSIsCatS(void) {
38620    int test_ret = 0;
38621
38622#if defined(LIBXML_UNICODE_ENABLED)
38623    int mem_base;
38624    int ret_val;
38625    int code; /* UCS code point */
38626    int n_code;
38627
38628    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38629        mem_base = xmlMemBlocks();
38630        code = gen_int(n_code, 0);
38631
38632        ret_val = xmlUCSIsCatS(code);
38633        desret_int(ret_val);
38634        call_tests++;
38635        des_int(n_code, code, 0);
38636        xmlResetLastError();
38637        if (mem_base != xmlMemBlocks()) {
38638            printf("Leak of %d blocks found in xmlUCSIsCatS",
38639	           xmlMemBlocks() - mem_base);
38640	    test_ret++;
38641            printf(" %d", n_code);
38642            printf("\n");
38643        }
38644    }
38645    function_tests++;
38646#endif
38647
38648    return(test_ret);
38649}
38650
38651
38652static int
38653test_xmlUCSIsCatSc(void) {
38654    int test_ret = 0;
38655
38656#if defined(LIBXML_UNICODE_ENABLED)
38657    int mem_base;
38658    int ret_val;
38659    int code; /* UCS code point */
38660    int n_code;
38661
38662    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38663        mem_base = xmlMemBlocks();
38664        code = gen_int(n_code, 0);
38665
38666        ret_val = xmlUCSIsCatSc(code);
38667        desret_int(ret_val);
38668        call_tests++;
38669        des_int(n_code, code, 0);
38670        xmlResetLastError();
38671        if (mem_base != xmlMemBlocks()) {
38672            printf("Leak of %d blocks found in xmlUCSIsCatSc",
38673	           xmlMemBlocks() - mem_base);
38674	    test_ret++;
38675            printf(" %d", n_code);
38676            printf("\n");
38677        }
38678    }
38679    function_tests++;
38680#endif
38681
38682    return(test_ret);
38683}
38684
38685
38686static int
38687test_xmlUCSIsCatSk(void) {
38688    int test_ret = 0;
38689
38690#if defined(LIBXML_UNICODE_ENABLED)
38691    int mem_base;
38692    int ret_val;
38693    int code; /* UCS code point */
38694    int n_code;
38695
38696    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38697        mem_base = xmlMemBlocks();
38698        code = gen_int(n_code, 0);
38699
38700        ret_val = xmlUCSIsCatSk(code);
38701        desret_int(ret_val);
38702        call_tests++;
38703        des_int(n_code, code, 0);
38704        xmlResetLastError();
38705        if (mem_base != xmlMemBlocks()) {
38706            printf("Leak of %d blocks found in xmlUCSIsCatSk",
38707	           xmlMemBlocks() - mem_base);
38708	    test_ret++;
38709            printf(" %d", n_code);
38710            printf("\n");
38711        }
38712    }
38713    function_tests++;
38714#endif
38715
38716    return(test_ret);
38717}
38718
38719
38720static int
38721test_xmlUCSIsCatSm(void) {
38722    int test_ret = 0;
38723
38724#if defined(LIBXML_UNICODE_ENABLED)
38725    int mem_base;
38726    int ret_val;
38727    int code; /* UCS code point */
38728    int n_code;
38729
38730    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38731        mem_base = xmlMemBlocks();
38732        code = gen_int(n_code, 0);
38733
38734        ret_val = xmlUCSIsCatSm(code);
38735        desret_int(ret_val);
38736        call_tests++;
38737        des_int(n_code, code, 0);
38738        xmlResetLastError();
38739        if (mem_base != xmlMemBlocks()) {
38740            printf("Leak of %d blocks found in xmlUCSIsCatSm",
38741	           xmlMemBlocks() - mem_base);
38742	    test_ret++;
38743            printf(" %d", n_code);
38744            printf("\n");
38745        }
38746    }
38747    function_tests++;
38748#endif
38749
38750    return(test_ret);
38751}
38752
38753
38754static int
38755test_xmlUCSIsCatSo(void) {
38756    int test_ret = 0;
38757
38758#if defined(LIBXML_UNICODE_ENABLED)
38759    int mem_base;
38760    int ret_val;
38761    int code; /* UCS code point */
38762    int n_code;
38763
38764    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38765        mem_base = xmlMemBlocks();
38766        code = gen_int(n_code, 0);
38767
38768        ret_val = xmlUCSIsCatSo(code);
38769        desret_int(ret_val);
38770        call_tests++;
38771        des_int(n_code, code, 0);
38772        xmlResetLastError();
38773        if (mem_base != xmlMemBlocks()) {
38774            printf("Leak of %d blocks found in xmlUCSIsCatSo",
38775	           xmlMemBlocks() - mem_base);
38776	    test_ret++;
38777            printf(" %d", n_code);
38778            printf("\n");
38779        }
38780    }
38781    function_tests++;
38782#endif
38783
38784    return(test_ret);
38785}
38786
38787
38788static int
38789test_xmlUCSIsCatZ(void) {
38790    int test_ret = 0;
38791
38792#if defined(LIBXML_UNICODE_ENABLED)
38793    int mem_base;
38794    int ret_val;
38795    int code; /* UCS code point */
38796    int n_code;
38797
38798    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38799        mem_base = xmlMemBlocks();
38800        code = gen_int(n_code, 0);
38801
38802        ret_val = xmlUCSIsCatZ(code);
38803        desret_int(ret_val);
38804        call_tests++;
38805        des_int(n_code, code, 0);
38806        xmlResetLastError();
38807        if (mem_base != xmlMemBlocks()) {
38808            printf("Leak of %d blocks found in xmlUCSIsCatZ",
38809	           xmlMemBlocks() - mem_base);
38810	    test_ret++;
38811            printf(" %d", n_code);
38812            printf("\n");
38813        }
38814    }
38815    function_tests++;
38816#endif
38817
38818    return(test_ret);
38819}
38820
38821
38822static int
38823test_xmlUCSIsCatZl(void) {
38824    int test_ret = 0;
38825
38826#if defined(LIBXML_UNICODE_ENABLED)
38827    int mem_base;
38828    int ret_val;
38829    int code; /* UCS code point */
38830    int n_code;
38831
38832    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38833        mem_base = xmlMemBlocks();
38834        code = gen_int(n_code, 0);
38835
38836        ret_val = xmlUCSIsCatZl(code);
38837        desret_int(ret_val);
38838        call_tests++;
38839        des_int(n_code, code, 0);
38840        xmlResetLastError();
38841        if (mem_base != xmlMemBlocks()) {
38842            printf("Leak of %d blocks found in xmlUCSIsCatZl",
38843	           xmlMemBlocks() - mem_base);
38844	    test_ret++;
38845            printf(" %d", n_code);
38846            printf("\n");
38847        }
38848    }
38849    function_tests++;
38850#endif
38851
38852    return(test_ret);
38853}
38854
38855
38856static int
38857test_xmlUCSIsCatZp(void) {
38858    int test_ret = 0;
38859
38860#if defined(LIBXML_UNICODE_ENABLED)
38861    int mem_base;
38862    int ret_val;
38863    int code; /* UCS code point */
38864    int n_code;
38865
38866    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38867        mem_base = xmlMemBlocks();
38868        code = gen_int(n_code, 0);
38869
38870        ret_val = xmlUCSIsCatZp(code);
38871        desret_int(ret_val);
38872        call_tests++;
38873        des_int(n_code, code, 0);
38874        xmlResetLastError();
38875        if (mem_base != xmlMemBlocks()) {
38876            printf("Leak of %d blocks found in xmlUCSIsCatZp",
38877	           xmlMemBlocks() - mem_base);
38878	    test_ret++;
38879            printf(" %d", n_code);
38880            printf("\n");
38881        }
38882    }
38883    function_tests++;
38884#endif
38885
38886    return(test_ret);
38887}
38888
38889
38890static int
38891test_xmlUCSIsCatZs(void) {
38892    int test_ret = 0;
38893
38894#if defined(LIBXML_UNICODE_ENABLED)
38895    int mem_base;
38896    int ret_val;
38897    int code; /* UCS code point */
38898    int n_code;
38899
38900    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38901        mem_base = xmlMemBlocks();
38902        code = gen_int(n_code, 0);
38903
38904        ret_val = xmlUCSIsCatZs(code);
38905        desret_int(ret_val);
38906        call_tests++;
38907        des_int(n_code, code, 0);
38908        xmlResetLastError();
38909        if (mem_base != xmlMemBlocks()) {
38910            printf("Leak of %d blocks found in xmlUCSIsCatZs",
38911	           xmlMemBlocks() - mem_base);
38912	    test_ret++;
38913            printf(" %d", n_code);
38914            printf("\n");
38915        }
38916    }
38917    function_tests++;
38918#endif
38919
38920    return(test_ret);
38921}
38922
38923
38924static int
38925test_xmlUCSIsCherokee(void) {
38926    int test_ret = 0;
38927
38928#if defined(LIBXML_UNICODE_ENABLED)
38929    int mem_base;
38930    int ret_val;
38931    int code; /* UCS code point */
38932    int n_code;
38933
38934    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38935        mem_base = xmlMemBlocks();
38936        code = gen_int(n_code, 0);
38937
38938        ret_val = xmlUCSIsCherokee(code);
38939        desret_int(ret_val);
38940        call_tests++;
38941        des_int(n_code, code, 0);
38942        xmlResetLastError();
38943        if (mem_base != xmlMemBlocks()) {
38944            printf("Leak of %d blocks found in xmlUCSIsCherokee",
38945	           xmlMemBlocks() - mem_base);
38946	    test_ret++;
38947            printf(" %d", n_code);
38948            printf("\n");
38949        }
38950    }
38951    function_tests++;
38952#endif
38953
38954    return(test_ret);
38955}
38956
38957
38958static int
38959test_xmlUCSIsCombiningDiacriticalMarks(void) {
38960    int test_ret = 0;
38961
38962#if defined(LIBXML_UNICODE_ENABLED)
38963    int mem_base;
38964    int ret_val;
38965    int code; /* UCS code point */
38966    int n_code;
38967
38968    for (n_code = 0;n_code < gen_nb_int;n_code++) {
38969        mem_base = xmlMemBlocks();
38970        code = gen_int(n_code, 0);
38971
38972        ret_val = xmlUCSIsCombiningDiacriticalMarks(code);
38973        desret_int(ret_val);
38974        call_tests++;
38975        des_int(n_code, code, 0);
38976        xmlResetLastError();
38977        if (mem_base != xmlMemBlocks()) {
38978            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks",
38979	           xmlMemBlocks() - mem_base);
38980	    test_ret++;
38981            printf(" %d", n_code);
38982            printf("\n");
38983        }
38984    }
38985    function_tests++;
38986#endif
38987
38988    return(test_ret);
38989}
38990
38991
38992static int
38993test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) {
38994    int test_ret = 0;
38995
38996#if defined(LIBXML_UNICODE_ENABLED)
38997    int mem_base;
38998    int ret_val;
38999    int code; /* UCS code point */
39000    int n_code;
39001
39002    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39003        mem_base = xmlMemBlocks();
39004        code = gen_int(n_code, 0);
39005
39006        ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code);
39007        desret_int(ret_val);
39008        call_tests++;
39009        des_int(n_code, code, 0);
39010        xmlResetLastError();
39011        if (mem_base != xmlMemBlocks()) {
39012            printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols",
39013	           xmlMemBlocks() - mem_base);
39014	    test_ret++;
39015            printf(" %d", n_code);
39016            printf("\n");
39017        }
39018    }
39019    function_tests++;
39020#endif
39021
39022    return(test_ret);
39023}
39024
39025
39026static int
39027test_xmlUCSIsCombiningHalfMarks(void) {
39028    int test_ret = 0;
39029
39030#if defined(LIBXML_UNICODE_ENABLED)
39031    int mem_base;
39032    int ret_val;
39033    int code; /* UCS code point */
39034    int n_code;
39035
39036    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39037        mem_base = xmlMemBlocks();
39038        code = gen_int(n_code, 0);
39039
39040        ret_val = xmlUCSIsCombiningHalfMarks(code);
39041        desret_int(ret_val);
39042        call_tests++;
39043        des_int(n_code, code, 0);
39044        xmlResetLastError();
39045        if (mem_base != xmlMemBlocks()) {
39046            printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks",
39047	           xmlMemBlocks() - mem_base);
39048	    test_ret++;
39049            printf(" %d", n_code);
39050            printf("\n");
39051        }
39052    }
39053    function_tests++;
39054#endif
39055
39056    return(test_ret);
39057}
39058
39059
39060static int
39061test_xmlUCSIsCombiningMarksforSymbols(void) {
39062    int test_ret = 0;
39063
39064#if defined(LIBXML_UNICODE_ENABLED)
39065    int mem_base;
39066    int ret_val;
39067    int code; /* UCS code point */
39068    int n_code;
39069
39070    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39071        mem_base = xmlMemBlocks();
39072        code = gen_int(n_code, 0);
39073
39074        ret_val = xmlUCSIsCombiningMarksforSymbols(code);
39075        desret_int(ret_val);
39076        call_tests++;
39077        des_int(n_code, code, 0);
39078        xmlResetLastError();
39079        if (mem_base != xmlMemBlocks()) {
39080            printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols",
39081	           xmlMemBlocks() - mem_base);
39082	    test_ret++;
39083            printf(" %d", n_code);
39084            printf("\n");
39085        }
39086    }
39087    function_tests++;
39088#endif
39089
39090    return(test_ret);
39091}
39092
39093
39094static int
39095test_xmlUCSIsControlPictures(void) {
39096    int test_ret = 0;
39097
39098#if defined(LIBXML_UNICODE_ENABLED)
39099    int mem_base;
39100    int ret_val;
39101    int code; /* UCS code point */
39102    int n_code;
39103
39104    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39105        mem_base = xmlMemBlocks();
39106        code = gen_int(n_code, 0);
39107
39108        ret_val = xmlUCSIsControlPictures(code);
39109        desret_int(ret_val);
39110        call_tests++;
39111        des_int(n_code, code, 0);
39112        xmlResetLastError();
39113        if (mem_base != xmlMemBlocks()) {
39114            printf("Leak of %d blocks found in xmlUCSIsControlPictures",
39115	           xmlMemBlocks() - mem_base);
39116	    test_ret++;
39117            printf(" %d", n_code);
39118            printf("\n");
39119        }
39120    }
39121    function_tests++;
39122#endif
39123
39124    return(test_ret);
39125}
39126
39127
39128static int
39129test_xmlUCSIsCurrencySymbols(void) {
39130    int test_ret = 0;
39131
39132#if defined(LIBXML_UNICODE_ENABLED)
39133    int mem_base;
39134    int ret_val;
39135    int code; /* UCS code point */
39136    int n_code;
39137
39138    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39139        mem_base = xmlMemBlocks();
39140        code = gen_int(n_code, 0);
39141
39142        ret_val = xmlUCSIsCurrencySymbols(code);
39143        desret_int(ret_val);
39144        call_tests++;
39145        des_int(n_code, code, 0);
39146        xmlResetLastError();
39147        if (mem_base != xmlMemBlocks()) {
39148            printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols",
39149	           xmlMemBlocks() - mem_base);
39150	    test_ret++;
39151            printf(" %d", n_code);
39152            printf("\n");
39153        }
39154    }
39155    function_tests++;
39156#endif
39157
39158    return(test_ret);
39159}
39160
39161
39162static int
39163test_xmlUCSIsCypriotSyllabary(void) {
39164    int test_ret = 0;
39165
39166#if defined(LIBXML_UNICODE_ENABLED)
39167    int mem_base;
39168    int ret_val;
39169    int code; /* UCS code point */
39170    int n_code;
39171
39172    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39173        mem_base = xmlMemBlocks();
39174        code = gen_int(n_code, 0);
39175
39176        ret_val = xmlUCSIsCypriotSyllabary(code);
39177        desret_int(ret_val);
39178        call_tests++;
39179        des_int(n_code, code, 0);
39180        xmlResetLastError();
39181        if (mem_base != xmlMemBlocks()) {
39182            printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary",
39183	           xmlMemBlocks() - mem_base);
39184	    test_ret++;
39185            printf(" %d", n_code);
39186            printf("\n");
39187        }
39188    }
39189    function_tests++;
39190#endif
39191
39192    return(test_ret);
39193}
39194
39195
39196static int
39197test_xmlUCSIsCyrillic(void) {
39198    int test_ret = 0;
39199
39200#if defined(LIBXML_UNICODE_ENABLED)
39201    int mem_base;
39202    int ret_val;
39203    int code; /* UCS code point */
39204    int n_code;
39205
39206    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39207        mem_base = xmlMemBlocks();
39208        code = gen_int(n_code, 0);
39209
39210        ret_val = xmlUCSIsCyrillic(code);
39211        desret_int(ret_val);
39212        call_tests++;
39213        des_int(n_code, code, 0);
39214        xmlResetLastError();
39215        if (mem_base != xmlMemBlocks()) {
39216            printf("Leak of %d blocks found in xmlUCSIsCyrillic",
39217	           xmlMemBlocks() - mem_base);
39218	    test_ret++;
39219            printf(" %d", n_code);
39220            printf("\n");
39221        }
39222    }
39223    function_tests++;
39224#endif
39225
39226    return(test_ret);
39227}
39228
39229
39230static int
39231test_xmlUCSIsCyrillicSupplement(void) {
39232    int test_ret = 0;
39233
39234#if defined(LIBXML_UNICODE_ENABLED)
39235    int mem_base;
39236    int ret_val;
39237    int code; /* UCS code point */
39238    int n_code;
39239
39240    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39241        mem_base = xmlMemBlocks();
39242        code = gen_int(n_code, 0);
39243
39244        ret_val = xmlUCSIsCyrillicSupplement(code);
39245        desret_int(ret_val);
39246        call_tests++;
39247        des_int(n_code, code, 0);
39248        xmlResetLastError();
39249        if (mem_base != xmlMemBlocks()) {
39250            printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement",
39251	           xmlMemBlocks() - mem_base);
39252	    test_ret++;
39253            printf(" %d", n_code);
39254            printf("\n");
39255        }
39256    }
39257    function_tests++;
39258#endif
39259
39260    return(test_ret);
39261}
39262
39263
39264static int
39265test_xmlUCSIsDeseret(void) {
39266    int test_ret = 0;
39267
39268#if defined(LIBXML_UNICODE_ENABLED)
39269    int mem_base;
39270    int ret_val;
39271    int code; /* UCS code point */
39272    int n_code;
39273
39274    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39275        mem_base = xmlMemBlocks();
39276        code = gen_int(n_code, 0);
39277
39278        ret_val = xmlUCSIsDeseret(code);
39279        desret_int(ret_val);
39280        call_tests++;
39281        des_int(n_code, code, 0);
39282        xmlResetLastError();
39283        if (mem_base != xmlMemBlocks()) {
39284            printf("Leak of %d blocks found in xmlUCSIsDeseret",
39285	           xmlMemBlocks() - mem_base);
39286	    test_ret++;
39287            printf(" %d", n_code);
39288            printf("\n");
39289        }
39290    }
39291    function_tests++;
39292#endif
39293
39294    return(test_ret);
39295}
39296
39297
39298static int
39299test_xmlUCSIsDevanagari(void) {
39300    int test_ret = 0;
39301
39302#if defined(LIBXML_UNICODE_ENABLED)
39303    int mem_base;
39304    int ret_val;
39305    int code; /* UCS code point */
39306    int n_code;
39307
39308    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39309        mem_base = xmlMemBlocks();
39310        code = gen_int(n_code, 0);
39311
39312        ret_val = xmlUCSIsDevanagari(code);
39313        desret_int(ret_val);
39314        call_tests++;
39315        des_int(n_code, code, 0);
39316        xmlResetLastError();
39317        if (mem_base != xmlMemBlocks()) {
39318            printf("Leak of %d blocks found in xmlUCSIsDevanagari",
39319	           xmlMemBlocks() - mem_base);
39320	    test_ret++;
39321            printf(" %d", n_code);
39322            printf("\n");
39323        }
39324    }
39325    function_tests++;
39326#endif
39327
39328    return(test_ret);
39329}
39330
39331
39332static int
39333test_xmlUCSIsDingbats(void) {
39334    int test_ret = 0;
39335
39336#if defined(LIBXML_UNICODE_ENABLED)
39337    int mem_base;
39338    int ret_val;
39339    int code; /* UCS code point */
39340    int n_code;
39341
39342    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39343        mem_base = xmlMemBlocks();
39344        code = gen_int(n_code, 0);
39345
39346        ret_val = xmlUCSIsDingbats(code);
39347        desret_int(ret_val);
39348        call_tests++;
39349        des_int(n_code, code, 0);
39350        xmlResetLastError();
39351        if (mem_base != xmlMemBlocks()) {
39352            printf("Leak of %d blocks found in xmlUCSIsDingbats",
39353	           xmlMemBlocks() - mem_base);
39354	    test_ret++;
39355            printf(" %d", n_code);
39356            printf("\n");
39357        }
39358    }
39359    function_tests++;
39360#endif
39361
39362    return(test_ret);
39363}
39364
39365
39366static int
39367test_xmlUCSIsEnclosedAlphanumerics(void) {
39368    int test_ret = 0;
39369
39370#if defined(LIBXML_UNICODE_ENABLED)
39371    int mem_base;
39372    int ret_val;
39373    int code; /* UCS code point */
39374    int n_code;
39375
39376    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39377        mem_base = xmlMemBlocks();
39378        code = gen_int(n_code, 0);
39379
39380        ret_val = xmlUCSIsEnclosedAlphanumerics(code);
39381        desret_int(ret_val);
39382        call_tests++;
39383        des_int(n_code, code, 0);
39384        xmlResetLastError();
39385        if (mem_base != xmlMemBlocks()) {
39386            printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics",
39387	           xmlMemBlocks() - mem_base);
39388	    test_ret++;
39389            printf(" %d", n_code);
39390            printf("\n");
39391        }
39392    }
39393    function_tests++;
39394#endif
39395
39396    return(test_ret);
39397}
39398
39399
39400static int
39401test_xmlUCSIsEnclosedCJKLettersandMonths(void) {
39402    int test_ret = 0;
39403
39404#if defined(LIBXML_UNICODE_ENABLED)
39405    int mem_base;
39406    int ret_val;
39407    int code; /* UCS code point */
39408    int n_code;
39409
39410    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39411        mem_base = xmlMemBlocks();
39412        code = gen_int(n_code, 0);
39413
39414        ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code);
39415        desret_int(ret_val);
39416        call_tests++;
39417        des_int(n_code, code, 0);
39418        xmlResetLastError();
39419        if (mem_base != xmlMemBlocks()) {
39420            printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths",
39421	           xmlMemBlocks() - mem_base);
39422	    test_ret++;
39423            printf(" %d", n_code);
39424            printf("\n");
39425        }
39426    }
39427    function_tests++;
39428#endif
39429
39430    return(test_ret);
39431}
39432
39433
39434static int
39435test_xmlUCSIsEthiopic(void) {
39436    int test_ret = 0;
39437
39438#if defined(LIBXML_UNICODE_ENABLED)
39439    int mem_base;
39440    int ret_val;
39441    int code; /* UCS code point */
39442    int n_code;
39443
39444    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39445        mem_base = xmlMemBlocks();
39446        code = gen_int(n_code, 0);
39447
39448        ret_val = xmlUCSIsEthiopic(code);
39449        desret_int(ret_val);
39450        call_tests++;
39451        des_int(n_code, code, 0);
39452        xmlResetLastError();
39453        if (mem_base != xmlMemBlocks()) {
39454            printf("Leak of %d blocks found in xmlUCSIsEthiopic",
39455	           xmlMemBlocks() - mem_base);
39456	    test_ret++;
39457            printf(" %d", n_code);
39458            printf("\n");
39459        }
39460    }
39461    function_tests++;
39462#endif
39463
39464    return(test_ret);
39465}
39466
39467
39468static int
39469test_xmlUCSIsGeneralPunctuation(void) {
39470    int test_ret = 0;
39471
39472#if defined(LIBXML_UNICODE_ENABLED)
39473    int mem_base;
39474    int ret_val;
39475    int code; /* UCS code point */
39476    int n_code;
39477
39478    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39479        mem_base = xmlMemBlocks();
39480        code = gen_int(n_code, 0);
39481
39482        ret_val = xmlUCSIsGeneralPunctuation(code);
39483        desret_int(ret_val);
39484        call_tests++;
39485        des_int(n_code, code, 0);
39486        xmlResetLastError();
39487        if (mem_base != xmlMemBlocks()) {
39488            printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation",
39489	           xmlMemBlocks() - mem_base);
39490	    test_ret++;
39491            printf(" %d", n_code);
39492            printf("\n");
39493        }
39494    }
39495    function_tests++;
39496#endif
39497
39498    return(test_ret);
39499}
39500
39501
39502static int
39503test_xmlUCSIsGeometricShapes(void) {
39504    int test_ret = 0;
39505
39506#if defined(LIBXML_UNICODE_ENABLED)
39507    int mem_base;
39508    int ret_val;
39509    int code; /* UCS code point */
39510    int n_code;
39511
39512    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39513        mem_base = xmlMemBlocks();
39514        code = gen_int(n_code, 0);
39515
39516        ret_val = xmlUCSIsGeometricShapes(code);
39517        desret_int(ret_val);
39518        call_tests++;
39519        des_int(n_code, code, 0);
39520        xmlResetLastError();
39521        if (mem_base != xmlMemBlocks()) {
39522            printf("Leak of %d blocks found in xmlUCSIsGeometricShapes",
39523	           xmlMemBlocks() - mem_base);
39524	    test_ret++;
39525            printf(" %d", n_code);
39526            printf("\n");
39527        }
39528    }
39529    function_tests++;
39530#endif
39531
39532    return(test_ret);
39533}
39534
39535
39536static int
39537test_xmlUCSIsGeorgian(void) {
39538    int test_ret = 0;
39539
39540#if defined(LIBXML_UNICODE_ENABLED)
39541    int mem_base;
39542    int ret_val;
39543    int code; /* UCS code point */
39544    int n_code;
39545
39546    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39547        mem_base = xmlMemBlocks();
39548        code = gen_int(n_code, 0);
39549
39550        ret_val = xmlUCSIsGeorgian(code);
39551        desret_int(ret_val);
39552        call_tests++;
39553        des_int(n_code, code, 0);
39554        xmlResetLastError();
39555        if (mem_base != xmlMemBlocks()) {
39556            printf("Leak of %d blocks found in xmlUCSIsGeorgian",
39557	           xmlMemBlocks() - mem_base);
39558	    test_ret++;
39559            printf(" %d", n_code);
39560            printf("\n");
39561        }
39562    }
39563    function_tests++;
39564#endif
39565
39566    return(test_ret);
39567}
39568
39569
39570static int
39571test_xmlUCSIsGothic(void) {
39572    int test_ret = 0;
39573
39574#if defined(LIBXML_UNICODE_ENABLED)
39575    int mem_base;
39576    int ret_val;
39577    int code; /* UCS code point */
39578    int n_code;
39579
39580    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39581        mem_base = xmlMemBlocks();
39582        code = gen_int(n_code, 0);
39583
39584        ret_val = xmlUCSIsGothic(code);
39585        desret_int(ret_val);
39586        call_tests++;
39587        des_int(n_code, code, 0);
39588        xmlResetLastError();
39589        if (mem_base != xmlMemBlocks()) {
39590            printf("Leak of %d blocks found in xmlUCSIsGothic",
39591	           xmlMemBlocks() - mem_base);
39592	    test_ret++;
39593            printf(" %d", n_code);
39594            printf("\n");
39595        }
39596    }
39597    function_tests++;
39598#endif
39599
39600    return(test_ret);
39601}
39602
39603
39604static int
39605test_xmlUCSIsGreek(void) {
39606    int test_ret = 0;
39607
39608#if defined(LIBXML_UNICODE_ENABLED)
39609    int mem_base;
39610    int ret_val;
39611    int code; /* UCS code point */
39612    int n_code;
39613
39614    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39615        mem_base = xmlMemBlocks();
39616        code = gen_int(n_code, 0);
39617
39618        ret_val = xmlUCSIsGreek(code);
39619        desret_int(ret_val);
39620        call_tests++;
39621        des_int(n_code, code, 0);
39622        xmlResetLastError();
39623        if (mem_base != xmlMemBlocks()) {
39624            printf("Leak of %d blocks found in xmlUCSIsGreek",
39625	           xmlMemBlocks() - mem_base);
39626	    test_ret++;
39627            printf(" %d", n_code);
39628            printf("\n");
39629        }
39630    }
39631    function_tests++;
39632#endif
39633
39634    return(test_ret);
39635}
39636
39637
39638static int
39639test_xmlUCSIsGreekExtended(void) {
39640    int test_ret = 0;
39641
39642#if defined(LIBXML_UNICODE_ENABLED)
39643    int mem_base;
39644    int ret_val;
39645    int code; /* UCS code point */
39646    int n_code;
39647
39648    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39649        mem_base = xmlMemBlocks();
39650        code = gen_int(n_code, 0);
39651
39652        ret_val = xmlUCSIsGreekExtended(code);
39653        desret_int(ret_val);
39654        call_tests++;
39655        des_int(n_code, code, 0);
39656        xmlResetLastError();
39657        if (mem_base != xmlMemBlocks()) {
39658            printf("Leak of %d blocks found in xmlUCSIsGreekExtended",
39659	           xmlMemBlocks() - mem_base);
39660	    test_ret++;
39661            printf(" %d", n_code);
39662            printf("\n");
39663        }
39664    }
39665    function_tests++;
39666#endif
39667
39668    return(test_ret);
39669}
39670
39671
39672static int
39673test_xmlUCSIsGreekandCoptic(void) {
39674    int test_ret = 0;
39675
39676#if defined(LIBXML_UNICODE_ENABLED)
39677    int mem_base;
39678    int ret_val;
39679    int code; /* UCS code point */
39680    int n_code;
39681
39682    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39683        mem_base = xmlMemBlocks();
39684        code = gen_int(n_code, 0);
39685
39686        ret_val = xmlUCSIsGreekandCoptic(code);
39687        desret_int(ret_val);
39688        call_tests++;
39689        des_int(n_code, code, 0);
39690        xmlResetLastError();
39691        if (mem_base != xmlMemBlocks()) {
39692            printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic",
39693	           xmlMemBlocks() - mem_base);
39694	    test_ret++;
39695            printf(" %d", n_code);
39696            printf("\n");
39697        }
39698    }
39699    function_tests++;
39700#endif
39701
39702    return(test_ret);
39703}
39704
39705
39706static int
39707test_xmlUCSIsGujarati(void) {
39708    int test_ret = 0;
39709
39710#if defined(LIBXML_UNICODE_ENABLED)
39711    int mem_base;
39712    int ret_val;
39713    int code; /* UCS code point */
39714    int n_code;
39715
39716    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39717        mem_base = xmlMemBlocks();
39718        code = gen_int(n_code, 0);
39719
39720        ret_val = xmlUCSIsGujarati(code);
39721        desret_int(ret_val);
39722        call_tests++;
39723        des_int(n_code, code, 0);
39724        xmlResetLastError();
39725        if (mem_base != xmlMemBlocks()) {
39726            printf("Leak of %d blocks found in xmlUCSIsGujarati",
39727	           xmlMemBlocks() - mem_base);
39728	    test_ret++;
39729            printf(" %d", n_code);
39730            printf("\n");
39731        }
39732    }
39733    function_tests++;
39734#endif
39735
39736    return(test_ret);
39737}
39738
39739
39740static int
39741test_xmlUCSIsGurmukhi(void) {
39742    int test_ret = 0;
39743
39744#if defined(LIBXML_UNICODE_ENABLED)
39745    int mem_base;
39746    int ret_val;
39747    int code; /* UCS code point */
39748    int n_code;
39749
39750    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39751        mem_base = xmlMemBlocks();
39752        code = gen_int(n_code, 0);
39753
39754        ret_val = xmlUCSIsGurmukhi(code);
39755        desret_int(ret_val);
39756        call_tests++;
39757        des_int(n_code, code, 0);
39758        xmlResetLastError();
39759        if (mem_base != xmlMemBlocks()) {
39760            printf("Leak of %d blocks found in xmlUCSIsGurmukhi",
39761	           xmlMemBlocks() - mem_base);
39762	    test_ret++;
39763            printf(" %d", n_code);
39764            printf("\n");
39765        }
39766    }
39767    function_tests++;
39768#endif
39769
39770    return(test_ret);
39771}
39772
39773
39774static int
39775test_xmlUCSIsHalfwidthandFullwidthForms(void) {
39776    int test_ret = 0;
39777
39778#if defined(LIBXML_UNICODE_ENABLED)
39779    int mem_base;
39780    int ret_val;
39781    int code; /* UCS code point */
39782    int n_code;
39783
39784    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39785        mem_base = xmlMemBlocks();
39786        code = gen_int(n_code, 0);
39787
39788        ret_val = xmlUCSIsHalfwidthandFullwidthForms(code);
39789        desret_int(ret_val);
39790        call_tests++;
39791        des_int(n_code, code, 0);
39792        xmlResetLastError();
39793        if (mem_base != xmlMemBlocks()) {
39794            printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms",
39795	           xmlMemBlocks() - mem_base);
39796	    test_ret++;
39797            printf(" %d", n_code);
39798            printf("\n");
39799        }
39800    }
39801    function_tests++;
39802#endif
39803
39804    return(test_ret);
39805}
39806
39807
39808static int
39809test_xmlUCSIsHangulCompatibilityJamo(void) {
39810    int test_ret = 0;
39811
39812#if defined(LIBXML_UNICODE_ENABLED)
39813    int mem_base;
39814    int ret_val;
39815    int code; /* UCS code point */
39816    int n_code;
39817
39818    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39819        mem_base = xmlMemBlocks();
39820        code = gen_int(n_code, 0);
39821
39822        ret_val = xmlUCSIsHangulCompatibilityJamo(code);
39823        desret_int(ret_val);
39824        call_tests++;
39825        des_int(n_code, code, 0);
39826        xmlResetLastError();
39827        if (mem_base != xmlMemBlocks()) {
39828            printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo",
39829	           xmlMemBlocks() - mem_base);
39830	    test_ret++;
39831            printf(" %d", n_code);
39832            printf("\n");
39833        }
39834    }
39835    function_tests++;
39836#endif
39837
39838    return(test_ret);
39839}
39840
39841
39842static int
39843test_xmlUCSIsHangulJamo(void) {
39844    int test_ret = 0;
39845
39846#if defined(LIBXML_UNICODE_ENABLED)
39847    int mem_base;
39848    int ret_val;
39849    int code; /* UCS code point */
39850    int n_code;
39851
39852    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39853        mem_base = xmlMemBlocks();
39854        code = gen_int(n_code, 0);
39855
39856        ret_val = xmlUCSIsHangulJamo(code);
39857        desret_int(ret_val);
39858        call_tests++;
39859        des_int(n_code, code, 0);
39860        xmlResetLastError();
39861        if (mem_base != xmlMemBlocks()) {
39862            printf("Leak of %d blocks found in xmlUCSIsHangulJamo",
39863	           xmlMemBlocks() - mem_base);
39864	    test_ret++;
39865            printf(" %d", n_code);
39866            printf("\n");
39867        }
39868    }
39869    function_tests++;
39870#endif
39871
39872    return(test_ret);
39873}
39874
39875
39876static int
39877test_xmlUCSIsHangulSyllables(void) {
39878    int test_ret = 0;
39879
39880#if defined(LIBXML_UNICODE_ENABLED)
39881    int mem_base;
39882    int ret_val;
39883    int code; /* UCS code point */
39884    int n_code;
39885
39886    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39887        mem_base = xmlMemBlocks();
39888        code = gen_int(n_code, 0);
39889
39890        ret_val = xmlUCSIsHangulSyllables(code);
39891        desret_int(ret_val);
39892        call_tests++;
39893        des_int(n_code, code, 0);
39894        xmlResetLastError();
39895        if (mem_base != xmlMemBlocks()) {
39896            printf("Leak of %d blocks found in xmlUCSIsHangulSyllables",
39897	           xmlMemBlocks() - mem_base);
39898	    test_ret++;
39899            printf(" %d", n_code);
39900            printf("\n");
39901        }
39902    }
39903    function_tests++;
39904#endif
39905
39906    return(test_ret);
39907}
39908
39909
39910static int
39911test_xmlUCSIsHanunoo(void) {
39912    int test_ret = 0;
39913
39914#if defined(LIBXML_UNICODE_ENABLED)
39915    int mem_base;
39916    int ret_val;
39917    int code; /* UCS code point */
39918    int n_code;
39919
39920    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39921        mem_base = xmlMemBlocks();
39922        code = gen_int(n_code, 0);
39923
39924        ret_val = xmlUCSIsHanunoo(code);
39925        desret_int(ret_val);
39926        call_tests++;
39927        des_int(n_code, code, 0);
39928        xmlResetLastError();
39929        if (mem_base != xmlMemBlocks()) {
39930            printf("Leak of %d blocks found in xmlUCSIsHanunoo",
39931	           xmlMemBlocks() - mem_base);
39932	    test_ret++;
39933            printf(" %d", n_code);
39934            printf("\n");
39935        }
39936    }
39937    function_tests++;
39938#endif
39939
39940    return(test_ret);
39941}
39942
39943
39944static int
39945test_xmlUCSIsHebrew(void) {
39946    int test_ret = 0;
39947
39948#if defined(LIBXML_UNICODE_ENABLED)
39949    int mem_base;
39950    int ret_val;
39951    int code; /* UCS code point */
39952    int n_code;
39953
39954    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39955        mem_base = xmlMemBlocks();
39956        code = gen_int(n_code, 0);
39957
39958        ret_val = xmlUCSIsHebrew(code);
39959        desret_int(ret_val);
39960        call_tests++;
39961        des_int(n_code, code, 0);
39962        xmlResetLastError();
39963        if (mem_base != xmlMemBlocks()) {
39964            printf("Leak of %d blocks found in xmlUCSIsHebrew",
39965	           xmlMemBlocks() - mem_base);
39966	    test_ret++;
39967            printf(" %d", n_code);
39968            printf("\n");
39969        }
39970    }
39971    function_tests++;
39972#endif
39973
39974    return(test_ret);
39975}
39976
39977
39978static int
39979test_xmlUCSIsHighPrivateUseSurrogates(void) {
39980    int test_ret = 0;
39981
39982#if defined(LIBXML_UNICODE_ENABLED)
39983    int mem_base;
39984    int ret_val;
39985    int code; /* UCS code point */
39986    int n_code;
39987
39988    for (n_code = 0;n_code < gen_nb_int;n_code++) {
39989        mem_base = xmlMemBlocks();
39990        code = gen_int(n_code, 0);
39991
39992        ret_val = xmlUCSIsHighPrivateUseSurrogates(code);
39993        desret_int(ret_val);
39994        call_tests++;
39995        des_int(n_code, code, 0);
39996        xmlResetLastError();
39997        if (mem_base != xmlMemBlocks()) {
39998            printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates",
39999	           xmlMemBlocks() - mem_base);
40000	    test_ret++;
40001            printf(" %d", n_code);
40002            printf("\n");
40003        }
40004    }
40005    function_tests++;
40006#endif
40007
40008    return(test_ret);
40009}
40010
40011
40012static int
40013test_xmlUCSIsHighSurrogates(void) {
40014    int test_ret = 0;
40015
40016#if defined(LIBXML_UNICODE_ENABLED)
40017    int mem_base;
40018    int ret_val;
40019    int code; /* UCS code point */
40020    int n_code;
40021
40022    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40023        mem_base = xmlMemBlocks();
40024        code = gen_int(n_code, 0);
40025
40026        ret_val = xmlUCSIsHighSurrogates(code);
40027        desret_int(ret_val);
40028        call_tests++;
40029        des_int(n_code, code, 0);
40030        xmlResetLastError();
40031        if (mem_base != xmlMemBlocks()) {
40032            printf("Leak of %d blocks found in xmlUCSIsHighSurrogates",
40033	           xmlMemBlocks() - mem_base);
40034	    test_ret++;
40035            printf(" %d", n_code);
40036            printf("\n");
40037        }
40038    }
40039    function_tests++;
40040#endif
40041
40042    return(test_ret);
40043}
40044
40045
40046static int
40047test_xmlUCSIsHiragana(void) {
40048    int test_ret = 0;
40049
40050#if defined(LIBXML_UNICODE_ENABLED)
40051    int mem_base;
40052    int ret_val;
40053    int code; /* UCS code point */
40054    int n_code;
40055
40056    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40057        mem_base = xmlMemBlocks();
40058        code = gen_int(n_code, 0);
40059
40060        ret_val = xmlUCSIsHiragana(code);
40061        desret_int(ret_val);
40062        call_tests++;
40063        des_int(n_code, code, 0);
40064        xmlResetLastError();
40065        if (mem_base != xmlMemBlocks()) {
40066            printf("Leak of %d blocks found in xmlUCSIsHiragana",
40067	           xmlMemBlocks() - mem_base);
40068	    test_ret++;
40069            printf(" %d", n_code);
40070            printf("\n");
40071        }
40072    }
40073    function_tests++;
40074#endif
40075
40076    return(test_ret);
40077}
40078
40079
40080static int
40081test_xmlUCSIsIPAExtensions(void) {
40082    int test_ret = 0;
40083
40084#if defined(LIBXML_UNICODE_ENABLED)
40085    int mem_base;
40086    int ret_val;
40087    int code; /* UCS code point */
40088    int n_code;
40089
40090    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40091        mem_base = xmlMemBlocks();
40092        code = gen_int(n_code, 0);
40093
40094        ret_val = xmlUCSIsIPAExtensions(code);
40095        desret_int(ret_val);
40096        call_tests++;
40097        des_int(n_code, code, 0);
40098        xmlResetLastError();
40099        if (mem_base != xmlMemBlocks()) {
40100            printf("Leak of %d blocks found in xmlUCSIsIPAExtensions",
40101	           xmlMemBlocks() - mem_base);
40102	    test_ret++;
40103            printf(" %d", n_code);
40104            printf("\n");
40105        }
40106    }
40107    function_tests++;
40108#endif
40109
40110    return(test_ret);
40111}
40112
40113
40114static int
40115test_xmlUCSIsIdeographicDescriptionCharacters(void) {
40116    int test_ret = 0;
40117
40118#if defined(LIBXML_UNICODE_ENABLED)
40119    int mem_base;
40120    int ret_val;
40121    int code; /* UCS code point */
40122    int n_code;
40123
40124    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40125        mem_base = xmlMemBlocks();
40126        code = gen_int(n_code, 0);
40127
40128        ret_val = xmlUCSIsIdeographicDescriptionCharacters(code);
40129        desret_int(ret_val);
40130        call_tests++;
40131        des_int(n_code, code, 0);
40132        xmlResetLastError();
40133        if (mem_base != xmlMemBlocks()) {
40134            printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters",
40135	           xmlMemBlocks() - mem_base);
40136	    test_ret++;
40137            printf(" %d", n_code);
40138            printf("\n");
40139        }
40140    }
40141    function_tests++;
40142#endif
40143
40144    return(test_ret);
40145}
40146
40147
40148static int
40149test_xmlUCSIsKanbun(void) {
40150    int test_ret = 0;
40151
40152#if defined(LIBXML_UNICODE_ENABLED)
40153    int mem_base;
40154    int ret_val;
40155    int code; /* UCS code point */
40156    int n_code;
40157
40158    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40159        mem_base = xmlMemBlocks();
40160        code = gen_int(n_code, 0);
40161
40162        ret_val = xmlUCSIsKanbun(code);
40163        desret_int(ret_val);
40164        call_tests++;
40165        des_int(n_code, code, 0);
40166        xmlResetLastError();
40167        if (mem_base != xmlMemBlocks()) {
40168            printf("Leak of %d blocks found in xmlUCSIsKanbun",
40169	           xmlMemBlocks() - mem_base);
40170	    test_ret++;
40171            printf(" %d", n_code);
40172            printf("\n");
40173        }
40174    }
40175    function_tests++;
40176#endif
40177
40178    return(test_ret);
40179}
40180
40181
40182static int
40183test_xmlUCSIsKangxiRadicals(void) {
40184    int test_ret = 0;
40185
40186#if defined(LIBXML_UNICODE_ENABLED)
40187    int mem_base;
40188    int ret_val;
40189    int code; /* UCS code point */
40190    int n_code;
40191
40192    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40193        mem_base = xmlMemBlocks();
40194        code = gen_int(n_code, 0);
40195
40196        ret_val = xmlUCSIsKangxiRadicals(code);
40197        desret_int(ret_val);
40198        call_tests++;
40199        des_int(n_code, code, 0);
40200        xmlResetLastError();
40201        if (mem_base != xmlMemBlocks()) {
40202            printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals",
40203	           xmlMemBlocks() - mem_base);
40204	    test_ret++;
40205            printf(" %d", n_code);
40206            printf("\n");
40207        }
40208    }
40209    function_tests++;
40210#endif
40211
40212    return(test_ret);
40213}
40214
40215
40216static int
40217test_xmlUCSIsKannada(void) {
40218    int test_ret = 0;
40219
40220#if defined(LIBXML_UNICODE_ENABLED)
40221    int mem_base;
40222    int ret_val;
40223    int code; /* UCS code point */
40224    int n_code;
40225
40226    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40227        mem_base = xmlMemBlocks();
40228        code = gen_int(n_code, 0);
40229
40230        ret_val = xmlUCSIsKannada(code);
40231        desret_int(ret_val);
40232        call_tests++;
40233        des_int(n_code, code, 0);
40234        xmlResetLastError();
40235        if (mem_base != xmlMemBlocks()) {
40236            printf("Leak of %d blocks found in xmlUCSIsKannada",
40237	           xmlMemBlocks() - mem_base);
40238	    test_ret++;
40239            printf(" %d", n_code);
40240            printf("\n");
40241        }
40242    }
40243    function_tests++;
40244#endif
40245
40246    return(test_ret);
40247}
40248
40249
40250static int
40251test_xmlUCSIsKatakana(void) {
40252    int test_ret = 0;
40253
40254#if defined(LIBXML_UNICODE_ENABLED)
40255    int mem_base;
40256    int ret_val;
40257    int code; /* UCS code point */
40258    int n_code;
40259
40260    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40261        mem_base = xmlMemBlocks();
40262        code = gen_int(n_code, 0);
40263
40264        ret_val = xmlUCSIsKatakana(code);
40265        desret_int(ret_val);
40266        call_tests++;
40267        des_int(n_code, code, 0);
40268        xmlResetLastError();
40269        if (mem_base != xmlMemBlocks()) {
40270            printf("Leak of %d blocks found in xmlUCSIsKatakana",
40271	           xmlMemBlocks() - mem_base);
40272	    test_ret++;
40273            printf(" %d", n_code);
40274            printf("\n");
40275        }
40276    }
40277    function_tests++;
40278#endif
40279
40280    return(test_ret);
40281}
40282
40283
40284static int
40285test_xmlUCSIsKatakanaPhoneticExtensions(void) {
40286    int test_ret = 0;
40287
40288#if defined(LIBXML_UNICODE_ENABLED)
40289    int mem_base;
40290    int ret_val;
40291    int code; /* UCS code point */
40292    int n_code;
40293
40294    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40295        mem_base = xmlMemBlocks();
40296        code = gen_int(n_code, 0);
40297
40298        ret_val = xmlUCSIsKatakanaPhoneticExtensions(code);
40299        desret_int(ret_val);
40300        call_tests++;
40301        des_int(n_code, code, 0);
40302        xmlResetLastError();
40303        if (mem_base != xmlMemBlocks()) {
40304            printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions",
40305	           xmlMemBlocks() - mem_base);
40306	    test_ret++;
40307            printf(" %d", n_code);
40308            printf("\n");
40309        }
40310    }
40311    function_tests++;
40312#endif
40313
40314    return(test_ret);
40315}
40316
40317
40318static int
40319test_xmlUCSIsKhmer(void) {
40320    int test_ret = 0;
40321
40322#if defined(LIBXML_UNICODE_ENABLED)
40323    int mem_base;
40324    int ret_val;
40325    int code; /* UCS code point */
40326    int n_code;
40327
40328    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40329        mem_base = xmlMemBlocks();
40330        code = gen_int(n_code, 0);
40331
40332        ret_val = xmlUCSIsKhmer(code);
40333        desret_int(ret_val);
40334        call_tests++;
40335        des_int(n_code, code, 0);
40336        xmlResetLastError();
40337        if (mem_base != xmlMemBlocks()) {
40338            printf("Leak of %d blocks found in xmlUCSIsKhmer",
40339	           xmlMemBlocks() - mem_base);
40340	    test_ret++;
40341            printf(" %d", n_code);
40342            printf("\n");
40343        }
40344    }
40345    function_tests++;
40346#endif
40347
40348    return(test_ret);
40349}
40350
40351
40352static int
40353test_xmlUCSIsKhmerSymbols(void) {
40354    int test_ret = 0;
40355
40356#if defined(LIBXML_UNICODE_ENABLED)
40357    int mem_base;
40358    int ret_val;
40359    int code; /* UCS code point */
40360    int n_code;
40361
40362    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40363        mem_base = xmlMemBlocks();
40364        code = gen_int(n_code, 0);
40365
40366        ret_val = xmlUCSIsKhmerSymbols(code);
40367        desret_int(ret_val);
40368        call_tests++;
40369        des_int(n_code, code, 0);
40370        xmlResetLastError();
40371        if (mem_base != xmlMemBlocks()) {
40372            printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols",
40373	           xmlMemBlocks() - mem_base);
40374	    test_ret++;
40375            printf(" %d", n_code);
40376            printf("\n");
40377        }
40378    }
40379    function_tests++;
40380#endif
40381
40382    return(test_ret);
40383}
40384
40385
40386static int
40387test_xmlUCSIsLao(void) {
40388    int test_ret = 0;
40389
40390#if defined(LIBXML_UNICODE_ENABLED)
40391    int mem_base;
40392    int ret_val;
40393    int code; /* UCS code point */
40394    int n_code;
40395
40396    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40397        mem_base = xmlMemBlocks();
40398        code = gen_int(n_code, 0);
40399
40400        ret_val = xmlUCSIsLao(code);
40401        desret_int(ret_val);
40402        call_tests++;
40403        des_int(n_code, code, 0);
40404        xmlResetLastError();
40405        if (mem_base != xmlMemBlocks()) {
40406            printf("Leak of %d blocks found in xmlUCSIsLao",
40407	           xmlMemBlocks() - mem_base);
40408	    test_ret++;
40409            printf(" %d", n_code);
40410            printf("\n");
40411        }
40412    }
40413    function_tests++;
40414#endif
40415
40416    return(test_ret);
40417}
40418
40419
40420static int
40421test_xmlUCSIsLatin1Supplement(void) {
40422    int test_ret = 0;
40423
40424#if defined(LIBXML_UNICODE_ENABLED)
40425    int mem_base;
40426    int ret_val;
40427    int code; /* UCS code point */
40428    int n_code;
40429
40430    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40431        mem_base = xmlMemBlocks();
40432        code = gen_int(n_code, 0);
40433
40434        ret_val = xmlUCSIsLatin1Supplement(code);
40435        desret_int(ret_val);
40436        call_tests++;
40437        des_int(n_code, code, 0);
40438        xmlResetLastError();
40439        if (mem_base != xmlMemBlocks()) {
40440            printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement",
40441	           xmlMemBlocks() - mem_base);
40442	    test_ret++;
40443            printf(" %d", n_code);
40444            printf("\n");
40445        }
40446    }
40447    function_tests++;
40448#endif
40449
40450    return(test_ret);
40451}
40452
40453
40454static int
40455test_xmlUCSIsLatinExtendedA(void) {
40456    int test_ret = 0;
40457
40458#if defined(LIBXML_UNICODE_ENABLED)
40459    int mem_base;
40460    int ret_val;
40461    int code; /* UCS code point */
40462    int n_code;
40463
40464    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40465        mem_base = xmlMemBlocks();
40466        code = gen_int(n_code, 0);
40467
40468        ret_val = xmlUCSIsLatinExtendedA(code);
40469        desret_int(ret_val);
40470        call_tests++;
40471        des_int(n_code, code, 0);
40472        xmlResetLastError();
40473        if (mem_base != xmlMemBlocks()) {
40474            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA",
40475	           xmlMemBlocks() - mem_base);
40476	    test_ret++;
40477            printf(" %d", n_code);
40478            printf("\n");
40479        }
40480    }
40481    function_tests++;
40482#endif
40483
40484    return(test_ret);
40485}
40486
40487
40488static int
40489test_xmlUCSIsLatinExtendedAdditional(void) {
40490    int test_ret = 0;
40491
40492#if defined(LIBXML_UNICODE_ENABLED)
40493    int mem_base;
40494    int ret_val;
40495    int code; /* UCS code point */
40496    int n_code;
40497
40498    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40499        mem_base = xmlMemBlocks();
40500        code = gen_int(n_code, 0);
40501
40502        ret_val = xmlUCSIsLatinExtendedAdditional(code);
40503        desret_int(ret_val);
40504        call_tests++;
40505        des_int(n_code, code, 0);
40506        xmlResetLastError();
40507        if (mem_base != xmlMemBlocks()) {
40508            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional",
40509	           xmlMemBlocks() - mem_base);
40510	    test_ret++;
40511            printf(" %d", n_code);
40512            printf("\n");
40513        }
40514    }
40515    function_tests++;
40516#endif
40517
40518    return(test_ret);
40519}
40520
40521
40522static int
40523test_xmlUCSIsLatinExtendedB(void) {
40524    int test_ret = 0;
40525
40526#if defined(LIBXML_UNICODE_ENABLED)
40527    int mem_base;
40528    int ret_val;
40529    int code; /* UCS code point */
40530    int n_code;
40531
40532    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40533        mem_base = xmlMemBlocks();
40534        code = gen_int(n_code, 0);
40535
40536        ret_val = xmlUCSIsLatinExtendedB(code);
40537        desret_int(ret_val);
40538        call_tests++;
40539        des_int(n_code, code, 0);
40540        xmlResetLastError();
40541        if (mem_base != xmlMemBlocks()) {
40542            printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB",
40543	           xmlMemBlocks() - mem_base);
40544	    test_ret++;
40545            printf(" %d", n_code);
40546            printf("\n");
40547        }
40548    }
40549    function_tests++;
40550#endif
40551
40552    return(test_ret);
40553}
40554
40555
40556static int
40557test_xmlUCSIsLetterlikeSymbols(void) {
40558    int test_ret = 0;
40559
40560#if defined(LIBXML_UNICODE_ENABLED)
40561    int mem_base;
40562    int ret_val;
40563    int code; /* UCS code point */
40564    int n_code;
40565
40566    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40567        mem_base = xmlMemBlocks();
40568        code = gen_int(n_code, 0);
40569
40570        ret_val = xmlUCSIsLetterlikeSymbols(code);
40571        desret_int(ret_val);
40572        call_tests++;
40573        des_int(n_code, code, 0);
40574        xmlResetLastError();
40575        if (mem_base != xmlMemBlocks()) {
40576            printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols",
40577	           xmlMemBlocks() - mem_base);
40578	    test_ret++;
40579            printf(" %d", n_code);
40580            printf("\n");
40581        }
40582    }
40583    function_tests++;
40584#endif
40585
40586    return(test_ret);
40587}
40588
40589
40590static int
40591test_xmlUCSIsLimbu(void) {
40592    int test_ret = 0;
40593
40594#if defined(LIBXML_UNICODE_ENABLED)
40595    int mem_base;
40596    int ret_val;
40597    int code; /* UCS code point */
40598    int n_code;
40599
40600    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40601        mem_base = xmlMemBlocks();
40602        code = gen_int(n_code, 0);
40603
40604        ret_val = xmlUCSIsLimbu(code);
40605        desret_int(ret_val);
40606        call_tests++;
40607        des_int(n_code, code, 0);
40608        xmlResetLastError();
40609        if (mem_base != xmlMemBlocks()) {
40610            printf("Leak of %d blocks found in xmlUCSIsLimbu",
40611	           xmlMemBlocks() - mem_base);
40612	    test_ret++;
40613            printf(" %d", n_code);
40614            printf("\n");
40615        }
40616    }
40617    function_tests++;
40618#endif
40619
40620    return(test_ret);
40621}
40622
40623
40624static int
40625test_xmlUCSIsLinearBIdeograms(void) {
40626    int test_ret = 0;
40627
40628#if defined(LIBXML_UNICODE_ENABLED)
40629    int mem_base;
40630    int ret_val;
40631    int code; /* UCS code point */
40632    int n_code;
40633
40634    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40635        mem_base = xmlMemBlocks();
40636        code = gen_int(n_code, 0);
40637
40638        ret_val = xmlUCSIsLinearBIdeograms(code);
40639        desret_int(ret_val);
40640        call_tests++;
40641        des_int(n_code, code, 0);
40642        xmlResetLastError();
40643        if (mem_base != xmlMemBlocks()) {
40644            printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms",
40645	           xmlMemBlocks() - mem_base);
40646	    test_ret++;
40647            printf(" %d", n_code);
40648            printf("\n");
40649        }
40650    }
40651    function_tests++;
40652#endif
40653
40654    return(test_ret);
40655}
40656
40657
40658static int
40659test_xmlUCSIsLinearBSyllabary(void) {
40660    int test_ret = 0;
40661
40662#if defined(LIBXML_UNICODE_ENABLED)
40663    int mem_base;
40664    int ret_val;
40665    int code; /* UCS code point */
40666    int n_code;
40667
40668    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40669        mem_base = xmlMemBlocks();
40670        code = gen_int(n_code, 0);
40671
40672        ret_val = xmlUCSIsLinearBSyllabary(code);
40673        desret_int(ret_val);
40674        call_tests++;
40675        des_int(n_code, code, 0);
40676        xmlResetLastError();
40677        if (mem_base != xmlMemBlocks()) {
40678            printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary",
40679	           xmlMemBlocks() - mem_base);
40680	    test_ret++;
40681            printf(" %d", n_code);
40682            printf("\n");
40683        }
40684    }
40685    function_tests++;
40686#endif
40687
40688    return(test_ret);
40689}
40690
40691
40692static int
40693test_xmlUCSIsLowSurrogates(void) {
40694    int test_ret = 0;
40695
40696#if defined(LIBXML_UNICODE_ENABLED)
40697    int mem_base;
40698    int ret_val;
40699    int code; /* UCS code point */
40700    int n_code;
40701
40702    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40703        mem_base = xmlMemBlocks();
40704        code = gen_int(n_code, 0);
40705
40706        ret_val = xmlUCSIsLowSurrogates(code);
40707        desret_int(ret_val);
40708        call_tests++;
40709        des_int(n_code, code, 0);
40710        xmlResetLastError();
40711        if (mem_base != xmlMemBlocks()) {
40712            printf("Leak of %d blocks found in xmlUCSIsLowSurrogates",
40713	           xmlMemBlocks() - mem_base);
40714	    test_ret++;
40715            printf(" %d", n_code);
40716            printf("\n");
40717        }
40718    }
40719    function_tests++;
40720#endif
40721
40722    return(test_ret);
40723}
40724
40725
40726static int
40727test_xmlUCSIsMalayalam(void) {
40728    int test_ret = 0;
40729
40730#if defined(LIBXML_UNICODE_ENABLED)
40731    int mem_base;
40732    int ret_val;
40733    int code; /* UCS code point */
40734    int n_code;
40735
40736    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40737        mem_base = xmlMemBlocks();
40738        code = gen_int(n_code, 0);
40739
40740        ret_val = xmlUCSIsMalayalam(code);
40741        desret_int(ret_val);
40742        call_tests++;
40743        des_int(n_code, code, 0);
40744        xmlResetLastError();
40745        if (mem_base != xmlMemBlocks()) {
40746            printf("Leak of %d blocks found in xmlUCSIsMalayalam",
40747	           xmlMemBlocks() - mem_base);
40748	    test_ret++;
40749            printf(" %d", n_code);
40750            printf("\n");
40751        }
40752    }
40753    function_tests++;
40754#endif
40755
40756    return(test_ret);
40757}
40758
40759
40760static int
40761test_xmlUCSIsMathematicalAlphanumericSymbols(void) {
40762    int test_ret = 0;
40763
40764#if defined(LIBXML_UNICODE_ENABLED)
40765    int mem_base;
40766    int ret_val;
40767    int code; /* UCS code point */
40768    int n_code;
40769
40770    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40771        mem_base = xmlMemBlocks();
40772        code = gen_int(n_code, 0);
40773
40774        ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code);
40775        desret_int(ret_val);
40776        call_tests++;
40777        des_int(n_code, code, 0);
40778        xmlResetLastError();
40779        if (mem_base != xmlMemBlocks()) {
40780            printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols",
40781	           xmlMemBlocks() - mem_base);
40782	    test_ret++;
40783            printf(" %d", n_code);
40784            printf("\n");
40785        }
40786    }
40787    function_tests++;
40788#endif
40789
40790    return(test_ret);
40791}
40792
40793
40794static int
40795test_xmlUCSIsMathematicalOperators(void) {
40796    int test_ret = 0;
40797
40798#if defined(LIBXML_UNICODE_ENABLED)
40799    int mem_base;
40800    int ret_val;
40801    int code; /* UCS code point */
40802    int n_code;
40803
40804    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40805        mem_base = xmlMemBlocks();
40806        code = gen_int(n_code, 0);
40807
40808        ret_val = xmlUCSIsMathematicalOperators(code);
40809        desret_int(ret_val);
40810        call_tests++;
40811        des_int(n_code, code, 0);
40812        xmlResetLastError();
40813        if (mem_base != xmlMemBlocks()) {
40814            printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators",
40815	           xmlMemBlocks() - mem_base);
40816	    test_ret++;
40817            printf(" %d", n_code);
40818            printf("\n");
40819        }
40820    }
40821    function_tests++;
40822#endif
40823
40824    return(test_ret);
40825}
40826
40827
40828static int
40829test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) {
40830    int test_ret = 0;
40831
40832#if defined(LIBXML_UNICODE_ENABLED)
40833    int mem_base;
40834    int ret_val;
40835    int code; /* UCS code point */
40836    int n_code;
40837
40838    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40839        mem_base = xmlMemBlocks();
40840        code = gen_int(n_code, 0);
40841
40842        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code);
40843        desret_int(ret_val);
40844        call_tests++;
40845        des_int(n_code, code, 0);
40846        xmlResetLastError();
40847        if (mem_base != xmlMemBlocks()) {
40848            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA",
40849	           xmlMemBlocks() - mem_base);
40850	    test_ret++;
40851            printf(" %d", n_code);
40852            printf("\n");
40853        }
40854    }
40855    function_tests++;
40856#endif
40857
40858    return(test_ret);
40859}
40860
40861
40862static int
40863test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) {
40864    int test_ret = 0;
40865
40866#if defined(LIBXML_UNICODE_ENABLED)
40867    int mem_base;
40868    int ret_val;
40869    int code; /* UCS code point */
40870    int n_code;
40871
40872    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40873        mem_base = xmlMemBlocks();
40874        code = gen_int(n_code, 0);
40875
40876        ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code);
40877        desret_int(ret_val);
40878        call_tests++;
40879        des_int(n_code, code, 0);
40880        xmlResetLastError();
40881        if (mem_base != xmlMemBlocks()) {
40882            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB",
40883	           xmlMemBlocks() - mem_base);
40884	    test_ret++;
40885            printf(" %d", n_code);
40886            printf("\n");
40887        }
40888    }
40889    function_tests++;
40890#endif
40891
40892    return(test_ret);
40893}
40894
40895
40896static int
40897test_xmlUCSIsMiscellaneousSymbols(void) {
40898    int test_ret = 0;
40899
40900#if defined(LIBXML_UNICODE_ENABLED)
40901    int mem_base;
40902    int ret_val;
40903    int code; /* UCS code point */
40904    int n_code;
40905
40906    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40907        mem_base = xmlMemBlocks();
40908        code = gen_int(n_code, 0);
40909
40910        ret_val = xmlUCSIsMiscellaneousSymbols(code);
40911        desret_int(ret_val);
40912        call_tests++;
40913        des_int(n_code, code, 0);
40914        xmlResetLastError();
40915        if (mem_base != xmlMemBlocks()) {
40916            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols",
40917	           xmlMemBlocks() - mem_base);
40918	    test_ret++;
40919            printf(" %d", n_code);
40920            printf("\n");
40921        }
40922    }
40923    function_tests++;
40924#endif
40925
40926    return(test_ret);
40927}
40928
40929
40930static int
40931test_xmlUCSIsMiscellaneousSymbolsandArrows(void) {
40932    int test_ret = 0;
40933
40934#if defined(LIBXML_UNICODE_ENABLED)
40935    int mem_base;
40936    int ret_val;
40937    int code; /* UCS code point */
40938    int n_code;
40939
40940    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40941        mem_base = xmlMemBlocks();
40942        code = gen_int(n_code, 0);
40943
40944        ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code);
40945        desret_int(ret_val);
40946        call_tests++;
40947        des_int(n_code, code, 0);
40948        xmlResetLastError();
40949        if (mem_base != xmlMemBlocks()) {
40950            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows",
40951	           xmlMemBlocks() - mem_base);
40952	    test_ret++;
40953            printf(" %d", n_code);
40954            printf("\n");
40955        }
40956    }
40957    function_tests++;
40958#endif
40959
40960    return(test_ret);
40961}
40962
40963
40964static int
40965test_xmlUCSIsMiscellaneousTechnical(void) {
40966    int test_ret = 0;
40967
40968#if defined(LIBXML_UNICODE_ENABLED)
40969    int mem_base;
40970    int ret_val;
40971    int code; /* UCS code point */
40972    int n_code;
40973
40974    for (n_code = 0;n_code < gen_nb_int;n_code++) {
40975        mem_base = xmlMemBlocks();
40976        code = gen_int(n_code, 0);
40977
40978        ret_val = xmlUCSIsMiscellaneousTechnical(code);
40979        desret_int(ret_val);
40980        call_tests++;
40981        des_int(n_code, code, 0);
40982        xmlResetLastError();
40983        if (mem_base != xmlMemBlocks()) {
40984            printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical",
40985	           xmlMemBlocks() - mem_base);
40986	    test_ret++;
40987            printf(" %d", n_code);
40988            printf("\n");
40989        }
40990    }
40991    function_tests++;
40992#endif
40993
40994    return(test_ret);
40995}
40996
40997
40998static int
40999test_xmlUCSIsMongolian(void) {
41000    int test_ret = 0;
41001
41002#if defined(LIBXML_UNICODE_ENABLED)
41003    int mem_base;
41004    int ret_val;
41005    int code; /* UCS code point */
41006    int n_code;
41007
41008    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41009        mem_base = xmlMemBlocks();
41010        code = gen_int(n_code, 0);
41011
41012        ret_val = xmlUCSIsMongolian(code);
41013        desret_int(ret_val);
41014        call_tests++;
41015        des_int(n_code, code, 0);
41016        xmlResetLastError();
41017        if (mem_base != xmlMemBlocks()) {
41018            printf("Leak of %d blocks found in xmlUCSIsMongolian",
41019	           xmlMemBlocks() - mem_base);
41020	    test_ret++;
41021            printf(" %d", n_code);
41022            printf("\n");
41023        }
41024    }
41025    function_tests++;
41026#endif
41027
41028    return(test_ret);
41029}
41030
41031
41032static int
41033test_xmlUCSIsMusicalSymbols(void) {
41034    int test_ret = 0;
41035
41036#if defined(LIBXML_UNICODE_ENABLED)
41037    int mem_base;
41038    int ret_val;
41039    int code; /* UCS code point */
41040    int n_code;
41041
41042    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41043        mem_base = xmlMemBlocks();
41044        code = gen_int(n_code, 0);
41045
41046        ret_val = xmlUCSIsMusicalSymbols(code);
41047        desret_int(ret_val);
41048        call_tests++;
41049        des_int(n_code, code, 0);
41050        xmlResetLastError();
41051        if (mem_base != xmlMemBlocks()) {
41052            printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols",
41053	           xmlMemBlocks() - mem_base);
41054	    test_ret++;
41055            printf(" %d", n_code);
41056            printf("\n");
41057        }
41058    }
41059    function_tests++;
41060#endif
41061
41062    return(test_ret);
41063}
41064
41065
41066static int
41067test_xmlUCSIsMyanmar(void) {
41068    int test_ret = 0;
41069
41070#if defined(LIBXML_UNICODE_ENABLED)
41071    int mem_base;
41072    int ret_val;
41073    int code; /* UCS code point */
41074    int n_code;
41075
41076    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41077        mem_base = xmlMemBlocks();
41078        code = gen_int(n_code, 0);
41079
41080        ret_val = xmlUCSIsMyanmar(code);
41081        desret_int(ret_val);
41082        call_tests++;
41083        des_int(n_code, code, 0);
41084        xmlResetLastError();
41085        if (mem_base != xmlMemBlocks()) {
41086            printf("Leak of %d blocks found in xmlUCSIsMyanmar",
41087	           xmlMemBlocks() - mem_base);
41088	    test_ret++;
41089            printf(" %d", n_code);
41090            printf("\n");
41091        }
41092    }
41093    function_tests++;
41094#endif
41095
41096    return(test_ret);
41097}
41098
41099
41100static int
41101test_xmlUCSIsNumberForms(void) {
41102    int test_ret = 0;
41103
41104#if defined(LIBXML_UNICODE_ENABLED)
41105    int mem_base;
41106    int ret_val;
41107    int code; /* UCS code point */
41108    int n_code;
41109
41110    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41111        mem_base = xmlMemBlocks();
41112        code = gen_int(n_code, 0);
41113
41114        ret_val = xmlUCSIsNumberForms(code);
41115        desret_int(ret_val);
41116        call_tests++;
41117        des_int(n_code, code, 0);
41118        xmlResetLastError();
41119        if (mem_base != xmlMemBlocks()) {
41120            printf("Leak of %d blocks found in xmlUCSIsNumberForms",
41121	           xmlMemBlocks() - mem_base);
41122	    test_ret++;
41123            printf(" %d", n_code);
41124            printf("\n");
41125        }
41126    }
41127    function_tests++;
41128#endif
41129
41130    return(test_ret);
41131}
41132
41133
41134static int
41135test_xmlUCSIsOgham(void) {
41136    int test_ret = 0;
41137
41138#if defined(LIBXML_UNICODE_ENABLED)
41139    int mem_base;
41140    int ret_val;
41141    int code; /* UCS code point */
41142    int n_code;
41143
41144    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41145        mem_base = xmlMemBlocks();
41146        code = gen_int(n_code, 0);
41147
41148        ret_val = xmlUCSIsOgham(code);
41149        desret_int(ret_val);
41150        call_tests++;
41151        des_int(n_code, code, 0);
41152        xmlResetLastError();
41153        if (mem_base != xmlMemBlocks()) {
41154            printf("Leak of %d blocks found in xmlUCSIsOgham",
41155	           xmlMemBlocks() - mem_base);
41156	    test_ret++;
41157            printf(" %d", n_code);
41158            printf("\n");
41159        }
41160    }
41161    function_tests++;
41162#endif
41163
41164    return(test_ret);
41165}
41166
41167
41168static int
41169test_xmlUCSIsOldItalic(void) {
41170    int test_ret = 0;
41171
41172#if defined(LIBXML_UNICODE_ENABLED)
41173    int mem_base;
41174    int ret_val;
41175    int code; /* UCS code point */
41176    int n_code;
41177
41178    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41179        mem_base = xmlMemBlocks();
41180        code = gen_int(n_code, 0);
41181
41182        ret_val = xmlUCSIsOldItalic(code);
41183        desret_int(ret_val);
41184        call_tests++;
41185        des_int(n_code, code, 0);
41186        xmlResetLastError();
41187        if (mem_base != xmlMemBlocks()) {
41188            printf("Leak of %d blocks found in xmlUCSIsOldItalic",
41189	           xmlMemBlocks() - mem_base);
41190	    test_ret++;
41191            printf(" %d", n_code);
41192            printf("\n");
41193        }
41194    }
41195    function_tests++;
41196#endif
41197
41198    return(test_ret);
41199}
41200
41201
41202static int
41203test_xmlUCSIsOpticalCharacterRecognition(void) {
41204    int test_ret = 0;
41205
41206#if defined(LIBXML_UNICODE_ENABLED)
41207    int mem_base;
41208    int ret_val;
41209    int code; /* UCS code point */
41210    int n_code;
41211
41212    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41213        mem_base = xmlMemBlocks();
41214        code = gen_int(n_code, 0);
41215
41216        ret_val = xmlUCSIsOpticalCharacterRecognition(code);
41217        desret_int(ret_val);
41218        call_tests++;
41219        des_int(n_code, code, 0);
41220        xmlResetLastError();
41221        if (mem_base != xmlMemBlocks()) {
41222            printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition",
41223	           xmlMemBlocks() - mem_base);
41224	    test_ret++;
41225            printf(" %d", n_code);
41226            printf("\n");
41227        }
41228    }
41229    function_tests++;
41230#endif
41231
41232    return(test_ret);
41233}
41234
41235
41236static int
41237test_xmlUCSIsOriya(void) {
41238    int test_ret = 0;
41239
41240#if defined(LIBXML_UNICODE_ENABLED)
41241    int mem_base;
41242    int ret_val;
41243    int code; /* UCS code point */
41244    int n_code;
41245
41246    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41247        mem_base = xmlMemBlocks();
41248        code = gen_int(n_code, 0);
41249
41250        ret_val = xmlUCSIsOriya(code);
41251        desret_int(ret_val);
41252        call_tests++;
41253        des_int(n_code, code, 0);
41254        xmlResetLastError();
41255        if (mem_base != xmlMemBlocks()) {
41256            printf("Leak of %d blocks found in xmlUCSIsOriya",
41257	           xmlMemBlocks() - mem_base);
41258	    test_ret++;
41259            printf(" %d", n_code);
41260            printf("\n");
41261        }
41262    }
41263    function_tests++;
41264#endif
41265
41266    return(test_ret);
41267}
41268
41269
41270static int
41271test_xmlUCSIsOsmanya(void) {
41272    int test_ret = 0;
41273
41274#if defined(LIBXML_UNICODE_ENABLED)
41275    int mem_base;
41276    int ret_val;
41277    int code; /* UCS code point */
41278    int n_code;
41279
41280    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41281        mem_base = xmlMemBlocks();
41282        code = gen_int(n_code, 0);
41283
41284        ret_val = xmlUCSIsOsmanya(code);
41285        desret_int(ret_val);
41286        call_tests++;
41287        des_int(n_code, code, 0);
41288        xmlResetLastError();
41289        if (mem_base != xmlMemBlocks()) {
41290            printf("Leak of %d blocks found in xmlUCSIsOsmanya",
41291	           xmlMemBlocks() - mem_base);
41292	    test_ret++;
41293            printf(" %d", n_code);
41294            printf("\n");
41295        }
41296    }
41297    function_tests++;
41298#endif
41299
41300    return(test_ret);
41301}
41302
41303
41304static int
41305test_xmlUCSIsPhoneticExtensions(void) {
41306    int test_ret = 0;
41307
41308#if defined(LIBXML_UNICODE_ENABLED)
41309    int mem_base;
41310    int ret_val;
41311    int code; /* UCS code point */
41312    int n_code;
41313
41314    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41315        mem_base = xmlMemBlocks();
41316        code = gen_int(n_code, 0);
41317
41318        ret_val = xmlUCSIsPhoneticExtensions(code);
41319        desret_int(ret_val);
41320        call_tests++;
41321        des_int(n_code, code, 0);
41322        xmlResetLastError();
41323        if (mem_base != xmlMemBlocks()) {
41324            printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions",
41325	           xmlMemBlocks() - mem_base);
41326	    test_ret++;
41327            printf(" %d", n_code);
41328            printf("\n");
41329        }
41330    }
41331    function_tests++;
41332#endif
41333
41334    return(test_ret);
41335}
41336
41337
41338static int
41339test_xmlUCSIsPrivateUse(void) {
41340    int test_ret = 0;
41341
41342#if defined(LIBXML_UNICODE_ENABLED)
41343    int mem_base;
41344    int ret_val;
41345    int code; /* UCS code point */
41346    int n_code;
41347
41348    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41349        mem_base = xmlMemBlocks();
41350        code = gen_int(n_code, 0);
41351
41352        ret_val = xmlUCSIsPrivateUse(code);
41353        desret_int(ret_val);
41354        call_tests++;
41355        des_int(n_code, code, 0);
41356        xmlResetLastError();
41357        if (mem_base != xmlMemBlocks()) {
41358            printf("Leak of %d blocks found in xmlUCSIsPrivateUse",
41359	           xmlMemBlocks() - mem_base);
41360	    test_ret++;
41361            printf(" %d", n_code);
41362            printf("\n");
41363        }
41364    }
41365    function_tests++;
41366#endif
41367
41368    return(test_ret);
41369}
41370
41371
41372static int
41373test_xmlUCSIsPrivateUseArea(void) {
41374    int test_ret = 0;
41375
41376#if defined(LIBXML_UNICODE_ENABLED)
41377    int mem_base;
41378    int ret_val;
41379    int code; /* UCS code point */
41380    int n_code;
41381
41382    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41383        mem_base = xmlMemBlocks();
41384        code = gen_int(n_code, 0);
41385
41386        ret_val = xmlUCSIsPrivateUseArea(code);
41387        desret_int(ret_val);
41388        call_tests++;
41389        des_int(n_code, code, 0);
41390        xmlResetLastError();
41391        if (mem_base != xmlMemBlocks()) {
41392            printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea",
41393	           xmlMemBlocks() - mem_base);
41394	    test_ret++;
41395            printf(" %d", n_code);
41396            printf("\n");
41397        }
41398    }
41399    function_tests++;
41400#endif
41401
41402    return(test_ret);
41403}
41404
41405
41406static int
41407test_xmlUCSIsRunic(void) {
41408    int test_ret = 0;
41409
41410#if defined(LIBXML_UNICODE_ENABLED)
41411    int mem_base;
41412    int ret_val;
41413    int code; /* UCS code point */
41414    int n_code;
41415
41416    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41417        mem_base = xmlMemBlocks();
41418        code = gen_int(n_code, 0);
41419
41420        ret_val = xmlUCSIsRunic(code);
41421        desret_int(ret_val);
41422        call_tests++;
41423        des_int(n_code, code, 0);
41424        xmlResetLastError();
41425        if (mem_base != xmlMemBlocks()) {
41426            printf("Leak of %d blocks found in xmlUCSIsRunic",
41427	           xmlMemBlocks() - mem_base);
41428	    test_ret++;
41429            printf(" %d", n_code);
41430            printf("\n");
41431        }
41432    }
41433    function_tests++;
41434#endif
41435
41436    return(test_ret);
41437}
41438
41439
41440static int
41441test_xmlUCSIsShavian(void) {
41442    int test_ret = 0;
41443
41444#if defined(LIBXML_UNICODE_ENABLED)
41445    int mem_base;
41446    int ret_val;
41447    int code; /* UCS code point */
41448    int n_code;
41449
41450    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41451        mem_base = xmlMemBlocks();
41452        code = gen_int(n_code, 0);
41453
41454        ret_val = xmlUCSIsShavian(code);
41455        desret_int(ret_val);
41456        call_tests++;
41457        des_int(n_code, code, 0);
41458        xmlResetLastError();
41459        if (mem_base != xmlMemBlocks()) {
41460            printf("Leak of %d blocks found in xmlUCSIsShavian",
41461	           xmlMemBlocks() - mem_base);
41462	    test_ret++;
41463            printf(" %d", n_code);
41464            printf("\n");
41465        }
41466    }
41467    function_tests++;
41468#endif
41469
41470    return(test_ret);
41471}
41472
41473
41474static int
41475test_xmlUCSIsSinhala(void) {
41476    int test_ret = 0;
41477
41478#if defined(LIBXML_UNICODE_ENABLED)
41479    int mem_base;
41480    int ret_val;
41481    int code; /* UCS code point */
41482    int n_code;
41483
41484    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41485        mem_base = xmlMemBlocks();
41486        code = gen_int(n_code, 0);
41487
41488        ret_val = xmlUCSIsSinhala(code);
41489        desret_int(ret_val);
41490        call_tests++;
41491        des_int(n_code, code, 0);
41492        xmlResetLastError();
41493        if (mem_base != xmlMemBlocks()) {
41494            printf("Leak of %d blocks found in xmlUCSIsSinhala",
41495	           xmlMemBlocks() - mem_base);
41496	    test_ret++;
41497            printf(" %d", n_code);
41498            printf("\n");
41499        }
41500    }
41501    function_tests++;
41502#endif
41503
41504    return(test_ret);
41505}
41506
41507
41508static int
41509test_xmlUCSIsSmallFormVariants(void) {
41510    int test_ret = 0;
41511
41512#if defined(LIBXML_UNICODE_ENABLED)
41513    int mem_base;
41514    int ret_val;
41515    int code; /* UCS code point */
41516    int n_code;
41517
41518    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41519        mem_base = xmlMemBlocks();
41520        code = gen_int(n_code, 0);
41521
41522        ret_val = xmlUCSIsSmallFormVariants(code);
41523        desret_int(ret_val);
41524        call_tests++;
41525        des_int(n_code, code, 0);
41526        xmlResetLastError();
41527        if (mem_base != xmlMemBlocks()) {
41528            printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants",
41529	           xmlMemBlocks() - mem_base);
41530	    test_ret++;
41531            printf(" %d", n_code);
41532            printf("\n");
41533        }
41534    }
41535    function_tests++;
41536#endif
41537
41538    return(test_ret);
41539}
41540
41541
41542static int
41543test_xmlUCSIsSpacingModifierLetters(void) {
41544    int test_ret = 0;
41545
41546#if defined(LIBXML_UNICODE_ENABLED)
41547    int mem_base;
41548    int ret_val;
41549    int code; /* UCS code point */
41550    int n_code;
41551
41552    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41553        mem_base = xmlMemBlocks();
41554        code = gen_int(n_code, 0);
41555
41556        ret_val = xmlUCSIsSpacingModifierLetters(code);
41557        desret_int(ret_val);
41558        call_tests++;
41559        des_int(n_code, code, 0);
41560        xmlResetLastError();
41561        if (mem_base != xmlMemBlocks()) {
41562            printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters",
41563	           xmlMemBlocks() - mem_base);
41564	    test_ret++;
41565            printf(" %d", n_code);
41566            printf("\n");
41567        }
41568    }
41569    function_tests++;
41570#endif
41571
41572    return(test_ret);
41573}
41574
41575
41576static int
41577test_xmlUCSIsSpecials(void) {
41578    int test_ret = 0;
41579
41580#if defined(LIBXML_UNICODE_ENABLED)
41581    int mem_base;
41582    int ret_val;
41583    int code; /* UCS code point */
41584    int n_code;
41585
41586    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41587        mem_base = xmlMemBlocks();
41588        code = gen_int(n_code, 0);
41589
41590        ret_val = xmlUCSIsSpecials(code);
41591        desret_int(ret_val);
41592        call_tests++;
41593        des_int(n_code, code, 0);
41594        xmlResetLastError();
41595        if (mem_base != xmlMemBlocks()) {
41596            printf("Leak of %d blocks found in xmlUCSIsSpecials",
41597	           xmlMemBlocks() - mem_base);
41598	    test_ret++;
41599            printf(" %d", n_code);
41600            printf("\n");
41601        }
41602    }
41603    function_tests++;
41604#endif
41605
41606    return(test_ret);
41607}
41608
41609
41610static int
41611test_xmlUCSIsSuperscriptsandSubscripts(void) {
41612    int test_ret = 0;
41613
41614#if defined(LIBXML_UNICODE_ENABLED)
41615    int mem_base;
41616    int ret_val;
41617    int code; /* UCS code point */
41618    int n_code;
41619
41620    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41621        mem_base = xmlMemBlocks();
41622        code = gen_int(n_code, 0);
41623
41624        ret_val = xmlUCSIsSuperscriptsandSubscripts(code);
41625        desret_int(ret_val);
41626        call_tests++;
41627        des_int(n_code, code, 0);
41628        xmlResetLastError();
41629        if (mem_base != xmlMemBlocks()) {
41630            printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts",
41631	           xmlMemBlocks() - mem_base);
41632	    test_ret++;
41633            printf(" %d", n_code);
41634            printf("\n");
41635        }
41636    }
41637    function_tests++;
41638#endif
41639
41640    return(test_ret);
41641}
41642
41643
41644static int
41645test_xmlUCSIsSupplementalArrowsA(void) {
41646    int test_ret = 0;
41647
41648#if defined(LIBXML_UNICODE_ENABLED)
41649    int mem_base;
41650    int ret_val;
41651    int code; /* UCS code point */
41652    int n_code;
41653
41654    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41655        mem_base = xmlMemBlocks();
41656        code = gen_int(n_code, 0);
41657
41658        ret_val = xmlUCSIsSupplementalArrowsA(code);
41659        desret_int(ret_val);
41660        call_tests++;
41661        des_int(n_code, code, 0);
41662        xmlResetLastError();
41663        if (mem_base != xmlMemBlocks()) {
41664            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA",
41665	           xmlMemBlocks() - mem_base);
41666	    test_ret++;
41667            printf(" %d", n_code);
41668            printf("\n");
41669        }
41670    }
41671    function_tests++;
41672#endif
41673
41674    return(test_ret);
41675}
41676
41677
41678static int
41679test_xmlUCSIsSupplementalArrowsB(void) {
41680    int test_ret = 0;
41681
41682#if defined(LIBXML_UNICODE_ENABLED)
41683    int mem_base;
41684    int ret_val;
41685    int code; /* UCS code point */
41686    int n_code;
41687
41688    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41689        mem_base = xmlMemBlocks();
41690        code = gen_int(n_code, 0);
41691
41692        ret_val = xmlUCSIsSupplementalArrowsB(code);
41693        desret_int(ret_val);
41694        call_tests++;
41695        des_int(n_code, code, 0);
41696        xmlResetLastError();
41697        if (mem_base != xmlMemBlocks()) {
41698            printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB",
41699	           xmlMemBlocks() - mem_base);
41700	    test_ret++;
41701            printf(" %d", n_code);
41702            printf("\n");
41703        }
41704    }
41705    function_tests++;
41706#endif
41707
41708    return(test_ret);
41709}
41710
41711
41712static int
41713test_xmlUCSIsSupplementalMathematicalOperators(void) {
41714    int test_ret = 0;
41715
41716#if defined(LIBXML_UNICODE_ENABLED)
41717    int mem_base;
41718    int ret_val;
41719    int code; /* UCS code point */
41720    int n_code;
41721
41722    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41723        mem_base = xmlMemBlocks();
41724        code = gen_int(n_code, 0);
41725
41726        ret_val = xmlUCSIsSupplementalMathematicalOperators(code);
41727        desret_int(ret_val);
41728        call_tests++;
41729        des_int(n_code, code, 0);
41730        xmlResetLastError();
41731        if (mem_base != xmlMemBlocks()) {
41732            printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators",
41733	           xmlMemBlocks() - mem_base);
41734	    test_ret++;
41735            printf(" %d", n_code);
41736            printf("\n");
41737        }
41738    }
41739    function_tests++;
41740#endif
41741
41742    return(test_ret);
41743}
41744
41745
41746static int
41747test_xmlUCSIsSupplementaryPrivateUseAreaA(void) {
41748    int test_ret = 0;
41749
41750#if defined(LIBXML_UNICODE_ENABLED)
41751    int mem_base;
41752    int ret_val;
41753    int code; /* UCS code point */
41754    int n_code;
41755
41756    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41757        mem_base = xmlMemBlocks();
41758        code = gen_int(n_code, 0);
41759
41760        ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code);
41761        desret_int(ret_val);
41762        call_tests++;
41763        des_int(n_code, code, 0);
41764        xmlResetLastError();
41765        if (mem_base != xmlMemBlocks()) {
41766            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA",
41767	           xmlMemBlocks() - mem_base);
41768	    test_ret++;
41769            printf(" %d", n_code);
41770            printf("\n");
41771        }
41772    }
41773    function_tests++;
41774#endif
41775
41776    return(test_ret);
41777}
41778
41779
41780static int
41781test_xmlUCSIsSupplementaryPrivateUseAreaB(void) {
41782    int test_ret = 0;
41783
41784#if defined(LIBXML_UNICODE_ENABLED)
41785    int mem_base;
41786    int ret_val;
41787    int code; /* UCS code point */
41788    int n_code;
41789
41790    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41791        mem_base = xmlMemBlocks();
41792        code = gen_int(n_code, 0);
41793
41794        ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code);
41795        desret_int(ret_val);
41796        call_tests++;
41797        des_int(n_code, code, 0);
41798        xmlResetLastError();
41799        if (mem_base != xmlMemBlocks()) {
41800            printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB",
41801	           xmlMemBlocks() - mem_base);
41802	    test_ret++;
41803            printf(" %d", n_code);
41804            printf("\n");
41805        }
41806    }
41807    function_tests++;
41808#endif
41809
41810    return(test_ret);
41811}
41812
41813
41814static int
41815test_xmlUCSIsSyriac(void) {
41816    int test_ret = 0;
41817
41818#if defined(LIBXML_UNICODE_ENABLED)
41819    int mem_base;
41820    int ret_val;
41821    int code; /* UCS code point */
41822    int n_code;
41823
41824    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41825        mem_base = xmlMemBlocks();
41826        code = gen_int(n_code, 0);
41827
41828        ret_val = xmlUCSIsSyriac(code);
41829        desret_int(ret_val);
41830        call_tests++;
41831        des_int(n_code, code, 0);
41832        xmlResetLastError();
41833        if (mem_base != xmlMemBlocks()) {
41834            printf("Leak of %d blocks found in xmlUCSIsSyriac",
41835	           xmlMemBlocks() - mem_base);
41836	    test_ret++;
41837            printf(" %d", n_code);
41838            printf("\n");
41839        }
41840    }
41841    function_tests++;
41842#endif
41843
41844    return(test_ret);
41845}
41846
41847
41848static int
41849test_xmlUCSIsTagalog(void) {
41850    int test_ret = 0;
41851
41852#if defined(LIBXML_UNICODE_ENABLED)
41853    int mem_base;
41854    int ret_val;
41855    int code; /* UCS code point */
41856    int n_code;
41857
41858    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41859        mem_base = xmlMemBlocks();
41860        code = gen_int(n_code, 0);
41861
41862        ret_val = xmlUCSIsTagalog(code);
41863        desret_int(ret_val);
41864        call_tests++;
41865        des_int(n_code, code, 0);
41866        xmlResetLastError();
41867        if (mem_base != xmlMemBlocks()) {
41868            printf("Leak of %d blocks found in xmlUCSIsTagalog",
41869	           xmlMemBlocks() - mem_base);
41870	    test_ret++;
41871            printf(" %d", n_code);
41872            printf("\n");
41873        }
41874    }
41875    function_tests++;
41876#endif
41877
41878    return(test_ret);
41879}
41880
41881
41882static int
41883test_xmlUCSIsTagbanwa(void) {
41884    int test_ret = 0;
41885
41886#if defined(LIBXML_UNICODE_ENABLED)
41887    int mem_base;
41888    int ret_val;
41889    int code; /* UCS code point */
41890    int n_code;
41891
41892    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41893        mem_base = xmlMemBlocks();
41894        code = gen_int(n_code, 0);
41895
41896        ret_val = xmlUCSIsTagbanwa(code);
41897        desret_int(ret_val);
41898        call_tests++;
41899        des_int(n_code, code, 0);
41900        xmlResetLastError();
41901        if (mem_base != xmlMemBlocks()) {
41902            printf("Leak of %d blocks found in xmlUCSIsTagbanwa",
41903	           xmlMemBlocks() - mem_base);
41904	    test_ret++;
41905            printf(" %d", n_code);
41906            printf("\n");
41907        }
41908    }
41909    function_tests++;
41910#endif
41911
41912    return(test_ret);
41913}
41914
41915
41916static int
41917test_xmlUCSIsTags(void) {
41918    int test_ret = 0;
41919
41920#if defined(LIBXML_UNICODE_ENABLED)
41921    int mem_base;
41922    int ret_val;
41923    int code; /* UCS code point */
41924    int n_code;
41925
41926    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41927        mem_base = xmlMemBlocks();
41928        code = gen_int(n_code, 0);
41929
41930        ret_val = xmlUCSIsTags(code);
41931        desret_int(ret_val);
41932        call_tests++;
41933        des_int(n_code, code, 0);
41934        xmlResetLastError();
41935        if (mem_base != xmlMemBlocks()) {
41936            printf("Leak of %d blocks found in xmlUCSIsTags",
41937	           xmlMemBlocks() - mem_base);
41938	    test_ret++;
41939            printf(" %d", n_code);
41940            printf("\n");
41941        }
41942    }
41943    function_tests++;
41944#endif
41945
41946    return(test_ret);
41947}
41948
41949
41950static int
41951test_xmlUCSIsTaiLe(void) {
41952    int test_ret = 0;
41953
41954#if defined(LIBXML_UNICODE_ENABLED)
41955    int mem_base;
41956    int ret_val;
41957    int code; /* UCS code point */
41958    int n_code;
41959
41960    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41961        mem_base = xmlMemBlocks();
41962        code = gen_int(n_code, 0);
41963
41964        ret_val = xmlUCSIsTaiLe(code);
41965        desret_int(ret_val);
41966        call_tests++;
41967        des_int(n_code, code, 0);
41968        xmlResetLastError();
41969        if (mem_base != xmlMemBlocks()) {
41970            printf("Leak of %d blocks found in xmlUCSIsTaiLe",
41971	           xmlMemBlocks() - mem_base);
41972	    test_ret++;
41973            printf(" %d", n_code);
41974            printf("\n");
41975        }
41976    }
41977    function_tests++;
41978#endif
41979
41980    return(test_ret);
41981}
41982
41983
41984static int
41985test_xmlUCSIsTaiXuanJingSymbols(void) {
41986    int test_ret = 0;
41987
41988#if defined(LIBXML_UNICODE_ENABLED)
41989    int mem_base;
41990    int ret_val;
41991    int code; /* UCS code point */
41992    int n_code;
41993
41994    for (n_code = 0;n_code < gen_nb_int;n_code++) {
41995        mem_base = xmlMemBlocks();
41996        code = gen_int(n_code, 0);
41997
41998        ret_val = xmlUCSIsTaiXuanJingSymbols(code);
41999        desret_int(ret_val);
42000        call_tests++;
42001        des_int(n_code, code, 0);
42002        xmlResetLastError();
42003        if (mem_base != xmlMemBlocks()) {
42004            printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols",
42005	           xmlMemBlocks() - mem_base);
42006	    test_ret++;
42007            printf(" %d", n_code);
42008            printf("\n");
42009        }
42010    }
42011    function_tests++;
42012#endif
42013
42014    return(test_ret);
42015}
42016
42017
42018static int
42019test_xmlUCSIsTamil(void) {
42020    int test_ret = 0;
42021
42022#if defined(LIBXML_UNICODE_ENABLED)
42023    int mem_base;
42024    int ret_val;
42025    int code; /* UCS code point */
42026    int n_code;
42027
42028    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42029        mem_base = xmlMemBlocks();
42030        code = gen_int(n_code, 0);
42031
42032        ret_val = xmlUCSIsTamil(code);
42033        desret_int(ret_val);
42034        call_tests++;
42035        des_int(n_code, code, 0);
42036        xmlResetLastError();
42037        if (mem_base != xmlMemBlocks()) {
42038            printf("Leak of %d blocks found in xmlUCSIsTamil",
42039	           xmlMemBlocks() - mem_base);
42040	    test_ret++;
42041            printf(" %d", n_code);
42042            printf("\n");
42043        }
42044    }
42045    function_tests++;
42046#endif
42047
42048    return(test_ret);
42049}
42050
42051
42052static int
42053test_xmlUCSIsTelugu(void) {
42054    int test_ret = 0;
42055
42056#if defined(LIBXML_UNICODE_ENABLED)
42057    int mem_base;
42058    int ret_val;
42059    int code; /* UCS code point */
42060    int n_code;
42061
42062    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42063        mem_base = xmlMemBlocks();
42064        code = gen_int(n_code, 0);
42065
42066        ret_val = xmlUCSIsTelugu(code);
42067        desret_int(ret_val);
42068        call_tests++;
42069        des_int(n_code, code, 0);
42070        xmlResetLastError();
42071        if (mem_base != xmlMemBlocks()) {
42072            printf("Leak of %d blocks found in xmlUCSIsTelugu",
42073	           xmlMemBlocks() - mem_base);
42074	    test_ret++;
42075            printf(" %d", n_code);
42076            printf("\n");
42077        }
42078    }
42079    function_tests++;
42080#endif
42081
42082    return(test_ret);
42083}
42084
42085
42086static int
42087test_xmlUCSIsThaana(void) {
42088    int test_ret = 0;
42089
42090#if defined(LIBXML_UNICODE_ENABLED)
42091    int mem_base;
42092    int ret_val;
42093    int code; /* UCS code point */
42094    int n_code;
42095
42096    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42097        mem_base = xmlMemBlocks();
42098        code = gen_int(n_code, 0);
42099
42100        ret_val = xmlUCSIsThaana(code);
42101        desret_int(ret_val);
42102        call_tests++;
42103        des_int(n_code, code, 0);
42104        xmlResetLastError();
42105        if (mem_base != xmlMemBlocks()) {
42106            printf("Leak of %d blocks found in xmlUCSIsThaana",
42107	           xmlMemBlocks() - mem_base);
42108	    test_ret++;
42109            printf(" %d", n_code);
42110            printf("\n");
42111        }
42112    }
42113    function_tests++;
42114#endif
42115
42116    return(test_ret);
42117}
42118
42119
42120static int
42121test_xmlUCSIsThai(void) {
42122    int test_ret = 0;
42123
42124#if defined(LIBXML_UNICODE_ENABLED)
42125    int mem_base;
42126    int ret_val;
42127    int code; /* UCS code point */
42128    int n_code;
42129
42130    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42131        mem_base = xmlMemBlocks();
42132        code = gen_int(n_code, 0);
42133
42134        ret_val = xmlUCSIsThai(code);
42135        desret_int(ret_val);
42136        call_tests++;
42137        des_int(n_code, code, 0);
42138        xmlResetLastError();
42139        if (mem_base != xmlMemBlocks()) {
42140            printf("Leak of %d blocks found in xmlUCSIsThai",
42141	           xmlMemBlocks() - mem_base);
42142	    test_ret++;
42143            printf(" %d", n_code);
42144            printf("\n");
42145        }
42146    }
42147    function_tests++;
42148#endif
42149
42150    return(test_ret);
42151}
42152
42153
42154static int
42155test_xmlUCSIsTibetan(void) {
42156    int test_ret = 0;
42157
42158#if defined(LIBXML_UNICODE_ENABLED)
42159    int mem_base;
42160    int ret_val;
42161    int code; /* UCS code point */
42162    int n_code;
42163
42164    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42165        mem_base = xmlMemBlocks();
42166        code = gen_int(n_code, 0);
42167
42168        ret_val = xmlUCSIsTibetan(code);
42169        desret_int(ret_val);
42170        call_tests++;
42171        des_int(n_code, code, 0);
42172        xmlResetLastError();
42173        if (mem_base != xmlMemBlocks()) {
42174            printf("Leak of %d blocks found in xmlUCSIsTibetan",
42175	           xmlMemBlocks() - mem_base);
42176	    test_ret++;
42177            printf(" %d", n_code);
42178            printf("\n");
42179        }
42180    }
42181    function_tests++;
42182#endif
42183
42184    return(test_ret);
42185}
42186
42187
42188static int
42189test_xmlUCSIsUgaritic(void) {
42190    int test_ret = 0;
42191
42192#if defined(LIBXML_UNICODE_ENABLED)
42193    int mem_base;
42194    int ret_val;
42195    int code; /* UCS code point */
42196    int n_code;
42197
42198    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42199        mem_base = xmlMemBlocks();
42200        code = gen_int(n_code, 0);
42201
42202        ret_val = xmlUCSIsUgaritic(code);
42203        desret_int(ret_val);
42204        call_tests++;
42205        des_int(n_code, code, 0);
42206        xmlResetLastError();
42207        if (mem_base != xmlMemBlocks()) {
42208            printf("Leak of %d blocks found in xmlUCSIsUgaritic",
42209	           xmlMemBlocks() - mem_base);
42210	    test_ret++;
42211            printf(" %d", n_code);
42212            printf("\n");
42213        }
42214    }
42215    function_tests++;
42216#endif
42217
42218    return(test_ret);
42219}
42220
42221
42222static int
42223test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) {
42224    int test_ret = 0;
42225
42226#if defined(LIBXML_UNICODE_ENABLED)
42227    int mem_base;
42228    int ret_val;
42229    int code; /* UCS code point */
42230    int n_code;
42231
42232    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42233        mem_base = xmlMemBlocks();
42234        code = gen_int(n_code, 0);
42235
42236        ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code);
42237        desret_int(ret_val);
42238        call_tests++;
42239        des_int(n_code, code, 0);
42240        xmlResetLastError();
42241        if (mem_base != xmlMemBlocks()) {
42242            printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics",
42243	           xmlMemBlocks() - mem_base);
42244	    test_ret++;
42245            printf(" %d", n_code);
42246            printf("\n");
42247        }
42248    }
42249    function_tests++;
42250#endif
42251
42252    return(test_ret);
42253}
42254
42255
42256static int
42257test_xmlUCSIsVariationSelectors(void) {
42258    int test_ret = 0;
42259
42260#if defined(LIBXML_UNICODE_ENABLED)
42261    int mem_base;
42262    int ret_val;
42263    int code; /* UCS code point */
42264    int n_code;
42265
42266    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42267        mem_base = xmlMemBlocks();
42268        code = gen_int(n_code, 0);
42269
42270        ret_val = xmlUCSIsVariationSelectors(code);
42271        desret_int(ret_val);
42272        call_tests++;
42273        des_int(n_code, code, 0);
42274        xmlResetLastError();
42275        if (mem_base != xmlMemBlocks()) {
42276            printf("Leak of %d blocks found in xmlUCSIsVariationSelectors",
42277	           xmlMemBlocks() - mem_base);
42278	    test_ret++;
42279            printf(" %d", n_code);
42280            printf("\n");
42281        }
42282    }
42283    function_tests++;
42284#endif
42285
42286    return(test_ret);
42287}
42288
42289
42290static int
42291test_xmlUCSIsVariationSelectorsSupplement(void) {
42292    int test_ret = 0;
42293
42294#if defined(LIBXML_UNICODE_ENABLED)
42295    int mem_base;
42296    int ret_val;
42297    int code; /* UCS code point */
42298    int n_code;
42299
42300    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42301        mem_base = xmlMemBlocks();
42302        code = gen_int(n_code, 0);
42303
42304        ret_val = xmlUCSIsVariationSelectorsSupplement(code);
42305        desret_int(ret_val);
42306        call_tests++;
42307        des_int(n_code, code, 0);
42308        xmlResetLastError();
42309        if (mem_base != xmlMemBlocks()) {
42310            printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement",
42311	           xmlMemBlocks() - mem_base);
42312	    test_ret++;
42313            printf(" %d", n_code);
42314            printf("\n");
42315        }
42316    }
42317    function_tests++;
42318#endif
42319
42320    return(test_ret);
42321}
42322
42323
42324static int
42325test_xmlUCSIsYiRadicals(void) {
42326    int test_ret = 0;
42327
42328#if defined(LIBXML_UNICODE_ENABLED)
42329    int mem_base;
42330    int ret_val;
42331    int code; /* UCS code point */
42332    int n_code;
42333
42334    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42335        mem_base = xmlMemBlocks();
42336        code = gen_int(n_code, 0);
42337
42338        ret_val = xmlUCSIsYiRadicals(code);
42339        desret_int(ret_val);
42340        call_tests++;
42341        des_int(n_code, code, 0);
42342        xmlResetLastError();
42343        if (mem_base != xmlMemBlocks()) {
42344            printf("Leak of %d blocks found in xmlUCSIsYiRadicals",
42345	           xmlMemBlocks() - mem_base);
42346	    test_ret++;
42347            printf(" %d", n_code);
42348            printf("\n");
42349        }
42350    }
42351    function_tests++;
42352#endif
42353
42354    return(test_ret);
42355}
42356
42357
42358static int
42359test_xmlUCSIsYiSyllables(void) {
42360    int test_ret = 0;
42361
42362#if defined(LIBXML_UNICODE_ENABLED)
42363    int mem_base;
42364    int ret_val;
42365    int code; /* UCS code point */
42366    int n_code;
42367
42368    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42369        mem_base = xmlMemBlocks();
42370        code = gen_int(n_code, 0);
42371
42372        ret_val = xmlUCSIsYiSyllables(code);
42373        desret_int(ret_val);
42374        call_tests++;
42375        des_int(n_code, code, 0);
42376        xmlResetLastError();
42377        if (mem_base != xmlMemBlocks()) {
42378            printf("Leak of %d blocks found in xmlUCSIsYiSyllables",
42379	           xmlMemBlocks() - mem_base);
42380	    test_ret++;
42381            printf(" %d", n_code);
42382            printf("\n");
42383        }
42384    }
42385    function_tests++;
42386#endif
42387
42388    return(test_ret);
42389}
42390
42391
42392static int
42393test_xmlUCSIsYijingHexagramSymbols(void) {
42394    int test_ret = 0;
42395
42396#if defined(LIBXML_UNICODE_ENABLED)
42397    int mem_base;
42398    int ret_val;
42399    int code; /* UCS code point */
42400    int n_code;
42401
42402    for (n_code = 0;n_code < gen_nb_int;n_code++) {
42403        mem_base = xmlMemBlocks();
42404        code = gen_int(n_code, 0);
42405
42406        ret_val = xmlUCSIsYijingHexagramSymbols(code);
42407        desret_int(ret_val);
42408        call_tests++;
42409        des_int(n_code, code, 0);
42410        xmlResetLastError();
42411        if (mem_base != xmlMemBlocks()) {
42412            printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols",
42413	           xmlMemBlocks() - mem_base);
42414	    test_ret++;
42415            printf(" %d", n_code);
42416            printf("\n");
42417        }
42418    }
42419    function_tests++;
42420#endif
42421
42422    return(test_ret);
42423}
42424
42425static int
42426test_xmlunicode(void) {
42427    int test_ret = 0;
42428
42429    if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n");
42430    test_ret += test_xmlUCSIsAegeanNumbers();
42431    test_ret += test_xmlUCSIsAlphabeticPresentationForms();
42432    test_ret += test_xmlUCSIsArabic();
42433    test_ret += test_xmlUCSIsArabicPresentationFormsA();
42434    test_ret += test_xmlUCSIsArabicPresentationFormsB();
42435    test_ret += test_xmlUCSIsArmenian();
42436    test_ret += test_xmlUCSIsArrows();
42437    test_ret += test_xmlUCSIsBasicLatin();
42438    test_ret += test_xmlUCSIsBengali();
42439    test_ret += test_xmlUCSIsBlock();
42440    test_ret += test_xmlUCSIsBlockElements();
42441    test_ret += test_xmlUCSIsBopomofo();
42442    test_ret += test_xmlUCSIsBopomofoExtended();
42443    test_ret += test_xmlUCSIsBoxDrawing();
42444    test_ret += test_xmlUCSIsBraillePatterns();
42445    test_ret += test_xmlUCSIsBuhid();
42446    test_ret += test_xmlUCSIsByzantineMusicalSymbols();
42447    test_ret += test_xmlUCSIsCJKCompatibility();
42448    test_ret += test_xmlUCSIsCJKCompatibilityForms();
42449    test_ret += test_xmlUCSIsCJKCompatibilityIdeographs();
42450    test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement();
42451    test_ret += test_xmlUCSIsCJKRadicalsSupplement();
42452    test_ret += test_xmlUCSIsCJKSymbolsandPunctuation();
42453    test_ret += test_xmlUCSIsCJKUnifiedIdeographs();
42454    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA();
42455    test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB();
42456    test_ret += test_xmlUCSIsCat();
42457    test_ret += test_xmlUCSIsCatC();
42458    test_ret += test_xmlUCSIsCatCc();
42459    test_ret += test_xmlUCSIsCatCf();
42460    test_ret += test_xmlUCSIsCatCo();
42461    test_ret += test_xmlUCSIsCatCs();
42462    test_ret += test_xmlUCSIsCatL();
42463    test_ret += test_xmlUCSIsCatLl();
42464    test_ret += test_xmlUCSIsCatLm();
42465    test_ret += test_xmlUCSIsCatLo();
42466    test_ret += test_xmlUCSIsCatLt();
42467    test_ret += test_xmlUCSIsCatLu();
42468    test_ret += test_xmlUCSIsCatM();
42469    test_ret += test_xmlUCSIsCatMc();
42470    test_ret += test_xmlUCSIsCatMe();
42471    test_ret += test_xmlUCSIsCatMn();
42472    test_ret += test_xmlUCSIsCatN();
42473    test_ret += test_xmlUCSIsCatNd();
42474    test_ret += test_xmlUCSIsCatNl();
42475    test_ret += test_xmlUCSIsCatNo();
42476    test_ret += test_xmlUCSIsCatP();
42477    test_ret += test_xmlUCSIsCatPc();
42478    test_ret += test_xmlUCSIsCatPd();
42479    test_ret += test_xmlUCSIsCatPe();
42480    test_ret += test_xmlUCSIsCatPf();
42481    test_ret += test_xmlUCSIsCatPi();
42482    test_ret += test_xmlUCSIsCatPo();
42483    test_ret += test_xmlUCSIsCatPs();
42484    test_ret += test_xmlUCSIsCatS();
42485    test_ret += test_xmlUCSIsCatSc();
42486    test_ret += test_xmlUCSIsCatSk();
42487    test_ret += test_xmlUCSIsCatSm();
42488    test_ret += test_xmlUCSIsCatSo();
42489    test_ret += test_xmlUCSIsCatZ();
42490    test_ret += test_xmlUCSIsCatZl();
42491    test_ret += test_xmlUCSIsCatZp();
42492    test_ret += test_xmlUCSIsCatZs();
42493    test_ret += test_xmlUCSIsCherokee();
42494    test_ret += test_xmlUCSIsCombiningDiacriticalMarks();
42495    test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols();
42496    test_ret += test_xmlUCSIsCombiningHalfMarks();
42497    test_ret += test_xmlUCSIsCombiningMarksforSymbols();
42498    test_ret += test_xmlUCSIsControlPictures();
42499    test_ret += test_xmlUCSIsCurrencySymbols();
42500    test_ret += test_xmlUCSIsCypriotSyllabary();
42501    test_ret += test_xmlUCSIsCyrillic();
42502    test_ret += test_xmlUCSIsCyrillicSupplement();
42503    test_ret += test_xmlUCSIsDeseret();
42504    test_ret += test_xmlUCSIsDevanagari();
42505    test_ret += test_xmlUCSIsDingbats();
42506    test_ret += test_xmlUCSIsEnclosedAlphanumerics();
42507    test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths();
42508    test_ret += test_xmlUCSIsEthiopic();
42509    test_ret += test_xmlUCSIsGeneralPunctuation();
42510    test_ret += test_xmlUCSIsGeometricShapes();
42511    test_ret += test_xmlUCSIsGeorgian();
42512    test_ret += test_xmlUCSIsGothic();
42513    test_ret += test_xmlUCSIsGreek();
42514    test_ret += test_xmlUCSIsGreekExtended();
42515    test_ret += test_xmlUCSIsGreekandCoptic();
42516    test_ret += test_xmlUCSIsGujarati();
42517    test_ret += test_xmlUCSIsGurmukhi();
42518    test_ret += test_xmlUCSIsHalfwidthandFullwidthForms();
42519    test_ret += test_xmlUCSIsHangulCompatibilityJamo();
42520    test_ret += test_xmlUCSIsHangulJamo();
42521    test_ret += test_xmlUCSIsHangulSyllables();
42522    test_ret += test_xmlUCSIsHanunoo();
42523    test_ret += test_xmlUCSIsHebrew();
42524    test_ret += test_xmlUCSIsHighPrivateUseSurrogates();
42525    test_ret += test_xmlUCSIsHighSurrogates();
42526    test_ret += test_xmlUCSIsHiragana();
42527    test_ret += test_xmlUCSIsIPAExtensions();
42528    test_ret += test_xmlUCSIsIdeographicDescriptionCharacters();
42529    test_ret += test_xmlUCSIsKanbun();
42530    test_ret += test_xmlUCSIsKangxiRadicals();
42531    test_ret += test_xmlUCSIsKannada();
42532    test_ret += test_xmlUCSIsKatakana();
42533    test_ret += test_xmlUCSIsKatakanaPhoneticExtensions();
42534    test_ret += test_xmlUCSIsKhmer();
42535    test_ret += test_xmlUCSIsKhmerSymbols();
42536    test_ret += test_xmlUCSIsLao();
42537    test_ret += test_xmlUCSIsLatin1Supplement();
42538    test_ret += test_xmlUCSIsLatinExtendedA();
42539    test_ret += test_xmlUCSIsLatinExtendedAdditional();
42540    test_ret += test_xmlUCSIsLatinExtendedB();
42541    test_ret += test_xmlUCSIsLetterlikeSymbols();
42542    test_ret += test_xmlUCSIsLimbu();
42543    test_ret += test_xmlUCSIsLinearBIdeograms();
42544    test_ret += test_xmlUCSIsLinearBSyllabary();
42545    test_ret += test_xmlUCSIsLowSurrogates();
42546    test_ret += test_xmlUCSIsMalayalam();
42547    test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols();
42548    test_ret += test_xmlUCSIsMathematicalOperators();
42549    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA();
42550    test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB();
42551    test_ret += test_xmlUCSIsMiscellaneousSymbols();
42552    test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows();
42553    test_ret += test_xmlUCSIsMiscellaneousTechnical();
42554    test_ret += test_xmlUCSIsMongolian();
42555    test_ret += test_xmlUCSIsMusicalSymbols();
42556    test_ret += test_xmlUCSIsMyanmar();
42557    test_ret += test_xmlUCSIsNumberForms();
42558    test_ret += test_xmlUCSIsOgham();
42559    test_ret += test_xmlUCSIsOldItalic();
42560    test_ret += test_xmlUCSIsOpticalCharacterRecognition();
42561    test_ret += test_xmlUCSIsOriya();
42562    test_ret += test_xmlUCSIsOsmanya();
42563    test_ret += test_xmlUCSIsPhoneticExtensions();
42564    test_ret += test_xmlUCSIsPrivateUse();
42565    test_ret += test_xmlUCSIsPrivateUseArea();
42566    test_ret += test_xmlUCSIsRunic();
42567    test_ret += test_xmlUCSIsShavian();
42568    test_ret += test_xmlUCSIsSinhala();
42569    test_ret += test_xmlUCSIsSmallFormVariants();
42570    test_ret += test_xmlUCSIsSpacingModifierLetters();
42571    test_ret += test_xmlUCSIsSpecials();
42572    test_ret += test_xmlUCSIsSuperscriptsandSubscripts();
42573    test_ret += test_xmlUCSIsSupplementalArrowsA();
42574    test_ret += test_xmlUCSIsSupplementalArrowsB();
42575    test_ret += test_xmlUCSIsSupplementalMathematicalOperators();
42576    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA();
42577    test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB();
42578    test_ret += test_xmlUCSIsSyriac();
42579    test_ret += test_xmlUCSIsTagalog();
42580    test_ret += test_xmlUCSIsTagbanwa();
42581    test_ret += test_xmlUCSIsTags();
42582    test_ret += test_xmlUCSIsTaiLe();
42583    test_ret += test_xmlUCSIsTaiXuanJingSymbols();
42584    test_ret += test_xmlUCSIsTamil();
42585    test_ret += test_xmlUCSIsTelugu();
42586    test_ret += test_xmlUCSIsThaana();
42587    test_ret += test_xmlUCSIsThai();
42588    test_ret += test_xmlUCSIsTibetan();
42589    test_ret += test_xmlUCSIsUgaritic();
42590    test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics();
42591    test_ret += test_xmlUCSIsVariationSelectors();
42592    test_ret += test_xmlUCSIsVariationSelectorsSupplement();
42593    test_ret += test_xmlUCSIsYiRadicals();
42594    test_ret += test_xmlUCSIsYiSyllables();
42595    test_ret += test_xmlUCSIsYijingHexagramSymbols();
42596
42597    if (test_ret != 0)
42598	printf("Module xmlunicode: %d errors\n", test_ret);
42599    return(test_ret);
42600}
42601
42602static int
42603test_xmlNewTextWriter(void) {
42604    int test_ret = 0;
42605
42606#if defined(LIBXML_WRITER_ENABLED)
42607    int mem_base;
42608    xmlTextWriterPtr ret_val;
42609    xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */
42610    int n_out;
42611
42612    for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) {
42613        mem_base = xmlMemBlocks();
42614        out = gen_xmlOutputBufferPtr(n_out, 0);
42615
42616        ret_val = xmlNewTextWriter(out);
42617        if (ret_val != NULL) out = NULL;
42618        desret_xmlTextWriterPtr(ret_val);
42619        call_tests++;
42620        des_xmlOutputBufferPtr(n_out, out, 0);
42621        xmlResetLastError();
42622        if (mem_base != xmlMemBlocks()) {
42623            printf("Leak of %d blocks found in xmlNewTextWriter",
42624	           xmlMemBlocks() - mem_base);
42625	    test_ret++;
42626            printf(" %d", n_out);
42627            printf("\n");
42628        }
42629    }
42630    function_tests++;
42631#endif
42632
42633    return(test_ret);
42634}
42635
42636
42637static int
42638test_xmlNewTextWriterFilename(void) {
42639    int test_ret = 0;
42640
42641#if defined(LIBXML_WRITER_ENABLED)
42642    int mem_base;
42643    xmlTextWriterPtr ret_val;
42644    const char * uri; /* the URI of the resource for the output */
42645    int n_uri;
42646    int compression; /* compress the output? */
42647    int n_compression;
42648
42649    for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) {
42650    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42651        mem_base = xmlMemBlocks();
42652        uri = gen_fileoutput(n_uri, 0);
42653        compression = gen_int(n_compression, 1);
42654
42655        ret_val = xmlNewTextWriterFilename(uri, compression);
42656        desret_xmlTextWriterPtr(ret_val);
42657        call_tests++;
42658        des_fileoutput(n_uri, uri, 0);
42659        des_int(n_compression, compression, 1);
42660        xmlResetLastError();
42661        if (mem_base != xmlMemBlocks()) {
42662            printf("Leak of %d blocks found in xmlNewTextWriterFilename",
42663	           xmlMemBlocks() - mem_base);
42664	    test_ret++;
42665            printf(" %d", n_uri);
42666            printf(" %d", n_compression);
42667            printf("\n");
42668        }
42669    }
42670    }
42671    function_tests++;
42672#endif
42673
42674    return(test_ret);
42675}
42676
42677
42678static int
42679test_xmlNewTextWriterMemory(void) {
42680    int test_ret = 0;
42681
42682#if defined(LIBXML_WRITER_ENABLED)
42683    int mem_base;
42684    xmlTextWriterPtr ret_val;
42685    xmlBufferPtr buf; /* xmlBufferPtr */
42686    int n_buf;
42687    int compression; /* compress the output? */
42688    int n_compression;
42689
42690    for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) {
42691    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42692        mem_base = xmlMemBlocks();
42693        buf = gen_xmlBufferPtr(n_buf, 0);
42694        compression = gen_int(n_compression, 1);
42695
42696        ret_val = xmlNewTextWriterMemory(buf, compression);
42697        desret_xmlTextWriterPtr(ret_val);
42698        call_tests++;
42699        des_xmlBufferPtr(n_buf, buf, 0);
42700        des_int(n_compression, compression, 1);
42701        xmlResetLastError();
42702        if (mem_base != xmlMemBlocks()) {
42703            printf("Leak of %d blocks found in xmlNewTextWriterMemory",
42704	           xmlMemBlocks() - mem_base);
42705	    test_ret++;
42706            printf(" %d", n_buf);
42707            printf(" %d", n_compression);
42708            printf("\n");
42709        }
42710    }
42711    }
42712    function_tests++;
42713#endif
42714
42715    return(test_ret);
42716}
42717
42718
42719static int
42720test_xmlNewTextWriterPushParser(void) {
42721    int test_ret = 0;
42722
42723#if defined(LIBXML_WRITER_ENABLED)
42724    int mem_base;
42725    xmlTextWriterPtr ret_val;
42726    xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */
42727    int n_ctxt;
42728    int compression; /* compress the output? */
42729    int n_compression;
42730
42731    for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
42732    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42733        mem_base = xmlMemBlocks();
42734        ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
42735        compression = gen_int(n_compression, 1);
42736
42737        ret_val = xmlNewTextWriterPushParser(ctxt, compression);
42738        if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;
42739        desret_xmlTextWriterPtr(ret_val);
42740        call_tests++;
42741        des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
42742        des_int(n_compression, compression, 1);
42743        xmlResetLastError();
42744        if (mem_base != xmlMemBlocks()) {
42745            printf("Leak of %d blocks found in xmlNewTextWriterPushParser",
42746	           xmlMemBlocks() - mem_base);
42747	    test_ret++;
42748            printf(" %d", n_ctxt);
42749            printf(" %d", n_compression);
42750            printf("\n");
42751        }
42752    }
42753    }
42754    function_tests++;
42755#endif
42756
42757    return(test_ret);
42758}
42759
42760
42761static int
42762test_xmlNewTextWriterTree(void) {
42763    int test_ret = 0;
42764
42765#if defined(LIBXML_WRITER_ENABLED)
42766    int mem_base;
42767    xmlTextWriterPtr ret_val;
42768    xmlDocPtr doc; /* xmlDocPtr */
42769    int n_doc;
42770    xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */
42771    int n_node;
42772    int compression; /* compress the output? */
42773    int n_compression;
42774
42775    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
42776    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
42777    for (n_compression = 0;n_compression < gen_nb_int;n_compression++) {
42778        mem_base = xmlMemBlocks();
42779        doc = gen_xmlDocPtr(n_doc, 0);
42780        node = gen_xmlNodePtr(n_node, 1);
42781        compression = gen_int(n_compression, 2);
42782
42783        ret_val = xmlNewTextWriterTree(doc, node, compression);
42784        desret_xmlTextWriterPtr(ret_val);
42785        call_tests++;
42786        des_xmlDocPtr(n_doc, doc, 0);
42787        des_xmlNodePtr(n_node, node, 1);
42788        des_int(n_compression, compression, 2);
42789        xmlResetLastError();
42790        if (mem_base != xmlMemBlocks()) {
42791            printf("Leak of %d blocks found in xmlNewTextWriterTree",
42792	           xmlMemBlocks() - mem_base);
42793	    test_ret++;
42794            printf(" %d", n_doc);
42795            printf(" %d", n_node);
42796            printf(" %d", n_compression);
42797            printf("\n");
42798        }
42799    }
42800    }
42801    }
42802    function_tests++;
42803#endif
42804
42805    return(test_ret);
42806}
42807
42808
42809static int
42810test_xmlTextWriterEndAttribute(void) {
42811    int test_ret = 0;
42812
42813#if defined(LIBXML_WRITER_ENABLED)
42814    int mem_base;
42815    int ret_val;
42816    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42817    int n_writer;
42818
42819    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42820        mem_base = xmlMemBlocks();
42821        writer = gen_xmlTextWriterPtr(n_writer, 0);
42822
42823        ret_val = xmlTextWriterEndAttribute(writer);
42824        desret_int(ret_val);
42825        call_tests++;
42826        des_xmlTextWriterPtr(n_writer, writer, 0);
42827        xmlResetLastError();
42828        if (mem_base != xmlMemBlocks()) {
42829            printf("Leak of %d blocks found in xmlTextWriterEndAttribute",
42830	           xmlMemBlocks() - mem_base);
42831	    test_ret++;
42832            printf(" %d", n_writer);
42833            printf("\n");
42834        }
42835    }
42836    function_tests++;
42837#endif
42838
42839    return(test_ret);
42840}
42841
42842
42843static int
42844test_xmlTextWriterEndCDATA(void) {
42845    int test_ret = 0;
42846
42847#if defined(LIBXML_WRITER_ENABLED)
42848    int mem_base;
42849    int ret_val;
42850    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42851    int n_writer;
42852
42853    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42854        mem_base = xmlMemBlocks();
42855        writer = gen_xmlTextWriterPtr(n_writer, 0);
42856
42857        ret_val = xmlTextWriterEndCDATA(writer);
42858        desret_int(ret_val);
42859        call_tests++;
42860        des_xmlTextWriterPtr(n_writer, writer, 0);
42861        xmlResetLastError();
42862        if (mem_base != xmlMemBlocks()) {
42863            printf("Leak of %d blocks found in xmlTextWriterEndCDATA",
42864	           xmlMemBlocks() - mem_base);
42865	    test_ret++;
42866            printf(" %d", n_writer);
42867            printf("\n");
42868        }
42869    }
42870    function_tests++;
42871#endif
42872
42873    return(test_ret);
42874}
42875
42876
42877static int
42878test_xmlTextWriterEndComment(void) {
42879    int test_ret = 0;
42880
42881#if defined(LIBXML_WRITER_ENABLED)
42882    int mem_base;
42883    int ret_val;
42884    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42885    int n_writer;
42886
42887    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42888        mem_base = xmlMemBlocks();
42889        writer = gen_xmlTextWriterPtr(n_writer, 0);
42890
42891        ret_val = xmlTextWriterEndComment(writer);
42892        desret_int(ret_val);
42893        call_tests++;
42894        des_xmlTextWriterPtr(n_writer, writer, 0);
42895        xmlResetLastError();
42896        if (mem_base != xmlMemBlocks()) {
42897            printf("Leak of %d blocks found in xmlTextWriterEndComment",
42898	           xmlMemBlocks() - mem_base);
42899	    test_ret++;
42900            printf(" %d", n_writer);
42901            printf("\n");
42902        }
42903    }
42904    function_tests++;
42905#endif
42906
42907    return(test_ret);
42908}
42909
42910
42911static int
42912test_xmlTextWriterEndDTD(void) {
42913    int test_ret = 0;
42914
42915#if defined(LIBXML_WRITER_ENABLED)
42916    int mem_base;
42917    int ret_val;
42918    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42919    int n_writer;
42920
42921    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42922        mem_base = xmlMemBlocks();
42923        writer = gen_xmlTextWriterPtr(n_writer, 0);
42924
42925        ret_val = xmlTextWriterEndDTD(writer);
42926        desret_int(ret_val);
42927        call_tests++;
42928        des_xmlTextWriterPtr(n_writer, writer, 0);
42929        xmlResetLastError();
42930        if (mem_base != xmlMemBlocks()) {
42931            printf("Leak of %d blocks found in xmlTextWriterEndDTD",
42932	           xmlMemBlocks() - mem_base);
42933	    test_ret++;
42934            printf(" %d", n_writer);
42935            printf("\n");
42936        }
42937    }
42938    function_tests++;
42939#endif
42940
42941    return(test_ret);
42942}
42943
42944
42945static int
42946test_xmlTextWriterEndDTDAttlist(void) {
42947    int test_ret = 0;
42948
42949#if defined(LIBXML_WRITER_ENABLED)
42950    int mem_base;
42951    int ret_val;
42952    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42953    int n_writer;
42954
42955    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42956        mem_base = xmlMemBlocks();
42957        writer = gen_xmlTextWriterPtr(n_writer, 0);
42958
42959        ret_val = xmlTextWriterEndDTDAttlist(writer);
42960        desret_int(ret_val);
42961        call_tests++;
42962        des_xmlTextWriterPtr(n_writer, writer, 0);
42963        xmlResetLastError();
42964        if (mem_base != xmlMemBlocks()) {
42965            printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist",
42966	           xmlMemBlocks() - mem_base);
42967	    test_ret++;
42968            printf(" %d", n_writer);
42969            printf("\n");
42970        }
42971    }
42972    function_tests++;
42973#endif
42974
42975    return(test_ret);
42976}
42977
42978
42979static int
42980test_xmlTextWriterEndDTDElement(void) {
42981    int test_ret = 0;
42982
42983#if defined(LIBXML_WRITER_ENABLED)
42984    int mem_base;
42985    int ret_val;
42986    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
42987    int n_writer;
42988
42989    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
42990        mem_base = xmlMemBlocks();
42991        writer = gen_xmlTextWriterPtr(n_writer, 0);
42992
42993        ret_val = xmlTextWriterEndDTDElement(writer);
42994        desret_int(ret_val);
42995        call_tests++;
42996        des_xmlTextWriterPtr(n_writer, writer, 0);
42997        xmlResetLastError();
42998        if (mem_base != xmlMemBlocks()) {
42999            printf("Leak of %d blocks found in xmlTextWriterEndDTDElement",
43000	           xmlMemBlocks() - mem_base);
43001	    test_ret++;
43002            printf(" %d", n_writer);
43003            printf("\n");
43004        }
43005    }
43006    function_tests++;
43007#endif
43008
43009    return(test_ret);
43010}
43011
43012
43013static int
43014test_xmlTextWriterEndDTDEntity(void) {
43015    int test_ret = 0;
43016
43017#if defined(LIBXML_WRITER_ENABLED)
43018    int mem_base;
43019    int ret_val;
43020    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43021    int n_writer;
43022
43023    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43024        mem_base = xmlMemBlocks();
43025        writer = gen_xmlTextWriterPtr(n_writer, 0);
43026
43027        ret_val = xmlTextWriterEndDTDEntity(writer);
43028        desret_int(ret_val);
43029        call_tests++;
43030        des_xmlTextWriterPtr(n_writer, writer, 0);
43031        xmlResetLastError();
43032        if (mem_base != xmlMemBlocks()) {
43033            printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity",
43034	           xmlMemBlocks() - mem_base);
43035	    test_ret++;
43036            printf(" %d", n_writer);
43037            printf("\n");
43038        }
43039    }
43040    function_tests++;
43041#endif
43042
43043    return(test_ret);
43044}
43045
43046
43047static int
43048test_xmlTextWriterEndDocument(void) {
43049    int test_ret = 0;
43050
43051#if defined(LIBXML_WRITER_ENABLED)
43052    int mem_base;
43053    int ret_val;
43054    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43055    int n_writer;
43056
43057    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43058        mem_base = xmlMemBlocks();
43059        writer = gen_xmlTextWriterPtr(n_writer, 0);
43060
43061        ret_val = xmlTextWriterEndDocument(writer);
43062        desret_int(ret_val);
43063        call_tests++;
43064        des_xmlTextWriterPtr(n_writer, writer, 0);
43065        xmlResetLastError();
43066        if (mem_base != xmlMemBlocks()) {
43067            printf("Leak of %d blocks found in xmlTextWriterEndDocument",
43068	           xmlMemBlocks() - mem_base);
43069	    test_ret++;
43070            printf(" %d", n_writer);
43071            printf("\n");
43072        }
43073    }
43074    function_tests++;
43075#endif
43076
43077    return(test_ret);
43078}
43079
43080
43081static int
43082test_xmlTextWriterEndElement(void) {
43083    int test_ret = 0;
43084
43085#if defined(LIBXML_WRITER_ENABLED)
43086    int mem_base;
43087    int ret_val;
43088    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43089    int n_writer;
43090
43091    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43092        mem_base = xmlMemBlocks();
43093        writer = gen_xmlTextWriterPtr(n_writer, 0);
43094
43095        ret_val = xmlTextWriterEndElement(writer);
43096        desret_int(ret_val);
43097        call_tests++;
43098        des_xmlTextWriterPtr(n_writer, writer, 0);
43099        xmlResetLastError();
43100        if (mem_base != xmlMemBlocks()) {
43101            printf("Leak of %d blocks found in xmlTextWriterEndElement",
43102	           xmlMemBlocks() - mem_base);
43103	    test_ret++;
43104            printf(" %d", n_writer);
43105            printf("\n");
43106        }
43107    }
43108    function_tests++;
43109#endif
43110
43111    return(test_ret);
43112}
43113
43114
43115static int
43116test_xmlTextWriterEndPI(void) {
43117    int test_ret = 0;
43118
43119#if defined(LIBXML_WRITER_ENABLED)
43120    int mem_base;
43121    int ret_val;
43122    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43123    int n_writer;
43124
43125    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43126        mem_base = xmlMemBlocks();
43127        writer = gen_xmlTextWriterPtr(n_writer, 0);
43128
43129        ret_val = xmlTextWriterEndPI(writer);
43130        desret_int(ret_val);
43131        call_tests++;
43132        des_xmlTextWriterPtr(n_writer, writer, 0);
43133        xmlResetLastError();
43134        if (mem_base != xmlMemBlocks()) {
43135            printf("Leak of %d blocks found in xmlTextWriterEndPI",
43136	           xmlMemBlocks() - mem_base);
43137	    test_ret++;
43138            printf(" %d", n_writer);
43139            printf("\n");
43140        }
43141    }
43142    function_tests++;
43143#endif
43144
43145    return(test_ret);
43146}
43147
43148
43149static int
43150test_xmlTextWriterFlush(void) {
43151    int test_ret = 0;
43152
43153#if defined(LIBXML_WRITER_ENABLED)
43154    int mem_base;
43155    int ret_val;
43156    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43157    int n_writer;
43158
43159    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43160        mem_base = xmlMemBlocks();
43161        writer = gen_xmlTextWriterPtr(n_writer, 0);
43162
43163        ret_val = xmlTextWriterFlush(writer);
43164        desret_int(ret_val);
43165        call_tests++;
43166        des_xmlTextWriterPtr(n_writer, writer, 0);
43167        xmlResetLastError();
43168        if (mem_base != xmlMemBlocks()) {
43169            printf("Leak of %d blocks found in xmlTextWriterFlush",
43170	           xmlMemBlocks() - mem_base);
43171	    test_ret++;
43172            printf(" %d", n_writer);
43173            printf("\n");
43174        }
43175    }
43176    function_tests++;
43177#endif
43178
43179    return(test_ret);
43180}
43181
43182
43183static int
43184test_xmlTextWriterFullEndElement(void) {
43185    int test_ret = 0;
43186
43187#if defined(LIBXML_WRITER_ENABLED)
43188    int mem_base;
43189    int ret_val;
43190    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43191    int n_writer;
43192
43193    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43194        mem_base = xmlMemBlocks();
43195        writer = gen_xmlTextWriterPtr(n_writer, 0);
43196
43197        ret_val = xmlTextWriterFullEndElement(writer);
43198        desret_int(ret_val);
43199        call_tests++;
43200        des_xmlTextWriterPtr(n_writer, writer, 0);
43201        xmlResetLastError();
43202        if (mem_base != xmlMemBlocks()) {
43203            printf("Leak of %d blocks found in xmlTextWriterFullEndElement",
43204	           xmlMemBlocks() - mem_base);
43205	    test_ret++;
43206            printf(" %d", n_writer);
43207            printf("\n");
43208        }
43209    }
43210    function_tests++;
43211#endif
43212
43213    return(test_ret);
43214}
43215
43216
43217static int
43218test_xmlTextWriterSetIndent(void) {
43219    int test_ret = 0;
43220
43221#if defined(LIBXML_WRITER_ENABLED)
43222    int mem_base;
43223    int ret_val;
43224    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43225    int n_writer;
43226    int indent; /* do indentation? */
43227    int n_indent;
43228
43229    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43230    for (n_indent = 0;n_indent < gen_nb_int;n_indent++) {
43231        mem_base = xmlMemBlocks();
43232        writer = gen_xmlTextWriterPtr(n_writer, 0);
43233        indent = gen_int(n_indent, 1);
43234
43235        ret_val = xmlTextWriterSetIndent(writer, indent);
43236        desret_int(ret_val);
43237        call_tests++;
43238        des_xmlTextWriterPtr(n_writer, writer, 0);
43239        des_int(n_indent, indent, 1);
43240        xmlResetLastError();
43241        if (mem_base != xmlMemBlocks()) {
43242            printf("Leak of %d blocks found in xmlTextWriterSetIndent",
43243	           xmlMemBlocks() - mem_base);
43244	    test_ret++;
43245            printf(" %d", n_writer);
43246            printf(" %d", n_indent);
43247            printf("\n");
43248        }
43249    }
43250    }
43251    function_tests++;
43252#endif
43253
43254    return(test_ret);
43255}
43256
43257
43258static int
43259test_xmlTextWriterSetIndentString(void) {
43260    int test_ret = 0;
43261
43262#if defined(LIBXML_WRITER_ENABLED)
43263    int mem_base;
43264    int ret_val;
43265    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43266    int n_writer;
43267    xmlChar * str; /* the xmlChar string */
43268    int n_str;
43269
43270    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43271    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
43272        mem_base = xmlMemBlocks();
43273        writer = gen_xmlTextWriterPtr(n_writer, 0);
43274        str = gen_const_xmlChar_ptr(n_str, 1);
43275
43276        ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str);
43277        desret_int(ret_val);
43278        call_tests++;
43279        des_xmlTextWriterPtr(n_writer, writer, 0);
43280        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1);
43281        xmlResetLastError();
43282        if (mem_base != xmlMemBlocks()) {
43283            printf("Leak of %d blocks found in xmlTextWriterSetIndentString",
43284	           xmlMemBlocks() - mem_base);
43285	    test_ret++;
43286            printf(" %d", n_writer);
43287            printf(" %d", n_str);
43288            printf("\n");
43289        }
43290    }
43291    }
43292    function_tests++;
43293#endif
43294
43295    return(test_ret);
43296}
43297
43298
43299static int
43300test_xmlTextWriterStartAttribute(void) {
43301    int test_ret = 0;
43302
43303#if defined(LIBXML_WRITER_ENABLED)
43304    int mem_base;
43305    int ret_val;
43306    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43307    int n_writer;
43308    xmlChar * name; /* element name */
43309    int n_name;
43310
43311    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43312    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43313        mem_base = xmlMemBlocks();
43314        writer = gen_xmlTextWriterPtr(n_writer, 0);
43315        name = gen_const_xmlChar_ptr(n_name, 1);
43316
43317        ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name);
43318        desret_int(ret_val);
43319        call_tests++;
43320        des_xmlTextWriterPtr(n_writer, writer, 0);
43321        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43322        xmlResetLastError();
43323        if (mem_base != xmlMemBlocks()) {
43324            printf("Leak of %d blocks found in xmlTextWriterStartAttribute",
43325	           xmlMemBlocks() - mem_base);
43326	    test_ret++;
43327            printf(" %d", n_writer);
43328            printf(" %d", n_name);
43329            printf("\n");
43330        }
43331    }
43332    }
43333    function_tests++;
43334#endif
43335
43336    return(test_ret);
43337}
43338
43339
43340static int
43341test_xmlTextWriterStartAttributeNS(void) {
43342    int test_ret = 0;
43343
43344#if defined(LIBXML_WRITER_ENABLED)
43345    int mem_base;
43346    int ret_val;
43347    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43348    int n_writer;
43349    xmlChar * prefix; /* namespace prefix or NULL */
43350    int n_prefix;
43351    xmlChar * name; /* element local name */
43352    int n_name;
43353    xmlChar * namespaceURI; /* namespace URI or NULL */
43354    int n_namespaceURI;
43355
43356    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43357    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43358    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43359    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43360        mem_base = xmlMemBlocks();
43361        writer = gen_xmlTextWriterPtr(n_writer, 0);
43362        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43363        name = gen_const_xmlChar_ptr(n_name, 2);
43364        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43365
43366        ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43367        desret_int(ret_val);
43368        call_tests++;
43369        des_xmlTextWriterPtr(n_writer, writer, 0);
43370        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43371        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43372        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43373        xmlResetLastError();
43374        if (mem_base != xmlMemBlocks()) {
43375            printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS",
43376	           xmlMemBlocks() - mem_base);
43377	    test_ret++;
43378            printf(" %d", n_writer);
43379            printf(" %d", n_prefix);
43380            printf(" %d", n_name);
43381            printf(" %d", n_namespaceURI);
43382            printf("\n");
43383        }
43384    }
43385    }
43386    }
43387    }
43388    function_tests++;
43389#endif
43390
43391    return(test_ret);
43392}
43393
43394
43395static int
43396test_xmlTextWriterStartCDATA(void) {
43397    int test_ret = 0;
43398
43399#if defined(LIBXML_WRITER_ENABLED)
43400    int mem_base;
43401    int ret_val;
43402    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43403    int n_writer;
43404
43405    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43406        mem_base = xmlMemBlocks();
43407        writer = gen_xmlTextWriterPtr(n_writer, 0);
43408
43409        ret_val = xmlTextWriterStartCDATA(writer);
43410        desret_int(ret_val);
43411        call_tests++;
43412        des_xmlTextWriterPtr(n_writer, writer, 0);
43413        xmlResetLastError();
43414        if (mem_base != xmlMemBlocks()) {
43415            printf("Leak of %d blocks found in xmlTextWriterStartCDATA",
43416	           xmlMemBlocks() - mem_base);
43417	    test_ret++;
43418            printf(" %d", n_writer);
43419            printf("\n");
43420        }
43421    }
43422    function_tests++;
43423#endif
43424
43425    return(test_ret);
43426}
43427
43428
43429static int
43430test_xmlTextWriterStartComment(void) {
43431    int test_ret = 0;
43432
43433#if defined(LIBXML_WRITER_ENABLED)
43434    int mem_base;
43435    int ret_val;
43436    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43437    int n_writer;
43438
43439    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43440        mem_base = xmlMemBlocks();
43441        writer = gen_xmlTextWriterPtr(n_writer, 0);
43442
43443        ret_val = xmlTextWriterStartComment(writer);
43444        desret_int(ret_val);
43445        call_tests++;
43446        des_xmlTextWriterPtr(n_writer, writer, 0);
43447        xmlResetLastError();
43448        if (mem_base != xmlMemBlocks()) {
43449            printf("Leak of %d blocks found in xmlTextWriterStartComment",
43450	           xmlMemBlocks() - mem_base);
43451	    test_ret++;
43452            printf(" %d", n_writer);
43453            printf("\n");
43454        }
43455    }
43456    function_tests++;
43457#endif
43458
43459    return(test_ret);
43460}
43461
43462
43463static int
43464test_xmlTextWriterStartDTD(void) {
43465    int test_ret = 0;
43466
43467#if defined(LIBXML_WRITER_ENABLED)
43468    int mem_base;
43469    int ret_val;
43470    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43471    int n_writer;
43472    xmlChar * name; /* the name of the DTD */
43473    int n_name;
43474    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
43475    int n_pubid;
43476    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
43477    int n_sysid;
43478
43479    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43480    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43481    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
43482    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
43483        mem_base = xmlMemBlocks();
43484        writer = gen_xmlTextWriterPtr(n_writer, 0);
43485        name = gen_const_xmlChar_ptr(n_name, 1);
43486        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
43487        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
43488
43489        ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
43490        desret_int(ret_val);
43491        call_tests++;
43492        des_xmlTextWriterPtr(n_writer, writer, 0);
43493        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43494        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
43495        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
43496        xmlResetLastError();
43497        if (mem_base != xmlMemBlocks()) {
43498            printf("Leak of %d blocks found in xmlTextWriterStartDTD",
43499	           xmlMemBlocks() - mem_base);
43500	    test_ret++;
43501            printf(" %d", n_writer);
43502            printf(" %d", n_name);
43503            printf(" %d", n_pubid);
43504            printf(" %d", n_sysid);
43505            printf("\n");
43506        }
43507    }
43508    }
43509    }
43510    }
43511    function_tests++;
43512#endif
43513
43514    return(test_ret);
43515}
43516
43517
43518static int
43519test_xmlTextWriterStartDTDAttlist(void) {
43520    int test_ret = 0;
43521
43522#if defined(LIBXML_WRITER_ENABLED)
43523    int mem_base;
43524    int ret_val;
43525    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43526    int n_writer;
43527    xmlChar * name; /* the name of the DTD ATTLIST */
43528    int n_name;
43529
43530    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43531    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43532        mem_base = xmlMemBlocks();
43533        writer = gen_xmlTextWriterPtr(n_writer, 0);
43534        name = gen_const_xmlChar_ptr(n_name, 1);
43535
43536        ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name);
43537        desret_int(ret_val);
43538        call_tests++;
43539        des_xmlTextWriterPtr(n_writer, writer, 0);
43540        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43541        xmlResetLastError();
43542        if (mem_base != xmlMemBlocks()) {
43543            printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist",
43544	           xmlMemBlocks() - mem_base);
43545	    test_ret++;
43546            printf(" %d", n_writer);
43547            printf(" %d", n_name);
43548            printf("\n");
43549        }
43550    }
43551    }
43552    function_tests++;
43553#endif
43554
43555    return(test_ret);
43556}
43557
43558
43559static int
43560test_xmlTextWriterStartDTDElement(void) {
43561    int test_ret = 0;
43562
43563#if defined(LIBXML_WRITER_ENABLED)
43564    int mem_base;
43565    int ret_val;
43566    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43567    int n_writer;
43568    xmlChar * name; /* the name of the DTD element */
43569    int n_name;
43570
43571    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43572    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43573        mem_base = xmlMemBlocks();
43574        writer = gen_xmlTextWriterPtr(n_writer, 0);
43575        name = gen_const_xmlChar_ptr(n_name, 1);
43576
43577        ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name);
43578        desret_int(ret_val);
43579        call_tests++;
43580        des_xmlTextWriterPtr(n_writer, writer, 0);
43581        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43582        xmlResetLastError();
43583        if (mem_base != xmlMemBlocks()) {
43584            printf("Leak of %d blocks found in xmlTextWriterStartDTDElement",
43585	           xmlMemBlocks() - mem_base);
43586	    test_ret++;
43587            printf(" %d", n_writer);
43588            printf(" %d", n_name);
43589            printf("\n");
43590        }
43591    }
43592    }
43593    function_tests++;
43594#endif
43595
43596    return(test_ret);
43597}
43598
43599
43600static int
43601test_xmlTextWriterStartDTDEntity(void) {
43602    int test_ret = 0;
43603
43604#if defined(LIBXML_WRITER_ENABLED)
43605    int mem_base;
43606    int ret_val;
43607    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43608    int n_writer;
43609    int pe; /* TRUE if this is a parameter entity, FALSE if not */
43610    int n_pe;
43611    xmlChar * name; /* the name of the DTD ATTLIST */
43612    int n_name;
43613
43614    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43615    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
43616    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43617        mem_base = xmlMemBlocks();
43618        writer = gen_xmlTextWriterPtr(n_writer, 0);
43619        pe = gen_int(n_pe, 1);
43620        name = gen_const_xmlChar_ptr(n_name, 2);
43621
43622        ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name);
43623        desret_int(ret_val);
43624        call_tests++;
43625        des_xmlTextWriterPtr(n_writer, writer, 0);
43626        des_int(n_pe, pe, 1);
43627        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43628        xmlResetLastError();
43629        if (mem_base != xmlMemBlocks()) {
43630            printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity",
43631	           xmlMemBlocks() - mem_base);
43632	    test_ret++;
43633            printf(" %d", n_writer);
43634            printf(" %d", n_pe);
43635            printf(" %d", n_name);
43636            printf("\n");
43637        }
43638    }
43639    }
43640    }
43641    function_tests++;
43642#endif
43643
43644    return(test_ret);
43645}
43646
43647
43648static int
43649test_xmlTextWriterStartDocument(void) {
43650    int test_ret = 0;
43651
43652#if defined(LIBXML_WRITER_ENABLED)
43653    int mem_base;
43654    int ret_val;
43655    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43656    int n_writer;
43657    char * version; /* the xml version ("1.0") or NULL for default ("1.0") */
43658    int n_version;
43659    char * encoding; /* the encoding or NULL for default */
43660    int n_encoding;
43661    char * standalone; /* "yes" or "no" or NULL for default */
43662    int n_standalone;
43663
43664    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43665    for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) {
43666    for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) {
43667    for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) {
43668        mem_base = xmlMemBlocks();
43669        writer = gen_xmlTextWriterPtr(n_writer, 0);
43670        version = gen_const_char_ptr(n_version, 1);
43671        encoding = gen_const_char_ptr(n_encoding, 2);
43672        standalone = gen_const_char_ptr(n_standalone, 3);
43673
43674        ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone);
43675        desret_int(ret_val);
43676        call_tests++;
43677        des_xmlTextWriterPtr(n_writer, writer, 0);
43678        des_const_char_ptr(n_version, (const char *)version, 1);
43679        des_const_char_ptr(n_encoding, (const char *)encoding, 2);
43680        des_const_char_ptr(n_standalone, (const char *)standalone, 3);
43681        xmlResetLastError();
43682        if (mem_base != xmlMemBlocks()) {
43683            printf("Leak of %d blocks found in xmlTextWriterStartDocument",
43684	           xmlMemBlocks() - mem_base);
43685	    test_ret++;
43686            printf(" %d", n_writer);
43687            printf(" %d", n_version);
43688            printf(" %d", n_encoding);
43689            printf(" %d", n_standalone);
43690            printf("\n");
43691        }
43692    }
43693    }
43694    }
43695    }
43696    function_tests++;
43697#endif
43698
43699    return(test_ret);
43700}
43701
43702
43703static int
43704test_xmlTextWriterStartElement(void) {
43705    int test_ret = 0;
43706
43707#if defined(LIBXML_WRITER_ENABLED)
43708    int mem_base;
43709    int ret_val;
43710    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43711    int n_writer;
43712    xmlChar * name; /* element name */
43713    int n_name;
43714
43715    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43716    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43717        mem_base = xmlMemBlocks();
43718        writer = gen_xmlTextWriterPtr(n_writer, 0);
43719        name = gen_const_xmlChar_ptr(n_name, 1);
43720
43721        ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name);
43722        desret_int(ret_val);
43723        call_tests++;
43724        des_xmlTextWriterPtr(n_writer, writer, 0);
43725        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43726        xmlResetLastError();
43727        if (mem_base != xmlMemBlocks()) {
43728            printf("Leak of %d blocks found in xmlTextWriterStartElement",
43729	           xmlMemBlocks() - mem_base);
43730	    test_ret++;
43731            printf(" %d", n_writer);
43732            printf(" %d", n_name);
43733            printf("\n");
43734        }
43735    }
43736    }
43737    function_tests++;
43738#endif
43739
43740    return(test_ret);
43741}
43742
43743
43744static int
43745test_xmlTextWriterStartElementNS(void) {
43746    int test_ret = 0;
43747
43748#if defined(LIBXML_WRITER_ENABLED)
43749    int mem_base;
43750    int ret_val;
43751    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43752    int n_writer;
43753    xmlChar * prefix; /* namespace prefix or NULL */
43754    int n_prefix;
43755    xmlChar * name; /* element local name */
43756    int n_name;
43757    xmlChar * namespaceURI; /* namespace URI or NULL */
43758    int n_namespaceURI;
43759
43760    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43761    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43762    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43763    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43764        mem_base = xmlMemBlocks();
43765        writer = gen_xmlTextWriterPtr(n_writer, 0);
43766        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43767        name = gen_const_xmlChar_ptr(n_name, 2);
43768        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43769
43770        ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI);
43771        desret_int(ret_val);
43772        call_tests++;
43773        des_xmlTextWriterPtr(n_writer, writer, 0);
43774        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43775        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43776        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43777        xmlResetLastError();
43778        if (mem_base != xmlMemBlocks()) {
43779            printf("Leak of %d blocks found in xmlTextWriterStartElementNS",
43780	           xmlMemBlocks() - mem_base);
43781	    test_ret++;
43782            printf(" %d", n_writer);
43783            printf(" %d", n_prefix);
43784            printf(" %d", n_name);
43785            printf(" %d", n_namespaceURI);
43786            printf("\n");
43787        }
43788    }
43789    }
43790    }
43791    }
43792    function_tests++;
43793#endif
43794
43795    return(test_ret);
43796}
43797
43798
43799static int
43800test_xmlTextWriterStartPI(void) {
43801    int test_ret = 0;
43802
43803#if defined(LIBXML_WRITER_ENABLED)
43804    int mem_base;
43805    int ret_val;
43806    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43807    int n_writer;
43808    xmlChar * target; /* PI target */
43809    int n_target;
43810
43811    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43812    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
43813        mem_base = xmlMemBlocks();
43814        writer = gen_xmlTextWriterPtr(n_writer, 0);
43815        target = gen_const_xmlChar_ptr(n_target, 1);
43816
43817        ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target);
43818        desret_int(ret_val);
43819        call_tests++;
43820        des_xmlTextWriterPtr(n_writer, writer, 0);
43821        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
43822        xmlResetLastError();
43823        if (mem_base != xmlMemBlocks()) {
43824            printf("Leak of %d blocks found in xmlTextWriterStartPI",
43825	           xmlMemBlocks() - mem_base);
43826	    test_ret++;
43827            printf(" %d", n_writer);
43828            printf(" %d", n_target);
43829            printf("\n");
43830        }
43831    }
43832    }
43833    function_tests++;
43834#endif
43835
43836    return(test_ret);
43837}
43838
43839
43840static int
43841test_xmlTextWriterWriteAttribute(void) {
43842    int test_ret = 0;
43843
43844#if defined(LIBXML_WRITER_ENABLED)
43845    int mem_base;
43846    int ret_val;
43847    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43848    int n_writer;
43849    xmlChar * name; /* attribute name */
43850    int n_name;
43851    xmlChar * content; /* attribute content */
43852    int n_content;
43853
43854    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43855    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43856    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43857        mem_base = xmlMemBlocks();
43858        writer = gen_xmlTextWriterPtr(n_writer, 0);
43859        name = gen_const_xmlChar_ptr(n_name, 1);
43860        content = gen_const_xmlChar_ptr(n_content, 2);
43861
43862        ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content);
43863        desret_int(ret_val);
43864        call_tests++;
43865        des_xmlTextWriterPtr(n_writer, writer, 0);
43866        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
43867        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
43868        xmlResetLastError();
43869        if (mem_base != xmlMemBlocks()) {
43870            printf("Leak of %d blocks found in xmlTextWriterWriteAttribute",
43871	           xmlMemBlocks() - mem_base);
43872	    test_ret++;
43873            printf(" %d", n_writer);
43874            printf(" %d", n_name);
43875            printf(" %d", n_content);
43876            printf("\n");
43877        }
43878    }
43879    }
43880    }
43881    function_tests++;
43882#endif
43883
43884    return(test_ret);
43885}
43886
43887
43888static int
43889test_xmlTextWriterWriteAttributeNS(void) {
43890    int test_ret = 0;
43891
43892#if defined(LIBXML_WRITER_ENABLED)
43893    int mem_base;
43894    int ret_val;
43895    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43896    int n_writer;
43897    xmlChar * prefix; /* namespace prefix */
43898    int n_prefix;
43899    xmlChar * name; /* attribute local name */
43900    int n_name;
43901    xmlChar * namespaceURI; /* namespace URI */
43902    int n_namespaceURI;
43903    xmlChar * content; /* attribute content */
43904    int n_content;
43905
43906    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43907    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
43908    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
43909    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
43910    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
43911        mem_base = xmlMemBlocks();
43912        writer = gen_xmlTextWriterPtr(n_writer, 0);
43913        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
43914        name = gen_const_xmlChar_ptr(n_name, 2);
43915        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
43916        content = gen_const_xmlChar_ptr(n_content, 4);
43917
43918        ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
43919        desret_int(ret_val);
43920        call_tests++;
43921        des_xmlTextWriterPtr(n_writer, writer, 0);
43922        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
43923        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
43924        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
43925        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
43926        xmlResetLastError();
43927        if (mem_base != xmlMemBlocks()) {
43928            printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS",
43929	           xmlMemBlocks() - mem_base);
43930	    test_ret++;
43931            printf(" %d", n_writer);
43932            printf(" %d", n_prefix);
43933            printf(" %d", n_name);
43934            printf(" %d", n_namespaceURI);
43935            printf(" %d", n_content);
43936            printf("\n");
43937        }
43938    }
43939    }
43940    }
43941    }
43942    }
43943    function_tests++;
43944#endif
43945
43946    return(test_ret);
43947}
43948
43949
43950static int
43951test_xmlTextWriterWriteBase64(void) {
43952    int test_ret = 0;
43953
43954#if defined(LIBXML_WRITER_ENABLED)
43955    int mem_base;
43956    int ret_val;
43957    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
43958    int n_writer;
43959    char * data; /* binary data */
43960    int n_data;
43961    int start; /* the position within the data of the first byte to encode */
43962    int n_start;
43963    int len; /* the number of bytes to encode */
43964    int n_len;
43965
43966    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
43967    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
43968    for (n_start = 0;n_start < gen_nb_int;n_start++) {
43969    for (n_len = 0;n_len < gen_nb_int;n_len++) {
43970        mem_base = xmlMemBlocks();
43971        writer = gen_xmlTextWriterPtr(n_writer, 0);
43972        data = gen_const_char_ptr(n_data, 1);
43973        start = gen_int(n_start, 2);
43974        len = gen_int(n_len, 3);
43975
43976        ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len);
43977        desret_int(ret_val);
43978        call_tests++;
43979        des_xmlTextWriterPtr(n_writer, writer, 0);
43980        des_const_char_ptr(n_data, (const char *)data, 1);
43981        des_int(n_start, start, 2);
43982        des_int(n_len, len, 3);
43983        xmlResetLastError();
43984        if (mem_base != xmlMemBlocks()) {
43985            printf("Leak of %d blocks found in xmlTextWriterWriteBase64",
43986	           xmlMemBlocks() - mem_base);
43987	    test_ret++;
43988            printf(" %d", n_writer);
43989            printf(" %d", n_data);
43990            printf(" %d", n_start);
43991            printf(" %d", n_len);
43992            printf("\n");
43993        }
43994    }
43995    }
43996    }
43997    }
43998    function_tests++;
43999#endif
44000
44001    return(test_ret);
44002}
44003
44004
44005static int
44006test_xmlTextWriterWriteBinHex(void) {
44007    int test_ret = 0;
44008
44009#if defined(LIBXML_WRITER_ENABLED)
44010    int mem_base;
44011    int ret_val;
44012    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44013    int n_writer;
44014    char * data; /* binary data */
44015    int n_data;
44016    int start; /* the position within the data of the first byte to encode */
44017    int n_start;
44018    int len; /* the number of bytes to encode */
44019    int n_len;
44020
44021    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44022    for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) {
44023    for (n_start = 0;n_start < gen_nb_int;n_start++) {
44024    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44025        mem_base = xmlMemBlocks();
44026        writer = gen_xmlTextWriterPtr(n_writer, 0);
44027        data = gen_const_char_ptr(n_data, 1);
44028        start = gen_int(n_start, 2);
44029        len = gen_int(n_len, 3);
44030
44031        ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len);
44032        desret_int(ret_val);
44033        call_tests++;
44034        des_xmlTextWriterPtr(n_writer, writer, 0);
44035        des_const_char_ptr(n_data, (const char *)data, 1);
44036        des_int(n_start, start, 2);
44037        des_int(n_len, len, 3);
44038        xmlResetLastError();
44039        if (mem_base != xmlMemBlocks()) {
44040            printf("Leak of %d blocks found in xmlTextWriterWriteBinHex",
44041	           xmlMemBlocks() - mem_base);
44042	    test_ret++;
44043            printf(" %d", n_writer);
44044            printf(" %d", n_data);
44045            printf(" %d", n_start);
44046            printf(" %d", n_len);
44047            printf("\n");
44048        }
44049    }
44050    }
44051    }
44052    }
44053    function_tests++;
44054#endif
44055
44056    return(test_ret);
44057}
44058
44059
44060static int
44061test_xmlTextWriterWriteCDATA(void) {
44062    int test_ret = 0;
44063
44064#if defined(LIBXML_WRITER_ENABLED)
44065    int mem_base;
44066    int ret_val;
44067    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44068    int n_writer;
44069    xmlChar * content; /* CDATA content */
44070    int n_content;
44071
44072    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44073    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44074        mem_base = xmlMemBlocks();
44075        writer = gen_xmlTextWriterPtr(n_writer, 0);
44076        content = gen_const_xmlChar_ptr(n_content, 1);
44077
44078        ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content);
44079        desret_int(ret_val);
44080        call_tests++;
44081        des_xmlTextWriterPtr(n_writer, writer, 0);
44082        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44083        xmlResetLastError();
44084        if (mem_base != xmlMemBlocks()) {
44085            printf("Leak of %d blocks found in xmlTextWriterWriteCDATA",
44086	           xmlMemBlocks() - mem_base);
44087	    test_ret++;
44088            printf(" %d", n_writer);
44089            printf(" %d", n_content);
44090            printf("\n");
44091        }
44092    }
44093    }
44094    function_tests++;
44095#endif
44096
44097    return(test_ret);
44098}
44099
44100
44101static int
44102test_xmlTextWriterWriteComment(void) {
44103    int test_ret = 0;
44104
44105#if defined(LIBXML_WRITER_ENABLED)
44106    int mem_base;
44107    int ret_val;
44108    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44109    int n_writer;
44110    xmlChar * content; /* comment string */
44111    int n_content;
44112
44113    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44114    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44115        mem_base = xmlMemBlocks();
44116        writer = gen_xmlTextWriterPtr(n_writer, 0);
44117        content = gen_const_xmlChar_ptr(n_content, 1);
44118
44119        ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content);
44120        desret_int(ret_val);
44121        call_tests++;
44122        des_xmlTextWriterPtr(n_writer, writer, 0);
44123        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44124        xmlResetLastError();
44125        if (mem_base != xmlMemBlocks()) {
44126            printf("Leak of %d blocks found in xmlTextWriterWriteComment",
44127	           xmlMemBlocks() - mem_base);
44128	    test_ret++;
44129            printf(" %d", n_writer);
44130            printf(" %d", n_content);
44131            printf("\n");
44132        }
44133    }
44134    }
44135    function_tests++;
44136#endif
44137
44138    return(test_ret);
44139}
44140
44141
44142static int
44143test_xmlTextWriterWriteDTD(void) {
44144    int test_ret = 0;
44145
44146#if defined(LIBXML_WRITER_ENABLED)
44147    int mem_base;
44148    int ret_val;
44149    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44150    int n_writer;
44151    xmlChar * name; /* the name of the DTD */
44152    int n_name;
44153    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44154    int n_pubid;
44155    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44156    int n_sysid;
44157    xmlChar * subset; /* string content of the DTD */
44158    int n_subset;
44159
44160    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44161    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44162    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44163    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44164    for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) {
44165        mem_base = xmlMemBlocks();
44166        writer = gen_xmlTextWriterPtr(n_writer, 0);
44167        name = gen_const_xmlChar_ptr(n_name, 1);
44168        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44169        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44170        subset = gen_const_xmlChar_ptr(n_subset, 4);
44171
44172        ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset);
44173        desret_int(ret_val);
44174        call_tests++;
44175        des_xmlTextWriterPtr(n_writer, writer, 0);
44176        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44177        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44178        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44179        des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4);
44180        xmlResetLastError();
44181        if (mem_base != xmlMemBlocks()) {
44182            printf("Leak of %d blocks found in xmlTextWriterWriteDTD",
44183	           xmlMemBlocks() - mem_base);
44184	    test_ret++;
44185            printf(" %d", n_writer);
44186            printf(" %d", n_name);
44187            printf(" %d", n_pubid);
44188            printf(" %d", n_sysid);
44189            printf(" %d", n_subset);
44190            printf("\n");
44191        }
44192    }
44193    }
44194    }
44195    }
44196    }
44197    function_tests++;
44198#endif
44199
44200    return(test_ret);
44201}
44202
44203
44204static int
44205test_xmlTextWriterWriteDTDAttlist(void) {
44206    int test_ret = 0;
44207
44208#if defined(LIBXML_WRITER_ENABLED)
44209    int mem_base;
44210    int ret_val;
44211    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44212    int n_writer;
44213    xmlChar * name; /* the name of the DTD ATTLIST */
44214    int n_name;
44215    xmlChar * content; /* content of the ATTLIST */
44216    int n_content;
44217
44218    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44219    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44220    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44221        mem_base = xmlMemBlocks();
44222        writer = gen_xmlTextWriterPtr(n_writer, 0);
44223        name = gen_const_xmlChar_ptr(n_name, 1);
44224        content = gen_const_xmlChar_ptr(n_content, 2);
44225
44226        ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content);
44227        desret_int(ret_val);
44228        call_tests++;
44229        des_xmlTextWriterPtr(n_writer, writer, 0);
44230        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44231        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44232        xmlResetLastError();
44233        if (mem_base != xmlMemBlocks()) {
44234            printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist",
44235	           xmlMemBlocks() - mem_base);
44236	    test_ret++;
44237            printf(" %d", n_writer);
44238            printf(" %d", n_name);
44239            printf(" %d", n_content);
44240            printf("\n");
44241        }
44242    }
44243    }
44244    }
44245    function_tests++;
44246#endif
44247
44248    return(test_ret);
44249}
44250
44251
44252static int
44253test_xmlTextWriterWriteDTDElement(void) {
44254    int test_ret = 0;
44255
44256#if defined(LIBXML_WRITER_ENABLED)
44257    int mem_base;
44258    int ret_val;
44259    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44260    int n_writer;
44261    xmlChar * name; /* the name of the DTD element */
44262    int n_name;
44263    xmlChar * content; /* content of the element */
44264    int n_content;
44265
44266    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44267    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44268    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44269        mem_base = xmlMemBlocks();
44270        writer = gen_xmlTextWriterPtr(n_writer, 0);
44271        name = gen_const_xmlChar_ptr(n_name, 1);
44272        content = gen_const_xmlChar_ptr(n_content, 2);
44273
44274        ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44275        desret_int(ret_val);
44276        call_tests++;
44277        des_xmlTextWriterPtr(n_writer, writer, 0);
44278        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44279        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44280        xmlResetLastError();
44281        if (mem_base != xmlMemBlocks()) {
44282            printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement",
44283	           xmlMemBlocks() - mem_base);
44284	    test_ret++;
44285            printf(" %d", n_writer);
44286            printf(" %d", n_name);
44287            printf(" %d", n_content);
44288            printf("\n");
44289        }
44290    }
44291    }
44292    }
44293    function_tests++;
44294#endif
44295
44296    return(test_ret);
44297}
44298
44299
44300static int
44301test_xmlTextWriterWriteDTDEntity(void) {
44302    int test_ret = 0;
44303
44304#if defined(LIBXML_WRITER_ENABLED)
44305    int mem_base;
44306    int ret_val;
44307    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44308    int n_writer;
44309    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44310    int n_pe;
44311    xmlChar * name; /* the name of the DTD entity */
44312    int n_name;
44313    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44314    int n_pubid;
44315    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44316    int n_sysid;
44317    xmlChar * ndataid; /* the xml notation name. */
44318    int n_ndataid;
44319    xmlChar * content; /* content of the entity */
44320    int n_content;
44321
44322    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44323    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44324    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44325    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44326    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44327    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44328    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44329        mem_base = xmlMemBlocks();
44330        writer = gen_xmlTextWriterPtr(n_writer, 0);
44331        pe = gen_int(n_pe, 1);
44332        name = gen_const_xmlChar_ptr(n_name, 2);
44333        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44334        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44335        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44336        content = gen_const_xmlChar_ptr(n_content, 6);
44337
44338        ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content);
44339        desret_int(ret_val);
44340        call_tests++;
44341        des_xmlTextWriterPtr(n_writer, writer, 0);
44342        des_int(n_pe, pe, 1);
44343        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44344        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44345        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44346        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44347        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6);
44348        xmlResetLastError();
44349        if (mem_base != xmlMemBlocks()) {
44350            printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity",
44351	           xmlMemBlocks() - mem_base);
44352	    test_ret++;
44353            printf(" %d", n_writer);
44354            printf(" %d", n_pe);
44355            printf(" %d", n_name);
44356            printf(" %d", n_pubid);
44357            printf(" %d", n_sysid);
44358            printf(" %d", n_ndataid);
44359            printf(" %d", n_content);
44360            printf("\n");
44361        }
44362    }
44363    }
44364    }
44365    }
44366    }
44367    }
44368    }
44369    function_tests++;
44370#endif
44371
44372    return(test_ret);
44373}
44374
44375
44376static int
44377test_xmlTextWriterWriteDTDExternalEntity(void) {
44378    int test_ret = 0;
44379
44380#if defined(LIBXML_WRITER_ENABLED)
44381    int mem_base;
44382    int ret_val;
44383    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44384    int n_writer;
44385    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44386    int n_pe;
44387    xmlChar * name; /* the name of the DTD entity */
44388    int n_name;
44389    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44390    int n_pubid;
44391    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44392    int n_sysid;
44393    xmlChar * ndataid; /* the xml notation name. */
44394    int n_ndataid;
44395
44396    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44397    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44398    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44399    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44400    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44401    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44402        mem_base = xmlMemBlocks();
44403        writer = gen_xmlTextWriterPtr(n_writer, 0);
44404        pe = gen_int(n_pe, 1);
44405        name = gen_const_xmlChar_ptr(n_name, 2);
44406        pubid = gen_const_xmlChar_ptr(n_pubid, 3);
44407        sysid = gen_const_xmlChar_ptr(n_sysid, 4);
44408        ndataid = gen_const_xmlChar_ptr(n_ndataid, 5);
44409
44410        ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44411        desret_int(ret_val);
44412        call_tests++;
44413        des_xmlTextWriterPtr(n_writer, writer, 0);
44414        des_int(n_pe, pe, 1);
44415        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44416        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3);
44417        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4);
44418        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5);
44419        xmlResetLastError();
44420        if (mem_base != xmlMemBlocks()) {
44421            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity",
44422	           xmlMemBlocks() - mem_base);
44423	    test_ret++;
44424            printf(" %d", n_writer);
44425            printf(" %d", n_pe);
44426            printf(" %d", n_name);
44427            printf(" %d", n_pubid);
44428            printf(" %d", n_sysid);
44429            printf(" %d", n_ndataid);
44430            printf("\n");
44431        }
44432    }
44433    }
44434    }
44435    }
44436    }
44437    }
44438    function_tests++;
44439#endif
44440
44441    return(test_ret);
44442}
44443
44444
44445static int
44446test_xmlTextWriterWriteDTDExternalEntityContents(void) {
44447    int test_ret = 0;
44448
44449#if defined(LIBXML_WRITER_ENABLED)
44450    int mem_base;
44451    int ret_val;
44452    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44453    int n_writer;
44454    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44455    int n_pubid;
44456    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44457    int n_sysid;
44458    xmlChar * ndataid; /* the xml notation name. */
44459    int n_ndataid;
44460
44461    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44462    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44463    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44464    for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) {
44465        mem_base = xmlMemBlocks();
44466        writer = gen_xmlTextWriterPtr(n_writer, 0);
44467        pubid = gen_const_xmlChar_ptr(n_pubid, 1);
44468        sysid = gen_const_xmlChar_ptr(n_sysid, 2);
44469        ndataid = gen_const_xmlChar_ptr(n_ndataid, 3);
44470
44471        ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid);
44472        desret_int(ret_val);
44473        call_tests++;
44474        des_xmlTextWriterPtr(n_writer, writer, 0);
44475        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1);
44476        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2);
44477        des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3);
44478        xmlResetLastError();
44479        if (mem_base != xmlMemBlocks()) {
44480            printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents",
44481	           xmlMemBlocks() - mem_base);
44482	    test_ret++;
44483            printf(" %d", n_writer);
44484            printf(" %d", n_pubid);
44485            printf(" %d", n_sysid);
44486            printf(" %d", n_ndataid);
44487            printf("\n");
44488        }
44489    }
44490    }
44491    }
44492    }
44493    function_tests++;
44494#endif
44495
44496    return(test_ret);
44497}
44498
44499
44500static int
44501test_xmlTextWriterWriteDTDInternalEntity(void) {
44502    int test_ret = 0;
44503
44504#if defined(LIBXML_WRITER_ENABLED)
44505    int mem_base;
44506    int ret_val;
44507    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44508    int n_writer;
44509    int pe; /* TRUE if this is a parameter entity, FALSE if not */
44510    int n_pe;
44511    xmlChar * name; /* the name of the DTD entity */
44512    int n_name;
44513    xmlChar * content; /* content of the entity */
44514    int n_content;
44515
44516    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44517    for (n_pe = 0;n_pe < gen_nb_int;n_pe++) {
44518    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44519    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44520        mem_base = xmlMemBlocks();
44521        writer = gen_xmlTextWriterPtr(n_writer, 0);
44522        pe = gen_int(n_pe, 1);
44523        name = gen_const_xmlChar_ptr(n_name, 2);
44524        content = gen_const_xmlChar_ptr(n_content, 3);
44525
44526        ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content);
44527        desret_int(ret_val);
44528        call_tests++;
44529        des_xmlTextWriterPtr(n_writer, writer, 0);
44530        des_int(n_pe, pe, 1);
44531        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44532        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3);
44533        xmlResetLastError();
44534        if (mem_base != xmlMemBlocks()) {
44535            printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity",
44536	           xmlMemBlocks() - mem_base);
44537	    test_ret++;
44538            printf(" %d", n_writer);
44539            printf(" %d", n_pe);
44540            printf(" %d", n_name);
44541            printf(" %d", n_content);
44542            printf("\n");
44543        }
44544    }
44545    }
44546    }
44547    }
44548    function_tests++;
44549#endif
44550
44551    return(test_ret);
44552}
44553
44554
44555static int
44556test_xmlTextWriterWriteDTDNotation(void) {
44557    int test_ret = 0;
44558
44559#if defined(LIBXML_WRITER_ENABLED)
44560    int mem_base;
44561    int ret_val;
44562    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44563    int n_writer;
44564    xmlChar * name; /* the name of the xml notation */
44565    int n_name;
44566    xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */
44567    int n_pubid;
44568    xmlChar * sysid; /* the system identifier, which is the URI of the DTD */
44569    int n_sysid;
44570
44571    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44572    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44573    for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) {
44574    for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) {
44575        mem_base = xmlMemBlocks();
44576        writer = gen_xmlTextWriterPtr(n_writer, 0);
44577        name = gen_const_xmlChar_ptr(n_name, 1);
44578        pubid = gen_const_xmlChar_ptr(n_pubid, 2);
44579        sysid = gen_const_xmlChar_ptr(n_sysid, 3);
44580
44581        ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid);
44582        desret_int(ret_val);
44583        call_tests++;
44584        des_xmlTextWriterPtr(n_writer, writer, 0);
44585        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44586        des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2);
44587        des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3);
44588        xmlResetLastError();
44589        if (mem_base != xmlMemBlocks()) {
44590            printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation",
44591	           xmlMemBlocks() - mem_base);
44592	    test_ret++;
44593            printf(" %d", n_writer);
44594            printf(" %d", n_name);
44595            printf(" %d", n_pubid);
44596            printf(" %d", n_sysid);
44597            printf("\n");
44598        }
44599    }
44600    }
44601    }
44602    }
44603    function_tests++;
44604#endif
44605
44606    return(test_ret);
44607}
44608
44609
44610static int
44611test_xmlTextWriterWriteElement(void) {
44612    int test_ret = 0;
44613
44614#if defined(LIBXML_WRITER_ENABLED)
44615    int mem_base;
44616    int ret_val;
44617    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44618    int n_writer;
44619    xmlChar * name; /* element name */
44620    int n_name;
44621    xmlChar * content; /* element content */
44622    int n_content;
44623
44624    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44625    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44626    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44627        mem_base = xmlMemBlocks();
44628        writer = gen_xmlTextWriterPtr(n_writer, 0);
44629        name = gen_const_xmlChar_ptr(n_name, 1);
44630        content = gen_const_xmlChar_ptr(n_content, 2);
44631
44632        ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content);
44633        desret_int(ret_val);
44634        call_tests++;
44635        des_xmlTextWriterPtr(n_writer, writer, 0);
44636        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
44637        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44638        xmlResetLastError();
44639        if (mem_base != xmlMemBlocks()) {
44640            printf("Leak of %d blocks found in xmlTextWriterWriteElement",
44641	           xmlMemBlocks() - mem_base);
44642	    test_ret++;
44643            printf(" %d", n_writer);
44644            printf(" %d", n_name);
44645            printf(" %d", n_content);
44646            printf("\n");
44647        }
44648    }
44649    }
44650    }
44651    function_tests++;
44652#endif
44653
44654    return(test_ret);
44655}
44656
44657
44658static int
44659test_xmlTextWriterWriteElementNS(void) {
44660    int test_ret = 0;
44661
44662#if defined(LIBXML_WRITER_ENABLED)
44663    int mem_base;
44664    int ret_val;
44665    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44666    int n_writer;
44667    xmlChar * prefix; /* namespace prefix */
44668    int n_prefix;
44669    xmlChar * name; /* element local name */
44670    int n_name;
44671    xmlChar * namespaceURI; /* namespace URI */
44672    int n_namespaceURI;
44673    xmlChar * content; /* element content */
44674    int n_content;
44675
44676    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44677    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
44678    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
44679    for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) {
44680    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44681        mem_base = xmlMemBlocks();
44682        writer = gen_xmlTextWriterPtr(n_writer, 0);
44683        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
44684        name = gen_const_xmlChar_ptr(n_name, 2);
44685        namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3);
44686        content = gen_const_xmlChar_ptr(n_content, 4);
44687
44688        ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content);
44689        desret_int(ret_val);
44690        call_tests++;
44691        des_xmlTextWriterPtr(n_writer, writer, 0);
44692        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
44693        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2);
44694        des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3);
44695        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4);
44696        xmlResetLastError();
44697        if (mem_base != xmlMemBlocks()) {
44698            printf("Leak of %d blocks found in xmlTextWriterWriteElementNS",
44699	           xmlMemBlocks() - mem_base);
44700	    test_ret++;
44701            printf(" %d", n_writer);
44702            printf(" %d", n_prefix);
44703            printf(" %d", n_name);
44704            printf(" %d", n_namespaceURI);
44705            printf(" %d", n_content);
44706            printf("\n");
44707        }
44708    }
44709    }
44710    }
44711    }
44712    }
44713    function_tests++;
44714#endif
44715
44716    return(test_ret);
44717}
44718
44719
44720static int
44721test_xmlTextWriterWriteFormatAttribute(void) {
44722    int test_ret = 0;
44723
44724
44725    /* missing type support */
44726    return(test_ret);
44727}
44728
44729
44730static int
44731test_xmlTextWriterWriteFormatAttributeNS(void) {
44732    int test_ret = 0;
44733
44734
44735    /* missing type support */
44736    return(test_ret);
44737}
44738
44739
44740static int
44741test_xmlTextWriterWriteFormatCDATA(void) {
44742    int test_ret = 0;
44743
44744
44745    /* missing type support */
44746    return(test_ret);
44747}
44748
44749
44750static int
44751test_xmlTextWriterWriteFormatComment(void) {
44752    int test_ret = 0;
44753
44754
44755    /* missing type support */
44756    return(test_ret);
44757}
44758
44759
44760static int
44761test_xmlTextWriterWriteFormatDTD(void) {
44762    int test_ret = 0;
44763
44764
44765    /* missing type support */
44766    return(test_ret);
44767}
44768
44769
44770static int
44771test_xmlTextWriterWriteFormatDTDAttlist(void) {
44772    int test_ret = 0;
44773
44774
44775    /* missing type support */
44776    return(test_ret);
44777}
44778
44779
44780static int
44781test_xmlTextWriterWriteFormatDTDElement(void) {
44782    int test_ret = 0;
44783
44784
44785    /* missing type support */
44786    return(test_ret);
44787}
44788
44789
44790static int
44791test_xmlTextWriterWriteFormatDTDInternalEntity(void) {
44792    int test_ret = 0;
44793
44794
44795    /* missing type support */
44796    return(test_ret);
44797}
44798
44799
44800static int
44801test_xmlTextWriterWriteFormatElement(void) {
44802    int test_ret = 0;
44803
44804
44805    /* missing type support */
44806    return(test_ret);
44807}
44808
44809
44810static int
44811test_xmlTextWriterWriteFormatElementNS(void) {
44812    int test_ret = 0;
44813
44814
44815    /* missing type support */
44816    return(test_ret);
44817}
44818
44819
44820static int
44821test_xmlTextWriterWriteFormatPI(void) {
44822    int test_ret = 0;
44823
44824
44825    /* missing type support */
44826    return(test_ret);
44827}
44828
44829
44830static int
44831test_xmlTextWriterWriteFormatRaw(void) {
44832    int test_ret = 0;
44833
44834
44835    /* missing type support */
44836    return(test_ret);
44837}
44838
44839
44840static int
44841test_xmlTextWriterWriteFormatString(void) {
44842    int test_ret = 0;
44843
44844
44845    /* missing type support */
44846    return(test_ret);
44847}
44848
44849
44850static int
44851test_xmlTextWriterWritePI(void) {
44852    int test_ret = 0;
44853
44854#if defined(LIBXML_WRITER_ENABLED)
44855    int mem_base;
44856    int ret_val;
44857    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44858    int n_writer;
44859    xmlChar * target; /* PI target */
44860    int n_target;
44861    xmlChar * content; /* PI content */
44862    int n_content;
44863
44864    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44865    for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) {
44866    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44867        mem_base = xmlMemBlocks();
44868        writer = gen_xmlTextWriterPtr(n_writer, 0);
44869        target = gen_const_xmlChar_ptr(n_target, 1);
44870        content = gen_const_xmlChar_ptr(n_content, 2);
44871
44872        ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content);
44873        desret_int(ret_val);
44874        call_tests++;
44875        des_xmlTextWriterPtr(n_writer, writer, 0);
44876        des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1);
44877        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2);
44878        xmlResetLastError();
44879        if (mem_base != xmlMemBlocks()) {
44880            printf("Leak of %d blocks found in xmlTextWriterWritePI",
44881	           xmlMemBlocks() - mem_base);
44882	    test_ret++;
44883            printf(" %d", n_writer);
44884            printf(" %d", n_target);
44885            printf(" %d", n_content);
44886            printf("\n");
44887        }
44888    }
44889    }
44890    }
44891    function_tests++;
44892#endif
44893
44894    return(test_ret);
44895}
44896
44897
44898static int
44899test_xmlTextWriterWriteRaw(void) {
44900    int test_ret = 0;
44901
44902#if defined(LIBXML_WRITER_ENABLED)
44903    int mem_base;
44904    int ret_val;
44905    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44906    int n_writer;
44907    xmlChar * content; /* text string */
44908    int n_content;
44909
44910    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44911    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44912        mem_base = xmlMemBlocks();
44913        writer = gen_xmlTextWriterPtr(n_writer, 0);
44914        content = gen_const_xmlChar_ptr(n_content, 1);
44915
44916        ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content);
44917        desret_int(ret_val);
44918        call_tests++;
44919        des_xmlTextWriterPtr(n_writer, writer, 0);
44920        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44921        xmlResetLastError();
44922        if (mem_base != xmlMemBlocks()) {
44923            printf("Leak of %d blocks found in xmlTextWriterWriteRaw",
44924	           xmlMemBlocks() - mem_base);
44925	    test_ret++;
44926            printf(" %d", n_writer);
44927            printf(" %d", n_content);
44928            printf("\n");
44929        }
44930    }
44931    }
44932    function_tests++;
44933#endif
44934
44935    return(test_ret);
44936}
44937
44938
44939static int
44940test_xmlTextWriterWriteRawLen(void) {
44941    int test_ret = 0;
44942
44943#if defined(LIBXML_WRITER_ENABLED)
44944    int mem_base;
44945    int ret_val;
44946    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44947    int n_writer;
44948    xmlChar * content; /* text string */
44949    int n_content;
44950    int len; /* length of the text string */
44951    int n_len;
44952
44953    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
44954    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
44955    for (n_len = 0;n_len < gen_nb_int;n_len++) {
44956        mem_base = xmlMemBlocks();
44957        writer = gen_xmlTextWriterPtr(n_writer, 0);
44958        content = gen_const_xmlChar_ptr(n_content, 1);
44959        len = gen_int(n_len, 2);
44960
44961        ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len);
44962        desret_int(ret_val);
44963        call_tests++;
44964        des_xmlTextWriterPtr(n_writer, writer, 0);
44965        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
44966        des_int(n_len, len, 2);
44967        xmlResetLastError();
44968        if (mem_base != xmlMemBlocks()) {
44969            printf("Leak of %d blocks found in xmlTextWriterWriteRawLen",
44970	           xmlMemBlocks() - mem_base);
44971	    test_ret++;
44972            printf(" %d", n_writer);
44973            printf(" %d", n_content);
44974            printf(" %d", n_len);
44975            printf("\n");
44976        }
44977    }
44978    }
44979    }
44980    function_tests++;
44981#endif
44982
44983    return(test_ret);
44984}
44985
44986
44987static int
44988test_xmlTextWriterWriteString(void) {
44989    int test_ret = 0;
44990
44991#if defined(LIBXML_WRITER_ENABLED)
44992    int mem_base;
44993    int ret_val;
44994    xmlTextWriterPtr writer; /* the xmlTextWriterPtr */
44995    int n_writer;
44996    xmlChar * content; /* text string */
44997    int n_content;
44998
44999    for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) {
45000    for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
45001        mem_base = xmlMemBlocks();
45002        writer = gen_xmlTextWriterPtr(n_writer, 0);
45003        content = gen_const_xmlChar_ptr(n_content, 1);
45004
45005        ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content);
45006        desret_int(ret_val);
45007        call_tests++;
45008        des_xmlTextWriterPtr(n_writer, writer, 0);
45009        des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1);
45010        xmlResetLastError();
45011        if (mem_base != xmlMemBlocks()) {
45012            printf("Leak of %d blocks found in xmlTextWriterWriteString",
45013	           xmlMemBlocks() - mem_base);
45014	    test_ret++;
45015            printf(" %d", n_writer);
45016            printf(" %d", n_content);
45017            printf("\n");
45018        }
45019    }
45020    }
45021    function_tests++;
45022#endif
45023
45024    return(test_ret);
45025}
45026
45027
45028static int
45029test_xmlTextWriterWriteVFormatAttribute(void) {
45030    int test_ret = 0;
45031
45032
45033    /* missing type support */
45034    return(test_ret);
45035}
45036
45037
45038static int
45039test_xmlTextWriterWriteVFormatAttributeNS(void) {
45040    int test_ret = 0;
45041
45042
45043    /* missing type support */
45044    return(test_ret);
45045}
45046
45047
45048static int
45049test_xmlTextWriterWriteVFormatCDATA(void) {
45050    int test_ret = 0;
45051
45052
45053    /* missing type support */
45054    return(test_ret);
45055}
45056
45057
45058static int
45059test_xmlTextWriterWriteVFormatComment(void) {
45060    int test_ret = 0;
45061
45062
45063    /* missing type support */
45064    return(test_ret);
45065}
45066
45067
45068static int
45069test_xmlTextWriterWriteVFormatDTD(void) {
45070    int test_ret = 0;
45071
45072
45073    /* missing type support */
45074    return(test_ret);
45075}
45076
45077
45078static int
45079test_xmlTextWriterWriteVFormatDTDAttlist(void) {
45080    int test_ret = 0;
45081
45082
45083    /* missing type support */
45084    return(test_ret);
45085}
45086
45087
45088static int
45089test_xmlTextWriterWriteVFormatDTDElement(void) {
45090    int test_ret = 0;
45091
45092
45093    /* missing type support */
45094    return(test_ret);
45095}
45096
45097
45098static int
45099test_xmlTextWriterWriteVFormatDTDInternalEntity(void) {
45100    int test_ret = 0;
45101
45102
45103    /* missing type support */
45104    return(test_ret);
45105}
45106
45107
45108static int
45109test_xmlTextWriterWriteVFormatElement(void) {
45110    int test_ret = 0;
45111
45112
45113    /* missing type support */
45114    return(test_ret);
45115}
45116
45117
45118static int
45119test_xmlTextWriterWriteVFormatElementNS(void) {
45120    int test_ret = 0;
45121
45122
45123    /* missing type support */
45124    return(test_ret);
45125}
45126
45127
45128static int
45129test_xmlTextWriterWriteVFormatPI(void) {
45130    int test_ret = 0;
45131
45132
45133    /* missing type support */
45134    return(test_ret);
45135}
45136
45137
45138static int
45139test_xmlTextWriterWriteVFormatRaw(void) {
45140    int test_ret = 0;
45141
45142
45143    /* missing type support */
45144    return(test_ret);
45145}
45146
45147
45148static int
45149test_xmlTextWriterWriteVFormatString(void) {
45150    int test_ret = 0;
45151
45152
45153    /* missing type support */
45154    return(test_ret);
45155}
45156
45157static int
45158test_xmlwriter(void) {
45159    int test_ret = 0;
45160
45161    if (quiet == 0) printf("Testing xmlwriter : 51 of 79 functions ...\n");
45162    test_ret += test_xmlNewTextWriter();
45163    test_ret += test_xmlNewTextWriterFilename();
45164    test_ret += test_xmlNewTextWriterMemory();
45165    test_ret += test_xmlNewTextWriterPushParser();
45166    test_ret += test_xmlNewTextWriterTree();
45167    test_ret += test_xmlTextWriterEndAttribute();
45168    test_ret += test_xmlTextWriterEndCDATA();
45169    test_ret += test_xmlTextWriterEndComment();
45170    test_ret += test_xmlTextWriterEndDTD();
45171    test_ret += test_xmlTextWriterEndDTDAttlist();
45172    test_ret += test_xmlTextWriterEndDTDElement();
45173    test_ret += test_xmlTextWriterEndDTDEntity();
45174    test_ret += test_xmlTextWriterEndDocument();
45175    test_ret += test_xmlTextWriterEndElement();
45176    test_ret += test_xmlTextWriterEndPI();
45177    test_ret += test_xmlTextWriterFlush();
45178    test_ret += test_xmlTextWriterFullEndElement();
45179    test_ret += test_xmlTextWriterSetIndent();
45180    test_ret += test_xmlTextWriterSetIndentString();
45181    test_ret += test_xmlTextWriterStartAttribute();
45182    test_ret += test_xmlTextWriterStartAttributeNS();
45183    test_ret += test_xmlTextWriterStartCDATA();
45184    test_ret += test_xmlTextWriterStartComment();
45185    test_ret += test_xmlTextWriterStartDTD();
45186    test_ret += test_xmlTextWriterStartDTDAttlist();
45187    test_ret += test_xmlTextWriterStartDTDElement();
45188    test_ret += test_xmlTextWriterStartDTDEntity();
45189    test_ret += test_xmlTextWriterStartDocument();
45190    test_ret += test_xmlTextWriterStartElement();
45191    test_ret += test_xmlTextWriterStartElementNS();
45192    test_ret += test_xmlTextWriterStartPI();
45193    test_ret += test_xmlTextWriterWriteAttribute();
45194    test_ret += test_xmlTextWriterWriteAttributeNS();
45195    test_ret += test_xmlTextWriterWriteBase64();
45196    test_ret += test_xmlTextWriterWriteBinHex();
45197    test_ret += test_xmlTextWriterWriteCDATA();
45198    test_ret += test_xmlTextWriterWriteComment();
45199    test_ret += test_xmlTextWriterWriteDTD();
45200    test_ret += test_xmlTextWriterWriteDTDAttlist();
45201    test_ret += test_xmlTextWriterWriteDTDElement();
45202    test_ret += test_xmlTextWriterWriteDTDEntity();
45203    test_ret += test_xmlTextWriterWriteDTDExternalEntity();
45204    test_ret += test_xmlTextWriterWriteDTDExternalEntityContents();
45205    test_ret += test_xmlTextWriterWriteDTDInternalEntity();
45206    test_ret += test_xmlTextWriterWriteDTDNotation();
45207    test_ret += test_xmlTextWriterWriteElement();
45208    test_ret += test_xmlTextWriterWriteElementNS();
45209    test_ret += test_xmlTextWriterWriteFormatAttribute();
45210    test_ret += test_xmlTextWriterWriteFormatAttributeNS();
45211    test_ret += test_xmlTextWriterWriteFormatCDATA();
45212    test_ret += test_xmlTextWriterWriteFormatComment();
45213    test_ret += test_xmlTextWriterWriteFormatDTD();
45214    test_ret += test_xmlTextWriterWriteFormatDTDAttlist();
45215    test_ret += test_xmlTextWriterWriteFormatDTDElement();
45216    test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity();
45217    test_ret += test_xmlTextWriterWriteFormatElement();
45218    test_ret += test_xmlTextWriterWriteFormatElementNS();
45219    test_ret += test_xmlTextWriterWriteFormatPI();
45220    test_ret += test_xmlTextWriterWriteFormatRaw();
45221    test_ret += test_xmlTextWriterWriteFormatString();
45222    test_ret += test_xmlTextWriterWritePI();
45223    test_ret += test_xmlTextWriterWriteRaw();
45224    test_ret += test_xmlTextWriterWriteRawLen();
45225    test_ret += test_xmlTextWriterWriteString();
45226    test_ret += test_xmlTextWriterWriteVFormatAttribute();
45227    test_ret += test_xmlTextWriterWriteVFormatAttributeNS();
45228    test_ret += test_xmlTextWriterWriteVFormatCDATA();
45229    test_ret += test_xmlTextWriterWriteVFormatComment();
45230    test_ret += test_xmlTextWriterWriteVFormatDTD();
45231    test_ret += test_xmlTextWriterWriteVFormatDTDAttlist();
45232    test_ret += test_xmlTextWriterWriteVFormatDTDElement();
45233    test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity();
45234    test_ret += test_xmlTextWriterWriteVFormatElement();
45235    test_ret += test_xmlTextWriterWriteVFormatElementNS();
45236    test_ret += test_xmlTextWriterWriteVFormatPI();
45237    test_ret += test_xmlTextWriterWriteVFormatRaw();
45238    test_ret += test_xmlTextWriterWriteVFormatString();
45239
45240    if (test_ret != 0)
45241	printf("Module xmlwriter: %d errors\n", test_ret);
45242    return(test_ret);
45243}
45244
45245static int
45246test_xmlXPathCastBooleanToNumber(void) {
45247    int test_ret = 0;
45248
45249#if defined(LIBXML_XPATH_ENABLED)
45250    int mem_base;
45251    double ret_val;
45252    int val; /* a boolean */
45253    int n_val;
45254
45255    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45256        mem_base = xmlMemBlocks();
45257        val = gen_int(n_val, 0);
45258
45259        ret_val = xmlXPathCastBooleanToNumber(val);
45260        desret_double(ret_val);
45261        call_tests++;
45262        des_int(n_val, val, 0);
45263        xmlResetLastError();
45264        if (mem_base != xmlMemBlocks()) {
45265            printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber",
45266	           xmlMemBlocks() - mem_base);
45267	    test_ret++;
45268            printf(" %d", n_val);
45269            printf("\n");
45270        }
45271    }
45272    function_tests++;
45273#endif
45274
45275    return(test_ret);
45276}
45277
45278
45279static int
45280test_xmlXPathCastBooleanToString(void) {
45281    int test_ret = 0;
45282
45283#if defined(LIBXML_XPATH_ENABLED)
45284    int mem_base;
45285    xmlChar * ret_val;
45286    int val; /* a boolean */
45287    int n_val;
45288
45289    for (n_val = 0;n_val < gen_nb_int;n_val++) {
45290        mem_base = xmlMemBlocks();
45291        val = gen_int(n_val, 0);
45292
45293        ret_val = xmlXPathCastBooleanToString(val);
45294        desret_xmlChar_ptr(ret_val);
45295        call_tests++;
45296        des_int(n_val, val, 0);
45297        xmlResetLastError();
45298        if (mem_base != xmlMemBlocks()) {
45299            printf("Leak of %d blocks found in xmlXPathCastBooleanToString",
45300	           xmlMemBlocks() - mem_base);
45301	    test_ret++;
45302            printf(" %d", n_val);
45303            printf("\n");
45304        }
45305    }
45306    function_tests++;
45307#endif
45308
45309    return(test_ret);
45310}
45311
45312
45313static int
45314test_xmlXPathCastNodeSetToBoolean(void) {
45315    int test_ret = 0;
45316
45317#if defined(LIBXML_XPATH_ENABLED)
45318    int mem_base;
45319    int ret_val;
45320    xmlNodeSetPtr ns; /* a node-set */
45321    int n_ns;
45322
45323    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45324        mem_base = xmlMemBlocks();
45325        ns = gen_xmlNodeSetPtr(n_ns, 0);
45326
45327        ret_val = xmlXPathCastNodeSetToBoolean(ns);
45328        desret_int(ret_val);
45329        call_tests++;
45330        des_xmlNodeSetPtr(n_ns, ns, 0);
45331        xmlResetLastError();
45332        if (mem_base != xmlMemBlocks()) {
45333            printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean",
45334	           xmlMemBlocks() - mem_base);
45335	    test_ret++;
45336            printf(" %d", n_ns);
45337            printf("\n");
45338        }
45339    }
45340    function_tests++;
45341#endif
45342
45343    return(test_ret);
45344}
45345
45346
45347static int
45348test_xmlXPathCastNodeSetToNumber(void) {
45349    int test_ret = 0;
45350
45351#if defined(LIBXML_XPATH_ENABLED)
45352    int mem_base;
45353    double ret_val;
45354    xmlNodeSetPtr ns; /* a node-set */
45355    int n_ns;
45356
45357    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45358        mem_base = xmlMemBlocks();
45359        ns = gen_xmlNodeSetPtr(n_ns, 0);
45360
45361        ret_val = xmlXPathCastNodeSetToNumber(ns);
45362        desret_double(ret_val);
45363        call_tests++;
45364        des_xmlNodeSetPtr(n_ns, ns, 0);
45365        xmlResetLastError();
45366        if (mem_base != xmlMemBlocks()) {
45367            printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber",
45368	           xmlMemBlocks() - mem_base);
45369	    test_ret++;
45370            printf(" %d", n_ns);
45371            printf("\n");
45372        }
45373    }
45374    function_tests++;
45375#endif
45376
45377    return(test_ret);
45378}
45379
45380
45381static int
45382test_xmlXPathCastNodeSetToString(void) {
45383    int test_ret = 0;
45384
45385#if defined(LIBXML_XPATH_ENABLED)
45386    int mem_base;
45387    xmlChar * ret_val;
45388    xmlNodeSetPtr ns; /* a node-set */
45389    int n_ns;
45390
45391    for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) {
45392        mem_base = xmlMemBlocks();
45393        ns = gen_xmlNodeSetPtr(n_ns, 0);
45394
45395        ret_val = xmlXPathCastNodeSetToString(ns);
45396        desret_xmlChar_ptr(ret_val);
45397        call_tests++;
45398        des_xmlNodeSetPtr(n_ns, ns, 0);
45399        xmlResetLastError();
45400        if (mem_base != xmlMemBlocks()) {
45401            printf("Leak of %d blocks found in xmlXPathCastNodeSetToString",
45402	           xmlMemBlocks() - mem_base);
45403	    test_ret++;
45404            printf(" %d", n_ns);
45405            printf("\n");
45406        }
45407    }
45408    function_tests++;
45409#endif
45410
45411    return(test_ret);
45412}
45413
45414
45415static int
45416test_xmlXPathCastNodeToNumber(void) {
45417    int test_ret = 0;
45418
45419#if defined(LIBXML_XPATH_ENABLED)
45420    int mem_base;
45421    double ret_val;
45422    xmlNodePtr node; /* a node */
45423    int n_node;
45424
45425    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45426        mem_base = xmlMemBlocks();
45427        node = gen_xmlNodePtr(n_node, 0);
45428
45429        ret_val = xmlXPathCastNodeToNumber(node);
45430        desret_double(ret_val);
45431        call_tests++;
45432        des_xmlNodePtr(n_node, node, 0);
45433        xmlResetLastError();
45434        if (mem_base != xmlMemBlocks()) {
45435            printf("Leak of %d blocks found in xmlXPathCastNodeToNumber",
45436	           xmlMemBlocks() - mem_base);
45437	    test_ret++;
45438            printf(" %d", n_node);
45439            printf("\n");
45440        }
45441    }
45442    function_tests++;
45443#endif
45444
45445    return(test_ret);
45446}
45447
45448
45449static int
45450test_xmlXPathCastNodeToString(void) {
45451    int test_ret = 0;
45452
45453#if defined(LIBXML_XPATH_ENABLED)
45454    int mem_base;
45455    xmlChar * ret_val;
45456    xmlNodePtr node; /* a node */
45457    int n_node;
45458
45459    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
45460        mem_base = xmlMemBlocks();
45461        node = gen_xmlNodePtr(n_node, 0);
45462
45463        ret_val = xmlXPathCastNodeToString(node);
45464        desret_xmlChar_ptr(ret_val);
45465        call_tests++;
45466        des_xmlNodePtr(n_node, node, 0);
45467        xmlResetLastError();
45468        if (mem_base != xmlMemBlocks()) {
45469            printf("Leak of %d blocks found in xmlXPathCastNodeToString",
45470	           xmlMemBlocks() - mem_base);
45471	    test_ret++;
45472            printf(" %d", n_node);
45473            printf("\n");
45474        }
45475    }
45476    function_tests++;
45477#endif
45478
45479    return(test_ret);
45480}
45481
45482
45483static int
45484test_xmlXPathCastNumberToBoolean(void) {
45485    int test_ret = 0;
45486
45487#if defined(LIBXML_XPATH_ENABLED)
45488    int mem_base;
45489    int ret_val;
45490    double val; /* a number */
45491    int n_val;
45492
45493    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45494        mem_base = xmlMemBlocks();
45495        val = gen_double(n_val, 0);
45496
45497        ret_val = xmlXPathCastNumberToBoolean(val);
45498        desret_int(ret_val);
45499        call_tests++;
45500        des_double(n_val, val, 0);
45501        xmlResetLastError();
45502        if (mem_base != xmlMemBlocks()) {
45503            printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean",
45504	           xmlMemBlocks() - mem_base);
45505	    test_ret++;
45506            printf(" %d", n_val);
45507            printf("\n");
45508        }
45509    }
45510    function_tests++;
45511#endif
45512
45513    return(test_ret);
45514}
45515
45516
45517static int
45518test_xmlXPathCastNumberToString(void) {
45519    int test_ret = 0;
45520
45521#if defined(LIBXML_XPATH_ENABLED)
45522    int mem_base;
45523    xmlChar * ret_val;
45524    double val; /* a number */
45525    int n_val;
45526
45527    for (n_val = 0;n_val < gen_nb_double;n_val++) {
45528        mem_base = xmlMemBlocks();
45529        val = gen_double(n_val, 0);
45530
45531        ret_val = xmlXPathCastNumberToString(val);
45532        desret_xmlChar_ptr(ret_val);
45533        call_tests++;
45534        des_double(n_val, val, 0);
45535        xmlResetLastError();
45536        if (mem_base != xmlMemBlocks()) {
45537            printf("Leak of %d blocks found in xmlXPathCastNumberToString",
45538	           xmlMemBlocks() - mem_base);
45539	    test_ret++;
45540            printf(" %d", n_val);
45541            printf("\n");
45542        }
45543    }
45544    function_tests++;
45545#endif
45546
45547    return(test_ret);
45548}
45549
45550
45551static int
45552test_xmlXPathCastStringToBoolean(void) {
45553    int test_ret = 0;
45554
45555#if defined(LIBXML_XPATH_ENABLED)
45556    int mem_base;
45557    int ret_val;
45558    xmlChar * val; /* a string */
45559    int n_val;
45560
45561    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45562        mem_base = xmlMemBlocks();
45563        val = gen_const_xmlChar_ptr(n_val, 0);
45564
45565        ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val);
45566        desret_int(ret_val);
45567        call_tests++;
45568        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45569        xmlResetLastError();
45570        if (mem_base != xmlMemBlocks()) {
45571            printf("Leak of %d blocks found in xmlXPathCastStringToBoolean",
45572	           xmlMemBlocks() - mem_base);
45573	    test_ret++;
45574            printf(" %d", n_val);
45575            printf("\n");
45576        }
45577    }
45578    function_tests++;
45579#endif
45580
45581    return(test_ret);
45582}
45583
45584
45585static int
45586test_xmlXPathCastStringToNumber(void) {
45587    int test_ret = 0;
45588
45589#if defined(LIBXML_XPATH_ENABLED)
45590    int mem_base;
45591    double ret_val;
45592    xmlChar * val; /* a string */
45593    int n_val;
45594
45595    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
45596        mem_base = xmlMemBlocks();
45597        val = gen_const_xmlChar_ptr(n_val, 0);
45598
45599        ret_val = xmlXPathCastStringToNumber((const xmlChar *)val);
45600        desret_double(ret_val);
45601        call_tests++;
45602        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
45603        xmlResetLastError();
45604        if (mem_base != xmlMemBlocks()) {
45605            printf("Leak of %d blocks found in xmlXPathCastStringToNumber",
45606	           xmlMemBlocks() - mem_base);
45607	    test_ret++;
45608            printf(" %d", n_val);
45609            printf("\n");
45610        }
45611    }
45612    function_tests++;
45613#endif
45614
45615    return(test_ret);
45616}
45617
45618
45619static int
45620test_xmlXPathCastToBoolean(void) {
45621    int test_ret = 0;
45622
45623#if defined(LIBXML_XPATH_ENABLED)
45624    int mem_base;
45625    int ret_val;
45626    xmlXPathObjectPtr val; /* an XPath object */
45627    int n_val;
45628
45629    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45630        mem_base = xmlMemBlocks();
45631        val = gen_xmlXPathObjectPtr(n_val, 0);
45632
45633        ret_val = xmlXPathCastToBoolean(val);
45634        desret_int(ret_val);
45635        call_tests++;
45636        des_xmlXPathObjectPtr(n_val, val, 0);
45637        xmlResetLastError();
45638        if (mem_base != xmlMemBlocks()) {
45639            printf("Leak of %d blocks found in xmlXPathCastToBoolean",
45640	           xmlMemBlocks() - mem_base);
45641	    test_ret++;
45642            printf(" %d", n_val);
45643            printf("\n");
45644        }
45645    }
45646    function_tests++;
45647#endif
45648
45649    return(test_ret);
45650}
45651
45652
45653static int
45654test_xmlXPathCastToNumber(void) {
45655    int test_ret = 0;
45656
45657#if defined(LIBXML_XPATH_ENABLED)
45658    int mem_base;
45659    double ret_val;
45660    xmlXPathObjectPtr val; /* an XPath object */
45661    int n_val;
45662
45663    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45664        mem_base = xmlMemBlocks();
45665        val = gen_xmlXPathObjectPtr(n_val, 0);
45666
45667        ret_val = xmlXPathCastToNumber(val);
45668        desret_double(ret_val);
45669        call_tests++;
45670        des_xmlXPathObjectPtr(n_val, val, 0);
45671        xmlResetLastError();
45672        if (mem_base != xmlMemBlocks()) {
45673            printf("Leak of %d blocks found in xmlXPathCastToNumber",
45674	           xmlMemBlocks() - mem_base);
45675	    test_ret++;
45676            printf(" %d", n_val);
45677            printf("\n");
45678        }
45679    }
45680    function_tests++;
45681#endif
45682
45683    return(test_ret);
45684}
45685
45686
45687static int
45688test_xmlXPathCastToString(void) {
45689    int test_ret = 0;
45690
45691#if defined(LIBXML_XPATH_ENABLED)
45692    int mem_base;
45693    xmlChar * ret_val;
45694    xmlXPathObjectPtr val; /* an XPath object */
45695    int n_val;
45696
45697    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45698        mem_base = xmlMemBlocks();
45699        val = gen_xmlXPathObjectPtr(n_val, 0);
45700
45701        ret_val = xmlXPathCastToString(val);
45702        desret_xmlChar_ptr(ret_val);
45703        call_tests++;
45704        des_xmlXPathObjectPtr(n_val, val, 0);
45705        xmlResetLastError();
45706        if (mem_base != xmlMemBlocks()) {
45707            printf("Leak of %d blocks found in xmlXPathCastToString",
45708	           xmlMemBlocks() - mem_base);
45709	    test_ret++;
45710            printf(" %d", n_val);
45711            printf("\n");
45712        }
45713    }
45714    function_tests++;
45715#endif
45716
45717    return(test_ret);
45718}
45719
45720
45721static int
45722test_xmlXPathCmpNodes(void) {
45723    int test_ret = 0;
45724
45725#if defined(LIBXML_XPATH_ENABLED)
45726    int mem_base;
45727    int ret_val;
45728    xmlNodePtr node1; /* the first node */
45729    int n_node1;
45730    xmlNodePtr node2; /* the second node */
45731    int n_node2;
45732
45733    for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) {
45734    for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) {
45735        mem_base = xmlMemBlocks();
45736        node1 = gen_xmlNodePtr(n_node1, 0);
45737        node2 = gen_xmlNodePtr(n_node2, 1);
45738
45739        ret_val = xmlXPathCmpNodes(node1, node2);
45740        desret_int(ret_val);
45741        call_tests++;
45742        des_xmlNodePtr(n_node1, node1, 0);
45743        des_xmlNodePtr(n_node2, node2, 1);
45744        xmlResetLastError();
45745        if (mem_base != xmlMemBlocks()) {
45746            printf("Leak of %d blocks found in xmlXPathCmpNodes",
45747	           xmlMemBlocks() - mem_base);
45748	    test_ret++;
45749            printf(" %d", n_node1);
45750            printf(" %d", n_node2);
45751            printf("\n");
45752        }
45753    }
45754    }
45755    function_tests++;
45756#endif
45757
45758    return(test_ret);
45759}
45760
45761
45762static int
45763test_xmlXPathCompile(void) {
45764    int test_ret = 0;
45765
45766
45767    /* missing type support */
45768    return(test_ret);
45769}
45770
45771#ifdef LIBXML_XPATH_ENABLED
45772
45773#define gen_nb_xmlXPathCompExprPtr 1
45774static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45775    return(NULL);
45776}
45777static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45778}
45779#endif
45780
45781#ifdef LIBXML_XPATH_ENABLED
45782
45783#define gen_nb_xmlXPathContextPtr 1
45784static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45785    return(NULL);
45786}
45787static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
45788}
45789#endif
45790
45791
45792static int
45793test_xmlXPathCompiledEval(void) {
45794    int test_ret = 0;
45795
45796#if defined(LIBXML_XPATH_ENABLED)
45797    int mem_base;
45798    xmlXPathObjectPtr ret_val;
45799    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45800    int n_comp;
45801    xmlXPathContextPtr ctx; /* the XPath context */
45802    int n_ctx;
45803
45804    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45805    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
45806        mem_base = xmlMemBlocks();
45807        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45808        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
45809
45810        ret_val = xmlXPathCompiledEval(comp, ctx);
45811        desret_xmlXPathObjectPtr(ret_val);
45812        call_tests++;
45813        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45814        des_xmlXPathContextPtr(n_ctx, ctx, 1);
45815        xmlResetLastError();
45816        if (mem_base != xmlMemBlocks()) {
45817            printf("Leak of %d blocks found in xmlXPathCompiledEval",
45818	           xmlMemBlocks() - mem_base);
45819	    test_ret++;
45820            printf(" %d", n_comp);
45821            printf(" %d", n_ctx);
45822            printf("\n");
45823        }
45824    }
45825    }
45826    function_tests++;
45827#endif
45828
45829    return(test_ret);
45830}
45831
45832
45833static int
45834test_xmlXPathCompiledEvalToBoolean(void) {
45835    int test_ret = 0;
45836
45837#if defined(LIBXML_XPATH_ENABLED)
45838    int mem_base;
45839    int ret_val;
45840    xmlXPathCompExprPtr comp; /* the compiled XPath expression */
45841    int n_comp;
45842    xmlXPathContextPtr ctxt; /* the XPath context */
45843    int n_ctxt;
45844
45845    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
45846    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45847        mem_base = xmlMemBlocks();
45848        comp = gen_xmlXPathCompExprPtr(n_comp, 0);
45849        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
45850
45851        ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt);
45852        desret_int(ret_val);
45853        call_tests++;
45854        des_xmlXPathCompExprPtr(n_comp, comp, 0);
45855        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
45856        xmlResetLastError();
45857        if (mem_base != xmlMemBlocks()) {
45858            printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean",
45859	           xmlMemBlocks() - mem_base);
45860	    test_ret++;
45861            printf(" %d", n_comp);
45862            printf(" %d", n_ctxt);
45863            printf("\n");
45864        }
45865    }
45866    }
45867    function_tests++;
45868#endif
45869
45870    return(test_ret);
45871}
45872
45873
45874static int
45875test_xmlXPathContextSetCache(void) {
45876    int test_ret = 0;
45877
45878#if defined(LIBXML_XPATH_ENABLED)
45879    int mem_base;
45880    int ret_val;
45881    xmlXPathContextPtr ctxt; /* the XPath context */
45882    int n_ctxt;
45883    int active; /* enables/disables (creates/frees) the cache */
45884    int n_active;
45885    int value; /* a value with semantics dependant on @options */
45886    int n_value;
45887    int options; /* options (currently only the value 0 is used) */
45888    int n_options;
45889
45890    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
45891    for (n_active = 0;n_active < gen_nb_int;n_active++) {
45892    for (n_value = 0;n_value < gen_nb_int;n_value++) {
45893    for (n_options = 0;n_options < gen_nb_int;n_options++) {
45894        mem_base = xmlMemBlocks();
45895        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
45896        active = gen_int(n_active, 1);
45897        value = gen_int(n_value, 2);
45898        options = gen_int(n_options, 3);
45899
45900        ret_val = xmlXPathContextSetCache(ctxt, active, value, options);
45901        desret_int(ret_val);
45902        call_tests++;
45903        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
45904        des_int(n_active, active, 1);
45905        des_int(n_value, value, 2);
45906        des_int(n_options, options, 3);
45907        xmlResetLastError();
45908        if (mem_base != xmlMemBlocks()) {
45909            printf("Leak of %d blocks found in xmlXPathContextSetCache",
45910	           xmlMemBlocks() - mem_base);
45911	    test_ret++;
45912            printf(" %d", n_ctxt);
45913            printf(" %d", n_active);
45914            printf(" %d", n_value);
45915            printf(" %d", n_options);
45916            printf("\n");
45917        }
45918    }
45919    }
45920    }
45921    }
45922    function_tests++;
45923#endif
45924
45925    return(test_ret);
45926}
45927
45928
45929static int
45930test_xmlXPathConvertBoolean(void) {
45931    int test_ret = 0;
45932
45933#if defined(LIBXML_XPATH_ENABLED)
45934    int mem_base;
45935    xmlXPathObjectPtr ret_val;
45936    xmlXPathObjectPtr val; /* an XPath object */
45937    int n_val;
45938
45939    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45940        mem_base = xmlMemBlocks();
45941        val = gen_xmlXPathObjectPtr(n_val, 0);
45942
45943        ret_val = xmlXPathConvertBoolean(val);
45944        val = NULL;
45945        desret_xmlXPathObjectPtr(ret_val);
45946        call_tests++;
45947        des_xmlXPathObjectPtr(n_val, val, 0);
45948        xmlResetLastError();
45949        if (mem_base != xmlMemBlocks()) {
45950            printf("Leak of %d blocks found in xmlXPathConvertBoolean",
45951	           xmlMemBlocks() - mem_base);
45952	    test_ret++;
45953            printf(" %d", n_val);
45954            printf("\n");
45955        }
45956    }
45957    function_tests++;
45958#endif
45959
45960    return(test_ret);
45961}
45962
45963
45964static int
45965test_xmlXPathConvertNumber(void) {
45966    int test_ret = 0;
45967
45968#if defined(LIBXML_XPATH_ENABLED)
45969    int mem_base;
45970    xmlXPathObjectPtr ret_val;
45971    xmlXPathObjectPtr val; /* an XPath object */
45972    int n_val;
45973
45974    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
45975        mem_base = xmlMemBlocks();
45976        val = gen_xmlXPathObjectPtr(n_val, 0);
45977
45978        ret_val = xmlXPathConvertNumber(val);
45979        val = NULL;
45980        desret_xmlXPathObjectPtr(ret_val);
45981        call_tests++;
45982        des_xmlXPathObjectPtr(n_val, val, 0);
45983        xmlResetLastError();
45984        if (mem_base != xmlMemBlocks()) {
45985            printf("Leak of %d blocks found in xmlXPathConvertNumber",
45986	           xmlMemBlocks() - mem_base);
45987	    test_ret++;
45988            printf(" %d", n_val);
45989            printf("\n");
45990        }
45991    }
45992    function_tests++;
45993#endif
45994
45995    return(test_ret);
45996}
45997
45998
45999static int
46000test_xmlXPathConvertString(void) {
46001    int test_ret = 0;
46002
46003#if defined(LIBXML_XPATH_ENABLED)
46004    int mem_base;
46005    xmlXPathObjectPtr ret_val;
46006    xmlXPathObjectPtr val; /* an XPath object */
46007    int n_val;
46008
46009    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46010        mem_base = xmlMemBlocks();
46011        val = gen_xmlXPathObjectPtr(n_val, 0);
46012
46013        ret_val = xmlXPathConvertString(val);
46014        val = NULL;
46015        desret_xmlXPathObjectPtr(ret_val);
46016        call_tests++;
46017        des_xmlXPathObjectPtr(n_val, val, 0);
46018        xmlResetLastError();
46019        if (mem_base != xmlMemBlocks()) {
46020            printf("Leak of %d blocks found in xmlXPathConvertString",
46021	           xmlMemBlocks() - mem_base);
46022	    test_ret++;
46023            printf(" %d", n_val);
46024            printf("\n");
46025        }
46026    }
46027    function_tests++;
46028#endif
46029
46030    return(test_ret);
46031}
46032
46033
46034static int
46035test_xmlXPathCtxtCompile(void) {
46036    int test_ret = 0;
46037
46038
46039    /* missing type support */
46040    return(test_ret);
46041}
46042
46043
46044static int
46045test_xmlXPathEval(void) {
46046    int test_ret = 0;
46047
46048#if defined(LIBXML_XPATH_ENABLED)
46049    int mem_base;
46050    xmlXPathObjectPtr ret_val;
46051    xmlChar * str; /* the XPath expression */
46052    int n_str;
46053    xmlXPathContextPtr ctx; /* the XPath context */
46054    int n_ctx;
46055
46056    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46057    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
46058        mem_base = xmlMemBlocks();
46059        str = gen_const_xmlChar_ptr(n_str, 0);
46060        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
46061
46062        ret_val = xmlXPathEval((const xmlChar *)str, ctx);
46063        desret_xmlXPathObjectPtr(ret_val);
46064        call_tests++;
46065        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46066        des_xmlXPathContextPtr(n_ctx, ctx, 1);
46067        xmlResetLastError();
46068        if (mem_base != xmlMemBlocks()) {
46069            printf("Leak of %d blocks found in xmlXPathEval",
46070	           xmlMemBlocks() - mem_base);
46071	    test_ret++;
46072            printf(" %d", n_str);
46073            printf(" %d", n_ctx);
46074            printf("\n");
46075        }
46076    }
46077    }
46078    function_tests++;
46079#endif
46080
46081    return(test_ret);
46082}
46083
46084
46085static int
46086test_xmlXPathEvalExpression(void) {
46087    int test_ret = 0;
46088
46089#if defined(LIBXML_XPATH_ENABLED)
46090    int mem_base;
46091    xmlXPathObjectPtr ret_val;
46092    xmlChar * str; /* the XPath expression */
46093    int n_str;
46094    xmlXPathContextPtr ctxt; /* the XPath context */
46095    int n_ctxt;
46096
46097    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
46098    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46099        mem_base = xmlMemBlocks();
46100        str = gen_const_xmlChar_ptr(n_str, 0);
46101        ctxt = gen_xmlXPathContextPtr(n_ctxt, 1);
46102
46103        ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt);
46104        desret_xmlXPathObjectPtr(ret_val);
46105        call_tests++;
46106        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
46107        des_xmlXPathContextPtr(n_ctxt, ctxt, 1);
46108        xmlResetLastError();
46109        if (mem_base != xmlMemBlocks()) {
46110            printf("Leak of %d blocks found in xmlXPathEvalExpression",
46111	           xmlMemBlocks() - mem_base);
46112	    test_ret++;
46113            printf(" %d", n_str);
46114            printf(" %d", n_ctxt);
46115            printf("\n");
46116        }
46117    }
46118    }
46119    function_tests++;
46120#endif
46121
46122    return(test_ret);
46123}
46124
46125
46126static int
46127test_xmlXPathEvalPredicate(void) {
46128    int test_ret = 0;
46129
46130#if defined(LIBXML_XPATH_ENABLED)
46131    int mem_base;
46132    int ret_val;
46133    xmlXPathContextPtr ctxt; /* the XPath context */
46134    int n_ctxt;
46135    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
46136    int n_res;
46137
46138    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
46139    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
46140        mem_base = xmlMemBlocks();
46141        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
46142        res = gen_xmlXPathObjectPtr(n_res, 1);
46143
46144        ret_val = xmlXPathEvalPredicate(ctxt, res);
46145        desret_int(ret_val);
46146        call_tests++;
46147        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
46148        des_xmlXPathObjectPtr(n_res, res, 1);
46149        xmlResetLastError();
46150        if (mem_base != xmlMemBlocks()) {
46151            printf("Leak of %d blocks found in xmlXPathEvalPredicate",
46152	           xmlMemBlocks() - mem_base);
46153	    test_ret++;
46154            printf(" %d", n_ctxt);
46155            printf(" %d", n_res);
46156            printf("\n");
46157        }
46158    }
46159    }
46160    function_tests++;
46161#endif
46162
46163    return(test_ret);
46164}
46165
46166
46167static int
46168test_xmlXPathInit(void) {
46169    int test_ret = 0;
46170
46171#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46172    int mem_base;
46173
46174        mem_base = xmlMemBlocks();
46175
46176        xmlXPathInit();
46177        call_tests++;
46178        xmlResetLastError();
46179        if (mem_base != xmlMemBlocks()) {
46180            printf("Leak of %d blocks found in xmlXPathInit",
46181	           xmlMemBlocks() - mem_base);
46182	    test_ret++;
46183            printf("\n");
46184        }
46185    function_tests++;
46186#endif
46187
46188    return(test_ret);
46189}
46190
46191
46192static int
46193test_xmlXPathIsInf(void) {
46194    int test_ret = 0;
46195
46196#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46197    int mem_base;
46198    int ret_val;
46199    double val; /* a double value */
46200    int n_val;
46201
46202    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46203        mem_base = xmlMemBlocks();
46204        val = gen_double(n_val, 0);
46205
46206        ret_val = xmlXPathIsInf(val);
46207        desret_int(ret_val);
46208        call_tests++;
46209        des_double(n_val, val, 0);
46210        xmlResetLastError();
46211        if (mem_base != xmlMemBlocks()) {
46212            printf("Leak of %d blocks found in xmlXPathIsInf",
46213	           xmlMemBlocks() - mem_base);
46214	    test_ret++;
46215            printf(" %d", n_val);
46216            printf("\n");
46217        }
46218    }
46219    function_tests++;
46220#endif
46221
46222    return(test_ret);
46223}
46224
46225
46226static int
46227test_xmlXPathIsNaN(void) {
46228    int test_ret = 0;
46229
46230#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
46231    int mem_base;
46232    int ret_val;
46233    double val; /* a double value */
46234    int n_val;
46235
46236    for (n_val = 0;n_val < gen_nb_double;n_val++) {
46237        mem_base = xmlMemBlocks();
46238        val = gen_double(n_val, 0);
46239
46240        ret_val = xmlXPathIsNaN(val);
46241        desret_int(ret_val);
46242        call_tests++;
46243        des_double(n_val, val, 0);
46244        xmlResetLastError();
46245        if (mem_base != xmlMemBlocks()) {
46246            printf("Leak of %d blocks found in xmlXPathIsNaN",
46247	           xmlMemBlocks() - mem_base);
46248	    test_ret++;
46249            printf(" %d", n_val);
46250            printf("\n");
46251        }
46252    }
46253    function_tests++;
46254#endif
46255
46256    return(test_ret);
46257}
46258
46259
46260static int
46261test_xmlXPathNewContext(void) {
46262    int test_ret = 0;
46263
46264
46265    /* missing type support */
46266    return(test_ret);
46267}
46268
46269
46270static int
46271test_xmlXPathNodeSetCreate(void) {
46272    int test_ret = 0;
46273
46274#if defined(LIBXML_XPATH_ENABLED)
46275    int mem_base;
46276    xmlNodeSetPtr ret_val;
46277    xmlNodePtr val; /* an initial xmlNodePtr, or NULL */
46278    int n_val;
46279
46280    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
46281        mem_base = xmlMemBlocks();
46282        val = gen_xmlNodePtr(n_val, 0);
46283
46284        ret_val = xmlXPathNodeSetCreate(val);
46285        desret_xmlNodeSetPtr(ret_val);
46286        call_tests++;
46287        des_xmlNodePtr(n_val, val, 0);
46288        xmlResetLastError();
46289        if (mem_base != xmlMemBlocks()) {
46290            printf("Leak of %d blocks found in xmlXPathNodeSetCreate",
46291	           xmlMemBlocks() - mem_base);
46292	    test_ret++;
46293            printf(" %d", n_val);
46294            printf("\n");
46295        }
46296    }
46297    function_tests++;
46298#endif
46299
46300    return(test_ret);
46301}
46302
46303
46304static int
46305test_xmlXPathObjectCopy(void) {
46306    int test_ret = 0;
46307
46308#if defined(LIBXML_XPATH_ENABLED)
46309    int mem_base;
46310    xmlXPathObjectPtr ret_val;
46311    xmlXPathObjectPtr val; /* the original object */
46312    int n_val;
46313
46314    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
46315        mem_base = xmlMemBlocks();
46316        val = gen_xmlXPathObjectPtr(n_val, 0);
46317
46318        ret_val = xmlXPathObjectCopy(val);
46319        desret_xmlXPathObjectPtr(ret_val);
46320        call_tests++;
46321        des_xmlXPathObjectPtr(n_val, val, 0);
46322        xmlResetLastError();
46323        if (mem_base != xmlMemBlocks()) {
46324            printf("Leak of %d blocks found in xmlXPathObjectCopy",
46325	           xmlMemBlocks() - mem_base);
46326	    test_ret++;
46327            printf(" %d", n_val);
46328            printf("\n");
46329        }
46330    }
46331    function_tests++;
46332#endif
46333
46334    return(test_ret);
46335}
46336
46337
46338static int
46339test_xmlXPathOrderDocElems(void) {
46340    int test_ret = 0;
46341
46342#if defined(LIBXML_XPATH_ENABLED)
46343    int mem_base;
46344    long ret_val;
46345    xmlDocPtr doc; /* an input document */
46346    int n_doc;
46347
46348    for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
46349        mem_base = xmlMemBlocks();
46350        doc = gen_xmlDocPtr(n_doc, 0);
46351
46352        ret_val = xmlXPathOrderDocElems(doc);
46353        desret_long(ret_val);
46354        call_tests++;
46355        des_xmlDocPtr(n_doc, doc, 0);
46356        xmlResetLastError();
46357        if (mem_base != xmlMemBlocks()) {
46358            printf("Leak of %d blocks found in xmlXPathOrderDocElems",
46359	           xmlMemBlocks() - mem_base);
46360	    test_ret++;
46361            printf(" %d", n_doc);
46362            printf("\n");
46363        }
46364    }
46365    function_tests++;
46366#endif
46367
46368    return(test_ret);
46369}
46370
46371static int
46372test_xpath(void) {
46373    int test_ret = 0;
46374
46375    if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n");
46376    test_ret += test_xmlXPathCastBooleanToNumber();
46377    test_ret += test_xmlXPathCastBooleanToString();
46378    test_ret += test_xmlXPathCastNodeSetToBoolean();
46379    test_ret += test_xmlXPathCastNodeSetToNumber();
46380    test_ret += test_xmlXPathCastNodeSetToString();
46381    test_ret += test_xmlXPathCastNodeToNumber();
46382    test_ret += test_xmlXPathCastNodeToString();
46383    test_ret += test_xmlXPathCastNumberToBoolean();
46384    test_ret += test_xmlXPathCastNumberToString();
46385    test_ret += test_xmlXPathCastStringToBoolean();
46386    test_ret += test_xmlXPathCastStringToNumber();
46387    test_ret += test_xmlXPathCastToBoolean();
46388    test_ret += test_xmlXPathCastToNumber();
46389    test_ret += test_xmlXPathCastToString();
46390    test_ret += test_xmlXPathCmpNodes();
46391    test_ret += test_xmlXPathCompile();
46392    test_ret += test_xmlXPathCompiledEval();
46393    test_ret += test_xmlXPathCompiledEvalToBoolean();
46394    test_ret += test_xmlXPathContextSetCache();
46395    test_ret += test_xmlXPathConvertBoolean();
46396    test_ret += test_xmlXPathConvertNumber();
46397    test_ret += test_xmlXPathConvertString();
46398    test_ret += test_xmlXPathCtxtCompile();
46399    test_ret += test_xmlXPathEval();
46400    test_ret += test_xmlXPathEvalExpression();
46401    test_ret += test_xmlXPathEvalPredicate();
46402    test_ret += test_xmlXPathInit();
46403    test_ret += test_xmlXPathIsInf();
46404    test_ret += test_xmlXPathIsNaN();
46405    test_ret += test_xmlXPathNewContext();
46406    test_ret += test_xmlXPathNodeSetCreate();
46407    test_ret += test_xmlXPathObjectCopy();
46408    test_ret += test_xmlXPathOrderDocElems();
46409
46410    if (test_ret != 0)
46411	printf("Module xpath: %d errors\n", test_ret);
46412    return(test_ret);
46413}
46414#ifdef LIBXML_XPATH_ENABLED
46415
46416#define gen_nb_xmlXPathParserContextPtr 1
46417static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46418    return(NULL);
46419}
46420static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
46421}
46422#endif
46423
46424
46425static int
46426test_valuePop(void) {
46427    int test_ret = 0;
46428
46429#if defined(LIBXML_XPATH_ENABLED)
46430    int mem_base;
46431    xmlXPathObjectPtr ret_val;
46432    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46433    int n_ctxt;
46434
46435    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46436        mem_base = xmlMemBlocks();
46437        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46438
46439        ret_val = valuePop(ctxt);
46440        desret_xmlXPathObjectPtr(ret_val);
46441        call_tests++;
46442        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46443        xmlResetLastError();
46444        if (mem_base != xmlMemBlocks()) {
46445            printf("Leak of %d blocks found in valuePop",
46446	           xmlMemBlocks() - mem_base);
46447	    test_ret++;
46448            printf(" %d", n_ctxt);
46449            printf("\n");
46450        }
46451    }
46452    function_tests++;
46453#endif
46454
46455    return(test_ret);
46456}
46457
46458
46459static int
46460test_valuePush(void) {
46461    int test_ret = 0;
46462
46463#if defined(LIBXML_XPATH_ENABLED)
46464    int mem_base;
46465    int ret_val;
46466    xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */
46467    int n_ctxt;
46468    xmlXPathObjectPtr value; /* the XPath object */
46469    int n_value;
46470
46471    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46472    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
46473        mem_base = xmlMemBlocks();
46474        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46475        value = gen_xmlXPathObjectPtr(n_value, 1);
46476
46477        ret_val = valuePush(ctxt, value);
46478        desret_int(ret_val);
46479        call_tests++;
46480        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46481        des_xmlXPathObjectPtr(n_value, value, 1);
46482        xmlResetLastError();
46483        if (mem_base != xmlMemBlocks()) {
46484            printf("Leak of %d blocks found in valuePush",
46485	           xmlMemBlocks() - mem_base);
46486	    test_ret++;
46487            printf(" %d", n_ctxt);
46488            printf(" %d", n_value);
46489            printf("\n");
46490        }
46491    }
46492    }
46493    function_tests++;
46494#endif
46495
46496    return(test_ret);
46497}
46498
46499
46500static int
46501test_xmlXPathAddValues(void) {
46502    int test_ret = 0;
46503
46504#if defined(LIBXML_XPATH_ENABLED)
46505    int mem_base;
46506    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46507    int n_ctxt;
46508
46509    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46510        mem_base = xmlMemBlocks();
46511        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46512
46513        xmlXPathAddValues(ctxt);
46514        call_tests++;
46515        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46516        xmlResetLastError();
46517        if (mem_base != xmlMemBlocks()) {
46518            printf("Leak of %d blocks found in xmlXPathAddValues",
46519	           xmlMemBlocks() - mem_base);
46520	    test_ret++;
46521            printf(" %d", n_ctxt);
46522            printf("\n");
46523        }
46524    }
46525    function_tests++;
46526#endif
46527
46528    return(test_ret);
46529}
46530
46531
46532static int
46533test_xmlXPathBooleanFunction(void) {
46534    int test_ret = 0;
46535
46536#if defined(LIBXML_XPATH_ENABLED)
46537    int mem_base;
46538    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46539    int n_ctxt;
46540    int nargs; /* the number of arguments */
46541    int n_nargs;
46542
46543    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46544    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46545        mem_base = xmlMemBlocks();
46546        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46547        nargs = gen_int(n_nargs, 1);
46548
46549        xmlXPathBooleanFunction(ctxt, nargs);
46550        call_tests++;
46551        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46552        des_int(n_nargs, nargs, 1);
46553        xmlResetLastError();
46554        if (mem_base != xmlMemBlocks()) {
46555            printf("Leak of %d blocks found in xmlXPathBooleanFunction",
46556	           xmlMemBlocks() - mem_base);
46557	    test_ret++;
46558            printf(" %d", n_ctxt);
46559            printf(" %d", n_nargs);
46560            printf("\n");
46561        }
46562    }
46563    }
46564    function_tests++;
46565#endif
46566
46567    return(test_ret);
46568}
46569
46570
46571static int
46572test_xmlXPathCeilingFunction(void) {
46573    int test_ret = 0;
46574
46575#if defined(LIBXML_XPATH_ENABLED)
46576    int mem_base;
46577    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46578    int n_ctxt;
46579    int nargs; /* the number of arguments */
46580    int n_nargs;
46581
46582    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46583    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46584        mem_base = xmlMemBlocks();
46585        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46586        nargs = gen_int(n_nargs, 1);
46587
46588        xmlXPathCeilingFunction(ctxt, nargs);
46589        call_tests++;
46590        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46591        des_int(n_nargs, nargs, 1);
46592        xmlResetLastError();
46593        if (mem_base != xmlMemBlocks()) {
46594            printf("Leak of %d blocks found in xmlXPathCeilingFunction",
46595	           xmlMemBlocks() - mem_base);
46596	    test_ret++;
46597            printf(" %d", n_ctxt);
46598            printf(" %d", n_nargs);
46599            printf("\n");
46600        }
46601    }
46602    }
46603    function_tests++;
46604#endif
46605
46606    return(test_ret);
46607}
46608
46609
46610static int
46611test_xmlXPathCompareValues(void) {
46612    int test_ret = 0;
46613
46614#if defined(LIBXML_XPATH_ENABLED)
46615    int mem_base;
46616    int ret_val;
46617    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46618    int n_ctxt;
46619    int inf; /* less than (1) or greater than (0) */
46620    int n_inf;
46621    int strict; /* is the comparison strict */
46622    int n_strict;
46623
46624    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46625    for (n_inf = 0;n_inf < gen_nb_int;n_inf++) {
46626    for (n_strict = 0;n_strict < gen_nb_int;n_strict++) {
46627        mem_base = xmlMemBlocks();
46628        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46629        inf = gen_int(n_inf, 1);
46630        strict = gen_int(n_strict, 2);
46631
46632        ret_val = xmlXPathCompareValues(ctxt, inf, strict);
46633        desret_int(ret_val);
46634        call_tests++;
46635        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46636        des_int(n_inf, inf, 1);
46637        des_int(n_strict, strict, 2);
46638        xmlResetLastError();
46639        if (mem_base != xmlMemBlocks()) {
46640            printf("Leak of %d blocks found in xmlXPathCompareValues",
46641	           xmlMemBlocks() - mem_base);
46642	    test_ret++;
46643            printf(" %d", n_ctxt);
46644            printf(" %d", n_inf);
46645            printf(" %d", n_strict);
46646            printf("\n");
46647        }
46648    }
46649    }
46650    }
46651    function_tests++;
46652#endif
46653
46654    return(test_ret);
46655}
46656
46657
46658static int
46659test_xmlXPathConcatFunction(void) {
46660    int test_ret = 0;
46661
46662#if defined(LIBXML_XPATH_ENABLED)
46663    int mem_base;
46664    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46665    int n_ctxt;
46666    int nargs; /* the number of arguments */
46667    int n_nargs;
46668
46669    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46670    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46671        mem_base = xmlMemBlocks();
46672        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46673        nargs = gen_int(n_nargs, 1);
46674
46675        xmlXPathConcatFunction(ctxt, nargs);
46676        call_tests++;
46677        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46678        des_int(n_nargs, nargs, 1);
46679        xmlResetLastError();
46680        if (mem_base != xmlMemBlocks()) {
46681            printf("Leak of %d blocks found in xmlXPathConcatFunction",
46682	           xmlMemBlocks() - mem_base);
46683	    test_ret++;
46684            printf(" %d", n_ctxt);
46685            printf(" %d", n_nargs);
46686            printf("\n");
46687        }
46688    }
46689    }
46690    function_tests++;
46691#endif
46692
46693    return(test_ret);
46694}
46695
46696
46697static int
46698test_xmlXPathContainsFunction(void) {
46699    int test_ret = 0;
46700
46701#if defined(LIBXML_XPATH_ENABLED)
46702    int mem_base;
46703    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46704    int n_ctxt;
46705    int nargs; /* the number of arguments */
46706    int n_nargs;
46707
46708    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46709    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46710        mem_base = xmlMemBlocks();
46711        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46712        nargs = gen_int(n_nargs, 1);
46713
46714        xmlXPathContainsFunction(ctxt, nargs);
46715        call_tests++;
46716        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46717        des_int(n_nargs, nargs, 1);
46718        xmlResetLastError();
46719        if (mem_base != xmlMemBlocks()) {
46720            printf("Leak of %d blocks found in xmlXPathContainsFunction",
46721	           xmlMemBlocks() - mem_base);
46722	    test_ret++;
46723            printf(" %d", n_ctxt);
46724            printf(" %d", n_nargs);
46725            printf("\n");
46726        }
46727    }
46728    }
46729    function_tests++;
46730#endif
46731
46732    return(test_ret);
46733}
46734
46735
46736static int
46737test_xmlXPathCountFunction(void) {
46738    int test_ret = 0;
46739
46740#if defined(LIBXML_XPATH_ENABLED)
46741    int mem_base;
46742    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46743    int n_ctxt;
46744    int nargs; /* the number of arguments */
46745    int n_nargs;
46746
46747    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46748    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
46749        mem_base = xmlMemBlocks();
46750        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46751        nargs = gen_int(n_nargs, 1);
46752
46753        xmlXPathCountFunction(ctxt, nargs);
46754        call_tests++;
46755        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46756        des_int(n_nargs, nargs, 1);
46757        xmlResetLastError();
46758        if (mem_base != xmlMemBlocks()) {
46759            printf("Leak of %d blocks found in xmlXPathCountFunction",
46760	           xmlMemBlocks() - mem_base);
46761	    test_ret++;
46762            printf(" %d", n_ctxt);
46763            printf(" %d", n_nargs);
46764            printf("\n");
46765        }
46766    }
46767    }
46768    function_tests++;
46769#endif
46770
46771    return(test_ret);
46772}
46773
46774
46775static int
46776test_xmlXPathDebugDumpCompExpr(void) {
46777    int test_ret = 0;
46778
46779#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46780    int mem_base;
46781    FILE * output; /* the FILE * for the output */
46782    int n_output;
46783    xmlXPathCompExprPtr comp; /* the precompiled XPath expression */
46784    int n_comp;
46785    int depth; /* the indentation level. */
46786    int n_depth;
46787
46788    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46789    for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) {
46790    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46791        mem_base = xmlMemBlocks();
46792        output = gen_FILE_ptr(n_output, 0);
46793        comp = gen_xmlXPathCompExprPtr(n_comp, 1);
46794        depth = gen_int(n_depth, 2);
46795
46796        xmlXPathDebugDumpCompExpr(output, comp, depth);
46797        call_tests++;
46798        des_FILE_ptr(n_output, output, 0);
46799        des_xmlXPathCompExprPtr(n_comp, comp, 1);
46800        des_int(n_depth, depth, 2);
46801        xmlResetLastError();
46802        if (mem_base != xmlMemBlocks()) {
46803            printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr",
46804	           xmlMemBlocks() - mem_base);
46805	    test_ret++;
46806            printf(" %d", n_output);
46807            printf(" %d", n_comp);
46808            printf(" %d", n_depth);
46809            printf("\n");
46810        }
46811    }
46812    }
46813    }
46814    function_tests++;
46815#endif
46816
46817    return(test_ret);
46818}
46819
46820
46821static int
46822test_xmlXPathDebugDumpObject(void) {
46823    int test_ret = 0;
46824
46825#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
46826    int mem_base;
46827    FILE * output; /* the FILE * to dump the output */
46828    int n_output;
46829    xmlXPathObjectPtr cur; /* the object to inspect */
46830    int n_cur;
46831    int depth; /* indentation level */
46832    int n_depth;
46833
46834    for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) {
46835    for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) {
46836    for (n_depth = 0;n_depth < gen_nb_int;n_depth++) {
46837        mem_base = xmlMemBlocks();
46838        output = gen_FILE_ptr(n_output, 0);
46839        cur = gen_xmlXPathObjectPtr(n_cur, 1);
46840        depth = gen_int(n_depth, 2);
46841
46842        xmlXPathDebugDumpObject(output, cur, depth);
46843        call_tests++;
46844        des_FILE_ptr(n_output, output, 0);
46845        des_xmlXPathObjectPtr(n_cur, cur, 1);
46846        des_int(n_depth, depth, 2);
46847        xmlResetLastError();
46848        if (mem_base != xmlMemBlocks()) {
46849            printf("Leak of %d blocks found in xmlXPathDebugDumpObject",
46850	           xmlMemBlocks() - mem_base);
46851	    test_ret++;
46852            printf(" %d", n_output);
46853            printf(" %d", n_cur);
46854            printf(" %d", n_depth);
46855            printf("\n");
46856        }
46857    }
46858    }
46859    }
46860    function_tests++;
46861#endif
46862
46863    return(test_ret);
46864}
46865
46866
46867static int
46868test_xmlXPathDifference(void) {
46869    int test_ret = 0;
46870
46871#if defined(LIBXML_XPATH_ENABLED)
46872    int mem_base;
46873    xmlNodeSetPtr ret_val;
46874    xmlNodeSetPtr nodes1; /* a node-set */
46875    int n_nodes1;
46876    xmlNodeSetPtr nodes2; /* a node-set */
46877    int n_nodes2;
46878
46879    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
46880    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
46881        mem_base = xmlMemBlocks();
46882        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
46883        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
46884
46885        ret_val = xmlXPathDifference(nodes1, nodes2);
46886        desret_xmlNodeSetPtr(ret_val);
46887        call_tests++;
46888        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
46889        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
46890        xmlResetLastError();
46891        if (mem_base != xmlMemBlocks()) {
46892            printf("Leak of %d blocks found in xmlXPathDifference",
46893	           xmlMemBlocks() - mem_base);
46894	    test_ret++;
46895            printf(" %d", n_nodes1);
46896            printf(" %d", n_nodes2);
46897            printf("\n");
46898        }
46899    }
46900    }
46901    function_tests++;
46902#endif
46903
46904    return(test_ret);
46905}
46906
46907
46908static int
46909test_xmlXPathDistinct(void) {
46910    int test_ret = 0;
46911
46912#if defined(LIBXML_XPATH_ENABLED)
46913    int mem_base;
46914    xmlNodeSetPtr ret_val;
46915    xmlNodeSetPtr nodes; /* a node-set */
46916    int n_nodes;
46917
46918    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46919        mem_base = xmlMemBlocks();
46920        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46921
46922        ret_val = xmlXPathDistinct(nodes);
46923        desret_xmlNodeSetPtr(ret_val);
46924        call_tests++;
46925        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46926        xmlResetLastError();
46927        if (mem_base != xmlMemBlocks()) {
46928            printf("Leak of %d blocks found in xmlXPathDistinct",
46929	           xmlMemBlocks() - mem_base);
46930	    test_ret++;
46931            printf(" %d", n_nodes);
46932            printf("\n");
46933        }
46934    }
46935    function_tests++;
46936#endif
46937
46938    return(test_ret);
46939}
46940
46941
46942static int
46943test_xmlXPathDistinctSorted(void) {
46944    int test_ret = 0;
46945
46946#if defined(LIBXML_XPATH_ENABLED)
46947    int mem_base;
46948    xmlNodeSetPtr ret_val;
46949    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
46950    int n_nodes;
46951
46952    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
46953        mem_base = xmlMemBlocks();
46954        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
46955
46956        ret_val = xmlXPathDistinctSorted(nodes);
46957        desret_xmlNodeSetPtr(ret_val);
46958        call_tests++;
46959        des_xmlNodeSetPtr(n_nodes, nodes, 0);
46960        xmlResetLastError();
46961        if (mem_base != xmlMemBlocks()) {
46962            printf("Leak of %d blocks found in xmlXPathDistinctSorted",
46963	           xmlMemBlocks() - mem_base);
46964	    test_ret++;
46965            printf(" %d", n_nodes);
46966            printf("\n");
46967        }
46968    }
46969    function_tests++;
46970#endif
46971
46972    return(test_ret);
46973}
46974
46975
46976static int
46977test_xmlXPathDivValues(void) {
46978    int test_ret = 0;
46979
46980#if defined(LIBXML_XPATH_ENABLED)
46981    int mem_base;
46982    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
46983    int n_ctxt;
46984
46985    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
46986        mem_base = xmlMemBlocks();
46987        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
46988
46989        xmlXPathDivValues(ctxt);
46990        call_tests++;
46991        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
46992        xmlResetLastError();
46993        if (mem_base != xmlMemBlocks()) {
46994            printf("Leak of %d blocks found in xmlXPathDivValues",
46995	           xmlMemBlocks() - mem_base);
46996	    test_ret++;
46997            printf(" %d", n_ctxt);
46998            printf("\n");
46999        }
47000    }
47001    function_tests++;
47002#endif
47003
47004    return(test_ret);
47005}
47006
47007
47008static int
47009test_xmlXPathEqualValues(void) {
47010    int test_ret = 0;
47011
47012#if defined(LIBXML_XPATH_ENABLED)
47013    int mem_base;
47014    int ret_val;
47015    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47016    int n_ctxt;
47017
47018    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47019        mem_base = xmlMemBlocks();
47020        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47021
47022        ret_val = xmlXPathEqualValues(ctxt);
47023        desret_int(ret_val);
47024        call_tests++;
47025        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47026        xmlResetLastError();
47027        if (mem_base != xmlMemBlocks()) {
47028            printf("Leak of %d blocks found in xmlXPathEqualValues",
47029	           xmlMemBlocks() - mem_base);
47030	    test_ret++;
47031            printf(" %d", n_ctxt);
47032            printf("\n");
47033        }
47034    }
47035    function_tests++;
47036#endif
47037
47038    return(test_ret);
47039}
47040
47041
47042static int
47043test_xmlXPathErr(void) {
47044    int test_ret = 0;
47045
47046#if defined(LIBXML_XPATH_ENABLED)
47047    int mem_base;
47048    xmlXPathParserContextPtr ctxt; /* a XPath parser context */
47049    int n_ctxt;
47050    int error; /* the error code */
47051    int n_error;
47052
47053    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47054    for (n_error = 0;n_error < gen_nb_int;n_error++) {
47055        mem_base = xmlMemBlocks();
47056        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47057        error = gen_int(n_error, 1);
47058
47059        xmlXPathErr(ctxt, error);
47060        call_tests++;
47061        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47062        des_int(n_error, error, 1);
47063        xmlResetLastError();
47064        if (mem_base != xmlMemBlocks()) {
47065            printf("Leak of %d blocks found in xmlXPathErr",
47066	           xmlMemBlocks() - mem_base);
47067	    test_ret++;
47068            printf(" %d", n_ctxt);
47069            printf(" %d", n_error);
47070            printf("\n");
47071        }
47072    }
47073    }
47074    function_tests++;
47075#endif
47076
47077    return(test_ret);
47078}
47079
47080
47081static int
47082test_xmlXPathEvalExpr(void) {
47083    int test_ret = 0;
47084
47085#if defined(LIBXML_XPATH_ENABLED)
47086    int mem_base;
47087    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47088    int n_ctxt;
47089
47090    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47091        mem_base = xmlMemBlocks();
47092        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47093
47094        xmlXPathEvalExpr(ctxt);
47095        call_tests++;
47096        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47097        xmlResetLastError();
47098        if (mem_base != xmlMemBlocks()) {
47099            printf("Leak of %d blocks found in xmlXPathEvalExpr",
47100	           xmlMemBlocks() - mem_base);
47101	    test_ret++;
47102            printf(" %d", n_ctxt);
47103            printf("\n");
47104        }
47105    }
47106    function_tests++;
47107#endif
47108
47109    return(test_ret);
47110}
47111
47112
47113static int
47114test_xmlXPathEvaluatePredicateResult(void) {
47115    int test_ret = 0;
47116
47117#if defined(LIBXML_XPATH_ENABLED)
47118    int mem_base;
47119    int ret_val;
47120    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47121    int n_ctxt;
47122    xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */
47123    int n_res;
47124
47125    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47126    for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) {
47127        mem_base = xmlMemBlocks();
47128        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47129        res = gen_xmlXPathObjectPtr(n_res, 1);
47130
47131        ret_val = xmlXPathEvaluatePredicateResult(ctxt, res);
47132        desret_int(ret_val);
47133        call_tests++;
47134        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47135        des_xmlXPathObjectPtr(n_res, res, 1);
47136        xmlResetLastError();
47137        if (mem_base != xmlMemBlocks()) {
47138            printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult",
47139	           xmlMemBlocks() - mem_base);
47140	    test_ret++;
47141            printf(" %d", n_ctxt);
47142            printf(" %d", n_res);
47143            printf("\n");
47144        }
47145    }
47146    }
47147    function_tests++;
47148#endif
47149
47150    return(test_ret);
47151}
47152
47153
47154static int
47155test_xmlXPathFalseFunction(void) {
47156    int test_ret = 0;
47157
47158#if defined(LIBXML_XPATH_ENABLED)
47159    int mem_base;
47160    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47161    int n_ctxt;
47162    int nargs; /* the number of arguments */
47163    int n_nargs;
47164
47165    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47166    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47167        mem_base = xmlMemBlocks();
47168        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47169        nargs = gen_int(n_nargs, 1);
47170
47171        xmlXPathFalseFunction(ctxt, nargs);
47172        call_tests++;
47173        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47174        des_int(n_nargs, nargs, 1);
47175        xmlResetLastError();
47176        if (mem_base != xmlMemBlocks()) {
47177            printf("Leak of %d blocks found in xmlXPathFalseFunction",
47178	           xmlMemBlocks() - mem_base);
47179	    test_ret++;
47180            printf(" %d", n_ctxt);
47181            printf(" %d", n_nargs);
47182            printf("\n");
47183        }
47184    }
47185    }
47186    function_tests++;
47187#endif
47188
47189    return(test_ret);
47190}
47191
47192
47193static int
47194test_xmlXPathFloorFunction(void) {
47195    int test_ret = 0;
47196
47197#if defined(LIBXML_XPATH_ENABLED)
47198    int mem_base;
47199    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47200    int n_ctxt;
47201    int nargs; /* the number of arguments */
47202    int n_nargs;
47203
47204    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47205    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47206        mem_base = xmlMemBlocks();
47207        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47208        nargs = gen_int(n_nargs, 1);
47209
47210        xmlXPathFloorFunction(ctxt, nargs);
47211        call_tests++;
47212        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47213        des_int(n_nargs, nargs, 1);
47214        xmlResetLastError();
47215        if (mem_base != xmlMemBlocks()) {
47216            printf("Leak of %d blocks found in xmlXPathFloorFunction",
47217	           xmlMemBlocks() - mem_base);
47218	    test_ret++;
47219            printf(" %d", n_ctxt);
47220            printf(" %d", n_nargs);
47221            printf("\n");
47222        }
47223    }
47224    }
47225    function_tests++;
47226#endif
47227
47228    return(test_ret);
47229}
47230
47231
47232static int
47233test_xmlXPathFunctionLookup(void) {
47234    int test_ret = 0;
47235
47236
47237    /* missing type support */
47238    return(test_ret);
47239}
47240
47241
47242static int
47243test_xmlXPathFunctionLookupNS(void) {
47244    int test_ret = 0;
47245
47246
47247    /* missing type support */
47248    return(test_ret);
47249}
47250
47251
47252static int
47253test_xmlXPathHasSameNodes(void) {
47254    int test_ret = 0;
47255
47256#if defined(LIBXML_XPATH_ENABLED)
47257    int mem_base;
47258    int ret_val;
47259    xmlNodeSetPtr nodes1; /* a node-set */
47260    int n_nodes1;
47261    xmlNodeSetPtr nodes2; /* a node-set */
47262    int n_nodes2;
47263
47264    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47265    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47266        mem_base = xmlMemBlocks();
47267        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47268        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47269
47270        ret_val = xmlXPathHasSameNodes(nodes1, nodes2);
47271        desret_int(ret_val);
47272        call_tests++;
47273        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47274        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47275        xmlResetLastError();
47276        if (mem_base != xmlMemBlocks()) {
47277            printf("Leak of %d blocks found in xmlXPathHasSameNodes",
47278	           xmlMemBlocks() - mem_base);
47279	    test_ret++;
47280            printf(" %d", n_nodes1);
47281            printf(" %d", n_nodes2);
47282            printf("\n");
47283        }
47284    }
47285    }
47286    function_tests++;
47287#endif
47288
47289    return(test_ret);
47290}
47291
47292
47293static int
47294test_xmlXPathIdFunction(void) {
47295    int test_ret = 0;
47296
47297#if defined(LIBXML_XPATH_ENABLED)
47298    int mem_base;
47299    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47300    int n_ctxt;
47301    int nargs; /* the number of arguments */
47302    int n_nargs;
47303
47304    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47305    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47306        mem_base = xmlMemBlocks();
47307        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47308        nargs = gen_int(n_nargs, 1);
47309
47310        xmlXPathIdFunction(ctxt, nargs);
47311        call_tests++;
47312        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47313        des_int(n_nargs, nargs, 1);
47314        xmlResetLastError();
47315        if (mem_base != xmlMemBlocks()) {
47316            printf("Leak of %d blocks found in xmlXPathIdFunction",
47317	           xmlMemBlocks() - mem_base);
47318	    test_ret++;
47319            printf(" %d", n_ctxt);
47320            printf(" %d", n_nargs);
47321            printf("\n");
47322        }
47323    }
47324    }
47325    function_tests++;
47326#endif
47327
47328    return(test_ret);
47329}
47330
47331
47332static int
47333test_xmlXPathIntersection(void) {
47334    int test_ret = 0;
47335
47336#if defined(LIBXML_XPATH_ENABLED)
47337    int mem_base;
47338    xmlNodeSetPtr ret_val;
47339    xmlNodeSetPtr nodes1; /* a node-set */
47340    int n_nodes1;
47341    xmlNodeSetPtr nodes2; /* a node-set */
47342    int n_nodes2;
47343
47344    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47345    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47346        mem_base = xmlMemBlocks();
47347        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47348        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47349
47350        ret_val = xmlXPathIntersection(nodes1, nodes2);
47351        desret_xmlNodeSetPtr(ret_val);
47352        call_tests++;
47353        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47354        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47355        xmlResetLastError();
47356        if (mem_base != xmlMemBlocks()) {
47357            printf("Leak of %d blocks found in xmlXPathIntersection",
47358	           xmlMemBlocks() - mem_base);
47359	    test_ret++;
47360            printf(" %d", n_nodes1);
47361            printf(" %d", n_nodes2);
47362            printf("\n");
47363        }
47364    }
47365    }
47366    function_tests++;
47367#endif
47368
47369    return(test_ret);
47370}
47371
47372
47373static int
47374test_xmlXPathIsNodeType(void) {
47375    int test_ret = 0;
47376
47377#if defined(LIBXML_XPATH_ENABLED)
47378    int mem_base;
47379    int ret_val;
47380    xmlChar * name; /* a name string */
47381    int n_name;
47382
47383    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
47384        mem_base = xmlMemBlocks();
47385        name = gen_const_xmlChar_ptr(n_name, 0);
47386
47387        ret_val = xmlXPathIsNodeType((const xmlChar *)name);
47388        desret_int(ret_val);
47389        call_tests++;
47390        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0);
47391        xmlResetLastError();
47392        if (mem_base != xmlMemBlocks()) {
47393            printf("Leak of %d blocks found in xmlXPathIsNodeType",
47394	           xmlMemBlocks() - mem_base);
47395	    test_ret++;
47396            printf(" %d", n_name);
47397            printf("\n");
47398        }
47399    }
47400    function_tests++;
47401#endif
47402
47403    return(test_ret);
47404}
47405
47406
47407static int
47408test_xmlXPathLangFunction(void) {
47409    int test_ret = 0;
47410
47411#if defined(LIBXML_XPATH_ENABLED)
47412    int mem_base;
47413    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47414    int n_ctxt;
47415    int nargs; /* the number of arguments */
47416    int n_nargs;
47417
47418    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47419    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47420        mem_base = xmlMemBlocks();
47421        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47422        nargs = gen_int(n_nargs, 1);
47423
47424        xmlXPathLangFunction(ctxt, nargs);
47425        call_tests++;
47426        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47427        des_int(n_nargs, nargs, 1);
47428        xmlResetLastError();
47429        if (mem_base != xmlMemBlocks()) {
47430            printf("Leak of %d blocks found in xmlXPathLangFunction",
47431	           xmlMemBlocks() - mem_base);
47432	    test_ret++;
47433            printf(" %d", n_ctxt);
47434            printf(" %d", n_nargs);
47435            printf("\n");
47436        }
47437    }
47438    }
47439    function_tests++;
47440#endif
47441
47442    return(test_ret);
47443}
47444
47445
47446static int
47447test_xmlXPathLastFunction(void) {
47448    int test_ret = 0;
47449
47450#if defined(LIBXML_XPATH_ENABLED)
47451    int mem_base;
47452    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47453    int n_ctxt;
47454    int nargs; /* the number of arguments */
47455    int n_nargs;
47456
47457    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47458    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47459        mem_base = xmlMemBlocks();
47460        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47461        nargs = gen_int(n_nargs, 1);
47462
47463        xmlXPathLastFunction(ctxt, nargs);
47464        call_tests++;
47465        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47466        des_int(n_nargs, nargs, 1);
47467        xmlResetLastError();
47468        if (mem_base != xmlMemBlocks()) {
47469            printf("Leak of %d blocks found in xmlXPathLastFunction",
47470	           xmlMemBlocks() - mem_base);
47471	    test_ret++;
47472            printf(" %d", n_ctxt);
47473            printf(" %d", n_nargs);
47474            printf("\n");
47475        }
47476    }
47477    }
47478    function_tests++;
47479#endif
47480
47481    return(test_ret);
47482}
47483
47484
47485static int
47486test_xmlXPathLeading(void) {
47487    int test_ret = 0;
47488
47489#if defined(LIBXML_XPATH_ENABLED)
47490    int mem_base;
47491    xmlNodeSetPtr ret_val;
47492    xmlNodeSetPtr nodes1; /* a node-set */
47493    int n_nodes1;
47494    xmlNodeSetPtr nodes2; /* a node-set */
47495    int n_nodes2;
47496
47497    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47498    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47499        mem_base = xmlMemBlocks();
47500        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47501        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47502
47503        ret_val = xmlXPathLeading(nodes1, nodes2);
47504        desret_xmlNodeSetPtr(ret_val);
47505        call_tests++;
47506        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47507        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47508        xmlResetLastError();
47509        if (mem_base != xmlMemBlocks()) {
47510            printf("Leak of %d blocks found in xmlXPathLeading",
47511	           xmlMemBlocks() - mem_base);
47512	    test_ret++;
47513            printf(" %d", n_nodes1);
47514            printf(" %d", n_nodes2);
47515            printf("\n");
47516        }
47517    }
47518    }
47519    function_tests++;
47520#endif
47521
47522    return(test_ret);
47523}
47524
47525
47526static int
47527test_xmlXPathLeadingSorted(void) {
47528    int test_ret = 0;
47529
47530#if defined(LIBXML_XPATH_ENABLED)
47531    int mem_base;
47532    xmlNodeSetPtr ret_val;
47533    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
47534    int n_nodes1;
47535    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
47536    int n_nodes2;
47537
47538    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
47539    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
47540        mem_base = xmlMemBlocks();
47541        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
47542        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
47543
47544        ret_val = xmlXPathLeadingSorted(nodes1, nodes2);
47545        desret_xmlNodeSetPtr(ret_val);
47546        call_tests++;
47547        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
47548        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
47549        xmlResetLastError();
47550        if (mem_base != xmlMemBlocks()) {
47551            printf("Leak of %d blocks found in xmlXPathLeadingSorted",
47552	           xmlMemBlocks() - mem_base);
47553	    test_ret++;
47554            printf(" %d", n_nodes1);
47555            printf(" %d", n_nodes2);
47556            printf("\n");
47557        }
47558    }
47559    }
47560    function_tests++;
47561#endif
47562
47563    return(test_ret);
47564}
47565
47566
47567static int
47568test_xmlXPathLocalNameFunction(void) {
47569    int test_ret = 0;
47570
47571#if defined(LIBXML_XPATH_ENABLED)
47572    int mem_base;
47573    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47574    int n_ctxt;
47575    int nargs; /* the number of arguments */
47576    int n_nargs;
47577
47578    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47579    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47580        mem_base = xmlMemBlocks();
47581        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47582        nargs = gen_int(n_nargs, 1);
47583
47584        xmlXPathLocalNameFunction(ctxt, nargs);
47585        call_tests++;
47586        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47587        des_int(n_nargs, nargs, 1);
47588        xmlResetLastError();
47589        if (mem_base != xmlMemBlocks()) {
47590            printf("Leak of %d blocks found in xmlXPathLocalNameFunction",
47591	           xmlMemBlocks() - mem_base);
47592	    test_ret++;
47593            printf(" %d", n_ctxt);
47594            printf(" %d", n_nargs);
47595            printf("\n");
47596        }
47597    }
47598    }
47599    function_tests++;
47600#endif
47601
47602    return(test_ret);
47603}
47604
47605
47606static int
47607test_xmlXPathModValues(void) {
47608    int test_ret = 0;
47609
47610#if defined(LIBXML_XPATH_ENABLED)
47611    int mem_base;
47612    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47613    int n_ctxt;
47614
47615    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47616        mem_base = xmlMemBlocks();
47617        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47618
47619        xmlXPathModValues(ctxt);
47620        call_tests++;
47621        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47622        xmlResetLastError();
47623        if (mem_base != xmlMemBlocks()) {
47624            printf("Leak of %d blocks found in xmlXPathModValues",
47625	           xmlMemBlocks() - mem_base);
47626	    test_ret++;
47627            printf(" %d", n_ctxt);
47628            printf("\n");
47629        }
47630    }
47631    function_tests++;
47632#endif
47633
47634    return(test_ret);
47635}
47636
47637
47638static int
47639test_xmlXPathMultValues(void) {
47640    int test_ret = 0;
47641
47642#if defined(LIBXML_XPATH_ENABLED)
47643    int mem_base;
47644    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47645    int n_ctxt;
47646
47647    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47648        mem_base = xmlMemBlocks();
47649        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47650
47651        xmlXPathMultValues(ctxt);
47652        call_tests++;
47653        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47654        xmlResetLastError();
47655        if (mem_base != xmlMemBlocks()) {
47656            printf("Leak of %d blocks found in xmlXPathMultValues",
47657	           xmlMemBlocks() - mem_base);
47658	    test_ret++;
47659            printf(" %d", n_ctxt);
47660            printf("\n");
47661        }
47662    }
47663    function_tests++;
47664#endif
47665
47666    return(test_ret);
47667}
47668
47669
47670static int
47671test_xmlXPathNamespaceURIFunction(void) {
47672    int test_ret = 0;
47673
47674#if defined(LIBXML_XPATH_ENABLED)
47675    int mem_base;
47676    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47677    int n_ctxt;
47678    int nargs; /* the number of arguments */
47679    int n_nargs;
47680
47681    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47682    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
47683        mem_base = xmlMemBlocks();
47684        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47685        nargs = gen_int(n_nargs, 1);
47686
47687        xmlXPathNamespaceURIFunction(ctxt, nargs);
47688        call_tests++;
47689        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47690        des_int(n_nargs, nargs, 1);
47691        xmlResetLastError();
47692        if (mem_base != xmlMemBlocks()) {
47693            printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction",
47694	           xmlMemBlocks() - mem_base);
47695	    test_ret++;
47696            printf(" %d", n_ctxt);
47697            printf(" %d", n_nargs);
47698            printf("\n");
47699        }
47700    }
47701    }
47702    function_tests++;
47703#endif
47704
47705    return(test_ret);
47706}
47707
47708
47709static int
47710test_xmlXPathNewBoolean(void) {
47711    int test_ret = 0;
47712
47713#if defined(LIBXML_XPATH_ENABLED)
47714    int mem_base;
47715    xmlXPathObjectPtr ret_val;
47716    int val; /* the boolean value */
47717    int n_val;
47718
47719    for (n_val = 0;n_val < gen_nb_int;n_val++) {
47720        mem_base = xmlMemBlocks();
47721        val = gen_int(n_val, 0);
47722
47723        ret_val = xmlXPathNewBoolean(val);
47724        desret_xmlXPathObjectPtr(ret_val);
47725        call_tests++;
47726        des_int(n_val, val, 0);
47727        xmlResetLastError();
47728        if (mem_base != xmlMemBlocks()) {
47729            printf("Leak of %d blocks found in xmlXPathNewBoolean",
47730	           xmlMemBlocks() - mem_base);
47731	    test_ret++;
47732            printf(" %d", n_val);
47733            printf("\n");
47734        }
47735    }
47736    function_tests++;
47737#endif
47738
47739    return(test_ret);
47740}
47741
47742
47743static int
47744test_xmlXPathNewCString(void) {
47745    int test_ret = 0;
47746
47747#if defined(LIBXML_XPATH_ENABLED)
47748    int mem_base;
47749    xmlXPathObjectPtr ret_val;
47750    char * val; /* the char * value */
47751    int n_val;
47752
47753    for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) {
47754        mem_base = xmlMemBlocks();
47755        val = gen_const_char_ptr(n_val, 0);
47756
47757        ret_val = xmlXPathNewCString((const char *)val);
47758        desret_xmlXPathObjectPtr(ret_val);
47759        call_tests++;
47760        des_const_char_ptr(n_val, (const char *)val, 0);
47761        xmlResetLastError();
47762        if (mem_base != xmlMemBlocks()) {
47763            printf("Leak of %d blocks found in xmlXPathNewCString",
47764	           xmlMemBlocks() - mem_base);
47765	    test_ret++;
47766            printf(" %d", n_val);
47767            printf("\n");
47768        }
47769    }
47770    function_tests++;
47771#endif
47772
47773    return(test_ret);
47774}
47775
47776
47777static int
47778test_xmlXPathNewFloat(void) {
47779    int test_ret = 0;
47780
47781#if defined(LIBXML_XPATH_ENABLED)
47782    int mem_base;
47783    xmlXPathObjectPtr ret_val;
47784    double val; /* the double value */
47785    int n_val;
47786
47787    for (n_val = 0;n_val < gen_nb_double;n_val++) {
47788        mem_base = xmlMemBlocks();
47789        val = gen_double(n_val, 0);
47790
47791        ret_val = xmlXPathNewFloat(val);
47792        desret_xmlXPathObjectPtr(ret_val);
47793        call_tests++;
47794        des_double(n_val, val, 0);
47795        xmlResetLastError();
47796        if (mem_base != xmlMemBlocks()) {
47797            printf("Leak of %d blocks found in xmlXPathNewFloat",
47798	           xmlMemBlocks() - mem_base);
47799	    test_ret++;
47800            printf(" %d", n_val);
47801            printf("\n");
47802        }
47803    }
47804    function_tests++;
47805#endif
47806
47807    return(test_ret);
47808}
47809
47810
47811static int
47812test_xmlXPathNewNodeSet(void) {
47813    int test_ret = 0;
47814
47815#if defined(LIBXML_XPATH_ENABLED)
47816    int mem_base;
47817    xmlXPathObjectPtr ret_val;
47818    xmlNodePtr val; /* the NodePtr value */
47819    int n_val;
47820
47821    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
47822        mem_base = xmlMemBlocks();
47823        val = gen_xmlNodePtr(n_val, 0);
47824
47825        ret_val = xmlXPathNewNodeSet(val);
47826        desret_xmlXPathObjectPtr(ret_val);
47827        call_tests++;
47828        des_xmlNodePtr(n_val, val, 0);
47829        xmlResetLastError();
47830        if (mem_base != xmlMemBlocks()) {
47831            printf("Leak of %d blocks found in xmlXPathNewNodeSet",
47832	           xmlMemBlocks() - mem_base);
47833	    test_ret++;
47834            printf(" %d", n_val);
47835            printf("\n");
47836        }
47837    }
47838    function_tests++;
47839#endif
47840
47841    return(test_ret);
47842}
47843
47844
47845static int
47846test_xmlXPathNewNodeSetList(void) {
47847    int test_ret = 0;
47848
47849#if defined(LIBXML_XPATH_ENABLED)
47850    int mem_base;
47851    xmlXPathObjectPtr ret_val;
47852    xmlNodeSetPtr val; /* an existing NodeSet */
47853    int n_val;
47854
47855    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
47856        mem_base = xmlMemBlocks();
47857        val = gen_xmlNodeSetPtr(n_val, 0);
47858
47859        ret_val = xmlXPathNewNodeSetList(val);
47860        desret_xmlXPathObjectPtr(ret_val);
47861        call_tests++;
47862        des_xmlNodeSetPtr(n_val, val, 0);
47863        xmlResetLastError();
47864        if (mem_base != xmlMemBlocks()) {
47865            printf("Leak of %d blocks found in xmlXPathNewNodeSetList",
47866	           xmlMemBlocks() - mem_base);
47867	    test_ret++;
47868            printf(" %d", n_val);
47869            printf("\n");
47870        }
47871    }
47872    function_tests++;
47873#endif
47874
47875    return(test_ret);
47876}
47877
47878
47879static int
47880test_xmlXPathNewParserContext(void) {
47881    int test_ret = 0;
47882
47883
47884    /* missing type support */
47885    return(test_ret);
47886}
47887
47888
47889static int
47890test_xmlXPathNewString(void) {
47891    int test_ret = 0;
47892
47893#if defined(LIBXML_XPATH_ENABLED)
47894    int mem_base;
47895    xmlXPathObjectPtr ret_val;
47896    xmlChar * val; /* the xmlChar * value */
47897    int n_val;
47898
47899    for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) {
47900        mem_base = xmlMemBlocks();
47901        val = gen_const_xmlChar_ptr(n_val, 0);
47902
47903        ret_val = xmlXPathNewString((const xmlChar *)val);
47904        desret_xmlXPathObjectPtr(ret_val);
47905        call_tests++;
47906        des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0);
47907        xmlResetLastError();
47908        if (mem_base != xmlMemBlocks()) {
47909            printf("Leak of %d blocks found in xmlXPathNewString",
47910	           xmlMemBlocks() - mem_base);
47911	    test_ret++;
47912            printf(" %d", n_val);
47913            printf("\n");
47914        }
47915    }
47916    function_tests++;
47917#endif
47918
47919    return(test_ret);
47920}
47921
47922
47923static int
47924test_xmlXPathNextAncestor(void) {
47925    int test_ret = 0;
47926
47927#if defined(LIBXML_XPATH_ENABLED)
47928    int mem_base;
47929    xmlNodePtr ret_val;
47930    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47931    int n_ctxt;
47932    xmlNodePtr cur; /* the current node in the traversal */
47933    int n_cur;
47934
47935    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47936    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47937        mem_base = xmlMemBlocks();
47938        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47939        cur = gen_xmlNodePtr(n_cur, 1);
47940
47941        ret_val = xmlXPathNextAncestor(ctxt, cur);
47942        desret_xmlNodePtr(ret_val);
47943        call_tests++;
47944        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47945        des_xmlNodePtr(n_cur, cur, 1);
47946        xmlResetLastError();
47947        if (mem_base != xmlMemBlocks()) {
47948            printf("Leak of %d blocks found in xmlXPathNextAncestor",
47949	           xmlMemBlocks() - mem_base);
47950	    test_ret++;
47951            printf(" %d", n_ctxt);
47952            printf(" %d", n_cur);
47953            printf("\n");
47954        }
47955    }
47956    }
47957    function_tests++;
47958#endif
47959
47960    return(test_ret);
47961}
47962
47963
47964static int
47965test_xmlXPathNextAncestorOrSelf(void) {
47966    int test_ret = 0;
47967
47968#if defined(LIBXML_XPATH_ENABLED)
47969    int mem_base;
47970    xmlNodePtr ret_val;
47971    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
47972    int n_ctxt;
47973    xmlNodePtr cur; /* the current node in the traversal */
47974    int n_cur;
47975
47976    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
47977    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
47978        mem_base = xmlMemBlocks();
47979        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
47980        cur = gen_xmlNodePtr(n_cur, 1);
47981
47982        ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur);
47983        desret_xmlNodePtr(ret_val);
47984        call_tests++;
47985        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
47986        des_xmlNodePtr(n_cur, cur, 1);
47987        xmlResetLastError();
47988        if (mem_base != xmlMemBlocks()) {
47989            printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf",
47990	           xmlMemBlocks() - mem_base);
47991	    test_ret++;
47992            printf(" %d", n_ctxt);
47993            printf(" %d", n_cur);
47994            printf("\n");
47995        }
47996    }
47997    }
47998    function_tests++;
47999#endif
48000
48001    return(test_ret);
48002}
48003
48004
48005static int
48006test_xmlXPathNextAttribute(void) {
48007    int test_ret = 0;
48008
48009#if defined(LIBXML_XPATH_ENABLED)
48010    int mem_base;
48011    xmlNodePtr ret_val;
48012    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48013    int n_ctxt;
48014    xmlNodePtr cur; /* the current attribute in the traversal */
48015    int n_cur;
48016
48017    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48018    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48019        mem_base = xmlMemBlocks();
48020        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48021        cur = gen_xmlNodePtr(n_cur, 1);
48022
48023        ret_val = xmlXPathNextAttribute(ctxt, cur);
48024        desret_xmlNodePtr(ret_val);
48025        call_tests++;
48026        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48027        des_xmlNodePtr(n_cur, cur, 1);
48028        xmlResetLastError();
48029        if (mem_base != xmlMemBlocks()) {
48030            printf("Leak of %d blocks found in xmlXPathNextAttribute",
48031	           xmlMemBlocks() - mem_base);
48032	    test_ret++;
48033            printf(" %d", n_ctxt);
48034            printf(" %d", n_cur);
48035            printf("\n");
48036        }
48037    }
48038    }
48039    function_tests++;
48040#endif
48041
48042    return(test_ret);
48043}
48044
48045
48046static int
48047test_xmlXPathNextChild(void) {
48048    int test_ret = 0;
48049
48050#if defined(LIBXML_XPATH_ENABLED)
48051    int mem_base;
48052    xmlNodePtr ret_val;
48053    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48054    int n_ctxt;
48055    xmlNodePtr cur; /* the current node in the traversal */
48056    int n_cur;
48057
48058    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48059    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48060        mem_base = xmlMemBlocks();
48061        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48062        cur = gen_xmlNodePtr(n_cur, 1);
48063
48064        ret_val = xmlXPathNextChild(ctxt, cur);
48065        desret_xmlNodePtr(ret_val);
48066        call_tests++;
48067        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48068        des_xmlNodePtr(n_cur, cur, 1);
48069        xmlResetLastError();
48070        if (mem_base != xmlMemBlocks()) {
48071            printf("Leak of %d blocks found in xmlXPathNextChild",
48072	           xmlMemBlocks() - mem_base);
48073	    test_ret++;
48074            printf(" %d", n_ctxt);
48075            printf(" %d", n_cur);
48076            printf("\n");
48077        }
48078    }
48079    }
48080    function_tests++;
48081#endif
48082
48083    return(test_ret);
48084}
48085
48086
48087static int
48088test_xmlXPathNextDescendant(void) {
48089    int test_ret = 0;
48090
48091#if defined(LIBXML_XPATH_ENABLED)
48092    int mem_base;
48093    xmlNodePtr ret_val;
48094    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48095    int n_ctxt;
48096    xmlNodePtr cur; /* the current node in the traversal */
48097    int n_cur;
48098
48099    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48100    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48101        mem_base = xmlMemBlocks();
48102        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48103        cur = gen_xmlNodePtr(n_cur, 1);
48104
48105        ret_val = xmlXPathNextDescendant(ctxt, cur);
48106        desret_xmlNodePtr(ret_val);
48107        call_tests++;
48108        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48109        des_xmlNodePtr(n_cur, cur, 1);
48110        xmlResetLastError();
48111        if (mem_base != xmlMemBlocks()) {
48112            printf("Leak of %d blocks found in xmlXPathNextDescendant",
48113	           xmlMemBlocks() - mem_base);
48114	    test_ret++;
48115            printf(" %d", n_ctxt);
48116            printf(" %d", n_cur);
48117            printf("\n");
48118        }
48119    }
48120    }
48121    function_tests++;
48122#endif
48123
48124    return(test_ret);
48125}
48126
48127
48128static int
48129test_xmlXPathNextDescendantOrSelf(void) {
48130    int test_ret = 0;
48131
48132#if defined(LIBXML_XPATH_ENABLED)
48133    int mem_base;
48134    xmlNodePtr ret_val;
48135    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48136    int n_ctxt;
48137    xmlNodePtr cur; /* the current node in the traversal */
48138    int n_cur;
48139
48140    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48141    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48142        mem_base = xmlMemBlocks();
48143        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48144        cur = gen_xmlNodePtr(n_cur, 1);
48145
48146        ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur);
48147        desret_xmlNodePtr(ret_val);
48148        call_tests++;
48149        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48150        des_xmlNodePtr(n_cur, cur, 1);
48151        xmlResetLastError();
48152        if (mem_base != xmlMemBlocks()) {
48153            printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf",
48154	           xmlMemBlocks() - mem_base);
48155	    test_ret++;
48156            printf(" %d", n_ctxt);
48157            printf(" %d", n_cur);
48158            printf("\n");
48159        }
48160    }
48161    }
48162    function_tests++;
48163#endif
48164
48165    return(test_ret);
48166}
48167
48168
48169static int
48170test_xmlXPathNextFollowing(void) {
48171    int test_ret = 0;
48172
48173#if defined(LIBXML_XPATH_ENABLED)
48174    int mem_base;
48175    xmlNodePtr ret_val;
48176    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48177    int n_ctxt;
48178    xmlNodePtr cur; /* the current node in the traversal */
48179    int n_cur;
48180
48181    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48182    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48183        mem_base = xmlMemBlocks();
48184        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48185        cur = gen_xmlNodePtr(n_cur, 1);
48186
48187        ret_val = xmlXPathNextFollowing(ctxt, cur);
48188        desret_xmlNodePtr(ret_val);
48189        call_tests++;
48190        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48191        des_xmlNodePtr(n_cur, cur, 1);
48192        xmlResetLastError();
48193        if (mem_base != xmlMemBlocks()) {
48194            printf("Leak of %d blocks found in xmlXPathNextFollowing",
48195	           xmlMemBlocks() - mem_base);
48196	    test_ret++;
48197            printf(" %d", n_ctxt);
48198            printf(" %d", n_cur);
48199            printf("\n");
48200        }
48201    }
48202    }
48203    function_tests++;
48204#endif
48205
48206    return(test_ret);
48207}
48208
48209
48210static int
48211test_xmlXPathNextFollowingSibling(void) {
48212    int test_ret = 0;
48213
48214#if defined(LIBXML_XPATH_ENABLED)
48215    int mem_base;
48216    xmlNodePtr ret_val;
48217    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48218    int n_ctxt;
48219    xmlNodePtr cur; /* the current node in the traversal */
48220    int n_cur;
48221
48222    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48223    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48224        mem_base = xmlMemBlocks();
48225        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48226        cur = gen_xmlNodePtr(n_cur, 1);
48227
48228        ret_val = xmlXPathNextFollowingSibling(ctxt, cur);
48229        desret_xmlNodePtr(ret_val);
48230        call_tests++;
48231        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48232        des_xmlNodePtr(n_cur, cur, 1);
48233        xmlResetLastError();
48234        if (mem_base != xmlMemBlocks()) {
48235            printf("Leak of %d blocks found in xmlXPathNextFollowingSibling",
48236	           xmlMemBlocks() - mem_base);
48237	    test_ret++;
48238            printf(" %d", n_ctxt);
48239            printf(" %d", n_cur);
48240            printf("\n");
48241        }
48242    }
48243    }
48244    function_tests++;
48245#endif
48246
48247    return(test_ret);
48248}
48249
48250
48251static int
48252test_xmlXPathNextNamespace(void) {
48253    int test_ret = 0;
48254
48255#if defined(LIBXML_XPATH_ENABLED)
48256    int mem_base;
48257    xmlNodePtr ret_val;
48258    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48259    int n_ctxt;
48260    xmlNodePtr cur; /* the current attribute in the traversal */
48261    int n_cur;
48262
48263    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48264    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48265        mem_base = xmlMemBlocks();
48266        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48267        cur = gen_xmlNodePtr(n_cur, 1);
48268
48269        ret_val = xmlXPathNextNamespace(ctxt, cur);
48270        desret_xmlNodePtr(ret_val);
48271        call_tests++;
48272        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48273        des_xmlNodePtr(n_cur, cur, 1);
48274        xmlResetLastError();
48275        if (mem_base != xmlMemBlocks()) {
48276            printf("Leak of %d blocks found in xmlXPathNextNamespace",
48277	           xmlMemBlocks() - mem_base);
48278	    test_ret++;
48279            printf(" %d", n_ctxt);
48280            printf(" %d", n_cur);
48281            printf("\n");
48282        }
48283    }
48284    }
48285    function_tests++;
48286#endif
48287
48288    return(test_ret);
48289}
48290
48291
48292static int
48293test_xmlXPathNextParent(void) {
48294    int test_ret = 0;
48295
48296#if defined(LIBXML_XPATH_ENABLED)
48297    int mem_base;
48298    xmlNodePtr ret_val;
48299    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48300    int n_ctxt;
48301    xmlNodePtr cur; /* the current node in the traversal */
48302    int n_cur;
48303
48304    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48305    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48306        mem_base = xmlMemBlocks();
48307        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48308        cur = gen_xmlNodePtr(n_cur, 1);
48309
48310        ret_val = xmlXPathNextParent(ctxt, cur);
48311        desret_xmlNodePtr(ret_val);
48312        call_tests++;
48313        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48314        des_xmlNodePtr(n_cur, cur, 1);
48315        xmlResetLastError();
48316        if (mem_base != xmlMemBlocks()) {
48317            printf("Leak of %d blocks found in xmlXPathNextParent",
48318	           xmlMemBlocks() - mem_base);
48319	    test_ret++;
48320            printf(" %d", n_ctxt);
48321            printf(" %d", n_cur);
48322            printf("\n");
48323        }
48324    }
48325    }
48326    function_tests++;
48327#endif
48328
48329    return(test_ret);
48330}
48331
48332
48333static int
48334test_xmlXPathNextPreceding(void) {
48335    int test_ret = 0;
48336
48337#if defined(LIBXML_XPATH_ENABLED)
48338    int mem_base;
48339    xmlNodePtr ret_val;
48340    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48341    int n_ctxt;
48342    xmlNodePtr cur; /* the current node in the traversal */
48343    int n_cur;
48344
48345    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48346    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48347        mem_base = xmlMemBlocks();
48348        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48349        cur = gen_xmlNodePtr(n_cur, 1);
48350
48351        ret_val = xmlXPathNextPreceding(ctxt, cur);
48352        desret_xmlNodePtr(ret_val);
48353        call_tests++;
48354        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48355        des_xmlNodePtr(n_cur, cur, 1);
48356        xmlResetLastError();
48357        if (mem_base != xmlMemBlocks()) {
48358            printf("Leak of %d blocks found in xmlXPathNextPreceding",
48359	           xmlMemBlocks() - mem_base);
48360	    test_ret++;
48361            printf(" %d", n_ctxt);
48362            printf(" %d", n_cur);
48363            printf("\n");
48364        }
48365    }
48366    }
48367    function_tests++;
48368#endif
48369
48370    return(test_ret);
48371}
48372
48373
48374static int
48375test_xmlXPathNextPrecedingSibling(void) {
48376    int test_ret = 0;
48377
48378#if defined(LIBXML_XPATH_ENABLED)
48379    int mem_base;
48380    xmlNodePtr ret_val;
48381    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48382    int n_ctxt;
48383    xmlNodePtr cur; /* the current node in the traversal */
48384    int n_cur;
48385
48386    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48387    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48388        mem_base = xmlMemBlocks();
48389        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48390        cur = gen_xmlNodePtr(n_cur, 1);
48391
48392        ret_val = xmlXPathNextPrecedingSibling(ctxt, cur);
48393        desret_xmlNodePtr(ret_val);
48394        call_tests++;
48395        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48396        des_xmlNodePtr(n_cur, cur, 1);
48397        xmlResetLastError();
48398        if (mem_base != xmlMemBlocks()) {
48399            printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling",
48400	           xmlMemBlocks() - mem_base);
48401	    test_ret++;
48402            printf(" %d", n_ctxt);
48403            printf(" %d", n_cur);
48404            printf("\n");
48405        }
48406    }
48407    }
48408    function_tests++;
48409#endif
48410
48411    return(test_ret);
48412}
48413
48414
48415static int
48416test_xmlXPathNextSelf(void) {
48417    int test_ret = 0;
48418
48419#if defined(LIBXML_XPATH_ENABLED)
48420    int mem_base;
48421    xmlNodePtr ret_val;
48422    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48423    int n_ctxt;
48424    xmlNodePtr cur; /* the current node in the traversal */
48425    int n_cur;
48426
48427    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48428    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
48429        mem_base = xmlMemBlocks();
48430        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48431        cur = gen_xmlNodePtr(n_cur, 1);
48432
48433        ret_val = xmlXPathNextSelf(ctxt, cur);
48434        desret_xmlNodePtr(ret_val);
48435        call_tests++;
48436        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48437        des_xmlNodePtr(n_cur, cur, 1);
48438        xmlResetLastError();
48439        if (mem_base != xmlMemBlocks()) {
48440            printf("Leak of %d blocks found in xmlXPathNextSelf",
48441	           xmlMemBlocks() - mem_base);
48442	    test_ret++;
48443            printf(" %d", n_ctxt);
48444            printf(" %d", n_cur);
48445            printf("\n");
48446        }
48447    }
48448    }
48449    function_tests++;
48450#endif
48451
48452    return(test_ret);
48453}
48454
48455
48456static int
48457test_xmlXPathNodeLeading(void) {
48458    int test_ret = 0;
48459
48460#if defined(LIBXML_XPATH_ENABLED)
48461    int mem_base;
48462    xmlNodeSetPtr ret_val;
48463    xmlNodeSetPtr nodes; /* a node-set */
48464    int n_nodes;
48465    xmlNodePtr node; /* a node */
48466    int n_node;
48467
48468    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48469    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48470        mem_base = xmlMemBlocks();
48471        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48472        node = gen_xmlNodePtr(n_node, 1);
48473
48474        ret_val = xmlXPathNodeLeading(nodes, node);
48475        desret_xmlNodeSetPtr(ret_val);
48476        call_tests++;
48477        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48478        des_xmlNodePtr(n_node, node, 1);
48479        xmlResetLastError();
48480        if (mem_base != xmlMemBlocks()) {
48481            printf("Leak of %d blocks found in xmlXPathNodeLeading",
48482	           xmlMemBlocks() - mem_base);
48483	    test_ret++;
48484            printf(" %d", n_nodes);
48485            printf(" %d", n_node);
48486            printf("\n");
48487        }
48488    }
48489    }
48490    function_tests++;
48491#endif
48492
48493    return(test_ret);
48494}
48495
48496
48497static int
48498test_xmlXPathNodeLeadingSorted(void) {
48499    int test_ret = 0;
48500
48501#if defined(LIBXML_XPATH_ENABLED)
48502    int mem_base;
48503    xmlNodeSetPtr ret_val;
48504    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48505    int n_nodes;
48506    xmlNodePtr node; /* a node */
48507    int n_node;
48508
48509    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48510    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48511        mem_base = xmlMemBlocks();
48512        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48513        node = gen_xmlNodePtr(n_node, 1);
48514
48515        ret_val = xmlXPathNodeLeadingSorted(nodes, node);
48516        desret_xmlNodeSetPtr(ret_val);
48517        call_tests++;
48518        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48519        des_xmlNodePtr(n_node, node, 1);
48520        xmlResetLastError();
48521        if (mem_base != xmlMemBlocks()) {
48522            printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted",
48523	           xmlMemBlocks() - mem_base);
48524	    test_ret++;
48525            printf(" %d", n_nodes);
48526            printf(" %d", n_node);
48527            printf("\n");
48528        }
48529    }
48530    }
48531    function_tests++;
48532#endif
48533
48534    return(test_ret);
48535}
48536
48537
48538static int
48539test_xmlXPathNodeSetAdd(void) {
48540    int test_ret = 0;
48541
48542#if defined(LIBXML_XPATH_ENABLED)
48543    int mem_base;
48544    xmlNodeSetPtr cur; /* the initial node set */
48545    int n_cur;
48546    xmlNodePtr val; /* a new xmlNodePtr */
48547    int n_val;
48548
48549    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48550    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48551        mem_base = xmlMemBlocks();
48552        cur = gen_xmlNodeSetPtr(n_cur, 0);
48553        val = gen_xmlNodePtr(n_val, 1);
48554
48555        xmlXPathNodeSetAdd(cur, val);
48556        call_tests++;
48557        des_xmlNodeSetPtr(n_cur, cur, 0);
48558        des_xmlNodePtr(n_val, val, 1);
48559        xmlResetLastError();
48560        if (mem_base != xmlMemBlocks()) {
48561            printf("Leak of %d blocks found in xmlXPathNodeSetAdd",
48562	           xmlMemBlocks() - mem_base);
48563	    test_ret++;
48564            printf(" %d", n_cur);
48565            printf(" %d", n_val);
48566            printf("\n");
48567        }
48568    }
48569    }
48570    function_tests++;
48571#endif
48572
48573    return(test_ret);
48574}
48575
48576
48577static int
48578test_xmlXPathNodeSetAddNs(void) {
48579    int test_ret = 0;
48580
48581#if defined(LIBXML_XPATH_ENABLED)
48582    int mem_base;
48583    xmlNodeSetPtr cur; /* the initial node set */
48584    int n_cur;
48585    xmlNodePtr node; /* the hosting node */
48586    int n_node;
48587    xmlNsPtr ns; /* a the namespace node */
48588    int n_ns;
48589
48590    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48591    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48592    for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) {
48593        mem_base = xmlMemBlocks();
48594        cur = gen_xmlNodeSetPtr(n_cur, 0);
48595        node = gen_xmlNodePtr(n_node, 1);
48596        ns = gen_xmlNsPtr(n_ns, 2);
48597
48598        xmlXPathNodeSetAddNs(cur, node, ns);
48599        call_tests++;
48600        des_xmlNodeSetPtr(n_cur, cur, 0);
48601        des_xmlNodePtr(n_node, node, 1);
48602        des_xmlNsPtr(n_ns, ns, 2);
48603        xmlResetLastError();
48604        if (mem_base != xmlMemBlocks()) {
48605            printf("Leak of %d blocks found in xmlXPathNodeSetAddNs",
48606	           xmlMemBlocks() - mem_base);
48607	    test_ret++;
48608            printf(" %d", n_cur);
48609            printf(" %d", n_node);
48610            printf(" %d", n_ns);
48611            printf("\n");
48612        }
48613    }
48614    }
48615    }
48616    function_tests++;
48617#endif
48618
48619    return(test_ret);
48620}
48621
48622
48623static int
48624test_xmlXPathNodeSetAddUnique(void) {
48625    int test_ret = 0;
48626
48627#if defined(LIBXML_XPATH_ENABLED)
48628    int mem_base;
48629    xmlNodeSetPtr cur; /* the initial node set */
48630    int n_cur;
48631    xmlNodePtr val; /* a new xmlNodePtr */
48632    int n_val;
48633
48634    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48635    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48636        mem_base = xmlMemBlocks();
48637        cur = gen_xmlNodeSetPtr(n_cur, 0);
48638        val = gen_xmlNodePtr(n_val, 1);
48639
48640        xmlXPathNodeSetAddUnique(cur, val);
48641        call_tests++;
48642        des_xmlNodeSetPtr(n_cur, cur, 0);
48643        des_xmlNodePtr(n_val, val, 1);
48644        xmlResetLastError();
48645        if (mem_base != xmlMemBlocks()) {
48646            printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique",
48647	           xmlMemBlocks() - mem_base);
48648	    test_ret++;
48649            printf(" %d", n_cur);
48650            printf(" %d", n_val);
48651            printf("\n");
48652        }
48653    }
48654    }
48655    function_tests++;
48656#endif
48657
48658    return(test_ret);
48659}
48660
48661
48662static int
48663test_xmlXPathNodeSetContains(void) {
48664    int test_ret = 0;
48665
48666#if defined(LIBXML_XPATH_ENABLED)
48667    int mem_base;
48668    int ret_val;
48669    xmlNodeSetPtr cur; /* the node-set */
48670    int n_cur;
48671    xmlNodePtr val; /* the node */
48672    int n_val;
48673
48674    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48675    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48676        mem_base = xmlMemBlocks();
48677        cur = gen_xmlNodeSetPtr(n_cur, 0);
48678        val = gen_xmlNodePtr(n_val, 1);
48679
48680        ret_val = xmlXPathNodeSetContains(cur, val);
48681        desret_int(ret_val);
48682        call_tests++;
48683        des_xmlNodeSetPtr(n_cur, cur, 0);
48684        des_xmlNodePtr(n_val, val, 1);
48685        xmlResetLastError();
48686        if (mem_base != xmlMemBlocks()) {
48687            printf("Leak of %d blocks found in xmlXPathNodeSetContains",
48688	           xmlMemBlocks() - mem_base);
48689	    test_ret++;
48690            printf(" %d", n_cur);
48691            printf(" %d", n_val);
48692            printf("\n");
48693        }
48694    }
48695    }
48696    function_tests++;
48697#endif
48698
48699    return(test_ret);
48700}
48701
48702
48703static int
48704test_xmlXPathNodeSetDel(void) {
48705    int test_ret = 0;
48706
48707#if defined(LIBXML_XPATH_ENABLED)
48708    int mem_base;
48709    xmlNodeSetPtr cur; /* the initial node set */
48710    int n_cur;
48711    xmlNodePtr val; /* an xmlNodePtr */
48712    int n_val;
48713
48714    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48715    for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) {
48716        mem_base = xmlMemBlocks();
48717        cur = gen_xmlNodeSetPtr(n_cur, 0);
48718        val = gen_xmlNodePtr(n_val, 1);
48719
48720        xmlXPathNodeSetDel(cur, val);
48721        call_tests++;
48722        des_xmlNodeSetPtr(n_cur, cur, 0);
48723        des_xmlNodePtr(n_val, val, 1);
48724        xmlResetLastError();
48725        if (mem_base != xmlMemBlocks()) {
48726            printf("Leak of %d blocks found in xmlXPathNodeSetDel",
48727	           xmlMemBlocks() - mem_base);
48728	    test_ret++;
48729            printf(" %d", n_cur);
48730            printf(" %d", n_val);
48731            printf("\n");
48732        }
48733    }
48734    }
48735    function_tests++;
48736#endif
48737
48738    return(test_ret);
48739}
48740
48741
48742static int
48743test_xmlXPathNodeSetMerge(void) {
48744    int test_ret = 0;
48745
48746#if defined(LIBXML_XPATH_ENABLED)
48747    int mem_base;
48748    xmlNodeSetPtr ret_val;
48749    xmlNodeSetPtr val1; /* the first NodeSet or NULL */
48750    int n_val1;
48751    xmlNodeSetPtr val2; /* the second NodeSet */
48752    int n_val2;
48753
48754    for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) {
48755    for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) {
48756        mem_base = xmlMemBlocks();
48757        val1 = gen_xmlNodeSetPtr(n_val1, 0);
48758        val2 = gen_xmlNodeSetPtr(n_val2, 1);
48759
48760        ret_val = xmlXPathNodeSetMerge(val1, val2);
48761        desret_xmlNodeSetPtr(ret_val);
48762        call_tests++;
48763        des_xmlNodeSetPtr(n_val1, val1, 0);
48764        des_xmlNodeSetPtr(n_val2, val2, 1);
48765        xmlResetLastError();
48766        if (mem_base != xmlMemBlocks()) {
48767            printf("Leak of %d blocks found in xmlXPathNodeSetMerge",
48768	           xmlMemBlocks() - mem_base);
48769	    test_ret++;
48770            printf(" %d", n_val1);
48771            printf(" %d", n_val2);
48772            printf("\n");
48773        }
48774    }
48775    }
48776    function_tests++;
48777#endif
48778
48779    return(test_ret);
48780}
48781
48782
48783static int
48784test_xmlXPathNodeSetRemove(void) {
48785    int test_ret = 0;
48786
48787#if defined(LIBXML_XPATH_ENABLED)
48788    int mem_base;
48789    xmlNodeSetPtr cur; /* the initial node set */
48790    int n_cur;
48791    int val; /* the index to remove */
48792    int n_val;
48793
48794    for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) {
48795    for (n_val = 0;n_val < gen_nb_int;n_val++) {
48796        mem_base = xmlMemBlocks();
48797        cur = gen_xmlNodeSetPtr(n_cur, 0);
48798        val = gen_int(n_val, 1);
48799
48800        xmlXPathNodeSetRemove(cur, val);
48801        call_tests++;
48802        des_xmlNodeSetPtr(n_cur, cur, 0);
48803        des_int(n_val, val, 1);
48804        xmlResetLastError();
48805        if (mem_base != xmlMemBlocks()) {
48806            printf("Leak of %d blocks found in xmlXPathNodeSetRemove",
48807	           xmlMemBlocks() - mem_base);
48808	    test_ret++;
48809            printf(" %d", n_cur);
48810            printf(" %d", n_val);
48811            printf("\n");
48812        }
48813    }
48814    }
48815    function_tests++;
48816#endif
48817
48818    return(test_ret);
48819}
48820
48821
48822static int
48823test_xmlXPathNodeSetSort(void) {
48824    int test_ret = 0;
48825
48826#if defined(LIBXML_XPATH_ENABLED)
48827    int mem_base;
48828    xmlNodeSetPtr set; /* the node set */
48829    int n_set;
48830
48831    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
48832        mem_base = xmlMemBlocks();
48833        set = gen_xmlNodeSetPtr(n_set, 0);
48834
48835        xmlXPathNodeSetSort(set);
48836        call_tests++;
48837        des_xmlNodeSetPtr(n_set, set, 0);
48838        xmlResetLastError();
48839        if (mem_base != xmlMemBlocks()) {
48840            printf("Leak of %d blocks found in xmlXPathNodeSetSort",
48841	           xmlMemBlocks() - mem_base);
48842	    test_ret++;
48843            printf(" %d", n_set);
48844            printf("\n");
48845        }
48846    }
48847    function_tests++;
48848#endif
48849
48850    return(test_ret);
48851}
48852
48853
48854static int
48855test_xmlXPathNodeTrailing(void) {
48856    int test_ret = 0;
48857
48858#if defined(LIBXML_XPATH_ENABLED)
48859    int mem_base;
48860    xmlNodeSetPtr ret_val;
48861    xmlNodeSetPtr nodes; /* a node-set */
48862    int n_nodes;
48863    xmlNodePtr node; /* a node */
48864    int n_node;
48865
48866    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48867    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48868        mem_base = xmlMemBlocks();
48869        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48870        node = gen_xmlNodePtr(n_node, 1);
48871
48872        ret_val = xmlXPathNodeTrailing(nodes, node);
48873        desret_xmlNodeSetPtr(ret_val);
48874        call_tests++;
48875        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48876        des_xmlNodePtr(n_node, node, 1);
48877        xmlResetLastError();
48878        if (mem_base != xmlMemBlocks()) {
48879            printf("Leak of %d blocks found in xmlXPathNodeTrailing",
48880	           xmlMemBlocks() - mem_base);
48881	    test_ret++;
48882            printf(" %d", n_nodes);
48883            printf(" %d", n_node);
48884            printf("\n");
48885        }
48886    }
48887    }
48888    function_tests++;
48889#endif
48890
48891    return(test_ret);
48892}
48893
48894
48895static int
48896test_xmlXPathNodeTrailingSorted(void) {
48897    int test_ret = 0;
48898
48899#if defined(LIBXML_XPATH_ENABLED)
48900    int mem_base;
48901    xmlNodeSetPtr ret_val;
48902    xmlNodeSetPtr nodes; /* a node-set, sorted by document order */
48903    int n_nodes;
48904    xmlNodePtr node; /* a node */
48905    int n_node;
48906
48907    for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) {
48908    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
48909        mem_base = xmlMemBlocks();
48910        nodes = gen_xmlNodeSetPtr(n_nodes, 0);
48911        node = gen_xmlNodePtr(n_node, 1);
48912
48913        ret_val = xmlXPathNodeTrailingSorted(nodes, node);
48914        desret_xmlNodeSetPtr(ret_val);
48915        call_tests++;
48916        des_xmlNodeSetPtr(n_nodes, nodes, 0);
48917        des_xmlNodePtr(n_node, node, 1);
48918        xmlResetLastError();
48919        if (mem_base != xmlMemBlocks()) {
48920            printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted",
48921	           xmlMemBlocks() - mem_base);
48922	    test_ret++;
48923            printf(" %d", n_nodes);
48924            printf(" %d", n_node);
48925            printf("\n");
48926        }
48927    }
48928    }
48929    function_tests++;
48930#endif
48931
48932    return(test_ret);
48933}
48934
48935
48936static int
48937test_xmlXPathNormalizeFunction(void) {
48938    int test_ret = 0;
48939
48940#if defined(LIBXML_XPATH_ENABLED)
48941    int mem_base;
48942    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48943    int n_ctxt;
48944    int nargs; /* the number of arguments */
48945    int n_nargs;
48946
48947    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48948    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
48949        mem_base = xmlMemBlocks();
48950        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48951        nargs = gen_int(n_nargs, 1);
48952
48953        xmlXPathNormalizeFunction(ctxt, nargs);
48954        call_tests++;
48955        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48956        des_int(n_nargs, nargs, 1);
48957        xmlResetLastError();
48958        if (mem_base != xmlMemBlocks()) {
48959            printf("Leak of %d blocks found in xmlXPathNormalizeFunction",
48960	           xmlMemBlocks() - mem_base);
48961	    test_ret++;
48962            printf(" %d", n_ctxt);
48963            printf(" %d", n_nargs);
48964            printf("\n");
48965        }
48966    }
48967    }
48968    function_tests++;
48969#endif
48970
48971    return(test_ret);
48972}
48973
48974
48975static int
48976test_xmlXPathNotEqualValues(void) {
48977    int test_ret = 0;
48978
48979#if defined(LIBXML_XPATH_ENABLED)
48980    int mem_base;
48981    int ret_val;
48982    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
48983    int n_ctxt;
48984
48985    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
48986        mem_base = xmlMemBlocks();
48987        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
48988
48989        ret_val = xmlXPathNotEqualValues(ctxt);
48990        desret_int(ret_val);
48991        call_tests++;
48992        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
48993        xmlResetLastError();
48994        if (mem_base != xmlMemBlocks()) {
48995            printf("Leak of %d blocks found in xmlXPathNotEqualValues",
48996	           xmlMemBlocks() - mem_base);
48997	    test_ret++;
48998            printf(" %d", n_ctxt);
48999            printf("\n");
49000        }
49001    }
49002    function_tests++;
49003#endif
49004
49005    return(test_ret);
49006}
49007
49008
49009static int
49010test_xmlXPathNotFunction(void) {
49011    int test_ret = 0;
49012
49013#if defined(LIBXML_XPATH_ENABLED)
49014    int mem_base;
49015    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49016    int n_ctxt;
49017    int nargs; /* the number of arguments */
49018    int n_nargs;
49019
49020    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49021    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49022        mem_base = xmlMemBlocks();
49023        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49024        nargs = gen_int(n_nargs, 1);
49025
49026        xmlXPathNotFunction(ctxt, nargs);
49027        call_tests++;
49028        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49029        des_int(n_nargs, nargs, 1);
49030        xmlResetLastError();
49031        if (mem_base != xmlMemBlocks()) {
49032            printf("Leak of %d blocks found in xmlXPathNotFunction",
49033	           xmlMemBlocks() - mem_base);
49034	    test_ret++;
49035            printf(" %d", n_ctxt);
49036            printf(" %d", n_nargs);
49037            printf("\n");
49038        }
49039    }
49040    }
49041    function_tests++;
49042#endif
49043
49044    return(test_ret);
49045}
49046
49047
49048static int
49049test_xmlXPathNsLookup(void) {
49050    int test_ret = 0;
49051
49052#if defined(LIBXML_XPATH_ENABLED)
49053    int mem_base;
49054    const xmlChar * ret_val;
49055    xmlXPathContextPtr ctxt; /* the XPath context */
49056    int n_ctxt;
49057    xmlChar * prefix; /* the namespace prefix value */
49058    int n_prefix;
49059
49060    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49061    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49062        mem_base = xmlMemBlocks();
49063        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49064        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49065
49066        ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix);
49067        desret_const_xmlChar_ptr(ret_val);
49068        call_tests++;
49069        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49070        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49071        xmlResetLastError();
49072        if (mem_base != xmlMemBlocks()) {
49073            printf("Leak of %d blocks found in xmlXPathNsLookup",
49074	           xmlMemBlocks() - mem_base);
49075	    test_ret++;
49076            printf(" %d", n_ctxt);
49077            printf(" %d", n_prefix);
49078            printf("\n");
49079        }
49080    }
49081    }
49082    function_tests++;
49083#endif
49084
49085    return(test_ret);
49086}
49087
49088
49089static int
49090test_xmlXPathNumberFunction(void) {
49091    int test_ret = 0;
49092
49093#if defined(LIBXML_XPATH_ENABLED)
49094    int mem_base;
49095    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49096    int n_ctxt;
49097    int nargs; /* the number of arguments */
49098    int n_nargs;
49099
49100    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49101    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49102        mem_base = xmlMemBlocks();
49103        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49104        nargs = gen_int(n_nargs, 1);
49105
49106        xmlXPathNumberFunction(ctxt, nargs);
49107        call_tests++;
49108        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49109        des_int(n_nargs, nargs, 1);
49110        xmlResetLastError();
49111        if (mem_base != xmlMemBlocks()) {
49112            printf("Leak of %d blocks found in xmlXPathNumberFunction",
49113	           xmlMemBlocks() - mem_base);
49114	    test_ret++;
49115            printf(" %d", n_ctxt);
49116            printf(" %d", n_nargs);
49117            printf("\n");
49118        }
49119    }
49120    }
49121    function_tests++;
49122#endif
49123
49124    return(test_ret);
49125}
49126
49127
49128static int
49129test_xmlXPathParseNCName(void) {
49130    int test_ret = 0;
49131
49132#if defined(LIBXML_XPATH_ENABLED)
49133    int mem_base;
49134    xmlChar * ret_val;
49135    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49136    int n_ctxt;
49137
49138    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49139        mem_base = xmlMemBlocks();
49140        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49141
49142        ret_val = xmlXPathParseNCName(ctxt);
49143        desret_xmlChar_ptr(ret_val);
49144        call_tests++;
49145        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49146        xmlResetLastError();
49147        if (mem_base != xmlMemBlocks()) {
49148            printf("Leak of %d blocks found in xmlXPathParseNCName",
49149	           xmlMemBlocks() - mem_base);
49150	    test_ret++;
49151            printf(" %d", n_ctxt);
49152            printf("\n");
49153        }
49154    }
49155    function_tests++;
49156#endif
49157
49158    return(test_ret);
49159}
49160
49161
49162static int
49163test_xmlXPathParseName(void) {
49164    int test_ret = 0;
49165
49166#if defined(LIBXML_XPATH_ENABLED)
49167    int mem_base;
49168    xmlChar * ret_val;
49169    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49170    int n_ctxt;
49171
49172    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49173        mem_base = xmlMemBlocks();
49174        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49175
49176        ret_val = xmlXPathParseName(ctxt);
49177        desret_xmlChar_ptr(ret_val);
49178        call_tests++;
49179        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49180        xmlResetLastError();
49181        if (mem_base != xmlMemBlocks()) {
49182            printf("Leak of %d blocks found in xmlXPathParseName",
49183	           xmlMemBlocks() - mem_base);
49184	    test_ret++;
49185            printf(" %d", n_ctxt);
49186            printf("\n");
49187        }
49188    }
49189    function_tests++;
49190#endif
49191
49192    return(test_ret);
49193}
49194
49195
49196static int
49197test_xmlXPathPopBoolean(void) {
49198    int test_ret = 0;
49199
49200#if defined(LIBXML_XPATH_ENABLED)
49201    int mem_base;
49202    int ret_val;
49203    xmlXPathParserContextPtr ctxt; /* an 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 = xmlXPathPopBoolean(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 xmlXPathPopBoolean",
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_xmlXPathPopExternal(void) {
49232    int test_ret = 0;
49233
49234#if defined(LIBXML_XPATH_ENABLED)
49235    int mem_base;
49236    void * ret_val;
49237    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49238    int n_ctxt;
49239
49240    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49241        mem_base = xmlMemBlocks();
49242        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49243
49244        ret_val = xmlXPathPopExternal(ctxt);
49245        desret_void_ptr(ret_val);
49246        call_tests++;
49247        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49248        xmlResetLastError();
49249        if (mem_base != xmlMemBlocks()) {
49250            printf("Leak of %d blocks found in xmlXPathPopExternal",
49251	           xmlMemBlocks() - mem_base);
49252	    test_ret++;
49253            printf(" %d", n_ctxt);
49254            printf("\n");
49255        }
49256    }
49257    function_tests++;
49258#endif
49259
49260    return(test_ret);
49261}
49262
49263
49264static int
49265test_xmlXPathPopNodeSet(void) {
49266    int test_ret = 0;
49267
49268#if defined(LIBXML_XPATH_ENABLED)
49269    int mem_base;
49270    xmlNodeSetPtr ret_val;
49271    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49272    int n_ctxt;
49273
49274    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49275        mem_base = xmlMemBlocks();
49276        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49277
49278        ret_val = xmlXPathPopNodeSet(ctxt);
49279        desret_xmlNodeSetPtr(ret_val);
49280        call_tests++;
49281        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49282        xmlResetLastError();
49283        if (mem_base != xmlMemBlocks()) {
49284            printf("Leak of %d blocks found in xmlXPathPopNodeSet",
49285	           xmlMemBlocks() - mem_base);
49286	    test_ret++;
49287            printf(" %d", n_ctxt);
49288            printf("\n");
49289        }
49290    }
49291    function_tests++;
49292#endif
49293
49294    return(test_ret);
49295}
49296
49297
49298static int
49299test_xmlXPathPopNumber(void) {
49300    int test_ret = 0;
49301
49302#if defined(LIBXML_XPATH_ENABLED)
49303    int mem_base;
49304    double ret_val;
49305    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49306    int n_ctxt;
49307
49308    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49309        mem_base = xmlMemBlocks();
49310        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49311
49312        ret_val = xmlXPathPopNumber(ctxt);
49313        desret_double(ret_val);
49314        call_tests++;
49315        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49316        xmlResetLastError();
49317        if (mem_base != xmlMemBlocks()) {
49318            printf("Leak of %d blocks found in xmlXPathPopNumber",
49319	           xmlMemBlocks() - mem_base);
49320	    test_ret++;
49321            printf(" %d", n_ctxt);
49322            printf("\n");
49323        }
49324    }
49325    function_tests++;
49326#endif
49327
49328    return(test_ret);
49329}
49330
49331
49332static int
49333test_xmlXPathPopString(void) {
49334    int test_ret = 0;
49335
49336#if defined(LIBXML_XPATH_ENABLED)
49337    int mem_base;
49338    xmlChar * ret_val;
49339    xmlXPathParserContextPtr ctxt; /* an XPath parser context */
49340    int n_ctxt;
49341
49342    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49343        mem_base = xmlMemBlocks();
49344        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49345
49346        ret_val = xmlXPathPopString(ctxt);
49347        desret_xmlChar_ptr(ret_val);
49348        call_tests++;
49349        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49350        xmlResetLastError();
49351        if (mem_base != xmlMemBlocks()) {
49352            printf("Leak of %d blocks found in xmlXPathPopString",
49353	           xmlMemBlocks() - mem_base);
49354	    test_ret++;
49355            printf(" %d", n_ctxt);
49356            printf("\n");
49357        }
49358    }
49359    function_tests++;
49360#endif
49361
49362    return(test_ret);
49363}
49364
49365
49366static int
49367test_xmlXPathPositionFunction(void) {
49368    int test_ret = 0;
49369
49370#if defined(LIBXML_XPATH_ENABLED)
49371    int mem_base;
49372    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49373    int n_ctxt;
49374    int nargs; /* the number of arguments */
49375    int n_nargs;
49376
49377    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49378    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49379        mem_base = xmlMemBlocks();
49380        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49381        nargs = gen_int(n_nargs, 1);
49382
49383        xmlXPathPositionFunction(ctxt, nargs);
49384        call_tests++;
49385        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49386        des_int(n_nargs, nargs, 1);
49387        xmlResetLastError();
49388        if (mem_base != xmlMemBlocks()) {
49389            printf("Leak of %d blocks found in xmlXPathPositionFunction",
49390	           xmlMemBlocks() - mem_base);
49391	    test_ret++;
49392            printf(" %d", n_ctxt);
49393            printf(" %d", n_nargs);
49394            printf("\n");
49395        }
49396    }
49397    }
49398    function_tests++;
49399#endif
49400
49401    return(test_ret);
49402}
49403
49404
49405static int
49406test_xmlXPathRegisterAllFunctions(void) {
49407    int test_ret = 0;
49408
49409#if defined(LIBXML_XPATH_ENABLED)
49410    int mem_base;
49411    xmlXPathContextPtr ctxt; /* the XPath context */
49412    int n_ctxt;
49413
49414    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49415        mem_base = xmlMemBlocks();
49416        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49417
49418        xmlXPathRegisterAllFunctions(ctxt);
49419        call_tests++;
49420        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49421        xmlResetLastError();
49422        if (mem_base != xmlMemBlocks()) {
49423            printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions",
49424	           xmlMemBlocks() - mem_base);
49425	    test_ret++;
49426            printf(" %d", n_ctxt);
49427            printf("\n");
49428        }
49429    }
49430    function_tests++;
49431#endif
49432
49433    return(test_ret);
49434}
49435
49436
49437static int
49438test_xmlXPathRegisterFunc(void) {
49439    int test_ret = 0;
49440
49441
49442    /* missing type support */
49443    return(test_ret);
49444}
49445
49446
49447static int
49448test_xmlXPathRegisterFuncLookup(void) {
49449    int test_ret = 0;
49450
49451
49452    /* missing type support */
49453    return(test_ret);
49454}
49455
49456
49457static int
49458test_xmlXPathRegisterFuncNS(void) {
49459    int test_ret = 0;
49460
49461
49462    /* missing type support */
49463    return(test_ret);
49464}
49465
49466
49467static int
49468test_xmlXPathRegisterNs(void) {
49469    int test_ret = 0;
49470
49471#if defined(LIBXML_XPATH_ENABLED)
49472    int mem_base;
49473    int ret_val;
49474    xmlXPathContextPtr ctxt; /* the XPath context */
49475    int n_ctxt;
49476    xmlChar * prefix; /* the namespace prefix */
49477    int n_prefix;
49478    xmlChar * ns_uri; /* the namespace name */
49479    int n_ns_uri;
49480
49481    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49482    for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) {
49483    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49484        mem_base = xmlMemBlocks();
49485        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49486        prefix = gen_const_xmlChar_ptr(n_prefix, 1);
49487        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49488
49489        ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri);
49490        desret_int(ret_val);
49491        call_tests++;
49492        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49493        des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1);
49494        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49495        xmlResetLastError();
49496        if (mem_base != xmlMemBlocks()) {
49497            printf("Leak of %d blocks found in xmlXPathRegisterNs",
49498	           xmlMemBlocks() - mem_base);
49499	    test_ret++;
49500            printf(" %d", n_ctxt);
49501            printf(" %d", n_prefix);
49502            printf(" %d", n_ns_uri);
49503            printf("\n");
49504        }
49505    }
49506    }
49507    }
49508    function_tests++;
49509#endif
49510
49511    return(test_ret);
49512}
49513
49514
49515static int
49516test_xmlXPathRegisterVariable(void) {
49517    int test_ret = 0;
49518
49519#if defined(LIBXML_XPATH_ENABLED)
49520    int mem_base;
49521    int ret_val;
49522    xmlXPathContextPtr ctxt; /* the XPath context */
49523    int n_ctxt;
49524    xmlChar * name; /* the variable name */
49525    int n_name;
49526    xmlXPathObjectPtr value; /* the variable value or NULL */
49527    int n_value;
49528
49529    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49530    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49531    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49532        mem_base = xmlMemBlocks();
49533        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49534        name = gen_const_xmlChar_ptr(n_name, 1);
49535        value = gen_xmlXPathObjectPtr(n_value, 2);
49536
49537        ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value);
49538        desret_int(ret_val);
49539        call_tests++;
49540        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49541        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49542        des_xmlXPathObjectPtr(n_value, value, 2);
49543        xmlResetLastError();
49544        if (mem_base != xmlMemBlocks()) {
49545            printf("Leak of %d blocks found in xmlXPathRegisterVariable",
49546	           xmlMemBlocks() - mem_base);
49547	    test_ret++;
49548            printf(" %d", n_ctxt);
49549            printf(" %d", n_name);
49550            printf(" %d", n_value);
49551            printf("\n");
49552        }
49553    }
49554    }
49555    }
49556    function_tests++;
49557#endif
49558
49559    return(test_ret);
49560}
49561
49562
49563static int
49564test_xmlXPathRegisterVariableLookup(void) {
49565    int test_ret = 0;
49566
49567
49568    /* missing type support */
49569    return(test_ret);
49570}
49571
49572
49573static int
49574test_xmlXPathRegisterVariableNS(void) {
49575    int test_ret = 0;
49576
49577#if defined(LIBXML_XPATH_ENABLED)
49578    int mem_base;
49579    int ret_val;
49580    xmlXPathContextPtr ctxt; /* the XPath context */
49581    int n_ctxt;
49582    xmlChar * name; /* the variable name */
49583    int n_name;
49584    xmlChar * ns_uri; /* the variable namespace URI */
49585    int n_ns_uri;
49586    xmlXPathObjectPtr value; /* the variable value or NULL */
49587    int n_value;
49588
49589    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49590    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
49591    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
49592    for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) {
49593        mem_base = xmlMemBlocks();
49594        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49595        name = gen_const_xmlChar_ptr(n_name, 1);
49596        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
49597        value = gen_xmlXPathObjectPtr(n_value, 3);
49598
49599        ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value);
49600        desret_int(ret_val);
49601        call_tests++;
49602        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49603        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
49604        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
49605        des_xmlXPathObjectPtr(n_value, value, 3);
49606        xmlResetLastError();
49607        if (mem_base != xmlMemBlocks()) {
49608            printf("Leak of %d blocks found in xmlXPathRegisterVariableNS",
49609	           xmlMemBlocks() - mem_base);
49610	    test_ret++;
49611            printf(" %d", n_ctxt);
49612            printf(" %d", n_name);
49613            printf(" %d", n_ns_uri);
49614            printf(" %d", n_value);
49615            printf("\n");
49616        }
49617    }
49618    }
49619    }
49620    }
49621    function_tests++;
49622#endif
49623
49624    return(test_ret);
49625}
49626
49627
49628static int
49629test_xmlXPathRegisteredFuncsCleanup(void) {
49630    int test_ret = 0;
49631
49632#if defined(LIBXML_XPATH_ENABLED)
49633    int mem_base;
49634    xmlXPathContextPtr ctxt; /* the XPath context */
49635    int n_ctxt;
49636
49637    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49638        mem_base = xmlMemBlocks();
49639        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49640
49641        xmlXPathRegisteredFuncsCleanup(ctxt);
49642        call_tests++;
49643        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49644        xmlResetLastError();
49645        if (mem_base != xmlMemBlocks()) {
49646            printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup",
49647	           xmlMemBlocks() - mem_base);
49648	    test_ret++;
49649            printf(" %d", n_ctxt);
49650            printf("\n");
49651        }
49652    }
49653    function_tests++;
49654#endif
49655
49656    return(test_ret);
49657}
49658
49659
49660static int
49661test_xmlXPathRegisteredNsCleanup(void) {
49662    int test_ret = 0;
49663
49664#if defined(LIBXML_XPATH_ENABLED)
49665    int mem_base;
49666    xmlXPathContextPtr ctxt; /* the XPath context */
49667    int n_ctxt;
49668
49669    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49670        mem_base = xmlMemBlocks();
49671        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49672
49673        xmlXPathRegisteredNsCleanup(ctxt);
49674        call_tests++;
49675        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49676        xmlResetLastError();
49677        if (mem_base != xmlMemBlocks()) {
49678            printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup",
49679	           xmlMemBlocks() - mem_base);
49680	    test_ret++;
49681            printf(" %d", n_ctxt);
49682            printf("\n");
49683        }
49684    }
49685    function_tests++;
49686#endif
49687
49688    return(test_ret);
49689}
49690
49691
49692static int
49693test_xmlXPathRegisteredVariablesCleanup(void) {
49694    int test_ret = 0;
49695
49696#if defined(LIBXML_XPATH_ENABLED)
49697    int mem_base;
49698    xmlXPathContextPtr ctxt; /* the XPath context */
49699    int n_ctxt;
49700
49701    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
49702        mem_base = xmlMemBlocks();
49703        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
49704
49705        xmlXPathRegisteredVariablesCleanup(ctxt);
49706        call_tests++;
49707        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
49708        xmlResetLastError();
49709        if (mem_base != xmlMemBlocks()) {
49710            printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup",
49711	           xmlMemBlocks() - mem_base);
49712	    test_ret++;
49713            printf(" %d", n_ctxt);
49714            printf("\n");
49715        }
49716    }
49717    function_tests++;
49718#endif
49719
49720    return(test_ret);
49721}
49722
49723
49724static int
49725test_xmlXPathRoot(void) {
49726    int test_ret = 0;
49727
49728#if defined(LIBXML_XPATH_ENABLED)
49729    int mem_base;
49730    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49731    int n_ctxt;
49732
49733    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49734        mem_base = xmlMemBlocks();
49735        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49736
49737        xmlXPathRoot(ctxt);
49738        call_tests++;
49739        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49740        xmlResetLastError();
49741        if (mem_base != xmlMemBlocks()) {
49742            printf("Leak of %d blocks found in xmlXPathRoot",
49743	           xmlMemBlocks() - mem_base);
49744	    test_ret++;
49745            printf(" %d", n_ctxt);
49746            printf("\n");
49747        }
49748    }
49749    function_tests++;
49750#endif
49751
49752    return(test_ret);
49753}
49754
49755
49756static int
49757test_xmlXPathRoundFunction(void) {
49758    int test_ret = 0;
49759
49760#if defined(LIBXML_XPATH_ENABLED)
49761    int mem_base;
49762    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49763    int n_ctxt;
49764    int nargs; /* the number of arguments */
49765    int n_nargs;
49766
49767    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49768    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49769        mem_base = xmlMemBlocks();
49770        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49771        nargs = gen_int(n_nargs, 1);
49772
49773        xmlXPathRoundFunction(ctxt, nargs);
49774        call_tests++;
49775        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49776        des_int(n_nargs, nargs, 1);
49777        xmlResetLastError();
49778        if (mem_base != xmlMemBlocks()) {
49779            printf("Leak of %d blocks found in xmlXPathRoundFunction",
49780	           xmlMemBlocks() - mem_base);
49781	    test_ret++;
49782            printf(" %d", n_ctxt);
49783            printf(" %d", n_nargs);
49784            printf("\n");
49785        }
49786    }
49787    }
49788    function_tests++;
49789#endif
49790
49791    return(test_ret);
49792}
49793
49794
49795static int
49796test_xmlXPathStartsWithFunction(void) {
49797    int test_ret = 0;
49798
49799#if defined(LIBXML_XPATH_ENABLED)
49800    int mem_base;
49801    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49802    int n_ctxt;
49803    int nargs; /* the number of arguments */
49804    int n_nargs;
49805
49806    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49807    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49808        mem_base = xmlMemBlocks();
49809        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49810        nargs = gen_int(n_nargs, 1);
49811
49812        xmlXPathStartsWithFunction(ctxt, nargs);
49813        call_tests++;
49814        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49815        des_int(n_nargs, nargs, 1);
49816        xmlResetLastError();
49817        if (mem_base != xmlMemBlocks()) {
49818            printf("Leak of %d blocks found in xmlXPathStartsWithFunction",
49819	           xmlMemBlocks() - mem_base);
49820	    test_ret++;
49821            printf(" %d", n_ctxt);
49822            printf(" %d", n_nargs);
49823            printf("\n");
49824        }
49825    }
49826    }
49827    function_tests++;
49828#endif
49829
49830    return(test_ret);
49831}
49832
49833
49834static int
49835test_xmlXPathStringEvalNumber(void) {
49836    int test_ret = 0;
49837
49838#if defined(LIBXML_XPATH_ENABLED)
49839    int mem_base;
49840    double ret_val;
49841    xmlChar * str; /* A string to scan */
49842    int n_str;
49843
49844    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
49845        mem_base = xmlMemBlocks();
49846        str = gen_const_xmlChar_ptr(n_str, 0);
49847
49848        ret_val = xmlXPathStringEvalNumber((const xmlChar *)str);
49849        desret_double(ret_val);
49850        call_tests++;
49851        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
49852        xmlResetLastError();
49853        if (mem_base != xmlMemBlocks()) {
49854            printf("Leak of %d blocks found in xmlXPathStringEvalNumber",
49855	           xmlMemBlocks() - mem_base);
49856	    test_ret++;
49857            printf(" %d", n_str);
49858            printf("\n");
49859        }
49860    }
49861    function_tests++;
49862#endif
49863
49864    return(test_ret);
49865}
49866
49867
49868static int
49869test_xmlXPathStringFunction(void) {
49870    int test_ret = 0;
49871
49872#if defined(LIBXML_XPATH_ENABLED)
49873    int mem_base;
49874    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49875    int n_ctxt;
49876    int nargs; /* the number of arguments */
49877    int n_nargs;
49878
49879    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49880    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49881        mem_base = xmlMemBlocks();
49882        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49883        nargs = gen_int(n_nargs, 1);
49884
49885        xmlXPathStringFunction(ctxt, nargs);
49886        call_tests++;
49887        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49888        des_int(n_nargs, nargs, 1);
49889        xmlResetLastError();
49890        if (mem_base != xmlMemBlocks()) {
49891            printf("Leak of %d blocks found in xmlXPathStringFunction",
49892	           xmlMemBlocks() - mem_base);
49893	    test_ret++;
49894            printf(" %d", n_ctxt);
49895            printf(" %d", n_nargs);
49896            printf("\n");
49897        }
49898    }
49899    }
49900    function_tests++;
49901#endif
49902
49903    return(test_ret);
49904}
49905
49906
49907static int
49908test_xmlXPathStringLengthFunction(void) {
49909    int test_ret = 0;
49910
49911#if defined(LIBXML_XPATH_ENABLED)
49912    int mem_base;
49913    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49914    int n_ctxt;
49915    int nargs; /* the number of arguments */
49916    int n_nargs;
49917
49918    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49919    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49920        mem_base = xmlMemBlocks();
49921        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49922        nargs = gen_int(n_nargs, 1);
49923
49924        xmlXPathStringLengthFunction(ctxt, nargs);
49925        call_tests++;
49926        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49927        des_int(n_nargs, nargs, 1);
49928        xmlResetLastError();
49929        if (mem_base != xmlMemBlocks()) {
49930            printf("Leak of %d blocks found in xmlXPathStringLengthFunction",
49931	           xmlMemBlocks() - mem_base);
49932	    test_ret++;
49933            printf(" %d", n_ctxt);
49934            printf(" %d", n_nargs);
49935            printf("\n");
49936        }
49937    }
49938    }
49939    function_tests++;
49940#endif
49941
49942    return(test_ret);
49943}
49944
49945
49946static int
49947test_xmlXPathSubValues(void) {
49948    int test_ret = 0;
49949
49950#if defined(LIBXML_XPATH_ENABLED)
49951    int mem_base;
49952    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49953    int n_ctxt;
49954
49955    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49956        mem_base = xmlMemBlocks();
49957        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49958
49959        xmlXPathSubValues(ctxt);
49960        call_tests++;
49961        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49962        xmlResetLastError();
49963        if (mem_base != xmlMemBlocks()) {
49964            printf("Leak of %d blocks found in xmlXPathSubValues",
49965	           xmlMemBlocks() - mem_base);
49966	    test_ret++;
49967            printf(" %d", n_ctxt);
49968            printf("\n");
49969        }
49970    }
49971    function_tests++;
49972#endif
49973
49974    return(test_ret);
49975}
49976
49977
49978static int
49979test_xmlXPathSubstringAfterFunction(void) {
49980    int test_ret = 0;
49981
49982#if defined(LIBXML_XPATH_ENABLED)
49983    int mem_base;
49984    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
49985    int n_ctxt;
49986    int nargs; /* the number of arguments */
49987    int n_nargs;
49988
49989    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
49990    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
49991        mem_base = xmlMemBlocks();
49992        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
49993        nargs = gen_int(n_nargs, 1);
49994
49995        xmlXPathSubstringAfterFunction(ctxt, nargs);
49996        call_tests++;
49997        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
49998        des_int(n_nargs, nargs, 1);
49999        xmlResetLastError();
50000        if (mem_base != xmlMemBlocks()) {
50001            printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction",
50002	           xmlMemBlocks() - mem_base);
50003	    test_ret++;
50004            printf(" %d", n_ctxt);
50005            printf(" %d", n_nargs);
50006            printf("\n");
50007        }
50008    }
50009    }
50010    function_tests++;
50011#endif
50012
50013    return(test_ret);
50014}
50015
50016
50017static int
50018test_xmlXPathSubstringBeforeFunction(void) {
50019    int test_ret = 0;
50020
50021#if defined(LIBXML_XPATH_ENABLED)
50022    int mem_base;
50023    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50024    int n_ctxt;
50025    int nargs; /* the number of arguments */
50026    int n_nargs;
50027
50028    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50029    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50030        mem_base = xmlMemBlocks();
50031        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50032        nargs = gen_int(n_nargs, 1);
50033
50034        xmlXPathSubstringBeforeFunction(ctxt, nargs);
50035        call_tests++;
50036        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50037        des_int(n_nargs, nargs, 1);
50038        xmlResetLastError();
50039        if (mem_base != xmlMemBlocks()) {
50040            printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction",
50041	           xmlMemBlocks() - mem_base);
50042	    test_ret++;
50043            printf(" %d", n_ctxt);
50044            printf(" %d", n_nargs);
50045            printf("\n");
50046        }
50047    }
50048    }
50049    function_tests++;
50050#endif
50051
50052    return(test_ret);
50053}
50054
50055
50056static int
50057test_xmlXPathSubstringFunction(void) {
50058    int test_ret = 0;
50059
50060#if defined(LIBXML_XPATH_ENABLED)
50061    int mem_base;
50062    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50063    int n_ctxt;
50064    int nargs; /* the number of arguments */
50065    int n_nargs;
50066
50067    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50068    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50069        mem_base = xmlMemBlocks();
50070        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50071        nargs = gen_int(n_nargs, 1);
50072
50073        xmlXPathSubstringFunction(ctxt, nargs);
50074        call_tests++;
50075        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50076        des_int(n_nargs, nargs, 1);
50077        xmlResetLastError();
50078        if (mem_base != xmlMemBlocks()) {
50079            printf("Leak of %d blocks found in xmlXPathSubstringFunction",
50080	           xmlMemBlocks() - mem_base);
50081	    test_ret++;
50082            printf(" %d", n_ctxt);
50083            printf(" %d", n_nargs);
50084            printf("\n");
50085        }
50086    }
50087    }
50088    function_tests++;
50089#endif
50090
50091    return(test_ret);
50092}
50093
50094
50095static int
50096test_xmlXPathSumFunction(void) {
50097    int test_ret = 0;
50098
50099#if defined(LIBXML_XPATH_ENABLED)
50100    int mem_base;
50101    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50102    int n_ctxt;
50103    int nargs; /* the number of arguments */
50104    int n_nargs;
50105
50106    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50107    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50108        mem_base = xmlMemBlocks();
50109        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50110        nargs = gen_int(n_nargs, 1);
50111
50112        xmlXPathSumFunction(ctxt, nargs);
50113        call_tests++;
50114        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50115        des_int(n_nargs, nargs, 1);
50116        xmlResetLastError();
50117        if (mem_base != xmlMemBlocks()) {
50118            printf("Leak of %d blocks found in xmlXPathSumFunction",
50119	           xmlMemBlocks() - mem_base);
50120	    test_ret++;
50121            printf(" %d", n_ctxt);
50122            printf(" %d", n_nargs);
50123            printf("\n");
50124        }
50125    }
50126    }
50127    function_tests++;
50128#endif
50129
50130    return(test_ret);
50131}
50132
50133
50134static int
50135test_xmlXPathTrailing(void) {
50136    int test_ret = 0;
50137
50138#if defined(LIBXML_XPATH_ENABLED)
50139    int mem_base;
50140    xmlNodeSetPtr ret_val;
50141    xmlNodeSetPtr nodes1; /* a node-set */
50142    int n_nodes1;
50143    xmlNodeSetPtr nodes2; /* a node-set */
50144    int n_nodes2;
50145
50146    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50147    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50148        mem_base = xmlMemBlocks();
50149        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50150        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50151
50152        ret_val = xmlXPathTrailing(nodes1, nodes2);
50153        desret_xmlNodeSetPtr(ret_val);
50154        call_tests++;
50155        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50156        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50157        xmlResetLastError();
50158        if (mem_base != xmlMemBlocks()) {
50159            printf("Leak of %d blocks found in xmlXPathTrailing",
50160	           xmlMemBlocks() - mem_base);
50161	    test_ret++;
50162            printf(" %d", n_nodes1);
50163            printf(" %d", n_nodes2);
50164            printf("\n");
50165        }
50166    }
50167    }
50168    function_tests++;
50169#endif
50170
50171    return(test_ret);
50172}
50173
50174
50175static int
50176test_xmlXPathTrailingSorted(void) {
50177    int test_ret = 0;
50178
50179#if defined(LIBXML_XPATH_ENABLED)
50180    int mem_base;
50181    xmlNodeSetPtr ret_val;
50182    xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */
50183    int n_nodes1;
50184    xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */
50185    int n_nodes2;
50186
50187    for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) {
50188    for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) {
50189        mem_base = xmlMemBlocks();
50190        nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0);
50191        nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1);
50192
50193        ret_val = xmlXPathTrailingSorted(nodes1, nodes2);
50194        desret_xmlNodeSetPtr(ret_val);
50195        call_tests++;
50196        des_xmlNodeSetPtr(n_nodes1, nodes1, 0);
50197        des_xmlNodeSetPtr(n_nodes2, nodes2, 1);
50198        xmlResetLastError();
50199        if (mem_base != xmlMemBlocks()) {
50200            printf("Leak of %d blocks found in xmlXPathTrailingSorted",
50201	           xmlMemBlocks() - mem_base);
50202	    test_ret++;
50203            printf(" %d", n_nodes1);
50204            printf(" %d", n_nodes2);
50205            printf("\n");
50206        }
50207    }
50208    }
50209    function_tests++;
50210#endif
50211
50212    return(test_ret);
50213}
50214
50215
50216static int
50217test_xmlXPathTranslateFunction(void) {
50218    int test_ret = 0;
50219
50220#if defined(LIBXML_XPATH_ENABLED)
50221    int mem_base;
50222    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50223    int n_ctxt;
50224    int nargs; /* the number of arguments */
50225    int n_nargs;
50226
50227    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50228    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50229        mem_base = xmlMemBlocks();
50230        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50231        nargs = gen_int(n_nargs, 1);
50232
50233        xmlXPathTranslateFunction(ctxt, nargs);
50234        call_tests++;
50235        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50236        des_int(n_nargs, nargs, 1);
50237        xmlResetLastError();
50238        if (mem_base != xmlMemBlocks()) {
50239            printf("Leak of %d blocks found in xmlXPathTranslateFunction",
50240	           xmlMemBlocks() - mem_base);
50241	    test_ret++;
50242            printf(" %d", n_ctxt);
50243            printf(" %d", n_nargs);
50244            printf("\n");
50245        }
50246    }
50247    }
50248    function_tests++;
50249#endif
50250
50251    return(test_ret);
50252}
50253
50254
50255static int
50256test_xmlXPathTrueFunction(void) {
50257    int test_ret = 0;
50258
50259#if defined(LIBXML_XPATH_ENABLED)
50260    int mem_base;
50261    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50262    int n_ctxt;
50263    int nargs; /* the number of arguments */
50264    int n_nargs;
50265
50266    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50267    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
50268        mem_base = xmlMemBlocks();
50269        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50270        nargs = gen_int(n_nargs, 1);
50271
50272        xmlXPathTrueFunction(ctxt, nargs);
50273        call_tests++;
50274        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50275        des_int(n_nargs, nargs, 1);
50276        xmlResetLastError();
50277        if (mem_base != xmlMemBlocks()) {
50278            printf("Leak of %d blocks found in xmlXPathTrueFunction",
50279	           xmlMemBlocks() - mem_base);
50280	    test_ret++;
50281            printf(" %d", n_ctxt);
50282            printf(" %d", n_nargs);
50283            printf("\n");
50284        }
50285    }
50286    }
50287    function_tests++;
50288#endif
50289
50290    return(test_ret);
50291}
50292
50293
50294static int
50295test_xmlXPathValueFlipSign(void) {
50296    int test_ret = 0;
50297
50298#if defined(LIBXML_XPATH_ENABLED)
50299    int mem_base;
50300    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50301    int n_ctxt;
50302
50303    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50304        mem_base = xmlMemBlocks();
50305        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50306
50307        xmlXPathValueFlipSign(ctxt);
50308        call_tests++;
50309        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50310        xmlResetLastError();
50311        if (mem_base != xmlMemBlocks()) {
50312            printf("Leak of %d blocks found in xmlXPathValueFlipSign",
50313	           xmlMemBlocks() - mem_base);
50314	    test_ret++;
50315            printf(" %d", n_ctxt);
50316            printf("\n");
50317        }
50318    }
50319    function_tests++;
50320#endif
50321
50322    return(test_ret);
50323}
50324
50325
50326static int
50327test_xmlXPathVariableLookup(void) {
50328    int test_ret = 0;
50329
50330#if defined(LIBXML_XPATH_ENABLED)
50331    int mem_base;
50332    xmlXPathObjectPtr ret_val;
50333    xmlXPathContextPtr ctxt; /* the XPath context */
50334    int n_ctxt;
50335    xmlChar * name; /* the variable name */
50336    int n_name;
50337
50338    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50339    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50340        mem_base = xmlMemBlocks();
50341        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50342        name = gen_const_xmlChar_ptr(n_name, 1);
50343
50344        ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name);
50345        desret_xmlXPathObjectPtr(ret_val);
50346        call_tests++;
50347        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50348        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50349        xmlResetLastError();
50350        if (mem_base != xmlMemBlocks()) {
50351            printf("Leak of %d blocks found in xmlXPathVariableLookup",
50352	           xmlMemBlocks() - mem_base);
50353	    test_ret++;
50354            printf(" %d", n_ctxt);
50355            printf(" %d", n_name);
50356            printf("\n");
50357        }
50358    }
50359    }
50360    function_tests++;
50361#endif
50362
50363    return(test_ret);
50364}
50365
50366
50367static int
50368test_xmlXPathVariableLookupNS(void) {
50369    int test_ret = 0;
50370
50371#if defined(LIBXML_XPATH_ENABLED)
50372    int mem_base;
50373    xmlXPathObjectPtr ret_val;
50374    xmlXPathContextPtr ctxt; /* the XPath context */
50375    int n_ctxt;
50376    xmlChar * name; /* the variable name */
50377    int n_name;
50378    xmlChar * ns_uri; /* the variable namespace URI */
50379    int n_ns_uri;
50380
50381    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) {
50382    for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
50383    for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) {
50384        mem_base = xmlMemBlocks();
50385        ctxt = gen_xmlXPathContextPtr(n_ctxt, 0);
50386        name = gen_const_xmlChar_ptr(n_name, 1);
50387        ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2);
50388
50389        ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri);
50390        desret_xmlXPathObjectPtr(ret_val);
50391        call_tests++;
50392        des_xmlXPathContextPtr(n_ctxt, ctxt, 0);
50393        des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
50394        des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2);
50395        xmlResetLastError();
50396        if (mem_base != xmlMemBlocks()) {
50397            printf("Leak of %d blocks found in xmlXPathVariableLookupNS",
50398	           xmlMemBlocks() - mem_base);
50399	    test_ret++;
50400            printf(" %d", n_ctxt);
50401            printf(" %d", n_name);
50402            printf(" %d", n_ns_uri);
50403            printf("\n");
50404        }
50405    }
50406    }
50407    }
50408    function_tests++;
50409#endif
50410
50411    return(test_ret);
50412}
50413
50414
50415static int
50416test_xmlXPathWrapCString(void) {
50417    int test_ret = 0;
50418
50419#if defined(LIBXML_XPATH_ENABLED)
50420    int mem_base;
50421    xmlXPathObjectPtr ret_val;
50422    char * val; /* the char * value */
50423    int n_val;
50424
50425    for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) {
50426        mem_base = xmlMemBlocks();
50427        val = gen_char_ptr(n_val, 0);
50428
50429        ret_val = xmlXPathWrapCString(val);
50430        desret_xmlXPathObjectPtr(ret_val);
50431        call_tests++;
50432        des_char_ptr(n_val, val, 0);
50433        xmlResetLastError();
50434        if (mem_base != xmlMemBlocks()) {
50435            printf("Leak of %d blocks found in xmlXPathWrapCString",
50436	           xmlMemBlocks() - mem_base);
50437	    test_ret++;
50438            printf(" %d", n_val);
50439            printf("\n");
50440        }
50441    }
50442    function_tests++;
50443#endif
50444
50445    return(test_ret);
50446}
50447
50448
50449static int
50450test_xmlXPathWrapExternal(void) {
50451    int test_ret = 0;
50452
50453#if defined(LIBXML_XPATH_ENABLED)
50454    int mem_base;
50455    xmlXPathObjectPtr ret_val;
50456    void * val; /* the user data */
50457    int n_val;
50458
50459    for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) {
50460        mem_base = xmlMemBlocks();
50461        val = gen_void_ptr(n_val, 0);
50462
50463        ret_val = xmlXPathWrapExternal(val);
50464        desret_xmlXPathObjectPtr(ret_val);
50465        call_tests++;
50466        des_void_ptr(n_val, val, 0);
50467        xmlResetLastError();
50468        if (mem_base != xmlMemBlocks()) {
50469            printf("Leak of %d blocks found in xmlXPathWrapExternal",
50470	           xmlMemBlocks() - mem_base);
50471	    test_ret++;
50472            printf(" %d", n_val);
50473            printf("\n");
50474        }
50475    }
50476    function_tests++;
50477#endif
50478
50479    return(test_ret);
50480}
50481
50482
50483static int
50484test_xmlXPathWrapNodeSet(void) {
50485    int test_ret = 0;
50486
50487#if defined(LIBXML_XPATH_ENABLED)
50488    int mem_base;
50489    xmlXPathObjectPtr ret_val;
50490    xmlNodeSetPtr val; /* the NodePtr value */
50491    int n_val;
50492
50493    for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) {
50494        mem_base = xmlMemBlocks();
50495        val = gen_xmlNodeSetPtr(n_val, 0);
50496
50497        ret_val = xmlXPathWrapNodeSet(val);
50498        desret_xmlXPathObjectPtr(ret_val);
50499        call_tests++;
50500        des_xmlNodeSetPtr(n_val, val, 0);
50501        xmlResetLastError();
50502        if (mem_base != xmlMemBlocks()) {
50503            printf("Leak of %d blocks found in xmlXPathWrapNodeSet",
50504	           xmlMemBlocks() - mem_base);
50505	    test_ret++;
50506            printf(" %d", n_val);
50507            printf("\n");
50508        }
50509    }
50510    function_tests++;
50511#endif
50512
50513    return(test_ret);
50514}
50515
50516
50517static int
50518test_xmlXPatherror(void) {
50519    int test_ret = 0;
50520
50521#if defined(LIBXML_XPATH_ENABLED)
50522    int mem_base;
50523    xmlXPathParserContextPtr ctxt; /* the XPath Parser context */
50524    int n_ctxt;
50525    const char * file; /* the file name */
50526    int n_file;
50527    int line; /* the line number */
50528    int n_line;
50529    int no; /* the error number */
50530    int n_no;
50531
50532    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50533    for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
50534    for (n_line = 0;n_line < gen_nb_int;n_line++) {
50535    for (n_no = 0;n_no < gen_nb_int;n_no++) {
50536        mem_base = xmlMemBlocks();
50537        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50538        file = gen_filepath(n_file, 1);
50539        line = gen_int(n_line, 2);
50540        no = gen_int(n_no, 3);
50541
50542        xmlXPatherror(ctxt, file, line, no);
50543        call_tests++;
50544        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50545        des_filepath(n_file, file, 1);
50546        des_int(n_line, line, 2);
50547        des_int(n_no, no, 3);
50548        xmlResetLastError();
50549        if (mem_base != xmlMemBlocks()) {
50550            printf("Leak of %d blocks found in xmlXPatherror",
50551	           xmlMemBlocks() - mem_base);
50552	    test_ret++;
50553            printf(" %d", n_ctxt);
50554            printf(" %d", n_file);
50555            printf(" %d", n_line);
50556            printf(" %d", n_no);
50557            printf("\n");
50558        }
50559    }
50560    }
50561    }
50562    }
50563    function_tests++;
50564#endif
50565
50566    return(test_ret);
50567}
50568
50569static int
50570test_xpathInternals(void) {
50571    int test_ret = 0;
50572
50573    if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n");
50574    test_ret += test_valuePop();
50575    test_ret += test_valuePush();
50576    test_ret += test_xmlXPathAddValues();
50577    test_ret += test_xmlXPathBooleanFunction();
50578    test_ret += test_xmlXPathCeilingFunction();
50579    test_ret += test_xmlXPathCompareValues();
50580    test_ret += test_xmlXPathConcatFunction();
50581    test_ret += test_xmlXPathContainsFunction();
50582    test_ret += test_xmlXPathCountFunction();
50583    test_ret += test_xmlXPathDebugDumpCompExpr();
50584    test_ret += test_xmlXPathDebugDumpObject();
50585    test_ret += test_xmlXPathDifference();
50586    test_ret += test_xmlXPathDistinct();
50587    test_ret += test_xmlXPathDistinctSorted();
50588    test_ret += test_xmlXPathDivValues();
50589    test_ret += test_xmlXPathEqualValues();
50590    test_ret += test_xmlXPathErr();
50591    test_ret += test_xmlXPathEvalExpr();
50592    test_ret += test_xmlXPathEvaluatePredicateResult();
50593    test_ret += test_xmlXPathFalseFunction();
50594    test_ret += test_xmlXPathFloorFunction();
50595    test_ret += test_xmlXPathFunctionLookup();
50596    test_ret += test_xmlXPathFunctionLookupNS();
50597    test_ret += test_xmlXPathHasSameNodes();
50598    test_ret += test_xmlXPathIdFunction();
50599    test_ret += test_xmlXPathIntersection();
50600    test_ret += test_xmlXPathIsNodeType();
50601    test_ret += test_xmlXPathLangFunction();
50602    test_ret += test_xmlXPathLastFunction();
50603    test_ret += test_xmlXPathLeading();
50604    test_ret += test_xmlXPathLeadingSorted();
50605    test_ret += test_xmlXPathLocalNameFunction();
50606    test_ret += test_xmlXPathModValues();
50607    test_ret += test_xmlXPathMultValues();
50608    test_ret += test_xmlXPathNamespaceURIFunction();
50609    test_ret += test_xmlXPathNewBoolean();
50610    test_ret += test_xmlXPathNewCString();
50611    test_ret += test_xmlXPathNewFloat();
50612    test_ret += test_xmlXPathNewNodeSet();
50613    test_ret += test_xmlXPathNewNodeSetList();
50614    test_ret += test_xmlXPathNewParserContext();
50615    test_ret += test_xmlXPathNewString();
50616    test_ret += test_xmlXPathNextAncestor();
50617    test_ret += test_xmlXPathNextAncestorOrSelf();
50618    test_ret += test_xmlXPathNextAttribute();
50619    test_ret += test_xmlXPathNextChild();
50620    test_ret += test_xmlXPathNextDescendant();
50621    test_ret += test_xmlXPathNextDescendantOrSelf();
50622    test_ret += test_xmlXPathNextFollowing();
50623    test_ret += test_xmlXPathNextFollowingSibling();
50624    test_ret += test_xmlXPathNextNamespace();
50625    test_ret += test_xmlXPathNextParent();
50626    test_ret += test_xmlXPathNextPreceding();
50627    test_ret += test_xmlXPathNextPrecedingSibling();
50628    test_ret += test_xmlXPathNextSelf();
50629    test_ret += test_xmlXPathNodeLeading();
50630    test_ret += test_xmlXPathNodeLeadingSorted();
50631    test_ret += test_xmlXPathNodeSetAdd();
50632    test_ret += test_xmlXPathNodeSetAddNs();
50633    test_ret += test_xmlXPathNodeSetAddUnique();
50634    test_ret += test_xmlXPathNodeSetContains();
50635    test_ret += test_xmlXPathNodeSetDel();
50636    test_ret += test_xmlXPathNodeSetMerge();
50637    test_ret += test_xmlXPathNodeSetRemove();
50638    test_ret += test_xmlXPathNodeSetSort();
50639    test_ret += test_xmlXPathNodeTrailing();
50640    test_ret += test_xmlXPathNodeTrailingSorted();
50641    test_ret += test_xmlXPathNormalizeFunction();
50642    test_ret += test_xmlXPathNotEqualValues();
50643    test_ret += test_xmlXPathNotFunction();
50644    test_ret += test_xmlXPathNsLookup();
50645    test_ret += test_xmlXPathNumberFunction();
50646    test_ret += test_xmlXPathParseNCName();
50647    test_ret += test_xmlXPathParseName();
50648    test_ret += test_xmlXPathPopBoolean();
50649    test_ret += test_xmlXPathPopExternal();
50650    test_ret += test_xmlXPathPopNodeSet();
50651    test_ret += test_xmlXPathPopNumber();
50652    test_ret += test_xmlXPathPopString();
50653    test_ret += test_xmlXPathPositionFunction();
50654    test_ret += test_xmlXPathRegisterAllFunctions();
50655    test_ret += test_xmlXPathRegisterFunc();
50656    test_ret += test_xmlXPathRegisterFuncLookup();
50657    test_ret += test_xmlXPathRegisterFuncNS();
50658    test_ret += test_xmlXPathRegisterNs();
50659    test_ret += test_xmlXPathRegisterVariable();
50660    test_ret += test_xmlXPathRegisterVariableLookup();
50661    test_ret += test_xmlXPathRegisterVariableNS();
50662    test_ret += test_xmlXPathRegisteredFuncsCleanup();
50663    test_ret += test_xmlXPathRegisteredNsCleanup();
50664    test_ret += test_xmlXPathRegisteredVariablesCleanup();
50665    test_ret += test_xmlXPathRoot();
50666    test_ret += test_xmlXPathRoundFunction();
50667    test_ret += test_xmlXPathStartsWithFunction();
50668    test_ret += test_xmlXPathStringEvalNumber();
50669    test_ret += test_xmlXPathStringFunction();
50670    test_ret += test_xmlXPathStringLengthFunction();
50671    test_ret += test_xmlXPathSubValues();
50672    test_ret += test_xmlXPathSubstringAfterFunction();
50673    test_ret += test_xmlXPathSubstringBeforeFunction();
50674    test_ret += test_xmlXPathSubstringFunction();
50675    test_ret += test_xmlXPathSumFunction();
50676    test_ret += test_xmlXPathTrailing();
50677    test_ret += test_xmlXPathTrailingSorted();
50678    test_ret += test_xmlXPathTranslateFunction();
50679    test_ret += test_xmlXPathTrueFunction();
50680    test_ret += test_xmlXPathValueFlipSign();
50681    test_ret += test_xmlXPathVariableLookup();
50682    test_ret += test_xmlXPathVariableLookupNS();
50683    test_ret += test_xmlXPathWrapCString();
50684    test_ret += test_xmlXPathWrapExternal();
50685    test_ret += test_xmlXPathWrapNodeSet();
50686    test_ret += test_xmlXPatherror();
50687
50688    if (test_ret != 0)
50689	printf("Module xpathInternals: %d errors\n", test_ret);
50690    return(test_ret);
50691}
50692
50693static int
50694test_xmlXPtrBuildNodeList(void) {
50695    int test_ret = 0;
50696
50697#if defined(LIBXML_XPTR_ENABLED)
50698    int mem_base;
50699    xmlNodePtr ret_val;
50700    xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */
50701    int n_obj;
50702
50703    for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) {
50704        mem_base = xmlMemBlocks();
50705        obj = gen_xmlXPathObjectPtr(n_obj, 0);
50706
50707        ret_val = xmlXPtrBuildNodeList(obj);
50708        desret_xmlNodePtr(ret_val);
50709        call_tests++;
50710        des_xmlXPathObjectPtr(n_obj, obj, 0);
50711        xmlResetLastError();
50712        if (mem_base != xmlMemBlocks()) {
50713            printf("Leak of %d blocks found in xmlXPtrBuildNodeList",
50714	           xmlMemBlocks() - mem_base);
50715	    test_ret++;
50716            printf(" %d", n_obj);
50717            printf("\n");
50718        }
50719    }
50720    function_tests++;
50721#endif
50722
50723    return(test_ret);
50724}
50725
50726
50727static int
50728test_xmlXPtrEval(void) {
50729    int test_ret = 0;
50730
50731#if defined(LIBXML_XPTR_ENABLED)
50732    int mem_base;
50733    xmlXPathObjectPtr ret_val;
50734    xmlChar * str; /* the XPointer expression */
50735    int n_str;
50736    xmlXPathContextPtr ctx; /* the XPointer context */
50737    int n_ctx;
50738
50739    for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) {
50740    for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) {
50741        mem_base = xmlMemBlocks();
50742        str = gen_const_xmlChar_ptr(n_str, 0);
50743        ctx = gen_xmlXPathContextPtr(n_ctx, 1);
50744
50745        ret_val = xmlXPtrEval((const xmlChar *)str, ctx);
50746        desret_xmlXPathObjectPtr(ret_val);
50747        call_tests++;
50748        des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0);
50749        des_xmlXPathContextPtr(n_ctx, ctx, 1);
50750        xmlResetLastError();
50751        if (mem_base != xmlMemBlocks()) {
50752            printf("Leak of %d blocks found in xmlXPtrEval",
50753	           xmlMemBlocks() - mem_base);
50754	    test_ret++;
50755            printf(" %d", n_str);
50756            printf(" %d", n_ctx);
50757            printf("\n");
50758        }
50759    }
50760    }
50761    function_tests++;
50762#endif
50763
50764    return(test_ret);
50765}
50766
50767
50768static int
50769test_xmlXPtrEvalRangePredicate(void) {
50770    int test_ret = 0;
50771
50772#if defined(LIBXML_XPTR_ENABLED)
50773    int mem_base;
50774    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
50775    int n_ctxt;
50776
50777    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
50778        mem_base = xmlMemBlocks();
50779        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
50780
50781        xmlXPtrEvalRangePredicate(ctxt);
50782        call_tests++;
50783        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
50784        xmlResetLastError();
50785        if (mem_base != xmlMemBlocks()) {
50786            printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate",
50787	           xmlMemBlocks() - mem_base);
50788	    test_ret++;
50789            printf(" %d", n_ctxt);
50790            printf("\n");
50791        }
50792    }
50793    function_tests++;
50794#endif
50795
50796    return(test_ret);
50797}
50798
50799#ifdef LIBXML_XPTR_ENABLED
50800
50801#define gen_nb_xmlLocationSetPtr 1
50802static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50803    return(NULL);
50804}
50805static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
50806}
50807#endif
50808
50809
50810static int
50811test_xmlXPtrLocationSetAdd(void) {
50812    int test_ret = 0;
50813
50814#if defined(LIBXML_XPTR_ENABLED)
50815    int mem_base;
50816    xmlLocationSetPtr cur; /* the initial range set */
50817    int n_cur;
50818    xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */
50819    int n_val;
50820
50821    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50822    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50823        mem_base = xmlMemBlocks();
50824        cur = gen_xmlLocationSetPtr(n_cur, 0);
50825        val = gen_xmlXPathObjectPtr(n_val, 1);
50826
50827        xmlXPtrLocationSetAdd(cur, val);
50828        call_tests++;
50829        des_xmlLocationSetPtr(n_cur, cur, 0);
50830        des_xmlXPathObjectPtr(n_val, val, 1);
50831        xmlResetLastError();
50832        if (mem_base != xmlMemBlocks()) {
50833            printf("Leak of %d blocks found in xmlXPtrLocationSetAdd",
50834	           xmlMemBlocks() - mem_base);
50835	    test_ret++;
50836            printf(" %d", n_cur);
50837            printf(" %d", n_val);
50838            printf("\n");
50839        }
50840    }
50841    }
50842    function_tests++;
50843#endif
50844
50845    return(test_ret);
50846}
50847
50848
50849static int
50850test_xmlXPtrLocationSetCreate(void) {
50851    int test_ret = 0;
50852
50853
50854    /* missing type support */
50855    return(test_ret);
50856}
50857
50858
50859static int
50860test_xmlXPtrLocationSetDel(void) {
50861    int test_ret = 0;
50862
50863#if defined(LIBXML_XPTR_ENABLED)
50864    int mem_base;
50865    xmlLocationSetPtr cur; /* the initial range set */
50866    int n_cur;
50867    xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */
50868    int n_val;
50869
50870    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50871    for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) {
50872        mem_base = xmlMemBlocks();
50873        cur = gen_xmlLocationSetPtr(n_cur, 0);
50874        val = gen_xmlXPathObjectPtr(n_val, 1);
50875
50876        xmlXPtrLocationSetDel(cur, val);
50877        call_tests++;
50878        des_xmlLocationSetPtr(n_cur, cur, 0);
50879        des_xmlXPathObjectPtr(n_val, val, 1);
50880        xmlResetLastError();
50881        if (mem_base != xmlMemBlocks()) {
50882            printf("Leak of %d blocks found in xmlXPtrLocationSetDel",
50883	           xmlMemBlocks() - mem_base);
50884	    test_ret++;
50885            printf(" %d", n_cur);
50886            printf(" %d", n_val);
50887            printf("\n");
50888        }
50889    }
50890    }
50891    function_tests++;
50892#endif
50893
50894    return(test_ret);
50895}
50896
50897
50898static int
50899test_xmlXPtrLocationSetMerge(void) {
50900    int test_ret = 0;
50901
50902
50903    /* missing type support */
50904    return(test_ret);
50905}
50906
50907
50908static int
50909test_xmlXPtrLocationSetRemove(void) {
50910    int test_ret = 0;
50911
50912#if defined(LIBXML_XPTR_ENABLED)
50913    int mem_base;
50914    xmlLocationSetPtr cur; /* the initial range set */
50915    int n_cur;
50916    int val; /* the index to remove */
50917    int n_val;
50918
50919    for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) {
50920    for (n_val = 0;n_val < gen_nb_int;n_val++) {
50921        mem_base = xmlMemBlocks();
50922        cur = gen_xmlLocationSetPtr(n_cur, 0);
50923        val = gen_int(n_val, 1);
50924
50925        xmlXPtrLocationSetRemove(cur, val);
50926        call_tests++;
50927        des_xmlLocationSetPtr(n_cur, cur, 0);
50928        des_int(n_val, val, 1);
50929        xmlResetLastError();
50930        if (mem_base != xmlMemBlocks()) {
50931            printf("Leak of %d blocks found in xmlXPtrLocationSetRemove",
50932	           xmlMemBlocks() - mem_base);
50933	    test_ret++;
50934            printf(" %d", n_cur);
50935            printf(" %d", n_val);
50936            printf("\n");
50937        }
50938    }
50939    }
50940    function_tests++;
50941#endif
50942
50943    return(test_ret);
50944}
50945
50946
50947static int
50948test_xmlXPtrNewCollapsedRange(void) {
50949    int test_ret = 0;
50950
50951#if defined(LIBXML_XPTR_ENABLED)
50952    int mem_base;
50953    xmlXPathObjectPtr ret_val;
50954    xmlNodePtr start; /* the starting and ending node */
50955    int n_start;
50956
50957    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
50958        mem_base = xmlMemBlocks();
50959        start = gen_xmlNodePtr(n_start, 0);
50960
50961        ret_val = xmlXPtrNewCollapsedRange(start);
50962        desret_xmlXPathObjectPtr(ret_val);
50963        call_tests++;
50964        des_xmlNodePtr(n_start, start, 0);
50965        xmlResetLastError();
50966        if (mem_base != xmlMemBlocks()) {
50967            printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange",
50968	           xmlMemBlocks() - mem_base);
50969	    test_ret++;
50970            printf(" %d", n_start);
50971            printf("\n");
50972        }
50973    }
50974    function_tests++;
50975#endif
50976
50977    return(test_ret);
50978}
50979
50980
50981static int
50982test_xmlXPtrNewContext(void) {
50983    int test_ret = 0;
50984
50985
50986    /* missing type support */
50987    return(test_ret);
50988}
50989
50990
50991static int
50992test_xmlXPtrNewLocationSetNodeSet(void) {
50993    int test_ret = 0;
50994
50995#if defined(LIBXML_XPTR_ENABLED)
50996    int mem_base;
50997    xmlXPathObjectPtr ret_val;
50998    xmlNodeSetPtr set; /* a node set */
50999    int n_set;
51000
51001    for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) {
51002        mem_base = xmlMemBlocks();
51003        set = gen_xmlNodeSetPtr(n_set, 0);
51004
51005        ret_val = xmlXPtrNewLocationSetNodeSet(set);
51006        desret_xmlXPathObjectPtr(ret_val);
51007        call_tests++;
51008        des_xmlNodeSetPtr(n_set, set, 0);
51009        xmlResetLastError();
51010        if (mem_base != xmlMemBlocks()) {
51011            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet",
51012	           xmlMemBlocks() - mem_base);
51013	    test_ret++;
51014            printf(" %d", n_set);
51015            printf("\n");
51016        }
51017    }
51018    function_tests++;
51019#endif
51020
51021    return(test_ret);
51022}
51023
51024
51025static int
51026test_xmlXPtrNewLocationSetNodes(void) {
51027    int test_ret = 0;
51028
51029#if defined(LIBXML_XPTR_ENABLED)
51030    int mem_base;
51031    xmlXPathObjectPtr ret_val;
51032    xmlNodePtr start; /* the start NodePtr value */
51033    int n_start;
51034    xmlNodePtr end; /* the end NodePtr value or NULL */
51035    int n_end;
51036
51037    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51038    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51039        mem_base = xmlMemBlocks();
51040        start = gen_xmlNodePtr(n_start, 0);
51041        end = gen_xmlNodePtr(n_end, 1);
51042
51043        ret_val = xmlXPtrNewLocationSetNodes(start, end);
51044        desret_xmlXPathObjectPtr(ret_val);
51045        call_tests++;
51046        des_xmlNodePtr(n_start, start, 0);
51047        des_xmlNodePtr(n_end, end, 1);
51048        xmlResetLastError();
51049        if (mem_base != xmlMemBlocks()) {
51050            printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes",
51051	           xmlMemBlocks() - mem_base);
51052	    test_ret++;
51053            printf(" %d", n_start);
51054            printf(" %d", n_end);
51055            printf("\n");
51056        }
51057    }
51058    }
51059    function_tests++;
51060#endif
51061
51062    return(test_ret);
51063}
51064
51065
51066static int
51067test_xmlXPtrNewRange(void) {
51068    int test_ret = 0;
51069
51070#if defined(LIBXML_XPTR_ENABLED)
51071    int mem_base;
51072    xmlXPathObjectPtr ret_val;
51073    xmlNodePtr start; /* the starting node */
51074    int n_start;
51075    int startindex; /* the start index */
51076    int n_startindex;
51077    xmlNodePtr end; /* the ending point */
51078    int n_end;
51079    int endindex; /* the ending index */
51080    int n_endindex;
51081
51082    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51083    for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) {
51084    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51085    for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) {
51086        mem_base = xmlMemBlocks();
51087        start = gen_xmlNodePtr(n_start, 0);
51088        startindex = gen_int(n_startindex, 1);
51089        end = gen_xmlNodePtr(n_end, 2);
51090        endindex = gen_int(n_endindex, 3);
51091
51092        ret_val = xmlXPtrNewRange(start, startindex, end, endindex);
51093        desret_xmlXPathObjectPtr(ret_val);
51094        call_tests++;
51095        des_xmlNodePtr(n_start, start, 0);
51096        des_int(n_startindex, startindex, 1);
51097        des_xmlNodePtr(n_end, end, 2);
51098        des_int(n_endindex, endindex, 3);
51099        xmlResetLastError();
51100        if (mem_base != xmlMemBlocks()) {
51101            printf("Leak of %d blocks found in xmlXPtrNewRange",
51102	           xmlMemBlocks() - mem_base);
51103	    test_ret++;
51104            printf(" %d", n_start);
51105            printf(" %d", n_startindex);
51106            printf(" %d", n_end);
51107            printf(" %d", n_endindex);
51108            printf("\n");
51109        }
51110    }
51111    }
51112    }
51113    }
51114    function_tests++;
51115#endif
51116
51117    return(test_ret);
51118}
51119
51120
51121static int
51122test_xmlXPtrNewRangeNodeObject(void) {
51123    int test_ret = 0;
51124
51125#if defined(LIBXML_XPTR_ENABLED)
51126    int mem_base;
51127    xmlXPathObjectPtr ret_val;
51128    xmlNodePtr start; /* the starting node */
51129    int n_start;
51130    xmlXPathObjectPtr end; /* the ending object */
51131    int n_end;
51132
51133    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51134    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51135        mem_base = xmlMemBlocks();
51136        start = gen_xmlNodePtr(n_start, 0);
51137        end = gen_xmlXPathObjectPtr(n_end, 1);
51138
51139        ret_val = xmlXPtrNewRangeNodeObject(start, end);
51140        desret_xmlXPathObjectPtr(ret_val);
51141        call_tests++;
51142        des_xmlNodePtr(n_start, start, 0);
51143        des_xmlXPathObjectPtr(n_end, end, 1);
51144        xmlResetLastError();
51145        if (mem_base != xmlMemBlocks()) {
51146            printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject",
51147	           xmlMemBlocks() - mem_base);
51148	    test_ret++;
51149            printf(" %d", n_start);
51150            printf(" %d", n_end);
51151            printf("\n");
51152        }
51153    }
51154    }
51155    function_tests++;
51156#endif
51157
51158    return(test_ret);
51159}
51160
51161
51162static int
51163test_xmlXPtrNewRangeNodePoint(void) {
51164    int test_ret = 0;
51165
51166#if defined(LIBXML_XPTR_ENABLED)
51167    int mem_base;
51168    xmlXPathObjectPtr ret_val;
51169    xmlNodePtr start; /* the starting node */
51170    int n_start;
51171    xmlXPathObjectPtr end; /* the ending point */
51172    int n_end;
51173
51174    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51175    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51176        mem_base = xmlMemBlocks();
51177        start = gen_xmlNodePtr(n_start, 0);
51178        end = gen_xmlXPathObjectPtr(n_end, 1);
51179
51180        ret_val = xmlXPtrNewRangeNodePoint(start, end);
51181        desret_xmlXPathObjectPtr(ret_val);
51182        call_tests++;
51183        des_xmlNodePtr(n_start, start, 0);
51184        des_xmlXPathObjectPtr(n_end, end, 1);
51185        xmlResetLastError();
51186        if (mem_base != xmlMemBlocks()) {
51187            printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint",
51188	           xmlMemBlocks() - mem_base);
51189	    test_ret++;
51190            printf(" %d", n_start);
51191            printf(" %d", n_end);
51192            printf("\n");
51193        }
51194    }
51195    }
51196    function_tests++;
51197#endif
51198
51199    return(test_ret);
51200}
51201
51202
51203static int
51204test_xmlXPtrNewRangeNodes(void) {
51205    int test_ret = 0;
51206
51207#if defined(LIBXML_XPTR_ENABLED)
51208    int mem_base;
51209    xmlXPathObjectPtr ret_val;
51210    xmlNodePtr start; /* the starting node */
51211    int n_start;
51212    xmlNodePtr end; /* the ending node */
51213    int n_end;
51214
51215    for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) {
51216    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51217        mem_base = xmlMemBlocks();
51218        start = gen_xmlNodePtr(n_start, 0);
51219        end = gen_xmlNodePtr(n_end, 1);
51220
51221        ret_val = xmlXPtrNewRangeNodes(start, end);
51222        desret_xmlXPathObjectPtr(ret_val);
51223        call_tests++;
51224        des_xmlNodePtr(n_start, start, 0);
51225        des_xmlNodePtr(n_end, end, 1);
51226        xmlResetLastError();
51227        if (mem_base != xmlMemBlocks()) {
51228            printf("Leak of %d blocks found in xmlXPtrNewRangeNodes",
51229	           xmlMemBlocks() - mem_base);
51230	    test_ret++;
51231            printf(" %d", n_start);
51232            printf(" %d", n_end);
51233            printf("\n");
51234        }
51235    }
51236    }
51237    function_tests++;
51238#endif
51239
51240    return(test_ret);
51241}
51242
51243
51244static int
51245test_xmlXPtrNewRangePointNode(void) {
51246    int test_ret = 0;
51247
51248#if defined(LIBXML_XPTR_ENABLED)
51249    int mem_base;
51250    xmlXPathObjectPtr ret_val;
51251    xmlXPathObjectPtr start; /* the starting point */
51252    int n_start;
51253    xmlNodePtr end; /* the ending node */
51254    int n_end;
51255
51256    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51257    for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) {
51258        mem_base = xmlMemBlocks();
51259        start = gen_xmlXPathObjectPtr(n_start, 0);
51260        end = gen_xmlNodePtr(n_end, 1);
51261
51262        ret_val = xmlXPtrNewRangePointNode(start, end);
51263        desret_xmlXPathObjectPtr(ret_val);
51264        call_tests++;
51265        des_xmlXPathObjectPtr(n_start, start, 0);
51266        des_xmlNodePtr(n_end, end, 1);
51267        xmlResetLastError();
51268        if (mem_base != xmlMemBlocks()) {
51269            printf("Leak of %d blocks found in xmlXPtrNewRangePointNode",
51270	           xmlMemBlocks() - mem_base);
51271	    test_ret++;
51272            printf(" %d", n_start);
51273            printf(" %d", n_end);
51274            printf("\n");
51275        }
51276    }
51277    }
51278    function_tests++;
51279#endif
51280
51281    return(test_ret);
51282}
51283
51284
51285static int
51286test_xmlXPtrNewRangePoints(void) {
51287    int test_ret = 0;
51288
51289#if defined(LIBXML_XPTR_ENABLED)
51290    int mem_base;
51291    xmlXPathObjectPtr ret_val;
51292    xmlXPathObjectPtr start; /* the starting point */
51293    int n_start;
51294    xmlXPathObjectPtr end; /* the ending point */
51295    int n_end;
51296
51297    for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) {
51298    for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) {
51299        mem_base = xmlMemBlocks();
51300        start = gen_xmlXPathObjectPtr(n_start, 0);
51301        end = gen_xmlXPathObjectPtr(n_end, 1);
51302
51303        ret_val = xmlXPtrNewRangePoints(start, end);
51304        desret_xmlXPathObjectPtr(ret_val);
51305        call_tests++;
51306        des_xmlXPathObjectPtr(n_start, start, 0);
51307        des_xmlXPathObjectPtr(n_end, end, 1);
51308        xmlResetLastError();
51309        if (mem_base != xmlMemBlocks()) {
51310            printf("Leak of %d blocks found in xmlXPtrNewRangePoints",
51311	           xmlMemBlocks() - mem_base);
51312	    test_ret++;
51313            printf(" %d", n_start);
51314            printf(" %d", n_end);
51315            printf("\n");
51316        }
51317    }
51318    }
51319    function_tests++;
51320#endif
51321
51322    return(test_ret);
51323}
51324
51325
51326static int
51327test_xmlXPtrRangeToFunction(void) {
51328    int test_ret = 0;
51329
51330#if defined(LIBXML_XPTR_ENABLED)
51331    int mem_base;
51332    xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */
51333    int n_ctxt;
51334    int nargs; /* the number of args */
51335    int n_nargs;
51336
51337    for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) {
51338    for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) {
51339        mem_base = xmlMemBlocks();
51340        ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0);
51341        nargs = gen_int(n_nargs, 1);
51342
51343        xmlXPtrRangeToFunction(ctxt, nargs);
51344        call_tests++;
51345        des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0);
51346        des_int(n_nargs, nargs, 1);
51347        xmlResetLastError();
51348        if (mem_base != xmlMemBlocks()) {
51349            printf("Leak of %d blocks found in xmlXPtrRangeToFunction",
51350	           xmlMemBlocks() - mem_base);
51351	    test_ret++;
51352            printf(" %d", n_ctxt);
51353            printf(" %d", n_nargs);
51354            printf("\n");
51355        }
51356    }
51357    }
51358    function_tests++;
51359#endif
51360
51361    return(test_ret);
51362}
51363
51364
51365static int
51366test_xmlXPtrWrapLocationSet(void) {
51367    int test_ret = 0;
51368
51369#if defined(LIBXML_XPTR_ENABLED)
51370    int mem_base;
51371    xmlXPathObjectPtr ret_val;
51372    xmlLocationSetPtr val; /* the LocationSet value */
51373    int n_val;
51374
51375    for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) {
51376        mem_base = xmlMemBlocks();
51377        val = gen_xmlLocationSetPtr(n_val, 0);
51378
51379        ret_val = xmlXPtrWrapLocationSet(val);
51380        desret_xmlXPathObjectPtr(ret_val);
51381        call_tests++;
51382        des_xmlLocationSetPtr(n_val, val, 0);
51383        xmlResetLastError();
51384        if (mem_base != xmlMemBlocks()) {
51385            printf("Leak of %d blocks found in xmlXPtrWrapLocationSet",
51386	           xmlMemBlocks() - mem_base);
51387	    test_ret++;
51388            printf(" %d", n_val);
51389            printf("\n");
51390        }
51391    }
51392    function_tests++;
51393#endif
51394
51395    return(test_ret);
51396}
51397
51398static int
51399test_xpointer(void) {
51400    int test_ret = 0;
51401
51402    if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n");
51403    test_ret += test_xmlXPtrBuildNodeList();
51404    test_ret += test_xmlXPtrEval();
51405    test_ret += test_xmlXPtrEvalRangePredicate();
51406    test_ret += test_xmlXPtrLocationSetAdd();
51407    test_ret += test_xmlXPtrLocationSetCreate();
51408    test_ret += test_xmlXPtrLocationSetDel();
51409    test_ret += test_xmlXPtrLocationSetMerge();
51410    test_ret += test_xmlXPtrLocationSetRemove();
51411    test_ret += test_xmlXPtrNewCollapsedRange();
51412    test_ret += test_xmlXPtrNewContext();
51413    test_ret += test_xmlXPtrNewLocationSetNodeSet();
51414    test_ret += test_xmlXPtrNewLocationSetNodes();
51415    test_ret += test_xmlXPtrNewRange();
51416    test_ret += test_xmlXPtrNewRangeNodeObject();
51417    test_ret += test_xmlXPtrNewRangeNodePoint();
51418    test_ret += test_xmlXPtrNewRangeNodes();
51419    test_ret += test_xmlXPtrNewRangePointNode();
51420    test_ret += test_xmlXPtrNewRangePoints();
51421    test_ret += test_xmlXPtrRangeToFunction();
51422    test_ret += test_xmlXPtrWrapLocationSet();
51423
51424    if (test_ret != 0)
51425	printf("Module xpointer: %d errors\n", test_ret);
51426    return(test_ret);
51427}
51428static int
51429test_module(const char *module) {
51430    if (!strcmp(module, "HTMLparser")) return(test_HTMLparser());
51431    if (!strcmp(module, "HTMLtree")) return(test_HTMLtree());
51432    if (!strcmp(module, "SAX2")) return(test_SAX2());
51433    if (!strcmp(module, "c14n")) return(test_c14n());
51434    if (!strcmp(module, "catalog")) return(test_catalog());
51435    if (!strcmp(module, "chvalid")) return(test_chvalid());
51436    if (!strcmp(module, "debugXML")) return(test_debugXML());
51437    if (!strcmp(module, "dict")) return(test_dict());
51438    if (!strcmp(module, "encoding")) return(test_encoding());
51439    if (!strcmp(module, "entities")) return(test_entities());
51440    if (!strcmp(module, "hash")) return(test_hash());
51441    if (!strcmp(module, "list")) return(test_list());
51442    if (!strcmp(module, "nanoftp")) return(test_nanoftp());
51443    if (!strcmp(module, "nanohttp")) return(test_nanohttp());
51444    if (!strcmp(module, "parser")) return(test_parser());
51445    if (!strcmp(module, "parserInternals")) return(test_parserInternals());
51446    if (!strcmp(module, "pattern")) return(test_pattern());
51447    if (!strcmp(module, "relaxng")) return(test_relaxng());
51448    if (!strcmp(module, "schemasInternals")) return(test_schemasInternals());
51449    if (!strcmp(module, "schematron")) return(test_schematron());
51450    if (!strcmp(module, "tree")) return(test_tree());
51451    if (!strcmp(module, "uri")) return(test_uri());
51452    if (!strcmp(module, "valid")) return(test_valid());
51453    if (!strcmp(module, "xinclude")) return(test_xinclude());
51454    if (!strcmp(module, "xmlIO")) return(test_xmlIO());
51455    if (!strcmp(module, "xmlautomata")) return(test_xmlautomata());
51456    if (!strcmp(module, "xmlerror")) return(test_xmlerror());
51457    if (!strcmp(module, "xmlmodule")) return(test_xmlmodule());
51458    if (!strcmp(module, "xmlreader")) return(test_xmlreader());
51459    if (!strcmp(module, "xmlregexp")) return(test_xmlregexp());
51460    if (!strcmp(module, "xmlsave")) return(test_xmlsave());
51461    if (!strcmp(module, "xmlschemas")) return(test_xmlschemas());
51462    if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes());
51463    if (!strcmp(module, "xmlstring")) return(test_xmlstring());
51464    if (!strcmp(module, "xmlunicode")) return(test_xmlunicode());
51465    if (!strcmp(module, "xmlwriter")) return(test_xmlwriter());
51466    if (!strcmp(module, "xpath")) return(test_xpath());
51467    if (!strcmp(module, "xpathInternals")) return(test_xpathInternals());
51468    if (!strcmp(module, "xpointer")) return(test_xpointer());
51469    return(0);
51470}
51471